From 41a85b71fc6934c589d505e48e7bf3aeb5e1a642 Mon Sep 17 00:00:00 2001 From: Sabas Date: Wed, 22 Jan 2020 20:30:33 -0600 Subject: [PATCH 001/919] init nfc copy --- ports/atmel-samd/boards/nfc_copy/board.c | 38 ++++++++++++++ .../boards/nfc_copy/mpconfigboard.h | 50 +++++++++++++++++++ .../boards/nfc_copy/mpconfigboard.mk | 11 ++++ ports/atmel-samd/boards/nfc_copy/pins.c | 21 ++++++++ 4 files changed, 120 insertions(+) create mode 100644 ports/atmel-samd/boards/nfc_copy/board.c create mode 100644 ports/atmel-samd/boards/nfc_copy/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/nfc_copy/pins.c diff --git a/ports/atmel-samd/boards/nfc_copy/board.c b/ports/atmel-samd/boards/nfc_copy/board.c new file mode 100644 index 0000000000..c8e20206a1 --- /dev/null +++ b/ports/atmel-samd/boards/nfc_copy/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.h b/ports/atmel-samd/boards/nfc_copy/mpconfigboard.h new file mode 100644 index 0000000000..126b2119f5 --- /dev/null +++ b/ports/atmel-samd/boards/nfc_copy/mpconfigboard.h @@ -0,0 +1,50 @@ +#define MICROPY_HW_BOARD_NAME "Electronic Cats NFC Copy Cat" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +// No microcontroller.nvm +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA08) +#define DEFAULT_I2C_BUS_SDA (&pin_PA09) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA17) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA16) +#define DEFAULT_SPI_BUS_MISO (&pin_PA19) + +#define DEFAULT_UART_BUS_RX (&pin_PA01) +#define DEFAULT_UART_BUS_TX (&pin_PA00) + +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +// USB is always used. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 diff --git a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk b/ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk new file mode 100644 index 0000000000..582c584d8c --- /dev/null +++ b/ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x1209 +USB_PID = 0xBAB8 +USB_PRODUCT = "NFC Copy Cat" +USB_MANUFACTURER = "Electronic Cats" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 diff --git a/ports/atmel-samd/boards/nfc_copy/pins.c b/ports/atmel-samd/boards/nfc_copy/pins.c new file mode 100644 index 0000000000..46a7ed3c93 --- /dev/null +++ b/ports/atmel-samd/boards/nfc_copy/pins.c @@ -0,0 +1,21 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA02) }, // IRQ + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, // IN_A + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, // IN_B + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, // LED + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA11) }, // LED + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) }, // LED + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PA27) }, // Switch + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_PA28) }, // Switch + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA18) }, // CS + { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 3c50098dfc353b0f30f3a743d45dce9de95e060a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 6 Feb 2020 15:17:42 -0500 Subject: [PATCH 002/919] add stm32f4 to docs --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index e327d6ec6a..ab26366c2e 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -26,7 +26,7 @@ import os import re -SUPPORTED_PORTS = ["atmel-samd", "nrf", "mimxrt10xx"] +SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm32f4", "mimxrt10xx"] def parse_port_config(contents, chip_keyword=None): From 86fd93bd03d937713d4d23fa38ab359034c503c2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 25 Feb 2020 12:13:08 -0800 Subject: [PATCH 003/919] Support importing native modules in native packages. This only fixes the `import` portion. It doesn't actually change reference behavior because modules within a package could already be referenced through the parent package even though an error should have been thrown. --- py/builtinimport.c | 30 ++++++++++++++++++++---------- py/gc_long_lived.c | 4 +++- py/objmodule.c | 7 +++++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/py/builtinimport.c b/py/builtinimport.c index 6ed0a75940..9edda18b3e 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -400,21 +400,31 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { DEBUG_printf("Current path: %.*s\n", vstr_len(&path), vstr_str(&path)); if (stat == MP_IMPORT_STAT_NO_EXIST) { - #if MICROPY_MODULE_WEAK_LINKS - // check if there is a weak link to this module - if (i == mod_len) { - mp_map_elem_t *el = mp_map_lookup((mp_map_t*)&mp_builtin_module_weak_links_map, MP_OBJ_NEW_QSTR(mod_name), MP_MAP_LOOKUP); + // This is just the module name after the previous . + qstr current_module_name = qstr_from_strn(mod_str + last, i - last); + mp_map_elem_t *el = NULL; + if (outer_module_obj == MP_OBJ_NULL) { + el = mp_map_lookup((mp_map_t*)&mp_builtin_module_map, + MP_OBJ_NEW_QSTR(current_module_name), + MP_MAP_LOOKUP); + #if MICROPY_MODULE_WEAK_LINKS + // check if there is a weak link to this module if (el == NULL) { - goto no_exist; + el = mp_map_lookup((mp_map_t*)&mp_builtin_module_weak_links_map, + MP_OBJ_NEW_QSTR(current_module_name), + MP_MAP_LOOKUP); } - // found weak linked module + #endif + } else { + el = mp_map_lookup(&((mp_obj_module_t*) outer_module_obj)->globals->map, + MP_OBJ_NEW_QSTR(current_module_name), + MP_MAP_LOOKUP); + } + + if (el != NULL) { module_obj = el->value; mp_module_call_init(mod_name, module_obj); } else { - no_exist: - #else - { - #endif // couldn't find the file, so fail if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_raise_ImportError(translate("module not found")); diff --git a/py/gc_long_lived.c b/py/gc_long_lived.c index 01c22a7af7..a2b5d88e01 100755 --- a/py/gc_long_lived.c +++ b/py/gc_long_lived.c @@ -85,11 +85,13 @@ mp_obj_property_t *make_property_long_lived(mp_obj_property_t *prop, uint8_t max return gc_make_long_lived(prop); } +extern const mp_obj_dict_t mcu_module_globals; + mp_obj_dict_t *make_dict_long_lived(mp_obj_dict_t *dict, uint8_t max_depth) { #ifndef MICROPY_ENABLE_GC return dict; #endif - if (dict == NULL || max_depth == 0 || dict == &MP_STATE_VM(dict_main)) { + if (dict == NULL || max_depth == 0 || dict == &MP_STATE_VM(dict_main) || dict->map.is_fixed) { return dict; } // Don't recurse unnecessarily. Return immediately if we've already seen this dict. diff --git a/py/objmodule.c b/py/objmodule.c index 627ba79e8a..c8b3a67a29 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -69,6 +69,13 @@ STATIC void module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { // delete/store attribute mp_obj_dict_t *dict = self->globals; if (dict->map.is_fixed) { + mp_map_elem_t *elem = mp_map_lookup(&dict->map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP); + // Return success if the given value is already in the dictionary. This is the case for + // native packages with native submodules. + if (elem != NULL && elem->value == dest[1]) { + dest[0] = MP_OBJ_NULL; // indicate success + return; + } else #if MICROPY_CAN_OVERRIDE_BUILTINS if (dict == &mp_module_builtins_globals) { if (MP_STATE_VM(mp_module_builtins_override_dict) == NULL) { From 6375d8699e84ffab0754af58c311bf869ad648ab Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 26 Feb 2020 10:32:02 -0800 Subject: [PATCH 004/919] Validate builtin member is a module --- py/builtinimport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/builtinimport.c b/py/builtinimport.c index 9edda18b3e..2be779c6c0 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -421,7 +421,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { MP_MAP_LOOKUP); } - if (el != NULL) { + if (el != NULL && MP_OBJ_IS_TYPE(el->value, &mp_type_module)) { module_obj = el->value; mp_module_call_init(mod_name, module_obj); } else { From 41e71485af4f708c865e7878fe6f8f8aff61d175 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Feb 2020 09:41:22 -0600 Subject: [PATCH 005/919] libm: Disable float-equal diagnostics I choose to believe these authors knew what they were doing. --- lib/libm/erf_lgamma.c | 1 + lib/libm/log1pf.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/libm/erf_lgamma.c b/lib/libm/erf_lgamma.c index 877816a0c2..fcb1d0a0c6 100644 --- a/lib/libm/erf_lgamma.c +++ b/lib/libm/erf_lgamma.c @@ -24,6 +24,7 @@ */ #include "fdlibm.h" +#pragma GCC diagnostic ignored "-Wfloat-equal" #define __ieee754_logf logf diff --git a/lib/libm/log1pf.c b/lib/libm/log1pf.c index 0d32b0a2fe..89ed250b08 100644 --- a/lib/libm/log1pf.c +++ b/lib/libm/log1pf.c @@ -18,6 +18,8 @@ #include "libm.h" +#pragma GCC diagnostic ignored "-Wfloat-equal" + static const float ln2_hi = 6.9313812256e-01, /* 0x3f317180 */ ln2_lo = 9.0580006145e-06, /* 0x3717f7d1 */ From 50438b51aa0af3f6453f334d3868f0a87eb94a89 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Feb 2020 09:41:44 -0600 Subject: [PATCH 006/919] libm: Provide log2f --- lib/libm/math.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libm/math.c b/lib/libm/math.c index 39c6a68a5e..0e53563bcb 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -50,6 +50,9 @@ float copysignf(float x, float y) { static const float _M_LN10 = 2.30258509299404; // 0x40135d8e float log10f(float x) { return logf(x) / (float)_M_LN10; } +#undef _M_LN2 +static const float _M_LN2 = 0.6931472; +float log2f(float x) { return logf(x) / (float)_M_LN2; } float tanhf(float x) { if (isinf(x)) { From 4c710cf13b2977eeeb9f2b0506761adaf1feac53 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 14 Feb 2020 09:34:44 -0600 Subject: [PATCH 007/919] unix port: add help(), help('modules') --- ports/unix/mpconfigport.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index e0f9d99957..3ac7ceaf21 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -323,3 +323,6 @@ void mp_unix_mark_exec(void); // For debugging purposes, make printf() available to any source file. #include #endif + +#define MICROPY_PY_BUILTINS_HELP (1) +#define MICROPY_PY_BUILTINS_HELP_MODULES (1) From fa3b9eba926525751d0968aef88317ce5ad25003 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 4 Feb 2020 10:24:37 -0600 Subject: [PATCH 008/919] ulab: Incorporate it --- .gitmodules | 3 + extmod/ulab | 1 + locale/ID.po | 209 +++++++- locale/circuitpython.pot | 209 +++++++- locale/de_DE.po | 209 +++++++- locale/en_US.po | 209 +++++++- locale/en_x_pirate.po | 209 +++++++- locale/es.po | 209 +++++++- locale/fil.po | 209 +++++++- locale/fr.po | 209 +++++++- locale/it_IT.po | 209 +++++++- locale/ko.po | 209 +++++++- locale/pl.po | 209 +++++++- locale/pt_BR.po | 209 +++++++- locale/zh_Latn_pinyin.po | 209 +++++++- .../boards/kicksat-sprite/mpconfigboard.mk | 2 + ports/atmel-samd/mpconfigport.mk | 6 + ports/nrf/mpconfigport.mk | 1 + ports/unix/mpconfigport.mk | 2 + py/builtin.h | 7 + py/circuitpy_defns.mk | 13 + py/circuitpy_mpconfig.h | 6 + py/mpconfig.h | 4 + py/objmodule.c | 8 + py/py.mk | 15 + shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/ulab/__init__.rst | 459 ++++++++++++++++++ tests/run-tests | 2 +- tests/ulab/smoke.py | 84 ++++ tests/ulab/smoke.py.exp | 0 30 files changed, 3304 insertions(+), 28 deletions(-) create mode 160000 extmod/ulab create mode 100644 shared-bindings/ulab/__init__.rst create mode 100644 tests/ulab/smoke.py create mode 100644 tests/ulab/smoke.py.exp diff --git a/.gitmodules b/.gitmodules index 88d46f69df..a8748efbe5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -114,3 +114,6 @@ [submodule "frozen/Adafruit_CircuitPython_Register"] path = frozen/Adafruit_CircuitPython_Register url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git +[submodule "extmod/ulab"] + path = extmod/ulab + url = https://github.com/adafruit/circuitpython-ulab diff --git a/extmod/ulab b/extmod/ulab new file mode 160000 index 0000000000..6b9ea24b2e --- /dev/null +++ b/extmod/ulab @@ -0,0 +1 @@ +Subproject commit 6b9ea24b2e57e200d9e2e0f41f6836b1fd73c348 diff --git a/locale/ID.po b/locale/ID.po index 01f461392f..07d2241040 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -684,6 +684,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1133,6 +1137,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1593,6 +1598,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1606,6 +1615,10 @@ msgstr "argumen num/types tidak cocok" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1614,6 +1627,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mode compile buruk" @@ -1857,6 +1882,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "tidak dapat melakukan relative import" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1913,6 +1942,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1938,6 +1991,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1951,6 +2008,10 @@ msgstr "" msgid "empty heap" msgstr "heap kosong" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -2017,6 +2078,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2025,6 +2090,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "bit pertama(firstbit) harus berupa MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2041,6 +2114,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "fungsi tidak dapat mengambil argumen keyword" @@ -2117,6 +2194,10 @@ msgstr "" msgid "incorrect padding" msgstr "lapisan (padding) tidak benar" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2127,10 +2208,46 @@ msgstr "index keluar dari jangkauan" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2209,6 +2326,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2265,6 +2390,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2288,6 +2417,10 @@ msgstr "" msgid "module not found" msgstr "modul tidak ditemukan" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "perkalian *x dalam assignment" @@ -2312,6 +2445,10 @@ msgstr "harus menentukan semua pin sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2398,6 +2535,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2457,6 +2602,14 @@ msgstr "modul tidak ditemukan" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2466,6 +2619,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2541,6 +2710,10 @@ msgstr "" msgid "queue overflow" msgstr "antrian meluap (overflow)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relative import" @@ -2558,6 +2731,10 @@ msgstr "anotasi return harus sebuah identifier" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2580,6 +2757,10 @@ msgstr "" msgid "script compilation not supported" msgstr "kompilasi script tidak didukung" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2592,6 +2773,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2608,6 +2793,10 @@ msgstr "" msgid "soft reboot\n" msgstr "memulai ulang software(soft reboot)\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2698,12 +2887,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2834,6 +3027,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2842,6 +3043,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 354dbc4ba4..9f6fee54f1 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -673,6 +673,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1121,6 +1125,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1570,6 +1575,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1583,6 +1592,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1591,6 +1604,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1833,6 +1858,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1889,6 +1918,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1914,6 +1967,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1927,6 +1984,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1993,6 +2054,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2001,6 +2066,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2017,6 +2090,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2093,6 +2170,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2103,10 +2184,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2185,6 +2302,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2241,6 +2366,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2264,6 +2393,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2288,6 +2421,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2374,6 +2511,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2432,6 +2577,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2441,6 +2594,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2516,6 +2685,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2533,6 +2706,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2555,6 +2732,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2567,6 +2748,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2583,6 +2768,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2672,12 +2861,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2808,6 +3001,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2816,6 +3017,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 056f56d749..43d1bb624a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -677,6 +677,10 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Kommando nicht gesendet." @@ -1136,6 +1140,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1598,6 +1603,10 @@ msgstr "adresses ist leer" msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "Argument hat falschen Typ" @@ -1611,6 +1620,10 @@ msgstr "Anzahl/Type der Argumente passen nicht" msgid "argument should be a '%q' not a '%q'" msgstr "Argument sollte '%q' sein, nicht '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" @@ -1619,6 +1632,18 @@ msgstr "Array/Bytes auf der rechten Seite erforderlich" msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1861,6 +1886,10 @@ msgstr "Name %q kann nicht importiert werden" msgid "cannot perform relative import" msgstr "kann keinen relativen Import durchführen" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1918,6 +1947,30 @@ msgstr "constant muss ein integer sein" msgid "conversion to object" msgstr "Umwandlung zu Objekt" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "Dezimalzahlen nicht unterstützt" @@ -1943,6 +1996,10 @@ msgstr "destination_length muss ein int >= 0 sein" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1956,6 +2013,10 @@ msgstr "leer" msgid "empty heap" msgstr "leerer heap" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "leeres Trennzeichen" @@ -2022,6 +2083,10 @@ msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" msgid "filesystem must provide mount method" msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" @@ -2030,6 +2095,14 @@ msgstr "Das erste Argument für super() muss type sein" msgid "firstbit must be MSB" msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float zu groß" @@ -2046,6 +2119,10 @@ msgstr "" msgid "full" msgstr "voll" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "Funktion akzeptiert keine Keyword-Argumente" @@ -2123,6 +2200,10 @@ msgstr "unvollständiger Formatschlüssel" msgid "incorrect padding" msgstr "padding ist inkorrekt" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2133,10 +2214,46 @@ msgstr "index außerhalb der Reichweite" msgid "indices must be integers" msgstr "Indizes müssen ganze Zahlen sein" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 muss >= 2 und <= 36 sein" @@ -2215,6 +2332,14 @@ msgstr "issubclass() arg 1 muss eine Klasse sein" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2277,6 +2402,10 @@ msgstr "map buffer zu klein" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2300,6 +2429,10 @@ msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" msgid "module not found" msgstr "Modul nicht gefunden" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "mehrere *x in Zuordnung" @@ -2324,6 +2457,10 @@ msgstr "sck/mosi/miso müssen alle spezifiziert sein" msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "Name '%q' ist nirgends definiert worden (Schreibweise kontrollieren)" @@ -2410,6 +2547,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2468,6 +2613,14 @@ msgstr "offset außerhalb der Grenzen" msgid "only bit_depth=16 is supported" msgstr "nur eine bit_depth=16 wird unterstützt" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "nur eine sample_rate=16000 wird unterstützt" @@ -2477,6 +2630,22 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord erwartet ein Zeichen" @@ -2554,6 +2723,10 @@ msgstr "" msgid "queue overflow" msgstr "Warteschlangenüberlauf" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relativer Import" @@ -2571,6 +2744,10 @@ msgstr "return annotation muss ein identifier sein" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2595,6 +2772,10 @@ msgstr "Der schedule stack ist voll" msgid "script compilation not supported" msgstr "kompilieren von Skripten nicht unterstützt" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2607,6 +2788,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2623,6 +2808,10 @@ msgstr "small int Überlauf" msgid "soft reboot\n" msgstr "weicher reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -2713,12 +2902,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2853,6 +3046,14 @@ msgstr "value_count muss größer als 0 sein" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -2861,6 +3062,10 @@ msgstr "falsche Anzahl an Argumenten" msgid "wrong number of values to unpack" msgstr "falsche Anzahl zu entpackender Werte" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x Wert außerhalb der Grenzen" diff --git a/locale/en_US.po b/locale/en_US.po index 58c798ce4b..58b9d4df2d 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -673,6 +673,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1121,6 +1125,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1570,6 +1575,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1583,6 +1592,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1591,6 +1604,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1833,6 +1858,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1889,6 +1918,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1914,6 +1967,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1927,6 +1984,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1993,6 +2054,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2001,6 +2066,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2017,6 +2090,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2093,6 +2170,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2103,10 +2184,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2185,6 +2302,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2241,6 +2366,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2264,6 +2393,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2288,6 +2421,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2374,6 +2511,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2432,6 +2577,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2441,6 +2594,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2516,6 +2685,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2533,6 +2706,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2555,6 +2732,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2567,6 +2748,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2583,6 +2768,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2672,12 +2861,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2808,6 +3001,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2816,6 +3017,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e2ee9c887d..9fd5ff4fe1 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -677,6 +677,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1125,6 +1129,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1574,6 +1579,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1587,6 +1596,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1595,6 +1608,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1837,6 +1862,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1893,6 +1922,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1918,6 +1971,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1931,6 +1988,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1997,6 +2058,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2005,6 +2070,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2021,6 +2094,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2097,6 +2174,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2107,10 +2188,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2189,6 +2306,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2245,6 +2370,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2268,6 +2397,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2292,6 +2425,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2378,6 +2515,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2436,6 +2581,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2445,6 +2598,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2520,6 +2689,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2537,6 +2710,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2559,6 +2736,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2571,6 +2752,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2587,6 +2772,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2676,12 +2865,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2812,6 +3005,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2820,6 +3021,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/es.po b/locale/es.po index 8d445a469a..ebd2a1e935 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -679,6 +679,10 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fallo enviando comando" @@ -1135,6 +1139,7 @@ msgstr "" "PWM frecuencia no esta escrito cuando el variable_frequency es falso en " "construcion" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1594,6 +1599,10 @@ msgstr "addresses esta vacío" msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" @@ -1607,6 +1616,10 @@ msgstr "argumento número/tipos no coinciden" msgid "argument should be a '%q' not a '%q'" msgstr "argumento deberia ser un '%q' no un '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" @@ -1615,6 +1628,18 @@ msgstr "array/bytes requeridos en el lado derecho" msgid "attributes not supported yet" msgstr "atributos aún no soportados" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "modo de compilación erroneo" @@ -1862,6 +1887,10 @@ msgstr "no se puede importar name '%q'" msgid "cannot perform relative import" msgstr "no se puedo realizar importación relativa" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1918,6 +1947,30 @@ msgstr "constant debe ser un entero" msgid "conversion to object" msgstr "conversión a objeto" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "números decimales no soportados" @@ -1945,6 +1998,10 @@ msgstr "destination_length debe ser un int >= 0" msgid "dict update sequence has wrong length" msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1958,6 +2015,10 @@ msgstr "vacío" msgid "empty heap" msgstr "heap vacío" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "separator vacío" @@ -2024,6 +2085,10 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" @@ -2032,6 +2097,14 @@ msgstr "primer argumento para super() debe ser de tipo" msgid "firstbit must be MSB" msgstr "firstbit debe ser MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2048,6 +2121,10 @@ msgstr "format requiere un dict" msgid "full" msgstr "lleno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la función no tiene argumentos por palabra clave" @@ -2124,6 +2201,10 @@ msgstr "" msgid "incorrect padding" msgstr "relleno (padding) incorrecto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2134,10 +2215,46 @@ msgstr "index fuera de rango" msgid "indices must be integers" msgstr "indices deben ser enteros" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 debe ser >= 2 y <= 36" @@ -2216,6 +2333,14 @@ msgstr "issubclass() arg 1 debe ser una clase" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2275,6 +2400,10 @@ msgstr "map buffer muy pequeño" msgid "math domain error" msgstr "error de dominio matemático" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2298,6 +2427,10 @@ msgstr "la asignación de memoria falló, el heap está bloqueado" msgid "module not found" msgstr "módulo no encontrado" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "múltiples *x en la asignación" @@ -2322,6 +2455,10 @@ msgstr "se deben de especificar sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' no esta definido" @@ -2411,6 +2548,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2470,6 +2615,14 @@ msgstr "address fuera de límites" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2479,6 +2632,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord espera un carácter" @@ -2554,6 +2723,10 @@ msgstr "pow() con 3 argumentos requiere enteros" msgid "queue overflow" msgstr "desbordamiento de cola(queue)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "import relativo" @@ -2571,6 +2744,10 @@ msgstr "la anotación de retorno debe ser un identificador" msgid "return expected '%q' but got '%q'" msgstr "retorno esperado '%q' pero se obtuvo '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2595,6 +2772,10 @@ msgstr "" msgid "script compilation not supported" msgstr "script de compilación no soportado" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "signo no permitido en el espeficador de string format" @@ -2607,6 +2788,10 @@ msgstr "signo no permitido con el especificador integer format 'c'" msgid "single '}' encountered in format string" msgstr "un solo '}' encontrado en format string" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la longitud de sleep no puede ser negativa" @@ -2623,6 +2808,10 @@ msgstr "pequeño int desbordamiento" msgid "soft reboot\n" msgstr "reinicio suave\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -2713,12 +2902,16 @@ msgstr "timestamp fuera de rango para plataform time_t" msgid "too many arguments provided with the given format" msgstr "demasiados argumentos provistos con el formato dado" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "demasiados valores para descomprimir (%d esperado)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -2849,6 +3042,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -2857,6 +3058,10 @@ msgstr "numero erroneo de argumentos" msgid "wrong number of values to unpack" msgstr "numero erroneo de valores a descomprimir" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fil.po b/locale/fil.po index b8b61d723b..e358c9eb81 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -687,6 +687,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1141,6 +1145,7 @@ msgid "" msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1603,6 +1608,10 @@ msgstr "walang laman ang address" msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "may maling type ang argument" @@ -1616,6 +1625,10 @@ msgstr "hindi tugma ang argument num/types" msgid "argument should be a '%q' not a '%q'" msgstr "argument ay dapat na '%q' hindi '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" @@ -1624,6 +1637,18 @@ msgstr "array/bytes kinakailangan sa kanang bahagi" msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "masamang mode ng compile" @@ -1873,6 +1898,10 @@ msgstr "hindi ma-import ang name %q" msgid "cannot perform relative import" msgstr "hindi maaring isagawa ang relative import" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "casting" @@ -1929,6 +1958,30 @@ msgstr "constant ay dapat na integer" msgid "conversion to object" msgstr "kombersyon to object" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimal numbers hindi sinusuportahan" @@ -1958,6 +2011,10 @@ msgstr "ang destination_length ay dapat na isang int >= 0" msgid "dict update sequence has wrong length" msgstr "may mali sa haba ng dict update sequence" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1971,6 +2028,10 @@ msgstr "walang laman" msgid "empty heap" msgstr "walang laman ang heap" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "walang laman na separator" @@ -2038,6 +2099,10 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" @@ -2046,6 +2111,14 @@ msgstr "unang argument ng super() ay dapat type" msgid "firstbit must be MSB" msgstr "firstbit ay dapat MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "masyadong malaki ang float" @@ -2062,6 +2135,10 @@ msgstr "kailangan ng format ng dict" msgid "full" msgstr "puno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword" @@ -2139,6 +2216,10 @@ msgstr "hindi kumpleto ang format key" msgid "incorrect padding" msgstr "mali ang padding" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2149,10 +2230,46 @@ msgstr "index wala sa sakop" msgid "indices must be integers" msgstr "ang mga indeks ay dapat na integer" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 ay dapat >=2 at <= 36" @@ -2231,6 +2348,14 @@ msgstr "issubclass() arg 1 ay dapat na class" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 ay dapat na class o tuple ng classes" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2291,6 +2416,10 @@ msgstr "masyadong maliit ang buffer map" msgid "math domain error" msgstr "may pagkakamali sa math domain" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2314,6 +2443,10 @@ msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock" msgid "module not found" msgstr "module hindi nakita" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "maramihang *x sa assignment" @@ -2338,6 +2471,10 @@ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' ay hindi defined" @@ -2424,6 +2561,14 @@ msgstr "hindi lahat ng arguments na i-convert habang string formatting" msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2483,6 +2628,14 @@ msgstr "wala sa sakop ang address" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2492,6 +2645,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord umaasa ng character" @@ -2568,6 +2737,10 @@ msgstr "pow() na may 3 argumento kailangan ng integers" msgid "queue overflow" msgstr "puno na ang pila (overflow)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relative import" @@ -2585,6 +2758,10 @@ msgstr "return annotation ay dapat na identifier" msgid "return expected '%q' but got '%q'" msgstr "return umasa ng '%q' pero ang nakuha ay ‘%q’" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2609,6 +2786,10 @@ msgstr "puno na ang schedule stack" msgid "script compilation not supported" msgstr "script kompilasyon hindi supportado" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "sign hindi maaring string format specifier" @@ -2621,6 +2802,10 @@ msgstr "sign hindi maari sa integer format specifier 'c'" msgid "single '}' encountered in format string" msgstr "isang '}' nasalubong sa format string" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "sleep length ay dapat hindi negatibo" @@ -2637,6 +2822,10 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "malambot na reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -2728,12 +2917,16 @@ msgstr "wala sa sakop ng timestamp ang platform time_t" msgid "too many arguments provided with the given format" msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -2864,6 +3057,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -2872,6 +3073,10 @@ msgstr "mali ang bilang ng argumento" msgid "wrong number of values to unpack" msgstr "maling number ng value na i-unpack" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fr.po b/locale/fr.po index 625b4e91aa..cd7a533c39 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -690,6 +690,10 @@ msgstr "Tuple de longueur %d attendu, obtenu %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1155,6 +1159,7 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1620,6 +1625,10 @@ msgstr "adresses vides" msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" @@ -1633,6 +1642,10 @@ msgstr "argument num/types ne correspond pas" msgid "argument should be a '%q' not a '%q'" msgstr "l'argument devrait être un(e) '%q', pas '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" @@ -1641,6 +1654,18 @@ msgstr "tableau/octets requis à droite" msgid "attributes not supported yet" msgstr "attribut pas encore supporté" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mauvais mode de compilation" @@ -1896,6 +1921,10 @@ msgstr "ne peut pas importer le nom %q" msgid "cannot perform relative import" msgstr "ne peut pas réaliser un import relatif" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "typage" @@ -1956,6 +1985,30 @@ msgstr "constante doit être un entier" msgid "conversion to object" msgstr "conversion en objet" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "nombres décimaux non supportés" @@ -1983,6 +2036,10 @@ msgstr "destination_length doit être un entier >= 0" msgid "dict update sequence has wrong length" msgstr "la séquence de mise à jour de dict a une mauvaise longueur" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1996,6 +2053,10 @@ msgstr "vide" msgid "empty heap" msgstr "tas vide" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "séparateur vide" @@ -2063,6 +2124,10 @@ msgstr "le fichier doit être un fichier ouvert en mode 'byte'" msgid "filesystem must provide mount method" msgstr "le system de fichier doit fournir une méthode 'mount'" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" @@ -2071,6 +2136,14 @@ msgstr "le premier argument de super() doit être un type" msgid "firstbit must be MSB" msgstr "le 1er bit doit être le MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "nombre à virgule flottante trop grand" @@ -2087,6 +2160,10 @@ msgstr "le format nécessite un dict" msgid "full" msgstr "plein" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la fonction ne prend pas d'arguments nommés" @@ -2163,6 +2240,10 @@ msgstr "clé de format incomplète" msgid "incorrect padding" msgstr "espacement incorrect" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2173,10 +2254,46 @@ msgstr "index hors gamme" msgid "indices must be integers" msgstr "les indices doivent être des entiers" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "l'argument 2 de int() doit être >=2 et <=36" @@ -2256,6 +2373,14 @@ msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" "l'argument 2 de issubclass() doit être une classe ou un tuple de classes" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2315,6 +2440,10 @@ msgstr "tampon trop petit" msgid "math domain error" msgstr "erreur de domaine math" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2338,6 +2467,10 @@ msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" msgid "module not found" msgstr "module introuvable" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "*x multiple dans l'assignement" @@ -2362,6 +2495,10 @@ msgstr "sck, mosi et miso doivent tous être spécifiés" msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nom '%q' non défini" @@ -2451,6 +2588,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2510,6 +2655,14 @@ msgstr "adresse hors limites" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2519,6 +2672,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord attend un caractère" @@ -2600,6 +2769,10 @@ msgstr "pow() avec 3 arguments nécessite des entiers" msgid "queue overflow" msgstr "dépassement de file" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "import relatif" @@ -2617,6 +2790,10 @@ msgstr "l'annotation de return doit être un identifiant" msgid "return expected '%q' but got '%q'" msgstr "return attendait '%q' mais a reçu '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2641,6 +2818,10 @@ msgstr "pile de planification pleine" msgid "script compilation not supported" msgstr "compilation de script non supportée" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "signe non autorisé dans les spéc. de formats de chaînes de caractères" @@ -2653,6 +2834,10 @@ msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" msgid "single '}' encountered in format string" msgstr "'}' seule rencontrée dans une chaîne de format" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la longueur de sleep ne doit pas être négative" @@ -2669,6 +2854,10 @@ msgstr "dépassement de capacité d'un entier court" msgid "soft reboot\n" msgstr "redémarrage logiciel\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -2761,12 +2950,16 @@ msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "trop de valeur à dégrouper (%d attendues)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -2898,6 +3091,14 @@ msgstr "'value_count' doit être > 0" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -2906,6 +3107,10 @@ msgstr "mauvais nombres d'arguments" msgid "wrong number of values to unpack" msgstr "mauvais nombre de valeurs à dégrouper" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/it_IT.po b/locale/it_IT.po index 93af9bdb86..e0581b0864 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -687,6 +687,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1150,6 +1154,7 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1606,6 +1611,10 @@ msgstr "gli indirizzi sono vuoti" msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" @@ -1619,6 +1628,10 @@ msgstr "discrepanza di numero/tipo di argomenti" msgid "argument should be a '%q' not a '%q'" msgstr "l'argomento dovrebbe essere un '%q' e non un '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1627,6 +1640,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributi non ancora supportati" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1873,6 +1898,10 @@ msgstr "impossibile imporate il nome %q" msgid "cannot perform relative import" msgstr "impossibile effettuare l'importazione relativa" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "casting" @@ -1931,6 +1960,30 @@ msgstr "la costante deve essere un intero" msgid "conversion to object" msgstr "conversione in oggetto" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "numeri decimali non supportati" @@ -1959,6 +2012,10 @@ msgstr "destination_length deve essere un int >= 0" msgid "dict update sequence has wrong length" msgstr "sequanza di aggiornamento del dizionario ha la lunghezza errata" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1972,6 +2029,10 @@ msgstr "vuoto" msgid "empty heap" msgstr "heap vuoto" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "separatore vuoto" @@ -2039,6 +2100,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2047,6 +2112,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "il primo bit deve essere il più significativo (MSB)" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float troppo grande" @@ -2063,6 +2136,10 @@ msgstr "la formattazione richiede un dict" msgid "full" msgstr "pieno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la funzione non prende argomenti nominati" @@ -2140,6 +2217,10 @@ msgstr "" msgid "incorrect padding" msgstr "padding incorretto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2150,10 +2231,46 @@ msgstr "indice fuori intervallo" msgid "indices must be integers" msgstr "gli indici devono essere interi" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" @@ -2234,6 +2351,14 @@ msgstr "" "il secondo argomento di issubclass() deve essere una classe o una tupla di " "classi" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2293,6 +2418,10 @@ msgstr "map buffer troppo piccolo" msgid "math domain error" msgstr "errore di dominio matematico" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2316,6 +2445,10 @@ msgstr "allocazione di memoria fallita, l'heap è bloccato" msgid "module not found" msgstr "modulo non trovato" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "*x multipli nell'assegnamento" @@ -2340,6 +2473,10 @@ msgstr "è necessario specificare tutte le sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nome '%q'non definito" @@ -2429,6 +2566,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2488,6 +2633,14 @@ msgstr "indirizzo fuori limite" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2497,6 +2650,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord() aspetta un carattere" @@ -2575,6 +2744,10 @@ msgstr "pow() con 3 argomenti richiede interi" msgid "queue overflow" msgstr "overflow della coda" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "importazione relativa" @@ -2592,6 +2765,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "return aspettava '%q' ma ha ottenuto '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2616,6 +2793,10 @@ msgstr "" msgid "script compilation not supported" msgstr "compilazione dello scrip non suportata" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "segno non permesso nello spcificatore di formato della stringa" @@ -2628,6 +2809,10 @@ msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" msgid "single '}' encountered in format string" msgstr "'}' singolo presente nella stringa di formattazione" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la lunghezza di sleed deve essere non negativa" @@ -2644,6 +2829,10 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "soft reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2735,12 +2924,16 @@ msgstr "timestamp è fuori intervallo per il time_t della piattaforma" msgid "too many arguments provided with the given format" msgstr "troppi argomenti forniti con il formato specificato" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "troppi valori da scompattare (%d attesi)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -2871,6 +3064,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -2879,6 +3080,10 @@ msgstr "numero di argomenti errato" msgid "wrong number of values to unpack" msgstr "numero di valori da scompattare non corretto" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/ko.po b/locale/ko.po index 04ab849d43..d9efa7466b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -677,6 +677,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1125,6 +1129,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1575,6 +1580,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1588,6 +1597,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1596,6 +1609,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1838,6 +1863,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1894,6 +1923,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1919,6 +1972,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1932,6 +1989,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1998,6 +2059,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2006,6 +2071,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float이 너무 큽니다" @@ -2022,6 +2095,10 @@ msgstr "" msgid "full" msgstr "완전한(full)" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2098,6 +2175,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2108,10 +2189,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2190,6 +2307,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2246,6 +2371,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2269,6 +2398,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2293,6 +2426,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2379,6 +2516,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2437,6 +2582,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2446,6 +2599,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2521,6 +2690,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2538,6 +2711,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2560,6 +2737,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2572,6 +2753,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2588,6 +2773,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2677,12 +2866,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2813,6 +3006,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2821,6 +3022,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index d766191822..a8620dbc91 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -676,6 +676,10 @@ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1126,6 +1130,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1578,6 +1583,10 @@ msgstr "adres jest pusty" msgid "arg is an empty sequence" msgstr "arg jest puste" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argument ma zły typ" @@ -1591,6 +1600,10 @@ msgstr "zła liczba lub typ argumentów" msgid "argument should be a '%q' not a '%q'" msgstr "argument powinien być '%q' a nie '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" @@ -1599,6 +1612,18 @@ msgstr "tablica/bytes wymagane po prawej stronie" msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "zły tryb kompilacji" @@ -1841,6 +1866,10 @@ msgstr "nie można zaimportować nazwy %q" msgid "cannot perform relative import" msgstr "nie można wykonać relatywnego importu" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "rzutowanie" @@ -1897,6 +1926,30 @@ msgstr "stała musi być liczbą całkowitą" msgid "conversion to object" msgstr "konwersja do obiektu" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "liczby dziesiętne nieobsługiwane" @@ -1923,6 +1976,10 @@ msgstr "destination_length musi być nieujemną liczbą całkowitą" msgid "dict update sequence has wrong length" msgstr "sekwencja ma złą długość" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1936,6 +1993,10 @@ msgstr "puste" msgid "empty heap" msgstr "pusta sterta" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "pusty separator" @@ -2002,6 +2063,10 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" @@ -2010,6 +2075,14 @@ msgstr "pierwszy argument super() musi być typem" msgid "firstbit must be MSB" msgstr "firstbit musi być MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float zbyt wielki" @@ -2026,6 +2099,10 @@ msgstr "format wymaga słownika" msgid "full" msgstr "pełny" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "funkcja nie bierze argumentów nazwanych" @@ -2102,6 +2179,10 @@ msgstr "niepełny klucz formatu" msgid "incorrect padding" msgstr "złe wypełnienie" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2112,10 +2193,46 @@ msgstr "indeks poza zakresem" msgid "indices must be integers" msgstr "indeksy muszą być całkowite" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "argument 2 do int() busi być pomiędzy 2 a 36" @@ -2194,6 +2311,14 @@ msgstr "argument 1 dla issubclass() musi być klasą" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "argument 2 dla issubclass() musi być klasą lub krotką klas" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "join oczekuje listy str/bytes zgodnych z self" @@ -2250,6 +2375,10 @@ msgstr "bufor mapy zbyt mały" msgid "math domain error" msgstr "błąd domeny" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2273,6 +2402,10 @@ msgstr "alokacja pamięci nie powiodła się, sterta zablokowana" msgid "module not found" msgstr "brak modułu" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "wiele *x w przypisaniu" @@ -2297,6 +2430,10 @@ msgstr "sck/mosi/miso muszą być podane" msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nazwa '%q' niezdefiniowana" @@ -2383,6 +2520,14 @@ msgstr "nie wszystkie argumenty wykorzystane w formatowaniu" msgid "not enough arguments for format string" msgstr "nie dość argumentów przy formatowaniu" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2441,6 +2586,14 @@ msgstr "offset poza zakresem" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2450,6 +2603,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord oczekuje znaku" @@ -2526,6 +2695,10 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" msgid "queue overflow" msgstr "przepełnienie kolejki" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relatywny import" @@ -2543,6 +2716,10 @@ msgstr "anotacja wartości musi być identyfikatorem" msgid "return expected '%q' but got '%q'" msgstr "return oczekiwał '%q', a jest '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2566,6 +2743,10 @@ msgstr "stos planu pełen" msgid "script compilation not supported" msgstr "kompilowanie skryptów nieobsługiwane" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "znak jest niedopuszczalny w specyfikacji formatu łańcucha" @@ -2578,6 +2759,10 @@ msgstr "znak jest niedopuszczalny w specyfikacji 'c'" msgid "single '}' encountered in format string" msgstr "pojedynczy '}' w specyfikacji formatu" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "okres snu musi być nieujemny" @@ -2594,6 +2779,10 @@ msgstr "przepełnienie small int" msgid "soft reboot\n" msgstr "programowy reset\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -2683,12 +2872,16 @@ msgstr "timestamp poza zakresem dla time_t na tej platformie" msgid "too many arguments provided with the given format" msgstr "zbyt wiele argumentów podanych dla tego formatu" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -2819,6 +3012,14 @@ msgstr "value_count musi być > 0" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -2827,6 +3028,10 @@ msgstr "zła liczba argumentów" msgid "wrong number of values to unpack" msgstr "zła liczba wartości do rozpakowania" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b948003a18..ed63a1595c 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -682,6 +682,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Falha ao enviar comando." @@ -1136,6 +1140,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1588,6 +1593,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argumento tem tipo errado" @@ -1601,6 +1610,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1609,6 +1622,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "atributos ainda não suportados" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1854,6 +1879,10 @@ msgstr "não pode importar nome %q" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1910,6 +1939,30 @@ msgstr "constante deve ser um inteiro" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1935,6 +1988,10 @@ msgstr "destination_length deve ser um int >= 0" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1948,6 +2005,10 @@ msgstr "vazio" msgid "empty heap" msgstr "heap vazia" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -2015,6 +2076,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2023,6 +2088,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "firstbit devem ser MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float muito grande" @@ -2039,6 +2112,10 @@ msgstr "" msgid "full" msgstr "cheio" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "função não aceita argumentos de palavras-chave" @@ -2115,6 +2192,10 @@ msgstr "" msgid "incorrect padding" msgstr "preenchimento incorreto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2125,10 +2206,46 @@ msgstr "Índice fora do intervalo" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2207,6 +2324,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2263,6 +2388,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2286,6 +2415,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2310,6 +2443,10 @@ msgstr "deve especificar todos sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2396,6 +2533,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2454,6 +2599,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2463,6 +2616,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2538,6 +2707,10 @@ msgstr "" msgid "queue overflow" msgstr "estouro de fila" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2555,6 +2728,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2577,6 +2754,10 @@ msgstr "" msgid "script compilation not supported" msgstr "compilação de script não suportada" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2589,6 +2770,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2605,6 +2790,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2696,12 +2885,16 @@ msgstr "timestamp fora do intervalo para a plataforma time_t" msgid "too many arguments provided with the given format" msgstr "Muitos argumentos fornecidos com o formato dado" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2832,6 +3025,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2840,6 +3041,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9a9473436f..c94f4240da 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-27 11:02-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -684,6 +684,10 @@ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" msgid "Extended advertisements with scan response not supported." msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fāsòng mìnglìng shībài." @@ -1140,6 +1144,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "Shàng bù zhīchí ParallelBus" @@ -1603,6 +1608,10 @@ msgstr "dìzhǐ wèi kōng" msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" @@ -1616,6 +1625,10 @@ msgstr "cānshù biānhào/lèixíng bù pǐpèi" msgid "argument should be a '%q' not a '%q'" msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" @@ -1624,6 +1637,18 @@ msgstr "yòu cè xūyào shùzǔ/zì jié" msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "biānyì móshì cuòwù" @@ -1866,6 +1891,10 @@ msgstr "wúfǎ dǎorù míngchēng %q" msgid "cannot perform relative import" msgstr "wúfǎ zhíxíng xiāngguān dǎorù" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "tóuyǐng" @@ -1925,6 +1954,30 @@ msgstr "chángshù bìxū shì yīgè zhěngshù" msgid "conversion to object" msgstr "zhuǎnhuàn wèi duìxiàng" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "bù zhīchí xiǎoshù shù" @@ -1951,6 +2004,10 @@ msgstr "mùbiāo chángdù bìxū shì > = 0 de zhěngshù" msgid "dict update sequence has wrong length" msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1964,6 +2021,10 @@ msgstr "kòngxián" msgid "empty heap" msgstr "kōng yīn yīnxiào" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "kōng fēngé fú" @@ -2030,6 +2091,10 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" @@ -2038,6 +2103,14 @@ msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" msgid "firstbit must be MSB" msgstr "dì yī wèi bìxū shì MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "fú diǎn tài dà" @@ -2054,6 +2127,10 @@ msgstr "géshì yāoqiú yīgè yǔjù" msgid "full" msgstr "chōngfèn" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "hánshù méiyǒu guānjiàn cí cānshù" @@ -2130,6 +2207,10 @@ msgstr "géshì bù wánzhěng de mì yào" msgid "incorrect padding" msgstr "bù zhèngquè de tiánchōng" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2140,10 +2221,46 @@ msgstr "suǒyǐn chāochū fànwéi" msgid "indices must be integers" msgstr "suǒyǐn bìxū shì zhěngshù" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" +#: extmod/ulab/code/linalg.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" @@ -2222,6 +2339,14 @@ msgstr "issubclass() cānshù 1 bìxū shì yīgè lèi" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() cānshù 2 bìxū shì lèi de lèi huò yuán zǔ" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2279,6 +2404,10 @@ msgstr "dìtú huǎnchōng qū tài xiǎo" msgid "math domain error" msgstr "shùxué yù cuòwù" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2302,6 +2431,10 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" msgid "module not found" msgstr "zhǎo bù dào mókuài" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "duō gè*x zài zuòyè zhōng" @@ -2326,6 +2459,10 @@ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "míngchēng '%q' wèi dìngyì" @@ -2413,6 +2550,14 @@ msgstr "bùshì zì chuàn géshì huà guòchéng zhōng zhuǎnhuàn de suǒyǒ msgid "not enough arguments for format string" msgstr "géshì zìfú chuàn cān shǔ bùzú" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2471,6 +2616,14 @@ msgstr "piānlí biānjiè" msgid "only bit_depth=16 is supported" msgstr "Jǐn zhīchí wèi shēndù = 16" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" @@ -2480,6 +2633,22 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord yùqí zìfú" @@ -2555,6 +2724,10 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" msgid "queue overflow" msgstr "duìliè yìchū" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "xiāngduì dǎorù" @@ -2572,6 +2745,10 @@ msgstr "fǎnhuí zhùshì bìxū shì biāozhì fú" msgid "return expected '%q' but got '%q'" msgstr "fǎnhuí yùqí de '%q' dàn huòdéle '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2596,6 +2773,10 @@ msgstr "jìhuà duīzhàn yǐ mǎn" msgid "script compilation not supported" msgstr "bù zhīchí jiǎoběn biānyì" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "zìfú chuàn géshì shuōmíng fú zhōng bù yǔnxǔ shǐyòng fúhào" @@ -2608,6 +2789,10 @@ msgstr "zhěngshù géshì shuōmíng fú 'c' bù yǔnxǔ shǐyòng fúhào" msgid "single '}' encountered in format string" msgstr "zài géshì zìfú chuàn zhōng yù dào de dāngè '}'" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "shuìmián chángdù bìxū shìfēi fùshù" @@ -2624,6 +2809,10 @@ msgstr "xiǎo zhěngshù yìchū" msgid "soft reboot\n" msgstr "ruǎn chóngqǐ\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -2713,12 +2902,16 @@ msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" msgid "too many arguments provided with the given format" msgstr "tígōng jǐ dìng géshì de cānshù tài duō" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "dǎkāi tài duō zhí (yùqí %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -2849,6 +3042,14 @@ msgstr "zhí jìshù bìxū wèi > 0" msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -2857,6 +3058,10 @@ msgstr "cānshù shù cuòwù" msgid "wrong number of values to unpack" msgstr "wúfǎ jiě bāo de zhí shù" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x zhí chāochū biānjiè" diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index df1a2d8eb3..eb3c81485e 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -15,3 +15,5 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 + +MICROPY_PY_ULAB = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 354745a2c1..7565e41a4a 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -62,6 +62,12 @@ ifndef CIRCUITPY_SAMD CIRCUITPY_SAMD = 1 endif +ifndef MICROPY_PY_ULAB +ifneq ($(CIRCUITPY_SMALL_BUILD),1) +MICROPY_PY_ULAB = 1 +endif +endif + endif # samd51 INTERNAL_LIBM = 1 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 9b738d4b3a..db1b6b03ea 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -69,4 +69,5 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS +MICROPY_PY_ULAB = 1 endif diff --git a/ports/unix/mpconfigport.mk b/ports/unix/mpconfigport.mk index f0aa955c0c..4cb1804d46 100644 --- a/ports/unix/mpconfigport.mk +++ b/ports/unix/mpconfigport.mk @@ -40,3 +40,5 @@ MICROPY_PY_JNI = 0 # Avoid using system libraries, use copies bundled with MicroPython # as submodules (currently affects only libffi). MICROPY_STANDALONE = 0 + +MICROPY_PY_ULAB = 1 diff --git a/py/builtin.h b/py/builtin.h index 84b99a8a4f..6e0d5d9bef 100644 --- a/py/builtin.h +++ b/py/builtin.h @@ -117,6 +117,13 @@ extern const mp_obj_module_t mp_module_websocket; extern const mp_obj_module_t mp_module_webrepl; extern const mp_obj_module_t mp_module_framebuf; extern const mp_obj_module_t mp_module_btree; +extern const mp_obj_module_t ulab_user_cmodule; +extern mp_obj_module_t ulab_fft_module; +extern mp_obj_module_t ulab_filter_module; +extern mp_obj_module_t ulab_linalg_module; +extern mp_obj_module_t ulab_numerical_module; +extern mp_obj_module_t ulab_poly_module; + extern const char MICROPY_PY_BUILTINS_HELP_TEXT[]; diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 68fa25d8d8..92021d0d07 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -431,6 +431,19 @@ $(addprefix lib/,\ libm/atanf.c \ libm/atan2f.c \ ) +ifeq ($(MICROPY_PY_ULAB),1) +SRC_LIBM += \ +$(addprefix lib/,\ + libm/acoshf.c \ + libm/asinhf.c \ + libm/atanhf.c \ + libm/erf_lgamma.c \ + libm/log1pf.c \ + libm/sf_erf.c \ + libm/wf_lgamma.c \ + libm/wf_tgamma.c \ + ) +endif endif ifdef LD_TEMPLATE_FILE diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 53cd7b0bb6..61dd901ed5 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -578,6 +578,12 @@ extern const struct _mp_obj_module_t ustack_module; #define JSON_MODULE #endif +#if defined(MICROPY_PY_ULAB) && MICROPY_PY_ULAB +#define ULAB_MODULE \ + { MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, +#else +#define ULAB_MODULE +#endif #if MICROPY_PY_URE #define RE_MODULE { MP_ROM_QSTR(MP_QSTR_re), MP_ROM_PTR(&mp_module_ure) }, #else diff --git a/py/mpconfig.h b/py/mpconfig.h index 1512c7d3a3..8f78ade5cc 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1173,6 +1173,10 @@ typedef double mp_float_t; #define MICROPY_PY_UJSON (0) #endif +#ifndef MICROPY_PY_ULAB +#define MICROPY_PY_ULAB (0) +#endif + #ifndef MICROPY_PY_URE #define MICROPY_PY_URE (0) #endif diff --git a/py/objmodule.c b/py/objmodule.c index 627ba79e8a..c7b080300c 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -206,6 +206,14 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { { MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) }, #endif #endif +#if MICROPY_PY_ULAB +#if CIRCUITPY +// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here. +// TODO: move to shared-bindings/ +#else + { MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, +#endif +#endif #if MICROPY_PY_URE #if CIRCUITPY // CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here. diff --git a/py/py.mk b/py/py.mk index a73b47f372..01fce2447e 100644 --- a/py/py.mk +++ b/py/py.mk @@ -105,6 +105,21 @@ $(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif +ifeq ($(MICROPY_PY_ULAB),1) +SRC_MOD += $(addprefix extmod/ulab/code/, \ +filter.c \ +fft.c \ +linalg.c \ +ndarray.c \ +numerical.c \ +poly.c \ +vectorise.c \ +ulab.c \ + ) +CFLAGS_MOD += -DMICROPY_PY_ULAB=1 -DMODULE_ULAB_ENABLED=1 +$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY +endif + # External modules written in C. ifneq ($(USER_C_MODULES),) # pre-define USERMOD variables as expanded so that variables are immediate diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 87d410ea1a..96af58a4f3 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -49,7 +49,7 @@ //| first sample will be for channel 1, the second sample will be for channel two, the third for //| channel 1 and so on. //| -//| :param array buffer: An `array.array` with samples +//| :param array.array buffer: An `array.array` with samples //| :param int channel_count: The number of channels in the buffer //| :param int sample_rate: The desired playback sample rate //| diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst new file mode 100644 index 0000000000..329d28ca2b --- /dev/null +++ b/shared-bindings/ulab/__init__.rst @@ -0,0 +1,459 @@ + +:mod:`ulab` --- Manipulate numeric data similar to numpy +======================================================== + +.. module:: ulab + :synopsis: Manipulate numeric data similar to numpy + +`ulab` is a numpy-like module for micropython, meant to simplify and +speed up common mathematical operations on arrays. The primary goal was to +implement a small subset of numpy that might be useful in the context of a +microcontroller. This means low-level data processing of linear (array) and +two-dimensional (matrix) data. + +`ulab` is adapted from micropython-ulab, and the original project's +documentation can be found at +https://micropython-ulab.readthedocs.io/en/latest/ + +`ulab` is modeled after numpy, and aims to be a compatible subset where +possible. Numpy's documentation can be found at +https://docs.scipy.org/doc/numpy/index.html + +.. contents:: + +.. attribute:: __version__ + +The closest corresponding version of micropython-ulab + +ulab.array -- 1- and 2- dimensional array +----------------------------------------- + +.. class:: ulab.array(values, \*, dtype=float) + + :param sequence values: Sequence giving the initial content of the array. + :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` + + The `values` sequence can either be a sequence of numbers (in which case a + 1-dimensional array is created), or a sequence where each subsequence has + the same length (in which case a 2-dimensional array is created). + + In many cases, it is more convenient to create an array from a function + like `zeros` or `linspace`. + + `ulab.array` implements the buffer protocol, so it can be used in many + places an `array.array` can be used. + + .. attribute:: shape + + The size of the array, a tuple of length 1 or 2 + + .. attribute:: size + + The number of elements in the array + + .. attribute:: itemsize + + The number of elements in the array + + .. method:: flatten(\*, order='C') + + :param order: Whether to flatten by rows ('C') or columns ('F') + + Returns a new `ulab.array` object which is always 1 dimensional. + If order is 'C' (the default", then the data is ordered in rows; + If it is 'F', then the data is ordered in columns. "C" and "F" refer + to the typical storage organization of the C and Fortran languages. + + .. method:: sort(\*, axis=1) + + :param axis: Whether to sort elements within rows (0), columns (1), or elements (None) + + .. method:: transpose() + + Swap the rows and columns of a 2-dimensional array + + .. method:: __add__() + + Adds corresponding elements of the two arrays, or adds a number to all + elements of the array. A number must be on the right hand side. If + both arguments are arrays, their sizes must match. + + .. method:: __sub__() + + Subtracts corresponding elements of the two arrays, or subtracts a + number from all elements of the array. A number must be on the right + hand side. If both arguments are arrays, their sizes must match. + + .. method:: __mul__() + + Multiplies corresponding elements of the two arrays, or multiplies + all elements of the array by a number. A number must be on the right + hand side. If both arguments are arrays, their sizes must match. + + .. method:: __div__() + + Multiplies corresponding elements of the two arrays, or divides + all elements of the array by a number. A number must be on the right + hand side. If both arguments are arrays, their sizes must match. + + .. method:: __getitem__() + + Retrieve an element of the array. + + .. method:: __setitem__() + + Set an element of the array. + +Array type codes +---------------- +.. attribute:: int8 + + Type code for signed integers in the range -128 .. 127 inclusive, like the 'b' typecode of `array.array` + +.. attribute:: int16 + + Type code for signed integers in the range -32768 .. 32767 inclusive, like the 'h' typecode of `array.array` + +.. attribute:: float + + Type code for floating point values, like the 'f' typecode of `array.array` + +.. attribute:: uint8 + + Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array` + +.. attribute:: uint8 + + Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array` + + +Basic Array defining functions +------------------------------ +See also `ulab.linalg.eye` and `ulab.numerical.linspace` for other useful +array defining functions. + +.. method:: ones(shape, \*, dtype=float) + + .. param: shape + Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + + .. param: dtype + Type of values in the array + + Return a new array of the given shape with all elements set to 1. + +.. method:: zeros + + .. param: shape + Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + + .. param: dtype + Type of values in the array + + Return a new array of the given shape with all elements set to 0. + + +.. method:: eye(size, \*, dtype=float) + + Return a new square array of size, with the diagonal elements set to 1 + and the other elements set to 0. + + +:mod:`ulab.vector` --- Element-by-element functions +=================================================== + +.. module:: ulab.vector + +These functions can operate on numbers, 1-D arrays, or 2-D arrays by +applying the function to every element in the array. This is typically +much more efficient than expressing the same operation as a Python loop. + +.. method:: acos + + Computes the inverse cosine function + +.. method:: acosh + + Computes the inverse hyperbolic cosine function + +.. method:: asin + + Computes the inverse sine function + +.. method:: asinh + + Computes the inverse hyperbolic sine function + +.. method:: atan + + Computes the inverse tangent function + +.. method:: atanh + + Computes the inverse hyperbolic tangent function + +.. method:: ceil + + Rounds numbers up to the next whole number + +.. method:: cos + + Computes the cosine function + +.. method:: erf + + Computes the error function, which has applications in statistics + +.. method:: erfc + + Computes the complementary error function, which has applications in statistics + +.. method:: exp + + Computes the exponent function. + +.. method:: expm1 + + Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function. + +.. method:: floor + + Rounds numbers up to the next whole number + +.. method:: gamma + + Computes the gamma function + +.. method:: lgamma + + Computes the natural log of the gamma function + +.. method:: log + + Computes the natural log + +.. method:: log10 + + Computes the log base 10 + +.. method:: log2 + + Computes the log base 2 + +.. method:: sin + + Computes the sine + +.. method:: sinh + + Computes the hyperbolic sine + +.. method:: sqrt + + Computes the square root + +.. method:: tan + + Computes the tangent + +.. method:: tanh + + Computes the hyperbolic tangent + +:mod:`ulab.linalg` - Linear algebra functions +============================================= + +.. module:: ulab.linalg + +.. method:: det + + :param: m, a square matrix + :return float: The determinant of the matrix + + Computes the eigenvalues and eigenvectors of a square matrix + +.. method:: dot(m1, m2) + + :param ~ulab.array m1: a matrix + :param ~ulab.array m2: a matrix + + Computes the matrix product of two matrices + + **WARNING:** Unlike ``numpy``, this function cannot be used to compute the dot product of two vectors + +.. method:: eig(m) + + :param m: a square matrix + :return tuple (eigenvectors, eigenvaues): + + Computes the eigenvalues and eigenvectors of a square matrix + + +.. method:: eye(size, \*, dtype=float) + + :param int: size - The number of rows and colums in the matrix + + Returns a square matrix with all the diagonal elements set to 1 and all + other elements set to 0 + +.. method:: inv(m) + + :param ~ulab.array m: a square matrix + :return: The inverse of the matrix, if it exists + :raises ValueError: if the matrix is not invertible + + Computes the inverse of a square matrix + +.. method:: size(array) + + Return the total number of elements in the array, as an integer. + +:mod:`ulab.filter` --- Filtering functions +========================================== + +.. module:: ulab.filter + +.. method:: convolve(r, c=None) + + :param ulab.array a: + :param ulab.array v: + + Returns the discrete, linear convolution of two one-dimensional sequences. + The result is always an array of float. Only the ``full`` mode is supported, + and the ``mode`` named parameter of numpy is not accepted. Note that all other + modes can be had by slicing a ``full`` result. + + Convolution filters can implement high pass, low pass, band pass, etc., + filtering operations. Convolution filters are typically constructed ahead + of time. This can be done using desktop python with scipy, or on web pages + such as https://fiiir.com/ + + Convolution is most time-efficient when both inputs are of float type. + +:mod:`ulab.fft` --- Frequency-domain functions +============================================== + +.. module:: ulab.fft + +.. method:: fft(r, c=None) + + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value + :return tuple (r, c): The real and complex parts of the FFT + + Perform a Fast Fourier Transform from the time domain into the frequency domain + +.. method:: ifft(r, c=None) + + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value + :return tuple (r, c): The real and complex parts of the inverse FFT + + Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain + +.. method:: spectrum(r): + + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + + Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. + +:mod:`ulab.numerical` --- Numerical and Statistical functions +============================================================= + +.. module:: ulab.numerical + +Most of these functions take an "axis" argument, which indicates whether to +operate over the flattened array (None), rows (0), or columns (1). + +.. method:: argmax(array, \*, axis=None) + + Return the index of the maximum element of the 1D array, as an array with 1 element + +.. method:: argmin(array, \*, axis=None) + + Return the index of the minimum element of the 1D array, as an array with 1 element + +.. method:: argsort(array, \*, axis=None) + + Returns an array which gives indices into the input array from least to greatest. + +.. method:: diff(array, \*, axis=1) + + Return the numerical derivative of successive elements of the array, as + an array. axis=None is not supported. + +.. method:: flip(array, \*, axis=None) + + Returns a new array that reverses the order of the elements along the + given axis, or along all axes if axis is None. + +.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True) + + .. param: start + + First value in the array + + .. param: stop + + Final value in the array + + .. param int: num + + Count of values in the array + + .. param: dtype + + Type of values in the array + + .. param bool: endpoint + + Whether the ``stop`` value is included. Note that even when + endpoint=True, the exact ``stop`` value may not be included due to the + inaccuracy of floating point arithmetic. + + Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly. + +.. method:: max(array, \*, axis=None) + + Return the maximum element of the 1D array, as an array with 1 element + +.. method:: mean(array, \*, axis=None) + + Return the mean element of the 1D array, as a number if axis is None, otherwise as an array. + +.. method:: min(array, \*, axis=None) + + Return the minimum element of the 1D array, as an array with 1 element + +.. method:: roll(array, distance, \*, axis=None) + + Shift the content of a vector by the positions given as the second + argument. If the ``axis`` keyword is supplied, the shift is applied to + the given axis. The array is modified in place. + +.. method:: std(array, \*, axis=None) + + Return the standard deviation of the array, as a number if axis is None, otherwise as an array. + +.. method:: sum(array, \*, axis=None) + + Return the sum of the array, as a number if axis is None, otherwise as an array. + +.. method:: sort(array, \*, axis=0) + + Sort the array along the given axis, or along all axes if axis is None. + The array is modified in place. + +:mod:`ulab.poly` --- Polynomial functions +========================================= + +.. module:: ulab.poly + +.. method:: polyfit([x, ] y, degree) + + Return a polynomial of given degree that approximates the function + f(x)=y. If x is not supplied, it is the range(len(y)). + +.. method:: polyval(p, x) + + Evaluate the polynomial p at the points x. x must be an array. diff --git a/tests/run-tests b/tests/run-tests index 94e1591e8a..28eed1e80e 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -579,7 +579,7 @@ the last matching regex is used: # run PC tests test_dirs = ( 'basics', 'micropython', 'float', 'import', 'io', 'misc', - 'stress', 'unicode', 'extmod', 'unix', 'cmdline', + 'stress', 'unicode', 'extmod', 'ulab', 'unix', 'cmdline', ) else: # run tests from these directories diff --git a/tests/ulab/smoke.py b/tests/ulab/smoke.py new file mode 100644 index 0000000000..1cc7fd86db --- /dev/null +++ b/tests/ulab/smoke.py @@ -0,0 +1,84 @@ +try: + import ulab +except: + print('SKIP') + raise SystemExit + +ulab.array([1,2,3]) +ulab.array([1,2,3], dtype=ulab.int8) +ulab.array([1,2,3], dtype=ulab.int16) +ulab.array([1,2,3], dtype=ulab.uint8) +ulab.array([1,2,3], dtype=ulab.uint16) +ulab.array([1,2,3], dtype=ulab.float) +ulab.zeros(3) +ulab.ones(3) +a = ulab.linalg.eye(3) +a.shape +a.size +a.itemsize +a.flatten +a.sort() +a.transpose() +a + 0 +a + a +a * 0 +a * a +a / 1 +a / a +a - 0 +a - a ++a +-a +a[0] +a[:] +a[0] = 0 +a[:] = ulab.zeros((3,3)) +a = ulab.linalg.eye(3) +ulab.vector.acos(a) +ulab.vector.acosh(a) +ulab.vector.asin(a) +ulab.vector.asinh(a) +ulab.vector.atan(a) +ulab.vector.atanh(a) +ulab.vector.ceil(a) +ulab.vector.cos(a) +#ulab.vector.cosh(a) +ulab.vector.sin(a) +ulab.vector.sinh(a) +ulab.vector.tan(a) +ulab.vector.tanh(a) +ulab.vector.erf(a) +ulab.vector.erfc(a) +ulab.vector.exp(a) +ulab.vector.expm1(a) +ulab.vector.floor(a) +ulab.vector.gamma(a) +ulab.vector.lgamma(a) +ulab.vector.log(a) +ulab.vector.log2(a) +ulab.vector.sqrt(a) +ulab.linalg.dot(a,a) +ulab.linalg.inv(a) +ulab.linalg.eig(a) +ulab.linalg.det(a) +ulab.filter.convolve(ulab.array([1,2,3]), ulab.array([1,10,100,1000])) +ulab.numerical.linspace(0, 10, num=3) +a = ulab.numerical.linspace(0, 10, num=256, endpoint=True) +ulab.fft.spectrum(a) +p, q = ulab.fft.fft(a) +ulab.fft.ifft(p) +ulab.fft.ifft(p,q) +ulab.numerical.argmin(a) +ulab.numerical.argmax(a) +ulab.numerical.argsort(a) +ulab.numerical.max(a) +ulab.numerical.min(a) +ulab.numerical.mean(a) +ulab.numerical.std(a) +ulab.numerical.diff(a) +#ulab.size(a) +f = ulab.poly.polyfit([1,2,3], 3) +ulab.poly.polyval([1,2,3], [1,2,3]) +ulab.numerical.sort(a) +ulab.numerical.flip(a) +ulab.numerical.roll(a, 1) diff --git a/tests/ulab/smoke.py.exp b/tests/ulab/smoke.py.exp new file mode 100644 index 0000000000..e69de29bb2 From 645df931ae64e775dfb9641e3d96e3a6d5779d3d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 27 Feb 2020 11:07:37 -0600 Subject: [PATCH 009/919] typos --- shared-bindings/ulab/__init__.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index 329d28ca2b..7e30f2a10a 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -284,14 +284,14 @@ much more efficient than expressing the same operation as a Python loop. .. method:: eig(m) :param m: a square matrix - :return tuple (eigenvectors, eigenvaues): + :return tuple (eigenvectors, eigenvalues): Computes the eigenvalues and eigenvectors of a square matrix .. method:: eye(size, \*, dtype=float) - :param int: size - The number of rows and colums in the matrix + :param int: size - The number of rows and columns in the matrix Returns a square matrix with all the diagonal elements set to 1 and all other elements set to 0 From 39cfe32c345781b32d235353c2e59acacbc32dc6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 27 Feb 2020 14:14:05 -0600 Subject: [PATCH 010/919] Update ulab from upstream again --- extmod/ulab | 2 +- py/py.mk | 5 ++- shared-bindings/ulab/__init__.rst | 63 +++++++++++++------------------ tests/ulab/smoke.py | 8 ++-- 4 files changed, 35 insertions(+), 43 deletions(-) diff --git a/extmod/ulab b/extmod/ulab index 6b9ea24b2e..42d831e1e6 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 6b9ea24b2e57e200d9e2e0f41f6836b1fd73c348 +Subproject commit 42d831e1e65b1c75ed90de11b87a1c4a0ebe6152 diff --git a/py/py.mk b/py/py.mk index 01fce2447e..5e044947ac 100644 --- a/py/py.mk +++ b/py/py.mk @@ -107,14 +107,15 @@ endif ifeq ($(MICROPY_PY_ULAB),1) SRC_MOD += $(addprefix extmod/ulab/code/, \ -filter.c \ +create.c \ fft.c \ +filter.c \ linalg.c \ ndarray.c \ numerical.c \ poly.c \ -vectorise.c \ ulab.c \ +vectorise.c \ ) CFLAGS_MOD += -DMICROPY_PY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index 7e30f2a10a..b2933be792 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -129,8 +129,6 @@ Array type codes Basic Array defining functions ------------------------------ -See also `ulab.linalg.eye` and `ulab.numerical.linspace` for other useful -array defining functions. .. method:: ones(shape, \*, dtype=float) @@ -158,6 +156,33 @@ array defining functions. Return a new square array of size, with the diagonal elements set to 1 and the other elements set to 0. +.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True) + + .. param: start + + First value in the array + + .. param: stop + + Final value in the array + + .. param int: num + + Count of values in the array + + .. param: dtype + + Type of values in the array + + .. param bool: endpoint + + Whether the ``stop`` value is included. Note that even when + endpoint=True, the exact ``stop`` value may not be included due to the + inaccuracy of floating point arithmetic. + + Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly. + + :mod:`ulab.vector` --- Element-by-element functions =================================================== @@ -288,14 +313,6 @@ much more efficient than expressing the same operation as a Python loop. Computes the eigenvalues and eigenvectors of a square matrix - -.. method:: eye(size, \*, dtype=float) - - :param int: size - The number of rows and columns in the matrix - - Returns a square matrix with all the diagonal elements set to 1 and all - other elements set to 0 - .. method:: inv(m) :param ~ulab.array m: a square matrix @@ -387,32 +404,6 @@ operate over the flattened array (None), rows (0), or columns (1). Returns a new array that reverses the order of the elements along the given axis, or along all axes if axis is None. -.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True) - - .. param: start - - First value in the array - - .. param: stop - - Final value in the array - - .. param int: num - - Count of values in the array - - .. param: dtype - - Type of values in the array - - .. param bool: endpoint - - Whether the ``stop`` value is included. Note that even when - endpoint=True, the exact ``stop`` value may not be included due to the - inaccuracy of floating point arithmetic. - - Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly. - .. method:: max(array, \*, axis=None) Return the maximum element of the 1D array, as an array with 1 element diff --git a/tests/ulab/smoke.py b/tests/ulab/smoke.py index 1cc7fd86db..e6d7f55138 100644 --- a/tests/ulab/smoke.py +++ b/tests/ulab/smoke.py @@ -12,7 +12,7 @@ ulab.array([1,2,3], dtype=ulab.uint16) ulab.array([1,2,3], dtype=ulab.float) ulab.zeros(3) ulab.ones(3) -a = ulab.linalg.eye(3) +a = ulab.eye(3) a.shape a.size a.itemsize @@ -33,7 +33,7 @@ a[0] a[:] a[0] = 0 a[:] = ulab.zeros((3,3)) -a = ulab.linalg.eye(3) +a = ulab.eye(3) ulab.vector.acos(a) ulab.vector.acosh(a) ulab.vector.asin(a) @@ -62,8 +62,8 @@ ulab.linalg.inv(a) ulab.linalg.eig(a) ulab.linalg.det(a) ulab.filter.convolve(ulab.array([1,2,3]), ulab.array([1,10,100,1000])) -ulab.numerical.linspace(0, 10, num=3) -a = ulab.numerical.linspace(0, 10, num=256, endpoint=True) +ulab.linspace(0, 10, num=3) +a = ulab.linspace(0, 10, num=256, endpoint=True) ulab.fft.spectrum(a) p, q = ulab.fft.fft(a) ulab.fft.ifft(p) From 6d4ffc69fdfe19366b15861694f97cbf77452937 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Fri, 28 Feb 2020 02:52:46 -0500 Subject: [PATCH 011/919] add TG-Watch02A --- ports/nrf/boards/TG-Watch02A/README.md | 201 ++++++++++++++++++ ports/nrf/boards/TG-Watch02A/board.c | 38 ++++ ports/nrf/boards/TG-Watch02A/mpconfigboard.h | 72 +++++++ ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 26 +++ ports/nrf/boards/TG-Watch02A/pins.c | 53 +++++ ports/nrf/boards/pca10056/mpconfigboard.h | 1 + 6 files changed, 391 insertions(+) create mode 100644 ports/nrf/boards/TG-Watch02A/README.md create mode 100644 ports/nrf/boards/TG-Watch02A/board.c create mode 100644 ports/nrf/boards/TG-Watch02A/mpconfigboard.h create mode 100644 ports/nrf/boards/TG-Watch02A/mpconfigboard.mk create mode 100644 ports/nrf/boards/TG-Watch02A/pins.c diff --git a/ports/nrf/boards/TG-Watch02A/README.md b/ports/nrf/boards/TG-Watch02A/README.md new file mode 100644 index 0000000000..8d515010f9 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/README.md @@ -0,0 +1,201 @@ +# Setup + +The `feather52840` board is currently based on the `PCA10056` development +board from Nordic Semiconductors, since commercial modules are not yet +available for the nRF52840. + +The difference between the `pca10056` and `feather52840` board support +packages is that no bootloader is present on the `pca10056` (a HW debugger +like a Segger J-Link is required to flash firmware images), whereas the +`feather52840` package uses a serial bootloader, with a slightly different +flash layout to account for the bootloader's presence. + +Both targets run on the same hardware and assume the same pinouts. + +The `feather52840` board support package will be updated at a later date +to reflect any pin changes in the final Feather form-factor HW. + +## Installing CircuitPython submodules + +Before you can build, you will need to run the following commands once, which +will install the submodules that are part of the CircuitPython ecosystem, and +build the `mpy-cross` tool: + +``` +$ cd circuitpython +$ git submodule update --init +$ make -C mpy-cross +``` + +You then need to download the SD and Nordic SDK files via: + +> This script relies on `wget`, which must be available from the command line. + +``` +$ cd ports/nrf +$ ./bluetooth/download_ble_stack.sh +``` + +## Installing the Serial Bootloader + +The Adafruit nRF52840 Feather uses a serial bootloader that allows you to +update the core CircuitPython firmware and internal file system contents +using only a serial connection. + +On empty devices, the serial bootloader will need to be flashed once using a +HW debugger such as a Segger J-Link before the serial updater (`adafruit-nrfutil`) can +be used. + +### Install `nrfjprog` + +Before you can install the bootloader, you will first need to install the +`nrfjprog` tool from Nordic Semiconductors for your operating system. The +binary files can be downloaded via the following links: + +- [nRF5x toolset tar for Linux 32-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux32/52619) +- [nRF5x toolset tar for Linux 64-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux64/51388) +- [nRF5x toolset tar for OSX v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-OSX/53406) +- [nRF5x toolset installer for Windows v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Win32/48768) + +You will then need to add the `nrfjprog` folder to your system `PATH` variable +so that it is available from the command line. The exact process for this is +OS specific, but on a POSIX type system like OS X or Linux, you can +temporarily add the location to your `PATH` environment variables as follows: + +``` +$ export PATH=$PATH:YOURPATHHERE/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog/ +``` + +You can test this by running the following command: + +``` +$ nrfjprog --version +nrfjprog version: 9.7.2 +JLinkARM.dll version: 6.20f +``` + +### Flash the USB CDC Bootloader with 'nrfjprog' + +> This operation only needs to be done once, and only on boards that don't + already have the serial bootloader installed. + +Firstly clone the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader.git) and enter its directory + +``` +$ git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader.git +$ cd Adafruit_nRF52_Bootloader +``` + +Once `nrfjprog` is installed and available in `PATH` you can flash your +board with the serial bootloader via the following command: + +``` +make BOARD=feather_nrf52840_express VERSION=latest flash +``` + +This should give you the following (or very similar) output, and you will see +a DFU blinky pattern on one of the board LEDs: + +``` +$ make BOARD=pca10056 VERSION=latest flash +Flashing: bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex +nrfjprog --program bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex --chiperase -f nrf52 --reset +Parsing hex file. +Erasing user available code and UICR flash areas. +Applying system reset. +Checking that the area to write is not protected. +Programing device. +Applying system reset. +Run. +``` + +From this point onward, you can now use a simple serial port for firmware +updates. + +Note: You can specify other version that are available in the directory `Adafruit_nRF52_Bootloader/bin/feather_nrf52840_express/` . The `VERSION=latest` will use the latest bootloader available. + +### IMPORTANT: Disable Mass Storage on PCA10056 J-Link + +The J-Link firmware on the PCA10056 implement USB Mass Storage, but this +causes a known conflict with reliable USB CDC serial port communication. In +order to use the serial bootloader, **you must disable MSD support on the +Segger J-Link**! + +To disable mass storage support, run the `JLinkExe` (or equivalent) command, +and send `MSDDisable`. (You can re-enable MSD support via `MSDEnable`): + +``` +$ JLinkExe +SEGGER J-Link Commander V6.20f (Compiled Oct 13 2017 17:20:01) +DLL version V6.20f, compiled Oct 13 2017 17:19:52 + +Connecting to J-Link via USB...O.K. +Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12 +Hardware version: V1.00 +S/N: 683947110 +VTref = 3.300V + + +Type "connect" to establish a target connection, '?' for help +J-Link>MSDDisable +Probe configured successfully. +J-Link>exit +``` + +## Building and Flashing CircuitPython + +### Installing `adafruit-nrfutil` + +run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) from PyPi + +``` +$ pip3 install adafruit-nrfutil --user +``` + +### Flashing CircuitPython with USB CDC + +With the serial bootloader present on your board, you first need to force your +board into DFU mode by holding down BUTTON1 and RESETTING the board (with +BUTTON1 still pressed as you come out of reset). + +This will give you a **fast blinky DFU pattern** to indicate you are in DFU +mode. + +You can **build and flash** a CircuitPython binary via the following command: + +``` +$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all dfu-gen dfu-flash +``` + +This should give you the following results: + +``` +$make V=1 BOARD=feather52840 SD=s140 SERIAL=/dev/tty.usbmodem1411 dfu-gen dfu-flash +nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application build-feather52840-s140/firmware.hex build-feather52840-s140/dfu-package.zip +Zip created at build-feather52840-s140/dfu-package.zip +nrfutil --verbose dfu serial --package build-feather52840-s140/dfu-package.zip -p /dev/ttyACM1 -b 115200 --singlebank +Upgrading target on /dev/ttyACM1 with DFU package /home/hathach/Dropbox/adafruit/circuitpython/ada_cp/ports/nrf/build-feather52840-s140/dfu-package.zip. Flow control is disabled, Single bank mode +Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 199840 +Sending DFU start packet +Sending DFU init packet +Sending firmware file +######################################################################################################################################################################################################################################################################################################################################################################################################### +Activating new firmware + +DFU upgrade took 8.50606513023s +Device programmed. +``` + +### Flashing CircuitPython with MSC UF2 + +uf2 file is generated last by `all` target + +``` +$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all +Create firmware.uf2 +../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-feather52840-s140/firmware.uf2" "build-feather52840-s140/firmware.hex" +Converting to uf2, output size: 392192, start address: 0x26000 +Wrote 392192 bytes to build-feather52840-s140/firmware.uf2. +``` + +Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done. diff --git a/ports/nrf/boards/TG-Watch02A/board.c b/ports/nrf/boards/TG-Watch02A/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h new file mode 100644 index 0000000000..27bebec643 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h @@ -0,0 +1,72 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "TG-Watch02A-rev00" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (4096) + +#define MICROPY_HW_NEOPIXEL (&pin_P0_16) + +#define MICROPY_HW_LED_STATUS (&pin_P1_15) + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_17 +#define SPI_FLASH_MISO_PIN &pin_P0_22 +#define SPI_FLASH_SCK_PIN &pin_P0_19 +#define SPI_FLASH_CS_PIN &pin_P0_20 +#endif + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define BOARD_HAS_CRYSTAL 0 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_11) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_12) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_14) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_13) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_15) + +#define DEFAULT_UART_BUS_RX (&pin_P0_24) +#define DEFAULT_UART_BUS_TX (&pin_P0_25) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk new file mode 100644 index 0000000000..718a7862dc --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -0,0 +1,26 @@ +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "TG-Watch02" +USB_MANUFACTURER = "TG-Tech + +MCU_SERIES = m4 +MCU_VARIANT = nrf52 +MCU_SUB_VARIANT = nrf52840 +MCU_CHIP = nrf52840 +SD ?= s140 +SOFTDEV_VERSION ?= 6.1.0 + +BOOT_SETTING_ADDR = 0xFF000 + +ifeq ($(SD),) + LD_FILE = boards/nrf52840_1M_256k.ld +else + LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld + CIRCUITPY_BLEIO = 1 +endif + +NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/TG-Watch02A/pins.c b/ports/nrf/boards/TG-Watch02A/pins.c new file mode 100644 index 0000000000..ec2689ab45 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/pins.c @@ -0,0 +1,53 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P1_02) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_24) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 5b30c7fe83..8cc3ad8c21 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -5,6 +5,7 @@ * * Copyright (c) 2016 Glenn Ruben Bakke * + * * 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 From 527eb2444c7d0f82e7a6192f04a93af22f24dee9 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Fri, 28 Feb 2020 04:11:54 -0500 Subject: [PATCH 012/919] added TG-Watch02A pins --- ports/nrf/boards/TG-Watch02A/README.md | 201 ++++++++++++++++++ ports/nrf/boards/TG-Watch02A/board.c | 38 ++++ ports/nrf/boards/TG-Watch02A/mpconfigboard.h | 63 ++++++ ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 10 + ports/nrf/boards/TG-Watch02A/pins.c | 86 ++++++++ 5 files changed, 398 insertions(+) create mode 100644 ports/nrf/boards/TG-Watch02A/README.md create mode 100644 ports/nrf/boards/TG-Watch02A/board.c create mode 100644 ports/nrf/boards/TG-Watch02A/mpconfigboard.h create mode 100644 ports/nrf/boards/TG-Watch02A/mpconfigboard.mk create mode 100644 ports/nrf/boards/TG-Watch02A/pins.c diff --git a/ports/nrf/boards/TG-Watch02A/README.md b/ports/nrf/boards/TG-Watch02A/README.md new file mode 100644 index 0000000000..8d515010f9 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/README.md @@ -0,0 +1,201 @@ +# Setup + +The `feather52840` board is currently based on the `PCA10056` development +board from Nordic Semiconductors, since commercial modules are not yet +available for the nRF52840. + +The difference between the `pca10056` and `feather52840` board support +packages is that no bootloader is present on the `pca10056` (a HW debugger +like a Segger J-Link is required to flash firmware images), whereas the +`feather52840` package uses a serial bootloader, with a slightly different +flash layout to account for the bootloader's presence. + +Both targets run on the same hardware and assume the same pinouts. + +The `feather52840` board support package will be updated at a later date +to reflect any pin changes in the final Feather form-factor HW. + +## Installing CircuitPython submodules + +Before you can build, you will need to run the following commands once, which +will install the submodules that are part of the CircuitPython ecosystem, and +build the `mpy-cross` tool: + +``` +$ cd circuitpython +$ git submodule update --init +$ make -C mpy-cross +``` + +You then need to download the SD and Nordic SDK files via: + +> This script relies on `wget`, which must be available from the command line. + +``` +$ cd ports/nrf +$ ./bluetooth/download_ble_stack.sh +``` + +## Installing the Serial Bootloader + +The Adafruit nRF52840 Feather uses a serial bootloader that allows you to +update the core CircuitPython firmware and internal file system contents +using only a serial connection. + +On empty devices, the serial bootloader will need to be flashed once using a +HW debugger such as a Segger J-Link before the serial updater (`adafruit-nrfutil`) can +be used. + +### Install `nrfjprog` + +Before you can install the bootloader, you will first need to install the +`nrfjprog` tool from Nordic Semiconductors for your operating system. The +binary files can be downloaded via the following links: + +- [nRF5x toolset tar for Linux 32-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux32/52619) +- [nRF5x toolset tar for Linux 64-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux64/51388) +- [nRF5x toolset tar for OSX v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-OSX/53406) +- [nRF5x toolset installer for Windows v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Win32/48768) + +You will then need to add the `nrfjprog` folder to your system `PATH` variable +so that it is available from the command line. The exact process for this is +OS specific, but on a POSIX type system like OS X or Linux, you can +temporarily add the location to your `PATH` environment variables as follows: + +``` +$ export PATH=$PATH:YOURPATHHERE/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog/ +``` + +You can test this by running the following command: + +``` +$ nrfjprog --version +nrfjprog version: 9.7.2 +JLinkARM.dll version: 6.20f +``` + +### Flash the USB CDC Bootloader with 'nrfjprog' + +> This operation only needs to be done once, and only on boards that don't + already have the serial bootloader installed. + +Firstly clone the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader.git) and enter its directory + +``` +$ git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader.git +$ cd Adafruit_nRF52_Bootloader +``` + +Once `nrfjprog` is installed and available in `PATH` you can flash your +board with the serial bootloader via the following command: + +``` +make BOARD=feather_nrf52840_express VERSION=latest flash +``` + +This should give you the following (or very similar) output, and you will see +a DFU blinky pattern on one of the board LEDs: + +``` +$ make BOARD=pca10056 VERSION=latest flash +Flashing: bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex +nrfjprog --program bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex --chiperase -f nrf52 --reset +Parsing hex file. +Erasing user available code and UICR flash areas. +Applying system reset. +Checking that the area to write is not protected. +Programing device. +Applying system reset. +Run. +``` + +From this point onward, you can now use a simple serial port for firmware +updates. + +Note: You can specify other version that are available in the directory `Adafruit_nRF52_Bootloader/bin/feather_nrf52840_express/` . The `VERSION=latest` will use the latest bootloader available. + +### IMPORTANT: Disable Mass Storage on PCA10056 J-Link + +The J-Link firmware on the PCA10056 implement USB Mass Storage, but this +causes a known conflict with reliable USB CDC serial port communication. In +order to use the serial bootloader, **you must disable MSD support on the +Segger J-Link**! + +To disable mass storage support, run the `JLinkExe` (or equivalent) command, +and send `MSDDisable`. (You can re-enable MSD support via `MSDEnable`): + +``` +$ JLinkExe +SEGGER J-Link Commander V6.20f (Compiled Oct 13 2017 17:20:01) +DLL version V6.20f, compiled Oct 13 2017 17:19:52 + +Connecting to J-Link via USB...O.K. +Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12 +Hardware version: V1.00 +S/N: 683947110 +VTref = 3.300V + + +Type "connect" to establish a target connection, '?' for help +J-Link>MSDDisable +Probe configured successfully. +J-Link>exit +``` + +## Building and Flashing CircuitPython + +### Installing `adafruit-nrfutil` + +run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) from PyPi + +``` +$ pip3 install adafruit-nrfutil --user +``` + +### Flashing CircuitPython with USB CDC + +With the serial bootloader present on your board, you first need to force your +board into DFU mode by holding down BUTTON1 and RESETTING the board (with +BUTTON1 still pressed as you come out of reset). + +This will give you a **fast blinky DFU pattern** to indicate you are in DFU +mode. + +You can **build and flash** a CircuitPython binary via the following command: + +``` +$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all dfu-gen dfu-flash +``` + +This should give you the following results: + +``` +$make V=1 BOARD=feather52840 SD=s140 SERIAL=/dev/tty.usbmodem1411 dfu-gen dfu-flash +nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application build-feather52840-s140/firmware.hex build-feather52840-s140/dfu-package.zip +Zip created at build-feather52840-s140/dfu-package.zip +nrfutil --verbose dfu serial --package build-feather52840-s140/dfu-package.zip -p /dev/ttyACM1 -b 115200 --singlebank +Upgrading target on /dev/ttyACM1 with DFU package /home/hathach/Dropbox/adafruit/circuitpython/ada_cp/ports/nrf/build-feather52840-s140/dfu-package.zip. Flow control is disabled, Single bank mode +Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 199840 +Sending DFU start packet +Sending DFU init packet +Sending firmware file +######################################################################################################################################################################################################################################################################################################################################################################################################### +Activating new firmware + +DFU upgrade took 8.50606513023s +Device programmed. +``` + +### Flashing CircuitPython with MSC UF2 + +uf2 file is generated last by `all` target + +``` +$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all +Create firmware.uf2 +../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-feather52840-s140/firmware.uf2" "build-feather52840-s140/firmware.hex" +Converting to uf2, output size: 392192, start address: 0x26000 +Wrote 392192 bytes to build-feather52840-s140/firmware.uf2. +``` + +Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done. diff --git a/ports/nrf/boards/TG-Watch02A/board.c b/ports/nrf/boards/TG-Watch02A/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h new file mode 100644 index 0000000000..acb84cba79 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h @@ -0,0 +1,63 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_NEOPIXEL (&pin_P0_16) + +#define MICROPY_HW_LED_STATUS (&pin_P1_15) + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_17 +#define SPI_FLASH_MISO_PIN &pin_P0_22 +#define SPI_FLASH_SCK_PIN &pin_P0_19 +#define SPI_FLASH_CS_PIN &pin_P0_20 +#endif + +#define BOARD_HAS_CRYSTAL 0 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_11) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_12) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_14) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_13) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_15) + +#define DEFAULT_UART_BUS_RX (&pin_P0_24) +#define DEFAULT_UART_BUS_TX (&pin_P0_25) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk new file mode 100644 index 0000000000..2c1385cf0c --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "TG-Watch02A" +USB_MANUFACTURER = "TG-Tech" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" diff --git a/ports/nrf/boards/TG-Watch02A/pins.c b/ports/nrf/boards/TG-Watch02A/pins.c new file mode 100644 index 0000000000..cbd20d8687 --- /dev/null +++ b/ports/nrf/boards/TG-Watch02A/pins.c @@ -0,0 +1,86 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P1_02) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_24) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + /*TG-Watch02A specific pins*/ + + //tft / display pins + { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_DISP_PWR), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_01) }, + + //cap touch screen + { MP_ROM_QSTR(MP_QSTR_CTP_RESET), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_CTP_INT), MP_ROM_PTR(&pin_P1_05) }, + + //power / battery + { MP_ROM_QSTR(MP_QSTR_CHRG_STAT), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_BAT_VDIV), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_PRESENT), MP_ROM_PTR(&pin_P1_04) }, + + //sensors / outputs + { MP_ROM_QSTR(MP_QSTR_RTC_RESET), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_P0_27) }, + + { MP_ROM_QSTR(MP_QSTR_ACCEL_INT1), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_ACCEL_INT2), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_HAPTIC_INT), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_HAPTIC_ENABLE), MP_ROM_PTR(&pin_P1_06) }, + + //smc pins + { MP_ROM_QSTR(MP_QSTR_SMC_RESET), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON0), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_P1_09) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 1e6c08fc301b4de089ea756704172f85f076a1cd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Feb 2020 10:03:37 -0600 Subject: [PATCH 013/919] nrf: sqpi_flash: Handle unaligned reads --- ports/nrf/supervisor/qspi_flash.c | 43 ++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index bb449d881c..90260b0912 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -83,11 +83,52 @@ bool spi_flash_sector_command(uint8_t command, uint32_t address) { } bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { + // TODO: In theory, this also needs to handle unaligned data and + // non-multiple-of-4 length. (in practice, I don't think the fat layer + // generates such writes) return nrfx_qspi_write(data, length, address) == NRFX_SUCCESS; } bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { - return nrfx_qspi_read(data, length, address) == NRFX_SUCCESS; + int misaligned = ((intptr_t)data) & 3; + // If the data is misaligned, we need to read 4 bytes + // into an aligned buffer, and then copy 1, 2, or 3 bytes from the aligned + // buffer to data. + if(misaligned) { + int sz = 4 - misaligned; + __attribute__((aligned(4))) uint8_t buf[4]; + + if(nrfx_qspi_read(buf, 4, address) != NRFX_SUCCESS) { + return false; + } + memcpy(data, buf, sz); + data += sz; + address += sz; + length -= sz; + } + + // nrfx_qspi_read works in 4 byte increments, though it doesn't + // signal an error if sz is not a multiple of 4. Read (directly into data) + // all but the last 1, 2, or 3 bytes depending on the (remaining) length. + uint32_t sz = length & ~(uint32_t)3; + if(nrfx_qspi_read(data, sz, address) != NRFX_SUCCESS) { + return false; + } + data += sz; + address += sz; + length -= sz; + + // Now, if we have any bytes left over, we must do a final read of 4 + // bytes and copy 1, 2, or 3 bytes to data. + if(length) { + __attribute__((aligned(4))) uint8_t buf[4]; + if(nrfx_qspi_read(buf, 4, address) != NRFX_SUCCESS) { + return false; + } + memcpy(data, buf, length); + } + + return true; } void spi_flash_init(void) { From eef742bf45f504cf23523fea4f20e61774407646 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 28 Feb 2020 10:04:06 -0600 Subject: [PATCH 014/919] oofatfs: Remove _FS_DISK_READ_ALIGNED This workaround is no longer needed, so it can be removed. Closes: #2332 --- lib/oofatfs/ff.c | 6 +----- lib/oofatfs/ffconf.h | 6 ------ ports/nrf/Makefile | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index 71bd19702a..e961c789d8 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -3382,11 +3382,7 @@ FRESULT f_read ( if (!sect) ABORT(fs, FR_INT_ERR); sect += csect; cc = btr / SS(fs); /* When remaining bytes >= sector size, */ - if (cc -#if _FS_DISK_READ_ALIGNED - && (((int)rbuff & 3) == 0) -#endif - ) {/* Read maximum contiguous sectors directly */ + if (cc) {/* Read maximum contiguous sectors directly */ if (csect + cc > fs->csize) { /* Clip at cluster boundary */ cc = fs->csize - csect; } diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index a3795fa3fe..214311b4c2 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -343,12 +343,6 @@ / SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be / included somewhere in the scope of ff.h. */ -// Set to nonzero if buffers passed to disk_read have a word alignment -// restriction -#ifndef _FS_DISK_READ_ALIGNED -#define _FS_DISK_READ_ALIGNED 0 -#endif - /* #include // O/S definitions */ diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 47a5b86534..89d88ce366 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -102,7 +102,6 @@ CFLAGS += -Wno-undef CFLAGS += -Wno-cast-align NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET -NRF_DEFINES += -D_FS_DISK_READ_ALIGNED=1 CFLAGS += $(NRF_DEFINES) CFLAGS += \ From ce9a7d7e2ae93e342578b9a9c61ae3c0e72c6f7a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 28 Feb 2020 23:32:24 -0500 Subject: [PATCH 015/919] new pin validation routines; don't use mp_const_none if NULL will do --- .../boards/hallowing_m4_express/board.c | 2 +- ports/atmel-samd/boards/monster_m4sk/board.c | 2 +- ports/atmel-samd/boards/openbook_m4/board.c | 2 +- ports/atmel-samd/boards/pewpew_m4/board.c | 2 +- ports/atmel-samd/boards/pybadge/board.c | 2 +- .../atmel-samd/boards/pybadge_airlift/board.c | 2 +- ports/atmel-samd/boards/pygamer/board.c | 2 +- .../atmel-samd/boards/pygamer_advance/board.c | 2 +- .../atmel-samd/common-hal/analogio/AnalogIn.c | 4 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 8 ++-- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 6 +-- .../atmel-samd/common-hal/audioio/AudioOut.c | 6 +-- ports/atmel-samd/common-hal/busio/SPI.c | 4 +- ports/atmel-samd/common-hal/busio/UART.c | 8 ++-- .../common-hal/digitalio/DigitalInOut.c | 4 +- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 4 +- ports/cxd56/common-hal/analogio/AnalogIn.c | 4 +- ports/cxd56/common-hal/busio/UART.c | 4 +- .../cxd56/common-hal/digitalio/DigitalInOut.c | 4 +- ports/cxd56/common-hal/pulseio/PWMOut.c | 8 ++-- ports/cxd56/common-hal/pulseio/PulseIn.c | 25 +++++------ .../mimxrt10xx/common-hal/analogio/AnalogIn.c | 4 +- ports/mimxrt10xx/common-hal/busio/UART.c | 18 ++++---- .../common-hal/digitalio/DigitalInOut.c | 4 +- .../nrf/boards/clue_nrf52840_express/board.c | 2 +- ports/nrf/boards/ohs2020_badge/board.c | 2 +- ports/nrf/common-hal/analogio/AnalogIn.c | 4 +- ports/nrf/common-hal/busio/SPI.c | 4 +- ports/nrf/common-hal/busio/UART.c | 14 +++--- ports/nrf/common-hal/digitalio/DigitalInOut.c | 4 +- ports/stm32f4/common-hal/analogio/AnalogIn.c | 14 +++--- ports/stm32f4/common-hal/analogio/AnalogOut.c | 4 +- ports/stm32f4/common-hal/busio/I2C.c | 18 ++++---- ports/stm32f4/common-hal/busio/SPI.c | 44 +++++++++---------- ports/stm32f4/common-hal/busio/UART.c | 16 +++---- .../common-hal/digitalio/DigitalInOut.c | 12 ++--- ports/stm32f4/common-hal/pulseio/PWMOut.c | 16 +++---- shared-bindings/analogio/AnalogIn.c | 9 ++-- shared-bindings/analogio/AnalogOut.c | 6 +-- shared-bindings/audiobusio/I2SOut.c | 14 ++---- shared-bindings/audiobusio/PDMIn.c | 11 +---- shared-bindings/audioio/AudioOut.c | 12 +---- shared-bindings/audiopwmio/PWMAudioOut.c | 12 +---- shared-bindings/bitbangio/I2C.c | 7 ++- shared-bindings/bitbangio/OneWire.c | 5 +-- shared-bindings/bitbangio/SPI.c | 10 ++--- shared-bindings/busio/I2C.c | 10 ++--- shared-bindings/busio/OneWire.c | 4 +- shared-bindings/busio/SPI.c | 16 +++---- shared-bindings/busio/UART.c | 20 ++++----- shared-bindings/digitalio/DigitalInOut.c | 6 +-- shared-bindings/displayio/Display.c | 8 +--- shared-bindings/displayio/EPaperDisplay.c | 8 +--- shared-bindings/frequencyio/FrequencyIn.c | 4 +- shared-bindings/i2cslave/I2CSlave.c | 8 +--- shared-bindings/microcontroller/Pin.c | 29 +++++++++++- shared-bindings/microcontroller/Pin.h | 6 ++- shared-bindings/ps2io/Ps2.c | 9 ++-- shared-bindings/pulseio/PWMOut.c | 5 +-- shared-bindings/pulseio/PulseIn.c | 4 +- shared-bindings/rotaryio/IncrementalEncoder.c | 9 +--- shared-bindings/touchio/TouchIn.c | 5 +-- shared-bindings/wiznet/wiznet5k.c | 6 +-- shared-module/bitbangio/SPI.c | 4 +- 64 files changed, 237 insertions(+), 295 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 5d1ef6d9be..6bb2a591f0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 40141ca157..2377f4a9da 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 85a5888799..2d9b316474 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -55,7 +55,7 @@ uint8_t stop_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 1872d18763..5f5a01e48e 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -97,7 +97,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 28e1aec131..bead06f3c6 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index fbb4441f0e..061f3d7772 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index c052614dbb..70d4a05dcd 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index a138c7e504..ff2da34a26 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index fc11d5d19f..2bd218cdda 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -73,7 +73,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -81,7 +81,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void analogin_reset() { diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 05a6aaf7b0..99d3762cbf 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -204,7 +204,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, } bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) { - return self->bit_clock == mp_const_none; + return self->bit_clock == NULL; } void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { @@ -213,11 +213,11 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { } reset_pin_number(self->bit_clock->number); - self->bit_clock = mp_const_none; + self->bit_clock = NULL; reset_pin_number(self->word_select->number); - self->word_select = mp_const_none; + self->word_select = NULL; reset_pin_number(self->data->number); - self->data = mp_const_none; + self->data = NULL; } void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 3a51cce8f1..f70f1fec0d 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -219,7 +219,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, } bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t* self) { - return self->clock_pin == mp_const_none; + return self->clock_pin == NULL; } void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { @@ -237,8 +237,8 @@ void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { reset_pin_number(self->clock_pin->number); reset_pin_number(self->data_pin->number); - self->clock_pin = mp_const_none; - self->data_pin = mp_const_none; + self->clock_pin = NULL; + self->data_pin = NULL; } uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t* self) { diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index b75c2b3350..1d9b4cbe8f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -304,7 +304,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, } bool common_hal_audioio_audioout_deinited(audioio_audioout_obj_t* self) { - return self->left_channel == mp_const_none; + return self->left_channel == NULL; } void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { @@ -332,10 +332,10 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { tc_set_enable(tc_insts[self->tc_index], false); reset_pin_number(self->left_channel->number); - self->left_channel = mp_const_none; + self->left_channel = NULL; #ifdef SAMD51 reset_pin_number(self->right_channel->number); - self->right_channel = mp_const_none; + self->right_channel = NULL; #endif } diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 7a1426bedc..1dc389027d 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -89,8 +89,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, Sercom* sercom = NULL; uint8_t sercom_index; uint32_t clock_pinmux = 0; - bool mosi_none = mosi == mp_const_none || mosi == NULL; - bool miso_none = miso == mp_const_none || miso == NULL; + bool mosi_none = mosi == NULL; + bool miso_none = miso == NULL; uint32_t mosi_pinmux = 0; uint32_t miso_pinmux = 0; uint8_t clock_pad = 0; diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index fb9968605f..1f6b75f972 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -65,7 +65,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint32_t tx_pinmux = 0; uint8_t tx_pad = 255; // Unset pad - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } @@ -73,8 +73,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); } - bool have_tx = tx != mp_const_none; - bool have_rx = rx != mp_const_none; + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -109,7 +109,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); tx_pad = tx->sercom[i].pad; - if (rx == mp_const_none) { + if (rx == NULL) { sercom = potential_sercom; break; } diff --git a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c index e167cbb694..68d3da806c 100644 --- a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +++ b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_never_reset( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self) { @@ -63,7 +63,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index 0adb23fc5d..fef581584f 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -292,7 +292,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { @@ -319,7 +319,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index e2ca5e4a42..cdf37c06a7 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -83,7 +83,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const // start ADC ioctl(analogin_dev[self->number].fd, ANIOC_CXD56_START, 0); - + self->pin = pin; } @@ -97,7 +97,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { close(analogin_dev[self->number].fd); analogin_dev[self->number].fd = -1; - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 3ed9809529..3bca240e01 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -60,10 +60,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size) { struct termios tio; - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + if (bits != 8) { mp_raise_ValueError(translate("Could not initialize UART")); } diff --git a/ports/cxd56/common-hal/digitalio/DigitalInOut.c b/ports/cxd56/common-hal/digitalio/DigitalInOut.c index 7b1f6cc031..c9af12e443 100644 --- a/ports/cxd56/common-hal/digitalio/DigitalInOut.c +++ b/ports/cxd56/common-hal/digitalio/DigitalInOut.c @@ -56,11 +56,11 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self board_gpio_config(self->pin->number, 0, false, true, PIN_FLOAT); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_switch_to_input(digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { diff --git a/ports/cxd56/common-hal/pulseio/PWMOut.c b/ports/cxd56/common-hal/pulseio/PWMOut.c index a0b4e79c60..7e0be566b4 100644 --- a/ports/cxd56/common-hal/pulseio/PWMOut.c +++ b/ports/cxd56/common-hal/pulseio/PWMOut.c @@ -50,7 +50,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, const mcu_pin_obj_t *pin, uint16_t duty, uint32_t frequency, bool variable_frequency) { self->number = -1; - + for (int i = 0; i < MP_ARRAY_SIZE(pwmout_dev); i++) { if (pin->number == pwmout_dev[i].pin->number) { self->number = i; @@ -95,7 +95,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) { pwmout_dev[self->number].fd = -1; reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t *self) { @@ -131,11 +131,11 @@ bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t *self void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { never_reset_pin_number(self->pin->number); - pwmout_dev[self->number].reset = false; + pwmout_dev[self->number].reset = false; } void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { - pwmout_dev[self->number].reset = true; + pwmout_dev[self->number].reset = true; } void pwmout_reset(void) { diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index dd2773d1d0..65ca1d97eb 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -106,7 +106,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, board_gpio_int(self->pin->number, true); } - + void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { if (common_hal_pulseio_pulsein_deinited(self)) { return; @@ -116,18 +116,18 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { board_gpio_intconfig(self->pin->number, 0, false, NULL); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } - + bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } - + void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { board_gpio_int(self->pin->number, false); self->paused = true; } - + void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t trigger_duration) { // Make sure we're paused. common_hal_pulseio_pulsein_pause(self); @@ -147,14 +147,14 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t tri pulsein_set_config(self, true); board_gpio_int(self->pin->number, true); } - + void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { common_hal_mcu_disable_interrupts(); self->start = 0; self->len = 0; common_hal_mcu_enable_interrupts(); } - + uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { if (self->len == 0) { mp_raise_IndexError(translate("pop from an empty PulseIn")); @@ -167,19 +167,19 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { return value; } - + uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t *self) { return self->maxlen; } - + bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { return self->paused; } - + uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t *self) { return self->len; } - + uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_t index) { common_hal_mcu_disable_interrupts(); if (index < 0) { @@ -193,4 +193,3 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ common_hal_mcu_enable_interrupts(); return value; } - \ No newline at end of file diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index d714001f33..2cc2681b44 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -58,7 +58,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -66,7 +66,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 4fd7afecbc..b34b948b29 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -80,8 +80,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // TODO: Allow none rx or tx - bool have_tx = tx != mp_const_none; - bool have_rx = rx != mp_const_none; + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -116,8 +116,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } // Filter for sane settings for RS485 - if (rs485_dir != mp_const_none) { - if ((rts != mp_const_none) || (cts != mp_const_none)) { + if (rs485_dir != NULL) { + if ((rts != NULL) || (cts != NULL)) { mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); } // For IMXRT the RTS pin is used for RS485 direction @@ -133,7 +133,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const uint32_t rts_count = sizeof(mcu_uart_rts_list) / sizeof(mcu_periph_obj_t); const uint32_t cts_count = sizeof(mcu_uart_cts_list) / sizeof(mcu_periph_obj_t); - if (rts != mp_const_none) { + if (rts != NULL) { for (uint32_t i=0; i < rts_count; ++i) { if (mcu_uart_rts_list[i].bank_idx == self->rx_pin->bank_idx) { if (mcu_uart_rts_list[i].pin == rts) { @@ -146,7 +146,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Selected RTS pin not valid")); } - if (cts != mp_const_none) { + if (cts != NULL) { for (uint32_t i=0; i < cts_count; ++i) { if (mcu_uart_cts_list[i].bank_idx == self->rx_pin->bank_idx) { if (mcu_uart_cts_list[i].pin == cts) { @@ -158,7 +158,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (self->cts_pin == NULL) mp_raise_ValueError(translate("Selected CTS pin not valid")); } - + self->uart = mcu_uart_banks[self->tx_pin->bank_idx - 1]; config_periph_pin(self->rx_pin); @@ -166,7 +166,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (self->rts_pin) config_periph_pin(self->rts_pin); if (self->cts_pin) - config_periph_pin(self->cts_pin); + config_periph_pin(self->cts_pin); lpuart_config_t config = { 0 }; LPUART_GetDefaultConfig(&config); @@ -187,7 +187,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Before we init, setup RS485 direction pin // ..unfortunately this isn't done by the driver library uint32_t modir = (self->uart->MODIR) & ~(LPUART_MODIR_TXRTSPOL_MASK | LPUART_MODIR_TXRTSE_MASK); - if (rs485_dir != mp_const_none) { + if (rs485_dir != NULL) { modir |= LPUART_MODIR_TXRTSE_MASK; if (rs485_invert) modir |= LPUART_MODIR_TXRTSPOL_MASK; diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index d69a18d962..603515764f 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -78,7 +78,7 @@ void common_hal_digitalio_digitalinout_never_reset( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self) { @@ -86,7 +86,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index 5f5337a3da..e342c6d939 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 7e3e058144..9e881d7639 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 3bc097019e..dbcc5281ce 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -55,7 +55,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -65,7 +65,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { nrf_gpio_cfg_default(self->pin->number); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index b4ebddde1d..3f205e7782 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -155,7 +155,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * self->clock_pin_number = clock->number; claim_pin(clock); - if (mosi != mp_const_none) { + if (mosi != NULL) { config.mosi_pin = mosi->number; self->MOSI_pin_number = mosi->number; claim_pin(mosi); @@ -163,7 +163,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * self->MOSI_pin_number = NO_PIN; } - if (miso != mp_const_none) { + if (miso != NULL) { config.miso_pin = miso->number; self->MISO_pin_number = mosi->number; claim_pin(miso); diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 933faf17b8..14fa363749 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -135,10 +135,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size) { - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + // Find a free UART peripheral. self->uarte = NULL; for (size_t i = 0 ; i < MP_ARRAY_SIZE(nrfx_uartes); i++) { @@ -152,7 +152,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("All UART peripherals are in use")); } - if ( (tx == mp_const_none) && (rx == mp_const_none) ) { + if ( (tx == NULL) && (rx == NULL) ) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -165,8 +165,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } nrfx_uarte_config_t config = { - .pseltxd = (tx == mp_const_none) ? NRF_UARTE_PSEL_DISCONNECTED : tx->number, - .pselrxd = (rx == mp_const_none) ? NRF_UARTE_PSEL_DISCONNECTED : rx->number, + .pseltxd = (tx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : tx->number, + .pselrxd = (rx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : rx->number, .pselcts = NRF_UARTE_PSEL_DISCONNECTED, .pselrts = NRF_UARTE_PSEL_DISCONNECTED, .p_context = self, @@ -181,7 +181,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, _VERIFY_ERR(nrfx_uarte_init(self->uarte, &config, uart_callback_irq)); // Init buffer for rx - if ( rx != mp_const_none ) { + if ( rx != NULL ) { // Initially allocate the UART's buffer in the long-lived part of the // heap. UARTs are generally long-lived objects, but the "make long- // lived" machinery is incapable of moving internal pointers like @@ -200,7 +200,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, claim_pin(rx); } - if ( tx != mp_const_none ) { + if ( tx != NULL ) { self->tx_pin_number = tx->number; claim_pin(tx); } else { diff --git a/ports/nrf/common-hal/digitalio/DigitalInOut.c b/ports/nrf/common-hal/digitalio/DigitalInOut.c index 0836962c63..c5a7a7dfba 100644 --- a/ports/nrf/common-hal/digitalio/DigitalInOut.c +++ b/ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -56,7 +56,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self nrf_gpio_cfg_default(self->pin->number); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/stm32f4/common-hal/analogio/AnalogIn.c b/ports/stm32f4/common-hal/analogio/AnalogIn.c index 3ee3c4dbbb..1d1b308b66 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogIn.c +++ b/ports/stm32f4/common-hal/analogio/AnalogIn.c @@ -45,11 +45,11 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } // TODO: add ADC traits to structure? - // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only - // for dual conversion. For this basic application it is never used. + // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only + // for dual conversion. For this basic application it is never used. LL_GPIO_SetPinMode(pin_port(pin->port), (uint32_t)pin_mask(pin->number), LL_GPIO_MODE_ANALOG); if (pin->adc_unit & 0x01) { - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); } else if (pin->adc_unit == 0x04) { #ifdef LL_APB2_GRP1_PERIPH_ADC3 LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); @@ -62,7 +62,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -70,7 +70,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->port,self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { @@ -116,10 +116,10 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); HAL_ADC_Start(&AdcHandle); - HAL_ADC_PollForConversion(&AdcHandle,1); + HAL_ADC_PollForConversion(&AdcHandle,1); uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - + // // Shift the value to be 16 bit. return value << 4; } diff --git a/ports/stm32f4/common-hal/analogio/AnalogOut.c b/ports/stm32f4/common-hal/analogio/AnalogOut.c index 79ced0492f..2ea969f503 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogOut.c +++ b/ports/stm32f4/common-hal/analogio/AnalogOut.c @@ -39,7 +39,7 @@ #include "stm32f4xx_hal.h" -//DAC is shared between both channels. +//DAC is shared between both channels. #if HAS_DAC DAC_HandleTypeDef handle; #endif @@ -97,7 +97,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { #if HAS_DAC reset_pin_number(self->pin->port,self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; dac_on[self->dac_index] = false; //turn off the DAC if both channels are off diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c index 1437e5e784..8e98b966d2 100644 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ b/ports/stm32f4/common-hal/busio/I2C.c @@ -100,14 +100,14 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->sda->altfn_index; + GPIO_InitStruct.Alternate = self->sda->altfn_index; HAL_GPIO_Init(pin_port(sda->port), &GPIO_InitStruct); GPIO_InitStruct.Pin = pin_mask(scl->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->scl->altfn_index; + GPIO_InitStruct.Alternate = self->scl->altfn_index; HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); //Note: due to I2C soft reboot issue, do not relocate clock init. @@ -144,7 +144,7 @@ void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { - return self->sda->pin == mp_const_none; + return self->sda == NULL; } void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { @@ -158,8 +158,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { reset_pin_number(self->sda->pin->port,self->sda->pin->number); reset_pin_number(self->scl->pin->port,self->scl->pin->number); - self->sda = mp_const_none; - self->scl = mp_const_none; + self->sda = NULL; + self->scl = NULL; } bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { @@ -169,7 +169,7 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { bool grabbed_lock = false; - //Critical section code that may be required at some point. + //Critical section code that may be required at some point. // uint32_t store_primask = __get_PRIMASK(); // __disable_irq(); // __DMB(); @@ -195,19 +195,19 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const uint8_t *data, size_t len, bool transmit_stop_bit) { - HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), + HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), (uint8_t *)data, (uint16_t)len, 500); return result == HAL_OK ? 0 : MP_EIO; } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t *data, size_t len) { - return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) + return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) == HAL_OK ? 0 : MP_EIO; } STATIC void i2c_clock_enable(uint8_t mask) { - //Note: hard reset required due to soft reboot issue. + //Note: hard reset required due to soft reboot issue. #ifdef I2C1 if (mask & (1 << 0)) { __HAL_RCC_I2C1_CLK_ENABLE(); diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index e00b5e9f0c..7e25e0a571 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -49,7 +49,7 @@ STATIC void spi_clock_enable(uint8_t mask); STATIC void spi_clock_disable(uint8_t mask); STATIC uint32_t get_busclock(SPI_TypeDef * instance) { - //SPI2 and 3 are on PCLK1, if they exist. + //SPI2 and 3 are on PCLK1, if they exist. #ifdef SPI2 if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); #endif @@ -113,7 +113,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, for (uint i = 0; i < sck_len; i++) { if (mcu_spi_sck_list[i].pin == sck) { //if both MOSI and MISO exist, loop search normally - if ((mosi != mp_const_none) && (miso != mp_const_none)) { + if ((mosi != NULL) && (miso != NULL)) { //MOSI for (uint j = 0; j < mosi_len; j++) { if (mcu_spi_mosi_list[j].pin == mosi) { @@ -133,11 +133,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[k]; break; } - } + } } } // if just MISO, reduce search - } else if (miso != mp_const_none) { + } else if (miso != NULL) { for (uint j = 0; j < miso_len; j++) { if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) { @@ -152,9 +152,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[j]; break; } - } + } // if just MOSI, reduce search - } else if (mosi != mp_const_none) { + } else if (mosi != NULL) { for (uint j = 0; j < mosi_len; j++) { if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) { @@ -169,7 +169,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = NULL; break; } - } + } } else { //throw an error immediately mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); @@ -179,8 +179,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, //handle typedef selection, errors if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || - (self->sck != NULL && self->mosi != NULL && miso == mp_const_none) || - (self->sck != NULL && self->miso != NULL && mosi == mp_const_none)) { + (self->sck != NULL && self->mosi != NULL && miso == NULL) || + (self->sck != NULL && self->miso != NULL && mosi == NULL)) { SPIx = mcu_spi_banks[self->sck->spi_index - 1]; } else { if (spi_taken) { @@ -196,7 +196,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->sck->altfn_index; + GPIO_InitStruct.Alternate = self->sck->altfn_index; HAL_GPIO_Init(pin_port(sck->port), &GPIO_InitStruct); if (self->mosi != NULL) { @@ -204,7 +204,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->mosi->altfn_index; + GPIO_InitStruct.Alternate = self->mosi->altfn_index; HAL_GPIO_Init(pin_port(mosi->port), &GPIO_InitStruct); } @@ -213,14 +213,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->miso->altfn_index; + GPIO_InitStruct.Alternate = self->miso->altfn_index; HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); } spi_clock_enable(1 << (self->sck->spi_index - 1)); reserved_spi[self->sck->spi_index - 1] = true; - - self->handle.Instance = SPIx; + + self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; // Direction change only required for RX-only, see RefMan RM0090:884 self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES; @@ -269,7 +269,7 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { - return self->sck->pin == mp_const_none; + return self->sck->pin == NULL; } void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { @@ -287,15 +287,15 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (self->miso != NULL) { reset_pin_number(self->miso->pin->port,self->miso->pin->number); } - self->sck = mp_const_none; - self->mosi = mp_const_none; - self->miso = mp_const_none; + self->sck = NULL; + self->mosi = NULL; + self->miso = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { //This resets the SPI, so check before updating it redundantly - if (baudrate == self->baudrate && polarity== self->polarity + if (baudrate == self->baudrate && polarity== self->polarity && phase == self->phase && bits == self->bits) { return true; } @@ -307,7 +307,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->handle.Init.CLKPolarity = (polarity) ? SPI_POLARITY_HIGH : SPI_POLARITY_LOW; self->handle.Init.CLKPhase = (phase) ? SPI_PHASE_2EDGE : SPI_PHASE_1EDGE; - self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, get_busclock(self->handle.Instance)); if (HAL_SPI_Init(&self->handle) != HAL_OK) @@ -325,7 +325,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { bool grabbed_lock = false; - //Critical section code that may be required at some point. + //Critical section code that may be required at some point. // uint32_t store_primask = __get_PRIMASK(); // __disable_irq(); // __DMB(); @@ -367,7 +367,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return result == HAL_OK; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { if (self->miso == NULL || self->mosi == NULL) { mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 3c19092591..0b434fd023 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -86,12 +86,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool uart_taken = false; uint8_t uart_index = 0; //origin 0 corrected - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert == true)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + //Can have both pins, or either - if ((tx != mp_const_none) && (rx != mp_const_none)) { + if ((tx != NULL) && (rx != NULL)) { //normal find loop if both pins exist for (uint i = 0; i < tx_len; i++) { if (mcu_uart_tx_list[i].pin == tx) { @@ -115,7 +115,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uart_index = self->tx->uart_index - 1; USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), uart_index, uart_taken); - } else if (tx == mp_const_none) { + } else if (tx == NULL) { //If there is no tx, run only rx for (uint i = 0; i < rx_len; i++) { if (mcu_uart_rx_list[i].pin == rx) { @@ -132,7 +132,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uart_index = self->rx->uart_index - 1; USARTx = assign_uart_or_throw(self, (self->rx != NULL), uart_index, uart_taken); - } else if (rx == mp_const_none) { + } else if (rx == NULL) { //If there is no rx, run only tx for (uint i = 0; i < tx_len; i++) { if (mcu_uart_tx_list[i].pin == tx) { @@ -236,7 +236,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->tx->pin == mp_const_none; + return self->tx->pin == NULL; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -244,8 +244,8 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); - self->tx = mp_const_none; - self->rx = mp_const_none; + self->tx = NULL; + self->rx = NULL; gc_free(self->rbuf.buf); self->rbuf.size = 0; self->rbuf.iput = self->rbuf.iget = 0; diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c index 36c1075e23..be2db4dace 100644 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c @@ -54,7 +54,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -63,7 +63,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } reset_pin_number(self->pin->port, self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( @@ -90,7 +90,7 @@ void common_hal_digitalio_digitalinout_switch_to_output( digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_digitalinout_obj_t *self) { - return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) + return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_MODE_INPUT) ? DIRECTION_INPUT : DIRECTION_OUTPUT; } @@ -111,7 +111,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( digitalio_drive_mode_t drive_mode) { GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = pin_mask(self->pin->number); - GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? + GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? GPIO_MODE_OUTPUT_OD : GPIO_MODE_OUTPUT_PP); GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; @@ -121,7 +121,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( digitalio_digitalinout_obj_t *self) { - return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) + return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_OUTPUT_OPENDRAIN ? DRIVE_MODE_OPEN_DRAIN : DRIVE_MODE_PUSH_PULL; } @@ -145,7 +145,7 @@ void common_hal_digitalio_digitalinout_set_pull( digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( digitalio_digitalinout_obj_t *self) { - + switch (LL_GPIO_GetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number))) { case LL_GPIO_PULL_UP: diff --git a/ports/stm32f4/common-hal/pulseio/PWMOut.c b/ports/stm32f4/common-hal/pulseio/PWMOut.c index 50bacbb514..c23fa74625 100644 --- a/ports/stm32f4/common-hal/pulseio/PWMOut.c +++ b/ports/stm32f4/common-hal/pulseio/PWMOut.c @@ -72,7 +72,7 @@ STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) { return (duty*period) / ((1 << 16) - 1); } -STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, +STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, uint32_t frequency, uint32_t source_freq) { //Find the largest possible period supported by this frequency for (int i = 0; i < (1 << 16); i++) { @@ -139,7 +139,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, first_time_setup = false; //skip setting up the timer } //No problems taken, so set it up - self->tim = l_tim; + self->tim = l_tim; break; } } @@ -182,7 +182,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, uint32_t prescaler = 0; //prescaler is 15 bit uint32_t period = 0; //period is 16 bit - timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_optimal_divisors(&period, &prescaler, frequency, timer_get_source_freq(self->tim->tim_index)); //Timer init @@ -240,7 +240,7 @@ void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { - return self->tim == mp_const_none; + return self->tim == NULL; } void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { @@ -255,7 +255,7 @@ 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 = mp_const_none; + self->tim = NULL; //if reserved timer has no active channels, we can disable it if (!reserved_tim[self->tim->tim_index - 1]) { @@ -276,13 +276,13 @@ 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, uint32_t frequency) { //don't halt setup for the same frequency - if (frequency == self->frequency) { + if (frequency == self->frequency) { return; } uint32_t prescaler = 0; uint32_t period = 0; - timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_optimal_divisors(&period, &prescaler, frequency, timer_get_source_freq(self->tim->tim_index)); //shut down @@ -290,7 +290,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_ //Only change altered values self->handle.Init.Period = period - 1; - self->handle.Init.Prescaler = prescaler - 1; + self->handle.Init.Prescaler = prescaler - 1; //restart everything, adjusting for new speed if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 9a9b525d8b..9d1312dd86 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -63,16 +63,13 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - mp_obj_t pin_obj = args[0]; - assert_pin(pin_obj, false); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); analogio_analogin_obj_t *self = m_new_obj(analogio_analogin_obj_t); self->base.type = &analogio_analogin_type; - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); common_hal_analogio_analogin_construct(self, pin); - return (mp_obj_t) self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() @@ -141,7 +138,7 @@ STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { float reference_voltage = common_hal_analogio_analogin_get_reference_voltage(self); if (reference_voltage <= 0.0f) { - return mp_const_none; + return mp_const_none; } else { return mp_obj_new_float(reference_voltage); } diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 0816da4657..2496f17849 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -62,15 +62,13 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); - assert_pin(args[0], false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(args[0]); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); analogio_analogout_obj_t *self = m_new_obj(analogio_analogout_obj_t); self->base.type = &analogio_analogout_type; - assert_pin_free(pin); common_hal_analogio_analogout_construct(self, pin); - return self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 8f7382fde5..45f7037954 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -105,17 +105,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t bit_clock_obj = args[ARG_bit_clock].u_obj; - assert_pin(bit_clock_obj, false); - const mcu_pin_obj_t *bit_clock = MP_OBJ_TO_PTR(bit_clock_obj); - - mp_obj_t word_select_obj = args[ARG_word_select].u_obj; - assert_pin(word_select_obj, false); - const mcu_pin_obj_t *word_select = MP_OBJ_TO_PTR(word_select_obj); - - mp_obj_t data_obj = args[ARG_data].u_obj; - assert_pin(data_obj, false); - const mcu_pin_obj_t *data = MP_OBJ_TO_PTR(data_obj); + const mcu_pin_obj_t *bit_clock = validate_is_free_pin(args[ARG_bit_clock].u_obj); + const mcu_pin_obj_t *word_select = validate_is_free_pin(args[ARG_word_select].u_obj); + const mcu_pin_obj_t *data = validate_is_free_pin(args[ARG_data].u_obj); audiobusio_i2sout_obj_t *self = m_new_obj_with_finaliser(audiobusio_i2sout_obj_t); self->base.type = &audiobusio_i2sout_type; diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 0c92c24780..65bc5a9d26 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -104,15 +104,8 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t clock_pin_obj = args[ARG_clock_pin].u_obj; - assert_pin(clock_pin_obj, false); - const mcu_pin_obj_t *clock_pin = MP_OBJ_TO_PTR(clock_pin_obj); - assert_pin_free(clock_pin); - - mp_obj_t data_pin_obj = args[ARG_data_pin].u_obj; - assert_pin(data_pin_obj, false); - const mcu_pin_obj_t *data_pin = MP_OBJ_TO_PTR(data_pin_obj); - assert_pin_free(data_pin); + const mcu_pin_obj_t *clock_pin = validate_is_free_pin(args[ARG_clock_pin].u_obj); + const mcu_pin_obj_t *data_pin = validate_is_free_pin(args[ARG_data_pin].u_obj); // create PDMIn object from the given pin audiobusio_pdmin_obj_t *self = m_new_obj(audiobusio_pdmin_obj_t); diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index eb4ef1fc6c..687db22d3f 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -104,16 +104,8 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t left_channel_obj = args[ARG_left_channel].u_obj; - assert_pin(left_channel_obj, false); - const mcu_pin_obj_t *left_channel_pin = MP_OBJ_TO_PTR(left_channel_obj); - - mp_obj_t right_channel_obj = args[ARG_right_channel].u_obj; - const mcu_pin_obj_t *right_channel_pin = NULL; - if (right_channel_obj != mp_const_none) { - assert_pin(right_channel_obj, false); - right_channel_pin = MP_OBJ_TO_PTR(right_channel_obj); - } + const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj); // create AudioOut object from the given pin audioio_audioout_obj_t *self = m_new_obj(audioio_audioout_obj_t); diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 60bf085002..c1c11f9cdc 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -107,16 +107,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t left_channel_obj = args[ARG_left_channel].u_obj; - assert_pin(left_channel_obj, false); - const mcu_pin_obj_t *left_channel_pin = MP_OBJ_TO_PTR(left_channel_obj); - - mp_obj_t right_channel_obj = args[ARG_right_channel].u_obj; - const mcu_pin_obj_t *right_channel_pin = NULL; - if (right_channel_obj != mp_const_none) { - assert_pin(right_channel_obj, false); - right_channel_pin = MP_OBJ_TO_PTR(right_channel_obj); - } + const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj) // create AudioOut object from the given pin audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 01a128393b..bdfbfb2ca9 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -63,10 +63,9 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); + + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); bitbangio_i2c_obj_t *self = m_new_obj(bitbangio_i2c_obj_t); self->base.type = &bitbangio_i2c_type; diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 73bedcd8d5..20ca81c5dc 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -69,9 +69,8 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); bitbangio_onewire_obj_t *self = m_new_obj(bitbangio_onewire_obj_t); self->base.type = &bitbangio_onewire_type; diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 9a51bde665..4623523523 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -71,12 +71,10 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clock].u_obj, false); - assert_pin(args[ARG_MOSI].u_obj, true); - assert_pin(args[ARG_MISO].u_obj, true); - const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(args[ARG_clock].u_obj); - const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(args[ARG_MOSI].u_obj); - const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(args[ARG_MISO].u_obj); + + const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); bitbangio_spi_obj_t *self = m_new_obj(bitbangio_spi_obj_t); self->base.type = &bitbangio_spi_type; diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 50a95beb2e..618a5ad320 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -76,12 +76,10 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - assert_pin_free(scl); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); - assert_pin_free(sda); + + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); + common_hal_busio_i2c_construct(self, scl, sda, args[ARG_frequency].u_int, args[ARG_timeout].u_int); return (mp_obj_t)self; } diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index aca2a3ef20..b28495096d 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -69,9 +69,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); busio_onewire_obj_t *self = m_new_obj(busio_onewire_obj_t); self->base.type = &busio_onewire_type; diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 828ffb8d00..ca84c0f246 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -89,17 +89,13 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clock].u_obj, false); - assert_pin(args[ARG_MOSI].u_obj, true); - assert_pin(args[ARG_MISO].u_obj, true); - const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(args[ARG_clock].u_obj); - assert_pin_free(clock); - const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(args[ARG_MOSI].u_obj); - assert_pin_free(mosi); - const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(args[ARG_MISO].u_obj); - assert_pin_free(miso); + + const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); + common_hal_busio_spi_construct(self, clock, mosi, miso); - return (mp_obj_t)self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 02c5afb16e..ffa50fd7d8 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -105,13 +105,12 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_rx].u_obj, true); - const mcu_pin_obj_t* rx = MP_OBJ_TO_PTR(args[ARG_rx].u_obj); - assert_pin_free(rx); + const mcu_pin_obj_t* rx = validate_is_free_pin_or_none(args[ARG_rx].u_obj); + const mcu_pin_obj_t* tx = validate_is_free_pin_or_none(args[ARG_tx].u_obj); - assert_pin(args[ARG_tx].u_obj, true); - const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(args[ARG_tx].u_obj); - assert_pin_free(tx); + if ( (tx == NULL) && (rx == NULL) ) { + mp_raise_ValueError(translate("tx and rx cannot both be None")); + } uint8_t bits = args[ARG_bits].u_int; if (bits < 7 || bits > 9) { @@ -133,12 +132,11 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); validate_timeout(timeout); - const mcu_pin_obj_t* rts = MP_OBJ_TO_PTR(args[ARG_rts].u_obj); + const mcu_pin_obj_t* rts = validate_is_free_pin_or_none(args[ARG_rts].u_obj); + const mcu_pin_obj_t* cts = validate_is_free_pin_or_none(args[ARG_cts].u_obj); + const mcu_pin_obj_t* rs485_dir = validate_is_free_pin_or_none(args[ARG_rs485_dir].u_obj); - const mcu_pin_obj_t* cts = MP_OBJ_TO_PTR(args[ARG_cts].u_obj); - - const mcu_pin_obj_t* rs485_dir = args[ARG_rs485_dir].u_obj; - bool rs485_invert = args[ARG_rs485_invert].u_bool; + const bool rs485_invert = args[ARG_rs485_invert].u_bool; common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, args[ARG_baudrate].u_int, bits, parity, stop, timeout, diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 16472c12c1..1610c83f8b 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -68,12 +68,10 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, digitalio_digitalinout_obj_t *self = m_new_obj(digitalio_digitalinout_obj_t); self->base.type = &digitalio_digitalinout_type; - assert_pin(args[0], false); - mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(args[0]); - assert_pin_free(pin); + mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); common_hal_digitalio_digitalinout_construct(self, pin); - return (mp_obj_t)self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 5759e8ad22..9fa976b86b 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -141,13 +141,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_init_sequence].u_obj, &bufinfo, MP_BUFFER_READ); - mp_obj_t backlight_pin_obj = args[ARG_backlight_pin].u_obj; - assert_pin(backlight_pin_obj, true); - const mcu_pin_obj_t* backlight_pin = NULL; - if (backlight_pin_obj != NULL && backlight_pin_obj != mp_const_none) { - backlight_pin = MP_OBJ_TO_PTR(backlight_pin_obj); - assert_pin_free(backlight_pin); - } + const mcu_pin_obj_t* backlight_pin = validate_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); mp_float_t brightness = mp_obj_get_float(args[ARG_brightness].u_obj); diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 81e06f82f9..60a3838a40 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -129,13 +129,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size mp_get_buffer_raise(args[ARG_stop_sequence].u_obj, &stop_bufinfo, MP_BUFFER_READ); - mp_obj_t busy_pin_obj = args[ARG_busy_pin].u_obj; - assert_pin(busy_pin_obj, true); - const mcu_pin_obj_t* busy_pin = NULL; - if (busy_pin_obj != NULL && busy_pin_obj != mp_const_none) { - busy_pin = MP_OBJ_TO_PTR(busy_pin_obj); - assert_pin_free(busy_pin); - } + const mcu_pin_obj_t* busy_pin = validate_is_free_pin_or_none(args[ARG_busy_pin].u_obj); mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index e2b924c079..349ef7e970 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -87,9 +87,7 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); const uint16_t capture_period = args[ARG_capture_period].u_int; diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index c98ea52e06..b7980d5174 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -77,12 +77,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - assert_pin_free(scl); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); - assert_pin_free(sda); + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); mp_obj_iter_buf_t iter_buf; mp_obj_t iterable = mp_getiter(args[ARG_addresses].u_obj, &iter_buf); diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 3635f0afbd..ef80088272 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -84,10 +84,35 @@ const mp_obj_type_t mcu_pin_type = { .print = mcu_pin_print }; -void assert_pin(mp_obj_t obj, bool none_ok) { - if ((obj != mp_const_none || !none_ok) && !MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) { +mcu_pin_obj_t *validate_is_pin(mp_obj_t obj) { + if (!MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), mcu_pin_type.name); } + return MP_OBJ_TO_PTR(obj); +} + +// Validate that the obj is a pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. +mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj) { + if (obj == mp_const_none) { + return NULL; + } + return validate_is_pin(obj); +} + +mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj) { + mcu_pin_obj_t *pin = validate_is_pin(obj); + assert_pin_free(pin); + return pin; +} + +// Validate that the obj is a free pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. +mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj) { + if (obj == mp_const_none) { + return NULL; + } + mcu_pin_obj_t *pin = validate_is_pin(obj); + assert_pin_free(pin); + return pin; } void assert_pin_free(const mcu_pin_obj_t* pin) { diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 2d15dd5c58..2b40838278 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -33,7 +33,11 @@ // Type object used in Python. Should be shared between ports. extern const mp_obj_type_t mcu_pin_type; -void assert_pin(mp_obj_t obj, bool none_ok); +mcu_pin_obj_t *validate_is_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj); +mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj); + void assert_pin_free(const mcu_pin_obj_t* pin); bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index fb5c24b85c..f5aa70907a 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -77,12 +77,9 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clkpin].u_obj, false); - assert_pin(args[ARG_datapin].u_obj, false); - const mcu_pin_obj_t* clkpin = MP_OBJ_TO_PTR(args[ARG_clkpin].u_obj); - assert_pin_free(clkpin); - const mcu_pin_obj_t* datapin = MP_OBJ_TO_PTR(args[ARG_datapin].u_obj); - assert_pin_free(datapin); + + const mcu_pin_obj_t* clkpin = validate_is_free_pin(args[ARG_clkpin].u_obj); + const mcu_pin_obj_t* datapin = validate_is_free_pin(args[ARG_datapin].u_obj); ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); self->base.type = &ps2io_ps2_type; diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 53b88c61a5..d04b469c1c 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -96,10 +96,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args mp_arg_val_t parsed_args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, parsed_args); - mp_obj_t pin_obj = parsed_args[ARG_pin].u_obj; - assert_pin(pin_obj, false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); + const mcu_pin_obj_t *pin = validate_is_free_pin(parsed_args[ARG_pin].u_obj); uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int; uint32_t frequency = parsed_args[ARG_frequency].u_int; diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 8b69109f04..dbab253af4 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -90,9 +90,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); pulseio_pulsein_obj_t *self = m_new_obj(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index f2f1578478..78dccacb52 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -73,13 +73,8 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin_a].u_obj, false); - const mcu_pin_obj_t* pin_a = MP_OBJ_TO_PTR(args[ARG_pin_a].u_obj); - assert_pin_free(pin_a); - - assert_pin(args[ARG_pin_b].u_obj, false); - const mcu_pin_obj_t* pin_b = MP_OBJ_TO_PTR(args[ARG_pin_b].u_obj); - assert_pin_free(pin_b); + const mcu_pin_obj_t* pin_a = validate_is_free_pin(args[ARG_pin_a].u_obj); + const mcu_pin_obj_t* pin_b = validate_is_free_pin(args[ARG_pin_b].u_obj); rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 33d369c748..5eadb2cc49 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -66,10 +66,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - mp_obj_t pin_obj = args[0]; - assert_pin(pin_obj, false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); touchio_touchin_obj_t *self = m_new_obj(touchio_touchin_obj_t); self->base.type = &touchio_touchin_type; diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index ac89cc691e..1b7f76e122 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -78,10 +78,10 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); // TODO check type of ARG_spi? - assert_pin(args[ARG_cs].u_obj, false); - assert_pin(args[ARG_rst].u_obj, true); // may be NULL + const mcu_pin_obj_t *cs = validate_is_free_pin(args[ARG_cs].u_obj); + const mcu_pin_obj_t *rst = validate_is_free_pin_or_none(args[ARG_rst].u_obj); - mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, args[ARG_cs].u_obj, args[ARG_rst].u_obj); + mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, cs, rst); if (args[ARG_dhcp].u_bool) wiznet5k_start_dhcp(); return ret; } diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index d02adf34fb..4ed15ea213 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -45,7 +45,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, } common_hal_digitalio_digitalinout_switch_to_output(&self->clock, self->polarity == 1, DRIVE_MODE_PUSH_PULL); - if (mosi != mp_const_none) { + if (mosi != NULL) { result = common_hal_digitalio_digitalinout_construct(&self->mosi, mosi); if (result != DIGITALINOUT_OK) { common_hal_digitalio_digitalinout_deinit(&self->clock); @@ -55,7 +55,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, common_hal_digitalio_digitalinout_switch_to_output(&self->mosi, false, DRIVE_MODE_PUSH_PULL); } - if (miso != mp_const_none) { + if (miso != NULL) { // Starts out as input by default, no need to change. result = common_hal_digitalio_digitalinout_construct(&self->miso, miso); if (result != DIGITALINOUT_OK) { From b6206406de2a232299ebdd1d187c7656ae79f8f2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 28 Feb 2020 23:32:24 -0500 Subject: [PATCH 016/919] new pin validation routines; don't use mp_const_none if NULL will do --- .../boards/hallowing_m4_express/board.c | 2 +- ports/atmel-samd/boards/monster_m4sk/board.c | 2 +- ports/atmel-samd/boards/openbook_m4/board.c | 2 +- ports/atmel-samd/boards/pewpew_m4/board.c | 2 +- ports/atmel-samd/boards/pybadge/board.c | 2 +- .../atmel-samd/boards/pybadge_airlift/board.c | 2 +- ports/atmel-samd/boards/pygamer/board.c | 2 +- .../atmel-samd/boards/pygamer_advance/board.c | 2 +- .../atmel-samd/common-hal/analogio/AnalogIn.c | 4 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 8 ++-- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 6 +-- .../atmel-samd/common-hal/audioio/AudioOut.c | 6 +-- ports/atmel-samd/common-hal/busio/SPI.c | 4 +- ports/atmel-samd/common-hal/busio/UART.c | 8 ++-- .../common-hal/digitalio/DigitalInOut.c | 4 +- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 4 +- ports/cxd56/common-hal/analogio/AnalogIn.c | 4 +- ports/cxd56/common-hal/busio/UART.c | 4 +- .../cxd56/common-hal/digitalio/DigitalInOut.c | 4 +- ports/cxd56/common-hal/pulseio/PWMOut.c | 8 ++-- ports/cxd56/common-hal/pulseio/PulseIn.c | 25 +++++------ .../mimxrt10xx/common-hal/analogio/AnalogIn.c | 4 +- ports/mimxrt10xx/common-hal/busio/UART.c | 18 ++++---- .../common-hal/digitalio/DigitalInOut.c | 4 +- .../nrf/boards/clue_nrf52840_express/board.c | 2 +- ports/nrf/boards/ohs2020_badge/board.c | 2 +- ports/nrf/common-hal/analogio/AnalogIn.c | 4 +- ports/nrf/common-hal/busio/SPI.c | 4 +- ports/nrf/common-hal/busio/UART.c | 14 +++--- ports/nrf/common-hal/digitalio/DigitalInOut.c | 4 +- ports/stm32f4/common-hal/analogio/AnalogIn.c | 14 +++--- ports/stm32f4/common-hal/analogio/AnalogOut.c | 4 +- ports/stm32f4/common-hal/busio/I2C.c | 18 ++++---- ports/stm32f4/common-hal/busio/SPI.c | 44 +++++++++---------- ports/stm32f4/common-hal/busio/UART.c | 16 +++---- .../common-hal/digitalio/DigitalInOut.c | 12 ++--- ports/stm32f4/common-hal/pulseio/PWMOut.c | 16 +++---- shared-bindings/analogio/AnalogIn.c | 9 ++-- shared-bindings/analogio/AnalogOut.c | 6 +-- shared-bindings/audiobusio/I2SOut.c | 14 ++---- shared-bindings/audiobusio/PDMIn.c | 11 +---- shared-bindings/audioio/AudioOut.c | 12 +---- shared-bindings/audiopwmio/PWMAudioOut.c | 12 +---- shared-bindings/bitbangio/I2C.c | 7 ++- shared-bindings/bitbangio/OneWire.c | 5 +-- shared-bindings/bitbangio/SPI.c | 10 ++--- shared-bindings/busio/I2C.c | 10 ++--- shared-bindings/busio/OneWire.c | 4 +- shared-bindings/busio/SPI.c | 16 +++---- shared-bindings/busio/UART.c | 20 ++++----- shared-bindings/digitalio/DigitalInOut.c | 6 +-- shared-bindings/displayio/Display.c | 8 +--- shared-bindings/displayio/EPaperDisplay.c | 8 +--- shared-bindings/frequencyio/FrequencyIn.c | 4 +- shared-bindings/i2cslave/I2CSlave.c | 8 +--- shared-bindings/microcontroller/Pin.c | 29 +++++++++++- shared-bindings/microcontroller/Pin.h | 6 ++- shared-bindings/ps2io/Ps2.c | 9 ++-- shared-bindings/pulseio/PWMOut.c | 5 +-- shared-bindings/pulseio/PulseIn.c | 4 +- shared-bindings/rotaryio/IncrementalEncoder.c | 9 +--- shared-bindings/touchio/TouchIn.c | 5 +-- shared-bindings/wiznet/wiznet5k.c | 6 +-- shared-module/bitbangio/SPI.c | 6 +-- shared-module/board/__init__.c | 6 +-- 65 files changed, 241 insertions(+), 299 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 5d1ef6d9be..6bb2a591f0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 40141ca157..2377f4a9da 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 85a5888799..2d9b316474 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -55,7 +55,7 @@ uint8_t stop_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 1872d18763..5f5a01e48e 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -97,7 +97,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 28e1aec131..bead06f3c6 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index fbb4441f0e..061f3d7772 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index c052614dbb..70d4a05dcd 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -72,7 +72,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index a138c7e504..ff2da34a26 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index fc11d5d19f..2bd218cdda 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -73,7 +73,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -81,7 +81,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void analogin_reset() { diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 05a6aaf7b0..99d3762cbf 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -204,7 +204,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, } bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) { - return self->bit_clock == mp_const_none; + return self->bit_clock == NULL; } void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { @@ -213,11 +213,11 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { } reset_pin_number(self->bit_clock->number); - self->bit_clock = mp_const_none; + self->bit_clock = NULL; reset_pin_number(self->word_select->number); - self->word_select = mp_const_none; + self->word_select = NULL; reset_pin_number(self->data->number); - self->data = mp_const_none; + self->data = NULL; } void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 3a51cce8f1..f70f1fec0d 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -219,7 +219,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, } bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t* self) { - return self->clock_pin == mp_const_none; + return self->clock_pin == NULL; } void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { @@ -237,8 +237,8 @@ void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { reset_pin_number(self->clock_pin->number); reset_pin_number(self->data_pin->number); - self->clock_pin = mp_const_none; - self->data_pin = mp_const_none; + self->clock_pin = NULL; + self->data_pin = NULL; } uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t* self) { diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index b75c2b3350..1d9b4cbe8f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -304,7 +304,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, } bool common_hal_audioio_audioout_deinited(audioio_audioout_obj_t* self) { - return self->left_channel == mp_const_none; + return self->left_channel == NULL; } void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { @@ -332,10 +332,10 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { tc_set_enable(tc_insts[self->tc_index], false); reset_pin_number(self->left_channel->number); - self->left_channel = mp_const_none; + self->left_channel = NULL; #ifdef SAMD51 reset_pin_number(self->right_channel->number); - self->right_channel = mp_const_none; + self->right_channel = NULL; #endif } diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 7a1426bedc..1dc389027d 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -89,8 +89,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, Sercom* sercom = NULL; uint8_t sercom_index; uint32_t clock_pinmux = 0; - bool mosi_none = mosi == mp_const_none || mosi == NULL; - bool miso_none = miso == mp_const_none || miso == NULL; + bool mosi_none = mosi == NULL; + bool miso_none = miso == NULL; uint32_t mosi_pinmux = 0; uint32_t miso_pinmux = 0; uint8_t clock_pad = 0; diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index fb9968605f..1f6b75f972 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -65,7 +65,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint32_t tx_pinmux = 0; uint8_t tx_pad = 255; // Unset pad - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } @@ -73,8 +73,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); } - bool have_tx = tx != mp_const_none; - bool have_rx = rx != mp_const_none; + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -109,7 +109,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); tx_pad = tx->sercom[i].pad; - if (rx == mp_const_none) { + if (rx == NULL) { sercom = potential_sercom; break; } diff --git a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c index e167cbb694..68d3da806c 100644 --- a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +++ b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_never_reset( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self) { @@ -63,7 +63,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index 0adb23fc5d..fef581584f 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -292,7 +292,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { @@ -319,7 +319,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { } } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) { diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index e2ca5e4a42..cdf37c06a7 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -83,7 +83,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const // start ADC ioctl(analogin_dev[self->number].fd, ANIOC_CXD56_START, 0); - + self->pin = pin; } @@ -97,7 +97,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { close(analogin_dev[self->number].fd); analogin_dev[self->number].fd = -1; - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 3ed9809529..3bca240e01 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -60,10 +60,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size) { struct termios tio; - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + if (bits != 8) { mp_raise_ValueError(translate("Could not initialize UART")); } diff --git a/ports/cxd56/common-hal/digitalio/DigitalInOut.c b/ports/cxd56/common-hal/digitalio/DigitalInOut.c index 7b1f6cc031..c9af12e443 100644 --- a/ports/cxd56/common-hal/digitalio/DigitalInOut.c +++ b/ports/cxd56/common-hal/digitalio/DigitalInOut.c @@ -56,11 +56,11 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self board_gpio_config(self->pin->number, 0, false, true, PIN_FLOAT); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_switch_to_input(digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { diff --git a/ports/cxd56/common-hal/pulseio/PWMOut.c b/ports/cxd56/common-hal/pulseio/PWMOut.c index a0b4e79c60..7e0be566b4 100644 --- a/ports/cxd56/common-hal/pulseio/PWMOut.c +++ b/ports/cxd56/common-hal/pulseio/PWMOut.c @@ -50,7 +50,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self, const mcu_pin_obj_t *pin, uint16_t duty, uint32_t frequency, bool variable_frequency) { self->number = -1; - + for (int i = 0; i < MP_ARRAY_SIZE(pwmout_dev); i++) { if (pin->number == pwmout_dev[i].pin->number) { self->number = i; @@ -95,7 +95,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) { pwmout_dev[self->number].fd = -1; reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t *self) { @@ -131,11 +131,11 @@ bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t *self void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) { never_reset_pin_number(self->pin->number); - pwmout_dev[self->number].reset = false; + pwmout_dev[self->number].reset = false; } void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { - pwmout_dev[self->number].reset = true; + pwmout_dev[self->number].reset = true; } void pwmout_reset(void) { diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index dd2773d1d0..65ca1d97eb 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -106,7 +106,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, board_gpio_int(self->pin->number, true); } - + void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { if (common_hal_pulseio_pulsein_deinited(self)) { return; @@ -116,18 +116,18 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { board_gpio_intconfig(self->pin->number, 0, false, NULL); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } - + bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } - + void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { board_gpio_int(self->pin->number, false); self->paused = true; } - + void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t trigger_duration) { // Make sure we're paused. common_hal_pulseio_pulsein_pause(self); @@ -147,14 +147,14 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t tri pulsein_set_config(self, true); board_gpio_int(self->pin->number, true); } - + void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { common_hal_mcu_disable_interrupts(); self->start = 0; self->len = 0; common_hal_mcu_enable_interrupts(); } - + uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { if (self->len == 0) { mp_raise_IndexError(translate("pop from an empty PulseIn")); @@ -167,19 +167,19 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { return value; } - + uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t *self) { return self->maxlen; } - + bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { return self->paused; } - + uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t *self) { return self->len; } - + uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_t index) { common_hal_mcu_disable_interrupts(); if (index < 0) { @@ -193,4 +193,3 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ common_hal_mcu_enable_interrupts(); return value; } - \ No newline at end of file diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index d714001f33..2cc2681b44 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -58,7 +58,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -66,7 +66,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 4fd7afecbc..b34b948b29 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -80,8 +80,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // TODO: Allow none rx or tx - bool have_tx = tx != mp_const_none; - bool have_rx = rx != mp_const_none; + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -116,8 +116,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } // Filter for sane settings for RS485 - if (rs485_dir != mp_const_none) { - if ((rts != mp_const_none) || (cts != mp_const_none)) { + if (rs485_dir != NULL) { + if ((rts != NULL) || (cts != NULL)) { mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); } // For IMXRT the RTS pin is used for RS485 direction @@ -133,7 +133,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const uint32_t rts_count = sizeof(mcu_uart_rts_list) / sizeof(mcu_periph_obj_t); const uint32_t cts_count = sizeof(mcu_uart_cts_list) / sizeof(mcu_periph_obj_t); - if (rts != mp_const_none) { + if (rts != NULL) { for (uint32_t i=0; i < rts_count; ++i) { if (mcu_uart_rts_list[i].bank_idx == self->rx_pin->bank_idx) { if (mcu_uart_rts_list[i].pin == rts) { @@ -146,7 +146,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Selected RTS pin not valid")); } - if (cts != mp_const_none) { + if (cts != NULL) { for (uint32_t i=0; i < cts_count; ++i) { if (mcu_uart_cts_list[i].bank_idx == self->rx_pin->bank_idx) { if (mcu_uart_cts_list[i].pin == cts) { @@ -158,7 +158,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (self->cts_pin == NULL) mp_raise_ValueError(translate("Selected CTS pin not valid")); } - + self->uart = mcu_uart_banks[self->tx_pin->bank_idx - 1]; config_periph_pin(self->rx_pin); @@ -166,7 +166,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (self->rts_pin) config_periph_pin(self->rts_pin); if (self->cts_pin) - config_periph_pin(self->cts_pin); + config_periph_pin(self->cts_pin); lpuart_config_t config = { 0 }; LPUART_GetDefaultConfig(&config); @@ -187,7 +187,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Before we init, setup RS485 direction pin // ..unfortunately this isn't done by the driver library uint32_t modir = (self->uart->MODIR) & ~(LPUART_MODIR_TXRTSPOL_MASK | LPUART_MODIR_TXRTSE_MASK); - if (rs485_dir != mp_const_none) { + if (rs485_dir != NULL) { modir |= LPUART_MODIR_TXRTSE_MASK; if (rs485_invert) modir |= LPUART_MODIR_TXRTSPOL_MASK; diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index d69a18d962..603515764f 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -78,7 +78,7 @@ void common_hal_digitalio_digitalinout_never_reset( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self) { @@ -86,7 +86,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self return; } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index 5f5337a3da..e342c6d939 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 7e3e058144..9e881d7639 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = { void board_init(void) { busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; - common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, mp_const_none); + common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL); common_hal_busio_spi_never_reset(spi); displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 3bc097019e..dbcc5281ce 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -55,7 +55,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -65,7 +65,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { nrf_gpio_cfg_default(self->pin->number); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index b4ebddde1d..3f205e7782 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -155,7 +155,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * self->clock_pin_number = clock->number; claim_pin(clock); - if (mosi != mp_const_none) { + if (mosi != NULL) { config.mosi_pin = mosi->number; self->MOSI_pin_number = mosi->number; claim_pin(mosi); @@ -163,7 +163,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * self->MOSI_pin_number = NO_PIN; } - if (miso != mp_const_none) { + if (miso != NULL) { config.miso_pin = miso->number; self->MISO_pin_number = mosi->number; claim_pin(miso); diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 933faf17b8..14fa363749 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -135,10 +135,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size) { - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + // Find a free UART peripheral. self->uarte = NULL; for (size_t i = 0 ; i < MP_ARRAY_SIZE(nrfx_uartes); i++) { @@ -152,7 +152,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("All UART peripherals are in use")); } - if ( (tx == mp_const_none) && (rx == mp_const_none) ) { + if ( (tx == NULL) && (rx == NULL) ) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -165,8 +165,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } nrfx_uarte_config_t config = { - .pseltxd = (tx == mp_const_none) ? NRF_UARTE_PSEL_DISCONNECTED : tx->number, - .pselrxd = (rx == mp_const_none) ? NRF_UARTE_PSEL_DISCONNECTED : rx->number, + .pseltxd = (tx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : tx->number, + .pselrxd = (rx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : rx->number, .pselcts = NRF_UARTE_PSEL_DISCONNECTED, .pselrts = NRF_UARTE_PSEL_DISCONNECTED, .p_context = self, @@ -181,7 +181,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, _VERIFY_ERR(nrfx_uarte_init(self->uarte, &config, uart_callback_irq)); // Init buffer for rx - if ( rx != mp_const_none ) { + if ( rx != NULL ) { // Initially allocate the UART's buffer in the long-lived part of the // heap. UARTs are generally long-lived objects, but the "make long- // lived" machinery is incapable of moving internal pointers like @@ -200,7 +200,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, claim_pin(rx); } - if ( tx != mp_const_none ) { + if ( tx != NULL ) { self->tx_pin_number = tx->number; claim_pin(tx); } else { diff --git a/ports/nrf/common-hal/digitalio/DigitalInOut.c b/ports/nrf/common-hal/digitalio/DigitalInOut.c index 0836962c63..c5a7a7dfba 100644 --- a/ports/nrf/common-hal/digitalio/DigitalInOut.c +++ b/ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -56,7 +56,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self nrf_gpio_cfg_default(self->pin->number); reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/stm32f4/common-hal/analogio/AnalogIn.c b/ports/stm32f4/common-hal/analogio/AnalogIn.c index 3ee3c4dbbb..1d1b308b66 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogIn.c +++ b/ports/stm32f4/common-hal/analogio/AnalogIn.c @@ -45,11 +45,11 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } // TODO: add ADC traits to structure? - // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only - // for dual conversion. For this basic application it is never used. + // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only + // for dual conversion. For this basic application it is never used. LL_GPIO_SetPinMode(pin_port(pin->port), (uint32_t)pin_mask(pin->number), LL_GPIO_MODE_ANALOG); if (pin->adc_unit & 0x01) { - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); } else if (pin->adc_unit == 0x04) { #ifdef LL_APB2_GRP1_PERIPH_ADC3 LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); @@ -62,7 +62,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { @@ -70,7 +70,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { return; } reset_pin_number(self->pin->port,self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { @@ -116,10 +116,10 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); HAL_ADC_Start(&AdcHandle); - HAL_ADC_PollForConversion(&AdcHandle,1); + HAL_ADC_PollForConversion(&AdcHandle,1); uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - + // // Shift the value to be 16 bit. return value << 4; } diff --git a/ports/stm32f4/common-hal/analogio/AnalogOut.c b/ports/stm32f4/common-hal/analogio/AnalogOut.c index 79ced0492f..2ea969f503 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogOut.c +++ b/ports/stm32f4/common-hal/analogio/AnalogOut.c @@ -39,7 +39,7 @@ #include "stm32f4xx_hal.h" -//DAC is shared between both channels. +//DAC is shared between both channels. #if HAS_DAC DAC_HandleTypeDef handle; #endif @@ -97,7 +97,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { #if HAS_DAC reset_pin_number(self->pin->port,self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; dac_on[self->dac_index] = false; //turn off the DAC if both channels are off diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c index 1437e5e784..8e98b966d2 100644 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ b/ports/stm32f4/common-hal/busio/I2C.c @@ -100,14 +100,14 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->sda->altfn_index; + GPIO_InitStruct.Alternate = self->sda->altfn_index; HAL_GPIO_Init(pin_port(sda->port), &GPIO_InitStruct); GPIO_InitStruct.Pin = pin_mask(scl->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->scl->altfn_index; + GPIO_InitStruct.Alternate = self->scl->altfn_index; HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); //Note: due to I2C soft reboot issue, do not relocate clock init. @@ -144,7 +144,7 @@ void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { - return self->sda->pin == mp_const_none; + return self->sda == NULL; } void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { @@ -158,8 +158,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { reset_pin_number(self->sda->pin->port,self->sda->pin->number); reset_pin_number(self->scl->pin->port,self->scl->pin->number); - self->sda = mp_const_none; - self->scl = mp_const_none; + self->sda = NULL; + self->scl = NULL; } bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { @@ -169,7 +169,7 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { bool grabbed_lock = false; - //Critical section code that may be required at some point. + //Critical section code that may be required at some point. // uint32_t store_primask = __get_PRIMASK(); // __disable_irq(); // __DMB(); @@ -195,19 +195,19 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const uint8_t *data, size_t len, bool transmit_stop_bit) { - HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), + HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), (uint8_t *)data, (uint16_t)len, 500); return result == HAL_OK ? 0 : MP_EIO; } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t *data, size_t len) { - return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) + return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) == HAL_OK ? 0 : MP_EIO; } STATIC void i2c_clock_enable(uint8_t mask) { - //Note: hard reset required due to soft reboot issue. + //Note: hard reset required due to soft reboot issue. #ifdef I2C1 if (mask & (1 << 0)) { __HAL_RCC_I2C1_CLK_ENABLE(); diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index e00b5e9f0c..7e25e0a571 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -49,7 +49,7 @@ STATIC void spi_clock_enable(uint8_t mask); STATIC void spi_clock_disable(uint8_t mask); STATIC uint32_t get_busclock(SPI_TypeDef * instance) { - //SPI2 and 3 are on PCLK1, if they exist. + //SPI2 and 3 are on PCLK1, if they exist. #ifdef SPI2 if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); #endif @@ -113,7 +113,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, for (uint i = 0; i < sck_len; i++) { if (mcu_spi_sck_list[i].pin == sck) { //if both MOSI and MISO exist, loop search normally - if ((mosi != mp_const_none) && (miso != mp_const_none)) { + if ((mosi != NULL) && (miso != NULL)) { //MOSI for (uint j = 0; j < mosi_len; j++) { if (mcu_spi_mosi_list[j].pin == mosi) { @@ -133,11 +133,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[k]; break; } - } + } } } // if just MISO, reduce search - } else if (miso != mp_const_none) { + } else if (miso != NULL) { for (uint j = 0; j < miso_len; j++) { if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) { @@ -152,9 +152,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[j]; break; } - } + } // if just MOSI, reduce search - } else if (mosi != mp_const_none) { + } else if (mosi != NULL) { for (uint j = 0; j < mosi_len; j++) { if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) { @@ -169,7 +169,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = NULL; break; } - } + } } else { //throw an error immediately mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); @@ -179,8 +179,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, //handle typedef selection, errors if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || - (self->sck != NULL && self->mosi != NULL && miso == mp_const_none) || - (self->sck != NULL && self->miso != NULL && mosi == mp_const_none)) { + (self->sck != NULL && self->mosi != NULL && miso == NULL) || + (self->sck != NULL && self->miso != NULL && mosi == NULL)) { SPIx = mcu_spi_banks[self->sck->spi_index - 1]; } else { if (spi_taken) { @@ -196,7 +196,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->sck->altfn_index; + GPIO_InitStruct.Alternate = self->sck->altfn_index; HAL_GPIO_Init(pin_port(sck->port), &GPIO_InitStruct); if (self->mosi != NULL) { @@ -204,7 +204,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->mosi->altfn_index; + GPIO_InitStruct.Alternate = self->mosi->altfn_index; HAL_GPIO_Init(pin_port(mosi->port), &GPIO_InitStruct); } @@ -213,14 +213,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->miso->altfn_index; + GPIO_InitStruct.Alternate = self->miso->altfn_index; HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); } spi_clock_enable(1 << (self->sck->spi_index - 1)); reserved_spi[self->sck->spi_index - 1] = true; - - self->handle.Instance = SPIx; + + self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; // Direction change only required for RX-only, see RefMan RM0090:884 self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES; @@ -269,7 +269,7 @@ void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { - return self->sck->pin == mp_const_none; + return self->sck->pin == NULL; } void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { @@ -287,15 +287,15 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (self->miso != NULL) { reset_pin_number(self->miso->pin->port,self->miso->pin->number); } - self->sck = mp_const_none; - self->mosi = mp_const_none; - self->miso = mp_const_none; + self->sck = NULL; + self->mosi = NULL; + self->miso = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { //This resets the SPI, so check before updating it redundantly - if (baudrate == self->baudrate && polarity== self->polarity + if (baudrate == self->baudrate && polarity== self->polarity && phase == self->phase && bits == self->bits) { return true; } @@ -307,7 +307,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->handle.Init.CLKPolarity = (polarity) ? SPI_POLARITY_HIGH : SPI_POLARITY_LOW; self->handle.Init.CLKPhase = (phase) ? SPI_PHASE_2EDGE : SPI_PHASE_1EDGE; - self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, get_busclock(self->handle.Instance)); if (HAL_SPI_Init(&self->handle) != HAL_OK) @@ -325,7 +325,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { bool grabbed_lock = false; - //Critical section code that may be required at some point. + //Critical section code that may be required at some point. // uint32_t store_primask = __get_PRIMASK(); // __disable_irq(); // __DMB(); @@ -367,7 +367,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return result == HAL_OK; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { if (self->miso == NULL || self->mosi == NULL) { mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 3c19092591..0b434fd023 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -86,12 +86,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool uart_taken = false; uint8_t uart_index = 0; //origin 0 corrected - if ((rts != mp_const_none) || (cts != mp_const_none) || (rs485_dir != mp_const_none) || (rs485_invert == true)) { + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); } - + //Can have both pins, or either - if ((tx != mp_const_none) && (rx != mp_const_none)) { + if ((tx != NULL) && (rx != NULL)) { //normal find loop if both pins exist for (uint i = 0; i < tx_len; i++) { if (mcu_uart_tx_list[i].pin == tx) { @@ -115,7 +115,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uart_index = self->tx->uart_index - 1; USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), uart_index, uart_taken); - } else if (tx == mp_const_none) { + } else if (tx == NULL) { //If there is no tx, run only rx for (uint i = 0; i < rx_len; i++) { if (mcu_uart_rx_list[i].pin == rx) { @@ -132,7 +132,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uart_index = self->rx->uart_index - 1; USARTx = assign_uart_or_throw(self, (self->rx != NULL), uart_index, uart_taken); - } else if (rx == mp_const_none) { + } else if (rx == NULL) { //If there is no rx, run only tx for (uint i = 0; i < tx_len; i++) { if (mcu_uart_tx_list[i].pin == tx) { @@ -236,7 +236,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->tx->pin == mp_const_none; + return self->tx->pin == NULL; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -244,8 +244,8 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); - self->tx = mp_const_none; - self->rx = mp_const_none; + self->tx = NULL; + self->rx = NULL; gc_free(self->rbuf.buf); self->rbuf.size = 0; self->rbuf.iput = self->rbuf.iget = 0; diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c index 36c1075e23..be2db4dace 100644 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c @@ -54,7 +54,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -63,7 +63,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } reset_pin_number(self->pin->port, self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( @@ -90,7 +90,7 @@ void common_hal_digitalio_digitalinout_switch_to_output( digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_digitalinout_obj_t *self) { - return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) + return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_MODE_INPUT) ? DIRECTION_INPUT : DIRECTION_OUTPUT; } @@ -111,7 +111,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( digitalio_drive_mode_t drive_mode) { GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = pin_mask(self->pin->number); - GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? + GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? GPIO_MODE_OUTPUT_OD : GPIO_MODE_OUTPUT_PP); GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; @@ -121,7 +121,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( digitalio_digitalinout_obj_t *self) { - return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) + return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_OUTPUT_OPENDRAIN ? DRIVE_MODE_OPEN_DRAIN : DRIVE_MODE_PUSH_PULL; } @@ -145,7 +145,7 @@ void common_hal_digitalio_digitalinout_set_pull( digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( digitalio_digitalinout_obj_t *self) { - + switch (LL_GPIO_GetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number))) { case LL_GPIO_PULL_UP: diff --git a/ports/stm32f4/common-hal/pulseio/PWMOut.c b/ports/stm32f4/common-hal/pulseio/PWMOut.c index 50bacbb514..c23fa74625 100644 --- a/ports/stm32f4/common-hal/pulseio/PWMOut.c +++ b/ports/stm32f4/common-hal/pulseio/PWMOut.c @@ -72,7 +72,7 @@ STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) { return (duty*period) / ((1 << 16) - 1); } -STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, +STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, uint32_t frequency, uint32_t source_freq) { //Find the largest possible period supported by this frequency for (int i = 0; i < (1 << 16); i++) { @@ -139,7 +139,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, first_time_setup = false; //skip setting up the timer } //No problems taken, so set it up - self->tim = l_tim; + self->tim = l_tim; break; } } @@ -182,7 +182,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, uint32_t prescaler = 0; //prescaler is 15 bit uint32_t period = 0; //period is 16 bit - timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_optimal_divisors(&period, &prescaler, frequency, timer_get_source_freq(self->tim->tim_index)); //Timer init @@ -240,7 +240,7 @@ void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) { } bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) { - return self->tim == mp_const_none; + return self->tim == NULL; } void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { @@ -255,7 +255,7 @@ 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 = mp_const_none; + self->tim = NULL; //if reserved timer has no active channels, we can disable it if (!reserved_tim[self->tim->tim_index - 1]) { @@ -276,13 +276,13 @@ 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, uint32_t frequency) { //don't halt setup for the same frequency - if (frequency == self->frequency) { + if (frequency == self->frequency) { return; } uint32_t prescaler = 0; uint32_t period = 0; - timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_optimal_divisors(&period, &prescaler, frequency, timer_get_source_freq(self->tim->tim_index)); //shut down @@ -290,7 +290,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_ //Only change altered values self->handle.Init.Period = period - 1; - self->handle.Init.Prescaler = prescaler - 1; + self->handle.Init.Prescaler = prescaler - 1; //restart everything, adjusting for new speed if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 9a9b525d8b..9d1312dd86 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -63,16 +63,13 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - mp_obj_t pin_obj = args[0]; - assert_pin(pin_obj, false); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); analogio_analogin_obj_t *self = m_new_obj(analogio_analogin_obj_t); self->base.type = &analogio_analogin_type; - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); common_hal_analogio_analogin_construct(self, pin); - return (mp_obj_t) self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() @@ -141,7 +138,7 @@ STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { float reference_voltage = common_hal_analogio_analogin_get_reference_voltage(self); if (reference_voltage <= 0.0f) { - return mp_const_none; + return mp_const_none; } else { return mp_obj_new_float(reference_voltage); } diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 0816da4657..2496f17849 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -62,15 +62,13 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); - assert_pin(args[0], false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(args[0]); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); analogio_analogout_obj_t *self = m_new_obj(analogio_analogout_obj_t); self->base.type = &analogio_analogout_type; - assert_pin_free(pin); common_hal_analogio_analogout_construct(self, pin); - return self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 8f7382fde5..45f7037954 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -105,17 +105,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t bit_clock_obj = args[ARG_bit_clock].u_obj; - assert_pin(bit_clock_obj, false); - const mcu_pin_obj_t *bit_clock = MP_OBJ_TO_PTR(bit_clock_obj); - - mp_obj_t word_select_obj = args[ARG_word_select].u_obj; - assert_pin(word_select_obj, false); - const mcu_pin_obj_t *word_select = MP_OBJ_TO_PTR(word_select_obj); - - mp_obj_t data_obj = args[ARG_data].u_obj; - assert_pin(data_obj, false); - const mcu_pin_obj_t *data = MP_OBJ_TO_PTR(data_obj); + const mcu_pin_obj_t *bit_clock = validate_is_free_pin(args[ARG_bit_clock].u_obj); + const mcu_pin_obj_t *word_select = validate_is_free_pin(args[ARG_word_select].u_obj); + const mcu_pin_obj_t *data = validate_is_free_pin(args[ARG_data].u_obj); audiobusio_i2sout_obj_t *self = m_new_obj_with_finaliser(audiobusio_i2sout_obj_t); self->base.type = &audiobusio_i2sout_type; diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 0c92c24780..65bc5a9d26 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -104,15 +104,8 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t clock_pin_obj = args[ARG_clock_pin].u_obj; - assert_pin(clock_pin_obj, false); - const mcu_pin_obj_t *clock_pin = MP_OBJ_TO_PTR(clock_pin_obj); - assert_pin_free(clock_pin); - - mp_obj_t data_pin_obj = args[ARG_data_pin].u_obj; - assert_pin(data_pin_obj, false); - const mcu_pin_obj_t *data_pin = MP_OBJ_TO_PTR(data_pin_obj); - assert_pin_free(data_pin); + const mcu_pin_obj_t *clock_pin = validate_is_free_pin(args[ARG_clock_pin].u_obj); + const mcu_pin_obj_t *data_pin = validate_is_free_pin(args[ARG_data_pin].u_obj); // create PDMIn object from the given pin audiobusio_pdmin_obj_t *self = m_new_obj(audiobusio_pdmin_obj_t); diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index eb4ef1fc6c..687db22d3f 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -104,16 +104,8 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t left_channel_obj = args[ARG_left_channel].u_obj; - assert_pin(left_channel_obj, false); - const mcu_pin_obj_t *left_channel_pin = MP_OBJ_TO_PTR(left_channel_obj); - - mp_obj_t right_channel_obj = args[ARG_right_channel].u_obj; - const mcu_pin_obj_t *right_channel_pin = NULL; - if (right_channel_obj != mp_const_none) { - assert_pin(right_channel_obj, false); - right_channel_pin = MP_OBJ_TO_PTR(right_channel_obj); - } + const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj); // create AudioOut object from the given pin audioio_audioout_obj_t *self = m_new_obj(audioio_audioout_obj_t); diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 60bf085002..c1c11f9cdc 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -107,16 +107,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t left_channel_obj = args[ARG_left_channel].u_obj; - assert_pin(left_channel_obj, false); - const mcu_pin_obj_t *left_channel_pin = MP_OBJ_TO_PTR(left_channel_obj); - - mp_obj_t right_channel_obj = args[ARG_right_channel].u_obj; - const mcu_pin_obj_t *right_channel_pin = NULL; - if (right_channel_obj != mp_const_none) { - assert_pin(right_channel_obj, false); - right_channel_pin = MP_OBJ_TO_PTR(right_channel_obj); - } + const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj) // create AudioOut object from the given pin audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 01a128393b..bdfbfb2ca9 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -63,10 +63,9 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); + + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); bitbangio_i2c_obj_t *self = m_new_obj(bitbangio_i2c_obj_t); self->base.type = &bitbangio_i2c_type; diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 73bedcd8d5..20ca81c5dc 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -69,9 +69,8 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); bitbangio_onewire_obj_t *self = m_new_obj(bitbangio_onewire_obj_t); self->base.type = &bitbangio_onewire_type; diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 9a51bde665..4623523523 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -71,12 +71,10 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clock].u_obj, false); - assert_pin(args[ARG_MOSI].u_obj, true); - assert_pin(args[ARG_MISO].u_obj, true); - const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(args[ARG_clock].u_obj); - const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(args[ARG_MOSI].u_obj); - const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(args[ARG_MISO].u_obj); + + const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); bitbangio_spi_obj_t *self = m_new_obj(bitbangio_spi_obj_t); self->base.type = &bitbangio_spi_type; diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 50a95beb2e..618a5ad320 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -76,12 +76,10 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - assert_pin_free(scl); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); - assert_pin_free(sda); + + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); + common_hal_busio_i2c_construct(self, scl, sda, args[ARG_frequency].u_int, args[ARG_timeout].u_int); return (mp_obj_t)self; } diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index aca2a3ef20..b28495096d 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -69,9 +69,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); busio_onewire_obj_t *self = m_new_obj(busio_onewire_obj_t); self->base.type = &busio_onewire_type; diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 828ffb8d00..ca84c0f246 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -89,17 +89,13 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clock].u_obj, false); - assert_pin(args[ARG_MOSI].u_obj, true); - assert_pin(args[ARG_MISO].u_obj, true); - const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(args[ARG_clock].u_obj); - assert_pin_free(clock); - const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(args[ARG_MOSI].u_obj); - assert_pin_free(mosi); - const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(args[ARG_MISO].u_obj); - assert_pin_free(miso); + + const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); + common_hal_busio_spi_construct(self, clock, mosi, miso); - return (mp_obj_t)self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 02c5afb16e..ffa50fd7d8 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -105,13 +105,12 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_rx].u_obj, true); - const mcu_pin_obj_t* rx = MP_OBJ_TO_PTR(args[ARG_rx].u_obj); - assert_pin_free(rx); + const mcu_pin_obj_t* rx = validate_is_free_pin_or_none(args[ARG_rx].u_obj); + const mcu_pin_obj_t* tx = validate_is_free_pin_or_none(args[ARG_tx].u_obj); - assert_pin(args[ARG_tx].u_obj, true); - const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(args[ARG_tx].u_obj); - assert_pin_free(tx); + if ( (tx == NULL) && (rx == NULL) ) { + mp_raise_ValueError(translate("tx and rx cannot both be None")); + } uint8_t bits = args[ARG_bits].u_int; if (bits < 7 || bits > 9) { @@ -133,12 +132,11 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); validate_timeout(timeout); - const mcu_pin_obj_t* rts = MP_OBJ_TO_PTR(args[ARG_rts].u_obj); + const mcu_pin_obj_t* rts = validate_is_free_pin_or_none(args[ARG_rts].u_obj); + const mcu_pin_obj_t* cts = validate_is_free_pin_or_none(args[ARG_cts].u_obj); + const mcu_pin_obj_t* rs485_dir = validate_is_free_pin_or_none(args[ARG_rs485_dir].u_obj); - const mcu_pin_obj_t* cts = MP_OBJ_TO_PTR(args[ARG_cts].u_obj); - - const mcu_pin_obj_t* rs485_dir = args[ARG_rs485_dir].u_obj; - bool rs485_invert = args[ARG_rs485_invert].u_bool; + const bool rs485_invert = args[ARG_rs485_invert].u_bool; common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, args[ARG_baudrate].u_int, bits, parity, stop, timeout, diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 16472c12c1..1610c83f8b 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -68,12 +68,10 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, digitalio_digitalinout_obj_t *self = m_new_obj(digitalio_digitalinout_obj_t); self->base.type = &digitalio_digitalinout_type; - assert_pin(args[0], false); - mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(args[0]); - assert_pin_free(pin); + mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); common_hal_digitalio_digitalinout_construct(self, pin); - return (mp_obj_t)self; + return MP_OBJ_FROM_PTR(self); } //| .. method:: deinit() diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 5759e8ad22..9fa976b86b 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -141,13 +141,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_init_sequence].u_obj, &bufinfo, MP_BUFFER_READ); - mp_obj_t backlight_pin_obj = args[ARG_backlight_pin].u_obj; - assert_pin(backlight_pin_obj, true); - const mcu_pin_obj_t* backlight_pin = NULL; - if (backlight_pin_obj != NULL && backlight_pin_obj != mp_const_none) { - backlight_pin = MP_OBJ_TO_PTR(backlight_pin_obj); - assert_pin_free(backlight_pin); - } + const mcu_pin_obj_t* backlight_pin = validate_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); mp_float_t brightness = mp_obj_get_float(args[ARG_brightness].u_obj); diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 81e06f82f9..60a3838a40 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -129,13 +129,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size mp_get_buffer_raise(args[ARG_stop_sequence].u_obj, &stop_bufinfo, MP_BUFFER_READ); - mp_obj_t busy_pin_obj = args[ARG_busy_pin].u_obj; - assert_pin(busy_pin_obj, true); - const mcu_pin_obj_t* busy_pin = NULL; - if (busy_pin_obj != NULL && busy_pin_obj != mp_const_none) { - busy_pin = MP_OBJ_TO_PTR(busy_pin_obj); - assert_pin_free(busy_pin); - } + const mcu_pin_obj_t* busy_pin = validate_is_free_pin_or_none(args[ARG_busy_pin].u_obj); mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index e2b924c079..349ef7e970 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -87,9 +87,7 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); const uint16_t capture_period = args[ARG_capture_period].u_int; diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index c98ea52e06..b7980d5174 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -77,12 +77,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_scl].u_obj, false); - assert_pin(args[ARG_sda].u_obj, false); - const mcu_pin_obj_t* scl = MP_OBJ_TO_PTR(args[ARG_scl].u_obj); - assert_pin_free(scl); - const mcu_pin_obj_t* sda = MP_OBJ_TO_PTR(args[ARG_sda].u_obj); - assert_pin_free(sda); + const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); mp_obj_iter_buf_t iter_buf; mp_obj_t iterable = mp_getiter(args[ARG_addresses].u_obj, &iter_buf); diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 3635f0afbd..ef80088272 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -84,10 +84,35 @@ const mp_obj_type_t mcu_pin_type = { .print = mcu_pin_print }; -void assert_pin(mp_obj_t obj, bool none_ok) { - if ((obj != mp_const_none || !none_ok) && !MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) { +mcu_pin_obj_t *validate_is_pin(mp_obj_t obj) { + if (!MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), mcu_pin_type.name); } + return MP_OBJ_TO_PTR(obj); +} + +// Validate that the obj is a pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. +mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj) { + if (obj == mp_const_none) { + return NULL; + } + return validate_is_pin(obj); +} + +mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj) { + mcu_pin_obj_t *pin = validate_is_pin(obj); + assert_pin_free(pin); + return pin; +} + +// Validate that the obj is a free pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. +mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj) { + if (obj == mp_const_none) { + return NULL; + } + mcu_pin_obj_t *pin = validate_is_pin(obj); + assert_pin_free(pin); + return pin; } void assert_pin_free(const mcu_pin_obj_t* pin) { diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 2d15dd5c58..2b40838278 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -33,7 +33,11 @@ // Type object used in Python. Should be shared between ports. extern const mp_obj_type_t mcu_pin_type; -void assert_pin(mp_obj_t obj, bool none_ok); +mcu_pin_obj_t *validate_is_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj); +mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj); + void assert_pin_free(const mcu_pin_obj_t* pin); bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index fb5c24b85c..f5aa70907a 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -77,12 +77,9 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_clkpin].u_obj, false); - assert_pin(args[ARG_datapin].u_obj, false); - const mcu_pin_obj_t* clkpin = MP_OBJ_TO_PTR(args[ARG_clkpin].u_obj); - assert_pin_free(clkpin); - const mcu_pin_obj_t* datapin = MP_OBJ_TO_PTR(args[ARG_datapin].u_obj); - assert_pin_free(datapin); + + const mcu_pin_obj_t* clkpin = validate_is_free_pin(args[ARG_clkpin].u_obj); + const mcu_pin_obj_t* datapin = validate_is_free_pin(args[ARG_datapin].u_obj); ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); self->base.type = &ps2io_ps2_type; diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 53b88c61a5..d04b469c1c 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -96,10 +96,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args mp_arg_val_t parsed_args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, parsed_args); - mp_obj_t pin_obj = parsed_args[ARG_pin].u_obj; - assert_pin(pin_obj, false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); + const mcu_pin_obj_t *pin = validate_is_free_pin(parsed_args[ARG_pin].u_obj); uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int; uint32_t frequency = parsed_args[ARG_frequency].u_int; diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 8b69109f04..dbab253af4 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -90,9 +90,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin].u_obj, false); - const mcu_pin_obj_t* pin = MP_OBJ_TO_PTR(args[ARG_pin].u_obj); - assert_pin_free(pin); + const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); pulseio_pulsein_obj_t *self = m_new_obj(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index f2f1578478..78dccacb52 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -73,13 +73,8 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - assert_pin(args[ARG_pin_a].u_obj, false); - const mcu_pin_obj_t* pin_a = MP_OBJ_TO_PTR(args[ARG_pin_a].u_obj); - assert_pin_free(pin_a); - - assert_pin(args[ARG_pin_b].u_obj, false); - const mcu_pin_obj_t* pin_b = MP_OBJ_TO_PTR(args[ARG_pin_b].u_obj); - assert_pin_free(pin_b); + const mcu_pin_obj_t* pin_a = validate_is_free_pin(args[ARG_pin_a].u_obj); + const mcu_pin_obj_t* pin_b = validate_is_free_pin(args[ARG_pin_b].u_obj); rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 33d369c748..5eadb2cc49 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -66,10 +66,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - mp_obj_t pin_obj = args[0]; - assert_pin(pin_obj, false); - const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj); - assert_pin_free(pin); + const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); touchio_touchin_obj_t *self = m_new_obj(touchio_touchin_obj_t); self->base.type = &touchio_touchin_type; diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index ac89cc691e..1b7f76e122 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -78,10 +78,10 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); // TODO check type of ARG_spi? - assert_pin(args[ARG_cs].u_obj, false); - assert_pin(args[ARG_rst].u_obj, true); // may be NULL + const mcu_pin_obj_t *cs = validate_is_free_pin(args[ARG_cs].u_obj); + const mcu_pin_obj_t *rst = validate_is_free_pin_or_none(args[ARG_rst].u_obj); - mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, args[ARG_cs].u_obj, args[ARG_rst].u_obj); + mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, cs, rst); if (args[ARG_dhcp].u_bool) wiznet5k_start_dhcp(); return ret; } diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index d02adf34fb..e0ff1184fe 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -45,7 +45,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, } common_hal_digitalio_digitalinout_switch_to_output(&self->clock, self->polarity == 1, DRIVE_MODE_PUSH_PULL); - if (mosi != mp_const_none) { + if (mosi != NULL) { result = common_hal_digitalio_digitalinout_construct(&self->mosi, mosi); if (result != DIGITALINOUT_OK) { common_hal_digitalio_digitalinout_deinit(&self->clock); @@ -55,12 +55,12 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, common_hal_digitalio_digitalinout_switch_to_output(&self->mosi, false, DRIVE_MODE_PUSH_PULL); } - if (miso != mp_const_none) { + if (miso != NULL) { // Starts out as input by default, no need to change. result = common_hal_digitalio_digitalinout_construct(&self->miso, miso); if (result != DIGITALINOUT_OK) { common_hal_digitalio_digitalinout_deinit(&self->clock); - if (mosi != mp_const_none) { + if (mosi != NULL) { common_hal_digitalio_digitalinout_deinit(&self->mosi); } mp_raise_ValueError(translate("MISO pin init failed.")); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index bbf177384b..789318a053 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -103,12 +103,12 @@ mp_obj_t common_hal_board_create_uart(void) { #ifdef DEFAULT_UART_BUS_RTS const mcu_pin_obj_t* rts = MP_OBJ_TO_PTR(DEFAULT_UART_BUS_RTS); #else - const mcu_pin_obj_t* rts = mp_const_none; + const mcu_pin_obj_t* rts = NULL; #endif #ifdef DEFAULT_UART_BUS_CTS const mcu_pin_obj_t* cts = MP_OBJ_TO_PTR(DEFAULT_UART_BUS_CTS); #else - const mcu_pin_obj_t* cts = mp_const_none; + const mcu_pin_obj_t* cts = NULL; #endif #ifdef DEFAULT_UART_IS_RS485 const mcu_pin_obj_t* rs485_dir = MP_OBJ_TO_PTR(DEFAULT_UART_BUS_RS485DIR); @@ -118,7 +118,7 @@ mp_obj_t common_hal_board_create_uart(void) { const bool rs485_invert = false; #endif #else - const mcu_pin_obj_t* rs485_dir = mp_const_none; + const mcu_pin_obj_t* rs485_dir = NULL; const bool rs485_invert = false; #endif From 611ef27ac2a312faffeba5be5e773403b3870422 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Sat, 29 Feb 2020 14:44:33 -0500 Subject: [PATCH 017/919] stm32: Add PulseOut support Matches the implementations of the NRF and Atmel ports. TIM7 is used as it does not have a tied pin. Contains some register micromanagement since HAL support for the TIM7 timer is limited. --- ports/stm32f4/common-hal/pulseio/PWMOut.c | 2 +- ports/stm32f4/common-hal/pulseio/PulseOut.c | 155 +++++++++++++++++++- ports/stm32f4/common-hal/pulseio/PulseOut.h | 2 +- ports/stm32f4/supervisor/port.c | 2 + 4 files changed, 157 insertions(+), 4 deletions(-) diff --git a/ports/stm32f4/common-hal/pulseio/PWMOut.c b/ports/stm32f4/common-hal/pulseio/PWMOut.c index 50bacbb514..4bb3afae45 100644 --- a/ports/stm32f4/common-hal/pulseio/PWMOut.c +++ b/ports/stm32f4/common-hal/pulseio/PWMOut.c @@ -163,7 +163,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, } else if (var_freq_mismatch) { mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use")); } else { - mp_raise_ValueError(translate("Invalid pins")); + mp_raise_ValueError(translate("Invalid pins for PWMOut")); } } diff --git a/ports/stm32f4/common-hal/pulseio/PulseOut.c b/ports/stm32f4/common-hal/pulseio/PulseOut.c index d393afc5c6..033e1c7fe1 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseOut.c +++ b/ports/stm32f4/common-hal/pulseio/PulseOut.c @@ -35,21 +35,172 @@ #include "shared-bindings/pulseio/PWMOut.h" #include "supervisor/shared/translate.h" +#include "stm32f4xx_hal.h" +#include "common-hal/microcontroller/Pin.h" +#include "tick.h" + +// A single timer is shared amongst all PulseOut objects under the assumption that +// the code is single threaded. +STATIC uint8_t refcount = 0; + +STATIC uint16_t *pulse_array = NULL; +STATIC volatile uint16_t pulse_array_index = 0; +STATIC uint16_t pulse_array_length; + +//Timer is shared, must be accessible by interrupt +STATIC TIM_HandleTypeDef t7_handle; +pulseio_pulseout_obj_t *curr_pulseout = NULL; + +STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { + // Turn on PWM + HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel); +} + +STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { + // Turn off PWM + HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); + // Make sure pin is low. + HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), + pin_mask(pulseout->pwmout->tim->pin->number), 0); +} + +STATIC void start_timer(void) { + // Set the new period + t7_handle.Init.Period = pulse_array[pulse_array_index] - 1; + HAL_TIM_Base_Init(&t7_handle); + + // TIM7 has limited HAL support, set registers manually + t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE); + +} + +STATIC void pulseout_event_handler(void) { + if (curr_pulseout->pwmout == NULL) { + return; //invalid interrupt + } + + HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1); + HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0); + + pulse_array_index++; + + // No more pulses. Turn off output and don't restart. + if (pulse_array_index >= pulse_array_length) { + turn_off(curr_pulseout); + return; + } + + // Alternate on and off, starting with on. + if (pulse_array_index % 2 == 0) { + turn_on(curr_pulseout); + } else { + turn_off(curr_pulseout); + } + + // Count up to the next given value. + start_timer(); +} void pulseout_reset() { + __HAL_RCC_TIM7_CLK_DISABLE(); + refcount = 0; } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, const pulseio_pwmout_obj_t* carrier) { - mp_raise_NotImplementedError(translate("PulseOut not yet supported")); + // Add to active PulseOuts + refcount++; + + // Calculate a 1 ms period + uint32_t source, clk_div; + source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1 + clk_div = RCC->CFGR & RCC_CFGR_PPRE1; + // APB quirk, see See DM00031020 Rev 4, page 115. + if (clk_div != 0) { + // APB prescaler for this timer is > 1 + source *= 2; + } + + uint32_t prescaler = source/1000000; //1us intervals + + __HAL_RCC_TIM7_CLK_ENABLE(); + HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0); + HAL_NVIC_EnableIRQ(TIM7_IRQn); + + // Timers 6 and 7 have no pins, so using them doesn't affect PWM availability + t7_handle.Instance = TIM7; + t7_handle.Init.Period = 100; //immediately replaced. + t7_handle.Init.Prescaler = prescaler - 1; + t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP; + t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + + HAL_TIM_Base_Init(&t7_handle); + t7_handle.Instance->SR = 0; + + // The HAL can't work with const, recast required. + self->pwmout = (pulseio_pwmout_obj_t*)carrier; + + turn_off(self); } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { - return true; + return self->pwmout == NULL; } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { + if (common_hal_pulseio_pulseout_deinited(self)) { + return; + } + turn_on(self); + self->pwmout = NULL; + + refcount--; + if (refcount == 0) { + __HAL_RCC_TIM7_CLK_DISABLE(); + } } void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) { + pulse_array = pulses; + pulse_array_index = 0; + pulse_array_length = length; + curr_pulseout = self; + + turn_on(self); + + // Count up to the next given value. + start_timer(); + + // Use when debugging, or issues are irrecoverable + // uint32_t starttime = supervisor_ticks_ms64(); + // uint32_t timeout = 10000; + while(pulse_array_index < length) { + // Do other things while we wait. The interrupts will handle sending the + // signal. + RUN_BACKGROUND_TASKS; + + // Use when debugging, or issues are irrecoverable + // if ((supervisor_ticks_ms64() - starttime ) > timeout ) { + // mp_raise_RuntimeError(translate("Error: Send Timeout")); + // } + } + //turn off timer counter. + t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; +} + +void TIM7_IRQHandler(void) +{ + // Detect TIM Update event + if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE); + pulseout_event_handler(); + } + } } diff --git a/ports/stm32f4/common-hal/pulseio/PulseOut.h b/ports/stm32f4/common-hal/pulseio/PulseOut.h index 45823d28a4..aa97396d00 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseOut.h +++ b/ports/stm32f4/common-hal/pulseio/PulseOut.h @@ -34,7 +34,7 @@ typedef struct { mp_obj_base_t base; - const pulseio_pwmout_obj_t *pwmout; + pulseio_pwmout_obj_t *pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index e9e4720d77..ecb4d3d15c 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -35,6 +35,7 @@ #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 "stm32f4/clocks.h" #include "stm32f4/gpio.h" @@ -60,6 +61,7 @@ void reset_port(void) { spi_reset(); uart_reset(); pwmout_reset(); + pulseout_reset(); } void reset_to_bootloader(void) { From 6bb1649b4b490285628767f92307a671b225237d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Sat, 29 Feb 2020 14:52:49 -0500 Subject: [PATCH 018/919] Add translations --- locale/ID.po | 12 ++++++------ locale/circuitpython.pot | 12 ++++++------ locale/de_DE.po | 12 ++++++------ locale/en_US.po | 12 ++++++------ locale/en_x_pirate.po | 12 ++++++------ locale/es.po | 12 ++++++------ locale/fil.po | 12 ++++++------ locale/fr.po | 12 ++++++------ locale/it_IT.po | 12 ++++++------ locale/ko.po | 12 ++++++------ locale/pl.po | 12 ++++++------ locale/pt_BR.po | 12 ++++++------ locale/zh_Latn_pinyin.po | 15 +++++++++------ 13 files changed, 81 insertions(+), 78 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 01f461392f..8e74df8c07 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -906,10 +906,13 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1133,6 +1136,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1175,10 +1179,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 354dbc4ba4..45e7957874 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -895,10 +895,13 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1121,6 +1124,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1161,10 +1165,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 056f56d749..9456e83e53 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -903,10 +903,13 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Ungültige Pins" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Ungültige Polarität" @@ -1136,6 +1139,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1178,10 +1182,6 @@ msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 58c798ce4b..b02fc66da9 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -895,10 +895,13 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1121,6 +1124,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1161,10 +1165,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e2ee9c887d..1c38c4f5cf 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -899,10 +899,13 @@ msgstr "Belay that! Invalid pin for starboard-side channel" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1125,6 +1128,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1165,10 +1169,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/es.po b/locale/es.po index 8d445a469a..305f829990 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -903,10 +903,13 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "pines inválidos" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polaridad inválida" @@ -1135,6 +1138,7 @@ msgstr "" "PWM frecuencia no esta escrito cuando el variable_frequency es falso en " "construcion" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1177,10 +1181,6 @@ msgstr "Pull no se usa cuando la dirección es output." msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index b8b61d723b..6781538974 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -911,10 +911,13 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Mali ang pins" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Mali ang polarity" @@ -1141,6 +1144,7 @@ msgid "" msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1183,10 +1187,6 @@ msgstr "Pull hindi ginagamit kapag ang direksyon ay output." msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 625b4e91aa..e2c924113b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -917,10 +917,13 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Broches invalides" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarité invalide" @@ -1155,6 +1158,7 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1196,10 +1200,6 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 93af9bdb86..bf48daffdf 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -913,10 +913,13 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Pin non validi" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarità non valida" @@ -1150,6 +1153,7 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1192,10 +1196,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 04ab849d43..37436f58f9 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -899,10 +899,13 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1125,6 +1128,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1165,10 +1169,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index d766191822..132b09b237 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -900,10 +900,13 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Złe nóżki" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Zła polaryzacja" @@ -1126,6 +1129,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1166,10 +1170,6 @@ msgstr "Podciągnięcie nieużywane w trybie wyjścia." msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b948003a18..01f1624b8d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -906,10 +906,13 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Pinos inválidos" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -1136,6 +1139,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1177,10 +1181,6 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9a9473436f..b094fa274b 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-02-29 14:52-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -908,10 +908,13 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c -#: ports/stm32f4/common-hal/pulseio/PWMOut.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" +#: ports/stm32f4/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" @@ -1140,6 +1143,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "Shàng bù zhīchí ParallelBus" @@ -1180,10 +1184,6 @@ msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." msgid "PulseIn not yet supported" msgstr "Shàng bù zhīchí PulseIn" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not yet supported" -msgstr "Shàng bù zhīchí PulseOut" - #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" @@ -3081,6 +3081,9 @@ msgstr "líng bù" #~ msgid "Pixel beyond bounds of buffer" #~ msgstr "Xiàngsù chāochū huǎnchōng qū biānjiè" +#~ msgid "PulseOut not yet supported" +#~ msgstr "Shàng bù zhīchí PulseOut" + #~ msgid "Range out of bounds" #~ msgstr "Fànwéi chāochū biānjiè" From 84359354296e462490b5541cad639def229bf029 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 29 Feb 2020 15:37:32 -0500 Subject: [PATCH 019/919] update uses of assert_pin_free; remove redundant checks --- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 4 +--- ports/atmel-samd/common-hal/audiobusio/PDMIn.c | 3 +-- ports/atmel-samd/common-hal/audioio/AudioOut.c | 3 +-- ports/nrf/common-hal/audiobusio/PDMIn.c | 3 +-- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 3 +-- shared-bindings/displayio/FourWire.c | 13 +++---------- shared-bindings/displayio/I2CDisplay.c | 7 +------ shared-bindings/displayio/ParallelBus.c | 18 ++++++------------ 8 files changed, 15 insertions(+), 39 deletions(-) diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 99d3762cbf..8f827e7fba 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -89,6 +89,7 @@ void i2sout_reset(void) { #endif } +// Caller validates that pins are free. void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, const mcu_pin_obj_t* bit_clock, const mcu_pin_obj_t* word_select, const mcu_pin_obj_t* data, bool left_justified) { @@ -182,9 +183,6 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, #ifdef SAMD21 #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_G #endif - assert_pin_free(bit_clock); - assert_pin_free(word_select); - assert_pin_free(data); self->bit_clock = bit_clock; self->word_select = word_select; diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index f70f1fec0d..76e66ab45f 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -74,6 +74,7 @@ void pdmin_reset(void) { I2S->CTRLA.reg = I2S_CTRLA_SWRST; } +// Caller validates that pins are free. void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, const mcu_pin_obj_t* clock_pin, const mcu_pin_obj_t* data_pin, @@ -157,8 +158,6 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #ifdef SAMD21 #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_G #endif - assert_pin_free(clock_pin); - assert_pin_free(data_pin); uint32_t clock_divisor = (uint32_t) roundf( 48000000.0f / sample_rate / oversample); float mic_clock_freq = 48000000.0f / clock_divisor; diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 1d9b4cbe8f..75621b361f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -115,6 +115,7 @@ void audioout_reset(void) { // TODO(tannewt): Turn off the DAC clocks to save power. } +// Caller validates that pins are free. void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { #ifdef SAMD51 @@ -135,7 +136,6 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, if (left_channel != &pin_PA02) { mp_raise_ValueError(translate("Invalid pin")); } - assert_pin_free(left_channel); claim_pin(left_channel); #endif #ifdef SAMD51 @@ -143,7 +143,6 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, if (left_channel != &pin_PA02 && left_channel != &pin_PA05) { mp_raise_ValueError(translate("Invalid pin for left channel")); } - assert_pin_free(left_channel); if (right_channel != NULL && right_channel != &pin_PA02 && right_channel != &pin_PA05) { mp_raise_ValueError(translate("Invalid pin for right channel")); } diff --git a/ports/nrf/common-hal/audiobusio/PDMIn.c b/ports/nrf/common-hal/audiobusio/PDMIn.c index a7f9c9d747..ddd34174b2 100644 --- a/ports/nrf/common-hal/audiobusio/PDMIn.c +++ b/ports/nrf/common-hal/audiobusio/PDMIn.c @@ -34,6 +34,7 @@ NRF_PDM_Type *nrf_pdm = NRF_PDM; static uint32_t dummy_buffer[4]; +// Caller validates that pins are free. void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, const mcu_pin_obj_t* clock_pin, const mcu_pin_obj_t* data_pin, @@ -41,8 +42,6 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, uint8_t bit_depth, bool mono, uint8_t oversample) { - assert_pin_free(clock_pin); - assert_pin_free(data_pin); claim_pin(clock_pin); claim_pin(data_pin); diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index cdb57bbe1d..7b99901d5c 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -155,10 +155,9 @@ void audiopwmout_background() { } } +// Caller validates that pins are free. void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { - assert_pin_free(left_channel); - assert_pin_free(right_channel); self->pwm = pwmout_allocate(256, PWM_PRESCALER_PRESCALER_DIV_1, true, NULL, NULL); if (!self->pwm) { mp_raise_RuntimeError(translate("All timers in use")); diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 51203d4604..f013cc18fc 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -73,16 +73,9 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t command = args[ARG_command].u_obj; - mp_obj_t chip_select = args[ARG_chip_select].u_obj; - assert_pin_free(command); - assert_pin_free(chip_select); - mp_obj_t reset = args[ARG_reset].u_obj; - if (reset != mp_const_none) { - assert_pin_free(reset); - } else { - reset = NULL; - } + mcu_pin_obj_t *command = validate_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *chip_select = validate_is_free_pin(args[ARG_chip_select].u_obj); + mcu_pin_obj_t *reset = validate_is_free_pin_or_none(args[ARG_reset].u_obj); displayio_fourwire_obj_t* self = NULL; mp_obj_t spi = args[ARG_spi_bus].u_obj; diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 9b863f6567..03779fba99 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -69,12 +69,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t reset = args[ARG_reset].u_obj; - if (reset != mp_const_none) { - assert_pin_free(reset); - } else { - reset = NULL; - } + mcu_pin_obj_t *reset = validate_is_free_pin_or_none(args[ARG_reset].u_obj); displayio_i2cdisplay_obj_t* self = NULL; mp_obj_t i2c = args[ARG_i2c_bus].u_obj; diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index f7195b9ccb..33a165af96 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -76,18 +76,12 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_obj_t data0 = args[ARG_data0].u_obj; - mp_obj_t command = args[ARG_command].u_obj; - mp_obj_t chip_select = args[ARG_chip_select].u_obj; - mp_obj_t write = args[ARG_write].u_obj; - mp_obj_t read = args[ARG_read].u_obj; - mp_obj_t reset = args[ARG_reset].u_obj; - assert_pin_free(data0); - assert_pin_free(command); - assert_pin_free(chip_select); - assert_pin_free(write); - assert_pin_free(read); - assert_pin_free(reset); + mcu_pin_obj_t *data0 = validate_is_free_pin(args[ARG_data0].u_obj); + mcu_pin_obj_t *command = validate_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *chip_select = validate_is_free_pin(args[ARG_chip_select].u_obj); + mcu_pin_obj_t *write = validate_is_free_pin(args[ARG_write].u_obj); + mcu_pin_obj_t *read = validate_is_free_pin(args[ARG_read].u_obj); + mcu_pin_obj_t *reset = validate_is_free_pin(args[ARG_reset].u_obj); displayio_parallelbus_obj_t* self = NULL; for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { From e30b1d3121b094e8f8ae67ff1b66f381c37c6a07 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 29 Feb 2020 22:48:11 -0500 Subject: [PATCH 020/919] missing semicolon --- shared-bindings/audiopwmio/PWMAudioOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index c1c11f9cdc..ab1d9c9fc6 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -108,7 +108,7 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); - const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj) + const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj); // create AudioOut object from the given pin audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); From 511c1808699ef29908ab99180866c46dfeae4b95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Mar 2020 09:38:34 -0600 Subject: [PATCH 021/919] parse: push_result_token: throw an exception on too-long names Before this, such names would instead cause an assertion error inside qstr_from_strn. A simple reproducer is a python source file containing the letter "a" repeated 256 times --- py/parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/parse.c b/py/parse.c index 911b891e0f..864528470f 100644 --- a/py/parse.c +++ b/py/parse.c @@ -477,6 +477,9 @@ STATIC void push_result_token(parser_t *parser, uint8_t rule_id) { mp_parse_node_t pn; mp_lexer_t *lex = parser->lexer; if (lex->tok_kind == MP_TOKEN_NAME) { + if(lex->vstr.len >= (1 << (8 * MICROPY_QSTR_BYTES_IN_LEN))) { + mp_raise_msg(&mp_type_SyntaxError, translate("Name too long")); + } qstr id = qstr_from_strn(lex->vstr.buf, lex->vstr.len); #if MICROPY_COMP_CONST // if name is a standalone identifier, look it up in the table of dynamic constants From 862830da322b52680cc809a25985636f608aa42d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Mar 2020 09:40:43 -0600 Subject: [PATCH 022/919] compile: Give a proper error on 'async with'/'async for' outside 'async def' A simple reproducer is: async for x in():x --- py/compile.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/py/compile.c b/py/compile.c index 77715d3fe5..d5fae02994 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1711,6 +1711,16 @@ STATIC void compile_yield_from(compiler_t *comp) { } #if MICROPY_PY_ASYNC_AWAIT +STATIC bool compile_require_async_context(compiler_t *comp, mp_parse_node_struct_t *pns) { + int scope_flags = comp->scope_cur->scope_flags; + if(scope_flags & MP_SCOPE_FLAG_GENERATOR) { + return true; + } + compile_syntax_error(comp, (mp_parse_node_t)pns, + translate("'async for' or 'async with' outside async function")); + return false; +} + STATIC void compile_await_object_method(compiler_t *comp, qstr method) { EMIT_ARG(load_method, method, false); EMIT_ARG(call_method, 0, 0, 0); @@ -1720,6 +1730,10 @@ STATIC void compile_await_object_method(compiler_t *comp, qstr method) { STATIC void compile_async_for_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { // comp->break_label |= MP_EMIT_BREAK_FROM_FOR; + if(!compile_require_async_context(comp, pns)) { + return; + } + qstr context = MP_PARSE_NODE_LEAF_ARG(pns->nodes[1]); uint while_else_label = comp_next_label(comp); uint try_exception_label = comp_next_label(comp); @@ -1857,6 +1871,9 @@ STATIC void compile_async_with_stmt_helper(compiler_t *comp, int n, mp_parse_nod } STATIC void compile_async_with_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { + if(!compile_require_async_context(comp, pns)) { + return; + } // get the nodes for the pre-bit of the with (the a as b, c as d, ... bit) mp_parse_node_t *nodes; int n = mp_parse_node_extract_list(&pns->nodes[0], PN_with_stmt_list, &nodes); From 74bf17bb0dee27a431e2fc6d0e07ee1df833cf1b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 1 Mar 2020 11:48:20 -0600 Subject: [PATCH 023/919] Makefiles: add targets to build unix port, mpy-cross for fuzzing This assumes you have properly install afl-fuzz with afl-clang-fast. Tested with AFLplusplus 2.60c-75-g2c6847b. --- mpy-cross/.gitignore | 1 + mpy-cross/Makefile.fuzz | 6 ++++++ ports/unix/Makefile | 12 ++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 mpy-cross/Makefile.fuzz diff --git a/mpy-cross/.gitignore b/mpy-cross/.gitignore index 0681b685fa..80d7acd423 100644 --- a/mpy-cross/.gitignore +++ b/mpy-cross/.gitignore @@ -3,4 +3,5 @@ /mpy-cross.static /mpy-cross.static.exe /mpy-cross.static-raspbian +/mpy-cross.fuzz /pitools diff --git a/mpy-cross/Makefile.fuzz b/mpy-cross/Makefile.fuzz new file mode 100644 index 0000000000..ca59788f4c --- /dev/null +++ b/mpy-cross/Makefile.fuzz @@ -0,0 +1,6 @@ + +PROG=mpy-cross.fuzz +BUILD=build-static +STATIC_BUILD=1 +CC=afl-clang-fast +include mpy-cross.mk diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 7ffa0fd082..63c4980c31 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -277,6 +277,18 @@ coverage_test: coverage coverage_clean: $(MAKE) V=2 BUILD=build-coverage PROG=micropython_coverage clean +# build an interpreter for fuzzing +fuzz: + $(MAKE) \ + CC=afl-clang-fast DEBUG=1 \ + CFLAGS_EXTRA='$(CFLAGS_EXTRA) -ffunction-sections' \ + LDFLAGS_EXTRA='$(LDFLAGS_EXTRA)' \ + BUILD=build-fuzz PROG=micropython_fuzz + +fuzz_clean: + $(MAKE) V=2 BUILD=build-fuzz PROG=micropython_fuzz clean + + # Value of configure's --host= option (required for cross-compilation). # Deduce it from CROSS_COMPILE by default, but can be overridden. ifneq ($(CROSS_COMPILE),) From 402262a843712adbdc447511f07008057ee1a86a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 2 Mar 2020 09:13:06 -0600 Subject: [PATCH 024/919] make translate --- locale/ID.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/circuitpython.pot | 217 ++++++++++++++++++++++++++++++++++++++- locale/de_DE.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/en_US.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/en_x_pirate.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/es.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/fil.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/fr.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/it_IT.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/ko.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/pl.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/pt_BR.po | 217 ++++++++++++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 217 ++++++++++++++++++++++++++++++++++++++- 13 files changed, 2795 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 01f461392f..9978600eac 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -184,6 +184,10 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "'align' membutuhkan 1 argumen" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' diluar fungsi" @@ -684,6 +688,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -999,6 +1007,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1133,6 +1145,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1593,6 +1606,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1606,6 +1623,10 @@ msgstr "argumen num/types tidak cocok" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1614,6 +1635,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mode compile buruk" @@ -1857,6 +1890,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "tidak dapat melakukan relative import" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1913,6 +1950,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1938,6 +1999,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1951,6 +2016,10 @@ msgstr "" msgid "empty heap" msgstr "heap kosong" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -2017,6 +2086,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2025,6 +2098,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "bit pertama(firstbit) harus berupa MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2041,6 +2122,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "fungsi tidak dapat mengambil argumen keyword" @@ -2117,6 +2202,10 @@ msgstr "" msgid "incorrect padding" msgstr "lapisan (padding) tidak benar" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2127,10 +2216,46 @@ msgstr "index keluar dari jangkauan" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2209,6 +2334,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2265,6 +2398,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2288,6 +2425,10 @@ msgstr "" msgid "module not found" msgstr "modul tidak ditemukan" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "perkalian *x dalam assignment" @@ -2312,6 +2453,10 @@ msgstr "harus menentukan semua pin sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2398,6 +2543,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2457,6 +2610,14 @@ msgstr "modul tidak ditemukan" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2466,6 +2627,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2541,6 +2718,10 @@ msgstr "" msgid "queue overflow" msgstr "antrian meluap (overflow)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relative import" @@ -2558,6 +2739,10 @@ msgstr "anotasi return harus sebuah identifier" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2580,6 +2765,10 @@ msgstr "" msgid "script compilation not supported" msgstr "kompilasi script tidak didukung" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2592,6 +2781,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2608,6 +2801,10 @@ msgstr "" msgid "soft reboot\n" msgstr "memulai ulang software(soft reboot)\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2698,12 +2895,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2834,6 +3035,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2842,6 +3051,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 354dbc4ba4..d44fe8d195 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -183,6 +183,10 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "" @@ -673,6 +677,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -988,6 +996,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1121,6 +1133,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1570,6 +1583,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1583,6 +1600,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1591,6 +1612,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1833,6 +1866,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1889,6 +1926,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1914,6 +1975,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1927,6 +1992,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1993,6 +2062,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2001,6 +2074,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2017,6 +2098,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2093,6 +2178,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2103,10 +2192,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2185,6 +2310,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2241,6 +2374,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2264,6 +2401,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2288,6 +2429,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2374,6 +2519,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2432,6 +2585,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2441,6 +2602,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2516,6 +2693,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2533,6 +2714,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2555,6 +2740,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2567,6 +2756,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2583,6 +2776,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2672,12 +2869,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2808,6 +3009,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2816,6 +3025,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 056f56d749..0d85f1931d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -185,6 +185,10 @@ msgstr "'S' und 'O' sind keine unterstützten Formattypen" msgid "'align' requires 1 argument" msgstr "'align' erfordert genau ein Argument" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' außerhalb einer Funktion" @@ -677,6 +681,10 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Kommando nicht gesendet." @@ -997,6 +1005,10 @@ msgstr "Muss eine %q Unterklasse sein." msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1136,6 +1148,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1598,6 +1611,10 @@ msgstr "adresses ist leer" msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "Argument hat falschen Typ" @@ -1611,6 +1628,10 @@ msgstr "Anzahl/Type der Argumente passen nicht" msgid "argument should be a '%q' not a '%q'" msgstr "Argument sollte '%q' sein, nicht '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" @@ -1619,6 +1640,18 @@ msgstr "Array/Bytes auf der rechten Seite erforderlich" msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1861,6 +1894,10 @@ msgstr "Name %q kann nicht importiert werden" msgid "cannot perform relative import" msgstr "kann keinen relativen Import durchführen" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1918,6 +1955,30 @@ msgstr "constant muss ein integer sein" msgid "conversion to object" msgstr "Umwandlung zu Objekt" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "Dezimalzahlen nicht unterstützt" @@ -1943,6 +2004,10 @@ msgstr "destination_length muss ein int >= 0 sein" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1956,6 +2021,10 @@ msgstr "leer" msgid "empty heap" msgstr "leerer heap" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "leeres Trennzeichen" @@ -2022,6 +2091,10 @@ msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" msgid "filesystem must provide mount method" msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" @@ -2030,6 +2103,14 @@ msgstr "Das erste Argument für super() muss type sein" msgid "firstbit must be MSB" msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float zu groß" @@ -2046,6 +2127,10 @@ msgstr "" msgid "full" msgstr "voll" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "Funktion akzeptiert keine Keyword-Argumente" @@ -2123,6 +2208,10 @@ msgstr "unvollständiger Formatschlüssel" msgid "incorrect padding" msgstr "padding ist inkorrekt" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2133,10 +2222,46 @@ msgstr "index außerhalb der Reichweite" msgid "indices must be integers" msgstr "Indizes müssen ganze Zahlen sein" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler muss eine function sein" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 muss >= 2 und <= 36 sein" @@ -2215,6 +2340,14 @@ msgstr "issubclass() arg 1 muss eine Klasse sein" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2277,6 +2410,10 @@ msgstr "map buffer zu klein" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2300,6 +2437,10 @@ msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt" msgid "module not found" msgstr "Modul nicht gefunden" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "mehrere *x in Zuordnung" @@ -2324,6 +2465,10 @@ msgstr "sck/mosi/miso müssen alle spezifiziert sein" msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "Name '%q' ist nirgends definiert worden (Schreibweise kontrollieren)" @@ -2410,6 +2555,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2468,6 +2621,14 @@ msgstr "offset außerhalb der Grenzen" msgid "only bit_depth=16 is supported" msgstr "nur eine bit_depth=16 wird unterstützt" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "nur eine sample_rate=16000 wird unterstützt" @@ -2477,6 +2638,22 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord erwartet ein Zeichen" @@ -2554,6 +2731,10 @@ msgstr "" msgid "queue overflow" msgstr "Warteschlangenüberlauf" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relativer Import" @@ -2571,6 +2752,10 @@ msgstr "return annotation muss ein identifier sein" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2595,6 +2780,10 @@ msgstr "Der schedule stack ist voll" msgid "script compilation not supported" msgstr "kompilieren von Skripten nicht unterstützt" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2607,6 +2796,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2623,6 +2816,10 @@ msgstr "small int Überlauf" msgid "soft reboot\n" msgstr "weicher reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -2713,12 +2910,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2853,6 +3054,14 @@ msgstr "value_count muss größer als 0 sein" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -2861,6 +3070,10 @@ msgstr "falsche Anzahl an Argumenten" msgid "wrong number of values to unpack" msgstr "falsche Anzahl zu entpackender Werte" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x Wert außerhalb der Grenzen" diff --git a/locale/en_US.po b/locale/en_US.po index 58c798ce4b..bd21a7e0ff 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -183,6 +183,10 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "" @@ -673,6 +677,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -988,6 +996,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1121,6 +1133,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1570,6 +1583,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1583,6 +1600,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1591,6 +1612,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1833,6 +1866,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1889,6 +1926,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1914,6 +1975,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1927,6 +1992,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1993,6 +2062,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2001,6 +2074,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2017,6 +2098,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2093,6 +2178,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2103,10 +2192,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2185,6 +2310,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2241,6 +2374,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2264,6 +2401,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2288,6 +2429,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2374,6 +2519,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2432,6 +2585,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2441,6 +2602,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2516,6 +2693,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2533,6 +2714,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2555,6 +2740,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2567,6 +2756,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2583,6 +2776,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2672,12 +2869,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2808,6 +3009,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2816,6 +3025,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e2ee9c887d..e6b3d36caf 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -185,6 +185,10 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "" @@ -677,6 +681,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -992,6 +1000,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1125,6 +1137,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1574,6 +1587,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1587,6 +1604,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1595,6 +1616,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1837,6 +1870,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1893,6 +1930,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1918,6 +1979,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1931,6 +1996,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1997,6 +2066,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2005,6 +2078,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2021,6 +2102,10 @@ msgstr "" msgid "full" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2097,6 +2182,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2107,10 +2196,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2189,6 +2314,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2245,6 +2378,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2268,6 +2405,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2292,6 +2433,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2378,6 +2523,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2436,6 +2589,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2445,6 +2606,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2520,6 +2697,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2537,6 +2718,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2559,6 +2744,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2571,6 +2760,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2587,6 +2780,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2676,12 +2873,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2812,6 +3013,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2820,6 +3029,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/es.po b/locale/es.po index 8d445a469a..35b8c565f7 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -185,6 +185,10 @@ msgstr "'S' y 'O' no son compatibles con los tipos de formato" msgid "'align' requires 1 argument" msgstr "'align' requiere 1 argumento" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' fuera de la función" @@ -679,6 +683,10 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fallo enviando comando" @@ -996,6 +1004,10 @@ msgstr "Debe de ser una subclase de %q" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1135,6 +1147,7 @@ msgstr "" "PWM frecuencia no esta escrito cuando el variable_frequency es falso en " "construcion" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1594,6 +1607,10 @@ msgstr "addresses esta vacío" msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" @@ -1607,6 +1624,10 @@ msgstr "argumento número/tipos no coinciden" msgid "argument should be a '%q' not a '%q'" msgstr "argumento deberia ser un '%q' no un '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" @@ -1615,6 +1636,18 @@ msgstr "array/bytes requeridos en el lado derecho" msgid "attributes not supported yet" msgstr "atributos aún no soportados" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "modo de compilación erroneo" @@ -1862,6 +1895,10 @@ msgstr "no se puede importar name '%q'" msgid "cannot perform relative import" msgstr "no se puedo realizar importación relativa" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1918,6 +1955,30 @@ msgstr "constant debe ser un entero" msgid "conversion to object" msgstr "conversión a objeto" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "números decimales no soportados" @@ -1945,6 +2006,10 @@ msgstr "destination_length debe ser un int >= 0" msgid "dict update sequence has wrong length" msgstr "la secuencia de actualizacion del dict tiene una longitud incorrecta" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1958,6 +2023,10 @@ msgstr "vacío" msgid "empty heap" msgstr "heap vacío" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "separator vacío" @@ -2024,6 +2093,10 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" @@ -2032,6 +2105,14 @@ msgstr "primer argumento para super() debe ser de tipo" msgid "firstbit must be MSB" msgstr "firstbit debe ser MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -2048,6 +2129,10 @@ msgstr "format requiere un dict" msgid "full" msgstr "lleno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la función no tiene argumentos por palabra clave" @@ -2124,6 +2209,10 @@ msgstr "" msgid "incorrect padding" msgstr "relleno (padding) incorrecto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2134,10 +2223,46 @@ msgstr "index fuera de rango" msgid "indices must be integers" msgstr "indices deben ser enteros" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 debe ser >= 2 y <= 36" @@ -2216,6 +2341,14 @@ msgstr "issubclass() arg 1 debe ser una clase" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2275,6 +2408,10 @@ msgstr "map buffer muy pequeño" msgid "math domain error" msgstr "error de dominio matemático" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2298,6 +2435,10 @@ msgstr "la asignación de memoria falló, el heap está bloqueado" msgid "module not found" msgstr "módulo no encontrado" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "múltiples *x en la asignación" @@ -2322,6 +2463,10 @@ msgstr "se deben de especificar sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' no esta definido" @@ -2411,6 +2556,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2470,6 +2623,14 @@ msgstr "address fuera de límites" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2479,6 +2640,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord espera un carácter" @@ -2554,6 +2731,10 @@ msgstr "pow() con 3 argumentos requiere enteros" msgid "queue overflow" msgstr "desbordamiento de cola(queue)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "import relativo" @@ -2571,6 +2752,10 @@ msgstr "la anotación de retorno debe ser un identificador" msgid "return expected '%q' but got '%q'" msgstr "retorno esperado '%q' pero se obtuvo '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2595,6 +2780,10 @@ msgstr "" msgid "script compilation not supported" msgstr "script de compilación no soportado" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "signo no permitido en el espeficador de string format" @@ -2607,6 +2796,10 @@ msgstr "signo no permitido con el especificador integer format 'c'" msgid "single '}' encountered in format string" msgstr "un solo '}' encontrado en format string" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la longitud de sleep no puede ser negativa" @@ -2623,6 +2816,10 @@ msgstr "pequeño int desbordamiento" msgid "soft reboot\n" msgstr "reinicio suave\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -2713,12 +2910,16 @@ msgstr "timestamp fuera de rango para plataform time_t" msgid "too many arguments provided with the given format" msgstr "demasiados argumentos provistos con el formato dado" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "demasiados valores para descomprimir (%d esperado)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "tuple index fuera de rango" @@ -2849,6 +3050,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -2857,6 +3066,10 @@ msgstr "numero erroneo de argumentos" msgid "wrong number of values to unpack" msgstr "numero erroneo de valores a descomprimir" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fil.po b/locale/fil.po index b8b61d723b..ec1a88d82e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -186,6 +186,10 @@ msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format" msgid "'align' requires 1 argument" msgstr "'align' kailangan ng 1 argument" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' sa labas ng function" @@ -687,6 +691,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1004,6 +1012,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1141,6 +1153,7 @@ msgid "" msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1603,6 +1616,10 @@ msgstr "walang laman ang address" msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "may maling type ang argument" @@ -1616,6 +1633,10 @@ msgstr "hindi tugma ang argument num/types" msgid "argument should be a '%q' not a '%q'" msgstr "argument ay dapat na '%q' hindi '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" @@ -1624,6 +1645,18 @@ msgstr "array/bytes kinakailangan sa kanang bahagi" msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "masamang mode ng compile" @@ -1873,6 +1906,10 @@ msgstr "hindi ma-import ang name %q" msgid "cannot perform relative import" msgstr "hindi maaring isagawa ang relative import" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "casting" @@ -1929,6 +1966,30 @@ msgstr "constant ay dapat na integer" msgid "conversion to object" msgstr "kombersyon to object" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimal numbers hindi sinusuportahan" @@ -1958,6 +2019,10 @@ msgstr "ang destination_length ay dapat na isang int >= 0" msgid "dict update sequence has wrong length" msgstr "may mali sa haba ng dict update sequence" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1971,6 +2036,10 @@ msgstr "walang laman" msgid "empty heap" msgstr "walang laman ang heap" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "walang laman na separator" @@ -2038,6 +2107,10 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" @@ -2046,6 +2119,14 @@ msgstr "unang argument ng super() ay dapat type" msgid "firstbit must be MSB" msgstr "firstbit ay dapat MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "masyadong malaki ang float" @@ -2062,6 +2143,10 @@ msgstr "kailangan ng format ng dict" msgid "full" msgstr "puno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword" @@ -2139,6 +2224,10 @@ msgstr "hindi kumpleto ang format key" msgid "incorrect padding" msgstr "mali ang padding" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2149,10 +2238,46 @@ msgstr "index wala sa sakop" msgid "indices must be integers" msgstr "ang mga indeks ay dapat na integer" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "int() arg 2 ay dapat >=2 at <= 36" @@ -2231,6 +2356,14 @@ msgstr "issubclass() arg 1 ay dapat na class" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() arg 2 ay dapat na class o tuple ng classes" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2291,6 +2424,10 @@ msgstr "masyadong maliit ang buffer map" msgid "math domain error" msgstr "may pagkakamali sa math domain" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2314,6 +2451,10 @@ msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock" msgid "module not found" msgstr "module hindi nakita" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "maramihang *x sa assignment" @@ -2338,6 +2479,10 @@ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "name '%q' ay hindi defined" @@ -2424,6 +2569,14 @@ msgstr "hindi lahat ng arguments na i-convert habang string formatting" msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2483,6 +2636,14 @@ msgstr "wala sa sakop ang address" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2492,6 +2653,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord umaasa ng character" @@ -2568,6 +2745,10 @@ msgstr "pow() na may 3 argumento kailangan ng integers" msgid "queue overflow" msgstr "puno na ang pila (overflow)" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relative import" @@ -2585,6 +2766,10 @@ msgstr "return annotation ay dapat na identifier" msgid "return expected '%q' but got '%q'" msgstr "return umasa ng '%q' pero ang nakuha ay ‘%q’" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2609,6 +2794,10 @@ msgstr "puno na ang schedule stack" msgid "script compilation not supported" msgstr "script kompilasyon hindi supportado" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "sign hindi maaring string format specifier" @@ -2621,6 +2810,10 @@ msgstr "sign hindi maari sa integer format specifier 'c'" msgid "single '}' encountered in format string" msgstr "isang '}' nasalubong sa format string" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "sleep length ay dapat hindi negatibo" @@ -2637,6 +2830,10 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "malambot na reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -2728,12 +2925,16 @@ msgstr "wala sa sakop ng timestamp ang platform time_t" msgid "too many arguments provided with the given format" msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" @@ -2864,6 +3065,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -2872,6 +3081,10 @@ msgstr "mali ang bilang ng argumento" msgid "wrong number of values to unpack" msgstr "maling number ng value na i-unpack" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fr.po b/locale/fr.po index 625b4e91aa..a79d8444ba 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -187,6 +187,10 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" msgid "'align' requires 1 argument" msgstr "'align' nécessite 1 argument" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' en dehors d'une fonction" @@ -690,6 +694,10 @@ msgstr "Tuple de longueur %d attendu, obtenu %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1011,6 +1019,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1155,6 +1167,7 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1620,6 +1633,10 @@ msgstr "adresses vides" msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" @@ -1633,6 +1650,10 @@ msgstr "argument num/types ne correspond pas" msgid "argument should be a '%q' not a '%q'" msgstr "l'argument devrait être un(e) '%q', pas '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" @@ -1641,6 +1662,18 @@ msgstr "tableau/octets requis à droite" msgid "attributes not supported yet" msgstr "attribut pas encore supporté" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mauvais mode de compilation" @@ -1896,6 +1929,10 @@ msgstr "ne peut pas importer le nom %q" msgid "cannot perform relative import" msgstr "ne peut pas réaliser un import relatif" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "typage" @@ -1956,6 +1993,30 @@ msgstr "constante doit être un entier" msgid "conversion to object" msgstr "conversion en objet" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "nombres décimaux non supportés" @@ -1983,6 +2044,10 @@ msgstr "destination_length doit être un entier >= 0" msgid "dict update sequence has wrong length" msgstr "la séquence de mise à jour de dict a une mauvaise longueur" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1996,6 +2061,10 @@ msgstr "vide" msgid "empty heap" msgstr "tas vide" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "séparateur vide" @@ -2063,6 +2132,10 @@ msgstr "le fichier doit être un fichier ouvert en mode 'byte'" msgid "filesystem must provide mount method" msgstr "le system de fichier doit fournir une méthode 'mount'" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" @@ -2071,6 +2144,14 @@ msgstr "le premier argument de super() doit être un type" msgid "firstbit must be MSB" msgstr "le 1er bit doit être le MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "nombre à virgule flottante trop grand" @@ -2087,6 +2168,10 @@ msgstr "le format nécessite un dict" msgid "full" msgstr "plein" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la fonction ne prend pas d'arguments nommés" @@ -2163,6 +2248,10 @@ msgstr "clé de format incomplète" msgid "incorrect padding" msgstr "espacement incorrect" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2173,10 +2262,46 @@ msgstr "index hors gamme" msgid "indices must be integers" msgstr "les indices doivent être des entiers" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "l'assembleur doit être une fonction" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "l'argument 2 de int() doit être >=2 et <=36" @@ -2256,6 +2381,14 @@ msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" "l'argument 2 de issubclass() doit être une classe ou un tuple de classes" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2315,6 +2448,10 @@ msgstr "tampon trop petit" msgid "math domain error" msgstr "erreur de domaine math" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2338,6 +2475,10 @@ msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé" msgid "module not found" msgstr "module introuvable" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "*x multiple dans l'assignement" @@ -2362,6 +2503,10 @@ msgstr "sck, mosi et miso doivent tous être spécifiés" msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nom '%q' non défini" @@ -2451,6 +2596,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2510,6 +2663,14 @@ msgstr "adresse hors limites" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2519,6 +2680,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord attend un caractère" @@ -2600,6 +2777,10 @@ msgstr "pow() avec 3 arguments nécessite des entiers" msgid "queue overflow" msgstr "dépassement de file" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "import relatif" @@ -2617,6 +2798,10 @@ msgstr "l'annotation de return doit être un identifiant" msgid "return expected '%q' but got '%q'" msgstr "return attendait '%q' mais a reçu '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2641,6 +2826,10 @@ msgstr "pile de planification pleine" msgid "script compilation not supported" msgstr "compilation de script non supportée" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "signe non autorisé dans les spéc. de formats de chaînes de caractères" @@ -2653,6 +2842,10 @@ msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" msgid "single '}' encountered in format string" msgstr "'}' seule rencontrée dans une chaîne de format" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la longueur de sleep ne doit pas être négative" @@ -2669,6 +2862,10 @@ msgstr "dépassement de capacité d'un entier court" msgid "soft reboot\n" msgstr "redémarrage logiciel\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -2761,12 +2958,16 @@ msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "trop de valeur à dégrouper (%d attendues)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "index du tuple hors gamme" @@ -2898,6 +3099,14 @@ msgstr "'value_count' doit être > 0" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -2906,6 +3115,10 @@ msgstr "mauvais nombres d'arguments" msgid "wrong number of values to unpack" msgstr "mauvais nombre de valeurs à dégrouper" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/it_IT.po b/locale/it_IT.po index 93af9bdb86..172f00878a 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -185,6 +185,10 @@ msgstr "'S' e 'O' non sono formati supportati" msgid "'align' requires 1 argument" msgstr "'align' richiede 1 argomento" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' al di fuori della funzione" @@ -687,6 +691,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -1008,6 +1016,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1150,6 +1162,7 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1606,6 +1619,10 @@ msgstr "gli indirizzi sono vuoti" msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" @@ -1619,6 +1636,10 @@ msgstr "discrepanza di numero/tipo di argomenti" msgid "argument should be a '%q' not a '%q'" msgstr "l'argomento dovrebbe essere un '%q' e non un '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1627,6 +1648,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "attributi non ancora supportati" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1873,6 +1906,10 @@ msgstr "impossibile imporate il nome %q" msgid "cannot perform relative import" msgstr "impossibile effettuare l'importazione relativa" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "casting" @@ -1931,6 +1968,30 @@ msgstr "la costante deve essere un intero" msgid "conversion to object" msgstr "conversione in oggetto" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "numeri decimali non supportati" @@ -1959,6 +2020,10 @@ msgstr "destination_length deve essere un int >= 0" msgid "dict update sequence has wrong length" msgstr "sequanza di aggiornamento del dizionario ha la lunghezza errata" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1972,6 +2037,10 @@ msgstr "vuoto" msgid "empty heap" msgstr "heap vuoto" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "separatore vuoto" @@ -2039,6 +2108,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2047,6 +2120,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "il primo bit deve essere il più significativo (MSB)" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float troppo grande" @@ -2063,6 +2144,10 @@ msgstr "la formattazione richiede un dict" msgid "full" msgstr "pieno" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la funzione non prende argomenti nominati" @@ -2140,6 +2225,10 @@ msgstr "" msgid "incorrect padding" msgstr "padding incorretto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2150,10 +2239,46 @@ msgstr "indice fuori intervallo" msgid "indices must be integers" msgstr "gli indici devono essere interi" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" @@ -2234,6 +2359,14 @@ msgstr "" "il secondo argomento di issubclass() deve essere una classe o una tupla di " "classi" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2293,6 +2426,10 @@ msgstr "map buffer troppo piccolo" msgid "math domain error" msgstr "errore di dominio matematico" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2316,6 +2453,10 @@ msgstr "allocazione di memoria fallita, l'heap è bloccato" msgid "module not found" msgstr "modulo non trovato" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "*x multipli nell'assegnamento" @@ -2340,6 +2481,10 @@ msgstr "è necessario specificare tutte le sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nome '%q'non definito" @@ -2429,6 +2574,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2488,6 +2641,14 @@ msgstr "indirizzo fuori limite" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2497,6 +2658,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord() aspetta un carattere" @@ -2575,6 +2752,10 @@ msgstr "pow() con 3 argomenti richiede interi" msgid "queue overflow" msgstr "overflow della coda" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "importazione relativa" @@ -2592,6 +2773,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "return aspettava '%q' ma ha ottenuto '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2616,6 +2801,10 @@ msgstr "" msgid "script compilation not supported" msgstr "compilazione dello scrip non suportata" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "segno non permesso nello spcificatore di formato della stringa" @@ -2628,6 +2817,10 @@ msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" msgid "single '}' encountered in format string" msgstr "'}' singolo presente nella stringa di formattazione" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "la lunghezza di sleed deve essere non negativa" @@ -2644,6 +2837,10 @@ msgstr "small int overflow" msgid "soft reboot\n" msgstr "soft reboot\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2735,12 +2932,16 @@ msgstr "timestamp è fuori intervallo per il time_t della piattaforma" msgid "too many arguments provided with the given format" msgstr "troppi argomenti forniti con il formato specificato" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "troppi valori da scompattare (%d attesi)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" @@ -2871,6 +3072,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -2879,6 +3088,10 @@ msgstr "numero di argomenti errato" msgid "wrong number of values to unpack" msgstr "numero di valori da scompattare non corretto" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/ko.po b/locale/ko.po index 04ab849d43..81dcd88091 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -185,6 +185,10 @@ msgstr "" msgid "'align' requires 1 argument" msgstr "'align' 에는 1 개의 독립변수가 필요합니다" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' 는 펑크션 외부에 있습니다" @@ -677,6 +681,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -992,6 +1000,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1125,6 +1137,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1575,6 +1588,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "" @@ -1588,6 +1605,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1596,6 +1617,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1838,6 +1871,10 @@ msgstr "" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1894,6 +1931,30 @@ msgstr "" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1919,6 +1980,10 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1932,6 +1997,10 @@ msgstr "" msgid "empty heap" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1998,6 +2067,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2006,6 +2079,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float이 너무 큽니다" @@ -2022,6 +2103,10 @@ msgstr "" msgid "full" msgstr "완전한(full)" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2098,6 +2183,10 @@ msgstr "" msgid "incorrect padding" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2108,10 +2197,46 @@ msgstr "" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2190,6 +2315,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2246,6 +2379,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2269,6 +2406,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2293,6 +2434,10 @@ msgstr "" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2379,6 +2524,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2437,6 +2590,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2446,6 +2607,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2521,6 +2698,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2538,6 +2719,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2560,6 +2745,10 @@ msgstr "" msgid "script compilation not supported" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2572,6 +2761,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2588,6 +2781,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2677,12 +2874,16 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2813,6 +3014,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2821,6 +3030,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index d766191822..764c75881c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -184,6 +184,10 @@ msgstr "typy formatowania 'S' oraz 'O' są niewspierane" msgid "'align' requires 1 argument" msgstr "'align' wymaga 1 argumentu" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' poza funkcją" @@ -676,6 +680,10 @@ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -993,6 +1001,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1126,6 +1138,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1578,6 +1591,10 @@ msgstr "adres jest pusty" msgid "arg is an empty sequence" msgstr "arg jest puste" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argument ma zły typ" @@ -1591,6 +1608,10 @@ msgstr "zła liczba lub typ argumentów" msgid "argument should be a '%q' not a '%q'" msgstr "argument powinien być '%q' a nie '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" @@ -1599,6 +1620,18 @@ msgstr "tablica/bytes wymagane po prawej stronie" msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "zły tryb kompilacji" @@ -1841,6 +1874,10 @@ msgstr "nie można zaimportować nazwy %q" msgid "cannot perform relative import" msgstr "nie można wykonać relatywnego importu" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "rzutowanie" @@ -1897,6 +1934,30 @@ msgstr "stała musi być liczbą całkowitą" msgid "conversion to object" msgstr "konwersja do obiektu" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "liczby dziesiętne nieobsługiwane" @@ -1923,6 +1984,10 @@ msgstr "destination_length musi być nieujemną liczbą całkowitą" msgid "dict update sequence has wrong length" msgstr "sekwencja ma złą długość" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1936,6 +2001,10 @@ msgstr "puste" msgid "empty heap" msgstr "pusta sterta" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "pusty separator" @@ -2002,6 +2071,10 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" @@ -2010,6 +2083,14 @@ msgstr "pierwszy argument super() musi być typem" msgid "firstbit must be MSB" msgstr "firstbit musi być MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float zbyt wielki" @@ -2026,6 +2107,10 @@ msgstr "format wymaga słownika" msgid "full" msgstr "pełny" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "funkcja nie bierze argumentów nazwanych" @@ -2102,6 +2187,10 @@ msgstr "niepełny klucz formatu" msgid "incorrect padding" msgstr "złe wypełnienie" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2112,10 +2201,46 @@ msgstr "indeks poza zakresem" msgid "indices must be integers" msgstr "indeksy muszą być całkowite" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "argument 2 do int() busi być pomiędzy 2 a 36" @@ -2194,6 +2319,14 @@ msgstr "argument 1 dla issubclass() musi być klasą" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "argument 2 dla issubclass() musi być klasą lub krotką klas" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "join oczekuje listy str/bytes zgodnych z self" @@ -2250,6 +2383,10 @@ msgstr "bufor mapy zbyt mały" msgid "math domain error" msgstr "błąd domeny" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2273,6 +2410,10 @@ msgstr "alokacja pamięci nie powiodła się, sterta zablokowana" msgid "module not found" msgstr "brak modułu" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "wiele *x w przypisaniu" @@ -2297,6 +2438,10 @@ msgstr "sck/mosi/miso muszą być podane" msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "nazwa '%q' niezdefiniowana" @@ -2383,6 +2528,14 @@ msgstr "nie wszystkie argumenty wykorzystane w formatowaniu" msgid "not enough arguments for format string" msgstr "nie dość argumentów przy formatowaniu" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2441,6 +2594,14 @@ msgstr "offset poza zakresem" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2450,6 +2611,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord oczekuje znaku" @@ -2526,6 +2703,10 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" msgid "queue overflow" msgstr "przepełnienie kolejki" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "relatywny import" @@ -2543,6 +2724,10 @@ msgstr "anotacja wartości musi być identyfikatorem" msgid "return expected '%q' but got '%q'" msgstr "return oczekiwał '%q', a jest '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "rsplit(None,n)" @@ -2566,6 +2751,10 @@ msgstr "stos planu pełen" msgid "script compilation not supported" msgstr "kompilowanie skryptów nieobsługiwane" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "znak jest niedopuszczalny w specyfikacji formatu łańcucha" @@ -2578,6 +2767,10 @@ msgstr "znak jest niedopuszczalny w specyfikacji 'c'" msgid "single '}' encountered in format string" msgstr "pojedynczy '}' w specyfikacji formatu" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "okres snu musi być nieujemny" @@ -2594,6 +2787,10 @@ msgstr "przepełnienie small int" msgid "soft reboot\n" msgstr "programowy reset\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -2683,12 +2880,16 @@ msgstr "timestamp poza zakresem dla time_t na tej platformie" msgid "too many arguments provided with the given format" msgstr "zbyt wiele argumentów podanych dla tego formatu" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "indeks krotki poza zakresem" @@ -2819,6 +3020,14 @@ msgstr "value_count musi być > 0" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -2827,6 +3036,10 @@ msgstr "zła liczba argumentów" msgid "wrong number of values to unpack" msgstr "zła liczba wartości do rozpakowania" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b948003a18..81a7974f3d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -185,6 +185,10 @@ msgstr "'S' e 'O' não são tipos de formato suportados" msgid "'align' requires 1 argument" msgstr "" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "" @@ -682,6 +686,10 @@ msgstr "" msgid "Extended advertisements with scan response not supported." msgstr "" +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Falha ao enviar comando." @@ -1000,6 +1008,10 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "" @@ -1136,6 +1148,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1588,6 +1601,10 @@ msgstr "" msgid "arg is an empty sequence" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "argumento tem tipo errado" @@ -1601,6 +1618,10 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "" @@ -1609,6 +1630,18 @@ msgstr "" msgid "attributes not supported yet" msgstr "atributos ainda não suportados" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1854,6 +1887,10 @@ msgstr "não pode importar nome %q" msgid "cannot perform relative import" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "" @@ -1910,6 +1947,30 @@ msgstr "constante deve ser um inteiro" msgid "conversion to object" msgstr "" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -1935,6 +1996,10 @@ msgstr "destination_length deve ser um int >= 0" msgid "dict update sequence has wrong length" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1948,6 +2013,10 @@ msgstr "vazio" msgid "empty heap" msgstr "heap vazia" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -2015,6 +2084,10 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2023,6 +2096,14 @@ msgstr "" msgid "firstbit must be MSB" msgstr "firstbit devem ser MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float muito grande" @@ -2039,6 +2120,10 @@ msgstr "" msgid "full" msgstr "cheio" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "função não aceita argumentos de palavras-chave" @@ -2115,6 +2200,10 @@ msgstr "" msgid "incorrect padding" msgstr "preenchimento incorreto" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2125,10 +2214,46 @@ msgstr "Índice fora do intervalo" msgid "indices must be integers" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "" @@ -2207,6 +2332,14 @@ msgstr "" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2263,6 +2396,10 @@ msgstr "" msgid "math domain error" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2286,6 +2423,10 @@ msgstr "" msgid "module not found" msgstr "" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "" @@ -2310,6 +2451,10 @@ msgstr "deve especificar todos sck/mosi/miso" msgid "must use keyword argument for key function" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "" @@ -2396,6 +2541,14 @@ msgstr "" msgid "not enough arguments for format string" msgstr "" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2454,6 +2607,14 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2463,6 +2624,22 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "" @@ -2538,6 +2715,10 @@ msgstr "" msgid "queue overflow" msgstr "estouro de fila" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "" @@ -2555,6 +2736,10 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2577,6 +2762,10 @@ msgstr "" msgid "script compilation not supported" msgstr "compilação de script não suportada" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2589,6 +2778,10 @@ msgstr "" msgid "single '}' encountered in format string" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "" @@ -2605,6 +2798,10 @@ msgstr "" msgid "soft reboot\n" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -2696,12 +2893,16 @@ msgstr "timestamp fora do intervalo para a plataforma time_t" msgid "too many arguments provided with the given format" msgstr "Muitos argumentos fornecidos com o formato dado" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "" @@ -2832,6 +3033,14 @@ msgstr "" msgid "window must be <= interval" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -2840,6 +3049,10 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9a9473436f..d650ac52a9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-19 08:44+0000\n" +"POT-Creation-Date: 2020-03-02 09:12-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -190,6 +190,10 @@ msgstr "'S' hé 'O' bù zhīchí géshì lèixíng" msgid "'align' requires 1 argument" msgstr "'align' xūyào 1 gè cānshù" +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + #: py/compile.c msgid "'await' outside function" msgstr "'await' wàibù gōngnéng" @@ -684,6 +688,10 @@ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" msgid "Extended advertisements with scan response not supported." msgstr "Bù zhīchí dài yǒu sǎomiáo xiǎngyìng de kuòzhǎn guǎngbò." +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fāsòng mìnglìng shībài." @@ -1001,6 +1009,10 @@ msgstr "Bìxū shì %q zi lèi." msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" +#: py/parse.c +msgid "Name too long" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" msgstr "Bù zhīchí fù bù" @@ -1140,6 +1152,7 @@ msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "Shàng bù zhīchí ParallelBus" @@ -1603,6 +1616,10 @@ msgstr "dìzhǐ wèi kōng" msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + #: py/runtime.c msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" @@ -1616,6 +1633,10 @@ msgstr "cānshù biānhào/lèixíng bù pǐpèi" msgid "argument should be a '%q' not a '%q'" msgstr "cānshù yīnggāi shì '%q', 'bùshì '%q'" +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" @@ -1624,6 +1645,18 @@ msgstr "yòu cè xūyào shùzǔ/zì jié" msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "biānyì móshì cuòwù" @@ -1866,6 +1899,10 @@ msgstr "wúfǎ dǎorù míngchēng %q" msgid "cannot perform relative import" msgstr "wúfǎ zhíxíng xiāngguān dǎorù" +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + #: py/emitnative.c msgid "casting" msgstr "tóuyǐng" @@ -1925,6 +1962,30 @@ msgstr "chángshù bìxū shì yīgè zhěngshù" msgid "conversion to object" msgstr "zhuǎnhuàn wèi duìxiàng" +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "bù zhīchí xiǎoshù shù" @@ -1951,6 +2012,10 @@ msgstr "mùbiāo chángdù bìxū shì > = 0 de zhěngshù" msgid "dict update sequence has wrong length" msgstr "yǔfǎ gēngxīn xùliè de chángdù cuòwù" +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" @@ -1964,6 +2029,10 @@ msgstr "kòngxián" msgid "empty heap" msgstr "kōng yīn yīnxiào" +#: extmod/ulab/code/ndarray.c +msgid "empty index range" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "kōng fēngé fú" @@ -2030,6 +2099,10 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" @@ -2038,6 +2111,14 @@ msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" msgid "firstbit must be MSB" msgstr "dì yī wèi bìxū shì MSB" +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "fú diǎn tài dà" @@ -2054,6 +2135,10 @@ msgstr "géshì yāoqiú yīgè yǔjù" msgid "full" msgstr "chōngfèn" +#: extmod/ulab/code/linalg.c +msgid "function defined for ndarrays only" +msgstr "" + #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "hánshù méiyǒu guānjiàn cí cānshù" @@ -2130,6 +2215,10 @@ msgstr "géshì bù wánzhěng de mì yào" msgid "incorrect padding" msgstr "bù zhèngquè de tiánchōng" +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c @@ -2140,10 +2229,46 @@ msgstr "suǒyǐn chāochū fànwéi" msgid "indices must be integers" msgstr "suǒyǐn bìxū shì zhěngshù" +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" @@ -2222,6 +2347,14 @@ msgstr "issubclass() cānshù 1 bìxū shì yīgè lèi" msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "issubclass() cānshù 2 bìxū shì lèi de lèi huò yuán zǔ" +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" @@ -2279,6 +2412,10 @@ msgstr "dìtú huǎnchōng qū tài xiǎo" msgid "math domain error" msgstr "shùxué yù cuòwù" +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2302,6 +2439,10 @@ msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng" msgid "module not found" msgstr "zhǎo bù dào mókuài" +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + #: py/compile.c msgid "multiple *x in assignment" msgstr "duō gè*x zài zuòyè zhōng" @@ -2326,6 +2467,10 @@ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + #: py/runtime.c msgid "name '%q' is not defined" msgstr "míngchēng '%q' wèi dìngyì" @@ -2413,6 +2558,14 @@ msgstr "bùshì zì chuàn géshì huà guòchéng zhōng zhuǎnhuàn de suǒyǒ msgid "not enough arguments for format string" msgstr "géshì zìfú chuàn cān shǔ bùzú" +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" @@ -2471,6 +2624,14 @@ msgstr "piānlí biānjiè" msgid "only bit_depth=16 is supported" msgstr "Jǐn zhīchí wèi shēndù = 16" +#: extmod/ulab/code/linalg.c +msgid "only ndarray objects can be inverted" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "only ndarrays can be inverted" +msgstr "" + #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" @@ -2480,6 +2641,22 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" +#: extmod/ulab/code/linalg.c +msgid "only square matrices can be inverted" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + #: py/modbuiltins.c msgid "ord expects a character" msgstr "ord yùqí zìfú" @@ -2555,6 +2732,10 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" msgid "queue overflow" msgstr "duìliè yìchū" +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + #: py/builtinimport.c msgid "relative import" msgstr "xiāngduì dǎorù" @@ -2572,6 +2753,10 @@ msgstr "fǎnhuí zhùshì bìxū shì biāozhì fú" msgid "return expected '%q' but got '%q'" msgstr "fǎnhuí yùqí de '%q' dàn huòdéle '%q'" +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + #: py/objstr.c msgid "rsplit(None,n)" msgstr "" @@ -2596,6 +2781,10 @@ msgstr "jìhuà duīzhàn yǐ mǎn" msgid "script compilation not supported" msgstr "bù zhīchí jiǎoběn biānyì" +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "zìfú chuàn géshì shuōmíng fú zhōng bù yǔnxǔ shǐyòng fúhào" @@ -2608,6 +2797,10 @@ msgstr "zhěngshù géshì shuōmíng fú 'c' bù yǔnxǔ shǐyòng fúhào" msgid "single '}' encountered in format string" msgstr "zài géshì zìfú chuàn zhōng yù dào de dāngè '}'" +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" msgstr "shuìmián chángdù bìxū shìfēi fùshù" @@ -2624,6 +2817,10 @@ msgstr "xiǎo zhěngshù yìchū" msgid "soft reboot\n" msgstr "ruǎn chóngqǐ\n" +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -2713,12 +2910,16 @@ msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" msgid "too many arguments provided with the given format" msgstr "tígōng jǐ dìng géshì de cānshù tài duō" +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" msgstr "dǎkāi tài duō zhí (yùqí %d)" -#: py/objstr.c +#: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" msgstr "yuán zǔ suǒyǐn chāochū fànwéi" @@ -2849,6 +3050,14 @@ msgstr "zhí jìshù bìxū wèi > 0" msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -2857,6 +3066,10 @@ msgstr "cānshù shù cuòwù" msgid "wrong number of values to unpack" msgstr "wúfǎ jiě bāo de zhí shù" +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type on the right hand side" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x zhí chāochū biānjiè" From eb71bfe9d3971dc87fe3d7c89f09598e5f66d52a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 2 Mar 2020 11:14:58 -0500 Subject: [PATCH 025/919] Exclude SoCs without basic timers --- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- ports/stm32f4/common-hal/pulseio/PulseOut.c | 8 ++++++++ ports/stm32f4/peripherals/stm32f4/periph.h | 7 ++++++- 15 files changed, 79 insertions(+), 14 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8e74df8c07..cb9fdfee44 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1179,6 +1179,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 45e7957874..4272080d9b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1165,6 +1165,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9456e83e53..1e8a61dd7a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -1182,6 +1182,10 @@ msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index b02fc66da9..2f9677594c 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -1165,6 +1165,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 1c38c4f5cf..78cda4fbcc 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -1169,6 +1169,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/es.po b/locale/es.po index 305f829990..aecdea9e0b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -1181,6 +1181,10 @@ msgstr "Pull no se usa cuando la dirección es output." msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 6781538974..be9930d42d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1187,6 +1187,10 @@ msgstr "Pull hindi ginagamit kapag ang direksyon ay output." msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index e2c924113b..b5e41dacb7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -1200,6 +1200,10 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index bf48daffdf..79f35e1032 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1196,6 +1196,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 37436f58f9..b7c2185db2 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1169,6 +1169,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 132b09b237..dbe9653c84 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1170,6 +1170,10 @@ msgstr "Podciągnięcie nieużywane w trybie wyjścia." msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 01f1624b8d..e9adb9daeb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1181,6 +1181,10 @@ msgstr "" msgid "PulseIn not yet supported" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b094fa274b..a4cdf3fc82 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-29 14:52-0500\n" +"POT-Creation-Date: 2020-03-02 11:20-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1184,6 +1184,10 @@ msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." msgid "PulseIn not yet supported" msgstr "Shàng bù zhīchí PulseIn" +#: ports/stm32f4/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + #: ports/stm32f4/common-hal/os/__init__.c msgid "RNG DeInit Error" msgstr "RNG qǔxiāo chūshǐhuà cuòwù" diff --git a/ports/stm32f4/common-hal/pulseio/PulseOut.c b/ports/stm32f4/common-hal/pulseio/PulseOut.c index 033e1c7fe1..d82525ea16 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseOut.c +++ b/ports/stm32f4/common-hal/pulseio/PulseOut.c @@ -105,12 +105,17 @@ STATIC void pulseout_event_handler(void) { } void pulseout_reset() { + #if HAS_BASIC_TIM __HAL_RCC_TIM7_CLK_DISABLE(); refcount = 0; + #endif } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, const pulseio_pwmout_obj_t* carrier) { +#if !(HAS_BASIC_TIM) + mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); +#else // Add to active PulseOuts refcount++; @@ -145,6 +150,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, self->pwmout = (pulseio_pwmout_obj_t*)carrier; turn_off(self); +#endif } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { @@ -160,7 +166,9 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { refcount--; if (refcount == 0) { + #if HAS_BASIC_TIM __HAL_RCC_TIM7_CLK_DISABLE(); + #endif } } diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 969a8e79b7..d311afe4a1 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -138,23 +138,26 @@ typedef struct { .pin = tim_pin, \ } -//Starter Lines +//Access Lines #ifdef STM32F401xE #define HAS_DAC 0 #define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 #include "stm32f401xe/periph.h" #endif #ifdef STM32F411xE #define HAS_DAC 0 #define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 #include "stm32f411xe/periph.h" #endif #ifdef STM32F412Zx #define HAS_DAC 0 #define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 #include "stm32f412zx/periph.h" #endif @@ -163,12 +166,14 @@ typedef struct { #ifdef STM32F405xx #define HAS_DAC 1 #define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 #include "stm32f405xx/periph.h" #endif #ifdef STM32F407xx #define HAS_DAC 1 #define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 #include "stm32f407xx/periph.h" #endif From c0bfa117661766cdc7d5a3daca88008a669b5a90 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 27 Feb 2020 14:17:29 -0600 Subject: [PATCH 026/919] Use tests from ulab extmod, instead of our own --- tests/run-tests | 2 +- tests/ulab/smoke.py | 84 ----------------------------------------- tests/ulab/smoke.py.exp | 0 3 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 tests/ulab/smoke.py delete mode 100644 tests/ulab/smoke.py.exp diff --git a/tests/run-tests b/tests/run-tests index 28eed1e80e..f6c727a8a6 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -579,7 +579,7 @@ the last matching regex is used: # run PC tests test_dirs = ( 'basics', 'micropython', 'float', 'import', 'io', 'misc', - 'stress', 'unicode', 'extmod', 'ulab', 'unix', 'cmdline', + 'stress', 'unicode', 'extmod', '../extmod/ulab/tests', 'unix', 'cmdline', ) else: # run tests from these directories diff --git a/tests/ulab/smoke.py b/tests/ulab/smoke.py deleted file mode 100644 index e6d7f55138..0000000000 --- a/tests/ulab/smoke.py +++ /dev/null @@ -1,84 +0,0 @@ -try: - import ulab -except: - print('SKIP') - raise SystemExit - -ulab.array([1,2,3]) -ulab.array([1,2,3], dtype=ulab.int8) -ulab.array([1,2,3], dtype=ulab.int16) -ulab.array([1,2,3], dtype=ulab.uint8) -ulab.array([1,2,3], dtype=ulab.uint16) -ulab.array([1,2,3], dtype=ulab.float) -ulab.zeros(3) -ulab.ones(3) -a = ulab.eye(3) -a.shape -a.size -a.itemsize -a.flatten -a.sort() -a.transpose() -a + 0 -a + a -a * 0 -a * a -a / 1 -a / a -a - 0 -a - a -+a --a -a[0] -a[:] -a[0] = 0 -a[:] = ulab.zeros((3,3)) -a = ulab.eye(3) -ulab.vector.acos(a) -ulab.vector.acosh(a) -ulab.vector.asin(a) -ulab.vector.asinh(a) -ulab.vector.atan(a) -ulab.vector.atanh(a) -ulab.vector.ceil(a) -ulab.vector.cos(a) -#ulab.vector.cosh(a) -ulab.vector.sin(a) -ulab.vector.sinh(a) -ulab.vector.tan(a) -ulab.vector.tanh(a) -ulab.vector.erf(a) -ulab.vector.erfc(a) -ulab.vector.exp(a) -ulab.vector.expm1(a) -ulab.vector.floor(a) -ulab.vector.gamma(a) -ulab.vector.lgamma(a) -ulab.vector.log(a) -ulab.vector.log2(a) -ulab.vector.sqrt(a) -ulab.linalg.dot(a,a) -ulab.linalg.inv(a) -ulab.linalg.eig(a) -ulab.linalg.det(a) -ulab.filter.convolve(ulab.array([1,2,3]), ulab.array([1,10,100,1000])) -ulab.linspace(0, 10, num=3) -a = ulab.linspace(0, 10, num=256, endpoint=True) -ulab.fft.spectrum(a) -p, q = ulab.fft.fft(a) -ulab.fft.ifft(p) -ulab.fft.ifft(p,q) -ulab.numerical.argmin(a) -ulab.numerical.argmax(a) -ulab.numerical.argsort(a) -ulab.numerical.max(a) -ulab.numerical.min(a) -ulab.numerical.mean(a) -ulab.numerical.std(a) -ulab.numerical.diff(a) -#ulab.size(a) -f = ulab.poly.polyfit([1,2,3], 3) -ulab.poly.polyval([1,2,3], [1,2,3]) -ulab.numerical.sort(a) -ulab.numerical.flip(a) -ulab.numerical.roll(a, 1) diff --git a/tests/ulab/smoke.py.exp b/tests/ulab/smoke.py.exp deleted file mode 100644 index e69de29bb2..0000000000 From 274cb597b0cd2a12b82d6efe2c40fb76402f8644 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 3 Mar 2020 10:55:50 -0800 Subject: [PATCH 027/919] Remove debug extern --- py/gc_long_lived.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/py/gc_long_lived.c b/py/gc_long_lived.c index a2b5d88e01..0e94390e9d 100755 --- a/py/gc_long_lived.c +++ b/py/gc_long_lived.c @@ -85,8 +85,6 @@ mp_obj_property_t *make_property_long_lived(mp_obj_property_t *prop, uint8_t max return gc_make_long_lived(prop); } -extern const mp_obj_dict_t mcu_module_globals; - mp_obj_dict_t *make_dict_long_lived(mp_obj_dict_t *dict, uint8_t max_depth) { #ifndef MICROPY_ENABLE_GC return dict; From 55e13715a9f0aee9e89830cee9a47ffff25eeb33 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 3 Mar 2020 17:21:47 -0500 Subject: [PATCH 028/919] Expand GPIO clock enables for F405 and F407 --- ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c | 6 +++++- ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c index f9be3b4ec2..d1eaa90d1b 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c @@ -30,9 +30,13 @@ void stm32f4_peripherals_gpio_init(void) { //Enable all GPIO for now - __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); //Never reset pins never_reset_pin_number(2,13); //PC13 anti tamp diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c index f9be3b4ec2..d1eaa90d1b 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c @@ -30,9 +30,13 @@ void stm32f4_peripherals_gpio_init(void) { //Enable all GPIO for now - __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); //Never reset pins never_reset_pin_number(2,13); //PC13 anti tamp From 409a4a9490b5f68d0afc62f631794cee321c12fe Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Wed, 4 Mar 2020 23:22:46 -0800 Subject: [PATCH 029/919] Disable the HID USB descriptor for Sol It's not used and ends up being confusing for folks. --- ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index a0449d7bb9..b1f916ec20 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -6,6 +6,7 @@ USB_PID = 0x8062 USB_PRODUCT = "Sol" USB_MANUFACTURER = "Winterbloom" USB_INTERFACE_NAME = "Sol" +USB_DEVICES = "CDC,MSC,AUDIO" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 @@ -25,6 +26,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_PS2IO = 0 +CIRCUITPY_USB_HID = 0 # Enable micropython.native CIRCUITPY_ENABLE_MPY_NATIVE = 1 From 817b5be320b36b9cac59b195b1c19359783fe032 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 5 Mar 2020 16:35:31 -0500 Subject: [PATCH 030/919] rename routines to be clearer; fix wiznet arg types --- shared-bindings/analogio/AnalogIn.c | 2 +- shared-bindings/analogio/AnalogOut.c | 2 +- shared-bindings/audiobusio/I2SOut.c | 6 +++--- shared-bindings/audiobusio/PDMIn.c | 4 ++-- shared-bindings/audioio/AudioOut.c | 4 ++-- shared-bindings/audiopwmio/PWMAudioOut.c | 4 ++-- shared-bindings/bitbangio/I2C.c | 4 ++-- shared-bindings/bitbangio/OneWire.c | 2 +- shared-bindings/bitbangio/SPI.c | 6 +++--- shared-bindings/busio/I2C.c | 4 ++-- shared-bindings/busio/OneWire.c | 2 +- shared-bindings/busio/SPI.c | 6 +++--- shared-bindings/busio/UART.c | 10 +++++----- shared-bindings/digitalio/DigitalInOut.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/EPaperDisplay.c | 2 +- shared-bindings/displayio/FourWire.c | 6 +++--- shared-bindings/displayio/I2CDisplay.c | 2 +- shared-bindings/displayio/ParallelBus.c | 12 ++++++------ shared-bindings/frequencyio/FrequencyIn.c | 2 +- shared-bindings/i2cslave/I2CSlave.c | 4 ++-- shared-bindings/microcontroller/Pin.c | 14 +++++++------- shared-bindings/microcontroller/Pin.h | 8 ++++---- shared-bindings/ps2io/Ps2.c | 4 ++-- shared-bindings/pulseio/PWMOut.c | 2 +- shared-bindings/pulseio/PulseIn.c | 2 +- shared-bindings/rotaryio/IncrementalEncoder.c | 4 ++-- shared-bindings/touchio/TouchIn.c | 2 +- shared-bindings/wiznet/wiznet5k.c | 4 ++-- shared-module/wiznet/wiznet5k.c | 4 ++-- shared-module/wiznet/wiznet5k.h | 2 +- 31 files changed, 67 insertions(+), 67 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 9d1312dd86..b4eeb2af1b 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -63,7 +63,7 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); + const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); analogio_analogin_obj_t *self = m_new_obj(analogio_analogin_obj_t); self->base.type = &analogio_analogin_type; diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 2496f17849..89cf147b26 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -62,7 +62,7 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); - const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); + const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); analogio_analogout_obj_t *self = m_new_obj(analogio_analogout_obj_t); self->base.type = &analogio_analogout_type; diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 45f7037954..cd662acb56 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -105,9 +105,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *bit_clock = validate_is_free_pin(args[ARG_bit_clock].u_obj); - const mcu_pin_obj_t *word_select = validate_is_free_pin(args[ARG_word_select].u_obj); - const mcu_pin_obj_t *data = validate_is_free_pin(args[ARG_data].u_obj); + const mcu_pin_obj_t *bit_clock = validate_obj_is_free_pin(args[ARG_bit_clock].u_obj); + const mcu_pin_obj_t *word_select = validate_obj_is_free_pin(args[ARG_word_select].u_obj); + const mcu_pin_obj_t *data = validate_obj_is_free_pin(args[ARG_data].u_obj); audiobusio_i2sout_obj_t *self = m_new_obj_with_finaliser(audiobusio_i2sout_obj_t); self->base.type = &audiobusio_i2sout_type; diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 65bc5a9d26..fce6cf7a2e 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -104,8 +104,8 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *clock_pin = validate_is_free_pin(args[ARG_clock_pin].u_obj); - const mcu_pin_obj_t *data_pin = validate_is_free_pin(args[ARG_data_pin].u_obj); + const mcu_pin_obj_t *clock_pin = validate_obj_is_free_pin(args[ARG_clock_pin].u_obj); + const mcu_pin_obj_t *data_pin = validate_obj_is_free_pin(args[ARG_data_pin].u_obj); // create PDMIn object from the given pin audiobusio_pdmin_obj_t *self = m_new_obj(audiobusio_pdmin_obj_t); diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 687db22d3f..ea1efcdffb 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -104,8 +104,8 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); - const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj); + const mcu_pin_obj_t *left_channel_pin = validate_obj_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_obj_is_free_pin_or_none(args[ARG_right_channel].u_obj); // create AudioOut object from the given pin audioio_audioout_obj_t *self = m_new_obj(audioio_audioout_obj_t); diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index ab1d9c9fc6..9fa2b1578e 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -107,8 +107,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t *left_channel_pin = validate_is_free_pin(args[ARG_left_channel].u_obj); - const mcu_pin_obj_t *right_channel_pin = validate_is_free_pin_or_none(args[ARG_right_channel].u_obj); + const mcu_pin_obj_t *left_channel_pin = validate_obj_is_free_pin(args[ARG_left_channel].u_obj); + const mcu_pin_obj_t *right_channel_pin = validate_obj_is_free_pin_or_none(args[ARG_right_channel].u_obj); // create AudioOut object from the given pin audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index bdfbfb2ca9..3c4f137771 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -64,8 +64,8 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); + const mcu_pin_obj_t* scl = validate_obj_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_obj_is_free_pin(args[ARG_sda].u_obj); bitbangio_i2c_obj_t *self = m_new_obj(bitbangio_i2c_obj_t); self->base.type = &bitbangio_i2c_type; diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 20ca81c5dc..95bbd0679c 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -70,7 +70,7 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); + const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); bitbangio_onewire_obj_t *self = m_new_obj(bitbangio_onewire_obj_t); self->base.type = &bitbangio_onewire_type; diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 4623523523..b1a94c1841 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -72,9 +72,9 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); - const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); - const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); + const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_obj_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_obj_is_free_pin_or_none(args[ARG_MISO].u_obj); bitbangio_spi_obj_t *self = m_new_obj(bitbangio_spi_obj_t); self->base.type = &bitbangio_spi_type; diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 618a5ad320..c89215acdb 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -77,8 +77,8 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); + const mcu_pin_obj_t* scl = validate_obj_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_obj_is_free_pin(args[ARG_sda].u_obj); common_hal_busio_i2c_construct(self, scl, sda, args[ARG_frequency].u_int, args[ARG_timeout].u_int); return (mp_obj_t)self; diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index b28495096d..022d6afcf4 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -69,7 +69,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); + const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); busio_onewire_obj_t *self = m_new_obj(busio_onewire_obj_t); self->base.type = &busio_onewire_type; diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index ca84c0f246..043c1089d5 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -90,9 +90,9 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* clock = validate_is_free_pin(args[ARG_clock].u_obj); - const mcu_pin_obj_t* mosi = validate_is_free_pin_or_none(args[ARG_MOSI].u_obj); - const mcu_pin_obj_t* miso = validate_is_free_pin_or_none(args[ARG_MISO].u_obj); + const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* mosi = validate_obj_is_free_pin_or_none(args[ARG_MOSI].u_obj); + const mcu_pin_obj_t* miso = validate_obj_is_free_pin_or_none(args[ARG_MISO].u_obj); common_hal_busio_spi_construct(self, clock, mosi, miso); return MP_OBJ_FROM_PTR(self); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index ffa50fd7d8..f231924d50 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -105,8 +105,8 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* rx = validate_is_free_pin_or_none(args[ARG_rx].u_obj); - const mcu_pin_obj_t* tx = validate_is_free_pin_or_none(args[ARG_tx].u_obj); + const mcu_pin_obj_t* rx = validate_obj_is_free_pin_or_none(args[ARG_rx].u_obj); + const mcu_pin_obj_t* tx = validate_obj_is_free_pin_or_none(args[ARG_tx].u_obj); if ( (tx == NULL) && (rx == NULL) ) { mp_raise_ValueError(translate("tx and rx cannot both be None")); @@ -132,9 +132,9 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); validate_timeout(timeout); - const mcu_pin_obj_t* rts = validate_is_free_pin_or_none(args[ARG_rts].u_obj); - const mcu_pin_obj_t* cts = validate_is_free_pin_or_none(args[ARG_cts].u_obj); - const mcu_pin_obj_t* rs485_dir = validate_is_free_pin_or_none(args[ARG_rs485_dir].u_obj); + const mcu_pin_obj_t* rts = validate_obj_is_free_pin_or_none(args[ARG_rts].u_obj); + const mcu_pin_obj_t* cts = validate_obj_is_free_pin_or_none(args[ARG_cts].u_obj); + const mcu_pin_obj_t* rs485_dir = validate_obj_is_free_pin_or_none(args[ARG_rs485_dir].u_obj); const bool rs485_invert = args[ARG_rs485_invert].u_bool; diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 1610c83f8b..39da00cf71 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -68,7 +68,7 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, digitalio_digitalinout_obj_t *self = m_new_obj(digitalio_digitalinout_obj_t); self->base.type = &digitalio_digitalinout_type; - mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); + mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); common_hal_digitalio_digitalinout_construct(self, pin); return MP_OBJ_FROM_PTR(self); diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 9fa976b86b..991c828be8 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -141,7 +141,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_init_sequence].u_obj, &bufinfo, MP_BUFFER_READ); - const mcu_pin_obj_t* backlight_pin = validate_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); + const mcu_pin_obj_t* backlight_pin = validate_obj_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); mp_float_t brightness = mp_obj_get_float(args[ARG_brightness].u_obj); diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 60a3838a40..25a4a41e92 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -129,7 +129,7 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size mp_get_buffer_raise(args[ARG_stop_sequence].u_obj, &stop_bufinfo, MP_BUFFER_READ); - const mcu_pin_obj_t* busy_pin = validate_is_free_pin_or_none(args[ARG_busy_pin].u_obj); + const mcu_pin_obj_t* busy_pin = validate_obj_is_free_pin_or_none(args[ARG_busy_pin].u_obj); mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index f013cc18fc..2cbceec48c 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -73,9 +73,9 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mcu_pin_obj_t *command = validate_is_free_pin(args[ARG_command].u_obj); - mcu_pin_obj_t *chip_select = validate_is_free_pin(args[ARG_chip_select].u_obj); - mcu_pin_obj_t *reset = validate_is_free_pin_or_none(args[ARG_reset].u_obj); + mcu_pin_obj_t *command = validate_obj_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *chip_select = validate_obj_is_free_pin(args[ARG_chip_select].u_obj); + mcu_pin_obj_t *reset = validate_obj_is_free_pin_or_none(args[ARG_reset].u_obj); displayio_fourwire_obj_t* self = NULL; mp_obj_t spi = args[ARG_spi_bus].u_obj; diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 03779fba99..2e312aa14e 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -69,7 +69,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mcu_pin_obj_t *reset = validate_is_free_pin_or_none(args[ARG_reset].u_obj); + mcu_pin_obj_t *reset = validate_obj_is_free_pin_or_none(args[ARG_reset].u_obj); displayio_i2cdisplay_obj_t* self = NULL; mp_obj_t i2c = args[ARG_i2c_bus].u_obj; diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index 33a165af96..ea1753f314 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -76,12 +76,12 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mcu_pin_obj_t *data0 = validate_is_free_pin(args[ARG_data0].u_obj); - mcu_pin_obj_t *command = validate_is_free_pin(args[ARG_command].u_obj); - mcu_pin_obj_t *chip_select = validate_is_free_pin(args[ARG_chip_select].u_obj); - mcu_pin_obj_t *write = validate_is_free_pin(args[ARG_write].u_obj); - mcu_pin_obj_t *read = validate_is_free_pin(args[ARG_read].u_obj); - mcu_pin_obj_t *reset = validate_is_free_pin(args[ARG_reset].u_obj); + mcu_pin_obj_t *data0 = validate_obj_is_free_pin(args[ARG_data0].u_obj); + mcu_pin_obj_t *command = validate_obj_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *chip_select = validate_obj_is_free_pin(args[ARG_chip_select].u_obj); + mcu_pin_obj_t *write = validate_obj_is_free_pin(args[ARG_write].u_obj); + mcu_pin_obj_t *read = validate_obj_is_free_pin(args[ARG_read].u_obj); + mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); displayio_parallelbus_obj_t* self = NULL; for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 349ef7e970..6743f87063 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -87,7 +87,7 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); + mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); const uint16_t capture_period = args[ARG_capture_period].u_int; diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index b7980d5174..e28eb3f253 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -77,8 +77,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* scl = validate_is_free_pin(args[ARG_scl].u_obj); - const mcu_pin_obj_t* sda = validate_is_free_pin(args[ARG_sda].u_obj); + const mcu_pin_obj_t* scl = validate_obj_is_free_pin(args[ARG_scl].u_obj); + const mcu_pin_obj_t* sda = validate_obj_is_free_pin(args[ARG_sda].u_obj); mp_obj_iter_buf_t iter_buf; mp_obj_t iterable = mp_getiter(args[ARG_addresses].u_obj, &iter_buf); diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index ef80088272..67aecaf66e 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -84,7 +84,7 @@ const mp_obj_type_t mcu_pin_type = { .print = mcu_pin_print }; -mcu_pin_obj_t *validate_is_pin(mp_obj_t obj) { +mcu_pin_obj_t *validate_obj_is_pin(mp_obj_t obj) { if (!MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), mcu_pin_type.name); } @@ -92,25 +92,25 @@ mcu_pin_obj_t *validate_is_pin(mp_obj_t obj) { } // Validate that the obj is a pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. -mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj) { +mcu_pin_obj_t *validate_obj_is_pin_or_none(mp_obj_t obj) { if (obj == mp_const_none) { return NULL; } - return validate_is_pin(obj); + return validate_obj_is_pin(obj); } -mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj) { - mcu_pin_obj_t *pin = validate_is_pin(obj); +mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj) { + mcu_pin_obj_t *pin = validate_obj_is_pin(obj); assert_pin_free(pin); return pin; } // Validate that the obj is a free pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly. -mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj) { +mcu_pin_obj_t *validate_obj_is_free_pin_or_none(mp_obj_t obj) { if (obj == mp_const_none) { return NULL; } - mcu_pin_obj_t *pin = validate_is_pin(obj); + mcu_pin_obj_t *pin = validate_obj_is_pin(obj); assert_pin_free(pin); return pin; } diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 2b40838278..4f29322a06 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -33,10 +33,10 @@ // Type object used in Python. Should be shared between ports. extern const mp_obj_type_t mcu_pin_type; -mcu_pin_obj_t *validate_is_pin(mp_obj_t obj); -mcu_pin_obj_t *validate_is_pin_or_none(mp_obj_t obj); -mcu_pin_obj_t *validate_is_free_pin(mp_obj_t obj); -mcu_pin_obj_t *validate_is_free_pin_or_none(mp_obj_t obj); +mcu_pin_obj_t *validate_obj_is_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_obj_is_pin_or_none(mp_obj_t obj); +mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj); +mcu_pin_obj_t *validate_obj_is_free_pin_or_none(mp_obj_t obj); void assert_pin_free(const mcu_pin_obj_t* pin); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index f5aa70907a..89ed0a76ce 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -78,8 +78,8 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* clkpin = validate_is_free_pin(args[ARG_clkpin].u_obj); - const mcu_pin_obj_t* datapin = validate_is_free_pin(args[ARG_datapin].u_obj); + const mcu_pin_obj_t* clkpin = validate_obj_is_free_pin(args[ARG_clkpin].u_obj); + const mcu_pin_obj_t* datapin = validate_obj_is_free_pin(args[ARG_datapin].u_obj); ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); self->base.type = &ps2io_ps2_type; diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index d04b469c1c..2491a5c3f1 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -96,7 +96,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args mp_arg_val_t parsed_args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, parsed_args); - const mcu_pin_obj_t *pin = validate_is_free_pin(parsed_args[ARG_pin].u_obj); + const mcu_pin_obj_t *pin = validate_obj_is_free_pin(parsed_args[ARG_pin].u_obj); uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int; uint32_t frequency = parsed_args[ARG_frequency].u_int; diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index dbab253af4..6c01a4c178 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -90,7 +90,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* pin = validate_is_free_pin(args[ARG_pin].u_obj); + const mcu_pin_obj_t* pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); pulseio_pulsein_obj_t *self = m_new_obj(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 78dccacb52..058241d24a 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -73,8 +73,8 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - const mcu_pin_obj_t* pin_a = validate_is_free_pin(args[ARG_pin_a].u_obj); - const mcu_pin_obj_t* pin_b = validate_is_free_pin(args[ARG_pin_b].u_obj); + const mcu_pin_obj_t* pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); + const mcu_pin_obj_t* pin_b = validate_obj_is_free_pin(args[ARG_pin_b].u_obj); rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 5eadb2cc49..db53ec1bc8 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -66,7 +66,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, mp_arg_check_num(n_args, kw_args, 1, 1, false); // 1st argument is the pin - const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]); + const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[0]); touchio_touchin_obj_t *self = m_new_obj(touchio_touchin_obj_t); self->base.type = &touchio_touchin_type; diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 1b7f76e122..786978bfe8 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -78,8 +78,8 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); // TODO check type of ARG_spi? - const mcu_pin_obj_t *cs = validate_is_free_pin(args[ARG_cs].u_obj); - const mcu_pin_obj_t *rst = validate_is_free_pin_or_none(args[ARG_rst].u_obj); + const mcu_pin_obj_t *cs = validate_obj_is_free_pin(args[ARG_cs].u_obj); + const mcu_pin_obj_t *rst = validate_obj_is_free_pin_or_none(args[ARG_rst].u_obj); mp_obj_t ret = wiznet5k_create(args[ARG_spi].u_obj, cs, rst); if (args[ARG_dhcp].u_bool) wiznet5k_start_dhcp(); diff --git a/shared-module/wiznet/wiznet5k.c b/shared-module/wiznet/wiznet5k.c index 3c5c5f0c83..a603a55937 100644 --- a/shared-module/wiznet/wiznet5k.c +++ b/shared-module/wiznet/wiznet5k.c @@ -379,12 +379,12 @@ void wiznet5k_socket_deinit(mod_network_socket_obj_t *socket) { } /// Create and return a WIZNET5K object. -mp_obj_t wiznet5k_create(mp_obj_t spi_in, mp_obj_t cs_in, mp_obj_t rst_in) { +mp_obj_t wiznet5k_create(busio_spi_obj_t *spi_in, const mcu_pin_obj_t *cs_in, const mcu_pin_obj_t *rst_in) { // init the wiznet5k object wiznet5k_obj.base.type = (mp_obj_type_t*)&mod_network_nic_type_wiznet5k; wiznet5k_obj.cris_state = 0; - wiznet5k_obj.spi = MP_OBJ_TO_PTR(spi_in); + wiznet5k_obj.spi = spi_in; wiznet5k_obj.socket_used = 0; wiznet5k_obj.dhcp_socket = -1; diff --git a/shared-module/wiznet/wiznet5k.h b/shared-module/wiznet/wiznet5k.h index 0154831c71..19823ae550 100644 --- a/shared-module/wiznet/wiznet5k.h +++ b/shared-module/wiznet/wiznet5k.h @@ -59,7 +59,7 @@ int wiznet5k_socket_ioctl(mod_network_socket_obj_t *socket, mp_uint_t request, m void wiznet5k_socket_timer_tick(mod_network_socket_obj_t *socket); void wiznet5k_socket_deinit(mod_network_socket_obj_t *socket); mp_obj_t wiznet5k_socket_disconnect(mp_obj_t self_in); -mp_obj_t wiznet5k_create(mp_obj_t spi_in, mp_obj_t cs_in, mp_obj_t rst_in); +mp_obj_t wiznet5k_create(busio_spi_obj_t *spi_in, const mcu_pin_obj_t *cs_in, const mcu_pin_obj_t *rst_in); int wiznet5k_start_dhcp(void); int wiznet5k_stop_dhcp(void); From b492ea69cb63e3bdd17a9eff64463d4fec3714e8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 5 Mar 2020 23:06:30 -0500 Subject: [PATCH 031/919] try actions/checkout@v2 --- .github/workflows/build.yml | 6 +++--- .github/workflows/create_website_pr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32c949a3a8..4580e711a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true - name: CircuitPython version @@ -103,7 +103,7 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true - name: CircuitPython version @@ -253,7 +253,7 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true - name: mpy-cross diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 69ca8f12b9..ca2bf49def 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -13,17 +13,17 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Set up Python 3.5 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.5 - name: Install deps run: | - pip install requests sh click + pip install requests sh click - name: Versions run: | gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true - name: CircuitPython version From 127e6fa27e7ef41e8bbdbd0282ef0a3eec7df145 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 5 Mar 2020 23:13:14 -0500 Subject: [PATCH 032/919] Revert "try actions/checkout@v2" This reverts commit b492ea69cb63e3bdd17a9eff64463d4fec3714e8. --- .github/workflows/build.yml | 6 +++--- .github/workflows/create_website_pr.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4580e711a6..32c949a3a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 with: submodules: true - name: CircuitPython version @@ -103,7 +103,7 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 with: submodules: true - name: CircuitPython version @@ -253,7 +253,7 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 with: submodules: true - name: mpy-cross diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index ca2bf49def..69ca8f12b9 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -13,17 +13,17 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - name: Set up Python 3.5 - uses: actions/setup-python@v2 + uses: actions/setup-python@v1 with: python-version: 3.5 - name: Install deps run: | - pip install requests sh click + pip install requests sh click - name: Versions run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 with: submodules: true - name: CircuitPython version From fdcdc1320b1629aec95287466eed8ee2fdc64204 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 6 Mar 2020 14:30:30 -0500 Subject: [PATCH 033/919] Make ParallelBus reset ping arg required --- shared-bindings/displayio/ParallelBus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index ea1753f314..b3a876f903 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -71,7 +71,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t { MP_QSTR_chip_select, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_write, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_read, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, - { MP_QSTR_reset, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, + { MP_QSTR_reset, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); From 125409fe95089c5856e4b9e5245c4fc23192e77e Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 6 Mar 2020 13:31:08 -0800 Subject: [PATCH 034/919] add proximity and sound_level --- docs/design_guide.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 5d965f9074..6f87ecf798 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -476,6 +476,8 @@ properties. +-----------------------+-----------------------+-------------------------------------------------------------------------+ | ``distance`` | float | centimeters | +-----------------------+-----------------------+-------------------------------------------------------------------------+ +| ``proximity`` | int | non-unit-specifc proximity values (monotonic but not actual distance) | ++-----------------------+-----------------------+-------------------------------------------------------------------------+ | ``light`` | float | non-unit-specific light levels (should be monotonic but is not lux) | +-----------------------+-----------------------+-------------------------------------------------------------------------+ | ``lux`` | float | SI lux | @@ -504,6 +506,8 @@ properties. +-----------------------+-----------------------+-------------------------------------------------------------------------+ | ``weight`` | float | grams (g) | +-----------------------+-----------------------+-------------------------------------------------------------------------+ +| ``sound_level`` | float | non-unit-specific sound level (monotonic but not actual decibels) | ++-----------------------+-----------------------+-------------------------------------------------------------------------+ Adding native modules -------------------------------------------------------------------------------- From 3a7a5ba6860c787cc691b5c828eff9a130f39526 Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Sat, 10 Aug 2019 21:27:20 -0700 Subject: [PATCH 035/919] py: Implement partial PEP-498 (f-string) support This implements (most of) the PEP-498 spec for f-strings, with two exceptions: - raw f-strings (`fr` or `rf` prefixes) raise `NotImplementedError` - one special corner case does not function as specified in the PEP (more on that in a moment) This is implemented in the core as a syntax translation, brute-forcing all f-strings to run through `String.format`. For example, the statement `x='world'; print(f'hello {x}')` gets translated *at a syntax level* (injected into the lexer) to `x='world'; print('hello {}'.format(x))`. While this may lead to weird column results in tracebacks, it seemed like the fastest, most efficient, and *likely* most RAM-friendly option, despite being implemented under the hood with a completely separate `vstr_t`. Since [string concatenation of adjacent literals is implemented in the lexer](https://github.com/micropython/micropython/commit/534b7c368dc2af7720f3aaed0c936ef46d773957), two side effects emerge: - All strings with at least one f-string portion are concatenated into a single literal which *must* be run through `String.format()` wholesale, and: - Concatenation of a raw string with interpolation characters with an f-string will cause `IndexError`/`KeyError`, which is both different from CPython *and* different from the corner case mentioned in the PEP (which gave an example of the following:) ```python x = 10 y = 'hi' assert ('a' 'b' f'{x}' '{c}' f'str<{y:^4}>' 'd' 'e') == 'ab10{c}str< hi >de' ``` The above-linked commit detailed a pretty solid case for leaving string concatenation in the lexer rather than putting it in the parser, and undoing that decision would likely be disproportionately costly on resources for the sake of a probably-low-impact corner case. An alternative to become complaint with this corner case of the PEP would be to revert to string concatenation in the parser *only when an f-string is part of concatenation*, though I've done no investigation on the difficulty or costs of doing this. A decent set of tests is included. I've manually tested this on the `unix` port on Linux and on a Feather M4 Express (`atmel-samd`) and things seem sane. --- py/lexer.c | 132 +++++++++++++++++++++++++- py/lexer.h | 10 ++ py/parse.c | 47 +++++++-- tests/basics/string_pep498_fstring.py | 126 ++++++++++++++++++++++++ 4 files changed, 301 insertions(+), 14 deletions(-) create mode 100644 tests/basics/string_pep498_fstring.py diff --git a/py/lexer.c b/py/lexer.c index 755fa625be..6894ada472 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -64,6 +64,10 @@ STATIC bool is_char_or3(mp_lexer_t *lex, byte c1, byte c2, byte c3) { return lex->chr0 == c1 || lex->chr0 == c2 || lex->chr0 == c3; } +STATIC bool is_char_or4(mp_lexer_t *lex, byte c1, byte c2, byte c3, byte c4) { + return lex->chr0 == c1 || lex->chr0 == c2 || lex->chr0 == c3 || lex->chr0 == c4; +} + STATIC bool is_char_following(mp_lexer_t *lex, byte c) { return lex->chr1 == c; } @@ -107,7 +111,9 @@ STATIC bool is_following_odigit(mp_lexer_t *lex) { STATIC bool is_string_or_bytes(mp_lexer_t *lex) { return is_char_or(lex, '\'', '\"') - || (is_char_or3(lex, 'r', 'u', 'b') && is_char_following_or(lex, '\'', '\"')) + || (is_char_or4(lex, 'r', 'u', 'b', 'f') && is_char_following_or(lex, '\'', '\"')) + || ((is_char_and(lex, 'r', 'f') || is_char_and(lex, 'f', 'r')) + && is_char_following_following_or(lex, '\'', '\"')) || ((is_char_and(lex, 'r', 'b') || is_char_and(lex, 'b', 'r')) && is_char_following_following_or(lex, '\'', '\"')); } @@ -121,6 +127,37 @@ STATIC bool is_tail_of_identifier(mp_lexer_t *lex) { return is_head_of_identifier(lex) || is_digit(lex); } +STATIC void swap_char_banks(mp_lexer_t *lex) { + if (lex->vstr_postfix_processing) { + unichar h0, h1, h2; + + h0 = lex->chr0; + h1 = lex->chr1; + h2 = lex->chr2; + + lex->chr0 = lex->vstr_postfix.len > 0 ? lex->vstr_postfix.buf[0] : 0; + lex->chr1 = lex->vstr_postfix.len > 1 ? lex->vstr_postfix.buf[1] : 0; + lex->chr2 = lex->vstr_postfix.len > 2 ? lex->vstr_postfix.buf[2] : 0; + lex->chr3 = h0; + lex->chr4 = h1; + lex->chr5 = h2; + + lex->vstr_postfix_idx = lex->vstr_postfix.len > 2 ? 3 : lex->vstr_postfix.len; + } else { + // blindly reset to the "backup" bank when done postfix processing + // this restores control to the mp_reader + lex->chr0 = lex->chr3; + lex->chr1 = lex->chr4; + lex->chr2 = lex->chr5; + lex->chr3 = 0; + lex->chr4 = 0; + lex->chr5 = 0; + + vstr_reset(&lex->vstr_postfix); + lex->vstr_postfix_idx = 0; + } +} + STATIC void next_char(mp_lexer_t *lex) { if (lex->chr0 == '\n') { // a new line @@ -136,7 +173,16 @@ STATIC void next_char(mp_lexer_t *lex) { lex->chr0 = lex->chr1; lex->chr1 = lex->chr2; - lex->chr2 = lex->reader.readbyte(lex->reader.data); + + if (lex->vstr_postfix_processing) { + if (lex->vstr_postfix_idx == lex->vstr_postfix.len) { + lex->chr2 = '\0'; + } else { + lex->chr2 = lex->vstr_postfix.buf[lex->vstr_postfix_idx++]; + } + } else { + lex->chr2 = lex->reader.readbyte(lex->reader.data); + } if (lex->chr1 == '\r') { // CR is a new line, converted to LF @@ -151,6 +197,11 @@ STATIC void next_char(mp_lexer_t *lex) { if (lex->chr2 == MP_LEXER_EOF && lex->chr1 != MP_LEXER_EOF && lex->chr1 != '\n') { lex->chr2 = '\n'; } + + if (lex->vstr_postfix_processing && lex->chr0 == '\0') { + lex->vstr_postfix_processing = false; + swap_char_banks(lex); + } } STATIC void indent_push(mp_lexer_t *lex, size_t indent) { @@ -270,7 +321,7 @@ STATIC bool get_hex(mp_lexer_t *lex, size_t num_digits, mp_uint_t *result) { return true; } -STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw) { +STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw, bool is_fstring) { // get first quoting character char quote_char = '\''; if (is_char(lex, '\"')) { @@ -291,15 +342,67 @@ STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw) { } size_t n_closing = 0; + bool in_expression = false; + bool expression_eat = true; + while (!is_end(lex) && (num_quotes > 1 || !is_char(lex, '\n')) && n_closing < num_quotes) { if (is_char(lex, quote_char)) { n_closing += 1; vstr_add_char(&lex->vstr, CUR_CHAR(lex)); } else { n_closing = 0; + if (is_fstring && is_char(lex, '{')) { + vstr_add_char(&lex->vstr, CUR_CHAR(lex)); + in_expression = !in_expression; + expression_eat = in_expression; + + if (lex->vstr_postfix.len == 0) { + vstr_add_str(&lex->vstr_postfix, ".format("); + } + + next_char(lex); + continue; + } + + if (is_fstring && is_char(lex, '}')) { + vstr_add_char(&lex->vstr, CUR_CHAR(lex)); + + if (in_expression) { + in_expression = false; + vstr_add_char(&lex->vstr_postfix, ','); + } + + next_char(lex); + continue; + } + + if (in_expression) { + // throw errors for illegal chars inside f-string expressions + if (is_char(lex, '#')) { + lex->tok_kind = MP_TOKEN_FSTRING_COMMENT; + return; + } else if (is_char(lex, '\\')) { + lex->tok_kind = MP_TOKEN_FSTRING_BACKSLASH; + return; + } else if (is_char(lex, ':')) { + expression_eat = false; + } + + unichar c = CUR_CHAR(lex); + if (expression_eat) { + vstr_add_char(&lex->vstr_postfix, c); + } else { + vstr_add_char(&lex->vstr, c); + } + + next_char(lex); + continue; + } + if (is_char(lex, '\\')) { next_char(lex); unichar c = CUR_CHAR(lex); + if (is_raw) { // raw strings allow escaping of quotes, but the backslash is also emitted vstr_add_char(&lex->vstr, '\\'); @@ -430,6 +533,13 @@ STATIC bool skip_whitespace(mp_lexer_t *lex, bool stop_at_newline) { } void mp_lexer_to_next(mp_lexer_t *lex) { + if (lex->vstr_postfix.len && !lex->vstr_postfix_processing) { + // end format call injection + vstr_add_char(&lex->vstr_postfix, ')'); + lex->vstr_postfix_processing = true; + swap_char_banks(lex); + } + // start new token text vstr_reset(&lex->vstr); @@ -485,6 +595,7 @@ void mp_lexer_to_next(mp_lexer_t *lex) { do { // parse type codes bool is_raw = false; + bool is_fstring = false; mp_token_kind_t kind = MP_TOKEN_STRING; int n_char = 0; if (is_char(lex, 'u')) { @@ -503,6 +614,17 @@ void mp_lexer_to_next(mp_lexer_t *lex) { kind = MP_TOKEN_BYTES; n_char = 2; } + if (is_char_following(lex, 'f')) { + lex->tok_kind = MP_TOKEN_FSTRING_RAW; + break; + } + } else if (is_char(lex, 'f')) { + if (is_char_following(lex, 'r')) { + lex->tok_kind = MP_TOKEN_FSTRING_RAW; + break; + } + n_char = 1; + is_fstring = true; } // Set or check token kind @@ -522,13 +644,12 @@ void mp_lexer_to_next(mp_lexer_t *lex) { } // Parse the literal - parse_string_literal(lex, is_raw); + parse_string_literal(lex, is_raw, is_fstring); // Skip whitespace so we can check if there's another string following skip_whitespace(lex, true); } while (is_string_or_bytes(lex)); - } else if (is_head_of_identifier(lex)) { lex->tok_kind = MP_TOKEN_NAME; @@ -682,6 +803,7 @@ mp_lexer_t *mp_lexer_new(qstr src_name, mp_reader_t reader) { lex->num_indent_level = 1; lex->indent_level = m_new(uint16_t, lex->alloc_indent_level); vstr_init(&lex->vstr, 32); + vstr_init(&lex->vstr_postfix, 0); // store sentinel for first indentation level lex->indent_level[0] = 0; diff --git a/py/lexer.h b/py/lexer.h index a29709107d..7fe271e841 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -44,6 +44,12 @@ typedef enum _mp_token_kind_t { MP_TOKEN_INVALID, MP_TOKEN_DEDENT_MISMATCH, MP_TOKEN_LONELY_STRING_OPEN, + MP_TOKEN_FSTRING_BACKSLASH, + MP_TOKEN_FSTRING_COMMENT, + MP_TOKEN_FSTRING_UNCLOSED, + MP_TOKEN_FSTRING_UNOPENED, + MP_TOKEN_FSTRING_EMPTY_EXP, + MP_TOKEN_FSTRING_RAW, MP_TOKEN_NEWLINE, MP_TOKEN_INDENT, @@ -150,6 +156,7 @@ typedef struct _mp_lexer_t { mp_reader_t reader; // stream source unichar chr0, chr1, chr2; // current cached characters from source + unichar chr3, chr4, chr5; // current cached characters from alt source size_t line; // current source line size_t column; // current source column @@ -165,6 +172,9 @@ typedef struct _mp_lexer_t { size_t tok_column; // token source column mp_token_kind_t tok_kind; // token kind vstr_t vstr; // token data + vstr_t vstr_postfix; // postfix to apply to string + bool vstr_postfix_processing; + uint16_t vstr_postfix_idx; } mp_lexer_t; mp_lexer_t *mp_lexer_new(qstr src_name, mp_reader_t reader); diff --git a/py/parse.c b/py/parse.c index 864528470f..d30d1b22f3 100644 --- a/py/parse.c +++ b/py/parse.c @@ -924,6 +924,7 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { backtrack = false; } for (; i < n; ++i) { + //printf("--> inside for @L924\n"); uint16_t kind = rule_arg[i] & RULE_ARG_KIND_MASK; if (kind == RULE_ARG_TOK) { if (lex->tok_kind == (rule_arg[i] & RULE_ARG_ARG_MASK)) { @@ -1168,15 +1169,43 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { ) { syntax_error:; mp_obj_t exc; - if (lex->tok_kind == MP_TOKEN_INDENT) { - exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - translate("unexpected indent")); - } else if (lex->tok_kind == MP_TOKEN_DEDENT_MISMATCH) { - exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - translate("unindent does not match any outer indentation level")); - } else { - exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, - translate("invalid syntax")); + switch(lex->tok_kind) { + case MP_TOKEN_INDENT: + exc = mp_obj_new_exception_msg(&mp_type_IndentationError, + translate("unexpected indent")); + break; + case MP_TOKEN_DEDENT_MISMATCH: + exc = mp_obj_new_exception_msg(&mp_type_IndentationError, + translate("unindent does not match any outer indentation level")); + break; + case MP_TOKEN_FSTRING_BACKSLASH: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("f-string expression part cannot include a backslash")); + break; + case MP_TOKEN_FSTRING_COMMENT: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("f-string expression part cannot include a '#'")); + break; + case MP_TOKEN_FSTRING_UNCLOSED: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("f-string: expecting '}'")); + break; + case MP_TOKEN_FSTRING_UNOPENED: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("f-string: single '}' is not allowed")); + break; + case MP_TOKEN_FSTRING_EMPTY_EXP: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("f-string: empty expression not allowed")); + break; + case MP_TOKEN_FSTRING_RAW: + exc = mp_obj_new_exception_msg(&mp_type_NotImplementedError, + translate("raw f-strings are not implemented")); + break; + default: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("invalid syntax")); + break; } // add traceback to give info about file name and location // we don't have a 'block' name, so just pass the NULL qstr to indicate this diff --git a/tests/basics/string_pep498_fstring.py b/tests/basics/string_pep498_fstring.py new file mode 100644 index 0000000000..f1ad1f19b8 --- /dev/null +++ b/tests/basics/string_pep498_fstring.py @@ -0,0 +1,126 @@ +# Tests against https://www.python.org/dev/peps/pep-0498/ + +assert f'no interpolation' == 'no interpolation' +assert f"no interpolation" == 'no interpolation' + +# Quoth the PEP: +# Backslashes may not appear anywhere within expressions. Comments, using the +# '#' character, are not allowed inside an expression +# +# CPython (3.7.4 on Linux) raises a SyntaxError here: +# >>> f'{#}' +# File "", line 1 +# SyntaxError: f-string expression part cannot include '#' +# >>> f'{\}' +# File "", line 1 +# SyntaxError: f-string expression part cannot include a backslash +# >>> f'{\\}' +# File "", line 1 +# SyntaxError: f-string expression part cannot include a backslash +# >>> f'{\#}' +# File "", line 1 +# SyntaxError: f-string expression part cannot include a backslash + +# Backslashes and comments allowed outside expression +assert f"\\" == "\\" +assert f'#' == '#' + +## But not inside +try: + eval("f'{\}'") +except SyntaxError: + pass +else: + raise AssertionError('f-string with backslash in expression did not raise SyntaxError') + +try: + eval("f'{#}'") +except SyntaxError: + pass +else: + raise AssertionError('f-string with \'#\' in expression did not raise SyntaxError') + +# Quoth the PEP: +# While scanning the string for expressions, any doubled braces '{{' or '}}' +# inside literal portions of an f-string are replaced by the corresponding +# single brace. Doubled literal opening braces do not signify the start of an +# expression. A single closing curly brace '}' in the literal portion of a +# string is an error: literal closing curly braces must be doubled '}}' in +# order to represent a single closing brace. +# +# CPython (3.7.4 on Linux) raises a SyntaxError for the last case: +# >>> f'{{}' +# File "", line 1 +# SyntaxError: f-string: single '}' is not allowed + +assert f'{{}}' == '{}' + +try: + eval("f'{{}'") +except ValueError: + pass +else: + raise RuntimeError('Expected ValueError for invalid f-string literal bracing') + +x = 1 +assert f'{x}' == '1' + +# Quoth the PEP: +# The expressions that are extracted from the string are evaluated in the +# context where the f-string appeared. This means the expression has full +# access to local and global variables. Any valid Python expression can be +# used, including function and method calls. Because the f-strings are +# evaluated where the string appears in the source code, there is no additional +# expressiveness available with f-strings. There are also no additional +# security concerns: you could have also just written the same expression, not +# inside of an f-string: + +def foo(): + return 20 + +assert f'result={foo()}' == 'result=20' +assert f'result={foo()}' == 'result={}'.format(foo()) +assert f'result={foo()}' == 'result={result}'.format(result=foo()) + + +# Quoth the PEP: +# Adjacent f-strings and regular strings are concatenated. Regular strings are +# concatenated at compile time, and f-strings are concatenated at run time. For +# example, the expression: +# +# >>> x = 10 +# >>> y = 'hi' +# >>> 'a' 'b' f'{x}' '{c}' f'str<{y:^4}>' 'd' 'e' +# +# yields the value: 'ab10{c}str< hi >de' +# +# Because strings are concatenated at lexer time rather than parser time in +# MicroPython for mostly RAM efficiency reasons (see +# https://github.com/micropython/micropython/commit/534b7c368dc2af7720f3aaed0c936ef46d773957), +# and because f-strings here are implemented as a syntax translation +# (f'{something}' => '{}'.format(something)), this particular functionality is unimplemented, +# and in the above example, the '{c}' portion will trigger a KeyError on String.format() + +x = 10 +y = 'hi' +assert (f'h' f'i') == 'hi' +assert (f'h' 'i') == 'hi' +assert ('h' f'i') == 'hi' +assert f'{x:^4}' == ' 10 ' +assert ('a' 'b' f'{x}' f'str<{y:^4}>' 'd' 'e') == 'ab10str< hi >de' + +# Other tests +assert f'{{{4*10}}}' == '{40}' + +try: + eval("fr''") +except NotImplementedError: + pass +else: + raise RuntimeError('expected raw f-string to raise NotImplementedError') +try: + eval("rf''") +except NotImplementedError: + pass +else: + raise RuntimeError('expected raw f-string to raise NotImplementedError') From 40bc05ee1eafcc2f0b3ed48f212a1526b65163bc Mon Sep 17 00:00:00 2001 From: Josh Klar Date: Thu, 26 Sep 2019 16:48:02 -0700 Subject: [PATCH 036/919] Address dpgeorge feedback - largely simplifications --- py/lexer.c | 24 ++++++++---------------- py/parse.c | 12 ++++++++++++ tests/basics/string_pep498_fstring.py | 13 ------------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/py/lexer.c b/py/lexer.c index 6894ada472..c3f4e65064 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -129,29 +129,21 @@ STATIC bool is_tail_of_identifier(mp_lexer_t *lex) { STATIC void swap_char_banks(mp_lexer_t *lex) { if (lex->vstr_postfix_processing) { - unichar h0, h1, h2; + lex->chr3 = lex->chr0; + lex->chr4 = lex->chr1; + lex->chr5 = lex->chr2; + lex->chr0 = lex->vstr_postfix.buf[0]; + lex->chr1 = lex->vstr_postfix.buf[1]; + lex->chr2 = lex->vstr_postfix.buf[2]; - h0 = lex->chr0; - h1 = lex->chr1; - h2 = lex->chr2; - - lex->chr0 = lex->vstr_postfix.len > 0 ? lex->vstr_postfix.buf[0] : 0; - lex->chr1 = lex->vstr_postfix.len > 1 ? lex->vstr_postfix.buf[1] : 0; - lex->chr2 = lex->vstr_postfix.len > 2 ? lex->vstr_postfix.buf[2] : 0; - lex->chr3 = h0; - lex->chr4 = h1; - lex->chr5 = h2; - - lex->vstr_postfix_idx = lex->vstr_postfix.len > 2 ? 3 : lex->vstr_postfix.len; + lex->vstr_postfix_idx = 3; } else { // blindly reset to the "backup" bank when done postfix processing // this restores control to the mp_reader lex->chr0 = lex->chr3; lex->chr1 = lex->chr4; lex->chr2 = lex->chr5; - lex->chr3 = 0; - lex->chr4 = 0; - lex->chr5 = 0; + // willfully ignoring setting chr3-5 here - WARNING consider those garbage data now vstr_reset(&lex->vstr_postfix); lex->vstr_postfix_idx = 0; diff --git a/py/parse.c b/py/parse.c index d30d1b22f3..f86ee25fe0 100644 --- a/py/parse.c +++ b/py/parse.c @@ -1178,6 +1178,7 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, translate("unindent does not match any outer indentation level")); break; +#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED case MP_TOKEN_FSTRING_BACKSLASH: exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, translate("f-string expression part cannot include a backslash")); @@ -1202,6 +1203,17 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { exc = mp_obj_new_exception_msg(&mp_type_NotImplementedError, translate("raw f-strings are not implemented")); break; +#else + case MP_TOKEN_FSTRING_BACKSLASH: + case MP_TOKEN_FSTRING_COMMENT: + case MP_TOKEN_FSTRING_UNCLOSED: + case MP_TOKEN_FSTRING_UNOPENED: + case MP_TOKEN_FSTRING_EMPTY_EXP: + case MP_TOKEN_FSTRING_RAW: + exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, + translate("malformed f-string")); + break; +#endif default: exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, translate("invalid syntax")); diff --git a/tests/basics/string_pep498_fstring.py b/tests/basics/string_pep498_fstring.py index f1ad1f19b8..f4e76c8310 100644 --- a/tests/basics/string_pep498_fstring.py +++ b/tests/basics/string_pep498_fstring.py @@ -111,16 +111,3 @@ assert ('a' 'b' f'{x}' f'str<{y:^4}>' 'd' 'e') == 'ab10str< hi >de' # Other tests assert f'{{{4*10}}}' == '{40}' - -try: - eval("fr''") -except NotImplementedError: - pass -else: - raise RuntimeError('expected raw f-string to raise NotImplementedError') -try: - eval("rf''") -except NotImplementedError: - pass -else: - raise RuntimeError('expected raw f-string to raise NotImplementedError') From acd7b8932f9ae4dc03d28ebcf13795de5e913368 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 08:19:46 -0500 Subject: [PATCH 037/919] locale: run 'make translate' --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/circuitpython.pot | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/en_US.po | 30 +++++++++++++++++++++++++++++- locale/en_x_pirate.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 13 files changed, 377 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 4325ac3222..dff59c1ce5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2080,6 +2080,26 @@ msgstr "argumen keyword ekstra telah diberikan" msgid "extra positional arguments given" msgstr "argumen posisi ekstra telah diberikan" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2393,6 +2413,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2721,6 +2745,10 @@ msgstr "" msgid "queue overflow" msgstr "antrian meluap (overflow)" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5494ed9322..e9afe41c2f 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2056,6 +2056,26 @@ msgstr "" msgid "extra positional arguments given" msgstr "" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2369,6 +2389,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2696,6 +2720,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9f0ff3a43e..b1ddf050ea 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -2085,6 +2085,26 @@ msgstr "Es wurden zusätzliche Keyword-Argumente angegeben" msgid "extra positional arguments given" msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2405,6 +2425,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "long int wird in diesem Build nicht unterstützt" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "map buffer zu klein" @@ -2734,6 +2758,10 @@ msgstr "" msgid "queue overflow" msgstr "Warteschlangenüberlauf" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 3ab55e3e37..b41734976b 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2056,6 +2056,26 @@ msgstr "" msgid "extra positional arguments given" msgstr "" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2369,6 +2389,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2696,6 +2720,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 6e31f7638e..b079dcd092 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -2060,6 +2060,26 @@ msgstr "" msgid "extra positional arguments given" msgstr "" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2373,6 +2393,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2700,6 +2724,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/es.po b/locale/es.po index 406d912342..772c38f695 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2087,6 +2087,26 @@ msgstr "argumento(s) por palabra clave adicionales fueron dados" msgid "extra positional arguments given" msgstr "argumento posicional adicional dado" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2403,6 +2423,10 @@ msgstr "variable local referenciada antes de la asignación" msgid "long int not supported in this build" msgstr "long int no soportado en esta compilación" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "map buffer muy pequeño" @@ -2734,6 +2758,10 @@ msgstr "pow() con 3 argumentos requiere enteros" msgid "queue overflow" msgstr "desbordamiento de cola(queue)" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 2c79dfe5c1..450ed5f0e2 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2101,6 +2101,26 @@ msgstr "dagdag na keyword argument na ibinigay" msgid "extra positional arguments given" msgstr "dagdag na positional argument na ibinigay" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2419,6 +2439,10 @@ msgstr "local variable na reference bago na i-assign" msgid "long int not supported in this build" msgstr "long int hindi sinusuportahan sa build na ito" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "masyadong maliit ang buffer map" @@ -2748,6 +2772,10 @@ msgstr "pow() na may 3 argumento kailangan ng integers" msgid "queue overflow" msgstr "puno na ang pila (overflow)" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 220b66de83..708176c6bc 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2126,6 +2126,26 @@ msgstr "argument(s) nommé(s) supplémentaire(s) donné(s)" msgid "extra positional arguments given" msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2443,6 +2463,10 @@ msgstr "variable locale référencée avant d'être assignée" msgid "long int not supported in this build" msgstr "entiers longs non supportés dans cette build" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "tampon trop petit" @@ -2780,6 +2804,10 @@ msgstr "pow() avec 3 arguments nécessite des entiers" msgid "queue overflow" msgstr "dépassement de file" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 19162faf56..f4eeea46fd 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2102,6 +2102,26 @@ msgstr "argomento nominato aggiuntivo fornito" msgid "extra positional arguments given" msgstr "argomenti posizonali extra dati" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2421,6 +2441,10 @@ msgstr "variabile locale richiamata prima di un assegnamento" msgid "long int not supported in this build" msgstr "long int non supportata in questa build" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "map buffer troppo piccolo" @@ -2755,6 +2779,10 @@ msgstr "pow() con 3 argomenti richiede interi" msgid "queue overflow" msgstr "overflow della coda" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 067d3491f0..96bb26d091 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -2061,6 +2061,26 @@ msgstr "" msgid "extra positional arguments given" msgstr "" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2374,6 +2394,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2701,6 +2725,10 @@ msgstr "" msgid "queue overflow" msgstr "" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index a1d47caa61..581dac8d0d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -2065,6 +2065,26 @@ msgstr "nadmiarowe argumenty nazwane" msgid "extra positional arguments given" msgstr "nadmiarowe argumenty pozycyjne" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2378,6 +2398,10 @@ msgstr "zmienna lokalna użyta przed przypisaniem" msgid "long int not supported in this build" msgstr "long int jest nieobsługiwany" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "bufor mapy zbyt mały" @@ -2706,6 +2730,10 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych" msgid "queue overflow" msgstr "przepełnienie kolejki" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f37d750503..3dce592e3b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2078,6 +2078,26 @@ msgstr "argumentos extras de palavras-chave passados" msgid "extra positional arguments given" msgstr "argumentos extra posicionais passados" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2391,6 +2411,10 @@ msgstr "" msgid "long int not supported in this build" msgstr "" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "" @@ -2718,6 +2742,10 @@ msgstr "" msgid "queue overflow" msgstr "estouro de fila" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 465920d5dc..cc23d7fc80 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-03 20:13-0600\n" +"POT-Creation-Date: 2020-03-09 08:19-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2093,6 +2093,26 @@ msgstr "éwài de guānjiàn cí cānshù" msgid "extra positional arguments given" msgstr "gěi chūle éwài de wèizhì cānshù" +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" @@ -2407,6 +2427,10 @@ msgstr "fùzhí qián yǐnyòng de júbù biànliàng" msgid "long int not supported in this build" msgstr "cǐ bǎnběn bù zhīchí zhǎng zhěngshù" +#: py/parse.c +msgid "malformed f-string" +msgstr "" + #: shared-bindings/_stage/Layer.c msgid "map buffer too small" msgstr "dìtú huǎnchōng qū tài xiǎo" @@ -2735,6 +2759,10 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" msgid "queue overflow" msgstr "duìliè yìchū" +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" msgstr "" From 32647cd9b41c26003df0bdc385353f6a24b727d7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 08:33:47 -0500 Subject: [PATCH 038/919] lexer: catch concatenation of f'' and '' strings This turns the "edge case" into a parse-time error. --- py/lexer.c | 13 +++++++++++++ tests/basics/string_pep498_fstring.py | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/py/lexer.c b/py/lexer.c index c3f4e65064..80f8f043c7 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -583,6 +583,8 @@ void mp_lexer_to_next(mp_lexer_t *lex) { // MP_TOKEN_END is used to indicate that this is the first string token lex->tok_kind = MP_TOKEN_END; + bool saw_normal = false, saw_fstring = false; + // Loop to accumulate string/bytes literals do { // parse type codes @@ -619,6 +621,17 @@ void mp_lexer_to_next(mp_lexer_t *lex) { is_fstring = true; } + if (is_fstring) { + saw_fstring = true; + } else { + saw_normal = true; + } + + if (saw_fstring && saw_normal) { + // Can't concatenate f-string with normal string + break; + } + // Set or check token kind if (lex->tok_kind == MP_TOKEN_END) { lex->tok_kind = kind; diff --git a/tests/basics/string_pep498_fstring.py b/tests/basics/string_pep498_fstring.py index f4e76c8310..c645a730c6 100644 --- a/tests/basics/string_pep498_fstring.py +++ b/tests/basics/string_pep498_fstring.py @@ -104,10 +104,10 @@ assert f'result={foo()}' == 'result={result}'.format(result=foo()) x = 10 y = 'hi' assert (f'h' f'i') == 'hi' -assert (f'h' 'i') == 'hi' -assert ('h' f'i') == 'hi' +#assert (f'h' 'i') == 'hi' +#assert ('h' f'i') == 'hi' assert f'{x:^4}' == ' 10 ' -assert ('a' 'b' f'{x}' f'str<{y:^4}>' 'd' 'e') == 'ab10str< hi >de' +#assert ('a' 'b' f'{x}' f'str<{y:^4}>' 'd' 'e') == 'ab10str< hi >de' # Other tests assert f'{{{4*10}}}' == '{40}' From 473e9c5ffb081ae2750948099ac8288b039d4255 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 09:02:47 -0500 Subject: [PATCH 039/919] f-strings: Make optional, defaulting to !CIRCUITPY_MINIMAL_BUILD This should reclaim *most* code space added to handle f-strings. However, there may be some small code growth as parse_string_literal takes a new parameter (which will always be 0, so hopefully the optimizer eliminates it) --- py/circuitpy_mpconfig.h | 3 +++ py/lexer.c | 33 ++++++++++++++++++++++++++++++++- py/lexer.h | 6 ++++++ py/mpconfig.h | 5 +++++ py/parse.c | 2 ++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 61dd901ed5..acff27bcf5 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -187,6 +187,9 @@ typedef long mp_off_t; #if !defined(MICROPY_CPYTHON_COMPAT) #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #endif +#if !defined(MICROPY_COMP_FSTRING_LITERAL) +#define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) +#endif #define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD) diff --git a/py/lexer.c b/py/lexer.c index 80f8f043c7..00cd59bcae 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -64,9 +64,11 @@ STATIC bool is_char_or3(mp_lexer_t *lex, byte c1, byte c2, byte c3) { return lex->chr0 == c1 || lex->chr0 == c2 || lex->chr0 == c3; } +#if MICROPY_COMP_FSTRING_LITERAL STATIC bool is_char_or4(mp_lexer_t *lex, byte c1, byte c2, byte c3, byte c4) { return lex->chr0 == c1 || lex->chr0 == c2 || lex->chr0 == c3 || lex->chr0 == c4; } +#endif STATIC bool is_char_following(mp_lexer_t *lex, byte c) { return lex->chr1 == c; @@ -111,9 +113,13 @@ STATIC bool is_following_odigit(mp_lexer_t *lex) { STATIC bool is_string_or_bytes(mp_lexer_t *lex) { return is_char_or(lex, '\'', '\"') +#if MICROPY_COMP_FSTRING_LITERAL || (is_char_or4(lex, 'r', 'u', 'b', 'f') && is_char_following_or(lex, '\'', '\"')) || ((is_char_and(lex, 'r', 'f') || is_char_and(lex, 'f', 'r')) && is_char_following_following_or(lex, '\'', '\"')) +#else + || (is_char_or3(lex, 'r', 'u', 'b') && is_char_following_or(lex, '\'', '\"')) +#endif || ((is_char_and(lex, 'r', 'b') || is_char_and(lex, 'b', 'r')) && is_char_following_following_or(lex, '\'', '\"')); } @@ -127,6 +133,7 @@ STATIC bool is_tail_of_identifier(mp_lexer_t *lex) { return is_head_of_identifier(lex) || is_digit(lex); } +#if MICROPY_COMP_FSTRING_LITERAL STATIC void swap_char_banks(mp_lexer_t *lex) { if (lex->vstr_postfix_processing) { lex->chr3 = lex->chr0; @@ -149,6 +156,7 @@ STATIC void swap_char_banks(mp_lexer_t *lex) { lex->vstr_postfix_idx = 0; } } +#endif STATIC void next_char(mp_lexer_t *lex) { if (lex->chr0 == '\n') { @@ -166,13 +174,16 @@ STATIC void next_char(mp_lexer_t *lex) { lex->chr0 = lex->chr1; lex->chr1 = lex->chr2; +#if MICROPY_COMP_FSTRING_LITERAL if (lex->vstr_postfix_processing) { if (lex->vstr_postfix_idx == lex->vstr_postfix.len) { lex->chr2 = '\0'; } else { lex->chr2 = lex->vstr_postfix.buf[lex->vstr_postfix_idx++]; } - } else { + } else +#endif + { lex->chr2 = lex->reader.readbyte(lex->reader.data); } @@ -190,10 +201,12 @@ STATIC void next_char(mp_lexer_t *lex) { lex->chr2 = '\n'; } +#if MICROPY_COMP_FSTRING_LITERAL if (lex->vstr_postfix_processing && lex->chr0 == '\0') { lex->vstr_postfix_processing = false; swap_char_banks(lex); } +#endif } STATIC void indent_push(mp_lexer_t *lex, size_t indent) { @@ -334,8 +347,10 @@ STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw, bool is_fstring) } size_t n_closing = 0; +#if MICROPY_COMP_FSTRING_LITERAL bool in_expression = false; bool expression_eat = true; +#endif while (!is_end(lex) && (num_quotes > 1 || !is_char(lex, '\n')) && n_closing < num_quotes) { if (is_char(lex, quote_char)) { @@ -343,6 +358,7 @@ STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw, bool is_fstring) vstr_add_char(&lex->vstr, CUR_CHAR(lex)); } else { n_closing = 0; +#if MICROPY_COMP_FSTRING_LITERAL if (is_fstring && is_char(lex, '{')) { vstr_add_char(&lex->vstr, CUR_CHAR(lex)); in_expression = !in_expression; @@ -390,6 +406,7 @@ STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw, bool is_fstring) next_char(lex); continue; } +#endif if (is_char(lex, '\\')) { next_char(lex); @@ -525,12 +542,14 @@ STATIC bool skip_whitespace(mp_lexer_t *lex, bool stop_at_newline) { } void mp_lexer_to_next(mp_lexer_t *lex) { +#if MICROPY_COMP_FSTRING_LITERAL if (lex->vstr_postfix.len && !lex->vstr_postfix_processing) { // end format call injection vstr_add_char(&lex->vstr_postfix, ')'); lex->vstr_postfix_processing = true; swap_char_banks(lex); } +#endif // start new token text vstr_reset(&lex->vstr); @@ -583,13 +602,19 @@ void mp_lexer_to_next(mp_lexer_t *lex) { // MP_TOKEN_END is used to indicate that this is the first string token lex->tok_kind = MP_TOKEN_END; +#if MICROPY_COMP_FSTRING_LITERAL bool saw_normal = false, saw_fstring = false; +#endif // Loop to accumulate string/bytes literals do { // parse type codes bool is_raw = false; +#if MICROPY_COMP_FSTRING_LITERAL bool is_fstring = false; +#else + const bool is_fstring = false; +#endif mp_token_kind_t kind = MP_TOKEN_STRING; int n_char = 0; if (is_char(lex, 'u')) { @@ -608,6 +633,7 @@ void mp_lexer_to_next(mp_lexer_t *lex) { kind = MP_TOKEN_BYTES; n_char = 2; } +#if MICROPY_COMP_FSTRING_LITERAL if (is_char_following(lex, 'f')) { lex->tok_kind = MP_TOKEN_FSTRING_RAW; break; @@ -619,8 +645,10 @@ void mp_lexer_to_next(mp_lexer_t *lex) { } n_char = 1; is_fstring = true; +#endif } +#if MICROPY_COMP_FSTRING_LITERAL if (is_fstring) { saw_fstring = true; } else { @@ -631,6 +659,7 @@ void mp_lexer_to_next(mp_lexer_t *lex) { // Can't concatenate f-string with normal string break; } +#endif // Set or check token kind if (lex->tok_kind == MP_TOKEN_END) { @@ -808,7 +837,9 @@ mp_lexer_t *mp_lexer_new(qstr src_name, mp_reader_t reader) { lex->num_indent_level = 1; lex->indent_level = m_new(uint16_t, lex->alloc_indent_level); vstr_init(&lex->vstr, 32); +#if MICROPY_COMP_FSTRING_LITERAL vstr_init(&lex->vstr_postfix, 0); +#endif // store sentinel for first indentation level lex->indent_level[0] = 0; diff --git a/py/lexer.h b/py/lexer.h index 7fe271e841..a3eaa2a7e6 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -44,12 +44,14 @@ typedef enum _mp_token_kind_t { MP_TOKEN_INVALID, MP_TOKEN_DEDENT_MISMATCH, MP_TOKEN_LONELY_STRING_OPEN, +#if MICROPY_COMP_FSTRING_LITERAL MP_TOKEN_FSTRING_BACKSLASH, MP_TOKEN_FSTRING_COMMENT, MP_TOKEN_FSTRING_UNCLOSED, MP_TOKEN_FSTRING_UNOPENED, MP_TOKEN_FSTRING_EMPTY_EXP, MP_TOKEN_FSTRING_RAW, +#endif MP_TOKEN_NEWLINE, MP_TOKEN_INDENT, @@ -156,7 +158,9 @@ typedef struct _mp_lexer_t { mp_reader_t reader; // stream source unichar chr0, chr1, chr2; // current cached characters from source +#if MICROPY_COMP_FSTRING_LITERAL unichar chr3, chr4, chr5; // current cached characters from alt source +#endif size_t line; // current source line size_t column; // current source column @@ -172,9 +176,11 @@ typedef struct _mp_lexer_t { size_t tok_column; // token source column mp_token_kind_t tok_kind; // token kind vstr_t vstr; // token data +#if MICROPY_COMP_FSTRING_LITERAL vstr_t vstr_postfix; // postfix to apply to string bool vstr_postfix_processing; uint16_t vstr_postfix_idx; +#endif } mp_lexer_t; mp_lexer_t *mp_lexer_new(qstr src_name, mp_reader_t reader); diff --git a/py/mpconfig.h b/py/mpconfig.h index 8f78ade5cc..01572f546e 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -377,6 +377,11 @@ #define MICROPY_COMP_RETURN_IF_EXPR (0) #endif +// Whether to include parsing of f-string literals +#ifndef MICROPY_COMP_FSTRING_LITERAL +#define MICROPY_COMP_FSTRING_LITERAL (1) +#endif + /*****************************************************************************/ /* Internal debugging stuff */ diff --git a/py/parse.c b/py/parse.c index f86ee25fe0..b8cfda2cb5 100644 --- a/py/parse.c +++ b/py/parse.c @@ -1178,6 +1178,7 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, translate("unindent does not match any outer indentation level")); break; +#if MICROPY_COMP_FSTRING_LITERAL #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_DETAILED case MP_TOKEN_FSTRING_BACKSLASH: exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, @@ -1213,6 +1214,7 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, translate("malformed f-string")); break; +#endif #endif default: exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, From eab9b670d8a8f57c94ec1375cd5cea64fe7b1df8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 14:48:52 -0500 Subject: [PATCH 040/919] ulab: Use https://github.com/v923z/micropython-ulab/ The only delta we were carrying was in the README. --- .gitmodules | 2 +- extmod/ulab | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9130593f2c..c25239882e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -116,7 +116,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git [submodule "extmod/ulab"] path = extmod/ulab - url = https://github.com/adafruit/circuitpython-ulab + url = https://github.com/v923z/micropython-ulab/ [submodule "frozen/Adafruit_CircuitPython_ESP32SPI"] path = frozen/Adafruit_CircuitPython_ESP32SPI url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI diff --git a/extmod/ulab b/extmod/ulab index 42d831e1e6..66b89de8c7 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 42d831e1e65b1c75ed90de11b87a1c4a0ebe6152 +Subproject commit 66b89de8c714790de8647dc55f59430002044171 From e128d770f15112bf6e0c91c1b38674313a60e433 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 15:52:55 -0500 Subject: [PATCH 041/919] cdx56: prepare to enable ulab This involves fixing support for SRC_MOD and enabling INTERNAL_LIBM including adding support for SRC_LIBM. --- ports/cxd56/Makefile | 4 ++++ ports/cxd56/mpconfigport.mk | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index a0782c4e95..e2fce976d7 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -176,6 +176,10 @@ OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +ifeq ($(INTERNAL_LIBM),1) +OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) +endif +OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) # List of sources for qstr extraction SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index a418ae8e9d..ad3d0e72df 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -18,3 +18,5 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 + +INTERNAL_LIBM = 1 From 66aa0dec601afb945a90096d78ae517033850427 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 15:53:31 -0500 Subject: [PATCH 042/919] stm32: enable ulab This is needed because stm32 defines CIRCUITPY_MINIMAL_BUILD "for early port". --- ports/stm32f4/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32f4/mpconfigport.mk b/ports/stm32f4/mpconfigport.mk index f214282cb8..493f32c636 100644 --- a/ports/stm32f4/mpconfigport.mk +++ b/ports/stm32f4/mpconfigport.mk @@ -71,5 +71,7 @@ endif CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 +MICROPY_PY_ULAB = 1 + #ifeq ($(MCU_SUB_VARIANT), stm32f412zx) #endif From 491a31a7312d21cd7ead17d158971572f5372335 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 15:54:21 -0500 Subject: [PATCH 043/919] circuitpy_mpconfig.mk: Enable ULAB for "full builds" This enables it on the imxrt and cds56 ports where it was disabled before --- py/circuitpy_mpconfig.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index d6e033daf3..21b1abd9bb 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -339,6 +339,11 @@ CIRCUITPY_SERIAL_UART = 0 endif CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) +# ulab numerics library +ifndef MICROPY_PY_ULAB +MICROPY_PY_ULAB = $(CIRCUITPY_FULL_BUILD) +endif + # Enabled micropython.native decorator (experimental) ifndef CIRCUITPY_ENABLE_MPY_NATIVE CIRCUITPY_ENABLE_MPY_NATIVE = 0 From ef195d6e1b769f8555d1362d27f98ef9aa84169d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 09:19:02 -0500 Subject: [PATCH 044/919] Update tests * string_pep498_fstring.py: Not compatible with python3.5 * cmd_parsetree.py: enumerated constants changed --- tests/basics/string_pep498_fstring.py.exp | 0 tests/cmdline/cmd_parsetree.py.exp | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 tests/basics/string_pep498_fstring.py.exp diff --git a/tests/basics/string_pep498_fstring.py.exp b/tests/basics/string_pep498_fstring.py.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cmdline/cmd_parsetree.py.exp b/tests/cmdline/cmd_parsetree.py.exp index 12a1bfbe90..c06ce4e31f 100644 --- a/tests/cmdline/cmd_parsetree.py.exp +++ b/tests/cmdline/cmd_parsetree.py.exp @@ -1,6 +1,6 @@ ---------------- [ 4] rule(1) (n=9) - tok(4) + tok(10) [ 4] rule(22) (n=4) id(i) [ 4] rule(44) (n=1) @@ -9,7 +9,7 @@ NULL [ 6] rule(5) (n=2) id(a) - tok(14) + tok(20) [ 7] rule(5) (n=2) id(b) str(str) From 03a2b2faf15d0d2bda5eb092672676866a609fdd Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Mar 2020 23:00:21 -0500 Subject: [PATCH 045/919] ulab: don't enable on m0 boards --- ports/atmel-samd/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 7565e41a4a..6b6b335d38 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -40,6 +40,8 @@ endif # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 +MICROPY_PY_ULAB = 0 + endif # samd21 # Put samd51-only choices here. From 50b451ae0c9f6c35961d18c4c0b7ec85153228b5 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Tue, 10 Mar 2020 22:40:55 -0400 Subject: [PATCH 046/919] add TG-Watch02A board def --- ports/nrf/boards/TG-Watch02A/mpconfigboard.h | 20 +++------ ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 44 +++++++++---------- ports/nrf/boards/TG-Watch02A/pins.c | 6 +-- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h index 788454fc3a..d499f58e53 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h @@ -27,21 +27,16 @@ #include "nrfx/hal/nrf_gpio.h" -<<<<<<< HEAD -#define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A" + +#define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A Rev:00" #define MICROPY_HW_MCU_NAME "nRF52840" -======= -#define MICROPY_HW_BOARD_NAME "TG-Watch02A-rev00" -#define MICROPY_HW_MCU_NAME "nRF52840" +//#define FLASH_SIZE (0x100000) +//#define FLASH_PAGE_SIZE (4096) -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - ->>>>>>> 7198056bc31ebae22337af119c07c7dca03e85d5 #define MICROPY_HW_NEOPIXEL (&pin_P0_16) -#define MICROPY_HW_LED_STATUS (&pin_P1_15) +#define MICROPY_HW_LED_STATUS (&pin_P0_07) #if QSPI_FLASH_FILESYSTEM #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17) @@ -59,15 +54,14 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -<<<<<<< HEAD -======= +/* #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 #define CIRCUITPY_INTERNAL_NVM_SIZE (4096) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) +*/ ->>>>>>> 7198056bc31ebae22337af119c07c7dca03e85d5 #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index 62010930a9..2629643071 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x802A -<<<<<<< HEAD + USB_PRODUCT = "TG-Watch02A" USB_MANUFACTURER = "TG-Tech" @@ -9,29 +9,29 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" -======= -USB_PRODUCT = "TG-Watch02" -USB_MANUFACTURER = "TG-Tech -MCU_SERIES = m4 -MCU_VARIANT = nrf52 -MCU_SUB_VARIANT = nrf52840 -MCU_CHIP = nrf52840 -SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 -BOOT_SETTING_ADDR = 0xFF000 +#USB_PRODUCT = "TG-Watch02" +#USB_MANUFACTURER = "TG-Tech -ifeq ($(SD),) - LD_FILE = boards/nrf52840_1M_256k.ld -else - LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld - CIRCUITPY_BLEIO = 1 -endif +#MCU_SERIES = m4 +#MCU_VARIANT = nrf52 +#MCU_SUB_VARIANT = nrf52840 +#MCU_CHIP = nrf52840 +#SD ?= s140 +#SOFTDEV_VERSION ?= 6.1.0 -NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 +#BOOT_SETTING_ADDR = 0xFF000 -QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = "GD25Q16C" ->>>>>>> 7198056bc31ebae22337af119c07c7dca03e85d5 +#ifeq ($(SD),) +# LD_FILE = boards/nrf52840_1M_256k.ld +#else +# LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld +# CIRCUITPY_BLEIO = 1 +#endif + +#NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 + +#QSPI_FLASH_FILESYSTEM = 1 +#EXTERNAL_FLASH_DEVICE_COUNT = 1 +#EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/TG-Watch02A/pins.c b/ports/nrf/boards/TG-Watch02A/pins.c index b93df80ae9..a856b18eee 100644 --- a/ports/nrf/boards/TG-Watch02A/pins.c +++ b/ports/nrf/boards/TG-Watch02A/pins.c @@ -48,8 +48,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, -<<<<<<< HEAD - /*TG-Watch02A specific pins*/ //tft / display pins @@ -74,7 +72,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_ACCEL_INT1), MP_ROM_PTR(&pin_P1_11) }, { MP_ROM_QSTR(MP_QSTR_ACCEL_INT2), MP_ROM_PTR(&pin_P1_10) }, - + { MP_ROM_QSTR(MP_QSTR_HAPTIC_INT), MP_ROM_PTR(&pin_P1_07) }, { MP_ROM_QSTR(MP_QSTR_HAPTIC_ENABLE), MP_ROM_PTR(&pin_P1_06) }, @@ -82,8 +80,6 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SMC_RESET), MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_BUTTON0), MP_ROM_PTR(&pin_P1_08) }, { MP_ROM_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_P1_09) }, -======= ->>>>>>> 7198056bc31ebae22337af119c07c7dca03e85d5 }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b967a2071fb81bf5dd737e47cf6d41e4d8828c26 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Tue, 10 Mar 2020 23:07:25 -0400 Subject: [PATCH 047/919] changed TG-Watch02A HW_BOARD_NAME --- ports/nrf/boards/TG-Watch02A/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h index d499f58e53..7811bc893a 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h @@ -28,13 +28,13 @@ #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A Rev:00" +#define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A" #define MICROPY_HW_MCU_NAME "nRF52840" //#define FLASH_SIZE (0x100000) //#define FLASH_PAGE_SIZE (4096) -#define MICROPY_HW_NEOPIXEL (&pin_P0_16) +//#define MICROPY_HW_NEOPIXEL (&pin_P0_16) #define MICROPY_HW_LED_STATUS (&pin_P0_07) From 2b161d37dffa4662ca5193c2f45c75f93a1cf896 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 10 Mar 2020 17:16:31 -0400 Subject: [PATCH 048/919] stm32: add PulseIn module --- ports/stm32f4/common-hal/pulseio/PulseIn.c | 263 ++++++++++++++++++++- ports/stm32f4/common-hal/pulseio/PulseIn.h | 3 +- ports/stm32f4/supervisor/port.c | 2 + 3 files changed, 260 insertions(+), 8 deletions(-) diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.c b/ports/stm32f4/common-hal/pulseio/PulseIn.c index 068936bdd0..d361a1e9a7 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.c +++ b/ports/stm32f4/common-hal/pulseio/PulseIn.c @@ -34,46 +34,295 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "tick.h" +#include "stm32f4xx_hal.h" + +#define STM32_GPIO_PORT_SIZE 16 + +static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE]; + +static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num); + +static void pulsein_handler(uint8_t num) { + // Grab the current time first. + uint32_t current_us; + uint64_t current_ms; + current_tick(¤t_ms, ¤t_us); + + // current_tick gives us the remaining us until the next tick but we want the number since the last ms. + current_us = 1000 - current_us; + + pulseio_pulsein_obj_t* self = _objs[num]; + if ( !self ) return; + + if (self->first_edge) { + // first pulse is opposite state from idle + bool state = HAL_GPIO_ReadPin(pin_port(self->pin->port), pin_mask(self->pin->number)); + if ( self->idle_state != state ) { + self->first_edge = false; + } + } else { + uint32_t ms_diff = current_ms - self->last_ms; + uint16_t us_diff = current_us - self->last_us; + uint32_t total_diff = us_diff; + + if (self->last_us > current_us) { + total_diff = 1000 + current_us - self->last_us; + if (ms_diff > 1) { + total_diff += (ms_diff - 1) * 1000; + } + } else { + total_diff += ms_diff * 1000; + } + uint16_t duration = 0xffff; + if (total_diff < duration) { + duration = total_diff; + } + + uint16_t i = (self->start + self->len) % self->maxlen; + self->buffer[i] = duration; + if (self->len < self->maxlen) { + self->len++; + } else { + self->start++; + } + } + + self->last_ms = current_ms; + self->last_us = current_us; +} + void pulsein_reset(void) { + // Disable all active interrupts and clear array + for (uint i = 0; i < STM32_GPIO_PORT_SIZE; i++) { + if (_objs[i] != NULL) { + HAL_NVIC_DisableIRQ(_objs[i]->irq); + } + } + memset(_objs, 0, sizeof(_objs)); } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { - mp_raise_NotImplementedError(translate("PulseIn not yet supported")); + // STM32 has one shared EXTI for each pin number, 0-15 + uint8_t p_num = pin->number; + if(_objs[p_num]) { + mp_raise_ValueError(translate("Pin number already reserved by EXTI")); + } + _objs[p_num] = self; + + // Allocate pulse buffer + self->buffer = (uint16_t *) m_malloc(maxlen * sizeof(uint16_t), false); + if (self->buffer == NULL) { + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), + maxlen * sizeof(uint16_t)); + } + + // Set internal variables + self->pin = pin; + self->maxlen = maxlen; + self->idle_state = idle_state; + self->start = 0; + self->len = 0; + self->first_edge = true; + self->paused = false; + self->last_us = 0; + self->last_ms = 0; + + // EXTI pins can also be read as an input + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); + + // Interrupt starts immediately + assign_EXTI_Interrupt(self, pin->number); + HAL_NVIC_EnableIRQ(self->irq); + claim_pin(pin); } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { - return true; + return (self->pin == NULL); } void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { + if (common_hal_pulseio_pulsein_deinited(self)) { + return; + } + HAL_NVIC_DisableIRQ(self->irq); + _objs[self->pin->number] = NULL; + reset_pin_number(self->pin->port, self->pin->number); + self->pin = NULL; } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { + HAL_NVIC_DisableIRQ(self->irq); + self->paused = true; } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { + // Make sure we're paused. + if ( !self->paused ) { + common_hal_pulseio_pulsein_pause(self); + } + + // Send the trigger pulse. + if (trigger_duration > 0) { + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(self->pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); + + HAL_GPIO_WritePin(pin_port(self->pin->port), pin_mask(self->pin->number), !self->idle_state); + common_hal_mcu_delay_us((uint32_t)trigger_duration); + HAL_GPIO_WritePin(pin_port(self->pin->port), pin_mask(self->pin->number), self->idle_state); + + GPIO_InitStruct.Pin = pin_mask(self->pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); + } + + self->first_edge = true; + self->paused = false; + self->last_ms = 0; + self->last_us = 0; + + HAL_NVIC_EnableIRQ(self->irq); } void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { + HAL_NVIC_DisableIRQ(self->irq); + self->start = 0; + self->len = 0; + HAL_NVIC_EnableIRQ(self->irq); } uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { - return 0; + HAL_NVIC_DisableIRQ(self->irq); + if (index < 0) { + index += self->len; + } + if (index < 0 || index >= self->len) { + HAL_NVIC_EnableIRQ(self->irq); + mp_raise_IndexError(translate("index out of range")); + } + uint16_t value = self->buffer[(self->start + index) % self->maxlen]; + HAL_NVIC_EnableIRQ(self->irq); + return value; } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { - return 0; + if (self->len == 0) { + mp_raise_IndexError(translate("pop from an empty PulseIn")); + } + HAL_NVIC_DisableIRQ(self->irq); + uint16_t value = self->buffer[self->start]; + self->start = (self->start + 1) % self->maxlen; + self->len--; + HAL_NVIC_EnableIRQ(self->irq); + + return value; } uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { - return 0; + return self->maxlen; } bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) { - return 0; + return self->paused; } uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) { - return 0; + return self->len; +} + +static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num) { + if (num == 0) { + self->irq = EXTI0_IRQn; + } else if (num == 1) { + self->irq = EXTI1_IRQn; + } else if (num == 2) { + self->irq = EXTI2_IRQn; + } else if (num == 3) { + self->irq = EXTI3_IRQn; + } else if (num == 4) { + self->irq = EXTI4_IRQn; + } else if (num >= 5 && num <= 9 ) { + self->irq = EXTI9_5_IRQn; + } else if (num >= 10 && num <= 15) { + self->irq = EXTI15_10_IRQn; + } +} + +void EXTI0_IRQHandler(void) +{ + EXTI->PR = 1 << 0; + pulsein_handler(0); +} +void EXTI1_IRQHandler(void) +{ + EXTI->PR = 1 << 1; + pulsein_handler(1); +} +void EXTI2_IRQHandler(void) +{ + EXTI->PR = 1 << 2; + pulsein_handler(2); +} +void EXTI3_IRQHandler(void) +{ + EXTI->PR = 1 << 3; + pulsein_handler(3); +} +void EXTI4_IRQHandler(void) +{ + EXTI->PR = 1 << 4; + pulsein_handler(4); +} +void EXTI9_5_IRQHandler(void) +{ + uint32_t pending = EXTI->PR; + if(pending & (1 << 5)) { + EXTI->PR = 1 << 5; + pulsein_handler(5); + } else if (pending & (1 << 6)) { + EXTI->PR = 1 << 6; + pulsein_handler(6); + } else if (pending & (1 << 7)) { + EXTI->PR = 1 << 7; + pulsein_handler(7); + } else if (pending & (1 << 8)) { + EXTI->PR = 1 << 8; + pulsein_handler(8); + } else if (pending & (1 << 9)) { + EXTI->PR = 1 << 9; + pulsein_handler(9); + } +} + +void EXTI15_10_IRQHandler(void) +{ + uint32_t pending = EXTI->PR; + if(pending & (1 << 10)) { + EXTI->PR = 1 << 10; + pulsein_handler(10); + } else if (pending & (1 << 11)) { + EXTI->PR = 1 << 11; + pulsein_handler(11); + } else if (pending & (1 << 12)) { + EXTI->PR = 1 << 12; + pulsein_handler(12); + } else if (pending & (1 << 13)) { + EXTI->PR = 1 << 13; + pulsein_handler(13); + } else if (pending & (1 << 14)) { + EXTI->PR = 1 << 14; + pulsein_handler(14); + } else if (pending & (1 << 15)) { + EXTI->PR = 1 << 15; + pulsein_handler(15); + } } diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.h b/ports/stm32f4/common-hal/pulseio/PulseIn.h index 2538b07ab5..5456613c6a 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.h +++ b/ports/stm32f4/common-hal/pulseio/PulseIn.h @@ -34,7 +34,8 @@ typedef struct { mp_obj_base_t base; - uint8_t pin; + const mcu_pin_obj_t* pin; + IRQn_Type irq; bool idle_state; bool paused; volatile bool first_edge; diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index ecb4d3d15c..948e9f2e4a 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -36,6 +36,7 @@ #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 "stm32f4/clocks.h" #include "stm32f4/gpio.h" @@ -62,6 +63,7 @@ void reset_port(void) { uart_reset(); pwmout_reset(); pulseout_reset(); + pulsein_reset(); } void reset_to_bootloader(void) { From 2a082baa63ea401fea40c3d643efb9c037c208c3 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 16:39:57 -0400 Subject: [PATCH 049/919] Add up to date translations --- locale/ID.po | 16 ++++++++++------ locale/circuitpython.pot | 16 ++++++++++------ locale/de_DE.po | 16 ++++++++++------ locale/en_US.po | 16 ++++++++++------ locale/en_x_pirate.po | 16 ++++++++++------ locale/es.po | 16 ++++++++++------ locale/fil.po | 16 ++++++++++------ locale/fr.po | 16 ++++++++++------ locale/it_IT.po | 16 ++++++++++------ locale/ko.po | 16 ++++++++++------ locale/pl.po | 16 ++++++++++------ locale/pt_BR.po | 16 ++++++++++------ locale/zh_Latn_pinyin.po | 19 +++++++++++++------ 13 files changed, 133 insertions(+), 78 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index dff59c1ce5..03111a7a8f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -709,6 +709,7 @@ msgstr "Gagal untuk mengalokasikan buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" @@ -1165,6 +1166,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" @@ -1187,10 +1192,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2231,7 +2232,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2718,6 +2720,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" @@ -2949,6 +2952,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e9afe41c2f..7b56d28dc2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -698,6 +698,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -1153,6 +1154,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1173,10 +1178,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2207,7 +2208,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2693,6 +2695,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -2923,6 +2926,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index b1ddf050ea..78cecce642 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -702,6 +702,7 @@ msgstr "Konnte keinen RX Buffer allozieren" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" @@ -1168,6 +1169,10 @@ msgstr "Zugang verweigert" msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" @@ -1190,10 +1195,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2237,7 +2238,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2731,6 +2733,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" @@ -2964,6 +2967,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" diff --git a/locale/en_US.po b/locale/en_US.po index b41734976b..f452fdaad3 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -698,6 +698,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -1153,6 +1154,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1173,10 +1178,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2207,7 +2208,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2693,6 +2695,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -2923,6 +2926,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index b079dcd092..709571f31b 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -702,6 +702,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -1157,6 +1158,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "Belay that! Th' Pin be not ADC capable" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1177,10 +1182,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2211,7 +2212,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2697,6 +2699,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -2927,6 +2930,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/es.po b/locale/es.po index 772c38f695..9c7f3e3cb4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -704,6 +704,7 @@ msgstr "Ha fallado la asignación del buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" @@ -1167,6 +1168,10 @@ msgstr "Permiso denegado" msgid "Pin does not have ADC capabilities" msgstr "Pin no tiene capacidad ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1189,10 +1194,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2238,7 +2239,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2731,6 +2733,7 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" @@ -2964,6 +2967,7 @@ msgstr "tuple/lista se require en RHS" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" diff --git a/locale/fil.po b/locale/fil.po index 450ed5f0e2..ed31a176b7 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -712,6 +712,7 @@ msgstr "Nabigong ilaan ang RX buffer" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" @@ -1173,6 +1174,10 @@ msgstr "Walang pahintulot" msgid "Pin does not have ADC capabilities" msgstr "Ang pin ay walang kakayahan sa ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" @@ -1195,10 +1200,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2253,7 +2254,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2745,6 +2747,7 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" @@ -2979,6 +2982,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" diff --git a/locale/fr.po b/locale/fr.po index 708176c6bc..9345787c55 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -715,6 +715,7 @@ msgstr "Echec de l'allocation du tampon RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" @@ -1187,6 +1188,10 @@ msgstr "Permission refusée" msgid "Pin does not have ADC capabilities" msgstr "La broche ne peut être utilisée pour l'ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1208,10 +1213,6 @@ 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/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2277,7 +2278,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2777,6 +2779,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "'pop' d'une entrée PulseIn vide" @@ -3012,6 +3015,7 @@ msgstr "tuple ou liste requis en partie droite" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx et rx ne peuvent être 'None' tous les deux" diff --git a/locale/it_IT.po b/locale/it_IT.po index f4eeea46fd..68cd7dd41d 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -712,6 +712,7 @@ msgstr "Impossibile allocare buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" @@ -1182,6 +1183,10 @@ msgstr "Permesso negato" msgid "Pin does not have ADC capabilities" msgstr "Il pin non ha capacità di ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1204,10 +1209,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2254,7 +2255,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2752,6 +2754,7 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" @@ -2986,6 +2989,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" diff --git a/locale/ko.po b/locale/ko.po index 96bb26d091..656adf2cb2 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -702,6 +702,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -1157,6 +1158,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1177,10 +1182,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2212,7 +2213,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2698,6 +2700,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -2928,6 +2931,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 581dac8d0d..6eb37254b5 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -701,6 +701,7 @@ msgstr "Nie udała się alokacja bufora RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udała się alokacja %d bajtów na bufor RX" @@ -1158,6 +1159,10 @@ msgstr "Odmowa dostępu" msgid "Pin does not have ADC capabilities" msgstr "Nóżka nie obsługuje ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" @@ -1178,10 +1183,6 @@ 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/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2216,7 +2217,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2703,6 +2705,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" @@ -2934,6 +2937,7 @@ msgstr "wymagana krotka/lista po prawej stronie" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3dce592e3b..a0f2024ebc 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -707,6 +707,7 @@ msgstr "Falha ao alocar buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" @@ -1168,6 +1169,10 @@ msgstr "Permissão negada" msgid "Pin does not have ADC capabilities" msgstr "O pino não tem recursos de ADC" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1189,10 +1194,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2229,7 +2230,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2715,6 +2717,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -2947,6 +2950,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index cc23d7fc80..e93bcb1d26 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-09 08:19-0500\n" +"POT-Creation-Date: 2020-03-11 17:52-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -709,6 +709,7 @@ msgstr "Fēnpèi RX huǎnchōng shībài" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" @@ -1172,6 +1173,10 @@ msgstr "Quánxiàn bèi jùjué" msgid "Pin does not have ADC capabilities" msgstr "Pin méiyǒu ADC nénglì" +#: ports/stm32f4/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" @@ -1192,10 +1197,6 @@ 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/stm32f4/common-hal/pulseio/PulseIn.c -msgid "PulseIn not yet supported" -msgstr "Shàng bù zhīchí PulseIn" - #: ports/stm32f4/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" @@ -2244,7 +2245,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2732,6 +2734,7 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "cóng kōng de PulseIn dànchū dànchū" @@ -2964,6 +2967,7 @@ msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" @@ -3325,6 +3329,9 @@ msgstr "líng bù" #~ msgid "Pixel beyond bounds of buffer" #~ msgstr "Xiàngsù chāochū huǎnchōng qū biānjiè" +#~ msgid "PulseIn not yet supported" +#~ msgstr "Shàng bù zhīchí PulseIn" + #~ msgid "PulseOut not yet supported" #~ msgstr "Shàng bù zhīchí PulseOut" From 53b1544f41b5b296a407426b08c3f935944b4762 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 18:13:06 -0400 Subject: [PATCH 050/919] create copy --- ports/stm/.gitignore | 9 + ports/stm/Makefile | 284 +++++++ ports/stm/README.md | 3 + ports/stm/background.c | 60 ++ ports/stm/background.h | 35 + ports/stm/boards/STM32F401xd_fs.ld | 107 +++ ports/stm/boards/STM32F401xe_boot.ld | 106 +++ ports/stm/boards/STM32F401xe_fs.ld | 107 +++ ports/stm/boards/STM32F405_boot.ld | 107 +++ ports/stm/boards/STM32F405_default.ld | 107 +++ ports/stm/boards/STM32F405_fs.ld | 108 +++ ports/stm/boards/STM32F407_fs.ld | 108 +++ ports/stm/boards/STM32F411VETx_FLASH.ld | 109 +++ ports/stm/boards/STM32F412ZGTx_FLASH.ld | 105 +++ ports/stm/boards/board.h | 45 + ports/stm/boards/espruino_pico/README.md | 15 + ports/stm/boards/espruino_pico/board.c | 39 + .../stm/boards/espruino_pico/mpconfigboard.h | 39 + .../stm/boards/espruino_pico/mpconfigboard.mk | 16 + ports/stm/boards/espruino_pico/pins.c | 33 + .../boards/espruino_pico/stm32f4xx_hal_conf.h | 440 ++++++++++ ports/stm/boards/espruino_wifi/README.MD | 15 + ports/stm/boards/espruino_wifi/board.c | 38 + .../stm/boards/espruino_wifi/mpconfigboard.h | 36 + .../stm/boards/espruino_wifi/mpconfigboard.mk | 16 + ports/stm/boards/espruino_wifi/pins.c | 39 + .../boards/espruino_wifi/stm32f4xx_hal_conf.h | 439 ++++++++++ .../boards/feather_stm32f405_express/board.c | 39 + .../feather_stm32f405_express/mpconfigboard.h | 58 ++ .../mpconfigboard.mk | 22 + .../boards/feather_stm32f405_express/pins.c | 35 + .../stm32f4xx_hal_conf.h | 440 ++++++++++ ports/stm/boards/meowbit_v121/board.c | 121 +++ ports/stm/boards/meowbit_v121/mpconfigboard.h | 47 ++ .../stm/boards/meowbit_v121/mpconfigboard.mk | 24 + ports/stm/boards/meowbit_v121/pins.c | 68 ++ .../boards/meowbit_v121/stm32f4xx_hal_conf.h | 440 ++++++++++ ports/stm/boards/openocd_stm32f4.cfg | 44 + ports/stm/boards/pyb_nano_v2/board.c | 39 + ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 47 ++ ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 18 + ports/stm/boards/pyb_nano_v2/pins.c | 59 ++ .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 440 ++++++++++ ports/stm/boards/pyboard_v11/board.c | 38 + ports/stm/boards/pyboard_v11/mpconfigboard.h | 38 + ports/stm/boards/pyboard_v11/mpconfigboard.mk | 16 + ports/stm/boards/pyboard_v11/pins.c | 52 ++ .../boards/pyboard_v11/stm32f4xx_hal_conf.h | 440 ++++++++++ ports/stm/boards/startup_stm32f401xe.s | 448 ++++++++++ ports/stm/boards/startup_stm32f405xx.s | 516 ++++++++++++ ports/stm/boards/startup_stm32f407xx.s | 516 ++++++++++++ ports/stm/boards/startup_stm32f411xe.s | 452 ++++++++++ ports/stm/boards/startup_stm32f412zx.s | 524 ++++++++++++ .../stm/boards/stm32f411ce_blackpill/board.c | 39 + .../stm32f411ce_blackpill/mpconfigboard.h | 48 ++ .../stm32f411ce_blackpill/mpconfigboard.mk | 21 + ports/stm/boards/stm32f411ce_blackpill/pins.c | 39 + .../stm32f4xx_hal_conf.h | 440 ++++++++++ .../stm/boards/stm32f411ve_discovery/board.c | 38 + .../stm32f411ve_discovery/mpconfigboard.h | 35 + .../stm32f411ve_discovery/mpconfigboard.mk | 16 + ports/stm/boards/stm32f411ve_discovery/pins.c | 106 +++ .../stm32f4xx_hal_conf.h | 439 ++++++++++ .../stm/boards/stm32f412zg_discovery/board.c | 38 + .../stm32f412zg_discovery/mpconfigboard.h | 38 + .../stm32f412zg_discovery/mpconfigboard.mk | 22 + ports/stm/boards/stm32f412zg_discovery/pins.c | 94 +++ .../stm32f4xx_hal_conf.h | 438 ++++++++++ ports/stm/boards/stm32f4_discovery/board.c | 38 + .../boards/stm32f4_discovery/mpconfigboard.h | 35 + .../boards/stm32f4_discovery/mpconfigboard.mk | 18 + ports/stm/boards/stm32f4_discovery/pins.c | 107 +++ .../stm32f4_discovery/stm32f4xx_hal_conf.h | 439 ++++++++++ ports/stm/common-hal/analogio/AnalogIn.c | 129 +++ ports/stm/common-hal/analogio/AnalogIn.h | 48 ++ ports/stm/common-hal/analogio/AnalogOut.c | 124 +++ ports/stm/common-hal/analogio/AnalogOut.h | 49 ++ ports/stm/common-hal/analogio/__init__.c | 1 + ports/stm/common-hal/board/__init__.c | 25 + ports/stm/common-hal/busio/I2C.c | 250 ++++++ ports/stm/common-hal/busio/I2C.h | 48 ++ ports/stm/common-hal/busio/OneWire.h | 33 + ports/stm/common-hal/busio/SPI.c | 470 +++++++++++ ports/stm/common-hal/busio/SPI.h | 55 ++ ports/stm/common-hal/busio/UART.c | 626 ++++++++++++++ ports/stm/common-hal/busio/UART.h | 60 ++ ports/stm/common-hal/busio/__init__.c | 1 + ports/stm/common-hal/digitalio/DigitalInOut.c | 160 ++++ ports/stm/common-hal/digitalio/DigitalInOut.h | 38 + ports/stm/common-hal/digitalio/__init__.c | 1 + ports/stm/common-hal/displayio/ParallelBus.c | 68 ++ ports/stm/common-hal/displayio/ParallelBus.h | 36 + ports/stm/common-hal/microcontroller/Pin.c | 134 +++ ports/stm/common-hal/microcontroller/Pin.h | 52 ++ .../common-hal/microcontroller/Processor.c | 127 +++ .../common-hal/microcontroller/Processor.h | 39 + .../stm/common-hal/microcontroller/__init__.c | 244 ++++++ .../stm/common-hal/neopixel_write/__init__.c | 102 +++ ports/stm/common-hal/os/__init__.c | 95 +++ ports/stm/common-hal/pulseio/PWMOut.c | 448 ++++++++++ ports/stm/common-hal/pulseio/PWMOut.h | 51 ++ ports/stm/common-hal/pulseio/PulseIn.c | 79 ++ ports/stm/common-hal/pulseio/PulseIn.h | 53 ++ ports/stm/common-hal/pulseio/PulseOut.c | 214 +++++ ports/stm/common-hal/pulseio/PulseOut.h | 42 + ports/stm/common-hal/pulseio/__init__.c | 1 + ports/stm/common-hal/supervisor/Runtime.c | 38 + ports/stm/common-hal/supervisor/Runtime.h | 37 + ports/stm/common-hal/supervisor/__init__.c | 40 + ports/stm/common-hal/time/__init__.c | 45 + ports/stm/fatfs_port.c | 33 + ports/stm/mpconfigport.h | 59 ++ ports/stm/mpconfigport.mk | 77 ++ ports/stm/mphalport.c | 63 ++ ports/stm/mphalport.h | 51 ++ ports/stm/peripherals/stm32f4/clocks.h | 27 + ports/stm/peripherals/stm32f4/gpio.h | 28 + ports/stm/peripherals/stm32f4/periph.h | 180 ++++ ports/stm/peripherals/stm32f4/pins.h | 96 +++ .../peripherals/stm32f4/stm32f401xe/clocks.c | 62 ++ .../peripherals/stm32f4/stm32f401xe/gpio.c | 51 ++ .../peripherals/stm32f4/stm32f401xe/periph.c | 173 ++++ .../peripherals/stm32f4/stm32f401xe/periph.h | 57 ++ .../peripherals/stm32f4/stm32f401xe/pins.c | 123 +++ .../peripherals/stm32f4/stm32f401xe/pins.h | 121 +++ .../peripherals/stm32f4/stm32f405xx/clocks.c | 64 ++ .../peripherals/stm32f4/stm32f405xx/gpio.c | 60 ++ .../peripherals/stm32f4/stm32f405xx/periph.c | 194 +++++ .../peripherals/stm32f4/stm32f405xx/periph.h | 57 ++ .../peripherals/stm32f4/stm32f405xx/pins.c | 161 ++++ .../peripherals/stm32f4/stm32f405xx/pins.h | 158 ++++ .../peripherals/stm32f4/stm32f407xx/clocks.c | 64 ++ .../peripherals/stm32f4/stm32f407xx/gpio.c | 60 ++ .../peripherals/stm32f4/stm32f407xx/periph.c | 194 +++++ .../peripherals/stm32f4/stm32f407xx/periph.h | 57 ++ .../peripherals/stm32f4/stm32f407xx/pins.c | 161 ++++ .../peripherals/stm32f4/stm32f407xx/pins.h | 158 ++++ .../peripherals/stm32f4/stm32f411xe/clocks.c | 62 ++ .../peripherals/stm32f4/stm32f411xe/gpio.c | 59 ++ .../peripherals/stm32f4/stm32f411xe/periph.c | 194 +++++ .../peripherals/stm32f4/stm32f411xe/periph.h | 57 ++ .../peripherals/stm32f4/stm32f411xe/pins.c | 123 +++ .../peripherals/stm32f4/stm32f411xe/pins.h | 121 +++ .../peripherals/stm32f4/stm32f412zx/clocks.c | 75 ++ .../peripherals/stm32f4/stm32f412zx/gpio.c | 243 ++++++ .../peripherals/stm32f4/stm32f412zx/periph.c | 223 +++++ .../peripherals/stm32f4/stm32f412zx/periph.h | 58 ++ .../peripherals/stm32f4/stm32f412zx/pins.c | 161 ++++ .../peripherals/stm32f4/stm32f412zx/pins.h | 158 ++++ ports/stm/qstrdefsport.h | 1 + ports/stm/supervisor/cpu.s | 27 + ports/stm/supervisor/internal_flash.c | 204 +++++ ports/stm/supervisor/internal_flash.h | 68 ++ .../supervisor/internal_flash_root_pointers.h | 31 + ports/stm/supervisor/port.c | 106 +++ ports/stm/supervisor/qspi_flash.c | 162 ++++ ports/stm/supervisor/serial.c | 75 ++ ports/stm/supervisor/usb.c | 112 +++ ports/stm/system_stm32f4xx.c | 788 ++++++++++++++++++ ports/stm/tick.c | 81 ++ ports/stm/tick.h | 44 + 161 files changed, 19919 insertions(+) create mode 100644 ports/stm/.gitignore create mode 100755 ports/stm/Makefile create mode 100644 ports/stm/README.md create mode 100644 ports/stm/background.c create mode 100644 ports/stm/background.h create mode 100644 ports/stm/boards/STM32F401xd_fs.ld create mode 100644 ports/stm/boards/STM32F401xe_boot.ld create mode 100644 ports/stm/boards/STM32F401xe_fs.ld create mode 100644 ports/stm/boards/STM32F405_boot.ld create mode 100644 ports/stm/boards/STM32F405_default.ld create mode 100644 ports/stm/boards/STM32F405_fs.ld create mode 100644 ports/stm/boards/STM32F407_fs.ld create mode 100644 ports/stm/boards/STM32F411VETx_FLASH.ld create mode 100644 ports/stm/boards/STM32F412ZGTx_FLASH.ld create mode 100644 ports/stm/boards/board.h create mode 100644 ports/stm/boards/espruino_pico/README.md create mode 100644 ports/stm/boards/espruino_pico/board.c create mode 100644 ports/stm/boards/espruino_pico/mpconfigboard.h create mode 100644 ports/stm/boards/espruino_pico/mpconfigboard.mk create mode 100644 ports/stm/boards/espruino_pico/pins.c create mode 100644 ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/espruino_wifi/README.MD create mode 100644 ports/stm/boards/espruino_wifi/board.c create mode 100644 ports/stm/boards/espruino_wifi/mpconfigboard.h create mode 100644 ports/stm/boards/espruino_wifi/mpconfigboard.mk create mode 100644 ports/stm/boards/espruino_wifi/pins.c create mode 100644 ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/feather_stm32f405_express/board.c create mode 100644 ports/stm/boards/feather_stm32f405_express/mpconfigboard.h create mode 100644 ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk create mode 100644 ports/stm/boards/feather_stm32f405_express/pins.c create mode 100644 ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/meowbit_v121/board.c create mode 100644 ports/stm/boards/meowbit_v121/mpconfigboard.h create mode 100644 ports/stm/boards/meowbit_v121/mpconfigboard.mk create mode 100644 ports/stm/boards/meowbit_v121/pins.c create mode 100644 ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/openocd_stm32f4.cfg create mode 100644 ports/stm/boards/pyb_nano_v2/board.c create mode 100644 ports/stm/boards/pyb_nano_v2/mpconfigboard.h create mode 100644 ports/stm/boards/pyb_nano_v2/mpconfigboard.mk create mode 100644 ports/stm/boards/pyb_nano_v2/pins.c create mode 100644 ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/pyboard_v11/board.c create mode 100644 ports/stm/boards/pyboard_v11/mpconfigboard.h create mode 100644 ports/stm/boards/pyboard_v11/mpconfigboard.mk create mode 100644 ports/stm/boards/pyboard_v11/pins.c create mode 100644 ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/startup_stm32f401xe.s create mode 100644 ports/stm/boards/startup_stm32f405xx.s create mode 100644 ports/stm/boards/startup_stm32f407xx.s create mode 100644 ports/stm/boards/startup_stm32f411xe.s create mode 100644 ports/stm/boards/startup_stm32f412zx.s create mode 100644 ports/stm/boards/stm32f411ce_blackpill/board.c create mode 100644 ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h create mode 100644 ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32f411ce_blackpill/pins.c create mode 100644 ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/stm32f411ve_discovery/board.c create mode 100644 ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h create mode 100644 ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32f411ve_discovery/pins.c create mode 100644 ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/stm32f412zg_discovery/board.c create mode 100644 ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h create mode 100644 ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32f412zg_discovery/pins.c create mode 100644 ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h create mode 100644 ports/stm/boards/stm32f4_discovery/board.c create mode 100644 ports/stm/boards/stm32f4_discovery/mpconfigboard.h create mode 100644 ports/stm/boards/stm32f4_discovery/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32f4_discovery/pins.c create mode 100644 ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h create mode 100644 ports/stm/common-hal/analogio/AnalogIn.c create mode 100644 ports/stm/common-hal/analogio/AnalogIn.h create mode 100644 ports/stm/common-hal/analogio/AnalogOut.c create mode 100644 ports/stm/common-hal/analogio/AnalogOut.h create mode 100644 ports/stm/common-hal/analogio/__init__.c create mode 100644 ports/stm/common-hal/board/__init__.c create mode 100644 ports/stm/common-hal/busio/I2C.c create mode 100644 ports/stm/common-hal/busio/I2C.h create mode 100644 ports/stm/common-hal/busio/OneWire.h create mode 100644 ports/stm/common-hal/busio/SPI.c create mode 100644 ports/stm/common-hal/busio/SPI.h create mode 100644 ports/stm/common-hal/busio/UART.c create mode 100644 ports/stm/common-hal/busio/UART.h create mode 100644 ports/stm/common-hal/busio/__init__.c create mode 100644 ports/stm/common-hal/digitalio/DigitalInOut.c create mode 100644 ports/stm/common-hal/digitalio/DigitalInOut.h create mode 100644 ports/stm/common-hal/digitalio/__init__.c create mode 100644 ports/stm/common-hal/displayio/ParallelBus.c create mode 100644 ports/stm/common-hal/displayio/ParallelBus.h create mode 100644 ports/stm/common-hal/microcontroller/Pin.c create mode 100644 ports/stm/common-hal/microcontroller/Pin.h create mode 100644 ports/stm/common-hal/microcontroller/Processor.c create mode 100644 ports/stm/common-hal/microcontroller/Processor.h create mode 100644 ports/stm/common-hal/microcontroller/__init__.c create mode 100644 ports/stm/common-hal/neopixel_write/__init__.c create mode 100644 ports/stm/common-hal/os/__init__.c create mode 100644 ports/stm/common-hal/pulseio/PWMOut.c create mode 100644 ports/stm/common-hal/pulseio/PWMOut.h create mode 100644 ports/stm/common-hal/pulseio/PulseIn.c create mode 100644 ports/stm/common-hal/pulseio/PulseIn.h create mode 100644 ports/stm/common-hal/pulseio/PulseOut.c create mode 100644 ports/stm/common-hal/pulseio/PulseOut.h create mode 100644 ports/stm/common-hal/pulseio/__init__.c create mode 100755 ports/stm/common-hal/supervisor/Runtime.c create mode 100755 ports/stm/common-hal/supervisor/Runtime.h create mode 100755 ports/stm/common-hal/supervisor/__init__.c create mode 100644 ports/stm/common-hal/time/__init__.c create mode 100644 ports/stm/fatfs_port.c create mode 100644 ports/stm/mpconfigport.h create mode 100644 ports/stm/mpconfigport.mk create mode 100644 ports/stm/mphalport.c create mode 100644 ports/stm/mphalport.h create mode 100644 ports/stm/peripherals/stm32f4/clocks.h create mode 100644 ports/stm/peripherals/stm32f4/gpio.h create mode 100644 ports/stm/peripherals/stm32f4/periph.h create mode 100644 ports/stm/peripherals/stm32f4/pins.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/pins.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/pins.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/pins.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/pins.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/pins.h create mode 100644 ports/stm/qstrdefsport.h create mode 100755 ports/stm/supervisor/cpu.s create mode 100644 ports/stm/supervisor/internal_flash.c create mode 100644 ports/stm/supervisor/internal_flash.h create mode 100644 ports/stm/supervisor/internal_flash_root_pointers.h create mode 100644 ports/stm/supervisor/port.c create mode 100644 ports/stm/supervisor/qspi_flash.c create mode 100644 ports/stm/supervisor/serial.c create mode 100644 ports/stm/supervisor/usb.c create mode 100644 ports/stm/system_stm32f4xx.c create mode 100644 ports/stm/tick.c create mode 100644 ports/stm/tick.h diff --git a/ports/stm/.gitignore b/ports/stm/.gitignore new file mode 100644 index 0000000000..3080ece14d --- /dev/null +++ b/ports/stm/.gitignore @@ -0,0 +1,9 @@ +# Build files +##################### +build-*/ + +# Reference files +##################### +ref/ + +.gdb_history \ No newline at end of file diff --git a/ports/stm/Makefile b/ports/stm/Makefile new file mode 100755 index 0000000000..3a6191c851 --- /dev/null +++ b/ports/stm/Makefile @@ -0,0 +1,284 @@ +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2019 Dan Halbert for Adafruit Industries +# Copyright (c) 2019 Lucian Copeland for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# DEBUG = 1 + +# Select the board to build for. +ifeq ($(BOARD),) + $(error You must provide a BOARD parameter) +else + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD specified) + endif +endif + +# If the build directory is not given, make it reflect the board name. +BUILD ?= build-$(BOARD) + +include ../../py/mkenv.mk +# Board-specific +include boards/$(BOARD)/mpconfigboard.mk +# Port-specific +include mpconfigport.mk + +# CircuitPython-specific +include $(TOP)/py/circuitpy_mpconfig.mk + +# qstr definitions (must come before including py.mk) +QSTR_DEFS = qstrdefsport.h + +# include py core make definitions +include $(TOP)/py/py.mk + +include $(TOP)/supervisor/supervisor.mk + +# Include make rules and variables common across CircuitPython builds. +include $(TOP)/py/circuitpy_defns.mk + +CROSS_COMPILE = arm-none-eabi- + +####################################### +# CFLAGS +####################################### + +INC += -I. +INC += -I../.. +INC += -I$(BUILD) +INC += -I$(BUILD)/genhdr +INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc +INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc/Legacy +INC += -I./stm32f4/CMSIS/Device/ST/STM32F4xx/Include +INC += -I./stm32f4/CMSIS/Include +INC += -I./boards +INC += -I./boards/$(BOARD) +INC += -I./peripherals +INC += -I../../lib/mp-readline +INC += -I../../lib/tinyusb/src +INC += -I../../supervisor/shared/usb + + +#Debugging/Optimization +ifeq ($(DEBUG), 1) + CFLAGS += -ggdb + # You may want to enable these flags to make setting breakpoints easier. + CFLAGS += -fno-inline -fno-ipa-sra +else + CFLAGS += -Os -DNDEBUG + CFLAGS += -ggdb + # TODO: Test with -flto + ### CFLAGS += -flto +endif + + +C_DEFS = -DMCU_PACKAGE=$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(CMSIS_MCU) + +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) + +# Undo some warnings. +# STM32 apparently also uses undefined preprocessor variables quite casually, +# so we can't do warning checks for these. +CFLAGS += -Wno-undef +# STM32 might do casts that increase alignment requirements. +CFLAGS += -Wno-cast-align + +CFLAGS += \ + -mthumb \ + -mabi=aapcs-linux \ + -mfloat-abi=hard \ + -mcpu=cortex-m4 \ + -mfpu=fpv4-sp-d16 + +# TODO: check this +CFLAGS += -D__START=main + +#need both command and valid file to use uf2 bootloader +ifndef LD_FILE + ifneq ($(and $(UF2_BOOTLOADER),$(LD_BOOT)),) + LD_FILE = $(LD_BOOT) + BOOTLOADER_OFFSET = $(UF2_OFFSET) + CFLAGS += -DUF2_BOOTLOADER_ENABLED + else + LD_FILE = $(LD_DEFAULT) + endif +endif + +# Add bootloader specific items +ifndef BOOTLOADER_OFFSET + BOOTLOADER_OFFSET := 0x8000000 +endif + +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LIBS := -lgcc -lc + +LDFLAGS += -mthumb -mcpu=cortex-m4 + +# Use toolchain libm if we're not using our own. +ifndef INTERNAL_LIBM +LIBS += -lm +endif + +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 + + +###################################### +# source +###################################### + +SRC_STM32 = \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ + system_stm32f4xx.c + + +SRC_C += \ + background.c \ + fatfs_port.c \ + mphalport.c \ + tick.c \ + boards/$(BOARD)/board.c \ + boards/$(BOARD)/pins.c \ + peripherals/stm32f4/$(MCU_SUB_VARIANT)/pins.c \ + peripherals/stm32f4/$(MCU_SUB_VARIANT)/clocks.c \ + peripherals/stm32f4/$(MCU_SUB_VARIANT)/gpio.c \ + peripherals/stm32f4/$(MCU_SUB_VARIANT)/periph.c \ + lib/libc/string0.c \ + lib/mp-readline/readline.c \ + lib/oofatfs/ff.c \ + lib/oofatfs/option/ccsbcs.c \ + lib/timeutils/timeutils.c \ + lib/utils/buffer_helper.c \ + lib/utils/context_manager_helpers.c \ + lib/utils/interrupt_char.c \ + lib/utils/pyexec.c \ + lib/utils/stdout_helpers.c \ + lib/utils/sys_stdio_mphal.c \ + supervisor/shared/memory.c + +ifneq ($(USB),FALSE) +SRC_C += lib/tinyusb/src/portable/st/synopsys/dcd_synopsys.c +endif + +SRC_S = \ + supervisor/cpu.s \ + boards/startup_$(MCU_SUB_VARIANT).s + +SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ + $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ + $(addprefix common-hal/, $(SRC_COMMON_HAL)) + +SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) + + +ifneq ($(FROZEN_MPY_DIR),) +FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') +FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +endif + +OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_STM32:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +ifeq ($(INTERNAL_LIBM),1) +OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) +endif +OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) + +$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os +$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os + +# List of sources for qstr extraction +SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) +# Sources that only hold QSTRs after pre-processing. +SRC_QSTR_PREPROCESSOR += + + +all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 + +$(BUILD)/firmware.elf: $(OBJ) + $(STEPECHO) "LINK $@" + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + +$(BUILD)/firmware.bin: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O binary $^ $@ +# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.hex: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O ihex $^ $@ +# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.uf2: $(BUILD)/firmware.hex + $(ECHO) "Create $@" + $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ + +include $(TOP)/py/mkrules.mk + +# Print out the value of a make variable. +# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile +print-%: + @echo $* = $($*) diff --git a/ports/stm/README.md b/ports/stm/README.md new file mode 100644 index 0000000000..a860c01ce4 --- /dev/null +++ b/ports/stm/README.md @@ -0,0 +1,3 @@ +# CircuitPython Port To The ST Microelectronics STM32F4 Series + +This is a port of CircuitPython to the STM32F4 series of chips. diff --git a/ports/stm/background.c b/ports/stm/background.c new file mode 100644 index 0000000000..8c18970434 --- /dev/null +++ b/ports/stm/background.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "supervisor/filesystem.h" +#include "supervisor/usb.h" +#include "supervisor/shared/stack.h" + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif + +static bool running_background_tasks = false; + +void background_tasks_reset(void) { + running_background_tasks = false; +} + +void run_background_tasks(void) { + // Don't call ourselves recursively. + if (running_background_tasks) { + return; + } + running_background_tasks = true; + filesystem_background(); + + #if USB_AVAILABLE + usb_background(); + #endif + + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif + running_background_tasks = false; + + assert_heap_ok(); +} diff --git a/ports/stm/background.h b/ports/stm/background.h new file mode 100644 index 0000000000..05a4f894a6 --- /dev/null +++ b/ports/stm/background.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_BACKGROUND_H +#define MICROPY_INCLUDED_STM32F4_BACKGROUND_H + +#include + +void background_tasks_reset(void); +void run_background_tasks(void); + +#endif // MICROPY_INCLUDED_STM32F4_BACKGROUND_H diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld new file mode 100644 index 0000000000..c42dfcca8c --- /dev/null +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -0,0 +1,107 @@ +/* + GNU linker script for STM32F401 with bootloader (such as the Meowbit) +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld new file mode 100644 index 0000000000..125d785fc2 --- /dev/null +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -0,0 +1,106 @@ +/* + GNU linker script for STM32F401 with bootloader (such as the Meowbit) +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ + FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld new file mode 100644 index 0000000000..fd30e16228 --- /dev/null +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -0,0 +1,107 @@ +/* + GNU linker script for STM32F401 with bootloader (such as the Meowbit) +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld new file mode 100644 index 0000000000..64da3b6520 --- /dev/null +++ b/ports/stm/boards/STM32F405_boot.ld @@ -0,0 +1,107 @@ +/* + GNU linker script for STM32F405 with bootloader + Based on Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ + FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define the top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld new file mode 100644 index 0000000000..c2b8c843ee --- /dev/null +++ b/ports/stm/boards/STM32F405_default.ld @@ -0,0 +1,107 @@ +/* + GNU linker script for STM32F405 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld new file mode 100644 index 0000000000..7f7c917846 --- /dev/null +++ b/ports/stm/boards/STM32F405_fs.ld @@ -0,0 +1,108 @@ +/* + GNU linker script for STM32F405 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld new file mode 100644 index 0000000000..7f7c917846 --- /dev/null +++ b/ports/stm/boards/STM32F407_fs.ld @@ -0,0 +1,108 @@ +/* + GNU linker script for STM32F405 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F411VETx_FLASH.ld b/ports/stm/boards/STM32F411VETx_FLASH.ld new file mode 100644 index 0000000000..ac1ba32408 --- /dev/null +++ b/ports/stm/boards/STM32F411VETx_FLASH.ld @@ -0,0 +1,109 @@ +/* + GNU linker script for STM32F411 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); +_heap_start = _ebss; /* heap starts just after statically allocated memory */ +_heap_end = 0x2001c000; /* tunable */ + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F412ZGTx_FLASH.ld b/ports/stm/boards/STM32F412ZGTx_FLASH.ld new file mode 100644 index 0000000000..e0586709e6 --- /dev/null +++ b/ports/stm/boards/STM32F412ZGTx_FLASH.ld @@ -0,0 +1,105 @@ +/* + GNU linker script for STM32F412 +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); +_heap_start = _ebss; /* heap starts just after statically allocated memory */ +_heap_end = 0x20020000; /* tunable */ + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/ports/stm/boards/board.h b/ports/stm/boards/board.h new file mode 100644 index 0000000000..22d9e99be0 --- /dev/null +++ b/ports/stm/boards/board.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// This file defines board specific functions. + +#ifndef MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H +#define MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H + +#include + +// Initializes board related state once on start up. +void board_init(void); + +// Returns true if the user initiates safe mode in a board specific way. +// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific +// way. +bool board_requests_safe_mode(void); + +// Reset the state of off MCU components such as neopixels. +void reset_board(void); + +#endif // MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H diff --git a/ports/stm/boards/espruino_pico/README.md b/ports/stm/boards/espruino_pico/README.md new file mode 100644 index 0000000000..9f0321c474 --- /dev/null +++ b/ports/stm/boards/espruino_pico/README.md @@ -0,0 +1,15 @@ +# Flashing the Espruino Pico + +The Espruino Pico is normally updated via a bootloader activated by the Espruino web app. This approach is not practical for Circuitpython as it takes too much space from the internal filesystem - thus, you will need to follow the instructions for advanced reflashing using the built-in ROM bootloader on all STM32F4 MCUs (instructions sourced from https://www.espruino.com/Pico#advanced-reflashing) + + - Short out the BOOT0/BTN solder jumper on the back of the board - you can do this by drawing over it with a pencil. + - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux + - **Mac**: install with Homebrew: `brew install dfu-util` + - **Linux**: install with apt-get: `sudo apt-get install dfu-util` + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - Hold down the Pico's button while plugging it into USB (when overwriting Espruino's default firmware) + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. + + +To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file diff --git a/ports/stm/boards/espruino_pico/board.c b/ports/stm/boards/espruino_pico/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm/boards/espruino_pico/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h new file mode 100644 index 0000000000..d4430380c6 --- /dev/null +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "Espruino Pico" +#define MICROPY_HW_MCU_NAME "STM32F401xD" + +#define FLASH_SIZE (0x60000) +#define FLASH_PAGE_SIZE (0x4000) + +#define AUTORESET_DELAY_MS (500) +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) + +#define BOARD_OSC_DIV (8) + diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk new file mode 100644 index 0000000000..151ca1437a --- /dev/null +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -0,0 +1,16 @@ +USB_VID = 0x239A +USB_PID = 0x808E +USB_PRODUCT = "Espruino Pico" +USB_MANUFACTURER = "Espruino" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f401xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F401xE +LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash + diff --git a/ports/stm/boards/espruino_pico/pins.c b/ports/stm/boards/espruino_pico/pins.c new file mode 100644 index 0000000000..55c0336c54 --- /dev/null +++ b/ports/stm/boards/espruino_pico/pins.c @@ -0,0 +1,33 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..ab04df3182 --- /dev/null +++ b/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/espruino_wifi/README.MD b/ports/stm/boards/espruino_wifi/README.MD new file mode 100644 index 0000000000..8c2cd3be2b --- /dev/null +++ b/ports/stm/boards/espruino_wifi/README.MD @@ -0,0 +1,15 @@ +# Flashing the Espruino Wifi + +The Espruino Wifi is normally updated via a bootloader activated by the Espruino web app. This approach is not practical for Circuitpython as it takes too much space from the internal filesystem - thus, you will need to follow the instructions for advanced reflashing using the built-in ROM bootloader on all STM32F4 MCUs (instructions sourced from https://www.espruino.com/Wifi#advanced-reflashing) + + - Short out the BOOT0/BTN solder jumper on the back of the board - you can do this by drawing over it with a pencil. + - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux + - **Mac**: install with Homebrew: `brew install dfu-util` + - **Linux**: install with apt-get: `sudo apt-get install dfu-util` + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - Hold down the Wifi's button while plugging it into USB (when overwriting Espruino's default firmware) + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. + + +To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file diff --git a/ports/stm/boards/espruino_wifi/board.c b/ports/stm/boards/espruino_wifi/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/espruino_wifi/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h new file mode 100644 index 0000000000..abdc9e8fac --- /dev/null +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "Espruino Wifi" +#define MICROPY_HW_MCU_NAME "STM32F411xE" + +#define FLASH_SIZE (0x80000) //512K +#define FLASH_PAGE_SIZE (0x4000) //16K + +#define BOARD_OSC_DIV (8) +#define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk new file mode 100644 index 0000000000..8b28cf07c7 --- /dev/null +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -0,0 +1,16 @@ +USB_VID = 0x239A +USB_PID = 0x8090 +USB_PRODUCT = "Espruino Wifi" +USB_MANUFACTURER = "Espruino" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld + diff --git a/ports/stm/boards/espruino_wifi/pins.c b/ports/stm/boards/espruino_wifi/pins.c new file mode 100644 index 0000000000..8800317d50 --- /dev/null +++ b/ports/stm/boards/espruino_wifi/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + //P1 + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, + + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) }, + + { MP_ROM_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_ESP_CHPD), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_ESP_GPIO13), MP_ROM_PTR(&pin_PA15) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..18d9d60ebe --- /dev/null +++ b/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h @@ -0,0 +1,439 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/feather_stm32f405_express/board.c b/ports/stm/boards/feather_stm32f405_express/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm/boards/feather_stm32f405_express/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h new file mode 100644 index 0000000000..6600fcf671 --- /dev/null +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -0,0 +1,58 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "Feather STM32F405 Express" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define MICROPY_HW_NEOPIXEL (&pin_PC00) + +#define BOARD_OSC_DIV (12) + +// On-board flash +#define SPI_FLASH_MOSI_PIN (&pin_PB05) +#define SPI_FLASH_MISO_PIN (&pin_PB04) +#define SPI_FLASH_SCK_PIN (&pin_PB03) +#define SPI_FLASH_CS_PIN (&pin_PA15) + +// Bootloader only +#ifdef UF2_BOOTLOADER_ENABLED + #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader +#endif + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) +#define DEFAULT_SPI_BUS_MISO (&pin_PB14) + +#define DEFAULT_UART_BUS_RX (&pin_PB11) +#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk new file mode 100644 index 0000000000..312ca6b480 --- /dev/null +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x239A +USB_PID = 0x805A +USB_PRODUCT = "Feather STM32F405 Express" +USB_MANUFACTURER = "Adafruit Industries LLC" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f405xx +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F405xx + +# Default includes filesystem, but uses external flash +LD_DEFAULT = boards/STM32F405_default.ld +LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option +UF2_OFFSET = 0x8010000 + diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c new file mode 100644 index 0000000000..ebc8fa337e --- /dev/null +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..8031403a91 --- /dev/null +++ b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c new file mode 100644 index 0000000000..a0ae988249 --- /dev/null +++ b/ports/stm/boards/meowbit_v121/board.c @@ -0,0 +1,121 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/SPI.h" + +#include "supervisor/spi_flash_api.h" + +#include "tick.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0x01, 0 | DELAY, 150, // SWRESET + 0x11, 0 | DELAY, 255, // SLPOUT + 0xb1, 3, 0x01, 0x2C, 0x2D, // _FRMCTR1 + 0xb2, 3, 0x01, 0x2C, 0x2D, // + 0xb3, 6, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, + 0xb4, 1, 0x07, // _INVCTR line inversion + 0xc0, 3, 0xa2, 0x02, 0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA + 0xc1, 1, 0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V + 0xc2, 2, 0x0a, 0x00, // _PWCTR3 Opamp current small, Boost frequency + 0xc3, 2, 0x8a, 0x2a, + 0xc4, 2, 0x8a, 0xee, + 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V + 0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20 + 0x36, 1, 0x18, // _MADCTL bottom to top refresh + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // fix on VTL + 0x3a, 1, 0x05, // COLMOD - 16bit color + 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, + 0x37, 0x32, 0x29, 0x2d, + 0x29, 0x25, 0x2B, 0x39, + 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma + 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, + 0x2E, 0x2C, 0x29, 0x2D, + 0x2E, 0x2E, 0x37, 0x3F, + 0x00, 0x00, 0x02, 0x10, // _GMCTRN1 + 0x13, 0 | DELAY, 10, // _NORON + 0x29, 0 | DELAY, 100, // _DISPON +}; + +void board_init(void) { + displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + busio_spi_obj_t *internal_spi = &supervisor_flash_spi_bus; + common_hal_displayio_fourwire_construct(bus, + internal_spi, + &pin_PA08, // Command or data + &pin_PB12, // Chip select + &pin_PB10, // Reset + 24000000); + + displayio_display_obj_t* display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 160, // Width + 128, // Height + 0, // column start + 0, // row start + 90, // rotation + 16, // Color depth + false, // Grayscale + false, // Pixels in a byte share a row. Only used for depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + 0x37, // set vertical scroll command + display_init_sequence, + sizeof(display_init_sequence), + &pin_PB03, + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60); // native_frames_per_second +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h new file mode 100644 index 0000000000..babf54a3a9 --- /dev/null +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "MEOWBIT" +#define MICROPY_HW_MCU_NAME "STM32F401xE" + +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) + +#define BOARD_OSC_DIV (12) +#define BOARD_NO_VBUS_SENSE (1) +#define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader +#define BOARD_USE_INTERNAL_SPI + +// On-board flash +#define SPI_FLASH_MOSI_PIN (&pin_PB15) +#define SPI_FLASH_MISO_PIN (&pin_PB14) +#define SPI_FLASH_SCK_PIN (&pin_PB13) +#define SPI_FLASH_CS_PIN (&pin_PB01) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk new file mode 100644 index 0000000000..16268ba119 --- /dev/null +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x239A +USB_PID = 0x805A +USB_PRODUCT = "Meowbit" +USB_MANUFACTURER = "Kittenbot" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = W25Q16JV_IQ +LONGINT_IMPL = MPZ + +BOOTLOADER_OFFSET = 0x8010000 + +# INTERNAL_FLASH_FILESYSTEM = 1 +# LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f401xe +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F401xE +LD_FILE = boards/STM32F401xe_boot.ld +# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash + diff --git a/ports/stm/boards/meowbit_v121/pins.c b/ports/stm/boards/meowbit_v121/pins.c new file mode 100644 index 0000000000..af896fad87 --- /dev/null +++ b/ports/stm/boards/meowbit_v121/pins.c @@ -0,0 +1,68 @@ +#include "shared-bindings/board/__init__.h" +#include "supervisor/spi_flash_api.h" + +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PB05) }, + + { MP_ROM_QSTR(MP_QSTR_DISP_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_DISP_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_DISP_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_DISP_CS), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_DISP_DC), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_DISP_RST), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_DISP_BL), MP_ROM_PTR(&pin_PB03) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZ), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_BTNA), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_BTNB), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_RIGHT), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_DOWN), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_LEFT), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_TEMP), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_UP), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_MENU), MP_ROM_PTR(&pin_PC15) }, + + { MP_ROM_QSTR(MP_QSTR_JACK_TX), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_JACK_PWREN), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_JACK_SND), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_ACC_INT), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_ACC_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_ACC_SDA), MP_ROM_PTR(&pin_PB07) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + // { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PC06) }, //these are wrong on Meowbit diagram. + // { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA03) }, //they cannot be used together (UART2 vs 6) + { MP_ROM_QSTR(MP_QSTR_NSS), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PC10) }, + + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PA10) }, //in use by USB + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB00) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, + { MP_ROM_QSTR(MP_QSTR_INTERNAL_SPI), MP_ROM_PTR(&supervisor_flash_spi_bus) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..68a49b4ba8 --- /dev/null +++ b/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/openocd_stm32f4.cfg b/ports/stm/boards/openocd_stm32f4.cfg new file mode 100644 index 0000000000..19631a7c8e --- /dev/null +++ b/ports/stm/boards/openocd_stm32f4.cfg @@ -0,0 +1,44 @@ +# This script configures OpenOCD for use with an ST-Link V2 programmer/debugger +# and an STM32F4 target microcontroller. +# +# To flash your firmware: +# +# $ openocd -f openocd_stm32f4.cfg \ +# -c "stm_flash build-BOARD/firmware0.bin 0x08000000 build-BOARD/firmware1.bin 0x08020000" +# +# For a gdb server on port 3333: +# +# $ openocd -f openocd_stm32f4.cfg + + +source [find interface/stlink-v2.cfg] +transport select hla_swd +source [find target/stm32f4x.cfg] +reset_config srst_only +init + +proc stm_flash { BIN0 ADDR0 {BIN1 ""} {ADDR1 ""} } { + reset halt + sleep 100 + wait_halt 2 + flash write_image erase $BIN0 $ADDR0 + sleep 100 + verify_image $BIN0 $ADDR0 + sleep 100 + if {$BIN1 ne ""} { + flash write_image erase $BIN1 $ADDR1 + sleep 100 + verify_image $BIN1 $ADDR1 + sleep 100 + } + reset run + shutdown +} + +proc stm_erase {} { + reset halt + sleep 100 + stm32f4x mass_erase 0 + sleep 100 + shutdown +} diff --git a/ports/stm/boards/pyb_nano_v2/board.c b/ports/stm/boards/pyb_nano_v2/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm/boards/pyb_nano_v2/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h new file mode 100644 index 0000000000..965e7d5ff4 --- /dev/null +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "PYB LR Nano V2" +#define MICROPY_HW_MCU_NAME "STM32F411CE" + +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) + +// On-board flash +#define SPI_FLASH_MOSI_PIN (&pin_PB15) +#define SPI_FLASH_MISO_PIN (&pin_PB14) +#define SPI_FLASH_SCK_PIN (&pin_PB13) +#define SPI_FLASH_CS_PIN (&pin_PB12) + +#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) + +#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk new file mode 100644 index 0000000000..a8472608b7 --- /dev/null +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x239A +USB_PID = 0x8068 +USB_PRODUCT = "PYB LR Nano V2" +USB_MANUFACTURER = "MicroPython Chinese Community" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = W25Q64JV_IQ +LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld + diff --git a/ports/stm/boards/pyb_nano_v2/pins.c b/ports/stm/boards/pyb_nano_v2/pins.c new file mode 100644 index 0000000000..e10124f6af --- /dev/null +++ b/ports/stm/boards/pyb_nano_v2/pins.c @@ -0,0 +1,59 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_Y0), MP_ROM_PTR(&pin_PB09) }, + + { MP_ROM_QSTR(MP_QSTR_X15), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_X14), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_X13), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_X0), MP_ROM_PTR(&pin_PA00) }, + + { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SCK2), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO2), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI2), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_LED_YELLOW), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..ab04df3182 --- /dev/null +++ b/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/pyboard_v11/board.c b/ports/stm/boards/pyboard_v11/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/pyboard_v11/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h new file mode 100644 index 0000000000..398731d30c --- /dev/null +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "PyboardV1_1" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (12) + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk new file mode 100644 index 0000000000..ef1b8f0ca1 --- /dev/null +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -0,0 +1,16 @@ +USB_VID = 0x239A +USB_PID = 0x805C +USB_PRODUCT = "Pyboard Version 1.1" +USB_MANUFACTURER = "George Robotic" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f405xx +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F405xx +LD_FILE = boards/STM32F405_fs.ld + diff --git a/ports/stm/boards/pyboard_v11/pins.c b/ports/stm/boards/pyboard_v11/pins.c new file mode 100644 index 0000000000..8783dfcf10 --- /dev/null +++ b/ports/stm/boards/pyboard_v11/pins.c @@ -0,0 +1,52 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_Y11), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_Y12), MP_ROM_PTR(&pin_PB01) }, + + { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PC05) }, + + { MP_ROM_QSTR(MP_QSTR_X17), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_X18), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_X19), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_X20), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_X21), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_X22), MP_ROM_PTR(&pin_PC03) }, + + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PA13) }, + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA13) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h b/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..4dc18cb7f4 --- /dev/null +++ b/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/startup_stm32f401xe.s b/ports/stm/boards/startup_stm32f401xe.s new file mode 100644 index 0000000000..815ac17197 --- /dev/null +++ b/ports/stm/boards/startup_stm32f401xe.s @@ -0,0 +1,448 @@ +/** + ****************************************************************************** + * @file startup_stm32f401xe.s + * @author MCD Application Team + * @brief STM32F401xExx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ + /* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word 0 /* Reserved */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word 0 /* Reserved */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word FPU_IRQHandler /* FPU */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word SPI4_IRQHandler /* SPI4 */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/ports/stm/boards/startup_stm32f405xx.s b/ports/stm/boards/startup_stm32f405xx.s new file mode 100644 index 0000000000..6b77655ca1 --- /dev/null +++ b/ports/stm/boards/startup_stm32f405xx.s @@ -0,0 +1,516 @@ +/** + ****************************************************************************** + * @file startup_stm32f405xx.s + * @author MCD Application Team + * @brief STM32F405xx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + + +g_pfnVectors: + .word _estack + .word Reset_Handler + + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word CAN1_TX_IRQHandler /* CAN1 TX */ + .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ + .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ + .word CAN1_SCE_IRQHandler /* CAN1 SCE */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word FSMC_IRQHandler /* FSMC */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word UART4_IRQHandler /* UART4 */ + .word UART5_IRQHandler /* UART5 */ + .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word CAN2_TX_IRQHandler /* CAN2 TX */ + .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ + .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ + .word CAN2_SCE_IRQHandler /* CAN2 SCE */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ + .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ + .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ + .word OTG_HS_IRQHandler /* USB OTG HS */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word HASH_RNG_IRQHandler /* Hash and Rng */ + .word FPU_IRQHandler /* FPU */ + + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak CAN1_TX_IRQHandler + .thumb_set CAN1_TX_IRQHandler,Default_Handler + + .weak CAN1_RX0_IRQHandler + .thumb_set CAN1_RX0_IRQHandler,Default_Handler + + .weak CAN1_RX1_IRQHandler + .thumb_set CAN1_RX1_IRQHandler,Default_Handler + + .weak CAN1_SCE_IRQHandler + .thumb_set CAN1_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak FSMC_IRQHandler + .thumb_set FSMC_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak UART4_IRQHandler + .thumb_set UART4_IRQHandler,Default_Handler + + .weak UART5_IRQHandler + .thumb_set UART5_IRQHandler,Default_Handler + + .weak TIM6_DAC_IRQHandler + .thumb_set TIM6_DAC_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak CAN2_TX_IRQHandler + .thumb_set CAN2_TX_IRQHandler,Default_Handler + + .weak CAN2_RX0_IRQHandler + .thumb_set CAN2_RX0_IRQHandler,Default_Handler + + .weak CAN2_RX1_IRQHandler + .thumb_set CAN2_RX1_IRQHandler,Default_Handler + + .weak CAN2_SCE_IRQHandler + .thumb_set CAN2_SCE_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_OUT_IRQHandler + .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_IN_IRQHandler + .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler + + .weak OTG_HS_WKUP_IRQHandler + .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler + + .weak OTG_HS_IRQHandler + .thumb_set OTG_HS_IRQHandler,Default_Handler + + .weak HASH_RNG_IRQHandler + .thumb_set HASH_RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + + diff --git a/ports/stm/boards/startup_stm32f407xx.s b/ports/stm/boards/startup_stm32f407xx.s new file mode 100644 index 0000000000..6b77655ca1 --- /dev/null +++ b/ports/stm/boards/startup_stm32f407xx.s @@ -0,0 +1,516 @@ +/** + ****************************************************************************** + * @file startup_stm32f405xx.s + * @author MCD Application Team + * @brief STM32F405xx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + + +g_pfnVectors: + .word _estack + .word Reset_Handler + + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word CAN1_TX_IRQHandler /* CAN1 TX */ + .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ + .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ + .word CAN1_SCE_IRQHandler /* CAN1 SCE */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word FSMC_IRQHandler /* FSMC */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word UART4_IRQHandler /* UART4 */ + .word UART5_IRQHandler /* UART5 */ + .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word CAN2_TX_IRQHandler /* CAN2 TX */ + .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ + .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ + .word CAN2_SCE_IRQHandler /* CAN2 SCE */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ + .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ + .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ + .word OTG_HS_IRQHandler /* USB OTG HS */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word HASH_RNG_IRQHandler /* Hash and Rng */ + .word FPU_IRQHandler /* FPU */ + + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak CAN1_TX_IRQHandler + .thumb_set CAN1_TX_IRQHandler,Default_Handler + + .weak CAN1_RX0_IRQHandler + .thumb_set CAN1_RX0_IRQHandler,Default_Handler + + .weak CAN1_RX1_IRQHandler + .thumb_set CAN1_RX1_IRQHandler,Default_Handler + + .weak CAN1_SCE_IRQHandler + .thumb_set CAN1_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak FSMC_IRQHandler + .thumb_set FSMC_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak UART4_IRQHandler + .thumb_set UART4_IRQHandler,Default_Handler + + .weak UART5_IRQHandler + .thumb_set UART5_IRQHandler,Default_Handler + + .weak TIM6_DAC_IRQHandler + .thumb_set TIM6_DAC_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak CAN2_TX_IRQHandler + .thumb_set CAN2_TX_IRQHandler,Default_Handler + + .weak CAN2_RX0_IRQHandler + .thumb_set CAN2_RX0_IRQHandler,Default_Handler + + .weak CAN2_RX1_IRQHandler + .thumb_set CAN2_RX1_IRQHandler,Default_Handler + + .weak CAN2_SCE_IRQHandler + .thumb_set CAN2_SCE_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_OUT_IRQHandler + .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_IN_IRQHandler + .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler + + .weak OTG_HS_WKUP_IRQHandler + .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler + + .weak OTG_HS_IRQHandler + .thumb_set OTG_HS_IRQHandler,Default_Handler + + .weak HASH_RNG_IRQHandler + .thumb_set HASH_RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + + diff --git a/ports/stm/boards/startup_stm32f411xe.s b/ports/stm/boards/startup_stm32f411xe.s new file mode 100644 index 0000000000..3aac640cb2 --- /dev/null +++ b/ports/stm/boards/startup_stm32f411xe.s @@ -0,0 +1,452 @@ +/** + ****************************************************************************** + * @file startup_stm32f411xe.s + * @author MCD Application Team + * @brief STM32F411xExx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word 0 /* Reserved */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word 0 /* Reserved */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word FPU_IRQHandler /* FPU */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word SPI4_IRQHandler /* SPI4 */ + .word SPI5_IRQHandler /* SPI5 */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + + .weak SPI5_IRQHandler + .thumb_set SPI5_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/ports/stm/boards/startup_stm32f412zx.s b/ports/stm/boards/startup_stm32f412zx.s new file mode 100644 index 0000000000..8012207957 --- /dev/null +++ b/ports/stm/boards/startup_stm32f412zx.s @@ -0,0 +1,524 @@ +/** + ****************************************************************************** + * @file startup_stm32f412zx.s + * @author MCD Application Team + * @brief STM32F412Zx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word CAN1_TX_IRQHandler /* CAN1 TX */ + .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ + .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ + .word CAN1_SCE_IRQHandler /* CAN1 SCE */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word 0 /* Reserved */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word TIM6_IRQHandler /* TIM6 */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */ + .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */ + .word CAN2_TX_IRQHandler /* CAN2 TX */ + .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ + .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ + .word CAN2_SCE_IRQHandler /* CAN2 SCE */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word RNG_IRQHandler /* RNG */ + .word FPU_IRQHandler /* FPU */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word SPI4_IRQHandler /* SPI4 */ + .word SPI5_IRQHandler /* SPI5 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word QUADSPI_IRQHandler /* QuadSPI */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */ + .word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak CAN1_TX_IRQHandler + .thumb_set CAN1_TX_IRQHandler,Default_Handler + + .weak CAN1_RX0_IRQHandler + .thumb_set CAN1_RX0_IRQHandler,Default_Handler + + .weak CAN1_RX1_IRQHandler + .thumb_set CAN1_RX1_IRQHandler,Default_Handler + + .weak CAN1_SCE_IRQHandler + .thumb_set CAN1_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak TIM6_IRQHandler + .thumb_set TIM6_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak DFSDM1_FLT0_IRQHandler + .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler + + .weak DFSDM1_FLT1_IRQHandler + .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler + + .weak CAN2_TX_IRQHandler + .thumb_set CAN2_TX_IRQHandler,Default_Handler + + .weak CAN2_RX0_IRQHandler + .thumb_set CAN2_RX0_IRQHandler,Default_Handler + + .weak CAN2_RX1_IRQHandler + .thumb_set CAN2_RX1_IRQHandler,Default_Handler + + .weak CAN2_SCE_IRQHandler + .thumb_set CAN2_SCE_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + + .weak SPI5_IRQHandler + .thumb_set SPI5_IRQHandler,Default_Handler + + .weak QUADSPI_IRQHandler + .thumb_set QUADSPI_IRQHandler,Default_Handler + + .weak FMPI2C1_EV_IRQHandler + .thumb_set FMPI2C1_EV_IRQHandler,Default_Handler + + .weak FMPI2C1_ER_IRQHandler + .thumb_set FMPI2C1_ER_IRQHandler,Default_Handler +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ce_blackpill/board.c b/ports/stm/boards/stm32f411ce_blackpill/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm/boards/stm32f411ce_blackpill/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h new file mode 100644 index 0000000000..2ae1a29268 --- /dev/null +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "stm32f411ce-blackpill" +#define MICROPY_HW_MCU_NAME "STM32F411CE" + +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (25) +#define BOARD_NO_VBUS_SENSE (1) + +// On-board flash +// #define SPI_FLASH_MOSI_PIN (&pin_PA07) +// #define SPI_FLASH_MISO_PIN (&pin_PA06) +// #define SPI_FLASH_SCK_PIN (&pin_PA05) +// #define SPI_FLASH_CS_PIN (&pin_PA04) + +#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) + +#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk new file mode 100644 index 0000000000..68c6a1eeaa --- /dev/null +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x806A +USB_PRODUCT = "stm32f411ce blackpill" +USB_MANUFACTURER = "Unknown" +USB_DEVICES = "CDC,MSC" + +# SPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = xxxxxx #See supervisor/shared/external_flash/devices.h for options +# LONGINT_IMPL = MPZ + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld + diff --git a/ports/stm/boards/stm32f411ce_blackpill/pins.c b/ports/stm/boards/stm32f411ce_blackpill/pins.c new file mode 100644 index 0000000000..aa9736fc4c --- /dev/null +++ b/ports/stm/boards/stm32f411ce_blackpill/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, + + { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..81d29f2420 --- /dev/null +++ b/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +/* #define HAL_PCD_MODULE_ENABLED */ +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ve_discovery/board.c b/ports/stm/boards/stm32f411ve_discovery/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/stm32f411ve_discovery/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h new file mode 100644 index 0000000000..49ef80cdd7 --- /dev/null +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "STM32F411E_DISCO" +#define MICROPY_HW_MCU_NAME "STM32F411xE" + +#define FLASH_SIZE (0x80000) //512K +#define FLASH_PAGE_SIZE (0x4000) //16K + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk new file mode 100644 index 0000000000..64e2b4dc53 --- /dev/null +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -0,0 +1,16 @@ +USB_VID = 0x239A +USB_PID = 0x805E +USB_PRODUCT = "STM32F411VE Discovery Board - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 100 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld + diff --git a/ports/stm/boards/stm32f411ve_discovery/pins.c b/ports/stm/boards/stm32f411ve_discovery/pins.c new file mode 100644 index 0000000000..673c412d51 --- /dev/null +++ b/ports/stm/boards/stm32f411ve_discovery/pins.c @@ -0,0 +1,106 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + //P1 + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + //P2 + { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + //ST LED names + { MP_ROM_QSTR(MP_QSTR_LD3), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LD4), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LD5), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LD6), MP_ROM_PTR(&pin_PD15) }, + //more useful LED names + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PD15) }, + //AnalogIO names + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + //actual LED names + { MP_ROM_QSTR(MP_QSTR_LED_ORANGE), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PD15) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..18d9d60ebe --- /dev/null +++ b/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h @@ -0,0 +1,439 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f412zg_discovery/board.c b/ports/stm/boards/stm32f412zg_discovery/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/stm32f412zg_discovery/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h new file mode 100644 index 0000000000..f34b830fb2 --- /dev/null +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "STM32F412G_DISCO" +#define MICROPY_HW_MCU_NAME "STM32F412xGS" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) + +#define DEFAULT_I2C_BUS_SCL (&pin_PB10) +#define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk new file mode 100644 index 0000000000..b0205fc733 --- /dev/null +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x239A +USB_PID = 0x8056 +USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC,HID" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +# QSPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = N25Q128A +# LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f412zx +MCU_PACKAGE = 144 +CMSIS_MCU = STM32F412Zx +LD_FILE = boards/STM32F412ZGTx_FLASH.ld + + diff --git a/ports/stm/boards/stm32f412zg_discovery/pins.c b/ports/stm/boards/stm32f412zg_discovery/pins.c new file mode 100644 index 0000000000..ab90b04558 --- /dev/null +++ b/ports/stm/boards/stm32f412zg_discovery/pins.c @@ -0,0 +1,94 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PF10) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, //USART6 TX + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, //USART6 RX + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC05) }, //alt PB09, see F401ZG-DISCO manual + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, //alt PB10, see F401ZG-DISCO manual + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE03) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..f1b4013485 --- /dev/null +++ b/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h @@ -0,0 +1,438 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f4_discovery/board.c b/ports/stm/boards/stm32f4_discovery/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/stm32f4_discovery/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h new file mode 100644 index 0000000000..fcd7aa09cd --- /dev/null +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "STM32F4_DISCO" +#define MICROPY_HW_MCU_NAME "STM32F407VG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk new file mode 100644 index 0000000000..312a20f65a --- /dev/null +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x239A +USB_PID = 0x808A +USB_PRODUCT = "STM32F407VG Discovery Board - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +# This is technically a F407 but there's no difference +# other than the camera and ethernet, which aren't supported. +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f407xx +MCU_PACKAGE = 100 +CMSIS_MCU = STM32F407xx +LD_FILE = boards/STM32F407_fs.ld + diff --git a/ports/stm/boards/stm32f4_discovery/pins.c b/ports/stm/boards/stm32f4_discovery/pins.c new file mode 100644 index 0000000000..712932145a --- /dev/null +++ b/ports/stm/boards/stm32f4_discovery/pins.c @@ -0,0 +1,107 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + //P1 + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, // Differs from F411 + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + //P2 + { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + //ST LED names + { MP_ROM_QSTR(MP_QSTR_LD3), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LD4), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LD5), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LD6), MP_ROM_PTR(&pin_PD15) }, + //more useful LED names + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PD15) }, + //AnalogIO names + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + //actual LED names + { MP_ROM_QSTR(MP_QSTR_LED_ORANGE), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PD15) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..ee5832d49c --- /dev/null +++ b/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h @@ -0,0 +1,439 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c new file mode 100644 index 0000000000..1d1b308b66 --- /dev/null +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -0,0 +1,129 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/analogio/AnalogIn.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "common-hal/microcontroller/Pin.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4xx_ll_gpio.h" +#include "stm32f4xx_ll_adc.h" +#include "stm32f4xx_ll_bus.h" + +void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, + const mcu_pin_obj_t *pin) { + + // No ADC function on pin + if (pin->adc_unit == 0x00) { + mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + } + // TODO: add ADC traits to structure? + + // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only + // for dual conversion. For this basic application it is never used. + LL_GPIO_SetPinMode(pin_port(pin->port), (uint32_t)pin_mask(pin->number), LL_GPIO_MODE_ANALOG); + if (pin->adc_unit & 0x01) { + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); + } else if (pin->adc_unit == 0x04) { + #ifdef LL_APB2_GRP1_PERIPH_ADC3 + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); + #endif + } else { + mp_raise_ValueError(translate("Invalid ADC Unit value")); + } + claim_pin(pin); + self->pin = pin; +} + +bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { + return self->pin == NULL; +} + +void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { + if (common_hal_analogio_analogin_deinited(self)) { + return; + } + reset_pin_number(self->pin->port,self->pin->number); + self->pin = NULL; +} + +uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { + // Something else might have used the ADC in a different way, + // so we completely re-initialize it. + ADC_TypeDef * ADCx; + + if(self->pin->adc_unit & 0x01) { + ADCx = ADC1; + } else if (self->pin->adc_unit == 0x04) { + #ifdef ADC3 + ADCx = ADC3; + #endif + } else { + mp_raise_ValueError(translate("Invalid ADC Unit value")); + } + + LL_GPIO_SetPinMode(pin_port(self->pin->port), (uint32_t)pin_mask(self->pin->number), LL_GPIO_MODE_ANALOG); + //LL_GPIO_PIN_0 + + //HAL Implementation + ADC_HandleTypeDef AdcHandle; + ADC_ChannelConfTypeDef sConfig; + + AdcHandle.Instance = ADCx; + AdcHandle.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; + AdcHandle.Init.Resolution = ADC_RESOLUTION_12B; + AdcHandle.Init.ScanConvMode = DISABLE; + AdcHandle.Init.ContinuousConvMode = DISABLE; + AdcHandle.Init.DiscontinuousConvMode = DISABLE; + AdcHandle.Init.NbrOfDiscConversion = 0; + AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; + AdcHandle.Init.ExternalTrigConv = ADC_SOFTWARE_START; + AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT; + AdcHandle.Init.NbrOfConversion = 1; + AdcHandle.Init.DMAContinuousRequests = DISABLE; + AdcHandle.Init.EOCSelection = ADC_EOC_SINGLE_CONV; + HAL_ADC_Init(&AdcHandle); + + sConfig.Channel = (uint32_t)self->pin->adc_channel; //ADC_CHANNEL_0 <-normal iteration, not mask + sConfig.Rank = 1; + sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES; //Taken from micropython + HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); + + HAL_ADC_Start(&AdcHandle); + HAL_ADC_PollForConversion(&AdcHandle,1); + uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); + HAL_ADC_Stop(&AdcHandle); + + // // Shift the value to be 16 bit. + return value << 4; +} + +float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { + return 3.3f; +} diff --git a/ports/stm/common-hal/analogio/AnalogIn.h b/ports/stm/common-hal/analogio/AnalogIn.h new file mode 100644 index 0000000000..910092897e --- /dev/null +++ b/ports/stm/common-hal/analogio/AnalogIn.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t * pin; +} analogio_analogin_obj_t; + +static inline uint8_t stm32_adc_units(uint8_t adc_packed) { + return adc_packed >> 5; +} + +static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { + return adc_packed & 0x1f; +} + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c new file mode 100644 index 0000000000..2ea969f503 --- /dev/null +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -0,0 +1,124 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019, Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/analogio/AnalogOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate.h" + +#include "common-hal/microcontroller/Pin.h" + +#include "stm32f4xx_hal.h" + +//DAC is shared between both channels. +#if HAS_DAC +DAC_HandleTypeDef handle; +#endif + +STATIC bool dac_on[2]; + +void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, + const mcu_pin_obj_t *pin) { + #if !(HAS_DAC) + mp_raise_ValueError(translate("No DAC on chip")); + #else + if (pin == &pin_PA04) { + self->channel = DAC_CHANNEL_1; + self->dac_index = 0; + } else if (pin == &pin_PA05) { + self->channel = DAC_CHANNEL_2; + self->dac_index = 1; + } else { + mp_raise_ValueError(translate("Invalid DAC pin supplied")); + } + + //Only init if the shared DAC is empty or reset + if (handle.Instance == NULL || handle.State == HAL_DAC_STATE_RESET) { + __HAL_RCC_DAC_CLK_ENABLE(); + handle.Instance = DAC; + if (HAL_DAC_Init(&handle) != HAL_OK) + { + mp_raise_ValueError(translate("DAC Device Init Error")); + } + } + + //init channel specific pin + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); + + self->ch_handle.DAC_Trigger = DAC_TRIGGER_NONE; + self->ch_handle.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; + if (HAL_DAC_ConfigChannel(&handle, &self->ch_handle, self->channel) != HAL_OK) { + mp_raise_ValueError(translate("DAC Channel Init Error")); + } + + dac_on[self->dac_index] = true; + self->pin = pin; + claim_pin(pin); + #endif +} + +bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { + return !dac_on[self->dac_index]; +} + +void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { + #if HAS_DAC + reset_pin_number(self->pin->port,self->pin->number); + self->pin = NULL; + dac_on[self->dac_index] = false; + + //turn off the DAC if both channels are off + if(dac_on[0] == false && dac_on[1] == false) { + __HAL_RCC_DAC_CLK_DISABLE(); + HAL_DAC_DeInit(&handle); + } + #endif +} + +void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, + uint16_t value) { + #if HAS_DAC + HAL_DAC_SetValue(&handle, self->channel, DAC_ALIGN_12B_R, value >> 4); + HAL_DAC_Start(&handle, self->channel); + #endif +} + +void analogout_reset(void) { + #if HAS_DAC + __HAL_RCC_DAC_CLK_DISABLE(); + HAL_DAC_DeInit(&handle); + #endif +} diff --git a/ports/stm/common-hal/analogio/AnalogOut.h b/ports/stm/common-hal/analogio/AnalogOut.h new file mode 100644 index 0000000000..61591d0e65 --- /dev/null +++ b/ports/stm/common-hal/analogio/AnalogOut.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + +typedef struct { + mp_obj_base_t base; +#if HAS_DAC + DAC_ChannelConfTypeDef ch_handle; +#endif + const mcu_pin_obj_t * pin; + uint8_t channel; + uint8_t dac_index:1; +} analogio_analogout_obj_t; + +void analogout_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H diff --git a/ports/stm/common-hal/analogio/__init__.c b/ports/stm/common-hal/analogio/__init__.c new file mode 100644 index 0000000000..eea58c77d6 --- /dev/null +++ b/ports/stm/common-hal/analogio/__init__.c @@ -0,0 +1 @@ +// No analogio module functions. diff --git a/ports/stm/common-hal/board/__init__.c b/ports/stm/common-hal/board/__init__.c new file mode 100644 index 0000000000..880033ed67 --- /dev/null +++ b/ports/stm/common-hal/board/__init__.c @@ -0,0 +1,25 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c new file mode 100644 index 0000000000..8e98b966d2 --- /dev/null +++ b/ports/stm/common-hal/busio/I2C.c @@ -0,0 +1,250 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include + +#include "shared-bindings/busio/I2C.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "stm32f4xx_hal.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/translate.h" +#include "common-hal/microcontroller/Pin.h" + +//arrays use 0 based numbering: I2C1 is stored at index 0 +#define MAX_I2C 3 +STATIC bool reserved_i2c[MAX_I2C]; +STATIC bool never_reset_i2c[MAX_I2C]; + +#define ALL_CLOCKS 0xFF +STATIC void i2c_clock_enable(uint8_t mask); +STATIC void i2c_clock_disable(uint8_t mask); + +void i2c_reset(void) { + uint16_t never_reset_mask = 0x00; + for(int i = 0; i < MAX_I2C; i++) { + if (!never_reset_i2c[i]) { + reserved_i2c[i] = false; + } else { + never_reset_mask |= 1 << i; + } + } + i2c_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); +} + +void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, + const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { + + //match pins to I2C objects + I2C_TypeDef * I2Cx; + uint8_t sda_len = MP_ARRAY_SIZE(mcu_i2c_sda_list); + uint8_t scl_len = MP_ARRAY_SIZE(mcu_i2c_scl_list); + bool i2c_taken = false; + + for (uint i = 0; i < sda_len; i++) { + if (mcu_i2c_sda_list[i].pin == sda) { + for (uint j = 0; j < scl_len; j++) { + if ((mcu_i2c_scl_list[j].pin == scl) + && (mcu_i2c_scl_list[j].i2c_index == mcu_i2c_sda_list[i].i2c_index)) { + //keep looking if the I2C is taken, could be another SCL that works + if (reserved_i2c[mcu_i2c_scl_list[i].i2c_index - 1]) { + i2c_taken = true; + continue; + } + self->scl = &mcu_i2c_scl_list[j]; + self->sda = &mcu_i2c_sda_list[i]; + break; + } + } + } + } + + //handle typedef selection, errors + if (self->sda != NULL && self->scl != NULL ) { + I2Cx = mcu_i2c_banks[self->sda->i2c_index - 1]; + } else { + if (i2c_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid I2C pin selection")); + } + } + + //Start GPIO for each pin + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(sda->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = self->sda->altfn_index; + HAL_GPIO_Init(pin_port(sda->port), &GPIO_InitStruct); + + GPIO_InitStruct.Pin = pin_mask(scl->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = self->scl->altfn_index; + HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); + + //Note: due to I2C soft reboot issue, do not relocate clock init. + i2c_clock_enable(1 << (self->sda->i2c_index - 1)); + reserved_i2c[self->sda->i2c_index - 1] = true; + + self->handle.Instance = I2Cx; + self->handle.Init.ClockSpeed = 100000; + self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; + self->handle.Init.OwnAddress1 = 0; + self->handle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; + self->handle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; + self->handle.Init.OwnAddress2 = 0; + self->handle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; + self->handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; + self->handle.State = HAL_I2C_STATE_RESET; + if (HAL_I2C_Init(&(self->handle)) != HAL_OK) { + mp_raise_RuntimeError(translate("I2C Init Error")); + } + claim_pin(sda); + claim_pin(scl); +} + +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_i2c_banks); i++) { + if (self->handle.Instance == mcu_i2c_banks[i]) { + never_reset_i2c[i] = true; + + never_reset_pin_number(self->scl->pin->port, self->scl->pin->number); + never_reset_pin_number(self->sda->pin->port, self->sda->pin->number); + break; + } + } +} + +bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { + return self->sda == NULL; +} + +void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { + if (common_hal_busio_i2c_deinited(self)) { + return; + } + + i2c_clock_disable(1 << (self->sda->i2c_index - 1)); + reserved_i2c[self->sda->i2c_index - 1] = false; + never_reset_i2c[self->sda->i2c_index - 1] = false; + + reset_pin_number(self->sda->pin->port,self->sda->pin->number); + reset_pin_number(self->scl->pin->port,self->scl->pin->number); + self->sda = NULL; + self->scl = NULL; +} + +bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { + return HAL_I2C_IsDeviceReady(&(self->handle), (uint16_t)(addr << 1), 2, 2) == HAL_OK; +} + +bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { + bool grabbed_lock = false; + + //Critical section code that may be required at some point. + // uint32_t store_primask = __get_PRIMASK(); + // __disable_irq(); + // __DMB(); + + if (!self->has_lock) { + grabbed_lock = true; + self->has_lock = true; + } + + // __DMB(); + // __set_PRIMASK(store_primask); + + return grabbed_lock; +} + +bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { + self->has_lock = false; +} + +uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, + const uint8_t *data, size_t len, bool transmit_stop_bit) { + HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), + (uint8_t *)data, (uint16_t)len, 500); + return result == HAL_OK ? 0 : MP_EIO; +} + +uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, + uint8_t *data, size_t len) { + return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) + == HAL_OK ? 0 : MP_EIO; +} + +STATIC void i2c_clock_enable(uint8_t mask) { + //Note: hard reset required due to soft reboot issue. + #ifdef I2C1 + if (mask & (1 << 0)) { + __HAL_RCC_I2C1_CLK_ENABLE(); + __HAL_RCC_I2C1_FORCE_RESET(); + __HAL_RCC_I2C1_RELEASE_RESET(); + } + #endif + #ifdef I2C2 + if (mask & (1 << 1)) { + __HAL_RCC_I2C2_CLK_ENABLE(); + __HAL_RCC_I2C2_FORCE_RESET(); + __HAL_RCC_I2C2_RELEASE_RESET(); + } + #endif + #ifdef I2C3 + if (mask & (1 << 2)) { + __HAL_RCC_I2C3_CLK_ENABLE(); + __HAL_RCC_I2C3_FORCE_RESET(); + __HAL_RCC_I2C3_RELEASE_RESET(); + } + #endif +} + +STATIC void i2c_clock_disable(uint8_t mask) { + #ifdef I2C1 + if (mask & (1 << 0)) { + __HAL_RCC_I2C1_CLK_DISABLE(); + } + #endif + #ifdef I2C2 + if (mask & (1 << 1)) { + __HAL_RCC_I2C2_CLK_DISABLE(); + } + #endif + #ifdef I2C3 + if (mask & (1 << 2)) { + __HAL_RCC_I2C3_CLK_DISABLE(); + } + #endif +} diff --git a/ports/stm/common-hal/busio/I2C.h b/ports/stm/common-hal/busio/I2C.h new file mode 100644 index 0000000000..b5c891a98d --- /dev/null +++ b/ports/stm/common-hal/busio/I2C.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H + +#include "common-hal/microcontroller/Pin.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + I2C_HandleTypeDef handle; + bool has_lock; + const mcu_i2c_scl_obj_t *scl; + const mcu_i2c_sda_obj_t *sda; +} busio_i2c_obj_t; + +void i2c_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/stm/common-hal/busio/OneWire.h b/ports/stm/common-hal/busio/OneWire.h new file mode 100644 index 0000000000..6e8c829793 --- /dev/null +++ b/ports/stm/common-hal/busio/OneWire.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H + +// Use bitbangio. +#include "shared-module/busio/OneWire.h" + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c new file mode 100644 index 0000000000..7e25e0a571 --- /dev/null +++ b/ports/stm/common-hal/busio/SPI.c @@ -0,0 +1,470 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include + +#include "shared-bindings/busio/SPI.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "stm32f4xx_hal.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "boards/board.h" +#include "supervisor/shared/translate.h" +#include "common-hal/microcontroller/Pin.h" + +// Note that any bugs introduced in this file can cause crashes at startup +// for chips using external SPI flash. + +//arrays use 0 based numbering: SPI1 is stored at index 0 +#define MAX_SPI 6 +STATIC bool reserved_spi[MAX_SPI]; +STATIC bool never_reset_spi[MAX_SPI]; + +#define ALL_CLOCKS 0xFF +STATIC void spi_clock_enable(uint8_t mask); +STATIC void spi_clock_disable(uint8_t mask); + +STATIC uint32_t get_busclock(SPI_TypeDef * instance) { + //SPI2 and 3 are on PCLK1, if they exist. + #ifdef SPI2 + if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + #endif + #ifdef SPI3 + if (instance == SPI3) return HAL_RCC_GetPCLK1Freq(); + #endif + return HAL_RCC_GetPCLK2Freq(); +} + +STATIC uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler, uint32_t busclock) { + static const uint32_t baud_map[8][2] = { + {2,SPI_BAUDRATEPRESCALER_2}, + {4,SPI_BAUDRATEPRESCALER_4}, + {8,SPI_BAUDRATEPRESCALER_8}, + {16,SPI_BAUDRATEPRESCALER_16}, + {32,SPI_BAUDRATEPRESCALER_32}, + {64,SPI_BAUDRATEPRESCALER_64}, + {128,SPI_BAUDRATEPRESCALER_128}, + {256,SPI_BAUDRATEPRESCALER_256} + }; + size_t i = 0; + uint16_t divisor; + do { + divisor = baud_map[i][0]; + if (baudrate >= (busclock/divisor)) { + *prescaler = divisor; + return baud_map[i][1]; + } + i++; + } while (divisor != 256); + //only gets here if requested baud is lower than minimum + *prescaler = 256; + return SPI_BAUDRATEPRESCALER_256; +} + +void spi_reset(void) { + uint16_t never_reset_mask = 0x00; + for (int i = 0; i < MAX_SPI; i++) { + if (!never_reset_spi[i]) { + reserved_spi[i] = false; + } else { + never_reset_mask |= 1 << i; + } + } + spi_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); +} + +void common_hal_busio_spi_construct(busio_spi_obj_t *self, + const mcu_pin_obj_t * sck, const mcu_pin_obj_t * mosi, + const mcu_pin_obj_t * miso) { + + //match pins to SPI objects + SPI_TypeDef * SPIx; + + uint8_t sck_len = MP_ARRAY_SIZE(mcu_spi_sck_list); + uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); + uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); + bool spi_taken = false; + + //SCK is not optional. MOSI and MISO are + for (uint i = 0; i < sck_len; i++) { + if (mcu_spi_sck_list[i].pin == sck) { + //if both MOSI and MISO exist, loop search normally + if ((mosi != NULL) && (miso != NULL)) { + //MOSI + for (uint j = 0; j < mosi_len; j++) { + if (mcu_spi_mosi_list[j].pin == mosi) { + //MISO + for (uint k = 0; k < miso_len; k++) { + if ((mcu_spi_miso_list[k].pin == miso) //everything needs the same index + && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index) + && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[k].spi_index)) { + //keep looking if the SPI is taken, edge case + if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + spi_taken = true; + continue; + } + //store pins if not + self->sck = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = &mcu_spi_miso_list[k]; + break; + } + } + } + } + // if just MISO, reduce search + } else if (miso != NULL) { + for (uint j = 0; j < miso_len; j++) { + if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index + && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) { + //keep looking if the SPI is taken, edge case + if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + spi_taken = true; + continue; + } + //store pins if not + self->sck = &mcu_spi_sck_list[i]; + self->mosi = NULL; + self->miso = &mcu_spi_miso_list[j]; + break; + } + } + // if just MOSI, reduce search + } else if (mosi != NULL) { + for (uint j = 0; j < mosi_len; j++) { + if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index + && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) { + //keep looking if the SPI is taken, edge case + if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + spi_taken = true; + continue; + } + //store pins if not + self->sck = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = NULL; + break; + } + } + } else { + //throw an error immediately + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); + } + } + } + + //handle typedef selection, errors + if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || + (self->sck != NULL && self->mosi != NULL && miso == NULL) || + (self->sck != NULL && self->miso != NULL && mosi == NULL)) { + SPIx = mcu_spi_banks[self->sck->spi_index - 1]; + } else { + if (spi_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid SPI pin selection")); + } + } + + //Start GPIO for each pin + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(sck->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->sck->altfn_index; + HAL_GPIO_Init(pin_port(sck->port), &GPIO_InitStruct); + + if (self->mosi != NULL) { + GPIO_InitStruct.Pin = pin_mask(mosi->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->mosi->altfn_index; + HAL_GPIO_Init(pin_port(mosi->port), &GPIO_InitStruct); + } + + if (self->miso != NULL) { + GPIO_InitStruct.Pin = pin_mask(miso->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->miso->altfn_index; + HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); + } + + spi_clock_enable(1 << (self->sck->spi_index - 1)); + reserved_spi[self->sck->spi_index - 1] = true; + + self->handle.Instance = SPIx; + self->handle.Init.Mode = SPI_MODE_MASTER; + // Direction change only required for RX-only, see RefMan RM0090:884 + self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES; + self->handle.Init.DataSize = SPI_DATASIZE_8BIT; + self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; + self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; + self->handle.Init.NSS = SPI_NSS_SOFT; + self->handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; + self->handle.Init.FirstBit = SPI_FIRSTBIT_MSB; + self->handle.Init.TIMode = SPI_TIMODE_DISABLE; + self->handle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + self->handle.Init.CRCPolynomial = 10; + if (HAL_SPI_Init(&self->handle) != HAL_OK) + { + mp_raise_ValueError(translate("SPI Init Error")); + } + self->baudrate = (get_busclock(SPIx) / 16); + self->prescaler = 16; + self->polarity = 0; + self->phase = 0; + self->bits = 8; + + claim_pin(sck); + if (self->mosi != NULL) { + claim_pin(mosi); + } + if (self->miso != NULL) { + claim_pin(miso); + } +} + +void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { + for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { + if (mcu_spi_banks[i] == self->handle.Instance) { + never_reset_spi[i] = true; + never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); + if (self->mosi != NULL) { + never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); + } + if (self->miso != NULL) { + never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); + } + break; + } + } +} + +bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { + return self->sck->pin == NULL; +} + +void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { + if (common_hal_busio_spi_deinited(self)) { + return; + } + spi_clock_disable(1<<(self->sck->spi_index - 1)); + reserved_spi[self->sck->spi_index - 1] = false; + never_reset_spi[self->sck->spi_index - 1] = false; + + reset_pin_number(self->sck->pin->port,self->sck->pin->number); + if (self->mosi != NULL) { + reset_pin_number(self->mosi->pin->port,self->mosi->pin->number); + } + if (self->miso != NULL) { + reset_pin_number(self->miso->pin->port,self->miso->pin->number); + } + self->sck = NULL; + self->mosi = NULL; + self->miso = NULL; +} + +bool common_hal_busio_spi_configure(busio_spi_obj_t *self, + uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { + //This resets the SPI, so check before updating it redundantly + if (baudrate == self->baudrate && polarity== self->polarity + && phase == self->phase && bits == self->bits) { + return true; + } + + //Deinit SPI + HAL_SPI_DeInit(&self->handle); + + self->handle.Init.DataSize = (bits == 16) ? SPI_DATASIZE_16BIT : SPI_DATASIZE_8BIT; + self->handle.Init.CLKPolarity = (polarity) ? SPI_POLARITY_HIGH : SPI_POLARITY_LOW; + self->handle.Init.CLKPhase = (phase) ? SPI_PHASE_2EDGE : SPI_PHASE_1EDGE; + + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, + get_busclock(self->handle.Instance)); + + if (HAL_SPI_Init(&self->handle) != HAL_OK) + { + mp_raise_ValueError(translate("SPI Re-initialization error")); + } + + self->baudrate = baudrate; + self->polarity = polarity; + self->phase = phase; + self->bits = bits; + return true; +} + +bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { + bool grabbed_lock = false; + + //Critical section code that may be required at some point. + // uint32_t store_primask = __get_PRIMASK(); + // __disable_irq(); + // __DMB(); + + if (!self->has_lock) { + grabbed_lock = true; + self->has_lock = true; + } + + // __DMB(); + // __set_PRIMASK(store_primask); + + return grabbed_lock; +} + +bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { + self->has_lock = false; +} + +bool common_hal_busio_spi_write(busio_spi_obj_t *self, + const uint8_t *data, size_t len) { + if (self->mosi == NULL) { + mp_raise_ValueError(translate("No MOSI Pin")); + } + HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); + return result == HAL_OK; +} + +bool common_hal_busio_spi_read(busio_spi_obj_t *self, + uint8_t *data, size_t len, uint8_t write_value) { + if (self->miso == NULL) { + mp_raise_ValueError(translate("No MISO Pin")); + } + HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY); + return result == HAL_OK; +} + +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, + uint8_t *data_out, uint8_t *data_in, size_t len) { + if (self->miso == NULL || self->mosi == NULL) { + mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); + } + HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle, + data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); + return result == HAL_OK; +} + +uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { + //returns actual frequency + uint32_t result = HAL_RCC_GetPCLK2Freq()/self->prescaler; + return result; +} + +uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { + return self->phase; +} + +uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { + return self->polarity; +} + +STATIC void spi_clock_enable(uint8_t mask) { + #ifdef SPI1 + if (mask & (1 << 0)) { + __HAL_RCC_SPI1_CLK_ENABLE(); + } + #endif + #ifdef SPI2 + if (mask & (1 << 1)) { + __HAL_RCC_SPI2_CLK_ENABLE(); + } + #endif + #ifdef SPI3 + if (mask & (1 << 2)) { + __HAL_RCC_SPI3_CLK_ENABLE(); + } + #endif + #ifdef SPI4 + if (mask & (1 << 3)) { + __HAL_RCC_SPI4_CLK_ENABLE(); + } + #endif + #ifdef SPI5 + if (mask & (1 << 4)) { + __HAL_RCC_SPI5_CLK_ENABLE(); + } + #endif + #ifdef SPI6 + if (mask & (1 << 5)) { + __HAL_RCC_SPI6_CLK_ENABLE(); + } + #endif +} + +STATIC void spi_clock_disable(uint8_t mask) { + #ifdef SPI1 + if (mask & (1 << 0)) { + __HAL_RCC_SPI1_CLK_DISABLE(); + __HAL_RCC_SPI1_FORCE_RESET(); + __HAL_RCC_SPI1_RELEASE_RESET(); + } + #endif + #ifdef SPI2 + if (mask & (1 << 1)) { + __HAL_RCC_SPI2_CLK_DISABLE(); + __HAL_RCC_SPI2_FORCE_RESET(); + __HAL_RCC_SPI2_RELEASE_RESET(); + } + #endif + #ifdef SPI3 + if (mask & (1 << 2)) { + __HAL_RCC_SPI3_CLK_DISABLE(); + __HAL_RCC_SPI3_FORCE_RESET(); + __HAL_RCC_SPI3_RELEASE_RESET(); + } + #endif + #ifdef SPI4 + if (mask & (1 << 3)) { + __HAL_RCC_SPI4_CLK_DISABLE(); + __HAL_RCC_SPI4_FORCE_RESET(); + __HAL_RCC_SPI4_RELEASE_RESET(); + } + #endif + #ifdef SPI5 + if (mask & (1 << 4)) { + __HAL_RCC_SPI5_CLK_DISABLE(); + __HAL_RCC_SPI5_FORCE_RESET(); + __HAL_RCC_SPI5_RELEASE_RESET(); + } + #endif + #ifdef SPI6 + if (mask & (1 << 5)) { + __HAL_RCC_SPI6_CLK_DISABLE(); + __HAL_RCC_SPI6_FORCE_RESET(); + __HAL_RCC_SPI6_RELEASE_RESET(); + } + #endif +} diff --git a/ports/stm/common-hal/busio/SPI.h b/ports/stm/common-hal/busio/SPI.h new file mode 100644 index 0000000000..067d2fcb65 --- /dev/null +++ b/ports/stm/common-hal/busio/SPI.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H + +#include "common-hal/microcontroller/Pin.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + SPI_HandleTypeDef handle; + bool has_lock; + const mcu_spi_sck_obj_t *sck; + const mcu_spi_mosi_obj_t *mosi; + const mcu_spi_miso_obj_t *miso; + const mcu_spi_nss_obj_t *nss; + uint32_t baudrate; + uint16_t prescaler; + uint8_t polarity; + uint8_t phase; + uint8_t bits; +} busio_spi_obj_t; + +void spi_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c new file mode 100644 index 0000000000..0b434fd023 --- /dev/null +++ b/ports/stm/common-hal/busio/UART.c @@ -0,0 +1,626 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/busio/UART.h" + +#include "mpconfigport.h" +#include "lib/utils/interrupt_char.h" +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "supervisor/shared/translate.h" + +#include "tick.h" +#include "stm32f4xx_hal.h" + +#define ALL_UARTS 0xFFFF + +//arrays use 0 based numbering: UART1 is stored at index 0 +STATIC bool reserved_uart[MAX_UART]; +int errflag; //Used to restart read halts + +STATIC void uart_clock_enable(uint16_t mask); +STATIC void uart_clock_disable(uint16_t mask); +STATIC void uart_assign_irq(busio_uart_obj_t* self, USART_TypeDef* USARTx); + +STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, + int uart_index, bool uart_taken) { + if (pin_eval) { + //assign a root pointer pointer for IRQ + MP_STATE_PORT(cpy_uart_obj_all)[uart_index] = self; + return mcu_uart_banks[uart_index]; + } else { + if (uart_taken) { + mp_raise_ValueError(translate("Hardware in use, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } + } +} + +void uart_reset(void) { + for (uint8_t i = 0; i < MAX_UART; i++) { + reserved_uart[i] = false; + MP_STATE_PORT(cpy_uart_obj_all)[i] = NULL; + } + uart_clock_disable(ALL_UARTS); +} + +void common_hal_busio_uart_construct(busio_uart_obj_t *self, + const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, + const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, + const mcu_pin_obj_t * rs485_dir, bool rs485_invert, + uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + mp_float_t timeout, uint16_t receiver_buffer_size) { + + //match pins to UART objects + USART_TypeDef * USARTx; + + uint8_t tx_len = MP_ARRAY_SIZE(mcu_uart_tx_list); + uint8_t rx_len = MP_ARRAY_SIZE(mcu_uart_rx_list); + bool uart_taken = false; + uint8_t uart_index = 0; //origin 0 corrected + + if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { + mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + } + + //Can have both pins, or either + if ((tx != NULL) && (rx != NULL)) { + //normal find loop if both pins exist + for (uint i = 0; i < tx_len; i++) { + if (mcu_uart_tx_list[i].pin == tx) { + //rx + for (uint j = 0; j < rx_len; j++) { + if (mcu_uart_rx_list[j].pin == rx + && mcu_uart_rx_list[j].uart_index == mcu_uart_tx_list[i].uart_index) { + //keep looking if the UART is taken, edge case + if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { + uart_taken = true; + continue; + } + //store pins if not + self->tx = &mcu_uart_tx_list[i]; + self->rx = &mcu_uart_rx_list[j]; + break; + } + } + } + } + uart_index = self->tx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), + uart_index, uart_taken); + } else if (tx == NULL) { + //If there is no tx, run only rx + for (uint i = 0; i < rx_len; i++) { + if (mcu_uart_rx_list[i].pin == rx) { + //keep looking if the UART is taken, edge case + if (reserved_uart[mcu_uart_rx_list[i].uart_index - 1]) { + uart_taken = true; + continue; + } + //store pins if not + self->rx = &mcu_uart_rx_list[i]; + break; + } + } + uart_index = self->rx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->rx != NULL), + uart_index, uart_taken); + } else if (rx == NULL) { + //If there is no rx, run only tx + for (uint i = 0; i < tx_len; i++) { + if (mcu_uart_tx_list[i].pin == tx) { + //keep looking if the UART is taken, edge case + if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { + uart_taken = true; + continue; + } + //store pins if not + self->tx = &mcu_uart_tx_list[i]; + break; + } + } + uart_index = self->tx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->tx != NULL), + uart_index, uart_taken); + } else { + //both pins cannot be empty + mp_raise_ValueError(translate("Supply at least one UART pin")); + } + + //Other errors + if ( receiver_buffer_size == 0 ) { + mp_raise_ValueError(translate("Invalid buffer size")); + } + if ( bits != 8 && bits != 9 ) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } + if ( USARTx == NULL) { //this can only be hit if the periph file is wrong + mp_raise_ValueError(translate("Internal define error")); + } + + //GPIO Init + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if (self->tx != NULL) { + GPIO_InitStruct.Pin = pin_mask(tx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->tx->altfn_index; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + } + if (self->rx != NULL) { + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + } + + //reserve uart and enable the peripheral + reserved_uart[uart_index] = true; + uart_clock_enable(1 << (uart_index)); + uart_assign_irq(self, USARTx); + + self->handle.Instance = USARTx; + self->handle.Init.BaudRate = baudrate; + self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; + self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; + self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : + (parity == PARITY_EVEN) ? UART_PARITY_EVEN : + UART_PARITY_NONE; + self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : + (self->tx != NULL) ? UART_MODE_TX : + UART_MODE_RX; + self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; + self->handle.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&self->handle) != HAL_OK) + { + mp_raise_ValueError(translate("UART Init Error")); + + } + + // Init buffer for rx and claim pins + if (self->rx != NULL) { + ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); + if (!self->rbuf.buf) { + mp_raise_ValueError(translate("UART Buffer allocation error")); + } + claim_pin(rx); + } + if (self->tx != NULL) { + claim_pin(tx); + } + self->baudrate = baudrate; + self->timeout_ms = timeout * 1000; + + //start the interrupt series + if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { + mp_raise_ValueError(translate("Could not start interrupt, RX busy")); + } + + //start the receive interrupt chain + HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention + HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); + HAL_NVIC_EnableIRQ(self->irq); + + errflag = HAL_OK; +} + +bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { + return self->tx->pin == NULL; +} + +void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + if (common_hal_busio_uart_deinited(self)) return; + + reset_pin_number(self->tx->pin->port,self->tx->pin->number); + reset_pin_number(self->rx->pin->port,self->rx->pin->number); + self->tx = NULL; + self->rx = NULL; + gc_free(self->rbuf.buf); + self->rbuf.size = 0; + self->rbuf.iput = self->rbuf.iget = 0; +} + +size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (self->rx == NULL) { + mp_raise_ValueError(translate("No RX pin")); + } + + size_t rx_bytes = 0; + uint64_t start_ticks = supervisor_ticks_ms64(); + + // Wait for all bytes received or timeout, same as nrf + while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + RUN_BACKGROUND_TASKS; + //restart if it failed in the callback + if (errflag != HAL_OK) { + errflag = HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + } + // Allow user to break out of a timeout with a KeyboardInterrupt. + if ( mp_hal_is_interrupted() ) { + return 0; + } + } + + // Halt reception + HAL_NVIC_DisableIRQ(self->irq); + // copy received data + rx_bytes = ringbuf_count(&self->rbuf); + rx_bytes = MIN(rx_bytes, len); + for (uint16_t i = 0; i < rx_bytes; i++) { + data[i] = ringbuf_get(&self->rbuf); + } + HAL_NVIC_EnableIRQ(self->irq); + + if (rx_bytes == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } + return rx_bytes; +} + +// Write characters. +size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + if (self->tx == NULL) { + mp_raise_ValueError(translate("No TX pin")); + } + bool write_err = false; //write error shouldn't disable interrupts + + HAL_NVIC_DisableIRQ(self->irq); + if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, HAL_MAX_DELAY) != HAL_OK) { + write_err = true; + } + HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + HAL_NVIC_EnableIRQ(self->irq); + + if (write_err) { + mp_raise_ValueError(translate("UART write error")); + } + return len; +} + +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) +{ + for (int i = 0; i < 7; i++) { + //get context pointer and cast it as struct pointer + busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[i]; + if (handle == &context->handle) { + //check if transaction is ongoing + if ((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { + return; + } + ringbuf_put_n(&context->rbuf, &context->rx_char, 1); + errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); + + return; + } + } +} + +void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) +{ + if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_PE) != RESET) { + __HAL_UART_CLEAR_PEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_FE) != RESET) { + __HAL_UART_CLEAR_FEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_NE) != RESET) { + __HAL_UART_CLEAR_NEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_ORE) != RESET) { + __HAL_UART_CLEAR_OREFLAG(UartHandle); + } + //restart serial read after an error + for (int i = 0; i < 7; i++) { + busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; + if (UartHandle == &context->handle) { + HAL_UART_Receive_IT(UartHandle, &context->rx_char, 1); + return; + } + } + +} + +uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { + return self->baudrate; +} + +void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { + //Don't reset if it's the same value + if (baudrate == self->baudrate) return; + + //Otherwise de-init and set new rate + if (HAL_UART_DeInit(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("UART De-init error")); + } + self->handle.Init.BaudRate = baudrate; + if (HAL_UART_Init(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("UART Re-init error")); + } + + self->baudrate = baudrate; +} + +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + +uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { + return ringbuf_count(&self->rbuf); +} + +void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + // Halt reception + HAL_NVIC_DisableIRQ(self->irq); + ringbuf_clear(&self->rbuf); + HAL_NVIC_EnableIRQ(self->irq); +} + +bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { + return __HAL_UART_GET_FLAG(&self->handle, UART_FLAG_TXE); +} + +STATIC void call_hal_irq(int uart_num) { + //Create casted context pointer + busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[uart_num - 1]; + if (context != NULL) { + HAL_NVIC_ClearPendingIRQ(context->irq); + HAL_UART_IRQHandler(&context->handle); + } +} + +// UART/USART IRQ handlers +void USART1_IRQHandler(void) { + call_hal_irq(1); +} + +void USART2_IRQHandler(void) { + call_hal_irq(2); +} + +void USART3_IRQHandler(void) { + call_hal_irq(3); +} + +void UART4_IRQHandler(void) { + call_hal_irq(4); +} + +void UART5_IRQHandler(void) { + call_hal_irq(5); +} + +void USART6_IRQHandler(void) { + call_hal_irq(6); +} + +STATIC void uart_clock_enable(uint16_t mask) { + #ifdef USART1 + if (mask & (1 << 0)) { + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); + __HAL_RCC_USART1_CLK_ENABLE(); + } + #endif + #ifdef USART2 + if (mask & (1 << 1)) { + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); + __HAL_RCC_USART2_CLK_ENABLE(); + } + #endif + #ifdef USART3 + if (mask & (1 << 2)) { + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); + __HAL_RCC_USART3_CLK_ENABLE(); + } + #endif + #ifdef UART4 + if (mask & (1 << 3)) { + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); + __HAL_RCC_UART4_CLK_ENABLE(); + } + #endif + #ifdef UART5 + if (mask & (1 << 4)) { + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); + __HAL_RCC_UART5_CLK_ENABLE(); + } + #endif + #ifdef USART6 + if (mask & (1 << 5)) { + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); + __HAL_RCC_USART6_CLK_ENABLE(); + } + #endif + #ifdef UART7 + if (mask & (1 << 6)) { + __HAL_RCC_UART7_FORCE_RESET(); + __HAL_RCC_UART7_RELEASE_RESET(); + __HAL_RCC_UART7_CLK_ENABLE(); + } + #endif + #ifdef UART8 + if (mask & (1 << 7)) { + __HAL_RCC_UART8_FORCE_RESET(); + __HAL_RCC_UART8_RELEASE_RESET(); + __HAL_RCC_UART8_CLK_ENABLE(); + } + #endif + #ifdef UART9 + if (mask & (1 << 8)) { + __HAL_RCC_UART9_FORCE_RESET(); + __HAL_RCC_UART9_RELEASE_RESET(); + __HAL_RCC_UART9_CLK_ENABLE(); + } + #endif + #ifdef UART10 + if (mask & (1 << 9)) { + __HAL_RCC_UART10_FORCE_RESET(); + __HAL_RCC_UART10_RELEASE_RESET(); + __HAL_RCC_UART10_CLK_ENABLE(); + } + #endif +} + +STATIC void uart_clock_disable(uint16_t mask) { + #ifdef USART1 + if (mask & (1 << 0)) { + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); + __HAL_RCC_USART1_CLK_DISABLE(); + } + #endif + #ifdef USART2 + if (mask & (1 << 1)) { + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); + __HAL_RCC_USART2_CLK_DISABLE(); + } + #endif + #ifdef USART3 + if (mask & (1 << 2)) { + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); + __HAL_RCC_USART3_CLK_DISABLE(); + } + #endif + #ifdef UART4 + if (mask & (1 << 3)) { + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); + __HAL_RCC_UART4_CLK_DISABLE(); + } + #endif + #ifdef UART5 + if (mask & (1 << 4)) { + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); + __HAL_RCC_UART5_CLK_DISABLE(); + } + #endif + #ifdef USART6 + if (mask & (1 << 5)) { + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); + __HAL_RCC_USART6_CLK_DISABLE(); + } + #endif + #ifdef UART7 + if (mask & (1 << 6)) { + __HAL_RCC_UART7_FORCE_RESET(); + __HAL_RCC_UART7_RELEASE_RESET(); + __HAL_RCC_UART7_CLK_DISABLE(); + } + #endif + #ifdef UART8 + if (mask & (1 << 7)) { + __HAL_RCC_UART8_FORCE_RESET(); + __HAL_RCC_UART8_RELEASE_RESET(); + __HAL_RCC_UART8_CLK_DISABLE(); + } + #endif + #ifdef UART9 + if (mask & (1 << 8)) { + __HAL_RCC_UART9_FORCE_RESET(); + __HAL_RCC_UART9_RELEASE_RESET(); + __HAL_RCC_UART9_CLK_DISABLE(); + } + #endif + #ifdef UART10 + if (mask & (1 << 9)) { + __HAL_RCC_UART10_FORCE_RESET(); + __HAL_RCC_UART10_RELEASE_RESET(); + __HAL_RCC_UART10_CLK_DISABLE(); + } + #endif +} + +STATIC void uart_assign_irq(busio_uart_obj_t *self, USART_TypeDef * USARTx) { + #ifdef USART1 + if (USARTx == USART1) { + self->irq = USART1_IRQn; + } + #endif + #ifdef USART2 + if (USARTx == USART2) { + self->irq = USART2_IRQn; + } + #endif + #ifdef USART3 + if (USARTx == USART3) { + self->irq = USART3_IRQn; + } + #endif + #ifdef UART4 + if (USARTx == UART4) { + self->irq = UART4_IRQn; + } + #endif + #ifdef UART5 + if (USARTx == UART5) { + self->irq = UART5_IRQn; + } + #endif + #ifdef USART6 + if (USARTx == USART6) { + self->irq = USART6_IRQn; + } + #endif + #ifdef UART7 + if (USARTx == UART7) { + self->irq = UART7_IRQn; + } + #endif + #ifdef UART8 + if (USARTx == UART8) { + self->irq = UART8_IRQn; + } + #endif + #ifdef UART9 + if (USARTx == UART9) { + self->irq = UART9_IRQn; + } + #endif + #ifdef UART10 + if (USARTx == UART10) { + self->irq = UART10_IRQn; + } + #endif +} diff --git a/ports/stm/common-hal/busio/UART.h b/ports/stm/common-hal/busio/UART.h new file mode 100644 index 0000000000..cde5fadd00 --- /dev/null +++ b/ports/stm/common-hal/busio/UART.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H + +#include "common-hal/microcontroller/Pin.h" +#include "stm32f4/periph.h" +#include "stm32f4xx_hal.h" + +#include "py/obj.h" +#include "py/ringbuf.h" + +#ifndef UART_IRQPRI +#define UART_IRQPRI 1 +#endif +#ifndef UART_IRQSUB_PRI +#define UART_IRQSUB_PRI 0 +#endif + +typedef struct { + mp_obj_base_t base; + UART_HandleTypeDef handle; + IRQn_Type irq; + const mcu_uart_tx_obj_t *tx; + const mcu_uart_rx_obj_t *rx; + + ringbuf_t rbuf; + uint8_t rx_char; + + uint32_t baudrate; + uint32_t timeout_ms; +} busio_uart_obj_t; + +void uart_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm/common-hal/busio/__init__.c b/ports/stm/common-hal/busio/__init__.c new file mode 100644 index 0000000000..41761b6743 --- /dev/null +++ b/ports/stm/common-hal/busio/__init__.c @@ -0,0 +1 @@ +// No busio module functions. diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c new file mode 100644 index 0000000000..be2db4dace --- /dev/null +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -0,0 +1,160 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4xx_ll_gpio.h" + +void common_hal_digitalio_digitalinout_never_reset( + digitalio_digitalinout_obj_t *self) { + never_reset_pin_number(self->pin->port, self->pin->number); +} + +digitalinout_result_t common_hal_digitalio_digitalinout_construct( + digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { + + claim_pin(pin); + self->pin = pin; + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(self->pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); + + return DIGITALINOUT_OK; +} + +bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { + return self->pin == NULL; +} + +void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_deinited(self)) { + return; + } + + reset_pin_number(self->pin->port, self->pin->number); + self->pin = NULL; +} + +void common_hal_digitalio_digitalinout_switch_to_input( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(self->pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); + + common_hal_digitalio_digitalinout_set_pull(self, pull); +} + +void common_hal_digitalio_digitalinout_switch_to_output( + digitalio_digitalinout_obj_t *self, bool value, + digitalio_drive_mode_t drive_mode) { + + common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); + common_hal_digitalio_digitalinout_set_value(self, value); +} + +digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( + digitalio_digitalinout_obj_t *self) { + + return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) + == LL_GPIO_MODE_INPUT) ? DIRECTION_INPUT : DIRECTION_OUTPUT; +} + +void common_hal_digitalio_digitalinout_set_value( + digitalio_digitalinout_obj_t *self, bool value) { + HAL_GPIO_WritePin(pin_port(self->pin->port), pin_mask(self->pin->number), value); +} + +bool common_hal_digitalio_digitalinout_get_value( + digitalio_digitalinout_obj_t *self) { + return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_MODE_INPUT) + ? HAL_GPIO_ReadPin(pin_port(self->pin->port), pin_mask(self->pin->number)) + : LL_GPIO_IsOutputPinSet(pin_port(self->pin->port), pin_mask(self->pin->number)); +} + +void common_hal_digitalio_digitalinout_set_drive_mode( + digitalio_digitalinout_obj_t *self, + digitalio_drive_mode_t drive_mode) { + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(self->pin->number); + GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? + GPIO_MODE_OUTPUT_OD : GPIO_MODE_OUTPUT_PP); + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); +} + +digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( + digitalio_digitalinout_obj_t *self) { + + return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) + == LL_GPIO_OUTPUT_OPENDRAIN ? DRIVE_MODE_OPEN_DRAIN : DRIVE_MODE_PUSH_PULL; +} + +void common_hal_digitalio_digitalinout_set_pull( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + + switch (pull) { + case PULL_UP: + LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_UP); + break; + case PULL_DOWN: + LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_DOWN); + break; + case PULL_NONE: + LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_NO); + break; + default: + break; + } +} + +digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( + digitalio_digitalinout_obj_t *self) { + + + switch (LL_GPIO_GetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number))) { + case LL_GPIO_PULL_UP: + return PULL_UP; + case LL_GPIO_PULL_DOWN: + return PULL_DOWN; + case LL_GPIO_PULL_NO: + return PULL_NONE; + default: + return PULL_NONE; + } +} diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.h b/ports/stm/common-hal/digitalio/DigitalInOut.h new file mode 100644 index 0000000000..76aa2c8556 --- /dev/null +++ b/ports/stm/common-hal/digitalio/DigitalInOut.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin; +} digitalio_digitalinout_obj_t; + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/stm/common-hal/digitalio/__init__.c b/ports/stm/common-hal/digitalio/__init__.c new file mode 100644 index 0000000000..20fad45959 --- /dev/null +++ b/ports/stm/common-hal/digitalio/__init__.c @@ -0,0 +1 @@ +// No digitalio module functions. diff --git a/ports/stm/common-hal/displayio/ParallelBus.c b/ports/stm/common-hal/displayio/ParallelBus.c new file mode 100644 index 0000000000..1b808ec025 --- /dev/null +++ b/ports/stm/common-hal/displayio/ParallelBus.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/displayio/ParallelBus.h" + +#include + +#include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/__init__.h" + +#include "tick.h" + +void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, + const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, + const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { + + mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); +} + +void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t* self) { + +} + +bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { + + return false; +} + +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { + +} + +void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { + +} diff --git a/ports/stm/common-hal/displayio/ParallelBus.h b/ports/stm/common-hal/displayio/ParallelBus.h new file mode 100644 index 0000000000..85d100715e --- /dev/null +++ b/ports/stm/common-hal/displayio/ParallelBus.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H + +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; +} displayio_parallelbus_obj_t; + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c new file mode 100644 index 0000000000..1d4d45b978 --- /dev/null +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -0,0 +1,134 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "supervisor/shared/rgb_led_status.h" + +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4xx_hal.h" + +#ifdef MICROPY_HW_NEOPIXEL +bool neopixel_in_use; +#endif + +#if MCU_PACKAGE == 144 + #define GPIO_PORT_COUNT 7 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; +#elif MCU_PACKAGE == 100 + #define GPIO_PORT_COUNT 5 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; +#elif MCU_PACKAGE == 64 + #define GPIO_PORT_COUNT 3 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; +#elif MCU_PACKAGE == 48 + #define GPIO_PORT_COUNT 3 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; +#endif + + +STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; +STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; + +void reset_all_pins(void) { + // Reset claimed pins + for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { + claimed_pins[i] = never_reset_pins[i]; + } + for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { + HAL_GPIO_DeInit(ports[i], ~never_reset_pins[i]); + } + + #ifdef MICROPY_HW_NEOPIXEL + neopixel_in_use = false; + #endif +} + +// Mark pin as free and return it to a quiescent state. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if (pin_port == 0x0F) { + return; + } + // Clear claimed bit & reset + claimed_pins[pin_port] &= ~(1<port && pin_number == MICROPY_HW_NEOPIXEL->number) { + neopixel_in_use = false; + rgb_led_status_init(); + return; + } + #endif +} + +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + never_reset_pins[pin_port] |= 1<port, pin->number); +} + +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->port, pin->number); +} + +void claim_pin(const mcu_pin_obj_t* pin) { + // Set bit in claimed_pins bitmask. + claimed_pins[pin->port] |= 1<number; + + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + neopixel_in_use = true; + } + #endif +} + +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { + return !(claimed_pins[pin_port] & 1<port, pin->number); +} + +GPIO_TypeDef * pin_port(uint8_t pin_port) { + return ports[pin_port]; +} + +uint16_t pin_mask(uint8_t pin_number) { + return 1< +#include "common-hal/microcontroller/Processor.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "stm32f4xx_hal.h" + +#define STM32_UUID ((uint32_t *)0x1FFF7A10) + +//Factory calibration locations +#define ADC_CAL_ADDRESS (0x1fff7a2a) +#define ADC_CAL1 ((uint16_t*)(ADC_CAL_ADDRESS + 2)) +#define ADC_CAL2 ((uint16_t*)(ADC_CAL_ADDRESS + 4)) +#define VREFIN_CAL ((uint16_t *)ADC_CAL_ADDRESS) + +// correction factor for reference value +STATIC volatile float adc_refcor = 1.0f; + +STATIC void set_adc_params(ADC_HandleTypeDef *AdcHandle) { + AdcHandle->Instance = ADC1; + AdcHandle->Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; + AdcHandle->Init.Resolution = ADC_RESOLUTION_12B; + AdcHandle->Init.ScanConvMode = DISABLE; + AdcHandle->Init.ContinuousConvMode = DISABLE; + AdcHandle->Init.DiscontinuousConvMode = DISABLE; + AdcHandle->Init.NbrOfDiscConversion = 0; + AdcHandle->Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; + AdcHandle->Init.ExternalTrigConv = ADC_SOFTWARE_START; + AdcHandle->Init.DataAlign = ADC_DATAALIGN_RIGHT; + AdcHandle->Init.NbrOfConversion = 1; + AdcHandle->Init.DMAContinuousRequests = DISABLE; + AdcHandle->Init.EOCSelection = ADC_EOC_SINGLE_CONV; +} + +float common_hal_mcu_processor_get_temperature(void) { + __HAL_RCC_ADC1_CLK_ENABLE(); + + //HAL Implementation + ADC_HandleTypeDef AdcHandle; + ADC_ChannelConfTypeDef sConfig; + set_adc_params(&AdcHandle); + HAL_ADC_Init(&AdcHandle); + + ADC->CCR |= ADC_CCR_TSVREFE; + ADC->CCR &= ~ADC_CCR_VBATE; // If this somehow got turned on, it'll return bad values. + + sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; //either 16 or 18, depending on chip + sConfig.Rank = 1; + sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; // Temp sensor likes 10us minimum + HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); + + HAL_ADC_Start(&AdcHandle); + if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { + mp_raise_RuntimeError(translate("Temperature read timed out")); + } + uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); + HAL_ADC_Stop(&AdcHandle); + + //There's no F4 specific appnote for this but it works the same as the L1 in AN3964 + float core_temp_avg_slope = (*ADC_CAL2 - *ADC_CAL1) / 80.0; + return (((float)value * adc_refcor - *ADC_CAL1) / core_temp_avg_slope) + 30.0f; +} + +float common_hal_mcu_processor_get_voltage(void) { + __HAL_RCC_ADC1_CLK_ENABLE(); + + //HAL Implementation + ADC_HandleTypeDef AdcHandle; + ADC_ChannelConfTypeDef sConfig; + set_adc_params(&AdcHandle); + HAL_ADC_Init(&AdcHandle); + + ADC->CCR |= ADC_CCR_TSVREFE; + + sConfig.Channel = ADC_CHANNEL_VREFINT; + sConfig.Rank = 1; + sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; + HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); + + HAL_ADC_Start(&AdcHandle); + if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { + mp_raise_RuntimeError(translate("Voltage read timed out")); + } + uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); + HAL_ADC_Stop(&AdcHandle); + + //This value could be used to actively correct ADC values. + adc_refcor = ((float)(*VREFIN_CAL)) / ((float)value); + + return adc_refcor * 3.3f; +} + +uint32_t common_hal_mcu_processor_get_frequency(void) { + return SystemCoreClock; +} + +void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { + for (int i=0; i<3; i++) { + ((uint32_t*) raw_id)[i] = STM32_UUID[i]; + } +} diff --git a/ports/stm/common-hal/microcontroller/Processor.h b/ports/stm/common-hal/microcontroller/Processor.h new file mode 100644 index 0000000000..311333e7de --- /dev/null +++ b/ports/stm/common-hal/microcontroller/Processor.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H + +#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 12 + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} mcu_processor_obj_t; + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c new file mode 100644 index 0000000000..0c680eb055 --- /dev/null +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -0,0 +1,244 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/microcontroller/Processor.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Processor.h" + +#include "supervisor/filesystem.h" +#include "supervisor/shared/safe_mode.h" + +#include "stm32f4xx_hal.h" + +//tested divisor value for busy loop in us delay +#define LOOP_TICKS 12 + +STATIC uint32_t get_us(void) { + uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; + uint32_t micros, sys_cycles; + do { + micros = supervisor_ticks_ms32(); + sys_cycles = SysTick->VAL; //counts backwards + } while (micros != supervisor_ticks_ms32()); //try again if ticks_ms rolled over + return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; +} + +void common_hal_mcu_delay_us(uint32_t delay) { + if (__get_PRIMASK() == 0x00000000) { + //by default use ticks_ms + uint32_t start = get_us(); + while (get_us()-start < delay) { + __asm__ __volatile__("nop"); + } + } else { + //when SysTick is disabled, approximate with busy loop + const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; + for (uint32_t count = 0; ++count <= ucount;) { + } + } +} + +volatile uint32_t nesting_count = 0; + +void common_hal_mcu_disable_interrupts(void) { + __disable_irq(); + __DMB(); + nesting_count++; +} + +void common_hal_mcu_enable_interrupts(void) { + if (nesting_count == 0) { + // This is very very bad because it means there was mismatched disable/enables so we + // "HardFault". + asm("bkpt"); + } + nesting_count--; + if (nesting_count > 0) { + return; + } + __DMB(); + __enable_irq(); +} + +void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { + if(runmode == RUNMODE_SAFE_MODE) + safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); +} + +void common_hal_mcu_reset(void) { + filesystem_flush(); //TODO: implement as part of flash improvements + NVIC_SystemReset(); +} + +// The singleton microcontroller.Processor object, bound to microcontroller.cpu +// It currently only has properties, and no state. +const mcu_processor_obj_t common_hal_mcu_processor_obj = { + .base = { + .type = &mcu_processor_type, + }, +}; + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +#if MCU_PACKAGE >= 100 + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, +#if MCU_PACKAGE == 144 + { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, + { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, + { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, + { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, +#if MCU_PACKAGE == 144 + { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, + { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, + { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, + { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, +#endif +#if MCU_PACKAGE >= 100 + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, +#if MCU_PACKAGE == 144 || defined STM32F405xx + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, +#if MCU_PACKAGE >= 100 + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, +#endif +#if MCU_PACKAGE == 144 + { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, + { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, + { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, + { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, + { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, + { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, +#if MCU_PACKAGE >= 100 + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, +#endif +#if MCU_PACKAGE == 144 + { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, +#endif + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, +#if MCU_PACKAGE >= 100 + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, +#endif +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c new file mode 100644 index 0000000000..6740a0d348 --- /dev/null +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -0,0 +1,102 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "shared-bindings/neopixel_write/__init__.h" + +#include "tick.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/microcontroller/Pin.h" +#include "stm32f4xx_hal.h" +#include "stm32f4xx_ll_gpio.h" + +uint64_t next_start_tick_ms = 0; +uint32_t next_start_tick_us = 1000; + +//sysclock divisors +#define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field +#define MAGIC_800_T0H 2800000 // ~0.36 us -> 0.44 field +#define MAGIC_800_T1H 1350000 // ~0.74 us -> 0.84 field + +#pragma GCC push_options +#pragma GCC optimize ("Os") + +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, + uint32_t numBytes) { + uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; + uint32_t start = 0; + uint32_t cyc = 0; + + //assumes 800_000Hz frequency + //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us + //TODO: try to get dynamic weighting working again + uint32_t sys_freq = HAL_RCC_GetSysClockFreq(); + uint32_t interval = sys_freq/MAGIC_800_INT; + uint32_t t0 = (sys_freq/MAGIC_800_T0H); + uint32_t t1 = (sys_freq/MAGIC_800_T1H); + + // This must be called while interrupts are on in case we're waiting for a + // future ms tick. + wait_until(next_start_tick_ms, next_start_tick_us); + + GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); + uint32_t p_mask = pin_mask(digitalinout->pin->number); + + __disable_irq(); + // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; + DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; + DWT->CYCCNT = 0; + + for(;;) { + cyc = (pix & mask) ? t1 : t0; + start = DWT->CYCCNT; + LL_GPIO_SetOutputPin(p_port, p_mask); + while((DWT->CYCCNT - start) < cyc); + LL_GPIO_ResetOutputPin(p_port, p_mask); + while((DWT->CYCCNT - start) < interval); + if(!(mask >>= 1)) { + if(p >= end) break; + pix = *p++; + mask = 0x80; + } + } + + // Enable interrupts again + __enable_irq(); + + // Update the next start. + current_tick(&next_start_tick_ms, &next_start_tick_us); + if (next_start_tick_us < 100) { + next_start_tick_ms += 1; + next_start_tick_us = 100 - next_start_tick_us; + } else { + next_start_tick_us -= 100; + } +} + +#pragma GCC pop_options \ No newline at end of file diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c new file mode 100644 index 0000000000..0b3153286a --- /dev/null +++ b/ports/stm/common-hal/os/__init__.c @@ -0,0 +1,95 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "genhdr/mpversion.h" +#include "py/mpconfig.h" +#include "py/objstr.h" +#include "py/objtuple.h" + +#include "py/mperrno.h" +#include "py/runtime.h" +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + +STATIC const qstr os_uname_info_fields[] = { + MP_QSTR_sysname, MP_QSTR_nodename, + MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine +}; +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "stm32f4"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "stm32f4"); + +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); + +STATIC MP_DEFINE_ATTRTUPLE( + os_uname_info_obj, + os_uname_info_fields, + 5, + (mp_obj_t)&os_uname_info_sysname_obj, + (mp_obj_t)&os_uname_info_nodename_obj, + (mp_obj_t)&os_uname_info_release_obj, + (mp_obj_t)&os_uname_info_version_obj, + (mp_obj_t)&os_uname_info_machine_obj +); + +mp_obj_t common_hal_os_uname(void) { + return (mp_obj_t)&os_uname_info_obj; +} + +#define RNG_TIMEOUT 5 + +bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { + #if (HAS_TRNG) + //init the RNG + __HAL_RCC_RNG_CLK_ENABLE(); + RNG_HandleTypeDef handle; + handle.Instance = RNG; + 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 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) { + mp_raise_ValueError(translate("Random number generation error")); + } + *buffer = (uint8_t)temp; + } + + //shut down the peripheral + if (HAL_RNG_DeInit(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG DeInit Error")); + __HAL_RCC_RNG_CLK_DISABLE(); + + return true; + #else + return false; + #endif +} \ No newline at end of file diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c new file mode 100644 index 0000000000..d62ee2a380 --- /dev/null +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -0,0 +1,448 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Uses code from Micropython, Copyright (c) 2013-2016 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "py/runtime.h" +#include "common-hal/pulseio/PWMOut.h" +#include "shared-bindings/pulseio/PWMOut.h" +#include "supervisor/shared/translate.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "stm32f4xx_hal.h" +#include "common-hal/microcontroller/Pin.h" + +#define ALL_CLOCKS 0xFFFF + +STATIC uint8_t reserved_tim[TIM_BANK_ARRAY_LEN]; +STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN]; +STATIC bool never_reset_tim[TIM_BANK_ARRAY_LEN]; + +STATIC void tim_clock_enable(uint16_t mask); +STATIC void tim_clock_disable(uint16_t mask); + +// Get the frequency (in Hz) of the source clock for the given timer. +// On STM32F405/407/415/417 there are 2 cases for how the clock freq is set. +// If the APB prescaler is 1, then the timer clock is equal to its respective +// APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its +// respective APB clock. See DM00031020 Rev 4, page 115. +STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { + uint32_t source, clk_div; + if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) { + // TIM{1,8,9,10,11} are on APB2 + source = HAL_RCC_GetPCLK2Freq(); + clk_div = RCC->CFGR & RCC_CFGR_PPRE2; + } else { + // TIM{2,3,4,5,6,7,12,13,14} are on APB1 + source = HAL_RCC_GetPCLK1Freq(); + clk_div = RCC->CFGR & RCC_CFGR_PPRE1; + } + if (clk_div != 0) { + // APB prescaler for this timer is > 1 + source *= 2; + } + return source; +} + +STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) { + //duty cycle is duty/0xFFFF fraction x (number of pulses per period) + return (duty*period) / ((1 << 16) - 1); +} + +STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, + uint32_t frequency, uint32_t source_freq) { + //Find the largest possible period supported by this frequency + for (int i = 0; i < (1 << 16); i++) { + *period = source_freq / (i * frequency); + if (*period < (1 << 16) && *period >= 2) { + *prescaler = i; + break; + } + } + if (*prescaler == 0) { + mp_raise_ValueError(translate("Invalid frequency supplied")); + } +} + +void pwmout_reset(void) { + uint16_t never_reset_mask = 0x00; + for (int i = 0; i < TIM_BANK_ARRAY_LEN; i++) { + if (!never_reset_tim[i]) { + reserved_tim[i] = 0x00; + tim_frequencies[i] = 0x00; + } else { + never_reset_mask |= 1 << i; + } + } + tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); +} + +pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, + const mcu_pin_obj_t* pin, + uint16_t duty, + uint32_t frequency, + bool variable_frequency) { + TIM_TypeDef * TIMx; + uint8_t tim_num = MP_ARRAY_SIZE(mcu_tim_pin_list); + bool tim_chan_taken = false; + bool tim_taken_f_mismatch = false; + bool var_freq_mismatch = false; + bool first_time_setup = true; + + for (uint i = 0; i < tim_num; i++) { + const mcu_tim_pin_obj_t * l_tim = &mcu_tim_pin_list[i]; + uint8_t l_tim_index = l_tim->tim_index - 1; + uint8_t l_tim_channel = l_tim->channel_index - 1; + + //if pin is same + if (l_tim->pin == pin) { + //check if the timer has a channel active + if (reserved_tim[l_tim_index] != 0) { + //is it the same channel? (or all channels reserved by a var-freq) + if (reserved_tim[l_tim_index] & 1 << (l_tim_channel)) { + tim_chan_taken = true; + continue; //keep looking, might be another viable option + } + //If the frequencies are the same it's ok + if (tim_frequencies[l_tim_index] != frequency) { + tim_taken_f_mismatch = true; + continue; //keep looking + } + //you can't put a variable frequency on a partially reserved timer + if (variable_frequency) { + var_freq_mismatch = true; + continue; //keep looking + } + first_time_setup = false; //skip setting up the timer + } + //No problems taken, so set it up + self->tim = l_tim; + break; + } + } + + //handle valid/invalid timer instance + if (self->tim != NULL) { + //create instance + TIMx = mcu_tim_banks[self->tim->tim_index - 1]; + //reserve timer/channel + if (variable_frequency) { + reserved_tim[self->tim->tim_index - 1] = 0x0F; + } else { + reserved_tim[self->tim->tim_index - 1] |= 1 << (self->tim->channel_index - 1); + } + tim_frequencies[self->tim->tim_index - 1] = frequency; + } else { //no match found + if (tim_chan_taken) { + mp_raise_ValueError(translate("No more timers available on this pin.")); + } else if (tim_taken_f_mismatch) { + mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); + } else if (var_freq_mismatch) { + mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use")); + } else { + mp_raise_ValueError(translate("Invalid pins for PWMOut")); + } + } + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(pin->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = self->tim->altfn_index; + HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); + + tim_clock_enable(1 << (self->tim->tim_index - 1)); + + //translate channel into handle value + self->channel = 4 * (self->tim->channel_index - 1); + + uint32_t prescaler = 0; //prescaler is 15 bit + uint32_t period = 0; //period is 16 bit + timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_source_freq(self->tim->tim_index)); + + //Timer init + self->handle.Instance = TIMx; + self->handle.Init.Period = period - 1; + self->handle.Init.Prescaler = prescaler - 1; + self->handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + self->handle.Init.CounterMode = TIM_COUNTERMODE_UP; + self->handle.Init.RepetitionCounter = 0; + + //only run init if this is the first instance of this timer + if (first_time_setup) { + if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("Could not initialize timer")); + } + } + + //Channel/PWM init + self->chan_handle.OCMode = TIM_OCMODE_PWM1; + self->chan_handle.Pulse = timer_get_internal_duty(duty, period); + self->chan_handle.OCPolarity = TIM_OCPOLARITY_HIGH; + self->chan_handle.OCFastMode = TIM_OCFAST_DISABLE; + if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { + mp_raise_ValueError(translate("Could not initialize channel")); + } + if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { + mp_raise_ValueError(translate("Could not start PWM")); + } + + self->variable_frequency = variable_frequency; + self->frequency = frequency; + self->duty_cycle = duty; + self->period = period; + + return PWMOUT_OK; +} + +void common_hal_pulseio_pwmout_never_reset(pulseio_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; + never_reset_pin_number(self->tim->pin->port, self->tim->pin->number); + break; + } + } +} + +void common_hal_pulseio_pwmout_reset_ok(pulseio_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; + break; + } + } +} + +bool common_hal_pulseio_pwmout_deinited(pulseio_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)) { + return; + } + //var freq shuts down entire timer, others just their channel + if (self->variable_frequency) { + reserved_tim[self->tim->tim_index - 1] = 0x00; + } else { + reserved_tim[self->tim->tim_index - 1] &= ~(1 << self->tim->channel_index); + 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; + tim_clock_disable(1 << (self->tim->tim_index - 1)); + } +} + +void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_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) { + return self->duty_cycle; +} + +void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { + //don't halt setup for the same frequency + if (frequency == self->frequency) { + return; + } + + uint32_t prescaler = 0; + uint32_t period = 0; + timer_get_optimal_divisors(&period, &prescaler, frequency, + timer_get_source_freq(self->tim->tim_index)); + + //shut down + HAL_TIM_PWM_Stop(&self->handle, self->channel); + + //Only change altered values + self->handle.Init.Period = period - 1; + self->handle.Init.Prescaler = prescaler - 1; + + //restart everything, adjusting for new speed + if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("Could not re-init timer")); + } + + self->chan_handle.Pulse = timer_get_internal_duty(self->duty_cycle, period); + + if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { + mp_raise_ValueError(translate("Could not re-init channel")); + } + if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { + mp_raise_ValueError(translate("Could not restart PWM")); + } + + tim_frequencies[self->tim->tim_index - 1] = frequency; + self->frequency = frequency; + self->period = period; +} + +uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { + return self->frequency; +} + +bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { + return self->variable_frequency; +} + +STATIC void tim_clock_enable(uint16_t mask) { + #ifdef TIM1 + if (mask & (1 << 0)) { + __HAL_RCC_TIM1_CLK_ENABLE(); + } + #endif + #ifdef TIM2 + if (mask & (1 << 1)) { + __HAL_RCC_TIM2_CLK_ENABLE(); + } + #endif + #ifdef TIM3 + if (mask & (1 << 2)) { + __HAL_RCC_TIM3_CLK_ENABLE(); + } + #endif + #ifdef TIM4 + if (mask & (1 << 3)) { + __HAL_RCC_TIM4_CLK_ENABLE(); + } + #endif + #ifdef TIM5 + if (mask & (1 << 4)) { + __HAL_RCC_TIM5_CLK_ENABLE(); + } + #endif + //6 and 7 are reserved ADC timers + #ifdef TIM8 + if (mask & (1 << 7)) { + __HAL_RCC_TIM8_CLK_ENABLE(); + } + #endif + #ifdef TIM9 + if (mask & (1 << 8)) { + __HAL_RCC_TIM9_CLK_ENABLE(); + } + #endif + #ifdef TIM10 + if (mask & (1 << 9)) { + __HAL_RCC_TIM10_CLK_ENABLE(); + } + #endif + #ifdef TIM11 + if (mask & (1 << 10)) { + __HAL_RCC_TIM11_CLK_ENABLE(); + } + #endif + #ifdef TIM12 + if (mask & (1 << 11)) { + __HAL_RCC_TIM12_CLK_ENABLE(); + } + #endif + #ifdef TIM13 + if (mask & (1 << 12)) { + __HAL_RCC_TIM13_CLK_ENABLE(); + } + #endif + #ifdef TIM14 + if (mask & (1 << 13)) { + __HAL_RCC_TIM14_CLK_ENABLE(); + } + #endif +} + +STATIC void tim_clock_disable(uint16_t mask) { + #ifdef TIM1 + if (mask & (1 << 0)) { + __HAL_RCC_TIM1_CLK_DISABLE(); + } + #endif + #ifdef TIM2 + if (mask & (1 << 1)) { + __HAL_RCC_TIM2_CLK_DISABLE(); + } + #endif + #ifdef TIM3 + if (mask & (1 << 2)) { + __HAL_RCC_TIM3_CLK_DISABLE(); + } + #endif + #ifdef TIM4 + if (mask & (1 << 3)) { + __HAL_RCC_TIM4_CLK_DISABLE(); + } + #endif + #ifdef TIM5 + if (mask & (1 << 4)) { + __HAL_RCC_TIM5_CLK_DISABLE(); + } + #endif + //6 and 7 are reserved ADC timers + #ifdef TIM8 + if (mask & (1 << 7)) { + __HAL_RCC_TIM8_CLK_DISABLE(); + } + #endif + #ifdef TIM9 + if (mask & (1 << 8)) { + __HAL_RCC_TIM9_CLK_DISABLE(); + } + #endif + #ifdef TIM10 + if (mask & (1 << 9)) { + __HAL_RCC_TIM10_CLK_DISABLE(); + } + #endif + #ifdef TIM11 + if (mask & (1 << 10)) { + __HAL_RCC_TIM11_CLK_DISABLE(); + } + #endif + #ifdef TIM12 + if (mask & (1 << 11)) { + __HAL_RCC_TIM12_CLK_DISABLE(); + } + #endif + #ifdef TIM13 + if (mask & (1 << 12)) { + __HAL_RCC_TIM13_CLK_DISABLE(); + } + #endif + #ifdef TIM14 + if (mask & (1 << 13)) { + __HAL_RCC_TIM14_CLK_DISABLE(); + } + #endif +} diff --git a/ports/stm/common-hal/pulseio/PWMOut.h b/ports/stm/common-hal/pulseio/PWMOut.h new file mode 100644 index 0000000000..59fc04e5ff --- /dev/null +++ b/ports/stm/common-hal/pulseio/PWMOut.h @@ -0,0 +1,51 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H + +#include "common-hal/microcontroller/Pin.h" + +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + TIM_HandleTypeDef handle; + TIM_OC_InitTypeDef chan_handle; + const mcu_tim_pin_obj_t *tim; + uint8_t channel: 7; + bool variable_frequency: 1; + uint16_t duty_cycle; + uint32_t frequency; + uint32_t period; +} pulseio_pwmout_obj_t; + +void pwmout_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c new file mode 100644 index 0000000000..068936bdd0 --- /dev/null +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -0,0 +1,79 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/pulseio/PulseIn.h" +#include +#include +#include "py/mpconfig.h" +#include "py/gc.h" +#include "py/runtime.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/pulseio/PulseIn.h" +#include "tick.h" + +void pulsein_reset(void) { +} + +void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, + uint16_t maxlen, bool idle_state) { + mp_raise_NotImplementedError(translate("PulseIn not yet supported")); +} + +bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { + return true; +} + +void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { +} + +void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { +} + +void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { +} + +void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { +} + +uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { + return 0; +} + +uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { + return 0; +} + +uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { + return 0; +} + +bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) { + return 0; +} + +uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) { + return 0; +} diff --git a/ports/stm/common-hal/pulseio/PulseIn.h b/ports/stm/common-hal/pulseio/PulseIn.h new file mode 100644 index 0000000000..2538b07ab5 --- /dev/null +++ b/ports/stm/common-hal/pulseio/PulseIn.h @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + + uint8_t pin; + bool idle_state; + bool paused; + volatile bool first_edge; + + uint16_t* buffer; + uint16_t maxlen; + + volatile uint16_t start; + volatile uint16_t len; + volatile uint16_t last_us; + volatile uint64_t last_ms; +} pulseio_pulsein_obj_t; + +void pulsein_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c new file mode 100644 index 0000000000..d82525ea16 --- /dev/null +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -0,0 +1,214 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/pulseio/PulseOut.h" + +#include + +#include "py/mpconfig.h" +#include "py/gc.h" +#include "py/runtime.h" +#include "shared-bindings/pulseio/PulseOut.h" +#include "shared-bindings/pulseio/PWMOut.h" +#include "supervisor/shared/translate.h" + +#include "stm32f4xx_hal.h" +#include "common-hal/microcontroller/Pin.h" +#include "tick.h" + +// A single timer is shared amongst all PulseOut objects under the assumption that +// the code is single threaded. +STATIC uint8_t refcount = 0; + +STATIC uint16_t *pulse_array = NULL; +STATIC volatile uint16_t pulse_array_index = 0; +STATIC uint16_t pulse_array_length; + +//Timer is shared, must be accessible by interrupt +STATIC TIM_HandleTypeDef t7_handle; +pulseio_pulseout_obj_t *curr_pulseout = NULL; + +STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { + // Turn on PWM + HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel); +} + +STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { + // Turn off PWM + HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); + // Make sure pin is low. + HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), + pin_mask(pulseout->pwmout->tim->pin->number), 0); +} + +STATIC void start_timer(void) { + // Set the new period + t7_handle.Init.Period = pulse_array[pulse_array_index] - 1; + HAL_TIM_Base_Init(&t7_handle); + + // TIM7 has limited HAL support, set registers manually + t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE); + +} + +STATIC void pulseout_event_handler(void) { + if (curr_pulseout->pwmout == NULL) { + return; //invalid interrupt + } + + HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1); + HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0); + + pulse_array_index++; + + // No more pulses. Turn off output and don't restart. + if (pulse_array_index >= pulse_array_length) { + turn_off(curr_pulseout); + return; + } + + // Alternate on and off, starting with on. + if (pulse_array_index % 2 == 0) { + turn_on(curr_pulseout); + } else { + turn_off(curr_pulseout); + } + + // Count up to the next given value. + start_timer(); +} + +void pulseout_reset() { + #if HAS_BASIC_TIM + __HAL_RCC_TIM7_CLK_DISABLE(); + refcount = 0; + #endif +} + +void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, + const pulseio_pwmout_obj_t* carrier) { +#if !(HAS_BASIC_TIM) + mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); +#else + // Add to active PulseOuts + refcount++; + + // Calculate a 1 ms period + uint32_t source, clk_div; + source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1 + clk_div = RCC->CFGR & RCC_CFGR_PPRE1; + // APB quirk, see See DM00031020 Rev 4, page 115. + if (clk_div != 0) { + // APB prescaler for this timer is > 1 + source *= 2; + } + + uint32_t prescaler = source/1000000; //1us intervals + + __HAL_RCC_TIM7_CLK_ENABLE(); + HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0); + HAL_NVIC_EnableIRQ(TIM7_IRQn); + + // Timers 6 and 7 have no pins, so using them doesn't affect PWM availability + t7_handle.Instance = TIM7; + t7_handle.Init.Period = 100; //immediately replaced. + t7_handle.Init.Prescaler = prescaler - 1; + t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP; + t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + + HAL_TIM_Base_Init(&t7_handle); + t7_handle.Instance->SR = 0; + + // The HAL can't work with const, recast required. + self->pwmout = (pulseio_pwmout_obj_t*)carrier; + + turn_off(self); +#endif +} + +bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { + return self->pwmout == NULL; +} + +void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { + if (common_hal_pulseio_pulseout_deinited(self)) { + return; + } + turn_on(self); + self->pwmout = NULL; + + refcount--; + if (refcount == 0) { + #if HAS_BASIC_TIM + __HAL_RCC_TIM7_CLK_DISABLE(); + #endif + } +} + +void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) { + pulse_array = pulses; + pulse_array_index = 0; + pulse_array_length = length; + curr_pulseout = self; + + turn_on(self); + + // Count up to the next given value. + start_timer(); + + // Use when debugging, or issues are irrecoverable + // uint32_t starttime = supervisor_ticks_ms64(); + // uint32_t timeout = 10000; + while(pulse_array_index < length) { + // Do other things while we wait. The interrupts will handle sending the + // signal. + RUN_BACKGROUND_TASKS; + + // Use when debugging, or issues are irrecoverable + // if ((supervisor_ticks_ms64() - starttime ) > timeout ) { + // mp_raise_RuntimeError(translate("Error: Send Timeout")); + // } + } + //turn off timer counter. + t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; +} + +void TIM7_IRQHandler(void) +{ + // Detect TIM Update event + if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE); + pulseout_event_handler(); + } + } +} diff --git a/ports/stm/common-hal/pulseio/PulseOut.h b/ports/stm/common-hal/pulseio/PulseOut.h new file mode 100644 index 0000000000..aa97396d00 --- /dev/null +++ b/ports/stm/common-hal/pulseio/PulseOut.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/pulseio/PWMOut.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + pulseio_pwmout_obj_t *pwmout; +} pulseio_pulseout_obj_t; + +void pulseout_reset(void); + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/stm/common-hal/pulseio/__init__.c b/ports/stm/common-hal/pulseio/__init__.c new file mode 100644 index 0000000000..2bee925bc7 --- /dev/null +++ b/ports/stm/common-hal/pulseio/__init__.c @@ -0,0 +1 @@ +// No pulseio module functions. diff --git a/ports/stm/common-hal/supervisor/Runtime.c b/ports/stm/common-hal/supervisor/Runtime.c new file mode 100755 index 0000000000..feab6987d8 --- /dev/null +++ b/ports/stm/common-hal/supervisor/Runtime.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * 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 +#include "shared-bindings/supervisor/Runtime.h" +#include "supervisor/serial.h" + +bool common_hal_get_serial_connected(void) { + return (bool) serial_connected(); +} + +bool common_hal_get_serial_bytes_available(void) { + return (bool) serial_bytes_available(); +} + diff --git a/ports/stm/common-hal/supervisor/Runtime.h b/ports/stm/common-hal/supervisor/Runtime.h new file mode 100755 index 0000000000..9a798e0567 --- /dev/null +++ b/ports/stm/common-hal/supervisor/Runtime.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} super_runtime_obj_t; + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/stm/common-hal/supervisor/__init__.c b/ports/stm/common-hal/supervisor/__init__.c new file mode 100755 index 0000000000..ac88556b45 --- /dev/null +++ b/ports/stm/common-hal/supervisor/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "py/obj.h" + +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/Runtime.h" + + +// The singleton supervisor.Runtime object, bound to supervisor.runtime +// It currently only has properties, and no state. +const super_runtime_obj_t common_hal_supervisor_runtime_obj = { + .base = { + .type = &supervisor_runtime_type, + }, +}; \ No newline at end of file diff --git a/ports/stm/common-hal/time/__init__.c b/ports/stm/common-hal/time/__init__.c new file mode 100644 index 0000000000..c85077868a --- /dev/null +++ b/ports/stm/common-hal/time/__init__.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "py/mphal.h" + +#include "tick.h" + +uint64_t common_hal_time_monotonic(void) { + return supervisor_ticks_ms64(); +} + +uint64_t common_hal_time_monotonic_ns(void) { + uint64_t ms; + uint32_t us_until_ms; + current_tick(&ms, &us_until_ms); + // us counts down. + return 1000 * (ms * 1000 + (1000 - us_until_ms)); +} + +void common_hal_time_delay_ms(uint32_t delay) { + mp_hal_delay_ms(delay); +} diff --git a/ports/stm/fatfs_port.c b/ports/stm/fatfs_port.c new file mode 100644 index 0000000000..13ac21fb1b --- /dev/null +++ b/ports/stm/fatfs_port.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +DWORD get_fattime(void) { + // TODO: Implement this function. For now, fake it. + return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); +} diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h new file mode 100644 index 0000000000..283984ea90 --- /dev/null +++ b/ports/stm/mpconfigport.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef STM32F4_MPCONFIGPORT_H__ +#define STM32F4_MPCONFIGPORT_H__ + +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) +#define MICROPY_PY_FUNCTION_ATTRS (1) +#define MICROPY_PY_IO (1) +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) +#define MICROPY_PY_UJSON (1) + +// 24kiB stack +#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 + +#include "py/circuitpy_mpconfig.h" + +//Board flags: +#ifndef BOARD_OVERWRITE_SWD +#define BOARD_OVERWRITE_SWD (0) +#endif +#ifndef BOARD_VTOR_DEFER +#define BOARD_VTOR_DEFER (0) +#endif +#ifndef BOARD_NO_VBUS_SENSE +#define BOARD_NO_VBUS_SENSE (0) +#endif + +#define MAX_UART 10 //how many UART are implemented + +#define MICROPY_PORT_ROOT_POINTERS \ + void *cpy_uart_obj_all[MAX_UART]; \ + CIRCUITPY_COMMON_ROOT_POINTERS + +#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk new file mode 100644 index 0000000000..493f32c636 --- /dev/null +++ b/ports/stm/mpconfigport.mk @@ -0,0 +1,77 @@ +# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk +# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. +# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + +# Internal math library is substantially smaller than toolchain one +INTERNAL_LIBM = 1 + +# Chip supplied serial number, in bytes +USB_SERIAL_NUMBER_LENGTH = 24 + +# Longints can be implemented as mpz, as longlong, or not +LONGINT_IMPL = MPZ + +#Reduced feature set for early port +CIRCUITPY_MINIMAL_BUILD = 1 + +# The ifndef's allow overriding in mpconfigboard.mk. + +ifndef CIRCUITPY_BOARD +CIRCUITPY_BOARD = 1 +endif + +ifndef CIRCUITPY_DIGITALIO +CIRCUITPY_DIGITALIO = 1 +endif + +ifndef CIRCUITPY_ANALOGIO +CIRCUITPY_ANALOGIO = 1 +endif + +ifndef CIRCUITPY_MICROCONTROLLER +CIRCUITPY_MICROCONTROLLER = 1 +endif + +ifndef CIRCUITPY_BUSIO +CIRCUITPY_BUSIO = 1 +endif + +ifndef CIRCUITPY_PULSEIO +CIRCUITPY_PULSEIO = 1 +endif + +ifndef CIRCUITPY_OS +CIRCUITPY_OS = 1 +endif + +ifndef CIRCUITPY_STORAGE +CIRCUITPY_STORAGE = 1 +endif + +ifndef CIRCUITPY_RANDOM +CIRCUITPY_RANDOM = 1 +endif + +ifndef CRICUITPY_USB_HID +CIRCUITPY_USB_HID = 1 +endif + +ifndef CIRCUITPY_USB_MIDI +CIRCUITPY_USB_MIDI = 1 +endif + +ifndef CIRCUITPY_NEOPIXEL_WRITE +CIRCUITPY_NEOPIXEL_WRITE = 1 +endif + +ifndef CIRCUITPY_DISPLAYIO +CIRCUITPY_DISPLAYIO = 1 +endif + +CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 + +MICROPY_PY_ULAB = 1 + +#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) +#endif diff --git a/ports/stm/mphalport.c b/ports/stm/mphalport.c new file mode 100644 index 0000000000..a3cf501c04 --- /dev/null +++ b/ports/stm/mphalport.c @@ -0,0 +1,63 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2018 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/mphal.h" +#include "py/mpstate.h" +#include "py/gc.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/tick.h" +#include "stm32f4xx_hal.h" + +void mp_hal_delay_ms(mp_uint_t delay) { + uint64_t start_tick = supervisor_ticks_ms64(); + uint64_t duration = 0; + while (duration < delay) { + RUN_BACKGROUND_TASKS; + // Check to see if we've been CTRL-Ced by autoreload or the user. + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + break; + } + duration = (supervisor_ticks_ms64() - start_tick); + // TODO(tannewt): Go to sleep for a little while while we wait. + } +} + +void mp_hal_delay_us(mp_uint_t delay) { + common_hal_mcu_delay_us(delay); +} + +void mp_hal_disable_all_interrupts(void) { + common_hal_mcu_disable_interrupts(); +} + +void mp_hal_enable_all_interrupts(void) { + common_hal_mcu_enable_interrupts(); +} diff --git a/ports/stm/mphalport.h b/ports/stm/mphalport.h new file mode 100644 index 0000000000..b392cb0f84 --- /dev/null +++ b/ports/stm/mphalport.h @@ -0,0 +1,51 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_MPHALPORT_H +#define MICROPY_INCLUDED_STM32F4_MPHALPORT_H + +#include "py/obj.h" + +#include "lib/oofatfs/ff.h" + +#include "supervisor/shared/tick.h" + +// Global millisecond tick count (driven by SysTick interrupt). +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; + +int receive_usb(void); + +void mp_hal_set_interrupt_char(int c); + +void mp_hal_disable_all_interrupts(void); +void mp_hal_enable_all_interrupts(void); + +#endif // MICROPY_INCLUDED_STM32F4_MPHALPORT_H diff --git a/ports/stm/peripherals/stm32f4/clocks.h b/ports/stm/peripherals/stm32f4/clocks.h new file mode 100644 index 0000000000..c7ba846622 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/clocks.h @@ -0,0 +1,27 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +void stm32f4_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f4/gpio.h b/ports/stm/peripherals/stm32f4/gpio.h new file mode 100644 index 0000000000..34f89e7921 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/gpio.h @@ -0,0 +1,28 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +void stm32f4_peripherals_gpio_init(void); +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state); diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h new file mode 100644 index 0000000000..d311afe4a1 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/periph.h @@ -0,0 +1,180 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ +#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ + +#include +#include + +#include "stm32f4xx_hal.h" +#include "stm32f4/pins.h" + +// I2C +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. + +typedef struct { + uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) + uint8_t altfn_index:4; //Index of the altfn for this pin (0 to 15) + const mcu_pin_obj_t * pin; +} mcu_i2c_sda_obj_t; + +typedef struct { + uint8_t i2c_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_i2c_scl_obj_t; + + +#define I2C_SDA(index, alt, sda_pin) \ +{ \ + .i2c_index = index, \ + .altfn_index = alt, \ + .pin = sda_pin, \ +} + +#define I2C_SCL(index, alt, scl_pin) \ +{ \ + .i2c_index = index, \ + .altfn_index = alt, \ + .pin = scl_pin, \ +} + +// SPI +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. + +typedef struct { + uint8_t spi_index:4; //Up to 6 SPI units + uint8_t altfn_index:4; //Up to 15 alt channels + const mcu_pin_obj_t * pin; +} mcu_spi_sck_obj_t; + +typedef struct { + uint8_t spi_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_spi_mosi_obj_t; + +typedef struct { + uint8_t spi_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_spi_miso_obj_t; + +typedef struct { + uint8_t spi_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_spi_nss_obj_t; + +#define SPI(index, alt, spi_pin) \ +{ \ + .spi_index = index, \ + .altfn_index = alt, \ + .pin = spi_pin, \ +} + +// UART +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. + +typedef struct { + uint8_t uart_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_uart_tx_obj_t; + +typedef struct { + uint8_t uart_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_uart_rx_obj_t; + +#define UART(index, alt, uart_pin) \ +{ \ + .uart_index = index, \ + .altfn_index = alt, \ + .pin = uart_pin, \ +} + +//Timers +typedef struct { + uint8_t tim_index:4; + uint8_t altfn_index:4; + uint8_t channel_index:4; + const mcu_pin_obj_t * pin; +} mcu_tim_pin_obj_t; + +#define TIM(index, alt, channel, tim_pin) \ +{ \ + .tim_index = index, \ + .altfn_index = alt, \ + .channel_index = channel, \ + .pin = tim_pin, \ +} + +//Access Lines + +#ifdef STM32F401xE +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f401xe/periph.h" +#endif + +#ifdef STM32F411xE +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f411xe/periph.h" +#endif + +#ifdef STM32F412Zx +#define HAS_DAC 0 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f412zx/periph.h" +#endif + +//Foundation Lines + +#ifdef STM32F405xx +#define HAS_DAC 1 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f405xx/periph.h" +#endif + +#ifdef STM32F407xx +#define HAS_DAC 1 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f407xx/periph.h" +#endif + +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/stm32f4/pins.h new file mode 100644 index 0000000000..44ef4c1baf --- /dev/null +++ b/ports/stm/peripherals/stm32f4/pins.h @@ -0,0 +1,96 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure +// that all necessary includes are already included. + +#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ +#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ + +#include +#include + +#include "stm32f4xx_hal.h" + +typedef struct { + mp_obj_base_t base; + uint8_t port:4; + uint8_t number:4; + uint8_t adc_unit:3; + uint8_t adc_channel:5; +} mcu_pin_obj_t; + +//Standard stm32 adc unit combinations +#define ADC_1 1 +#define ADC_12 3 +#define ADC_123 7 +#define ADC_3 4 + +//STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, +//but all 3 ADCs will share the same input number per pin. +//F4 family has 3 ADC max, 24 channels max. +#define ADC_INPUT(mask, number) \ + .adc_unit = mask, \ + .adc_channel = number, + +#define NO_ADC \ + .adc_unit = 0x00, \ + .adc_channel = 0x1f + +extern const mp_obj_type_t mcu_pin_type; + +// STM32 can have up to 9 ports, each restricted to 16 pins +// We split the pin/port evenly, in contrast to nrf. +#define PIN(p_port, p_number, p_adc) \ +{ \ + { &mcu_pin_type }, \ + .port = p_port, \ + .number = p_number, \ + p_adc \ +} + +// Use illegal pin value to mark unassigned pins. +#define NO_PIN 0xff + +// Choose based on chip +#ifdef STM32F401xE +#include "stm32f401xe/pins.h" +#endif +#ifdef STM32F411xE +#include "stm32f411xe/pins.h" +#endif +#ifdef STM32F412Zx +#include "stm32f412zx/pins.h" +#endif +#ifdef STM32F405xx +#include "stm32f405xx/pins.h" +#endif +#ifdef STM32F407xx +#include "stm32f407xx/pins.h" +#endif + +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c new file mode 100644 index 0000000000..53810af263 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c @@ -0,0 +1,62 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; + RCC_OscInitStruct.PLL.PLLQ = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c new file mode 100644 index 0000000000..7bd6196627 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK +} + +//LEDs are inverted on F411 DISCO +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c new file mode 100644 index 0000000000..b120841860 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c @@ -0,0 +1,173 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PD03), + SPI(3, 6, &pin_PB03), + SPI(3, 6, &pin_PC10), + SPI(4, 5, &pin_PE02), + SPI(4, 5, &pin_PE12), +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), + SPI(3, 5, &pin_PD06), + SPI(4, 5, &pin_PE06), + SPI(4, 5, &pin_PE14), +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), + SPI(4, 5, &pin_PE05), + SPI(4, 5, &pin_PE13), +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), + SPI(4, 6, &pin_PB12), + SPI(4, 5, &pin_PE04), + SPI(4, 5, &pin_PE11), +}; + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(6, 8, &pin_PC06), + UART(2, 7, &pin_PD05), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB07), + UART(6, 8, &pin_PC07), + UART(2, 7, &pin_PD06), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, + TIM11, NULL, NULL, NULL}; + +//#define TIM(index, alt, channel, tim_pin) +const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h new file mode 100644 index 0000000000..6085f1ff2b --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[4]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c new file mode 100644 index 0000000000..7e88c3dcba --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c @@ -0,0 +1,123 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h new file mode 100644 index 0000000000..09bc8f13e3 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h @@ -0,0 +1,121 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H + +//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only +//pg 38 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +//pg 39 +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +//pg 40 +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +//pg 41 +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +//pg 42 +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 43 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +//pg 44 +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +//pg 45 +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +//pg 46 +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c new file mode 100644 index 0000000000..2afca64e83 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c @@ -0,0 +1,64 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. + + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c new file mode 100644 index 0000000000..d1eaa90d1b --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c @@ -0,0 +1,60 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + // never_reset_pin_number(0,15); //PA15 JTDI + // never_reset_pin_number(1,3); //PB3 JTDO + // never_reset_pin_number(1,4); //PB4 JTRST + + // Port H is not included in GPIO port array + // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,1); //PH1 JTRST +} + +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { + +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c new file mode 100644 index 0000000000..bc03f7c7be --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -0,0 +1,194 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), + I2C_SDA(3, 4, &pin_PC09), +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PC07), + SPI(3, 6, &pin_PB03), + SPI(3, 6, &pin_PC10), +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), +}; + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { + UART(4, 8, &pin_PA00), + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(4, 8, &pin_PC10), + UART(5, 8, &pin_PC12), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), + UART(6, 8, &pin_PG14), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(4, 8, &pin_PA01), + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(4, 8, &pin_PC11), + UART(5, 8, &pin_PD02), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), + UART(6, 8, &pin_PG09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(13,9,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(14,9,1,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(2,1,4,&pin_PB11), + TIM(12,9,1,&pin_PB14), + TIM(12,9,2,&pin_PB15), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(8,3,1,&pin_PC06), + TIM(8,3,2,&pin_PC07), + TIM(8,3,3,&pin_PC08), + TIM(8,3,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), + TIM(10,3,1,&pin_PF06), + TIM(11,3,1,&pin_PF07), + TIM(13,9,1,&pin_PF08), + TIM(14,9,1,&pin_PF09), + // TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded + // TIM(12,9,2,&pin_PH09), + // TIM(5,2,1,&pin_PH10), + // TIM(5,2,2,&pin_PH11), + // TIM(5,2,3,&pin_PH12), + // TIM(5,2,4,&pin_PI00), + // TIM(8,3,4,&pin_PI02), + // TIM(8,3,1,&pin_PI05), + // TIM(8,3,2,&pin_PI06), + // TIM(8,3,3,&pin_PI07), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h new file mode 100644 index 0000000000..e87e798574 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[3]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c new file mode 100644 index 0000000000..86445fe140 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c @@ -0,0 +1,161 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_123,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 + +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h new file mode 100644 index 0000000000..180f5c316f --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H + +//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only +//pg 50 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +//pg 51 +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only +//pg 52 +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +//pg 53 +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PC04; +//pg 54 +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only +//pg 55 +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +//pg 56 +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; // 144 only +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +//pg 57 +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 58 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PG02; // 144 only +extern const mcu_pin_obj_t pin_PG03; // 144 only +extern const mcu_pin_obj_t pin_PG04; // 144 only +extern const mcu_pin_obj_t pin_PG05; // 144 only +extern const mcu_pin_obj_t pin_PG06; // 144 only +extern const mcu_pin_obj_t pin_PG07; // 144 only +extern const mcu_pin_obj_t pin_PG08; // 144 only +//pg 59 +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +//pg 60 +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +//pg 61 +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +//pg 62 +extern const mcu_pin_obj_t pin_PG09; // 144 only +extern const mcu_pin_obj_t pin_PG10; // 144 only +extern const mcu_pin_obj_t pin_PG11; // 144 only +extern const mcu_pin_obj_t pin_PG12; // 144 only +extern const mcu_pin_obj_t pin_PG13; // 144 only +extern const mcu_pin_obj_t pin_PG14; // 144 only +extern const mcu_pin_obj_t pin_PG15; // 144 only +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +//pg 63 +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c new file mode 100644 index 0000000000..2afca64e83 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c @@ -0,0 +1,64 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. + + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c new file mode 100644 index 0000000000..d1eaa90d1b --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c @@ -0,0 +1,60 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + // never_reset_pin_number(0,15); //PA15 JTDI + // never_reset_pin_number(1,3); //PB3 JTDO + // never_reset_pin_number(1,4); //PB4 JTRST + + // Port H is not included in GPIO port array + // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,1); //PH1 JTRST +} + +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { + +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c new file mode 100644 index 0000000000..bc03f7c7be --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c @@ -0,0 +1,194 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), + I2C_SDA(3, 4, &pin_PC09), +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PC07), + SPI(3, 6, &pin_PB03), + SPI(3, 6, &pin_PC10), +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), +}; + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { + UART(4, 8, &pin_PA00), + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(4, 8, &pin_PC10), + UART(5, 8, &pin_PC12), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), + UART(6, 8, &pin_PG14), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(4, 8, &pin_PA01), + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(4, 8, &pin_PC11), + UART(5, 8, &pin_PD02), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), + UART(6, 8, &pin_PG09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(13,9,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(14,9,1,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(2,1,4,&pin_PB11), + TIM(12,9,1,&pin_PB14), + TIM(12,9,2,&pin_PB15), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(8,3,1,&pin_PC06), + TIM(8,3,2,&pin_PC07), + TIM(8,3,3,&pin_PC08), + TIM(8,3,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), + TIM(10,3,1,&pin_PF06), + TIM(11,3,1,&pin_PF07), + TIM(13,9,1,&pin_PF08), + TIM(14,9,1,&pin_PF09), + // TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded + // TIM(12,9,2,&pin_PH09), + // TIM(5,2,1,&pin_PH10), + // TIM(5,2,2,&pin_PH11), + // TIM(5,2,3,&pin_PH12), + // TIM(5,2,4,&pin_PI00), + // TIM(8,3,4,&pin_PI02), + // TIM(8,3,1,&pin_PI05), + // TIM(8,3,2,&pin_PI06), + // TIM(8,3,3,&pin_PI07), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h new file mode 100644 index 0000000000..e87e798574 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[3]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c new file mode 100644 index 0000000000..86445fe140 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c @@ -0,0 +1,161 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_123,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 + +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h new file mode 100644 index 0000000000..180f5c316f --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H + +//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only +//pg 50 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +//pg 51 +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only +//pg 52 +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +//pg 53 +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PC04; +//pg 54 +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only +//pg 55 +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +//pg 56 +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; // 144 only +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +//pg 57 +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 58 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PG02; // 144 only +extern const mcu_pin_obj_t pin_PG03; // 144 only +extern const mcu_pin_obj_t pin_PG04; // 144 only +extern const mcu_pin_obj_t pin_PG05; // 144 only +extern const mcu_pin_obj_t pin_PG06; // 144 only +extern const mcu_pin_obj_t pin_PG07; // 144 only +extern const mcu_pin_obj_t pin_PG08; // 144 only +//pg 59 +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +//pg 60 +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +//pg 61 +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +//pg 62 +extern const mcu_pin_obj_t pin_PG09; // 144 only +extern const mcu_pin_obj_t pin_PG10; // 144 only +extern const mcu_pin_obj_t pin_PG11; // 144 only +extern const mcu_pin_obj_t pin_PG12; // 144 only +extern const mcu_pin_obj_t pin_PG13; // 144 only +extern const mcu_pin_obj_t pin_PG14; // 144 only +extern const mcu_pin_obj_t pin_PG15; // 144 only +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +//pg 63 +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c new file mode 100644 index 0000000000..53810af263 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c @@ -0,0 +1,62 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; + RCC_OscInitStruct.PLL.PLLQ = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c new file mode 100644 index 0000000000..aee0bd5eb8 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c @@ -0,0 +1,59 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "py/mpconfig.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + + #if !(BOARD_OVERWRITE_SWD) + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + #endif + + // Port H is not included in GPIO port array + // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,1); //PH1 JTRST +} + +//LEDs are inverted on F411 DISCO +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c new file mode 100644 index 0000000000..b7d9edf4f7 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c @@ -0,0 +1,194 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 9, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), + I2C_SDA(3, 9, &pin_PB08) +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PC07), + SPI(2, 5, &pin_PD03), + SPI(3, 6, &pin_PB03), + SPI(3, 7, &pin_PB12), + SPI(3, 6, &pin_PC10), + SPI(4, 6, &pin_PB13), + SPI(4, 5, &pin_PE02), + SPI(4, 5, &pin_PE12), + SPI(5, 6, &pin_PB00), + SPI(5, 6, &pin_PE02), + SPI(5, 6, &pin_PE12) +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), + SPI(3, 5, &pin_PD06), + SPI(4, 5, &pin_PA01), + SPI(4, 5, &pin_PE06), + SPI(4, 5, &pin_PE14), + SPI(5, 6, &pin_PA10), + SPI(5, 6, &pin_PB08), + SPI(5, 6, &pin_PE06), + SPI(5, 6, &pin_PE14) +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), + SPI(4, 6, &pin_PA11), + SPI(4, 5, &pin_PE05), + SPI(4, 5, &pin_PE13), + SPI(5, 6, &pin_PA12), + SPI(5, 6, &pin_PE05), + SPI(5, 6, &pin_PE13) +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), + SPI(4, 6, &pin_PB12), + SPI(4, 5, &pin_PE04), + SPI(4, 5, &pin_PE11), + SPI(5, 6, &pin_PB01), + SPI(5, 6, &pin_PE04), + SPI(5, 6, &pin_PE11) +}; + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[7] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PA15), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(6, 8, &pin_PC06), + UART(2, 7, &pin_PD05), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[7] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB03), + UART(1, 7, &pin_PB07), + UART(6, 8, &pin_PC07), + UART(2, 7, &pin_PD06), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, + TIM11, NULL, NULL, NULL}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h new file mode 100644 index 0000000000..d657d73b68 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[5]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c new file mode 100644 index 0000000000..7e88c3dcba --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c @@ -0,0 +1,123 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h new file mode 100644 index 0000000000..37d3a5cf11 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h @@ -0,0 +1,121 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H + +//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only +//pg 38 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +//pg 39 +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +//pg 40 +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +//pg 41 +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +//pg 42 +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 43 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +//pg 44 +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +//pg 45 +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +//pg 46 +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c new file mode 100644 index 0000000000..b208f9dfb3 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c @@ -0,0 +1,75 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the + * device is clocked below the maximum system frequency, to update the + * voltage scaling value regarding system frequency refer to product + * datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 200; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLR = 2; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLLSAI output as USB clock source */ + PeriphClkInitStruct.PLLI2S.PLLI2SM = 8; + PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; + PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + * clocks dividers */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c new file mode 100644 index 0000000000..d17ab4e018 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -0,0 +1,243 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* GPIO PIN REFERENCE +#define LED3_Pin GPIO_PIN_2 +#define LED3_GPIO_Port GPIOE +#define LED4_Pin GPIO_PIN_3 +#define LED4_GPIO_Port GPIOE +#define DFSDM_DATIN3_Pin GPIO_PIN_4 +#define DFSDM_DATIN3_GPIO_Port GPIOE +#define A0_Pin GPIO_PIN_0 +#define A0_GPIO_Port GPIOF +#define LCD_BLCTRL_Pin GPIO_PIN_5 +#define LCD_BLCTRL_GPIO_Port GPIOF +#define QSPI_BK1_IO3_Pin GPIO_PIN_6 +#define QSPI_BK1_IO3_GPIO_Port GPIOF +#define QSPI_BK1_IO2_Pin GPIO_PIN_7 +#define QSPI_BK1_IO2_GPIO_Port GPIOF +#define QSPI_BK1_IO0_Pin GPIO_PIN_8 +#define QSPI_BK1_IO0_GPIO_Port GPIOF +#define QSPI_BK1_IO1_Pin GPIO_PIN_9 +#define QSPI_BK1_IO1_GPIO_Port GPIOF +#define STLK_MCO_Pin GPIO_PIN_0 +#define STLK_MCO_GPIO_Port GPIOH +#define DFSDM_CKOUT_Pin GPIO_PIN_2 +#define DFSDM_CKOUT_GPIO_Port GPIOC +#define JOY_SEL_Pin GPIO_PIN_0 +#define JOY_SEL_GPIO_Port GPIOA +#define STLINK_RX_Pin GPIO_PIN_2 +#define STLINK_RX_GPIO_Port GPIOA +#define STLINK_TX_Pin GPIO_PIN_3 +#define STLINK_TX_GPIO_Port GPIOA +#define CODEC_I2S3_WS_Pin GPIO_PIN_4 +#define CODEC_I2S3_WS_GPIO_Port GPIOA +#define DFSDM_DATIN0_Pin GPIO_PIN_1 +#define DFSDM_DATIN0_GPIO_Port GPIOB +#define QSPI_CLK_Pin GPIO_PIN_2 +#define QSPI_CLK_GPIO_Port GPIOB +#define EXT_RESET_Pin GPIO_PIN_11 +#define EXT_RESET_GPIO_Port GPIOF +#define CTP_RST_Pin GPIO_PIN_12 +#define CTP_RST_GPIO_Port GPIOF +#define JOY_RIGHT_Pin GPIO_PIN_14 +#define JOY_RIGHT_GPIO_Port GPIOF +#define JOY_LEFT_Pin GPIO_PIN_15 +#define JOY_LEFT_GPIO_Port GPIOF +#define JOY_UP_Pin GPIO_PIN_0 +#define JOY_UP_GPIO_Port GPIOG +#define JOY_DOWN_Pin GPIO_PIN_1 +#define JOY_DOWN_GPIO_Port GPIOG +#define D4_Pin GPIO_PIN_7 +#define D4_GPIO_Port GPIOE +#define D5_Pin GPIO_PIN_8 +#define D5_GPIO_Port GPIOE +#define D6_Pin GPIO_PIN_9 +#define D6_GPIO_Port GPIOE +#define D7_Pin GPIO_PIN_10 +#define D7_GPIO_Port GPIOE +#define D8_Pin GPIO_PIN_11 +#define D8_GPIO_Port GPIOE +#define D9_Pin GPIO_PIN_12 +#define D9_GPIO_Port GPIOE +#define D10_Pin GPIO_PIN_13 +#define D10_GPIO_Port GPIOE +#define D11_Pin GPIO_PIN_14 +#define D11_GPIO_Port GPIOE +#define D12_Pin GPIO_PIN_15 +#define D12_GPIO_Port GPIOE +#define I2C2_SCL_Pin GPIO_PIN_10 +#define I2C2_SCL_GPIO_Port GPIOB +#define M2_CKIN_Pin GPIO_PIN_11 +#define M2_CKIN_GPIO_Port GPIOB +#define CODEC_I2S3_SCK_Pin GPIO_PIN_12 +#define CODEC_I2S3_SCK_GPIO_Port GPIOB +#define D13_Pin GPIO_PIN_8 +#define D13_GPIO_Port GPIOD +#define D14_Pin GPIO_PIN_9 +#define D14_GPIO_Port GPIOD +#define D15_Pin GPIO_PIN_10 +#define D15_GPIO_Port GPIOD +#define LCD_RESET_Pin GPIO_PIN_11 +#define LCD_RESET_GPIO_Port GPIOD +#define D0_Pin GPIO_PIN_14 +#define D0_GPIO_Port GPIOD +#define D1_Pin GPIO_PIN_15 +#define D1_GPIO_Port GPIOD +#define CODEC_INT_Pin GPIO_PIN_2 +#define CODEC_INT_GPIO_Port GPIOG +#define LCD_TE_Pin GPIO_PIN_4 +#define LCD_TE_GPIO_Port GPIOG +#define CTP_INT_Pin GPIO_PIN_5 +#define CTP_INT_GPIO_Port GPIOG +#define QSPI_BK1_NCS_Pin GPIO_PIN_6 +#define QSPI_BK1_NCS_GPIO_Port GPIOG +#define USB_OTGFS_OVRCR_Pin GPIO_PIN_7 +#define USB_OTGFS_OVRCR_GPIO_Port GPIOG +#define USB_OTGFS_PPWR_EN_Pin GPIO_PIN_8 +#define USB_OTGFS_PPWR_EN_GPIO_Port GPIOG +#define CODEC_I2S3_MCK_Pin GPIO_PIN_7 +#define CODEC_I2S3_MCK_GPIO_Port GPIOC +#define uSD_D0_Pin GPIO_PIN_8 +#define uSD_D0_GPIO_Port GPIOC +#define uSD_D1_Pin GPIO_PIN_9 +#define uSD_D1_GPIO_Port GPIOC +#define M2_CKINA8_Pin GPIO_PIN_8 +#define M2_CKINA8_GPIO_Port GPIOA +#define USB_OTGFS_VBUS_Pin GPIO_PIN_9 +#define USB_OTGFS_VBUS_GPIO_Port GPIOA +#define USB_OTGFS_ID_Pin GPIO_PIN_10 +#define USB_OTGFS_ID_GPIO_Port GPIOA +#define USB_OTGFS_DM_Pin GPIO_PIN_11 +#define USB_OTGFS_DM_GPIO_Port GPIOA +#define USB_OTGFS_DP_Pin GPIO_PIN_12 +#define USB_OTGFS_DP_GPIO_Port GPIOA +#define SWDIO_Pin GPIO_PIN_13 +#define SWDIO_GPIO_Port GPIOA +#define SWCLK_Pin GPIO_PIN_14 +#define SWCLK_GPIO_Port GPIOA +#define uSD_D2_Pin GPIO_PIN_10 +#define uSD_D2_GPIO_Port GPIOC +#define uSD_D3_Pin GPIO_PIN_11 +#define uSD_D3_GPIO_Port GPIOC +#define uSD_CLK_Pin GPIO_PIN_12 +#define uSD_CLK_GPIO_Port GPIOC +#define D2_Pin GPIO_PIN_0 +#define D2_GPIO_Port GPIOD +#define D3_Pin GPIO_PIN_1 +#define D3_GPIO_Port GPIOD +#define uSD_CMD_Pin GPIO_PIN_2 +#define uSD_CMD_GPIO_Port GPIOD +#define uSD_DETECT_Pin GPIO_PIN_3 +#define uSD_DETECT_GPIO_Port GPIOD +#define FMC_NOE_Pin GPIO_PIN_4 +#define FMC_NOE_GPIO_Port GPIOD +#define FMC_NWE_Pin GPIO_PIN_5 +#define FMC_NWE_GPIO_Port GPIOD +#define FMC_NE1_Pin GPIO_PIN_7 +#define FMC_NE1_GPIO_Port GPIOD +#define SWO_Pin GPIO_PIN_3 +#define SWO_GPIO_Port GPIOB +#define CODEC_I2S3ext_SD_Pin GPIO_PIN_4 +#define CODEC_I2S3ext_SD_GPIO_Port GPIOB +#define CODEC_I2S3_SD_Pin GPIO_PIN_5 +#define CODEC_I2S3_SD_GPIO_Port GPIOB +#define I2C1_SCL_Pin GPIO_PIN_6 +#define I2C1_SCL_GPIO_Port GPIOB +#define I2C1_SDA_Pin GPIO_PIN_7 +#define I2C1_SDA_GPIO_Port GPIOB +#define I2C2_SDA_Pin GPIO_PIN_9 +#define I2C2_SDA_GPIO_Port GPIOB +#define LED1_Pin GPIO_PIN_0 +#define LED1_GPIO_Port GPIOE +#define LED2_Pin GPIO_PIN_1 +#define LED2_GPIO_Port GPIOE +*/ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //Enable all GPIO for now + GPIO_InitTypeDef GPIO_InitStruct = {0}; + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); + //HAL_GPIO_WritePin(USB_OTGFS_PPWR_EN_GPIO_Port, USB_OTGFS_PPWR_EN_Pin, GPIO_PIN_SET); + + //Configure LED pins + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); + + //Status LED chain + stm32f4_peripherals_status_led(0,1); + stm32f4_peripherals_status_led(1,0); + stm32f4_peripherals_status_led(2,0); + stm32f4_peripherals_status_led(3,0); + + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + //never_reset_pin_number(0,15); //PA15 JTDI + //never_reset_pin_number(1,3); //PB3 JTDO + //never_reset_pin_number(1,4); //PB4 JTRST + + // Port H is not included in GPIO port array + // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,1); //PH1 JTRST +} + +//LEDs are inverted on F411 DISCO +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { + switch(led) + { + case 0: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, (state ^ 1)); + break; + case 1: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, (state ^ 1)); + break; + case 2: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, (state ^ 1)); + break; + case 3: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, (state ^ 1)); + break; + default: break; + } +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c new file mode 100644 index 0000000000..f5effa80ed --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c @@ -0,0 +1,223 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 + I2C_SDA(2, 9, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), + I2C_SDA(3, 9, &pin_PB08) +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PC07), + SPI(2, 5, &pin_PD03), + SPI(3, 6, &pin_PB03), + SPI(3, 7, &pin_PB12), + SPI(3, 6, &pin_PC10), + SPI(4, 6, &pin_PB13), + SPI(4, 5, &pin_PE02), + SPI(4, 5, &pin_PE12), + SPI(5, 6, &pin_PB00), + SPI(5, 6, &pin_PE02), + SPI(5, 6, &pin_PE12) +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), + SPI(3, 5, &pin_PD06), + SPI(4, 5, &pin_PA01), + SPI(4, 5, &pin_PE06), + SPI(4, 5, &pin_PE14), + SPI(5, 6, &pin_PA10), + SPI(5, 6, &pin_PB08), + SPI(5, 6, &pin_PE06), + SPI(5, 6, &pin_PE14) +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), + SPI(4, 6, &pin_PA11), + SPI(4, 5, &pin_PE05), + SPI(4, 5, &pin_PE13), + SPI(5, 6, &pin_PA12), + SPI(5, 6, &pin_PE05), + SPI(5, 6, &pin_PE13) +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), + SPI(4, 6, &pin_PB12), + SPI(4, 5, &pin_PE04), + SPI(4, 5, &pin_PE11), + SPI(5, 6, &pin_PB01), + SPI(5, 6, &pin_PE04), + SPI(5, 6, &pin_PE11) +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PA15), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), + UART(6, 8, &pin_PG14), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB03), + UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(3, 7, &pin_PC05), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), + UART(6, 8, &pin_PG09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(13,9,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(14,9,1,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(2,1,4,&pin_PB11), + TIM(12,9,1,&pin_PB14), + TIM(12,9,2,&pin_PB15), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(8,3,1,&pin_PC06), + TIM(8,3,2,&pin_PC07), + TIM(8,3,3,&pin_PC08), + TIM(8,3,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), + TIM(10,3,1,&pin_PF06), + TIM(11,3,1,&pin_PF07), + TIM(13,9,1,&pin_PF08), + TIM(14,9,1,&pin_PF09), + TIM(5,2,1,&pin_PF03), + TIM(5,2,2,&pin_PF04), + TIM(5,2,3,&pin_PF05), + TIM(5,2,4,&pin_PF10), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h new file mode 100644 index 0000000000..e0141e6dab --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h @@ -0,0 +1,58 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + + +//SPI +extern SPI_TypeDef * mcu_spi_banks[5]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c new file mode 100644 index 0000000000..c56de5a295 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c @@ -0,0 +1,161 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); + +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h new file mode 100644 index 0000000000..180f5c316f --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H + +//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only +//pg 50 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +//pg 51 +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only +//pg 52 +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +//pg 53 +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PC04; +//pg 54 +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only +//pg 55 +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +//pg 56 +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; // 144 only +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +//pg 57 +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 58 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PG02; // 144 only +extern const mcu_pin_obj_t pin_PG03; // 144 only +extern const mcu_pin_obj_t pin_PG04; // 144 only +extern const mcu_pin_obj_t pin_PG05; // 144 only +extern const mcu_pin_obj_t pin_PG06; // 144 only +extern const mcu_pin_obj_t pin_PG07; // 144 only +extern const mcu_pin_obj_t pin_PG08; // 144 only +//pg 59 +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +//pg 60 +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +//pg 61 +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +//pg 62 +extern const mcu_pin_obj_t pin_PG09; // 144 only +extern const mcu_pin_obj_t pin_PG10; // 144 only +extern const mcu_pin_obj_t pin_PG11; // 144 only +extern const mcu_pin_obj_t pin_PG12; // 144 only +extern const mcu_pin_obj_t pin_PG13; // 144 only +extern const mcu_pin_obj_t pin_PG14; // 144 only +extern const mcu_pin_obj_t pin_PG15; // 144 only +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +//pg 63 +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm/qstrdefsport.h b/ports/stm/qstrdefsport.h new file mode 100644 index 0000000000..3ba897069b --- /dev/null +++ b/ports/stm/qstrdefsport.h @@ -0,0 +1 @@ +// qstrs specific to this port diff --git a/ports/stm/supervisor/cpu.s b/ports/stm/supervisor/cpu.s new file mode 100755 index 0000000000..9e6807a5e2 --- /dev/null +++ b/ports/stm/supervisor/cpu.s @@ -0,0 +1,27 @@ +.syntax unified +.cpu cortex-m4 +.thumb +.text +.align 2 + +@ uint cpu_get_regs_and_sp(r0=uint regs[10]) +.global cpu_get_regs_and_sp +.thumb +.thumb_func +.type cpu_get_regs_and_sp, %function +cpu_get_regs_and_sp: +@ store registers into given array +str r4, [r0], #4 +str r5, [r0], #4 +str r6, [r0], #4 +str r7, [r0], #4 +str r8, [r0], #4 +str r9, [r0], #4 +str r10, [r0], #4 +str r11, [r0], #4 +str r12, [r0], #4 +str r13, [r0], #4 + +@ return the sp +mov r0, sp +bx lr diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c new file mode 100644 index 0000000000..046b26baf2 --- /dev/null +++ b/ports/stm/supervisor/internal_flash.c @@ -0,0 +1,204 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "supervisor/internal_flash.h" + +#include +#include + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +#include "stm32f4xx_hal.h" + +typedef struct { + uint32_t base_address; + uint32_t sector_size; + uint32_t sector_count; +} flash_layout_t; + +/*------------------------------------------------------------------*/ +/* Internal Flash API + *------------------------------------------------------------------*/ + +static const flash_layout_t flash_layout[] = { + { 0x08000000, 0x04000, 4 }, + { 0x08010000, 0x10000, 1 }, + { 0x08020000, 0x20000, 3 }, + #if defined(FLASH_SECTOR_8) + { 0x08080000, 0x20000, 4 }, + #endif + #if defined(FLASH_SECTOR_12) + { 0x08100000, 0x04000, 4 }, + { 0x08110000, 0x10000, 1 }, + { 0x08120000, 0x20000, 7 }, + #endif +}; + +static uint8_t sector_copy[0x4000] __attribute__((aligned(4))); + +//Return the sector of a given flash address. +uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { + if (addr >= flash_layout[0].base_address) { + uint32_t sector_index = 0; + for (uint8_t i = 0; i < MP_ARRAY_SIZE(flash_layout); ++i) { + for (uint8_t j = 0; j < flash_layout[i].sector_count; ++j) { + uint32_t sector_start_next = flash_layout[i].base_address + + (j + 1) * flash_layout[i].sector_size; + if (addr < sector_start_next) { + if (start_addr != NULL) { + *start_addr = flash_layout[i].base_address + + j * flash_layout[i].sector_size; + } + if (size != NULL) { + *size = flash_layout[i].sector_size; + } + return sector_index; + } + ++sector_index; + } + } + } + return 0; +} + +void supervisor_flash_init(void) { +} + +uint32_t supervisor_flash_get_block_size(void) { + return FILESYSTEM_BLOCK_SIZE; +} + +uint32_t supervisor_flash_get_block_count(void) { + return INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS; +} + +void supervisor_flash_flush(void) { +} + +static int32_t convert_block_to_flash_addr(uint32_t block) { + if (0 <= block && block < INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS) { + // a block in partition 1 + return INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; + } + // bad block + return -1; +} + +mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { + int32_t src = convert_block_to_flash_addr(block); + if (src == -1) { + // bad block number + return false; + } + memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); + return 0; // success +} + +bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { + int32_t dest = convert_block_to_flash_addr(block); + if (dest == -1) { + // bad block number + mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); + return false; + } + + // unlock flash + HAL_FLASH_Unlock(); + + // set up for erase + FLASH_EraseInitTypeDef EraseInitStruct; + EraseInitStruct.TypeErase = TYPEERASE_SECTORS; + EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V + // get the sector information + uint32_t sector_size; + uint32_t sector_start_addr; + EraseInitStruct.Sector = flash_get_sector_info(dest, §or_start_addr, §or_size); + EraseInitStruct.NbSectors = 1; + if (sector_size>0x4000) return false; + + // copy the sector + memcpy(sector_copy,(void *)sector_start_addr,sector_size); + + // // overwrite sector data + memcpy(sector_copy+(dest-sector_start_addr),src,FILESYSTEM_BLOCK_SIZE); + + // find end address, subtract for number of sectors + // Shouldn't be required since blocks will always fit in a single sector, they should never overlap + //EraseInitStruct.NbSectors = flash_get_sector_info(dest + FILESYSTEM_BLOCK_SIZE - 1, NULL, NULL) - EraseInitStruct.Sector + 1; + + // erase the sector + uint32_t SectorError = 0; + if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { + // error occurred during sector erase + HAL_FLASH_Lock(); // lock the flash + mp_printf(&mp_plat_print, "FLASH SECTOR ERASE ERROR"); + return false; + } + + __HAL_FLASH_DATA_CACHE_DISABLE(); + __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); + + __HAL_FLASH_DATA_CACHE_RESET(); + __HAL_FLASH_INSTRUCTION_CACHE_RESET(); + + __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); + __HAL_FLASH_DATA_CACHE_ENABLE(); + + // reprogram the sector + for (uint32_t i = 0; i < sector_size; i++) { + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)sector_copy[i]) != HAL_OK) { + // error occurred during flash write + HAL_FLASH_Lock(); // lock the flash + mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); + return false; + } + sector_start_addr += 1; + } + + // lock the flash + HAL_FLASH_Lock(); + + return true; +} + +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { + + for (size_t i = 0; i < num_blocks; i++) { + if (!supervisor_flash_write_block(src + i * FILESYSTEM_BLOCK_SIZE, block_num + i)) { + return 1; // error + } + } + return 0; // success +} + +void supervisor_flash_release_cache(void) { +} + diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h new file mode 100644 index 0000000000..9f16a799d8 --- /dev/null +++ b/ports/stm/supervisor/internal_flash.h @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H + +#include +#include + +#include "py/mpconfig.h" + +#ifdef STM32F401xE +#define STM32_FLASH_SIZE 0x80000 //512KiB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + +#ifdef STM32F411xE +#define STM32_FLASH_SIZE 0x80000 //512KiB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + +#ifdef STM32F412Zx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + +#ifdef STM32F405xx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + +#ifdef STM32F407xx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + +#define STM32_FLASH_OFFSET 0x8000000 //All STM32 chips map to this flash location + +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) + +#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms +#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) + +#endif // MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H diff --git a/ports/stm/supervisor/internal_flash_root_pointers.h b/ports/stm/supervisor/internal_flash_root_pointers.h new file mode 100644 index 0000000000..7a8681bd95 --- /dev/null +++ b/ports/stm/supervisor/internal_flash_root_pointers.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H +#define MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H + +#define FLASH_ROOT_POINTERS + +#endif // MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c new file mode 100644 index 0000000000..ecb4d3d15c --- /dev/null +++ b/ports/stm/supervisor/port.c @@ -0,0 +1,106 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "supervisor/port.h" +#include "boards/board.h" +#include "tick.h" + +#include "common-hal/microcontroller/Pin.h" +#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 "stm32f4/clocks.h" +#include "stm32f4/gpio.h" + +#include "stm32f4xx_hal.h" + +safe_mode_t port_init(void) { + HAL_Init(); + __HAL_RCC_SYSCFG_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); + + stm32f4_peripherals_clocks_init(); + stm32f4_peripherals_gpio_init(); + + tick_init(); + + return NO_SAFE_MODE; +} + +void reset_port(void) { + reset_all_pins(); + i2c_reset(); + spi_reset(); + uart_reset(); + pwmout_reset(); + pulseout_reset(); +} + +void reset_to_bootloader(void) { + +} + +void reset_cpu(void) { + NVIC_SystemReset(); +} + +uint32_t *port_heap_get_bottom(void) { + return port_stack_get_limit(); +} + +uint32_t *port_heap_get_top(void) { + return port_stack_get_top(); +} + +uint32_t *port_stack_get_limit(void) { + return &_ebss; +} + +uint32_t *port_stack_get_top(void) { + return &_estack; +} + +extern uint32_t _ebss; +// Place the word to save just after our BSS section that gets blanked. +void port_set_saved_word(uint32_t value) { + _ebss = value; +} + +uint32_t port_get_saved_word(void) { + return _ebss; +} + +void HardFault_Handler(void) { + reset_into_safe_mode(HARD_CRASH); + while (true) { + asm("nop;"); + } +} diff --git a/ports/stm/supervisor/qspi_flash.c b/ports/stm/supervisor/qspi_flash.c new file mode 100644 index 0000000000..f3915273b3 --- /dev/null +++ b/ports/stm/supervisor/qspi_flash.c @@ -0,0 +1,162 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/spi_flash_api.h" + +#include +#include + +#include "py/mpconfig.h" // for EXTERNAL_FLASH_QSPI_DUAL +//#include "nrfx_qspi.h" + +//#include "shared-bindings/microcontroller/__init__.h" + +#include "supervisor/shared/external_flash/common_commands.h" +#include "supervisor/shared/external_flash/qspi_flash.h" + +bool spi_flash_command(uint8_t command) { + // nrf_qspi_cinstr_conf_t cinstr_cfg = { + // .opcode = command, + // .length = 1, + // .io2_level = true, + // .io3_level = true, + // .wipwait = false, + // .wren = false + // }; + return false; //nrfx_qspi_cinstr_xfer(&cinstr_cfg, NULL, NULL) == NRFX_SUCCESS; +} + +bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) { + // nrf_qspi_cinstr_conf_t cinstr_cfg = { + // .opcode = command, + // .length = length + 1, + // .io2_level = true, + // .io3_level = true, + // .wipwait = false, + // .wren = false + // }; + // return nrfx_qspi_cinstr_xfer(&cinstr_cfg, NULL, response) == NRFX_SUCCESS; + return false; + +} + +bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { + // nrf_qspi_cinstr_conf_t cinstr_cfg = { + // .opcode = command, + // .length = length + 1, + // .io2_level = true, + // .io3_level = true, + // .wipwait = false, + // .wren = false // We do this manually. + // }; + // return nrfx_qspi_cinstr_xfer(&cinstr_cfg, data, NULL) == NRFX_SUCCESS; + return false; +} + +bool spi_flash_sector_command(uint8_t command, uint32_t address) { + // if (command != CMD_SECTOR_ERASE) { + // return false; + // } + // return nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, address) == NRFX_SUCCESS; + return false; +} + +bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { + // return nrfx_qspi_write(data, length, address) == NRFX_SUCCESS; + return false; +} + +bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { + // return nrfx_qspi_read(data, length, address) == NRFX_SUCCESS; + return false; +} + +void spi_flash_init(void) { + // Init QSPI flash +// nrfx_qspi_config_t qspi_cfg = { +// .xip_offset = 0, +// .pins = { +// .sck_pin = MICROPY_QSPI_SCK, +// .csn_pin = MICROPY_QSPI_CS, +// .io0_pin = MICROPY_QSPI_DATA0, +// .io1_pin = NRF_QSPI_PIN_NOT_CONNECTED, +// .io2_pin = NRF_QSPI_PIN_NOT_CONNECTED, +// .io3_pin = NRF_QSPI_PIN_NOT_CONNECTED, + +// }, +// .prot_if = { +// .readoc = NRF_QSPI_READOC_FASTREAD, +// .writeoc = NRF_QSPI_WRITEOC_PP, +// .addrmode = NRF_QSPI_ADDRMODE_24BIT, +// .dpmconfig = false +// }, +// .phy_if = { +// .sck_freq = NRF_QSPI_FREQ_32MDIV16, // Start at a slow 2MHz and speed up once we know what we're talking to. +// .sck_delay = 10, // min time CS must stay high before going low again. in unit of 62.5 ns +// .spi_mode = NRF_QSPI_MODE_0, +// .dpmen = false +// }, +// .irq_priority = 7, +// }; + +// #if EXTERNAL_FLASH_QSPI_DUAL +// qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1; +// qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ2O; +// qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP2O; +// #else +// qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1; +// qspi_cfg.pins.io2_pin = MICROPY_QSPI_DATA2; +// qspi_cfg.pins.io3_pin = MICROPY_QSPI_DATA3; +// qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ4IO; +// qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP4O; +// #endif + +// // No callback for blocking API +// nrfx_qspi_init(&qspi_cfg, NULL, NULL); +} + +void spi_flash_init_device(const external_flash_device* device) { + // check_quad_enable(device); + + // // Switch to single output line if the device doesn't support quad programs. + // if (!device->supports_qspi_writes) { + // NRF_QSPI->IFCONFIG0 &= ~QSPI_IFCONFIG0_WRITEOC_Msk; + // NRF_QSPI->IFCONFIG0 |= QSPI_IFCONFIG0_WRITEOC_PP << QSPI_IFCONFIG0_WRITEOC_Pos; + // } + + // // Speed up as much as we can. + // // Start at 16 MHz and go down. + // // At 32 MHz GD25Q16C doesn't work reliably on Feather 52840, even though it should work up to 104 MHz. + // // sckfreq = 0 is 32 Mhz + // // sckfreq = 1 is 16 MHz, etc. + // uint8_t sckfreq = 1; + // while (32000000 / (sckfreq + 1) > device->max_clock_speed_mhz * 1000000 && sckfreq < 16) { + // sckfreq += 1; + // } + // NRF_QSPI->IFCONFIG1 &= ~QSPI_IFCONFIG1_SCKFREQ_Msk; + // NRF_QSPI->IFCONFIG1 |= sckfreq << QSPI_IFCONFIG1_SCKFREQ_Pos; +} diff --git a/ports/stm/supervisor/serial.c b/ports/stm/supervisor/serial.c new file mode 100644 index 0000000000..ce13660000 --- /dev/null +++ b/ports/stm/supervisor/serial.c @@ -0,0 +1,75 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include +#include "supervisor/serial.h" +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" + +UART_HandleTypeDef huart2; + +void serial_init(void) { + huart2.Instance = USART2; + huart2.Init.BaudRate = 115200; + huart2.Init.WordLength = UART_WORDLENGTH_8B; + huart2.Init.StopBits = UART_STOPBITS_1; + huart2.Init.Parity = UART_PARITY_NONE; + huart2.Init.Mode = UART_MODE_TX_RX; + huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart2.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&huart2) == HAL_OK) + { + stm32f4_peripherals_status_led(1,1); + } +} + +bool serial_connected(void) { + return true; +} + +char serial_read(void) { + uint8_t data; + HAL_UART_Receive(&huart2, &data, 1,500); + return data; +} + +bool serial_bytes_available(void) { + return __HAL_UART_GET_FLAG(&huart2, UART_FLAG_RXNE); +} + +void serial_write(const char* text) { + serial_write_substring(text, strlen(text)); +} + +void serial_write_substring(const char *text, uint32_t len) { + if (len == 0) { + return; + } + HAL_UART_Transmit(&huart2, (uint8_t*)text, len, 5000); +} + diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c new file mode 100644 index 0000000000..358c2de5b3 --- /dev/null +++ b/ports/stm/supervisor/usb.c @@ -0,0 +1,112 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "tick.h" +#include "supervisor/usb.h" +#include "lib/utils/interrupt_char.h" +#include "lib/mp-readline/readline.h" +#include "stm32f4xx_hal.h" + +#include "py/mpconfig.h" + +#include "common-hal/microcontroller/Pin.h" + +STATIC void init_usb_vbus_sense(void) { + +#if (BOARD_NO_VBUS_SENSE) + // Disable VBUS sensing + #ifdef USB_OTG_GCCFG_VBDEN + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; + #else + USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN; + #endif +#else + // Enable VBUS hardware sensing + #ifdef USB_OTG_GCCFG_VBDEN + USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN; + #else + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS; + USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN; // B Device sense + #endif +#endif +} + +void init_usb_hardware(void) { + //TODO: if future chips overload this with options, move to peripherals management. + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + /**USB_OTG_FS GPIO Configuration + PA10 ------> USB_OTG_FS_ID + PA11 ------> USB_OTG_FS_DM + PA12 ------> USB_OTG_FS_DP + */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + + /* Configure DM DP Pins */ + GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; + GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + never_reset_pin_number(0, 11); + never_reset_pin_number(0, 12); + + /* Configure VBUS Pin */ + GPIO_InitStruct.Pin = GPIO_PIN_9; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + never_reset_pin_number(0, 9); + + /* This for ID line debug */ + GPIO_InitStruct.Pin = GPIO_PIN_10; + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + never_reset_pin_number(0, 10); + +#ifdef STM32F412Zx + /* Configure POWER_SWITCH IO pin (F412 ONLY)*/ + GPIO_InitStruct.Pin = GPIO_PIN_8; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); + never_reset_pin_number(0, 8); +#endif + + /* Peripheral clock enable */ + __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); + __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); + + init_usb_vbus_sense(); +} diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/system_stm32f4xx.c new file mode 100644 index 0000000000..caa4f9cafb --- /dev/null +++ b/ports/stm/system_stm32f4xx.c @@ -0,0 +1,788 @@ +/* + * Taken from ST Cube library and modified. See below for original header. + * + * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + ****************************************************************************** + * @file system_stm32f4xx.c + * @author MCD Application Team + * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32f4xx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32f4xx_system + * @{ + */ + +/** @addtogroup STM32F4xx_System_Private_Includes + * @{ + */ + + +#include "stm32f4xx.h" +#include "py/mpconfig.h" + +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_Defines + * @{ + */ + +/************************* Miscellaneous Configuration ************************/ +/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ + || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) +/* #define DATA_IN_ExtSRAM */ +#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ + STM32F412Zx || STM32F412Vx */ + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) +/* #define DATA_IN_ExtSDRAM */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\ + STM32F479xx */ + +/*!< Uncomment the following line if you need to relocate your vector Table in + Internal SRAM. */ +/* #define VECT_TAB_SRAM */ +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. + This value must be a multiple of 0x200. */ +/******************************************************************************/ + +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_Variables + * @{ + */ + /* This variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock; then there + is no need to call the 2 first functions listed above, since SystemCoreClock + variable is updated automatically. + */ +uint32_t SystemCoreClock = 16000000; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes + * @{ + */ + +#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) + static void SystemInit_ExtMemCtl(void); +#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ + +/** + * @} + */ + +/** @addtogroup STM32F4xx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system + * Initialize the FPU setting, vector table location and External memory + * configuration. + * @param None + * @retval None + */ +void SystemInit(void) +{ + /* FPU settings ------------------------------------------------------------*/ + #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ + #endif + /* Reset the RCC clock configuration to the default reset state ------------*/ + /* Set HSION bit */ + RCC->CR |= (uint32_t)0x00000001; + + /* Reset CFGR register */ + RCC->CFGR = 0x00000000; + + /* Reset HSEON, CSSON and PLLON bits */ + RCC->CR &= (uint32_t)0xFEF6FFFF; + + /* Reset PLLCFGR register */ + RCC->PLLCFGR = 0x24003010; + + /* Reset HSEBYP bit */ + RCC->CR &= (uint32_t)0xFFFBFFFF; + + /* Disable all interrupts */ + RCC->CIR = 0x00000000; + +#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) + SystemInit_ExtMemCtl(); +#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ + + /* Configure the Vector Table location add offset address ------------------*/ +#if !(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already + #ifdef VECT_TAB_SRAM + SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ + #else + SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + #endif +#endif +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * or HSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value + * depends on the application requirements), user has to ensure that HSE_VALUE + * is same as the real frequency of the crystal used. Otherwise, this function + * may have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; + + /* Get SYSCLK source -------------------------------------------------------*/ + tmp = RCC->CFGR & RCC_CFGR_SWS; + + switch (tmp) + { + case 0x00: /* HSI used as system clock source */ + SystemCoreClock = HSI_VALUE; + break; + case 0x04: /* HSE used as system clock source */ + SystemCoreClock = HSE_VALUE; + break; + case 0x08: /* PLL used as system clock source */ + + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N + SYSCLK = PLL_VCO / PLL_P + */ + pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; + pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; + + if (pllsource != 0) + { + /* HSE used as PLL clock source */ + pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + } + else + { + /* HSI used as PLL clock source */ + pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + } + + pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; + SystemCoreClock = pllvco/pllp; + break; + default: + SystemCoreClock = HSI_VALUE; + break; + } + /* Compute HCLK frequency --------------------------------------------------*/ + /* Get HCLK prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; + /* HCLK frequency */ + SystemCoreClock >>= tmp; +} + +#if defined (DATA_IN_ExtSRAM) && defined (DATA_IN_ExtSDRAM) +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F469xx) || defined(STM32F479xx) +/** + * @brief Setup the external memory controller. + * Called in startup_stm32f4xx.s before jump to main. + * This function configures the external memories (SRAM/SDRAM) + * This SRAM/SDRAM will be used as program data memory (including heap and stack). + * @param None + * @retval None + */ +void SystemInit_ExtMemCtl(void) +{ + __IO uint32_t tmp = 0x00; + + register uint32_t tmpreg = 0, timeout = 0xFFFF; + register __IO uint32_t index; + + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ + RCC->AHB1ENR |= 0x000001F8; + + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); + + /* Connect PDx pins to FMC Alternate function */ + GPIOD->AFR[0] = 0x00CCC0CC; + GPIOD->AFR[1] = 0xCCCCCCCC; + /* Configure PDx pins in Alternate function mode */ + GPIOD->MODER = 0xAAAA0A8A; + /* Configure PDx pins speed to 100 MHz */ + GPIOD->OSPEEDR = 0xFFFF0FCF; + /* Configure PDx pins Output type to push-pull */ + GPIOD->OTYPER = 0x00000000; + /* No pull-up, pull-down for PDx pins */ + GPIOD->PUPDR = 0x00000000; + + /* Connect PEx pins to FMC Alternate function */ + GPIOE->AFR[0] = 0xC00CC0CC; + GPIOE->AFR[1] = 0xCCCCCCCC; + /* Configure PEx pins in Alternate function mode */ + GPIOE->MODER = 0xAAAA828A; + /* Configure PEx pins speed to 100 MHz */ + GPIOE->OSPEEDR = 0xFFFFC3CF; + /* Configure PEx pins Output type to push-pull */ + GPIOE->OTYPER = 0x00000000; + /* No pull-up, pull-down for PEx pins */ + GPIOE->PUPDR = 0x00000000; + + /* Connect PFx pins to FMC Alternate function */ + GPIOF->AFR[0] = 0xCCCCCCCC; + GPIOF->AFR[1] = 0xCCCCCCCC; + /* Configure PFx pins in Alternate function mode */ + GPIOF->MODER = 0xAA800AAA; + /* Configure PFx pins speed to 50 MHz */ + GPIOF->OSPEEDR = 0xAA800AAA; + /* Configure PFx pins Output type to push-pull */ + GPIOF->OTYPER = 0x00000000; + /* No pull-up, pull-down for PFx pins */ + GPIOF->PUPDR = 0x00000000; + + /* Connect PGx pins to FMC Alternate function */ + GPIOG->AFR[0] = 0xCCCCCCCC; + GPIOG->AFR[1] = 0xCCCCCCCC; + /* Configure PGx pins in Alternate function mode */ + GPIOG->MODER = 0xAAAAAAAA; + /* Configure PGx pins speed to 50 MHz */ + GPIOG->OSPEEDR = 0xAAAAAAAA; + /* Configure PGx pins Output type to push-pull */ + GPIOG->OTYPER = 0x00000000; + /* No pull-up, pull-down for PGx pins */ + GPIOG->PUPDR = 0x00000000; + + /* Connect PHx pins to FMC Alternate function */ + GPIOH->AFR[0] = 0x00C0CC00; + GPIOH->AFR[1] = 0xCCCCCCCC; + /* Configure PHx pins in Alternate function mode */ + GPIOH->MODER = 0xAAAA08A0; + /* Configure PHx pins speed to 50 MHz */ + GPIOH->OSPEEDR = 0xAAAA08A0; + /* Configure PHx pins Output type to push-pull */ + GPIOH->OTYPER = 0x00000000; + /* No pull-up, pull-down for PHx pins */ + GPIOH->PUPDR = 0x00000000; + + /* Connect PIx pins to FMC Alternate function */ + GPIOI->AFR[0] = 0xCCCCCCCC; + GPIOI->AFR[1] = 0x00000CC0; + /* Configure PIx pins in Alternate function mode */ + GPIOI->MODER = 0x0028AAAA; + /* Configure PIx pins speed to 50 MHz */ + GPIOI->OSPEEDR = 0x0028AAAA; + /* Configure PIx pins Output type to push-pull */ + GPIOI->OTYPER = 0x00000000; + /* No pull-up, pull-down for PIx pins */ + GPIOI->PUPDR = 0x00000000; + +/*-- FMC Configuration -------------------------------------------------------*/ + /* Enable the FMC interface clock */ + RCC->AHB3ENR |= 0x00000001; + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); + + FMC_Bank5_6->SDCR[0] = 0x000019E4; + FMC_Bank5_6->SDTR[0] = 0x01115351; + + /* SDRAM initialization sequence */ + /* Clock enable command */ + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Delay */ + for (index = 0; index<1000; index++); + + /* PALL command */ + FMC_Bank5_6->SDCMR = 0x00000012; + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Auto refresh command */ + FMC_Bank5_6->SDCMR = 0x00000073; + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* MRD register program */ + FMC_Bank5_6->SDCMR = 0x00046014; + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Set refresh count */ + tmpreg = FMC_Bank5_6->SDRTR; + FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); + + /* Disable write protection */ + tmpreg = FMC_Bank5_6->SDCR[0]; + FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* Configure and enable Bank1_SRAM2 */ + FMC_Bank1->BTCR[2] = 0x00001011; + FMC_Bank1->BTCR[3] = 0x00000201; + FMC_Bank1E->BWTR[2] = 0x0fffffff; +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#if defined(STM32F469xx) || defined(STM32F479xx) + /* Configure and enable Bank1_SRAM2 */ + FMC_Bank1->BTCR[2] = 0x00001091; + FMC_Bank1->BTCR[3] = 0x00110212; + FMC_Bank1E->BWTR[2] = 0x0fffffff; +#endif /* STM32F469xx || STM32F479xx */ + + (void)(tmp); +} +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ +#elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) +/** + * @brief Setup the external memory controller. + * Called in startup_stm32f4xx.s before jump to main. + * This function configures the external memories (SRAM/SDRAM) + * This SRAM/SDRAM will be used as program data memory (including heap and stack). + * @param None + * @retval None + */ +void SystemInit_ExtMemCtl(void) +{ + __IO uint32_t tmp = 0x00; +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) +#if defined (DATA_IN_ExtSDRAM) + register uint32_t tmpreg = 0, timeout = 0xFFFF; + register __IO uint32_t index; + +#if defined(STM32F446xx) + /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface + clock */ + RCC->AHB1ENR |= 0x0000007D; +#else + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface + clock */ + RCC->AHB1ENR |= 0x000001F8; +#endif /* STM32F446xx */ + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); + +#if defined(STM32F446xx) + /* Connect PAx pins to FMC Alternate function */ + GPIOA->AFR[0] |= 0xC0000000; + GPIOA->AFR[1] |= 0x00000000; + /* Configure PDx pins in Alternate function mode */ + GPIOA->MODER |= 0x00008000; + /* Configure PDx pins speed to 50 MHz */ + GPIOA->OSPEEDR |= 0x00008000; + /* Configure PDx pins Output type to push-pull */ + GPIOA->OTYPER |= 0x00000000; + /* No pull-up, pull-down for PDx pins */ + GPIOA->PUPDR |= 0x00000000; + + /* Connect PCx pins to FMC Alternate function */ + GPIOC->AFR[0] |= 0x00CC0000; + GPIOC->AFR[1] |= 0x00000000; + /* Configure PDx pins in Alternate function mode */ + GPIOC->MODER |= 0x00000A00; + /* Configure PDx pins speed to 50 MHz */ + GPIOC->OSPEEDR |= 0x00000A00; + /* Configure PDx pins Output type to push-pull */ + GPIOC->OTYPER |= 0x00000000; + /* No pull-up, pull-down for PDx pins */ + GPIOC->PUPDR |= 0x00000000; +#endif /* STM32F446xx */ + + /* Connect PDx pins to FMC Alternate function */ + GPIOD->AFR[0] = 0x000000CC; + GPIOD->AFR[1] = 0xCC000CCC; + /* Configure PDx pins in Alternate function mode */ + GPIOD->MODER = 0xA02A000A; + /* Configure PDx pins speed to 50 MHz */ + GPIOD->OSPEEDR = 0xA02A000A; + /* Configure PDx pins Output type to push-pull */ + GPIOD->OTYPER = 0x00000000; + /* No pull-up, pull-down for PDx pins */ + GPIOD->PUPDR = 0x00000000; + + /* Connect PEx pins to FMC Alternate function */ + GPIOE->AFR[0] = 0xC00000CC; + GPIOE->AFR[1] = 0xCCCCCCCC; + /* Configure PEx pins in Alternate function mode */ + GPIOE->MODER = 0xAAAA800A; + /* Configure PEx pins speed to 50 MHz */ + GPIOE->OSPEEDR = 0xAAAA800A; + /* Configure PEx pins Output type to push-pull */ + GPIOE->OTYPER = 0x00000000; + /* No pull-up, pull-down for PEx pins */ + GPIOE->PUPDR = 0x00000000; + + /* Connect PFx pins to FMC Alternate function */ + GPIOF->AFR[0] = 0xCCCCCCCC; + GPIOF->AFR[1] = 0xCCCCCCCC; + /* Configure PFx pins in Alternate function mode */ + GPIOF->MODER = 0xAA800AAA; + /* Configure PFx pins speed to 50 MHz */ + GPIOF->OSPEEDR = 0xAA800AAA; + /* Configure PFx pins Output type to push-pull */ + GPIOF->OTYPER = 0x00000000; + /* No pull-up, pull-down for PFx pins */ + GPIOF->PUPDR = 0x00000000; + + /* Connect PGx pins to FMC Alternate function */ + GPIOG->AFR[0] = 0xCCCCCCCC; + GPIOG->AFR[1] = 0xCCCCCCCC; + /* Configure PGx pins in Alternate function mode */ + GPIOG->MODER = 0xAAAAAAAA; + /* Configure PGx pins speed to 50 MHz */ + GPIOG->OSPEEDR = 0xAAAAAAAA; + /* Configure PGx pins Output type to push-pull */ + GPIOG->OTYPER = 0x00000000; + /* No pull-up, pull-down for PGx pins */ + GPIOG->PUPDR = 0x00000000; + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F469xx) || defined(STM32F479xx) + /* Connect PHx pins to FMC Alternate function */ + GPIOH->AFR[0] = 0x00C0CC00; + GPIOH->AFR[1] = 0xCCCCCCCC; + /* Configure PHx pins in Alternate function mode */ + GPIOH->MODER = 0xAAAA08A0; + /* Configure PHx pins speed to 50 MHz */ + GPIOH->OSPEEDR = 0xAAAA08A0; + /* Configure PHx pins Output type to push-pull */ + GPIOH->OTYPER = 0x00000000; + /* No pull-up, pull-down for PHx pins */ + GPIOH->PUPDR = 0x00000000; + + /* Connect PIx pins to FMC Alternate function */ + GPIOI->AFR[0] = 0xCCCCCCCC; + GPIOI->AFR[1] = 0x00000CC0; + /* Configure PIx pins in Alternate function mode */ + GPIOI->MODER = 0x0028AAAA; + /* Configure PIx pins speed to 50 MHz */ + GPIOI->OSPEEDR = 0x0028AAAA; + /* Configure PIx pins Output type to push-pull */ + GPIOI->OTYPER = 0x00000000; + /* No pull-up, pull-down for PIx pins */ + GPIOI->PUPDR = 0x00000000; +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ + +/*-- FMC Configuration -------------------------------------------------------*/ + /* Enable the FMC interface clock */ + RCC->AHB3ENR |= 0x00000001; + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); + + /* Configure and enable SDRAM bank1 */ +#if defined(STM32F446xx) + FMC_Bank5_6->SDCR[0] = 0x00001954; +#else + FMC_Bank5_6->SDCR[0] = 0x000019E4; +#endif /* STM32F446xx */ + FMC_Bank5_6->SDTR[0] = 0x01115351; + + /* SDRAM initialization sequence */ + /* Clock enable command */ + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Delay */ + for (index = 0; index<1000; index++); + + /* PALL command */ + FMC_Bank5_6->SDCMR = 0x00000012; + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Auto refresh command */ +#if defined(STM32F446xx) + FMC_Bank5_6->SDCMR = 0x000000F3; +#else + FMC_Bank5_6->SDCMR = 0x00000073; +#endif /* STM32F446xx */ + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* MRD register program */ +#if defined(STM32F446xx) + FMC_Bank5_6->SDCMR = 0x00044014; +#else + FMC_Bank5_6->SDCMR = 0x00046014; +#endif /* STM32F446xx */ + timeout = 0xFFFF; + while((tmpreg != 0) && (timeout-- > 0)) + { + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + + /* Set refresh count */ + tmpreg = FMC_Bank5_6->SDRTR; +#if defined(STM32F446xx) + FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); +#else + FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); +#endif /* STM32F446xx */ + + /* Disable write protection */ + tmpreg = FMC_Bank5_6->SDCR[0]; + FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); +#endif /* DATA_IN_ExtSDRAM */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ + +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ + || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) + +#if defined(DATA_IN_ExtSRAM) +/*-- GPIOs Configuration -----------------------------------------------------*/ + /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ + RCC->AHB1ENR |= 0x00000078; + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); + + /* Connect PDx pins to FMC Alternate function */ + GPIOD->AFR[0] = 0x00CCC0CC; + GPIOD->AFR[1] = 0xCCCCCCCC; + /* Configure PDx pins in Alternate function mode */ + GPIOD->MODER = 0xAAAA0A8A; + /* Configure PDx pins speed to 100 MHz */ + GPIOD->OSPEEDR = 0xFFFF0FCF; + /* Configure PDx pins Output type to push-pull */ + GPIOD->OTYPER = 0x00000000; + /* No pull-up, pull-down for PDx pins */ + GPIOD->PUPDR = 0x00000000; + + /* Connect PEx pins to FMC Alternate function */ + GPIOE->AFR[0] = 0xC00CC0CC; + GPIOE->AFR[1] = 0xCCCCCCCC; + /* Configure PEx pins in Alternate function mode */ + GPIOE->MODER = 0xAAAA828A; + /* Configure PEx pins speed to 100 MHz */ + GPIOE->OSPEEDR = 0xFFFFC3CF; + /* Configure PEx pins Output type to push-pull */ + GPIOE->OTYPER = 0x00000000; + /* No pull-up, pull-down for PEx pins */ + GPIOE->PUPDR = 0x00000000; + + /* Connect PFx pins to FMC Alternate function */ + GPIOF->AFR[0] = 0x00CCCCCC; + GPIOF->AFR[1] = 0xCCCC0000; + /* Configure PFx pins in Alternate function mode */ + GPIOF->MODER = 0xAA000AAA; + /* Configure PFx pins speed to 100 MHz */ + GPIOF->OSPEEDR = 0xFF000FFF; + /* Configure PFx pins Output type to push-pull */ + GPIOF->OTYPER = 0x00000000; + /* No pull-up, pull-down for PFx pins */ + GPIOF->PUPDR = 0x00000000; + + /* Connect PGx pins to FMC Alternate function */ + GPIOG->AFR[0] = 0x00CCCCCC; + GPIOG->AFR[1] = 0x000000C0; + /* Configure PGx pins in Alternate function mode */ + GPIOG->MODER = 0x00085AAA; + /* Configure PGx pins speed to 100 MHz */ + GPIOG->OSPEEDR = 0x000CAFFF; + /* Configure PGx pins Output type to push-pull */ + GPIOG->OTYPER = 0x00000000; + /* No pull-up, pull-down for PGx pins */ + GPIOG->PUPDR = 0x00000000; + +/*-- FMC/FSMC Configuration --------------------------------------------------*/ + /* Enable the FMC/FSMC interface clock */ + RCC->AHB3ENR |= 0x00000001; + +#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); + /* Configure and enable Bank1_SRAM2 */ + FMC_Bank1->BTCR[2] = 0x00001011; + FMC_Bank1->BTCR[3] = 0x00000201; + FMC_Bank1E->BWTR[2] = 0x0fffffff; +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#if defined(STM32F469xx) || defined(STM32F479xx) + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); + /* Configure and enable Bank1_SRAM2 */ + FMC_Bank1->BTCR[2] = 0x00001091; + FMC_Bank1->BTCR[3] = 0x00110212; + FMC_Bank1E->BWTR[2] = 0x0fffffff; +#endif /* STM32F469xx || STM32F479xx */ +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\ + || defined(STM32F412Zx) || defined(STM32F412Vx) + /* Delay after an RCC peripheral clock enabling */ + tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); + /* Configure and enable Bank1_SRAM2 */ + FSMC_Bank1->BTCR[2] = 0x00001011; + FSMC_Bank1->BTCR[3] = 0x00000201; + FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ + +#endif /* DATA_IN_ExtSRAM */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ + (void)(tmp); +} +#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/tick.c b/ports/stm/tick.c new file mode 100644 index 0000000000..f4adf183aa --- /dev/null +++ b/ports/stm/tick.c @@ -0,0 +1,81 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "tick.h" + +#include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" +#include "shared-bindings/microcontroller/Processor.h" + +#include "stm32f4xx.h" + +void SysTick_Handler(void) { + // SysTick interrupt handler called when the SysTick timer reaches zero + // (every millisecond). + + // Do things common to all ports when the tick occurs + supervisor_tick(); +} + +uint32_t HAL_GetTick(void) //override ST HAL +{ + return (uint32_t)supervisor_ticks_ms32(); +} + +void tick_init() { + uint32_t ticks_per_ms = SystemCoreClock/ 1000; + SysTick_Config(ticks_per_ms); // interrupt is enabled + + NVIC_EnableIRQ(SysTick_IRQn); + // Bump up the systick interrupt so nothing else interferes with timekeeping. + NVIC_SetPriority(SysTick_IRQn, 0); + NVIC_SetPriority(OTG_FS_IRQn, 1); +} + +void tick_delay(uint32_t us) { + uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; + uint64_t start_ms = supervisor_ticks_ms64(); + while (us > 1000) { + while (supervisor_ticks_ms64() == start_ms) {} + us -= us_between_ticks; + start_ms = supervisor_ticks_ms64(); + us_between_ticks = 1000; + } + while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} +} + +// us counts down! +void current_tick(uint64_t* ms, uint32_t* us_until_ms) { + uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + *ms = supervisor_ticks_ms32(); + *us_until_ms = SysTick->VAL / ticks_per_us; +} + +void wait_until(uint64_t ms, uint32_t us_until_ms) { + uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} +} diff --git a/ports/stm/tick.h b/ports/stm/tick.h new file mode 100644 index 0000000000..999acc7a3c --- /dev/null +++ b/ports/stm/tick.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_STM32F4_TICK_H +#define MICROPY_INCLUDED_STM32F4_TICK_H + +#include "py/mpconfig.h" + +#include + +extern struct timer_descriptor ms_timer; + +void tick_init(void); + +void tick_delay(uint32_t us); + +void current_tick(uint64_t* ms, uint32_t* us_until_ms); +// Do not call this with interrupts disabled because it may be waiting for +// ticks_ms to increment. +void wait_until(uint64_t ms, uint32_t us_until_ms); + +#endif // MICROPY_INCLUDED_STM32F4_TICK_H From be7def128ac47c8128c06f187d11e6d501ec55fe Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 18:16:16 -0400 Subject: [PATCH 051/919] submodule move and sync --- .gitmodules | 4 ++-- ports/{stm32f4 => stm}/stm32f4 | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ports/{stm32f4 => stm}/stm32f4 (100%) diff --git a/.gitmodules b/.gitmodules index c25239882e..6300339d16 100644 --- a/.gitmodules +++ b/.gitmodules @@ -96,8 +96,8 @@ [submodule "frozen/circuitpython-stage"] path = frozen/circuitpython-stage url = https://github.com/python-ugame/circuitpython-stage.git -[submodule "ports/stm32f4/stm32f4"] - path = ports/stm32f4/stm32f4 +[submodule "ports/stm/stm32f4"] + path = ports/stm/stm32f4 url = https://github.com/adafruit/stm32f4.git [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk diff --git a/ports/stm32f4/stm32f4 b/ports/stm/stm32f4 similarity index 100% rename from ports/stm32f4/stm32f4 rename to ports/stm/stm32f4 From 127e531271ede39aa413fa3b9b365d72942d8900 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 18:16:52 -0400 Subject: [PATCH 052/919] remove old directory --- ports/stm32f4/.gitignore | 9 - ports/stm32f4/Makefile | 284 ------- ports/stm32f4/README.md | 3 - ports/stm32f4/background.c | 60 -- ports/stm32f4/background.h | 35 - ports/stm32f4/boards/STM32F401xd_fs.ld | 107 --- ports/stm32f4/boards/STM32F401xe_boot.ld | 106 --- ports/stm32f4/boards/STM32F401xe_fs.ld | 107 --- ports/stm32f4/boards/STM32F405_boot.ld | 107 --- ports/stm32f4/boards/STM32F405_default.ld | 107 --- ports/stm32f4/boards/STM32F405_fs.ld | 108 --- ports/stm32f4/boards/STM32F407_fs.ld | 108 --- ports/stm32f4/boards/STM32F411VETx_FLASH.ld | 109 --- ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld | 105 --- ports/stm32f4/boards/board.h | 45 - ports/stm32f4/boards/espruino_pico/README.md | 15 - ports/stm32f4/boards/espruino_pico/board.c | 39 - .../boards/espruino_pico/mpconfigboard.h | 39 - .../boards/espruino_pico/mpconfigboard.mk | 16 - ports/stm32f4/boards/espruino_pico/pins.c | 33 - .../boards/espruino_pico/stm32f4xx_hal_conf.h | 440 ---------- ports/stm32f4/boards/espruino_wifi/README.MD | 15 - ports/stm32f4/boards/espruino_wifi/board.c | 38 - .../boards/espruino_wifi/mpconfigboard.h | 36 - .../boards/espruino_wifi/mpconfigboard.mk | 16 - ports/stm32f4/boards/espruino_wifi/pins.c | 39 - .../boards/espruino_wifi/stm32f4xx_hal_conf.h | 439 ---------- .../boards/feather_stm32f405_express/board.c | 39 - .../feather_stm32f405_express/mpconfigboard.h | 58 -- .../mpconfigboard.mk | 22 - .../boards/feather_stm32f405_express/pins.c | 35 - .../stm32f4xx_hal_conf.h | 440 ---------- ports/stm32f4/boards/meowbit_v121/board.c | 121 --- .../boards/meowbit_v121/mpconfigboard.h | 47 -- .../boards/meowbit_v121/mpconfigboard.mk | 24 - ports/stm32f4/boards/meowbit_v121/pins.c | 68 -- .../boards/meowbit_v121/stm32f4xx_hal_conf.h | 440 ---------- ports/stm32f4/boards/openocd_stm32f4.cfg | 44 - ports/stm32f4/boards/pyb_nano_v2/board.c | 39 - .../boards/pyb_nano_v2/mpconfigboard.h | 47 -- .../boards/pyb_nano_v2/mpconfigboard.mk | 18 - ports/stm32f4/boards/pyb_nano_v2/pins.c | 59 -- .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 440 ---------- ports/stm32f4/boards/pyboard_v11/board.c | 38 - .../boards/pyboard_v11/mpconfigboard.h | 38 - .../boards/pyboard_v11/mpconfigboard.mk | 16 - ports/stm32f4/boards/pyboard_v11/pins.c | 52 -- .../boards/pyboard_v11/stm32f4xx_hal_conf.h | 440 ---------- ports/stm32f4/boards/startup_stm32f401xe.s | 448 ---------- ports/stm32f4/boards/startup_stm32f405xx.s | 516 ------------ ports/stm32f4/boards/startup_stm32f407xx.s | 516 ------------ ports/stm32f4/boards/startup_stm32f411xe.s | 452 ---------- ports/stm32f4/boards/startup_stm32f412zx.s | 524 ------------ .../boards/stm32f411ce_blackpill/board.c | 39 - .../stm32f411ce_blackpill/mpconfigboard.h | 48 -- .../stm32f411ce_blackpill/mpconfigboard.mk | 21 - .../boards/stm32f411ce_blackpill/pins.c | 39 - .../stm32f4xx_hal_conf.h | 440 ---------- .../boards/stm32f411ve_discovery/board.c | 38 - .../stm32f411ve_discovery/mpconfigboard.h | 35 - .../stm32f411ve_discovery/mpconfigboard.mk | 16 - .../boards/stm32f411ve_discovery/pins.c | 106 --- .../stm32f4xx_hal_conf.h | 439 ---------- .../boards/stm32f412zg_discovery/board.c | 38 - .../stm32f412zg_discovery/mpconfigboard.h | 38 - .../stm32f412zg_discovery/mpconfigboard.mk | 22 - .../boards/stm32f412zg_discovery/pins.c | 94 --- .../stm32f4xx_hal_conf.h | 438 ---------- .../stm32f4/boards/stm32f4_discovery/board.c | 38 - .../boards/stm32f4_discovery/mpconfigboard.h | 35 - .../boards/stm32f4_discovery/mpconfigboard.mk | 18 - ports/stm32f4/boards/stm32f4_discovery/pins.c | 107 --- .../stm32f4_discovery/stm32f4xx_hal_conf.h | 439 ---------- ports/stm32f4/common-hal/analogio/AnalogIn.c | 129 --- ports/stm32f4/common-hal/analogio/AnalogIn.h | 48 -- ports/stm32f4/common-hal/analogio/AnalogOut.c | 124 --- ports/stm32f4/common-hal/analogio/AnalogOut.h | 49 -- ports/stm32f4/common-hal/analogio/__init__.c | 1 - ports/stm32f4/common-hal/board/__init__.c | 25 - ports/stm32f4/common-hal/busio/I2C.c | 250 ------ ports/stm32f4/common-hal/busio/I2C.h | 48 -- ports/stm32f4/common-hal/busio/OneWire.h | 33 - ports/stm32f4/common-hal/busio/SPI.c | 470 ----------- ports/stm32f4/common-hal/busio/SPI.h | 55 -- ports/stm32f4/common-hal/busio/UART.c | 626 -------------- ports/stm32f4/common-hal/busio/UART.h | 60 -- ports/stm32f4/common-hal/busio/__init__.c | 1 - .../common-hal/digitalio/DigitalInOut.c | 160 ---- .../common-hal/digitalio/DigitalInOut.h | 38 - ports/stm32f4/common-hal/digitalio/__init__.c | 1 - .../common-hal/displayio/ParallelBus.c | 68 -- .../common-hal/displayio/ParallelBus.h | 36 - .../stm32f4/common-hal/microcontroller/Pin.c | 134 --- .../stm32f4/common-hal/microcontroller/Pin.h | 52 -- .../common-hal/microcontroller/Processor.c | 127 --- .../common-hal/microcontroller/Processor.h | 39 - .../common-hal/microcontroller/__init__.c | 244 ------ .../common-hal/neopixel_write/__init__.c | 102 --- ports/stm32f4/common-hal/os/__init__.c | 95 --- ports/stm32f4/common-hal/pulseio/PWMOut.c | 448 ---------- ports/stm32f4/common-hal/pulseio/PWMOut.h | 51 -- ports/stm32f4/common-hal/pulseio/PulseIn.c | 79 -- ports/stm32f4/common-hal/pulseio/PulseIn.h | 53 -- ports/stm32f4/common-hal/pulseio/PulseOut.c | 214 ----- ports/stm32f4/common-hal/pulseio/PulseOut.h | 42 - ports/stm32f4/common-hal/pulseio/__init__.c | 1 - ports/stm32f4/common-hal/supervisor/Runtime.c | 38 - ports/stm32f4/common-hal/supervisor/Runtime.h | 37 - .../stm32f4/common-hal/supervisor/__init__.c | 40 - ports/stm32f4/common-hal/time/__init__.c | 45 - ports/stm32f4/fatfs_port.c | 33 - ports/stm32f4/mpconfigport.h | 59 -- ports/stm32f4/mpconfigport.mk | 77 -- ports/stm32f4/mphalport.c | 63 -- ports/stm32f4/mphalport.h | 51 -- ports/stm32f4/peripherals/stm32f4/clocks.h | 27 - ports/stm32f4/peripherals/stm32f4/gpio.h | 28 - ports/stm32f4/peripherals/stm32f4/periph.h | 180 ---- ports/stm32f4/peripherals/stm32f4/pins.h | 96 --- .../peripherals/stm32f4/stm32f401xe/clocks.c | 62 -- .../peripherals/stm32f4/stm32f401xe/gpio.c | 51 -- .../peripherals/stm32f4/stm32f401xe/periph.c | 173 ---- .../peripherals/stm32f4/stm32f401xe/periph.h | 57 -- .../peripherals/stm32f4/stm32f401xe/pins.c | 123 --- .../peripherals/stm32f4/stm32f401xe/pins.h | 121 --- .../peripherals/stm32f4/stm32f405xx/clocks.c | 64 -- .../peripherals/stm32f4/stm32f405xx/gpio.c | 60 -- .../peripherals/stm32f4/stm32f405xx/periph.c | 194 ----- .../peripherals/stm32f4/stm32f405xx/periph.h | 57 -- .../peripherals/stm32f4/stm32f405xx/pins.c | 161 ---- .../peripherals/stm32f4/stm32f405xx/pins.h | 158 ---- .../peripherals/stm32f4/stm32f407xx/clocks.c | 64 -- .../peripherals/stm32f4/stm32f407xx/gpio.c | 60 -- .../peripherals/stm32f4/stm32f407xx/periph.c | 194 ----- .../peripherals/stm32f4/stm32f407xx/periph.h | 57 -- .../peripherals/stm32f4/stm32f407xx/pins.c | 161 ---- .../peripherals/stm32f4/stm32f407xx/pins.h | 158 ---- .../peripherals/stm32f4/stm32f411xe/clocks.c | 62 -- .../peripherals/stm32f4/stm32f411xe/gpio.c | 59 -- .../peripherals/stm32f4/stm32f411xe/periph.c | 194 ----- .../peripherals/stm32f4/stm32f411xe/periph.h | 57 -- .../peripherals/stm32f4/stm32f411xe/pins.c | 123 --- .../peripherals/stm32f4/stm32f411xe/pins.h | 121 --- .../peripherals/stm32f4/stm32f412zx/clocks.c | 75 -- .../peripherals/stm32f4/stm32f412zx/gpio.c | 243 ------ .../peripherals/stm32f4/stm32f412zx/periph.c | 223 ----- .../peripherals/stm32f4/stm32f412zx/periph.h | 58 -- .../peripherals/stm32f4/stm32f412zx/pins.c | 161 ---- .../peripherals/stm32f4/stm32f412zx/pins.h | 158 ---- ports/stm32f4/qstrdefsport.h | 1 - ports/stm32f4/supervisor/cpu.s | 27 - ports/stm32f4/supervisor/internal_flash.c | 204 ----- ports/stm32f4/supervisor/internal_flash.h | 68 -- .../supervisor/internal_flash_root_pointers.h | 31 - ports/stm32f4/supervisor/port.c | 106 --- ports/stm32f4/supervisor/qspi_flash.c | 162 ---- ports/stm32f4/supervisor/serial.c | 75 -- ports/stm32f4/supervisor/usb.c | 112 --- ports/stm32f4/system_stm32f4xx.c | 788 ------------------ ports/stm32f4/tick.c | 81 -- ports/stm32f4/tick.h | 44 - 161 files changed, 19919 deletions(-) delete mode 100644 ports/stm32f4/.gitignore delete mode 100755 ports/stm32f4/Makefile delete mode 100644 ports/stm32f4/README.md delete mode 100644 ports/stm32f4/background.c delete mode 100644 ports/stm32f4/background.h delete mode 100644 ports/stm32f4/boards/STM32F401xd_fs.ld delete mode 100644 ports/stm32f4/boards/STM32F401xe_boot.ld delete mode 100644 ports/stm32f4/boards/STM32F401xe_fs.ld delete mode 100644 ports/stm32f4/boards/STM32F405_boot.ld delete mode 100644 ports/stm32f4/boards/STM32F405_default.ld delete mode 100644 ports/stm32f4/boards/STM32F405_fs.ld delete mode 100644 ports/stm32f4/boards/STM32F407_fs.ld delete mode 100644 ports/stm32f4/boards/STM32F411VETx_FLASH.ld delete mode 100644 ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld delete mode 100644 ports/stm32f4/boards/board.h delete mode 100644 ports/stm32f4/boards/espruino_pico/README.md delete mode 100644 ports/stm32f4/boards/espruino_pico/board.c delete mode 100644 ports/stm32f4/boards/espruino_pico/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/espruino_pico/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/espruino_pico/pins.c delete mode 100644 ports/stm32f4/boards/espruino_pico/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/espruino_wifi/README.MD delete mode 100644 ports/stm32f4/boards/espruino_wifi/board.c delete mode 100644 ports/stm32f4/boards/espruino_wifi/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/espruino_wifi/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/espruino_wifi/pins.c delete mode 100644 ports/stm32f4/boards/espruino_wifi/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/feather_stm32f405_express/board.c delete mode 100644 ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/feather_stm32f405_express/pins.c delete mode 100644 ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/meowbit_v121/board.c delete mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/meowbit_v121/pins.c delete mode 100644 ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/openocd_stm32f4.cfg delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/board.c delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/pins.c delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/pyboard_v11/board.c delete mode 100644 ports/stm32f4/boards/pyboard_v11/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/pyboard_v11/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/pyboard_v11/pins.c delete mode 100644 ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/startup_stm32f401xe.s delete mode 100644 ports/stm32f4/boards/startup_stm32f405xx.s delete mode 100644 ports/stm32f4/boards/startup_stm32f407xx.s delete mode 100644 ports/stm32f4/boards/startup_stm32f411xe.s delete mode 100644 ports/stm32f4/boards/startup_stm32f412zx.s delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/board.c delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/pins.c delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/stm32f411ve_discovery/board.c delete mode 100644 ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/stm32f411ve_discovery/pins.c delete mode 100644 ports/stm32f4/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/stm32f412zg_discovery/board.c delete mode 100644 ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/stm32f412zg_discovery/pins.c delete mode 100644 ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/boards/stm32f4_discovery/board.c delete mode 100644 ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/stm32f4_discovery/pins.c delete mode 100644 ports/stm32f4/boards/stm32f4_discovery/stm32f4xx_hal_conf.h delete mode 100644 ports/stm32f4/common-hal/analogio/AnalogIn.c delete mode 100644 ports/stm32f4/common-hal/analogio/AnalogIn.h delete mode 100644 ports/stm32f4/common-hal/analogio/AnalogOut.c delete mode 100644 ports/stm32f4/common-hal/analogio/AnalogOut.h delete mode 100644 ports/stm32f4/common-hal/analogio/__init__.c delete mode 100644 ports/stm32f4/common-hal/board/__init__.c delete mode 100644 ports/stm32f4/common-hal/busio/I2C.c delete mode 100644 ports/stm32f4/common-hal/busio/I2C.h delete mode 100644 ports/stm32f4/common-hal/busio/OneWire.h delete mode 100644 ports/stm32f4/common-hal/busio/SPI.c delete mode 100644 ports/stm32f4/common-hal/busio/SPI.h delete mode 100644 ports/stm32f4/common-hal/busio/UART.c delete mode 100644 ports/stm32f4/common-hal/busio/UART.h delete mode 100644 ports/stm32f4/common-hal/busio/__init__.c delete mode 100644 ports/stm32f4/common-hal/digitalio/DigitalInOut.c delete mode 100644 ports/stm32f4/common-hal/digitalio/DigitalInOut.h delete mode 100644 ports/stm32f4/common-hal/digitalio/__init__.c delete mode 100644 ports/stm32f4/common-hal/displayio/ParallelBus.c delete mode 100644 ports/stm32f4/common-hal/displayio/ParallelBus.h delete mode 100644 ports/stm32f4/common-hal/microcontroller/Pin.c delete mode 100644 ports/stm32f4/common-hal/microcontroller/Pin.h delete mode 100644 ports/stm32f4/common-hal/microcontroller/Processor.c delete mode 100644 ports/stm32f4/common-hal/microcontroller/Processor.h delete mode 100644 ports/stm32f4/common-hal/microcontroller/__init__.c delete mode 100644 ports/stm32f4/common-hal/neopixel_write/__init__.c delete mode 100644 ports/stm32f4/common-hal/os/__init__.c delete mode 100644 ports/stm32f4/common-hal/pulseio/PWMOut.c delete mode 100644 ports/stm32f4/common-hal/pulseio/PWMOut.h delete mode 100644 ports/stm32f4/common-hal/pulseio/PulseIn.c delete mode 100644 ports/stm32f4/common-hal/pulseio/PulseIn.h delete mode 100644 ports/stm32f4/common-hal/pulseio/PulseOut.c delete mode 100644 ports/stm32f4/common-hal/pulseio/PulseOut.h delete mode 100644 ports/stm32f4/common-hal/pulseio/__init__.c delete mode 100755 ports/stm32f4/common-hal/supervisor/Runtime.c delete mode 100755 ports/stm32f4/common-hal/supervisor/Runtime.h delete mode 100755 ports/stm32f4/common-hal/supervisor/__init__.c delete mode 100644 ports/stm32f4/common-hal/time/__init__.c delete mode 100644 ports/stm32f4/fatfs_port.c delete mode 100644 ports/stm32f4/mpconfigport.h delete mode 100644 ports/stm32f4/mpconfigport.mk delete mode 100644 ports/stm32f4/mphalport.c delete mode 100644 ports/stm32f4/mphalport.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/clocks.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/gpio.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/pins.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.h delete mode 100644 ports/stm32f4/qstrdefsport.h delete mode 100755 ports/stm32f4/supervisor/cpu.s delete mode 100644 ports/stm32f4/supervisor/internal_flash.c delete mode 100644 ports/stm32f4/supervisor/internal_flash.h delete mode 100644 ports/stm32f4/supervisor/internal_flash_root_pointers.h delete mode 100644 ports/stm32f4/supervisor/port.c delete mode 100644 ports/stm32f4/supervisor/qspi_flash.c delete mode 100644 ports/stm32f4/supervisor/serial.c delete mode 100644 ports/stm32f4/supervisor/usb.c delete mode 100644 ports/stm32f4/system_stm32f4xx.c delete mode 100644 ports/stm32f4/tick.c delete mode 100644 ports/stm32f4/tick.h diff --git a/ports/stm32f4/.gitignore b/ports/stm32f4/.gitignore deleted file mode 100644 index 3080ece14d..0000000000 --- a/ports/stm32f4/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Build files -##################### -build-*/ - -# Reference files -##################### -ref/ - -.gdb_history \ No newline at end of file diff --git a/ports/stm32f4/Makefile b/ports/stm32f4/Makefile deleted file mode 100755 index 3a6191c851..0000000000 --- a/ports/stm32f4/Makefile +++ /dev/null @@ -1,284 +0,0 @@ -# This file is part of the MicroPython project, http://micropython.org/ -# -# The MIT License (MIT) -# -# Copyright (c) 2019 Dan Halbert for Adafruit Industries -# Copyright (c) 2019 Lucian Copeland for Adafruit Industries -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# DEBUG = 1 - -# Select the board to build for. -ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) -else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) - endif -endif - -# If the build directory is not given, make it reflect the board name. -BUILD ?= build-$(BOARD) - -include ../../py/mkenv.mk -# Board-specific -include boards/$(BOARD)/mpconfigboard.mk -# Port-specific -include mpconfigport.mk - -# CircuitPython-specific -include $(TOP)/py/circuitpy_mpconfig.mk - -# qstr definitions (must come before including py.mk) -QSTR_DEFS = qstrdefsport.h - -# include py core make definitions -include $(TOP)/py/py.mk - -include $(TOP)/supervisor/supervisor.mk - -# Include make rules and variables common across CircuitPython builds. -include $(TOP)/py/circuitpy_defns.mk - -CROSS_COMPILE = arm-none-eabi- - -####################################### -# CFLAGS -####################################### - -INC += -I. -INC += -I../.. -INC += -I$(BUILD) -INC += -I$(BUILD)/genhdr -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc/Legacy -INC += -I./stm32f4/CMSIS/Device/ST/STM32F4xx/Include -INC += -I./stm32f4/CMSIS/Include -INC += -I./boards -INC += -I./boards/$(BOARD) -INC += -I./peripherals -INC += -I../../lib/mp-readline -INC += -I../../lib/tinyusb/src -INC += -I../../supervisor/shared/usb - - -#Debugging/Optimization -ifeq ($(DEBUG), 1) - CFLAGS += -ggdb - # You may want to enable these flags to make setting breakpoints easier. - CFLAGS += -fno-inline -fno-ipa-sra -else - CFLAGS += -Os -DNDEBUG - CFLAGS += -ggdb - # TODO: Test with -flto - ### CFLAGS += -flto -endif - - -C_DEFS = -DMCU_PACKAGE=$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(CMSIS_MCU) - -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) - -# Undo some warnings. -# STM32 apparently also uses undefined preprocessor variables quite casually, -# so we can't do warning checks for these. -CFLAGS += -Wno-undef -# STM32 might do casts that increase alignment requirements. -CFLAGS += -Wno-cast-align - -CFLAGS += \ - -mthumb \ - -mabi=aapcs-linux \ - -mfloat-abi=hard \ - -mcpu=cortex-m4 \ - -mfpu=fpv4-sp-d16 - -# TODO: check this -CFLAGS += -D__START=main - -#need both command and valid file to use uf2 bootloader -ifndef LD_FILE - ifneq ($(and $(UF2_BOOTLOADER),$(LD_BOOT)),) - LD_FILE = $(LD_BOOT) - BOOTLOADER_OFFSET = $(UF2_OFFSET) - CFLAGS += -DUF2_BOOTLOADER_ENABLED - else - LD_FILE = $(LD_DEFAULT) - endif -endif - -# Add bootloader specific items -ifndef BOOTLOADER_OFFSET - BOOTLOADER_OFFSET := 0x8000000 -endif - -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -LIBS := -lgcc -lc - -LDFLAGS += -mthumb -mcpu=cortex-m4 - -# Use toolchain libm if we're not using our own. -ifndef INTERNAL_LIBM -LIBS += -lm -endif - -# TinyUSB defines -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 - - -###################################### -# source -###################################### - -SRC_STM32 = \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ - system_stm32f4xx.c - - -SRC_C += \ - background.c \ - fatfs_port.c \ - mphalport.c \ - tick.c \ - boards/$(BOARD)/board.c \ - boards/$(BOARD)/pins.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/pins.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/clocks.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/gpio.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/periph.c \ - lib/libc/string0.c \ - lib/mp-readline/readline.c \ - lib/oofatfs/ff.c \ - lib/oofatfs/option/ccsbcs.c \ - lib/timeutils/timeutils.c \ - lib/utils/buffer_helper.c \ - lib/utils/context_manager_helpers.c \ - lib/utils/interrupt_char.c \ - lib/utils/pyexec.c \ - lib/utils/stdout_helpers.c \ - lib/utils/sys_stdio_mphal.c \ - supervisor/shared/memory.c - -ifneq ($(USB),FALSE) -SRC_C += lib/tinyusb/src/portable/st/synopsys/dcd_synopsys.c -endif - -SRC_S = \ - supervisor/cpu.s \ - boards/startup_$(MCU_SUB_VARIANT).s - -SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ - $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ - $(addprefix common-hal/, $(SRC_COMMON_HAL)) - -SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ - $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ - $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) - - -ifneq ($(FROZEN_MPY_DIR),) -FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') -FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) -endif - -OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_STM32:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) -ifeq ($(INTERNAL_LIBM),1) -OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) -endif -OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) - -$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os -$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os - -# List of sources for qstr extraction -SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) -# Sources that only hold QSTRs after pre-processing. -SRC_QSTR_PREPROCESSOR += - - -all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 - -$(BUILD)/firmware.elf: $(OBJ) - $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group - $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) - -$(BUILD)/firmware.bin: $(BUILD)/firmware.elf - $(STEPECHO) "Create $@" - $(Q)$(OBJCOPY) -O binary $^ $@ -# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ - -$(BUILD)/firmware.hex: $(BUILD)/firmware.elf - $(STEPECHO) "Create $@" - $(Q)$(OBJCOPY) -O ihex $^ $@ -# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ - -$(BUILD)/firmware.uf2: $(BUILD)/firmware.hex - $(ECHO) "Create $@" - $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ - -include $(TOP)/py/mkrules.mk - -# Print out the value of a make variable. -# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile -print-%: - @echo $* = $($*) diff --git a/ports/stm32f4/README.md b/ports/stm32f4/README.md deleted file mode 100644 index a860c01ce4..0000000000 --- a/ports/stm32f4/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# CircuitPython Port To The ST Microelectronics STM32F4 Series - -This is a port of CircuitPython to the STM32F4 series of chips. diff --git a/ports/stm32f4/background.c b/ports/stm32f4/background.c deleted file mode 100644 index 8c18970434..0000000000 --- a/ports/stm32f4/background.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/runtime.h" -#include "supervisor/filesystem.h" -#include "supervisor/usb.h" -#include "supervisor/shared/stack.h" - -#if CIRCUITPY_DISPLAYIO -#include "shared-module/displayio/__init__.h" -#endif - -static bool running_background_tasks = false; - -void background_tasks_reset(void) { - running_background_tasks = false; -} - -void run_background_tasks(void) { - // Don't call ourselves recursively. - if (running_background_tasks) { - return; - } - running_background_tasks = true; - filesystem_background(); - - #if USB_AVAILABLE - usb_background(); - #endif - - #if CIRCUITPY_DISPLAYIO - displayio_background(); - #endif - running_background_tasks = false; - - assert_heap_ok(); -} diff --git a/ports/stm32f4/background.h b/ports/stm32f4/background.h deleted file mode 100644 index 05a4f894a6..0000000000 --- a/ports/stm32f4/background.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Dan Halbert for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_BACKGROUND_H -#define MICROPY_INCLUDED_STM32F4_BACKGROUND_H - -#include - -void background_tasks_reset(void); -void run_background_tasks(void); - -#endif // MICROPY_INCLUDED_STM32F4_BACKGROUND_H diff --git a/ports/stm32f4/boards/STM32F401xd_fs.ld b/ports/stm32f4/boards/STM32F401xd_fs.ld deleted file mode 100644 index c42dfcca8c..0000000000 --- a/ports/stm32f4/boards/STM32F401xd_fs.ld +++ /dev/null @@ -1,107 +0,0 @@ -/* - GNU linker script for STM32F401 with bootloader (such as the Meowbit) -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F401xe_boot.ld b/ports/stm32f4/boards/STM32F401xe_boot.ld deleted file mode 100644 index 125d785fc2..0000000000 --- a/ports/stm32f4/boards/STM32F401xe_boot.ld +++ /dev/null @@ -1,106 +0,0 @@ -/* - GNU linker script for STM32F401 with bootloader (such as the Meowbit) -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F401xe_fs.ld b/ports/stm32f4/boards/STM32F401xe_fs.ld deleted file mode 100644 index fd30e16228..0000000000 --- a/ports/stm32f4/boards/STM32F401xe_fs.ld +++ /dev/null @@ -1,107 +0,0 @@ -/* - GNU linker script for STM32F401 with bootloader (such as the Meowbit) -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F405_boot.ld b/ports/stm32f4/boards/STM32F405_boot.ld deleted file mode 100644 index 64da3b6520..0000000000 --- a/ports/stm32f4/boards/STM32F405_boot.ld +++ /dev/null @@ -1,107 +0,0 @@ -/* - GNU linker script for STM32F405 with bootloader - Based on Micropython -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define the top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - diff --git a/ports/stm32f4/boards/STM32F405_default.ld b/ports/stm32f4/boards/STM32F405_default.ld deleted file mode 100644 index c2b8c843ee..0000000000 --- a/ports/stm32f4/boards/STM32F405_default.ld +++ /dev/null @@ -1,107 +0,0 @@ -/* - GNU linker script for STM32F405 via Micropython -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F405_fs.ld b/ports/stm32f4/boards/STM32F405_fs.ld deleted file mode 100644 index 7f7c917846..0000000000 --- a/ports/stm32f4/boards/STM32F405_fs.ld +++ /dev/null @@ -1,108 +0,0 @@ -/* - GNU linker script for STM32F405 via Micropython -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F407_fs.ld b/ports/stm32f4/boards/STM32F407_fs.ld deleted file mode 100644 index 7f7c917846..0000000000 --- a/ports/stm32f4/boards/STM32F407_fs.ld +++ /dev/null @@ -1,108 +0,0 @@ -/* - GNU linker script for STM32F405 via Micropython -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F411VETx_FLASH.ld b/ports/stm32f4/boards/STM32F411VETx_FLASH.ld deleted file mode 100644 index ac1ba32408..0000000000 --- a/ports/stm32f4/boards/STM32F411VETx_FLASH.ld +++ /dev/null @@ -1,109 +0,0 @@ -/* - GNU linker script for STM32F411 via Micropython -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_start = _ebss; /* heap starts just after statically allocated memory */ -_heap_end = 0x2001c000; /* tunable */ - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld b/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld deleted file mode 100644 index e0586709e6..0000000000 --- a/ports/stm32f4/boards/STM32F412ZGTx_FLASH.ld +++ /dev/null @@ -1,105 +0,0 @@ -/* - GNU linker script for STM32F412 -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_start = _ebss; /* heap starts just after statically allocated memory */ -_heap_end = 0x20020000; /* tunable */ - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/ports/stm32f4/boards/board.h b/ports/stm32f4/boards/board.h deleted file mode 100644 index 22d9e99be0..0000000000 --- a/ports/stm32f4/boards/board.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// This file defines board specific functions. - -#ifndef MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H -#define MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H - -#include - -// Initializes board related state once on start up. -void board_init(void); - -// Returns true if the user initiates safe mode in a board specific way. -// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific -// way. -bool board_requests_safe_mode(void); - -// Reset the state of off MCU components such as neopixels. -void reset_board(void); - -#endif // MICROPY_INCLUDED_STM32F4_BOARDS_BOARD_H diff --git a/ports/stm32f4/boards/espruino_pico/README.md b/ports/stm32f4/boards/espruino_pico/README.md deleted file mode 100644 index 9f0321c474..0000000000 --- a/ports/stm32f4/boards/espruino_pico/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Flashing the Espruino Pico - -The Espruino Pico is normally updated via a bootloader activated by the Espruino web app. This approach is not practical for Circuitpython as it takes too much space from the internal filesystem - thus, you will need to follow the instructions for advanced reflashing using the built-in ROM bootloader on all STM32F4 MCUs (instructions sourced from https://www.espruino.com/Pico#advanced-reflashing) - - - Short out the BOOT0/BTN solder jumper on the back of the board - you can do this by drawing over it with a pencil. - - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - - **Mac**: install with Homebrew: `brew install dfu-util` - - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - - Hold down the Pico's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. - - -To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file diff --git a/ports/stm32f4/boards/espruino_pico/board.c b/ports/stm32f4/boards/espruino_pico/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/espruino_pico/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/espruino_pico/mpconfigboard.h b/ports/stm32f4/boards/espruino_pico/mpconfigboard.h deleted file mode 100644 index d4430380c6..0000000000 --- a/ports/stm32f4/boards/espruino_pico/mpconfigboard.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "Espruino Pico" -#define MICROPY_HW_MCU_NAME "STM32F401xD" - -#define FLASH_SIZE (0x60000) -#define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS (500) -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - -#define BOARD_OSC_DIV (8) - diff --git a/ports/stm32f4/boards/espruino_pico/mpconfigboard.mk b/ports/stm32f4/boards/espruino_pico/mpconfigboard.mk deleted file mode 100644 index 151ca1437a..0000000000 --- a/ports/stm32f4/boards/espruino_pico/mpconfigboard.mk +++ /dev/null @@ -1,16 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x808E -USB_PRODUCT = "Espruino Pico" -USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f401xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F401xE -LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash - diff --git a/ports/stm32f4/boards/espruino_pico/pins.c b/ports/stm32f4/boards/espruino_pico/pins.c deleted file mode 100644 index 55c0336c54..0000000000 --- a/ports/stm32f4/boards/espruino_pico/pins.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - - { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, - - { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/espruino_pico/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/espruino_pico/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm32f4/boards/espruino_pico/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/espruino_wifi/README.MD b/ports/stm32f4/boards/espruino_wifi/README.MD deleted file mode 100644 index 8c2cd3be2b..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/README.MD +++ /dev/null @@ -1,15 +0,0 @@ -# Flashing the Espruino Wifi - -The Espruino Wifi is normally updated via a bootloader activated by the Espruino web app. This approach is not practical for Circuitpython as it takes too much space from the internal filesystem - thus, you will need to follow the instructions for advanced reflashing using the built-in ROM bootloader on all STM32F4 MCUs (instructions sourced from https://www.espruino.com/Wifi#advanced-reflashing) - - - Short out the BOOT0/BTN solder jumper on the back of the board - you can do this by drawing over it with a pencil. - - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - - **Mac**: install with Homebrew: `brew install dfu-util` - - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - - Hold down the Wifi's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. - - -To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file diff --git a/ports/stm32f4/boards/espruino_wifi/board.c b/ports/stm32f4/boards/espruino_wifi/board.c deleted file mode 100644 index 4421970eef..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h b/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h deleted file mode 100644 index abdc9e8fac..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "Espruino Wifi" -#define MICROPY_HW_MCU_NAME "STM32F411xE" - -#define FLASH_SIZE (0x80000) //512K -#define FLASH_PAGE_SIZE (0x4000) //16K - -#define BOARD_OSC_DIV (8) -#define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.mk b/ports/stm32f4/boards/espruino_wifi/mpconfigboard.mk deleted file mode 100644 index 8b28cf07c7..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/mpconfigboard.mk +++ /dev/null @@ -1,16 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x8090 -USB_PRODUCT = "Espruino Wifi" -USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld - diff --git a/ports/stm32f4/boards/espruino_wifi/pins.c b/ports/stm32f4/boards/espruino_wifi/pins.c deleted file mode 100644 index 8800317d50..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/pins.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - //P1 - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, - - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_PC13) }, - - { MP_ROM_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_ESP_CHPD), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_ESP_GPIO13), MP_ROM_PTR(&pin_PA15) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/espruino_wifi/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/espruino_wifi/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm32f4/boards/espruino_wifi/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/feather_stm32f405_express/board.c b/ports/stm32f4/boards/feather_stm32f405_express/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/feather_stm32f405_express/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h deleted file mode 100644 index 6600fcf671..0000000000 --- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "Feather STM32F405 Express" -#define MICROPY_HW_MCU_NAME "STM32F405RG" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (0x4000) - -#define MICROPY_HW_NEOPIXEL (&pin_PC00) - -#define BOARD_OSC_DIV (12) - -// On-board flash -#define SPI_FLASH_MOSI_PIN (&pin_PB05) -#define SPI_FLASH_MISO_PIN (&pin_PB04) -#define SPI_FLASH_SCK_PIN (&pin_PB03) -#define SPI_FLASH_CS_PIN (&pin_PA15) - -// Bootloader only -#ifdef UF2_BOOTLOADER_ENABLED - #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader -#endif - -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) - -#define DEFAULT_SPI_BUS_SCK (&pin_PB13) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) -#define DEFAULT_SPI_BUS_MISO (&pin_PB14) - -#define DEFAULT_UART_BUS_RX (&pin_PB11) -#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.mk deleted file mode 100644 index 312ca6b480..0000000000 --- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.mk +++ /dev/null @@ -1,22 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x805A -USB_PRODUCT = "Feather STM32F405 Express" -USB_MANUFACTURER = "Adafruit Industries LLC" -USB_DEVICES = "CDC,MSC" - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = GD25Q16C -LONGINT_IMPL = MPZ - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx - -# Default includes filesystem, but uses external flash -LD_DEFAULT = boards/STM32F405_default.ld -LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option -UF2_OFFSET = 0x8010000 - diff --git a/ports/stm32f4/boards/feather_stm32f405_express/pins.c b/ports/stm32f4/boards/feather_stm32f405_express/pins.c deleted file mode 100644 index ebc8fa337e..0000000000 --- a/ports/stm32f4/boards/feather_stm32f405_express/pins.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h deleted file mode 100644 index 8031403a91..0000000000 --- a/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/meowbit_v121/board.c b/ports/stm32f4/boards/meowbit_v121/board.c deleted file mode 100644 index a0ae988249..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/board.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" -#include "mpconfigboard.h" - -#include "shared-bindings/board/__init__.h" -#include "shared-bindings/displayio/FourWire.h" -#include "shared-module/displayio/__init__.h" -#include "shared-module/displayio/mipi_constants.h" -#include "shared-bindings/busio/SPI.h" - -#include "supervisor/spi_flash_api.h" - -#include "tick.h" - -displayio_fourwire_obj_t board_display_obj; - -#define DELAY 0x80 - -uint8_t display_init_sequence[] = { - 0x01, 0 | DELAY, 150, // SWRESET - 0x11, 0 | DELAY, 255, // SLPOUT - 0xb1, 3, 0x01, 0x2C, 0x2D, // _FRMCTR1 - 0xb2, 3, 0x01, 0x2C, 0x2D, // - 0xb3, 6, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, - 0xb4, 1, 0x07, // _INVCTR line inversion - 0xc0, 3, 0xa2, 0x02, 0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA - 0xc1, 1, 0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V - 0xc2, 2, 0x0a, 0x00, // _PWCTR3 Opamp current small, Boost frequency - 0xc3, 2, 0x8a, 0x2a, - 0xc4, 2, 0x8a, 0xee, - 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V - 0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20 - 0x36, 1, 0x18, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, - // fix on VTL - 0x3a, 1, 0x05, // COLMOD - 16bit color - 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, - 0x37, 0x32, 0x29, 0x2d, - 0x29, 0x25, 0x2B, 0x39, - 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma - 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, - 0x2E, 0x2C, 0x29, 0x2D, - 0x2E, 0x2E, 0x37, 0x3F, - 0x00, 0x00, 0x02, 0x10, // _GMCTRN1 - 0x13, 0 | DELAY, 10, // _NORON - 0x29, 0 | DELAY, 100, // _DISPON -}; - -void board_init(void) { - displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; - bus->base.type = &displayio_fourwire_type; - busio_spi_obj_t *internal_spi = &supervisor_flash_spi_bus; - common_hal_displayio_fourwire_construct(bus, - internal_spi, - &pin_PA08, // Command or data - &pin_PB12, // Chip select - &pin_PB10, // Reset - 24000000); - - displayio_display_obj_t* display = &displays[0].display; - display->base.type = &displayio_display_type; - common_hal_displayio_display_construct(display, - bus, - 160, // Width - 128, // Height - 0, // column start - 0, // row start - 90, // rotation - 16, // Color depth - false, // Grayscale - false, // Pixels in a byte share a row. Only used for depth < 8 - 1, // bytes per cell. Only valid for depths < 8 - false, // reverse_pixels_in_byte. Only valid for depths < 8 - MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command - MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command - MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command - display_init_sequence, - sizeof(display_init_sequence), - &pin_PB03, - NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness - false, // single_byte_bounds - false, // data_as_commands - true, // auto_refresh - 60); // native_frames_per_second -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h deleted file mode 100644 index babf54a3a9..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "MEOWBIT" -#define MICROPY_HW_MCU_NAME "STM32F401xE" - -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - -#define BOARD_OSC_DIV (12) -#define BOARD_NO_VBUS_SENSE (1) -#define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader -#define BOARD_USE_INTERNAL_SPI - -// On-board flash -#define SPI_FLASH_MOSI_PIN (&pin_PB15) -#define SPI_FLASH_MISO_PIN (&pin_PB14) -#define SPI_FLASH_SCK_PIN (&pin_PB13) -#define SPI_FLASH_CS_PIN (&pin_PB01) diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk deleted file mode 100644 index 16268ba119..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk +++ /dev/null @@ -1,24 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x805A -USB_PRODUCT = "Meowbit" -USB_MANUFACTURER = "Kittenbot" -USB_DEVICES = "CDC,MSC" - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = W25Q16JV_IQ -LONGINT_IMPL = MPZ - -BOOTLOADER_OFFSET = 0x8010000 - -# INTERNAL_FLASH_FILESYSTEM = 1 -# LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f401xe -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F401xE -LD_FILE = boards/STM32F401xe_boot.ld -# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash - diff --git a/ports/stm32f4/boards/meowbit_v121/pins.c b/ports/stm32f4/boards/meowbit_v121/pins.c deleted file mode 100644 index af896fad87..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/pins.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "shared-bindings/board/__init__.h" -#include "supervisor/spi_flash_api.h" - -#include "shared-module/displayio/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PB05) }, - - { MP_ROM_QSTR(MP_QSTR_DISP_SCK), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_DISP_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_DISP_MOSI), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_DISP_CS), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_DISP_DC), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_DISP_RST), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_DISP_BL), MP_ROM_PTR(&pin_PB03) }, - - { MP_ROM_QSTR(MP_QSTR_BUZZ), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_BTNA), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_BTNB), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_RIGHT), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_DOWN), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_LEFT), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_TEMP), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_UP), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_MENU), MP_ROM_PTR(&pin_PC15) }, - - { MP_ROM_QSTR(MP_QSTR_JACK_TX), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_JACK_PWREN), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_JACK_SND), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_ACC_INT), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_ACC_SCL), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_ACC_SDA), MP_ROM_PTR(&pin_PB07) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - // { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PC06) }, //these are wrong on Meowbit diagram. - // { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA03) }, //they cannot be used together (UART2 vs 6) - { MP_ROM_QSTR(MP_QSTR_NSS), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PC12) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PC10) }, - - { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_PC12) }, - { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PA10) }, //in use by USB - { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB00) }, - - { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, - { MP_ROM_QSTR(MP_QSTR_INTERNAL_SPI), MP_ROM_PTR(&supervisor_flash_spi_bus) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h deleted file mode 100644 index 68a49b4ba8..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/openocd_stm32f4.cfg b/ports/stm32f4/boards/openocd_stm32f4.cfg deleted file mode 100644 index 19631a7c8e..0000000000 --- a/ports/stm32f4/boards/openocd_stm32f4.cfg +++ /dev/null @@ -1,44 +0,0 @@ -# This script configures OpenOCD for use with an ST-Link V2 programmer/debugger -# and an STM32F4 target microcontroller. -# -# To flash your firmware: -# -# $ openocd -f openocd_stm32f4.cfg \ -# -c "stm_flash build-BOARD/firmware0.bin 0x08000000 build-BOARD/firmware1.bin 0x08020000" -# -# For a gdb server on port 3333: -# -# $ openocd -f openocd_stm32f4.cfg - - -source [find interface/stlink-v2.cfg] -transport select hla_swd -source [find target/stm32f4x.cfg] -reset_config srst_only -init - -proc stm_flash { BIN0 ADDR0 {BIN1 ""} {ADDR1 ""} } { - reset halt - sleep 100 - wait_halt 2 - flash write_image erase $BIN0 $ADDR0 - sleep 100 - verify_image $BIN0 $ADDR0 - sleep 100 - if {$BIN1 ne ""} { - flash write_image erase $BIN1 $ADDR1 - sleep 100 - verify_image $BIN1 $ADDR1 - sleep 100 - } - reset run - shutdown -} - -proc stm_erase {} { - reset halt - sleep 100 - stm32f4x mass_erase 0 - sleep 100 - shutdown -} diff --git a/ports/stm32f4/boards/pyb_nano_v2/board.c b/ports/stm32f4/boards/pyb_nano_v2/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h deleted file mode 100644 index 965e7d5ff4..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "PYB LR Nano V2" -#define MICROPY_HW_MCU_NAME "STM32F411CE" - -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV (8) - -// On-board flash -#define SPI_FLASH_MOSI_PIN (&pin_PB15) -#define SPI_FLASH_MISO_PIN (&pin_PB14) -#define SPI_FLASH_SCK_PIN (&pin_PB13) -#define SPI_FLASH_CS_PIN (&pin_PB12) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk deleted file mode 100644 index a8472608b7..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk +++ /dev/null @@ -1,18 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x8068 -USB_PRODUCT = "PYB LR Nano V2" -USB_MANUFACTURER = "MicroPython Chinese Community" -USB_DEVICES = "CDC,MSC" - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = W25Q64JV_IQ -LONGINT_IMPL = MPZ - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld - diff --git a/ports/stm32f4/boards/pyb_nano_v2/pins.c b/ports/stm32f4/boards/pyb_nano_v2/pins.c deleted file mode 100644 index e10124f6af..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/pins.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_Y0), MP_ROM_PTR(&pin_PB09) }, - - { MP_ROM_QSTR(MP_QSTR_X15), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_X14), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_X13), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_X0), MP_ROM_PTR(&pin_PA00) }, - - { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PA08) }, - - { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_SCK2), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO2), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI2), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_LED_YELLOW), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/pyboard_v11/board.c b/ports/stm32f4/boards/pyboard_v11/board.c deleted file mode 100644 index 4421970eef..0000000000 --- a/ports/stm32f4/boards/pyboard_v11/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h deleted file mode 100644 index 398731d30c..0000000000 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "PyboardV1_1" -#define MICROPY_HW_MCU_NAME "STM32F405RG" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV (12) - -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.mk b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.mk deleted file mode 100644 index ef1b8f0ca1..0000000000 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.mk +++ /dev/null @@ -1,16 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x805C -USB_PRODUCT = "Pyboard Version 1.1" -USB_MANUFACTURER = "George Robotic" -USB_DEVICES = "CDC,MSC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx -LD_FILE = boards/STM32F405_fs.ld - diff --git a/ports/stm32f4/boards/pyboard_v11/pins.c b/ports/stm32f4/boards/pyboard_v11/pins.c deleted file mode 100644 index 8783dfcf10..0000000000 --- a/ports/stm32f4/boards/pyboard_v11/pins.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_Y11), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_Y12), MP_ROM_PTR(&pin_PB01) }, - - { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PC05) }, - - { MP_ROM_QSTR(MP_QSTR_X17), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_X18), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_X19), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_X20), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_X21), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_X22), MP_ROM_PTR(&pin_PC03) }, - - { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PA13) }, - - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA13) }, - - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h deleted file mode 100644 index 4dc18cb7f4..0000000000 --- a/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/startup_stm32f401xe.s b/ports/stm32f4/boards/startup_stm32f401xe.s deleted file mode 100644 index 815ac17197..0000000000 --- a/ports/stm32f4/boards/startup_stm32f401xe.s +++ /dev/null @@ -1,448 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f401xe.s - * @author MCD Application Team - * @brief STM32F401xExx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ - /* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word 0 /* Reserved */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm32f4/boards/startup_stm32f405xx.s b/ports/stm32f4/boards/startup_stm32f405xx.s deleted file mode 100644 index 6b77655ca1..0000000000 --- a/ports/stm32f4/boards/startup_stm32f405xx.s +++ /dev/null @@ -1,516 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f405xx.s - * @author MCD Application Team - * @brief STM32F405xx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FSMC_IRQHandler /* FSMC */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word HASH_RNG_IRQHandler /* Hash and Rng */ - .word FPU_IRQHandler /* FPU */ - - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FSMC_IRQHandler - .thumb_set FSMC_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak HASH_RNG_IRQHandler - .thumb_set HASH_RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - - diff --git a/ports/stm32f4/boards/startup_stm32f407xx.s b/ports/stm32f4/boards/startup_stm32f407xx.s deleted file mode 100644 index 6b77655ca1..0000000000 --- a/ports/stm32f4/boards/startup_stm32f407xx.s +++ /dev/null @@ -1,516 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f405xx.s - * @author MCD Application Team - * @brief STM32F405xx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FSMC_IRQHandler /* FSMC */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word HASH_RNG_IRQHandler /* Hash and Rng */ - .word FPU_IRQHandler /* FPU */ - - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FSMC_IRQHandler - .thumb_set FSMC_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak HASH_RNG_IRQHandler - .thumb_set HASH_RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - - diff --git a/ports/stm32f4/boards/startup_stm32f411xe.s b/ports/stm32f4/boards/startup_stm32f411xe.s deleted file mode 100644 index 3aac640cb2..0000000000 --- a/ports/stm32f4/boards/startup_stm32f411xe.s +++ /dev/null @@ -1,452 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f411xe.s - * @author MCD Application Team - * @brief STM32F411xExx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word 0 /* Reserved */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm32f4/boards/startup_stm32f412zx.s b/ports/stm32f4/boards/startup_stm32f412zx.s deleted file mode 100644 index 8012207957..0000000000 --- a/ports/stm32f4/boards/startup_stm32f412zx.s +++ /dev/null @@ -1,524 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f412zx.s - * @author MCD Application Team - * @brief STM32F412Zx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word TIM6_IRQHandler /* TIM6 */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */ - .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word RNG_IRQHandler /* RNG */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word QUADSPI_IRQHandler /* QuadSPI */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */ - .word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak TIM6_IRQHandler - .thumb_set TIM6_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak DFSDM1_FLT0_IRQHandler - .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler - - .weak DFSDM1_FLT1_IRQHandler - .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak RNG_IRQHandler - .thumb_set RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - - .weak QUADSPI_IRQHandler - .thumb_set QUADSPI_IRQHandler,Default_Handler - - .weak FMPI2C1_EV_IRQHandler - .thumb_set FMPI2C1_EV_IRQHandler,Default_Handler - - .weak FMPI2C1_ER_IRQHandler - .thumb_set FMPI2C1_ER_IRQHandler,Default_Handler -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/board.c b/ports/stm32f4/boards/stm32f411ce_blackpill/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h deleted file mode 100644 index 2ae1a29268..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "stm32f411ce-blackpill" -#define MICROPY_HW_MCU_NAME "STM32F411CE" - -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV (25) -#define BOARD_NO_VBUS_SENSE (1) - -// On-board flash -// #define SPI_FLASH_MOSI_PIN (&pin_PA07) -// #define SPI_FLASH_MISO_PIN (&pin_PA06) -// #define SPI_FLASH_SCK_PIN (&pin_PA05) -// #define SPI_FLASH_CS_PIN (&pin_PA04) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS (500) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS (500) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk deleted file mode 100644 index 68c6a1eeaa..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ /dev/null @@ -1,21 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x806A -USB_PRODUCT = "stm32f411ce blackpill" -USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC,MSC" - -# SPI_FLASH_FILESYSTEM = 1 -# EXTERNAL_FLASH_DEVICE_COUNT = 1 -# EXTERNAL_FLASH_DEVICES = xxxxxx #See supervisor/shared/external_flash/devices.h for options -# LONGINT_IMPL = MPZ - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld - diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c deleted file mode 100644 index aa9736fc4c..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, - - { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h deleted file mode 100644 index 81d29f2420..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/board.c b/ports/stm32f4/boards/stm32f411ve_discovery/board.c deleted file mode 100644 index 4421970eef..0000000000 --- a/ports/stm32f4/boards/stm32f411ve_discovery/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h deleted file mode 100644 index 49ef80cdd7..0000000000 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "STM32F411E_DISCO" -#define MICROPY_HW_MCU_NAME "STM32F411xE" - -#define FLASH_SIZE (0x80000) //512K -#define FLASH_PAGE_SIZE (0x4000) //16K - -#define BOARD_OSC_DIV (8) diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.mk deleted file mode 100644 index 64e2b4dc53..0000000000 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.mk +++ /dev/null @@ -1,16 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x805E -USB_PRODUCT = "STM32F411VE Discovery Board - CPy" -USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 100 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld - diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/pins.c b/ports/stm32f4/boards/stm32f411ve_discovery/pins.c deleted file mode 100644 index 673c412d51..0000000000 --- a/ports/stm32f4/boards/stm32f411ve_discovery/pins.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - //P1 - { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, - { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, - { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, - { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, - { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, - { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, - { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, - { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, - { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, - { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, - { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, - { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, - //P2 - { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, - { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, - { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, - { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, - { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, - { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, - { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, - { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, - { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, - { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, - { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - //ST LED names - { MP_ROM_QSTR(MP_QSTR_LD3), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LD4), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LD5), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LD6), MP_ROM_PTR(&pin_PD15) }, - //more useful LED names - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PD15) }, - //AnalogIO names - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - //actual LED names - { MP_ROM_QSTR(MP_QSTR_LED_ORANGE), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PD15) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm32f4/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/board.c b/ports/stm32f4/boards/stm32f412zg_discovery/board.c deleted file mode 100644 index 4421970eef..0000000000 --- a/ports/stm32f4/boards/stm32f412zg_discovery/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h deleted file mode 100644 index f34b830fb2..0000000000 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "STM32F412G_DISCO" -#define MICROPY_HW_MCU_NAME "STM32F412xGS" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV (8) - -#define DEFAULT_I2C_BUS_SCL (&pin_PB10) -#define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk deleted file mode 100644 index b0205fc733..0000000000 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk +++ /dev/null @@ -1,22 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x8056 -USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" -USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC,HID" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -# QSPI_FLASH_FILESYSTEM = 1 -# EXTERNAL_FLASH_DEVICE_COUNT = 1 -# EXTERNAL_FLASH_DEVICES = N25Q128A -# LONGINT_IMPL = MPZ - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f412zx -MCU_PACKAGE = 144 -CMSIS_MCU = STM32F412Zx -LD_FILE = boards/STM32F412ZGTx_FLASH.ld - - diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c b/ports/stm32f4/boards/stm32f412zg_discovery/pins.c deleted file mode 100644 index ab90b04558..0000000000 --- a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, - { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, - { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, - { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, - { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, - { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, - { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, - { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, - { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, - { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, - { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, - { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, - { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, - { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PG10) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PG11) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PF03) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PF10) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG12) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PF04) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, //USART6 TX - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, //USART6 RX - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC05) }, //alt PB09, see F401ZG-DISCO manual - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, //alt PB10, see F401ZG-DISCO manual - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PE01) }, - { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE03) }, - - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index f1b4013485..0000000000 --- a/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,438 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -#define HAL_QSPI_MODULE_ENABLED -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/stm32f4_discovery/board.c b/ports/stm32f4/boards/stm32f4_discovery/board.c deleted file mode 100644 index 4421970eef..0000000000 --- a/ports/stm32f4/boards/stm32f4_discovery/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "boards/board.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.h deleted file mode 100644 index fcd7aa09cd..0000000000 --- a/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -//Micropython setup - -#define MICROPY_HW_BOARD_NAME "STM32F4_DISCO" -#define MICROPY_HW_MCU_NAME "STM32F407VG" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV (8) diff --git a/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.mk deleted file mode 100644 index 312a20f65a..0000000000 --- a/ports/stm32f4/boards/stm32f4_discovery/mpconfigboard.mk +++ /dev/null @@ -1,18 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x808A -USB_PRODUCT = "STM32F407VG Discovery Board - CPy" -USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -# This is technically a F407 but there's no difference -# other than the camera and ethernet, which aren't supported. -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f407xx -MCU_PACKAGE = 100 -CMSIS_MCU = STM32F407xx -LD_FILE = boards/STM32F407_fs.ld - diff --git a/ports/stm32f4/boards/stm32f4_discovery/pins.c b/ports/stm32f4/boards/stm32f4_discovery/pins.c deleted file mode 100644 index 712932145a..0000000000 --- a/ports/stm32f4/boards/stm32f4_discovery/pins.c +++ /dev/null @@ -1,107 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - //P1 - { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, - { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, - { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, - { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, - { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, - { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, - { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, - { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, // Differs from F411 - { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, - { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, - { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, - { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, - { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, - //P2 - { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, - { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, - { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, - { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, - { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, - { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, - { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, - { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, - { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, - { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, - { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - //ST LED names - { MP_ROM_QSTR(MP_QSTR_LD3), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LD4), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LD5), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LD6), MP_ROM_PTR(&pin_PD15) }, - //more useful LED names - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PD15) }, - //AnalogIO names - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - //actual LED names - { MP_ROM_QSTR(MP_QSTR_LED_ORANGE), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PD15) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f4_discovery/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f4_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index ee5832d49c..0000000000 --- a/ports/stm32f4/boards/stm32f4_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/common-hal/analogio/AnalogIn.c b/ports/stm32f4/common-hal/analogio/AnalogIn.c deleted file mode 100644 index 1d1b308b66..0000000000 --- a/ports/stm32f4/common-hal/analogio/AnalogIn.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "common-hal/analogio/AnalogIn.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - -#include "common-hal/microcontroller/Pin.h" - -#include "stm32f4xx_hal.h" -#include "stm32f4xx_ll_gpio.h" -#include "stm32f4xx_ll_adc.h" -#include "stm32f4xx_ll_bus.h" - -void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self, - const mcu_pin_obj_t *pin) { - - // No ADC function on pin - if (pin->adc_unit == 0x00) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); - } - // TODO: add ADC traits to structure? - - // Note that ADC2 is always bundled pin-to-pin with ADC1 if it exists, and used only - // for dual conversion. For this basic application it is never used. - LL_GPIO_SetPinMode(pin_port(pin->port), (uint32_t)pin_mask(pin->number), LL_GPIO_MODE_ANALOG); - if (pin->adc_unit & 0x01) { - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1); - } else if (pin->adc_unit == 0x04) { - #ifdef LL_APB2_GRP1_PERIPH_ADC3 - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); - #endif - } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); - } - claim_pin(pin); - self->pin = pin; -} - -bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { - return self->pin == NULL; -} - -void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { - if (common_hal_analogio_analogin_deinited(self)) { - return; - } - reset_pin_number(self->pin->port,self->pin->number); - self->pin = NULL; -} - -uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { - // Something else might have used the ADC in a different way, - // so we completely re-initialize it. - ADC_TypeDef * ADCx; - - if(self->pin->adc_unit & 0x01) { - ADCx = ADC1; - } else if (self->pin->adc_unit == 0x04) { - #ifdef ADC3 - ADCx = ADC3; - #endif - } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); - } - - LL_GPIO_SetPinMode(pin_port(self->pin->port), (uint32_t)pin_mask(self->pin->number), LL_GPIO_MODE_ANALOG); - //LL_GPIO_PIN_0 - - //HAL Implementation - ADC_HandleTypeDef AdcHandle; - ADC_ChannelConfTypeDef sConfig; - - AdcHandle.Instance = ADCx; - AdcHandle.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; - AdcHandle.Init.Resolution = ADC_RESOLUTION_12B; - AdcHandle.Init.ScanConvMode = DISABLE; - AdcHandle.Init.ContinuousConvMode = DISABLE; - AdcHandle.Init.DiscontinuousConvMode = DISABLE; - AdcHandle.Init.NbrOfDiscConversion = 0; - AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; - AdcHandle.Init.ExternalTrigConv = ADC_SOFTWARE_START; - AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT; - AdcHandle.Init.NbrOfConversion = 1; - AdcHandle.Init.DMAContinuousRequests = DISABLE; - AdcHandle.Init.EOCSelection = ADC_EOC_SINGLE_CONV; - HAL_ADC_Init(&AdcHandle); - - sConfig.Channel = (uint32_t)self->pin->adc_channel; //ADC_CHANNEL_0 <-normal iteration, not mask - sConfig.Rank = 1; - sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES; //Taken from micropython - HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); - - HAL_ADC_Start(&AdcHandle); - HAL_ADC_PollForConversion(&AdcHandle,1); - uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); - HAL_ADC_Stop(&AdcHandle); - - // // Shift the value to be 16 bit. - return value << 4; -} - -float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { - return 3.3f; -} diff --git a/ports/stm32f4/common-hal/analogio/AnalogIn.h b/ports/stm32f4/common-hal/analogio/AnalogIn.h deleted file mode 100644 index 910092897e..0000000000 --- a/ports/stm32f4/common-hal/analogio/AnalogIn.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H - -#include "common-hal/microcontroller/Pin.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - const mcu_pin_obj_t * pin; -} analogio_analogin_obj_t; - -static inline uint8_t stm32_adc_units(uint8_t adc_packed) { - return adc_packed >> 5; -} - -static inline uint8_t stm32_adc_channel(uint8_t adc_packed) { - return adc_packed & 0x1f; -} - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGIN_H diff --git a/ports/stm32f4/common-hal/analogio/AnalogOut.c b/ports/stm32f4/common-hal/analogio/AnalogOut.c deleted file mode 100644 index 2ea969f503..0000000000 --- a/ports/stm32f4/common-hal/analogio/AnalogOut.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019, Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -#include "py/mperrno.h" -#include "py/runtime.h" - -#include "shared-bindings/analogio/AnalogOut.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" - -#include "common-hal/microcontroller/Pin.h" - -#include "stm32f4xx_hal.h" - -//DAC is shared between both channels. -#if HAS_DAC -DAC_HandleTypeDef handle; -#endif - -STATIC bool dac_on[2]; - -void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, - const mcu_pin_obj_t *pin) { - #if !(HAS_DAC) - mp_raise_ValueError(translate("No DAC on chip")); - #else - if (pin == &pin_PA04) { - self->channel = DAC_CHANNEL_1; - self->dac_index = 0; - } else if (pin == &pin_PA05) { - self->channel = DAC_CHANNEL_2; - self->dac_index = 1; - } else { - mp_raise_ValueError(translate("Invalid DAC pin supplied")); - } - - //Only init if the shared DAC is empty or reset - if (handle.Instance == NULL || handle.State == HAL_DAC_STATE_RESET) { - __HAL_RCC_DAC_CLK_ENABLE(); - handle.Instance = DAC; - if (HAL_DAC_Init(&handle) != HAL_OK) - { - mp_raise_ValueError(translate("DAC Device Init Error")); - } - } - - //init channel specific pin - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(pin->number); - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); - - self->ch_handle.DAC_Trigger = DAC_TRIGGER_NONE; - self->ch_handle.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE; - if (HAL_DAC_ConfigChannel(&handle, &self->ch_handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("DAC Channel Init Error")); - } - - dac_on[self->dac_index] = true; - self->pin = pin; - claim_pin(pin); - #endif -} - -bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { - return !dac_on[self->dac_index]; -} - -void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #if HAS_DAC - reset_pin_number(self->pin->port,self->pin->number); - self->pin = NULL; - dac_on[self->dac_index] = false; - - //turn off the DAC if both channels are off - if(dac_on[0] == false && dac_on[1] == false) { - __HAL_RCC_DAC_CLK_DISABLE(); - HAL_DAC_DeInit(&handle); - } - #endif -} - -void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, - uint16_t value) { - #if HAS_DAC - HAL_DAC_SetValue(&handle, self->channel, DAC_ALIGN_12B_R, value >> 4); - HAL_DAC_Start(&handle, self->channel); - #endif -} - -void analogout_reset(void) { - #if HAS_DAC - __HAL_RCC_DAC_CLK_DISABLE(); - HAL_DAC_DeInit(&handle); - #endif -} diff --git a/ports/stm32f4/common-hal/analogio/AnalogOut.h b/ports/stm32f4/common-hal/analogio/AnalogOut.h deleted file mode 100644 index 61591d0e65..0000000000 --- a/ports/stm32f4/common-hal/analogio/AnalogOut.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H - -#include "common-hal/microcontroller/Pin.h" - -#include "py/obj.h" -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" - -typedef struct { - mp_obj_base_t base; -#if HAS_DAC - DAC_ChannelConfTypeDef ch_handle; -#endif - const mcu_pin_obj_t * pin; - uint8_t channel; - uint8_t dac_index:1; -} analogio_analogout_obj_t; - -void analogout_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_ANALOGIO_ANALOGOUT_H diff --git a/ports/stm32f4/common-hal/analogio/__init__.c b/ports/stm32f4/common-hal/analogio/__init__.c deleted file mode 100644 index eea58c77d6..0000000000 --- a/ports/stm32f4/common-hal/analogio/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No analogio module functions. diff --git a/ports/stm32f4/common-hal/board/__init__.c b/ports/stm32f4/common-hal/board/__init__.c deleted file mode 100644 index 880033ed67..0000000000 --- a/ports/stm32f4/common-hal/board/__init__.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Dan Halbert for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c deleted file mode 100644 index 8e98b966d2..0000000000 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include - -#include "shared-bindings/busio/I2C.h" -#include "py/mperrno.h" -#include "py/runtime.h" -#include "stm32f4xx_hal.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" - -//arrays use 0 based numbering: I2C1 is stored at index 0 -#define MAX_I2C 3 -STATIC bool reserved_i2c[MAX_I2C]; -STATIC bool never_reset_i2c[MAX_I2C]; - -#define ALL_CLOCKS 0xFF -STATIC void i2c_clock_enable(uint8_t mask); -STATIC void i2c_clock_disable(uint8_t mask); - -void i2c_reset(void) { - uint16_t never_reset_mask = 0x00; - for(int i = 0; i < MAX_I2C; i++) { - if (!never_reset_i2c[i]) { - reserved_i2c[i] = false; - } else { - never_reset_mask |= 1 << i; - } - } - i2c_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); -} - -void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, - const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { - - //match pins to I2C objects - I2C_TypeDef * I2Cx; - uint8_t sda_len = MP_ARRAY_SIZE(mcu_i2c_sda_list); - uint8_t scl_len = MP_ARRAY_SIZE(mcu_i2c_scl_list); - bool i2c_taken = false; - - for (uint i = 0; i < sda_len; i++) { - if (mcu_i2c_sda_list[i].pin == sda) { - for (uint j = 0; j < scl_len; j++) { - if ((mcu_i2c_scl_list[j].pin == scl) - && (mcu_i2c_scl_list[j].i2c_index == mcu_i2c_sda_list[i].i2c_index)) { - //keep looking if the I2C is taken, could be another SCL that works - if (reserved_i2c[mcu_i2c_scl_list[i].i2c_index - 1]) { - i2c_taken = true; - continue; - } - self->scl = &mcu_i2c_scl_list[j]; - self->sda = &mcu_i2c_sda_list[i]; - break; - } - } - } - } - - //handle typedef selection, errors - if (self->sda != NULL && self->scl != NULL ) { - I2Cx = mcu_i2c_banks[self->sda->i2c_index - 1]; - } else { - if (i2c_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid I2C pin selection")); - } - } - - //Start GPIO for each pin - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(sda->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->sda->altfn_index; - HAL_GPIO_Init(pin_port(sda->port), &GPIO_InitStruct); - - GPIO_InitStruct.Pin = pin_mask(scl->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = self->scl->altfn_index; - HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); - - //Note: due to I2C soft reboot issue, do not relocate clock init. - i2c_clock_enable(1 << (self->sda->i2c_index - 1)); - reserved_i2c[self->sda->i2c_index - 1] = true; - - self->handle.Instance = I2Cx; - self->handle.Init.ClockSpeed = 100000; - self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; - self->handle.Init.OwnAddress1 = 0; - self->handle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; - self->handle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; - self->handle.Init.OwnAddress2 = 0; - self->handle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; - self->handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; - self->handle.State = HAL_I2C_STATE_RESET; - if (HAL_I2C_Init(&(self->handle)) != HAL_OK) { - mp_raise_RuntimeError(translate("I2C Init Error")); - } - claim_pin(sda); - claim_pin(scl); -} - -void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_i2c_banks); i++) { - if (self->handle.Instance == mcu_i2c_banks[i]) { - never_reset_i2c[i] = true; - - never_reset_pin_number(self->scl->pin->port, self->scl->pin->number); - never_reset_pin_number(self->sda->pin->port, self->sda->pin->number); - break; - } - } -} - -bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { - return self->sda == NULL; -} - -void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { - if (common_hal_busio_i2c_deinited(self)) { - return; - } - - i2c_clock_disable(1 << (self->sda->i2c_index - 1)); - reserved_i2c[self->sda->i2c_index - 1] = false; - never_reset_i2c[self->sda->i2c_index - 1] = false; - - reset_pin_number(self->sda->pin->port,self->sda->pin->number); - reset_pin_number(self->scl->pin->port,self->scl->pin->number); - self->sda = NULL; - self->scl = NULL; -} - -bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { - return HAL_I2C_IsDeviceReady(&(self->handle), (uint16_t)(addr << 1), 2, 2) == HAL_OK; -} - -bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { - bool grabbed_lock = false; - - //Critical section code that may be required at some point. - // uint32_t store_primask = __get_PRIMASK(); - // __disable_irq(); - // __DMB(); - - if (!self->has_lock) { - grabbed_lock = true; - self->has_lock = true; - } - - // __DMB(); - // __set_PRIMASK(store_primask); - - return grabbed_lock; -} - -bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { - return self->has_lock; -} - -void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { - self->has_lock = false; -} - -uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, - const uint8_t *data, size_t len, bool transmit_stop_bit) { - HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1), - (uint8_t *)data, (uint16_t)len, 500); - return result == HAL_OK ? 0 : MP_EIO; -} - -uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, - uint8_t *data, size_t len) { - return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500) - == HAL_OK ? 0 : MP_EIO; -} - -STATIC void i2c_clock_enable(uint8_t mask) { - //Note: hard reset required due to soft reboot issue. - #ifdef I2C1 - if (mask & (1 << 0)) { - __HAL_RCC_I2C1_CLK_ENABLE(); - __HAL_RCC_I2C1_FORCE_RESET(); - __HAL_RCC_I2C1_RELEASE_RESET(); - } - #endif - #ifdef I2C2 - if (mask & (1 << 1)) { - __HAL_RCC_I2C2_CLK_ENABLE(); - __HAL_RCC_I2C2_FORCE_RESET(); - __HAL_RCC_I2C2_RELEASE_RESET(); - } - #endif - #ifdef I2C3 - if (mask & (1 << 2)) { - __HAL_RCC_I2C3_CLK_ENABLE(); - __HAL_RCC_I2C3_FORCE_RESET(); - __HAL_RCC_I2C3_RELEASE_RESET(); - } - #endif -} - -STATIC void i2c_clock_disable(uint8_t mask) { - #ifdef I2C1 - if (mask & (1 << 0)) { - __HAL_RCC_I2C1_CLK_DISABLE(); - } - #endif - #ifdef I2C2 - if (mask & (1 << 1)) { - __HAL_RCC_I2C2_CLK_DISABLE(); - } - #endif - #ifdef I2C3 - if (mask & (1 << 2)) { - __HAL_RCC_I2C3_CLK_DISABLE(); - } - #endif -} diff --git a/ports/stm32f4/common-hal/busio/I2C.h b/ports/stm32f4/common-hal/busio/I2C.h deleted file mode 100644 index b5c891a98d..0000000000 --- a/ports/stm32f4/common-hal/busio/I2C.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H - -#include "common-hal/microcontroller/Pin.h" - -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - I2C_HandleTypeDef handle; - bool has_lock; - const mcu_i2c_scl_obj_t *scl; - const mcu_i2c_sda_obj_t *sda; -} busio_i2c_obj_t; - -void i2c_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/stm32f4/common-hal/busio/OneWire.h b/ports/stm32f4/common-hal/busio/OneWire.h deleted file mode 100644 index 6e8c829793..0000000000 --- a/ports/stm32f4/common-hal/busio/OneWire.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H - -// Use bitbangio. -#include "shared-module/busio/OneWire.h" - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c deleted file mode 100644 index 7e25e0a571..0000000000 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ /dev/null @@ -1,470 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include - -#include "shared-bindings/busio/SPI.h" -#include "py/mperrno.h" -#include "py/runtime.h" -#include "stm32f4xx_hal.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "boards/board.h" -#include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" - -// Note that any bugs introduced in this file can cause crashes at startup -// for chips using external SPI flash. - -//arrays use 0 based numbering: SPI1 is stored at index 0 -#define MAX_SPI 6 -STATIC bool reserved_spi[MAX_SPI]; -STATIC bool never_reset_spi[MAX_SPI]; - -#define ALL_CLOCKS 0xFF -STATIC void spi_clock_enable(uint8_t mask); -STATIC void spi_clock_disable(uint8_t mask); - -STATIC uint32_t get_busclock(SPI_TypeDef * instance) { - //SPI2 and 3 are on PCLK1, if they exist. - #ifdef SPI2 - if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); - #endif - #ifdef SPI3 - if (instance == SPI3) return HAL_RCC_GetPCLK1Freq(); - #endif - return HAL_RCC_GetPCLK2Freq(); -} - -STATIC uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler, uint32_t busclock) { - static const uint32_t baud_map[8][2] = { - {2,SPI_BAUDRATEPRESCALER_2}, - {4,SPI_BAUDRATEPRESCALER_4}, - {8,SPI_BAUDRATEPRESCALER_8}, - {16,SPI_BAUDRATEPRESCALER_16}, - {32,SPI_BAUDRATEPRESCALER_32}, - {64,SPI_BAUDRATEPRESCALER_64}, - {128,SPI_BAUDRATEPRESCALER_128}, - {256,SPI_BAUDRATEPRESCALER_256} - }; - size_t i = 0; - uint16_t divisor; - do { - divisor = baud_map[i][0]; - if (baudrate >= (busclock/divisor)) { - *prescaler = divisor; - return baud_map[i][1]; - } - i++; - } while (divisor != 256); - //only gets here if requested baud is lower than minimum - *prescaler = 256; - return SPI_BAUDRATEPRESCALER_256; -} - -void spi_reset(void) { - uint16_t never_reset_mask = 0x00; - for (int i = 0; i < MAX_SPI; i++) { - if (!never_reset_spi[i]) { - reserved_spi[i] = false; - } else { - never_reset_mask |= 1 << i; - } - } - spi_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); -} - -void common_hal_busio_spi_construct(busio_spi_obj_t *self, - const mcu_pin_obj_t * sck, const mcu_pin_obj_t * mosi, - const mcu_pin_obj_t * miso) { - - //match pins to SPI objects - SPI_TypeDef * SPIx; - - uint8_t sck_len = MP_ARRAY_SIZE(mcu_spi_sck_list); - uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); - uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); - bool spi_taken = false; - - //SCK is not optional. MOSI and MISO are - for (uint i = 0; i < sck_len; i++) { - if (mcu_spi_sck_list[i].pin == sck) { - //if both MOSI and MISO exist, loop search normally - if ((mosi != NULL) && (miso != NULL)) { - //MOSI - for (uint j = 0; j < mosi_len; j++) { - if (mcu_spi_mosi_list[j].pin == mosi) { - //MISO - for (uint k = 0; k < miso_len; k++) { - if ((mcu_spi_miso_list[k].pin == miso) //everything needs the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index) - && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[k].spi_index)) { - //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { - spi_taken = true; - continue; - } - //store pins if not - self->sck = &mcu_spi_sck_list[i]; - self->mosi = &mcu_spi_mosi_list[j]; - self->miso = &mcu_spi_miso_list[k]; - break; - } - } - } - } - // if just MISO, reduce search - } else if (miso != NULL) { - for (uint j = 0; j < miso_len; j++) { - if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) { - //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { - spi_taken = true; - continue; - } - //store pins if not - self->sck = &mcu_spi_sck_list[i]; - self->mosi = NULL; - self->miso = &mcu_spi_miso_list[j]; - break; - } - } - // if just MOSI, reduce search - } else if (mosi != NULL) { - for (uint j = 0; j < mosi_len; j++) { - if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) { - //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { - spi_taken = true; - continue; - } - //store pins if not - self->sck = &mcu_spi_sck_list[i]; - self->mosi = &mcu_spi_mosi_list[j]; - self->miso = NULL; - break; - } - } - } else { - //throw an error immediately - mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); - } - } - } - - //handle typedef selection, errors - if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || - (self->sck != NULL && self->mosi != NULL && miso == NULL) || - (self->sck != NULL && self->miso != NULL && mosi == NULL)) { - SPIx = mcu_spi_banks[self->sck->spi_index - 1]; - } else { - if (spi_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid SPI pin selection")); - } - } - - //Start GPIO for each pin - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(sck->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->sck->altfn_index; - HAL_GPIO_Init(pin_port(sck->port), &GPIO_InitStruct); - - if (self->mosi != NULL) { - GPIO_InitStruct.Pin = pin_mask(mosi->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->mosi->altfn_index; - HAL_GPIO_Init(pin_port(mosi->port), &GPIO_InitStruct); - } - - if (self->miso != NULL) { - GPIO_InitStruct.Pin = pin_mask(miso->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->miso->altfn_index; - HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); - } - - spi_clock_enable(1 << (self->sck->spi_index - 1)); - reserved_spi[self->sck->spi_index - 1] = true; - - self->handle.Instance = SPIx; - self->handle.Init.Mode = SPI_MODE_MASTER; - // Direction change only required for RX-only, see RefMan RM0090:884 - self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES; - self->handle.Init.DataSize = SPI_DATASIZE_8BIT; - self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; - self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; - self->handle.Init.NSS = SPI_NSS_SOFT; - self->handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; - self->handle.Init.FirstBit = SPI_FIRSTBIT_MSB; - self->handle.Init.TIMode = SPI_TIMODE_DISABLE; - self->handle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - self->handle.Init.CRCPolynomial = 10; - if (HAL_SPI_Init(&self->handle) != HAL_OK) - { - mp_raise_ValueError(translate("SPI Init Error")); - } - self->baudrate = (get_busclock(SPIx) / 16); - self->prescaler = 16; - self->polarity = 0; - self->phase = 0; - self->bits = 8; - - claim_pin(sck); - if (self->mosi != NULL) { - claim_pin(mosi); - } - if (self->miso != NULL) { - claim_pin(miso); - } -} - -void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { - if (mcu_spi_banks[i] == self->handle.Instance) { - never_reset_spi[i] = true; - never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); - if (self->mosi != NULL) { - never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); - } - if (self->miso != NULL) { - never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); - } - break; - } - } -} - -bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { - return self->sck->pin == NULL; -} - -void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { - if (common_hal_busio_spi_deinited(self)) { - return; - } - spi_clock_disable(1<<(self->sck->spi_index - 1)); - reserved_spi[self->sck->spi_index - 1] = false; - never_reset_spi[self->sck->spi_index - 1] = false; - - reset_pin_number(self->sck->pin->port,self->sck->pin->number); - if (self->mosi != NULL) { - reset_pin_number(self->mosi->pin->port,self->mosi->pin->number); - } - if (self->miso != NULL) { - reset_pin_number(self->miso->pin->port,self->miso->pin->number); - } - self->sck = NULL; - self->mosi = NULL; - self->miso = NULL; -} - -bool common_hal_busio_spi_configure(busio_spi_obj_t *self, - uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { - //This resets the SPI, so check before updating it redundantly - if (baudrate == self->baudrate && polarity== self->polarity - && phase == self->phase && bits == self->bits) { - return true; - } - - //Deinit SPI - HAL_SPI_DeInit(&self->handle); - - self->handle.Init.DataSize = (bits == 16) ? SPI_DATASIZE_16BIT : SPI_DATASIZE_8BIT; - self->handle.Init.CLKPolarity = (polarity) ? SPI_POLARITY_HIGH : SPI_POLARITY_LOW; - self->handle.Init.CLKPhase = (phase) ? SPI_PHASE_2EDGE : SPI_PHASE_1EDGE; - - self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, - get_busclock(self->handle.Instance)); - - if (HAL_SPI_Init(&self->handle) != HAL_OK) - { - mp_raise_ValueError(translate("SPI Re-initialization error")); - } - - self->baudrate = baudrate; - self->polarity = polarity; - self->phase = phase; - self->bits = bits; - return true; -} - -bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { - bool grabbed_lock = false; - - //Critical section code that may be required at some point. - // uint32_t store_primask = __get_PRIMASK(); - // __disable_irq(); - // __DMB(); - - if (!self->has_lock) { - grabbed_lock = true; - self->has_lock = true; - } - - // __DMB(); - // __set_PRIMASK(store_primask); - - return grabbed_lock; -} - -bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { - return self->has_lock; -} - -void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { - self->has_lock = false; -} - -bool common_hal_busio_spi_write(busio_spi_obj_t *self, - const uint8_t *data, size_t len) { - if (self->mosi == NULL) { - mp_raise_ValueError(translate("No MOSI Pin")); - } - HAL_StatusTypeDef result = HAL_SPI_Transmit (&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); - return result == HAL_OK; -} - -bool common_hal_busio_spi_read(busio_spi_obj_t *self, - uint8_t *data, size_t len, uint8_t write_value) { - if (self->miso == NULL) { - mp_raise_ValueError(translate("No MISO Pin")); - } - HAL_StatusTypeDef result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY); - return result == HAL_OK; -} - -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, - uint8_t *data_out, uint8_t *data_in, size_t len) { - if (self->miso == NULL || self->mosi == NULL) { - mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); - } - HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle, - data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); - return result == HAL_OK; -} - -uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { - //returns actual frequency - uint32_t result = HAL_RCC_GetPCLK2Freq()/self->prescaler; - return result; -} - -uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { - return self->phase; -} - -uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { - return self->polarity; -} - -STATIC void spi_clock_enable(uint8_t mask) { - #ifdef SPI1 - if (mask & (1 << 0)) { - __HAL_RCC_SPI1_CLK_ENABLE(); - } - #endif - #ifdef SPI2 - if (mask & (1 << 1)) { - __HAL_RCC_SPI2_CLK_ENABLE(); - } - #endif - #ifdef SPI3 - if (mask & (1 << 2)) { - __HAL_RCC_SPI3_CLK_ENABLE(); - } - #endif - #ifdef SPI4 - if (mask & (1 << 3)) { - __HAL_RCC_SPI4_CLK_ENABLE(); - } - #endif - #ifdef SPI5 - if (mask & (1 << 4)) { - __HAL_RCC_SPI5_CLK_ENABLE(); - } - #endif - #ifdef SPI6 - if (mask & (1 << 5)) { - __HAL_RCC_SPI6_CLK_ENABLE(); - } - #endif -} - -STATIC void spi_clock_disable(uint8_t mask) { - #ifdef SPI1 - if (mask & (1 << 0)) { - __HAL_RCC_SPI1_CLK_DISABLE(); - __HAL_RCC_SPI1_FORCE_RESET(); - __HAL_RCC_SPI1_RELEASE_RESET(); - } - #endif - #ifdef SPI2 - if (mask & (1 << 1)) { - __HAL_RCC_SPI2_CLK_DISABLE(); - __HAL_RCC_SPI2_FORCE_RESET(); - __HAL_RCC_SPI2_RELEASE_RESET(); - } - #endif - #ifdef SPI3 - if (mask & (1 << 2)) { - __HAL_RCC_SPI3_CLK_DISABLE(); - __HAL_RCC_SPI3_FORCE_RESET(); - __HAL_RCC_SPI3_RELEASE_RESET(); - } - #endif - #ifdef SPI4 - if (mask & (1 << 3)) { - __HAL_RCC_SPI4_CLK_DISABLE(); - __HAL_RCC_SPI4_FORCE_RESET(); - __HAL_RCC_SPI4_RELEASE_RESET(); - } - #endif - #ifdef SPI5 - if (mask & (1 << 4)) { - __HAL_RCC_SPI5_CLK_DISABLE(); - __HAL_RCC_SPI5_FORCE_RESET(); - __HAL_RCC_SPI5_RELEASE_RESET(); - } - #endif - #ifdef SPI6 - if (mask & (1 << 5)) { - __HAL_RCC_SPI6_CLK_DISABLE(); - __HAL_RCC_SPI6_FORCE_RESET(); - __HAL_RCC_SPI6_RELEASE_RESET(); - } - #endif -} diff --git a/ports/stm32f4/common-hal/busio/SPI.h b/ports/stm32f4/common-hal/busio/SPI.h deleted file mode 100644 index 067d2fcb65..0000000000 --- a/ports/stm32f4/common-hal/busio/SPI.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H - -#include "common-hal/microcontroller/Pin.h" - -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - SPI_HandleTypeDef handle; - bool has_lock; - const mcu_spi_sck_obj_t *sck; - const mcu_spi_mosi_obj_t *mosi; - const mcu_spi_miso_obj_t *miso; - const mcu_spi_nss_obj_t *nss; - uint32_t baudrate; - uint16_t prescaler; - uint8_t polarity; - uint8_t phase; - uint8_t bits; -} busio_spi_obj_t; - -void spi_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c deleted file mode 100644 index 0b434fd023..0000000000 --- a/ports/stm32f4/common-hal/busio/UART.c +++ /dev/null @@ -1,626 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/busio/UART.h" - -#include "mpconfigport.h" -#include "lib/utils/interrupt_char.h" -#include "py/gc.h" -#include "py/mperrno.h" -#include "py/runtime.h" -#include "py/stream.h" -#include "supervisor/shared/translate.h" - -#include "tick.h" -#include "stm32f4xx_hal.h" - -#define ALL_UARTS 0xFFFF - -//arrays use 0 based numbering: UART1 is stored at index 0 -STATIC bool reserved_uart[MAX_UART]; -int errflag; //Used to restart read halts - -STATIC void uart_clock_enable(uint16_t mask); -STATIC void uart_clock_disable(uint16_t mask); -STATIC void uart_assign_irq(busio_uart_obj_t* self, USART_TypeDef* USARTx); - -STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, - int uart_index, bool uart_taken) { - if (pin_eval) { - //assign a root pointer pointer for IRQ - MP_STATE_PORT(cpy_uart_obj_all)[uart_index] = self; - return mcu_uart_banks[uart_index]; - } else { - if (uart_taken) { - mp_raise_ValueError(translate("Hardware in use, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); - } - } -} - -void uart_reset(void) { - for (uint8_t i = 0; i < MAX_UART; i++) { - reserved_uart[i] = false; - MP_STATE_PORT(cpy_uart_obj_all)[i] = NULL; - } - uart_clock_disable(ALL_UARTS); -} - -void common_hal_busio_uart_construct(busio_uart_obj_t *self, - const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, - const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, - const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { - - //match pins to UART objects - USART_TypeDef * USARTx; - - uint8_t tx_len = MP_ARRAY_SIZE(mcu_uart_tx_list); - uint8_t rx_len = MP_ARRAY_SIZE(mcu_uart_rx_list); - bool uart_taken = false; - uint8_t uart_index = 0; //origin 0 corrected - - if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); - } - - //Can have both pins, or either - if ((tx != NULL) && (rx != NULL)) { - //normal find loop if both pins exist - for (uint i = 0; i < tx_len; i++) { - if (mcu_uart_tx_list[i].pin == tx) { - //rx - for (uint j = 0; j < rx_len; j++) { - if (mcu_uart_rx_list[j].pin == rx - && mcu_uart_rx_list[j].uart_index == mcu_uart_tx_list[i].uart_index) { - //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { - uart_taken = true; - continue; - } - //store pins if not - self->tx = &mcu_uart_tx_list[i]; - self->rx = &mcu_uart_rx_list[j]; - break; - } - } - } - } - uart_index = self->tx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), - uart_index, uart_taken); - } else if (tx == NULL) { - //If there is no tx, run only rx - for (uint i = 0; i < rx_len; i++) { - if (mcu_uart_rx_list[i].pin == rx) { - //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_rx_list[i].uart_index - 1]) { - uart_taken = true; - continue; - } - //store pins if not - self->rx = &mcu_uart_rx_list[i]; - break; - } - } - uart_index = self->rx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->rx != NULL), - uart_index, uart_taken); - } else if (rx == NULL) { - //If there is no rx, run only tx - for (uint i = 0; i < tx_len; i++) { - if (mcu_uart_tx_list[i].pin == tx) { - //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { - uart_taken = true; - continue; - } - //store pins if not - self->tx = &mcu_uart_tx_list[i]; - break; - } - } - uart_index = self->tx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->tx != NULL), - uart_index, uart_taken); - } else { - //both pins cannot be empty - mp_raise_ValueError(translate("Supply at least one UART pin")); - } - - //Other errors - if ( receiver_buffer_size == 0 ) { - mp_raise_ValueError(translate("Invalid buffer size")); - } - if ( bits != 8 && bits != 9 ) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - if ( USARTx == NULL) { //this can only be hit if the periph file is wrong - mp_raise_ValueError(translate("Internal define error")); - } - - //GPIO Init - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if (self->tx != NULL) { - GPIO_InitStruct.Pin = pin_mask(tx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->tx->altfn_index; - HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); - } - if (self->rx != NULL) { - GPIO_InitStruct.Pin = pin_mask(rx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->rx->altfn_index; - HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); - } - - //reserve uart and enable the peripheral - reserved_uart[uart_index] = true; - uart_clock_enable(1 << (uart_index)); - uart_assign_irq(self, USARTx); - - self->handle.Instance = USARTx; - self->handle.Init.BaudRate = baudrate; - self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; - self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; - self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : - (parity == PARITY_EVEN) ? UART_PARITY_EVEN : - UART_PARITY_NONE; - self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : - (self->tx != NULL) ? UART_MODE_TX : - UART_MODE_RX; - self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; - self->handle.Init.OverSampling = UART_OVERSAMPLING_16; - if (HAL_UART_Init(&self->handle) != HAL_OK) - { - mp_raise_ValueError(translate("UART Init Error")); - - } - - // Init buffer for rx and claim pins - if (self->rx != NULL) { - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); - if (!self->rbuf.buf) { - mp_raise_ValueError(translate("UART Buffer allocation error")); - } - claim_pin(rx); - } - if (self->tx != NULL) { - claim_pin(tx); - } - self->baudrate = baudrate; - self->timeout_ms = timeout * 1000; - - //start the interrupt series - if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { - mp_raise_ValueError(translate("Could not start interrupt, RX busy")); - } - - //start the receive interrupt chain - HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention - HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); - HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); - HAL_NVIC_EnableIRQ(self->irq); - - errflag = HAL_OK; -} - -bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->tx->pin == NULL; -} - -void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { - if (common_hal_busio_uart_deinited(self)) return; - - reset_pin_number(self->tx->pin->port,self->tx->pin->number); - reset_pin_number(self->rx->pin->port,self->rx->pin->number); - self->tx = NULL; - self->rx = NULL; - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; -} - -size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (self->rx == NULL) { - mp_raise_ValueError(translate("No RX pin")); - } - - size_t rx_bytes = 0; - uint64_t start_ticks = supervisor_ticks_ms64(); - - // Wait for all bytes received or timeout, same as nrf - while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { - RUN_BACKGROUND_TASKS; - //restart if it failed in the callback - if (errflag != HAL_OK) { - errflag = HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); - } - // Allow user to break out of a timeout with a KeyboardInterrupt. - if ( mp_hal_is_interrupted() ) { - return 0; - } - } - - // Halt reception - HAL_NVIC_DisableIRQ(self->irq); - // copy received data - rx_bytes = ringbuf_count(&self->rbuf); - rx_bytes = MIN(rx_bytes, len); - for (uint16_t i = 0; i < rx_bytes; i++) { - data[i] = ringbuf_get(&self->rbuf); - } - HAL_NVIC_EnableIRQ(self->irq); - - if (rx_bytes == 0) { - *errcode = EAGAIN; - return MP_STREAM_ERROR; - } - return rx_bytes; -} - -// Write characters. -size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - if (self->tx == NULL) { - mp_raise_ValueError(translate("No TX pin")); - } - bool write_err = false; //write error shouldn't disable interrupts - - HAL_NVIC_DisableIRQ(self->irq); - if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, HAL_MAX_DELAY) != HAL_OK) { - write_err = true; - } - HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); - HAL_NVIC_EnableIRQ(self->irq); - - if (write_err) { - mp_raise_ValueError(translate("UART write error")); - } - return len; -} - -void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) -{ - for (int i = 0; i < 7; i++) { - //get context pointer and cast it as struct pointer - busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[i]; - if (handle == &context->handle) { - //check if transaction is ongoing - if ((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { - return; - } - ringbuf_put_n(&context->rbuf, &context->rx_char, 1); - errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); - - return; - } - } -} - -void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) -{ - if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_PE) != RESET) { - __HAL_UART_CLEAR_PEFLAG(UartHandle); - } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_FE) != RESET) { - __HAL_UART_CLEAR_FEFLAG(UartHandle); - } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_NE) != RESET) { - __HAL_UART_CLEAR_NEFLAG(UartHandle); - } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_ORE) != RESET) { - __HAL_UART_CLEAR_OREFLAG(UartHandle); - } - //restart serial read after an error - for (int i = 0; i < 7; i++) { - busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; - if (UartHandle == &context->handle) { - HAL_UART_Receive_IT(UartHandle, &context->rx_char, 1); - return; - } - } - -} - -uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { - return self->baudrate; -} - -void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { - //Don't reset if it's the same value - if (baudrate == self->baudrate) return; - - //Otherwise de-init and set new rate - if (HAL_UART_DeInit(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART De-init error")); - } - self->handle.Init.BaudRate = baudrate; - if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART Re-init error")); - } - - self->baudrate = baudrate; -} - -mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { - return (mp_float_t) (self->timeout_ms / 1000.0f); -} - -void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { - self->timeout_ms = timeout * 1000; -} - -uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_count(&self->rbuf); -} - -void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - // Halt reception - HAL_NVIC_DisableIRQ(self->irq); - ringbuf_clear(&self->rbuf); - HAL_NVIC_EnableIRQ(self->irq); -} - -bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - return __HAL_UART_GET_FLAG(&self->handle, UART_FLAG_TXE); -} - -STATIC void call_hal_irq(int uart_num) { - //Create casted context pointer - busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[uart_num - 1]; - if (context != NULL) { - HAL_NVIC_ClearPendingIRQ(context->irq); - HAL_UART_IRQHandler(&context->handle); - } -} - -// UART/USART IRQ handlers -void USART1_IRQHandler(void) { - call_hal_irq(1); -} - -void USART2_IRQHandler(void) { - call_hal_irq(2); -} - -void USART3_IRQHandler(void) { - call_hal_irq(3); -} - -void UART4_IRQHandler(void) { - call_hal_irq(4); -} - -void UART5_IRQHandler(void) { - call_hal_irq(5); -} - -void USART6_IRQHandler(void) { - call_hal_irq(6); -} - -STATIC void uart_clock_enable(uint16_t mask) { - #ifdef USART1 - if (mask & (1 << 0)) { - __HAL_RCC_USART1_FORCE_RESET(); - __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_ENABLE(); - } - #endif - #ifdef USART2 - if (mask & (1 << 1)) { - __HAL_RCC_USART2_FORCE_RESET(); - __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_ENABLE(); - } - #endif - #ifdef USART3 - if (mask & (1 << 2)) { - __HAL_RCC_USART3_FORCE_RESET(); - __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_ENABLE(); - } - #endif - #ifdef UART4 - if (mask & (1 << 3)) { - __HAL_RCC_UART4_FORCE_RESET(); - __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_ENABLE(); - } - #endif - #ifdef UART5 - if (mask & (1 << 4)) { - __HAL_RCC_UART5_FORCE_RESET(); - __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_ENABLE(); - } - #endif - #ifdef USART6 - if (mask & (1 << 5)) { - __HAL_RCC_USART6_FORCE_RESET(); - __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_ENABLE(); - } - #endif - #ifdef UART7 - if (mask & (1 << 6)) { - __HAL_RCC_UART7_FORCE_RESET(); - __HAL_RCC_UART7_RELEASE_RESET(); - __HAL_RCC_UART7_CLK_ENABLE(); - } - #endif - #ifdef UART8 - if (mask & (1 << 7)) { - __HAL_RCC_UART8_FORCE_RESET(); - __HAL_RCC_UART8_RELEASE_RESET(); - __HAL_RCC_UART8_CLK_ENABLE(); - } - #endif - #ifdef UART9 - if (mask & (1 << 8)) { - __HAL_RCC_UART9_FORCE_RESET(); - __HAL_RCC_UART9_RELEASE_RESET(); - __HAL_RCC_UART9_CLK_ENABLE(); - } - #endif - #ifdef UART10 - if (mask & (1 << 9)) { - __HAL_RCC_UART10_FORCE_RESET(); - __HAL_RCC_UART10_RELEASE_RESET(); - __HAL_RCC_UART10_CLK_ENABLE(); - } - #endif -} - -STATIC void uart_clock_disable(uint16_t mask) { - #ifdef USART1 - if (mask & (1 << 0)) { - __HAL_RCC_USART1_FORCE_RESET(); - __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_DISABLE(); - } - #endif - #ifdef USART2 - if (mask & (1 << 1)) { - __HAL_RCC_USART2_FORCE_RESET(); - __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_DISABLE(); - } - #endif - #ifdef USART3 - if (mask & (1 << 2)) { - __HAL_RCC_USART3_FORCE_RESET(); - __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_DISABLE(); - } - #endif - #ifdef UART4 - if (mask & (1 << 3)) { - __HAL_RCC_UART4_FORCE_RESET(); - __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_DISABLE(); - } - #endif - #ifdef UART5 - if (mask & (1 << 4)) { - __HAL_RCC_UART5_FORCE_RESET(); - __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_DISABLE(); - } - #endif - #ifdef USART6 - if (mask & (1 << 5)) { - __HAL_RCC_USART6_FORCE_RESET(); - __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_DISABLE(); - } - #endif - #ifdef UART7 - if (mask & (1 << 6)) { - __HAL_RCC_UART7_FORCE_RESET(); - __HAL_RCC_UART7_RELEASE_RESET(); - __HAL_RCC_UART7_CLK_DISABLE(); - } - #endif - #ifdef UART8 - if (mask & (1 << 7)) { - __HAL_RCC_UART8_FORCE_RESET(); - __HAL_RCC_UART8_RELEASE_RESET(); - __HAL_RCC_UART8_CLK_DISABLE(); - } - #endif - #ifdef UART9 - if (mask & (1 << 8)) { - __HAL_RCC_UART9_FORCE_RESET(); - __HAL_RCC_UART9_RELEASE_RESET(); - __HAL_RCC_UART9_CLK_DISABLE(); - } - #endif - #ifdef UART10 - if (mask & (1 << 9)) { - __HAL_RCC_UART10_FORCE_RESET(); - __HAL_RCC_UART10_RELEASE_RESET(); - __HAL_RCC_UART10_CLK_DISABLE(); - } - #endif -} - -STATIC void uart_assign_irq(busio_uart_obj_t *self, USART_TypeDef * USARTx) { - #ifdef USART1 - if (USARTx == USART1) { - self->irq = USART1_IRQn; - } - #endif - #ifdef USART2 - if (USARTx == USART2) { - self->irq = USART2_IRQn; - } - #endif - #ifdef USART3 - if (USARTx == USART3) { - self->irq = USART3_IRQn; - } - #endif - #ifdef UART4 - if (USARTx == UART4) { - self->irq = UART4_IRQn; - } - #endif - #ifdef UART5 - if (USARTx == UART5) { - self->irq = UART5_IRQn; - } - #endif - #ifdef USART6 - if (USARTx == USART6) { - self->irq = USART6_IRQn; - } - #endif - #ifdef UART7 - if (USARTx == UART7) { - self->irq = UART7_IRQn; - } - #endif - #ifdef UART8 - if (USARTx == UART8) { - self->irq = UART8_IRQn; - } - #endif - #ifdef UART9 - if (USARTx == UART9) { - self->irq = UART9_IRQn; - } - #endif - #ifdef UART10 - if (USARTx == UART10) { - self->irq = UART10_IRQn; - } - #endif -} diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h deleted file mode 100644 index cde5fadd00..0000000000 --- a/ports/stm32f4/common-hal/busio/UART.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H - -#include "common-hal/microcontroller/Pin.h" -#include "stm32f4/periph.h" -#include "stm32f4xx_hal.h" - -#include "py/obj.h" -#include "py/ringbuf.h" - -#ifndef UART_IRQPRI -#define UART_IRQPRI 1 -#endif -#ifndef UART_IRQSUB_PRI -#define UART_IRQSUB_PRI 0 -#endif - -typedef struct { - mp_obj_base_t base; - UART_HandleTypeDef handle; - IRQn_Type irq; - const mcu_uart_tx_obj_t *tx; - const mcu_uart_rx_obj_t *rx; - - ringbuf_t rbuf; - uint8_t rx_char; - - uint32_t baudrate; - uint32_t timeout_ms; -} busio_uart_obj_t; - -void uart_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm32f4/common-hal/busio/__init__.c b/ports/stm32f4/common-hal/busio/__init__.c deleted file mode 100644 index 41761b6743..0000000000 --- a/ports/stm32f4/common-hal/busio/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No busio module functions. diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c deleted file mode 100644 index be2db4dace..0000000000 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - -#include "stm32f4xx_hal.h" -#include "stm32f4xx_ll_gpio.h" - -void common_hal_digitalio_digitalinout_never_reset( - digitalio_digitalinout_obj_t *self) { - never_reset_pin_number(self->pin->port, self->pin->number); -} - -digitalinout_result_t common_hal_digitalio_digitalinout_construct( - digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { - - claim_pin(pin); - self->pin = pin; - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(self->pin->number); - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); - - return DIGITALINOUT_OK; -} - -bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == NULL; -} - -void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { - if (common_hal_digitalio_digitalinout_deinited(self)) { - return; - } - - reset_pin_number(self->pin->port, self->pin->number); - self->pin = NULL; -} - -void common_hal_digitalio_digitalinout_switch_to_input( - digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(self->pin->number); - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); - - common_hal_digitalio_digitalinout_set_pull(self, pull); -} - -void common_hal_digitalio_digitalinout_switch_to_output( - digitalio_digitalinout_obj_t *self, bool value, - digitalio_drive_mode_t drive_mode) { - - common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); - common_hal_digitalio_digitalinout_set_value(self, value); -} - -digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( - digitalio_digitalinout_obj_t *self) { - - return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) - == LL_GPIO_MODE_INPUT) ? DIRECTION_INPUT : DIRECTION_OUTPUT; -} - -void common_hal_digitalio_digitalinout_set_value( - digitalio_digitalinout_obj_t *self, bool value) { - HAL_GPIO_WritePin(pin_port(self->pin->port), pin_mask(self->pin->number), value); -} - -bool common_hal_digitalio_digitalinout_get_value( - digitalio_digitalinout_obj_t *self) { - return (LL_GPIO_GetPinMode(pin_port(self->pin->port), pin_mask(self->pin->number)) == LL_GPIO_MODE_INPUT) - ? HAL_GPIO_ReadPin(pin_port(self->pin->port), pin_mask(self->pin->number)) - : LL_GPIO_IsOutputPinSet(pin_port(self->pin->port), pin_mask(self->pin->number)); -} - -void common_hal_digitalio_digitalinout_set_drive_mode( - digitalio_digitalinout_obj_t *self, - digitalio_drive_mode_t drive_mode) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(self->pin->number); - GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? - GPIO_MODE_OUTPUT_OD : GPIO_MODE_OUTPUT_PP); - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); -} - -digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( - digitalio_digitalinout_obj_t *self) { - - return LL_GPIO_GetPinOutputType(pin_port(self->pin->port), pin_mask(self->pin->number)) - == LL_GPIO_OUTPUT_OPENDRAIN ? DRIVE_MODE_OPEN_DRAIN : DRIVE_MODE_PUSH_PULL; -} - -void common_hal_digitalio_digitalinout_set_pull( - digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { - - switch (pull) { - case PULL_UP: - LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_UP); - break; - case PULL_DOWN: - LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_DOWN); - break; - case PULL_NONE: - LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number),LL_GPIO_PULL_NO); - break; - default: - break; - } -} - -digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( - digitalio_digitalinout_obj_t *self) { - - - switch (LL_GPIO_GetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number))) { - case LL_GPIO_PULL_UP: - return PULL_UP; - case LL_GPIO_PULL_DOWN: - return PULL_DOWN; - case LL_GPIO_PULL_NO: - return PULL_NONE; - default: - return PULL_NONE; - } -} diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.h b/ports/stm32f4/common-hal/digitalio/DigitalInOut.h deleted file mode 100644 index 76aa2c8556..0000000000 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H - -#include "common-hal/microcontroller/Pin.h" - -typedef struct { - mp_obj_base_t base; - const mcu_pin_obj_t *pin; -} digitalio_digitalinout_obj_t; - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/stm32f4/common-hal/digitalio/__init__.c b/ports/stm32f4/common-hal/digitalio/__init__.c deleted file mode 100644 index 20fad45959..0000000000 --- a/ports/stm32f4/common-hal/digitalio/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No digitalio module functions. diff --git a/ports/stm32f4/common-hal/displayio/ParallelBus.c b/ports/stm32f4/common-hal/displayio/ParallelBus.c deleted file mode 100644 index 1b808ec025..0000000000 --- a/ports/stm32f4/common-hal/displayio/ParallelBus.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "shared-bindings/displayio/ParallelBus.h" - -#include - -#include "common-hal/microcontroller/Pin.h" -#include "py/runtime.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/microcontroller/__init__.h" - -#include "tick.h" - -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, - const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, - const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { - - mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); -} - -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t* self) { - -} - -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - - return false; -} - -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { - -} - -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - -} diff --git a/ports/stm32f4/common-hal/displayio/ParallelBus.h b/ports/stm32f4/common-hal/displayio/ParallelBus.h deleted file mode 100644 index 85d100715e..0000000000 --- a/ports/stm32f4/common-hal/displayio/ParallelBus.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H - -#include "common-hal/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; -} displayio_parallelbus_obj_t; - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.c b/ports/stm32f4/common-hal/microcontroller/Pin.c deleted file mode 100644 index 1d4d45b978..0000000000 --- a/ports/stm32f4/common-hal/microcontroller/Pin.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/rgb_led_status.h" - -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4xx_hal.h" - -#ifdef MICROPY_HW_NEOPIXEL -bool neopixel_in_use; -#endif - -#if MCU_PACKAGE == 144 - #define GPIO_PORT_COUNT 7 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; -#elif MCU_PACKAGE == 100 - #define GPIO_PORT_COUNT 5 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; -#elif MCU_PACKAGE == 64 - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; -#elif MCU_PACKAGE == 48 - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; -#endif - - -STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; -STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; - -void reset_all_pins(void) { - // Reset claimed pins - for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { - claimed_pins[i] = never_reset_pins[i]; - } - for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { - HAL_GPIO_DeInit(ports[i], ~never_reset_pins[i]); - } - - #ifdef MICROPY_HW_NEOPIXEL - neopixel_in_use = false; - #endif -} - -// Mark pin as free and return it to a quiescent state. -void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { - if (pin_port == 0x0F) { - return; - } - // Clear claimed bit & reset - claimed_pins[pin_port] &= ~(1<port && pin_number == MICROPY_HW_NEOPIXEL->number) { - neopixel_in_use = false; - rgb_led_status_init(); - return; - } - #endif -} - -void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { - never_reset_pins[pin_port] |= 1<port, pin->number); -} - -void common_hal_reset_pin(const mcu_pin_obj_t* pin) { - reset_pin_number(pin->port, pin->number); -} - -void claim_pin(const mcu_pin_obj_t* pin) { - // Set bit in claimed_pins bitmask. - claimed_pins[pin->port] |= 1<number; - - #ifdef MICROPY_HW_NEOPIXEL - if (pin == MICROPY_HW_NEOPIXEL) { - neopixel_in_use = true; - } - #endif -} - -bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { - return !(claimed_pins[pin_port] & 1<port, pin->number); -} - -GPIO_TypeDef * pin_port(uint8_t pin_port) { - return ports[pin_port]; -} - -uint16_t pin_mask(uint8_t pin_number) { - return 1< -#include "common-hal/microcontroller/Processor.h" -#include "py/runtime.h" -#include "supervisor/shared/translate.h" - -#include "stm32f4xx_hal.h" - -#define STM32_UUID ((uint32_t *)0x1FFF7A10) - -//Factory calibration locations -#define ADC_CAL_ADDRESS (0x1fff7a2a) -#define ADC_CAL1 ((uint16_t*)(ADC_CAL_ADDRESS + 2)) -#define ADC_CAL2 ((uint16_t*)(ADC_CAL_ADDRESS + 4)) -#define VREFIN_CAL ((uint16_t *)ADC_CAL_ADDRESS) - -// correction factor for reference value -STATIC volatile float adc_refcor = 1.0f; - -STATIC void set_adc_params(ADC_HandleTypeDef *AdcHandle) { - AdcHandle->Instance = ADC1; - AdcHandle->Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; - AdcHandle->Init.Resolution = ADC_RESOLUTION_12B; - AdcHandle->Init.ScanConvMode = DISABLE; - AdcHandle->Init.ContinuousConvMode = DISABLE; - AdcHandle->Init.DiscontinuousConvMode = DISABLE; - AdcHandle->Init.NbrOfDiscConversion = 0; - AdcHandle->Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; - AdcHandle->Init.ExternalTrigConv = ADC_SOFTWARE_START; - AdcHandle->Init.DataAlign = ADC_DATAALIGN_RIGHT; - AdcHandle->Init.NbrOfConversion = 1; - AdcHandle->Init.DMAContinuousRequests = DISABLE; - AdcHandle->Init.EOCSelection = ADC_EOC_SINGLE_CONV; -} - -float common_hal_mcu_processor_get_temperature(void) { - __HAL_RCC_ADC1_CLK_ENABLE(); - - //HAL Implementation - ADC_HandleTypeDef AdcHandle; - ADC_ChannelConfTypeDef sConfig; - set_adc_params(&AdcHandle); - HAL_ADC_Init(&AdcHandle); - - ADC->CCR |= ADC_CCR_TSVREFE; - ADC->CCR &= ~ADC_CCR_VBATE; // If this somehow got turned on, it'll return bad values. - - sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; //either 16 or 18, depending on chip - sConfig.Rank = 1; - sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; // Temp sensor likes 10us minimum - HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); - - HAL_ADC_Start(&AdcHandle); - if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { - mp_raise_RuntimeError(translate("Temperature read timed out")); - } - uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); - HAL_ADC_Stop(&AdcHandle); - - //There's no F4 specific appnote for this but it works the same as the L1 in AN3964 - float core_temp_avg_slope = (*ADC_CAL2 - *ADC_CAL1) / 80.0; - return (((float)value * adc_refcor - *ADC_CAL1) / core_temp_avg_slope) + 30.0f; -} - -float common_hal_mcu_processor_get_voltage(void) { - __HAL_RCC_ADC1_CLK_ENABLE(); - - //HAL Implementation - ADC_HandleTypeDef AdcHandle; - ADC_ChannelConfTypeDef sConfig; - set_adc_params(&AdcHandle); - HAL_ADC_Init(&AdcHandle); - - ADC->CCR |= ADC_CCR_TSVREFE; - - sConfig.Channel = ADC_CHANNEL_VREFINT; - sConfig.Rank = 1; - sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES; - HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); - - HAL_ADC_Start(&AdcHandle); - if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { - mp_raise_RuntimeError(translate("Voltage read timed out")); - } - uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); - HAL_ADC_Stop(&AdcHandle); - - //This value could be used to actively correct ADC values. - adc_refcor = ((float)(*VREFIN_CAL)) / ((float)value); - - return adc_refcor * 3.3f; -} - -uint32_t common_hal_mcu_processor_get_frequency(void) { - return SystemCoreClock; -} - -void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { - for (int i=0; i<3; i++) { - ((uint32_t*) raw_id)[i] = STM32_UUID[i]; - } -} diff --git a/ports/stm32f4/common-hal/microcontroller/Processor.h b/ports/stm32f4/common-hal/microcontroller/Processor.h deleted file mode 100644 index 311333e7de..0000000000 --- a/ports/stm32f4/common-hal/microcontroller/Processor.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Dan Halbert for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H - -#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 12 - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - // Stores no state currently. -} mcu_processor_obj_t; - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c deleted file mode 100644 index 0c680eb055..0000000000 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/mphal.h" -#include "py/obj.h" -#include "py/runtime.h" - -#include "common-hal/microcontroller/Pin.h" -#include "common-hal/microcontroller/Processor.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/microcontroller/Processor.h" - -#include "supervisor/filesystem.h" -#include "supervisor/shared/safe_mode.h" - -#include "stm32f4xx_hal.h" - -//tested divisor value for busy loop in us delay -#define LOOP_TICKS 12 - -STATIC uint32_t get_us(void) { - uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; - uint32_t micros, sys_cycles; - do { - micros = supervisor_ticks_ms32(); - sys_cycles = SysTick->VAL; //counts backwards - } while (micros != supervisor_ticks_ms32()); //try again if ticks_ms rolled over - return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; -} - -void common_hal_mcu_delay_us(uint32_t delay) { - if (__get_PRIMASK() == 0x00000000) { - //by default use ticks_ms - uint32_t start = get_us(); - while (get_us()-start < delay) { - __asm__ __volatile__("nop"); - } - } else { - //when SysTick is disabled, approximate with busy loop - const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; - for (uint32_t count = 0; ++count <= ucount;) { - } - } -} - -volatile uint32_t nesting_count = 0; - -void common_hal_mcu_disable_interrupts(void) { - __disable_irq(); - __DMB(); - nesting_count++; -} - -void common_hal_mcu_enable_interrupts(void) { - if (nesting_count == 0) { - // This is very very bad because it means there was mismatched disable/enables so we - // "HardFault". - asm("bkpt"); - } - nesting_count--; - if (nesting_count > 0) { - return; - } - __DMB(); - __enable_irq(); -} - -void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { - if(runmode == RUNMODE_SAFE_MODE) - safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); -} - -void common_hal_mcu_reset(void) { - filesystem_flush(); //TODO: implement as part of flash improvements - NVIC_SystemReset(); -} - -// The singleton microcontroller.Processor object, bound to microcontroller.cpu -// It currently only has properties, and no state. -const mcu_processor_obj_t common_hal_mcu_processor_obj = { - .base = { - .type = &mcu_processor_type, - }, -}; - -STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, - { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, - { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, - { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, - { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, - { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, - { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, - { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, - { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, - { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, - { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, - { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, - { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, - { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, - { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, - { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, - { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, -#endif -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, - { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, - { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, - { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, - { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, - { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, - { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_PACKAGE == 144 || defined STM32F405xx - { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, - { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, - { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, - { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, - { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, -#endif -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, - { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, - { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, - { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, - { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, - { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, - { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, - { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, - { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, - { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, - { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, - { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, - { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, -#endif -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, - { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, - { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, - { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, - { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, - { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, -#endif -}; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm32f4/common-hal/neopixel_write/__init__.c b/ports/stm32f4/common-hal/neopixel_write/__init__.c deleted file mode 100644 index 6740a0d348..0000000000 --- a/ports/stm32f4/common-hal/neopixel_write/__init__.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/mphal.h" -#include "shared-bindings/neopixel_write/__init__.h" - -#include "tick.h" -#include "py/mperrno.h" -#include "py/runtime.h" -#include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" -#include "stm32f4xx_ll_gpio.h" - -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; - -//sysclock divisors -#define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field -#define MAGIC_800_T0H 2800000 // ~0.36 us -> 0.44 field -#define MAGIC_800_T1H 1350000 // ~0.74 us -> 0.84 field - -#pragma GCC push_options -#pragma GCC optimize ("Os") - -void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, - uint32_t numBytes) { - uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; - uint32_t start = 0; - uint32_t cyc = 0; - - //assumes 800_000Hz frequency - //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us - //TODO: try to get dynamic weighting working again - uint32_t sys_freq = HAL_RCC_GetSysClockFreq(); - uint32_t interval = sys_freq/MAGIC_800_INT; - uint32_t t0 = (sys_freq/MAGIC_800_T0H); - uint32_t t1 = (sys_freq/MAGIC_800_T1H); - - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); - - GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); - uint32_t p_mask = pin_mask(digitalinout->pin->number); - - __disable_irq(); - // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL - CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; - DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; - DWT->CYCCNT = 0; - - for(;;) { - cyc = (pix & mask) ? t1 : t0; - start = DWT->CYCCNT; - LL_GPIO_SetOutputPin(p_port, p_mask); - while((DWT->CYCCNT - start) < cyc); - LL_GPIO_ResetOutputPin(p_port, p_mask); - while((DWT->CYCCNT - start) < interval); - if(!(mask >>= 1)) { - if(p >= end) break; - pix = *p++; - mask = 0x80; - } - } - - // Enable interrupts again - __enable_irq(); - - // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } -} - -#pragma GCC pop_options \ No newline at end of file diff --git a/ports/stm32f4/common-hal/os/__init__.c b/ports/stm32f4/common-hal/os/__init__.c deleted file mode 100644 index 0b3153286a..0000000000 --- a/ports/stm32f4/common-hal/os/__init__.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "genhdr/mpversion.h" -#include "py/mpconfig.h" -#include "py/objstr.h" -#include "py/objtuple.h" - -#include "py/mperrno.h" -#include "py/runtime.h" -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" - -STATIC const qstr os_uname_info_fields[] = { - MP_QSTR_sysname, MP_QSTR_nodename, - MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine -}; -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "stm32f4"); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "stm32f4"); - -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); - -STATIC MP_DEFINE_ATTRTUPLE( - os_uname_info_obj, - os_uname_info_fields, - 5, - (mp_obj_t)&os_uname_info_sysname_obj, - (mp_obj_t)&os_uname_info_nodename_obj, - (mp_obj_t)&os_uname_info_release_obj, - (mp_obj_t)&os_uname_info_version_obj, - (mp_obj_t)&os_uname_info_machine_obj -); - -mp_obj_t common_hal_os_uname(void) { - return (mp_obj_t)&os_uname_info_obj; -} - -#define RNG_TIMEOUT 5 - -bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { - #if (HAS_TRNG) - //init the RNG - __HAL_RCC_RNG_CLK_ENABLE(); - RNG_HandleTypeDef handle; - handle.Instance = RNG; - 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 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) { - mp_raise_ValueError(translate("Random number generation error")); - } - *buffer = (uint8_t)temp; - } - - //shut down the peripheral - if (HAL_RNG_DeInit(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG DeInit Error")); - __HAL_RCC_RNG_CLK_DISABLE(); - - return true; - #else - return false; - #endif -} \ No newline at end of file diff --git a/ports/stm32f4/common-hal/pulseio/PWMOut.c b/ports/stm32f4/common-hal/pulseio/PWMOut.c deleted file mode 100644 index d62ee2a380..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PWMOut.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * Uses code from Micropython, Copyright (c) 2013-2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "py/runtime.h" -#include "common-hal/pulseio/PWMOut.h" -#include "shared-bindings/pulseio/PWMOut.h" -#include "supervisor/shared/translate.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "stm32f4xx_hal.h" -#include "common-hal/microcontroller/Pin.h" - -#define ALL_CLOCKS 0xFFFF - -STATIC uint8_t reserved_tim[TIM_BANK_ARRAY_LEN]; -STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN]; -STATIC bool never_reset_tim[TIM_BANK_ARRAY_LEN]; - -STATIC void tim_clock_enable(uint16_t mask); -STATIC void tim_clock_disable(uint16_t mask); - -// Get the frequency (in Hz) of the source clock for the given timer. -// On STM32F405/407/415/417 there are 2 cases for how the clock freq is set. -// If the APB prescaler is 1, then the timer clock is equal to its respective -// APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its -// respective APB clock. See DM00031020 Rev 4, page 115. -STATIC uint32_t timer_get_source_freq(uint32_t tim_id) { - uint32_t source, clk_div; - if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) { - // TIM{1,8,9,10,11} are on APB2 - source = HAL_RCC_GetPCLK2Freq(); - clk_div = RCC->CFGR & RCC_CFGR_PPRE2; - } else { - // TIM{2,3,4,5,6,7,12,13,14} are on APB1 - source = HAL_RCC_GetPCLK1Freq(); - clk_div = RCC->CFGR & RCC_CFGR_PPRE1; - } - if (clk_div != 0) { - // APB prescaler for this timer is > 1 - source *= 2; - } - return source; -} - -STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) { - //duty cycle is duty/0xFFFF fraction x (number of pulses per period) - return (duty*period) / ((1 << 16) - 1); -} - -STATIC void timer_get_optimal_divisors(uint32_t*period, uint32_t*prescaler, - uint32_t frequency, uint32_t source_freq) { - //Find the largest possible period supported by this frequency - for (int i = 0; i < (1 << 16); i++) { - *period = source_freq / (i * frequency); - if (*period < (1 << 16) && *period >= 2) { - *prescaler = i; - break; - } - } - if (*prescaler == 0) { - mp_raise_ValueError(translate("Invalid frequency supplied")); - } -} - -void pwmout_reset(void) { - uint16_t never_reset_mask = 0x00; - for (int i = 0; i < TIM_BANK_ARRAY_LEN; i++) { - if (!never_reset_tim[i]) { - reserved_tim[i] = 0x00; - tim_frequencies[i] = 0x00; - } else { - never_reset_mask |= 1 << i; - } - } - tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); -} - -pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, - const mcu_pin_obj_t* pin, - uint16_t duty, - uint32_t frequency, - bool variable_frequency) { - TIM_TypeDef * TIMx; - uint8_t tim_num = MP_ARRAY_SIZE(mcu_tim_pin_list); - bool tim_chan_taken = false; - bool tim_taken_f_mismatch = false; - bool var_freq_mismatch = false; - bool first_time_setup = true; - - for (uint i = 0; i < tim_num; i++) { - const mcu_tim_pin_obj_t * l_tim = &mcu_tim_pin_list[i]; - uint8_t l_tim_index = l_tim->tim_index - 1; - uint8_t l_tim_channel = l_tim->channel_index - 1; - - //if pin is same - if (l_tim->pin == pin) { - //check if the timer has a channel active - if (reserved_tim[l_tim_index] != 0) { - //is it the same channel? (or all channels reserved by a var-freq) - if (reserved_tim[l_tim_index] & 1 << (l_tim_channel)) { - tim_chan_taken = true; - continue; //keep looking, might be another viable option - } - //If the frequencies are the same it's ok - if (tim_frequencies[l_tim_index] != frequency) { - tim_taken_f_mismatch = true; - continue; //keep looking - } - //you can't put a variable frequency on a partially reserved timer - if (variable_frequency) { - var_freq_mismatch = true; - continue; //keep looking - } - first_time_setup = false; //skip setting up the timer - } - //No problems taken, so set it up - self->tim = l_tim; - break; - } - } - - //handle valid/invalid timer instance - if (self->tim != NULL) { - //create instance - TIMx = mcu_tim_banks[self->tim->tim_index - 1]; - //reserve timer/channel - if (variable_frequency) { - reserved_tim[self->tim->tim_index - 1] = 0x0F; - } else { - reserved_tim[self->tim->tim_index - 1] |= 1 << (self->tim->channel_index - 1); - } - tim_frequencies[self->tim->tim_index - 1] = frequency; - } else { //no match found - if (tim_chan_taken) { - mp_raise_ValueError(translate("No more timers available on this pin.")); - } else if (tim_taken_f_mismatch) { - mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); - } else if (var_freq_mismatch) { - mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use")); - } else { - mp_raise_ValueError(translate("Invalid pins for PWMOut")); - } - } - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(pin->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStruct.Alternate = self->tim->altfn_index; - HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); - - tim_clock_enable(1 << (self->tim->tim_index - 1)); - - //translate channel into handle value - self->channel = 4 * (self->tim->channel_index - 1); - - uint32_t prescaler = 0; //prescaler is 15 bit - uint32_t period = 0; //period is 16 bit - timer_get_optimal_divisors(&period, &prescaler, frequency, - timer_get_source_freq(self->tim->tim_index)); - - //Timer init - self->handle.Instance = TIMx; - self->handle.Init.Period = period - 1; - self->handle.Init.Prescaler = prescaler - 1; - self->handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - self->handle.Init.CounterMode = TIM_COUNTERMODE_UP; - self->handle.Init.RepetitionCounter = 0; - - //only run init if this is the first instance of this timer - if (first_time_setup) { - if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("Could not initialize timer")); - } - } - - //Channel/PWM init - self->chan_handle.OCMode = TIM_OCMODE_PWM1; - self->chan_handle.Pulse = timer_get_internal_duty(duty, period); - self->chan_handle.OCPolarity = TIM_OCPOLARITY_HIGH; - self->chan_handle.OCFastMode = TIM_OCFAST_DISABLE; - if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not initialize channel")); - } - if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not start PWM")); - } - - self->variable_frequency = variable_frequency; - self->frequency = frequency; - self->duty_cycle = duty; - self->period = period; - - return PWMOUT_OK; -} - -void common_hal_pulseio_pwmout_never_reset(pulseio_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; - never_reset_pin_number(self->tim->pin->port, self->tim->pin->number); - break; - } - } -} - -void common_hal_pulseio_pwmout_reset_ok(pulseio_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; - break; - } - } -} - -bool common_hal_pulseio_pwmout_deinited(pulseio_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)) { - return; - } - //var freq shuts down entire timer, others just their channel - if (self->variable_frequency) { - reserved_tim[self->tim->tim_index - 1] = 0x00; - } else { - reserved_tim[self->tim->tim_index - 1] &= ~(1 << self->tim->channel_index); - 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; - tim_clock_disable(1 << (self->tim->tim_index - 1)); - } -} - -void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_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) { - return self->duty_cycle; -} - -void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) { - //don't halt setup for the same frequency - if (frequency == self->frequency) { - return; - } - - uint32_t prescaler = 0; - uint32_t period = 0; - timer_get_optimal_divisors(&period, &prescaler, frequency, - timer_get_source_freq(self->tim->tim_index)); - - //shut down - HAL_TIM_PWM_Stop(&self->handle, self->channel); - - //Only change altered values - self->handle.Init.Period = period - 1; - self->handle.Init.Prescaler = prescaler - 1; - - //restart everything, adjusting for new speed - if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init timer")); - } - - self->chan_handle.Pulse = timer_get_internal_duty(self->duty_cycle, period); - - if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init channel")); - } - if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not restart PWM")); - } - - tim_frequencies[self->tim->tim_index - 1] = frequency; - self->frequency = frequency; - self->period = period; -} - -uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) { - return self->frequency; -} - -bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) { - return self->variable_frequency; -} - -STATIC void tim_clock_enable(uint16_t mask) { - #ifdef TIM1 - if (mask & (1 << 0)) { - __HAL_RCC_TIM1_CLK_ENABLE(); - } - #endif - #ifdef TIM2 - if (mask & (1 << 1)) { - __HAL_RCC_TIM2_CLK_ENABLE(); - } - #endif - #ifdef TIM3 - if (mask & (1 << 2)) { - __HAL_RCC_TIM3_CLK_ENABLE(); - } - #endif - #ifdef TIM4 - if (mask & (1 << 3)) { - __HAL_RCC_TIM4_CLK_ENABLE(); - } - #endif - #ifdef TIM5 - if (mask & (1 << 4)) { - __HAL_RCC_TIM5_CLK_ENABLE(); - } - #endif - //6 and 7 are reserved ADC timers - #ifdef TIM8 - if (mask & (1 << 7)) { - __HAL_RCC_TIM8_CLK_ENABLE(); - } - #endif - #ifdef TIM9 - if (mask & (1 << 8)) { - __HAL_RCC_TIM9_CLK_ENABLE(); - } - #endif - #ifdef TIM10 - if (mask & (1 << 9)) { - __HAL_RCC_TIM10_CLK_ENABLE(); - } - #endif - #ifdef TIM11 - if (mask & (1 << 10)) { - __HAL_RCC_TIM11_CLK_ENABLE(); - } - #endif - #ifdef TIM12 - if (mask & (1 << 11)) { - __HAL_RCC_TIM12_CLK_ENABLE(); - } - #endif - #ifdef TIM13 - if (mask & (1 << 12)) { - __HAL_RCC_TIM13_CLK_ENABLE(); - } - #endif - #ifdef TIM14 - if (mask & (1 << 13)) { - __HAL_RCC_TIM14_CLK_ENABLE(); - } - #endif -} - -STATIC void tim_clock_disable(uint16_t mask) { - #ifdef TIM1 - if (mask & (1 << 0)) { - __HAL_RCC_TIM1_CLK_DISABLE(); - } - #endif - #ifdef TIM2 - if (mask & (1 << 1)) { - __HAL_RCC_TIM2_CLK_DISABLE(); - } - #endif - #ifdef TIM3 - if (mask & (1 << 2)) { - __HAL_RCC_TIM3_CLK_DISABLE(); - } - #endif - #ifdef TIM4 - if (mask & (1 << 3)) { - __HAL_RCC_TIM4_CLK_DISABLE(); - } - #endif - #ifdef TIM5 - if (mask & (1 << 4)) { - __HAL_RCC_TIM5_CLK_DISABLE(); - } - #endif - //6 and 7 are reserved ADC timers - #ifdef TIM8 - if (mask & (1 << 7)) { - __HAL_RCC_TIM8_CLK_DISABLE(); - } - #endif - #ifdef TIM9 - if (mask & (1 << 8)) { - __HAL_RCC_TIM9_CLK_DISABLE(); - } - #endif - #ifdef TIM10 - if (mask & (1 << 9)) { - __HAL_RCC_TIM10_CLK_DISABLE(); - } - #endif - #ifdef TIM11 - if (mask & (1 << 10)) { - __HAL_RCC_TIM11_CLK_DISABLE(); - } - #endif - #ifdef TIM12 - if (mask & (1 << 11)) { - __HAL_RCC_TIM12_CLK_DISABLE(); - } - #endif - #ifdef TIM13 - if (mask & (1 << 12)) { - __HAL_RCC_TIM13_CLK_DISABLE(); - } - #endif - #ifdef TIM14 - if (mask & (1 << 13)) { - __HAL_RCC_TIM14_CLK_DISABLE(); - } - #endif -} diff --git a/ports/stm32f4/common-hal/pulseio/PWMOut.h b/ports/stm32f4/common-hal/pulseio/PWMOut.h deleted file mode 100644 index 59fc04e5ff..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PWMOut.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H - -#include "common-hal/microcontroller/Pin.h" - -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - TIM_HandleTypeDef handle; - TIM_OC_InitTypeDef chan_handle; - const mcu_tim_pin_obj_t *tim; - uint8_t channel: 7; - bool variable_frequency: 1; - uint16_t duty_cycle; - uint32_t frequency; - uint32_t period; -} pulseio_pwmout_obj_t; - -void pwmout_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.c b/ports/stm32f4/common-hal/pulseio/PulseIn.c deleted file mode 100644 index 068936bdd0..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "common-hal/pulseio/PulseIn.h" -#include -#include -#include "py/mpconfig.h" -#include "py/gc.h" -#include "py/runtime.h" -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/pulseio/PulseIn.h" -#include "tick.h" - -void pulsein_reset(void) { -} - -void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, - uint16_t maxlen, bool idle_state) { - mp_raise_NotImplementedError(translate("PulseIn not yet supported")); -} - -bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) { - return true; -} - -void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { -} - -void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { -} - -void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) { -} - -void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) { -} - -uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) { - return 0; -} - -uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) { - return 0; -} - -uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) { - return 0; -} - -bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) { - return 0; -} - -uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) { - return 0; -} diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.h b/ports/stm32f4/common-hal/pulseio/PulseIn.h deleted file mode 100644 index 2538b07ab5..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H - -#include "common-hal/microcontroller/Pin.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - - uint8_t pin; - bool idle_state; - bool paused; - volatile bool first_edge; - - uint16_t* buffer; - uint16_t maxlen; - - volatile uint16_t start; - volatile uint16_t len; - volatile uint16_t last_us; - volatile uint64_t last_ms; -} pulseio_pulsein_obj_t; - -void pulsein_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/stm32f4/common-hal/pulseio/PulseOut.c b/ports/stm32f4/common-hal/pulseio/PulseOut.c deleted file mode 100644 index d82525ea16..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PulseOut.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "common-hal/pulseio/PulseOut.h" - -#include - -#include "py/mpconfig.h" -#include "py/gc.h" -#include "py/runtime.h" -#include "shared-bindings/pulseio/PulseOut.h" -#include "shared-bindings/pulseio/PWMOut.h" -#include "supervisor/shared/translate.h" - -#include "stm32f4xx_hal.h" -#include "common-hal/microcontroller/Pin.h" -#include "tick.h" - -// A single timer is shared amongst all PulseOut objects under the assumption that -// the code is single threaded. -STATIC uint8_t refcount = 0; - -STATIC uint16_t *pulse_array = NULL; -STATIC volatile uint16_t pulse_array_index = 0; -STATIC uint16_t pulse_array_length; - -//Timer is shared, must be accessible by interrupt -STATIC TIM_HandleTypeDef t7_handle; -pulseio_pulseout_obj_t *curr_pulseout = NULL; - -STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { - // Turn on PWM - HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel); -} - -STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { - // Turn off PWM - HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); - // Make sure pin is low. - HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), - pin_mask(pulseout->pwmout->tim->pin->number), 0); -} - -STATIC void start_timer(void) { - // Set the new period - t7_handle.Init.Period = pulse_array[pulse_array_index] - 1; - HAL_TIM_Base_Init(&t7_handle); - - // TIM7 has limited HAL support, set registers manually - t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt - t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer - t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts - __HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE); - -} - -STATIC void pulseout_event_handler(void) { - if (curr_pulseout->pwmout == NULL) { - return; //invalid interrupt - } - - HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1); - HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0); - - pulse_array_index++; - - // No more pulses. Turn off output and don't restart. - if (pulse_array_index >= pulse_array_length) { - turn_off(curr_pulseout); - return; - } - - // Alternate on and off, starting with on. - if (pulse_array_index % 2 == 0) { - turn_on(curr_pulseout); - } else { - turn_off(curr_pulseout); - } - - // Count up to the next given value. - start_timer(); -} - -void pulseout_reset() { - #if HAS_BASIC_TIM - __HAL_RCC_TIM7_CLK_DISABLE(); - refcount = 0; - #endif -} - -void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { -#if !(HAS_BASIC_TIM) - mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); -#else - // Add to active PulseOuts - refcount++; - - // Calculate a 1 ms period - uint32_t source, clk_div; - source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1 - clk_div = RCC->CFGR & RCC_CFGR_PPRE1; - // APB quirk, see See DM00031020 Rev 4, page 115. - if (clk_div != 0) { - // APB prescaler for this timer is > 1 - source *= 2; - } - - uint32_t prescaler = source/1000000; //1us intervals - - __HAL_RCC_TIM7_CLK_ENABLE(); - HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0); - HAL_NVIC_EnableIRQ(TIM7_IRQn); - - // Timers 6 and 7 have no pins, so using them doesn't affect PWM availability - t7_handle.Instance = TIM7; - t7_handle.Init.Period = 100; //immediately replaced. - t7_handle.Init.Prescaler = prescaler - 1; - t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP; - t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - - HAL_TIM_Base_Init(&t7_handle); - t7_handle.Instance->SR = 0; - - // The HAL can't work with const, recast required. - self->pwmout = (pulseio_pwmout_obj_t*)carrier; - - turn_off(self); -#endif -} - -bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) { - return self->pwmout == NULL; -} - -void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) { - if (common_hal_pulseio_pulseout_deinited(self)) { - return; - } - turn_on(self); - self->pwmout = NULL; - - refcount--; - if (refcount == 0) { - #if HAS_BASIC_TIM - __HAL_RCC_TIM7_CLK_DISABLE(); - #endif - } -} - -void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) { - pulse_array = pulses; - pulse_array_index = 0; - pulse_array_length = length; - curr_pulseout = self; - - turn_on(self); - - // Count up to the next given value. - start_timer(); - - // Use when debugging, or issues are irrecoverable - // uint32_t starttime = supervisor_ticks_ms64(); - // uint32_t timeout = 10000; - while(pulse_array_index < length) { - // Do other things while we wait. The interrupts will handle sending the - // signal. - RUN_BACKGROUND_TASKS; - - // Use when debugging, or issues are irrecoverable - // if ((supervisor_ticks_ms64() - starttime ) > timeout ) { - // mp_raise_RuntimeError(translate("Error: Send Timeout")); - // } - } - //turn off timer counter. - t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; -} - -void TIM7_IRQHandler(void) -{ - // Detect TIM Update event - if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET) - { - if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET) - { - __HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE); - pulseout_event_handler(); - } - } -} diff --git a/ports/stm32f4/common-hal/pulseio/PulseOut.h b/ports/stm32f4/common-hal/pulseio/PulseOut.h deleted file mode 100644 index aa97396d00..0000000000 --- a/ports/stm32f4/common-hal/pulseio/PulseOut.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H - -#include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PWMOut.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - pulseio_pwmout_obj_t *pwmout; -} pulseio_pulseout_obj_t; - -void pulseout_reset(void); - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/stm32f4/common-hal/pulseio/__init__.c b/ports/stm32f4/common-hal/pulseio/__init__.c deleted file mode 100644 index 2bee925bc7..0000000000 --- a/ports/stm32f4/common-hal/pulseio/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No pulseio module functions. diff --git a/ports/stm32f4/common-hal/supervisor/Runtime.c b/ports/stm32f4/common-hal/supervisor/Runtime.c deleted file mode 100755 index feab6987d8..0000000000 --- a/ports/stm32f4/common-hal/supervisor/Runtime.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Michael Schroeder - * - * 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 -#include "shared-bindings/supervisor/Runtime.h" -#include "supervisor/serial.h" - -bool common_hal_get_serial_connected(void) { - return (bool) serial_connected(); -} - -bool common_hal_get_serial_bytes_available(void) { - return (bool) serial_bytes_available(); -} - diff --git a/ports/stm32f4/common-hal/supervisor/Runtime.h b/ports/stm32f4/common-hal/supervisor/Runtime.h deleted file mode 100755 index 9a798e0567..0000000000 --- a/ports/stm32f4/common-hal/supervisor/Runtime.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Michael Schroeder - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - // Stores no state currently. -} super_runtime_obj_t; - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/stm32f4/common-hal/supervisor/__init__.c b/ports/stm32f4/common-hal/supervisor/__init__.c deleted file mode 100755 index ac88556b45..0000000000 --- a/ports/stm32f4/common-hal/supervisor/__init__.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Michael Schroeder - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#include "py/obj.h" - -#include "shared-bindings/supervisor/__init__.h" -#include "shared-bindings/supervisor/Runtime.h" - - -// The singleton supervisor.Runtime object, bound to supervisor.runtime -// It currently only has properties, and no state. -const super_runtime_obj_t common_hal_supervisor_runtime_obj = { - .base = { - .type = &supervisor_runtime_type, - }, -}; \ No newline at end of file diff --git a/ports/stm32f4/common-hal/time/__init__.c b/ports/stm32f4/common-hal/time/__init__.c deleted file mode 100644 index c85077868a..0000000000 --- a/ports/stm32f4/common-hal/time/__init__.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 "py/mphal.h" - -#include "tick.h" - -uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} - -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} diff --git a/ports/stm32f4/fatfs_port.c b/ports/stm32f4/fatfs_port.c deleted file mode 100644 index 13ac21fb1b..0000000000 --- a/ports/stm32f4/fatfs_port.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" - -DWORD get_fattime(void) { - // TODO: Implement this function. For now, fake it. - return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); -} diff --git a/ports/stm32f4/mpconfigport.h b/ports/stm32f4/mpconfigport.h deleted file mode 100644 index 283984ea90..0000000000 --- a/ports/stm32f4/mpconfigport.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 Glenn Ruben Bakke - * Copyright (c) 2019 Dan Halbert for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef STM32F4_MPCONFIGPORT_H__ -#define STM32F4_MPCONFIGPORT_H__ - -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) -#define MICROPY_PY_FUNCTION_ATTRS (1) -#define MICROPY_PY_IO (1) -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) -#define MICROPY_PY_UJSON (1) - -// 24kiB stack -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 - -#include "py/circuitpy_mpconfig.h" - -//Board flags: -#ifndef BOARD_OVERWRITE_SWD -#define BOARD_OVERWRITE_SWD (0) -#endif -#ifndef BOARD_VTOR_DEFER -#define BOARD_VTOR_DEFER (0) -#endif -#ifndef BOARD_NO_VBUS_SENSE -#define BOARD_NO_VBUS_SENSE (0) -#endif - -#define MAX_UART 10 //how many UART are implemented - -#define MICROPY_PORT_ROOT_POINTERS \ - void *cpy_uart_obj_all[MAX_UART]; \ - CIRCUITPY_COMMON_ROOT_POINTERS - -#endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/stm32f4/mpconfigport.mk b/ports/stm32f4/mpconfigport.mk deleted file mode 100644 index 493f32c636..0000000000 --- a/ports/stm32f4/mpconfigport.mk +++ /dev/null @@ -1,77 +0,0 @@ -# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk -# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. -# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. -MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz - -# Internal math library is substantially smaller than toolchain one -INTERNAL_LIBM = 1 - -# Chip supplied serial number, in bytes -USB_SERIAL_NUMBER_LENGTH = 24 - -# Longints can be implemented as mpz, as longlong, or not -LONGINT_IMPL = MPZ - -#Reduced feature set for early port -CIRCUITPY_MINIMAL_BUILD = 1 - -# The ifndef's allow overriding in mpconfigboard.mk. - -ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = 1 -endif - -ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = 1 -endif - -ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = 1 -endif - -ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = 1 -endif - -ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = 1 -endif - -ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = 1 -endif - -ifndef CIRCUITPY_OS -CIRCUITPY_OS = 1 -endif - -ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = 1 -endif - -ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = 1 -endif - -ifndef CRICUITPY_USB_HID -CIRCUITPY_USB_HID = 1 -endif - -ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = 1 -endif - -ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = 1 -endif - -ifndef CIRCUITPY_DISPLAYIO -CIRCUITPY_DISPLAYIO = 1 -endif - -CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 - -MICROPY_PY_ULAB = 1 - -#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) -#endif diff --git a/ports/stm32f4/mphalport.c b/ports/stm32f4/mphalport.c deleted file mode 100644 index a3cf501c04..0000000000 --- a/ports/stm32f4/mphalport.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 Glenn Ruben Bakke - * Copyright (c) 2018 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "py/mphal.h" -#include "py/mpstate.h" -#include "py/gc.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/tick.h" -#include "stm32f4xx_hal.h" - -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - -void mp_hal_delay_us(mp_uint_t delay) { - common_hal_mcu_delay_us(delay); -} - -void mp_hal_disable_all_interrupts(void) { - common_hal_mcu_disable_interrupts(); -} - -void mp_hal_enable_all_interrupts(void) { - common_hal_mcu_enable_interrupts(); -} diff --git a/ports/stm32f4/mphalport.h b/ports/stm32f4/mphalport.h deleted file mode 100644 index b392cb0f84..0000000000 --- a/ports/stm32f4/mphalport.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 Glenn Ruben Bakke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_MPHALPORT_H -#define MICROPY_INCLUDED_STM32F4_MPHALPORT_H - -#include "py/obj.h" - -#include "lib/oofatfs/ff.h" - -#include "supervisor/shared/tick.h" - -// Global millisecond tick count (driven by SysTick interrupt). -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; - -int receive_usb(void); - -void mp_hal_set_interrupt_char(int c); - -void mp_hal_disable_all_interrupts(void); -void mp_hal_enable_all_interrupts(void); - -#endif // MICROPY_INCLUDED_STM32F4_MPHALPORT_H diff --git a/ports/stm32f4/peripherals/stm32f4/clocks.h b/ports/stm32f4/peripherals/stm32f4/clocks.h deleted file mode 100644 index c7ba846622..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/clocks.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -void stm32f4_peripherals_clocks_init(void); diff --git a/ports/stm32f4/peripherals/stm32f4/gpio.h b/ports/stm32f4/peripherals/stm32f4/gpio.h deleted file mode 100644 index 34f89e7921..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/gpio.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -void stm32f4_peripherals_gpio_init(void); -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state); diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h deleted file mode 100644 index d311afe4a1..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ -#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ - -#include -#include - -#include "stm32f4xx_hal.h" -#include "stm32f4/pins.h" - -// I2C -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) - uint8_t altfn_index:4; //Index of the altfn for this pin (0 to 15) - const mcu_pin_obj_t * pin; -} mcu_i2c_sda_obj_t; - -typedef struct { - uint8_t i2c_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_i2c_scl_obj_t; - - -#define I2C_SDA(index, alt, sda_pin) \ -{ \ - .i2c_index = index, \ - .altfn_index = alt, \ - .pin = sda_pin, \ -} - -#define I2C_SCL(index, alt, scl_pin) \ -{ \ - .i2c_index = index, \ - .altfn_index = alt, \ - .pin = scl_pin, \ -} - -// SPI -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t spi_index:4; //Up to 6 SPI units - uint8_t altfn_index:4; //Up to 15 alt channels - const mcu_pin_obj_t * pin; -} mcu_spi_sck_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_mosi_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_miso_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_nss_obj_t; - -#define SPI(index, alt, spi_pin) \ -{ \ - .spi_index = index, \ - .altfn_index = alt, \ - .pin = spi_pin, \ -} - -// UART -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_uart_tx_obj_t; - -typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_uart_rx_obj_t; - -#define UART(index, alt, uart_pin) \ -{ \ - .uart_index = index, \ - .altfn_index = alt, \ - .pin = uart_pin, \ -} - -//Timers -typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; - uint8_t channel_index:4; - const mcu_pin_obj_t * pin; -} mcu_tim_pin_obj_t; - -#define TIM(index, alt, channel, tim_pin) \ -{ \ - .tim_index = index, \ - .altfn_index = alt, \ - .channel_index = channel, \ - .pin = tim_pin, \ -} - -//Access Lines - -#ifdef STM32F401xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#define HAS_BASIC_TIM 0 -#include "stm32f401xe/periph.h" -#endif - -#ifdef STM32F411xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#define HAS_BASIC_TIM 0 -#include "stm32f411xe/periph.h" -#endif - -#ifdef STM32F412Zx -#define HAS_DAC 0 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f412zx/periph.h" -#endif - -//Foundation Lines - -#ifdef STM32F405xx -#define HAS_DAC 1 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f405xx/periph.h" -#endif - -#ifdef STM32F407xx -#define HAS_DAC 1 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f407xx/periph.h" -#endif - -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm32f4/peripherals/stm32f4/pins.h b/ports/stm32f4/peripherals/stm32f4/pins.h deleted file mode 100644 index 44ef4c1baf..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/pins.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Dan Halbert for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure -// that all necessary includes are already included. - -#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ -#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ - -#include -#include - -#include "stm32f4xx_hal.h" - -typedef struct { - mp_obj_base_t base; - uint8_t port:4; - uint8_t number:4; - uint8_t adc_unit:3; - uint8_t adc_channel:5; -} mcu_pin_obj_t; - -//Standard stm32 adc unit combinations -#define ADC_1 1 -#define ADC_12 3 -#define ADC_123 7 -#define ADC_3 4 - -//STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, -//but all 3 ADCs will share the same input number per pin. -//F4 family has 3 ADC max, 24 channels max. -#define ADC_INPUT(mask, number) \ - .adc_unit = mask, \ - .adc_channel = number, - -#define NO_ADC \ - .adc_unit = 0x00, \ - .adc_channel = 0x1f - -extern const mp_obj_type_t mcu_pin_type; - -// STM32 can have up to 9 ports, each restricted to 16 pins -// We split the pin/port evenly, in contrast to nrf. -#define PIN(p_port, p_number, p_adc) \ -{ \ - { &mcu_pin_type }, \ - .port = p_port, \ - .number = p_number, \ - p_adc \ -} - -// Use illegal pin value to mark unassigned pins. -#define NO_PIN 0xff - -// Choose based on chip -#ifdef STM32F401xE -#include "stm32f401xe/pins.h" -#endif -#ifdef STM32F411xE -#include "stm32f411xe/pins.h" -#endif -#ifdef STM32F412Zx -#include "stm32f412zx/pins.h" -#endif -#ifdef STM32F405xx -#include "stm32f405xx/pins.h" -#endif -#ifdef STM32F407xx -#include "stm32f407xx/pins.h" -#endif - -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c deleted file mode 100644 index 53810af263..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c deleted file mode 100644 index 7bd6196627..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK -} - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c deleted file mode 100644 index b120841860..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c +++ /dev/null @@ -1,173 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, - TIM11, NULL, NULL, NULL}; - -//#define TIM(index, alt, channel, tim_pin) -const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h deleted file mode 100644 index 6085f1ff2b..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[4]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c deleted file mode 100644 index 7e88c3dcba..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c +++ /dev/null @@ -1,123 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h deleted file mode 100644 index 09bc8f13e3..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H - -//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only -//pg 38 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -//pg 39 -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -//pg 40 -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -//pg 41 -extern const mcu_pin_obj_t pin_PC04; -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -extern const mcu_pin_obj_t pin_PE15; -//pg 42 -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 43 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -//pg 44 -extern const mcu_pin_obj_t pin_PA10; -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -extern const mcu_pin_obj_t pin_PC12; -//pg 45 -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -//pg 46 -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c deleted file mode 100644 index 2afca64e83..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. - - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c deleted file mode 100644 index d1eaa90d1b..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK - // never_reset_pin_number(0,15); //PA15 JTDI - // never_reset_pin_number(1,3); //PB3 JTDO - // never_reset_pin_number(1,4); //PB4 JTRST - - // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO - // never_reset_pin_number(5,1); //PH1 JTRST -} - -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c deleted file mode 100644 index bc03f7c7be..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c +++ /dev/null @@ -1,194 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), - I2C_SDA(3, 4, &pin_PC09), -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { - UART(4, 8, &pin_PA00), - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(4, 8, &pin_PC10), - UART(5, 8, &pin_PC12), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(4, 8, &pin_PA01), - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(4, 8, &pin_PC11), - UART(5, 8, &pin_PD02), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, - TIM11, TIM12, TIM13, TIM14}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(13,9,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(14,9,1,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(2,1,4,&pin_PB11), - TIM(12,9,1,&pin_PB14), - TIM(12,9,2,&pin_PB15), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(8,3,1,&pin_PC06), - TIM(8,3,2,&pin_PC07), - TIM(8,3,3,&pin_PC08), - TIM(8,3,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), - TIM(10,3,1,&pin_PF06), - TIM(11,3,1,&pin_PF07), - TIM(13,9,1,&pin_PF08), - TIM(14,9,1,&pin_PF09), - // TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded - // TIM(12,9,2,&pin_PH09), - // TIM(5,2,1,&pin_PH10), - // TIM(5,2,2,&pin_PH11), - // TIM(5,2,3,&pin_PH12), - // TIM(5,2,4,&pin_PI00), - // TIM(8,3,4,&pin_PI02), - // TIM(8,3,1,&pin_PI05), - // TIM(8,3,2,&pin_PI06), - // TIM(8,3,3,&pin_PI07), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h deleted file mode 100644 index e87e798574..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[3]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.c deleted file mode 100644 index 86445fe140..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.c +++ /dev/null @@ -1,161 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_123,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 - -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.h deleted file mode 100644 index 180f5c316f..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/pins.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H - -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only -//pg 50 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -//pg 51 -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only -//pg 52 -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -//pg 53 -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -extern const mcu_pin_obj_t pin_PC04; -//pg 54 -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only -//pg 55 -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -//pg 56 -extern const mcu_pin_obj_t pin_PE15; -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB11; // 144 only -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -//pg 57 -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 58 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PG02; // 144 only -extern const mcu_pin_obj_t pin_PG03; // 144 only -extern const mcu_pin_obj_t pin_PG04; // 144 only -extern const mcu_pin_obj_t pin_PG05; // 144 only -extern const mcu_pin_obj_t pin_PG06; // 144 only -extern const mcu_pin_obj_t pin_PG07; // 144 only -extern const mcu_pin_obj_t pin_PG08; // 144 only -//pg 59 -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -extern const mcu_pin_obj_t pin_PA10; -//pg 60 -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -//pg 61 -extern const mcu_pin_obj_t pin_PC12; -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -//pg 62 -extern const mcu_pin_obj_t pin_PG09; // 144 only -extern const mcu_pin_obj_t pin_PG10; // 144 only -extern const mcu_pin_obj_t pin_PG11; // 144 only -extern const mcu_pin_obj_t pin_PG12; // 144 only -extern const mcu_pin_obj_t pin_PG13; // 144 only -extern const mcu_pin_obj_t pin_PG14; // 144 only -extern const mcu_pin_obj_t pin_PG15; // 144 only -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -//pg 63 -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/clocks.c deleted file mode 100644 index 2afca64e83..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/clocks.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. - - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c deleted file mode 100644 index d1eaa90d1b..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/gpio.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK - // never_reset_pin_number(0,15); //PA15 JTDI - // never_reset_pin_number(1,3); //PB3 JTDO - // never_reset_pin_number(1,4); //PB4 JTRST - - // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO - // never_reset_pin_number(5,1); //PH1 JTRST -} - -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.c deleted file mode 100644 index bc03f7c7be..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.c +++ /dev/null @@ -1,194 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), - I2C_SDA(3, 4, &pin_PC09), -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { - UART(4, 8, &pin_PA00), - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(4, 8, &pin_PC10), - UART(5, 8, &pin_PC12), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(4, 8, &pin_PA01), - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(4, 8, &pin_PC11), - UART(5, 8, &pin_PD02), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, - TIM11, TIM12, TIM13, TIM14}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(13,9,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(14,9,1,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(2,1,4,&pin_PB11), - TIM(12,9,1,&pin_PB14), - TIM(12,9,2,&pin_PB15), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(8,3,1,&pin_PC06), - TIM(8,3,2,&pin_PC07), - TIM(8,3,3,&pin_PC08), - TIM(8,3,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), - TIM(10,3,1,&pin_PF06), - TIM(11,3,1,&pin_PF07), - TIM(13,9,1,&pin_PF08), - TIM(14,9,1,&pin_PF09), - // TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded - // TIM(12,9,2,&pin_PH09), - // TIM(5,2,1,&pin_PH10), - // TIM(5,2,2,&pin_PH11), - // TIM(5,2,3,&pin_PH12), - // TIM(5,2,4,&pin_PI00), - // TIM(8,3,4,&pin_PI02), - // TIM(8,3,1,&pin_PI05), - // TIM(8,3,2,&pin_PI06), - // TIM(8,3,3,&pin_PI07), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.h deleted file mode 100644 index e87e798574..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[3]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.c deleted file mode 100644 index 86445fe140..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.c +++ /dev/null @@ -1,161 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_123,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 - -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.h deleted file mode 100644 index 180f5c316f..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f407xx/pins.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H - -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only -//pg 50 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -//pg 51 -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only -//pg 52 -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -//pg 53 -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -extern const mcu_pin_obj_t pin_PC04; -//pg 54 -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only -//pg 55 -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -//pg 56 -extern const mcu_pin_obj_t pin_PE15; -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB11; // 144 only -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -//pg 57 -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 58 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PG02; // 144 only -extern const mcu_pin_obj_t pin_PG03; // 144 only -extern const mcu_pin_obj_t pin_PG04; // 144 only -extern const mcu_pin_obj_t pin_PG05; // 144 only -extern const mcu_pin_obj_t pin_PG06; // 144 only -extern const mcu_pin_obj_t pin_PG07; // 144 only -extern const mcu_pin_obj_t pin_PG08; // 144 only -//pg 59 -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -extern const mcu_pin_obj_t pin_PA10; -//pg 60 -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -//pg 61 -extern const mcu_pin_obj_t pin_PC12; -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -//pg 62 -extern const mcu_pin_obj_t pin_PG09; // 144 only -extern const mcu_pin_obj_t pin_PG10; // 144 only -extern const mcu_pin_obj_t pin_PG11; // 144 only -extern const mcu_pin_obj_t pin_PG12; // 144 only -extern const mcu_pin_obj_t pin_PG13; // 144 only -extern const mcu_pin_obj_t pin_PG14; // 144 only -extern const mcu_pin_obj_t pin_PG15; // 144 only -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -//pg 63 -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c deleted file mode 100644 index 53810af263..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c deleted file mode 100644 index aee0bd5eb8..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "py/mpconfig.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - - #if !(BOARD_OVERWRITE_SWD) - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK - #endif - - // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO - // never_reset_pin_number(5,1); //PH1 JTRST -} - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c deleted file mode 100644 index b7d9edf4f7..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c +++ /dev/null @@ -1,194 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 7, &pin_PB12), - SPI(3, 6, &pin_PC10), - SPI(4, 6, &pin_PB13), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), - SPI(5, 6, &pin_PB00), - SPI(5, 6, &pin_PE02), - SPI(5, 6, &pin_PE12) -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PA01), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), - SPI(5, 6, &pin_PA10), - SPI(5, 6, &pin_PB08), - SPI(5, 6, &pin_PE06), - SPI(5, 6, &pin_PE14) -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 6, &pin_PA11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), - SPI(5, 6, &pin_PA12), - SPI(5, 6, &pin_PE05), - SPI(5, 6, &pin_PE13) -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), - SPI(5, 6, &pin_PB01), - SPI(5, 6, &pin_PE04), - SPI(5, 6, &pin_PE11) -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[7] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PA15), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[7] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB03), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, - TIM11, NULL, NULL, NULL}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h deleted file mode 100644 index d657d73b68..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[5]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.c deleted file mode 100644 index 7e88c3dcba..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.c +++ /dev/null @@ -1,123 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.h deleted file mode 100644 index 37d3a5cf11..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/pins.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H - -//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only -//pg 38 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -//pg 39 -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -//pg 40 -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -//pg 41 -extern const mcu_pin_obj_t pin_PC04; -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -extern const mcu_pin_obj_t pin_PE15; -//pg 42 -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 43 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -//pg 44 -extern const mcu_pin_obj_t pin_PA10; -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -extern const mcu_pin_obj_t pin_PC12; -//pg 45 -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -//pg 46 -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/clocks.c deleted file mode 100644 index b208f9dfb3..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/clocks.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the - * device is clocked below the maximum system frequency, to update the - * voltage scaling value regarding system frequency refer to product - * datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 200; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLR = 2; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLLSAI output as USB clock source */ - PeriphClkInitStruct.PLLI2S.PLLI2SM = 8; - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; - PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - * clocks dividers */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/gpio.c deleted file mode 100644 index d17ab4e018..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/gpio.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* GPIO PIN REFERENCE -#define LED3_Pin GPIO_PIN_2 -#define LED3_GPIO_Port GPIOE -#define LED4_Pin GPIO_PIN_3 -#define LED4_GPIO_Port GPIOE -#define DFSDM_DATIN3_Pin GPIO_PIN_4 -#define DFSDM_DATIN3_GPIO_Port GPIOE -#define A0_Pin GPIO_PIN_0 -#define A0_GPIO_Port GPIOF -#define LCD_BLCTRL_Pin GPIO_PIN_5 -#define LCD_BLCTRL_GPIO_Port GPIOF -#define QSPI_BK1_IO3_Pin GPIO_PIN_6 -#define QSPI_BK1_IO3_GPIO_Port GPIOF -#define QSPI_BK1_IO2_Pin GPIO_PIN_7 -#define QSPI_BK1_IO2_GPIO_Port GPIOF -#define QSPI_BK1_IO0_Pin GPIO_PIN_8 -#define QSPI_BK1_IO0_GPIO_Port GPIOF -#define QSPI_BK1_IO1_Pin GPIO_PIN_9 -#define QSPI_BK1_IO1_GPIO_Port GPIOF -#define STLK_MCO_Pin GPIO_PIN_0 -#define STLK_MCO_GPIO_Port GPIOH -#define DFSDM_CKOUT_Pin GPIO_PIN_2 -#define DFSDM_CKOUT_GPIO_Port GPIOC -#define JOY_SEL_Pin GPIO_PIN_0 -#define JOY_SEL_GPIO_Port GPIOA -#define STLINK_RX_Pin GPIO_PIN_2 -#define STLINK_RX_GPIO_Port GPIOA -#define STLINK_TX_Pin GPIO_PIN_3 -#define STLINK_TX_GPIO_Port GPIOA -#define CODEC_I2S3_WS_Pin GPIO_PIN_4 -#define CODEC_I2S3_WS_GPIO_Port GPIOA -#define DFSDM_DATIN0_Pin GPIO_PIN_1 -#define DFSDM_DATIN0_GPIO_Port GPIOB -#define QSPI_CLK_Pin GPIO_PIN_2 -#define QSPI_CLK_GPIO_Port GPIOB -#define EXT_RESET_Pin GPIO_PIN_11 -#define EXT_RESET_GPIO_Port GPIOF -#define CTP_RST_Pin GPIO_PIN_12 -#define CTP_RST_GPIO_Port GPIOF -#define JOY_RIGHT_Pin GPIO_PIN_14 -#define JOY_RIGHT_GPIO_Port GPIOF -#define JOY_LEFT_Pin GPIO_PIN_15 -#define JOY_LEFT_GPIO_Port GPIOF -#define JOY_UP_Pin GPIO_PIN_0 -#define JOY_UP_GPIO_Port GPIOG -#define JOY_DOWN_Pin GPIO_PIN_1 -#define JOY_DOWN_GPIO_Port GPIOG -#define D4_Pin GPIO_PIN_7 -#define D4_GPIO_Port GPIOE -#define D5_Pin GPIO_PIN_8 -#define D5_GPIO_Port GPIOE -#define D6_Pin GPIO_PIN_9 -#define D6_GPIO_Port GPIOE -#define D7_Pin GPIO_PIN_10 -#define D7_GPIO_Port GPIOE -#define D8_Pin GPIO_PIN_11 -#define D8_GPIO_Port GPIOE -#define D9_Pin GPIO_PIN_12 -#define D9_GPIO_Port GPIOE -#define D10_Pin GPIO_PIN_13 -#define D10_GPIO_Port GPIOE -#define D11_Pin GPIO_PIN_14 -#define D11_GPIO_Port GPIOE -#define D12_Pin GPIO_PIN_15 -#define D12_GPIO_Port GPIOE -#define I2C2_SCL_Pin GPIO_PIN_10 -#define I2C2_SCL_GPIO_Port GPIOB -#define M2_CKIN_Pin GPIO_PIN_11 -#define M2_CKIN_GPIO_Port GPIOB -#define CODEC_I2S3_SCK_Pin GPIO_PIN_12 -#define CODEC_I2S3_SCK_GPIO_Port GPIOB -#define D13_Pin GPIO_PIN_8 -#define D13_GPIO_Port GPIOD -#define D14_Pin GPIO_PIN_9 -#define D14_GPIO_Port GPIOD -#define D15_Pin GPIO_PIN_10 -#define D15_GPIO_Port GPIOD -#define LCD_RESET_Pin GPIO_PIN_11 -#define LCD_RESET_GPIO_Port GPIOD -#define D0_Pin GPIO_PIN_14 -#define D0_GPIO_Port GPIOD -#define D1_Pin GPIO_PIN_15 -#define D1_GPIO_Port GPIOD -#define CODEC_INT_Pin GPIO_PIN_2 -#define CODEC_INT_GPIO_Port GPIOG -#define LCD_TE_Pin GPIO_PIN_4 -#define LCD_TE_GPIO_Port GPIOG -#define CTP_INT_Pin GPIO_PIN_5 -#define CTP_INT_GPIO_Port GPIOG -#define QSPI_BK1_NCS_Pin GPIO_PIN_6 -#define QSPI_BK1_NCS_GPIO_Port GPIOG -#define USB_OTGFS_OVRCR_Pin GPIO_PIN_7 -#define USB_OTGFS_OVRCR_GPIO_Port GPIOG -#define USB_OTGFS_PPWR_EN_Pin GPIO_PIN_8 -#define USB_OTGFS_PPWR_EN_GPIO_Port GPIOG -#define CODEC_I2S3_MCK_Pin GPIO_PIN_7 -#define CODEC_I2S3_MCK_GPIO_Port GPIOC -#define uSD_D0_Pin GPIO_PIN_8 -#define uSD_D0_GPIO_Port GPIOC -#define uSD_D1_Pin GPIO_PIN_9 -#define uSD_D1_GPIO_Port GPIOC -#define M2_CKINA8_Pin GPIO_PIN_8 -#define M2_CKINA8_GPIO_Port GPIOA -#define USB_OTGFS_VBUS_Pin GPIO_PIN_9 -#define USB_OTGFS_VBUS_GPIO_Port GPIOA -#define USB_OTGFS_ID_Pin GPIO_PIN_10 -#define USB_OTGFS_ID_GPIO_Port GPIOA -#define USB_OTGFS_DM_Pin GPIO_PIN_11 -#define USB_OTGFS_DM_GPIO_Port GPIOA -#define USB_OTGFS_DP_Pin GPIO_PIN_12 -#define USB_OTGFS_DP_GPIO_Port GPIOA -#define SWDIO_Pin GPIO_PIN_13 -#define SWDIO_GPIO_Port GPIOA -#define SWCLK_Pin GPIO_PIN_14 -#define SWCLK_GPIO_Port GPIOA -#define uSD_D2_Pin GPIO_PIN_10 -#define uSD_D2_GPIO_Port GPIOC -#define uSD_D3_Pin GPIO_PIN_11 -#define uSD_D3_GPIO_Port GPIOC -#define uSD_CLK_Pin GPIO_PIN_12 -#define uSD_CLK_GPIO_Port GPIOC -#define D2_Pin GPIO_PIN_0 -#define D2_GPIO_Port GPIOD -#define D3_Pin GPIO_PIN_1 -#define D3_GPIO_Port GPIOD -#define uSD_CMD_Pin GPIO_PIN_2 -#define uSD_CMD_GPIO_Port GPIOD -#define uSD_DETECT_Pin GPIO_PIN_3 -#define uSD_DETECT_GPIO_Port GPIOD -#define FMC_NOE_Pin GPIO_PIN_4 -#define FMC_NOE_GPIO_Port GPIOD -#define FMC_NWE_Pin GPIO_PIN_5 -#define FMC_NWE_GPIO_Port GPIOD -#define FMC_NE1_Pin GPIO_PIN_7 -#define FMC_NE1_GPIO_Port GPIOD -#define SWO_Pin GPIO_PIN_3 -#define SWO_GPIO_Port GPIOB -#define CODEC_I2S3ext_SD_Pin GPIO_PIN_4 -#define CODEC_I2S3ext_SD_GPIO_Port GPIOB -#define CODEC_I2S3_SD_Pin GPIO_PIN_5 -#define CODEC_I2S3_SD_GPIO_Port GPIOB -#define I2C1_SCL_Pin GPIO_PIN_6 -#define I2C1_SCL_GPIO_Port GPIOB -#define I2C1_SDA_Pin GPIO_PIN_7 -#define I2C1_SDA_GPIO_Port GPIOB -#define I2C2_SDA_Pin GPIO_PIN_9 -#define I2C2_SDA_GPIO_Port GPIOB -#define LED1_Pin GPIO_PIN_0 -#define LED1_GPIO_Port GPIOE -#define LED2_Pin GPIO_PIN_1 -#define LED2_GPIO_Port GPIOE -*/ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); - //HAL_GPIO_WritePin(USB_OTGFS_PPWR_EN_GPIO_Port, USB_OTGFS_PPWR_EN_Pin, GPIO_PIN_SET); - - //Configure LED pins - GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); - - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,0); - stm32f4_peripherals_status_led(2,0); - stm32f4_peripherals_status_led(3,0); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK - //never_reset_pin_number(0,15); //PA15 JTDI - //never_reset_pin_number(1,3); //PB3 JTDO - //never_reset_pin_number(1,4); //PB4 JTRST - - // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO - // never_reset_pin_number(5,1); //PH1 JTRST -} - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - switch(led) - { - case 0: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, (state ^ 1)); - break; - case 1: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, (state ^ 1)); - break; - case 2: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, (state ^ 1)); - break; - case 3: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, (state ^ 1)); - break; - default: break; - } -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c deleted file mode 100644 index f5effa80ed..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ /dev/null @@ -1,223 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 7, &pin_PB12), - SPI(3, 6, &pin_PC10), - SPI(4, 6, &pin_PB13), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), - SPI(5, 6, &pin_PB00), - SPI(5, 6, &pin_PE02), - SPI(5, 6, &pin_PE12) -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PA01), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), - SPI(5, 6, &pin_PA10), - SPI(5, 6, &pin_PB08), - SPI(5, 6, &pin_PE06), - SPI(5, 6, &pin_PE14) -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 6, &pin_PA11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), - SPI(5, 6, &pin_PA12), - SPI(5, 6, &pin_PE05), - SPI(5, 6, &pin_PE13) -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), - SPI(5, 6, &pin_PB01), - SPI(5, 6, &pin_PE04), - SPI(5, 6, &pin_PE11) -}; - -//UART - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PA15), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB03), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(3, 7, &pin_PC05), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, - TIM11, TIM12, TIM13, TIM14}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(13,9,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(14,9,1,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(2,1,4,&pin_PB11), - TIM(12,9,1,&pin_PB14), - TIM(12,9,2,&pin_PB15), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(8,3,1,&pin_PC06), - TIM(8,3,2,&pin_PC07), - TIM(8,3,3,&pin_PC08), - TIM(8,3,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), - TIM(10,3,1,&pin_PF06), - TIM(11,3,1,&pin_PF07), - TIM(13,9,1,&pin_PF08), - TIM(14,9,1,&pin_PF09), - TIM(5,2,1,&pin_PF03), - TIM(5,2,2,&pin_PF04), - TIM(5,2,3,&pin_PF05), - TIM(5,2,4,&pin_PF10), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h deleted file mode 100644 index e0141e6dab..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - - -//SPI -extern SPI_TypeDef * mcu_spi_banks[5]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.c deleted file mode 100644 index c56de5a295..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.c +++ /dev/null @@ -1,161 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.h deleted file mode 100644 index 180f5c316f..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/pins.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H - -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only -//pg 50 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -//pg 51 -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only -//pg 52 -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -//pg 53 -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -extern const mcu_pin_obj_t pin_PC04; -//pg 54 -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only -//pg 55 -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -//pg 56 -extern const mcu_pin_obj_t pin_PE15; -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB11; // 144 only -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -//pg 57 -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 58 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PG02; // 144 only -extern const mcu_pin_obj_t pin_PG03; // 144 only -extern const mcu_pin_obj_t pin_PG04; // 144 only -extern const mcu_pin_obj_t pin_PG05; // 144 only -extern const mcu_pin_obj_t pin_PG06; // 144 only -extern const mcu_pin_obj_t pin_PG07; // 144 only -extern const mcu_pin_obj_t pin_PG08; // 144 only -//pg 59 -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -extern const mcu_pin_obj_t pin_PA10; -//pg 60 -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -//pg 61 -extern const mcu_pin_obj_t pin_PC12; -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -//pg 62 -extern const mcu_pin_obj_t pin_PG09; // 144 only -extern const mcu_pin_obj_t pin_PG10; // 144 only -extern const mcu_pin_obj_t pin_PG11; // 144 only -extern const mcu_pin_obj_t pin_PG12; // 144 only -extern const mcu_pin_obj_t pin_PG13; // 144 only -extern const mcu_pin_obj_t pin_PG14; // 144 only -extern const mcu_pin_obj_t pin_PG15; // 144 only -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -//pg 63 -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H diff --git a/ports/stm32f4/qstrdefsport.h b/ports/stm32f4/qstrdefsport.h deleted file mode 100644 index 3ba897069b..0000000000 --- a/ports/stm32f4/qstrdefsport.h +++ /dev/null @@ -1 +0,0 @@ -// qstrs specific to this port diff --git a/ports/stm32f4/supervisor/cpu.s b/ports/stm32f4/supervisor/cpu.s deleted file mode 100755 index 9e6807a5e2..0000000000 --- a/ports/stm32f4/supervisor/cpu.s +++ /dev/null @@ -1,27 +0,0 @@ -.syntax unified -.cpu cortex-m4 -.thumb -.text -.align 2 - -@ uint cpu_get_regs_and_sp(r0=uint regs[10]) -.global cpu_get_regs_and_sp -.thumb -.thumb_func -.type cpu_get_regs_and_sp, %function -cpu_get_regs_and_sp: -@ store registers into given array -str r4, [r0], #4 -str r5, [r0], #4 -str r6, [r0], #4 -str r7, [r0], #4 -str r8, [r0], #4 -str r9, [r0], #4 -str r10, [r0], #4 -str r11, [r0], #4 -str r12, [r0], #4 -str r13, [r0], #4 - -@ return the sp -mov r0, sp -bx lr diff --git a/ports/stm32f4/supervisor/internal_flash.c b/ports/stm32f4/supervisor/internal_flash.c deleted file mode 100644 index 046b26baf2..0000000000 --- a/ports/stm32f4/supervisor/internal_flash.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "supervisor/internal_flash.h" - -#include -#include - -#include "extmod/vfs.h" -#include "extmod/vfs_fat.h" -#include "py/mphal.h" -#include "py/obj.h" -#include "py/runtime.h" -#include "lib/oofatfs/ff.h" - -#include "stm32f4xx_hal.h" - -typedef struct { - uint32_t base_address; - uint32_t sector_size; - uint32_t sector_count; -} flash_layout_t; - -/*------------------------------------------------------------------*/ -/* Internal Flash API - *------------------------------------------------------------------*/ - -static const flash_layout_t flash_layout[] = { - { 0x08000000, 0x04000, 4 }, - { 0x08010000, 0x10000, 1 }, - { 0x08020000, 0x20000, 3 }, - #if defined(FLASH_SECTOR_8) - { 0x08080000, 0x20000, 4 }, - #endif - #if defined(FLASH_SECTOR_12) - { 0x08100000, 0x04000, 4 }, - { 0x08110000, 0x10000, 1 }, - { 0x08120000, 0x20000, 7 }, - #endif -}; - -static uint8_t sector_copy[0x4000] __attribute__((aligned(4))); - -//Return the sector of a given flash address. -uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { - if (addr >= flash_layout[0].base_address) { - uint32_t sector_index = 0; - for (uint8_t i = 0; i < MP_ARRAY_SIZE(flash_layout); ++i) { - for (uint8_t j = 0; j < flash_layout[i].sector_count; ++j) { - uint32_t sector_start_next = flash_layout[i].base_address - + (j + 1) * flash_layout[i].sector_size; - if (addr < sector_start_next) { - if (start_addr != NULL) { - *start_addr = flash_layout[i].base_address - + j * flash_layout[i].sector_size; - } - if (size != NULL) { - *size = flash_layout[i].sector_size; - } - return sector_index; - } - ++sector_index; - } - } - } - return 0; -} - -void supervisor_flash_init(void) { -} - -uint32_t supervisor_flash_get_block_size(void) { - return FILESYSTEM_BLOCK_SIZE; -} - -uint32_t supervisor_flash_get_block_count(void) { - return INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS; -} - -void supervisor_flash_flush(void) { -} - -static int32_t convert_block_to_flash_addr(uint32_t block) { - if (0 <= block && block < INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS) { - // a block in partition 1 - return INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; - } - // bad block - return -1; -} - -mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { - int32_t src = convert_block_to_flash_addr(block); - if (src == -1) { - // bad block number - return false; - } - memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); - return 0; // success -} - -bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { - int32_t dest = convert_block_to_flash_addr(block); - if (dest == -1) { - // bad block number - mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); - return false; - } - - // unlock flash - HAL_FLASH_Unlock(); - - // set up for erase - FLASH_EraseInitTypeDef EraseInitStruct; - EraseInitStruct.TypeErase = TYPEERASE_SECTORS; - EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V - // get the sector information - uint32_t sector_size; - uint32_t sector_start_addr; - EraseInitStruct.Sector = flash_get_sector_info(dest, §or_start_addr, §or_size); - EraseInitStruct.NbSectors = 1; - if (sector_size>0x4000) return false; - - // copy the sector - memcpy(sector_copy,(void *)sector_start_addr,sector_size); - - // // overwrite sector data - memcpy(sector_copy+(dest-sector_start_addr),src,FILESYSTEM_BLOCK_SIZE); - - // find end address, subtract for number of sectors - // Shouldn't be required since blocks will always fit in a single sector, they should never overlap - //EraseInitStruct.NbSectors = flash_get_sector_info(dest + FILESYSTEM_BLOCK_SIZE - 1, NULL, NULL) - EraseInitStruct.Sector + 1; - - // erase the sector - uint32_t SectorError = 0; - if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { - // error occurred during sector erase - HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH SECTOR ERASE ERROR"); - return false; - } - - __HAL_FLASH_DATA_CACHE_DISABLE(); - __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); - - __HAL_FLASH_DATA_CACHE_RESET(); - __HAL_FLASH_INSTRUCTION_CACHE_RESET(); - - __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); - __HAL_FLASH_DATA_CACHE_ENABLE(); - - // reprogram the sector - for (uint32_t i = 0; i < sector_size; i++) { - if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)sector_copy[i]) != HAL_OK) { - // error occurred during flash write - HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); - return false; - } - sector_start_addr += 1; - } - - // lock the flash - HAL_FLASH_Lock(); - - return true; -} - -mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { - - for (size_t i = 0; i < num_blocks; i++) { - if (!supervisor_flash_write_block(src + i * FILESYSTEM_BLOCK_SIZE, block_num + i)) { - return 1; // error - } - } - return 0; // success -} - -void supervisor_flash_release_cache(void) { -} - diff --git a/ports/stm32f4/supervisor/internal_flash.h b/ports/stm32f4/supervisor/internal_flash.h deleted file mode 100644 index 9f16a799d8..0000000000 --- a/ports/stm32f4/supervisor/internal_flash.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H -#define MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H - -#include -#include - -#include "py/mpconfig.h" - -#ifdef STM32F401xE -#define STM32_FLASH_SIZE 0x80000 //512KiB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB -#endif - -#ifdef STM32F411xE -#define STM32_FLASH_SIZE 0x80000 //512KiB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB -#endif - -#ifdef STM32F412Zx -#define STM32_FLASH_SIZE 0x100000 //1MB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB -#endif - -#ifdef STM32F405xx -#define STM32_FLASH_SIZE 0x100000 //1MB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB -#endif - -#ifdef STM32F407xx -#define STM32_FLASH_SIZE 0x100000 //1MB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB -#endif - -#define STM32_FLASH_OFFSET 0x8000000 //All STM32 chips map to this flash location - -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) - -#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms -#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) - -#endif // MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H diff --git a/ports/stm32f4/supervisor/internal_flash_root_pointers.h b/ports/stm32f4/supervisor/internal_flash_root_pointers.h deleted file mode 100644 index 7a8681bd95..0000000000 --- a/ports/stm32f4/supervisor/internal_flash_root_pointers.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H -#define MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H - -#define FLASH_ROOT_POINTERS - -#endif // MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c deleted file mode 100644 index ecb4d3d15c..0000000000 --- a/ports/stm32f4/supervisor/port.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "supervisor/port.h" -#include "boards/board.h" -#include "tick.h" - -#include "common-hal/microcontroller/Pin.h" -#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 "stm32f4/clocks.h" -#include "stm32f4/gpio.h" - -#include "stm32f4xx_hal.h" - -safe_mode_t port_init(void) { - HAL_Init(); - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - stm32f4_peripherals_clocks_init(); - stm32f4_peripherals_gpio_init(); - - tick_init(); - - return NO_SAFE_MODE; -} - -void reset_port(void) { - reset_all_pins(); - i2c_reset(); - spi_reset(); - uart_reset(); - pwmout_reset(); - pulseout_reset(); -} - -void reset_to_bootloader(void) { - -} - -void reset_cpu(void) { - NVIC_SystemReset(); -} - -uint32_t *port_heap_get_bottom(void) { - return port_stack_get_limit(); -} - -uint32_t *port_heap_get_top(void) { - return port_stack_get_top(); -} - -uint32_t *port_stack_get_limit(void) { - return &_ebss; -} - -uint32_t *port_stack_get_top(void) { - return &_estack; -} - -extern uint32_t _ebss; -// Place the word to save just after our BSS section that gets blanked. -void port_set_saved_word(uint32_t value) { - _ebss = value; -} - -uint32_t port_get_saved_word(void) { - return _ebss; -} - -void HardFault_Handler(void) { - reset_into_safe_mode(HARD_CRASH); - while (true) { - asm("nop;"); - } -} diff --git a/ports/stm32f4/supervisor/qspi_flash.c b/ports/stm32f4/supervisor/qspi_flash.c deleted file mode 100644 index f3915273b3..0000000000 --- a/ports/stm32f4/supervisor/qspi_flash.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 hathach for Adafruit Industries - * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "supervisor/spi_flash_api.h" - -#include -#include - -#include "py/mpconfig.h" // for EXTERNAL_FLASH_QSPI_DUAL -//#include "nrfx_qspi.h" - -//#include "shared-bindings/microcontroller/__init__.h" - -#include "supervisor/shared/external_flash/common_commands.h" -#include "supervisor/shared/external_flash/qspi_flash.h" - -bool spi_flash_command(uint8_t command) { - // nrf_qspi_cinstr_conf_t cinstr_cfg = { - // .opcode = command, - // .length = 1, - // .io2_level = true, - // .io3_level = true, - // .wipwait = false, - // .wren = false - // }; - return false; //nrfx_qspi_cinstr_xfer(&cinstr_cfg, NULL, NULL) == NRFX_SUCCESS; -} - -bool spi_flash_read_command(uint8_t command, uint8_t* response, uint32_t length) { - // nrf_qspi_cinstr_conf_t cinstr_cfg = { - // .opcode = command, - // .length = length + 1, - // .io2_level = true, - // .io3_level = true, - // .wipwait = false, - // .wren = false - // }; - // return nrfx_qspi_cinstr_xfer(&cinstr_cfg, NULL, response) == NRFX_SUCCESS; - return false; - -} - -bool spi_flash_write_command(uint8_t command, uint8_t* data, uint32_t length) { - // nrf_qspi_cinstr_conf_t cinstr_cfg = { - // .opcode = command, - // .length = length + 1, - // .io2_level = true, - // .io3_level = true, - // .wipwait = false, - // .wren = false // We do this manually. - // }; - // return nrfx_qspi_cinstr_xfer(&cinstr_cfg, data, NULL) == NRFX_SUCCESS; - return false; -} - -bool spi_flash_sector_command(uint8_t command, uint32_t address) { - // if (command != CMD_SECTOR_ERASE) { - // return false; - // } - // return nrfx_qspi_erase(NRF_QSPI_ERASE_LEN_4KB, address) == NRFX_SUCCESS; - return false; -} - -bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { - // return nrfx_qspi_write(data, length, address) == NRFX_SUCCESS; - return false; -} - -bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { - // return nrfx_qspi_read(data, length, address) == NRFX_SUCCESS; - return false; -} - -void spi_flash_init(void) { - // Init QSPI flash -// nrfx_qspi_config_t qspi_cfg = { -// .xip_offset = 0, -// .pins = { -// .sck_pin = MICROPY_QSPI_SCK, -// .csn_pin = MICROPY_QSPI_CS, -// .io0_pin = MICROPY_QSPI_DATA0, -// .io1_pin = NRF_QSPI_PIN_NOT_CONNECTED, -// .io2_pin = NRF_QSPI_PIN_NOT_CONNECTED, -// .io3_pin = NRF_QSPI_PIN_NOT_CONNECTED, - -// }, -// .prot_if = { -// .readoc = NRF_QSPI_READOC_FASTREAD, -// .writeoc = NRF_QSPI_WRITEOC_PP, -// .addrmode = NRF_QSPI_ADDRMODE_24BIT, -// .dpmconfig = false -// }, -// .phy_if = { -// .sck_freq = NRF_QSPI_FREQ_32MDIV16, // Start at a slow 2MHz and speed up once we know what we're talking to. -// .sck_delay = 10, // min time CS must stay high before going low again. in unit of 62.5 ns -// .spi_mode = NRF_QSPI_MODE_0, -// .dpmen = false -// }, -// .irq_priority = 7, -// }; - -// #if EXTERNAL_FLASH_QSPI_DUAL -// qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1; -// qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ2O; -// qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP2O; -// #else -// qspi_cfg.pins.io1_pin = MICROPY_QSPI_DATA1; -// qspi_cfg.pins.io2_pin = MICROPY_QSPI_DATA2; -// qspi_cfg.pins.io3_pin = MICROPY_QSPI_DATA3; -// qspi_cfg.prot_if.readoc = NRF_QSPI_READOC_READ4IO; -// qspi_cfg.prot_if.writeoc = NRF_QSPI_WRITEOC_PP4O; -// #endif - -// // No callback for blocking API -// nrfx_qspi_init(&qspi_cfg, NULL, NULL); -} - -void spi_flash_init_device(const external_flash_device* device) { - // check_quad_enable(device); - - // // Switch to single output line if the device doesn't support quad programs. - // if (!device->supports_qspi_writes) { - // NRF_QSPI->IFCONFIG0 &= ~QSPI_IFCONFIG0_WRITEOC_Msk; - // NRF_QSPI->IFCONFIG0 |= QSPI_IFCONFIG0_WRITEOC_PP << QSPI_IFCONFIG0_WRITEOC_Pos; - // } - - // // Speed up as much as we can. - // // Start at 16 MHz and go down. - // // At 32 MHz GD25Q16C doesn't work reliably on Feather 52840, even though it should work up to 104 MHz. - // // sckfreq = 0 is 32 Mhz - // // sckfreq = 1 is 16 MHz, etc. - // uint8_t sckfreq = 1; - // while (32000000 / (sckfreq + 1) > device->max_clock_speed_mhz * 1000000 && sckfreq < 16) { - // sckfreq += 1; - // } - // NRF_QSPI->IFCONFIG1 &= ~QSPI_IFCONFIG1_SCKFREQ_Msk; - // NRF_QSPI->IFCONFIG1 |= sckfreq << QSPI_IFCONFIG1_SCKFREQ_Pos; -} diff --git a/ports/stm32f4/supervisor/serial.c b/ports/stm32f4/supervisor/serial.c deleted file mode 100644 index ce13660000..0000000000 --- a/ports/stm32f4/supervisor/serial.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/mphal.h" -#include -#include "supervisor/serial.h" -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" - -UART_HandleTypeDef huart2; - -void serial_init(void) { - huart2.Instance = USART2; - huart2.Init.BaudRate = 115200; - huart2.Init.WordLength = UART_WORDLENGTH_8B; - huart2.Init.StopBits = UART_STOPBITS_1; - huart2.Init.Parity = UART_PARITY_NONE; - huart2.Init.Mode = UART_MODE_TX_RX; - huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; - huart2.Init.OverSampling = UART_OVERSAMPLING_16; - if (HAL_UART_Init(&huart2) == HAL_OK) - { - stm32f4_peripherals_status_led(1,1); - } -} - -bool serial_connected(void) { - return true; -} - -char serial_read(void) { - uint8_t data; - HAL_UART_Receive(&huart2, &data, 1,500); - return data; -} - -bool serial_bytes_available(void) { - return __HAL_UART_GET_FLAG(&huart2, UART_FLAG_RXNE); -} - -void serial_write(const char* text) { - serial_write_substring(text, strlen(text)); -} - -void serial_write_substring(const char *text, uint32_t len) { - if (len == 0) { - return; - } - HAL_UART_Transmit(&huart2, (uint8_t*)text, len, 5000); -} - diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c deleted file mode 100644 index 358c2de5b3..0000000000 --- a/ports/stm32f4/supervisor/usb.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 hathach for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#include "tick.h" -#include "supervisor/usb.h" -#include "lib/utils/interrupt_char.h" -#include "lib/mp-readline/readline.h" -#include "stm32f4xx_hal.h" - -#include "py/mpconfig.h" - -#include "common-hal/microcontroller/Pin.h" - -STATIC void init_usb_vbus_sense(void) { - -#if (BOARD_NO_VBUS_SENSE) - // Disable VBUS sensing - #ifdef USB_OTG_GCCFG_VBDEN - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; - #else - USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN; - #endif -#else - // Enable VBUS hardware sensing - #ifdef USB_OTG_GCCFG_VBDEN - USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN; - #else - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_NOVBUSSENS; - USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBUSBSEN; // B Device sense - #endif -#endif -} - -void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - /**USB_OTG_FS GPIO Configuration - PA10 ------> USB_OTG_FS_ID - PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP - */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - - /* Configure DM DP Pins */ - GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - never_reset_pin_number(0, 11); - never_reset_pin_number(0, 12); - - /* Configure VBUS Pin */ - GPIO_InitStruct.Pin = GPIO_PIN_9; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - never_reset_pin_number(0, 9); - - /* This for ID line debug */ - GPIO_InitStruct.Pin = GPIO_PIN_10; - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - never_reset_pin_number(0, 10); - -#ifdef STM32F412Zx - /* Configure POWER_SWITCH IO pin (F412 ONLY)*/ - GPIO_InitStruct.Pin = GPIO_PIN_8; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); - never_reset_pin_number(0, 8); -#endif - - /* Peripheral clock enable */ - __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); - __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); - - init_usb_vbus_sense(); -} diff --git a/ports/stm32f4/system_stm32f4xx.c b/ports/stm32f4/system_stm32f4xx.c deleted file mode 100644 index caa4f9cafb..0000000000 --- a/ports/stm32f4/system_stm32f4xx.c +++ /dev/null @@ -1,788 +0,0 @@ -/* - * Taken from ST Cube library and modified. See below for original header. - * - * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - ****************************************************************************** - * @file system_stm32f4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f4xx_system - * @{ - */ - -/** @addtogroup STM32F4xx_System_Private_Includes - * @{ - */ - - -#include "stm32f4xx.h" -#include "py/mpconfig.h" - -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) -/* #define DATA_IN_ExtSRAM */ -#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ - STM32F412Zx || STM32F412Vx */ - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -/* #define DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\ - STM32F479xx */ - -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. - This value must be a multiple of 0x200. */ -/******************************************************************************/ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Variables - * @{ - */ - /* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = 16000000; -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes - * @{ - */ - -#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory - * configuration. - * @param None - * @retval None - */ -void SystemInit(void) -{ - /* FPU settings ------------------------------------------------------------*/ - #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ - #endif - /* Reset the RCC clock configuration to the default reset state ------------*/ - /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001; - - /* Reset CFGR register */ - RCC->CFGR = 0x00000000; - - /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFF; - - /* Reset PLLCFGR register */ - RCC->PLLCFGR = 0x24003010; - - /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFF; - - /* Disable all interrupts */ - RCC->CIR = 0x00000000; - -#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - - /* Configure the Vector Table location add offset address ------------------*/ -#if !(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already - #ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ - #else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ - #endif -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value - * depends on the application requirements), user has to ensure that HSE_VALUE - * is same as the real frequency of the crystal used. Otherwise, this function - * may have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case 0x00: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - case 0x04: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - case 0x08: /* PLL used as system clock source */ - - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N - SYSCLK = PLL_VCO / PLL_P - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; - pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - - if (pllsource != 0) - { - /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - else - { - /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - - pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; - SystemCoreClock = pllvco/pllp; - break; - default: - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK frequency --------------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK frequency */ - SystemCoreClock >>= tmp; -} - -#if defined (DATA_IN_ExtSRAM) && defined (DATA_IN_ExtSDRAM) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; - - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ - RCC->AHB1ENR |= 0x000001F8; - - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; - -/*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index<1000; index++); - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ - FMC_Bank5_6->SDCMR = 0x00000073; - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ - FMC_Bank5_6->SDCMR = 0x00046014; - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ - - (void)(tmp); -} -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ -#elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -#if defined (DATA_IN_ExtSDRAM) - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - -#if defined(STM32F446xx) - /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface - clock */ - RCC->AHB1ENR |= 0x0000007D; -#else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface - clock */ - RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - -#if defined(STM32F446xx) - /* Connect PAx pins to FMC Alternate function */ - GPIOA->AFR[0] |= 0xC0000000; - GPIOA->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOA->MODER |= 0x00008000; - /* Configure PDx pins speed to 50 MHz */ - GPIOA->OSPEEDR |= 0x00008000; - /* Configure PDx pins Output type to push-pull */ - GPIOA->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOA->PUPDR |= 0x00000000; - - /* Connect PCx pins to FMC Alternate function */ - GPIOC->AFR[0] |= 0x00CC0000; - GPIOC->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOC->MODER |= 0x00000A00; - /* Configure PDx pins speed to 50 MHz */ - GPIOC->OSPEEDR |= 0x00000A00; - /* Configure PDx pins Output type to push-pull */ - GPIOC->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOC->PUPDR |= 0x00000000; -#endif /* STM32F446xx */ - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x000000CC; - GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ - GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00000CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ - GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - -/*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - /* Configure and enable SDRAM bank1 */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCR[0] = 0x00001954; -#else - FMC_Bank5_6->SDCR[0] = 0x000019E4; -#endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index<1000; index++); - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x000000F3; -#else - FMC_Bank5_6->SDCMR = 0x00000073; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x00044014; -#else - FMC_Bank5_6->SDCMR = 0x00046014; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; -#if defined(STM32F446xx) - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); -#else - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); -#endif /* STM32F446xx */ - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); -#endif /* DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ - -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) - -#if defined(DATA_IN_ExtSRAM) -/*-- GPIOs Configuration -----------------------------------------------------*/ - /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ - RCC->AHB1ENR |= 0x00000078; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0x00CCCCCC; - GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ - GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0x00CCCCCC; - GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ - GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - -/*-- FMC/FSMC Configuration --------------------------------------------------*/ - /* Enable the FMC/FSMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\ - || defined(STM32F412Zx) || defined(STM32F412Vx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); - /* Configure and enable Bank1_SRAM2 */ - FSMC_Bank1->BTCR[2] = 0x00001011; - FSMC_Bank1->BTCR[3] = 0x00000201; - FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ - -#endif /* DATA_IN_ExtSRAM */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); -} -#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c deleted file mode 100644 index f4adf183aa..0000000000 --- a/ports/stm32f4/tick.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/Processor.h" - -#include "stm32f4xx.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -uint32_t HAL_GetTick(void) //override ST HAL -{ - return (uint32_t)supervisor_ticks_ms32(); -} - -void tick_init() { - uint32_t ticks_per_ms = SystemCoreClock/ 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled - - NVIC_EnableIRQ(SysTick_IRQn); - // Bump up the systick interrupt so nothing else interferes with timekeeping. - NVIC_SetPriority(SysTick_IRQn, 0); - NVIC_SetPriority(OTG_FS_IRQn, 1); -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = supervisor_ticks_ms64(); - while (us > 1000) { - while (supervisor_ticks_ms64() == start_ms) {} - us -= us_between_ticks; - start_ms = supervisor_ticks_ms64(); - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - *ms = supervisor_ticks_ms32(); - *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/stm32f4/tick.h b/ports/stm32f4/tick.h deleted file mode 100644 index 999acc7a3c..0000000000 --- a/ports/stm32f4/tick.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_STM32F4_TICK_H -#define MICROPY_INCLUDED_STM32F4_TICK_H - -#include "py/mpconfig.h" - -#include - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_STM32F4_TICK_H From 7ff336fbc5436c1bd2281a7d3034e30de6fbebdd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 18:32:32 -0400 Subject: [PATCH 053/919] Change docs target --- conf.py | 24 +++--------------------- docs/supported_ports.rst | 2 +- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/conf.py b/conf.py index 3b29986c06..1f9f85b0bc 100644 --- a/conf.py +++ b/conf.py @@ -121,16 +121,8 @@ exclude_patterns = ["**/build*", "ports/atmel-samd/peripherals", "ports/atmel-samd/QTouch", "ports/atmel-samd/tools", - "ports/bare-arm", - "ports/cc3200", - "ports/cc3200/FreeRTOS", - "ports/cc3200/hal", "ports/cxd56/mkspk", "ports/cxd56/spresense-exported-sdk", - "ports/esp32", - "ports/esp8266/boards", - "ports/esp8266/common-hal", - "ports/esp8266/modules", "ports/minimal", "ports/mimxrt10xx/peripherals", "ports/mimxrt10xx/sdk", @@ -140,20 +132,10 @@ exclude_patterns = ["**/build*", "ports/nrf/nrfx", "ports/nrf/peripherals", "ports/nrf/usb", - "ports/stm32f4/stm32f4", - "ports/stm32f4/peripherals", - "ports/stm32f4/ref", - "ports/pic16bit", - "ports/qemu-arm", - "ports/stm32", - "ports/stm32/hal", - "ports/stm32/cmsis", - "ports/stm32/usbdev", - "ports/stm32/usbhost", - "ports/teensy", + "ports/stm/stm32f4", + "ports/stm/peripherals", + "ports/stm/ref", "ports/unix", - "ports/windows", - "ports/zephyr", "py", "shared-bindings/util.*", "shared-module", diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst index 9416a9c4f5..bd237fb5da 100644 --- a/docs/supported_ports.rst +++ b/docs/supported_ports.rst @@ -10,5 +10,5 @@ and ESP8266. ../ports/atmel-samd/README ../ports/mimxrt10xx/README ../ports/nrf/README - ../ports/stm32f4/README + ../ports/stm/README ../ports/cxd56/README From f81e2c0487573997e1e76431c91b21b084096d7f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 11 Mar 2020 19:00:49 -0400 Subject: [PATCH 054/919] change CI target --- tools/build_board_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 3c8f44f740..b64f734f88 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -12,7 +12,7 @@ from sh.contrib import git sys.path.append("adabot") import adabot.github_requests as github -SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm32f4", "cxd56", "mimxrt10xx"] +SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx"] BIN = ('bin',) UF2 = ('uf2',) @@ -29,7 +29,7 @@ DOWNLOAD_BASE_URL = "https://downloads.circuitpython.org/bin" extension_by_port = { "nrf": UF2, "atmel-samd": UF2, - "stm32f4": BIN, + "stm": BIN, "cxd56": SPK, "mimxrt10xx": HEX_UF2, } From 197dc344aff695e1f122652b2337b727cb11460a Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Thu, 12 Mar 2020 02:31:13 -0400 Subject: [PATCH 055/919] fix requested changes --- ports/nrf/boards/TG-Watch02A/README.md | 201 ------------------ ports/nrf/boards/TG-Watch02A/mpconfigboard.h | 14 -- ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 26 --- ports/nrf/boards/TG-Watch02A/pins.c | 38 +--- 4 files changed, 2 insertions(+), 277 deletions(-) delete mode 100644 ports/nrf/boards/TG-Watch02A/README.md diff --git a/ports/nrf/boards/TG-Watch02A/README.md b/ports/nrf/boards/TG-Watch02A/README.md deleted file mode 100644 index 8d515010f9..0000000000 --- a/ports/nrf/boards/TG-Watch02A/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# Setup - -The `feather52840` board is currently based on the `PCA10056` development -board from Nordic Semiconductors, since commercial modules are not yet -available for the nRF52840. - -The difference between the `pca10056` and `feather52840` board support -packages is that no bootloader is present on the `pca10056` (a HW debugger -like a Segger J-Link is required to flash firmware images), whereas the -`feather52840` package uses a serial bootloader, with a slightly different -flash layout to account for the bootloader's presence. - -Both targets run on the same hardware and assume the same pinouts. - -The `feather52840` board support package will be updated at a later date -to reflect any pin changes in the final Feather form-factor HW. - -## Installing CircuitPython submodules - -Before you can build, you will need to run the following commands once, which -will install the submodules that are part of the CircuitPython ecosystem, and -build the `mpy-cross` tool: - -``` -$ cd circuitpython -$ git submodule update --init -$ make -C mpy-cross -``` - -You then need to download the SD and Nordic SDK files via: - -> This script relies on `wget`, which must be available from the command line. - -``` -$ cd ports/nrf -$ ./bluetooth/download_ble_stack.sh -``` - -## Installing the Serial Bootloader - -The Adafruit nRF52840 Feather uses a serial bootloader that allows you to -update the core CircuitPython firmware and internal file system contents -using only a serial connection. - -On empty devices, the serial bootloader will need to be flashed once using a -HW debugger such as a Segger J-Link before the serial updater (`adafruit-nrfutil`) can -be used. - -### Install `nrfjprog` - -Before you can install the bootloader, you will first need to install the -`nrfjprog` tool from Nordic Semiconductors for your operating system. The -binary files can be downloaded via the following links: - -- [nRF5x toolset tar for Linux 32-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux32/52619) -- [nRF5x toolset tar for Linux 64-bit v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Linux64/51388) -- [nRF5x toolset tar for OSX v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-OSX/53406) -- [nRF5x toolset installer for Windows v9.7.2](http://www.nordicsemi.com/eng/nordic/Products/nRF52832/nRF5x-Command-Line-Tools-Win32/48768) - -You will then need to add the `nrfjprog` folder to your system `PATH` variable -so that it is available from the command line. The exact process for this is -OS specific, but on a POSIX type system like OS X or Linux, you can -temporarily add the location to your `PATH` environment variables as follows: - -``` -$ export PATH=$PATH:YOURPATHHERE/nRF5x-Command-Line-Tools_9_7_2_OSX/nrfjprog/ -``` - -You can test this by running the following command: - -``` -$ nrfjprog --version -nrfjprog version: 9.7.2 -JLinkARM.dll version: 6.20f -``` - -### Flash the USB CDC Bootloader with 'nrfjprog' - -> This operation only needs to be done once, and only on boards that don't - already have the serial bootloader installed. - -Firstly clone the [Adafruit_nRF52_Bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader.git) and enter its directory - -``` -$ git clone https://github.com/adafruit/Adafruit_nRF52_Bootloader.git -$ cd Adafruit_nRF52_Bootloader -``` - -Once `nrfjprog` is installed and available in `PATH` you can flash your -board with the serial bootloader via the following command: - -``` -make BOARD=feather_nrf52840_express VERSION=latest flash -``` - -This should give you the following (or very similar) output, and you will see -a DFU blinky pattern on one of the board LEDs: - -``` -$ make BOARD=pca10056 VERSION=latest flash -Flashing: bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex -nrfjprog --program bin/pca10056/6.0.0r0/pca10056_bootloader_s140_6.0.0r0.hex --chiperase -f nrf52 --reset -Parsing hex file. -Erasing user available code and UICR flash areas. -Applying system reset. -Checking that the area to write is not protected. -Programing device. -Applying system reset. -Run. -``` - -From this point onward, you can now use a simple serial port for firmware -updates. - -Note: You can specify other version that are available in the directory `Adafruit_nRF52_Bootloader/bin/feather_nrf52840_express/` . The `VERSION=latest` will use the latest bootloader available. - -### IMPORTANT: Disable Mass Storage on PCA10056 J-Link - -The J-Link firmware on the PCA10056 implement USB Mass Storage, but this -causes a known conflict with reliable USB CDC serial port communication. In -order to use the serial bootloader, **you must disable MSD support on the -Segger J-Link**! - -To disable mass storage support, run the `JLinkExe` (or equivalent) command, -and send `MSDDisable`. (You can re-enable MSD support via `MSDEnable`): - -``` -$ JLinkExe -SEGGER J-Link Commander V6.20f (Compiled Oct 13 2017 17:20:01) -DLL version V6.20f, compiled Oct 13 2017 17:19:52 - -Connecting to J-Link via USB...O.K. -Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jul 24 2017 17:30:12 -Hardware version: V1.00 -S/N: 683947110 -VTref = 3.300V - - -Type "connect" to establish a target connection, '?' for help -J-Link>MSDDisable -Probe configured successfully. -J-Link>exit -``` - -## Building and Flashing CircuitPython - -### Installing `adafruit-nrfutil` - -run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Adafruit_nRF52_nrfutil) from PyPi - -``` -$ pip3 install adafruit-nrfutil --user -``` - -### Flashing CircuitPython with USB CDC - -With the serial bootloader present on your board, you first need to force your -board into DFU mode by holding down BUTTON1 and RESETTING the board (with -BUTTON1 still pressed as you come out of reset). - -This will give you a **fast blinky DFU pattern** to indicate you are in DFU -mode. - -You can **build and flash** a CircuitPython binary via the following command: - -``` -$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all dfu-gen dfu-flash -``` - -This should give you the following results: - -``` -$make V=1 BOARD=feather52840 SD=s140 SERIAL=/dev/tty.usbmodem1411 dfu-gen dfu-flash -nrfutil dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application build-feather52840-s140/firmware.hex build-feather52840-s140/dfu-package.zip -Zip created at build-feather52840-s140/dfu-package.zip -nrfutil --verbose dfu serial --package build-feather52840-s140/dfu-package.zip -p /dev/ttyACM1 -b 115200 --singlebank -Upgrading target on /dev/ttyACM1 with DFU package /home/hathach/Dropbox/adafruit/circuitpython/ada_cp/ports/nrf/build-feather52840-s140/dfu-package.zip. Flow control is disabled, Single bank mode -Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 199840 -Sending DFU start packet -Sending DFU init packet -Sending firmware file -######################################################################################################################################################################################################################################################################################################################################################################################################### -Activating new firmware - -DFU upgrade took 8.50606513023s -Device programmed. -``` - -### Flashing CircuitPython with MSC UF2 - -uf2 file is generated last by `all` target - -``` -$ make V=1 SD=s140 SERIAL=/dev/tty.usbmodem1411 BOARD=feather52840 all -Create firmware.uf2 -../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-feather52840-s140/firmware.uf2" "build-feather52840-s140/firmware.hex" -Converting to uf2, output size: 392192, start address: 0x26000 -Wrote 392192 bytes to build-feather52840-s140/firmware.uf2. -``` - -Simply drag and drop firmware.uf2 to the MSC, the nrf52840 will blink fast and reset after done. diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h index 7811bc893a..9b8a31858d 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.h +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.h @@ -27,15 +27,9 @@ #include "nrfx/hal/nrf_gpio.h" - #define MICROPY_HW_BOARD_NAME "TG-Techie's TG-Watch02A" #define MICROPY_HW_MCU_NAME "nRF52840" -//#define FLASH_SIZE (0x100000) -//#define FLASH_PAGE_SIZE (4096) - -//#define MICROPY_HW_NEOPIXEL (&pin_P0_16) - #define MICROPY_HW_LED_STATUS (&pin_P0_07) #if QSPI_FLASH_FILESYSTEM @@ -54,14 +48,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -/* -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) -*/ - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index 2629643071..c75c6dd394 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -9,29 +9,3 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" - - -#USB_PRODUCT = "TG-Watch02" -#USB_MANUFACTURER = "TG-Tech - -#MCU_SERIES = m4 -#MCU_VARIANT = nrf52 -#MCU_SUB_VARIANT = nrf52840 -#MCU_CHIP = nrf52840 -#SD ?= s140 -#SOFTDEV_VERSION ?= 6.1.0 - -#BOOT_SETTING_ADDR = 0xFF000 - -#ifeq ($(SD),) -# LD_FILE = boards/nrf52840_1M_256k.ld -#else -# LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld -# CIRCUITPY_BLEIO = 1 -#endif - -#NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 - -#QSPI_FLASH_FILESYSTEM = 1 -#EXTERNAL_FLASH_DEVICE_COUNT = 1 -#EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/TG-Watch02A/pins.c b/ports/nrf/boards/TG-Watch02A/pins.c index a856b18eee..582d954ecc 100644 --- a/ports/nrf/boards/TG-Watch02A/pins.c +++ b/ports/nrf/boards/TG-Watch02A/pins.c @@ -1,53 +1,19 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_28) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_02) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_03) }, - - { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_31) }, - - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_29) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_29) }, - - { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P1_02) }, - - { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, - { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, - - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_10) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_08) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_07) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_27) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_06) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_08) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_09) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_16) }, + /*Port and bus pins*/ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_15) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_25) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_24) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, - { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, - { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, - - { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + /*TG-Watch02A specific pins*/ //tft / display pins From ead32ea6e63eac21285bc59fc51973a5f1d4a351 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 12 Mar 2020 11:21:32 -0400 Subject: [PATCH 056/919] Comment change for CI --- ports/stm32f4/common-hal/pulseio/PulseIn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.c b/ports/stm32f4/common-hal/pulseio/PulseIn.c index d361a1e9a7..cf484daf9d 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.c +++ b/ports/stm32f4/common-hal/pulseio/PulseIn.c @@ -149,6 +149,7 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { if (common_hal_pulseio_pulsein_deinited(self)) { return; } + //Remove pulsein slot from shared array HAL_NVIC_DisableIRQ(self->irq); _objs[self->pin->number] = NULL; reset_pin_number(self->pin->port, self->pin->number); From bb167f04fa06ca7245c3f173d4ce108e36309c67 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 12 Mar 2020 14:54:43 -0400 Subject: [PATCH 057/919] WIP --- ports/stm/packages/stm32f4/LQFP100.h | 101 +++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 ports/stm/packages/stm32f4/LQFP100.h diff --git a/ports/stm/packages/stm32f4/LQFP100.h b/ports/stm/packages/stm32f4/LQFP100.h new file mode 100644 index 0000000000..3c0e244f99 --- /dev/null +++ b/ports/stm/packages/stm32f4/LQFP100.h @@ -0,0 +1,101 @@ +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Pins 1-25 + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + /* VBAT -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // PC14 OSC32_IN ----------------------------------*/ + // PC15 OSC32_OUT ---------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + // PH0 OSC_IN -------------------------------------*/ + // PH1 OSC_OUT ------------------------------------*/ + // NRST -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + // VSSA -------------------------------------------*/ + // VREF+ ------------------------------------------*/ + // VDDA -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + +// Pins 26-50 + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, +#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, +#endif + + + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file From 0155fab356d5e41681e9d7a18355a70910d5200a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 12 Mar 2020 15:03:21 -0400 Subject: [PATCH 058/919] Revise style on interrupt handler functions --- ports/stm32f4/common-hal/pulseio/PulseIn.c | 50 ++++++---------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/ports/stm32f4/common-hal/pulseio/PulseIn.c b/ports/stm32f4/common-hal/pulseio/PulseIn.c index cf484daf9d..8428a22789 100644 --- a/ports/stm32f4/common-hal/pulseio/PulseIn.c +++ b/ports/stm32f4/common-hal/pulseio/PulseIn.c @@ -43,6 +43,9 @@ static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE]; static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num); static void pulsein_handler(uint8_t num) { + // Interrupt register must be cleared manually + EXTI->PR = 1 << num; + // Grab the current time first. uint32_t current_us; uint64_t current_ms; @@ -260,70 +263,41 @@ static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num) { void EXTI0_IRQHandler(void) { - EXTI->PR = 1 << 0; pulsein_handler(0); } void EXTI1_IRQHandler(void) { - EXTI->PR = 1 << 1; pulsein_handler(1); } void EXTI2_IRQHandler(void) { - EXTI->PR = 1 << 2; pulsein_handler(2); } void EXTI3_IRQHandler(void) { - EXTI->PR = 1 << 3; pulsein_handler(3); } void EXTI4_IRQHandler(void) { - EXTI->PR = 1 << 4; pulsein_handler(4); } + void EXTI9_5_IRQHandler(void) { uint32_t pending = EXTI->PR; - if(pending & (1 << 5)) { - EXTI->PR = 1 << 5; - pulsein_handler(5); - } else if (pending & (1 << 6)) { - EXTI->PR = 1 << 6; - pulsein_handler(6); - } else if (pending & (1 << 7)) { - EXTI->PR = 1 << 7; - pulsein_handler(7); - } else if (pending & (1 << 8)) { - EXTI->PR = 1 << 8; - pulsein_handler(8); - } else if (pending & (1 << 9)) { - EXTI->PR = 1 << 9; - pulsein_handler(9); + for (uint i = 5; i <= 9; i++) { + if(pending & (1 << i)) { + pulsein_handler(i); + } } } void EXTI15_10_IRQHandler(void) { uint32_t pending = EXTI->PR; - if(pending & (1 << 10)) { - EXTI->PR = 1 << 10; - pulsein_handler(10); - } else if (pending & (1 << 11)) { - EXTI->PR = 1 << 11; - pulsein_handler(11); - } else if (pending & (1 << 12)) { - EXTI->PR = 1 << 12; - pulsein_handler(12); - } else if (pending & (1 << 13)) { - EXTI->PR = 1 << 13; - pulsein_handler(13); - } else if (pending & (1 << 14)) { - EXTI->PR = 1 << 14; - pulsein_handler(14); - } else if (pending & (1 << 15)) { - EXTI->PR = 1 << 15; - pulsein_handler(15); + for (uint i = 10; i <= 15; i++) { + if(pending & (1 << i)) { + pulsein_handler(i); + } } } From ef7370d0238fe174d7ebab0a3b110a63ab191eaa Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 12 Mar 2020 17:01:14 -0400 Subject: [PATCH 059/919] Change ST drivers submodule to match TinyUSB --- .gitmodules | 12 +++---- conf.py | 2 +- ports/stm/Makefile | 87 ++++++++++++++++++++++----------------------- ports/stm/st_driver | 1 + ports/stm/stm32f4 | 1 - 5 files changed, 49 insertions(+), 54 deletions(-) create mode 160000 ports/stm/st_driver delete mode 160000 ports/stm/stm32f4 diff --git a/.gitmodules b/.gitmodules index 6300339d16..5c3387077c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,10 +29,6 @@ [submodule "tools/python-semver"] path = tools/python-semver url = https://github.com/k-bx/python-semver.git -[submodule "lib/stm32lib"] - path = lib/stm32lib - url = https://github.com/micropython/stm32lib - branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0 [submodule "atmel-samd/asf4"] path = ports/atmel-samd/asf4 url = https://github.com/adafruit/asf4.git @@ -96,9 +92,6 @@ [submodule "frozen/circuitpython-stage"] path = frozen/circuitpython-stage url = https://github.com/python-ugame/circuitpython-stage.git -[submodule "ports/stm/stm32f4"] - path = ports/stm/stm32f4 - url = https://github.com/adafruit/stm32f4.git [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git @@ -122,4 +115,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI [submodule "frozen/Adafruit_CircuitPython_Requests"] path = frozen/Adafruit_CircuitPython_Requests - url = https://github.com/adafruit/Adafruit_CircuitPython_Requests \ No newline at end of file + url = https://github.com/adafruit/Adafruit_CircuitPython_Requests +[submodule "ports/stm/st_driver"] + path = ports/stm/st_driver + url = https://github.com/hathach/st_driver.git diff --git a/conf.py b/conf.py index 1f9f85b0bc..2ea0e8dc0f 100644 --- a/conf.py +++ b/conf.py @@ -132,7 +132,7 @@ exclude_patterns = ["**/build*", "ports/nrf/nrfx", "ports/nrf/peripherals", "ports/nrf/usb", - "ports/stm/stm32f4", + "ports/stm/st_driver", "ports/stm/peripherals", "ports/stm/ref", "ports/unix", diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 3a6191c851..f8c05fd802 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -66,10 +66,10 @@ INC += -I. INC += -I../.. INC += -I$(BUILD) INC += -I$(BUILD)/genhdr -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc -INC += -I./stm32f4/STM32F4xx_HAL_Driver/Inc/Legacy -INC += -I./stm32f4/CMSIS/Device/ST/STM32F4xx/Include -INC += -I./stm32f4/CMSIS/Include +INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc +INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc/Legacy +INC += -I./st_driver/CMSIS/Device/ST/STM32F4xx/Include +INC += -I./st_driver/CMSIS/Include INC += -I./boards INC += -I./boards/$(BOARD) INC += -I./peripherals @@ -147,46 +147,45 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD ###################################### SRC_STM32 = \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ - stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ system_stm32f4xx.c diff --git a/ports/stm/st_driver b/ports/stm/st_driver new file mode 160000 index 0000000000..3fc2e0f3db --- /dev/null +++ b/ports/stm/st_driver @@ -0,0 +1 @@ +Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 diff --git a/ports/stm/stm32f4 b/ports/stm/stm32f4 deleted file mode 160000 index 89a356f0b4..0000000000 --- a/ports/stm/stm32f4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 89a356f0b44883d55c45a5d22940777a44a2b881 From 7907ef597927d730b5d8ba5d8df3dbfcc38cb5c2 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Thu, 12 Mar 2020 20:30:45 -0400 Subject: [PATCH 060/919] add TG-Watch02A to build workflow --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32c949a3a8..6da2ac0959 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -228,6 +228,7 @@ jobs: - "stringcar_m0_express" - "teensy40" - "teknikio_bluebird" + - "TG-Watch02A" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" From 137d5c34fa5263ff7e52e8e471b37d2422e6e96b Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Thu, 12 Mar 2020 20:39:42 -0400 Subject: [PATCH 061/919] fix board sorting (due to T being before a anf t) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6da2ac0959..7ff20dc7a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,6 +122,7 @@ jobs: fail-fast: false matrix: board: + - "TG-Watch02A" - "aramcon_badge_2019" - "arduino_mkr1300" - "arduino_mkrzero" @@ -228,7 +229,6 @@ jobs: - "stringcar_m0_express" - "teensy40" - "teknikio_bluebird" - - "TG-Watch02A" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" From 6f60afe8c521011d1a2d34a2632295b483a8cee3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 5 Mar 2020 17:14:54 -0800 Subject: [PATCH 062/919] First try at lowering the power consumption --- ports/nrf/Makefile | 2 - ports/nrf/common-hal/_bleio/Adapter.c | 1 - .../common-hal/_bleio/CharacteristicBuffer.c | 2 - ports/nrf/common-hal/_bleio/PacketBuffer.c | 2 - ports/nrf/common-hal/busio/UART.c | 1 - ports/nrf/common-hal/displayio/ParallelBus.c | 2 - .../nrf/common-hal/neopixel_write/__init__.c | 18 ++--- ports/nrf/common-hal/pulseio/PulseIn.c | 8 +- ports/nrf/common-hal/rtc/RTC.c | 44 ++--------- ports/nrf/common-hal/time/__init__.c | 9 +-- ports/nrf/mphalport.c | 52 ------------- ports/nrf/supervisor/port.c | 76 ++++++++++++++++--- ports/nrf/supervisor/usb.c | 1 - ports/nrf/tick.c | 67 ---------------- ports/nrf/tick.h | 44 ----------- shared-module/displayio/Display.c | 2 - shared-module/displayio/EPaperDisplay.c | 2 - shared-module/displayio/FourWire.c | 2 - shared-module/displayio/I2CDisplay.c | 2 - shared-module/displayio/display_core.c | 2 - shared-module/usb_hid/Device.c | 2 +- supervisor/port.h | 16 ++++ supervisor/shared/tick.c | 50 ++++++++---- supervisor/shared/usb/usb.c | 1 - 24 files changed, 143 insertions(+), 265 deletions(-) delete mode 100644 ports/nrf/mphalport.c delete mode 100644 ports/nrf/tick.c delete mode 100644 ports/nrf/tick.h diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 89d88ce366..7d91b95f47 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -148,8 +148,6 @@ endif SRC_C += \ background.c \ fatfs_port.c \ - mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ device/$(MCU_VARIANT)/startup_$(MCU_SUB_VARIANT).c \ diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 53015364a6..f3877fa4c5 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -36,7 +36,6 @@ #include "nrfx_power.h" #include "nrf_nvic.h" #include "nrf_sdm.h" -#include "tick.h" #include "py/gc.h" #include "py/objstr.h" #include "py/runtime.h" diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index 9f9b453de4..c562d29e0e 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -35,8 +35,6 @@ #include "py/runtime.h" #include "py/stream.h" -#include "tick.h" - #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" #include "supervisor/shared/tick.h" diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 27dacb4938..26e1aec635 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -35,8 +35,6 @@ #include "py/runtime.h" #include "py/stream.h" -#include "tick.h" - #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/PacketBuffer.h" diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 14fa363749..d83e2292b5 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -35,7 +35,6 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -#include "tick.h" #include "nrfx_uarte.h" #include diff --git a/ports/nrf/common-hal/displayio/ParallelBus.c b/ports/nrf/common-hal/displayio/ParallelBus.c index be4b28a6e6..f13e03163f 100644 --- a/ports/nrf/common-hal/displayio/ParallelBus.c +++ b/ports/nrf/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c index 0a4036aae3..4d961621e3 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.c +++ b/ports/nrf/common-hal/neopixel_write/__init__.c @@ -29,8 +29,6 @@ #include "shared-bindings/neopixel_write/__init__.h" #include "nrf_pwm.h" -#include "tick.h" - // https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.cpp // [[[Begin of the Neopixel NRF52 EasyDMA implementation // by the Hackerspace San Salvador]]] @@ -176,7 +174,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } // Wait to make sure we don't append onto the last transmission. - wait_until(next_start_tick_ms, next_start_tick_us); + // wait_until(next_start_tick_ms, next_start_tick_us); // Use the identified device to choose the implementation // If a PWM device is available and we have a buffer, use DMA. @@ -323,11 +321,11 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + // current_tick(&next_start_tick_ms, &next_start_tick_us); + // if (next_start_tick_us < 100) { + // next_start_tick_ms += 1; + // next_start_tick_us = 100 - next_start_tick_us; + // } else { + // next_start_tick_us -= 100; + // } } diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index b47cc6273b..9316121ba8 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -36,7 +36,6 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" -#include "tick.h" #include "nrfx_gpiote.h" // obj array to map pin -> self since nrfx hide the mapping @@ -55,9 +54,10 @@ static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) { static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint32_t current_us = 0; + uint64_t current_ms = 0; + // FIXME! We need a higher resolution clock to measure against. + //current_tick(¤t_ms, ¤t_us); // current_tick gives us the remaining us until the next tick but we want the number since the last ms. current_us = 1000 - current_us; diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index a8ea366887..9ffd2e8a3b 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -30,54 +30,26 @@ #include "py/runtime.h" #include "lib/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" #include "nrfx_rtc.h" #include "nrf_clock.h" -// We clock the RTC very slowly (8Hz) so that it won't overflow often. -// But the counter is only 24 bits, so overflow is about every 24 days ... -// For testing, set this to 32768 and it'll overflow every few minutes - -#define RTC_CLOCK_HZ (8) - -volatile static uint32_t rtc_offset = 0; - -const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2); - -const nrfx_rtc_config_t rtc_config = { - .prescaler = RTC_FREQ_TO_PRESCALER(RTC_CLOCK_HZ), - .reliable = 0, - .tick_latency = 0, - .interrupt_priority = 6 -}; - -void rtc_handler(nrfx_rtc_int_type_t int_type) { - if (int_type == NRFX_RTC_INT_OVERFLOW) { - rtc_offset += (1L<<24) / RTC_CLOCK_HZ; - } -} - -void rtc_init(void) { - if (!nrf_clock_lf_is_running(NRF_CLOCK)) { - nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); - } - nrfx_rtc_counter_clear(&rtc_instance); - nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); - nrfx_rtc_enable(&rtc_instance); - nrfx_rtc_overflow_enable(&rtc_instance, 1); -} +// This is the time in seconds since 2000 that the RTC was started. +static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - uint32_t t = rtc_offset + (nrfx_rtc_counter_get(&rtc_instance) / RTC_CLOCK_HZ ); - timeutils_seconds_since_2000_to_struct_time(t, tm); + uint64_t ticks_s = port_get_raw_ticks() / 1024; + timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - rtc_offset = timeutils_seconds_since_2000( + uint64_t ticks_s = port_get_raw_ticks() / 1024; + uint32_t epoch_s = timeutils_seconds_since_2000( tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec ); - nrfx_rtc_counter_clear(&rtc_instance); + rtc_offset = epoch_s - ticks_s; } int common_hal_rtc_get_calibration(void) { diff --git a/ports/nrf/common-hal/time/__init__.c b/ports/nrf/common-hal/time/__init__.c index c85077868a..3ec5cf6835 100644 --- a/ports/nrf/common-hal/time/__init__.c +++ b/ports/nrf/common-hal/time/__init__.c @@ -26,16 +26,15 @@ #include "py/mphal.h" -#include "tick.h" - uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); } uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); + uint64_t ms = 0; + uint32_t us_until_ms = 0; + // FIXME! Re-implement this. + // current_tick(&ms, &us_until_ms); // us counts down. return 1000 * (ms * 1000 + (1000 - us_until_ms)); } diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c deleted file mode 100644 index 3885d5a826..0000000000 --- a/ports/nrf/mphalport.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Dan Halbert for Adafruit Industries - * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2015 Glenn Ruben Bakke - * - * 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 - -#include "py/mphal.h" -#include "py/mpstate.h" -#include "py/gc.h" -#include "supervisor/shared/tick.h" - -/*------------------------------------------------------------------*/ -/* delay - *------------------------------------------------------------------*/ -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index cbe0cec54d..85978cc071 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -28,8 +28,10 @@ #include "supervisor/port.h" #include "boards/board.h" +#include "nrfx/hal/nrf_clock.h" #include "nrfx/hal/nrf_power.h" #include "nrfx/drivers/include/nrfx_power.h" +#include "nrfx/drivers/include/nrfx_rtc.h" #include "nrf/cache.h" #include "nrf/clocks.h" @@ -48,7 +50,6 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" -#include "tick.h" #include "shared-bindings/rtc/__init__.h" @@ -64,6 +65,37 @@ static void power_warning_handler(void) { reset_into_safe_mode(BROWNOUT); } +const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2); + +const nrfx_rtc_config_t rtc_config = { + .prescaler = RTC_FREQ_TO_PRESCALER(1024), + .reliable = 0, + .tick_latency = 0, + .interrupt_priority = 6 +}; + +static volatile uint64_t overflowed_ticks = 0; + +void rtc_handler(nrfx_rtc_int_type_t int_type) { + if (int_type == NRFX_RTC_INT_OVERFLOW) { + overflowed_ticks += (1L<<24); + } + // Do things common to all ports when the tick occurs + if (int_type == NRFX_RTC_INT_TICK) { + supervisor_tick(); + } +} + +void tick_init(void) { + if (!nrf_clock_lf_is_running(NRF_CLOCK)) { + nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); + } + nrfx_rtc_counter_clear(&rtc_instance); + nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); + nrfx_rtc_enable(&rtc_instance); + nrfx_rtc_overflow_enable(&rtc_instance, true); +} + safe_mode_t port_init(void) { nrf_peripherals_clocks_init(); @@ -89,10 +121,6 @@ safe_mode_t port_init(void) { analogin_init(); #endif - #if CIRCUITPY_RTC - rtc_init(); - #endif - return NO_SAFE_MODE; } @@ -123,10 +151,6 @@ void reset_port(void) { timers_reset(); -#if CIRCUITPY_RTC - rtc_reset(); -#endif - #if CIRCUITPY_BLEIO bleio_reset(); #endif @@ -171,6 +195,40 @@ uint32_t port_get_saved_word(void) { return _ebss; } +uint64_t port_get_raw_ticks(void) { + return overflowed_ticks + nrfx_rtc_counter_get(&rtc_instance); +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + nrfx_rtc_tick_enable(&rtc_instance, true); +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + nrfx_rtc_tick_disable(&rtc_instance); +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = nrfx_rtc_counter_get(&rtc_instance); + uint32_t diff = 3; + if (ticks > diff) { + diff = ticks; + } + nrfx_rtc_cc_set(&rtc_instance, 0, current_ticks + diff, true); +} + +void port_sleep_until_interrupt(void) { + // Clear the FPU interrupt because it can prevent us from sleeping. + if (NVIC_GetPendingIRQ(FPU_IRQn)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + NVIC_ClearPendingIRQ(FPU_IRQn); + } + sd_app_evt_wait(); +} + + void HardFault_Handler(void) { reset_into_safe_mode(HARD_CRASH); while (true) { diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index bb9d78101c..364d02c735 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -26,7 +26,6 @@ #include "nrfx.h" #include "nrfx_power.h" -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c deleted file mode 100644 index ac825a7f1f..0000000000 --- a/ports/nrf/tick.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "supervisor/shared/tick.h" -#include "shared-module/gamepad/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" -#include "nrf.h" - -void SysTick_Handler(void) { - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = supervisor_ticks_ms64(); - while (us > 1000) { - while (supervisor_ticks_ms64() == start_ms) {} - us -= us_between_ticks; - start_ms = supervisor_ticks_ms64(); - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - *ms = supervisor_ticks_ms64(); - *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/nrf/tick.h b/ports/nrf/tick.h deleted file mode 100644 index d638ad0251..0000000000 --- a/ports/nrf/tick.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_NRF_TICK_H -#define MICROPY_INCLUDED_NRF_TICK_H - -#include "py/mpconfig.h" - -#include - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_NRF_TICK_H diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 299c8ad359..add42f5997 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -41,8 +41,6 @@ #include #include -#include "tick.h" - void common_hal_displayio_display_construct(displayio_display_obj_t* self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 91d4bb7f9f..f4f79ea5bb 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -42,8 +42,6 @@ #include #include -#include "tick.h" - void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self, mp_obj_t bus, uint8_t* start_sequence, uint16_t start_sequence_len, uint8_t* stop_sequence, uint16_t stop_sequence_len, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 256c29642d..c98b2d6702 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -36,8 +36,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" -#include "tick.h" - void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate) { diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 280476f195..0c8f2e69a9 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -38,8 +38,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" -#include "tick.h" - void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t* self, busio_i2c_obj_t* i2c, uint16_t device_address, const mcu_pin_obj_t* reset) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 120b70f76a..bae2a55596 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -40,8 +40,6 @@ #include #include -#include "tick.h" - void displayio_display_core_construct(displayio_display_core_t* self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte) { diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 8744f2ed31..8e9df6f040 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -25,7 +25,7 @@ */ #include -#include "tick.h" + #include "py/runtime.h" #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/Device.h" diff --git a/supervisor/port.h b/supervisor/port.h index b289583dd6..dd7093f436 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -70,4 +70,20 @@ uint32_t *port_heap_get_top(void); void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); +// Get the raw tick count since start up. A tick is 1/32768 of a second, a common low frequency +// clock rate. +uint64_t port_get_raw_ticks(void); + +// Enable 1/1024 second tick. +void port_enable_tick(void); + +// Disable 1/1024 second tick. +void port_disable_tick(void); + +// Wake the CPU after the given number of ticks or sooner. +void port_interrupt_after_ticks(uint32_t ticks); + +// Sleep the CPU until an interrupt is received. +void port_sleep_until_interrupt(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 5668f8fa10..b8776f5633 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -26,12 +26,13 @@ #include "supervisor/shared/tick.h" +#include "py/mpstate.h" #include "supervisor/linker.h" #include "supervisor/filesystem.h" +#include "supervisor/port.h" #include "supervisor/shared/autoreload.h" -static volatile uint64_t PLACE_IN_DTCM_BSS(ticks_ms); -static volatile uint32_t PLACE_IN_DTCM_BSS(background_ticks_ms32); +static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #if CIRCUITPY_GAMEPAD #include "shared-module/gamepad/__init__.h" @@ -44,9 +45,6 @@ static volatile uint32_t PLACE_IN_DTCM_BSS(background_ticks_ms32); #include "shared-bindings/microcontroller/__init__.h" void supervisor_tick(void) { - - ticks_ms ++; - #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif @@ -54,7 +52,7 @@ void supervisor_tick(void) { autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { + if (!(port_get_raw_ticks() & CIRCUITPY_GAMEPAD_TICKS)) { #if CIRCUITPY_GAMEPAD gamepad_tick(); #endif @@ -68,29 +66,51 @@ void supervisor_tick(void) { uint64_t supervisor_ticks_ms64() { uint64_t result; common_hal_mcu_disable_interrupts(); - result = ticks_ms; + result = port_get_raw_ticks(); common_hal_mcu_enable_interrupts(); + result = result * 1000 / 1024; return result; } uint32_t supervisor_ticks_ms32() { - return ticks_ms; + return supervisor_ticks_ms64(); } extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { - uint32_t now32 = ticks_ms; + // uint64_t now = port_get_raw_ticks(); - if (now32 == background_ticks_ms32) { - return; - } - background_ticks_ms32 = now32; + // if (now == background_ticks) { + // return; + // } + // background_ticks = now; run_background_tasks(); } void supervisor_fake_tick() { - uint32_t now32 = ticks_ms; - background_ticks_ms32 = (now32 - 1); + uint32_t now = port_get_raw_ticks(); + background_ticks = (now - 1); } + +void mp_hal_delay_ms(mp_uint_t delay) { + uint64_t start_tick = port_get_raw_ticks(); + // Adjust the delay to ticks vs ms. + delay = delay * 1024 / 1000; + uint64_t duration = 0; + port_interrupt_after_ticks(delay); + while (duration < delay) { + RUN_BACKGROUND_TASKS; + // Check to see if we've been CTRL-Ced by autoreload or the user. + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + break; + } + // Sleep until an interrupt happens. + port_sleep_until_interrupt(); + // asm("bkpt"); + duration = (port_get_raw_ticks() - start_tick); + } +} + diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index a0178528d8..774055a82a 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include "tick.h" #include "py/objstr.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-module/usb_midi/__init__.h" From 418333979ae007b28855079c64ee3c65f76ecbc7 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Mar 2020 18:15:16 -0800 Subject: [PATCH 063/919] Fix autoreload, neopixel, monotonic_ns and sleep w/o SD --- main.c | 2 +- .../nrf/common-hal/neopixel_write/__init__.c | 17 +++------ ports/nrf/common-hal/rtc/RTC.c | 4 +- ports/nrf/common-hal/time/__init__.c | 12 +++--- ports/nrf/supervisor/port.c | 32 ++++++++++++---- supervisor/port.h | 10 +++-- supervisor/shared/autoreload.c | 5 +++ supervisor/shared/tick.c | 37 ++++++++++++++----- supervisor/shared/tick.h | 3 ++ 9 files changed, 80 insertions(+), 42 deletions(-) diff --git a/main.c b/main.c index 52870cc8e2..c60cded165 100755 --- a/main.c +++ b/main.c @@ -428,7 +428,7 @@ int __attribute__((used)) main(void) { filesystem_init(safe_mode == NO_SAFE_MODE, false); // displays init after filesystem, since they could share the flash SPI - board_init(); + board_init(); // Reset everything and prep MicroPython to run boot.py. reset_port(); diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c index 4d961621e3..8062937f4b 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.c +++ b/ports/nrf/common-hal/neopixel_write/__init__.c @@ -27,6 +27,7 @@ #include "py/mphal.h" #include "py/mpstate.h" #include "shared-bindings/neopixel_write/__init__.h" +#include "supervisor/port.h" #include "nrf_pwm.h" // https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.cpp @@ -103,8 +104,7 @@ void neopixel_write_reset(void) { pixels_pattern_heap_size = 0; } -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { // To support both the SoftDevice + Neopixels we use the EasyDMA @@ -173,8 +173,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } } - // Wait to make sure we don't append onto the last transmission. - // wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} // Use the identified device to choose the implementation // If a PWM device is available and we have a buffer, use DMA. @@ -321,11 +322,5 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } // Update the next start. - // current_tick(&next_start_tick_ms, &next_start_tick_us); - // if (next_start_tick_us < 100) { - // next_start_tick_ms += 1; - // next_start_tick_us = 100 - next_start_tick_us; - // } else { - // next_start_tick_us -= 100; - // } + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; } diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 9ffd2e8a3b..6b582ef26f 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -40,12 +40,12 @@ static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - uint64_t ticks_s = port_get_raw_ticks() / 1024; + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - uint64_t ticks_s = port_get_raw_ticks() / 1024; + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; uint32_t epoch_s = timeutils_seconds_since_2000( tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec ); diff --git a/ports/nrf/common-hal/time/__init__.c b/ports/nrf/common-hal/time/__init__.c index 3ec5cf6835..21fe98926a 100644 --- a/ports/nrf/common-hal/time/__init__.c +++ b/ports/nrf/common-hal/time/__init__.c @@ -25,18 +25,18 @@ */ #include "py/mphal.h" +#include "supervisor/port.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); } uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms = 0; - uint32_t us_until_ms = 0; - // FIXME! Re-implement this. - // current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); + uint8_t subticks = 0; + uint64_t ticks = port_get_raw_ticks(&subticks); + // A tick is 976562.5 nanoseconds so multiply it by the base and add half instead of doing float + // math. + return 976562 * ticks + ticks / 2 + 30518 * subticks; } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 85978cc071..2a46040911 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -68,7 +68,7 @@ static void power_warning_handler(void) { const nrfx_rtc_t rtc_instance = NRFX_RTC_INSTANCE(2); const nrfx_rtc_config_t rtc_config = { - .prescaler = RTC_FREQ_TO_PRESCALER(1024), + .prescaler = RTC_FREQ_TO_PRESCALER(0x8000), .reliable = 0, .tick_latency = 0, .interrupt_priority = 6 @@ -79,10 +79,11 @@ static volatile uint64_t overflowed_ticks = 0; void rtc_handler(nrfx_rtc_int_type_t int_type) { if (int_type == NRFX_RTC_INT_OVERFLOW) { overflowed_ticks += (1L<<24); - } - // Do things common to all ports when the tick occurs - if (int_type == NRFX_RTC_INT_TICK) { + } else if (int_type == NRFX_RTC_INT_TICK && nrfx_rtc_counter_get(&rtc_instance) % 32 == 0) { + // Do things common to all ports when the tick occurs supervisor_tick(); + } else if (int_type == NRFX_RTC_INT_COMPARE0) { + nrfx_rtc_cc_set(&rtc_instance, 0, 0, false); } } @@ -195,8 +196,12 @@ uint32_t port_get_saved_word(void) { return _ebss; } -uint64_t port_get_raw_ticks(void) { - return overflowed_ticks + nrfx_rtc_counter_get(&rtc_instance); +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t rtc = nrfx_rtc_counter_get(&rtc_instance); + if (subticks != NULL) { + *subticks = (rtc % 32); + } + return overflowed_ticks + rtc / 32; } // Enable 1/1024 second tick. @@ -213,7 +218,10 @@ void port_interrupt_after_ticks(uint32_t ticks) { uint32_t current_ticks = nrfx_rtc_counter_get(&rtc_instance); uint32_t diff = 3; if (ticks > diff) { - diff = ticks; + diff = ticks * 32; + } + if (diff > 0xffffff) { + diff = 0xffffff; } nrfx_rtc_cc_set(&rtc_instance, 0, current_ticks + diff, true); } @@ -225,7 +233,15 @@ void port_sleep_until_interrupt(void) { (void) __get_FPSCR(); NVIC_ClearPendingIRQ(FPU_IRQn); } - sd_app_evt_wait(); + uint8_t sd_enabled; + + sd_softdevice_is_enabled(&sd_enabled); + if (sd_enabled) { + sd_app_evt_wait(); + } else { + // Call wait for interrupt ourselves if the SD isn't enabled. + __WFI(); + } } diff --git a/supervisor/port.h b/supervisor/port.h index dd7093f436..ccbb314adf 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -70,9 +70,10 @@ uint32_t *port_heap_get_top(void); void port_set_saved_word(uint32_t); uint32_t port_get_saved_word(void); -// Get the raw tick count since start up. A tick is 1/32768 of a second, a common low frequency -// clock rate. -uint64_t port_get_raw_ticks(void); +// Get the raw tick count since start up. A tick is 1/1024 of a second, a common low frequency +// clock rate. If subticks is not NULL then the port will fill in the number of subticks where each +// tick is 32 subticks (for a resolution of 1/32768 or 30.5ish microseconds.) +uint64_t port_get_raw_ticks(uint8_t* subticks); // Enable 1/1024 second tick. void port_enable_tick(void); @@ -80,7 +81,8 @@ void port_enable_tick(void); // Disable 1/1024 second tick. void port_disable_tick(void); -// Wake the CPU after the given number of ticks or sooner. +// Wake the CPU after the given number of ticks or sooner. Only the last call to this will apply. +// Only the common sleep routine should use it. void port_interrupt_after_ticks(uint32_t ticks); // Sleep the CPU until an interrupt is received. diff --git a/supervisor/shared/autoreload.c b/supervisor/shared/autoreload.c index a6212c1a9b..bc818e6b08 100644 --- a/supervisor/shared/autoreload.c +++ b/supervisor/shared/autoreload.c @@ -28,6 +28,7 @@ #include "py/mphal.h" #include "py/reload.h" +#include "supervisor/shared/tick.h" static volatile uint32_t autoreload_delay_ms = 0; static bool autoreload_enabled = false; @@ -43,6 +44,7 @@ inline void autoreload_tick() { !autoreload_suspended && !reload_requested) { mp_raise_reload_exception(); reload_requested = true; + supervisor_disable_tick(); } autoreload_delay_ms--; } @@ -69,6 +71,9 @@ inline bool autoreload_is_enabled() { } void autoreload_start() { + if (autoreload_delay_ms == 0) { + supervisor_enable_tick(); + } autoreload_delay_ms = CIRCUITPY_AUTORELOAD_DELAY_MS; } diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index b8776f5633..20ca3abb7b 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -52,7 +52,7 @@ void supervisor_tick(void) { autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(port_get_raw_ticks() & CIRCUITPY_GAMEPAD_TICKS)) { + if (!(port_get_raw_ticks(NULL) & CIRCUITPY_GAMEPAD_TICKS)) { #if CIRCUITPY_GAMEPAD gamepad_tick(); #endif @@ -66,7 +66,7 @@ void supervisor_tick(void) { uint64_t supervisor_ticks_ms64() { uint64_t result; common_hal_mcu_disable_interrupts(); - result = port_get_raw_ticks(); + result = port_get_raw_ticks(NULL); common_hal_mcu_enable_interrupts(); result = result * 1000 / 1024; return result; @@ -79,23 +79,24 @@ uint32_t supervisor_ticks_ms32() { extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { - // uint64_t now = port_get_raw_ticks(); + uint8_t subticks; + uint64_t now = port_get_raw_ticks(&subticks); - // if (now == background_ticks) { - // return; - // } - // background_ticks = now; + if (now == background_ticks && (subticks & 0x3) != 0) { + return; + } + background_ticks = now; run_background_tasks(); } void supervisor_fake_tick() { - uint32_t now = port_get_raw_ticks(); + uint32_t now = port_get_raw_ticks(NULL); background_ticks = (now - 1); } void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = port_get_raw_ticks(); + uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. delay = delay * 1024 / 1000; uint64_t duration = 0; @@ -110,7 +111,23 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Sleep until an interrupt happens. port_sleep_until_interrupt(); // asm("bkpt"); - duration = (port_get_raw_ticks() - start_tick); + duration = (port_get_raw_ticks(NULL) - start_tick); + port_interrupt_after_ticks(duration); + } +} + +volatile size_t tick_enable_count = 0; +extern void supervisor_enable_tick(void) { + if (tick_enable_count == 0) { + port_enable_tick(); + } + tick_enable_count++; +} + +extern void supervisor_disable_tick(void) { + tick_enable_count--; + if (tick_enable_count == 0) { + port_disable_tick(); } } diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index 7ce8281ba9..e7e8080581 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -64,4 +64,7 @@ extern uint64_t supervisor_ticks_ms64(void); */ extern void supervisor_run_background_if_tick(void); +extern void supervisor_enable_tick(void); +extern void supervisor_disable_tick(void); + #endif From ed5cdd7e0970b904ed001deabe051c48ac32b1d3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 Mar 2020 15:05:42 -0700 Subject: [PATCH 064/919] Hopefully fix flash flush and hopefully audio as well. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 7 +++- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 13 ++++++++ ports/nrf/supervisor/internal_flash.c | 2 +- supervisor/flash.h | 2 +- .../shared/external_flash/external_flash.c | 5 +-- .../shared/external_flash/external_flash.h | 2 ++ supervisor/shared/flash.c | 19 +++++++++++ supervisor/shared/internal_flash.h | 33 +++++++++++++++++++ 8 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 supervisor/shared/internal_flash.h diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index ead92b0000..65c153e1a0 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -283,6 +283,9 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, i2s_buffer_fill(self); NRF_I2S->RXTXD.MAXCNT = self->buffer_length / 4; + // Turn on the interrupt to the NVIC but not within the NVIC itself. This will wake the CPU and + // keep it awake until it is serviced without triggering an interrupt handler. + NRF_I2S->INTENSET = I2S_INTENSET_TXPTRUPD_Msk; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Enabled; NRF_I2S->TASKS_START = 1; @@ -305,6 +308,7 @@ bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t* self) { void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { NRF_I2S->TASKS_STOP = 1; self->stopping = true; + NRF_I2S->INTENCLR = I2S_INTENSET_TXPTRUPD_Msk; } bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { @@ -316,7 +320,7 @@ bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { } void i2s_background(void) { - if (NRF_I2S->EVENTS_TXPTRUPD) { + if (NVIC_GetPendingIRQ(I2S_IRQn) && NRF_I2S->EVENTS_TXPTRUPD) { NRF_I2S->EVENTS_TXPTRUPD = 0; if (instance) { i2s_buffer_fill(instance); @@ -328,6 +332,7 @@ void i2s_background(void) { void i2s_reset(void) { NRF_I2S->TASKS_STOP = 1; + NRF_I2S->INTENCLR = I2S_INTENSET_TXPTRUPD_Msk; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled; NRF_I2S->PSEL.MCK = 0xFFFFFFFF; NRF_I2S->PSEL.SCK = 0xFFFFFFFF; diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 7b99901d5c..239b491351 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -72,6 +72,8 @@ STATIC void activate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { } } STATIC void deactivate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { + // Turn off the interrupts to the CPU. + self->pwm->INTENCLR = PWM_INTENSET_SEQSTARTED0_Msk | PWM_INTENSET_SEQSTARTED1_Msk; for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (active_audio[i] == self) { active_audio[i] = NULL; @@ -149,6 +151,14 @@ STATIC void audiopwmout_background_obj(audiopwmio_pwmaudioout_obj_t *self) { } void audiopwmout_background() { + // Check the NVIC first because it is part of the CPU and fast to read. + if (!NVIC_GetPendingIRQ(PWM0_IRQn) && + !NVIC_GetPendingIRQ(PWM1_IRQn) && + !NVIC_GetPendingIRQ(PWM2_IRQn) && + !NVIC_GetPendingIRQ(PWM3_IRQn)) { + return; + } + // Check our objects because the PWM could be active for some other reason. for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (!active_audio[i]) continue; audiopwmout_background_obj(active_audio[i]); @@ -260,6 +270,9 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, self->pwm->EVENTS_SEQEND[0] = 0; self->pwm->EVENTS_SEQEND[1] = 0; self->pwm->EVENTS_STOPPED = 0; + // Enable the SEQSTARTED interrupts so that they wake the CPU and keep it awake until serviced. + // We don't enable them in the NVIC because we don't actually want an interrupt routine to run. + self->pwm->INTENSET = PWM_INTENSET_SEQSTARTED0_Msk | PWM_INTENSET_SEQSTARTED1_Msk; self->pwm->TASKS_SEQSTART[0] = 1; self->playing = true; self->paused = false; diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index a44f047ff6..737bab2036 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE ; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (_flash_page_addr == NO_CACHE) return; // Skip if data is the same diff --git a/supervisor/flash.h b/supervisor/flash.h index 0a124353e6..a8a77bf040 100644 --- a/supervisor/flash.h +++ b/supervisor/flash.h @@ -34,7 +34,7 @@ #ifdef EXTERNAL_FLASH_DEVICE_COUNT #include "supervisor/shared/external_flash/external_flash.h" #else -#include "supervisor/internal_flash.h" +#include "supervisor/shared/internal_flash.h" #endif void supervisor_flash_init(void); diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 9d38c07d89..69eeec43d1 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -23,11 +23,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "external_flash.h" +#include "supervisor/shared/external_flash/external_flash.h" #include #include +#include "supervisor/flash.h" #include "supervisor/spi_flash_api.h" #include "supervisor/shared/external_flash/common_commands.h" #include "extmod/vfs.h" @@ -451,7 +452,7 @@ static void spi_flash_flush_keep_cache(bool keep_cache) { #endif } -void supervisor_flash_flush(void) { +void supervisor_external_flash_flush(void) { spi_flash_flush_keep_cache(true); } diff --git a/supervisor/shared/external_flash/external_flash.h b/supervisor/shared/external_flash/external_flash.h index 72b619a2a8..db5c677eb0 100644 --- a/supervisor/shared/external_flash/external_flash.h +++ b/supervisor/shared/external_flash/external_flash.h @@ -45,4 +45,6 @@ #define SPI_FLASH_MAX_BAUDRATE 8000000 #endif +void supervisor_external_flash_flush(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_EXTERNAL_FLASH_EXTERNAL_FLASH_H diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 6b1f24b4bc..e0bf83490c 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -28,6 +28,7 @@ #include "extmod/vfs_fat.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/shared/tick.h" #define VFS_INDEX 0 @@ -110,6 +111,8 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks); } +volatile bool filesystem_dirty; + mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { if (num_blocks > 1) { @@ -118,10 +121,26 @@ mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t nu // can't write MBR, but pretend we did return 0; } else { + if (!filesystem_dirty) { + // Turn on ticks so that we can flush after a period of time elapses. + supervisor_enable_tick(); + filesystem_dirty = true; + } return supervisor_flash_write_blocks(src, block_num - PART1_START_BLOCK, num_blocks); } } +void supervisor_flash_flush(void) { + #if INTERNAL_FLASH_FILESYSTEM + port_internal_flash_flush(); + #else + supervisor_external_flash_flush(); + #endif + // Turn off ticks now that our filesystem has been flushed. + supervisor_disable_tick(); + filesystem_dirty = false; +} + STATIC mp_obj_t supervisor_flash_obj_readblocks(mp_obj_t self, mp_obj_t block_num, mp_obj_t buf) { mp_buffer_info_t bufinfo; mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_WRITE); diff --git a/supervisor/shared/internal_flash.h b/supervisor/shared/internal_flash.h new file mode 100644 index 0000000000..80257a2901 --- /dev/null +++ b/supervisor/shared/internal_flash.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft, for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H + +#include "supervisor/internal_flash.h" // This is per-port. + +void port_internal_flash_flush(void); + +#endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_INTERNAL_FLASH_H From 00d5f63e7cd3e489d3291ee7e90ab4ad46110b62 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 Mar 2020 16:16:58 -0700 Subject: [PATCH 065/919] Hopefully fix PulseIn --- ports/nrf/common-hal/pulseio/PulseIn.c | 87 +++++++++++++++++++------- ports/nrf/common-hal/pulseio/PulseIn.h | 4 +- 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 9316121ba8..a7d0fb28e7 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -29,6 +29,7 @@ #include #include +#include "nrf/timers.h" #include "py/mpconfig.h" #include "py/gc.h" #include "py/runtime.h" @@ -41,6 +42,20 @@ // obj array to map pin -> self since nrfx hide the mapping static pulseio_pulsein_obj_t* _objs[GPIOTE_CH_NUM]; +// A single timer is shared amongst all PulseIn objects as a common high speed clock reference. +static uint8_t refcount = 0; +static nrfx_timer_t *timer = NULL; + +static uint32_t overflow_count = 0; + +static void timer_overflow_event_handler(nrf_timer_event_t event_type, void *p_context) { + if (event_type != NRF_TIMER_EVENT_COMPARE0) { + // Other event. + return; + } + overflow_count++; +} + // return index of the object in array static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) { for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) { @@ -54,13 +69,8 @@ static int _find_pulsein_obj(pulseio_pulsein_obj_t* obj) { static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { // Grab the current time first. - uint32_t current_us = 0; - uint64_t current_ms = 0; - // FIXME! We need a higher resolution clock to measure against. - //current_tick(¤t_ms, ¤t_us); - - // current_tick gives us the remaining us until the next tick but we want the number since the last ms. - current_us = 1000 - current_us; + uint32_t current_overflow = overflow_count; + uint32_t current_count = nrfx_timer_capture(timer, 1); pulseio_pulsein_obj_t* self = NULL; for(size_t i = 0; i < NRFX_ARRAY_SIZE(_objs); i++ ) { @@ -78,18 +88,16 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action self->first_edge = false; } }else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; - - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; + // Wrapped around a number of times. + uint32_t total_diff = 0xffff; + // Wrapped around once so + if (self->last_overflow == current_overflow - 1) { + total_diff = current_count + (0xffffffff - self->last_count); + } else if (self->last_overflow == current_overflow) { + total_diff = current_count - self->last_count; } + + // Cap duration at 16 bits. uint16_t duration = 0xffff; if (total_diff < duration) { duration = total_diff; @@ -104,8 +112,8 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_overflow = current_overflow; + self->last_count = current_count; } void pulsein_reset(void) { @@ -114,6 +122,11 @@ void pulsein_reset(void) { } nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); + if (timer != NULL) { + nrf_peripherals_free_timer(timer); + } + refcount = 0; + memset(_objs, 0, sizeof(_objs)); } @@ -129,6 +142,27 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); } + if (refcount == 0) { + timer = nrf_peripherals_allocate_timer(); + if (timer == NULL) { + mp_raise_RuntimeError(translate("All timers in use")); + } + overflow_count = 0; + + nrfx_timer_config_t timer_config = { + // PulseIn durations are in microseconds, so this is convenient. + .frequency = NRF_TIMER_FREQ_1MHz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + }; + + nrfx_timer_init(timer, &timer_config, &timer_overflow_event_handler); + // Interrupt on overflow so we can track when it rolls over. + nrfx_timer_compare(timer, 0, 0, true); + } + refcount++; + self->pin = pin->number; self->maxlen = maxlen; self->idle_state = idle_state; @@ -136,8 +170,8 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->len = 0; self->first_edge = true; self->paused = false; - self->last_us = 0; - self->last_ms = 0; + self->last_overflow = 0; + self->last_count = 0; claim_pin(pin); @@ -173,6 +207,11 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { reset_pin_number(self->pin); self->pin = NO_PIN; + + refcount--; + if (refcount == 0) { + nrf_peripherals_free_timer(timer); + } } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { @@ -207,8 +246,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t tri self->first_edge = true; self->paused = false; - self->last_ms = 0; - self->last_us = 0; + self->last_overflow = 0; + self->last_count = 0; nrfx_gpiote_in_event_enable(self->pin, true); } diff --git a/ports/nrf/common-hal/pulseio/PulseIn.h b/ports/nrf/common-hal/pulseio/PulseIn.h index 4b2c6eee3f..da5263ac9c 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.h +++ b/ports/nrf/common-hal/pulseio/PulseIn.h @@ -44,8 +44,8 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; - volatile uint16_t last_us; - volatile uint64_t last_ms; + volatile size_t last_overflow; + volatile size_t last_count; } pulseio_pulsein_obj_t; void pulsein_reset(void); From affd3fcc2a0c577c58973c22af16383ff807a516 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 10 Mar 2020 16:57:41 -0700 Subject: [PATCH 066/919] Clear the pending IRQ in the NVIC as well. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 1 + ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 15 +++++++--- ports/nrf/common-hal/audiopwmio/PWMAudioOut.h | 2 ++ ports/nrf/common-hal/pulseio/PWMOut.c | 28 ++++++++++++++----- ports/nrf/common-hal/pulseio/PWMOut.h | 3 +- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 65c153e1a0..2fa28afac0 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -322,6 +322,7 @@ bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t* self) { void i2s_background(void) { if (NVIC_GetPendingIRQ(I2S_IRQn) && NRF_I2S->EVENTS_TXPTRUPD) { NRF_I2S->EVENTS_TXPTRUPD = 0; + NVIC_ClearPendingIRQ(I2S_IRQn); if (instance) { i2s_buffer_fill(instance); } else { diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 239b491351..89966b7da9 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -88,7 +88,6 @@ void audiopwmout_reset() { } STATIC void fill_buffers(audiopwmio_pwmaudioout_obj_t *self, int buf) { - self->pwm->EVENTS_SEQSTARTED[1-buf] = 0; uint16_t *dev_buffer = self->buffers[buf]; uint8_t *buffer; uint32_t buffer_length; @@ -145,8 +144,15 @@ STATIC void audiopwmout_background_obj(audiopwmio_pwmaudioout_obj_t *self) { if (stopped) self->pwm->TASKS_STOP = 1; } else if (!self->paused && !self->single_buffer) { - if (self->pwm->EVENTS_SEQSTARTED[0]) fill_buffers(self, 1); - if (self->pwm->EVENTS_SEQSTARTED[1]) fill_buffers(self, 0); + if (self->pwm->EVENTS_SEQSTARTED[0]) { + fill_buffers(self, 1); + self->pwm->EVENTS_SEQSTARTED[0] = 0; + } + if (self->pwm->EVENTS_SEQSTARTED[1]) { + fill_buffers(self, 0); + self->pwm->EVENTS_SEQSTARTED[1] = 0; + } + NVIC_ClearPendingIRQ(self->pwm_irq); } } @@ -168,7 +174,8 @@ void audiopwmout_background() { // Caller validates that pins are free. void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { - self->pwm = pwmout_allocate(256, PWM_PRESCALER_PRESCALER_DIV_1, true, NULL, NULL); + self->pwm = pwmout_allocate(256, PWM_PRESCALER_PRESCALER_DIV_1, true, NULL, NULL, + &self->pwm_irq); if (!self->pwm) { mp_raise_RuntimeError(translate("All timers in use")); } diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h index ed00324c41..fdd6289a43 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h @@ -44,6 +44,8 @@ typedef struct { uint8_t sample_channel_count; uint8_t bytes_per_sample; + IRQn_Type pwm_irq; + bool playing; bool stopping; bool paused; diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pulseio/PWMOut.c index 6921091f8a..9d42ccca0f 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.c +++ b/ports/nrf/common-hal/pulseio/PWMOut.c @@ -139,11 +139,15 @@ bool convert_frequency(uint32_t frequency, uint16_t *countertop, nrf_pwm_clk_t * return false; } +// We store these in an array because we cannot compute them. +static IRQn_Type pwm_irqs[4] = {PWM0_IRQn, PWM1_IRQn, PWM2_IRQn, PWM3_IRQn}; + NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, - bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out) { + bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out, + IRQn_Type* irq) { for (size_t pwm_index = 0; pwm_index < MP_ARRAY_SIZE(pwms); pwm_index++) { NRF_PWM_Type *pwm = pwms[pwm_index]; - bool pwm_already_in_use = pwm->ENABLE & SPIM_ENABLE_ENABLE_Msk; + bool pwm_already_in_use = pwm->ENABLE & PWM_ENABLE_ENABLE_Msk; if (pwm_already_in_use) { if (variable_frequency) { // Variable frequency requires exclusive use of a PWM, so try the next one. @@ -156,20 +160,30 @@ NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, for (size_t chan = 0; chan < CHANNELS_PER_PWM; chan++) { if (pwm->PSEL.OUT[chan] == 0xFFFFFFFF) { // Channel is free. - if(channel_out) + if (channel_out) { *channel_out = chan; - if(pwm_already_in_use_out) + } + if (pwm_already_in_use_out) { *pwm_already_in_use_out = pwm_already_in_use; + } + if (irq) { + *irq = pwm_irqs[pwm_index]; + } return pwm; } } } } else { // PWM not yet in use, so we can start to use it. Use channel 0. - if(channel_out) + if (channel_out) { *channel_out = 0; - if(pwm_already_in_use_out) + } + if (pwm_already_in_use_out) { *pwm_already_in_use_out = pwm_already_in_use; + } + if (irq) { + *irq = pwm_irqs[pwm_index]; + } return pwm; } } @@ -208,7 +222,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, int8_t channel; bool pwm_already_in_use; self->pwm = pwmout_allocate(countertop, base_clock, variable_frequency, - &channel, &pwm_already_in_use); + &channel, &pwm_already_in_use, NULL); if (self->pwm == NULL) { return PWMOUT_ALL_TIMERS_IN_USE; diff --git a/ports/nrf/common-hal/pulseio/PWMOut.h b/ports/nrf/common-hal/pulseio/PWMOut.h index b6798cb685..a0c2d87471 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.h +++ b/ports/nrf/common-hal/pulseio/PWMOut.h @@ -42,7 +42,8 @@ typedef struct { void pwmout_reset(void); NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock, - bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out); + bool variable_frequency, int8_t *channel_out, bool *pwm_already_in_use_out, + IRQn_Type *irq); void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H From 48b5f2a384e7ecc10ee51b453934a009ea9dc48d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Mar 2020 23:05:12 -0700 Subject: [PATCH 067/919] Initial work on SAMD --- ports/atmel-samd/Makefile | 2 - ports/atmel-samd/background.c | 6 +- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 1 - .../common-hal/displayio/ParallelBus.c | 2 - .../common-hal/neopixel_write/__init__.c | 22 ++-- ports/atmel-samd/common-hal/ps2io/Ps2.c | 14 +-- ports/atmel-samd/common-hal/ps2io/Ps2.h | 3 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 8 +- ports/atmel-samd/common-hal/rtc/RTC.c | 64 +++-------- ports/atmel-samd/common-hal/rtc/RTC.h | 2 - ports/atmel-samd/common-hal/time/__init__.c | 48 -------- ports/atmel-samd/mphalport.c | 15 --- ports/atmel-samd/supervisor/port.c | 106 +++++++++++++++-- ports/atmel-samd/tick.c | 107 ------------------ ports/atmel-samd/tick.h | 42 ------- ports/nrf/common-hal/rtc/RTC.c | 3 - ports/nrf/supervisor/port.c | 4 +- py/circuitpy_defns.mk | 6 +- .../time/__init__.c | 0 19 files changed, 139 insertions(+), 316 deletions(-) delete mode 100644 ports/atmel-samd/common-hal/time/__init__.c delete mode 100644 ports/atmel-samd/tick.c delete mode 100644 ports/atmel-samd/tick.h rename {ports/nrf/common-hal => shared-module}/time/__init__.c (100%) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f4886f96ef..5ec91a811f 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -194,7 +194,6 @@ SRC_ASF := \ hpl/gclk/hpl_gclk.c \ hpl/nvmctrl/hpl_nvmctrl.c \ hpl/pm/hpl_pm.c \ - hpl/rtc/hpl_rtc.c \ hpl/sercom/hpl_sercom.c \ hpl/systick/hpl_systick.c \ hal/utils/src/utils_list.c \ @@ -258,7 +257,6 @@ SRC_C = \ peripherals/samd/timers.c \ reset.c \ supervisor/shared/memory.c \ - tick.c \ timer_handler.c \ diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index ca91a31de6..767c7f3b6b 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -26,7 +26,6 @@ #include "background.h" #include "audio_dma.h" -#include "tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" @@ -34,6 +33,7 @@ #include "py/runtime.h" #include "shared-module/network/__init__.h" #include "supervisor/shared/stack.h" +#include "supervisor/port.h" #ifdef CIRCUITPY_DISPLAYIO #include "shared-module/displayio/__init__.h" @@ -92,10 +92,10 @@ void run_background_tasks(void) { running_background_tasks = false; assert_heap_ok(); - last_finished_tick = supervisor_ticks_ms64(); + last_finished_tick = port_get_raw_ticks(NULL); finish_background_task(); } bool background_tasks_ok(void) { - return supervisor_ticks_ms64() - last_finished_tick < 1000; + return port_get_raw_ticks(NULL) - last_finished_tick < 1024; } diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index 76e66ab45f..a1e35a1dc0 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -49,7 +49,6 @@ #include "samd/dma.h" #include "audio_dma.h" -#include "tick.h" #define OVERSAMPLING 64 #define SAMPLES_PER_BUFFER 32 diff --git a/ports/atmel-samd/common-hal/displayio/ParallelBus.c b/ports/atmel-samd/common-hal/displayio/ParallelBus.c index 2479e3b40e..405c08c64a 100644 --- a/ports/atmel-samd/common-hal/displayio/ParallelBus.c +++ b/ports/atmel-samd/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index ba69174af4..1755270253 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -29,7 +29,7 @@ #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" +#include "supervisor/port.h" #ifdef SAMD51 #include "hri/hri_cmcc_d51.h" @@ -91,8 +91,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa ""); } -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { // This is adapted directly from the Adafruit NeoPixel library SAMD21G18A code: @@ -101,9 +100,9 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint32_t pinMask; PortGroup* port; - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} // Turn off interrupts of any kind during timing-sensitive code. mp_hal_disable_all_interrupts(); @@ -144,15 +143,8 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, #endif - // ticks_ms may be out of date at this point because we stopped the - // interrupt. We'll risk it anyway. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + // Update the next start. + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; // Turn on interrupts after timing-sensitive code. mp_hal_enable_all_interrupts(); diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index 6a06864f21..2579142ad0 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -41,10 +41,9 @@ #include "samd/pins.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/ps2io/Ps2.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" -#include "tick.h" - #define STATE_IDLE 0 #define STATE_RECV 1 #define STATE_RECV_PARITY 2 @@ -168,24 +167,21 @@ static void delay_us(uint32_t t) { void ps2_interrupt_handler(uint8_t channel) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint64_t current_tick = port_get_raw_ticks(NULL); ps2io_ps2_obj_t* self = get_eic_channel_data(channel); int data_bit = gpio_get_pin_level(self->data_pin) ? 1 : 0; // test for timeout if (self->state != STATE_IDLE) { - int64_t diff_ms = current_ms - self->last_int_ms; - if (diff_ms >= 2) { // a.k.a. > 1.001ms + int64_t diff_ms = current_tick - self->last_raw_ticks; + if (diff_ms > 1) { // a.k.a. > 1.001ms self->last_errors |= ERROR_TIMEOUT; self->state = STATE_IDLE; } } - self->last_int_us = current_us; - self->last_int_ms = current_ms; + self->last_raw_ticks = current_tick; if (self->state == STATE_IDLE) { self->bits = 0; diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.h b/ports/atmel-samd/common-hal/ps2io/Ps2.h index cce6ae4746..588dfdd8be 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.h +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.h @@ -39,8 +39,7 @@ typedef struct { uint8_t data_pin; uint8_t state; - uint64_t last_int_ms; - uint32_t last_int_us; + uint64_t last_raw_ticks; uint16_t bits; bool parity; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index a2494f102f..147081d182 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -42,8 +42,6 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/translate.h" -#include "tick.h" - static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { uint32_t sense_setting; if (!first_edge) { @@ -61,9 +59,9 @@ static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint32_t current_us = 0; + uint64_t current_ms = 0; + // current_tick(¤t_ms, ¤t_us); // current_tick gives us the remaining us until the next tick but we want the number since the // last ms. diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 4c888418b6..7651fdef60 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -30,76 +30,46 @@ #include #include #include -#include #include "py/obj.h" #include "py/runtime.h" #include "lib/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/translate.h" -static struct calendar_descriptor calendar; - -void rtc_init(void) { -#ifdef SAMD21 - _gclk_enable_channel(RTC_GCLK_ID, CONF_GCLK_RTC_SRC); -#endif -#ifdef SAMD51 - hri_mclk_set_APBAMASK_RTC_bit(MCLK); -#endif - calendar_init(&calendar, RTC); - calendar_set_baseyear(&calendar, 2000); - calendar_enable(&calendar); -} +// This is the time in seconds since 2000 that the RTC was started. +static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { - struct calendar_date_time datetime; - calendar_get_date_time(&calendar, &datetime); - - tm->tm_year = datetime.date.year; - tm->tm_mon = datetime.date.month; - tm->tm_mday = datetime.date.day; - tm->tm_hour = datetime.time.hour; - tm->tm_min = datetime.time.min; - tm->tm_sec = datetime.time.sec; + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { - // Reset prescaler to increase initial precision. Otherwise we can be up to 1 second off already. - uint32_t freqcorr = hri_rtcmode0_read_FREQCORR_reg(calendar.device.hw); - calendar_deinit(&calendar); - rtc_init(); - hri_rtcmode0_write_FREQCORR_reg(calendar.device.hw, freqcorr); - - struct calendar_date date = { - .year = tm->tm_year, - .month = tm->tm_mon, - .day = tm->tm_mday, - }; - calendar_set_date(&calendar, &date); - - struct calendar_time time = { - .hour = tm->tm_hour, - .min = tm->tm_min, - .sec = tm->tm_sec, - }; - calendar_set_time(&calendar, &time); + uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; + uint32_t epoch_s = timeutils_seconds_since_2000( + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec + ); + rtc_offset = epoch_s - ticks_s; } // A positive value speeds up the clock by removing clock cycles. int common_hal_rtc_get_calibration(void) { - int calibration = hri_rtcmode0_read_FREQCORR_VALUE_bf(calendar.device.hw); + int calibration = hri_rtcmode0_read_FREQCORR_VALUE_bf(RTC); - if (!hri_rtcmode0_get_FREQCORR_SIGN_bit(calendar.device.hw)) + if (!hri_rtcmode0_get_FREQCORR_SIGN_bit(RTC)) { calibration = -calibration; + } return calibration; } void common_hal_rtc_set_calibration(int calibration) { - if (calibration > 127 || calibration < -127) + if (calibration > 127 || calibration < -127) { mp_raise_ValueError(translate("calibration value out of range +/-127")); + } - hri_rtcmode0_write_FREQCORR_SIGN_bit(calendar.device.hw, calibration < 0 ? 0 : 1); - hri_rtcmode0_write_FREQCORR_VALUE_bf(calendar.device.hw, abs(calibration)); + hri_rtcmode0_write_FREQCORR_SIGN_bit(RTC, calibration < 0 ? 0 : 1); + hri_rtcmode0_write_FREQCORR_VALUE_bf(RTC, abs(calibration)); } diff --git a/ports/atmel-samd/common-hal/rtc/RTC.h b/ports/atmel-samd/common-hal/rtc/RTC.h index 1d63b2deac..19cbc0b5c5 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.h +++ b/ports/atmel-samd/common-hal/rtc/RTC.h @@ -27,6 +27,4 @@ #ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H #define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H -extern void rtc_init(void); - #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RTC_RTC_H diff --git a/ports/atmel-samd/common-hal/time/__init__.c b/ports/atmel-samd/common-hal/time/__init__.c deleted file mode 100644 index 652e455fc4..0000000000 --- a/ports/atmel-samd/common-hal/time/__init__.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 "py/mphal.h" - -#include "shared-bindings/time/__init__.h" - -#include "supervisor/shared/tick.h" -#include "tick.h" - -inline uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} - -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} diff --git a/ports/atmel-samd/mphalport.c b/ports/atmel-samd/mphalport.c index 96433d729f..23a9b43300 100644 --- a/ports/atmel-samd/mphalport.c +++ b/ports/atmel-samd/mphalport.c @@ -49,21 +49,6 @@ extern uint32_t common_hal_mcu_processor_get_frequency(void); -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - // Use mp_hal_delay_us() for timing of less than 1ms. // Do a simple timing loop to wait for a certain number of microseconds. // Can be used when interrupts are disabled, which makes tick_delay() unreliable. diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 01ca797cad..61f23a7915 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -70,10 +70,10 @@ #include "samd/dma.h" #include "shared-bindings/rtc/__init__.h" #include "reset.h" -#include "tick.h" #include "supervisor/shared/safe_mode.h" #include "supervisor/shared/stack.h" +#include "supervisor/shared/tick.h" #include "tusb.h" @@ -132,6 +132,38 @@ static void save_usb_clock_calibration(void) { } #endif +static void rtc_init(void) { +#ifdef SAMD21 + _gclk_enable_channel(RTC_GCLK_ID, CONF_GCLK_RTC_SRC); +#endif +#ifdef SAMD51 + hri_mclk_set_APBAMASK_RTC_bit(MCLK); +#endif + + RTC->MODE0.CTRLA.reg = RTC_MODE0_CTRLA_ENABLE | + RTC_MODE0_CTRLA_MODE_COUNT32 | + RTC_MODE0_CTRLA_PRESCALER_DIV2 | + RTC_MODE0_CTRLA_COUNTSYNC; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_OVF; + + // Set all peripheral interrupt priorities to the lowest priority by default. + for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { + NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); + } + // Bump up the rtc interrupt so nothing else interferes with timekeeping. + NVIC_SetPriority(RTC_IRQn, 0); + #ifdef SAMD21 + NVIC_SetPriority(USB_IRQn, 1); + #endif + + #ifdef SAMD51 + NVIC_SetPriority(USB_0_IRQn, 1); + NVIC_SetPriority(USB_1_IRQn, 1); + NVIC_SetPriority(USB_2_IRQn, 1); + NVIC_SetPriority(USB_3_IRQn, 1); + #endif +} + safe_mode_t port_init(void) { #if defined(SAMD21) @@ -220,12 +252,7 @@ safe_mode_t port_init(void) { clock_init(BOARD_HAS_CRYSTAL, DEFAULT_DFLL48M_FINE_CALIBRATION); #endif - // Configure millisecond timer initialization. - tick_init(); - -#if CIRCUITPY_RTC rtc_init(); -#endif init_shared_dma(); @@ -275,9 +302,6 @@ void reset_port(void) { analogin_reset(); analogout_reset(); #endif -#if CIRCUITPY_RTC - rtc_reset(); -#endif reset_gclks(); @@ -352,6 +376,70 @@ uint32_t port_get_saved_word(void) { return *safe_word; } +// TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain +// is enabled. +static volatile uint64_t overflowed_ticks = 0; + +void RTC_Handler(void) { + uint32_t intflag = RTC->MODE0.INTFLAG.reg; + if (intflag & RTC_MODE0_INTFLAG_OVF) { + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_OVF; + // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per + // tick. + overflowed_ticks += (1L<< (32 - 4)); + + } else if (intflag & RTC_MODE0_INTFLAG_PER2) { + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; + // Do things common to all ports when the tick occurs + supervisor_tick(); + } else if (intflag & RTC_MODE0_INTFLAG_CMP0) { + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + } +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} + uint32_t current_ticks = RTC->MODE0.COUNT.reg; + if (subticks != NULL) { + *subticks = (current_ticks % 16) * 2; + } + + return overflowed_ticks + current_ticks / 16; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTFLAG_PER2; +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTFLAG_PER2; +} + +void port_interrupt_after_ticks(uint32_t ticks) { + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} + uint32_t current_ticks = RTC->MODE0.COUNT.reg; + if (ticks > 1 << 28) { + // We'll interrupt sooner with an overflow. + return; + } + RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; +} + +void port_sleep_until_interrupt(void) { + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + // Call wait for interrupt ourselves if the SD isn't enabled. + __WFI(); +} + /** * \brief Default interrupt handler for unused IRQs. */ diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c deleted file mode 100644 index f996440ae3..0000000000 --- a/ports/atmel-samd/tick.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "peripheral_clk_config.h" - -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - common_hal_mcu_disable_interrupts(); - - // Read the control register to reset the COUNTFLAG. - (void) SysTick->CTRL; - common_hal_mcu_enable_interrupts(); - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms-1); - NVIC_EnableIRQ(SysTick_IRQn); - // Set all peripheral interrupt priorities to the lowest priority by default. - for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { - NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); - } - // Bump up the systick interrupt so nothing else interferes with timekeeping. - NVIC_SetPriority(SysTick_IRQn, 0); - #ifdef SAMD21 - NVIC_SetPriority(USB_IRQn, 1); - #endif - - #ifdef SAMD51 - NVIC_SetPriority(USB_0_IRQn, 1); - NVIC_SetPriority(USB_1_IRQn, 1); - NVIC_SetPriority(USB_2_IRQn, 1); - NVIC_SetPriority(USB_3_IRQn, 1); - #endif -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_until_next_tick = SysTick->VAL / ticks_per_us; - uint32_t start_tick; - while (us >= us_until_next_tick) { - start_tick = SysTick->VAL; // wait for SysTick->VAL to RESET - while (SysTick->VAL < start_tick) {} - us -= us_until_next_tick; - us_until_next_tick = 1000; - } - while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - - // We disable interrupts to prevent ticks_ms from changing while we grab it. - common_hal_mcu_disable_interrupts(); - uint32_t tick_status = SysTick->CTRL; - uint32_t current_us = SysTick->VAL; - uint32_t tick_status2 = SysTick->CTRL; - uint64_t current_ms = supervisor_ticks_ms64(); - // The second clause ensures our value actually rolled over. Its possible it hit zero between - // the VAL read and CTRL read. - if ((tick_status & SysTick_CTRL_COUNTFLAG_Msk) != 0 || - ((tick_status2 & SysTick_CTRL_COUNTFLAG_Msk) != 0 && current_us > ticks_per_us)) { - current_ms++; - } - common_hal_mcu_enable_interrupts(); - *ms = current_ms; - *us_until_ms = current_us / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while (supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/atmel-samd/tick.h b/ports/atmel-samd/tick.h deleted file mode 100644 index 334352df26..0000000000 --- a/ports/atmel-samd/tick.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_TICK_H -#define MICROPY_INCLUDED_ATMEL_SAMD_TICK_H - -#include "py/mpconfig.h" - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_TICK_H diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 6b582ef26f..9f56f2f0df 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -33,9 +33,6 @@ #include "supervisor/port.h" #include "supervisor/shared/translate.h" -#include "nrfx_rtc.h" -#include "nrf_clock.h" - // This is the time in seconds since 2000 that the RTC was started. static uint32_t rtc_offset = 0; diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 2a46040911..17e980dff8 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -78,7 +78,9 @@ static volatile uint64_t overflowed_ticks = 0; void rtc_handler(nrfx_rtc_int_type_t int_type) { if (int_type == NRFX_RTC_INT_OVERFLOW) { - overflowed_ticks += (1L<<24); + // Our RTC is 24 bits and we're clocking it at 32.768khz which is 32 (2 ** 5) subticks per + // tick. + overflowed_ticks += (1L<< (24 - 5)); } else if (int_type == NRFX_RTC_INT_TICK && nrfx_rtc_counter_get(&rtc_instance) % 32 == 0) { // Do things common to all ports when the tick occurs supervisor_tick(); diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 92021d0d07..135782cf4d 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -282,8 +282,7 @@ SRC_COMMON_HAL_ALL = \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ - supervisor/__init__.c \ - time/__init__.c + supervisor/__init__.c SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) @@ -358,13 +357,14 @@ SRC_SHARED_MODULE_ALL = \ network/__init__.c \ storage/__init__.c \ struct/__init__.c \ + time/__init__.c \ terminalio/Terminal.c \ terminalio/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ _pew/__init__.c \ _pew/PewPew.c \ - _eve/__init__.c + _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) diff --git a/ports/nrf/common-hal/time/__init__.c b/shared-module/time/__init__.c similarity index 100% rename from ports/nrf/common-hal/time/__init__.c rename to shared-module/time/__init__.c From 4fba4eb1331d28892a633517bc729811d0807e2a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 13 Mar 2020 11:11:56 -0700 Subject: [PATCH 068/919] Switch from 1k RTC input to 32k output --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index b89811f22a..df39529b42 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit b89811f22a24ac350079ceaf0cdf0e62aa03f4f4 +Subproject commit df39529b42fbc43db3c9b5724dfb2d6c562e8489 From c9aa50817c62f95f2714faf4f0e0ccf1fb5de2dd Mon Sep 17 00:00:00 2001 From: Szymon Klause Date: Fri, 13 Mar 2020 21:39:17 +0100 Subject: [PATCH 069/919] add UARTLogger2 board support for CircuitPython --- .github/workflows/build.yml | 1 + ports/atmel-samd/boards/uartlogger2/board.c | 39 +++++++++++++ .../boards/uartlogger2/mpconfigboard.h | 35 ++++++++++++ .../boards/uartlogger2/mpconfigboard.mk | 12 ++++ ports/atmel-samd/boards/uartlogger2/pins.c | 55 +++++++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 ports/atmel-samd/boards/uartlogger2/board.c create mode 100644 ports/atmel-samd/boards/uartlogger2/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/uartlogger2/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32c949a3a8..0104f3979e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,6 +231,7 @@ jobs: - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" + - "uartlogger2" - "uchip" - "ugame10" - "winterbloom_sol" diff --git a/ports/atmel-samd/boards/uartlogger2/board.c b/ports/atmel-samd/boards/uartlogger2/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/uartlogger2/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/uartlogger2/mpconfigboard.h b/ports/atmel-samd/boards/uartlogger2/mpconfigboard.h new file mode 100644 index 0000000000..bd341d3039 --- /dev/null +++ b/ports/atmel-samd/boards/uartlogger2/mpconfigboard.h @@ -0,0 +1,35 @@ +#define MICROPY_HW_BOARD_NAME "UARTLogger II" +#define MICROPY_HW_MCU_NAME "samd51j19" + +#define CIRCUITPY_MCU_FAMILY samd51 + +#define MICROPY_HW_LED_TX (&pin_PB07) +#define MICROPY_HW_LED_RX (&pin_PB06) + +#define MICROPY_HW_LED_STATUS (&pin_PA16) + +#define MICROPY_HW_NEOPIXEL (&pin_PB22) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// QSPI CS, QSPI SCK and NeoPixel pin +#define MICROPY_PORT_B (PORT_PB11 | PORT_PB10 | PORT_PB22) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB03) +#define DEFAULT_I2C_BUS_SDA (&pin_PB02) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA12) +#define DEFAULT_SPI_BUS_MISO (&pin_PA14) + +#define DEFAULT_UART_BUS_RX (&pin_PA23) +#define DEFAULT_UART_BUS_TX (&pin_PA22) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk b/ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk new file mode 100644 index 0000000000..498429c9e8 --- /dev/null +++ b/ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8096 +USB_PRODUCT = "UARTLogger II" +USB_MANUFACTURER = "Szymon Klause" + +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/uartlogger2/pins.c b/ports/atmel-samd/boards/uartlogger2/pins.c new file mode 100644 index 0000000000..4e90870c49 --- /dev/null +++ b/ports/atmel-samd/boards/uartlogger2/pins.c @@ -0,0 +1,55 @@ +#include "shared-bindings/board/__init__.h" + +// This mapping only includes functional names because pins broken +// out on connectors are labeled with their MCU name available from +// microcontroller.pin. +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, + + // ESP control + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PB01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PB04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PB05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RTS), MP_ROM_PTR(&pin_PB23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA07) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB03) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PB22) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_LED_RX),MP_ROM_PTR(&pin_PB06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX),MP_ROM_PTR(&pin_PB07) }, + { 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); From 9fa270e330d1c3905b21994783db3dcccadf974a Mon Sep 17 00:00:00 2001 From: Szymon Klause Date: Fri, 13 Mar 2020 22:58:39 +0100 Subject: [PATCH 070/919] spacing correction --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0104f3979e..67d262177f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,7 +231,7 @@ jobs: - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" - - "uartlogger2" + - "uartlogger2" - "uchip" - "ugame10" - "winterbloom_sol" From df5be65423e1cfd36af782108277c31cdb9056aa Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 13 Mar 2020 16:12:52 -0700 Subject: [PATCH 071/919] Update FrequencyIn for new clock API. --- .../common-hal/frequencyio/FrequencyIn.c | 22 ++++++++----------- .../common-hal/frequencyio/FrequencyIn.h | 3 +-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index cbb0671045..fcb3c0ce73 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -24,11 +24,12 @@ * THE SOFTWARE. */ +#include "shared-bindings/frequencyio/FrequencyIn.h" + #include #include "hal/include/hal_gpio.h" #include "atmel_start_pins.h" -#include "supervisor/shared/translate.h" #include "mpconfigport.h" #include "py/runtime.h" @@ -41,11 +42,11 @@ #include "samd/pins.h" #include "samd/external_interrupts.h" -#include "shared-bindings/frequencyio/FrequencyIn.h" #include "peripheral_clk_config.h" #include "hpl_gclk_config.h" -#include "tick.h" +#include "shared-bindings/time/__init__.h" +#include "supervisor/shared/translate.h" #ifdef SAMD21 #include "hpl/gclk/hpl_gclk_base.h" @@ -88,9 +89,7 @@ void frequencyin_interrupt_handler(uint8_t index) { if (!ref_tc->COUNT16.INTFLAG.bit.OVF) return; // false trigger - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint64_t current_ns = common_hal_time_monotonic_ns(); for (uint8_t i = 0; i <= (TC_INST_NUM - 1); i++) { if (active_frequencyins[i] != NULL) { @@ -101,14 +100,12 @@ void frequencyin_interrupt_handler(uint8_t index) { if ((EIC->INTFLAG.reg & mask) == mask) { // Make sure capture_period has elapsed before we // record a new event count. - if (current_ms - self->last_ms >= self->capture_period) { - float new_factor = self->last_us + (1000 - current_us); + if ((current_ns - self->last_ns) / 1000000 >= self->capture_period) { // ms difference will not need 64 bits. If we use 64 bits, // double-precision float routines are required, and we don't // want to include them because they're very large. - self->factor = (uint32_t) (current_ms - self->last_ms) + (new_factor / 1000); - self->last_ms = current_ms; - self->last_us = current_us; + self->factor = (uint32_t) (current_ns - self->last_ns) / 1000000.0; + self->last_ns = current_ns; #ifdef SAMD51 tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val; @@ -278,8 +275,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self->pin = pin->number; self->channel = pin->extint_channel; self->errored_too_fast = false; - self->last_ms = 0; - self->last_us = 1000; + self->last_ns = 0; self->capture_period = capture_period; #ifdef SAMD21 self->TC_IRQ = TC3_IRQn + timer_index; diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h index abd63cc86d..461fb661f1 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h @@ -38,8 +38,7 @@ typedef struct { uint8_t channel; uint8_t event_channel; uint32_t frequency; - volatile uint64_t last_ms; - volatile uint32_t last_us; + volatile uint64_t last_ns; float factor; uint32_t capture_period; uint8_t TC_IRQ; From 7100d5e485a93552e035476cb794145d6e194052 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 13 Mar 2020 16:13:24 -0700 Subject: [PATCH 072/919] Fix autoreload and ticks in general --- ports/atmel-samd/supervisor/port.c | 10 ++++++++-- supervisor/shared/tick.c | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 61f23a7915..6b368e27ba 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -140,6 +140,9 @@ static void rtc_init(void) { hri_mclk_set_APBAMASK_RTC_bit(MCLK); #endif + RTC->MODE0.CTRLA.bit.SWRST = true; + while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {} + RTC->MODE0.CTRLA.reg = RTC_MODE0_CTRLA_ENABLE | RTC_MODE0_CTRLA_MODE_COUNT32 | RTC_MODE0_CTRLA_PRESCALER_DIV2 | @@ -162,6 +165,8 @@ static void rtc_init(void) { NVIC_SetPriority(USB_2_IRQn, 1); NVIC_SetPriority(USB_3_IRQn, 1); #endif + NVIC_ClearPendingIRQ(RTC_IRQn); + NVIC_EnableIRQ(RTC_IRQn); } safe_mode_t port_init(void) { @@ -411,12 +416,12 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. - RTC->MODE0.INTENSET.reg = RTC_MODE0_INTFLAG_PER2; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; } // Disable 1/1024 second tick. void port_disable_tick(void) { - RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTFLAG_PER2; + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; } void port_interrupt_after_ticks(uint32_t ticks) { @@ -427,6 +432,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { return; } RTC->MODE0.COMP[0].reg = current_ticks + (ticks << 4); + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; } diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 20ca3abb7b..80bd6f2041 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -125,7 +125,9 @@ extern void supervisor_enable_tick(void) { } extern void supervisor_disable_tick(void) { - tick_enable_count--; + if (tick_enable_count > 0) { + tick_enable_count--; + } if (tick_enable_count == 0) { port_disable_tick(); } From 76ca13b6ed9d5729ee8c0a0d30d93c2af6cf7508 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 13 Mar 2020 17:21:15 -0700 Subject: [PATCH 073/919] Fix SAMD51 pulsein --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 108 ++++++++++++++---- ports/atmel-samd/common-hal/pulseio/PulseIn.h | 5 +- ports/atmel-samd/timer_handler.c | 6 + ports/atmel-samd/timer_handler.h | 1 + ports/nrf/common-hal/pulseio/PulseIn.c | 9 +- 5 files changed, 96 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 147081d182..d51a674171 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -34,14 +34,32 @@ #include "background.h" #include "eic_handler.h" #include "mpconfigport.h" +#include "timer_handler.h" #include "py/gc.h" #include "py/runtime.h" #include "samd/external_interrupts.h" #include "samd/pins.h" +#include "samd/timers.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/translate.h" +// This timer is shared amongst all PulseIn objects as a higher resolution clock. +static uint8_t refcount = 0; +static uint8_t pulsein_tc_index = 0xff; + +static uint32_t overflow_count = 0; + +void pulsein_timer_interrupt_handler(uint8_t index) { + if (index != pulsein_tc_index) return; + overflow_count++; + Tc* tc = tc_insts[index]; + if (!tc->COUNT16.INTFLAG.bit.OVF) return; + + // Clear the interrupt bit. + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_OVF; +} + static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { uint32_t sense_setting; if (!first_edge) { @@ -59,13 +77,10 @@ static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. - uint32_t current_us = 0; - uint64_t current_ms = 0; - // current_tick(¤t_ms, ¤t_us); + uint32_t current_overflow = overflow_count; + Tc* tc = tc_insts[pulsein_tc_index]; + uint32_t current_count = tc->COUNT16.COUNT.reg; - // current_tick gives us the remaining us until the next tick but we want the number since the - // last ms. - current_us = 1000 - current_us; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); if (!background_tasks_ok() || self->errored_too_fast) { self->errored_too_fast = true; @@ -76,17 +91,11 @@ void pulsein_interrupt_handler(uint8_t channel) { self->first_edge = false; pulsein_set_config(self, false); } else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; - } + uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; + #ifdef SAMD21 + total_diff /= 3; + #endif + // Cap duration at 16 bits. uint16_t duration = 0xffff; if (total_diff < duration) { duration = total_diff; @@ -100,8 +109,8 @@ void pulsein_interrupt_handler(uint8_t channel) { self->start++; } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_overflow = current_overflow; + self->last_count = current_count; } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, @@ -124,10 +133,57 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, self->start = 0; self->len = 0; self->first_edge = true; - self->last_us = 0; - self->last_ms = 0; + self->last_overflow = 0; + self->last_count = 0; self->errored_too_fast = false; + if (refcount == 0) { + // Find a spare timer. + Tc *tc = NULL; + int8_t index = TC_INST_NUM - 1; + for (; index >= 0; index--) { + if (tc_insts[index]->COUNT16.CTRLA.bit.ENABLE == 0) { + tc = tc_insts[index]; + break; + } + } + if (tc == NULL) { + mp_raise_RuntimeError(translate("All timers in use")); + } + + pulsein_tc_index = index; + + set_timer_handler(true, index, TC_HANDLER_PULSEIN); + #ifdef SAMD21 + // We use GCLK0 for SAMD21 which is 48mhz. We prescale it to 3mhz. + turn_on_clocks(true, index, 0); + #endif + #ifdef SAMD51 + // We use GCLK5 for SAMD51 because it runs at 2mhz and we can use it for a 1mhz clock, + // 1us per tick. + turn_on_clocks(true, index, 5); + #endif + + + #ifdef SAMD21 + tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | + TC_CTRLA_PRESCALER_DIV16 | + TC_CTRLA_WAVEGEN_NFRQ; + #endif + #ifdef SAMD51 + tc_reset(tc); + tc_set_enable(tc, false); + tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV2; + tc->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_NFRQ; + #endif + + tc_set_enable(tc, true); + tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_RETRIGGER; + + overflow_count = 0; + } + refcount++; + set_eic_channel_data(pin->extint_channel, (void*) self); // Check to see if the EIC is enabled and start it up if its not.' @@ -156,6 +212,12 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); turn_off_eic_channel(self->channel); reset_pin_number(self->pin); + + refcount--; + if (refcount == 0) { + tc_reset(tc_insts[pulsein_tc_index]); + pulsein_tc_index = 0xff; + } self->pin = NO_PIN; } @@ -183,8 +245,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, // Reconfigure the pin and make sure its set to detect the first edge. self->first_edge = true; - self->last_ms = 0; - self->last_us = 0; + self->last_overflow = 0; + self->last_count = 0; gpio_set_pin_function(self->pin, GPIO_PIN_FUNCTION_A); uint32_t mask = 1 << self->channel; // Clear previous interrupt state and re-enable it. diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.h b/ports/atmel-samd/common-hal/pulseio/PulseIn.h index f5326d9e51..89b61a83ac 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.h @@ -41,13 +41,14 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; volatile bool first_edge; - volatile uint64_t last_ms; - volatile uint16_t last_us; + volatile uint32_t last_overflow; + volatile uint16_t last_count; volatile bool errored_too_fast; } pulseio_pulsein_obj_t; void pulsein_reset(void); void pulsein_interrupt_handler(uint8_t channel); +void pulsein_timer_interrupt_handler(uint8_t index); #endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 5d6de3093f..b2b17caec6 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -29,6 +29,7 @@ #include "timer_handler.h" +#include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" #include "shared-module/_pew/PewPew.h" #include "common-hal/frequencyio/FrequencyIn.h" @@ -47,6 +48,11 @@ void shared_timer_handler(bool is_tc, uint8_t index) { if (is_tc) { uint8_t handler = tc_handler[index]; switch(handler) { + case TC_HANDLER_PULSEIN: + #if CIRCUITPY_PULSEIO + pulsein_timer_interrupt_handler(index); + #endif + break; case TC_HANDLER_PULSEOUT: #if CIRCUITPY_PULSEIO pulseout_interrupt_handler(index); diff --git a/ports/atmel-samd/timer_handler.h b/ports/atmel-samd/timer_handler.h index 4a7adb58c3..e4cae2ab7b 100644 --- a/ports/atmel-samd/timer_handler.h +++ b/ports/atmel-samd/timer_handler.h @@ -30,6 +30,7 @@ #define TC_HANDLER_PULSEOUT 0x1 #define TC_HANDLER_PEW 0x2 #define TC_HANDLER_FREQUENCYIN 0x3 +#define TC_HANDLER_PULSEIN 0x4 void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler); void shared_timer_handler(bool is_tc, uint8_t index); diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index a7d0fb28e7..55ca956ff7 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -88,14 +88,7 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action self->first_edge = false; } }else { - // Wrapped around a number of times. - uint32_t total_diff = 0xffff; - // Wrapped around once so - if (self->last_overflow == current_overflow - 1) { - total_diff = current_count + (0xffffffff - self->last_count); - } else if (self->last_overflow == current_overflow) { - total_diff = current_count - self->last_count; - } + uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; // Cap duration at 16 bits. uint16_t duration = 0xffff; From 6f153804da4734bebd2abbc750c7679c0bf3dc3d Mon Sep 17 00:00:00 2001 From: jgillick Date: Sat, 14 Mar 2020 00:03:14 -0700 Subject: [PATCH 074/919] Add initial thunderpack port files. --- ports/stm/boards/STM32F412CGUx_FLASH.ld | 189 +++++++ .../boards/startup_stm32f412cx_thunderpack.s | 521 ++++++++++++++++++ ports/stm/boards/thunderpack/board.c | 38 ++ ports/stm/boards/thunderpack/mpconfigboard.h | 37 ++ ports/stm/boards/thunderpack/mpconfigboard.mk | 22 + ports/stm/boards/thunderpack/pins.c | 95 ++++ .../boards/thunderpack/stm32f4xx_hal_conf.h | 442 +++++++++++++++ .../stm32f4/stm32f412cx_thunderpack/clocks.c | 77 +++ .../stm32f4/stm32f412cx_thunderpack/gpio.c | 242 ++++++++ .../stm32f4/stm32f412cx_thunderpack/periph.c | 107 ++++ .../stm32f4/stm32f412cx_thunderpack/periph.h | 58 ++ .../stm32f4/stm32f412cx_thunderpack/pins.c | 161 ++++++ .../stm32f4/stm32f412cx_thunderpack/pins.h | 158 ++++++ 13 files changed, 2147 insertions(+) create mode 100644 ports/stm/boards/STM32F412CGUx_FLASH.ld create mode 100644 ports/stm/boards/startup_stm32f412cx_thunderpack.s create mode 100644 ports/stm/boards/thunderpack/board.c create mode 100644 ports/stm/boards/thunderpack/mpconfigboard.h create mode 100644 ports/stm/boards/thunderpack/mpconfigboard.mk create mode 100644 ports/stm/boards/thunderpack/pins.c create mode 100644 ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h diff --git a/ports/stm/boards/STM32F412CGUx_FLASH.ld b/ports/stm/boards/STM32F412CGUx_FLASH.ld new file mode 100644 index 0000000000..c394b8646e --- /dev/null +++ b/ports/stm/boards/STM32F412CGUx_FLASH.ld @@ -0,0 +1,189 @@ +/* +****************************************************************************** +** + +** File : LinkerScript.ld +** +** Author : Auto-generated by System Workbench for STM32 +** +** Abstract : Linker script for STM32F412CGUx series +** 1024Kbytes FLASH and 256Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 STMicroelectronics

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20040000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/startup_stm32f412cx_thunderpack.s b/ports/stm/boards/startup_stm32f412cx_thunderpack.s new file mode 100644 index 0000000000..1c344ec08a --- /dev/null +++ b/ports/stm/boards/startup_stm32f412cx_thunderpack.s @@ -0,0 +1,521 @@ +/** + ****************************************************************************** + * @file startup_stm32f412Cx.s + * @author MCD Application Team + * @brief STM32F412Cx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2017 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M3. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word CAN1_TX_IRQHandler /* CAN1 TX */ + .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ + .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ + .word CAN1_SCE_IRQHandler /* CAN1 SCE */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word 0 /* Reserved */ + .word SDIO_IRQHandler /* SDIO */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word TIM6_IRQHandler /* TIM6 */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */ + .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */ + .word CAN2_TX_IRQHandler /* CAN2 TX */ + .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ + .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ + .word CAN2_SCE_IRQHandler /* CAN2 SCE */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word RNG_IRQHandler /* RNG */ + .word FPU_IRQHandler /* FPU */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word SPI4_IRQHandler /* SPI4 */ + .word SPI5_IRQHandler /* SPI5 */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */ + .word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak CAN1_TX_IRQHandler + .thumb_set CAN1_TX_IRQHandler,Default_Handler + + .weak CAN1_RX0_IRQHandler + .thumb_set CAN1_RX0_IRQHandler,Default_Handler + + .weak CAN1_RX1_IRQHandler + .thumb_set CAN1_RX1_IRQHandler,Default_Handler + + .weak CAN1_SCE_IRQHandler + .thumb_set CAN1_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak SDIO_IRQHandler + .thumb_set SDIO_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak TIM6_IRQHandler + .thumb_set TIM6_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak DFSDM1_FLT0_IRQHandler + .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler + + .weak DFSDM1_FLT1_IRQHandler + .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler + + .weak CAN2_TX_IRQHandler + .thumb_set CAN2_TX_IRQHandler,Default_Handler + + .weak CAN2_RX0_IRQHandler + .thumb_set CAN2_RX0_IRQHandler,Default_Handler + + .weak CAN2_RX1_IRQHandler + .thumb_set CAN2_RX1_IRQHandler,Default_Handler + + .weak CAN2_SCE_IRQHandler + .thumb_set CAN2_SCE_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + + .weak SPI5_IRQHandler + .thumb_set SPI5_IRQHandler,Default_Handler + + .weak FMPI2C1_EV_IRQHandler + .thumb_set FMPI2C1_EV_IRQHandler,Default_Handler + + .weak FMPI2C1_ER_IRQHandler + .thumb_set FMPI2C1_ER_IRQHandler,Default_Handler +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/thunderpack/board.c b/ports/stm/boards/thunderpack/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/thunderpack/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h new file mode 100644 index 0000000000..e374089288 --- /dev/null +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +//Micropython setup +#define MICROPY_HW_BOARD_NAME "THUNDERPACK" +#define MICROPY_HW_MCU_NAME "STM32F412xGU" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (24) +#define BOARD_NO_VBUS_SENSE (1) + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk new file mode 100644 index 0000000000..a5febd5802 --- /dev/null +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x0483 +USB_PID = 0xdf11 +USB_PRODUCT = "Thunderpack" +USB_MANUFACTURER = "Jeremy Gillick" +USB_DEVICES = "CDC,MSC,HID" + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +# QSPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = N25Q128A +# LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f412cx_thunderpack +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F412Zx +LD_FILE = boards/STM32F412CGUx_FLASH.ld + + diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c new file mode 100644 index 0000000000..db0b3cde1b --- /dev/null +++ b/ports/stm/boards/thunderpack/pins.c @@ -0,0 +1,95 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + // { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + // { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + // { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + // { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + // { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + // { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + // { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + // { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, + // { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + // { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + // { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + // { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + // { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + // { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + // { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + // { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + // { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + // { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + // { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + // { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, + // { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + // { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + // { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + // { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + // { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + // { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + // { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + // { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + // { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + // { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + // { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + // { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + // { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + // { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + // { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + // { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + // { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + // { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + // { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + // { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + // { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + // { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + // { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB10) }, + // { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, + // { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, + // { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + // { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PG10) }, + // { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PG11) }, + // { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PF03) }, + // { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PF10) }, + // { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG12) }, + // { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PF04) }, + // { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG13) }, + // { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, //USART6 TX + // { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, //USART6 RX + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA01) }, + // { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC01) }, + // { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, + // { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC04) }, + // { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC05) }, //alt PB09, see F401ZG-DISCO manual + // { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, //alt PB10, see F401ZG-DISCO manual + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), 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_module_globals_table); diff --git a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..530c7e6055 --- /dev/null +++ b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h @@ -0,0 +1,442 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +#define HAL_SD_MODULE_ENABLED +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)24000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c new file mode 100644 index 0000000000..0f2537df8a --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c @@ -0,0 +1,77 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "stm32f4xx_hal.h" +#include "py/mpconfig.h" + +void stm32f4_peripherals_clocks_init(void) { + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the + * device is clocked below the maximum system frequency, to update the + * voltage scaling value regarding system frequency refer to product + * datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 200; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLR = 2; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLLSAI output as USB clock source */ + PeriphClkInitStruct.PLLI2S.PLLI2SM = 12; + PeriphClkInitStruct.PLLI2S.PLLI2SQ = 3; + PeriphClkInitStruct.PLLI2S.PLLI2SR = 2; + PeriphClkInitStruct.PLLI2S.PLLI2SN = 72; + PeriphClkInitStruct.PLLI2SSelection = RCC_PLLI2SCLKSOURCE_PLLSRC; + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + * clocks dividers */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); +} diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c new file mode 100644 index 0000000000..8f47ba3197 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c @@ -0,0 +1,242 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* GPIO PIN REFERENCE +#define LED3_Pin GPIO_PIN_2 +#define LED3_GPIO_Port GPIOE +#define LED4_Pin GPIO_PIN_3 +#define LED4_GPIO_Port GPIOE +#define DFSDM_DATIN3_Pin GPIO_PIN_4 +#define DFSDM_DATIN3_GPIO_Port GPIOE +#define A0_Pin GPIO_PIN_0 +#define A0_GPIO_Port GPIOF +#define LCD_BLCTRL_Pin GPIO_PIN_5 +#define LCD_BLCTRL_GPIO_Port GPIOF +#define QSPI_BK1_IO3_Pin GPIO_PIN_6 +#define QSPI_BK1_IO3_GPIO_Port GPIOF +#define QSPI_BK1_IO2_Pin GPIO_PIN_7 +#define QSPI_BK1_IO2_GPIO_Port GPIOF +#define QSPI_BK1_IO0_Pin GPIO_PIN_8 +#define QSPI_BK1_IO0_GPIO_Port GPIOF +#define QSPI_BK1_IO1_Pin GPIO_PIN_9 +#define QSPI_BK1_IO1_GPIO_Port GPIOF +#define STLK_MCO_Pin GPIO_PIN_0 +#define STLK_MCO_GPIO_Port GPIOH +#define DFSDM_CKOUT_Pin GPIO_PIN_2 +#define DFSDM_CKOUT_GPIO_Port GPIOC +#define JOY_SEL_Pin GPIO_PIN_0 +#define JOY_SEL_GPIO_Port GPIOA +#define STLINK_RX_Pin GPIO_PIN_2 +#define STLINK_RX_GPIO_Port GPIOA +#define STLINK_TX_Pin GPIO_PIN_3 +#define STLINK_TX_GPIO_Port GPIOA +#define CODEC_I2S3_WS_Pin GPIO_PIN_4 +#define CODEC_I2S3_WS_GPIO_Port GPIOA +#define DFSDM_DATIN0_Pin GPIO_PIN_1 +#define DFSDM_DATIN0_GPIO_Port GPIOB +#define QSPI_CLK_Pin GPIO_PIN_2 +#define QSPI_CLK_GPIO_Port GPIOB +#define EXT_RESET_Pin GPIO_PIN_11 +#define EXT_RESET_GPIO_Port GPIOF +#define CTP_RST_Pin GPIO_PIN_12 +#define CTP_RST_GPIO_Port GPIOF +#define JOY_RIGHT_Pin GPIO_PIN_14 +#define JOY_RIGHT_GPIO_Port GPIOF +#define JOY_LEFT_Pin GPIO_PIN_15 +#define JOY_LEFT_GPIO_Port GPIOF +#define JOY_UP_Pin GPIO_PIN_0 +#define JOY_UP_GPIO_Port GPIOG +#define JOY_DOWN_Pin GPIO_PIN_1 +#define JOY_DOWN_GPIO_Port GPIOG +#define D4_Pin GPIO_PIN_7 +#define D4_GPIO_Port GPIOE +#define D5_Pin GPIO_PIN_8 +#define D5_GPIO_Port GPIOE +#define D6_Pin GPIO_PIN_9 +#define D6_GPIO_Port GPIOE +#define D7_Pin GPIO_PIN_10 +#define D7_GPIO_Port GPIOE +#define D8_Pin GPIO_PIN_11 +#define D8_GPIO_Port GPIOE +#define D9_Pin GPIO_PIN_12 +#define D9_GPIO_Port GPIOE +#define D10_Pin GPIO_PIN_13 +#define D10_GPIO_Port GPIOE +#define D11_Pin GPIO_PIN_14 +#define D11_GPIO_Port GPIOE +#define D12_Pin GPIO_PIN_15 +#define D12_GPIO_Port GPIOE +#define I2C2_SCL_Pin GPIO_PIN_10 +#define I2C2_SCL_GPIO_Port GPIOB +#define M2_CKIN_Pin GPIO_PIN_11 +#define M2_CKIN_GPIO_Port GPIOB +#define CODEC_I2S3_SCK_Pin GPIO_PIN_12 +#define CODEC_I2S3_SCK_GPIO_Port GPIOB +#define D13_Pin GPIO_PIN_8 +#define D13_GPIO_Port GPIOD +#define D14_Pin GPIO_PIN_9 +#define D14_GPIO_Port GPIOD +#define D15_Pin GPIO_PIN_10 +#define D15_GPIO_Port GPIOD +#define LCD_RESET_Pin GPIO_PIN_11 +#define LCD_RESET_GPIO_Port GPIOD +#define D0_Pin GPIO_PIN_14 +#define D0_GPIO_Port GPIOD +#define D1_Pin GPIO_PIN_15 +#define D1_GPIO_Port GPIOD +#define CODEC_INT_Pin GPIO_PIN_2 +#define CODEC_INT_GPIO_Port GPIOG +#define LCD_TE_Pin GPIO_PIN_4 +#define LCD_TE_GPIO_Port GPIOG +#define CTP_INT_Pin GPIO_PIN_5 +#define CTP_INT_GPIO_Port GPIOG +#define QSPI_BK1_NCS_Pin GPIO_PIN_6 +#define QSPI_BK1_NCS_GPIO_Port GPIOG +#define USB_OTGFS_OVRCR_Pin GPIO_PIN_7 +#define USB_OTGFS_OVRCR_GPIO_Port GPIOG +#define USB_OTGFS_PPWR_EN_Pin GPIO_PIN_8 +#define USB_OTGFS_PPWR_EN_GPIO_Port GPIOG +#define CODEC_I2S3_MCK_Pin GPIO_PIN_7 +#define CODEC_I2S3_MCK_GPIO_Port GPIOC +#define uSD_D0_Pin GPIO_PIN_8 +#define uSD_D0_GPIO_Port GPIOC +#define uSD_D1_Pin GPIO_PIN_9 +#define uSD_D1_GPIO_Port GPIOC +#define M2_CKINA8_Pin GPIO_PIN_8 +#define M2_CKINA8_GPIO_Port GPIOA +#define USB_OTGFS_VBUS_Pin GPIO_PIN_9 +#define USB_OTGFS_VBUS_GPIO_Port GPIOA +#define USB_OTGFS_ID_Pin GPIO_PIN_10 +#define USB_OTGFS_ID_GPIO_Port GPIOA +#define USB_OTGFS_DM_Pin GPIO_PIN_11 +#define USB_OTGFS_DM_GPIO_Port GPIOA +#define USB_OTGFS_DP_Pin GPIO_PIN_12 +#define USB_OTGFS_DP_GPIO_Port GPIOA +#define SWDIO_Pin GPIO_PIN_13 +#define SWDIO_GPIO_Port GPIOA +#define SWCLK_Pin GPIO_PIN_14 +#define SWCLK_GPIO_Port GPIOA +#define uSD_D2_Pin GPIO_PIN_10 +#define uSD_D2_GPIO_Port GPIOC +#define uSD_D3_Pin GPIO_PIN_11 +#define uSD_D3_GPIO_Port GPIOC +#define uSD_CLK_Pin GPIO_PIN_12 +#define uSD_CLK_GPIO_Port GPIOC +#define D2_Pin GPIO_PIN_0 +#define D2_GPIO_Port GPIOD +#define D3_Pin GPIO_PIN_1 +#define D3_GPIO_Port GPIOD +#define uSD_CMD_Pin GPIO_PIN_2 +#define uSD_CMD_GPIO_Port GPIOD +#define uSD_DETECT_Pin GPIO_PIN_3 +#define uSD_DETECT_GPIO_Port GPIOD +#define FMC_NOE_Pin GPIO_PIN_4 +#define FMC_NOE_GPIO_Port GPIOD +#define FMC_NWE_Pin GPIO_PIN_5 +#define FMC_NWE_GPIO_Port GPIOD +#define FMC_NE1_Pin GPIO_PIN_7 +#define FMC_NE1_GPIO_Port GPIOD +#define SWO_Pin GPIO_PIN_3 +#define SWO_GPIO_Port GPIOB +#define CODEC_I2S3ext_SD_Pin GPIO_PIN_4 +#define CODEC_I2S3ext_SD_GPIO_Port GPIOB +#define CODEC_I2S3_SD_Pin GPIO_PIN_5 +#define CODEC_I2S3_SD_GPIO_Port GPIOB +#define I2C1_SCL_Pin GPIO_PIN_6 +#define I2C1_SCL_GPIO_Port GPIOB +#define I2C1_SDA_Pin GPIO_PIN_7 +#define I2C1_SDA_GPIO_Port GPIOB +#define I2C2_SDA_Pin GPIO_PIN_9 +#define I2C2_SDA_GPIO_Port GPIOB +#define LED1_Pin GPIO_PIN_0 +#define LED1_GPIO_Port GPIOE +#define LED2_Pin GPIO_PIN_1 +#define LED2_GPIO_Port GPIOE +*/ + +#include "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //Enable all GPIO for now + GPIO_InitTypeDef GPIO_InitStruct = {0}; + // __HAL_RCC_GPIOE_CLK_ENABLE(); + // __HAL_RCC_GPIOC_CLK_ENABLE(); + // __HAL_RCC_GPIOF_CLK_ENABLE(); + // __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + // __HAL_RCC_GPIOG_CLK_ENABLE(); + // __HAL_RCC_GPIOD_CLK_ENABLE(); + + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); + //HAL_GPIO_WritePin(USB_OTGFS_PPWR_EN_GPIO_Port, USB_OTGFS_PPWR_EN_Pin, GPIO_PIN_SET); + + //Configure LED pins + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + //Status LED chain + stm32f4_peripherals_status_led(0,1); + stm32f4_peripherals_status_led(1,1); + stm32f4_peripherals_status_led(2,1); + stm32f4_peripherals_status_led(3,1); + + //Never reset pins + // never_reset_pin_number(2,13); //PC13 anti tamp + // never_reset_pin_number(2,14); //PC14 OSC32_IN + // never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + //never_reset_pin_number(0,15); //PA15 JTDI + //never_reset_pin_number(1,3); //PB3 JTDO + //never_reset_pin_number(1,4); //PB4 JTRST + + // Port H is not included in GPIO port array + // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,1); //PH1 JTRST +} + +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { + switch(led) + { + case 0: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, state); + break; + case 1: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, state); + break; + case 2: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, state); + break; + case 3: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, state); + break; + default: break; + } +} + + diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c new file mode 100644 index 0000000000..aa9d7abf53 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c @@ -0,0 +1,107 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, NULL, NULL}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { + I2C_SDA(1, 4, &pin_PB07), +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[5] = {SPI1, NULL, NULL, NULL, NULL}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { + SPI(1, 5, &pin_PA05), +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { + SPI(1, 5, &pin_PA06), +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { + SPI(1, 5, &pin_PA04), +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, NULL, NULL, NULL, NULL, NULL}; +bool mcu_uart_has_usart[MAX_UART] = {true, false, false, false, false, false}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PB06), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(1, 7, &pin_PA10), + UART(1, 7, &pin_PB07), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, NULL, + NULL, NULL, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(13,9,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(14,9,1,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), +}; diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h new file mode 100644 index 0000000000..e0141e6dab --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h @@ -0,0 +1,58 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + + +//SPI +extern SPI_TypeDef * mcu_spi_banks[5]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; +extern const mcu_uart_rx_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]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c new file mode 100644 index 0000000000..c56de5a295 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c @@ -0,0 +1,161 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); + +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h new file mode 100644 index 0000000000..180f5c316f --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H + +//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only +//pg 50 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +//pg 51 +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only +//pg 52 +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +//pg 53 +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PC04; +//pg 54 +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only +//pg 55 +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +//pg 56 +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; // 144 only +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +//pg 57 +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 58 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PG02; // 144 only +extern const mcu_pin_obj_t pin_PG03; // 144 only +extern const mcu_pin_obj_t pin_PG04; // 144 only +extern const mcu_pin_obj_t pin_PG05; // 144 only +extern const mcu_pin_obj_t pin_PG06; // 144 only +extern const mcu_pin_obj_t pin_PG07; // 144 only +extern const mcu_pin_obj_t pin_PG08; // 144 only +//pg 59 +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +//pg 60 +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +//pg 61 +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +//pg 62 +extern const mcu_pin_obj_t pin_PG09; // 144 only +extern const mcu_pin_obj_t pin_PG10; // 144 only +extern const mcu_pin_obj_t pin_PG11; // 144 only +extern const mcu_pin_obj_t pin_PG12; // 144 only +extern const mcu_pin_obj_t pin_PG13; // 144 only +extern const mcu_pin_obj_t pin_PG14; // 144 only +extern const mcu_pin_obj_t pin_PG15; // 144 only +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +//pg 63 +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H From f884c2b9b68baba4031f7cc95aa04d01fed218bf Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 15 Mar 2020 19:34:41 -0700 Subject: [PATCH 075/919] Incremental update --- ports/stm/boards/STM32F412CGUx_FLASH.ld | 189 ----------- ports/stm/boards/thunderpack/mpconfigboard.h | 10 +- ports/stm/boards/thunderpack/mpconfigboard.mk | 9 +- .../boards/thunderpack/stm32f4xx_hal_conf.h | 2 +- ports/stm/peripherals/stm32f4/pins.h | 11 +- .../stm32f4/stm32f412cx_thunderpack/clocks.c | 14 +- .../stm32f4/stm32f412cx_thunderpack/gpio.c | 89 +++-- .../peripherals/stm32f4/stm32f412zx/gpio.c | 10 +- ports/stm/supervisor/internal_flash.h | 2 +- ports/stm/system_stm32f4xx.c | 308 +++++++++--------- 10 files changed, 225 insertions(+), 419 deletions(-) delete mode 100644 ports/stm/boards/STM32F412CGUx_FLASH.ld diff --git a/ports/stm/boards/STM32F412CGUx_FLASH.ld b/ports/stm/boards/STM32F412CGUx_FLASH.ld deleted file mode 100644 index c394b8646e..0000000000 --- a/ports/stm/boards/STM32F412CGUx_FLASH.ld +++ /dev/null @@ -1,189 +0,0 @@ -/* -****************************************************************************** -** - -** File : LinkerScript.ld -** -** Author : Auto-generated by System Workbench for STM32 -** -** Abstract : Linker script for STM32F412CGUx series -** 1024Kbytes FLASH and 256Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2019 STMicroelectronics

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of STMicroelectronics nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20040000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index e374089288..18977c131c 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -23,7 +23,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -//Micropython setup +#define BOARD_THUNDERPACK_STM32F412 #define MICROPY_HW_BOARD_NAME "THUNDERPACK" #define MICROPY_HW_MCU_NAME "STM32F412xGU" @@ -33,5 +33,11 @@ #define BOARD_OSC_DIV (24) #define BOARD_NO_VBUS_SENSE (1) +#define CP_RGB_STATUS_LED +#define CP_RGB_STATUS_R (&pin_PA00) +#define CP_RGB_STATUS_G (&pin_PA01) +#define CP_RGB_STATUS_B (&pin_PA02) +#define MICROPY_HW_LED_STATUS (&pin_PA03) + #define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) \ No newline at end of file diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index a5febd5802..9827b9e066 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -7,16 +7,11 @@ USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -# QSPI_FLASH_FILESYSTEM = 1 -# EXTERNAL_FLASH_DEVICE_COUNT = 1 -# EXTERNAL_FLASH_DEVICES = N25Q128A -# LONGINT_IMPL = MPZ - MCU_SERIES = m4 MCU_VARIANT = stm32f4 MCU_SUB_VARIANT = stm32f412cx_thunderpack MCU_PACKAGE = 48 -CMSIS_MCU = STM32F412Zx -LD_FILE = boards/STM32F412CGUx_FLASH.ld +CMSIS_MCU = STM32F412Cx +LD_FILE = boards/STM32F412ZGTx_FLASH.ld diff --git a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h index 530c7e6055..15162dfcca 100644 --- a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h +++ b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h @@ -70,7 +70,7 @@ #define HAL_PCD_MODULE_ENABLED /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_DSI_MODULE_ENABLED */ -#define HAL_QSPI_MODULE_ENABLED +/* #define HAL_QSPI_MODULE_ENABLED */ /* #define HAL_CEC_MODULE_ENABLED */ /* #define HAL_FMPI2C_MODULE_ENABLED */ /* #define HAL_SPDIFRX_MODULE_ENABLED */ diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/stm32f4/pins.h index 44ef4c1baf..7e8baf89dd 100644 --- a/ports/stm/peripherals/stm32f4/pins.h +++ b/ports/stm/peripherals/stm32f4/pins.h @@ -40,7 +40,7 @@ typedef struct { mp_obj_base_t base; uint8_t port:4; uint8_t number:4; - uint8_t adc_unit:3; + uint8_t adc_unit:3; uint8_t adc_channel:5; } mcu_pin_obj_t; @@ -51,8 +51,8 @@ typedef struct { #define ADC_3 4 //STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, -//but all 3 ADCs will share the same input number per pin. -//F4 family has 3 ADC max, 24 channels max. +//but all 3 ADCs will share the same input number per pin. +//F4 family has 3 ADC max, 24 channels max. #define ADC_INPUT(mask, number) \ .adc_unit = mask, \ .adc_channel = number, @@ -64,7 +64,7 @@ typedef struct { extern const mp_obj_type_t mcu_pin_type; // STM32 can have up to 9 ports, each restricted to 16 pins -// We split the pin/port evenly, in contrast to nrf. +// We split the pin/port evenly, in contrast to nrf. #define PIN(p_port, p_number, p_adc) \ { \ { &mcu_pin_type }, \ @@ -83,6 +83,9 @@ extern const mp_obj_type_t mcu_pin_type; #ifdef STM32F411xE #include "stm32f411xe/pins.h" #endif +#ifdef BOARD_THUNDERPACK_STM32F412 +#include "stm32f412cx_thunderpack/pins.h" +#endif #ifdef STM32F412Zx #include "stm32f412zx/pins.h" #endif diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c index 0f2537df8a..3e2766516b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c @@ -47,8 +47,8 @@ void stm32f4_peripherals_clocks_init(void) { RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 200; + RCC_OscInitStruct.PLL.PLLM = 12; + RCC_OscInitStruct.PLL.PLLN = 100; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; RCC_OscInitStruct.PLL.PLLR = 2; @@ -57,18 +57,16 @@ void stm32f4_peripherals_clocks_init(void) { /* Select PLLSAI output as USB clock source */ PeriphClkInitStruct.PLLI2S.PLLI2SM = 12; PeriphClkInitStruct.PLLI2S.PLLI2SQ = 3; - PeriphClkInitStruct.PLLI2S.PLLI2SR = 2; PeriphClkInitStruct.PLLI2S.PLLI2SN = 72; + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLI2SQ; PeriphClkInitStruct.PLLI2SSelection = RCC_PLLI2SCLKSOURCE_PLLSRC; - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 * clocks dividers */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c index 8f47ba3197..7172a2520d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c @@ -182,61 +182,52 @@ #include "common-hal/microcontroller/Pin.h" void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - // __HAL_RCC_GPIOE_CLK_ENABLE(); - // __HAL_RCC_GPIOC_CLK_ENABLE(); - // __HAL_RCC_GPIOF_CLK_ENABLE(); - // __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - // __HAL_RCC_GPIOG_CLK_ENABLE(); - // __HAL_RCC_GPIOD_CLK_ENABLE(); + //Enable all GPIO for now + GPIO_InitTypeDef GPIO_InitStruct = {0}; + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); - //HAL_GPIO_WritePin(USB_OTGFS_PPWR_EN_GPIO_Port, USB_OTGFS_PPWR_EN_Pin, GPIO_PIN_SET); + //Configure LED pins + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - //Configure LED pins - GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + //Status LED chain + stm32f4_peripherals_status_led(0,1); + stm32f4_peripherals_status_led(1,0); + stm32f4_peripherals_status_led(2,0); + stm32f4_peripherals_status_led(3,0); - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,1); - stm32f4_peripherals_status_led(2,1); - stm32f4_peripherals_status_led(3,1); - - //Never reset pins - // never_reset_pin_number(2,13); //PC13 anti tamp - // never_reset_pin_number(2,14); //PC14 OSC32_IN - // never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK - //never_reset_pin_number(0,15); //PA15 JTDI - //never_reset_pin_number(1,3); //PB3 JTDO - //never_reset_pin_number(1,4); //PB4 JTRST - - // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO - // never_reset_pin_number(5,1); //PH1 JTRST + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK } void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - switch(led) - { - case 0: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, state); - break; - case 1: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, state); - break; - case 2: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, state); - break; - case 3: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, state); - break; - default: break; - } + switch(led) + { + case 0: + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, state); + break; + case 1: + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, state); + break; + case 2: + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, state); + break; + case 3: + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, state); + break; + default: break; + } } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index d17ab4e018..4ec6b107fc 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -220,7 +220,7 @@ void stm32f4_peripherals_gpio_init(void) { //never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } @@ -228,13 +228,13 @@ void stm32f4_peripherals_gpio_init(void) { void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { switch(led) { - case 0: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, (state ^ 1)); + case 0: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, (state ^ 1)); break; - case 1: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, (state ^ 1)); + case 1: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, (state ^ 1)); break; - case 2: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, (state ^ 1)); + case 2: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, (state ^ 1)); break; - case 3: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, (state ^ 1)); + case 3: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, (state ^ 1)); break; default: break; } diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 9f16a799d8..92d1baddc0 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -42,7 +42,7 @@ #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif -#ifdef STM32F412Zx +#if (defined(STM32F412Zx) || defined(STM32F412Cx)) #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/system_stm32f4xx.c index caa4f9cafb..dd9ab1acd9 100644 --- a/ports/stm/system_stm32f4xx.c +++ b/ports/stm/system_stm32f4xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,16 +28,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f4xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -79,8 +79,8 @@ /** @addtogroup stm32f4xx_system * @{ - */ - + */ + /** @addtogroup STM32F4xx_System_Private_Includes * @{ */ @@ -89,7 +89,7 @@ #include "stm32f4xx.h" #include "py/mpconfig.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -117,11 +117,12 @@ /*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)\ + || defined(STM32F412Cx) /* #define DATA_IN_ExtSRAM */ #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ - STM32F412Zx || STM32F412Vx */ - + STM32F412Zx || STM32F412Vx || STM32F412Zx*/ + #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) /* #define DATA_IN_ExtSDRAM */ @@ -131,7 +132,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -153,7 +154,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -170,7 +171,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; */ #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - static void SystemInit_ExtMemCtl(void); + static void SystemInit_ExtMemCtl(void); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /** @@ -183,7 +184,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory + * Initialize the FPU setting, vector table location and External memory * configuration. * @param None * @retval None @@ -214,7 +215,7 @@ void SystemInit(void) RCC->CIR = 0x00000000; #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); + SystemInit_ExtMemCtl(); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /* Configure the Vector Table location add offset address ------------------*/ @@ -232,41 +233,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value * depends on the application requirements), user has to ensure that HSE_VALUE * is same as the real frequency of the crystal used. Otherwise, this function * may have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -282,10 +283,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -334,79 +335,79 @@ void SystemInit_ExtMemCtl(void) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; - + /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -414,50 +415,50 @@ void SystemInit_ExtMemCtl(void) tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ FMC_Bank5_6->SDCMR = 0x00000073; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ FMC_Bank5_6->SDCMR = 0x00046014; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) @@ -465,7 +466,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Configure and enable Bank1_SRAM2 */ FMC_Bank1->BTCR[2] = 0x00001091; @@ -473,7 +474,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ - (void)(tmp); + (void)(tmp); } #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ #elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) @@ -499,13 +500,13 @@ void SystemInit_ExtMemCtl(void) clock */ RCC->AHB1ENR |= 0x0000007D; #else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ +#endif /* STM32F446xx */ /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + #if defined(STM32F446xx) /* Connect PAx pins to FMC Alternate function */ GPIOA->AFR[0] |= 0xC0000000; @@ -535,78 +536,78 @@ void SystemInit_ExtMemCtl(void) /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x000000CC; GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ + /* Configure PDx pins speed to 50 MHz */ GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00000CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ + /* Configure PEx pins speed to 50 MHz */ GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) + || defined(STM32F469xx) || defined(STM32F479xx) /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -616,72 +617,73 @@ void SystemInit_ExtMemCtl(void) /* Configure and enable SDRAM bank1 */ #if defined(STM32F446xx) FMC_Bank5_6->SDCR[0] = 0x00001954; -#else +#else FMC_Bank5_6->SDCR[0] = 0x000019E4; #endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x000000F3; -#else +#else FMC_Bank5_6->SDCMR = 0x00000073; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x00044014; -#else +#else FMC_Bank5_6->SDCMR = 0x00046014; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; #if defined(STM32F446xx) FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); -#else +#else FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); #endif /* STM32F446xx */ - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #endif /* DATA_IN_ExtSDRAM */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)\ + || defined(STM32F412Cx) #if defined(DATA_IN_ExtSRAM) /*-- GPIOs Configuration -----------------------------------------------------*/ @@ -689,55 +691,55 @@ void SystemInit_ExtMemCtl(void) RCC->AHB1ENR |= 0x00000078; /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0x00CCCCCC; GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ + /* Configure PFx pins speed to 100 MHz */ GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0x00CCCCCC; GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ + /* Configure PGx pins speed to 100 MHz */ GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /*-- FMC/FSMC Configuration --------------------------------------------------*/ /* Enable the FMC/FSMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -749,7 +751,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); @@ -759,7 +761,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\ - || defined(STM32F412Zx) || defined(STM32F412Vx) + || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Cx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); /* Configure and enable Bank1_SRAM2 */ @@ -770,8 +772,8 @@ void SystemInit_ExtMemCtl(void) #endif /* DATA_IN_ExtSRAM */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ + (void)(tmp); } #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ /** From 5dbdf72472b2d441667a667c8a02c0617491bdb8 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 15 Mar 2020 19:36:16 -0700 Subject: [PATCH 076/919] Fix LED port. --- .../peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c | 8 ++++---- ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c index 7172a2520d..d2844f1a6d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c @@ -215,16 +215,16 @@ void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { switch(led) { case 0: - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, state); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, state); break; case 1: - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, state); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, state); break; case 2: - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, state); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, state); break; case 3: - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, state); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, state); break; default: break; } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 4ec6b107fc..fde10be3c9 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -228,13 +228,13 @@ void stm32f4_peripherals_gpio_init(void) { void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { switch(led) { - case 0: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, (state ^ 1)); + case 0: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, (state ^ 1)); break; - case 1: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, (state ^ 1)); + case 1: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, (state ^ 1)); break; - case 2: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, (state ^ 1)); + case 2: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, (state ^ 1)); break; - case 3: HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, (state ^ 1)); + case 3: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, (state ^ 1)); break; default: break; } From 8a93a81a2628a644b8bcc656b96881b6de35fa98 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 15 Mar 2020 22:31:36 -0700 Subject: [PATCH 077/919] Chip specific code. --- ports/stm/common-hal/busio/UART.c | 4 + ports/stm/peripherals/stm32f4/periph.h | 45 +++--- .../stm32f4/stm32f412cx_thunderpack/periph.c | 128 +++++++++++++++++- .../stm32f4/stm32f412cx_thunderpack/pins.c | 36 ++--- .../stm32f4/stm32f412cx_thunderpack/pins.h | 36 ++--- ports/stm/supervisor/usb.c | 8 +- 6 files changed, 193 insertions(+), 64 deletions(-) diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 0b434fd023..20648bf3d4 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -443,9 +443,11 @@ STATIC void uart_clock_enable(uint16_t mask) { #endif #ifdef USART3 if (mask & (1 << 2)) { + #ifndef STM32F412Cx __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_ENABLE(); + #endif } #endif #ifdef UART4 @@ -516,9 +518,11 @@ STATIC void uart_clock_disable(uint16_t mask) { #endif #ifdef USART3 if (mask & (1 << 2)) { + #ifndef STM32F412Cx __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_DISABLE(); + #endif } #endif #ifdef UART4 diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h index d311afe4a1..663df4bedf 100644 --- a/ports/stm/peripherals/stm32f4/periph.h +++ b/ports/stm/peripherals/stm32f4/periph.h @@ -33,9 +33,9 @@ #include "stm32f4xx_hal.h" #include "stm32f4/pins.h" -// I2C +// I2C // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) @@ -44,8 +44,8 @@ typedef struct { } mcu_i2c_sda_obj_t; typedef struct { - uint8_t i2c_index:4; - uint8_t altfn_index:4; + uint8_t i2c_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_i2c_scl_obj_t; @@ -64,9 +64,9 @@ typedef struct { .pin = scl_pin, \ } -// SPI +// SPI // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { uint8_t spi_index:4; //Up to 6 SPI units @@ -75,20 +75,20 @@ typedef struct { } mcu_spi_sck_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_mosi_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_miso_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_nss_obj_t; @@ -101,17 +101,17 @@ typedef struct { // UART // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; + uint8_t uart_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_uart_tx_obj_t; typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; + uint8_t uart_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_uart_rx_obj_t; @@ -124,8 +124,8 @@ typedef struct { //Timers typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; + uint8_t tim_index:4; + uint8_t altfn_index:4; uint8_t channel_index:4; const mcu_pin_obj_t * pin; } mcu_tim_pin_obj_t; @@ -154,6 +154,13 @@ typedef struct { #include "stm32f411xe/periph.h" #endif +#ifdef BOARD_THUNDERPACK_STM32F412 +#define HAS_DAC 0 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f412cx_thunderpack/periph.h" +#endif + #ifdef STM32F412Zx #define HAS_DAC 0 #define HAS_TRNG 1 diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c index aa9d7abf53..f5effa80ed 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c @@ -31,56 +31,133 @@ // I2C -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, NULL, NULL}; +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 + I2C_SDA(2, 9, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), + I2C_SDA(3, 9, &pin_PB08) }; const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) }; // SPI -SPI_TypeDef * mcu_spi_banks[5] = {SPI1, NULL, NULL, NULL, NULL}; +SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PC07), + SPI(2, 5, &pin_PD03), + SPI(3, 6, &pin_PB03), + SPI(3, 7, &pin_PB12), + SPI(3, 6, &pin_PC10), + SPI(4, 6, &pin_PB13), + SPI(4, 5, &pin_PE02), + SPI(4, 5, &pin_PE12), + SPI(5, 6, &pin_PB00), + SPI(5, 6, &pin_PE02), + SPI(5, 6, &pin_PE12) }; const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { SPI(1, 5, &pin_PA07), SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), + SPI(3, 5, &pin_PD06), + SPI(4, 5, &pin_PA01), + SPI(4, 5, &pin_PE06), + SPI(4, 5, &pin_PE14), + SPI(5, 6, &pin_PA10), + SPI(5, 6, &pin_PB08), + SPI(5, 6, &pin_PE06), + SPI(5, 6, &pin_PE14) }; const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), + SPI(4, 6, &pin_PA11), + SPI(4, 5, &pin_PE05), + SPI(4, 5, &pin_PE13), + SPI(5, 6, &pin_PA12), + SPI(5, 6, &pin_PE05), + SPI(5, 6, &pin_PE13) }; const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), + SPI(4, 6, &pin_PB12), + SPI(4, 5, &pin_PE04), + SPI(4, 5, &pin_PE11), + SPI(5, 6, &pin_PB01), + SPI(5, 6, &pin_PE04), + SPI(5, 6, &pin_PE11) }; //UART -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, NULL, NULL, NULL, NULL, NULL}; -bool mcu_uart_has_usart[MAX_UART] = {true, false, false, false, false, false}; +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { + UART(2, 7, &pin_PA02), UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PA15), + UART(6, 8, &pin_PA11), UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), + UART(6, 8, &pin_PG14), }; const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(2, 7, &pin_PA03), UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB03), UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(3, 7, &pin_PC05), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), + UART(6, 8, &pin_PG09), }; //Timers //TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, NULL, - NULL, NULL, TIM13, TIM14}; +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { TIM(2,1,1,&pin_PA00), @@ -101,7 +178,46 @@ const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { TIM(1,1,2,&pin_PA09), TIM(1,1,3,&pin_PA10), TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), TIM(3,2,2,&pin_PB05), TIM(4,2,1,&pin_PB06), TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(2,1,4,&pin_PB11), + TIM(12,9,1,&pin_PB14), + TIM(12,9,2,&pin_PB15), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(8,3,1,&pin_PC06), + TIM(8,3,2,&pin_PC07), + TIM(8,3,3,&pin_PC08), + TIM(8,3,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), + TIM(10,3,1,&pin_PF06), + TIM(11,3,1,&pin_PF07), + TIM(13,9,1,&pin_PF08), + TIM(14,9,1,&pin_PF09), + TIM(5,2,1,&pin_PF03), + TIM(5,2,2,&pin_PF04), + TIM(5,2,3,&pin_PF05), + TIM(5,2,4,&pin_PF10), }; diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c index c56de5a295..fddab5ef1c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h index 180f5c316f..07c22d5283 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h @@ -38,17 +38,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -69,13 +69,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 358c2de5b3..86a51d7506 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -59,13 +59,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -80,11 +80,13 @@ void init_usb_hardware(void) { never_reset_pin_number(0, 12); /* Configure VBUS Pin */ +#if (BOARD_NO_VBUS_SENSE) GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); +#endif /* This for ID line debug */ GPIO_InitStruct.Pin = GPIO_PIN_10; @@ -103,7 +105,7 @@ void init_usb_hardware(void) { HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); #endif - + /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); From 07549b7fd955cb1368a58d12e82e005865305f26 Mon Sep 17 00:00:00 2001 From: jgillick Date: Tue, 17 Mar 2020 00:27:04 -0700 Subject: [PATCH 078/919] Bring back trimmed spaces. --- ports/stm/peripherals/stm32f4/periph.h | 40 +-- ports/stm/peripherals/stm32f4/pins.h | 10 +- .../peripherals/stm32f4/stm32f412zx/gpio.c | 3 +- ports/stm/supervisor/usb.c | 8 +- ports/stm/system_stm32f4xx.c | 304 +++++++++--------- 5 files changed, 182 insertions(+), 183 deletions(-) diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h index 663df4bedf..1dfa7ac45e 100644 --- a/ports/stm/peripherals/stm32f4/periph.h +++ b/ports/stm/peripherals/stm32f4/periph.h @@ -33,9 +33,9 @@ #include "stm32f4xx_hal.h" #include "stm32f4/pins.h" -// I2C +// I2C // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) @@ -44,8 +44,8 @@ typedef struct { } mcu_i2c_sda_obj_t; typedef struct { - uint8_t i2c_index:4; - uint8_t altfn_index:4; + uint8_t i2c_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_i2c_scl_obj_t; @@ -64,9 +64,9 @@ typedef struct { .pin = scl_pin, \ } -// SPI +// SPI // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { uint8_t spi_index:4; //Up to 6 SPI units @@ -75,20 +75,20 @@ typedef struct { } mcu_spi_sck_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_mosi_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_miso_obj_t; typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; + uint8_t spi_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_spi_nss_obj_t; @@ -101,17 +101,17 @@ typedef struct { // UART // TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. +// find a compelling reason to store more unique data in them. typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; + uint8_t uart_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_uart_tx_obj_t; typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; + uint8_t uart_index:4; + uint8_t altfn_index:4; const mcu_pin_obj_t * pin; } mcu_uart_rx_obj_t; @@ -124,8 +124,8 @@ typedef struct { //Timers typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; + uint8_t tim_index:4; + uint8_t altfn_index:4; uint8_t channel_index:4; const mcu_pin_obj_t * pin; } mcu_tim_pin_obj_t; @@ -184,4 +184,4 @@ typedef struct { #include "stm32f407xx/periph.h" #endif -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/stm32f4/pins.h index 7e8baf89dd..ce2980969b 100644 --- a/ports/stm/peripherals/stm32f4/pins.h +++ b/ports/stm/peripherals/stm32f4/pins.h @@ -40,7 +40,7 @@ typedef struct { mp_obj_base_t base; uint8_t port:4; uint8_t number:4; - uint8_t adc_unit:3; + uint8_t adc_unit:3; uint8_t adc_channel:5; } mcu_pin_obj_t; @@ -51,8 +51,8 @@ typedef struct { #define ADC_3 4 //STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, -//but all 3 ADCs will share the same input number per pin. -//F4 family has 3 ADC max, 24 channels max. +//but all 3 ADCs will share the same input number per pin. +//F4 family has 3 ADC max, 24 channels max. #define ADC_INPUT(mask, number) \ .adc_unit = mask, \ .adc_channel = number, @@ -64,7 +64,7 @@ typedef struct { extern const mp_obj_type_t mcu_pin_type; // STM32 can have up to 9 ports, each restricted to 16 pins -// We split the pin/port evenly, in contrast to nrf. +// We split the pin/port evenly, in contrast to nrf. #define PIN(p_port, p_number, p_adc) \ { \ { &mcu_pin_type }, \ @@ -96,4 +96,4 @@ extern const mp_obj_type_t mcu_pin_type; #include "stm32f407xx/pins.h" #endif -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index fde10be3c9..68a75f4639 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -220,7 +220,7 @@ void stm32f4_peripherals_gpio_init(void) { //never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } @@ -240,4 +240,3 @@ void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } } - diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 86a51d7506..b2c417b11e 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -59,13 +59,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -105,10 +105,10 @@ void init_usb_hardware(void) { HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); #endif - + /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); init_usb_vbus_sense(); -} +} \ No newline at end of file diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/system_stm32f4xx.c index dd9ab1acd9..23a1336478 100644 --- a/ports/stm/system_stm32f4xx.c +++ b/ports/stm/system_stm32f4xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,16 +28,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f4xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -79,8 +79,8 @@ /** @addtogroup stm32f4xx_system * @{ - */ - + */ + /** @addtogroup STM32F4xx_System_Private_Includes * @{ */ @@ -89,7 +89,7 @@ #include "stm32f4xx.h" #include "py/mpconfig.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -121,8 +121,8 @@ || defined(STM32F412Cx) /* #define DATA_IN_ExtSRAM */ #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ - STM32F412Zx || STM32F412Vx || STM32F412Zx*/ - + STM32F412Zx || STM32F412Vx || STM32F412Cx */ + #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) /* #define DATA_IN_ExtSDRAM */ @@ -132,7 +132,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -154,7 +154,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -171,7 +171,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; */ #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - static void SystemInit_ExtMemCtl(void); + static void SystemInit_ExtMemCtl(void); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /** @@ -184,7 +184,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory + * Initialize the FPU setting, vector table location and External memory * configuration. * @param None * @retval None @@ -215,7 +215,7 @@ void SystemInit(void) RCC->CIR = 0x00000000; #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); + SystemInit_ExtMemCtl(); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /* Configure the Vector Table location add offset address ------------------*/ @@ -233,41 +233,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value * depends on the application requirements), user has to ensure that HSE_VALUE * is same as the real frequency of the crystal used. Otherwise, this function * may have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -283,10 +283,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -335,79 +335,79 @@ void SystemInit_ExtMemCtl(void) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; - + /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -415,50 +415,50 @@ void SystemInit_ExtMemCtl(void) tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ FMC_Bank5_6->SDCMR = 0x00000073; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ FMC_Bank5_6->SDCMR = 0x00046014; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) @@ -466,7 +466,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Configure and enable Bank1_SRAM2 */ FMC_Bank1->BTCR[2] = 0x00001091; @@ -474,7 +474,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ - (void)(tmp); + (void)(tmp); } #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ #elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) @@ -500,13 +500,13 @@ void SystemInit_ExtMemCtl(void) clock */ RCC->AHB1ENR |= 0x0000007D; #else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ +#endif /* STM32F446xx */ /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + #if defined(STM32F446xx) /* Connect PAx pins to FMC Alternate function */ GPIOA->AFR[0] |= 0xC0000000; @@ -536,78 +536,78 @@ void SystemInit_ExtMemCtl(void) /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x000000CC; GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ + /* Configure PDx pins speed to 50 MHz */ GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00000CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ + /* Configure PEx pins speed to 50 MHz */ GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) + || defined(STM32F469xx) || defined(STM32F479xx) /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -617,65 +617,65 @@ void SystemInit_ExtMemCtl(void) /* Configure and enable SDRAM bank1 */ #if defined(STM32F446xx) FMC_Bank5_6->SDCR[0] = 0x00001954; -#else +#else FMC_Bank5_6->SDCR[0] = 0x000019E4; #endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x000000F3; -#else +#else FMC_Bank5_6->SDCMR = 0x00000073; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x00044014; -#else +#else FMC_Bank5_6->SDCMR = 0x00046014; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; #if defined(STM32F446xx) FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); -#else +#else FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); #endif /* STM32F446xx */ - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #endif /* DATA_IN_ExtSDRAM */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ @@ -691,55 +691,55 @@ void SystemInit_ExtMemCtl(void) RCC->AHB1ENR |= 0x00000078; /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0x00CCCCCC; GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ + /* Configure PFx pins speed to 100 MHz */ GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0x00CCCCCC; GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ + /* Configure PGx pins speed to 100 MHz */ GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /*-- FMC/FSMC Configuration --------------------------------------------------*/ /* Enable the FMC/FSMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -751,7 +751,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); @@ -768,12 +768,12 @@ void SystemInit_ExtMemCtl(void) FSMC_Bank1->BTCR[2] = 0x00001011; FSMC_Bank1->BTCR[3] = 0x00000201; FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx || defined(STM32F412Cx) */ #endif /* DATA_IN_ExtSRAM */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx || defined(STM32F412Cx) */ + (void)(tmp); } #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ /** @@ -787,4 +787,4 @@ void SystemInit_ExtMemCtl(void) /** * @} */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file From cbc0e0344da6785aa7d734f9dc267fa5973a3956 Mon Sep 17 00:00:00 2001 From: jgillick Date: Tue, 17 Mar 2020 00:36:12 -0700 Subject: [PATCH 079/919] Revert changes to system_stm32f4xx.c --- ports/stm/system_stm32f4xx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/system_stm32f4xx.c index 23a1336478..5fb2946e8b 100644 --- a/ports/stm/system_stm32f4xx.c +++ b/ports/stm/system_stm32f4xx.c @@ -117,11 +117,10 @@ /*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)\ - || defined(STM32F412Cx) + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) /* #define DATA_IN_ExtSRAM */ #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ - STM32F412Zx || STM32F412Vx || STM32F412Cx */ + STM32F412Zx || STM32F412Vx */ #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) @@ -682,8 +681,7 @@ void SystemInit_ExtMemCtl(void) #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx)\ - || defined(STM32F412Cx) + || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) #if defined(DATA_IN_ExtSRAM) /*-- GPIOs Configuration -----------------------------------------------------*/ @@ -761,18 +759,18 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\ - || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Cx) + || defined(STM32F412Zx) || defined(STM32F412Vx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); /* Configure and enable Bank1_SRAM2 */ FSMC_Bank1->BTCR[2] = 0x00001011; FSMC_Bank1->BTCR[3] = 0x00000201; FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx || defined(STM32F412Cx) */ +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ #endif /* DATA_IN_ExtSRAM */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx || defined(STM32F412Cx) */ + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ (void)(tmp); } #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ From d41ef45a9b8e8b50ad3907ea16ba2c38658af73f Mon Sep 17 00:00:00 2001 From: jgillick Date: Tue, 17 Mar 2020 00:36:18 -0700 Subject: [PATCH 080/919] Update clock. --- .../peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c index 3e2766516b..6078700587 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c @@ -55,10 +55,11 @@ void stm32f4_peripherals_clocks_init(void) { HAL_RCC_OscConfig(&RCC_OscInitStruct); /* Select PLLSAI output as USB clock source */ - PeriphClkInitStruct.PLLI2S.PLLI2SM = 12; - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 3; - PeriphClkInitStruct.PLLI2S.PLLI2SN = 72; PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PLLI2S.PLLI2SN = 72; + PeriphClkInitStruct.PLLI2S.PLLI2SM = 12; + PeriphClkInitStruct.PLLI2S.PLLI2SR = 2; + PeriphClkInitStruct.PLLI2S.PLLI2SQ = 3; PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLI2SQ; PeriphClkInitStruct.PLLI2SSelection = RCC_PLLI2SCLKSOURCE_PLLSRC; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); From 24d1fd2bf1325ea6ede4a73cc6e8251d486f42a4 Mon Sep 17 00:00:00 2001 From: jgillick Date: Tue, 17 Mar 2020 00:48:19 -0700 Subject: [PATCH 081/919] PR Cleanup. --- lib/lwip | 1 + lib/mbedtls | 1 + lib/mynewt-nimble | 1 + lib/stm32lib | 1 + ports/stm/boards/thunderpack/mpconfigboard.h | 2 +- ports/stm/peripherals/stm32f4/periph.h | 2 +- ports/stm/peripherals/stm32f4/pins.h | 2 +- ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c | 1 - ports/stm/supervisor/usb.c | 2 +- ports/stm/system_stm32f4xx.c | 2 +- 10 files changed, 9 insertions(+), 6 deletions(-) create mode 160000 lib/lwip create mode 160000 lib/mbedtls create mode 160000 lib/mynewt-nimble create mode 160000 lib/stm32lib diff --git a/lib/lwip b/lib/lwip new file mode 160000 index 0000000000..159e31b689 --- /dev/null +++ b/lib/lwip @@ -0,0 +1 @@ +Subproject commit 159e31b689577dbf69cf0683bbaffbd71fa5ee10 diff --git a/lib/mbedtls b/lib/mbedtls new file mode 160000 index 0000000000..3f8d78411a --- /dev/null +++ b/lib/mbedtls @@ -0,0 +1 @@ +Subproject commit 3f8d78411a26e833db18d9fbde0e2f0baeda87f0 diff --git a/lib/mynewt-nimble b/lib/mynewt-nimble new file mode 160000 index 0000000000..223714cb16 --- /dev/null +++ b/lib/mynewt-nimble @@ -0,0 +1 @@ +Subproject commit 223714cb16c255cfa701929c0de6d7579bfd2cdd diff --git a/lib/stm32lib b/lib/stm32lib new file mode 160000 index 0000000000..668d7a9e54 --- /dev/null +++ b/lib/stm32lib @@ -0,0 +1 @@ +Subproject commit 668d7a9e54aea98f8fe8a858eac1d3daa80fa824 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 18977c131c..c9602d412b 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -40,4 +40,4 @@ #define MICROPY_HW_LED_STATUS (&pin_PA03) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) \ No newline at end of file +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h index 1dfa7ac45e..5ac8b40615 100644 --- a/ports/stm/peripherals/stm32f4/periph.h +++ b/ports/stm/peripherals/stm32f4/periph.h @@ -184,4 +184,4 @@ typedef struct { #include "stm32f407xx/periph.h" #endif -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ \ No newline at end of file +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/stm32f4/pins.h index ce2980969b..53040995d0 100644 --- a/ports/stm/peripherals/stm32f4/pins.h +++ b/ports/stm/peripherals/stm32f4/pins.h @@ -96,4 +96,4 @@ extern const mp_obj_type_t mcu_pin_type; #include "stm32f407xx/pins.h" #endif -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ \ No newline at end of file +#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 68a75f4639..2eb2967235 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -239,4 +239,3 @@ void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { default: break; } } - diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index b2c417b11e..0c5e70dd8f 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -111,4 +111,4 @@ void init_usb_hardware(void) { __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); init_usb_vbus_sense(); -} \ No newline at end of file +} diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/system_stm32f4xx.c index 5fb2946e8b..caa4f9cafb 100644 --- a/ports/stm/system_stm32f4xx.c +++ b/ports/stm/system_stm32f4xx.c @@ -785,4 +785,4 @@ void SystemInit_ExtMemCtl(void) /** * @} */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From 772ac705d3cbcdbc9cb139c7433a8e6e40db6f0d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Mar 2020 16:23:38 -0500 Subject: [PATCH 082/919] update ulab --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 66b89de8c7..a91b36986d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 66b89de8c714790de8647dc55f59430002044171 +Subproject commit a91b36986d81fd906a6232010778f2a93d690f8e From 69aa010cfc3c67a5cf07b356b55eec964f896ac5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Mar 2020 20:59:52 -0500 Subject: [PATCH 083/919] objslice: take mp_obj_slice_indices from micropython --- locale/ID.po | 203 +++----------------------- locale/circuitpython.pot | 203 +++----------------------- locale/de_DE.po | 203 +++----------------------- locale/en_US.po | 203 +++----------------------- locale/en_x_pirate.po | 203 +++----------------------- locale/es.po | 203 +++----------------------- locale/fil.po | 203 +++----------------------- locale/fr.po | 203 +++----------------------- locale/it_IT.po | 203 +++----------------------- locale/ko.po | 203 +++----------------------- locale/pl.po | 203 +++----------------------- locale/pt_BR.po | 203 +++----------------------- locale/zh_Latn_pinyin.po | 308 ++++++++++++++++----------------------- py/obj.h | 1 + py/objslice.c | 65 +++++++++ 15 files changed, 470 insertions(+), 2340 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 03111a7a8f..12d7b52fbf 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -482,10 +482,6 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -543,34 +539,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -593,14 +561,6 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC sudah digunakan" @@ -709,7 +669,6 @@ msgstr "Gagal untuk mengalokasikan buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" @@ -743,10 +702,6 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -761,22 +716,10 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operasi I2C tidak didukung" @@ -803,28 +746,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "%q pada tidak valid" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -834,12 +765,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -851,7 +781,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ukuran buffer tidak valid" @@ -879,10 +809,6 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -918,10 +844,6 @@ msgstr "Pin untuk channel kanan tidak valid" msgid "Invalid pins" msgstr "Pin-pin tidak valid" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -950,10 +872,6 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" @@ -999,18 +917,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1024,7 +934,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" @@ -1033,23 +942,13 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Tidak pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Tidak ada pin TX" @@ -1078,10 +977,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1150,7 +1045,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1162,14 +1056,9 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" @@ -1192,18 +1081,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1218,14 +1095,10 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1264,14 +1137,6 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1319,14 +1184,6 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1400,26 +1257,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1536,10 +1373,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" @@ -1606,6 +1439,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2020,10 +1857,6 @@ msgstr "" msgid "empty heap" msgstr "heap kosong" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2114,6 +1947,10 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2163,6 +2000,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2232,8 +2073,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2431,6 +2271,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2660,7 +2504,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2720,7 +2564,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7b56d28dc2..c9bad41d01 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -472,10 +472,6 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -533,34 +529,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -583,14 +551,6 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -698,7 +658,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -732,10 +691,6 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -750,22 +705,10 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -792,28 +735,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -823,12 +754,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -840,7 +770,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -868,10 +798,6 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -907,10 +833,6 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -939,10 +861,6 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -988,18 +906,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1013,7 +923,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1022,23 +931,13 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -1067,10 +966,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1138,7 +1033,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1150,14 +1044,9 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1178,18 +1067,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1204,14 +1081,10 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1248,14 +1121,6 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1303,14 +1168,6 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1384,26 +1241,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1519,10 +1356,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -1583,6 +1416,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -1996,10 +1833,6 @@ msgstr "" msgid "empty heap" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2090,6 +1923,10 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2139,6 +1976,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2208,8 +2049,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2407,6 +2247,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2635,7 +2479,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2695,7 +2539,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 78cecce642..eb2170b81b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -476,10 +476,6 @@ msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." msgid "Cannot unambiguously get sizeof scalar" msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Kann nicht ohne MOSI-Pin schreiben." @@ -537,34 +533,6 @@ msgstr "Beschädigter raw code" msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -587,14 +555,6 @@ msgstr "Konnte second buffer nicht zuteilen" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC wird schon benutzt" @@ -702,7 +662,6 @@ msgstr "Konnte keinen RX Buffer allozieren" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" @@ -738,10 +697,6 @@ msgstr "" "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme " "angehalten." -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -756,22 +711,10 @@ msgstr "Gruppe schon benutzt" msgid "Group full" msgstr "Gruppe voll" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C-operation nicht unterstützt" @@ -800,28 +743,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Ungültiger %q pin" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Ungültige BMP-Datei" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -831,12 +762,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -848,7 +778,7 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ungültige Puffergröße" @@ -876,10 +806,6 @@ msgstr "Ungültige Datei" msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -915,10 +841,6 @@ msgstr "Ungültiger Pin für rechten Kanal" msgid "Invalid pins" msgstr "Ungültige Pins" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Ungültige Polarität" @@ -947,10 +869,6 @@ msgstr "Ungültige Anzahl von Stimmen" msgid "Invalid wave file" msgstr "Ungültige wave Datei" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS des Schlüsselwortarguments muss eine id sein" @@ -997,18 +915,10 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1022,7 +932,6 @@ msgid "No CCCD for this Characteristic" msgstr "Kein CCCD für diese Charakteristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Kein DAC im Chip vorhanden" @@ -1031,23 +940,13 @@ msgstr "Kein DAC im Chip vorhanden" msgid "No DMA channel found" msgstr "Kein DMA Kanal gefunden" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Kein RX Pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Kein TX Pin" @@ -1076,10 +975,6 @@ msgstr "Keine Hardwareunterstützung am clk Pin" msgid "No hardware support on pin" msgstr "Keine Hardwareunterstützung an diesem Pin" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Kein Pulldown Widerstand am Pin; 1Mohm wird vorgeschlagen" @@ -1153,7 +1048,6 @@ msgid "" msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1165,14 +1059,9 @@ msgstr "Zugang verweigert" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" @@ -1195,18 +1084,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1221,14 +1098,10 @@ msgid "RTC is not supported on this board" msgstr "Eine RTC wird auf diesem Board nicht unterstützt" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" @@ -1265,14 +1138,6 @@ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" msgid "SDA or SCL needs a pull up" msgstr "SDA oder SCL brauchen pull up" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Abtastrate muss positiv sein" @@ -1320,14 +1185,6 @@ msgstr "Die Stackgröße sollte mindestens 256 sein" msgid "Stream missing readinto() or write() method." msgstr "Stream fehlt readinto() oder write() Methode." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1403,26 +1260,6 @@ msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" msgid "Tuple or struct_time argument required" msgstr "Tuple- oder struct_time-Argument erforderlich" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB beschäftigt" @@ -1540,10 +1377,6 @@ msgstr "Länge des Wertes > max_length" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -1611,6 +1444,10 @@ msgstr "Adresse außerhalb der Grenzen" msgid "addresses is empty" msgstr "adresses ist leer" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg ist eine leere Sequenz" @@ -2025,10 +1862,6 @@ msgstr "leer" msgid "empty heap" msgstr "leerer heap" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "leeres Trennzeichen" @@ -2119,6 +1952,10 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" @@ -2168,6 +2005,10 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2238,8 +2079,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2443,6 +2283,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2671,7 +2515,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2733,7 +2577,6 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" diff --git a/locale/en_US.po b/locale/en_US.po index f452fdaad3..217ce444bf 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -472,10 +472,6 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -533,34 +529,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -583,14 +551,6 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -698,7 +658,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -732,10 +691,6 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -750,22 +705,10 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -792,28 +735,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -823,12 +754,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -840,7 +770,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -868,10 +798,6 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -907,10 +833,6 @@ msgstr "" msgid "Invalid pins" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -939,10 +861,6 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -988,18 +906,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1013,7 +923,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1022,23 +931,13 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -1067,10 +966,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1138,7 +1033,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1150,14 +1044,9 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1178,18 +1067,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1204,14 +1081,10 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1248,14 +1121,6 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1303,14 +1168,6 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1384,26 +1241,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1519,10 +1356,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -1583,6 +1416,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -1996,10 +1833,6 @@ msgstr "" msgid "empty heap" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2090,6 +1923,10 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2139,6 +1976,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2208,8 +2049,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2407,6 +2247,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2635,7 +2479,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2695,7 +2539,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 709571f31b..f911817076 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -476,10 +476,6 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -537,34 +533,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -587,14 +555,6 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -702,7 +662,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -736,10 +695,6 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -754,22 +709,10 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -796,28 +739,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Avast! %q pin be invalid" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -827,12 +758,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -844,7 +774,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -872,10 +802,6 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -911,10 +837,6 @@ msgstr "Belay that! Invalid pin for starboard-side channel" msgid "Invalid pins" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -943,10 +865,6 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -992,18 +910,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1017,7 +927,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Shiver me timbers! There be no DAC on this chip" @@ -1026,23 +935,13 @@ msgstr "Shiver me timbers! There be no DAC on this chip" msgid "No DMA channel found" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -1071,10 +970,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1142,7 +1037,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1154,14 +1048,9 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Belay that! Th' Pin be not ADC capable" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1182,18 +1071,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1208,14 +1085,10 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1252,14 +1125,6 @@ msgstr "Runnin' in safe mode! Nay runnin' saved code.\n" msgid "SDA or SCL needs a pull up" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1307,14 +1172,6 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1388,26 +1245,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1523,10 +1360,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "Blimey! Yer code filename has two extensions\n" @@ -1587,6 +1420,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2000,10 +1837,6 @@ msgstr "" msgid "empty heap" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2094,6 +1927,10 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2143,6 +1980,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2212,8 +2053,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2411,6 +2251,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2639,7 +2483,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2699,7 +2543,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/es.po b/locale/es.po index 9c7f3e3cb4..20bfbdd3ac 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -478,10 +478,6 @@ msgstr "No se puede transmitir sin pines MOSI y MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "No se puede obtener inequívocamente sizeof escalar" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "No se puede escribir sin pin MOSI." @@ -539,34 +535,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -589,14 +557,6 @@ msgstr "No se pudo asignar el segundo buffer" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC ya está siendo utilizado" @@ -704,7 +664,6 @@ msgstr "Ha fallado la asignación del buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" @@ -738,10 +697,6 @@ msgstr "El archivo ya existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -756,22 +711,10 @@ msgstr "" msgid "Group full" msgstr "Group lleno" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operación I2C no soportada" @@ -800,28 +743,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pin %q inválido" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Archivo BMP inválido" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -831,12 +762,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -848,7 +778,7 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Tamaño de buffer inválido" @@ -876,10 +806,6 @@ msgstr "Archivo inválido" msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -915,10 +841,6 @@ msgstr "Pin inválido para canal derecho" msgid "Invalid pins" msgstr "pines inválidos" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polaridad inválida" @@ -947,10 +869,6 @@ msgstr "Cuenta de voces inválida" msgid "Invalid wave file" msgstr "Archivo wave inválido" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS del agumento por palabra clave deberia ser un identificador" @@ -996,18 +914,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1021,7 +931,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "El chip no tiene DAC" @@ -1030,23 +939,13 @@ msgstr "El chip no tiene DAC" msgid "No DMA channel found" msgstr "No se encontró el canal DMA" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Sin pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Sin pin TX" @@ -1075,10 +974,6 @@ msgstr "Sin soporte de hardware en el pin clk" msgid "No hardware support on pin" msgstr "Sin soporte de hardware en pin" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1152,7 +1047,6 @@ msgstr "" "construcion" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1164,14 +1058,9 @@ msgstr "Permiso denegado" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin no tiene capacidad ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1194,18 +1083,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1220,14 +1097,10 @@ msgid "RTC is not supported on this board" msgstr "RTC no soportado en esta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Solo-lectura" @@ -1265,14 +1138,6 @@ msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Sample rate debe ser positivo" @@ -1320,14 +1185,6 @@ msgstr "El tamaño de la pila debe ser de al menos 256" msgid "Stream missing readinto() or write() method." msgstr "A Stream le falta el método readinto() o write()." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1401,26 +1258,6 @@ msgstr "Traceback (ultima llamada reciente):\n" msgid "Tuple or struct_time argument required" msgstr "Argumento tuple o struct_time requerido" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB ocupado" @@ -1537,10 +1374,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "funciones Viper actualmente no soportan más de 4 argumentos." -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" @@ -1607,6 +1440,10 @@ msgstr "address fuera de límites" msgid "addresses is empty" msgstr "addresses esta vacío" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "argumento es una secuencia vacía" @@ -2027,10 +1864,6 @@ msgstr "vacío" msgid "empty heap" msgstr "heap vacío" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "separator vacío" @@ -2121,6 +1954,10 @@ msgstr "sistema de archivos debe proporcionar método de montaje" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" @@ -2170,6 +2007,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2239,8 +2080,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2441,6 +2281,10 @@ msgstr "error de dominio matemático" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2673,7 +2517,7 @@ msgstr "solo se admiten segmentos con step=1 (alias None)" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2733,7 +2577,6 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" diff --git a/locale/fil.po b/locale/fil.po index ed31a176b7..838089dbdc 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -480,10 +480,6 @@ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." msgid "Cannot unambiguously get sizeof scalar" msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Hindi maaring isulat kapag walang MOSI pin." @@ -542,34 +538,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -592,14 +560,6 @@ msgstr "Hindi ma-iallocate ang second buffer" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "Ginagamit na ang DAC" @@ -712,7 +672,6 @@ msgstr "Nabigong ilaan ang RX buffer" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" @@ -746,10 +705,6 @@ msgstr "Mayroong file" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -764,22 +719,10 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "Hindi supportado ang operasyong I2C" @@ -808,28 +751,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Mali ang %q pin" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Mali ang BMP file" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -839,12 +770,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -856,7 +786,7 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Mali ang buffer size" @@ -884,10 +814,6 @@ msgstr "Mali ang file" msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -923,10 +849,6 @@ msgstr "Mali ang pin para sa kanang channel" msgid "Invalid pins" msgstr "Mali ang pins" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Mali ang polarity" @@ -955,10 +877,6 @@ msgstr "Maling bilang ng voice" msgid "Invalid wave file" msgstr "May hindi tama sa wave file" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" @@ -1004,18 +922,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1029,7 +939,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Walang DAC sa chip" @@ -1038,23 +947,13 @@ msgstr "Walang DAC sa chip" msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Walang RX pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Walang TX pin" @@ -1083,10 +982,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1158,7 +1053,6 @@ msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1170,14 +1064,9 @@ msgstr "Walang pahintulot" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Ang pin ay walang kakayahan sa ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" @@ -1200,18 +1089,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1226,14 +1103,10 @@ msgid "RTC is not supported on this board" msgstr "Hindi supportado ang RTC sa board na ito" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Basahin-lamang" @@ -1271,14 +1144,6 @@ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Sample rate ay dapat positibo" @@ -1326,14 +1191,6 @@ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" msgid "Stream missing readinto() or write() method." msgstr "Stream kulang ng readinto() o write() method." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1407,26 +1264,6 @@ msgstr "Traceback (pinakahuling huling tawag): \n" msgid "Tuple or struct_time argument required" msgstr "Tuple o struct_time argument kailangan" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "Busy ang USB" @@ -1546,10 +1383,6 @@ msgstr "" "Ang mga function ng Viper ay kasalukuyang hindi sumusuporta sa higit sa 4 na " "argumento" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" @@ -1616,6 +1449,10 @@ msgstr "wala sa sakop ang address" msgid "addresses is empty" msgstr "walang laman ang address" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg ay walang laman na sequence" @@ -2040,10 +1877,6 @@ msgstr "walang laman" msgid "empty heap" msgstr "walang laman ang heap" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "walang laman na separator" @@ -2135,6 +1968,10 @@ msgstr "ang filesystem dapat mag bigay ng mount method" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" @@ -2184,6 +2021,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2254,8 +2095,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2457,6 +2297,10 @@ msgstr "may pagkakamali sa math domain" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2686,7 +2530,7 @@ msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2747,7 +2591,6 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" diff --git a/locale/fr.po b/locale/fr.po index 9345787c55..46366fe295 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -485,10 +485,6 @@ msgstr "Pas de transfert sans broches MOSI et MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossible d'écrire sans broche MOSI." @@ -547,34 +543,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -597,14 +565,6 @@ msgstr "Impossible d'allouer le 2e tampon" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC déjà utilisé" @@ -715,7 +675,6 @@ msgstr "Echec de l'allocation du tampon RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" @@ -749,10 +708,6 @@ msgstr "Le fichier existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -767,22 +722,10 @@ msgstr "" msgid "Group full" msgstr "Groupe plein" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "opération d'E/S sur un fichier fermé" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "opération sur I2C non supportée" @@ -811,29 +754,17 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c #, fuzzy msgid "Invalid BMP file" msgstr "Fichier BMP invalide" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -843,12 +774,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Fréquence de PWM invalide" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -860,7 +790,7 @@ msgstr "Argument invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "Longueur de tampon invalide" @@ -890,10 +820,6 @@ msgstr "Fichier invalide" msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -929,10 +855,6 @@ msgstr "Broche invalide pour le canal droit" msgid "Invalid pins" msgstr "Broches invalides" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarité invalide" @@ -962,10 +884,6 @@ msgstr "Nombre de voix invalide" msgid "Invalid wave file" msgstr "Fichier WAVE invalide" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "La partie gauche de l'argument nommé doit être un identifiant" @@ -1011,18 +929,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1036,7 +946,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Pas de DAC sur la puce" @@ -1045,23 +954,13 @@ msgstr "Pas de DAC sur la puce" msgid "No DMA channel found" msgstr "Aucun canal DMA trouvé" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Pas de broche RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Pas de broche TX" @@ -1090,10 +989,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "Pas de support matériel pour cette broche" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1172,7 +1067,6 @@ msgstr "" "à la construction." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1184,14 +1078,9 @@ msgstr "Permission refusée" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "La broche ne peut être utilisée pour l'ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1213,18 +1102,6 @@ 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/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1239,14 +1116,10 @@ msgid "RTC is not supported on this board" msgstr "RTC non supportée sur cette carte" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Lecture seule" @@ -1284,14 +1157,6 @@ msgstr "Mode sans-échec! Le code sauvegardé n'est pas éxecuté.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "Sample rate must be positive" @@ -1340,14 +1205,6 @@ msgstr "La pile doit être au moins de 256" msgid "Stream missing readinto() or write() method." msgstr "Il manque une méthode readinto() ou write() au flux." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1422,26 +1279,6 @@ msgstr "Trace (appels les plus récents en dernier):\n" msgid "Tuple or struct_time argument required" msgstr "Argument de type tuple ou struct_time nécessaire" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB occupé" @@ -1564,10 +1401,6 @@ msgid "Viper functions don't currently support more than 4 arguments" msgstr "" "les fonctions de Viper ne supportent pas plus de 4 arguments actuellement" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENTION: le nom de fichier de votre code a deux extensions\n" @@ -1633,6 +1466,10 @@ msgstr "adresse hors limites" msgid "addresses is empty" msgstr "adresses vides" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "l'argument est une séquence vide" @@ -2065,10 +1902,6 @@ msgstr "vide" msgid "empty heap" msgstr "tas vide" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "séparateur vide" @@ -2160,6 +1993,10 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" @@ -2209,6 +2046,10 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2278,8 +2119,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2481,6 +2321,10 @@ msgstr "erreur de domaine math" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2713,7 +2557,7 @@ msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2779,7 +2623,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "'pop' d'une entrée PulseIn vide" diff --git a/locale/it_IT.po b/locale/it_IT.po index 68cd7dd41d..4bba0b8022 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -481,10 +481,6 @@ msgstr "Impossibile trasferire senza i pin MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossibile scrivere senza pin MOSI." @@ -543,34 +539,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -593,14 +561,6 @@ msgstr "Impossibile allocare il secondo buffer" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC già in uso" @@ -712,7 +672,6 @@ msgstr "Impossibile allocare buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" @@ -746,10 +705,6 @@ msgstr "File esistente" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -764,22 +719,10 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operazione I2C non supportata" @@ -808,28 +751,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pin %q non valido" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "File BMP non valido" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -839,12 +770,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -856,7 +786,7 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "lunghezza del buffer non valida" @@ -886,10 +816,6 @@ msgstr "File non valido" msgid "Invalid format chunk size" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -925,10 +851,6 @@ msgstr "Pin non valido per il canale destro" msgid "Invalid pins" msgstr "Pin non validi" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarità non valida" @@ -958,10 +880,6 @@ msgstr "Tipo di servizio non valido" msgid "Invalid wave file" msgstr "File wave non valido" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1008,18 +926,10 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Il ritardo di avvio del microfono deve essere nell'intervallo tra 0.0 e 1.0" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1033,7 +943,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nessun DAC sul chip" @@ -1042,23 +951,13 @@ msgstr "Nessun DAC sul chip" msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nessun pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Nessun pin TX" @@ -1087,10 +986,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1167,7 +1062,6 @@ msgstr "" "impostato nel costruttore a False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1179,14 +1073,9 @@ msgstr "Permesso negato" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Il pin non ha capacità di ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1209,18 +1098,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1235,14 +1112,10 @@ msgid "RTC is not supported on this board" msgstr "RTC non supportato su questa scheda" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Sola lettura" @@ -1280,14 +1153,6 @@ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "Sample rate must be positive" @@ -1337,14 +1202,6 @@ msgstr "La dimensione dello stack deve essere almeno 256" msgid "Stream missing readinto() or write() method." msgstr "Metodi mancanti readinto() o write() allo stream." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1418,26 +1275,6 @@ msgstr "Traceback (chiamata più recente per ultima):\n" msgid "Tuple or struct_time argument required" msgstr "Tupla o struct_time richiesto come argomento" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB occupata" @@ -1555,10 +1392,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Le funzioni Viper non supportano più di 4 argomenti al momento" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" @@ -1619,6 +1452,10 @@ msgstr "indirizzo fuori limite" msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "l'argomento è una sequenza vuota" @@ -2041,10 +1878,6 @@ msgstr "vuoto" msgid "empty heap" msgstr "heap vuoto" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "separatore vuoto" @@ -2136,6 +1969,10 @@ msgstr "il filesystem deve fornire un metodo di mount" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2185,6 +2022,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2255,8 +2096,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2459,6 +2299,10 @@ msgstr "errore di dominio matematico" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2691,7 +2535,7 @@ msgstr "solo slice con step=1 (aka None) sono supportate" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2754,7 +2598,6 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" diff --git a/locale/ko.po b/locale/ko.po index 656adf2cb2..b4085c2197 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -476,10 +476,6 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -537,34 +533,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -587,14 +555,6 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC가 현재 사용 중입니다" @@ -702,7 +662,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -736,10 +695,6 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -754,22 +709,10 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -796,28 +739,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -827,12 +758,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -844,7 +774,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -872,10 +802,6 @@ msgstr "파일이 유효하지 않습니다" msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -911,10 +837,6 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -943,10 +865,6 @@ msgstr "" msgid "Invalid wave file" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -992,18 +910,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1017,7 +927,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -1026,23 +935,13 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -1071,10 +970,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1142,7 +1037,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1154,14 +1048,9 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1182,18 +1071,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1208,14 +1085,10 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1252,14 +1125,6 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1307,14 +1172,6 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1388,26 +1245,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1524,10 +1361,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -1588,6 +1421,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2001,10 +1838,6 @@ msgstr "" msgid "empty heap" msgstr "" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2095,6 +1928,10 @@ msgstr "" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2144,6 +1981,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2213,8 +2054,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2412,6 +2252,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2640,7 +2484,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2700,7 +2544,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 6eb37254b5..2ed3a5924b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -475,10 +475,6 @@ msgstr "Nie można przesyłać bez nóżek MOSI i MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wielkość skalara jest niejednoznaczna" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Nie można pisać bez nóżki MOSI." @@ -536,34 +532,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -586,14 +554,6 @@ msgstr "Nie udała się alokacja drugiego bufora" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC w użyciu" @@ -701,7 +661,6 @@ msgstr "Nie udała się alokacja bufora RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udała się alokacja %d bajtów na bufor RX" @@ -735,10 +694,6 @@ msgstr "Plik istnieje" msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -753,22 +708,10 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "Operacja I2C nieobsługiwana" @@ -797,28 +740,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Zła nóżka %q" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Zły BMP" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -828,12 +759,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -845,7 +775,7 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Zła wielkość bufora" @@ -873,10 +803,6 @@ msgstr "Zły plik" msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -912,10 +838,6 @@ msgstr "Zła nóżka dla prawego kanału" msgid "Invalid pins" msgstr "Złe nóżki" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Zła polaryzacja" @@ -944,10 +866,6 @@ msgstr "Zła liczba głosów" msgid "Invalid wave file" msgstr "Zły plik wave" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" @@ -993,18 +911,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1018,7 +928,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Brak DAC" @@ -1027,23 +936,13 @@ msgstr "Brak DAC" msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Brak nóżki RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Brak nóżki TX" @@ -1072,10 +971,6 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1143,7 +1038,6 @@ msgid "" msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1155,14 +1049,9 @@ msgstr "Odmowa dostępu" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Nóżka nie obsługuje ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" @@ -1183,18 +1072,6 @@ 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/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1209,14 +1086,10 @@ msgid "RTC is not supported on this board" msgstr "Brak obsługi RTC" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Tylko do odczytu" @@ -1253,14 +1126,6 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Częstotliwość próbkowania musi być dodatnia" @@ -1308,14 +1173,6 @@ msgstr "Stos musi mieć co najmniej 256 bajtów" msgid "Stream missing readinto() or write() method." msgstr "Strumień nie ma metod readinto() lub write()." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1389,26 +1246,6 @@ msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" msgid "Tuple or struct_time argument required" msgstr "Wymagana krotka lub struct_time" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB Zajęte" @@ -1524,10 +1361,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Funkcje Viper nie obsługują obecnie więcej niż 4 argumentów" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" @@ -1591,6 +1424,10 @@ msgstr "adres poza zakresem" msgid "addresses is empty" msgstr "adres jest pusty" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg jest puste" @@ -2005,10 +1842,6 @@ msgstr "puste" msgid "empty heap" msgstr "pusta sterta" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "pusty separator" @@ -2099,6 +1932,10 @@ msgstr "system plików musi mieć metodę mount" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" @@ -2148,6 +1985,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2217,8 +2058,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2416,6 +2256,10 @@ msgstr "błąd domeny" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2644,7 +2488,7 @@ msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2705,7 +2549,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a0f2024ebc..ca169d081a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -477,10 +477,6 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Não é possível ler sem um pino MOSI" @@ -539,34 +535,6 @@ msgstr "" msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -589,14 +557,6 @@ msgstr "Não pôde alocar segundo buffer" msgid "Crash into the HardFault_Handler." msgstr "" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC em uso" @@ -707,7 +667,6 @@ msgstr "Falha ao alocar buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" @@ -741,10 +700,6 @@ msgstr "Arquivo já existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -759,22 +714,10 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C operação não suportada" @@ -801,28 +744,16 @@ msgstr "" msgid "Insufficient encryption" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pino do %q inválido" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Arquivo BMP inválido" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -832,12 +763,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -849,7 +779,7 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "Arquivo inválido" @@ -879,10 +809,6 @@ msgstr "Arquivo inválido" msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -918,10 +844,6 @@ msgstr "Pino inválido para canal direito" msgid "Invalid pins" msgstr "Pinos inválidos" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -951,10 +873,6 @@ msgstr "certificado inválido" msgid "Invalid wave file" msgstr "Aqruivo de ondas inválido" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1000,18 +918,10 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1025,7 +935,6 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nenhum DAC no chip" @@ -1034,23 +943,13 @@ msgstr "Nenhum DAC no chip" msgid "No DMA channel found" msgstr "Nenhum canal DMA encontrado" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nenhum pino RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Nenhum pino TX" @@ -1079,10 +978,6 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "" - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1153,7 +1048,6 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1165,14 +1059,9 @@ msgstr "Permissão negada" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "O pino não tem recursos de ADC" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1194,18 +1083,6 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" -#: ports/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1220,14 +1097,10 @@ msgid "RTC is not supported on this board" msgstr "O RTC não é suportado nesta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Somente leitura" @@ -1265,14 +1138,6 @@ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1320,14 +1185,6 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1401,26 +1258,6 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB ocupada" @@ -1537,10 +1374,6 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" @@ -1601,6 +1434,10 @@ msgstr "" msgid "addresses is empty" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "" @@ -2017,10 +1854,6 @@ msgstr "vazio" msgid "empty heap" msgstr "heap vazia" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -2112,6 +1945,10 @@ msgstr "sistema de arquivos deve fornecer método de montagem" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "" @@ -2161,6 +1998,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2230,8 +2071,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2429,6 +2269,10 @@ msgstr "" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2657,7 +2501,7 @@ msgstr "" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2717,7 +2561,6 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e93bcb1d26..7993cf7bd4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-11 17:52-0400\n" +"POT-Creation-Date: 2020-03-16 20:59-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -481,10 +481,6 @@ msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Cannot vary frequency on a timer that is already in use" -msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." @@ -544,34 +540,6 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize channel" -msgstr "Wúfǎ chūshǐhuà píndào" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not initialize timer" -msgstr "Wúfǎ chūshǐhuà jìshí qì" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Wúfǎ chóngqǐ PWM" - -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Could not start PWM" -msgstr "Wúfǎ qǐdòng PWM" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Could not start interrupt, RX busy" -msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" - #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "Zhǎo bù dào jiěmǎ qì" @@ -594,14 +562,6 @@ msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" msgid "Crash into the HardFault_Handler." msgstr "Zhuìhuǐ. Shūrù HardFault_Handler." -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Channel Init Error" -msgstr "DAC tōngdào chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "DAC Device Init Error" -msgstr "DAC shèbèi chūshǐhuà cuòwù" - #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "Fā yuán huì yǐjīng shǐyòng" @@ -709,7 +669,6 @@ msgstr "Fēnpèi RX huǎnchōng shībài" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" @@ -743,10 +702,6 @@ msgstr "Wénjiàn cúnzài" msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Frequency must match existing PWMOut using this timer" -msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" - #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -761,22 +716,10 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" -#: ports/stm32f4/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/SPI.c -msgid "Hardware busy, try alternative pins" -msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Hardware in use, try alternative pins" -msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" -#: ports/stm32f4/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C chūshǐhuà cuòwù" - #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C cāozuò bù zhīchí" @@ -805,28 +748,16 @@ msgstr "Rènzhèng bùzú" msgid "Insufficient encryption" msgstr "Jiāmì bùzú" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Internal define error" -msgstr "Nèibù dìngyì cuòwù" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" -#: ports/stm32f4/common-hal/analogio/AnalogIn.c -msgid "Invalid ADC Unit value" -msgstr "Wúxiào de ADC dānwèi zhí" - #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Wúxiào de BMP wénjiàn" -#: ports/stm32f4/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" - -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm32f4/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" @@ -836,12 +767,11 @@ msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm32f4/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" #: ports/mimxrt10xx/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" @@ -853,7 +783,7 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Wúxiào de huǎnchōng qū dàxiǎo" @@ -881,10 +811,6 @@ msgstr "Wúxiào de wénjiàn" msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid frequency supplied" -msgstr "Tígōng de pínlǜ wúxiào" - #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "Wúxiào de nèicún fǎngwèn." @@ -920,10 +846,6 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "Invalid pins for PWMOut" -msgstr "" - #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" @@ -952,10 +874,6 @@ msgstr "Wúxiào de yǔyīn jìshù" msgid "Invalid wave file" msgstr "Wúxiào de làng làngcháo wénjiàn" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Wúxiào de zì/wèi chángdù" - #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" @@ -1001,18 +919,10 @@ msgstr "MicroPython zhìmìng cuòwù." msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" -msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" - #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "Must provide MISO or MOSI pin" -msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" - #: py/parse.c msgid "Name too long" msgstr "" @@ -1026,7 +936,6 @@ msgid "No CCCD for this Characteristic" msgstr "Zhège tèzhēng méiyǒu CCCD" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c -#: ports/stm32f4/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Méiyǒu DAC zài xīnpiàn shàng de" @@ -1035,23 +944,13 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MISO Pin" -msgstr "Méiyǒu MISO yǐn jiǎo" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "No MOSI Pin" -msgstr "Méiyǒu MOSI yǐn jiǎo" - #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No RX pin" msgstr "Wèi zhǎodào RX yǐn jiǎo" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/stm32f4/common-hal/busio/UART.c msgid "No TX pin" msgstr "Wèi zhǎodào TX yǐn jiǎo" @@ -1080,10 +979,6 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" -#: ports/stm32f4/common-hal/pulseio/PWMOut.c -msgid "No more timers available on this pin." -msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." - #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" @@ -1157,7 +1052,6 @@ msgid "" msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm32f4/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "Shàng bù zhīchí ParallelBus" @@ -1169,14 +1063,9 @@ msgstr "Quánxiàn bèi jùjué" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/stm32f4/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin méiyǒu ADC nénglì" -#: ports/stm32f4/common-hal/pulseio/PulseIn.c -msgid "Pin number already reserved by EXTI" -msgstr "" - #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" @@ -1197,18 +1086,6 @@ 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/stm32f4/common-hal/pulseio/PulseOut.c -msgid "PulseOut not supported on this chip" -msgstr "" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG DeInit Error" -msgstr "RNG qǔxiāo chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/os/__init__.c -msgid "RNG Init Error" -msgstr "RNG chūshǐhuà cuòwù" - #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1223,14 +1100,10 @@ msgid "RTC is not supported on this board" msgstr "Cǐ bǎn bù zhīchí RTC" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c ports/stm32f4/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" -#: ports/stm32f4/common-hal/os/__init__.c -msgid "Random number generation error" -msgstr "Suíjī shù shēngchéng cuòwù" - #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Zhǐ dú" @@ -1267,14 +1140,6 @@ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dài msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI chóngxīn chūshǐhuà cuòwù" - #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" @@ -1322,14 +1187,6 @@ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" msgid "Stream missing readinto() or write() method." msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." -#: ports/stm32f4/common-hal/busio/UART.c -msgid "Supply at least one UART pin" -msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" - -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Temperature read timed out" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1410,26 +1267,6 @@ msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" msgid "Tuple or struct_time argument required" msgstr "Xūyào Tuple huò struct_time cānshù" -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART huǎnchōng qū fēnpèi cuòwù" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART qǔxiāo chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART chóngxīn chūshǐhuà cuòwù" - -#: ports/stm32f4/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART xiě cuòwù" - #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB máng" @@ -1547,10 +1384,6 @@ msgstr "Zhí chángdù > zuìdà chángdù" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Viper hánshù mùqián bù zhīchí chāoguò 4 gè cānshù" -#: ports/stm32f4/common-hal/microcontroller/Processor.c -msgid "Voltage read timed out" -msgstr "" - #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" @@ -1616,6 +1449,10 @@ msgstr "dìzhǐ chāochū biānjiè" msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "cānshù shì yīgè kōng de xùliè" @@ -2033,10 +1870,6 @@ msgstr "kòngxián" msgid "empty heap" msgstr "kōng yīn yīnxiào" -#: extmod/ulab/code/ndarray.c -msgid "empty index range" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "kōng fēngé fú" @@ -2127,6 +1960,10 @@ msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" msgid "first argument must be an iterable" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + #: py/objtype.c msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" @@ -2176,6 +2013,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/linalg.c +msgid "function is defined for ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2245,8 +2086,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2445,6 +2285,10 @@ msgstr "shùxué yù cuòwù" msgid "matrix dimensions do not match" msgstr "" +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format @@ -2674,7 +2518,7 @@ msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" msgid "only square matrices can be inverted" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -2734,7 +2578,6 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/stm32f4/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "cóng kōng de PulseIn dànchū dànchū" @@ -3145,6 +2988,9 @@ msgstr "líng bù" #~ msgid "Can't set CCCD for local Characteristic" #~ msgstr "Wúfǎ wéi běndì tèzhēng shèzhì CCCD" +#~ msgid "Cannot vary frequency on a timer that is already in use" +#~ msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" + #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "Zìfú UUID bù fúhé fúwù UUID" @@ -3157,9 +3003,36 @@ msgstr "líng bù" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" +#~ msgid "Could not initialize channel" +#~ msgstr "Wúfǎ chūshǐhuà píndào" + +#~ msgid "Could not initialize timer" +#~ msgstr "Wúfǎ chūshǐhuà jìshí qì" + +#~ msgid "Could not re-init channel" +#~ msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" + +#~ msgid "Could not re-init timer" +#~ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" + +#~ msgid "Could not restart PWM" +#~ msgstr "Wúfǎ chóngqǐ PWM" + +#~ msgid "Could not start PWM" +#~ msgstr "Wúfǎ qǐdòng PWM" + +#~ msgid "Could not start interrupt, RX busy" +#~ msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" + #~ msgid "Crash into the HardFault_Handler.\n" #~ msgstr "Bēngkuì dào HardFault_Handler.\n" +#~ msgid "DAC Channel Init Error" +#~ msgstr "DAC tōngdào chūshǐhuà cuòwù" + +#~ msgid "DAC Device Init Error" +#~ msgstr "DAC shèbèi chūshǐhuà cuòwù" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" @@ -3277,6 +3150,27 @@ msgstr "líng bù" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Flash xiě rù shībài, err 0x%04x" +#~ msgid "Frequency must match existing PWMOut using this timer" +#~ msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" + +#~ msgid "Hardware busy, try alternative pins" +#~ msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" + +#~ msgid "Hardware in use, try alternative pins" +#~ msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C chūshǐhuà cuòwù" + +#~ msgid "Internal define error" +#~ msgstr "Nèibù dìngyì cuòwù" + +#~ msgid "Invalid ADC Unit value" +#~ msgstr "Wúxiào de ADC dānwèi zhí" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -3286,6 +3180,12 @@ msgstr "líng bù" #~ msgid "Invalid data pin" #~ msgstr "Wúxiào de shùjù yǐn jiǎo" +#~ msgid "Invalid frequency supplied" +#~ msgstr "Tígōng de pínlǜ wúxiào" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Wúxiào de zì/wèi chángdù" + #~ msgid "" #~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" #~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" @@ -3302,9 +3202,21 @@ msgstr "líng bù" #~ msgid "MicroPython fatal error.\n" #~ msgstr "MicroPython zhìmìng cuòwù.\n" +#~ msgid "Missing MISO or MOSI Pin" +#~ msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" + #~ msgid "Must be a Group subclass." #~ msgstr "Bìxū shì fēnzǔ zi lèi." +#~ msgid "Must provide MISO or MOSI pin" +#~ msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" + +#~ msgid "No MISO Pin" +#~ msgstr "Méiyǒu MISO yǐn jiǎo" + +#~ msgid "No MOSI Pin" +#~ msgstr "Méiyǒu MOSI yǐn jiǎo" + #~ msgid "No default I2C bus" #~ msgstr "Méiyǒu mòrèn I2C gōnggòng qìchē" @@ -3314,6 +3226,9 @@ msgstr "líng bù" #~ msgid "No default UART bus" #~ msgstr "Méiyǒu mòrèn UART gōnggòng qìchē" +#~ msgid "No more timers available on this pin." +#~ msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." + #~ msgid "Only bit maps of 8 bit color or less are supported" #~ msgstr "Jǐn zhīchí 8 wèi yánsè huò xiǎoyú" @@ -3335,12 +3250,30 @@ msgstr "líng bù" #~ msgid "PulseOut not yet supported" #~ msgstr "Shàng bù zhīchí PulseOut" +#~ msgid "RNG DeInit Error" +#~ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" + +#~ msgid "RNG Init Error" +#~ msgstr "RNG chūshǐhuà cuòwù" + +#~ msgid "Random number generation error" +#~ msgstr "Suíjī shù shēngchéng cuòwù" + #~ msgid "Range out of bounds" #~ msgstr "Fànwéi chāochū biānjiè" +#~ msgid "SPI Init Error" +#~ msgstr "SPI chūshǐhuà cuòwù" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI chóngxīn chūshǐhuà cuòwù" + #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" +#~ msgid "Supply at least one UART pin" +#~ msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" + #~ msgid "" #~ "The CircuitPython heap was corrupted because the stack was too small.\n" #~ "Please increase stack size limits and press reset (after ejecting " @@ -3378,6 +3311,21 @@ msgstr "líng bù" #~ msgid "To exit, please reset the board without " #~ msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART huǎnchōng qū fēnpèi cuòwù" + +#~ msgid "UART De-init error" +#~ msgstr "UART qǔxiāo chūshǐhuà cuòwù" + +#~ msgid "UART Init Error" +#~ msgstr "UART chūshǐhuà cuòwù" + +#~ msgid "UART Re-init error" +#~ msgstr "UART chóngxīn chūshǐhuà cuòwù" + +#~ msgid "UART write error" +#~ msgstr "UART xiě cuòwù" + #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" diff --git a/py/obj.h b/py/obj.h index cf4216d02f..fa315d12f7 100644 --- a/py/obj.h +++ b/py/obj.h @@ -858,6 +858,7 @@ typedef struct { mp_uint_t stop; mp_int_t step; } mp_bound_slice_t; +void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *result); // Compute the new length of a sequence and ensure an exception is thrown on overflow. size_t mp_seq_multiply_len(size_t item_sz, size_t len); diff --git a/py/objslice.c b/py/objslice.c index 5a15be55aa..cbbee326e9 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -152,6 +152,71 @@ mp_obj_t mp_obj_new_slice(mp_obj_t ostart, mp_obj_t ostop, mp_obj_t ostep) { return MP_OBJ_FROM_PTR(o); } +// Return the real index and step values for a slice when applied to a sequence of +// the given length, resolving missing components, negative values and values off +// the end of the sequence. +void mp_obj_slice_indices(mp_obj_t self_in, mp_int_t length, mp_bound_slice_t *result) { + mp_obj_slice_t *self = MP_OBJ_TO_PTR(self_in); + mp_int_t start, stop, step; + + if (self->step == mp_const_none) { + step = 1; + } else { + step = mp_obj_get_int(self->step); + if (step == 0) { + mp_raise_ValueError(translate("slice step cannot be zero")); + } + } + + if (step > 0) { + // Positive step + if (self->start == mp_const_none) { + start = 0; + } else { + start = mp_obj_get_int(self->start); + if (start < 0) { + start += length; + } + start = MIN(length, MAX(start, 0)); + } + + if (self->stop == mp_const_none) { + stop = length; + } else { + stop = mp_obj_get_int(self->stop); + if (stop < 0) { + stop += length; + } + stop = MIN(length, MAX(stop, 0)); + } + } else { + // Negative step + if (self->start == mp_const_none) { + start = length - 1; + } else { + start = mp_obj_get_int(self->start); + if (start < 0) { + start += length; + } + start = MIN(length - 1, MAX(start, -1)); + } + + if (self->stop == mp_const_none) { + stop = -1; + } else { + stop = mp_obj_get_int(self->stop); + if (stop < 0) { + stop += length; + } + stop = MIN(length - 1, MAX(stop, -1)); + } + } + + result->start = start; + result->stop = stop; + result->step = step; +} + #if MICROPY_PY_BUILTINS_SLICE_ATTRS STATIC mp_obj_t slice_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { From aa54a7e76e1f40c6811ce7a6df02546a719d80e8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Mar 2020 09:19:21 -0500 Subject: [PATCH 084/919] ulab: update documentation --- shared-bindings/ulab/__init__.rst | 51 +++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index b2933be792..b2f3d56818 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -33,9 +33,13 @@ ulab.array -- 1- and 2- dimensional array :param sequence values: Sequence giving the initial content of the array. :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` - The `values` sequence can either be a sequence of numbers (in which case a - 1-dimensional array is created), or a sequence where each subsequence has - the same length (in which case a 2-dimensional array is created). + The `values` sequence can either be another ~ulab.array, sequence of numbers + (in which case a 1-dimensional array is created), or a sequence where each + subsequence has the same length (in which case a 2-dimensional array is + created). + + Passing a ~ulab.array and a different dtype can be used to convert an array + from one dtype to another. In many cases, it is more convenient to create an array from a function like `zeros` or `linspace`. @@ -209,9 +213,20 @@ much more efficient than expressing the same operation as a Python loop. Computes the inverse hyperbolic sine function +.. method:: around(a, \*, decimals) + + Returns a new float array in which each element is rounded to + ``decimals`` places. + .. method:: atan - Computes the inverse tangent function + Computes the inverse tangent function; the return values are in the + range [-pi/2,pi/2]. + +.. method:: atan2(y,x) + + Computes the inverse tangent function of y/x; the return values are in + the range [-pi, pi]. .. method:: atanh @@ -290,6 +305,14 @@ much more efficient than expressing the same operation as a Python loop. .. module:: ulab.linalg +.. method:: cholesky(A) + + :param ~ulab.array A: a positive definite, symmetric square matrix + :return ~ulab.array L: a square root matrix in the lower triangular form + :raises ValueError: If the input does not fulfill the necessary conditions + + The returned matrix satisfies the equation m=LL* + .. method:: det :param: m, a square matrix @@ -360,6 +383,9 @@ much more efficient than expressing the same operation as a Python loop. Perform a Fast Fourier Transform from the time domain into the frequency domain + See also ~ulab.extras.spectrogram, which computes the magnitude of the fft, + rather than separately returning its real and imaginary parts. + .. method:: ifft(r, c=None) :param ulab.array r: A 1-dimension array of values whose size is a power of 2 @@ -368,12 +394,6 @@ much more efficient than expressing the same operation as a Python loop. Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain -.. method:: spectrum(r): - - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - - Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. - :mod:`ulab.numerical` --- Numerical and Statistical functions ============================================================= @@ -448,3 +468,14 @@ operate over the flattened array (None), rows (0), or columns (1). .. method:: polyval(p, x) Evaluate the polynomial p at the points x. x must be an array. + +:mod:`ulab.extras` --- Additional functions not in numpy +======================================================== + +.. method:: spectrum(r): + + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + + Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. + + This function is similar to scipy's ``scipy.signal.spectrogram``. From d6342af98014c0cc9e3c6b3010f06db88aa470b2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Mar 2020 09:33:03 -0500 Subject: [PATCH 085/919] ulab: rename enable macro so it appears in the support matrix --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 2 +- ports/atmel-samd/mpconfigport.mk | 6 +++--- ports/nrf/mpconfigport.mk | 2 +- ports/stm/mpconfigport.mk | 2 +- ports/unix/mpconfigport.mk | 2 +- py/circuitpy_defns.mk | 2 +- py/circuitpy_mpconfig.h | 2 +- py/circuitpy_mpconfig.mk | 4 ++-- py/mpconfig.h | 4 ++-- py/objmodule.c | 2 +- py/py.mk | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index eb3c81485e..5429bcf86e 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -16,4 +16,4 @@ CIRCUITPY_NETWORK = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 -MICROPY_PY_ULAB = 0 +CIRCUITPY_ULAB = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 6b6b335d38..c2408feae3 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -40,7 +40,7 @@ endif # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 -MICROPY_PY_ULAB = 0 +CIRCUITPY_ULAB = 0 endif # samd21 @@ -64,9 +64,9 @@ ifndef CIRCUITPY_SAMD CIRCUITPY_SAMD = 1 endif -ifndef MICROPY_PY_ULAB +ifndef CIRCUITPY_ULAB ifneq ($(CIRCUITPY_SMALL_BUILD),1) -MICROPY_PY_ULAB = 1 +CIRCUITPY_ULAB = 1 endif endif diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index db1b6b03ea..fcc59c484a 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -69,5 +69,5 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS -MICROPY_PY_ULAB = 1 +CIRCUITPY_ULAB = 1 endif diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 493f32c636..529a942487 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -71,7 +71,7 @@ endif CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 -MICROPY_PY_ULAB = 1 +CIRCUITPY_ULAB = 1 #ifeq ($(MCU_SUB_VARIANT), stm32f412zx) #endif diff --git a/ports/unix/mpconfigport.mk b/ports/unix/mpconfigport.mk index 4cb1804d46..6bb1c9693f 100644 --- a/ports/unix/mpconfigport.mk +++ b/ports/unix/mpconfigport.mk @@ -41,4 +41,4 @@ MICROPY_PY_JNI = 0 # as submodules (currently affects only libffi). MICROPY_STANDALONE = 0 -MICROPY_PY_ULAB = 1 +CIRCUITPY_ULAB = 1 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 92021d0d07..f84d0b5b1d 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -431,7 +431,7 @@ $(addprefix lib/,\ libm/atanf.c \ libm/atan2f.c \ ) -ifeq ($(MICROPY_PY_ULAB),1) +ifeq ($(CIRCUITPY_ULAB),1) SRC_LIBM += \ $(addprefix lib/,\ libm/acoshf.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index acff27bcf5..04e1912643 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -581,7 +581,7 @@ extern const struct _mp_obj_module_t ustack_module; #define JSON_MODULE #endif -#if defined(MICROPY_PY_ULAB) && MICROPY_PY_ULAB +#if defined(CIRCUITPY_ULAB) && CIRCUITPY_ULAB #define ULAB_MODULE \ { MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, #else diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 21b1abd9bb..1a375efc65 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -340,8 +340,8 @@ endif CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) # ulab numerics library -ifndef MICROPY_PY_ULAB -MICROPY_PY_ULAB = $(CIRCUITPY_FULL_BUILD) +ifndef CIRCUITPY_ULAB +CIRCUITPY_ULAB = $(CIRCUITPY_FULL_BUILD) endif # Enabled micropython.native decorator (experimental) diff --git a/py/mpconfig.h b/py/mpconfig.h index 01572f546e..513f04f6ef 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1178,8 +1178,8 @@ typedef double mp_float_t; #define MICROPY_PY_UJSON (0) #endif -#ifndef MICROPY_PY_ULAB -#define MICROPY_PY_ULAB (0) +#ifndef CIRCUITPY_ULAB +#define CIRCUITPY_ULAB (0) #endif #ifndef MICROPY_PY_URE diff --git a/py/objmodule.c b/py/objmodule.c index 7405a6919a..b6a8a084e9 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -213,7 +213,7 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { { MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) }, #endif #endif -#if MICROPY_PY_ULAB +#if CIRCUITPY_ULAB #if CIRCUITPY // CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here. // TODO: move to shared-bindings/ diff --git a/py/py.mk b/py/py.mk index 5e044947ac..d70c6c33e2 100644 --- a/py/py.mk +++ b/py/py.mk @@ -105,7 +105,7 @@ $(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif -ifeq ($(MICROPY_PY_ULAB),1) +ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(addprefix extmod/ulab/code/, \ create.c \ fft.c \ @@ -117,7 +117,7 @@ poly.c \ ulab.c \ vectorise.c \ ) -CFLAGS_MOD += -DMICROPY_PY_ULAB=1 -DMODULE_ULAB_ENABLED=1 +CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY endif From 96f2288b8403073075267bc058abca0a01606b80 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Mar 2020 09:33:17 -0500 Subject: [PATCH 086/919] ulab: include new 'extras' source file --- py/py.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/py/py.mk b/py/py.mk index d70c6c33e2..bac237b7dd 100644 --- a/py/py.mk +++ b/py/py.mk @@ -108,6 +108,7 @@ endif ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(addprefix extmod/ulab/code/, \ create.c \ +extras.c \ fft.c \ filter.c \ linalg.c \ From 4297ae2d0be7fd3b6c61a611c5598cb438b54b8f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Mar 2020 12:10:12 -0700 Subject: [PATCH 087/919] Fix DotStar status LED init. --- supervisor/shared/rgb_led_status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index f751a7ffd5..f3c2106471 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -115,7 +115,7 @@ void rgb_led_status_init() { shared_module_bitbangio_spi_construct(&status_apa102, MICROPY_HW_APA102_SCK, MICROPY_HW_APA102_MOSI, - mp_const_none); + NULL); #else if (!common_hal_busio_spi_deinited(&status_apa102)) { // This may call us recursively if common_hal_reset_pin() is called, @@ -125,7 +125,7 @@ void rgb_led_status_init() { common_hal_busio_spi_construct(&status_apa102, MICROPY_HW_APA102_SCK, MICROPY_HW_APA102_MOSI, - mp_const_none); + NULL); common_hal_busio_spi_never_reset(&status_apa102); #endif // Pretend we aren't using the pins. bitbangio.SPI will From d9e68156b23cfca47592c5672e69622d6071ff60 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Mar 2020 12:10:35 -0700 Subject: [PATCH 088/919] fix up SAMD21 sleep --- ports/atmel-samd/common-hal/touchio/TouchIn.c | 1 - ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/internal_flash.c | 3 +- ports/atmel-samd/supervisor/port.c | 63 ++++++++++++++++--- 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/common-hal/touchio/TouchIn.c b/ports/atmel-samd/common-hal/touchio/TouchIn.c index 908d8d7228..b2fcc6cdef 100644 --- a/ports/atmel-samd/common-hal/touchio/TouchIn.c +++ b/ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -42,7 +42,6 @@ #include "samd/clocks.h" #include "samd/pins.h" -#include "tick.h" #include "adafruit_ptc.h" bool touch_enabled = false; diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index df39529b42..bfbc88fd6b 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit df39529b42fbc43db3c9b5724dfb2d6c562e8489 +Subproject commit bfbc88fd6b2e2bb8f5e88836c0ba46eb80f97577 diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index a8ff5adfa9..9c8ff990ed 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -41,6 +41,7 @@ #endif #include "hal/include/hal_flash.h" +#include "supervisor/flash.h" #include "supervisor/shared/rgb_led_status.h" static struct flash_descriptor supervisor_flash_desc; @@ -73,7 +74,7 @@ uint32_t supervisor_flash_get_block_count(void) { return INTERNAL_FLASH_PART1_NUM_BLOCKS; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { } void supervisor_flash_release_cache(void) { diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 6b368e27ba..92ef35680c 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -32,6 +32,7 @@ // ASF 4 #include "atmel_start_pins.h" +#include "peripheral_clk_config.h" #include "hal/include/hal_delay.h" #include "hal/include/hal_flash.h" #include "hal/include/hal_gpio.h" @@ -134,12 +135,16 @@ static void save_usb_clock_calibration(void) { static void rtc_init(void) { #ifdef SAMD21 - _gclk_enable_channel(RTC_GCLK_ID, CONF_GCLK_RTC_SRC); + _gclk_enable_channel(RTC_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK2_Val); + RTC->MODE0.CTRL.bit.SWRST = true; + while (RTC->MODE0.CTRL.bit.SWRST != 0) {} + + RTC->MODE0.CTRL.reg = RTC_MODE0_CTRL_ENABLE | + RTC_MODE0_CTRL_MODE_COUNT32 | + RTC_MODE0_CTRL_PRESCALER_DIV2; #endif #ifdef SAMD51 hri_mclk_set_APBAMASK_RTC_bit(MCLK); -#endif - RTC->MODE0.CTRLA.bit.SWRST = true; while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {} @@ -147,6 +152,8 @@ static void rtc_init(void) { RTC_MODE0_CTRLA_MODE_COUNT32 | RTC_MODE0_CTRLA_PRESCALER_DIV2 | RTC_MODE0_CTRLA_COUNTSYNC; +#endif + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_OVF; // Set all peripheral interrupt priorities to the lowest priority by default. @@ -384,6 +391,7 @@ uint32_t port_get_saved_word(void) { // TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain // is enabled. static volatile uint64_t overflowed_ticks = 0; +static volatile bool _ticks_enabled = false; void RTC_Handler(void) { uint32_t intflag = RTC->MODE0.INTFLAG.reg; @@ -392,20 +400,44 @@ void RTC_Handler(void) { // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per // tick. overflowed_ticks += (1L<< (32 - 4)); - + #ifdef SAMD51 } else if (intflag & RTC_MODE0_INTFLAG_PER2) { RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; // Do things common to all ports when the tick occurs supervisor_tick(); + #endif } else if (intflag & RTC_MODE0_INTFLAG_CMP0) { - RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + // Clear the interrupt because we may have hit a sleep and _ticks_enabled RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + #ifdef SAMD21 + if (_ticks_enabled) { + // Do things common to all ports when the tick occurs. + supervisor_tick(); + // Check _ticks_enabled again because a tick handler may have turned it off. + if (_ticks_enabled) { + port_interrupt_after_ticks(1); + } + } + #endif + #ifdef SAMD51 + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + #endif } } -uint64_t port_get_raw_ticks(uint8_t* subticks) { +static uint32_t _get_count(void) { + #ifdef SAMD51 while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} - uint32_t current_ticks = RTC->MODE0.COUNT.reg; + #endif + #ifdef SAMD21 + while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) {} + #endif + + return RTC->MODE0.COUNT.reg; +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t current_ticks = _get_count(); if (subticks != NULL) { *subticks = (current_ticks % 16) * 2; } @@ -415,18 +447,29 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { + #ifdef SAMD51 // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; + #endif + #ifdef SAMD21 + _ticks_enabled = true; + port_interrupt_after_ticks(1); + #endif } // Disable 1/1024 second tick. void port_disable_tick(void) { + #ifdef SAMD51 RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; + #endif + #ifdef SAMD21 + _ticks_enabled = false; + RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + #endif } void port_interrupt_after_ticks(uint32_t ticks) { - while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} - uint32_t current_ticks = RTC->MODE0.COUNT.reg; + uint32_t current_ticks = _get_count(); if (ticks > 1 << 28) { // We'll interrupt sooner with an overflow. return; @@ -437,11 +480,13 @@ void port_interrupt_after_ticks(uint32_t ticks) { } void port_sleep_until_interrupt(void) { + #ifdef SAMD51 // Clear the FPU interrupt because it can prevent us from sleeping. if (__get_FPSCR() & ~(0x9f)) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); (void) __get_FPSCR(); } + #endif // Call wait for interrupt ourselves if the SD isn't enabled. __WFI(); } From 612ba2f45d07470712c23d603c8d98571a1629b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Mar 2020 12:10:12 -0700 Subject: [PATCH 089/919] Fix DotStar status LED init. --- supervisor/shared/rgb_led_status.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index f751a7ffd5..f3c2106471 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -115,7 +115,7 @@ void rgb_led_status_init() { shared_module_bitbangio_spi_construct(&status_apa102, MICROPY_HW_APA102_SCK, MICROPY_HW_APA102_MOSI, - mp_const_none); + NULL); #else if (!common_hal_busio_spi_deinited(&status_apa102)) { // This may call us recursively if common_hal_reset_pin() is called, @@ -125,7 +125,7 @@ void rgb_led_status_init() { common_hal_busio_spi_construct(&status_apa102, MICROPY_HW_APA102_SCK, MICROPY_HW_APA102_MOSI, - mp_const_none); + NULL); common_hal_busio_spi_never_reset(&status_apa102); #endif // Pretend we aren't using the pins. bitbangio.SPI will From 6db11cf68ba2d5e17c6267f36f516bc0abce4643 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Mar 2020 14:21:45 -0700 Subject: [PATCH 090/919] Fix up Spresense build. It doesn't sleep. --- ports/atmel-samd/mphalport.h | 5 +- ports/cxd56/Makefile | 5 +- .../common-hal/microcontroller/Processor.c | 4 +- .../common-hal/microcontroller/__init__.c | 16 ++++- ports/cxd56/common-hal/pulseio/PulseIn.c | 5 +- ports/cxd56/common-hal/time/__init__.c | 45 ------------- ports/cxd56/mphalport.c | 63 ------------------- ports/cxd56/mphalport.h | 3 + ports/cxd56/supervisor/internal_flash.c | 2 +- ports/cxd56/supervisor/port.c | 41 ++++++++++++ ports/cxd56/tick.c | 36 ----------- ports/cxd56/tick.h | 32 ---------- shared-module/time/__init__.c | 1 + 13 files changed, 72 insertions(+), 186 deletions(-) delete mode 100644 ports/cxd56/common-hal/time/__init__.c delete mode 100644 ports/cxd56/tick.c delete mode 100644 ports/cxd56/tick.h diff --git a/ports/atmel-samd/mphalport.h b/ports/atmel-samd/mphalport.h index 8a762e2584..f119717499 100644 --- a/ports/atmel-samd/mphalport.h +++ b/ports/atmel-samd/mphalport.h @@ -34,9 +34,8 @@ #include "supervisor/shared/tick.h" // Global millisecond tick count (driven by SysTick interrupt). -static inline mp_uint_t mp_hal_ticks_ms(void) { - return supervisor_ticks_ms32(); -} +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) + // Number of bytes in receive buffer volatile uint8_t usb_rx_count; volatile bool mp_cdc_enabled; diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index e2fce976d7..507d763312 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -152,7 +152,6 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) SRC_S = supervisor/cpu.s SRC_C = \ - tick.c \ background.c \ fatfs_port.c \ mphalport.c \ @@ -184,7 +183,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) # List of sources for qstr extraction SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. -SRC_QSTR_PREPROCESSOR += +SRC_QSTR_PREPROCESSOR += all: $(BUILD)/firmware.spk @@ -197,7 +196,7 @@ $(FIRMWARE): $(ECHO) "run make flash-bootloader again to flash bootloader." exit 1 -$(BUILD)/libmpy.a: $(SPRESENSE_SDK) $(OBJ) +$(BUILD)/libmpy.a: $(SPRESENSE_SDK) $(OBJ) $(ECHO) "AR $@" $(Q)$(AR) rcs $(BUILD)/libmpy.a $(OBJ) diff --git a/ports/cxd56/common-hal/microcontroller/Processor.c b/ports/cxd56/common-hal/microcontroller/Processor.c index 3e6fc3b8aa..1eddbb01de 100644 --- a/ports/cxd56/common-hal/microcontroller/Processor.c +++ b/ports/cxd56/common-hal/microcontroller/Processor.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include // for cxd56_clock.h +#include #include // For NAN: remove when not needed. @@ -31,7 +33,7 @@ #include "py/mphal.h" uint32_t common_hal_mcu_processor_get_frequency(void) { - return mp_hal_ticks_cpu(); + return cxd56_get_cpu_baseclk(); } float common_hal_mcu_processor_get_temperature(void) { diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c index 2be74b0069..7aa3b839d7 100644 --- a/ports/cxd56/common-hal/microcontroller/__init__.c +++ b/ports/cxd56/common-hal/microcontroller/__init__.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include // for cxd56_clock.h +#include #include #include "py/mphal.h" @@ -42,8 +44,20 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#define DELAY_CORRECTION (700) + void common_hal_mcu_delay_us(uint32_t delay) { - mp_hal_delay_us(delay); + if (delay) { + unsigned long long ticks = cxd56_get_cpu_baseclk() / 1000000L * delay; + if (ticks < DELAY_CORRECTION) return; // delay time already used in calculation + + ticks -= DELAY_CORRECTION; + ticks /= 6; + // following loop takes 6 cycles + do { + __asm__ __volatile__("nop"); + } while(--ticks); + } } void common_hal_mcu_disable_interrupts(void) { diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 65ca1d97eb..f474c0a105 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -25,6 +25,7 @@ */ #include +#include #include "py/runtime.h" #include "py/mphal.h" @@ -51,7 +52,9 @@ static int pulsein_set_config(pulseio_pulsein_obj_t *self, bool first_edge) { static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg) { // Grab the current time first. - uint32_t current_us = mp_hal_ticks_us(); + struct timeval tv; + gettimeofday(&tv, NULL); + uint32_t current_us = tv.tv_sec * 1000000 + tv.tv_usec; pulseio_pulsein_obj_t *self = pulsein_objects[irq - CXD56_IRQ_EXDEVICE_0]; diff --git a/ports/cxd56/common-hal/time/__init__.c b/ports/cxd56/common-hal/time/__init__.c deleted file mode 100644 index 31c63cbb29..0000000000 --- a/ports/cxd56/common-hal/time/__init__.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2019 Sony Semiconductor Solutions Corporation - * - * 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 - -#include "py/mphal.h" - -#include "supervisor/shared/tick.h" - -uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} - -uint64_t common_hal_time_monotonic_ns(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return 1000 * ((uint64_t) tv.tv_sec * 1000000 + (uint64_t) tv.tv_usec); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} diff --git a/ports/cxd56/mphalport.c b/ports/cxd56/mphalport.c index 1305706caa..5a76b83bdf 100644 --- a/ports/cxd56/mphalport.c +++ b/ports/cxd56/mphalport.c @@ -23,66 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include -#include -#include -#include - -#include "py/mpstate.h" - -#include "supervisor/shared/tick.h" - -#define DELAY_CORRECTION (700) -#define DELAY_INTERVAL (50) - -void mp_hal_init(void) { - boardctl(BOARDIOC_INIT, 0); -} - -mp_uint_t mp_hal_ticks_ms(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * 1000 + tv.tv_usec / 1000; -} - -mp_uint_t mp_hal_ticks_us(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec * 1000000 + tv.tv_usec; -} - -mp_uint_t mp_hal_ticks_cpu(void) { - return cxd56_get_cpu_baseclk(); -} - -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - -void mp_hal_delay_us(uint32_t us) { - if (us) { - unsigned long long ticks = mp_hal_ticks_cpu() / 1000000L * us; - if (ticks < DELAY_CORRECTION) return; // delay time already used in calculation - - ticks -= DELAY_CORRECTION; - ticks /= 6; - // following loop takes 6 cycles - do { - __asm__ __volatile__("nop"); - } while(--ticks); - } -} diff --git a/ports/cxd56/mphalport.h b/ports/cxd56/mphalport.h index a2be10b8d0..50e805cf50 100644 --- a/ports/cxd56/mphalport.h +++ b/ports/cxd56/mphalport.h @@ -30,5 +30,8 @@ #include #include "lib/utils/interrupt_char.h" +#include "supervisor/shared/tick.h" + +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) #endif // MICROPY_INCLUDED_CXD56_MPHALPORT_H diff --git a/ports/cxd56/supervisor/internal_flash.c b/ports/cxd56/supervisor/internal_flash.c index 0c9a61e063..2726fa4a23 100644 --- a/ports/cxd56/supervisor/internal_flash.c +++ b/ports/cxd56/supervisor/internal_flash.c @@ -59,7 +59,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CXD56_SPIFLASHSIZE >> PAGE_SHIFT; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (flash_sector == NO_SECTOR) { return; } diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 5d2957f350..73d6fb9309 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -25,13 +25,16 @@ */ #include + #include +#include #include "sched/sched.h" #include "boards/board.h" #include "supervisor/port.h" +#include "supervisor/shared/tick.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/analogio/AnalogIn.h" @@ -103,3 +106,41 @@ void port_set_saved_word(uint32_t value) { uint32_t port_get_saved_word(void) { return _ebss; } + +volatile bool _tick_enabled; +void board_timerhook(void) +{ + // Do things common to all ports when the tick occurs + if (_tick_enabled) { + supervisor_tick(); + } +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + struct timeval tv; + gettimeofday(&tv, NULL); + long computed_subticks = tv.tv_usec * 1024 * 32 / 1000000; + if (subticks != NULL) { + *subticks = computed_subticks % 32; + } + + return tv.tv_sec * 1024 + computed_subticks / 32; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + _tick_enabled = true; +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + _tick_enabled = false; +} + +void port_interrupt_after_ticks(uint32_t ticks) { +} + +void port_sleep_until_interrupt(void) { + // TODO: Implement sleep. +} + diff --git a/ports/cxd56/tick.c b/ports/cxd56/tick.c deleted file mode 100644 index 671b82b744..0000000000 --- a/ports/cxd56/tick.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2019 Sony Semiconductor Solutions Corporation - * - * 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 "tick.h" - -#include "supervisor/shared/autoreload.h" -#include "supervisor/shared/tick.h" - -void board_timerhook(void) -{ - // Do things common to all ports when the tick occurs - supervisor_tick(); -} diff --git a/ports/cxd56/tick.h b/ports/cxd56/tick.h deleted file mode 100644 index d641d9cd4f..0000000000 --- a/ports/cxd56/tick.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright 2019 Sony Semiconductor Solutions Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_CXD56_TICK_H -#define MICROPY_INCLUDED_CXD56_TICK_H - -#include "py/mpconfig.h" - -#endif // MICROPY_INCLUDED_CXD56_TICK_H diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 21fe98926a..347e68ae02 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -26,6 +26,7 @@ #include "py/mphal.h" #include "supervisor/port.h" +#include "supervisor/shared/tick.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); From aaf07ce72f1d3ac8d78fb002a68138e281c8f92c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Mar 2020 16:37:16 -0500 Subject: [PATCH 091/919] Update shared-bindings/ulab/__init__.rst Co-Authored-By: Scott Shawcroft --- shared-bindings/ulab/__init__.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index b2f3d56818..1379e56f3f 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -383,7 +383,7 @@ much more efficient than expressing the same operation as a Python loop. Perform a Fast Fourier Transform from the time domain into the frequency domain - See also ~ulab.extras.spectrogram, which computes the magnitude of the fft, + See also ~ulab.extras.spectrum, which computes the magnitude of the fft, rather than separately returning its real and imaginary parts. .. method:: ifft(r, c=None) From 38a718ff5558c2286172091615aaeb2ded5f70f5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Mar 2020 16:41:09 -0500 Subject: [PATCH 092/919] Translations: follow stm port rename, run 'make translate' --- Makefile | 2 +- locale/ID.po | 182 ++++++++++++++++++++++++- locale/circuitpython.pot | 182 ++++++++++++++++++++++++- locale/de_DE.po | 182 ++++++++++++++++++++++++- locale/en_US.po | 182 ++++++++++++++++++++++++- locale/en_x_pirate.po | 182 ++++++++++++++++++++++++- locale/es.po | 182 ++++++++++++++++++++++++- locale/fil.po | 182 ++++++++++++++++++++++++- locale/fr.po | 182 ++++++++++++++++++++++++- locale/it_IT.po | 182 ++++++++++++++++++++++++- locale/ko.po | 182 ++++++++++++++++++++++++- locale/pl.po | 182 ++++++++++++++++++++++++- locale/pt_BR.po | 182 ++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 287 ++++++++++++++++++++++++--------------- 14 files changed, 2276 insertions(+), 197 deletions(-) diff --git a/Makefile b/Makefile index 7eff665c08..5e949cd40f 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS) # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(BASEOPTS) -TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/mimxrt10xx ports/nrf ports/stm32f4 py shared-bindings shared-module supervisor +TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext stubs diff --git a/locale/ID.po b/locale/ID.po index 12d7b52fbf..b68e9d0902 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -482,6 +482,10 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -539,6 +543,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -561,6 +593,14 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC sudah digunakan" @@ -669,6 +709,7 @@ msgstr "Gagal untuk mengalokasikan buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" @@ -702,6 +743,10 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -716,10 +761,22 @@ msgstr "" msgid "Group full" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operasi I2C tidak didukung" @@ -746,16 +803,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "%q pada tidak valid" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -765,11 +834,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -781,7 +850,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ukuran buffer tidak valid" @@ -809,6 +878,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -844,6 +917,10 @@ msgstr "Pin untuk channel kanan tidak valid" msgid "Invalid pins" msgstr "Pin-pin tidak valid" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -872,6 +949,10 @@ msgstr "" msgid "Invalid wave file" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" @@ -917,10 +998,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -934,6 +1023,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" @@ -942,13 +1032,23 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Tidak pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Tidak ada pin TX" @@ -977,6 +1077,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1045,6 +1149,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1056,9 +1161,14 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" @@ -1081,6 +1191,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1095,10 +1217,14 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1137,6 +1263,14 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1184,6 +1318,14 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1257,6 +1399,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1373,6 +1535,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" @@ -2073,7 +2239,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -2564,6 +2731,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index c9bad41d01..352178a93f 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -472,6 +472,10 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -529,6 +533,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -551,6 +583,14 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -658,6 +698,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -691,6 +732,10 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -705,10 +750,22 @@ msgstr "" msgid "Group full" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -735,16 +792,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -754,11 +823,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -770,7 +839,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -798,6 +867,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -833,6 +906,10 @@ msgstr "" msgid "Invalid pins" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -861,6 +938,10 @@ msgstr "" msgid "Invalid wave file" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -906,10 +987,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -923,6 +1012,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -931,13 +1021,23 @@ msgstr "" msgid "No DMA channel found" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -966,6 +1066,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1033,6 +1137,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1044,9 +1149,14 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1067,6 +1177,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1081,10 +1203,14 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1121,6 +1247,14 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1168,6 +1302,14 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1241,6 +1383,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1356,6 +1518,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -2049,7 +2215,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2539,6 +2706,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index eb2170b81b..3794537a96 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -476,6 +476,10 @@ msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." msgid "Cannot unambiguously get sizeof scalar" msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Kann nicht ohne MOSI-Pin schreiben." @@ -533,6 +537,34 @@ msgstr "Beschädigter raw code" msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -555,6 +587,14 @@ msgstr "Konnte second buffer nicht zuteilen" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC wird schon benutzt" @@ -662,6 +702,7 @@ msgstr "Konnte keinen RX Buffer allozieren" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" @@ -697,6 +738,10 @@ msgstr "" "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme " "angehalten." +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -711,10 +756,22 @@ msgstr "Gruppe schon benutzt" msgid "Group full" msgstr "Gruppe voll" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C-operation nicht unterstützt" @@ -743,16 +800,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Ungültiger %q pin" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Ungültige BMP-Datei" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -762,11 +831,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -778,7 +847,7 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Ungültige Puffergröße" @@ -806,6 +875,10 @@ msgstr "Ungültige Datei" msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -841,6 +914,10 @@ msgstr "Ungültiger Pin für rechten Kanal" msgid "Invalid pins" msgstr "Ungültige Pins" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Ungültige Polarität" @@ -869,6 +946,10 @@ msgstr "Ungültige Anzahl von Stimmen" msgid "Invalid wave file" msgstr "Ungültige wave Datei" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS des Schlüsselwortarguments muss eine id sein" @@ -915,10 +996,18 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -932,6 +1021,7 @@ msgid "No CCCD for this Characteristic" msgstr "Kein CCCD für diese Charakteristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Kein DAC im Chip vorhanden" @@ -940,13 +1030,23 @@ msgstr "Kein DAC im Chip vorhanden" msgid "No DMA channel found" msgstr "Kein DMA Kanal gefunden" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Kein RX Pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Kein TX Pin" @@ -975,6 +1075,10 @@ msgstr "Keine Hardwareunterstützung am clk Pin" msgid "No hardware support on pin" msgstr "Keine Hardwareunterstützung an diesem Pin" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Kein Pulldown Widerstand am Pin; 1Mohm wird vorgeschlagen" @@ -1048,6 +1152,7 @@ msgid "" msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1059,9 +1164,14 @@ msgstr "Zugang verweigert" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" @@ -1084,6 +1194,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1098,10 +1220,14 @@ msgid "RTC is not supported on this board" msgstr "Eine RTC wird auf diesem Board nicht unterstützt" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" @@ -1138,6 +1264,14 @@ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" msgid "SDA or SCL needs a pull up" msgstr "SDA oder SCL brauchen pull up" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Abtastrate muss positiv sein" @@ -1185,6 +1319,14 @@ msgstr "Die Stackgröße sollte mindestens 256 sein" msgid "Stream missing readinto() or write() method." msgstr "Stream fehlt readinto() oder write() Methode." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1260,6 +1402,26 @@ msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" msgid "Tuple or struct_time argument required" msgstr "Tuple- oder struct_time-Argument erforderlich" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB beschäftigt" @@ -1377,6 +1539,10 @@ msgstr "Länge des Wertes > max_length" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -2079,7 +2245,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -2577,6 +2744,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" diff --git a/locale/en_US.po b/locale/en_US.po index 217ce444bf..9d88663aac 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -472,6 +472,10 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -529,6 +533,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -551,6 +583,14 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -658,6 +698,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -691,6 +732,10 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -705,10 +750,22 @@ msgstr "" msgid "Group full" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -735,16 +792,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -754,11 +823,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -770,7 +839,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -798,6 +867,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -833,6 +906,10 @@ msgstr "" msgid "Invalid pins" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -861,6 +938,10 @@ msgstr "" msgid "Invalid wave file" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -906,10 +987,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -923,6 +1012,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -931,13 +1021,23 @@ msgstr "" msgid "No DMA channel found" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -966,6 +1066,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1033,6 +1137,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1044,9 +1149,14 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1067,6 +1177,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1081,10 +1203,14 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1121,6 +1247,14 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1168,6 +1302,14 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1241,6 +1383,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1356,6 +1518,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -2049,7 +2215,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2539,6 +2706,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index f911817076..e5b135bf02 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -476,6 +476,10 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -533,6 +537,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -555,6 +587,14 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "" @@ -662,6 +702,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -695,6 +736,10 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -709,10 +754,22 @@ msgstr "" msgid "Group full" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -739,16 +796,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Avast! %q pin be invalid" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -758,11 +827,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -774,7 +843,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -802,6 +871,10 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -837,6 +910,10 @@ msgstr "Belay that! Invalid pin for starboard-side channel" msgid "Invalid pins" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -865,6 +942,10 @@ msgstr "" msgid "Invalid wave file" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -910,10 +991,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -927,6 +1016,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Shiver me timbers! There be no DAC on this chip" @@ -935,13 +1025,23 @@ msgstr "Shiver me timbers! There be no DAC on this chip" msgid "No DMA channel found" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -970,6 +1070,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1037,6 +1141,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1048,9 +1153,14 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Belay that! Th' Pin be not ADC capable" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1071,6 +1181,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1085,10 +1207,14 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1125,6 +1251,14 @@ msgstr "Runnin' in safe mode! Nay runnin' saved code.\n" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1172,6 +1306,14 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1245,6 +1387,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1360,6 +1522,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "Blimey! Yer code filename has two extensions\n" @@ -2053,7 +2219,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2543,6 +2710,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/es.po b/locale/es.po index 20bfbdd3ac..214496ed38 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -478,6 +478,10 @@ msgstr "No se puede transmitir sin pines MOSI y MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "No se puede obtener inequívocamente sizeof escalar" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "No se puede escribir sin pin MOSI." @@ -535,6 +539,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -557,6 +589,14 @@ msgstr "No se pudo asignar el segundo buffer" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC ya está siendo utilizado" @@ -664,6 +704,7 @@ msgstr "Ha fallado la asignación del buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" @@ -697,6 +738,10 @@ msgstr "El archivo ya existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -711,10 +756,22 @@ msgstr "" msgid "Group full" msgstr "Group lleno" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operación I2C no soportada" @@ -743,16 +800,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pin %q inválido" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Archivo BMP inválido" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -762,11 +831,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -778,7 +847,7 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Tamaño de buffer inválido" @@ -806,6 +875,10 @@ msgstr "Archivo inválido" msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -841,6 +914,10 @@ msgstr "Pin inválido para canal derecho" msgid "Invalid pins" msgstr "pines inválidos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polaridad inválida" @@ -869,6 +946,10 @@ msgstr "Cuenta de voces inválida" msgid "Invalid wave file" msgstr "Archivo wave inválido" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS del agumento por palabra clave deberia ser un identificador" @@ -914,10 +995,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -931,6 +1020,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "El chip no tiene DAC" @@ -939,13 +1029,23 @@ msgstr "El chip no tiene DAC" msgid "No DMA channel found" msgstr "No se encontró el canal DMA" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Sin pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Sin pin TX" @@ -974,6 +1074,10 @@ msgstr "Sin soporte de hardware en el pin clk" msgid "No hardware support on pin" msgstr "Sin soporte de hardware en pin" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1047,6 +1151,7 @@ msgstr "" "construcion" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1058,9 +1163,14 @@ msgstr "Permiso denegado" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin no tiene capacidad ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1083,6 +1193,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1097,10 +1219,14 @@ msgid "RTC is not supported on this board" msgstr "RTC no soportado en esta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Solo-lectura" @@ -1138,6 +1264,14 @@ msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Sample rate debe ser positivo" @@ -1185,6 +1319,14 @@ msgstr "El tamaño de la pila debe ser de al menos 256" msgid "Stream missing readinto() or write() method." msgstr "A Stream le falta el método readinto() o write()." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1258,6 +1400,26 @@ msgstr "Traceback (ultima llamada reciente):\n" msgid "Tuple or struct_time argument required" msgstr "Argumento tuple o struct_time requerido" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB ocupado" @@ -1374,6 +1536,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "funciones Viper actualmente no soportan más de 4 argumentos." +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" @@ -2080,7 +2246,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index fuera de rango" @@ -2577,6 +2744,7 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" diff --git a/locale/fil.po b/locale/fil.po index 838089dbdc..43fd086866 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -480,6 +480,10 @@ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." msgid "Cannot unambiguously get sizeof scalar" msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Hindi maaring isulat kapag walang MOSI pin." @@ -538,6 +542,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -560,6 +592,14 @@ msgstr "Hindi ma-iallocate ang second buffer" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "Ginagamit na ang DAC" @@ -672,6 +712,7 @@ msgstr "Nabigong ilaan ang RX buffer" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" @@ -705,6 +746,10 @@ msgstr "Mayroong file" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -719,10 +764,22 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "Hindi supportado ang operasyong I2C" @@ -751,16 +808,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Mali ang %q pin" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Mali ang BMP file" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -770,11 +839,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -786,7 +855,7 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Mali ang buffer size" @@ -814,6 +883,10 @@ msgstr "Mali ang file" msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -849,6 +922,10 @@ msgstr "Mali ang pin para sa kanang channel" msgid "Invalid pins" msgstr "Mali ang pins" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Mali ang polarity" @@ -877,6 +954,10 @@ msgstr "Maling bilang ng voice" msgid "Invalid wave file" msgstr "May hindi tama sa wave file" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" @@ -922,10 +1003,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -939,6 +1028,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Walang DAC sa chip" @@ -947,13 +1037,23 @@ msgstr "Walang DAC sa chip" msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Walang RX pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Walang TX pin" @@ -982,6 +1082,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1053,6 +1157,7 @@ msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1064,9 +1169,14 @@ msgstr "Walang pahintulot" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Ang pin ay walang kakayahan sa ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" @@ -1089,6 +1199,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1103,10 +1225,14 @@ msgid "RTC is not supported on this board" msgstr "Hindi supportado ang RTC sa board na ito" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Basahin-lamang" @@ -1144,6 +1270,14 @@ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Sample rate ay dapat positibo" @@ -1191,6 +1325,14 @@ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" msgid "Stream missing readinto() or write() method." msgstr "Stream kulang ng readinto() o write() method." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1264,6 +1406,26 @@ msgstr "Traceback (pinakahuling huling tawag): \n" msgid "Tuple or struct_time argument required" msgstr "Tuple o struct_time argument kailangan" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "Busy ang USB" @@ -1383,6 +1545,10 @@ msgstr "" "Ang mga function ng Viper ay kasalukuyang hindi sumusuporta sa higit sa 4 na " "argumento" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" @@ -2095,7 +2261,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index wala sa sakop" @@ -2591,6 +2758,7 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" diff --git a/locale/fr.po b/locale/fr.po index 46366fe295..aab2f8d49b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -485,6 +485,10 @@ msgstr "Pas de transfert sans broches MOSI et MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossible d'écrire sans broche MOSI." @@ -543,6 +547,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -565,6 +597,14 @@ msgstr "Impossible d'allouer le 2e tampon" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC déjà utilisé" @@ -675,6 +715,7 @@ msgstr "Echec de l'allocation du tampon RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" @@ -708,6 +749,10 @@ msgstr "Le fichier existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -722,10 +767,22 @@ msgstr "" msgid "Group full" msgstr "Groupe plein" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "opération d'E/S sur un fichier fermé" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "opération sur I2C non supportée" @@ -754,17 +811,29 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c #, fuzzy msgid "Invalid BMP file" msgstr "Fichier BMP invalide" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -774,11 +843,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Fréquence de PWM invalide" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -790,7 +859,7 @@ msgstr "Argument invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "Longueur de tampon invalide" @@ -820,6 +889,10 @@ msgstr "Fichier invalide" msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -855,6 +928,10 @@ msgstr "Broche invalide pour le canal droit" msgid "Invalid pins" msgstr "Broches invalides" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarité invalide" @@ -884,6 +961,10 @@ msgstr "Nombre de voix invalide" msgid "Invalid wave file" msgstr "Fichier WAVE invalide" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "La partie gauche de l'argument nommé doit être un identifiant" @@ -929,10 +1010,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -946,6 +1035,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Pas de DAC sur la puce" @@ -954,13 +1044,23 @@ msgstr "Pas de DAC sur la puce" msgid "No DMA channel found" msgstr "Aucun canal DMA trouvé" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Pas de broche RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Pas de broche TX" @@ -989,6 +1089,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Pas de support matériel pour cette broche" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1067,6 +1171,7 @@ msgstr "" "à la construction." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1078,9 +1183,14 @@ msgstr "Permission refusée" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "La broche ne peut être utilisée pour l'ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1102,6 +1212,18 @@ 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/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1116,10 +1238,14 @@ msgid "RTC is not supported on this board" msgstr "RTC non supportée sur cette carte" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Lecture seule" @@ -1157,6 +1283,14 @@ msgstr "Mode sans-échec! Le code sauvegardé n'est pas éxecuté.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "Sample rate must be positive" @@ -1205,6 +1339,14 @@ msgstr "La pile doit être au moins de 256" msgid "Stream missing readinto() or write() method." msgstr "Il manque une méthode readinto() ou write() au flux." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1279,6 +1421,26 @@ msgstr "Trace (appels les plus récents en dernier):\n" msgid "Tuple or struct_time argument required" msgstr "Argument de type tuple ou struct_time nécessaire" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB occupé" @@ -1401,6 +1563,10 @@ msgid "Viper functions don't currently support more than 4 arguments" msgstr "" "les fonctions de Viper ne supportent pas plus de 4 arguments actuellement" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENTION: le nom de fichier de votre code a deux extensions\n" @@ -2119,7 +2285,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "index hors gamme" @@ -2623,6 +2790,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "'pop' d'une entrée PulseIn vide" diff --git a/locale/it_IT.po b/locale/it_IT.po index 4bba0b8022..0378ef77cc 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -481,6 +481,10 @@ msgstr "Impossibile trasferire senza i pin MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossibile scrivere senza pin MOSI." @@ -539,6 +543,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -561,6 +593,14 @@ msgstr "Impossibile allocare il secondo buffer" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC già in uso" @@ -672,6 +712,7 @@ msgstr "Impossibile allocare buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" @@ -705,6 +746,10 @@ msgstr "File esistente" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -719,10 +764,22 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "operazione I2C non supportata" @@ -751,16 +808,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pin %q non valido" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "File BMP non valido" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -770,11 +839,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -786,7 +855,7 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "lunghezza del buffer non valida" @@ -816,6 +885,10 @@ msgstr "File non valido" msgid "Invalid format chunk size" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -851,6 +924,10 @@ msgstr "Pin non valido per il canale destro" msgid "Invalid pins" msgstr "Pin non validi" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Polarità non valida" @@ -880,6 +957,10 @@ msgstr "Tipo di servizio non valido" msgid "Invalid wave file" msgstr "File wave non valido" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -926,10 +1007,18 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Il ritardo di avvio del microfono deve essere nell'intervallo tra 0.0 e 1.0" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -943,6 +1032,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nessun DAC sul chip" @@ -951,13 +1041,23 @@ msgstr "Nessun DAC sul chip" msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nessun pin RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Nessun pin TX" @@ -986,6 +1086,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1062,6 +1166,7 @@ msgstr "" "impostato nel costruttore a False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1073,9 +1178,14 @@ msgstr "Permesso negato" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Il pin non ha capacità di ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1098,6 +1208,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1112,10 +1234,14 @@ msgid "RTC is not supported on this board" msgstr "RTC non supportato su questa scheda" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Sola lettura" @@ -1153,6 +1279,14 @@ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "Sample rate must be positive" @@ -1202,6 +1336,14 @@ msgstr "La dimensione dello stack deve essere almeno 256" msgid "Stream missing readinto() or write() method." msgstr "Metodi mancanti readinto() o write() allo stream." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1275,6 +1417,26 @@ msgstr "Traceback (chiamata più recente per ultima):\n" msgid "Tuple or struct_time argument required" msgstr "Tupla o struct_time richiesto come argomento" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB occupata" @@ -1392,6 +1554,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Le funzioni Viper non supportano più di 4 argomenti al momento" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" @@ -2096,7 +2262,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -2598,6 +2765,7 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" diff --git a/locale/ko.po b/locale/ko.po index b4085c2197..949b8cc62e 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -476,6 +476,10 @@ msgstr "" msgid "Cannot unambiguously get sizeof scalar" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -533,6 +537,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -555,6 +587,14 @@ msgstr "" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC가 현재 사용 중입니다" @@ -662,6 +702,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "" @@ -695,6 +736,10 @@ msgstr "" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -709,10 +754,22 @@ msgstr "" msgid "Group full" msgstr "" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "" @@ -739,16 +796,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -758,11 +827,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -774,7 +843,7 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "" @@ -802,6 +871,10 @@ msgstr "파일이 유효하지 않습니다" msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -837,6 +910,10 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -865,6 +942,10 @@ msgstr "" msgid "Invalid wave file" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -910,10 +991,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -927,6 +1016,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "" @@ -935,13 +1025,23 @@ msgstr "" msgid "No DMA channel found" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "" @@ -970,6 +1070,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1037,6 +1141,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1048,9 +1153,14 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1071,6 +1181,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1085,10 +1207,14 @@ msgid "RTC is not supported on this board" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "" @@ -1125,6 +1251,14 @@ msgstr "" msgid "SDA or SCL needs a pull up" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1172,6 +1306,14 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1245,6 +1387,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "" @@ -1361,6 +1523,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "" @@ -2054,7 +2220,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "" @@ -2544,6 +2711,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 2ed3a5924b..b25e42fe53 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -475,6 +475,10 @@ msgstr "Nie można przesyłać bez nóżek MOSI i MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wielkość skalara jest niejednoznaczna" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Nie można pisać bez nóżki MOSI." @@ -532,6 +536,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -554,6 +586,14 @@ msgstr "Nie udała się alokacja drugiego bufora" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC w użyciu" @@ -661,6 +701,7 @@ msgstr "Nie udała się alokacja bufora RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udała się alokacja %d bajtów na bufor RX" @@ -694,6 +735,10 @@ msgstr "Plik istnieje" msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -708,10 +753,22 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "Operacja I2C nieobsługiwana" @@ -740,16 +797,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Zła nóżka %q" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Zły BMP" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -759,11 +828,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -775,7 +844,7 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Zła wielkość bufora" @@ -803,6 +872,10 @@ msgstr "Zły plik" msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -838,6 +911,10 @@ msgstr "Zła nóżka dla prawego kanału" msgid "Invalid pins" msgstr "Złe nóżki" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Zła polaryzacja" @@ -866,6 +943,10 @@ msgstr "Zła liczba głosów" msgid "Invalid wave file" msgstr "Zły plik wave" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" @@ -911,10 +992,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -928,6 +1017,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Brak DAC" @@ -936,13 +1026,23 @@ msgstr "Brak DAC" msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Brak nóżki RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Brak nóżki TX" @@ -971,6 +1071,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1038,6 +1142,7 @@ msgid "" msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1049,9 +1154,14 @@ msgstr "Odmowa dostępu" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Nóżka nie obsługuje ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" @@ -1072,6 +1182,18 @@ 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/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1086,10 +1208,14 @@ msgid "RTC is not supported on this board" msgstr "Brak obsługi RTC" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Tylko do odczytu" @@ -1126,6 +1252,14 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Częstotliwość próbkowania musi być dodatnia" @@ -1173,6 +1307,14 @@ msgstr "Stos musi mieć co najmniej 256 bajtów" msgid "Stream missing readinto() or write() method." msgstr "Strumień nie ma metod readinto() lub write()." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1246,6 +1388,26 @@ msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" msgid "Tuple or struct_time argument required" msgstr "Wymagana krotka lub struct_time" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB Zajęte" @@ -1361,6 +1523,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Funkcje Viper nie obsługują obecnie więcej niż 4 argumentów" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" @@ -2058,7 +2224,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -2549,6 +2716,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ca169d081a..ec4658477e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -477,6 +477,10 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." msgid "Cannot unambiguously get sizeof scalar" msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Não é possível ler sem um pino MOSI" @@ -535,6 +539,34 @@ msgstr "" msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "" @@ -557,6 +589,14 @@ msgstr "Não pôde alocar segundo buffer" msgid "Crash into the HardFault_Handler." msgstr "" +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "DAC em uso" @@ -667,6 +707,7 @@ msgstr "Falha ao alocar buffer RX" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" @@ -700,6 +741,10 @@ msgstr "Arquivo já existe" msgid "Frequency captured is above capability. Capture Paused." msgstr "" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -714,10 +759,22 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C operação não suportada" @@ -744,16 +801,28 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Pino do %q inválido" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Arquivo BMP inválido" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -763,11 +832,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -779,7 +848,7 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c #, fuzzy msgid "Invalid buffer size" msgstr "Arquivo inválido" @@ -809,6 +878,10 @@ msgstr "Arquivo inválido" msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "" @@ -844,6 +917,10 @@ msgstr "Pino inválido para canal direito" msgid "Invalid pins" msgstr "Pinos inválidos" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "" @@ -873,6 +950,10 @@ msgstr "certificado inválido" msgid "Invalid wave file" msgstr "Aqruivo de ondas inválido" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -918,10 +999,18 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -935,6 +1024,7 @@ msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Nenhum DAC no chip" @@ -943,13 +1033,23 @@ msgstr "Nenhum DAC no chip" msgid "No DMA channel found" msgstr "Nenhum canal DMA encontrado" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Nenhum pino RX" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Nenhum pino TX" @@ -978,6 +1078,10 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "" @@ -1048,6 +1152,7 @@ msgid "" msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "" @@ -1059,9 +1164,14 @@ msgstr "Permissão negada" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "O pino não tem recursos de ADC" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1083,6 +1193,18 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1097,10 +1219,14 @@ msgid "RTC is not supported on this board" msgstr "O RTC não é suportado nesta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Somente leitura" @@ -1138,6 +1264,14 @@ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" @@ -1185,6 +1319,14 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" msgid "Stream missing readinto() or write() method." msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1258,6 +1400,26 @@ msgstr "" msgid "Tuple or struct_time argument required" msgstr "" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB ocupada" @@ -1374,6 +1536,10 @@ msgstr "" msgid "Viper functions don't currently support more than 4 arguments" msgstr "" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" @@ -2071,7 +2237,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "Índice fora do intervalo" @@ -2561,6 +2728,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 7993cf7bd4..8fbd53d704 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-16 20:59-0500\n" +"POT-Creation-Date: 2020-03-17 16:39-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -481,6 +481,10 @@ msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." msgid "Cannot unambiguously get sizeof scalar" msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." @@ -540,6 +544,34 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "Wúfǎ chūshǐhuà píndào" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "Wúfǎ chūshǐhuà jìshí qì" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "Wúfǎ chóngqǐ PWM" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "Wúfǎ qǐdòng PWM" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" + #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" msgstr "Zhǎo bù dào jiěmǎ qì" @@ -562,6 +594,14 @@ msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" msgid "Crash into the HardFault_Handler." msgstr "Zhuìhuǐ. Shūrù HardFault_Handler." +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "DAC tōngdào chūshǐhuà cuòwù" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "DAC shèbèi chūshǐhuà cuòwù" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" msgstr "Fā yuán huì yǐjīng shǐyòng" @@ -669,6 +709,7 @@ msgstr "Fēnpèi RX huǎnchōng shībài" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" @@ -702,6 +743,10 @@ msgstr "Wénjiàn cúnzài" msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" + #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" @@ -716,10 +761,22 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" + #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "I2C chūshǐhuà cuòwù" + #: extmod/machine_i2c.c msgid "I2C operation not supported" msgstr "I2C cāozuò bù zhīchí" @@ -748,16 +805,28 @@ msgstr "Rènzhèng bùzú" msgid "Insufficient encryption" msgstr "Jiāmì bùzú" +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "Nèibù dìngyì cuòwù" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "Wúxiào de ADC dānwèi zhí" + #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" msgstr "Wúxiào de BMP wénjiàn" -#: ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" @@ -767,11 +836,11 @@ msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" -#: ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" @@ -783,7 +852,7 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" msgstr "Wúxiào de huǎnchōng qū dàxiǎo" @@ -811,6 +880,10 @@ msgstr "Wúxiào de wénjiàn" msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "Tígōng de pínlǜ wúxiào" + #: supervisor/shared/safe_mode.c msgid "Invalid memory access." msgstr "Wúxiào de nèicún fǎngwèn." @@ -846,6 +919,10 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" @@ -874,6 +951,10 @@ msgstr "Wúxiào de yǔyīn jìshù" msgid "Invalid wave file" msgstr "Wúxiào de làng làngcháo wénjiàn" +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "Wúxiào de zì/wèi chángdù" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" @@ -919,10 +1000,18 @@ msgstr "MicroPython zhìmìng cuòwù." msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" + #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" + #: py/parse.c msgid "Name too long" msgstr "" @@ -936,6 +1025,7 @@ msgid "No CCCD for this Characteristic" msgstr "Zhège tèzhēng méiyǒu CCCD" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" msgstr "Méiyǒu DAC zài xīnpiàn shàng de" @@ -944,13 +1034,23 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "Méiyǒu MISO yǐn jiǎo" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "Méiyǒu MOSI yǐn jiǎo" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No RX pin" msgstr "Wèi zhǎodào RX yǐn jiǎo" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "No TX pin" msgstr "Wèi zhǎodào TX yǐn jiǎo" @@ -979,6 +1079,10 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." + #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" @@ -1052,6 +1156,7 @@ msgid "" msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" msgstr "Shàng bù zhīchí ParallelBus" @@ -1063,9 +1168,14 @@ msgstr "Quánxiàn bèi jùjué" #: ports/cxd56/common-hal/analogio/AnalogIn.c #: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c #: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" msgstr "Pin méiyǒu ADC nénglì" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" @@ -1086,6 +1196,18 @@ 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/common-hal/pulseio/PulseOut.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ù" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "RNG chūshǐhuà cuòwù" + #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" @@ -1100,10 +1222,14 @@ msgid "RTC is not supported on this board" msgstr "Cǐ bǎn bù zhīchí RTC" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/nrf/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" msgstr "" +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "Suíjī shù shēngchéng cuòwù" + #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" msgstr "Zhǐ dú" @@ -1140,6 +1266,14 @@ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dài msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "SPI chūshǐhuà cuòwù" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "SPI chóngxīn chūshǐhuà cuòwù" + #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" @@ -1187,6 +1321,14 @@ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" msgid "Stream missing readinto() or write() method." msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" @@ -1267,6 +1409,26 @@ msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" msgid "Tuple or struct_time argument required" msgstr "Xūyào Tuple huò struct_time cānshù" +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "UART huǎnchōng qū fēnpèi cuòwù" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "UART qǔxiāo chūshǐhuà cuòwù" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "UART chūshǐhuà cuòwù" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "UART chóngxīn chūshǐhuà cuòwù" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "UART xiě cuòwù" + #: shared-module/usb_hid/Device.c msgid "USB Busy" msgstr "USB máng" @@ -1384,6 +1546,10 @@ msgstr "Zhí chángdù > zuìdà chángdù" msgid "Viper functions don't currently support more than 4 arguments" msgstr "Viper hánshù mùqián bù zhīchí chāoguò 4 gè cānshù" +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + #: main.c msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" @@ -2086,7 +2252,8 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" msgstr "suǒyǐn chāochū fànwéi" @@ -2578,6 +2745,7 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "cóng kōng de PulseIn dànchū dànchū" @@ -2988,9 +3156,6 @@ msgstr "líng bù" #~ msgid "Can't set CCCD for local Characteristic" #~ msgstr "Wúfǎ wéi běndì tèzhēng shèzhì CCCD" -#~ msgid "Cannot vary frequency on a timer that is already in use" -#~ msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" - #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "Zìfú UUID bù fúhé fúwù UUID" @@ -3003,36 +3168,9 @@ msgstr "líng bù" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" -#~ msgid "Could not initialize channel" -#~ msgstr "Wúfǎ chūshǐhuà píndào" - -#~ msgid "Could not initialize timer" -#~ msgstr "Wúfǎ chūshǐhuà jìshí qì" - -#~ msgid "Could not re-init channel" -#~ msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" - -#~ msgid "Could not re-init timer" -#~ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" - -#~ msgid "Could not restart PWM" -#~ msgstr "Wúfǎ chóngqǐ PWM" - -#~ msgid "Could not start PWM" -#~ msgstr "Wúfǎ qǐdòng PWM" - -#~ msgid "Could not start interrupt, RX busy" -#~ msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" - #~ msgid "Crash into the HardFault_Handler.\n" #~ msgstr "Bēngkuì dào HardFault_Handler.\n" -#~ msgid "DAC Channel Init Error" -#~ msgstr "DAC tōngdào chūshǐhuà cuòwù" - -#~ msgid "DAC Device Init Error" -#~ msgstr "DAC shèbèi chūshǐhuà cuòwù" - #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" @@ -3150,27 +3288,6 @@ msgstr "líng bù" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Flash xiě rù shībài, err 0x%04x" -#~ msgid "Frequency must match existing PWMOut using this timer" -#~ msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi" - -#~ msgid "Hardware busy, try alternative pins" -#~ msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" - -#~ msgid "Hardware in use, try alternative pins" -#~ msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" - -#~ msgid "I2C Init Error" -#~ msgstr "I2C chūshǐhuà cuòwù" - -#~ msgid "Internal define error" -#~ msgstr "Nèibù dìngyì cuòwù" - -#~ msgid "Invalid ADC Unit value" -#~ msgstr "Wúxiào de ADC dānwèi zhí" - -#~ msgid "Invalid DAC pin supplied" -#~ msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" - #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -3180,12 +3297,6 @@ msgstr "líng bù" #~ msgid "Invalid data pin" #~ msgstr "Wúxiào de shùjù yǐn jiǎo" -#~ msgid "Invalid frequency supplied" -#~ msgstr "Tígōng de pínlǜ wúxiào" - -#~ msgid "Invalid word/bit length" -#~ msgstr "Wúxiào de zì/wèi chángdù" - #~ msgid "" #~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" #~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" @@ -3202,21 +3313,9 @@ msgstr "líng bù" #~ msgid "MicroPython fatal error.\n" #~ msgstr "MicroPython zhìmìng cuòwù.\n" -#~ msgid "Missing MISO or MOSI Pin" -#~ msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" - #~ msgid "Must be a Group subclass." #~ msgstr "Bìxū shì fēnzǔ zi lèi." -#~ msgid "Must provide MISO or MOSI pin" -#~ msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" - -#~ msgid "No MISO Pin" -#~ msgstr "Méiyǒu MISO yǐn jiǎo" - -#~ msgid "No MOSI Pin" -#~ msgstr "Méiyǒu MOSI yǐn jiǎo" - #~ msgid "No default I2C bus" #~ msgstr "Méiyǒu mòrèn I2C gōnggòng qìchē" @@ -3226,9 +3325,6 @@ msgstr "líng bù" #~ msgid "No default UART bus" #~ msgstr "Méiyǒu mòrèn UART gōnggòng qìchē" -#~ msgid "No more timers available on this pin." -#~ msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." - #~ msgid "Only bit maps of 8 bit color or less are supported" #~ msgstr "Jǐn zhīchí 8 wèi yánsè huò xiǎoyú" @@ -3250,30 +3346,12 @@ msgstr "líng bù" #~ msgid "PulseOut not yet supported" #~ msgstr "Shàng bù zhīchí PulseOut" -#~ msgid "RNG DeInit Error" -#~ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" - -#~ msgid "RNG Init Error" -#~ msgstr "RNG chūshǐhuà cuòwù" - -#~ msgid "Random number generation error" -#~ msgstr "Suíjī shù shēngchéng cuòwù" - #~ msgid "Range out of bounds" #~ msgstr "Fànwéi chāochū biānjiè" -#~ msgid "SPI Init Error" -#~ msgstr "SPI chūshǐhuà cuòwù" - -#~ msgid "SPI Re-initialization error" -#~ msgstr "SPI chóngxīn chūshǐhuà cuòwù" - #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" -#~ msgid "Supply at least one UART pin" -#~ msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" - #~ msgid "" #~ "The CircuitPython heap was corrupted because the stack was too small.\n" #~ "Please increase stack size limits and press reset (after ejecting " @@ -3311,21 +3389,6 @@ msgstr "líng bù" #~ msgid "To exit, please reset the board without " #~ msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " -#~ msgid "UART Buffer allocation error" -#~ msgstr "UART huǎnchōng qū fēnpèi cuòwù" - -#~ msgid "UART De-init error" -#~ msgstr "UART qǔxiāo chūshǐhuà cuòwù" - -#~ msgid "UART Init Error" -#~ msgstr "UART chūshǐhuà cuòwù" - -#~ msgid "UART Re-init error" -#~ msgstr "UART chóngxīn chūshǐhuà cuòwù" - -#~ msgid "UART write error" -#~ msgstr "UART xiě cuòwù" - #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" From 679314a22ed78ede26b7d01646e4fd82aeb30b68 Mon Sep 17 00:00:00 2001 From: jgillick Date: Wed, 18 Mar 2020 00:35:20 -0700 Subject: [PATCH 093/919] Fix disable VBUS sensing. --- ports/stm/supervisor/usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 0c5e70dd8f..6cb9feb4b1 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -41,7 +41,12 @@ STATIC void init_usb_vbus_sense(void) { #if (BOARD_NO_VBUS_SENSE) // Disable VBUS sensing #ifdef USB_OTG_GCCFG_VBDEN + // Deactivate VBUS Sensing B USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; + + // B-peripheral session valid override enable + USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN; + USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL; #else USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; From 310f2ccdf4c07bb2c99d7cbe9bc627299f1f3a3e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Mar 2020 10:09:46 -0500 Subject: [PATCH 094/919] Pixelbuf: subscr: Get correct pixel value Previously, the 0th pixel's value was always returned --- shared-module/_pixelbuf/PixelBuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index bad8539ea8..31350b875c 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -243,6 +243,7 @@ mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self_in, size_t index) if (self->pre_brightness_buffer != NULL) { pixel_buffer = self->pre_brightness_buffer; } + pixel_buffer += self->byteorder.bpp * index; pixelbuf_rgbw_t *rgbw_order = &self->byteorder.byteorder; elems[0] = MP_OBJ_NEW_SMALL_INT(pixel_buffer[rgbw_order->r]); From 7332adfa21d7033f8e5888965039d32b1ec82f76 Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Wed, 18 Mar 2020 16:29:44 -0700 Subject: [PATCH 095/919] Add board support for Winterbloom Big Honking Button --- .../winterbloom_big_honking_button/board.c | 38 +++++++++++++++++++ .../mpconfigboard.h | 20 ++++++++++ .../mpconfigboard.mk | 35 +++++++++++++++++ .../winterbloom_big_honking_button/pins.c | 10 +++++ 4 files changed, 103 insertions(+) create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/board.c create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c b/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c new file mode 100644 index 0000000000..c8e20206a1 --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.h b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.h new file mode 100644 index 0000000000..8d520f675b --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.h @@ -0,0 +1,20 @@ +#define MICROPY_HW_BOARD_NAME "Winterbloom Big Honking Button" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_STATUS (&pin_PA17) + +#define SPI_FLASH_MOSI_PIN &pin_PB22 +#define SPI_FLASH_MISO_PIN &pin_PB03 +#define SPI_FLASH_SCK_PIN &pin_PB23 +#define SPI_FLASH_CS_PIN &pin_PA27 + +// These are pins not to reset. +#define MICROPY_PORT_A (PORT_PA00 | PORT_PA01) +#define MICROPY_PORT_B ( 0 ) +#define MICROPY_PORT_C ( 0 ) + +#define BOARD_HAS_CRYSTAL 0 + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk new file mode 100644 index 0000000000..ca0e5e1deb --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -0,0 +1,35 @@ +# Adafruit +USB_VID = 0x239A +# Allocated for Big Honking Button at https://github.com/adafruit/circuitpython/issues/2715 +USB_PID = 0x6005 +USB_PRODUCT = "Big Honking Button" +USB_MANUFACTURER = "Winterbloom" +USB_DEVICES = "CDC,MSC" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" +LONGINT_IMPL = MPZ + +CIRCUITPY_AUDIOIO = 1 + +# Disable modules that are unusable on this special-purpose board. +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_NETWORK = 0 +CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_PS2IO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_RTC = 0 + +CFLAGS_INLINE_LIMIT = 60 +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c b/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c new file mode 100644 index 0000000000..f325529f39 --- /dev/null +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c @@ -0,0 +1,10 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_HONK_OUT), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_GATE_OUT), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_GATE_IN), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PITCH_IN), MP_ROM_PTR(&pin_PB08) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 25188f53a72884ffc058fd9e31067ea19550554a Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Wed, 18 Mar 2020 16:40:29 -0700 Subject: [PATCH 096/919] Add honking button to build workflow --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ff20dc7a6..0e26a7e7ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -235,6 +235,7 @@ jobs: - "uchip" - "ugame10" - "winterbloom_sol" + - "winterbloom_big_honking_button" - "xinabox_cc03" - "xinabox_cs11" From e027aaf4330f5288d84228a79e395bcd8f0cbabb Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Wed, 18 Mar 2020 16:49:10 -0700 Subject: [PATCH 097/919] Remove some build options, fix order of boards in build.yml --- .github/workflows/build.yml | 2 +- .../boards/winterbloom_big_honking_button/mpconfigboard.mk | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e26a7e7ad..44460b25e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -234,8 +234,8 @@ jobs: - "trinket_m0_haxpress" - "uchip" - "ugame10" - - "winterbloom_sol" - "winterbloom_big_honking_button" + - "winterbloom_sol" - "xinabox_cc03" - "xinabox_cs11" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index ca0e5e1deb..d91369f75e 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -30,6 +30,3 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_RTC = 0 - -CFLAGS_INLINE_LIMIT = 60 -SUPEROPT_GC = 0 From 9be2ab60082fa56d652e0335698ba0855b3c41ba Mon Sep 17 00:00:00 2001 From: jgillick Date: Wed, 18 Mar 2020 23:55:18 -0700 Subject: [PATCH 098/919] Change the board to use an STM32F411 chip. --- .../boards/startup_stm32f412cx_thunderpack.s | 521 ------------------ ports/stm/boards/thunderpack/mpconfigboard.h | 20 +- ports/stm/boards/thunderpack/mpconfigboard.mk | 15 +- ports/stm/boards/thunderpack/pins.c | 118 +--- .../boards/thunderpack/stm32f4xx_hal_conf.h | 94 ++-- .../stm32f4/stm32f412cx_thunderpack/clocks.c | 76 --- .../stm32f4/stm32f412cx_thunderpack/gpio.c | 233 -------- .../stm32f4/stm32f412cx_thunderpack/periph.c | 223 -------- .../stm32f4/stm32f412cx_thunderpack/periph.h | 58 -- .../stm32f4/stm32f412cx_thunderpack/pins.c | 161 ------ .../stm32f4/stm32f412cx_thunderpack/pins.h | 158 ------ 11 files changed, 94 insertions(+), 1583 deletions(-) delete mode 100644 ports/stm/boards/startup_stm32f412cx_thunderpack.s delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h diff --git a/ports/stm/boards/startup_stm32f412cx_thunderpack.s b/ports/stm/boards/startup_stm32f412cx_thunderpack.s deleted file mode 100644 index 1c344ec08a..0000000000 --- a/ports/stm/boards/startup_stm32f412cx_thunderpack.s +++ /dev/null @@ -1,521 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f412Cx.s - * @author MCD Application Team - * @brief STM32F412Cx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word TIM6_IRQHandler /* TIM6 */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */ - .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word RNG_IRQHandler /* RNG */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */ - .word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak TIM6_IRQHandler - .thumb_set TIM6_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak DFSDM1_FLT0_IRQHandler - .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler - - .weak DFSDM1_FLT1_IRQHandler - .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak RNG_IRQHandler - .thumb_set RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - - .weak FMPI2C1_EV_IRQHandler - .thumb_set FMPI2C1_EV_IRQHandler,Default_Handler - - .weak FMPI2C1_ER_IRQHandler - .thumb_set FMPI2C1_ER_IRQHandler,Default_Handler -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index c9602d412b..0e66f2a719 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -23,21 +23,21 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#define BOARD_THUNDERPACK_STM32F412 #define MICROPY_HW_BOARD_NAME "THUNDERPACK" -#define MICROPY_HW_MCU_NAME "STM32F412xGU" +#define MICROPY_HW_MCU_NAME "STM32F411CE" -#define FLASH_SIZE (0x100000) +#define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) -#define BOARD_OSC_DIV (24) -#define BOARD_NO_VBUS_SENSE (1) +#define BOARD_OSC_DIV (24) +#define BOARD_OVERWRITE_SWD (1) +#define BOARD_NO_VBUS_SENSE (1) -#define CP_RGB_STATUS_LED -#define CP_RGB_STATUS_R (&pin_PA00) -#define CP_RGB_STATUS_G (&pin_PA01) -#define CP_RGB_STATUS_B (&pin_PA02) -#define MICROPY_HW_LED_STATUS (&pin_PA03) +// Status LEDs +#define MICROPY_HW_LED_TX (&pin_PA00) +#define MICROPY_HW_LED_RX (&pin_PB01) +#define MICROPY_HW_LED_STATUS (&pin_PA02) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 9827b9e066..3efd6a8bdc 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -1,17 +1,18 @@ -USB_VID = 0x0483 -USB_PID = 0xdf11 -USB_PRODUCT = "Thunderpack" +USB_VID = 0x239A +USB_PID = 0x806A +USB_PRODUCT = "Thunderpack powered by ST" USB_MANUFACTURER = "Jeremy Gillick" -USB_DEVICES = "CDC,MSC,HID" +USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE MCU_SERIES = m4 MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f412cx_thunderpack +MCU_SUB_VARIANT = stm32f411xe MCU_PACKAGE = 48 -CMSIS_MCU = STM32F412Cx -LD_FILE = boards/STM32F412ZGTx_FLASH.ld +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld +STARTUP_FILE = startup_stm32f411xe.s diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c index db0b3cde1b..830e99dae7 100644 --- a/ports/stm/boards/thunderpack/pins.c +++ b/ports/stm/boards/thunderpack/pins.c @@ -1,95 +1,37 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - // { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - // { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - // { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - // { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - // { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, - // { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, - // { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, - // { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, - // { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, - // { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - // { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - // { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - // { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - // { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - // { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - // { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - // { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - // { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, - // { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, - // { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, - // { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, - // { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - // { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - // { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - // { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, - // { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - // { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - // { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, - // { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - // { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - // { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - // { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - // { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - // { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, - // { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, - // { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, - // { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, - // { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, - // { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, - // { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - // { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - // { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, - // { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - // { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, - // { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB10) }, - // { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, - // { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, - // { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - // { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PG10) }, - // { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PG11) }, - // { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PF03) }, - // { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PF10) }, - // { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG12) }, - // { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PF04) }, - // { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG13) }, - // { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, //USART6 TX - // { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, //USART6 RX - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA01) }, - // { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC01) }, - // { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, - // { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC04) }, - // { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC05) }, //alt PB09, see F401ZG-DISCO manual - // { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB00) }, //alt PB10, see F401ZG-DISCO manual + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB04) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h index 15162dfcca..5cb5634223 100644 --- a/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h +++ b/ports/stm/boards/thunderpack/stm32f4xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,7 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H @@ -32,45 +32,46 @@ /* ########################## Module Selection ############################## */ /** - * @brief This is the list of modules to be used in the HAL driver + * @brief This is the list of modules to be used in the HAL driver */ -#define HAL_MODULE_ENABLED +#define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED /* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_CAN_MODULE_ENABLED */ /* #define HAL_CRC_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED /* #define HAL_DCMI_MODULE_ENABLED */ /* #define HAL_DMA2D_MODULE_ENABLED */ /* #define HAL_ETH_MODULE_ENABLED */ /* #define HAL_NAND_MODULE_ENABLED */ /* #define HAL_NOR_MODULE_ENABLED */ /* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED +/* #define HAL_SRAM_MODULE_ENABLED */ /* #define HAL_SDRAM_MODULE_ENABLED */ /* #define HAL_HASH_MODULE_ENABLED */ #define HAL_I2C_MODULE_ENABLED #define HAL_I2S_MODULE_ENABLED /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RNG_MODULE_ENABLED */ /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED +/* #define HAL_SD_MODULE_ENABLED */ /* #define HAL_MMC_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED +/* #define HAL_PCD_MODULE_ENABLED */ /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ /* #define HAL_CEC_MODULE_ENABLED */ /* #define HAL_FMPI2C_MODULE_ENABLED */ /* #define HAL_SPDIFRX_MODULE_ENABLED */ @@ -89,10 +90,10 @@ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)24000000U) /*!< Value of the External oscillator in Hz */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) @@ -102,35 +103,36 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ #endif /* HSI_VALUE */ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations - in voltage and temperature.*/ + in voltage and temperature. */ /** * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ #if !defined (LSE_STARTUP_TIMEOUT) #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ + /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ @@ -143,16 +145,16 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U #define DATA_CACHE_ENABLE 1U /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -169,7 +171,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -177,9 +179,9 @@ /* Section 2: PHY configuration section */ -/* DP83848_PHY_ADDRESS Address*/ +/* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -191,7 +193,7 @@ #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -206,7 +208,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -224,7 +226,7 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -242,7 +244,7 @@ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f4xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -260,13 +262,9 @@ #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" + #include "stm32f4xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - #ifdef HAL_DMA2D_MODULE_ENABLED #include "stm32f4xx_hal_dma2d.h" #endif /* HAL_DMA2D_MODULE_ENABLED */ @@ -286,7 +284,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f4xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -301,11 +299,11 @@ #ifdef HAL_PCCARD_MODULE_ENABLED #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - +#endif /* HAL_PCCARD_MODULE_ENABLED */ + #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -386,7 +384,7 @@ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ - + #ifdef HAL_DSI_MODULE_ENABLED #include "stm32f4xx_hal_dsi.h" #endif /* HAL_DSI_MODULE_ENABLED */ @@ -414,14 +412,14 @@ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32f4xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ - + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -430,13 +428,13 @@ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ +#endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32F4xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c deleted file mode 100644 index 6078700587..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/clocks.c +++ /dev/null @@ -1,76 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#include "stm32f4xx_hal.h" -#include "py/mpconfig.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the - * device is clocked below the maximum system frequency, to update the - * voltage scaling value regarding system frequency refer to product - * datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 12; - RCC_OscInitStruct.PLL.PLLN = 100; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLR = 2; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLLSAI output as USB clock source */ - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; - PeriphClkInitStruct.PLLI2S.PLLI2SN = 72; - PeriphClkInitStruct.PLLI2S.PLLI2SM = 12; - PeriphClkInitStruct.PLLI2S.PLLI2SR = 2; - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 3; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLI2SQ; - PeriphClkInitStruct.PLLI2SSelection = RCC_PLLI2SCLKSOURCE_PLLSRC; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - * clocks dividers */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c deleted file mode 100644 index d2844f1a6d..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/gpio.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* GPIO PIN REFERENCE -#define LED3_Pin GPIO_PIN_2 -#define LED3_GPIO_Port GPIOE -#define LED4_Pin GPIO_PIN_3 -#define LED4_GPIO_Port GPIOE -#define DFSDM_DATIN3_Pin GPIO_PIN_4 -#define DFSDM_DATIN3_GPIO_Port GPIOE -#define A0_Pin GPIO_PIN_0 -#define A0_GPIO_Port GPIOF -#define LCD_BLCTRL_Pin GPIO_PIN_5 -#define LCD_BLCTRL_GPIO_Port GPIOF -#define QSPI_BK1_IO3_Pin GPIO_PIN_6 -#define QSPI_BK1_IO3_GPIO_Port GPIOF -#define QSPI_BK1_IO2_Pin GPIO_PIN_7 -#define QSPI_BK1_IO2_GPIO_Port GPIOF -#define QSPI_BK1_IO0_Pin GPIO_PIN_8 -#define QSPI_BK1_IO0_GPIO_Port GPIOF -#define QSPI_BK1_IO1_Pin GPIO_PIN_9 -#define QSPI_BK1_IO1_GPIO_Port GPIOF -#define STLK_MCO_Pin GPIO_PIN_0 -#define STLK_MCO_GPIO_Port GPIOH -#define DFSDM_CKOUT_Pin GPIO_PIN_2 -#define DFSDM_CKOUT_GPIO_Port GPIOC -#define JOY_SEL_Pin GPIO_PIN_0 -#define JOY_SEL_GPIO_Port GPIOA -#define STLINK_RX_Pin GPIO_PIN_2 -#define STLINK_RX_GPIO_Port GPIOA -#define STLINK_TX_Pin GPIO_PIN_3 -#define STLINK_TX_GPIO_Port GPIOA -#define CODEC_I2S3_WS_Pin GPIO_PIN_4 -#define CODEC_I2S3_WS_GPIO_Port GPIOA -#define DFSDM_DATIN0_Pin GPIO_PIN_1 -#define DFSDM_DATIN0_GPIO_Port GPIOB -#define QSPI_CLK_Pin GPIO_PIN_2 -#define QSPI_CLK_GPIO_Port GPIOB -#define EXT_RESET_Pin GPIO_PIN_11 -#define EXT_RESET_GPIO_Port GPIOF -#define CTP_RST_Pin GPIO_PIN_12 -#define CTP_RST_GPIO_Port GPIOF -#define JOY_RIGHT_Pin GPIO_PIN_14 -#define JOY_RIGHT_GPIO_Port GPIOF -#define JOY_LEFT_Pin GPIO_PIN_15 -#define JOY_LEFT_GPIO_Port GPIOF -#define JOY_UP_Pin GPIO_PIN_0 -#define JOY_UP_GPIO_Port GPIOG -#define JOY_DOWN_Pin GPIO_PIN_1 -#define JOY_DOWN_GPIO_Port GPIOG -#define D4_Pin GPIO_PIN_7 -#define D4_GPIO_Port GPIOE -#define D5_Pin GPIO_PIN_8 -#define D5_GPIO_Port GPIOE -#define D6_Pin GPIO_PIN_9 -#define D6_GPIO_Port GPIOE -#define D7_Pin GPIO_PIN_10 -#define D7_GPIO_Port GPIOE -#define D8_Pin GPIO_PIN_11 -#define D8_GPIO_Port GPIOE -#define D9_Pin GPIO_PIN_12 -#define D9_GPIO_Port GPIOE -#define D10_Pin GPIO_PIN_13 -#define D10_GPIO_Port GPIOE -#define D11_Pin GPIO_PIN_14 -#define D11_GPIO_Port GPIOE -#define D12_Pin GPIO_PIN_15 -#define D12_GPIO_Port GPIOE -#define I2C2_SCL_Pin GPIO_PIN_10 -#define I2C2_SCL_GPIO_Port GPIOB -#define M2_CKIN_Pin GPIO_PIN_11 -#define M2_CKIN_GPIO_Port GPIOB -#define CODEC_I2S3_SCK_Pin GPIO_PIN_12 -#define CODEC_I2S3_SCK_GPIO_Port GPIOB -#define D13_Pin GPIO_PIN_8 -#define D13_GPIO_Port GPIOD -#define D14_Pin GPIO_PIN_9 -#define D14_GPIO_Port GPIOD -#define D15_Pin GPIO_PIN_10 -#define D15_GPIO_Port GPIOD -#define LCD_RESET_Pin GPIO_PIN_11 -#define LCD_RESET_GPIO_Port GPIOD -#define D0_Pin GPIO_PIN_14 -#define D0_GPIO_Port GPIOD -#define D1_Pin GPIO_PIN_15 -#define D1_GPIO_Port GPIOD -#define CODEC_INT_Pin GPIO_PIN_2 -#define CODEC_INT_GPIO_Port GPIOG -#define LCD_TE_Pin GPIO_PIN_4 -#define LCD_TE_GPIO_Port GPIOG -#define CTP_INT_Pin GPIO_PIN_5 -#define CTP_INT_GPIO_Port GPIOG -#define QSPI_BK1_NCS_Pin GPIO_PIN_6 -#define QSPI_BK1_NCS_GPIO_Port GPIOG -#define USB_OTGFS_OVRCR_Pin GPIO_PIN_7 -#define USB_OTGFS_OVRCR_GPIO_Port GPIOG -#define USB_OTGFS_PPWR_EN_Pin GPIO_PIN_8 -#define USB_OTGFS_PPWR_EN_GPIO_Port GPIOG -#define CODEC_I2S3_MCK_Pin GPIO_PIN_7 -#define CODEC_I2S3_MCK_GPIO_Port GPIOC -#define uSD_D0_Pin GPIO_PIN_8 -#define uSD_D0_GPIO_Port GPIOC -#define uSD_D1_Pin GPIO_PIN_9 -#define uSD_D1_GPIO_Port GPIOC -#define M2_CKINA8_Pin GPIO_PIN_8 -#define M2_CKINA8_GPIO_Port GPIOA -#define USB_OTGFS_VBUS_Pin GPIO_PIN_9 -#define USB_OTGFS_VBUS_GPIO_Port GPIOA -#define USB_OTGFS_ID_Pin GPIO_PIN_10 -#define USB_OTGFS_ID_GPIO_Port GPIOA -#define USB_OTGFS_DM_Pin GPIO_PIN_11 -#define USB_OTGFS_DM_GPIO_Port GPIOA -#define USB_OTGFS_DP_Pin GPIO_PIN_12 -#define USB_OTGFS_DP_GPIO_Port GPIOA -#define SWDIO_Pin GPIO_PIN_13 -#define SWDIO_GPIO_Port GPIOA -#define SWCLK_Pin GPIO_PIN_14 -#define SWCLK_GPIO_Port GPIOA -#define uSD_D2_Pin GPIO_PIN_10 -#define uSD_D2_GPIO_Port GPIOC -#define uSD_D3_Pin GPIO_PIN_11 -#define uSD_D3_GPIO_Port GPIOC -#define uSD_CLK_Pin GPIO_PIN_12 -#define uSD_CLK_GPIO_Port GPIOC -#define D2_Pin GPIO_PIN_0 -#define D2_GPIO_Port GPIOD -#define D3_Pin GPIO_PIN_1 -#define D3_GPIO_Port GPIOD -#define uSD_CMD_Pin GPIO_PIN_2 -#define uSD_CMD_GPIO_Port GPIOD -#define uSD_DETECT_Pin GPIO_PIN_3 -#define uSD_DETECT_GPIO_Port GPIOD -#define FMC_NOE_Pin GPIO_PIN_4 -#define FMC_NOE_GPIO_Port GPIOD -#define FMC_NWE_Pin GPIO_PIN_5 -#define FMC_NWE_GPIO_Port GPIOD -#define FMC_NE1_Pin GPIO_PIN_7 -#define FMC_NE1_GPIO_Port GPIOD -#define SWO_Pin GPIO_PIN_3 -#define SWO_GPIO_Port GPIOB -#define CODEC_I2S3ext_SD_Pin GPIO_PIN_4 -#define CODEC_I2S3ext_SD_GPIO_Port GPIOB -#define CODEC_I2S3_SD_Pin GPIO_PIN_5 -#define CODEC_I2S3_SD_GPIO_Port GPIOB -#define I2C1_SCL_Pin GPIO_PIN_6 -#define I2C1_SCL_GPIO_Port GPIOB -#define I2C1_SDA_Pin GPIO_PIN_7 -#define I2C1_SDA_GPIO_Port GPIOB -#define I2C2_SDA_Pin GPIO_PIN_9 -#define I2C2_SDA_GPIO_Port GPIOB -#define LED1_Pin GPIO_PIN_0 -#define LED1_GPIO_Port GPIOE -#define LED2_Pin GPIO_PIN_1 -#define LED2_GPIO_Port GPIOE -*/ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - //Configure LED pins - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); - GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,0); - stm32f4_peripherals_status_led(2,0); - stm32f4_peripherals_status_led(3,0); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK -} - -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - switch(led) - { - case 0: - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, state); - break; - case 1: - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, state); - break; - case 2: - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2, state); - break; - case 3: - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, state); - break; - default: break; - } -} - - diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c deleted file mode 100644 index f5effa80ed..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.c +++ /dev/null @@ -1,223 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 7, &pin_PB12), - SPI(3, 6, &pin_PC10), - SPI(4, 6, &pin_PB13), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), - SPI(5, 6, &pin_PB00), - SPI(5, 6, &pin_PE02), - SPI(5, 6, &pin_PE12) -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PA01), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), - SPI(5, 6, &pin_PA10), - SPI(5, 6, &pin_PB08), - SPI(5, 6, &pin_PE06), - SPI(5, 6, &pin_PE14) -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 6, &pin_PA11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), - SPI(5, 6, &pin_PA12), - SPI(5, 6, &pin_PE05), - SPI(5, 6, &pin_PE13) -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), - SPI(5, 6, &pin_PB01), - SPI(5, 6, &pin_PE04), - SPI(5, 6, &pin_PE11) -}; - -//UART - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PA15), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB03), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(3, 7, &pin_PC05), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, - TIM11, TIM12, TIM13, TIM14}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(13,9,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(14,9,1,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(2,1,4,&pin_PB11), - TIM(12,9,1,&pin_PB14), - TIM(12,9,2,&pin_PB15), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(8,3,1,&pin_PC06), - TIM(8,3,2,&pin_PC07), - TIM(8,3,3,&pin_PC08), - TIM(8,3,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), - TIM(10,3,1,&pin_PF06), - TIM(11,3,1,&pin_PF07), - TIM(13,9,1,&pin_PF08), - TIM(14,9,1,&pin_PF09), - TIM(5,2,1,&pin_PF03), - TIM(5,2,2,&pin_PF04), - TIM(5,2,3,&pin_PF05), - TIM(5,2,4,&pin_PF10), -}; diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h deleted file mode 100644 index e0141e6dab..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/periph.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - - -//SPI -extern SPI_TypeDef * mcu_spi_banks[5]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; -extern const mcu_uart_rx_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]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c deleted file mode 100644 index fddab5ef1c..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.c +++ /dev/null @@ -1,161 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h b/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h deleted file mode 100644 index 07c22d5283..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412cx_thunderpack/pins.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H - -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only -//pg 50 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -//pg 51 -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only -//pg 52 -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -//pg 53 -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -extern const mcu_pin_obj_t pin_PC04; -//pg 54 -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only -//pg 55 -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -//pg 56 -extern const mcu_pin_obj_t pin_PE15; -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB11; // 144 only -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -//pg 57 -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 58 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PG02; // 144 only -extern const mcu_pin_obj_t pin_PG03; // 144 only -extern const mcu_pin_obj_t pin_PG04; // 144 only -extern const mcu_pin_obj_t pin_PG05; // 144 only -extern const mcu_pin_obj_t pin_PG06; // 144 only -extern const mcu_pin_obj_t pin_PG07; // 144 only -extern const mcu_pin_obj_t pin_PG08; // 144 only -//pg 59 -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -extern const mcu_pin_obj_t pin_PA10; -//pg 60 -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -//pg 61 -extern const mcu_pin_obj_t pin_PC12; -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -//pg 62 -extern const mcu_pin_obj_t pin_PG09; // 144 only -extern const mcu_pin_obj_t pin_PG10; // 144 only -extern const mcu_pin_obj_t pin_PG11; // 144 only -extern const mcu_pin_obj_t pin_PG12; // 144 only -extern const mcu_pin_obj_t pin_PG13; // 144 only -extern const mcu_pin_obj_t pin_PG14; // 144 only -extern const mcu_pin_obj_t pin_PG15; // 144 only -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -//pg 63 -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H From 284073584a66c0fde03e439fbdb54a4a5dc34790 Mon Sep 17 00:00:00 2001 From: jgillick Date: Thu, 19 Mar 2020 00:01:32 -0700 Subject: [PATCH 099/919] Cleanup --- ports/stm/boards/thunderpack/mpconfigboard.mk | 2 +- ports/stm/common-hal/busio/UART.c | 4 ---- ports/stm/peripherals/stm32f4/periph.h | 7 ------- ports/stm/peripherals/stm32f4/pins.h | 3 --- ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c | 1 + ports/stm/supervisor/internal_flash.h | 2 +- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 3efd6a8bdc..0bf5b57a88 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A USB_PID = 0x806A -USB_PRODUCT = "Thunderpack powered by ST" +USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 20648bf3d4..0b434fd023 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -443,11 +443,9 @@ STATIC void uart_clock_enable(uint16_t mask) { #endif #ifdef USART3 if (mask & (1 << 2)) { - #ifndef STM32F412Cx __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_ENABLE(); - #endif } #endif #ifdef UART4 @@ -518,11 +516,9 @@ STATIC void uart_clock_disable(uint16_t mask) { #endif #ifdef USART3 if (mask & (1 << 2)) { - #ifndef STM32F412Cx __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_DISABLE(); - #endif } #endif #ifdef UART4 diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h index 5ac8b40615..d311afe4a1 100644 --- a/ports/stm/peripherals/stm32f4/periph.h +++ b/ports/stm/peripherals/stm32f4/periph.h @@ -154,13 +154,6 @@ typedef struct { #include "stm32f411xe/periph.h" #endif -#ifdef BOARD_THUNDERPACK_STM32F412 -#define HAS_DAC 0 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f412cx_thunderpack/periph.h" -#endif - #ifdef STM32F412Zx #define HAS_DAC 0 #define HAS_TRNG 1 diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/stm32f4/pins.h index 53040995d0..44ef4c1baf 100644 --- a/ports/stm/peripherals/stm32f4/pins.h +++ b/ports/stm/peripherals/stm32f4/pins.h @@ -83,9 +83,6 @@ extern const mp_obj_type_t mcu_pin_type; #ifdef STM32F411xE #include "stm32f411xe/pins.h" #endif -#ifdef BOARD_THUNDERPACK_STM32F412 -#include "stm32f412cx_thunderpack/pins.h" -#endif #ifdef STM32F412Zx #include "stm32f412zx/pins.h" #endif diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 2eb2967235..68a75f4639 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -239,3 +239,4 @@ void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { default: break; } } + diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 92d1baddc0..9f16a799d8 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -42,7 +42,7 @@ #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif -#if (defined(STM32F412Zx) || defined(STM32F412Cx)) +#ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif From d9e491a9e863509f240609f6d69fb21de35fec32 Mon Sep 17 00:00:00 2001 From: jgillick Date: Thu, 19 Mar 2020 00:02:23 -0700 Subject: [PATCH 100/919] Remove unnecessary change --- ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 68a75f4639..d17ab4e018 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -240,3 +240,4 @@ void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } } + From 2623022c846698d8a6b9cfab8617aa569c5aef2f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 20 Mar 2020 12:58:34 -0700 Subject: [PATCH 101/919] Initial work for STM32. Need to fix us delay and PulseIn still. --- ports/stm/Makefile | 3 +- .../feather_stm32f405_express/mpconfigboard.h | 2 + .../stm32f4xx_hal_conf.h | 68 ++++----- .../boards/stm32f4_discovery/mpconfigboard.h | 2 + .../stm32f4_discovery/stm32f4xx_hal_conf.h | 66 ++++----- ports/stm/common-hal/busio/UART.c | 1 - ports/stm/common-hal/displayio/ParallelBus.c | 2 - .../stm/common-hal/microcontroller/__init__.c | 24 +--- .../stm/common-hal/neopixel_write/__init__.c | 25 ++-- ports/stm/common-hal/pulseio/PulseIn.c | 10 +- ports/stm/common-hal/pulseio/PulseOut.c | 5 +- ports/stm/mphalport.c | 15 -- .../peripherals/stm32f4/stm32f405xx/clocks.c | 4 +- .../peripherals/stm32f4/stm32f412zx/clocks.c | 2 +- ports/stm/supervisor/internal_flash.c | 4 +- ports/stm/supervisor/port.c | 134 +++++++++++++++++- ports/stm/supervisor/usb.c | 7 +- ports/stm/tick.c | 81 ----------- ports/stm/tick.h | 44 ------ supervisor/shared/flash.c | 6 +- supervisor/shared/tick.c | 4 + 21 files changed, 238 insertions(+), 271 deletions(-) delete mode 100644 ports/stm/tick.c delete mode 100644 ports/stm/tick.h diff --git a/ports/stm/Makefile b/ports/stm/Makefile index f8c05fd802..f53fc7b939 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -172,6 +172,8 @@ SRC_STM32 = \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ + st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ @@ -193,7 +195,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ peripherals/stm32f4/$(MCU_SUB_VARIANT)/pins.c \ diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 6600fcf671..0e66a32bde 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -36,6 +36,8 @@ #define BOARD_OSC_DIV (12) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE + // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB05) #define SPI_FLASH_MISO_PIN (&pin_PB04) diff --git a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h index 8031403a91..0d5612cdec 100644 --- a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h +++ b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,7 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H @@ -32,9 +32,9 @@ /* ########################## Module Selection ############################## */ /** - * @brief This is the list of modules to be used in the HAL driver + * @brief This is the list of modules to be used in the HAL driver */ -#define HAL_MODULE_ENABLED +#define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED /* #define HAL_CRYP_MODULE_ENABLED */ @@ -56,13 +56,13 @@ /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ #define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ +#define HAL_RTC_MODULE_ENABLED /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ /* #define HAL_MMC_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ @@ -90,9 +90,9 @@ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -103,7 +103,7 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ @@ -112,8 +112,8 @@ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations in voltage and temperature. */ @@ -131,8 +131,8 @@ /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ @@ -145,16 +145,16 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U #define DATA_CACHE_ENABLE 1U /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -171,7 +171,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -179,9 +179,9 @@ /* Section 2: PHY configuration section */ -/* DP83848_PHY_ADDRESS Address*/ +/* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -193,7 +193,7 @@ #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -208,7 +208,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -226,7 +226,7 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -244,7 +244,7 @@ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f4xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -262,7 +262,7 @@ #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" + #include "stm32f4xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ #ifdef HAL_DMA2D_MODULE_ENABLED @@ -284,7 +284,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f4xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -299,11 +299,11 @@ #ifdef HAL_PCCARD_MODULE_ENABLED #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - +#endif /* HAL_PCCARD_MODULE_ENABLED */ + #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -384,7 +384,7 @@ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ - + #ifdef HAL_DSI_MODULE_ENABLED #include "stm32f4xx_hal_dsi.h" #endif /* HAL_DSI_MODULE_ENABLED */ @@ -412,14 +412,14 @@ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32f4xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ - + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -428,13 +428,13 @@ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ +#endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32F4xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index fcd7aa09cd..32b17e1cd3 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -33,3 +33,5 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) + +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE diff --git a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h index ee5832d49c..6076324f08 100644 --- a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h +++ b/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h @@ -2,7 +2,7 @@ ****************************************************************************** * @file stm32f4xx_hal_conf_template.h * @author MCD Application Team - * @brief HAL configuration template file. + * @brief HAL configuration template file. * This file should be copied to the application folder and renamed * to stm32f4xx_hal_conf.h. ****************************************************************************** @@ -17,7 +17,7 @@ * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** - */ + */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H @@ -32,9 +32,9 @@ /* ########################## Module Selection ############################## */ /** - * @brief This is the list of modules to be used in the HAL driver + * @brief This is the list of modules to be used in the HAL driver */ -#define HAL_MODULE_ENABLED +#define HAL_MODULE_ENABLED #define HAL_ADC_MODULE_ENABLED /* #define HAL_CRYP_MODULE_ENABLED */ @@ -56,13 +56,13 @@ /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ #define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ +#define HAL_RTC_MODULE_ENABLED /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ /* #define HAL_MMC_MODULE_ENABLED */ #define HAL_SPI_MODULE_ENABLED #define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED #define HAL_USART_MODULE_ENABLED /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ @@ -90,9 +90,9 @@ /** * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). + * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -103,7 +103,7 @@ /** * @brief Internal High Speed oscillator (HSI) value. * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). + * (when HSI is used as system clock source, directly or through the PLL). */ #if !defined (HSI_VALUE) #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ @@ -112,7 +112,7 @@ /** * @brief Internal Low Speed oscillator (LSI) value. */ -#if !defined (LSI_VALUE) +#if !defined (LSI_VALUE) #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz The real value may vary depending on the variations @@ -130,8 +130,8 @@ /** * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. */ #if !defined (EXTERNAL_CLOCK_VALUE) #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ @@ -144,16 +144,16 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U #define PREFETCH_ENABLE 1U #define INSTRUCTION_CACHE_ENABLE 1U #define DATA_CACHE_ENABLE 1U /* ########################## Assert Selection ############################## */ /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the + * @brief Uncomment the line below to expanse the "assert_param" macro in the * HAL drivers code */ /* #define USE_FULL_ASSERT 1U */ @@ -170,7 +170,7 @@ #define MAC_ADDR4 0U #define MAC_ADDR5 0U -/* Definition of the Ethernet driver buffers size and count */ +/* Definition of the Ethernet driver buffers size and count */ #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ @@ -178,9 +178,9 @@ /* Section 2: PHY configuration section */ -/* DP83848_PHY_ADDRESS Address*/ +/* DP83848_PHY_ADDRESS Address*/ #define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) /* PHY Configuration delay */ #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) @@ -192,7 +192,7 @@ #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - + #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ @@ -207,7 +207,7 @@ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - + /* Section 4: Extended PHY Registers */ #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ @@ -225,7 +225,7 @@ /* Includes ------------------------------------------------------------------*/ /** - * @brief Include module's header file + * @brief Include module's header file */ #ifdef HAL_RCC_MODULE_ENABLED @@ -243,7 +243,7 @@ #ifdef HAL_DMA_MODULE_ENABLED #include "stm32f4xx_hal_dma.h" #endif /* HAL_DMA_MODULE_ENABLED */ - + #ifdef HAL_CORTEX_MODULE_ENABLED #include "stm32f4xx_hal_cortex.h" #endif /* HAL_CORTEX_MODULE_ENABLED */ @@ -261,7 +261,7 @@ #endif /* HAL_CRC_MODULE_ENABLED */ #ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" + #include "stm32f4xx_hal_cryp.h" #endif /* HAL_CRYP_MODULE_ENABLED */ #ifdef HAL_DMA2D_MODULE_ENABLED @@ -283,7 +283,7 @@ #ifdef HAL_FLASH_MODULE_ENABLED #include "stm32f4xx_hal_flash.h" #endif /* HAL_FLASH_MODULE_ENABLED */ - + #ifdef HAL_SRAM_MODULE_ENABLED #include "stm32f4xx_hal_sram.h" #endif /* HAL_SRAM_MODULE_ENABLED */ @@ -298,11 +298,11 @@ #ifdef HAL_PCCARD_MODULE_ENABLED #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - +#endif /* HAL_PCCARD_MODULE_ENABLED */ + #ifdef HAL_SDRAM_MODULE_ENABLED #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ +#endif /* HAL_SDRAM_MODULE_ENABLED */ #ifdef HAL_HASH_MODULE_ENABLED #include "stm32f4xx_hal_hash.h" @@ -383,7 +383,7 @@ #ifdef HAL_HCD_MODULE_ENABLED #include "stm32f4xx_hal_hcd.h" #endif /* HAL_HCD_MODULE_ENABLED */ - + #ifdef HAL_DSI_MODULE_ENABLED #include "stm32f4xx_hal_dsi.h" #endif /* HAL_DSI_MODULE_ENABLED */ @@ -411,14 +411,14 @@ #ifdef HAL_LPTIM_MODULE_ENABLED #include "stm32f4xx_hal_lptim.h" #endif /* HAL_LPTIM_MODULE_ENABLED */ - + /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source - * line number of the call that failed. + * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ @@ -427,13 +427,13 @@ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ +#endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32F4xx_HAL_CONF_H */ - + /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 0b434fd023..e32fa56357 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -35,7 +35,6 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -#include "tick.h" #include "stm32f4xx_hal.h" #define ALL_UARTS 0xFFFF diff --git a/ports/stm/common-hal/displayio/ParallelBus.c b/ports/stm/common-hal/displayio/ParallelBus.c index 1b808ec025..314b72ff73 100644 --- a/ports/stm/common-hal/displayio/ParallelBus.c +++ b/ports/stm/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 0c680eb055..b20f49e590 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -41,31 +41,9 @@ #include "stm32f4xx_hal.h" -//tested divisor value for busy loop in us delay -#define LOOP_TICKS 12 - -STATIC uint32_t get_us(void) { - uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; - uint32_t micros, sys_cycles; - do { - micros = supervisor_ticks_ms32(); - sys_cycles = SysTick->VAL; //counts backwards - } while (micros != supervisor_ticks_ms32()); //try again if ticks_ms rolled over - return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; -} - void common_hal_mcu_delay_us(uint32_t delay) { if (__get_PRIMASK() == 0x00000000) { - //by default use ticks_ms - uint32_t start = get_us(); - while (get_us()-start < delay) { - __asm__ __volatile__("nop"); - } } else { - //when SysTick is disabled, approximate with busy loop - const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; - for (uint32_t count = 0; ++count <= ucount;) { - } } } @@ -171,7 +149,7 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, #if MCU_PACKAGE == 144 || defined STM32F405xx { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, -#endif +#endif { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c index 6740a0d348..c8852403b2 100644 --- a/ports/stm/common-hal/neopixel_write/__init__.c +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -24,18 +24,17 @@ * THE SOFTWARE. */ -#include "py/mphal.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" #include "py/mperrno.h" +#include "py/mphal.h" #include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" #include "stm32f4xx_hal.h" #include "stm32f4xx_ll_gpio.h" +#include "supervisor/port.h" -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; //sysclock divisors #define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field @@ -45,7 +44,7 @@ uint32_t next_start_tick_us = 1000; #pragma GCC push_options #pragma GCC optimize ("Os") -void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; uint32_t start = 0; @@ -59,9 +58,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout uint32_t t0 = (sys_freq/MAGIC_800_T0H); uint32_t t1 = (sys_freq/MAGIC_800_T1H); - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); uint32_t p_mask = pin_mask(digitalinout->pin->number); @@ -90,13 +89,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout __enable_irq(); // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; } -#pragma GCC pop_options \ No newline at end of file +#pragma GCC pop_options diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 8428a22789..371ac42ed4 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -32,7 +32,6 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" -#include "tick.h" #include "stm32f4xx_hal.h" @@ -47,9 +46,8 @@ static void pulsein_handler(uint8_t num) { EXTI->PR = 1 << num; // Grab the current time first. - uint32_t current_us; - uint64_t current_ms; - current_tick(¤t_ms, ¤t_us); + uint32_t current_us = 0; + uint64_t current_ms = 0; // current_tick gives us the remaining us until the next tick but we want the number since the last ms. current_us = 1000 - current_us; @@ -116,10 +114,10 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu // Allocate pulse buffer self->buffer = (uint16_t *) m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); } - + // Set internal variables self->pin = pin; self->maxlen = maxlen; diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index d82525ea16..137ddaf9de 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -37,7 +37,6 @@ #include "stm32f4xx_hal.h" #include "common-hal/microcontroller/Pin.h" -#include "tick.h" // A single timer is shared amongst all PulseOut objects under the assumption that // the code is single threaded. @@ -60,7 +59,7 @@ STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { // Turn off PWM HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); // Make sure pin is low. - HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), + HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), pin_mask(pulseout->pwmout->tim->pin->number), 0); } @@ -196,7 +195,7 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu // mp_raise_RuntimeError(translate("Error: Send Timeout")); // } } - //turn off timer counter. + //turn off timer counter. t7_handle.Instance->CR1 &= ~TIM_CR1_CEN; } diff --git a/ports/stm/mphalport.c b/ports/stm/mphalport.c index a3cf501c04..cd8592be39 100644 --- a/ports/stm/mphalport.c +++ b/ports/stm/mphalport.c @@ -35,21 +35,6 @@ #include "supervisor/shared/tick.h" #include "stm32f4xx_hal.h" -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - void mp_hal_delay_us(mp_uint_t delay) { common_hal_mcu_delay_us(delay); } diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c index 2afca64e83..874a7dbf75 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c @@ -28,7 +28,7 @@ #include "py/mpconfig.h" void stm32f4_peripherals_clocks_init(void) { - //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. + //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. //System clock init RCC_ClkInitTypeDef RCC_ClkInitStruct; @@ -58,7 +58,9 @@ void stm32f4_peripherals_clocks_init(void) { RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + // APB1 must always be on so that we can talk to the RTC for timing. RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + // TODO: Only turn on APB2 when it is needed to save power. RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c index b208f9dfb3..b4075027a8 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c @@ -65,7 +65,7 @@ void stm32f4_peripherals_clocks_init(void) { /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 * clocks dividers */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 046b26baf2..4e3c564941 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -64,7 +64,7 @@ static const flash_layout_t flash_layout[] = { static uint8_t sector_copy[0x4000] __attribute__((aligned(4))); -//Return the sector of a given flash address. +//Return the sector of a given flash address. uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { if (addr >= flash_layout[0].base_address) { uint32_t sector_index = 0; @@ -100,7 +100,7 @@ uint32_t supervisor_flash_get_block_count(void) { return INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { } static int32_t convert_block_to_flash_addr(uint32_t block) { diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 948e9f2e4a..25000eca88 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -28,7 +28,7 @@ #include #include "supervisor/port.h" #include "boards/board.h" -#include "tick.h" +#include "lib/timeutils/timeutils.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/busio/I2C.h" @@ -43,6 +43,8 @@ #include "stm32f4xx_hal.h" +static RTC_HandleTypeDef _hrtc; + safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); @@ -51,11 +53,33 @@ safe_mode_t port_init(void) { stm32f4_peripherals_clocks_init(); stm32f4_peripherals_gpio_init(); - tick_init(); + HAL_PWR_EnableBkUpAccess(); + __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) {} + + __HAL_RCC_RTC_CONFIG(BOARD_RTC_CLOCK); + __HAL_RCC_RTC_ENABLE(); + _hrtc.Instance = RTC; + _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + // Divide async as little as possible so that we have 32768 count in subseconds. + _hrtc.Init.AsynchPrediv = 0x0; + _hrtc.Init.SynchPrediv = 0x7fff; // 32768 ticks per second + _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + + HAL_StatusTypeDef result = HAL_RTC_Init(&_hrtc); + if (result != HAL_OK) { + asm("bkpt"); + } return NO_SAFE_MODE; } +void SysTick_Handler(void) { + // Read the CTRL register to clear the SysTick interrupt. + SysTick->CTRL; + HAL_IncTick(); +} + void reset_port(void) { reset_all_pins(); i2c_reset(); @@ -106,3 +130,109 @@ void HardFault_Handler(void) { asm("nop;"); } } + +// This function is called often for timing so we cache the seconds elapsed computation based on the +// register value. The STM HAL always does shifts and conversion if we use it directly. +volatile uint32_t seconds_to_date = 0; +volatile uint32_t cached_date = 0; +volatile uint32_t seconds_to_minute = 0; +volatile uint32_t cached_hours_minutes = 0; +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint32_t subseconds = 0x8000 - (uint32_t)(RTC->SSR); + uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); + if (date != cached_date) { + uint32_t year = (uint8_t)((date & (RTC_DR_YT | RTC_DR_YU)) >> 16U); + uint8_t month = (uint8_t)((date & (RTC_DR_MT | RTC_DR_MU)) >> 8U); + uint8_t day = (uint8_t)(date & (RTC_DR_DT | RTC_DR_DU)); + // Add 2000 since the year is only the last two digits. + year = 2000 + (uint32_t)RTC_Bcd2ToByte(year); + month = (uint8_t)RTC_Bcd2ToByte(month); + day = (uint8_t)RTC_Bcd2ToByte(day); + seconds_to_date = timeutils_seconds_since_2000(year, month, day, 0, 0, 0); + cached_date = date; + } + uint32_t hours_minutes = time & (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU); + if (hours_minutes != cached_hours_minutes) { + uint8_t hours = (uint8_t)((time & (RTC_TR_HT | RTC_TR_HU)) >> 16U); + uint8_t minutes = (uint8_t)((time & (RTC_TR_MNT | RTC_TR_MNU)) >> 8U); + hours = (uint8_t)RTC_Bcd2ToByte(hours); + minutes = (uint8_t)RTC_Bcd2ToByte(minutes); + seconds_to_minute = 60 * (60 * hours + minutes); + } + uint8_t seconds = (uint8_t)(time & (RTC_TR_ST | RTC_TR_SU)); + seconds = (uint8_t)RTC_Bcd2ToByte(seconds); + if (subticks != NULL) { + *subticks = subseconds % 32; + } + + return ((uint64_t) 1024) * (seconds_to_date + seconds_to_minute + seconds) + subseconds / 32; +} + +void RTC_WKUP_IRQHandler(void) { + supervisor_tick(); + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&_hrtc, RTC_FLAG_WUTF); + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); +} + +void RTC_Alarm_IRQHandler(void) { + RTC->ISR = ~RTC_FLAG_ALRAF; + HAL_RTC_DeactivateAlarm(&_hrtc, RTC_ALARM_A); +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + HAL_StatusTypeDef result = HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, 32768 / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); + if (result != HAL_OK) { + asm("bkpt"); + } + HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 1, 0U); + HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); +} +extern volatile uint32_t autoreload_delay_ms; + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + if (autoreload_delay_ms > 1) { + asm("bkpt"); + } + HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn); + HAL_RTCEx_DeactivateWakeUpTimer(&_hrtc); +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint64_t raw_ticks = port_get_raw_ticks(NULL) + ticks; + + RTC_AlarmTypeDef alarm; + if (ticks > 1024) { + timeutils_struct_time_t tm; + timeutils_seconds_since_2000_to_struct_time(raw_ticks / 1024, &tm); + alarm.AlarmTime.Hours = tm.tm_hour; + alarm.AlarmTime.Minutes = tm.tm_min; + alarm.AlarmTime.Seconds = tm.tm_sec; + alarm.AlarmDateWeekDay = tm.tm_mday; + alarm.AlarmMask = RTC_ALARMMASK_ALL; + } else { + alarm.AlarmMask = RTC_ALARMMASK_NONE; + } + + alarm.AlarmTime.SubSeconds = 32768 - ((raw_ticks % 1024) * 32); + alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; + alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE; + alarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE; + alarm.Alarm = RTC_ALARM_A; + + HAL_RTC_SetAlarm_IT(&_hrtc, &alarm, RTC_FORMAT_BIN); +} + +void port_sleep_until_interrupt(void) { + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + // Call wait for interrupt ourselves if the SD isn't enabled. + __WFI(); +} + diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 358c2de5b3..c61b6e9596 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -26,7 +26,6 @@ */ -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" @@ -59,13 +58,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -103,7 +102,7 @@ void init_usb_hardware(void) { HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); #endif - + /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); diff --git a/ports/stm/tick.c b/ports/stm/tick.c deleted file mode 100644 index f4adf183aa..0000000000 --- a/ports/stm/tick.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/Processor.h" - -#include "stm32f4xx.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -uint32_t HAL_GetTick(void) //override ST HAL -{ - return (uint32_t)supervisor_ticks_ms32(); -} - -void tick_init() { - uint32_t ticks_per_ms = SystemCoreClock/ 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled - - NVIC_EnableIRQ(SysTick_IRQn); - // Bump up the systick interrupt so nothing else interferes with timekeeping. - NVIC_SetPriority(SysTick_IRQn, 0); - NVIC_SetPriority(OTG_FS_IRQn, 1); -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = supervisor_ticks_ms64(); - while (us > 1000) { - while (supervisor_ticks_ms64() == start_ms) {} - us -= us_between_ticks; - start_ms = supervisor_ticks_ms64(); - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - *ms = supervisor_ticks_ms32(); - *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/stm/tick.h b/ports/stm/tick.h deleted file mode 100644 index 999acc7a3c..0000000000 --- a/ports/stm/tick.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_STM32F4_TICK_H -#define MICROPY_INCLUDED_STM32F4_TICK_H - -#include "py/mpconfig.h" - -#include - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_STM32F4_TICK_H diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index e0bf83490c..298e7d83e4 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -111,7 +111,7 @@ mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_bloc return supervisor_flash_read_blocks(dest, block_num - PART1_START_BLOCK, num_blocks); } -volatile bool filesystem_dirty; +volatile bool filesystem_dirty = false; mp_uint_t flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { @@ -137,7 +137,9 @@ void supervisor_flash_flush(void) { supervisor_external_flash_flush(); #endif // Turn off ticks now that our filesystem has been flushed. - supervisor_disable_tick(); + if (filesystem_dirty) { + supervisor_disable_tick(); + } filesystem_dirty = false; } diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 80bd6f2041..de56b64f55 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -118,18 +118,22 @@ void mp_hal_delay_ms(mp_uint_t delay) { volatile size_t tick_enable_count = 0; extern void supervisor_enable_tick(void) { + common_hal_mcu_disable_interrupts(); if (tick_enable_count == 0) { port_enable_tick(); } tick_enable_count++; + common_hal_mcu_enable_interrupts(); } extern void supervisor_disable_tick(void) { + common_hal_mcu_disable_interrupts(); if (tick_enable_count > 0) { tick_enable_count--; } if (tick_enable_count == 0) { port_disable_tick(); } + common_hal_mcu_enable_interrupts(); } From 9d2270a979b3d3ce107a2ea830b6bf7beecb1fdc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 20 Mar 2020 17:48:03 -0500 Subject: [PATCH 102/919] runtime: Improve error message when setting read-only property Formerly, if you wrote SPI.frequency = 0 you would get the sightly erroneous error message AttributeError: 'SPI' object has no attribute 'frequency' In this case, a better message would read AttributeError: 'SPI' object cannot assign attribute 'frequency' This new message will both be used in the case where the attribute doesn't exist at all (and the object has no dynamic attributes; most instances of built in types behave this way), or if the attribute exists but is read-only. --- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- py/runtime.c | 2 +- 14 files changed, 66 insertions(+), 14 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index b68e9d0902..8c5725428e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -134,6 +134,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 352178a93f..53ee647957 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -133,6 +133,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 3794537a96..df62a978c6 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -135,6 +135,10 @@ msgstr "'%s' integer %d ist nicht im Bereich %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 9d88663aac..0a2f870e72 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -133,6 +133,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e5b135bf02..ae56216d7f 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -135,6 +135,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/es.po b/locale/es.po index 214496ed38..2f2b206b26 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -135,6 +135,10 @@ msgstr "'%s' entero %d no esta dentro del rango %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 43fd086866..f8c1471d59 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -136,6 +136,10 @@ msgstr "'%s' integer %d ay wala sa sakop ng %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index aab2f8d49b..56f20106bc 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -137,6 +137,10 @@ msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0378ef77cc..1b31c5645b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -135,6 +135,10 @@ msgstr "intero '%s' non è nell'intervallo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "intero '%s' non è nell'intervallo %d..%d" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 949b8cc62e..575a88b62a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -135,6 +135,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index b25e42fe53..ad726ac7fc 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -134,6 +134,10 @@ msgstr "'%s' liczba %d poza zakresem %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ec4658477e..48af7b7978 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -135,6 +135,10 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 8fbd53d704..5e545a66f8 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-17 16:39-0500\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -140,6 +140,10 @@ msgstr "'%s' zhěngshù %d bùzài fànwéi nèi %d.%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x" +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + #: py/proto.c msgid "'%s' object does not support '%q'" msgstr "'%s' duì xiàng bù zhīchí '%q'" diff --git a/py/runtime.c b/py/runtime.c index c1c311ae4c..59dcbc7a1c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -1172,7 +1172,7 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) { mp_raise_AttributeError(translate("no such attribute")); } else { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_AttributeError, - translate("'%s' object has no attribute '%q'"), + translate("'%s' object cannot assign attribute '%q'"), mp_obj_get_type_str(base), attr)); } } From fa95c1d09fc42d2c7e68b09e6cf783943e383bec Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 02:21:24 -0700 Subject: [PATCH 103/919] Remove submodules included from micropython. --- lib/lwip | 1 - lib/mbedtls | 1 - lib/mynewt-nimble | 1 - lib/stm32lib | 1 - 4 files changed, 4 deletions(-) delete mode 160000 lib/lwip delete mode 160000 lib/mbedtls delete mode 160000 lib/mynewt-nimble delete mode 160000 lib/stm32lib diff --git a/lib/lwip b/lib/lwip deleted file mode 160000 index 159e31b689..0000000000 --- a/lib/lwip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 159e31b689577dbf69cf0683bbaffbd71fa5ee10 diff --git a/lib/mbedtls b/lib/mbedtls deleted file mode 160000 index 3f8d78411a..0000000000 --- a/lib/mbedtls +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f8d78411a26e833db18d9fbde0e2f0baeda87f0 diff --git a/lib/mynewt-nimble b/lib/mynewt-nimble deleted file mode 160000 index 223714cb16..0000000000 --- a/lib/mynewt-nimble +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 223714cb16c255cfa701929c0de6d7579bfd2cdd diff --git a/lib/stm32lib b/lib/stm32lib deleted file mode 160000 index 668d7a9e54..0000000000 --- a/lib/stm32lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 668d7a9e54aea98f8fe8a858eac1d3daa80fa824 From d76b76cb1db59b85ef1300f6afb1aee97e5e0c72 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 02:22:59 -0700 Subject: [PATCH 104/919] Add non-volatile memory support to STM --- ports/stm/boards/STM32F411VETx_nvm_FLASH.ld | 118 ++++++++++++++++++ ports/stm/boards/thunderpack/mpconfigboard.h | 11 +- ports/stm/boards/thunderpack/mpconfigboard.mk | 4 +- .../stm/common-hal/microcontroller/__init__.c | 12 ++ ports/stm/common-hal/nvm/ByteArray.c | 73 +++++++++++ ports/stm/common-hal/nvm/ByteArray.h | 43 +++++++ ports/stm/common-hal/nvm/__init__.c | 27 ++++ ports/stm/supervisor/internal_flash.h | 4 + 8 files changed, 286 insertions(+), 6 deletions(-) create mode 100644 ports/stm/boards/STM32F411VETx_nvm_FLASH.ld create mode 100644 ports/stm/common-hal/nvm/ByteArray.c create mode 100644 ports/stm/common-hal/nvm/ByteArray.h create mode 100644 ports/stm/common-hal/nvm/__init__.c diff --git a/ports/stm/boards/STM32F411VETx_nvm_FLASH.ld b/ports/stm/boards/STM32F411VETx_nvm_FLASH.ld new file mode 100644 index 0000000000..8382cb7818 --- /dev/null +++ b/ports/stm/boards/STM32F411VETx_nvm_FLASH.ld @@ -0,0 +1,118 @@ +/* + GNU linker script for STM32F411 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define the top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); +_heap_start = _ebss; /* heap starts just after statically allocated memory */ +_heap_end = 0x2001c000; /* tunable */ + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* Non-volitile memory */ + .nvm_data : + { + . = ALIGN(4); + KEEP(*(.nvm_data)) + . = ALIGN(4); + } >FLASH_NVM + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 0e66f2a719..62bf7609da 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -26,17 +26,18 @@ #define MICROPY_HW_BOARD_NAME "THUNDERPACK" #define MICROPY_HW_MCU_NAME "STM32F411CE" -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) +#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 +#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) #define BOARD_OSC_DIV (24) #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) // Status LEDs -#define MICROPY_HW_LED_TX (&pin_PA00) -#define MICROPY_HW_LED_RX (&pin_PB01) #define MICROPY_HW_LED_STATUS (&pin_PA02) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 0bf5b57a88..6fcaae6ab0 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -7,12 +7,14 @@ USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE +CIRCUITPY_NVM = 1 + MCU_SERIES = m4 MCU_VARIANT = stm32f4 MCU_SUB_VARIANT = stm32f411xe MCU_PACKAGE = 48 CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld +LD_FILE = boards/STM32F411VETx_nvm_FLASH.ld STARTUP_FILE = startup_stm32f411xe.s diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 0c680eb055..85e66fb00d 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -32,6 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/microcontroller/Processor.h" +#include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" @@ -109,6 +110,17 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; +#if CIRCUITPY_INTERNAL_NVM_SIZE > 0 +// The singleton nvm.ByteArray object. +const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .len = NVM_BYTEARRAY_BUFFER, + .start_address = (uint8_t*) (CIRCUITPY_INTERNAL_NVM_START_ADDR) +}; +#endif + STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { #if MCU_PACKAGE >= 100 { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, diff --git a/ports/stm/common-hal/nvm/ByteArray.c b/ports/stm/common-hal/nvm/ByteArray.c new file mode 100644 index 0000000000..1aaf54653b --- /dev/null +++ b/ports/stm/common-hal/nvm/ByteArray.c @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/nvm/ByteArray.h" + +#include "stm32f4xx_hal.h" + +#include "supervisor/shared/stack.h" + +#include +#include + +uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { + return self->len; +} + +bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint8_t* values, uint32_t len) { + // Copy flash to buffer + uint8_t buffer[self->len]; + memcpy(buffer, self->start_address, self->len); + + // Set bytes in buffer + memmove(buffer + start_index, values, len); + + // Erase flash sector + HAL_FLASH_Unlock(); + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGSERR ); + FLASH_Erase_Sector(CIRCUITPY_INTERNAL_NVM_SECTOR, VOLTAGE_RANGE_3); + + // Write bytes to flash + uint32_t i; + uint32_t flash_addr = (uint32_t)self->start_address; + for (i = 0; i < self->len; i++, flash_addr++) { + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, flash_addr, buffer[i]) != HAL_OK) { + HAL_FLASH_Lock(); + return false; + } + } + + // Finish up + HAL_FLASH_Lock(); + return true; +} + +// NVM memory is memory mapped so reading it is easy. +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint32_t len, uint8_t* values) { + memcpy(values, self->start_address + start_index, len); +} diff --git a/ports/stm/common-hal/nvm/ByteArray.h b/ports/stm/common-hal/nvm/ByteArray.h new file mode 100644 index 0000000000..8ad64cb81b --- /dev/null +++ b/ports/stm/common-hal/nvm/ByteArray.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_NVM_BYTEARRAY_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_NVM_BYTEARRAY_H + +#include "py/obj.h" + +// STM flash is saved in sectors (not pages), at a minimum size of 16k. +// To limit the RAM usage during writing, we want to set a smaller +// maximum value. +#define NVM_BYTEARRAY_BUFFER 512 + +typedef struct { + mp_obj_base_t base; + uint8_t* start_address; + uint32_t len; +} nvm_bytearray_obj_t; + +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/stm/common-hal/nvm/__init__.c b/ports/stm/common-hal/nvm/__init__.c new file mode 100644 index 0000000000..f0792430f0 --- /dev/null +++ b/ports/stm/common-hal/nvm/__init__.c @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// No nvm module functions. diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 9f16a799d8..859470ff09 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -39,8 +39,12 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB +#ifdef CIRCUITPY_NVM +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB +#else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif +#endif #ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB From 5f7e51756f44975c06ccac6576cb72645f0d2c08 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 02:41:47 -0700 Subject: [PATCH 105/919] Add thunderpack to build. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b67b19b438..eace60ba63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -229,6 +229,7 @@ jobs: - "stringcar_m0_express" - "teensy40" - "teknikio_bluebird" + - "thunderpack" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" From 39a19d54c26f1e049684d2fe50eefed6d7230b46 Mon Sep 17 00:00:00 2001 From: Chris Burton Date: Sun, 22 Mar 2020 16:23:56 +0000 Subject: [PATCH 106/919] Add support for Commander --- .../atmel-samd/boards/8086_commander/board.c | 37 +++++++++++ .../boards/8086_commander/mpconfigboard.h | 28 +++++++++ .../boards/8086_commander/mpconfigboard.mk | 27 ++++++++ ports/atmel-samd/boards/8086_commander/pins.c | 63 +++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 ports/atmel-samd/boards/8086_commander/board.c create mode 100644 ports/atmel-samd/boards/8086_commander/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/8086_commander/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/8086_commander/pins.c diff --git a/ports/atmel-samd/boards/8086_commander/board.c b/ports/atmel-samd/boards/8086_commander/board.c new file mode 100644 index 0000000000..d7e856d611 --- /dev/null +++ b/ports/atmel-samd/boards/8086_commander/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.h b/ports/atmel-samd/boards/8086_commander/mpconfigboard.h new file mode 100644 index 0000000000..9e3be4e6a0 --- /dev/null +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.h @@ -0,0 +1,28 @@ +#define MICROPY_HW_BOARD_NAME "8086 Commander" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define BOARD_HAS_CRYSTAL 0 +#define CALIBRATE_CRYSTALLESS 1 + +#define MICROPY_HW_LED_STATUS (&pin_PA06) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define SPI_FLASH_BAUDRATE (8000000) + +#define SPI_FLASH_MISO_PIN &pin_PA19 +#define SPI_FLASH_MOSI_PIN &pin_PA16 +#define SPI_FLASH_SCK_PIN &pin_PA17 +#define SPI_FLASH_CS_PIN &pin_PA18 + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk new file mode 100644 index 0000000000..7b0833b884 --- /dev/null +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -0,0 +1,27 @@ +USB_VID = 0x3171 +USB_PID = 0x0101 +USB_PRODUCT = "Commander" +USB_MANUFACTURER = "8086 Consultancy" + +USB_DEVICES= "CDC,MSC,HID" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" + +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 + +SUPEROPT_GC = 0 + +CFLAGS_INLINE_LIMIT = 60 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD +#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ADXL34x diff --git a/ports/atmel-samd/boards/8086_commander/pins.c b/ports/atmel-samd/boards/8086_commander/pins.c new file mode 100644 index 0000000000..3eea4009e7 --- /dev/null +++ b/ports/atmel-samd/boards/8086_commander/pins.c @@ -0,0 +1,63 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + // Serial + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, // RX + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, // TX + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + + // Buttons + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA20) }, // 1 + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, // 2 + { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB09) }, // 3 + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA02) }, // 4 + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PA02) }, + + // SD Card / SPI + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA13) }, // CS + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB10) }, // MOSI + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB11) }, // SCK + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA12) }, // MISO + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + + // LED + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, // 1A + { MP_ROM_QSTR(MP_QSTR_LED1A), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA14) }, // 1B + { MP_ROM_QSTR(MP_QSTR_LED1B), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA08) }, // 2A + { MP_ROM_QSTR(MP_QSTR_LED2A), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA07) }, // 2B + { MP_ROM_QSTR(MP_QSTR_LED2B), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA06) }, // ALERT + { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) }, // 3A + { MP_ROM_QSTR(MP_QSTR_LED3A), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA04) }, // 3B + { MP_ROM_QSTR(MP_QSTR_LED3B), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB02) }, // 4A + { MP_ROM_QSTR(MP_QSTR_LED4A), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB03) }, // 4B + { MP_ROM_QSTR(MP_QSTR_LED4B), MP_ROM_PTR(&pin_PB03) }, + + // Accelerometer / I2C + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA23) }, // SCL + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA22) }, // SDA + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + + // Comm objects + { 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); From 68195a8dfe0bec239a38cc01ad2b74160bbdacd6 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 15:19:53 -0700 Subject: [PATCH 107/919] Update NVM_BYTEARRAY_BUFFER_LEN --- ports/stm/boards/thunderpack/mpconfigboard.h | 11 +++++++++-- ports/stm/common-hal/microcontroller/__init__.c | 2 +- ports/stm/common-hal/nvm/ByteArray.h | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 62bf7609da..270600b3c8 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -26,11 +26,18 @@ #define MICROPY_HW_BOARD_NAME "THUNDERPACK" #define MICROPY_HW_MCU_NAME "STM32F411CE" -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) +// Non-volatile memory config #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) #define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 + +// Putting the entire flash sector in the NVM byte array buffer +// would take up too much RAM. This limits how much of the sector we use. +#define NVM_BYTEARRAY_BUFFER_LEN 512 + +// Flash config +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) #define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) #define BOARD_OSC_DIV (24) diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 85e66fb00d..b69407eff7 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -116,7 +116,7 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, - .len = NVM_BYTEARRAY_BUFFER, + .len = NVM_BYTEARRAY_BUFFER_LEN, .start_address = (uint8_t*) (CIRCUITPY_INTERNAL_NVM_START_ADDR) }; #endif diff --git a/ports/stm/common-hal/nvm/ByteArray.h b/ports/stm/common-hal/nvm/ByteArray.h index 8ad64cb81b..0d7ecf6ab7 100644 --- a/ports/stm/common-hal/nvm/ByteArray.h +++ b/ports/stm/common-hal/nvm/ByteArray.h @@ -32,7 +32,9 @@ // STM flash is saved in sectors (not pages), at a minimum size of 16k. // To limit the RAM usage during writing, we want to set a smaller // maximum value. -#define NVM_BYTEARRAY_BUFFER 512 +#ifndef NVM_BYTEARRAY_BUFFER_LEN +#define NVM_BYTEARRAY_BUFFER_LEN 512 +#endif typedef struct { mp_obj_base_t base; From a79ac35173d29b473f64492b089f74e88a13d8bd Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 15:20:58 -0700 Subject: [PATCH 108/919] Rename NVM_BYTEARRAY_BUFFER_SIZE --- ports/stm/boards/thunderpack/mpconfigboard.h | 2 +- ports/stm/common-hal/microcontroller/__init__.c | 2 +- ports/stm/common-hal/nvm/ByteArray.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 270600b3c8..0b3c55819a 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -33,7 +33,7 @@ // Putting the entire flash sector in the NVM byte array buffer // would take up too much RAM. This limits how much of the sector we use. -#define NVM_BYTEARRAY_BUFFER_LEN 512 +#define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config #define FLASH_SIZE (0x80000) diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index b69407eff7..d407ecfe50 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -116,7 +116,7 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, - .len = NVM_BYTEARRAY_BUFFER_LEN, + .len = NVM_BYTEARRAY_BUFFER_SIZE, .start_address = (uint8_t*) (CIRCUITPY_INTERNAL_NVM_START_ADDR) }; #endif diff --git a/ports/stm/common-hal/nvm/ByteArray.h b/ports/stm/common-hal/nvm/ByteArray.h index 0d7ecf6ab7..b6ea36de3f 100644 --- a/ports/stm/common-hal/nvm/ByteArray.h +++ b/ports/stm/common-hal/nvm/ByteArray.h @@ -32,8 +32,8 @@ // STM flash is saved in sectors (not pages), at a minimum size of 16k. // To limit the RAM usage during writing, we want to set a smaller // maximum value. -#ifndef NVM_BYTEARRAY_BUFFER_LEN -#define NVM_BYTEARRAY_BUFFER_LEN 512 +#ifndef NVM_BYTEARRAY_BUFFER_SIZE +#define NVM_BYTEARRAY_BUFFER_SIZE 512 #endif typedef struct { From 29ce7567098dd6b5b093b1bd5a3e0ff553c91801 Mon Sep 17 00:00:00 2001 From: jgillick Date: Sun, 22 Mar 2020 18:41:19 -0700 Subject: [PATCH 109/919] PR feedback. --- ports/stm/boards/thunderpack/pins.c | 8 ++++---- ports/stm/supervisor/usb.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c index 830e99dae7..04394993e4 100644 --- a/ports/stm/boards/thunderpack/pins.c +++ b/ports/stm/boards/thunderpack/pins.c @@ -10,10 +10,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, //USB (shouldn't be used) - { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_PA14) }, diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 6cb9feb4b1..93b5ae7693 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -85,7 +85,7 @@ void init_usb_hardware(void) { never_reset_pin_number(0, 12); /* Configure VBUS Pin */ -#if (BOARD_NO_VBUS_SENSE) +#if (BOARD_NO_VBUS_SENSE == 0) GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; From c0c4c4403a24bc7c2bf2f12744cdc689be253842 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 Mar 2020 14:46:25 -0700 Subject: [PATCH 110/919] Factor out stm32f4xx_hal_conf.h --- .../stm/boards/espruino_pico/mpconfigboard.h | 1 + .../boards/espruino_pico/stm32f4xx_hal_conf.h | 440 ------------------ .../stm/boards/espruino_wifi/mpconfigboard.h | 1 + .../boards/espruino_wifi/stm32f4xx_hal_conf.h | 439 ----------------- .../stm32f4xx_hal_conf.h | 440 ------------------ ports/stm/boards/meowbit_v121/board.c | 4 +- ports/stm/boards/meowbit_v121/mpconfigboard.h | 4 + .../boards/meowbit_v121/stm32f4xx_hal_conf.h | 440 ------------------ ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 2 + .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 440 ------------------ ports/stm/boards/pyboard_v11/mpconfigboard.h | 3 + .../boards/pyboard_v11/stm32f4xx_hal_conf.h | 440 ------------------ .../stm32f411ce_blackpill/mpconfigboard.h | 3 + .../stm32f4xx_hal_conf.h | 440 ------------------ .../stm32f411ve_discovery/mpconfigboard.h | 6 + .../stm32f4xx_hal_conf.h | 439 ----------------- .../stm32f412zg_discovery/mpconfigboard.h | 2 + .../stm32f4xx_hal_conf.h | 438 ----------------- ports/stm/common-hal/pulseio/PulseIn.c | 82 +++- ports/stm/common-hal/pulseio/PulseIn.h | 4 +- .../stm32f4xx_hal_conf.h | 8 +- ports/stm/supervisor/port.c | 40 +- 22 files changed, 112 insertions(+), 4004 deletions(-) delete mode 100644 ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h delete mode 100644 ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h rename ports/stm/{boards/stm32f4_discovery => }/stm32f4xx_hal_conf.h (99%) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index d4430380c6..da75d8669b 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -36,4 +36,5 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE diff --git a/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm/boards/espruino_pico/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h index abdc9e8fac..d7cda02a07 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -33,4 +33,5 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV (8) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE #define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h b/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm/boards/espruino_wifi/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h deleted file mode 100644 index 0d5612cdec..0000000000 --- a/ports/stm/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index a0ae988249..09476a3bc0 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -35,8 +35,6 @@ #include "supervisor/spi_flash_api.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 @@ -61,7 +59,7 @@ uint8_t display_init_sequence[] = { 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2d, - 0x29, 0x25, 0x2B, 0x39, + 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index babf54a3a9..8c7e800f4a 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -36,6 +36,10 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (12) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) + #define BOARD_NO_VBUS_SENSE (1) #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader #define BOARD_USE_INTERNAL_SPI diff --git a/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h deleted file mode 100644 index 68a49b4ba8..0000000000 --- a/ports/stm/boards/meowbit_v121/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 965e7d5ff4..b16de9b513 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -33,6 +33,8 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define LSE_VALUE ((uint32_t)32000U) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) diff --git a/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm/boards/pyb_nano_v2/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h index 398731d30c..bbad321a6a 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -33,6 +33,9 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (12) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h b/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h deleted file mode 100644 index 4dc18cb7f4..0000000000 --- a/ports/stm/boards/pyboard_v11/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h index 2ae1a29268..feeee146fc 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -35,6 +35,9 @@ #define BOARD_OSC_DIV (25) #define BOARD_NO_VBUS_SENSE (1) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define HSE_VALUE ((uint32_t)25000000U) + // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) // #define SPI_FLASH_MISO_PIN (&pin_PA06) diff --git a/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h deleted file mode 100644 index 81d29f2420..0000000000 --- a/ports/stm/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index 49ef80cdd7..ffc6ee40c1 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -33,3 +33,9 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV (8) + +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI + +// The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. +// #define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +// #define LSE_VALUE ((uint32_t)32000U) diff --git a/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index 18d9d60ebe..0000000000 --- a/ports/stm/boards/stm32f411ve_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,439 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index f34b830fb2..8ee3734d70 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -34,5 +34,7 @@ #define BOARD_OSC_DIV (8) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE + #define DEFAULT_I2C_BUS_SCL (&pin_PB10) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h b/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h deleted file mode 100644 index f1b4013485..0000000000 --- a/ports/stm/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,438 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -#define HAL_SRAM_MODULE_ENABLED -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -#define HAL_SD_MODULE_ENABLED -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -#define HAL_QSPI_MODULE_ENABLED -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 371ac42ed4..5e94653fcd 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -39,19 +39,33 @@ static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE]; +STATIC TIM_HandleTypeDef t6_handle; +static uint32_t overflow_count = 0; +STATIC uint8_t refcount = 0; + static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num); +void TIM6_IRQHandler(void) +{ + // Detect TIM Update event + if (__HAL_TIM_GET_FLAG(&t6_handle, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(&t6_handle, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(&t6_handle, TIM_IT_UPDATE); + overflow_count++; + } + } +} + static void pulsein_handler(uint8_t num) { + // Grab the current time first. + uint32_t current_overflow = overflow_count; + uint32_t current_count = TIM6->CNT; + // Interrupt register must be cleared manually EXTI->PR = 1 << num; - // Grab the current time first. - uint32_t current_us = 0; - uint64_t current_ms = 0; - - // current_tick gives us the remaining us until the next tick but we want the number since the last ms. - current_us = 1000 - current_us; - pulseio_pulsein_obj_t* self = _objs[num]; if ( !self ) return; @@ -62,18 +76,8 @@ static void pulsein_handler(uint8_t num) { self->first_edge = false; } } else { - uint32_t ms_diff = current_ms - self->last_ms; - uint16_t us_diff = current_us - self->last_us; - uint32_t total_diff = us_diff; - - if (self->last_us > current_us) { - total_diff = 1000 + current_us - self->last_us; - if (ms_diff > 1) { - total_diff += (ms_diff - 1) * 1000; - } - } else { - total_diff += ms_diff * 1000; - } + uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; + // Cap duration at 16 bits. uint16_t duration = 0xffff; if (total_diff < duration) { duration = total_diff; @@ -88,8 +92,8 @@ static void pulsein_handler(uint8_t num) { } } - self->last_ms = current_ms; - self->last_us = current_us; + self->last_count = current_count; + self->last_overflow = current_overflow; } void pulsein_reset(void) { @@ -100,6 +104,9 @@ void pulsein_reset(void) { } } memset(_objs, 0, sizeof(_objs)); + + __HAL_RCC_TIM6_CLK_DISABLE(); + refcount = 0; } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, @@ -126,8 +133,26 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu self->len = 0; self->first_edge = true; self->paused = false; - self->last_us = 0; - self->last_ms = 0; + self->last_count = 0; + self->last_overflow = 0; + + if (HAL_TIM_Base_GetState(&t6_handle) == HAL_TIM_STATE_RESET) { + // Set the new period + t6_handle.Instance = TIM6; + t6_handle.Init.Prescaler = 168; // HCLK is 168 mhz so divide down to 1mhz + t6_handle.Init.Period = 0xffff; + HAL_TIM_Base_Init(&t6_handle); + + // TIM6 has limited HAL support, set registers manually + t6_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt + t6_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer + t6_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts + __HAL_TIM_ENABLE_IT(&t6_handle, TIM_IT_UPDATE); + + overflow_count = 0; + } + // Add to active PulseIns + refcount++; // EXTI pins can also be read as an input GPIO_InitTypeDef GPIO_InitStruct = {0}; @@ -155,6 +180,13 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) { _objs[self->pin->number] = NULL; reset_pin_number(self->pin->port, self->pin->number); self->pin = NULL; + + refcount--; + if (refcount == 0) { + #if HAS_BASIC_TIM + __HAL_RCC_TIM6_CLK_DISABLE(); + #endif + } } void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) { @@ -189,8 +221,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t tri self->first_edge = true; self->paused = false; - self->last_ms = 0; - self->last_us = 0; + self->last_count = 0; + self->last_overflow = 0; HAL_NVIC_EnableIRQ(self->irq); } diff --git a/ports/stm/common-hal/pulseio/PulseIn.h b/ports/stm/common-hal/pulseio/PulseIn.h index 5456613c6a..34d0cc731a 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.h +++ b/ports/stm/common-hal/pulseio/PulseIn.h @@ -45,8 +45,8 @@ typedef struct { volatile uint16_t start; volatile uint16_t len; - volatile uint16_t last_us; - volatile uint64_t last_ms; + volatile uint32_t last_overflow; + volatile uint16_t last_count; } pulseio_pulsein_obj_t; void pulsein_reset(void); diff --git a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h b/ports/stm/stm32f4xx_hal_conf.h similarity index 99% rename from ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h rename to ports/stm/stm32f4xx_hal_conf.h index 6076324f08..4c19f8561f 100644 --- a/ports/stm/boards/stm32f4_discovery/stm32f4xx_hal_conf.h +++ b/ports/stm/stm32f4xx_hal_conf.h @@ -19,6 +19,8 @@ ****************************************************************************** */ +#include "py/mpconfig.h" + /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_HAL_CONF_H #define __STM32F4xx_HAL_CONF_H @@ -70,8 +72,7 @@ #define HAL_PCD_MODULE_ENABLED /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED /* #define HAL_CEC_MODULE_ENABLED */ /* #define HAL_FMPI2C_MODULE_ENABLED */ /* #define HAL_SPDIFRX_MODULE_ENABLED */ @@ -128,6 +129,7 @@ #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ #endif /* LSE_STARTUP_TIMEOUT */ + /** * @brief External clock source for I2S peripheral * This value is used by the I2S HAL module to compute the I2S clock source @@ -144,7 +146,7 @@ /** * @brief This is the HAL system configuration section */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ #define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ #define USE_RTOS 0U #define PREFETCH_ENABLE 1U diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 25000eca88..b397073e2a 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -45,6 +45,12 @@ static RTC_HandleTypeDef _hrtc; +#if BOARD_RTC_CLOCK == RCC_RTCCLKSOURCE_LSE +#define RTC_CLOCK_FREQUENCY LSE_VALUE +#else +#define RTC_CLOCK_FREQUENCY LSI_VALUE +#endif + safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); @@ -54,22 +60,25 @@ safe_mode_t port_init(void) { stm32f4_peripherals_gpio_init(); HAL_PWR_EnableBkUpAccess(); + #if BOARD_RTC_CLOCK == RCC_RTCCLKSOURCE_LSE __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) {} + #else + __HAL_RCC_LSI_ENABLE(); + #endif __HAL_RCC_RTC_CONFIG(BOARD_RTC_CLOCK); __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - // Divide async as little as possible so that we have 32768 count in subseconds. + // Divide async as little as possible so that we have RTC_CLOCK_FREQUENCY count in subseconds. + // This ensures our timing > 1 second is correct. We fudge < 1 second because there will only be + // 1000 subticks with a 32.000k crystal. _hrtc.Init.AsynchPrediv = 0x0; - _hrtc.Init.SynchPrediv = 0x7fff; // 32768 ticks per second + _hrtc.Init.SynchPrediv = RTC_CLOCK_FREQUENCY - 1; _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; - HAL_StatusTypeDef result = HAL_RTC_Init(&_hrtc); - if (result != HAL_OK) { - asm("bkpt"); - } + HAL_RTC_Init(&_hrtc); return NO_SAFE_MODE; } @@ -138,7 +147,7 @@ volatile uint32_t cached_date = 0; volatile uint32_t seconds_to_minute = 0; volatile uint32_t cached_hours_minutes = 0; uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t subseconds = 0x8000 - (uint32_t)(RTC->SSR); + uint32_t subseconds = RTC_CLOCK_FREQUENCY - (uint32_t)(RTC->SSR); uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); if (date != cached_date) { @@ -182,10 +191,7 @@ void RTC_Alarm_IRQHandler(void) { // Enable 1/1024 second tick. void port_enable_tick(void) { - HAL_StatusTypeDef result = HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, 32768 / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); - if (result != HAL_OK) { - asm("bkpt"); - } + HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, RTC_CLOCK_FREQUENCY / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 1, 0U); HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); } @@ -193,9 +199,6 @@ extern volatile uint32_t autoreload_delay_ms; // Disable 1/1024 second tick. void port_disable_tick(void) { - if (autoreload_delay_ms > 1) { - asm("bkpt"); - } HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn); HAL_RTCEx_DeactivateWakeUpTimer(&_hrtc); } @@ -215,8 +218,15 @@ void port_interrupt_after_ticks(uint32_t ticks) { } else { alarm.AlarmMask = RTC_ALARMMASK_NONE; } + // Fudge subseconds if we're running a 32k crystal. + #if RTC_CLOCK_FREQUENCY == 32000 + if (raw_ticks % 1024 > 1000) { + raw_ticks -= 24; + } + #endif - alarm.AlarmTime.SubSeconds = 32768 - ((raw_ticks % 1024) * 32); + alarm.AlarmTime.SubSeconds = RTC_CLOCK_FREQUENCY - + ((raw_ticks % (1024)) * 32); alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE; From a56170d7f8f4b807dcc72a1d3cce365d3523b124 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 Mar 2020 15:02:24 -0700 Subject: [PATCH 111/919] Temporarily swap samd-peripherals location --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5c3387077c..6853d4fcac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,7 +62,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git [submodule "ports/atmel-samd/peripherals"] path = ports/atmel-samd/peripherals - url = https://github.com/adafruit/samd-peripherals.git + url = https://github.com/tannewt/samd-peripherals.git [submodule "frozen/Adafruit_CircuitPython_Crickit"] path = frozen/Adafruit_CircuitPython_Crickit url = https://github.com/adafruit/Adafruit_CircuitPython_Crickit From 653b7619ec60ff8167a52680d888f73062a8b06f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 Mar 2020 16:09:50 -0700 Subject: [PATCH 112/919] Add back microsecond delay to STM32 --- ports/stm/common-hal/microcontroller/__init__.c | 9 ++++++--- ports/stm/stm32f4xx_hal_conf.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index b20f49e590..a2d8e02c3a 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -42,9 +42,12 @@ #include "stm32f4xx_hal.h" void common_hal_mcu_delay_us(uint32_t delay) { - if (__get_PRIMASK() == 0x00000000) { - } else { - } + uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; + delay *= ticks_per_us; + SysTick->LOAD = delay; + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; + while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) {} + SysTick->CTRL = 0; } volatile uint32_t nesting_count = 0; diff --git a/ports/stm/stm32f4xx_hal_conf.h b/ports/stm/stm32f4xx_hal_conf.h index 4c19f8561f..0a8d272d2a 100644 --- a/ports/stm/stm32f4xx_hal_conf.h +++ b/ports/stm/stm32f4xx_hal_conf.h @@ -122,7 +122,7 @@ * @brief External Low Speed oscillator (LSE) value. */ #if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ + #define LSE_VALUE 32768 /*!< Value of the External Low Speed oscillator in Hz */ #endif /* LSE_VALUE */ #if !defined (LSE_STARTUP_TIMEOUT) From a8ed6d993cc6d1389017a9a1d38a1e830499b7c9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 23 Mar 2020 18:20:58 -0700 Subject: [PATCH 113/919] Switch iMX RT to RTC. Untested. --- ports/mimxrt10xx/mphalport.c | 15 ------- ports/mimxrt10xx/supervisor/internal_flash.c | 2 +- ports/mimxrt10xx/supervisor/port.c | 46 ++++++++++++++++++++ 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/ports/mimxrt10xx/mphalport.c b/ports/mimxrt10xx/mphalport.c index 06275cd83c..111e97011e 100644 --- a/ports/mimxrt10xx/mphalport.c +++ b/ports/mimxrt10xx/mphalport.c @@ -33,21 +33,6 @@ #include "fsl_common.h" -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - RUN_BACKGROUND_TASKS; - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - void mp_hal_delay_us(mp_uint_t delay) { #if defined(MIMXRT1011_SERIES) || defined(MIMXRT1021_SERIES) SDK_DelayAtLeastUs(delay, SystemCoreClock); diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 7e9d8fa377..4f52748ed5 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -183,7 +183,7 @@ uint32_t supervisor_flash_get_block_count(void) { return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE; } -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { if (_flash_page_addr == NO_CACHE) return; status_t status; diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index b311e89206..5ac84f257d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -341,6 +341,52 @@ uint32_t port_get_saved_word(void) { return SNVS->LPGPR[1]; } +uint64_t port_get_raw_ticks(uint8_t* subticks) { + uint64_t ticks = 0; + uint64_t next_ticks = 1; + while (ticks != next_ticks) { + ticks = next_ticks; + next_ticks = ((uint64_t) SNVS->HPRTCMR) << 32 | SNVS->HPRTCLR; + } + if (subticks != NULL) { + *subticks = ticks % 32; + } + return ticks / 32; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + uint32_t hpcr = SNVS->HPCR; + hpcr &= ~SNVS_HPCR_PI_FREQ_MASK; + SNVS->HPCR = hpcr | SNVS_HPCR_PI_FREQ(5) | SNVS_HPCR_PI_EN_MASK; +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + SNVS->HPCR &= ~SNVS_HPCR_PI_EN_MASK; +} + +void port_interrupt_after_ticks(uint32_t ticks) { + uint8_t subticks; + uint64_t current_ticks = port_get_raw_ticks(&subticks); + current_ticks += ticks; + SNVS->HPTALR = current_ticks << 5 | subticks; + SNVS->HPTAMR = current_ticks >> (32 - 5); + SNVS->HPCR |= SNVS_HPCR_HPTA_EN_MASK; +} + +void port_sleep_until_interrupt(void) { + // App note here: https://www.nxp.com/docs/en/application-note/AN12085.pdf + + // Clear the FPU interrupt because it can prevent us from sleeping. + if (__get_FPSCR() & ~(0x9f)) { + __set_FPSCR(__get_FPSCR() & ~(0x9f)); + (void) __get_FPSCR(); + } + // Call wait for interrupt ourselves if the SD isn't enabled. + __WFI(); +} + /** * \brief Default interrupt handler for unused IRQs. */ From 8ed4deee9d49b477a1a11cea52248122caaef3d5 Mon Sep 17 00:00:00 2001 From: jgillick Date: Mon, 23 Mar 2020 23:06:55 -0700 Subject: [PATCH 114/919] Rename pins --- ports/stm/boards/thunderpack/pins.c | 35 +++++++++++++---------------- ports/stm/supervisor/usb.c | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c index 04394993e4..559d9658e7 100644 --- a/ports/stm/boards/thunderpack/pins.c +++ b/ports/stm/boards/thunderpack/pins.c @@ -1,26 +1,23 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB7), MP_ROM_PTR(&pin_PB07) }, { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) }, diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 93b5ae7693..8bfdcde403 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -85,7 +85,7 @@ void init_usb_hardware(void) { never_reset_pin_number(0, 12); /* Configure VBUS Pin */ -#if (BOARD_NO_VBUS_SENSE == 0) +#if !(BOARD_NO_VBUS_SENSE) GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; From c961ed902564e18066e52ca46be20a2b58524b9f Mon Sep 17 00:00:00 2001 From: William Moser Date: Tue, 24 Mar 2020 13:25:02 -0400 Subject: [PATCH 115/919] Added 31250 and 56000 to baudrate_map in UART.c, to parallel definitions in nrfx/mdk/nrf*_bitfields.h files --- ports/nrf/common-hal/busio/UART.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 14fa363749..4a3e74c49d 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -70,7 +70,9 @@ static uint32_t get_nrf_baud (uint32_t baudrate) { { 14400, NRF_UARTE_BAUDRATE_14400 }, { 19200, NRF_UARTE_BAUDRATE_19200 }, { 28800, NRF_UARTE_BAUDRATE_28800 }, + { 31250, NRF_UARTE_BAUDRATE_31250 }, { 38400, NRF_UARTE_BAUDRATE_38400 }, + { 56000, NRF_UARTE_BAUDRATE_56000 }, { 57600, NRF_UARTE_BAUDRATE_57600 }, { 76800, NRF_UARTE_BAUDRATE_76800 }, { 115200, NRF_UARTE_BAUDRATE_115200 }, From 5c36c73a3dc47a87235933860d0f8f3e07f735d8 Mon Sep 17 00:00:00 2001 From: Chris Burton Date: Tue, 24 Mar 2020 19:43:25 +0000 Subject: [PATCH 116/919] Add to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b67b19b438..3d7256a3f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,6 +122,7 @@ jobs: fail-fast: false matrix: board: + - "8086_commander" - "TG-Watch02A" - "aramcon_badge_2019" - "arduino_mkr1300" From 5e559be9b59d4f6bf00907563414916228205199 Mon Sep 17 00:00:00 2001 From: Chris Burton Date: Tue, 24 Mar 2020 21:10:34 +0000 Subject: [PATCH 117/919] Remove Adafruit_CircuitPython_CircuitPlayground --- ports/atmel-samd/boards/8086_commander/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 7b0833b884..3e865657ac 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -21,7 +21,6 @@ CFLAGS_INLINE_LIMIT = 60 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ADXL34x From 5e1e4d32db0e81bc414414ab60cef952db61b6c1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 24 Mar 2020 15:46:10 -0700 Subject: [PATCH 118/919] Get basic sleep going on the iMX RT 1011 --- ports/mimxrt10xx/Makefile | 4 +- ports/mimxrt10xx/background.c | 1 - .../common-hal/displayio/ParallelBus.c | 2 - .../common-hal/neopixel_write/__init__.c | 29 +++--- ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 2 - ports/mimxrt10xx/sdk | 2 +- ports/mimxrt10xx/supervisor/port.c | 5 - ports/mimxrt10xx/tick.c | 92 ------------------- ports/mimxrt10xx/tick.h | 43 --------- 9 files changed, 14 insertions(+), 166 deletions(-) delete mode 100644 ports/mimxrt10xx/tick.c delete mode 100644 ports/mimxrt10xx/tick.h diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 80d1da1aac..858e92c328 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -162,8 +162,8 @@ SRC_C = \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/pins.c \ reset.c \ supervisor/flexspi_nor_flash_ops.c \ - supervisor/shared/memory.c \ - tick.c + supervisor/shared/memory.c + ifeq ($(CIRCUITPY_NETWORK),1) CFLAGS += -DMICROPY_PY_NETWORK=1 diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index 71dd795216..ff53ea44f4 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -27,7 +27,6 @@ #include "background.h" //#include "audio_dma.h" -#include "tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" diff --git a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c index 87fc511af1..87a72d0f33 100644 --- a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +++ b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c @@ -33,8 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "tick.h" - void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 9ea2335021..2ce552ad50 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -25,17 +25,16 @@ * THE SOFTWARE. */ -#include "py/mphal.h" #include "shared-bindings/neopixel_write/__init__.h" -#include "tick.h" -#include "py/mperrno.h" -#include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" #include "fsl_gpio.h" +#include "py/mperrno.h" +#include "py/mphal.h" +#include "py/runtime.h" +#include "supervisor/port.h" -uint64_t next_start_tick_ms = 0; -uint32_t next_start_tick_us = 1000; +uint64_t next_start_raw_ticks = 0; //sysclock divisors #define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field @@ -63,9 +62,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout uint32_t t0 = (sys_freq/MAGIC_800_T0H); uint32_t t1 = (sys_freq/MAGIC_800_T1H); - // This must be called while interrupts are on in case we're waiting for a - // future ms tick. - wait_until(next_start_tick_ms, next_start_tick_us); + // Wait to make sure we don't append onto the last transmission. This should only be a tick or + // two. + while (port_get_raw_ticks(NULL) < next_start_raw_ticks) {} GPIO_Type *gpio = digitalinout->pin->gpio; const uint32_t pin = digitalinout->pin->number; @@ -90,17 +89,11 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout } } + // Update the next start. + next_start_raw_ticks = port_get_raw_ticks(NULL) + 4; + // Enable interrupts again __enable_irq(); - - // Update the next start. - current_tick(&next_start_tick_ms, &next_start_tick_us); - if (next_start_tick_us < 100) { - next_start_tick_ms += 1; - next_start_tick_us = 100 - next_start_tick_us; - } else { - next_start_tick_us -= 100; - } } #pragma GCC pop_options diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c index 24e9ad85de..d8bf2017ea 100644 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c @@ -38,8 +38,6 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/translate.h" -#include "tick.h" - // TODO //static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { // uint32_t sense_setting; diff --git a/ports/mimxrt10xx/sdk b/ports/mimxrt10xx/sdk index 4e7438e654..987a289f03 160000 --- a/ports/mimxrt10xx/sdk +++ b/ports/mimxrt10xx/sdk @@ -1 +1 @@ -Subproject commit 4e7438e654f4a6b4f386b4bb9e817d74a0fbffc7 +Subproject commit 987a289f03ec45c75c7d39a5a8dec5862eacaf5b diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 5ac84f257d..ef6fe2f978 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -43,7 +43,6 @@ #include "common-hal/rtc/RTC.h" #include "reset.h" -#include "tick.h" #include "tusb.h" @@ -246,9 +245,6 @@ __attribute__((used, naked)) void Reset_Handler(void) { safe_mode_t port_init(void) { clocks_init(); - // Configure millisecond timer initialization. - tick_init(); - #if CIRCUITPY_RTC rtc_init(); #endif @@ -430,4 +426,3 @@ __attribute__((used)) void HardFault_Handler(void) asm("nop;"); } } - diff --git a/ports/mimxrt10xx/tick.c b/ports/mimxrt10xx/tick.c deleted file mode 100644 index c19ce796ed..0000000000 --- a/ports/mimxrt10xx/tick.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "tick.h" - -#include "fsl_common.h" - -#include "supervisor/shared/tick.h" -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - common_hal_mcu_disable_interrupts(); - - // Read the control register to reset the COUNTFLAG. - (void) SysTick->CTRL; - - common_hal_mcu_enable_interrupts(); - - // Do things common to all ports when the tick occurs - supervisor_tick(); -} - -void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms-1); -} - -void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_until_next_tick = SysTick->VAL / ticks_per_us; - uint32_t start_tick; - while (us >= us_until_next_tick) { - start_tick = SysTick->VAL; // wait for SysTick->VAL to RESET - while (SysTick->VAL < start_tick) {} - us -= us_until_next_tick; - us_until_next_tick = 1000; - } - while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - - // We disable interrupts to prevent ticks_ms from changing while we grab it. - common_hal_mcu_disable_interrupts(); - uint32_t tick_status = SysTick->CTRL; - uint32_t current_us = SysTick->VAL; - uint32_t tick_status2 = SysTick->CTRL; - uint64_t current_ms = supervisor_ticks_ms64(); - // The second clause ensures our value actually rolled over. Its possible it hit zero between - // the VAL read and CTRL read. - if ((tick_status & SysTick_CTRL_COUNTFLAG_Msk) != 0 || - ((tick_status2 & SysTick_CTRL_COUNTFLAG_Msk) != 0 && current_us > ticks_per_us)) { - current_ms++; - } - common_hal_mcu_enable_interrupts(); - *ms = current_ms; - *us_until_ms = current_us / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while (supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/mimxrt10xx/tick.h b/ports/mimxrt10xx/tick.h deleted file mode 100644 index 6660d5b4ae..0000000000 --- a/ports/mimxrt10xx/tick.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2019 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_TICK_H -#define MICROPY_INCLUDED_MIMXRT10XX_TICK_H - -#include "py/mpconfig.h" - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_MIMXRT10XX_TICK_H From ea0ce39962d2dc8a1c188119a416b4916b9bd493 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 24 Mar 2020 15:49:24 -0700 Subject: [PATCH 119/919] Simplify STM a bit. --- ports/stm/supervisor/port.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index b397073e2a..3d59ba49cf 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -72,8 +72,7 @@ safe_mode_t port_init(void) { _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; // Divide async as little as possible so that we have RTC_CLOCK_FREQUENCY count in subseconds. - // This ensures our timing > 1 second is correct. We fudge < 1 second because there will only be - // 1000 subticks with a 32.000k crystal. + // This ensures our timing > 1 second is correct. _hrtc.Init.AsynchPrediv = 0x0; _hrtc.Init.SynchPrediv = RTC_CLOCK_FREQUENCY - 1; _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; @@ -218,12 +217,6 @@ void port_interrupt_after_ticks(uint32_t ticks) { } else { alarm.AlarmMask = RTC_ALARMMASK_NONE; } - // Fudge subseconds if we're running a 32k crystal. - #if RTC_CLOCK_FREQUENCY == 32000 - if (raw_ticks % 1024 > 1000) { - raw_ticks -= 24; - } - #endif alarm.AlarmTime.SubSeconds = RTC_CLOCK_FREQUENCY - ((raw_ticks % (1024)) * 32); From 6b7acc65b655dd203b08b2d53f08ad56c7da1041 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 25 Mar 2020 11:22:46 -0700 Subject: [PATCH 121/919] Add polarity and phase to FourWire. It was fixed as 0/0 even though it used to get it from the current SPI state. This makes it more explicit with kwargs. Thanks to magpie_lark and kmatocha on the Adafruit Support forum for finding the issue: https://forums.adafruit.com/viewtopic.php?f=60&t=162515 --- shared-bindings/displayio/FourWire.c | 21 ++++++++++++++++++--- shared-bindings/displayio/FourWire.h | 3 ++- shared-module/displayio/FourWire.c | 7 ++++--- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 2cbceec48c..9ce08283b9 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -46,7 +46,8 @@ //| Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization. //| -//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000) +//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, +//| phase=0) //| //| Create a FourWire object associated with the given pins. //| @@ -60,15 +61,20 @@ //| :param microcontroller.Pin chip_select: Chip select pin //| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used //| :param int baudrate: Maximum baudrate in Hz for the display on the bus +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. //| STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset, ARG_baudrate }; + enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset, ARG_baudrate, ARG_polarity, ARG_phase }; static const mp_arg_t allowed_args[] = { { MP_QSTR_spi_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_command, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_chip_select, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_reset, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, { MP_QSTR_baudrate, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 24000000} }, + { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -91,8 +97,17 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_RuntimeError(translate("Too many display busses")); } + uint8_t polarity = args[ARG_polarity].u_int; + if (polarity != 0 && polarity != 1) { + mp_raise_ValueError(translate("Invalid polarity")); + } + uint8_t phase = args[ARG_phase].u_int; + if (phase != 0 && phase != 1) { + mp_raise_ValueError(translate("Invalid phase")); + } + common_hal_displayio_fourwire_construct(self, - MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int); + MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int, polarity, phase); return self; } diff --git a/shared-bindings/displayio/FourWire.h b/shared-bindings/displayio/FourWire.h index d0935f0639..ac186d2c3e 100644 --- a/shared-bindings/displayio/FourWire.h +++ b/shared-bindings/displayio/FourWire.h @@ -38,7 +38,8 @@ extern const mp_obj_type_t displayio_fourwire_type; void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, - const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate); + const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate, + uint8_t polarity, uint8_t phase); void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self); diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 256c29642d..fe7234aa7a 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -40,7 +40,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, - const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate) { + const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate, + uint8_t polarity, uint8_t phase) { self->bus = spi; common_hal_busio_spi_never_reset(self->bus); @@ -49,8 +50,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, gc_never_free(self->bus); self->frequency = baudrate; - self->polarity = 0; - self->phase = 0; + self->polarity = polarity; + self->phase = phase; common_hal_digitalio_digitalinout_construct(&self->command, command); common_hal_digitalio_digitalinout_switch_to_output(&self->command, true, DRIVE_MODE_PUSH_PULL); From 3551b769a27c442780e978ea7a58cc56170cdfc8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 25 Mar 2020 13:31:18 -0700 Subject: [PATCH 122/919] Fix connection handle tracking in PacketBuffer when a server. --- ports/nrf/common-hal/_bleio/PacketBuffer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 27dacb4938..8382a09709 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -156,8 +156,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { return false; } write_to_ringbuf(self, evt_write->data, evt_write->len); - } else if (evt_write->handle == self->characteristic->cccd_handle && - self->conn_handle == BLE_CONN_HANDLE_INVALID) { + } else if (evt_write->handle == self->characteristic->cccd_handle) { uint16_t cccd = *((uint16_t*) evt_write->data); if (cccd & BLE_GATT_HVX_NOTIFICATION) { self->conn_handle = conn_handle; @@ -167,6 +166,11 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { } break; } + case BLE_GAP_EVT_DISCONNECTED: { + if (self->conn_handle == conn_handle) { + self->conn_handle = BLE_CONN_HANDLE_INVALID; + } + } case BLE_GATTS_EVT_HVN_TX_COMPLETE: { queue_next_write(self); } @@ -192,6 +196,8 @@ void common_hal_bleio_packet_buffer_construct( incoming = outgoing; outgoing = temp; self->conn_handle = bleio_connection_get_conn_handle(MP_OBJ_TO_PTR(self->characteristic->service->connection)); + } else { + self->conn_handle = BLE_CONN_HANDLE_INVALID; } if (incoming) { From b1d83c3f5e08ac57799a535ced7fe70032552f57 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Wed, 25 Mar 2020 17:16:09 -0400 Subject: [PATCH 123/919] supervisor/shared/external_flash/devices.h: Add MX25L51245G support. Add external flash support for Macronix MX25L51245G 64MiB SPI flash. --- supervisor/shared/external_flash/devices.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 50263e5d6f..fd9224f561 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -481,6 +481,24 @@ typedef struct { .single_status_byte = true, \ } +// Settings for the Macronix MX25L51245G 64MiB SPI flash. +// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7437/MX25L51245G,%203V,%20512Mb,%20v1.6.pdf +#define MX25L51245G {\ + .total_size = (1 << 26), /* 64 MiB */ \ + .start_up_time_us = 5000, \ + .manufacturer_id = 0xc2, \ + .memory_type = 0x20, \ + .capacity = 0x1a, \ + .max_clock_speed_mhz = 133, \ + .quad_enable_bit_mask = 0x40, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} + // Settings for the Winbond W25Q128JV-PM 16MiB SPI flash. Note that JV-IM has a different .memory_type (0x70) // Datasheet: https://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf #define W25Q128JV_PM {\ From 18c12e782244c7dcdc95c0b09b9ddd365e9560f3 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Thu, 26 Mar 2020 00:15:48 +0100 Subject: [PATCH 124/919] mimxrt10xx: Return proper UART read length when everything was read --- ports/mimxrt10xx/common-hal/busio/UART.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index b34b948b29..4633507d8b 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -270,9 +270,14 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t LPUART_TransferAbortReceive(self->uart, &self->handle); } + // No data left, we got it all + if (self->handle.rxData == NULL) { + return len; + } + // The only place we can reliably tell how many bytes have been received is from the current // wp in the handle (because the abort nukes rxDataSize, and reading it before abort is a race.) - return self->handle.rxData-data; + return self->handle.rxData - data; } // Write characters. From 8a5d3cd6c4a5c68606aafa7373a7b5fc2079a936 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 25 Mar 2020 17:41:47 -0700 Subject: [PATCH 125/919] Add exception on small buffer and fix Connecion WRITE handling --- ports/nrf/common-hal/_bleio/Connection.c | 3 ++- ports/nrf/common-hal/_bleio/PacketBuffer.c | 4 ++-- shared-bindings/_bleio/PacketBuffer.c | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 96e8b8fbe9..d4c7308fd1 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -162,7 +162,8 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { self->do_bond_cccds = true; self->do_bond_cccds_request_time = supervisor_ticks_ms64(); } - break; + // Return false so other handlers get this event as well. + return false; case BLE_GATTS_EVT_SYS_ATTR_MISSING: sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 8382a09709..6ed6d14514 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -148,6 +148,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { // A client wrote to this server characteristic. ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; + // Event handle must match the handle for my characteristic. if (evt_write->handle == self->characteristic->handle) { if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { @@ -261,8 +262,7 @@ int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uin sd_nvic_critical_region_enter(&is_nested_critical_region); if (packet_length > len) { - // TODO: raise an exception. - packet_length = len; + return len - packet_length; } ringbuf_get_n(&self->ringbuf, data, packet_length); diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 3ed295f017..9e3666044a 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -109,7 +109,12 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o mp_buffer_info_t bufinfo; mp_get_buffer_raise(buffer_obj, &bufinfo, MP_BUFFER_WRITE); - return MP_OBJ_NEW_SMALL_INT(common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len)); + int size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); + if (size < 0) { + mp_raise_ValueError_varg(translate("Buffer too short by %d bytes"), size * -1); + } + + return MP_OBJ_NEW_SMALL_INT(size); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); From 7bba79363aab2b53cb1883fe5cab51a214d23461 Mon Sep 17 00:00:00 2001 From: siddacious Date: Thu, 19 Mar 2020 13:42:12 -0700 Subject: [PATCH 126/919] allowing backlight change --- ports/nrf/boards/ohs2020_badge/board.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 9e881d7639..c777d707ab 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -81,14 +81,16 @@ void board_init(void) { 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), - NULL, // backlight pin + //NULL, // backlight pin + &pin_P0_02, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 0.0f, // brightness (ignored) + false, // auto_brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60); // native_frames_per_second + } bool board_requests_safe_mode(void) { From 9e0c00dfd42504a53f000da374355829da7c7c77 Mon Sep 17 00:00:00 2001 From: siddacious Date: Wed, 25 Mar 2020 22:43:18 -0700 Subject: [PATCH 127/919] adding a backlight polarity flag to Display --- ports/atmel-samd/boards/hallowing_m0_express/board.c | 3 ++- ports/atmel-samd/boards/hallowing_m4_express/board.c | 3 ++- ports/atmel-samd/boards/monster_m4sk/board.c | 3 ++- ports/atmel-samd/boards/pewpew_m4/board.c | 3 ++- ports/atmel-samd/boards/pybadge/board.c | 3 ++- ports/atmel-samd/boards/pybadge_airlift/board.c | 3 ++- ports/atmel-samd/boards/pygamer/board.c | 3 ++- ports/atmel-samd/boards/pygamer_advance/board.c | 3 ++- ports/atmel-samd/boards/pyportal/board.c | 3 ++- ports/atmel-samd/boards/pyportal_titano/board.c | 3 ++- ports/atmel-samd/boards/ugame10/board.c | 3 ++- ports/nrf/boards/clue_nrf52840_express/board.c | 3 ++- ports/nrf/boards/ohs2020_badge/board.c | 11 +++++------ ports/stm/boards/meowbit_v121/board.c | 3 ++- shared-bindings/displayio/Display.c | 7 +++++-- shared-bindings/displayio/Display.h | 2 +- shared-module/displayio/Display.c | 5 ++++- shared-module/displayio/Display.h | 1 + 18 files changed, 42 insertions(+), 23 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index b4c54062f6..07546abf5c 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -108,7 +108,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 6bb2a591f0..6822368d72 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -88,7 +88,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 2377f4a9da..eeafdb4b80 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -89,7 +89,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 5f5a01e48e..ef259e27a6 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -139,7 +139,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands false, // auto_refresh - 20); // native_frames_per_second + 20, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index bead06f3c6..1209c027ee 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -111,7 +111,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 061f3d7772..dfbf7023fa 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -89,7 +89,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 70d4a05dcd..6df485fa9e 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -111,7 +111,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index ff2da34a26..ad5abd3f6c 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -89,7 +89,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index 2a72897784..a86f0ee48a 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -100,7 +100,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 828ceebc4e..a9ded1760d 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -117,7 +117,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index ce389a2b1c..96f2361fd6 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -108,7 +108,8 @@ void board_init(void) { false, // single_byte_bounds false, // data as commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index e342c6d939..03b212f9e0 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -88,7 +88,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index c777d707ab..106bbd6e16 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -81,16 +81,15 @@ void board_init(void) { 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), - //NULL, // backlight pin - &pin_P0_02, // backlight pin + &pin_P0_02, // backlight pin NO_BRIGHTNESS_COMMAND, - 0.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness (ignored) + true, // auto_brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second - + 60, // native_frames_per_second + false); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index a0ae988249..da87f00ec2 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -109,7 +109,8 @@ void board_init(void) { false, // single_byte_bounds false, // data_as_commands true, // auto_refresh - 60); // native_frames_per_second + 60, // native_frames_per_second + true); // backlight_on_high } bool board_requests_safe_mode(void) { diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 991c828be8..3ef7e74e9e 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -104,9 +104,10 @@ //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. //| :param bool auto_refresh: Automatically refresh the screen //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. +//| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. //| STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second }; + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -132,6 +133,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a { MP_QSTR_data_as_commands, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, + { MP_QSTR_backlight_on_high, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -178,7 +180,8 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_single_byte_bounds].u_bool, args[ARG_data_as_commands].u_bool, args[ARG_auto_refresh].u_bool, - args[ARG_native_frames_per_second].u_int + args[ARG_native_frames_per_second].u_int, + args[ARG_backlight_on_high].u_bool ); return self; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index b82a68ebe9..8c2e20262b 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -45,7 +45,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second); + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high); bool common_hal_displayio_display_show(displayio_display_obj_t* self, displayio_group_t* root_group); diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 299c8ad359..820fbcce62 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -50,7 +50,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, - bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second) { + bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, bool backlight_on_high) { // Turn off auto-refresh as we init. self->auto_refresh = false; uint16_t ram_width = 0x100; @@ -159,6 +159,9 @@ mp_float_t common_hal_displayio_display_get_brightness(displayio_display_obj_t* bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, mp_float_t brightness) { self->updating_backlight = true; + if (!self->backlight_on_high){ + brightness = 1.0-brightness; + } bool ok = false; if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index e5fe0a7088..8adaf597f9 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -55,6 +55,7 @@ typedef struct { bool data_as_commands; bool auto_brightness; bool updating_backlight; + bool backlight_on_high; } displayio_display_obj_t; void displayio_display_background(displayio_display_obj_t* self); From ff67571e9a4de91f38b6520f77dc0ff472306fda Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Thu, 26 Mar 2020 12:33:27 -0700 Subject: [PATCH 128/919] Add GD25Q64C as a flash chip for Sol --- ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index b1f916ec20..166eaad3f7 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -12,8 +12,8 @@ CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = W25Q32JV_IQ +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "GD25Q64C, W25Q32JV_IQ" LONGINT_IMPL = MPZ # Disable modules that are unusable on this special-purpose board. From a870908718a9e3c176f199dea41c95adaf966f14 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 26 Mar 2020 14:11:20 -0700 Subject: [PATCH 129/919] Don't break the function signature --- shared-bindings/displayio/FourWire.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 9ce08283b9..77329578a4 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -46,8 +46,7 @@ //| Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization. //| -//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, -//| phase=0) +//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, phase=0) //| //| Create a FourWire object associated with the given pins. //| From c4db8b87e2c57ca94b8f76e4b07ca02641df714e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 17 Mar 2020 18:26:13 -0400 Subject: [PATCH 130/919] Add F7 and H7 Support to the STM32 port Restructures the STM port of Circuitpython to be more generic about the STM32 chip lines to support the F7 and H7 series of chips. Adds the new Packages directory to organize different chip layouts between lines. Makes general changes to the Makefile to condense board-level flags to the minimum and support the new chip series. Adds the new chip line to the Peripherals directory, along with new python tools used to generate peripheral text automatically in the tools/ directory. --- ports/stm/Makefile | 150 ++-- ports/stm/README.md | 4 +- ports/stm/background.h | 6 +- ports/stm/boards/STM32H743ZITx_FLASH.ld | 193 +++++ ports/stm/boards/STM32H743_fs.ld | 164 ++++ .../stm/boards/espruino_pico/mpconfigboard.mk | 10 +- .../stm/boards/espruino_wifi/mpconfigboard.mk | 10 +- .../mpconfigboard.mk | 10 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 12 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 10 +- ports/stm/boards/pyboard_v11/mpconfigboard.mk | 10 +- ports/stm/boards/startup_stm32h743xx.s | 748 ++++++++++++++++++ .../stm32f411ce_blackpill/mpconfigboard.mk | 10 +- .../stm32f411ve_discovery/mpconfigboard.mk | 10 +- .../stm32f412zg_discovery/mpconfigboard.mk | 10 +- .../boards/stm32f4_discovery/mpconfigboard.mk | 12 +- .../stm/boards/stm32h743zi_discovery/board.c | 38 + .../stm32h743zi_discovery/mpconfigboard.h | 35 + .../stm32h743zi_discovery/mpconfigboard.mk | 14 + ports/stm/boards/stm32h743zi_discovery/pins.c | 135 ++++ .../stm32h7xx_hal_conf.h | 493 ++++++++++++ ports/stm/common-hal/analogio/AnalogOut.h | 2 +- ports/stm/common-hal/busio/I2C.c | 17 +- ports/stm/common-hal/busio/I2C.h | 13 +- ports/stm/common-hal/busio/OneWire.h | 6 +- ports/stm/common-hal/busio/SPI.c | 27 +- ports/stm/common-hal/busio/SPI.h | 17 +- ports/stm/common-hal/busio/UART.c | 33 +- ports/stm/common-hal/busio/UART.h | 11 +- ports/stm/common-hal/digitalio/DigitalInOut.c | 6 +- ports/stm/common-hal/digitalio/DigitalInOut.h | 6 +- ports/stm/common-hal/microcontroller/Pin.c | 11 +- ports/stm/common-hal/microcontroller/Pin.h | 8 +- .../common-hal/microcontroller/Processor.c | 14 +- .../common-hal/microcontroller/Processor.h | 6 +- .../stm/common-hal/microcontroller/__init__.c | 136 ---- ports/stm/common-hal/os/__init__.c | 2 +- ports/stm/common-hal/pulseio/PWMOut.h | 2 +- ports/stm/common-hal/supervisor/Runtime.h | 6 +- ports/stm/mpconfigport.h | 9 +- ports/stm/mpconfigport.mk | 19 +- ports/stm/mphalport.c | 1 - ports/stm/mphalport.h | 6 +- ports/stm/packages/LQFP100_f4.c | 117 +++ .../{stm32f4/LQFP100.h => LQFP100_x7.c} | 22 +- ports/stm/packages/LQFP144.c | 159 ++++ ports/stm/packages/LQFP64.c | 81 ++ ports/stm/packages/UFQFPN48.c | 63 ++ ports/stm/peripherals/{stm32f4 => }/clocks.h | 4 +- ports/stm/peripherals/{stm32f4 => }/gpio.h | 5 +- ports/stm/peripherals/periph.h | 117 +++ ports/stm/peripherals/{stm32f4 => }/pins.h | 28 +- ports/stm/peripherals/stm32f4/periph.h | 180 ----- .../peripherals/stm32f4/stm32f401xe/clocks.c | 4 +- .../peripherals/stm32f4/stm32f401xe/gpio.c | 10 +- .../peripherals/stm32f4/stm32f401xe/periph.c | 132 ++-- .../peripherals/stm32f4/stm32f401xe/periph.h | 22 +- .../peripherals/stm32f4/stm32f401xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f401xe/pins.h | 6 +- .../peripherals/stm32f4/stm32f405xx/clocks.c | 6 +- .../peripherals/stm32f4/stm32f405xx/gpio.c | 5 +- .../peripherals/stm32f4/stm32f405xx/periph.c | 134 ++-- .../peripherals/stm32f4/stm32f405xx/periph.h | 22 +- .../peripherals/stm32f4/stm32f405xx/pins.c | 2 +- .../peripherals/stm32f4/stm32f405xx/pins.h | 6 +- .../peripherals/stm32f4/stm32f407xx/clocks.c | 6 +- .../peripherals/stm32f4/stm32f407xx/gpio.c | 3 +- .../peripherals/stm32f4/stm32f407xx/periph.c | 134 ++-- .../peripherals/stm32f4/stm32f407xx/periph.h | 22 +- .../peripherals/stm32f4/stm32f407xx/pins.c | 2 +- .../peripherals/stm32f4/stm32f407xx/pins.h | 6 +- .../peripherals/stm32f4/stm32f411xe/clocks.c | 4 +- .../peripherals/stm32f4/stm32f411xe/gpio.c | 5 +- .../peripherals/stm32f4/stm32f411xe/periph.c | 176 ++--- .../peripherals/stm32f4/stm32f411xe/periph.h | 22 +- .../peripherals/stm32f4/stm32f411xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f411xe/pins.h | 4 +- .../peripherals/stm32f4/stm32f412zx/clocks.c | 6 +- .../peripherals/stm32f4/stm32f412zx/gpio.c | 214 +---- .../peripherals/stm32f4/stm32f412zx/periph.c | 196 ++--- .../peripherals/stm32f4/stm32f412zx/periph.h | 22 +- .../peripherals/stm32f4/stm32f412zx/pins.c | 2 +- .../peripherals/stm32f4/stm32f412zx/pins.h | 7 +- .../peripherals/stm32h7/stm32h743xx/clocks.c | 162 ++++ .../peripherals/stm32h7/stm32h743xx/gpio.c | 48 ++ .../peripherals/stm32h7/stm32h743xx/periph.c | 260 ++++++ .../peripherals/stm32h7/stm32h743xx/periph.h | 55 ++ .../peripherals/stm32h7/stm32h743xx/pins.c | 210 +++++ .../peripherals/stm32h7/stm32h743xx/pins.h | 199 +++++ ports/stm/supervisor/port.c | 43 +- ports/stm/supervisor/usb.c | 17 +- ports/stm/system_stm32h7xx.c | 425 ++++++++++ ports/stm/tick.c | 2 - ports/stm/tick.h | 6 +- ports/stm/tools/parse_af_csv.py | 137 ++++ 95 files changed, 4670 insertions(+), 1296 deletions(-) create mode 100644 ports/stm/boards/STM32H743ZITx_FLASH.ld create mode 100644 ports/stm/boards/STM32H743_fs.ld create mode 100644 ports/stm/boards/startup_stm32h743xx.s create mode 100644 ports/stm/boards/stm32h743zi_discovery/board.c create mode 100644 ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h create mode 100644 ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32h743zi_discovery/pins.c create mode 100644 ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h create mode 100644 ports/stm/packages/LQFP100_f4.c rename ports/stm/packages/{stm32f4/LQFP100.h => LQFP100_x7.c} (87%) create mode 100644 ports/stm/packages/LQFP144.c create mode 100644 ports/stm/packages/LQFP64.c create mode 100644 ports/stm/packages/UFQFPN48.c rename ports/stm/peripherals/{stm32f4 => }/clocks.h (91%) rename ports/stm/peripherals/{stm32f4 => }/gpio.h (87%) create mode 100644 ports/stm/peripherals/periph.h rename ports/stm/peripherals/{stm32f4 => }/pins.h (82%) delete mode 100644 ports/stm/peripherals/stm32f4/periph.h create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/periph.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/periph.h create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/pins.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/pins.h create mode 100644 ports/stm/system_stm32h7xx.c create mode 100644 ports/stm/tools/parse_af_csv.py diff --git a/ports/stm/Makefile b/ports/stm/Makefile index f8c05fd802..2eedcca113 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -22,7 +22,6 @@ # 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. -# DEBUG = 1 # Select the board to build for. ifeq ($(BOARD),) @@ -58,21 +57,23 @@ include $(TOP)/py/circuitpy_defns.mk CROSS_COMPILE = arm-none-eabi- -####################################### -# CFLAGS -####################################### +MCU_SERIES_LOWER = $(shell echo $(MCU_SERIES) | tr '[:upper:]' '[:lower:]') +MCU_VARIANT_LOWER = $(shell echo $(MCU_VARIANT) | tr '[:upper:]' '[:lower:]') + +HAL_DIR=st_driver/STM32$(MCU_SERIES)xx_HAL_Driver INC += -I. INC += -I../.. INC += -I$(BUILD) INC += -I$(BUILD)/genhdr -INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc -INC += -I./st_driver/STM32F4xx_HAL_Driver/Inc/Legacy -INC += -I./st_driver/CMSIS/Device/ST/STM32F4xx/Include +INC += -I./$(HAL_DIR)/Inc +INC += -I./$(HAL_DIR)/Inc/Legacy +INC += -I./st_driver/CMSIS/Device/ST/STM32$(MCU_SERIES)xx/Include INC += -I./st_driver/CMSIS/Include INC += -I./boards INC += -I./boards/$(BOARD) INC += -I./peripherals +INC += -I./packages INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb @@ -87,11 +88,11 @@ else CFLAGS += -Os -DNDEBUG CFLAGS += -ggdb # TODO: Test with -flto - ### CFLAGS += -flto + # CFLAGS += -flto endif - -C_DEFS = -DMCU_PACKAGE=$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(CMSIS_MCU) +# MCU Series is defined by the HAL package and doesn't need to be specified here +C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) @@ -102,17 +103,24 @@ CFLAGS += -Wno-undef # STM32 might do casts that increase alignment requirements. CFLAGS += -Wno-cast-align -CFLAGS += \ - -mthumb \ - -mabi=aapcs-linux \ - -mfloat-abi=hard \ - -mcpu=cortex-m4 \ - -mfpu=fpv4-sp-d16 +CFLAGS += -mthumb -mabi=aapcs-linux -# TODO: check this -CFLAGS += -D__START=main +# Arm core selection +MCU_FLAGS_F4 = -mtune=cortex-m4 -mcpu=cortex-m4 +MCU_FLAGS_F7 = -mtune=cortex-m7 -mcpu=cortex-m7 +MCU_FLAGS_H7 = -mtune=cortex-m7 -mcpu=cortex-m7 +CFLAGS += $(MCU_FLAGS_$(MCU_SERIES)) -#need both command and valid file to use uf2 bootloader +CFLAGS += -DSTM32_HAL_H='' + +# Floating point settings +ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) +CFLAGS += -mfpu=fpv5-d16 -mfloat-abi=hard +else +CFLAGS += -mfpu=fpv4-sp-d16 -mfloat-abi=hard +endif + +# Need both command and valid file to use uf2 bootloader ifndef LD_FILE ifneq ($(and $(UF2_BOOTLOADER),$(LD_BOOT)),) LD_FILE = $(LD_BOOT) @@ -131,7 +139,7 @@ endif LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc -LDFLAGS += -mthumb -mcpu=cortex-m4 +LDFLAGS += -mthumb $(MCU_FLAGS_$(MCU_SERIES)) # Use toolchain libm if we're not using our own. ifndef INTERNAL_LIBM @@ -139,55 +147,52 @@ LIBS += -lm endif # TinyUSB defines -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32$(MCU_SERIES) -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 +SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ + hal_adc.c \ + hal_adc_ex.c \ + hal_dac.c \ + hal_dac_ex.c \ + hal_i2c.c \ + hal_i2c_ex.c \ + hal_qspi.c \ + hal_rng.c \ + hal_rtc.c \ + hal_rtc_ex.c \ + hal_spi.c \ + hal_tim.c \ + hal_tim_ex.c \ + hal_uart.c \ + hal_usart.c \ + hal_rcc.c \ + hal_rcc_ex.c \ + hal_flash.c \ + hal_flash_ex.c \ + hal_gpio.c \ + hal_dma_ex.c \ + hal_dma.c \ + hal_pwr.c \ + hal_pwr_ex.c \ + hal_cortex.c \ + hal.c \ + hal_exti.c \ + hal_sd.c \ + ll_gpio.c \ + ll_adc.c \ + ll_i2c.c \ + ll_dma.c \ + ll_sdmmc.c \ + ll_usart.c \ + ll_rcc.c \ + ll_utils.c \ + ll_exti.c \ + ) +#removed: +# hal_flash_ramfunc.c \ +# ll_fsmc.c \ -###################################### -# source -###################################### - -SRC_STM32 = \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_gpio.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_i2c.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usart.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_rcc.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ - st_driver/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ - system_stm32f4xx.c - +SRC_STM32 += system_stm32$(MCU_SERIES_LOWER)xx.c SRC_C += \ background.c \ @@ -196,10 +201,11 @@ SRC_C += \ tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/pins.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/clocks.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/gpio.c \ - peripherals/stm32f4/$(MCU_SUB_VARIANT)/periph.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/clocks.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/gpio.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/periph.c \ + packages/$(MCU_PACKAGE).c\ lib/libc/string0.c \ lib/mp-readline/readline.c \ lib/oofatfs/ff.c \ @@ -219,7 +225,7 @@ endif SRC_S = \ supervisor/cpu.s \ - boards/startup_$(MCU_SUB_VARIANT).s + boards/startup_$(MCU_VARIANT_LOWER).s SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ diff --git a/ports/stm/README.md b/ports/stm/README.md index a860c01ce4..f2e3e9b67b 100644 --- a/ports/stm/README.md +++ b/ports/stm/README.md @@ -1,3 +1,3 @@ -# CircuitPython Port To The ST Microelectronics STM32F4 Series +# CircuitPython Port To The ST Microelectronics STM32 Series -This is a port of CircuitPython to the STM32F4 series of chips. +This is a port of CircuitPython to the STM32 series of chips. diff --git a/ports/stm/background.h b/ports/stm/background.h index 05a4f894a6..6225429f89 100644 --- a/ports/stm/background.h +++ b/ports/stm/background.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_BACKGROUND_H -#define MICROPY_INCLUDED_STM32F4_BACKGROUND_H +#ifndef MICROPY_INCLUDED_STM32_BACKGROUND_H +#define MICROPY_INCLUDED_STM32_BACKGROUND_H #include void background_tasks_reset(void); void run_background_tasks(void); -#endif // MICROPY_INCLUDED_STM32F4_BACKGROUND_H +#endif // MICROPY_INCLUDED_STM32_BACKGROUND_H diff --git a/ports/stm/boards/STM32H743ZITx_FLASH.ld b/ports/stm/boards/STM32H743ZITx_FLASH.ld new file mode 100644 index 0000000000..38b1fe4eaa --- /dev/null +++ b/ports/stm/boards/STM32H743ZITx_FLASH.ld @@ -0,0 +1,193 @@ +/* +****************************************************************************** +** + +** File : LinkerScript.ld +** +** Author : Auto-generated by System Workbench for STM32 +** +** Abstract : Linker script for STM32H743ZITx series +** 2048Kbytes FLASH and 1056Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 STMicroelectronics

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K +RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K +RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K +ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >DTCMRAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >DTCMRAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >DTCMRAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld new file mode 100644 index 0000000000..395a074d32 --- /dev/null +++ b/ports/stm/boards/STM32H743_fs.ld @@ -0,0 +1,164 @@ +/* +****************************************************************************** +** + +** File : LinkerScript.ld +** +** Author : Auto-generated by System Workbench for STM32 +** +** Abstract : Linker script for STM32H743ZITx series +** 2048Kbytes FLASH and 1056Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 STMicroelectronics

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ + FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ + FLASH_TEXT (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* Used for storage cache */ + RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 151ca1437a..01264d512b 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -5,12 +5,10 @@ USB_MANUFACTURER = "Espruino" USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f401xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F401xE +MCU_SERIES = F4 +MCU_VARIANT = STM32F401xE +MCU_PACKAGE = UFQFPN48 + LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index 8b28cf07c7..b4b3944439 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -5,12 +5,10 @@ USB_MANUFACTURER = "Espruino" USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE +MCU_PACKAGE = UFQFPN48 + LD_FILE = boards/STM32F411VETx_FLASH.ld diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 312ca6b480..351adf1b8c 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -7,15 +7,11 @@ USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C -LONGINT_IMPL = MPZ -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx +MCU_SERIES = F4 +MCU_VARIANT = STM32F405xx +MCU_PACKAGE = LQFP64 -# Default includes filesystem, but uses external flash LD_DEFAULT = boards/STM32F405_default.ld LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option UF2_OFFSET = 0x8010000 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 16268ba119..0a725d75ba 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -7,18 +7,14 @@ USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = W25Q16JV_IQ -LONGINT_IMPL = MPZ +# INTERNAL_FLASH_FILESYSTEM = 1 BOOTLOADER_OFFSET = 0x8010000 -# INTERNAL_FLASH_FILESYSTEM = 1 -# LONGINT_IMPL = NONE +MCU_SERIES = F4 +MCU_VARIANT = STM32F401xE +MCU_PACKAGE = LQFP64 -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f401xe -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F401xE LD_FILE = boards/STM32F401xe_boot.ld # LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index a8472608b7..e9f1d0369e 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -7,12 +7,10 @@ USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = W25Q64JV_IQ -LONGINT_IMPL = MPZ -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE +MCU_PACKAGE = UFQFPN48 + LD_FILE = boards/STM32F411VETx_FLASH.ld diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index ef1b8f0ca1..ab2ce86a98 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -5,12 +5,10 @@ USB_MANUFACTURER = "George Robotic" USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx +MCU_SERIES = F4 +MCU_VARIANT = STM32F405xx +MCU_PACKAGE = LQFP64 + LD_FILE = boards/STM32F405_fs.ld diff --git a/ports/stm/boards/startup_stm32h743xx.s b/ports/stm/boards/startup_stm32h743xx.s new file mode 100644 index 0000000000..357f7a7bab --- /dev/null +++ b/ports/stm/boards/startup_stm32h743xx.s @@ -0,0 +1,748 @@ +/** + ****************************************************************************** + * @file startup_stm32h743xx.s + * @author MCD Application Team + * @brief STM32H743xx Devices vector table for GCC based toolchain. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m7 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + +g_pfnVectors: + .word _estack + .word Reset_Handler + + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_AVD_IRQHandler /* PVD/AVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word FDCAN1_IT0_IRQHandler /* FDCAN1 interrupt line 0 */ + .word FDCAN2_IT0_IRQHandler /* FDCAN2 interrupt line 0 */ + .word FDCAN1_IT1_IRQHandler /* FDCAN1 interrupt line 1 */ + .word FDCAN2_IT1_IRQHandler /* FDCAN2 interrupt line 1 */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_IRQHandler /* TIM1 Break interrupt */ + .word TIM1_UP_IRQHandler /* TIM1 Update interrupt */ + .word TIM1_TRG_COM_IRQHandler /* TIM1 Trigger and Commutation interrupt */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word 0 /* Reserved */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word FMC_IRQHandler /* FMC */ + .word SDMMC1_IRQHandler /* SDMMC1 */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word UART4_IRQHandler /* UART4 */ + .word UART5_IRQHandler /* UART5 */ + .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word ETH_IRQHandler /* Ethernet */ + .word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */ + .word FDCAN_CAL_IRQHandler /* FDCAN calibration unit interrupt*/ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ + .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ + .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ + .word OTG_HS_IRQHandler /* USB OTG HS */ + .word DCMI_IRQHandler /* DCMI */ + .word 0 /* Reserved */ + .word RNG_IRQHandler /* Rng */ + .word FPU_IRQHandler /* FPU */ + .word UART7_IRQHandler /* UART7 */ + .word UART8_IRQHandler /* UART8 */ + .word SPI4_IRQHandler /* SPI4 */ + .word SPI5_IRQHandler /* SPI5 */ + .word SPI6_IRQHandler /* SPI6 */ + .word SAI1_IRQHandler /* SAI1 */ + .word LTDC_IRQHandler /* LTDC */ + .word LTDC_ER_IRQHandler /* LTDC error */ + .word DMA2D_IRQHandler /* DMA2D */ + .word SAI2_IRQHandler /* SAI2 */ + .word QUADSPI_IRQHandler /* QUADSPI */ + .word LPTIM1_IRQHandler /* LPTIM1 */ + .word CEC_IRQHandler /* HDMI_CEC */ + .word I2C4_EV_IRQHandler /* I2C4 Event */ + .word I2C4_ER_IRQHandler /* I2C4 Error */ + .word SPDIF_RX_IRQHandler /* SPDIF_RX */ + .word OTG_FS_EP1_OUT_IRQHandler /* USB OTG FS End Point 1 Out */ + .word OTG_FS_EP1_IN_IRQHandler /* USB OTG FS End Point 1 In */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMAMUX1_OVR_IRQHandler /* DMAMUX1 Overrun interrupt */ + .word HRTIM1_Master_IRQHandler /* HRTIM Master Timer global Interrupt */ + .word HRTIM1_TIMA_IRQHandler /* HRTIM Timer A global Interrupt */ + .word HRTIM1_TIMB_IRQHandler /* HRTIM Timer B global Interrupt */ + .word HRTIM1_TIMC_IRQHandler /* HRTIM Timer C global Interrupt */ + .word HRTIM1_TIMD_IRQHandler /* HRTIM Timer D global Interrupt */ + .word HRTIM1_TIME_IRQHandler /* HRTIM Timer E global Interrupt */ + .word HRTIM1_FLT_IRQHandler /* HRTIM Fault global Interrupt */ + .word DFSDM1_FLT0_IRQHandler /* DFSDM Filter0 Interrupt */ + .word DFSDM1_FLT1_IRQHandler /* DFSDM Filter1 Interrupt */ + .word DFSDM1_FLT2_IRQHandler /* DFSDM Filter2 Interrupt */ + .word DFSDM1_FLT3_IRQHandler /* DFSDM Filter3 Interrupt */ + .word SAI3_IRQHandler /* SAI3 global Interrupt */ + .word SWPMI1_IRQHandler /* Serial Wire Interface 1 global interrupt */ + .word TIM15_IRQHandler /* TIM15 global Interrupt */ + .word TIM16_IRQHandler /* TIM16 global Interrupt */ + .word TIM17_IRQHandler /* TIM17 global Interrupt */ + .word MDIOS_WKUP_IRQHandler /* MDIOS Wakeup Interrupt */ + .word MDIOS_IRQHandler /* MDIOS global Interrupt */ + .word JPEG_IRQHandler /* JPEG global Interrupt */ + .word MDMA_IRQHandler /* MDMA global Interrupt */ + .word 0 /* Reserved */ + .word SDMMC2_IRQHandler /* SDMMC2 global Interrupt */ + .word HSEM1_IRQHandler /* HSEM1 global Interrupt */ + .word 0 /* Reserved */ + .word ADC3_IRQHandler /* ADC3 global Interrupt */ + .word DMAMUX2_OVR_IRQHandler /* DMAMUX Overrun interrupt */ + .word BDMA_Channel0_IRQHandler /* BDMA Channel 0 global Interrupt */ + .word BDMA_Channel1_IRQHandler /* BDMA Channel 1 global Interrupt */ + .word BDMA_Channel2_IRQHandler /* BDMA Channel 2 global Interrupt */ + .word BDMA_Channel3_IRQHandler /* BDMA Channel 3 global Interrupt */ + .word BDMA_Channel4_IRQHandler /* BDMA Channel 4 global Interrupt */ + .word BDMA_Channel5_IRQHandler /* BDMA Channel 5 global Interrupt */ + .word BDMA_Channel6_IRQHandler /* BDMA Channel 6 global Interrupt */ + .word BDMA_Channel7_IRQHandler /* BDMA Channel 7 global Interrupt */ + .word COMP1_IRQHandler /* COMP1 global Interrupt */ + .word LPTIM2_IRQHandler /* LP TIM2 global interrupt */ + .word LPTIM3_IRQHandler /* LP TIM3 global interrupt */ + .word LPTIM4_IRQHandler /* LP TIM4 global interrupt */ + .word LPTIM5_IRQHandler /* LP TIM5 global interrupt */ + .word LPUART1_IRQHandler /* LP UART1 interrupt */ + .word 0 /* Reserved */ + .word CRS_IRQHandler /* Clock Recovery Global Interrupt */ + .word ECC_IRQHandler /* ECC diagnostic Global Interrupt */ + .word SAI4_IRQHandler /* SAI4 global interrupt */ + .word 0 /* Reserved */ + .word 0 /* Reserved */ + .word WAKEUP_PIN_IRQHandler /* Interrupt for all 6 wake-up pins */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_AVD_IRQHandler + .thumb_set PVD_AVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak FDCAN1_IT0_IRQHandler + .thumb_set FDCAN1_IT0_IRQHandler,Default_Handler + + .weak FDCAN2_IT0_IRQHandler + .thumb_set FDCAN2_IT0_IRQHandler,Default_Handler + + .weak FDCAN1_IT1_IRQHandler + .thumb_set FDCAN1_IT1_IRQHandler,Default_Handler + + .weak FDCAN2_IT1_IRQHandler + .thumb_set FDCAN2_IT1_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_IRQHandler + .thumb_set TIM1_BRK_IRQHandler,Default_Handler + + .weak TIM1_UP_IRQHandler + .thumb_set TIM1_UP_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_IRQHandler + .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak FMC_IRQHandler + .thumb_set FMC_IRQHandler,Default_Handler + + .weak SDMMC1_IRQHandler + .thumb_set SDMMC1_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak UART4_IRQHandler + .thumb_set UART4_IRQHandler,Default_Handler + + .weak UART5_IRQHandler + .thumb_set UART5_IRQHandler,Default_Handler + + .weak TIM6_DAC_IRQHandler + .thumb_set TIM6_DAC_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak ETH_IRQHandler + .thumb_set ETH_IRQHandler,Default_Handler + + .weak ETH_WKUP_IRQHandler + .thumb_set ETH_WKUP_IRQHandler,Default_Handler + + .weak FDCAN_CAL_IRQHandler + .thumb_set FDCAN_CAL_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_OUT_IRQHandler + .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_IN_IRQHandler + .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler + + .weak OTG_HS_WKUP_IRQHandler + .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler + + .weak OTG_HS_IRQHandler + .thumb_set OTG_HS_IRQHandler,Default_Handler + + .weak DCMI_IRQHandler + .thumb_set DCMI_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak UART7_IRQHandler + .thumb_set UART7_IRQHandler,Default_Handler + + .weak UART8_IRQHandler + .thumb_set UART8_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + + .weak SPI5_IRQHandler + .thumb_set SPI5_IRQHandler,Default_Handler + + .weak SPI6_IRQHandler + .thumb_set SPI6_IRQHandler,Default_Handler + + .weak SAI1_IRQHandler + .thumb_set SAI1_IRQHandler,Default_Handler + + .weak LTDC_IRQHandler + .thumb_set LTDC_IRQHandler,Default_Handler + + .weak LTDC_ER_IRQHandler + .thumb_set LTDC_ER_IRQHandler,Default_Handler + + .weak DMA2D_IRQHandler + .thumb_set DMA2D_IRQHandler,Default_Handler + + .weak SAI2_IRQHandler + .thumb_set SAI2_IRQHandler,Default_Handler + + .weak QUADSPI_IRQHandler + .thumb_set QUADSPI_IRQHandler,Default_Handler + + .weak LPTIM1_IRQHandler + .thumb_set LPTIM1_IRQHandler,Default_Handler + + .weak CEC_IRQHandler + .thumb_set CEC_IRQHandler,Default_Handler + + .weak I2C4_EV_IRQHandler + .thumb_set I2C4_EV_IRQHandler,Default_Handler + + .weak I2C4_ER_IRQHandler + .thumb_set I2C4_ER_IRQHandler,Default_Handler + + .weak SPDIF_RX_IRQHandler + .thumb_set SPDIF_RX_IRQHandler,Default_Handler + + .weak OTG_FS_EP1_OUT_IRQHandler + .thumb_set OTG_FS_EP1_OUT_IRQHandler,Default_Handler + + .weak OTG_FS_EP1_IN_IRQHandler + .thumb_set OTG_FS_EP1_IN_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMAMUX1_OVR_IRQHandler + .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler + + .weak HRTIM1_Master_IRQHandler + .thumb_set HRTIM1_Master_IRQHandler,Default_Handler + + .weak HRTIM1_TIMA_IRQHandler + .thumb_set HRTIM1_TIMA_IRQHandler,Default_Handler + + .weak HRTIM1_TIMB_IRQHandler + .thumb_set HRTIM1_TIMB_IRQHandler,Default_Handler + + .weak HRTIM1_TIMC_IRQHandler + .thumb_set HRTIM1_TIMC_IRQHandler,Default_Handler + + .weak HRTIM1_TIMD_IRQHandler + .thumb_set HRTIM1_TIMD_IRQHandler,Default_Handler + + .weak HRTIM1_TIME_IRQHandler + .thumb_set HRTIM1_TIME_IRQHandler,Default_Handler + + .weak HRTIM1_FLT_IRQHandler + .thumb_set HRTIM1_FLT_IRQHandler,Default_Handler + + .weak DFSDM1_FLT0_IRQHandler + .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler + + .weak DFSDM1_FLT1_IRQHandler + .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler + + .weak DFSDM1_FLT2_IRQHandler + .thumb_set DFSDM1_FLT2_IRQHandler,Default_Handler + + .weak DFSDM1_FLT3_IRQHandler + .thumb_set DFSDM1_FLT3_IRQHandler,Default_Handler + + .weak SAI3_IRQHandler + .thumb_set SAI3_IRQHandler,Default_Handler + + .weak SWPMI1_IRQHandler + .thumb_set SWPMI1_IRQHandler,Default_Handler + + .weak TIM15_IRQHandler + .thumb_set TIM15_IRQHandler,Default_Handler + + .weak TIM16_IRQHandler + .thumb_set TIM16_IRQHandler,Default_Handler + + .weak TIM17_IRQHandler + .thumb_set TIM17_IRQHandler,Default_Handler + + .weak MDIOS_WKUP_IRQHandler + .thumb_set MDIOS_WKUP_IRQHandler,Default_Handler + + .weak MDIOS_IRQHandler + .thumb_set MDIOS_IRQHandler,Default_Handler + + .weak JPEG_IRQHandler + .thumb_set JPEG_IRQHandler,Default_Handler + + .weak MDMA_IRQHandler + .thumb_set MDMA_IRQHandler,Default_Handler + + .weak SDMMC2_IRQHandler + .thumb_set SDMMC2_IRQHandler,Default_Handler + + .weak HSEM1_IRQHandler + .thumb_set HSEM1_IRQHandler,Default_Handler + + .weak ADC3_IRQHandler + .thumb_set ADC3_IRQHandler,Default_Handler + + .weak DMAMUX2_OVR_IRQHandler + .thumb_set DMAMUX2_OVR_IRQHandler,Default_Handler + + .weak BDMA_Channel0_IRQHandler + .thumb_set BDMA_Channel0_IRQHandler,Default_Handler + + .weak BDMA_Channel1_IRQHandler + .thumb_set BDMA_Channel1_IRQHandler,Default_Handler + + .weak BDMA_Channel2_IRQHandler + .thumb_set BDMA_Channel2_IRQHandler,Default_Handler + + .weak BDMA_Channel3_IRQHandler + .thumb_set BDMA_Channel3_IRQHandler,Default_Handler + + .weak BDMA_Channel4_IRQHandler + .thumb_set BDMA_Channel4_IRQHandler,Default_Handler + + .weak BDMA_Channel5_IRQHandler + .thumb_set BDMA_Channel5_IRQHandler,Default_Handler + + .weak BDMA_Channel6_IRQHandler + .thumb_set BDMA_Channel6_IRQHandler,Default_Handler + + .weak BDMA_Channel7_IRQHandler + .thumb_set BDMA_Channel7_IRQHandler,Default_Handler + + .weak COMP1_IRQHandler + .thumb_set COMP1_IRQHandler,Default_Handler + + .weak LPTIM2_IRQHandler + .thumb_set LPTIM2_IRQHandler,Default_Handler + + .weak LPTIM3_IRQHandler + .thumb_set LPTIM3_IRQHandler,Default_Handler + + .weak LPTIM4_IRQHandler + .thumb_set LPTIM4_IRQHandler,Default_Handler + + .weak LPTIM5_IRQHandler + .thumb_set LPTIM5_IRQHandler,Default_Handler + + .weak LPUART1_IRQHandler + .thumb_set LPUART1_IRQHandler,Default_Handler + + .weak CRS_IRQHandler + .thumb_set CRS_IRQHandler,Default_Handler + + .weak ECC_IRQHandler + .thumb_set ECC_IRQHandler,Default_Handler + + .weak SAI4_IRQHandler + .thumb_set SAI4_IRQHandler,Default_Handler + + .weak WAKEUP_PIN_IRQHandler + .thumb_set WAKEUP_PIN_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 68c6a1eeaa..bf2dd55965 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -10,12 +10,10 @@ USB_DEVICES = "CDC,MSC" # LONGINT_IMPL = MPZ INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE +MCU_PACKAGE = UFQFPN48 + LD_FILE = boards/STM32F411VETx_FLASH.ld diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index 64e2b4dc53..da24fe3f0a 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -5,12 +5,10 @@ USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 100 -CMSIS_MCU = STM32F411xE +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE +MCU_PACKAGE = LQFP100_f4 + LD_FILE = boards/STM32F411VETx_FLASH.ld diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index b0205fc733..d227803de7 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -5,18 +5,16 @@ USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE # QSPI_FLASH_FILESYSTEM = 1 # EXTERNAL_FLASH_DEVICE_COUNT = 1 # EXTERNAL_FLASH_DEVICES = N25Q128A # LONGINT_IMPL = MPZ -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f412zx -MCU_PACKAGE = 144 -CMSIS_MCU = STM32F412Zx +MCU_SERIES = F4 +MCU_VARIANT = STM32F412Zx +MCU_PACKAGE = LQFP144 + LD_FILE = boards/STM32F412ZGTx_FLASH.ld diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 312a20f65a..c8c424c0c4 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -5,14 +5,10 @@ USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE -# This is technically a F407 but there's no difference -# other than the camera and ethernet, which aren't supported. -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f407xx -MCU_PACKAGE = 100 -CMSIS_MCU = STM32F407xx +MCU_SERIES = F4 +MCU_VARIANT = STM32F407xx +MCU_PACKAGE = LQFP100_f4 + LD_FILE = boards/STM32F407_fs.ld diff --git a/ports/stm/boards/stm32h743zi_discovery/board.c b/ports/stm/boards/stm32h743zi_discovery/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/stm32h743zi_discovery/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h b/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h new file mode 100644 index 0000000000..6a62ff512a --- /dev/null +++ b/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "STM32H743_DISCO" +#define MICROPY_HW_MCU_NAME "STM32H743" + +// #define FLASH_SIZE (0x200000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk b/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk new file mode 100644 index 0000000000..d2f8905368 --- /dev/null +++ b/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A #REPLACE +USB_PID = 0x808A #REPLACE +USB_PRODUCT = "STM32H743ZI Discovery Board - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,HID" + +DISABLE_FILESYSTEM = 1 + +MCU_SERIES = H7 +MCU_VARIANT = STM32H743xx +MCU_PACKAGE = LQFP144 + +LD_FILE = boards/STM32H743_fs.ld + diff --git a/ports/stm/boards/stm32h743zi_discovery/pins.c b/ports/stm/boards/stm32h743zi_discovery/pins.c new file mode 100644 index 0000000000..eceea93820 --- /dev/null +++ b/ports/stm/boards/stm32h743zi_discovery/pins.c @@ -0,0 +1,135 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF10) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PF05) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG14) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_PG06) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_PG03) }, + { MP_ROM_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_D55), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_D56), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_D57), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_D58), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_D59), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_D60), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_D61), MP_ROM_PTR(&pin_PF08) }, + { MP_ROM_QSTR(MP_QSTR_D62), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_D63), MP_ROM_PTR(&pin_PF09) }, + { MP_ROM_QSTR(MP_QSTR_D64), MP_ROM_PTR(&pin_PG01) }, + { MP_ROM_QSTR(MP_QSTR_D65), MP_ROM_PTR(&pin_PG00) }, + { MP_ROM_QSTR(MP_QSTR_D66), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_D67), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_D68), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_D69), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_D70), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_D71), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_D72), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_I2C1_SCL), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PF14) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_SD_D0), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_SD_D1), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_SD_D2), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_SD_D3), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_SD_CK), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PG06) }, + { MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PG07) }, + { MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_UART5_TX), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_UART5_RX), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_UART6_TX), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_UART6_RX), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_UART7_TX), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_UART7_RX), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_UART8_TX), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_UART8_RX), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_ETH_MDC), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_ETH_MDIO), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_REF_CLK), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_CRS_DV), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD0), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD1), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TX_EN), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD0), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD1), MP_ROM_PTR(&pin_PB13) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h b/ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h new file mode 100644 index 0000000000..e6a2dd5f80 --- /dev/null +++ b/ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h @@ -0,0 +1,493 @@ +/** + ****************************************************************************** + * @file stm32h7xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32H7xx_HAL_CONF_H +#define __STM32H7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + + #define HAL_ADC_MODULE_ENABLED +/* #define HAL_FDCAN_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_COMP_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_OTFDEC_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_HRTIM_MODULE_ENABLED */ +/* #define HAL_HSEM_MODULE_ENABLED */ +/* #define HAL_GFXMMU_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_OPAMP_MODULE_ENABLED */ +/* #define HAL_OSPI_MODULE_ENABLED */ +/* #define HAL_OSPI_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +/* #define HAL_SWPMI_MODULE_ENABLED */ +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_MDIOS_MODULE_ENABLED */ +/* #define HAL_PSSI_MODULE_ENABLED */ +/* #define HAL_DTS_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal oscillator (CSI) default value. + * This value is the default CSI value after Reset. + */ +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################### Ethernet Configuration ######################### */ +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ + +#define ETH_MAC_ADDR0 ((uint8_t)0x02) +#define ETH_MAC_ADDR1 ((uint8_t)0x00) +#define ETH_MAC_ADDR2 ((uint8_t)0x00) +#define ETH_MAC_ADDR3 ((uint8_t)0x00) +#define ETH_MAC_ADDR4 ((uint8_t)0x00) +#define ETH_MAC_ADDR5 ((uint8_t)0x00) + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32h7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32h7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32h7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_MDMA_MODULE_ENABLED + #include "stm32h7xx_hal_mdma.h" +#endif /* HAL_MDMA_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32h7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32h7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32h7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32h7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32h7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32h7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32h7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32h7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32h7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED + #include "stm32h7xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32h7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32h7xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32h7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32h7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32h7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32h7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32h7xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32h7xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32h7xx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32h7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32h7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32h7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32h7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32h7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32h7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32h7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32h7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32h7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32h7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32h7xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32h7xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_OTFDEC_MODULE_ENABLED +#include "stm32h7xx_hal_otfdec.h" +#endif /* HAL_OTFDEC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32h7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32h7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RAMECC_MODULE_ENABLED + #include "stm32h7xx_hal_ramecc.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32h7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32h7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32h7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32h7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32h7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32h7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32h7xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32h7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32h7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32h7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32h7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32h7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32h7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32h7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32h7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32h7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32h7xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_DTS_MODULE_ENABLED + #include "stm32h7xx_hal_dts.h" +#endif /* HAL_DTS_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32H7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/analogio/AnalogOut.h b/ports/stm/common-hal/analogio/AnalogOut.h index 61591d0e65..46312b4609 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.h +++ b/ports/stm/common-hal/analogio/AnalogOut.h @@ -32,7 +32,7 @@ #include "py/obj.h" #include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" +#include "peripherals/periph.h" typedef struct { mp_obj_base_t base; diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 8e98b966d2..4daefb58bc 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -29,7 +29,6 @@ #include "shared-bindings/busio/I2C.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "stm32f4xx_hal.h" #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" @@ -69,9 +68,9 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (mcu_i2c_sda_list[i].pin == sda) { for (uint j = 0; j < scl_len; j++) { if ((mcu_i2c_scl_list[j].pin == scl) - && (mcu_i2c_scl_list[j].i2c_index == mcu_i2c_sda_list[i].i2c_index)) { + && (mcu_i2c_scl_list[j].periph_index == mcu_i2c_sda_list[i].periph_index)) { //keep looking if the I2C is taken, could be another SCL that works - if (reserved_i2c[mcu_i2c_scl_list[i].i2c_index - 1]) { + if (reserved_i2c[mcu_i2c_scl_list[i].periph_index - 1]) { i2c_taken = true; continue; } @@ -85,7 +84,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, //handle typedef selection, errors if (self->sda != NULL && self->scl != NULL ) { - I2Cx = mcu_i2c_banks[self->sda->i2c_index - 1]; + I2Cx = mcu_i2c_banks[self->sda->periph_index - 1]; } else { if (i2c_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); @@ -111,8 +110,8 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); //Note: due to I2C soft reboot issue, do not relocate clock init. - i2c_clock_enable(1 << (self->sda->i2c_index - 1)); - reserved_i2c[self->sda->i2c_index - 1] = true; + i2c_clock_enable(1 << (self->sda->periph_index - 1)); + reserved_i2c[self->sda->periph_index - 1] = true; self->handle.Instance = I2Cx; self->handle.Init.ClockSpeed = 100000; @@ -152,9 +151,9 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { return; } - i2c_clock_disable(1 << (self->sda->i2c_index - 1)); - reserved_i2c[self->sda->i2c_index - 1] = false; - never_reset_i2c[self->sda->i2c_index - 1] = false; + i2c_clock_disable(1 << (self->sda->periph_index - 1)); + reserved_i2c[self->sda->periph_index - 1] = false; + never_reset_i2c[self->sda->periph_index - 1] = false; reset_pin_number(self->sda->pin->port,self->sda->pin->number); reset_pin_number(self->scl->pin->port,self->scl->pin->number); diff --git a/ports/stm/common-hal/busio/I2C.h b/ports/stm/common-hal/busio/I2C.h index b5c891a98d..5ca2854eb8 100644 --- a/ports/stm/common-hal/busio/I2C.h +++ b/ports/stm/common-hal/busio/I2C.h @@ -25,13 +25,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_I2C_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_I2C_H #include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" +#include "peripherals/periph.h" #include "py/obj.h" @@ -39,10 +38,10 @@ typedef struct { mp_obj_base_t base; I2C_HandleTypeDef handle; bool has_lock; - const mcu_i2c_scl_obj_t *scl; - const mcu_i2c_sda_obj_t *sda; + const mcu_periph_obj_t *scl; + const mcu_periph_obj_t *sda; } busio_i2c_obj_t; void i2c_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_I2C_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/stm/common-hal/busio/OneWire.h b/ports/stm/common-hal/busio/OneWire.h index 6e8c829793..0099593f03 100644 --- a/ports/stm/common-hal/busio/OneWire.h +++ b/ports/stm/common-hal/busio/OneWire.h @@ -24,10 +24,10 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_ONEWIRE_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_ONEWIRE_H // Use bitbangio. #include "shared-module/busio/OneWire.h" -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_ONEWIRE_H +#endif // MICROPY_INCLUDED_STM32F_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 7e25e0a571..cf00155609 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -29,7 +29,6 @@ #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "stm32f4xx_hal.h" #include "shared-bindings/microcontroller/__init__.h" #include "boards/board.h" @@ -120,10 +119,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, //MISO for (uint k = 0; k < miso_len; k++) { if ((mcu_spi_miso_list[k].pin == miso) //everything needs the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index) - && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[k].spi_index)) { + && (mcu_spi_sck_list[i].periph_index == mcu_spi_mosi_list[j].periph_index) + && (mcu_spi_sck_list[i].periph_index == mcu_spi_miso_list[k].periph_index)) { //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { spi_taken = true; continue; } @@ -140,9 +139,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } else if (miso != NULL) { for (uint j = 0; j < miso_len; j++) { if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_miso_list[j].spi_index)) { + && (mcu_spi_sck_list[i].periph_index == mcu_spi_miso_list[j].periph_index)) { //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { spi_taken = true; continue; } @@ -157,9 +156,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } else if (mosi != NULL) { for (uint j = 0; j < mosi_len; j++) { if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index - && (mcu_spi_sck_list[i].spi_index == mcu_spi_mosi_list[j].spi_index)) { + && (mcu_spi_sck_list[i].periph_index == mcu_spi_mosi_list[j].periph_index)) { //keep looking if the SPI is taken, edge case - if (reserved_spi[mcu_spi_sck_list[i].spi_index - 1]) { + if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { spi_taken = true; continue; } @@ -181,7 +180,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || (self->sck != NULL && self->mosi != NULL && miso == NULL) || (self->sck != NULL && self->miso != NULL && mosi == NULL)) { - SPIx = mcu_spi_banks[self->sck->spi_index - 1]; + SPIx = mcu_spi_banks[self->sck->periph_index - 1]; } else { if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); @@ -217,8 +216,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); } - spi_clock_enable(1 << (self->sck->spi_index - 1)); - reserved_spi[self->sck->spi_index - 1] = true; + spi_clock_enable(1 << (self->sck->periph_index - 1)); + reserved_spi[self->sck->periph_index - 1] = true; self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; @@ -276,9 +275,9 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (common_hal_busio_spi_deinited(self)) { return; } - spi_clock_disable(1<<(self->sck->spi_index - 1)); - reserved_spi[self->sck->spi_index - 1] = false; - never_reset_spi[self->sck->spi_index - 1] = false; + spi_clock_disable(1<<(self->sck->periph_index - 1)); + reserved_spi[self->sck->periph_index - 1] = false; + never_reset_spi[self->sck->periph_index - 1] = false; reset_pin_number(self->sck->pin->port,self->sck->pin->number); if (self->mosi != NULL) { diff --git a/ports/stm/common-hal/busio/SPI.h b/ports/stm/common-hal/busio/SPI.h index 067d2fcb65..6483183678 100644 --- a/ports/stm/common-hal/busio/SPI.h +++ b/ports/stm/common-hal/busio/SPI.h @@ -25,13 +25,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_SPI_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_SPI_H #include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" +#include "peripherals/periph.h" #include "py/obj.h" @@ -39,10 +38,10 @@ typedef struct { mp_obj_base_t base; SPI_HandleTypeDef handle; bool has_lock; - const mcu_spi_sck_obj_t *sck; - const mcu_spi_mosi_obj_t *mosi; - const mcu_spi_miso_obj_t *miso; - const mcu_spi_nss_obj_t *nss; + const mcu_periph_obj_t *sck; + const mcu_periph_obj_t *mosi; + const mcu_periph_obj_t *miso; + const mcu_periph_obj_t *nss; uint32_t baudrate; uint16_t prescaler; uint8_t polarity; @@ -52,4 +51,4 @@ typedef struct { void spi_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_SPI_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 0b434fd023..df05a68cb4 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -36,7 +36,6 @@ #include "supervisor/shared/translate.h" #include "tick.h" -#include "stm32f4xx_hal.h" #define ALL_UARTS 0xFFFF @@ -49,11 +48,11 @@ STATIC void uart_clock_disable(uint16_t mask); STATIC void uart_assign_irq(busio_uart_obj_t* self, USART_TypeDef* USARTx); STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, - int uart_index, bool uart_taken) { + int periph_index, bool uart_taken) { if (pin_eval) { //assign a root pointer pointer for IRQ - MP_STATE_PORT(cpy_uart_obj_all)[uart_index] = self; - return mcu_uart_banks[uart_index]; + MP_STATE_PORT(cpy_uart_obj_all)[periph_index] = self; + return mcu_uart_banks[periph_index]; } else { if (uart_taken) { mp_raise_ValueError(translate("Hardware in use, try alternative pins")); @@ -84,7 +83,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t tx_len = MP_ARRAY_SIZE(mcu_uart_tx_list); uint8_t rx_len = MP_ARRAY_SIZE(mcu_uart_rx_list); bool uart_taken = false; - uint8_t uart_index = 0; //origin 0 corrected + uint8_t periph_index = 0; //origin 0 corrected if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); @@ -98,9 +97,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, //rx for (uint j = 0; j < rx_len; j++) { if (mcu_uart_rx_list[j].pin == rx - && mcu_uart_rx_list[j].uart_index == mcu_uart_tx_list[i].uart_index) { + && mcu_uart_rx_list[j].periph_index == mcu_uart_tx_list[i].periph_index) { //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { + if (reserved_uart[mcu_uart_tx_list[i].periph_index - 1]) { uart_taken = true; continue; } @@ -112,15 +111,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } } - uart_index = self->tx->uart_index - 1; + periph_index = self->tx->periph_index - 1; USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), - uart_index, uart_taken); + periph_index, uart_taken); } else if (tx == NULL) { //If there is no tx, run only rx for (uint i = 0; i < rx_len; i++) { if (mcu_uart_rx_list[i].pin == rx) { //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_rx_list[i].uart_index - 1]) { + if (reserved_uart[mcu_uart_rx_list[i].periph_index - 1]) { uart_taken = true; continue; } @@ -129,15 +128,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, break; } } - uart_index = self->rx->uart_index - 1; + periph_index = self->rx->periph_index - 1; USARTx = assign_uart_or_throw(self, (self->rx != NULL), - uart_index, uart_taken); + periph_index, uart_taken); } else if (rx == NULL) { //If there is no rx, run only tx for (uint i = 0; i < tx_len; i++) { if (mcu_uart_tx_list[i].pin == tx) { //keep looking if the UART is taken, edge case - if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { + if (reserved_uart[mcu_uart_tx_list[i].periph_index - 1]) { uart_taken = true; continue; } @@ -146,9 +145,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, break; } } - uart_index = self->tx->uart_index - 1; + periph_index = self->tx->periph_index - 1; USARTx = assign_uart_or_throw(self, (self->tx != NULL), - uart_index, uart_taken); + periph_index, uart_taken); } else { //both pins cannot be empty mp_raise_ValueError(translate("Supply at least one UART pin")); @@ -185,8 +184,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } //reserve uart and enable the peripheral - reserved_uart[uart_index] = true; - uart_clock_enable(1 << (uart_index)); + reserved_uart[periph_index] = true; + uart_clock_enable(1 << (periph_index)); uart_assign_irq(self, USARTx); self->handle.Instance = USARTx; diff --git a/ports/stm/common-hal/busio/UART.h b/ports/stm/common-hal/busio/UART.h index cde5fadd00..5ac1d352ca 100644 --- a/ports/stm/common-hal/busio/UART.h +++ b/ports/stm/common-hal/busio/UART.h @@ -24,12 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_UART_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_UART_H #include "common-hal/microcontroller/Pin.h" -#include "stm32f4/periph.h" -#include "stm32f4xx_hal.h" +#include "peripherals/periph.h" #include "py/obj.h" #include "py/ringbuf.h" @@ -45,8 +44,8 @@ typedef struct { mp_obj_base_t base; UART_HandleTypeDef handle; IRQn_Type irq; - const mcu_uart_tx_obj_t *tx; - const mcu_uart_rx_obj_t *rx; + const mcu_periph_obj_t *tx; + const mcu_periph_obj_t *rx; ringbuf_t rbuf; uint8_t rx_char; diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index be2db4dace..40e13ca3ba 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -29,8 +29,12 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "stm32f4xx_hal.h" +//TODO: rework this module to use HAL only +#ifdef STM32H743xx +#include "stm32h7xx_ll_gpio.h" +#else #include "stm32f4xx_ll_gpio.h" +#endif void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.h b/ports/stm/common-hal/digitalio/DigitalInOut.h index 76aa2c8556..e810ca3c15 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.h +++ b/ports/stm/common-hal/digitalio/DigitalInOut.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_DIGITALIO_DIGITALINOUT_H #include "common-hal/microcontroller/Pin.h" @@ -35,4 +35,4 @@ typedef struct { const mcu_pin_obj_t *pin; } digitalio_digitalinout_obj_t; -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 1d4d45b978..2c513f4aad 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -30,23 +30,22 @@ #include "supervisor/shared/rgb_led_status.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4xx_hal.h" +#include "pins.h" #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif -#if MCU_PACKAGE == 144 +#if defined(LQFP144) #define GPIO_PORT_COUNT 7 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; -#elif MCU_PACKAGE == 100 +#elif defined(LQFP100_f4) || (LQFP100_x7) #define GPIO_PORT_COUNT 5 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; -#elif MCU_PACKAGE == 64 +#elif defined(LQFP64) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; -#elif MCU_PACKAGE == 48 +#elif defined(UFQFPN48) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; #endif diff --git a/ports/stm/common-hal/microcontroller/Pin.h b/ports/stm/common-hal/microcontroller/Pin.h index c4c9be6a81..d69ddfb1de 100644 --- a/ports/stm/common-hal/microcontroller/Pin.h +++ b/ports/stm/common-hal/microcontroller/Pin.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM34F4_COMMON_HAL_MICROCONTROLLER_PIN_H -#define MICROPY_INCLUDED_STM34F4_COMMON_HAL_MICROCONTROLLER_PIN_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PIN_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PIN_H #include "py/mphal.h" -#include "peripherals/stm32f4/pins.h" +#include "peripherals/pins.h" #ifdef MICROPY_HW_NEOPIXEL extern bool neopixel_in_use; @@ -49,4 +49,4 @@ void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); GPIO_TypeDef * pin_port(uint8_t pin_port); uint16_t pin_mask(uint8_t pin_number); -#endif // MICROPY_INCLUDED_STM34F4_COMMON_HAL_MICROCONTROLLER_PIN_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/stm/common-hal/microcontroller/Processor.c b/ports/stm/common-hal/microcontroller/Processor.c index 324659cefa..c8b07db3f0 100644 --- a/ports/stm/common-hal/microcontroller/Processor.c +++ b/ports/stm/common-hal/microcontroller/Processor.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -#include "stm32f4xx_hal.h" +#if defined(STM32F4) #define STM32_UUID ((uint32_t *)0x1FFF7A10) @@ -58,7 +58,10 @@ STATIC void set_adc_params(ADC_HandleTypeDef *AdcHandle) { AdcHandle->Init.EOCSelection = ADC_EOC_SINGLE_CONV; } +#endif + float common_hal_mcu_processor_get_temperature(void) { + #if defined(STM32F4) __HAL_RCC_ADC1_CLK_ENABLE(); //HAL Implementation @@ -85,9 +88,13 @@ float common_hal_mcu_processor_get_temperature(void) { //There's no F4 specific appnote for this but it works the same as the L1 in AN3964 float core_temp_avg_slope = (*ADC_CAL2 - *ADC_CAL1) / 80.0; return (((float)value * adc_refcor - *ADC_CAL1) / core_temp_avg_slope) + 30.0f; + #else + return false; + #endif } float common_hal_mcu_processor_get_voltage(void) { + #if defined(STM32F4) __HAL_RCC_ADC1_CLK_ENABLE(); //HAL Implementation @@ -114,6 +121,9 @@ float common_hal_mcu_processor_get_voltage(void) { adc_refcor = ((float)(*VREFIN_CAL)) / ((float)value); return adc_refcor * 3.3f; + #else + return false; + #endif } uint32_t common_hal_mcu_processor_get_frequency(void) { @@ -121,7 +131,9 @@ uint32_t common_hal_mcu_processor_get_frequency(void) { } void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { + #if defined(STM32F4) for (int i=0; i<3; i++) { ((uint32_t*) raw_id)[i] = STM32_UUID[i]; } + #endif } diff --git a/ports/stm/common-hal/microcontroller/Processor.h b/ports/stm/common-hal/microcontroller/Processor.h index 311333e7de..1d22aa9650 100644 --- a/ports/stm/common-hal/microcontroller/Processor.h +++ b/ports/stm/common-hal/microcontroller/Processor.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H #define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 12 @@ -36,4 +36,4 @@ typedef struct { // Stores no state currently. } mcu_processor_obj_t; -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 0c680eb055..6f16c3ef23 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -39,8 +39,6 @@ #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" -#include "stm32f4xx_hal.h" - //tested divisor value for busy loop in us delay #define LOOP_TICKS 12 @@ -108,137 +106,3 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { .type = &mcu_processor_type, }, }; - -STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, - { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, - { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, - { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, - { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, - { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, - { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, - { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, - { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, - { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, - { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, - { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, - { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, - { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, - { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, - { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, - { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, - { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, - { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, -#endif -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, - { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, - { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, - { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, - { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, - { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, - { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_PACKAGE == 144 || defined STM32F405xx - { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, - { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, - { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, - { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, - { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, - { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, - { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, - { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, -#endif -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, - { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, - { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, - { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, - { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, - { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, - { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, - { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, - { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, - { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, - { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, - { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, - { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, -#endif -#if MCU_PACKAGE == 144 - { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, - { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, - { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, - { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, - { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, - { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, -#endif - { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, -#if MCU_PACKAGE >= 100 - { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, -#endif -}; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index 0b3153286a..1a1efef9ff 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -33,7 +33,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" +#include "peripherals/periph.h" STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, diff --git a/ports/stm/common-hal/pulseio/PWMOut.h b/ports/stm/common-hal/pulseio/PWMOut.h index 59fc04e5ff..8519735c62 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.h +++ b/ports/stm/common-hal/pulseio/PWMOut.h @@ -30,7 +30,7 @@ #include "common-hal/microcontroller/Pin.h" #include "stm32f4xx_hal.h" -#include "stm32f4/periph.h" +#include "peripherals/periph.h" #include "py/obj.h" diff --git a/ports/stm/common-hal/supervisor/Runtime.h b/ports/stm/common-hal/supervisor/Runtime.h index 9a798e0567..a357eb0c7e 100755 --- a/ports/stm/common-hal/supervisor/Runtime.h +++ b/ports/stm/common-hal/supervisor/Runtime.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H +#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_STM32_COMMON_HAL_SUPERVISOR_RUNTIME_H #include "py/obj.h" @@ -34,4 +34,4 @@ typedef struct { // Stores no state currently. } super_runtime_obj_t; -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_SUPERVISOR_RUNTIME_H +#endif // MICROPY_INCLUDED_STM32_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index 283984ea90..297c7338ed 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -25,8 +25,8 @@ * THE SOFTWARE. */ -#ifndef STM32F4_MPCONFIGPORT_H__ -#define STM32F4_MPCONFIGPORT_H__ +#ifndef STM32_MPCONFIGPORT_H__ +#define STM32_MPCONFIGPORT_H__ #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) @@ -39,7 +39,10 @@ #include "py/circuitpy_mpconfig.h" -//Board flags: +// The STM32 HAL file is included virtually everywhere: +#include STM32_HAL_H + +// Board flags: #ifndef BOARD_OVERWRITE_SWD #define BOARD_OVERWRITE_SWD (0) #endif diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 493f32c636..75cde0e388 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -12,7 +12,7 @@ USB_SERIAL_NUMBER_LENGTH = 24 # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ -#Reduced feature set for early port +# Reduced feature set for early port CIRCUITPY_MINIMAL_BUILD = 1 # The ifndef's allow overriding in mpconfigboard.mk. @@ -73,5 +73,18 @@ CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 MICROPY_PY_ULAB = 1 -#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) -#endif +ifeq ($(MCU_SERIES), H7) + CIRCUITPY_BOARD = 1 + CIRCUITPY_DIGITALIO = 1 + CIRCUITPY_ANALOGIO = 0 + CIRCUITPY_MICROCONTROLLER = 1 + CIRCUITPY_BUSIO = 0 + CIRCUITPY_PULSEIO = 0 + CIRCUITPY_OS = 0 + CIRCUITPY_STORAGE = 0 + CIRCUITPY_RANDOM = 0 + CIRCUITPY_USB_HID = 0 + CIRCUITPY_USB_MIDI = 0 + CIRCUITPY_NEOPIXEL_WRITE = 0 + CIRCUITPY_DISPLAYIO = 0 +endif diff --git a/ports/stm/mphalport.c b/ports/stm/mphalport.c index a3cf501c04..3ee56e22a9 100644 --- a/ports/stm/mphalport.c +++ b/ports/stm/mphalport.c @@ -33,7 +33,6 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/tick.h" -#include "stm32f4xx_hal.h" void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = supervisor_ticks_ms64(); diff --git a/ports/stm/mphalport.h b/ports/stm/mphalport.h index b392cb0f84..69f2c489c5 100644 --- a/ports/stm/mphalport.h +++ b/ports/stm/mphalport.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_MPHALPORT_H -#define MICROPY_INCLUDED_STM32F4_MPHALPORT_H +#ifndef MICROPY_INCLUDED_STM32_MPHALPORT_H +#define MICROPY_INCLUDED_STM32_MPHALPORT_H #include "py/obj.h" @@ -48,4 +48,4 @@ void mp_hal_set_interrupt_char(int c); void mp_hal_disable_all_interrupts(void); void mp_hal_enable_all_interrupts(void); -#endif // MICROPY_INCLUDED_STM32F4_MPHALPORT_H +#endif // MICROPY_INCLUDED_STM32_MPHALPORT_H diff --git a/ports/stm/packages/LQFP100_f4.c b/ports/stm/packages/LQFP100_f4.c new file mode 100644 index 0000000000..a2219ccc08 --- /dev/null +++ b/ports/stm/packages/LQFP100_f4.c @@ -0,0 +1,117 @@ +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Pins 1-25 + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + /* VBAT -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // PC14 OSC32_IN ----------------------------------*/ + // PC15 OSC32_OUT ---------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + // PH0 OSC_IN -------------------------------------*/ + // PH1 OSC_OUT ------------------------------------*/ + // NRST -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + // VDD --------------------------------------------*/ + // VSSA -------------------------------------------*/ + // VREF+ ------------------------------------------*/ + // VDDA -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + +// Pins 26-50 + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, +#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, +#endif //or VCAP1 -----------------------------------*/ + // VCAP1 or VSS -----------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 51-75 + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + // VCAP2 ------------------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 76-100 + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // BOOT0 ------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file diff --git a/ports/stm/packages/stm32f4/LQFP100.h b/ports/stm/packages/LQFP100_x7.c similarity index 87% rename from ports/stm/packages/stm32f4/LQFP100.h rename to ports/stm/packages/LQFP100_x7.c index 3c0e244f99..23d89a8268 100644 --- a/ports/stm/packages/stm32f4/LQFP100.h +++ b/ports/stm/packages/LQFP100_x7.c @@ -1,3 +1,7 @@ +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { // Pins 1-25 { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, @@ -25,11 +29,11 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, // Pins 26-50 // VSS --------------------------------------------*/ // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, @@ -48,11 +52,12 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, -#endif - + // VCAP1 ------------------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ +// Pins 51-75 { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, @@ -75,6 +80,11 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + // VCAP2 ------------------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 76-100 { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, @@ -93,9 +103,13 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // BOOT0 ------------------------------------------*/ { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + }; MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file diff --git a/ports/stm/packages/LQFP144.c b/ports/stm/packages/LQFP144.c new file mode 100644 index 0000000000..36683bb648 --- /dev/null +++ b/ports/stm/packages/LQFP144.c @@ -0,0 +1,159 @@ +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Pins 1-36 + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + /* VBAT -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // PC14 OSC32_IN ----------------------------------*/ + // PC15 OSC32_OUT ---------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, + { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, + { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, + // PH0 OSC_IN -------------------------------------*/ + // PH1 OSC_OUT ------------------------------------*/ + // NRST -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + // VDD --------------------------------------------*/ + // VSSA -------------------------------------------*/ + // VREF+ ------------------------------------------*/ + // VDDA -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + +// Pins 37-72 + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, + { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, + { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, + // VCAP1 ------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 73-108 + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, + { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, + { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, + { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, + { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, + { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, + // VSS --------------------------------------------*/ + // VDD or VDD_USB (F412, F446) --------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + // VCAP2 ------------------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 109-144 + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // BOOT0 ------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + // PDR_ON -----------------------------------------*/ + // VDD --------------------------------------------*/ + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file diff --git a/ports/stm/packages/LQFP64.c b/ports/stm/packages/LQFP64.c new file mode 100644 index 0000000000..02dcfa00ca --- /dev/null +++ b/ports/stm/packages/LQFP64.c @@ -0,0 +1,81 @@ +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Pins 1-16 + /* VBAT -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // PC14 OSC32_IN ----------------------------------*/ + // PC15 OSC32_OUT ---------------------------------*/ + // PH0 OSC_IN -------------------------------------*/ + // PH1 OSC_OUT ------------------------------------*/ + // NRST -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + // VSSA -------------------------------------------*/ + // VDDA -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + +// Pins 17-32 + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, +#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, +#endif //or VCAP1 -----------------------------------*/ + // VCAP1 or VSS -----------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 33-48 + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + // VSS or VCAP (F405) -----------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 49-64 + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // BOOT0 ------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/UFQFPN48.c b/ports/stm/packages/UFQFPN48.c new file mode 100644 index 0000000000..ae4bcf6cda --- /dev/null +++ b/ports/stm/packages/UFQFPN48.c @@ -0,0 +1,63 @@ +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Pins 1-12 + /* VBAT -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + // PC14 OSC32_IN ----------------------------------*/ + // PC15 OSC32_OUT ---------------------------------*/ + // PH0 OSC_IN -------------------------------------*/ + // PH1 OSC_OUT ------------------------------------*/ + // NRST -------------------------------------------*/ + // VSSA -------------------------------------------*/ + // VDDA -------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + +// Pins 13-24 + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + // VCAP1 ------------------------------------------*/ + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 25-36 + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +// Pins 37-48 + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + // BOOT0 ------------------------------------------*/ + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + // VSS --------------------------------------------*/ + // VDD --------------------------------------------*/ + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/clocks.h b/ports/stm/peripherals/clocks.h similarity index 91% rename from ports/stm/peripherals/stm32f4/clocks.h rename to ports/stm/peripherals/clocks.h index c7ba846622..1f837c79ee 100644 --- a/ports/stm/peripherals/stm32f4/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,4 +24,4 @@ * THE SOFTWARE. */ -void stm32f4_peripherals_clocks_init(void); +void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f4/gpio.h b/ports/stm/peripherals/gpio.h similarity index 87% rename from ports/stm/peripherals/stm32f4/gpio.h rename to ports/stm/peripherals/gpio.h index 34f89e7921..a5dbe444cb 100644 --- a/ports/stm/peripherals/stm32f4/gpio.h +++ b/ports/stm/peripherals/gpio.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,5 +24,4 @@ * THE SOFTWARE. */ -void stm32f4_peripherals_gpio_init(void); -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state); +void stm32_peripherals_gpio_init(void); diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h new file mode 100644 index 0000000000..aaf41361e6 --- /dev/null +++ b/ports/stm/peripherals/periph.h @@ -0,0 +1,117 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __MICROPY_INCLUDED_STM32_PERIPHERALS_PERIPH_H__ +#define __MICROPY_INCLUDED_STM32_PERIPHERALS_PERIPH_H__ + +#include +#include + +#include STM32_HAL_H +#include "pins.h" + +// PERIPH + +typedef struct { + uint8_t periph_index:4; // Index of the I2C unit (1 to 3) + uint8_t altfn_index:4; //Index of the altfn for this pin (0 to 15) + const mcu_pin_obj_t * pin; +} mcu_periph_obj_t; + +#define PERIPH(index, alt, p_pin) \ +{ \ + .periph_index = index, \ + .altfn_index = alt, \ + .pin = p_pin, \ +} + +//Timers +typedef struct { + uint8_t tim_index:4; + uint8_t altfn_index:4; + uint8_t channel_index:4; + const mcu_pin_obj_t * pin; +} mcu_tim_pin_obj_t; + +#define TIM(index, alt, channel, tim_pin) \ +{ \ + .tim_index = index, \ + .altfn_index = alt, \ + .channel_index = channel, \ + .pin = tim_pin, \ +} + +// F4 Series +// Access Lines + +#ifdef STM32F401xE +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f4/stm32f401xe/periph.h" +#endif + +#ifdef STM32F411xE +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f4/stm32f411xe/periph.h" +#endif + +#ifdef STM32F412Zx +#define HAS_DAC 0 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f4/stm32f412zx/periph.h" +#endif + +// Foundation Lines + +#ifdef STM32F405xx +#define HAS_DAC 1 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f4/stm32f405xx/periph.h" +#endif + +#ifdef STM32F407xx +#define HAS_DAC 1 +#define HAS_TRNG 1 +#define HAS_BASIC_TIM 1 +#include "stm32f4/stm32f407xx/periph.h" +#endif + +// H7 Series +// Single Core + +#ifdef STM32H743xx +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32h7/stm32h743xx/periph.h" +#endif + +#endif // __MICROPY_INCLUDED_STM32_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm/peripherals/stm32f4/pins.h b/ports/stm/peripherals/pins.h similarity index 82% rename from ports/stm/peripherals/stm32f4/pins.h rename to ports/stm/peripherals/pins.h index 44ef4c1baf..c6f1ec322b 100644 --- a/ports/stm/peripherals/stm32f4/pins.h +++ b/ports/stm/peripherals/pins.h @@ -3,8 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Dan Halbert for Adafruit Industries - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -28,13 +27,13 @@ // DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure // that all necessary includes are already included. -#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ -#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ +#ifndef __MICROPY_INCLUDED_STM32_PERIPHERALS_PINS_H__ +#define __MICROPY_INCLUDED_STM32_PERIPHERALS_PINS_H__ #include #include -#include "stm32f4xx_hal.h" +#include STM32_HAL_H typedef struct { mp_obj_base_t base; @@ -76,21 +75,26 @@ extern const mp_obj_type_t mcu_pin_type; // Use illegal pin value to mark unassigned pins. #define NO_PIN 0xff -// Choose based on chip +// F4 Series #ifdef STM32F401xE -#include "stm32f401xe/pins.h" +#include "stm32f4/stm32f401xe/pins.h" #endif #ifdef STM32F411xE -#include "stm32f411xe/pins.h" +#include "stm32f4/stm32f411xe/pins.h" #endif #ifdef STM32F412Zx -#include "stm32f412zx/pins.h" +#include "stm32f4/stm32f412zx/pins.h" #endif #ifdef STM32F405xx -#include "stm32f405xx/pins.h" +#include "stm32f4/stm32f405xx/pins.h" #endif #ifdef STM32F407xx -#include "stm32f407xx/pins.h" +#include "stm32f4/stm32f407xx/pins.h" #endif -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/pins.h" +#endif + +#endif // __MICROPY_INCLUDED_STM32_PERIPHERALS_PINS_H__ diff --git a/ports/stm/peripherals/stm32f4/periph.h b/ports/stm/peripherals/stm32f4/periph.h deleted file mode 100644 index d311afe4a1..0000000000 --- a/ports/stm/peripherals/stm32f4/periph.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ -#define __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ - -#include -#include - -#include "stm32f4xx_hal.h" -#include "stm32f4/pins.h" - -// I2C -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) - uint8_t altfn_index:4; //Index of the altfn for this pin (0 to 15) - const mcu_pin_obj_t * pin; -} mcu_i2c_sda_obj_t; - -typedef struct { - uint8_t i2c_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_i2c_scl_obj_t; - - -#define I2C_SDA(index, alt, sda_pin) \ -{ \ - .i2c_index = index, \ - .altfn_index = alt, \ - .pin = sda_pin, \ -} - -#define I2C_SCL(index, alt, scl_pin) \ -{ \ - .i2c_index = index, \ - .altfn_index = alt, \ - .pin = scl_pin, \ -} - -// SPI -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t spi_index:4; //Up to 6 SPI units - uint8_t altfn_index:4; //Up to 15 alt channels - const mcu_pin_obj_t * pin; -} mcu_spi_sck_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_mosi_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_miso_obj_t; - -typedef struct { - uint8_t spi_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_spi_nss_obj_t; - -#define SPI(index, alt, spi_pin) \ -{ \ - .spi_index = index, \ - .altfn_index = alt, \ - .pin = spi_pin, \ -} - -// UART -// TODO: these objects should be condensed into a single 'periph_pin' unless we -// find a compelling reason to store more unique data in them. - -typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_uart_tx_obj_t; - -typedef struct { - uint8_t uart_index:4; - uint8_t altfn_index:4; - const mcu_pin_obj_t * pin; -} mcu_uart_rx_obj_t; - -#define UART(index, alt, uart_pin) \ -{ \ - .uart_index = index, \ - .altfn_index = alt, \ - .pin = uart_pin, \ -} - -//Timers -typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; - uint8_t channel_index:4; - const mcu_pin_obj_t * pin; -} mcu_tim_pin_obj_t; - -#define TIM(index, alt, channel, tim_pin) \ -{ \ - .tim_index = index, \ - .altfn_index = alt, \ - .channel_index = channel, \ - .pin = tim_pin, \ -} - -//Access Lines - -#ifdef STM32F401xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#define HAS_BASIC_TIM 0 -#include "stm32f401xe/periph.h" -#endif - -#ifdef STM32F411xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#define HAS_BASIC_TIM 0 -#include "stm32f411xe/periph.h" -#endif - -#ifdef STM32F412Zx -#define HAS_DAC 0 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f412zx/periph.h" -#endif - -//Foundation Lines - -#ifdef STM32F405xx -#define HAS_DAC 1 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f405xx/periph.h" -#endif - -#ifdef STM32F407xx -#define HAS_DAC 1 -#define HAS_TRNG 1 -#define HAS_BASIC_TIM 1 -#include "stm32f407xx/periph.h" -#endif - -#endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c index 53810af263..d048d60e85 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c @@ -24,10 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" + #include "py/mpconfig.h" -void stm32f4_peripherals_clocks_init(void) { +void stm32_peripherals_clocks_init(void) { //System clock init RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c index 7bd6196627..514bcc506e 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c @@ -24,11 +24,10 @@ * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" +#include "gpio.h" #include "common-hal/microcontroller/Pin.h" -void stm32f4_peripherals_gpio_init(void) { +void stm32_peripherals_gpio_init(void) { /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); @@ -44,8 +43,3 @@ void stm32f4_peripherals_gpio_init(void) { never_reset_pin_number(0,14); //PA14 SWCLK } -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { -} - - diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c index b120841860..868945ecc3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.c @@ -26,98 +26,98 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" // I2C I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), +const mcu_periph_obj_t mcu_i2c_sda_list[5] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 9, &pin_PB03), + PERIPH(3, 4, &pin_PC09), + PERIPH(3, 9, &pin_PB04), }; -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) +const mcu_periph_obj_t mcu_i2c_scl_list[4] = { + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(3, 4, &pin_PA08) }; // SPI SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; -const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), +const mcu_periph_obj_t mcu_spi_sck_list[9] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(1, 5, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(2, 5, &pin_PD03), + PERIPH(3, 6, &pin_PB03), + PERIPH(3, 6, &pin_PC10), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), }; -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), +const mcu_periph_obj_t mcu_spi_mosi_list[9] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(1, 5, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PB05), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), }; -const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), +const mcu_periph_obj_t mcu_spi_miso_list[8] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PB04), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), }; -const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), +const mcu_periph_obj_t mcu_spi_nss_list[9] = { + PERIPH(1, 5, &pin_PA04), + PERIPH(1, 5, &pin_PA15), + PERIPH(2, 5, &pin_PB09), + PERIPH(2, 5, &pin_PB12), + PERIPH(3, 6, &pin_PA04), + PERIPH(3, 6, &pin_PA15), + PERIPH(4, 6, &pin_PB12), + PERIPH(4, 5, &pin_PE04), + PERIPH(4, 5, &pin_PE11), }; USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), +const mcu_periph_obj_t mcu_uart_tx_list[6] = { + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(6, 8, &pin_PA11), + PERIPH(1, 7, &pin_PB06), + PERIPH(6, 8, &pin_PC06), + PERIPH(2, 7, &pin_PD05), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), +const mcu_periph_obj_t mcu_uart_rx_list[6] = { + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(6, 8, &pin_PA12), + PERIPH(1, 7, &pin_PB07), + PERIPH(6, 8, &pin_PC07), + PERIPH(2, 7, &pin_PD06), }; //Timers diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h index 6085f1ff2b..334a14db57 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h @@ -24,29 +24,29 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H //I2C extern I2C_TypeDef * mcu_i2c_banks[3]; -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[5]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; //SPI extern SPI_TypeDef * mcu_spi_banks[4]; -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; +extern const mcu_periph_obj_t mcu_spi_sck_list[9]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[9]; +extern const mcu_periph_obj_t mcu_spi_miso_list[8]; +extern const mcu_periph_obj_t mcu_spi_nss_list[9]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[6]; +extern const mcu_periph_obj_t mcu_uart_tx_list[6]; +extern const mcu_periph_obj_t mcu_uart_rx_list[6]; //Timers #define TIM_BANK_ARRAY_LEN 14 @@ -54,4 +54,4 @@ extern const mcu_uart_rx_obj_t mcu_uart_rx_list[6]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c index 7e88c3dcba..eea2a1a1b3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c @@ -26,7 +26,7 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" +#include "peripherals/pins.h" const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h index 09bc8f13e3..c836df69a2 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PINS_H //Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only //pg 38 @@ -118,4 +118,4 @@ extern const mcu_pin_obj_t pin_PE00; extern const mcu_pin_obj_t pin_PE01; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F401XE_PINS_H +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c index 2afca64e83..5f4fd2783d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c @@ -24,12 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" + #include "py/mpconfig.h" -void stm32f4_peripherals_clocks_init(void) { - //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. - +void stm32_peripherals_clocks_init(void) { //System clock init RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c index d1eaa90d1b..a5f4eae78c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c @@ -24,11 +24,10 @@ * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" +#include "peripherals/gpio.h" #include "common-hal/microcontroller/Pin.h" -void stm32f4_peripherals_gpio_init(void) { +void stm32_peripherals_gpio_init(void) { //Enable all GPIO for now __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c index bc03f7c7be..e75f0b2062 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -26,97 +26,97 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" // I2C I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), - I2C_SDA(3, 4, &pin_PC09), +const mcu_periph_obj_t mcu_i2c_sda_list[4] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), }; -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) +const mcu_periph_obj_t mcu_i2c_scl_list[4] = { + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(3, 4, &pin_PA08) }; SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; -const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), +const mcu_periph_obj_t mcu_spi_sck_list[7] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(1, 5, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(2, 5, &pin_PC07), + PERIPH(3, 6, &pin_PB03), + PERIPH(3, 6, &pin_PC10), }; -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), +const mcu_periph_obj_t mcu_spi_mosi_list[6] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(1, 5, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PB05), + PERIPH(3, 6, &pin_PC12), }; -const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), +const mcu_periph_obj_t mcu_spi_miso_list[6] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PB04), + PERIPH(3, 6, &pin_PC11), }; -const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), +const mcu_periph_obj_t mcu_spi_nss_list[6] = { + PERIPH(1, 5, &pin_PA04), + PERIPH(1, 5, &pin_PA15), + PERIPH(2, 5, &pin_PB09), + PERIPH(2, 5, &pin_PB12), + PERIPH(3, 6, &pin_PA04), + PERIPH(3, 6, &pin_PA15), }; USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { - UART(4, 8, &pin_PA00), - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(4, 8, &pin_PC10), - UART(5, 8, &pin_PC12), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), +const mcu_periph_obj_t mcu_uart_tx_list[12] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PB06), + PERIPH(3, 7, &pin_PB10), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(6, 8, &pin_PG14), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(4, 8, &pin_PA01), - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(4, 8, &pin_PC11), - UART(5, 8, &pin_PD02), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), +const mcu_periph_obj_t mcu_uart_rx_list[12] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(1, 7, &pin_PB07), + PERIPH(3, 7, &pin_PB11), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(6, 8, &pin_PG09), }; //Timers diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index e87e798574..98b4fab9c2 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -24,29 +24,29 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H //I2C extern I2C_TypeDef * mcu_i2c_banks[3]; -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[4]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; //SPI extern SPI_TypeDef * mcu_spi_banks[3]; -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; +extern const mcu_periph_obj_t mcu_spi_sck_list[7]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[6]; +extern const mcu_periph_obj_t mcu_spi_miso_list[6]; +extern const mcu_periph_obj_t mcu_spi_nss_list[6]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; +extern const mcu_periph_obj_t mcu_uart_tx_list[12]; +extern const mcu_periph_obj_t mcu_uart_rx_list[12]; //Timers #define TIM_BANK_ARRAY_LEN 14 @@ -54,4 +54,4 @@ extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c index 86445fe140..0f669f1c6c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c @@ -26,7 +26,7 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" +#include "peripherals/pins.h" const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h index 180f5c316f..b3e5e3344d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H //Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only //pg 50 @@ -155,4 +155,4 @@ extern const mcu_pin_obj_t pin_PB09; extern const mcu_pin_obj_t pin_PE00; extern const mcu_pin_obj_t pin_PE01; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c index 2afca64e83..5f4fd2783d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c @@ -24,12 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" + #include "py/mpconfig.h" -void stm32f4_peripherals_clocks_init(void) { - //TODO: All parameters must be moved to board level, due to relationship with HSE Osc. - +void stm32_peripherals_clocks_init(void) { //System clock init RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c index d1eaa90d1b..dfdd61fde4 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c @@ -24,8 +24,7 @@ * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" +#include "peripherals/gpio.h" #include "common-hal/microcontroller/Pin.h" void stm32f4_peripherals_gpio_init(void) { diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c index bc03f7c7be..e75f0b2062 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.c @@ -26,97 +26,97 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" // I2C I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), - I2C_SDA(3, 4, &pin_PC09), +const mcu_periph_obj_t mcu_i2c_sda_list[4] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), }; -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) +const mcu_periph_obj_t mcu_i2c_scl_list[4] = { + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(3, 4, &pin_PA08) }; SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3}; -const mcu_spi_sck_obj_t mcu_spi_sck_list[7] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), +const mcu_periph_obj_t mcu_spi_sck_list[7] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(1, 5, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(2, 5, &pin_PC07), + PERIPH(3, 6, &pin_PB03), + PERIPH(3, 6, &pin_PC10), }; -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), +const mcu_periph_obj_t mcu_spi_mosi_list[6] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(1, 5, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PB05), + PERIPH(3, 6, &pin_PC12), }; -const mcu_spi_miso_obj_t mcu_spi_miso_list[6] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), +const mcu_periph_obj_t mcu_spi_miso_list[6] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PB04), + PERIPH(3, 6, &pin_PC11), }; -const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), +const mcu_periph_obj_t mcu_spi_nss_list[6] = { + PERIPH(1, 5, &pin_PA04), + PERIPH(1, 5, &pin_PA15), + PERIPH(2, 5, &pin_PB09), + PERIPH(2, 5, &pin_PB12), + PERIPH(3, 6, &pin_PA04), + PERIPH(3, 6, &pin_PA15), }; USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { - UART(4, 8, &pin_PA00), - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(4, 8, &pin_PC10), - UART(5, 8, &pin_PC12), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), +const mcu_periph_obj_t mcu_uart_tx_list[12] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PB06), + PERIPH(3, 7, &pin_PB10), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(6, 8, &pin_PG14), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(4, 8, &pin_PA01), - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(4, 8, &pin_PC11), - UART(5, 8, &pin_PD02), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), +const mcu_periph_obj_t mcu_uart_rx_list[12] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(1, 7, &pin_PB07), + PERIPH(3, 7, &pin_PB11), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(6, 8, &pin_PG09), }; //Timers diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h index e87e798574..15cbfb16d2 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h @@ -24,29 +24,29 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H //I2C extern I2C_TypeDef * mcu_i2c_banks[3]; -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[4]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; //SPI extern SPI_TypeDef * mcu_spi_banks[3]; -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[7]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; +extern const mcu_periph_obj_t mcu_spi_sck_list[7]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[6]; +extern const mcu_periph_obj_t mcu_spi_miso_list[6]; +extern const mcu_periph_obj_t mcu_spi_nss_list[6]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; +extern const mcu_periph_obj_t mcu_uart_tx_list[12]; +extern const mcu_periph_obj_t mcu_uart_rx_list[12]; //Timers #define TIM_BANK_ARRAY_LEN 14 @@ -54,4 +54,4 @@ extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c index 86445fe140..0f669f1c6c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c @@ -26,7 +26,7 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" +#include "peripherals/pins.h" const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h index 180f5c316f..109dcb9226 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PINS_H //Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only //pg 50 @@ -155,4 +155,4 @@ extern const mcu_pin_obj_t pin_PB09; extern const mcu_pin_obj_t pin_PE00; extern const mcu_pin_obj_t pin_PE01; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PINS_H diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c index 53810af263..d048d60e85 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c @@ -24,10 +24,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" + #include "py/mpconfig.h" -void stm32f4_peripherals_clocks_init(void) { +void stm32_peripherals_clocks_init(void) { //System clock init RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c index aee0bd5eb8..201a90e347 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c @@ -24,12 +24,11 @@ * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" +#include "peripherals/gpio.h" #include "py/mpconfig.h" #include "common-hal/microcontroller/Pin.h" -void stm32f4_peripherals_gpio_init(void) { +void stm32_peripherals_gpio_init(void) { //* GPIO Ports Clock Enable */ __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c index b7d9edf4f7..0856637493 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.c @@ -26,120 +26,120 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" // I2C I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) +const mcu_periph_obj_t mcu_i2c_sda_list[7] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 9, &pin_PB09), + PERIPH(2, 9, &pin_PB03), + PERIPH(3, 4, &pin_PC09), + PERIPH(3, 9, &pin_PB04), + PERIPH(3, 9, &pin_PB08) }; -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) +const mcu_periph_obj_t mcu_i2c_scl_list[4] = { + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(3, 4, &pin_PA08) }; // SPI SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; -const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 7, &pin_PB12), - SPI(3, 6, &pin_PC10), - SPI(4, 6, &pin_PB13), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), - SPI(5, 6, &pin_PB00), - SPI(5, 6, &pin_PE02), - SPI(5, 6, &pin_PE12) +const mcu_periph_obj_t mcu_spi_sck_list[15] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(1, 5, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(2, 5, &pin_PC07), + PERIPH(2, 5, &pin_PD03), + PERIPH(3, 6, &pin_PB03), + PERIPH(3, 7, &pin_PB12), + PERIPH(3, 6, &pin_PC10), + PERIPH(4, 6, &pin_PB13), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 6, &pin_PB00), + PERIPH(5, 6, &pin_PE02), + PERIPH(5, 6, &pin_PE12) }; -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PA01), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), - SPI(5, 6, &pin_PA10), - SPI(5, 6, &pin_PB08), - SPI(5, 6, &pin_PE06), - SPI(5, 6, &pin_PE14) +const mcu_periph_obj_t mcu_spi_mosi_list[14] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(1, 5, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PB05), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(4, 5, &pin_PA01), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 6, &pin_PA10), + PERIPH(5, 6, &pin_PB08), + PERIPH(5, 6, &pin_PE06), + PERIPH(5, 6, &pin_PE14) }; -const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 6, &pin_PA11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), - SPI(5, 6, &pin_PA12), - SPI(5, 6, &pin_PE05), - SPI(5, 6, &pin_PE13) +const mcu_periph_obj_t mcu_spi_miso_list[12] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PB04), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 6, &pin_PA11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 6, &pin_PA12), + PERIPH(5, 6, &pin_PE05), + PERIPH(5, 6, &pin_PE13) }; -const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), - SPI(5, 6, &pin_PB01), - SPI(5, 6, &pin_PE04), - SPI(5, 6, &pin_PE11) +const mcu_periph_obj_t mcu_spi_nss_list[12] = { + PERIPH(1, 5, &pin_PA04), + PERIPH(1, 5, &pin_PA15), + PERIPH(2, 5, &pin_PB09), + PERIPH(2, 5, &pin_PB12), + PERIPH(3, 6, &pin_PA04), + PERIPH(3, 6, &pin_PA15), + PERIPH(4, 6, &pin_PB12), + PERIPH(4, 5, &pin_PE04), + PERIPH(4, 5, &pin_PE11), + PERIPH(5, 6, &pin_PB01), + PERIPH(5, 6, &pin_PE04), + PERIPH(5, 6, &pin_PE11) }; USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[7] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PA15), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), +const mcu_periph_obj_t mcu_uart_tx_list[7] = { + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PA15), + PERIPH(6, 8, &pin_PA11), + PERIPH(1, 7, &pin_PB06), + PERIPH(6, 8, &pin_PC06), + PERIPH(2, 7, &pin_PD05), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[7] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB03), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), +const mcu_periph_obj_t mcu_uart_rx_list[7] = { + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(6, 8, &pin_PA12), + PERIPH(1, 7, &pin_PB03), + PERIPH(1, 7, &pin_PB07), + PERIPH(6, 8, &pin_PC07), + PERIPH(2, 7, &pin_PD06), }; //Timers diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h index d657d73b68..2c5e5dd564 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h @@ -24,29 +24,29 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H //I2C extern I2C_TypeDef * mcu_i2c_banks[3]; -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[7]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; //SPI extern SPI_TypeDef * mcu_spi_banks[5]; -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; +extern const mcu_periph_obj_t mcu_spi_sck_list[15]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[14]; +extern const mcu_periph_obj_t mcu_spi_miso_list[12]; +extern const mcu_periph_obj_t mcu_spi_nss_list[12]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[7]; +extern const mcu_periph_obj_t mcu_uart_tx_list[7]; +extern const mcu_periph_obj_t mcu_uart_rx_list[7]; //Timers #define TIM_BANK_ARRAY_LEN 14 @@ -54,4 +54,4 @@ extern const mcu_uart_rx_obj_t mcu_uart_rx_list[7]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c index 7e88c3dcba..eea2a1a1b3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c @@ -26,7 +26,7 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" +#include "peripherals/pins.h" const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h index 37d3a5cf11..b6c18b02e3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PINS_H //Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only //pg 38 diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c index b208f9dfb3..ad45abed22 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c @@ -24,12 +24,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "stm32f4xx_hal.h" + #include "py/mpconfig.h" -void stm32f4_peripherals_clocks_init(void) { +void stm32_peripherals_clocks_init(void) { //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index d17ab4e018..97ec933eab 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -24,193 +24,23 @@ * THE SOFTWARE. */ -/* GPIO PIN REFERENCE -#define LED3_Pin GPIO_PIN_2 -#define LED3_GPIO_Port GPIOE -#define LED4_Pin GPIO_PIN_3 -#define LED4_GPIO_Port GPIOE -#define DFSDM_DATIN3_Pin GPIO_PIN_4 -#define DFSDM_DATIN3_GPIO_Port GPIOE -#define A0_Pin GPIO_PIN_0 -#define A0_GPIO_Port GPIOF -#define LCD_BLCTRL_Pin GPIO_PIN_5 -#define LCD_BLCTRL_GPIO_Port GPIOF -#define QSPI_BK1_IO3_Pin GPIO_PIN_6 -#define QSPI_BK1_IO3_GPIO_Port GPIOF -#define QSPI_BK1_IO2_Pin GPIO_PIN_7 -#define QSPI_BK1_IO2_GPIO_Port GPIOF -#define QSPI_BK1_IO0_Pin GPIO_PIN_8 -#define QSPI_BK1_IO0_GPIO_Port GPIOF -#define QSPI_BK1_IO1_Pin GPIO_PIN_9 -#define QSPI_BK1_IO1_GPIO_Port GPIOF -#define STLK_MCO_Pin GPIO_PIN_0 -#define STLK_MCO_GPIO_Port GPIOH -#define DFSDM_CKOUT_Pin GPIO_PIN_2 -#define DFSDM_CKOUT_GPIO_Port GPIOC -#define JOY_SEL_Pin GPIO_PIN_0 -#define JOY_SEL_GPIO_Port GPIOA -#define STLINK_RX_Pin GPIO_PIN_2 -#define STLINK_RX_GPIO_Port GPIOA -#define STLINK_TX_Pin GPIO_PIN_3 -#define STLINK_TX_GPIO_Port GPIOA -#define CODEC_I2S3_WS_Pin GPIO_PIN_4 -#define CODEC_I2S3_WS_GPIO_Port GPIOA -#define DFSDM_DATIN0_Pin GPIO_PIN_1 -#define DFSDM_DATIN0_GPIO_Port GPIOB -#define QSPI_CLK_Pin GPIO_PIN_2 -#define QSPI_CLK_GPIO_Port GPIOB -#define EXT_RESET_Pin GPIO_PIN_11 -#define EXT_RESET_GPIO_Port GPIOF -#define CTP_RST_Pin GPIO_PIN_12 -#define CTP_RST_GPIO_Port GPIOF -#define JOY_RIGHT_Pin GPIO_PIN_14 -#define JOY_RIGHT_GPIO_Port GPIOF -#define JOY_LEFT_Pin GPIO_PIN_15 -#define JOY_LEFT_GPIO_Port GPIOF -#define JOY_UP_Pin GPIO_PIN_0 -#define JOY_UP_GPIO_Port GPIOG -#define JOY_DOWN_Pin GPIO_PIN_1 -#define JOY_DOWN_GPIO_Port GPIOG -#define D4_Pin GPIO_PIN_7 -#define D4_GPIO_Port GPIOE -#define D5_Pin GPIO_PIN_8 -#define D5_GPIO_Port GPIOE -#define D6_Pin GPIO_PIN_9 -#define D6_GPIO_Port GPIOE -#define D7_Pin GPIO_PIN_10 -#define D7_GPIO_Port GPIOE -#define D8_Pin GPIO_PIN_11 -#define D8_GPIO_Port GPIOE -#define D9_Pin GPIO_PIN_12 -#define D9_GPIO_Port GPIOE -#define D10_Pin GPIO_PIN_13 -#define D10_GPIO_Port GPIOE -#define D11_Pin GPIO_PIN_14 -#define D11_GPIO_Port GPIOE -#define D12_Pin GPIO_PIN_15 -#define D12_GPIO_Port GPIOE -#define I2C2_SCL_Pin GPIO_PIN_10 -#define I2C2_SCL_GPIO_Port GPIOB -#define M2_CKIN_Pin GPIO_PIN_11 -#define M2_CKIN_GPIO_Port GPIOB -#define CODEC_I2S3_SCK_Pin GPIO_PIN_12 -#define CODEC_I2S3_SCK_GPIO_Port GPIOB -#define D13_Pin GPIO_PIN_8 -#define D13_GPIO_Port GPIOD -#define D14_Pin GPIO_PIN_9 -#define D14_GPIO_Port GPIOD -#define D15_Pin GPIO_PIN_10 -#define D15_GPIO_Port GPIOD -#define LCD_RESET_Pin GPIO_PIN_11 -#define LCD_RESET_GPIO_Port GPIOD -#define D0_Pin GPIO_PIN_14 -#define D0_GPIO_Port GPIOD -#define D1_Pin GPIO_PIN_15 -#define D1_GPIO_Port GPIOD -#define CODEC_INT_Pin GPIO_PIN_2 -#define CODEC_INT_GPIO_Port GPIOG -#define LCD_TE_Pin GPIO_PIN_4 -#define LCD_TE_GPIO_Port GPIOG -#define CTP_INT_Pin GPIO_PIN_5 -#define CTP_INT_GPIO_Port GPIOG -#define QSPI_BK1_NCS_Pin GPIO_PIN_6 -#define QSPI_BK1_NCS_GPIO_Port GPIOG -#define USB_OTGFS_OVRCR_Pin GPIO_PIN_7 -#define USB_OTGFS_OVRCR_GPIO_Port GPIOG -#define USB_OTGFS_PPWR_EN_Pin GPIO_PIN_8 -#define USB_OTGFS_PPWR_EN_GPIO_Port GPIOG -#define CODEC_I2S3_MCK_Pin GPIO_PIN_7 -#define CODEC_I2S3_MCK_GPIO_Port GPIOC -#define uSD_D0_Pin GPIO_PIN_8 -#define uSD_D0_GPIO_Port GPIOC -#define uSD_D1_Pin GPIO_PIN_9 -#define uSD_D1_GPIO_Port GPIOC -#define M2_CKINA8_Pin GPIO_PIN_8 -#define M2_CKINA8_GPIO_Port GPIOA -#define USB_OTGFS_VBUS_Pin GPIO_PIN_9 -#define USB_OTGFS_VBUS_GPIO_Port GPIOA -#define USB_OTGFS_ID_Pin GPIO_PIN_10 -#define USB_OTGFS_ID_GPIO_Port GPIOA -#define USB_OTGFS_DM_Pin GPIO_PIN_11 -#define USB_OTGFS_DM_GPIO_Port GPIOA -#define USB_OTGFS_DP_Pin GPIO_PIN_12 -#define USB_OTGFS_DP_GPIO_Port GPIOA -#define SWDIO_Pin GPIO_PIN_13 -#define SWDIO_GPIO_Port GPIOA -#define SWCLK_Pin GPIO_PIN_14 -#define SWCLK_GPIO_Port GPIOA -#define uSD_D2_Pin GPIO_PIN_10 -#define uSD_D2_GPIO_Port GPIOC -#define uSD_D3_Pin GPIO_PIN_11 -#define uSD_D3_GPIO_Port GPIOC -#define uSD_CLK_Pin GPIO_PIN_12 -#define uSD_CLK_GPIO_Port GPIOC -#define D2_Pin GPIO_PIN_0 -#define D2_GPIO_Port GPIOD -#define D3_Pin GPIO_PIN_1 -#define D3_GPIO_Port GPIOD -#define uSD_CMD_Pin GPIO_PIN_2 -#define uSD_CMD_GPIO_Port GPIOD -#define uSD_DETECT_Pin GPIO_PIN_3 -#define uSD_DETECT_GPIO_Port GPIOD -#define FMC_NOE_Pin GPIO_PIN_4 -#define FMC_NOE_GPIO_Port GPIOD -#define FMC_NWE_Pin GPIO_PIN_5 -#define FMC_NWE_GPIO_Port GPIOD -#define FMC_NE1_Pin GPIO_PIN_7 -#define FMC_NE1_GPIO_Port GPIOD -#define SWO_Pin GPIO_PIN_3 -#define SWO_GPIO_Port GPIOB -#define CODEC_I2S3ext_SD_Pin GPIO_PIN_4 -#define CODEC_I2S3ext_SD_GPIO_Port GPIOB -#define CODEC_I2S3_SD_Pin GPIO_PIN_5 -#define CODEC_I2S3_SD_GPIO_Port GPIOB -#define I2C1_SCL_Pin GPIO_PIN_6 -#define I2C1_SCL_GPIO_Port GPIOB -#define I2C1_SDA_Pin GPIO_PIN_7 -#define I2C1_SDA_GPIO_Port GPIOB -#define I2C2_SDA_Pin GPIO_PIN_9 -#define I2C2_SDA_GPIO_Port GPIOB -#define LED1_Pin GPIO_PIN_0 -#define LED1_GPIO_Port GPIOE -#define LED2_Pin GPIO_PIN_1 -#define LED2_GPIO_Port GPIOE -*/ - -#include "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" +#include "peripherals/gpio.h" #include "common-hal/microcontroller/Pin.h" -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); +void stm32_peripherals_gpio_init(void) { - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); - //HAL_GPIO_WritePin(USB_OTGFS_PPWR_EN_GPIO_Port, USB_OTGFS_PPWR_EN_Pin, GPIO_PIN_SET); + GPIO_InitTypeDef GPIO_InitStruct = {0}; + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); - //Configure LED pins - GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); - - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,0); - stm32f4_peripherals_status_led(2,0); - stm32f4_peripherals_status_led(3,0); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT never_reset_pin_number(0,13); //PA13 SWDIO @@ -223,21 +53,3 @@ void stm32f4_peripherals_gpio_init(void) { // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - switch(led) - { - case 0: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, (state ^ 1)); - break; - case 1: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_1, (state ^ 1)); - break; - case 2: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, (state ^ 1)); - break; - case 3: HAL_GPIO_WritePin(GPIOE, GPIO_PIN_3, (state ^ 1)); - break; - default: break; - } -} - - diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c index f5effa80ed..e92c88ce55 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.c @@ -26,98 +26,98 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" // I2C I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) +const mcu_periph_obj_t mcu_i2c_sda_list[8] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), //not on LQFP100 + PERIPH(2, 9, &pin_PB09), + PERIPH(2, 9, &pin_PB03), + PERIPH(3, 4, &pin_PC09), + PERIPH(3, 9, &pin_PB04), + PERIPH(3, 9, &pin_PB08) }; -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) +const mcu_periph_obj_t mcu_i2c_scl_list[4] = { + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(3, 4, &pin_PA08) }; // SPI SPI_TypeDef * mcu_spi_banks[5] = {SPI1, SPI2, SPI3, SPI4, SPI5}; -const mcu_spi_sck_obj_t mcu_spi_sck_list[15] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PC07), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 7, &pin_PB12), - SPI(3, 6, &pin_PC10), - SPI(4, 6, &pin_PB13), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), - SPI(5, 6, &pin_PB00), - SPI(5, 6, &pin_PE02), - SPI(5, 6, &pin_PE12) +const mcu_periph_obj_t mcu_spi_sck_list[15] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(1, 5, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(2, 5, &pin_PC07), + PERIPH(2, 5, &pin_PD03), + PERIPH(3, 6, &pin_PB03), + PERIPH(3, 7, &pin_PB12), + PERIPH(3, 6, &pin_PC10), + PERIPH(4, 6, &pin_PB13), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 6, &pin_PB00), + PERIPH(5, 6, &pin_PE02), + PERIPH(5, 6, &pin_PE12) }; -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PA01), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), - SPI(5, 6, &pin_PA10), - SPI(5, 6, &pin_PB08), - SPI(5, 6, &pin_PE06), - SPI(5, 6, &pin_PE14) +const mcu_periph_obj_t mcu_spi_mosi_list[14] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(1, 5, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PB05), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(4, 5, &pin_PA01), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 6, &pin_PA10), + PERIPH(5, 6, &pin_PB08), + PERIPH(5, 6, &pin_PE06), + PERIPH(5, 6, &pin_PE14) }; -const mcu_spi_miso_obj_t mcu_spi_miso_list[12] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 6, &pin_PA11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), - SPI(5, 6, &pin_PA12), - SPI(5, 6, &pin_PE05), - SPI(5, 6, &pin_PE13) +const mcu_periph_obj_t mcu_spi_miso_list[12] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PB04), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 6, &pin_PA11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 6, &pin_PA12), + PERIPH(5, 6, &pin_PE05), + PERIPH(5, 6, &pin_PE13) }; -const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), - SPI(5, 6, &pin_PB01), - SPI(5, 6, &pin_PE04), - SPI(5, 6, &pin_PE11) +const mcu_periph_obj_t mcu_spi_nss_list[12] = { + PERIPH(1, 5, &pin_PA04), + PERIPH(1, 5, &pin_PA15), + PERIPH(2, 5, &pin_PB09), + PERIPH(2, 5, &pin_PB12), + PERIPH(3, 6, &pin_PA04), + PERIPH(3, 6, &pin_PA15), + PERIPH(4, 6, &pin_PB12), + PERIPH(4, 5, &pin_PE04), + PERIPH(4, 5, &pin_PE11), + PERIPH(5, 6, &pin_PB01), + PERIPH(5, 6, &pin_PE04), + PERIPH(5, 6, &pin_PE11) }; //UART @@ -125,33 +125,33 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(1, 7, &pin_PA15), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(3, 7, &pin_PB10), - UART(6, 8, &pin_PC06), - UART(3, 7, &pin_PC10), - UART(2, 7, &pin_PD05), - UART(3, 7, &pin_PD08), - UART(6, 8, &pin_PG14), +const mcu_periph_obj_t mcu_uart_tx_list[11] = { + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PA15), + PERIPH(6, 8, &pin_PA11), + PERIPH(1, 7, &pin_PB06), + PERIPH(3, 7, &pin_PB10), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(6, 8, &pin_PG14), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB03), - UART(1, 7, &pin_PB07), - UART(3, 7, &pin_PB11), - UART(3, 7, &pin_PC05), - UART(6, 8, &pin_PC07), - UART(3, 7, &pin_PC11), - UART(2, 7, &pin_PD06), - UART(3, 7, &pin_PD09), - UART(6, 8, &pin_PG09), +const mcu_periph_obj_t mcu_uart_rx_list[12] = { + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(6, 8, &pin_PA12), + PERIPH(1, 7, &pin_PB03), + PERIPH(1, 7, &pin_PB07), + PERIPH(3, 7, &pin_PB11), + PERIPH(3, 7, &pin_PC05), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(6, 8, &pin_PG09), }; //Timers diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h index e0141e6dab..f668ace752 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h @@ -24,30 +24,30 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H //I2C extern I2C_TypeDef * mcu_i2c_banks[3]; -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; +extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; +extern const mcu_periph_obj_t mcu_i2c_scl_list[4]; //SPI extern SPI_TypeDef * mcu_spi_banks[5]; -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[15]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; +extern const mcu_periph_obj_t mcu_spi_sck_list[15]; +extern const mcu_periph_obj_t mcu_spi_mosi_list[14]; +extern const mcu_periph_obj_t mcu_spi_miso_list[12]; +extern const mcu_periph_obj_t mcu_spi_nss_list[12]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; extern bool mcu_uart_has_usart[MAX_UART]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; +extern const mcu_periph_obj_t mcu_uart_tx_list[11]; +extern const mcu_periph_obj_t mcu_uart_rx_list[12]; //Timers #define TIM_BANK_ARRAY_LEN 14 @@ -55,4 +55,4 @@ extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c index c56de5a295..ef3ce6d0ed 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c @@ -26,7 +26,7 @@ #include "py/obj.h" #include "py/mphal.h" -#include "stm32f4/pins.h" +#include "peripherals/pins.h" const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h index 180f5c316f..5cf99345ce 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h @@ -24,10 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PINS_H -//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only //pg 50 extern const mcu_pin_obj_t pin_PE02; extern const mcu_pin_obj_t pin_PE03; @@ -155,4 +154,4 @@ extern const mcu_pin_obj_t pin_PB09; extern const mcu_pin_obj_t pin_PE00; extern const mcu_pin_obj_t pin_PE01; -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F412ZG_PINS_H +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PINS_H diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c new file mode 100644 index 0000000000..494b7709e6 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c @@ -0,0 +1,162 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mpconfig.h" + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* The PWR block is always enabled on the H7 series- there is no clock + enable. For now, use the default VOS3 scale mode (lowest) and limit clock + frequencies to avoid potential current draw problems from bus + power when using the max clock speeds throughout the chip. */ + + /* Enable HSE Oscillator and activate PLL1 with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.CSIState = RCC_CSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = 2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \ + RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \ + RCC_CLOCKTYPE_D3PCLK1); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; + + /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are + device-dependent- 120 MHz for this board according to Figure 2 of + the datasheet. Dividing by half will be safe for now. */ + RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; + + /* 4 wait states required for 168MHz and VOS3. */ + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); + + /* Like on F4, on H7, USB's actual peripheral clock and bus clock are + separate. However, the main system PLL (PLL1) doesn't have a direct + connection to the USB peripheral clock to generate 48 MHz, so we do this + dance. This will connect PLL1's Q output to the USB peripheral clock. */ + RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct; + + RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; + RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); + + // RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + // RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + // RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + + // /** Supply configuration update enable + // */ + // HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); + // /** Configure the main internal regulator output voltage + // */ + // __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + // while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} + // /** Macro to configure the PLL clock source + // */ + // __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE); + // /** Initializes the CPU, AHB and APB busses clocks + // */ + // RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + // RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + // RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + // RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + // RCC_OscInitStruct.PLL.PLLM = 4; + // RCC_OscInitStruct.PLL.PLLN = 400; + // RCC_OscInitStruct.PLL.PLLP = 2; + // RCC_OscInitStruct.PLL.PLLQ = 4; + // RCC_OscInitStruct.PLL.PLLR = 2; + // RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_1; + // RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; + // RCC_OscInitStruct.PLL.PLLFRACN = 0; + // if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + // { + + // } + // /** Initializes the CPU, AHB and APB busses clocks + // */ + // RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + // |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 + // |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; + // RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + // RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + // RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; + // RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; + // RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + // RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + // RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; + + // if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) + // { + + // } + // PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; /*RCC_PERIPHCLK_USART3|RCC_PERIPHCLK_UART4 + // |RCC_PERIPHCLK_SPI1|RCC_PERIPHCLK_ADC + // |RCC_PERIPHCLK_I2C1| */ + // // PeriphClkInitStruct.PLL2.PLL2M = 1; + // // PeriphClkInitStruct.PLL2.PLL2N = 19; + // // PeriphClkInitStruct.PLL2.PLL2P = 2; + // // PeriphClkInitStruct.PLL2.PLL2Q = 2; + // // PeriphClkInitStruct.PLL2.PLL2R = 2; + // // PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_3; + // // PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM; + // // PeriphClkInitStruct.PLL2.PLL2FRACN = 0; + // PeriphClkInitStruct.PLL3.PLL3M = 4; + // PeriphClkInitStruct.PLL3.PLL3N = 120; + // PeriphClkInitStruct.PLL3.PLL3P = 2; + // PeriphClkInitStruct.PLL3.PLL3Q = 5; + // PeriphClkInitStruct.PLL3.PLL3R = 2; + // PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_1; + // PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE; + // PeriphClkInitStruct.PLL3.PLL3FRACN = 0; + // PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL; + // PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1; + // PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_D2PCLK1; + // PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3; + // PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2; + // if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + // { + + // } + +} diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c new file mode 100644 index 0000000000..d51ff53c1f --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c @@ -0,0 +1,48 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK +} + + diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.c b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.c new file mode 100644 index 0000000000..8921646001 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.c @@ -0,0 +1,260 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[4] = {I2C1, I2C2, I2C3, I2C4}; + +const mcu_periph_obj_t mcu_i2c_sda_list[12] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(4, 6, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(4, 6, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), + PERIPH(4, 4, &pin_PD13), + PERIPH(2, 4, &pin_PF00), + PERIPH(4, 4, &pin_PF15), + PERIPH(2, 4, &pin_PH05), + PERIPH(3, 4, &pin_PH08), + PERIPH(4, 4, &pin_PH12) +}; + +const mcu_periph_obj_t mcu_i2c_scl_list[12] = { + PERIPH(3, 4, &pin_PA08), + PERIPH(1, 4, &pin_PB06), + PERIPH(4, 6, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(4, 6, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(4, 4, &pin_PD12), + PERIPH(2, 4, &pin_PF01), + PERIPH(4, 4, &pin_PF14), + PERIPH(2, 4, &pin_PH04), + PERIPH(3, 4, &pin_PH07), + PERIPH(4, 4, &pin_PH11) +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[6] = {SPI1, SPI2, SPI3, SPI4, SPI5, SPI6}; + +const mcu_periph_obj_t mcu_spi_sck_list[19] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(6, 8, &pin_PA05), + PERIPH(2, 5, &pin_PA09), + PERIPH(2, 5, &pin_PA12), + PERIPH(1, 5, &pin_PB03), + PERIPH(3, 6, &pin_PB03), + PERIPH(6, 8, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(3, 6, &pin_PC10), + PERIPH(2, 5, &pin_PD03), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 5, &pin_PF07), + PERIPH(1, 5, &pin_PG11), + PERIPH(6, 5, &pin_PG13), + PERIPH(5, 5, &pin_PH06), + PERIPH(2, 5, &pin_PI01), + PERIPH(5, 5, &pin_PK00), +}; + +const mcu_periph_obj_t mcu_spi_mosi_list[19] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(6, 8, &pin_PA07), + PERIPH(3, 7, &pin_PB02), + PERIPH(1, 5, &pin_PB05), + PERIPH(3, 7, &pin_PB05), + PERIPH(6, 8, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC01), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(1, 5, &pin_PD07), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 5, &pin_PF09), + PERIPH(5, 5, &pin_PF11), + PERIPH(6, 5, &pin_PG14), + PERIPH(2, 5, &pin_PI03), + PERIPH(5, 5, &pin_PJ10), +}; + +const mcu_periph_obj_t mcu_spi_miso_list[16] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(6, 8, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(3, 6, &pin_PB04), + PERIPH(6, 8, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 5, &pin_PF08), + PERIPH(1, 5, &pin_PG09), + PERIPH(6, 5, &pin_PG12), + PERIPH(5, 5, &pin_PH07), + PERIPH(2, 5, &pin_PI02), + PERIPH(5, 5, &pin_PJ11), +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6, UART7, UART8}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, true, true, true, true, true}; + +const mcu_periph_obj_t mcu_uart_tx_list[25] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(4, 6, &pin_PA12), + PERIPH(7, 11, &pin_PA15), + PERIPH(7, 11, &pin_PB04), + PERIPH(1, 7, &pin_PB06), + PERIPH(5, 14, &pin_PB06), + PERIPH(4, 8, &pin_PB09), + PERIPH(3, 7, &pin_PB10), + PERIPH(5, 14, &pin_PB13), + PERIPH(1, 4, &pin_PB14), + PERIPH(6, 7, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(4, 8, &pin_PD01), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(8, 8, &pin_PE01), + PERIPH(7, 7, &pin_PE08), + PERIPH(7, 7, &pin_PF07), + PERIPH(6, 7, &pin_PG14), + PERIPH(4, 8, &pin_PH13), + PERIPH(8, 8, &pin_PJ08), +}; + +const mcu_periph_obj_t mcu_uart_rx_list[26] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(7, 11, &pin_PA08), + PERIPH(1, 7, &pin_PA10), + PERIPH(4, 6, &pin_PA11), + PERIPH(7, 11, &pin_PB03), + PERIPH(5, 14, &pin_PB05), + PERIPH(1, 7, &pin_PB07), + PERIPH(4, 8, &pin_PB08), + PERIPH(3, 7, &pin_PB11), + PERIPH(5, 14, &pin_PB12), + PERIPH(1, 4, &pin_PB15), + PERIPH(6, 7, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(4, 8, &pin_PD00), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(8, 8, &pin_PE00), + PERIPH(7, 7, &pin_PE07), + PERIPH(7, 7, &pin_PF06), + PERIPH(6, 7, &pin_PG09), + PERIPH(4, 8, &pin_PH14), + PERIPH(4, 8, &pin_PI09), + PERIPH(8, 8, &pin_PJ09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +//TODO: H7 has more timers than this, but are they tied to pins? +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, NULL, NULL, + NULL, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[58] = { + TIM(2, 1, 1, &pin_PA00), + TIM(5, 2, 1, &pin_PA00), + TIM(2, 1, 2, &pin_PA01), + TIM(5, 2, 2, &pin_PA01), + TIM(2, 1, 3, &pin_PA02), + TIM(5, 2, 3, &pin_PA02), + TIM(2, 1, 4, &pin_PA03), + TIM(5, 2, 4, &pin_PA03), + TIM(2, 1, 1, &pin_PA05), + TIM(3, 2, 1, &pin_PA06), + TIM(3, 2, 2, &pin_PA07), + TIM(1, 1, 1, &pin_PA08), + TIM(1, 1, 2, &pin_PA09), + TIM(1, 1, 3, &pin_PA10), + TIM(1, 1, 4, &pin_PA11), + TIM(2, 1, 1, &pin_PA15), + TIM(3, 2, 3, &pin_PB00), + TIM(3, 2, 4, &pin_PB01), + TIM(2, 1, 2, &pin_PB03), + TIM(3, 2, 1, &pin_PB04), + TIM(3, 2, 2, &pin_PB05), + TIM(4, 2, 1, &pin_PB06), + TIM(4, 2, 2, &pin_PB07), + TIM(4, 2, 3, &pin_PB08), + TIM(4, 2, 4, &pin_PB09), + TIM(2, 1, 3, &pin_PB10), + TIM(2, 1, 4, &pin_PB11), + TIM(3, 2, 1, &pin_PC06), + TIM(8, 3, 1, &pin_PC06), + TIM(3, 2, 2, &pin_PC07), + TIM(8, 3, 2, &pin_PC07), + TIM(3, 2, 3, &pin_PC08), + TIM(8, 3, 3, &pin_PC08), + TIM(3, 2, 4, &pin_PC09), + TIM(8, 3, 4, &pin_PC09), + TIM(4, 2, 1, &pin_PD12), + TIM(4, 2, 2, &pin_PD13), + TIM(4, 2, 3, &pin_PD14), + TIM(4, 2, 4, &pin_PD15), + TIM(1, 1, 1, &pin_PE09), + TIM(1, 1, 2, &pin_PE11), + TIM(1, 1, 3, &pin_PE13), + TIM(1, 1, 4, &pin_PE14), + TIM(5, 2, 1, &pin_PH10), + TIM(5, 2, 2, &pin_PH11), + TIM(5, 2, 3, &pin_PH12), + TIM(5, 2, 4, &pin_PI00), + TIM(8, 3, 4, &pin_PI02), + TIM(8, 3, 1, &pin_PI05), + TIM(8, 3, 2, &pin_PI06), + TIM(8, 3, 3, &pin_PI07), + TIM(8, 3, 2, &pin_PJ06), + TIM(8, 3, 1, &pin_PJ08), + TIM(1, 1, 3, &pin_PJ09), + TIM(8, 3, 2, &pin_PJ10), + TIM(1, 1, 2, &pin_PJ11), + TIM(8, 3, 3, &pin_PK00), + TIM(1, 1, 1, &pin_PK01), +}; diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h new file mode 100644 index 0000000000..4b852413b3 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[4]; + +const mcu_periph_obj_t mcu_i2c_sda_list[12]; +const mcu_periph_obj_t mcu_i2c_scl_list[12]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[6]; + +const mcu_periph_obj_t mcu_spi_sck_list[19]; +const mcu_periph_obj_t mcu_spi_mosi_list[19]; +const mcu_periph_obj_t mcu_spi_miso_list[16]; + +//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[25]; +const mcu_periph_obj_t mcu_uart_rx_list[26]; + +//Timers +#define TIM_BANK_ARRAY_LEN 14 +#define TIM_PIN_ARRAY_LEN 58 +TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c new file mode 100644 index 0000000000..491fe69385 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c @@ -0,0 +1,210 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" + +// Todo: some pins do have ADCs, but the module isn't set up yet. + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, NO_ADC); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, NO_ADC); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, NO_ADC); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, NO_ADC); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, NO_ADC); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, NO_ADC); +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, NO_ADC); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, NO_ADC); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, NO_ADC); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, NO_ADC); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, NO_ADC); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, NO_ADC); +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, NO_ADC); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, NO_ADC); +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); + +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); + +const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC); +const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC); +const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC); +const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC); +const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC); +const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC); +const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC); +const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC); +const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC); +const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC); +const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC); +const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC); +const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC); +const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC); +const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC); +const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC); + +const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC); +const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC); +const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC); +const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC); +const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC); +const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC); +const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC); +const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC); +const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC); +const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC); +const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC); +const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC); +const mcu_pin_obj_t pin_PI12 = PIN(8, 12, NO_ADC); +const mcu_pin_obj_t pin_PI13 = PIN(8, 13, NO_ADC); +const mcu_pin_obj_t pin_PI14 = PIN(8, 14, NO_ADC); +const mcu_pin_obj_t pin_PI15 = PIN(8, 15, NO_ADC); + +const mcu_pin_obj_t pin_PJ00 = PIN(9, 0, NO_ADC); +const mcu_pin_obj_t pin_PJ01 = PIN(9, 1, NO_ADC); +const mcu_pin_obj_t pin_PJ02 = PIN(9, 2, NO_ADC); +const mcu_pin_obj_t pin_PJ03 = PIN(9, 3, NO_ADC); +const mcu_pin_obj_t pin_PJ04 = PIN(9, 4, NO_ADC); +const mcu_pin_obj_t pin_PJ05 = PIN(9, 5, NO_ADC); +const mcu_pin_obj_t pin_PJ06 = PIN(9, 6, NO_ADC); +const mcu_pin_obj_t pin_PJ07 = PIN(9, 7, NO_ADC); +const mcu_pin_obj_t pin_PJ08 = PIN(9, 8, NO_ADC); +const mcu_pin_obj_t pin_PJ09 = PIN(9, 9, NO_ADC); +const mcu_pin_obj_t pin_PJ10 = PIN(9, 10, NO_ADC); +const mcu_pin_obj_t pin_PJ11 = PIN(9, 11, NO_ADC); +const mcu_pin_obj_t pin_PJ12 = PIN(9, 12, NO_ADC); +const mcu_pin_obj_t pin_PJ13 = PIN(9, 13, NO_ADC); +const mcu_pin_obj_t pin_PJ14 = PIN(9, 14, NO_ADC); +const mcu_pin_obj_t pin_PJ15 = PIN(9, 15, NO_ADC); + +const mcu_pin_obj_t pin_PK00 = PIN(10, 0, NO_ADC); +const mcu_pin_obj_t pin_PK01 = PIN(10, 1, NO_ADC); +const mcu_pin_obj_t pin_PK02 = PIN(10, 2, NO_ADC); +const mcu_pin_obj_t pin_PK03 = PIN(10, 3, NO_ADC); +const mcu_pin_obj_t pin_PK04 = PIN(10, 4, NO_ADC); +const mcu_pin_obj_t pin_PK05 = PIN(10, 5, NO_ADC); +const mcu_pin_obj_t pin_PK06 = PIN(10, 6, NO_ADC); +const mcu_pin_obj_t pin_PK07 = PIN(10, 7, NO_ADC); diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.h b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.h new file mode 100644 index 0000000000..7c4650dca3 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.h @@ -0,0 +1,199 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PINS_H + +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PF00; +extern const mcu_pin_obj_t pin_PF01; +extern const mcu_pin_obj_t pin_PF02; +extern const mcu_pin_obj_t pin_PF03; +extern const mcu_pin_obj_t pin_PF04; +extern const mcu_pin_obj_t pin_PF05; +extern const mcu_pin_obj_t pin_PF06; +extern const mcu_pin_obj_t pin_PF07; +extern const mcu_pin_obj_t pin_PF08; +extern const mcu_pin_obj_t pin_PF09; +extern const mcu_pin_obj_t pin_PF10; +extern const mcu_pin_obj_t pin_PF11; +extern const mcu_pin_obj_t pin_PF12; +extern const mcu_pin_obj_t pin_PF13; +extern const mcu_pin_obj_t pin_PF14; +extern const mcu_pin_obj_t pin_PF15; +extern const mcu_pin_obj_t pin_PG00; +extern const mcu_pin_obj_t pin_PG01; +extern const mcu_pin_obj_t pin_PG02; +extern const mcu_pin_obj_t pin_PG03; +extern const mcu_pin_obj_t pin_PG04; +extern const mcu_pin_obj_t pin_PG05; +extern const mcu_pin_obj_t pin_PG06; +extern const mcu_pin_obj_t pin_PG07; +extern const mcu_pin_obj_t pin_PG08; +extern const mcu_pin_obj_t pin_PG09; +extern const mcu_pin_obj_t pin_PG10; +extern const mcu_pin_obj_t pin_PG11; +extern const mcu_pin_obj_t pin_PG12; +extern const mcu_pin_obj_t pin_PG13; +extern const mcu_pin_obj_t pin_PG14; +extern const mcu_pin_obj_t pin_PG15; +extern const mcu_pin_obj_t pin_PH00; +extern const mcu_pin_obj_t pin_PH01; +extern const mcu_pin_obj_t pin_PH02; +extern const mcu_pin_obj_t pin_PH03; +extern const mcu_pin_obj_t pin_PH04; +extern const mcu_pin_obj_t pin_PH05; +extern const mcu_pin_obj_t pin_PH06; +extern const mcu_pin_obj_t pin_PH07; +extern const mcu_pin_obj_t pin_PH08; +extern const mcu_pin_obj_t pin_PH09; +extern const mcu_pin_obj_t pin_PH10; +extern const mcu_pin_obj_t pin_PH11; +extern const mcu_pin_obj_t pin_PH12; +extern const mcu_pin_obj_t pin_PH13; +extern const mcu_pin_obj_t pin_PH14; +extern const mcu_pin_obj_t pin_PH15; +extern const mcu_pin_obj_t pin_PI00; +extern const mcu_pin_obj_t pin_PI01; +extern const mcu_pin_obj_t pin_PI02; +extern const mcu_pin_obj_t pin_PI03; +extern const mcu_pin_obj_t pin_PI04; +extern const mcu_pin_obj_t pin_PI05; +extern const mcu_pin_obj_t pin_PI06; +extern const mcu_pin_obj_t pin_PI07; +extern const mcu_pin_obj_t pin_PI08; +extern const mcu_pin_obj_t pin_PI09; +extern const mcu_pin_obj_t pin_PI10; +extern const mcu_pin_obj_t pin_PI11; +extern const mcu_pin_obj_t pin_PI12; +extern const mcu_pin_obj_t pin_PI13; +extern const mcu_pin_obj_t pin_PI14; +extern const mcu_pin_obj_t pin_PI15; +extern const mcu_pin_obj_t pin_PJ00; +extern const mcu_pin_obj_t pin_PJ01; +extern const mcu_pin_obj_t pin_PJ02; +extern const mcu_pin_obj_t pin_PJ03; +extern const mcu_pin_obj_t pin_PJ04; +extern const mcu_pin_obj_t pin_PJ05; +extern const mcu_pin_obj_t pin_PJ06; +extern const mcu_pin_obj_t pin_PJ07; +extern const mcu_pin_obj_t pin_PJ08; +extern const mcu_pin_obj_t pin_PJ09; +extern const mcu_pin_obj_t pin_PJ10; +extern const mcu_pin_obj_t pin_PJ11; +extern const mcu_pin_obj_t pin_PJ12; +extern const mcu_pin_obj_t pin_PJ13; +extern const mcu_pin_obj_t pin_PJ14; +extern const mcu_pin_obj_t pin_PJ15; +extern const mcu_pin_obj_t pin_PK00; +extern const mcu_pin_obj_t pin_PK01; +extern const mcu_pin_obj_t pin_PK02; +extern const mcu_pin_obj_t pin_PK03; +extern const mcu_pin_obj_t pin_PK04; +extern const mcu_pin_obj_t pin_PK05; +extern const mcu_pin_obj_t pin_PK06; +extern const mcu_pin_obj_t pin_PK07; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PINS_H diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 948e9f2e4a..fa377e74a9 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -31,25 +31,29 @@ #include "tick.h" #include "common-hal/microcontroller/Pin.h" -#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 "stm32f4/clocks.h" -#include "stm32f4/gpio.h" +#if defined(STM32F4) + #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" +#endif -#include "stm32f4xx_hal.h" +#include "clocks.h" +#include "gpio.h" safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); + + #if defined(STM32F4) + __HAL_RCC_PWR_CLK_ENABLE(); + #endif - stm32f4_peripherals_clocks_init(); - stm32f4_peripherals_gpio_init(); + stm32_peripherals_clocks_init(); + stm32_peripherals_gpio_init(); tick_init(); @@ -58,12 +62,15 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); - i2c_reset(); - spi_reset(); - uart_reset(); - pwmout_reset(); - pulseout_reset(); - pulsein_reset(); + + #if defined(STM32F4) + i2c_reset(); + spi_reset(); + uart_reset(); + pwmout_reset(); + pulseout_reset(); + pulsein_reset(); + #endif } void reset_to_bootloader(void) { diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 358c2de5b3..a0c907a3d1 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -30,7 +30,6 @@ #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" -#include "stm32f4xx_hal.h" #include "py/mpconfig.h" @@ -74,7 +73,11 @@ void init_usb_hardware(void) { GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; + #if defined(STM32H7) + GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; + #else GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 11); never_reset_pin_number(0, 12); @@ -91,7 +94,11 @@ void init_usb_hardware(void) { GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; + #if defined(STM32H7) + GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; + #else GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 10); @@ -103,10 +110,16 @@ void init_usb_hardware(void) { HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); #endif - + + +#if defined(STM32H7) + HAL_PWREx_EnableUSBVoltageDetector(); + __HAL_RCC_USB2_OTG_FS_CLK_ENABLE(); +#else /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); +#endif init_usb_vbus_sense(); } diff --git a/ports/stm/system_stm32h7xx.c b/ports/stm/system_stm32h7xx.c new file mode 100644 index 0000000000..2132f26a0c --- /dev/null +++ b/ports/stm/system_stm32h7xx.c @@ -0,0 +1,425 @@ +/* + * Taken from ST Cube library and modified. See below for original header. + * + * Modifications copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + ****************************************************************************** + * @file system_stm32h7xx.c + * @author MCD Application Team + * @brief CMSIS Cortex-Mx Device Peripheral Access Layer System Source File. + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32h7xx.s" file. + * + * - SystemCoreClock variable: Contains the core clock, it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32h7xx_system + * @{ + */ + +/** @addtogroup STM32H7xx_System_Private_Includes + * @{ + */ + +#include "stm32h7xx.h" +#include +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_Defines + * @{ + */ + +/************************* Miscellaneous Configuration ************************/ +/*!< Uncomment the following line if you need to use initialized data in D2 domain SRAM (AHB SRAM) */ +/* #define DATA_IN_D2_SRAM */ + +/*!< Uncomment the following line if you need to relocate your vector Table in + Internal SRAM. */ +/* #define VECT_TAB_SRAM */ +#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field. + This value must be a multiple of 0x200. */ +/******************************************************************************/ + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_Variables + * @{ + */ + /* This variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock; then there + is no need to call the 2 first functions listed above, since SystemCoreClock + variable is updated automatically. + */ + uint32_t SystemCoreClock = 64000000; + uint32_t SystemD2Clock = 64000000; + const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32H7xx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system + * Initialize the FPU setting and vector table location + * configuration. + * @param None + * @retval None + */ +void SystemInit (void) +{ +#if defined (DATA_IN_D2_SRAM) + __IO uint32_t tmpreg; +#endif /* DATA_IN_D2_SRAM */ + + /* FPU settings ------------------------------------------------------------*/ + #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2))); /* set CP10 and CP11 Full Access */ + #endif + /* Reset the RCC clock configuration to the default reset state ------------*/ + /* Set HSION bit */ + RCC->CR |= RCC_CR_HSION; + + /* Reset CFGR register */ + RCC->CFGR = 0x00000000; + + /* Reset HSEON, CSSON , CSION,RC48ON, CSIKERON PLL1ON, PLL2ON and PLL3ON bits */ + RCC->CR &= 0xEAF6ED7FU; + +#if defined(D3_SRAM_BASE) + /* Reset D1CFGR register */ + RCC->D1CFGR = 0x00000000; + + /* Reset D2CFGR register */ + RCC->D2CFGR = 0x00000000; + + /* Reset D3CFGR register */ + RCC->D3CFGR = 0x00000000; +#else + /* Reset CDCFGR1 register */ + RCC->CDCFGR1 = 0x00000000; + + /* Reset CDCFGR2 register */ + RCC->CDCFGR2 = 0x00000000; + + /* Reset SRDCFGR register */ + RCC->SRDCFGR = 0x00000000; +#endif + /* Reset PLLCKSELR register */ + RCC->PLLCKSELR = 0x00000000; + + /* Reset PLLCFGR register */ + RCC->PLLCFGR = 0x00000000; + /* Reset PLL1DIVR register */ + RCC->PLL1DIVR = 0x00000000; + /* Reset PLL1FRACR register */ + RCC->PLL1FRACR = 0x00000000; + + /* Reset PLL2DIVR register */ + RCC->PLL2DIVR = 0x00000000; + + /* Reset PLL2FRACR register */ + + RCC->PLL2FRACR = 0x00000000; + /* Reset PLL3DIVR register */ + RCC->PLL3DIVR = 0x00000000; + + /* Reset PLL3FRACR register */ + RCC->PLL3FRACR = 0x00000000; + + /* Reset HSEBYP bit */ + RCC->CR &= 0xFFFBFFFFU; + + /* Disable all interrupts */ + RCC->CIER = 0x00000000; + +#if (STM32H7_DEV_ID == 0x450UL) + /* dual core CM7 or single core line */ + if((DBGMCU->IDCODE & 0xFFFF0000U) < 0x20000000U) + { + /* if stm32h7 revY*/ + /* Change the switch matrix read issuing capability to 1 for the AXI SRAM target (Target 7) */ + *((__IO uint32_t*)0x51008108) = 0x000000001U; + } +#endif + +#if defined (DATA_IN_D2_SRAM) + /* in case of initialized data in D2 SRAM (AHB SRAM) , enable the D2 SRAM clock (AHB SRAM clock) */ +#if defined(RCC_AHB2ENR_D2SRAM3EN) + RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN | RCC_AHB2ENR_D2SRAM3EN); +#elif defined(RCC_AHB2ENR_D2SRAM2EN) + RCC->AHB2ENR |= (RCC_AHB2ENR_D2SRAM1EN | RCC_AHB2ENR_D2SRAM2EN); +#else + RCC->AHB2ENR |= (RCC_AHB2ENR_AHBSRAM1EN | RCC_AHB2ENR_AHBSRAM2EN); +#endif /* RCC_AHB2ENR_D2SRAM3EN */ + + tmpreg = RCC->AHB2ENR; + (void) tmpreg; +#endif /* DATA_IN_D2_SRAM */ + +#if defined(DUAL_CORE) && defined(CORE_CM4) + /* Configure the Vector Table location add offset address for cortex-M4 ------------------*/ +#ifdef VECT_TAB_SRAM + SCB->VTOR = D2_AHBSRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ +#else + SCB->VTOR = FLASH_BANK2_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ +#endif /* VECT_TAB_SRAM */ + +#else + + /* Configure the Vector Table location add offset address for cortex-M7 ------------------*/ +#if !(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already + #ifdef VECT_TAB_SRAM + SCB->VTOR = D1_AXISRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal AXI-RAM */ + #else + SCB->VTOR = FLASH_BANK1_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + #endif +#endif + +#endif /*DUAL_CORE && CORE_CM4*/ + +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock , it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is CSI, SystemCoreClock will contain the CSI_VALUE(*) + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) + * - If SYSCLK source is PLL, SystemCoreClock will contain the CSI_VALUE(*), + * HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors. + * + * (*) CSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value + * 4 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * (**) HSI_VALUE is a constant defined in stm32h7xx_hal.h file (default value + * 64 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (***)HSE_VALUE is a constant defined in stm32h7xx_hal.h file (default value + * 25 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * @param None + * @retval None + */ +void SystemCoreClockUpdate (void) +{ + uint32_t pllp, pllsource, pllm, pllfracen, hsivalue, tmp; + uint32_t common_system_clock; + float_t fracn1, pllvco; + + + /* Get SYSCLK source -------------------------------------------------------*/ + + switch (RCC->CFGR & RCC_CFGR_SWS) + { + case RCC_CFGR_SWS_HSI: /* HSI used as system clock source */ + common_system_clock = (uint32_t) (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)); + break; + + case RCC_CFGR_SWS_CSI: /* CSI used as system clock source */ + common_system_clock = CSI_VALUE; + break; + + case RCC_CFGR_SWS_HSE: /* HSE used as system clock source */ + common_system_clock = HSE_VALUE; + break; + + case RCC_CFGR_SWS_PLL1: /* PLL1 used as system clock source */ + + /* PLL_VCO = (HSE_VALUE or HSI_VALUE or CSI_VALUE/ PLLM) * PLLN + SYSCLK = PLL_VCO / PLLR + */ + pllsource = (RCC->PLLCKSELR & RCC_PLLCKSELR_PLLSRC); + pllm = ((RCC->PLLCKSELR & RCC_PLLCKSELR_DIVM1)>> 4) ; + pllfracen = ((RCC->PLLCFGR & RCC_PLLCFGR_PLL1FRACEN)>>RCC_PLLCFGR_PLL1FRACEN_Pos); + fracn1 = (float_t)(uint32_t)(pllfracen* ((RCC->PLL1FRACR & RCC_PLL1FRACR_FRACN1)>> 3)); + + if (pllm != 0U) + { + switch (pllsource) + { + case RCC_PLLCKSELR_PLLSRC_HSI: /* HSI used as PLL clock source */ + + hsivalue = (HSI_VALUE >> ((RCC->CR & RCC_CR_HSIDIV)>> 3)) ; + pllvco = ( (float_t)hsivalue / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 ); + + break; + + case RCC_PLLCKSELR_PLLSRC_CSI: /* CSI used as PLL clock source */ + pllvco = ((float_t)CSI_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 ); + break; + + case RCC_PLLCKSELR_PLLSRC_HSE: /* HSE used as PLL clock source */ + pllvco = ((float_t)HSE_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 ); + break; + + default: + pllvco = ((float_t)CSI_VALUE / (float_t)pllm) * ((float_t)(uint32_t)(RCC->PLL1DIVR & RCC_PLL1DIVR_N1) + (fracn1/(float_t)0x2000) +(float_t)1 ); + break; + } + pllp = (((RCC->PLL1DIVR & RCC_PLL1DIVR_P1) >>9) + 1U ) ; + common_system_clock = (uint32_t)(float_t)(pllvco/(float_t)pllp); + } + else + { + common_system_clock = 0U; + } + break; + + default: + common_system_clock = CSI_VALUE; + break; + } + + /* Compute SystemClock frequency --------------------------------------------------*/ +#if defined (RCC_D1CFGR_D1CPRE) + tmp = D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_D1CPRE)>> RCC_D1CFGR_D1CPRE_Pos]; + + /* common_system_clock frequency : CM7 CPU frequency */ + common_system_clock >>= tmp; + + /* SystemD2Clock frequency : CM4 CPU, AXI and AHBs Clock frequency */ + SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->D1CFGR & RCC_D1CFGR_HPRE)>> RCC_D1CFGR_HPRE_Pos]) & 0x1FU)); + +#else + tmp = D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_CDCPRE)>> RCC_CDCFGR1_CDCPRE_Pos]; + + /* common_system_clock frequency : CM7 CPU frequency */ + common_system_clock >>= tmp; + + /* SystemD2Clock frequency : AXI and AHBs Clock frequency */ + SystemD2Clock = (common_system_clock >> ((D1CorePrescTable[(RCC->CDCFGR1 & RCC_CDCFGR1_HPRE)>> RCC_CDCFGR1_HPRE_Pos]) & 0x1FU)); + +#endif + +#if defined(DUAL_CORE) && defined(CORE_CM4) + SystemCoreClock = SystemD2Clock; +#else + SystemCoreClock = common_system_clock; +#endif /* DUAL_CORE && CORE_CM4 */ +} + + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/tick.c b/ports/stm/tick.c index f4adf183aa..67adc84e30 100644 --- a/ports/stm/tick.c +++ b/ports/stm/tick.c @@ -30,8 +30,6 @@ #include "supervisor/shared/tick.h" #include "shared-bindings/microcontroller/Processor.h" -#include "stm32f4xx.h" - void SysTick_Handler(void) { // SysTick interrupt handler called when the SysTick timer reaches zero // (every millisecond). diff --git a/ports/stm/tick.h b/ports/stm/tick.h index 999acc7a3c..17e96362dd 100644 --- a/ports/stm/tick.h +++ b/ports/stm/tick.h @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_TICK_H -#define MICROPY_INCLUDED_STM32F4_TICK_H +#ifndef MICROPY_INCLUDED_STM32_TICK_H +#define MICROPY_INCLUDED_STM32_TICK_H #include "py/mpconfig.h" @@ -41,4 +41,4 @@ void current_tick(uint64_t* ms, uint32_t* us_until_ms); // ticks_ms to increment. void wait_until(uint64_t ms, uint32_t us_until_ms); -#endif // MICROPY_INCLUDED_STM32F4_TICK_H +#endif // MICROPY_INCLUDED_STM32_TICK_H diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py new file mode 100644 index 0000000000..4ab636d79f --- /dev/null +++ b/ports/stm/tools/parse_af_csv.py @@ -0,0 +1,137 @@ +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2020 Lucian Copeland for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import csv +import sys + +# Use: parse_af_csf.py Filename.csv -pins-only + +# Most peripherals (SPI, I2C) output 3 values: +# peripheral index, alt function, pin string +def evaluate_periph(inper, inlist, periph, subtype, altfn, pin): + # ex) SPI1_SCK,SPI3_SCK/I2S3_CK + # Clean anything after a '\' due to SPI/I2S mixing + if not inper.find('/') == -1: + inper = inper[:inper.find('/')] + + if inper[:len(periph)] == periph and inper[-len(subtype):] == subtype: + inlist.append([inper[len(periph):len(periph)+1], altfn, pin]) + +# Timers (TIM) are a special case with 4 values +# timer index, alt function, channel, pin string +def evaluate_tim(inper, inlist, altfn, pin): + # ex) TIM2_CH1/TIM2_ETR, TIM5_CH1 + # Clean anything after a '\' to filter ETR + if not inper.find('/') == -1: + inper = inper[:inper.find('/')] + + if inper[:3] == "TIM" and inper[5:7] == "CH" and inper[-1:] != 'N': + inlist.append([inper[3:4],altfn,inper[-1:],pin]) + +# Open target file +with open(sys.argv[1]) as csv_file: + csv_reader = csv.reader(csv_file, delimiter=',') + line_count = 0 + + if sys.argv[2] != "-pins-only": + # List of peripheral pin types to read + todo = [ + ["I2C","SDA"], + ["I2C","SCL"], + ["SPI","SCK"], + ["SPI","MOSI"], + ["SPI","MISO"], + ["UART","TX"], + ["UART","RX"]] + + # Make a list of empty lists to populate + outlist = [] + for items in todo: + empty = [] + outlist.append(empty) + # TIM + empty = [] + outlist.append(empty) + + # Each line is a list of strings + for row in csv_reader: + altfn = 0 + pin = row[1] + if len(pin) < 4: + pin = pin[:2] + '0' + pin[2:] + for col in row: + array_index = 0 + # Evaluate the string for every possible todo entry + for item in todo: + evaluate_periph(col, outlist[array_index], item[0], item[1], altfn - 2, pin) + # UART special case, run again for USART variant + if item[0] == "UART": + evaluate_periph(col, outlist[array_index], "USART", item[1], altfn - 2, pin) + array_index += 1 + # TIM special case + evaluate_tim(col, outlist[-1], altfn - 2, pin) + altfn += 1 + line_count += 1 + + # Print formatted output + for i in range(len(todo)): + ins = (todo[i][0]).lower() + '_' + (todo[i][1]).lower() + '_' + # const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { + print("const mcu_" + ins + "obj_t mcu_" + ins + "list[" + str(len(outlist[i])) + "] = {") + for row in outlist[i]: + print(" PERIPH(" + row[0] + ", " + str(row[1]) + ", &pin_" + row[2] + "),") + print("};") + + # Timer special case: + print("const mcu_tim_pin_obj_t mcu_tim_pin_list[" + str(len(outlist[-1])) + "] = {") + for row in outlist[-1]: + print(" TIM(" + row[0] + ", " + str(row[1]) + ", " + str(row[2]) + ", &pin_" + row[3] + "),") + print("};") + + else: + # Format all viable pins listed + # ex) const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); + # ex 2) extern const mcu_pin_obj_t pin_PE02; + # TODO: add ADC detection + outlist = [] + + for row in csv_reader: + altfn = 0 + pin = row[1] + if len(pin) < 4: + pin = pin[:2] + '0' + pin[2:] + outlist.append([pin, str(ord(row[1][1:2]) - 65), row[1][2:4]]) + line_count += 1 + + for line in outlist: + print("const mcu_pin_obj_t pin_" + line[0] + " = PIN(" + line[1] + ", " + line[2] + ", NO_ADC);") + + for line in outlist: + print("extern const mcu_pin_obj_t pin_" + line[0] + ";") + + + + + print(f'Processed {line_count} lines.') + From 2ae9edcbff1113cbfd87c7c2bb5fd23f96fa2504 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Thu, 26 Mar 2020 17:13:46 -0400 Subject: [PATCH 131/919] Add new board BDMICRO 'Vina M0'. ports/atmel-samd/boards/bdmicro_vina_m0/board.c ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk ports/atmel-samd/boards/bdmicro_vina_m0/board.c This board includes the newly added MX25L51245G 64MB SPI flash chip for the CircuitPython file system. Also included is the PCF2129T/2,518 high accuracy, battery backed, RTC. Also includes an independent USB HOST connector in addition to USB DEVICE making it easy to connect USB peripherals. Designed mainly as a general purpose module to piggy back onto application-specific boards, it can also run low power standalone in harsh environments for data logging and other control applications using an appropriate enclosure. Has been extensively tested with CircuitPython and works well. --- .../atmel-samd/boards/bdmicro_vina-m0/board.c | 48 +++++++++++++++++++ .../boards/bdmicro_vina-m0/mpconfigboard.h | 35 ++++++++++++++ .../boards/bdmicro_vina-m0/mpconfigboard.mk | 18 +++++++ .../atmel-samd/boards/bdmicro_vina-m0/pins.c | 39 +++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 ports/atmel-samd/boards/bdmicro_vina-m0/board.c create mode 100644 ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/bdmicro_vina-m0/pins.c diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/board.c b/ports/atmel-samd/boards/bdmicro_vina-m0/board.c new file mode 100644 index 0000000000..bd63baa6fd --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina-m0/board.c @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) +{ + // struct port_config pin_conf; + // port_get_config_defaults(&pin_conf); + // + // pin_conf.direction = PORT_PIN_DIR_OUTPUT; + // port_pin_set_config(MICROPY_HW_LED_TX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_TX, true); + // + // port_pin_set_config(MICROPY_HW_LED_RX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_RX, true); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h new file mode 100644 index 0000000000..458b1e12a6 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h @@ -0,0 +1,35 @@ +#define MICROPY_HW_BOARD_NAME "BDMICRO Vina M0" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_STATUS (&pin_PA28) +#define MICROPY_HW_LED_TX &pin_PA27 +#define MICROPY_HW_LED_RX &pin_PA31 + +// Clock rates are off: Salae reads 12MHz which is the limit even though we set it to the safer 8MHz. +#define SPI_FLASH_BAUDRATE (8000000) + +#define SPI_FLASH_MOSI_PIN &pin_PB22 +#define SPI_FLASH_MISO_PIN &pin_PB03 +#define SPI_FLASH_SCK_PIN &pin_PB23 +#define SPI_FLASH_CS_PIN &pin_PA13 + +// These are pins not to reset. +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define BOARD_HAS_CRYSTAL 0 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk new file mode 100644 index 0000000000..1537540424 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x31e2 +USB_PID = 0x2002 +USB_PRODUCT = "Vina M0" +USB_MANUFACTURER = "BDMICRO LLC" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25L51245G" +LONGINT_IMPL = MPZ + +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_I2CSLAVE = 0 + +CFLAGS_INLINE_LIMIT = 60 +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/pins.c b/ports/atmel-samd/boards/bdmicro_vina-m0/pins.c new file mode 100644 index 0000000000..610d16d863 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina-m0/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_RTC_CLK), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_RTC_TS), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PGM_LED), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { 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); From d8769e32e14a807c3bb9b9d2addbaa0425fbab77 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Thu, 26 Mar 2020 22:08:28 -0400 Subject: [PATCH 132/919] Add bdmicro_vina-m0 board to workflows/build.yml. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb6bb28da3..3902433237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,7 @@ jobs: - "arduino_nano_33_ble" - "arduino_nano_33_iot" - "arduino_zero" + - "bdmicro_vina-m0" - "bast_pro_mini_m0" - "capablerobot_usbhub" - "catwan_usbstick" From 5e1b6b11e6a6fb4556151f1001aadf4bcf1c99ca Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 27 Mar 2020 07:24:12 -0400 Subject: [PATCH 133/919] Fix tab introduced when adding bdmicro_vina-m0 board, should be spaces. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3902433237..2ca9892486 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,7 +130,7 @@ jobs: - "arduino_nano_33_ble" - "arduino_nano_33_iot" - "arduino_zero" - - "bdmicro_vina-m0" + - "bdmicro_vina-m0" - "bast_pro_mini_m0" - "capablerobot_usbhub" - "catwan_usbstick" From 08ea95b22c3be4beb83cf9b3a647d3172a02ba35 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 27 Mar 2020 07:35:51 -0400 Subject: [PATCH 134/919] Fix sort. "bd" comes *after* "ba". --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ca9892486..1ca1dbebb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,8 +130,8 @@ jobs: - "arduino_nano_33_ble" - "arduino_nano_33_iot" - "arduino_zero" - - "bdmicro_vina-m0" - "bast_pro_mini_m0" + - "bdmicro_vina-m0" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" From 7fa38e87256f6fc770a4ad6d11a81fb610d047cb Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 27 Mar 2020 13:37:59 -0400 Subject: [PATCH 135/919] Update board name to bdmicro_vina_m0 to eliminate hyphens. --- .github/workflows/build.yml | 2 +- .../boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/board.c | 0 .../boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/mpconfigboard.h | 0 .../{bdmicro_vina-m0 => bdmicro_vina_m0}/mpconfigboard.mk | 0 .../boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/pins.c | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename ports/atmel-samd/boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/board.c (100%) rename ports/atmel-samd/boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/mpconfigboard.h (100%) rename ports/atmel-samd/boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/mpconfigboard.mk (100%) rename ports/atmel-samd/boards/{bdmicro_vina-m0 => bdmicro_vina_m0}/pins.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ca1dbebb0..0be05ade47 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -131,7 +131,7 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - - "bdmicro_vina-m0" + - "bdmicro_vina_m0" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/board.c b/ports/atmel-samd/boards/bdmicro_vina_m0/board.c similarity index 100% rename from ports/atmel-samd/boards/bdmicro_vina-m0/board.c rename to ports/atmel-samd/boards/bdmicro_vina_m0/board.c diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h similarity index 100% rename from ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.h rename to ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk similarity index 100% rename from ports/atmel-samd/boards/bdmicro_vina-m0/mpconfigboard.mk rename to ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk diff --git a/ports/atmel-samd/boards/bdmicro_vina-m0/pins.c b/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c similarity index 100% rename from ports/atmel-samd/boards/bdmicro_vina-m0/pins.c rename to ports/atmel-samd/boards/bdmicro_vina_m0/pins.c From 7995bcac4009d2b3e20f42a26de72d5411e7e462 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 27 Mar 2020 14:15:33 -0400 Subject: [PATCH 136/919] Flash additions --- ports/stm/supervisor/internal_flash.c | 109 ++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 7 deletions(-) diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 046b26baf2..46ccd218cd 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -36,8 +36,6 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -#include "stm32f4xx_hal.h" - typedef struct { uint32_t base_address; uint32_t sector_size; @@ -62,7 +60,11 @@ static const flash_layout_t flash_layout[] = { #endif }; -static uint8_t sector_copy[0x4000] __attribute__((aligned(4))); +#define NO_CACHE 0xffffffff +#define MAX_CACHE 0x4000 + +static uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); +static uint32_t _cache_flash_addr = NO_CACHE; //Return the sector of a given flash address. uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { @@ -101,6 +103,56 @@ uint32_t supervisor_flash_get_block_count(void) { } void supervisor_flash_flush(void) { + if (_cache_flash_addr == NO_CACHE) return; + + // Skip if data is the same + if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { + // unlock flash + HAL_FLASH_Unlock(); + + // set up for erase + FLASH_EraseInitTypeDef EraseInitStruct; + EraseInitStruct.TypeErase = TYPEERASE_SECTORS; + EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V + // get the sector information + uint32_t sector_size; + uint32_t sector_start_addr; + EraseInitStruct.Sector = flash_get_sector_info(_cache_flash_addr, §or_start_addr, §or_size); + EraseInitStruct.NbSectors = 1; + if (sector_size>0x4000) return false; + + // erase the sector + uint32_t SectorError = 0; + if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { + // error occurred during sector erase + HAL_FLASH_Lock(); // lock the flash + mp_printf(&mp_plat_print, "FLASH SECTOR ERASE ERROR"); + return false; + } + + __HAL_FLASH_DATA_CACHE_DISABLE(); + __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); + + __HAL_FLASH_DATA_CACHE_RESET(); + __HAL_FLASH_INSTRUCTION_CACHE_RESET(); + + __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); + __HAL_FLASH_DATA_CACHE_ENABLE(); + + // reprogram the sector + for (uint32_t i = 0; i < sector_size; i++) { + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)_flash_cache[i]) != HAL_OK) { + // error occurred during flash write + HAL_FLASH_Lock(); // lock the flash + mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); + return false; + } + sector_start_addr += 1; + } + + // lock the flash + HAL_FLASH_Lock(); + } } static int32_t convert_block_to_flash_addr(uint32_t block) { @@ -189,13 +241,56 @@ bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { return true; } -mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { +// mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { - for (size_t i = 0; i < num_blocks; i++) { - if (!supervisor_flash_write_block(src + i * FILESYSTEM_BLOCK_SIZE, block_num + i)) { - return 1; // error +// for (size_t i = 0; i < num_blocks; i++) { +// if (!supervisor_flash_write_block(src + i * FILESYSTEM_BLOCK_SIZE, block_num + i)) { +// return 1; // error +// } +// } +// return 0; // success +// } + +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { + while (num_blocks) { + int32_t dest = convert_block_to_flash_addr(block); + if (dest == -1) { + // bad block number + mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); + return false; } + + // unlock flash + HAL_FLASH_Unlock(); + + flash_get_sector_info(dest, §or_start_addr, §or_size); + + // Fail for any sector outside the 16k ones for now + if (sector_size > 0x4000) return false; + + // Find how many blocks are left in the sector + uint32_t count = (sector_size - (dest - sector_start_addr))/FILESYSTEM_BLOCK_SIZE; + count = MIN(num_blocks, count); ` + + if (_cache_flash_addr != sector_start_addr) { + // Write out anything in cache before overwriting it. + supervisor_flash_flush(); + + _cache_flash_addr = sector_start_addr; + + // Copy the current contents of the entire page into the cache. + memcpy(_flash_cache, (void *)sector_start_addr, sector_size); + } + + // Overwrite part or all of the sector cache with the src data. + memcpy(_flash_cache + (dest-sector_start_addr), src, count * FILESYSTEM_BLOCK_SIZE); + + // adjust for next run + block_num += count; + src += count * FILESYSTEM_BLOCK_SIZE; + num_blocks -= count; } + return 0; // success } From b043384949ccc4009898a258b74b6afbfd196723 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 Mar 2020 14:35:29 -0700 Subject: [PATCH 137/919] Update built in display init --- ports/atmel-samd/boards/hallowing_m0_express/board.c | 4 +++- ports/atmel-samd/boards/hallowing_m4_express/board.c | 4 +++- ports/atmel-samd/boards/monster_m4sk/board.c | 4 +++- ports/atmel-samd/boards/openbook_m4/board.c | 4 +++- ports/atmel-samd/boards/pewpew_m4/board.c | 4 +++- ports/atmel-samd/boards/pybadge/board.c | 4 +++- ports/atmel-samd/boards/pybadge_airlift/board.c | 4 +++- ports/atmel-samd/boards/pygamer/board.c | 4 +++- ports/atmel-samd/boards/pygamer_advance/board.c | 4 +++- ports/atmel-samd/boards/ugame10/board.c | 4 +++- ports/nrf/boards/clue_nrf52840_express/board.c | 4 +++- ports/nrf/boards/ohs2020_badge/board.c | 4 +++- ports/stm/boards/meowbit_v121/board.c | 6 ++++-- 13 files changed, 40 insertions(+), 14 deletions(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index b4c54062f6..326707b03d 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -79,7 +79,9 @@ void board_init(void) { &pin_PA28, // Command or data &pin_PA01, // Chip select &pin_PA27, // Reset - 12000000); + 12000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 6bb2a591f0..782ccd40a1 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_PB31, // TFT_DC Command or data &pin_PA27, // TFT_CS Chip select &pin_PB30, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 2377f4a9da..2bc353d5b7 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PA07, // TFT_DC Command or data &pin_PA06, // TFT_CS Chip select &pin_PA04, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 2d9b316474..02270e7e57 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -65,7 +65,9 @@ void board_init(void) { &pin_PB05, // EPD_DC Command or data &pin_PB07, // EPD_CS Chip select &pin_PA00, // EPD_RST Reset - 1000000); + 1000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_epaperdisplay_obj_t* display = &displays[0].epaper_display; display->base.type = &displayio_epaperdisplay_type; diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 5f5a01e48e..0cb091be7f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -107,7 +107,9 @@ void board_init(void) { &pin_PA16, // TFT_DC Command or data &pin_PA11, // TFT_CS Chip select &pin_PA17, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase uint32_t cfg0 = lookupCfg(CFG_DISPLAY_CFG0, 0x000000); uint32_t offX = (cfg0 >> 8) & 0xff; diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index bead06f3c6..8218a4545d 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -82,7 +82,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB07, // TFT_CS Chip select &pin_PA00, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 061f3d7772..94c3433b7a 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB06, // TFT_CS Chip select &pin_PB07, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 70d4a05dcd..cfa1d03b98 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -82,7 +82,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB12, // TFT_CS Chip select &pin_PA00, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index ff2da34a26..d1257cac7f 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PA00, // TFT_DC Command or data &pin_PB15, // TFT_CS Chip select &pin_PB05, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index ce389a2b1c..0a9ff089b0 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -79,7 +79,9 @@ void board_init(void) { &pin_PA09, // Command or data &pin_PA08, // Chip select NULL, // Reset - 24000000); + 24000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index e342c6d939..d87d98f7b6 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_P0_13, // TFT_DC Command or data &pin_P0_12, // TFT_CS Chip select &pin_P1_03, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 9e881d7639..6700fab278 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_P0_08, // TFT_DC Command or data &pin_P0_14, // TFT_CS Chip select &pin_P0_13, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index a0ae988249..5ab4bbedc0 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -61,7 +61,7 @@ uint8_t display_init_sequence[] = { 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2d, - 0x29, 0x25, 0x2B, 0x39, + 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, @@ -80,7 +80,9 @@ void board_init(void) { &pin_PA08, // Command or data &pin_PB12, // Chip select &pin_PB10, // Reset - 24000000); + 24000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; From e4c4a4a3defa3ebb48bf4e139553243afdd84e2b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 Mar 2020 14:39:59 -0700 Subject: [PATCH 138/919] Swap to committed dependencies --- .gitmodules | 2 +- ports/atmel-samd/peripherals | 2 +- ports/mimxrt10xx/sdk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6853d4fcac..5c3387077c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,7 +62,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_DotStar.git [submodule "ports/atmel-samd/peripherals"] path = ports/atmel-samd/peripherals - url = https://github.com/tannewt/samd-peripherals.git + url = https://github.com/adafruit/samd-peripherals.git [submodule "frozen/Adafruit_CircuitPython_Crickit"] path = frozen/Adafruit_CircuitPython_Crickit url = https://github.com/adafruit/Adafruit_CircuitPython_Crickit diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index bfbc88fd6b..6b531fc923 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit bfbc88fd6b2e2bb8f5e88836c0ba46eb80f97577 +Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 diff --git a/ports/mimxrt10xx/sdk b/ports/mimxrt10xx/sdk index 987a289f03..a733558021 160000 --- a/ports/mimxrt10xx/sdk +++ b/ports/mimxrt10xx/sdk @@ -1 +1 @@ -Subproject commit 987a289f03ec45c75c7d39a5a8dec5862eacaf5b +Subproject commit a7335580210bd8fd385cc03fd45628b5463a4c77 From 798118b74f8ba408a6bbfe92d6ba925c68e388bf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 Mar 2020 14:52:35 -0700 Subject: [PATCH 139/919] Update board.c's to remove remaining tick.h --- .../boards/hallowing_m0_express/board.c | 2 - .../boards/hallowing_m4_express/board.c | 1 - ports/atmel-samd/boards/monster_m4sk/board.c | 1 - ports/atmel-samd/boards/openbook_m4/board.c | 1 - ports/atmel-samd/boards/pewpew_m4/board.c | 1 - ports/atmel-samd/boards/pybadge/board.c | 1 - .../atmel-samd/boards/pybadge_airlift/board.c | 1 - ports/atmel-samd/boards/pygamer/board.c | 1 - .../atmel-samd/boards/pygamer_advance/board.c | 1 - ports/atmel-samd/boards/pyportal/board.c | 2 - .../atmel-samd/boards/pyportal_titano/board.c | 2 - ports/atmel-samd/boards/ugame10/board.c | 2 - ports/mimxrt10xx/common-hal/time/__init__.c | 49 ------------------- .../nrf/boards/clue_nrf52840_express/board.c | 1 - ports/nrf/boards/ohs2020_badge/board.c | 1 - ports/stm/common-hal/time/__init__.c | 45 ----------------- 16 files changed, 112 deletions(-) delete mode 100644 ports/mimxrt10xx/common-hal/time/__init__.c delete mode 100644 ports/stm/common-hal/time/__init__.c diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index b4c54062f6..db56f95307 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -32,8 +32,6 @@ #include "shared-module/displayio/mipi_constants.h" #include "shared-bindings/busio/SPI.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 6bb2a591f0..2551106561 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 2377f4a9da..85e360b207 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 2d9b316474..93a8301249 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -32,7 +32,6 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 5f5a01e48e..a6bda9819e 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index bead06f3c6..de0f72fad9 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 061f3d7772..2496dcf503 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 70d4a05dcd..6fc05ff968 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index ff2da34a26..17abfa30ab 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -32,7 +32,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index 2a72897784..62bf7e2165 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -31,8 +31,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" - #define DELAY 0x80 uint8_t display_init_sequence[] = { diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 828ceebc4e..b7c2cc45b1 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -34,8 +34,6 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" - #define DELAY 0x80 uint8_t display_init_sequence[] = { diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index ce389a2b1c..c573ba6e16 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -32,8 +32,6 @@ #include "shared-module/displayio/mipi_constants.h" #include "shared-bindings/busio/SPI.h" -#include "tick.h" - displayio_fourwire_obj_t board_display_obj; #define DELAY 0x80 diff --git a/ports/mimxrt10xx/common-hal/time/__init__.c b/ports/mimxrt10xx/common-hal/time/__init__.c deleted file mode 100644 index 524e31d1ae..0000000000 --- a/ports/mimxrt10xx/common-hal/time/__init__.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 "py/mphal.h" - -#include "shared-bindings/time/__init__.h" - -#include "supervisor/shared/tick.h" - -#include "tick.h" - -inline uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} - -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index e342c6d939..4206ff0209 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 9e881d7639..15a9d46e9e 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -31,7 +31,6 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" -#include "tick.h" displayio_fourwire_obj_t board_display_obj; diff --git a/ports/stm/common-hal/time/__init__.c b/ports/stm/common-hal/time/__init__.c deleted file mode 100644 index c85077868a..0000000000 --- a/ports/stm/common-hal/time/__init__.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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 "py/mphal.h" - -#include "tick.h" - -uint64_t common_hal_time_monotonic(void) { - return supervisor_ticks_ms64(); -} - -uint64_t common_hal_time_monotonic_ns(void) { - uint64_t ms; - uint32_t us_until_ms; - current_tick(&ms, &us_until_ms); - // us counts down. - return 1000 * (ms * 1000 + (1000 - us_until_ms)); -} - -void common_hal_time_delay_ms(uint32_t delay) { - mp_hal_delay_ms(delay); -} From a4a458943d1129c691b6585b1f71439db233d4df Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 27 Mar 2020 15:40:17 -0700 Subject: [PATCH 140/919] Correct MIMXRT sdk version --- ports/mimxrt10xx/sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/sdk b/ports/mimxrt10xx/sdk index a733558021..8363ff7bed 160000 --- a/ports/mimxrt10xx/sdk +++ b/ports/mimxrt10xx/sdk @@ -1 +1 @@ -Subproject commit a7335580210bd8fd385cc03fd45628b5463a4c77 +Subproject commit 8363ff7bed7533b9e7e6a6239aace3d6da14f349 From e2be0696865992cda67f5bdeba5aeb5b4c2fdcd4 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Sat, 28 Mar 2020 18:30:46 -0400 Subject: [PATCH 141/919] Support cached internal flash on the H743 --- ports/stm/Makefile | 5 +- .../board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 4 +- .../pins.c | 2 +- .../stm32h7xx_hal_conf.h | 0 ports/stm/peripherals/periph.h | 11 +- ports/stm/supervisor/internal_flash.c | 237 ++++++++++-------- ports/stm/supervisor/internal_flash.h | 28 ++- ports/stm/tools/examples/nucleo_h743.csv | 130 ++++++++++ ports/stm/tools/examples/stm32f405.csv | 142 +++++++++++ ports/stm/tools/parse_af_csv.py | 8 +- ports/stm/tools/parse_pins_csv.py | 49 ++++ 13 files changed, 483 insertions(+), 133 deletions(-) rename ports/stm/boards/{stm32h743zi_discovery => stm32h743zi2_discovery}/board.c (100%) rename ports/stm/boards/{stm32h743zi_discovery => stm32h743zi2_discovery}/mpconfigboard.h (100%) rename ports/stm/boards/{stm32h743zi_discovery => stm32h743zi2_discovery}/mpconfigboard.mk (81%) rename ports/stm/boards/{stm32h743zi_discovery => stm32h743zi2_discovery}/pins.c (99%) rename ports/stm/boards/{stm32h743zi_discovery => stm32h743zi2_discovery}/stm32h7xx_hal_conf.h (100%) create mode 100644 ports/stm/tools/examples/nucleo_h743.csv create mode 100644 ports/stm/tools/examples/stm32f405.csv create mode 100644 ports/stm/tools/parse_pins_csv.py diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 2eedcca113..ef70cad81e 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -187,10 +187,7 @@ SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ ll_rcc.c \ ll_utils.c \ ll_exti.c \ - ) -#removed: -# hal_flash_ramfunc.c \ -# ll_fsmc.c \ +) SRC_STM32 += system_stm32$(MCU_SERIES_LOWER)xx.c diff --git a/ports/stm/boards/stm32h743zi_discovery/board.c b/ports/stm/boards/stm32h743zi2_discovery/board.c similarity index 100% rename from ports/stm/boards/stm32h743zi_discovery/board.c rename to ports/stm/boards/stm32h743zi2_discovery/board.c diff --git a/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h b/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.h similarity index 100% rename from ports/stm/boards/stm32h743zi_discovery/mpconfigboard.h rename to ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.h diff --git a/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk b/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk similarity index 81% rename from ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk rename to ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk index d2f8905368..3a37ffe75d 100644 --- a/ports/stm/boards/stm32h743zi_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk @@ -2,9 +2,9 @@ USB_VID = 0x239A #REPLACE USB_PID = 0x808A #REPLACE USB_PRODUCT = "STM32H743ZI Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,HID" +USB_DEVICES = "CDC,MSC" -DISABLE_FILESYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 MCU_SERIES = H7 MCU_VARIANT = STM32H743xx diff --git a/ports/stm/boards/stm32h743zi_discovery/pins.c b/ports/stm/boards/stm32h743zi2_discovery/pins.c similarity index 99% rename from ports/stm/boards/stm32h743zi_discovery/pins.c rename to ports/stm/boards/stm32h743zi2_discovery/pins.c index eceea93820..dc2db9e184 100644 --- a/ports/stm/boards/stm32h743zi_discovery/pins.c +++ b/ports/stm/boards/stm32h743zi2_discovery/pins.c @@ -86,7 +86,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PE01) }, { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PB09) }, diff --git a/ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h b/ports/stm/boards/stm32h743zi2_discovery/stm32h7xx_hal_conf.h similarity index 100% rename from ports/stm/boards/stm32h743zi_discovery/stm32h7xx_hal_conf.h rename to ports/stm/boards/stm32h743zi2_discovery/stm32h7xx_hal_conf.h diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index aaf41361e6..394ab25b11 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -33,12 +33,12 @@ #include STM32_HAL_H #include "pins.h" -// PERIPH +// Comm Peripherals typedef struct { - uint8_t periph_index:4; // Index of the I2C unit (1 to 3) - uint8_t altfn_index:4; //Index of the altfn for this pin (0 to 15) - const mcu_pin_obj_t * pin; + uint8_t periph_index:4; // Index of the peripheral instance + uint8_t altfn_index:4; // Index of the altfn for this pin (0 to 15) + const mcu_pin_obj_t * pin; // Pin Object } mcu_periph_obj_t; #define PERIPH(index, alt, p_pin) \ @@ -48,7 +48,8 @@ typedef struct { .pin = p_pin, \ } -//Timers +// Timer Peripheral + typedef struct { uint8_t tim_index:4; uint8_t altfn_index:4; diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 46ccd218cd..003ccdd908 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -35,6 +35,7 @@ #include "py/obj.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/shared/safe_mode.h" typedef struct { uint32_t base_address; @@ -46,7 +47,9 @@ typedef struct { /* Internal Flash API *------------------------------------------------------------------*/ -static const flash_layout_t flash_layout[] = { +#if defined(STM32F4) + +STATIC const flash_layout_t flash_layout[] = { { 0x08000000, 0x04000, 4 }, { 0x08010000, 0x10000, 1 }, { 0x08020000, 0x20000, 3 }, @@ -59,12 +62,45 @@ static const flash_layout_t flash_layout[] = { { 0x08120000, 0x20000, 7 }, #endif }; +STATIC uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); + +#elif defined(STM32H7) + +STATIC const flash_layout_t flash_layout[] = { + { 0x08000000, 0x20000, 16 }, +}; +STATIC uint8_t _flash_cache[0x20000] __attribute__((aligned(4))); + +#else + #error Unsupported processor +#endif #define NO_CACHE 0xffffffff #define MAX_CACHE 0x4000 -static uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); -static uint32_t _cache_flash_addr = NO_CACHE; + +STATIC uint32_t _cache_flash_addr = NO_CACHE; + +#if defined(STM32H7) +// get the bank of a given flash address +STATIC uint32_t get_bank(uint32_t addr) { + if (READ_BIT(FLASH->OPTCR, FLASH_OPTCR_SWAP_BANK) == 0) { + // no bank swap + if (addr < (FLASH_BASE + FLASH_BANK_SIZE)) { + return FLASH_BANK_1; + } else { + return FLASH_BANK_2; + } + } else { + // bank swap + if (addr < (FLASH_BASE + FLASH_BANK_SIZE)) { + return FLASH_BANK_2; + } else { + return FLASH_BANK_1; + } + } +} +#endif //Return the sector of a given flash address. uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size) { @@ -105,51 +141,99 @@ uint32_t supervisor_flash_get_block_count(void) { void supervisor_flash_flush(void) { if (_cache_flash_addr == NO_CACHE) return; + #if defined(STM32H7) + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS_BANK1 | FLASH_FLAG_ALL_ERRORS_BANK2); + #else + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | + FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); + #endif + + // set up for erase + FLASH_EraseInitTypeDef EraseInitStruct; + EraseInitStruct.TypeErase = TYPEERASE_SECTORS; + EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V + // get the sector information + uint32_t sector_size; + uint32_t sector_start_addr; + #if defined(STM32H7) + EraseInitStruct.Banks = get_bank(_cache_flash_addr); + #endif + EraseInitStruct.Sector = flash_get_sector_info(_cache_flash_addr, §or_start_addr, §or_size); + EraseInitStruct.NbSectors = 1; + if (sector_size > sizeof(_flash_cache)) { + __ASM volatile ("bkpt"); + mp_printf(&mp_plat_print, "FLASH ERR: invalid sector\n"); + reset_into_safe_mode(FLASH_WRITE_FAIL); + } + // Skip if data is the same - if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { + if (memcmp(_flash_cache, (void *)_cache_flash_addr, sector_size) != 0) { // unlock flash HAL_FLASH_Unlock(); - // set up for erase - FLASH_EraseInitTypeDef EraseInitStruct; - EraseInitStruct.TypeErase = TYPEERASE_SECTORS; - EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V - // get the sector information - uint32_t sector_size; - uint32_t sector_start_addr; - EraseInitStruct.Sector = flash_get_sector_info(_cache_flash_addr, §or_start_addr, §or_size); - EraseInitStruct.NbSectors = 1; - if (sector_size>0x4000) return false; - // erase the sector uint32_t SectorError = 0; if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { // error occurred during sector erase HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH SECTOR ERASE ERROR"); - return false; + __ASM volatile ("bkpt"); + mp_printf(&mp_plat_print, "FLASH ERR: erase failure\n"); + reset_into_safe_mode(FLASH_WRITE_FAIL); } - __HAL_FLASH_DATA_CACHE_DISABLE(); - __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); + // __HAL_FLASH_DATA_CACHE_DISABLE(); + // __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); - __HAL_FLASH_DATA_CACHE_RESET(); - __HAL_FLASH_INSTRUCTION_CACHE_RESET(); + // __HAL_FLASH_DATA_CACHE_RESET(); + // __HAL_FLASH_INSTRUCTION_CACHE_RESET(); - __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); - __HAL_FLASH_DATA_CACHE_ENABLE(); + // __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); + // __HAL_FLASH_DATA_CACHE_ENABLE(); - // reprogram the sector - for (uint32_t i = 0; i < sector_size; i++) { - if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)_flash_cache[i]) != HAL_OK) { + // // reprogram the sector + // for (uint32_t i = 0; i < sector_size; i++) { + // if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)_flash_cache[i]) != HAL_OK) { + // // error occurred during flash write + // HAL_FLASH_Lock(); // lock the flash + // mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); + // } + // sector_start_addr += 1; + // } + + uint32_t * cache_addr = (uint32_t*)_flash_cache; + + #if defined(STM32H7) + for (uint32_t i = 0; i < (sector_size / 32); i++) { + // Note that the STM32H7 HAL interface differs by taking an address, not 64 bit data + // This is because ST's code is written by a large room of chimpanzees + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, sector_start_addr, + (uint32_t)cache_addr) != HAL_OK) { // error occurred during flash write HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); - return false; + __ASM volatile ("bkpt"); + reset_into_safe_mode(FLASH_WRITE_FAIL); } - sector_start_addr += 1; + // RAM memory is by word (4 byte), but flash memory is by byte + cache_addr += 8; + sector_start_addr += 32; } + #else // STM32F4 + // program the flash word by word + for (uint32_t i = 0; i < sector_size / 4; i++) { + if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, sector_start_addr, + (uint64_t)*cache_addr) != HAL_OK) { + // error occurred during flash write + HAL_FLASH_Lock(); // lock the flash + __ASM volatile ("bkpt"); + reset_into_safe_mode(FLASH_WRITE_FAIL); + } + // RAM memory is by word (4 byte), but flash memory is by byte + cache_addr += 1; + sector_start_addr += 4; + } + #endif + // lock the flash HAL_FLASH_Lock(); } @@ -165,6 +249,9 @@ static int32_t convert_block_to_flash_addr(uint32_t block) { } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { + // Must write out anything in cache before trying to read. + supervisor_flash_flush(); + int32_t src = convert_block_to_flash_addr(block); if (src == -1) { // bad block number @@ -174,88 +261,12 @@ mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t n return 0; // success } -bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { - int32_t dest = convert_block_to_flash_addr(block); - if (dest == -1) { - // bad block number - mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); - return false; - } - - // unlock flash - HAL_FLASH_Unlock(); - - // set up for erase - FLASH_EraseInitTypeDef EraseInitStruct; - EraseInitStruct.TypeErase = TYPEERASE_SECTORS; - EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V - // get the sector information - uint32_t sector_size; - uint32_t sector_start_addr; - EraseInitStruct.Sector = flash_get_sector_info(dest, §or_start_addr, §or_size); - EraseInitStruct.NbSectors = 1; - if (sector_size>0x4000) return false; - - // copy the sector - memcpy(sector_copy,(void *)sector_start_addr,sector_size); - - // // overwrite sector data - memcpy(sector_copy+(dest-sector_start_addr),src,FILESYSTEM_BLOCK_SIZE); - - // find end address, subtract for number of sectors - // Shouldn't be required since blocks will always fit in a single sector, they should never overlap - //EraseInitStruct.NbSectors = flash_get_sector_info(dest + FILESYSTEM_BLOCK_SIZE - 1, NULL, NULL) - EraseInitStruct.Sector + 1; - - // erase the sector - uint32_t SectorError = 0; - if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { - // error occurred during sector erase - HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH SECTOR ERASE ERROR"); - return false; - } - - __HAL_FLASH_DATA_CACHE_DISABLE(); - __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); - - __HAL_FLASH_DATA_CACHE_RESET(); - __HAL_FLASH_INSTRUCTION_CACHE_RESET(); - - __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); - __HAL_FLASH_DATA_CACHE_ENABLE(); - - // reprogram the sector - for (uint32_t i = 0; i < sector_size; i++) { - if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)sector_copy[i]) != HAL_OK) { - // error occurred during flash write - HAL_FLASH_Lock(); // lock the flash - mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); - return false; - } - sector_start_addr += 1; - } - - // lock the flash - HAL_FLASH_Lock(); - - return true; -} - -// mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { - -// for (size_t i = 0; i < num_blocks; i++) { -// if (!supervisor_flash_write_block(src + i * FILESYSTEM_BLOCK_SIZE, block_num + i)) { -// return 1; // error -// } -// } -// return 0; // success -// } - mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { while (num_blocks) { - int32_t dest = convert_block_to_flash_addr(block); + int32_t dest = convert_block_to_flash_addr(block_num); if (dest == -1) { // bad block number + __ASM volatile ("bkpt"); mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); return false; } @@ -263,14 +274,20 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, // unlock flash HAL_FLASH_Unlock(); + uint32_t sector_size; + uint32_t sector_start_addr; flash_get_sector_info(dest, §or_start_addr, §or_size); // Fail for any sector outside the 16k ones for now - if (sector_size > 0x4000) return false; + if (sector_size > sizeof(_flash_cache)) { + __ASM volatile ("bkpt"); + mp_printf(&mp_plat_print, "FLASH ERR: invalid sector\n"); + reset_into_safe_mode(FLASH_WRITE_FAIL); + } // Find how many blocks are left in the sector uint32_t count = (sector_size - (dest - sector_start_addr))/FILESYSTEM_BLOCK_SIZE; - count = MIN(num_blocks, count); ` + count = MIN(num_blocks, count); if (_cache_flash_addr != sector_start_addr) { // Write out anything in cache before overwriting it. diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 859470ff09..37f0b25e46 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -4,7 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,8 +24,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H -#define MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H +#ifndef MICROPY_INCLUDED_STM32_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_STM32_INTERNAL_FLASH_H #include #include @@ -35,6 +35,8 @@ #ifdef STM32F401xE #define STM32_FLASH_SIZE 0x80000 //512KiB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F411xE @@ -43,30 +45,42 @@ #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB #else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #endif #ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F405xx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F407xx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) +#endif + +#ifdef STM32H743xx +#define STM32_FLASH_SIZE 0x200000 //2MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 //128KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08020000 +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #define STM32_FLASH_OFFSET 0x8000000 //All STM32 chips map to this flash location -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) - #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) -#endif // MICROPY_INCLUDED_STM32F4_INTERNAL_FLASH_H +#endif // MICROPY_INCLUDED_STM32_INTERNAL_FLASH_H diff --git a/ports/stm/tools/examples/nucleo_h743.csv b/ports/stm/tools/examples/nucleo_h743.csv new file mode 100644 index 0000000000..2481415b30 --- /dev/null +++ b/ports/stm/tools/examples/nucleo_h743.csv @@ -0,0 +1,130 @@ +A0,PA3 +A1,PC0 +A2,PC3 +A3,PB1 +A4,PC2 +A5,PF10 +A6,PF4 +A7,PF5 +A8,PF6 +D0,PB7 +D1,PB6 +D2,PG14 +D3,PE13 +D4,PE14 +D5,PE11 +D6,PE9 +D7,PG12 +D8,PF3 +D9,PD15 +D10,PD14 +D11,PB5 +D12,PA6 +D13,PA7 +D14,PB9 +D15,PB8 +D16,PC6 +D17,PB15 +D18,PB13 +D19,PB12 +D20,PA15 +D21,PC7 +D22,PB5 +D23,PB3 +D24,PA4 +D25,PB4 +D26,PG6 +D27,PB2 +D28,PD13 +D29,PD12 +D30,PD11 +D31,PE2 +D32,PA0 +D33,PB0 +D34,PE0 +D35,PB11 +D36,PB10 +D37,PE15 +D38,PE6 +D39,PE12 +D40,PE10 +D41,PE7 +D42,PE8 +D43,PC8 +D44,PC9 +D45,PC10 +D46,PC11 +D47,PC12 +D48,PD2 +D49,PG2 +D50,PG3 +D51,PD7 +D52,PD6 +D53,PD5 +D54,PD4 +D55,PD3 +D56,PE2 +D57,PE4 +D58,PE5 +D59,PE6 +D60,PE3 +D61,PF8 +D62,PF7 +D63,PF9 +D64,PG1 +D65,PG0 +D66,PD1 +D67,PD0 +D68,PF0 +D69,PF1 +D70,PF2 +D71,PE9 +D72,PB2 +DAC1,PA4 +DAC2,PA5 +LED1,PB0 +LED2,PB7 +LED3,PB14 +SW,PC13 +I2C1_SDA,PB9 +I2C1_SCL,PB8 +I2C2_SDA,PF0 +I2C2_SCL,PF1 +I2C4_SCL,PF14 +I2C4_SDA,PF15 +SD_D0,PC8 +SD_D1,PC9 +SD_D2,PC10 +SD_D3,PC11 +SD_CMD,PD2 +SD_CK,PC12 +SD_SW,PG2 +OTG_FS_POWER,PG6 +OTG_FS_OVER_CURRENT,PG7 +USB_VBUS,PA9 +USB_ID,PA10 +USB_DM,PA11 +USB_DP,PA12 +UART2_TX,PD5 +UART2_RX,PD6 +UART2_RTS,PD4 +UART2_CTS,PD3 +UART3_TX,PD8 +UART3_RX,PD9 +UART5_TX,PB6 +UART5_RX,PB12 +UART6_TX,PC6 +UART6_RX,PC7 +UART7_TX,PF7 +UART7_RX,PF6 +UART8_TX,PE1 +UART8_RX,PE0 +ETH_MDC,PC1 +ETH_MDIO,PA2 +ETH_RMII_REF_CLK,PA1 +ETH_RMII_CRS_DV,PA7 +ETH_RMII_RXD0,PC4 +ETH_RMII_RXD1,PC5 +ETH_RMII_TX_EN,PG11 +ETH_RMII_TXD0,PG13 +ETH_RMII_TXD1,PB13 \ No newline at end of file diff --git a/ports/stm/tools/examples/stm32f405.csv b/ports/stm/tools/examples/stm32f405.csv new file mode 100644 index 0000000000..2602db8775 --- /dev/null +++ b/ports/stm/tools/examples/stm32f405.csv @@ -0,0 +1,142 @@ +Port,,AF0,AF1,AF2,AF3,AF4,AF5,AF6,AF7,AF8,AF9,AF10,AF11,AF12,AF13,AF14,AF15, +,,SYS,TIM1/2,TIM3/4/5,TIM8/9/10/11,I2C1/2/3,SPI1/SPI2/I2S2/I2S2ext,SPI3/I2Sext/I2S3,USART1/2/3/I2S3ext,UART4/5/USART6,CAN1/CAN2/TIM12/13/14,OTG_FS/OTG_HS,ETH,FSMC/SDIO/OTG_FS,DCMI,,,ADC +PortA,PA0,,TIM2_CH1/TIM2_ETR,TIM5_CH1,TIM8_ETR,,,,USART2_CTS,UART4_TX,,,ETH_MII_CRS,,,,EVENTOUT,ADC123_IN0 +PortA,PA1,,TIM2_CH2,TIM5_CH2,,,,,USART2_RTS,UART4_RX,,,ETH_MII_RX_CLK/ETH_RMII_REF_CLK,,,,EVENTOUT,ADC123_IN1 +PortA,PA2,,TIM2_CH3,TIM5_CH3,TIM9_CH1,,,,USART2_TX,,,,ETH_MDIO,,,,EVENTOUT,ADC123_IN2 +PortA,PA3,,TIM2_CH4,TIM5_CH4,TIM9_CH2,,,,USART2_RX,,,OTG_HS_ULPI_D0,ETH_MII_COL,,,,EVENTOUT,ADC123_IN3 +PortA,PA4,,,,,,SPI1_NSS,SPI3_NSS/I2S3_WS,USART2_CK,,,,,OTG_HS_SOF,DCMI_HSYNC,,EVENTOUT,ADC12_IN4 +PortA,PA5,,TIM2_CH1/TIM2_ETR,,TIM8_CH1N,,SPI1_SCK,,,,,OTG_HS_ULPI_CK,,,,,EVENTOUT,ADC12_IN5 +PortA,PA6,,TIM1_BKIN,TIM3_CH1,TIM8_BKIN,,SPI1_MISO,,,,TIM13_CH1,,,,DCMI_PIXCK,,EVENTOUT,ADC12_IN6 +PortA,PA7,,TIM1_CH1N,TIM3_CH2,TIM8_CH1N,,SPI1_MOSI,,,,TIM14_CH1,,ETH_MII_RX_DV/ETH_RMII_CRS_DV,,,,EVENTOUT,ADC12_IN7 +PortA,PA8,MCO1,TIM1_CH1,,,I2C3_SCL,,,USART1_CK,,,OTG_FS_SOF,,,,,EVENTOUT, +PortA,PA9,,TIM1_CH2,,,I2C3_SMBA,,,USART1_TX,,,,,,DCMI_D0,,EVENTOUT, +PortA,PA10,,TIM1_CH3,,,,,,USART1_RX,,,OTG_FS_ID,,,DCMI_D1,,EVENTOUT, +PortA,PA11,,TIM1_CH4,,,,,,USART1_CTS,,CAN1_RX,OTG_FS_DM,,,,,EVENTOUT, +PortA,PA12,,TIM1_ETR,,,,,,USART1_RTS,,CAN1_TX,OTG_FS_DP,,,,,EVENTOUT, +PortA,PA13,JTMS/SWDIO,,,,,,,,,,,,,,,EVENTOUT, +PortA,PA14,JTCK/SWCLK,,,,,,,,,,,,,,,EVENTOUT, +PortA,PA15,JTDI,TIM2_CH1/TIM2_ETR,,,,SPI1_NSS,SPI3_NSS/I2S3_WS,,,,,,,,,EVENTOUT, +PortB,PB0,,TIM1_CH2N,TIM3_CH3,TIM8_CH2N,,,,,,,OTG_HS_ULPI_D1,ETH_MII_RXD2,,,,EVENTOUT,ADC12_IN8 +PortB,PB1,,TIM1_CH3N,TIM3_CH4,TIM8_CH3N,,,,,,,OTG_HS_ULPI_D2,ETH_MII_RXD3,,,,EVENTOUT,ADC12_IN9 +PortB,PB2,,,,,,,,,,,,,,,,EVENTOUT, +PortB,PB3,JTDO/TRACESWO,TIM2_CH2,,,,SPI1_SCK,SPI3_SCK/I2S3_CK,,,,,,,,,EVENTOUT, +PortB,PB4,NJTRST,,TIM3_CH1,,,SPI1_MISO,SPI3_MISO,I2S3ext_SD,,,,,,,,EVENTOUT, +PortB,PB5,,,TIM3_CH2,,I2C1_SMBA,SPI1_MOSI,SPI3_MOSI/I2S3_SD,,,CAN2_RX,OTG_HS_ULPI_D7,ETH_PPS_OUT,,DCMI_D10,,EVENTOUT, +PortB,PB6,,,TIM4_CH1,,I2C1_SCL,,,USART1_TX,,CAN2_TX,,,,DCMI_D5,,EVENTOUT, +PortB,PB7,,,TIM4_CH2,,I2C1_SDA,,,USART1_RX,,,,,FSMC_NL,DCMI_VSYNC,,EVENTOUT, +PortB,PB8,,,TIM4_CH3,TIM10_CH1,I2C1_SCL,,,,,CAN1_RX,,ETH_MII_TXD3,SDIO_D4,DCMI_D6,,EVENTOUT, +PortB,PB9,,,TIM4_CH4,TIM11_CH1,I2C1_SDA,SPI2_NSS/I2S2_WS,,,,CAN1_TX,,,SDIO_D5,DCMI_D7,,EVENTOUT, +PortB,PB10,,TIM2_CH3,,,I2C2_SCL,SPI2_SCK/I2S2_CK,,USART3_TX,,,OTG_HS_ULPI_D3,ETH_MII_RX_ER,,,,EVENTOUT, +PortB,PB11,,TIM2_CH4,,,I2C2_SDA,,,USART3_RX,,,OTG_HS_ULPI_D4,ETH_MII_TX_EN/ETH_RMII_TX_EN,,,,EVENTOUT, +PortB,PB12,,TIM1_BKIN,,,I2C2_SMBA,SPI2_NSS/I2S2_WS,,USART3_CK,,CAN2_RX,OTG_HS_ULPI_D5,ETH_MII_TXD0/ETH_RMII_TXD0,OTG_HS_ID,,,EVENTOUT, +PortB,PB13,,TIM1_CH1N,,,,SPI2_SCK/I2S2_CK,,USART3_CTS,,CAN2_TX,OTG_HS_ULPI_D6,ETH_MII_TXD1/ETH_RMII_TXD1,,,,EVENTOUT, +PortB,PB14,,TIM1_CH2N,,TIM8_CH2N,,SPI2_MISO,I2S2ext_SD,USART3_RTS,,TIM12_CH1,,,OTG_HS_DM,,,EVENTOUT, +PortB,PB15,RTC_REFIN,TIM1_CH3N,,TIM8_CH3N,,SPI2_MOSI/I2S2_SD,,,,TIM12_CH2,,,OTG_HS_DP,,,EVENTOUT, +PortC,PC0,,,,,,,,,,,OTG_HS_ULPI_STP,,,,,EVENTOUT,ADC123_IN10 +PortC,PC1,,,,,,,,,,,,ETH_MDC,,,,EVENTOUT,ADC123_IN11 +PortC,PC2,,,,,,SPI2_MISO,I2S2ext_SD,,,,OTG_HS_ULPI_DIR,ETH_MII_TXD2,,,,EVENTOUT,ADC123_IN12 +PortC,PC3,,,,,,SPI2_MOSI/I2S2_SD,,,,,OTG_HS_ULPI_NXT,ETH_MII_TX_CLK,,,,EVENTOUT,ADC123_IN13 +PortC,PC4,,,,,,,,,,,,ETH_MII_RXD0/ETH_RMII_RXD0,,,,EVENTOUT,ADC123_IN14 +PortC,PC5,,,,,,,,,,,,ETH_MII_RXD1/ETH_RMII_RXD1,,,,EVENTOUT,ADC123_IN15 +PortC,PC6,,,TIM3_CH1,TIM8_CH1,,I2S2_MCK,,,USART6_TX,,,,SDIO_D6,DCMI_D0,,EVENTOUT, +PortC,PC7,,,TIM3_CH2,TIM8_CH2,,,I2S3_MCK,,USART6_RX,,,,SDIO_D7,DCMI_D1,,EVENTOUT, +PortC,PC8,,,TIM3_CH3,TIM8_CH3,,,,,USART6_CK,,,,SDIO_D0,DCMI_D2,,EVENTOUT, +PortC,PC9,MCO2,,TIM3_CH4,TIM8_CH4,I2C3_SDA,I2S_CKIN,,,,,,,SDIO_D1,DCMI_D3,,EVENTOUT, +PortC,PC10,,,,,,,SPI3_SCK/I2S3_CK,USART3_TX,UART4_TX,,,,SDIO_D2,DCMI_D8,,EVENTOUT, +PortC,PC11,,,,,,I2S3ext_SD,SPI3_MISO,USART3_RX,UART4_RX,,,,SDIO_D3,DCMI_D4,,EVENTOUT, +PortC,PC12,,,,,,,SPI3_MOSI/I2S3_SD,USART3_CK,UART5_TX,,,,SDIO_CK,DCMI_D9,,EVENTOUT, +PortC,PC13,,,,,,,,,,,,,,,,EVENTOUT, +PortC,PC14,,,,,,,,,,,,,,,,EVENTOUT, +PortC,PC15,,,,,,,,,,,,,,,,EVENTOUT, +PortD,PD0,,,,,,,,,,CAN1_RX,,,FSMC_D2,,,EVENTOUT, +PortD,PD1,,,,,,,,,,CAN1_TX,,,FSMC_D3,,,EVENTOUT, +PortD,PD2,,,TIM3_ETR,,,,,,UART5_RX,,,,SDIO_CMD,DCMI_D11,,EVENTOUT, +PortD,PD3,,,,,,,,USART2_CTS,,,,,FSMC_CLK,,,EVENTOUT, +PortD,PD4,,,,,,,,USART2_RTS,,,,,FSMC_NOE,,,EVENTOUT, +PortD,PD5,,,,,,,,USART2_TX,,,,,FSMC_NWE,,,EVENTOUT, +PortD,PD6,,,,,,,,USART2_RX,,,,,FSMC_NWAIT,,,EVENTOUT, +PortD,PD7,,,,,,,,USART2_CK,,,,,FSMC_NE1/FSMC_NCE2,,,EVENTOUT, +PortD,PD8,,,,,,,,USART3_TX,,,,,FSMC_D13,,,EVENTOUT, +PortD,PD9,,,,,,,,USART3_RX,,,,,FSMC_D14,,,EVENTOUT, +PortD,PD10,,,,,,,,USART3_CK,,,,,FSMC_D15,,,EVENTOUT, +PortD,PD11,,,,,,,,USART3_CTS,,,,,FSMC_A16,,,EVENTOUT, +PortD,PD12,,,TIM4_CH1,,,,,USART3_RTS,,,,,FSMC_A17,,,EVENTOUT, +PortD,PD13,,,TIM4_CH2,,,,,,,,,,FSMC_A18,,,EVENTOUT, +PortD,PD14,,,TIM4_CH3,,,,,,,,,,FSMC_D0,,,EVENTOUT, +PortD,PD15,,,TIM4_CH4,,,,,,,,,,FSMC_D1,,,EVENTOUT, +PortE,PE0,,,TIM4_ETR,,,,,,,,,,FSMC_NBL0,DCMI_D2,,EVENTOUT, +PortE,PE1,,,,,,,,,,,,,FSMC_NBL1,DCMI_D3,,EVENTOUT, +PortE,PE2,TRACECLK,,,,,,,,,,,ETH_MII_TXD3,FSMC_A23,,,EVENTOUT, +PortE,PE3,TRACED0,,,,,,,,,,,,FSMC_A19,,,EVENTOUT, +PortE,PE4,TRACED1,,,,,,,,,,,,FSMC_A20,DCMI_D4,,EVENTOUT, +PortE,PE5,TRACED2,,,TIM9_CH1,,,,,,,,,FSMC_A21,DCMI_D6,,EVENTOUT, +PortE,PE6,TRACED3,,,TIM9_CH2,,,,,,,,,FSMC_A22,DCMI_D7,,EVENTOUT, +PortE,PE7,,TIM1_ETR,,,,,,,,,,,FSMC_D4,,,EVENTOUT, +PortE,PE8,,TIM1_CH1N,,,,,,,,,,,FSMC_D5,,,EVENTOUT, +PortE,PE9,,TIM1_CH1,,,,,,,,,,,FSMC_D6,,,EVENTOUT, +PortE,PE10,,TIM1_CH2N,,,,,,,,,,,FSMC_D7,,,EVENTOUT, +PortE,PE11,,TIM1_CH2,,,,,,,,,,,FSMC_D8,,,EVENTOUT, +PortE,PE12,,TIM1_CH3N,,,,,,,,,,,FSMC_D9,,,EVENTOUT, +PortE,PE13,,TIM1_CH3,,,,,,,,,,,FSMC_D10,,,EVENTOUT, +PortE,PE14,,TIM1_CH4,,,,,,,,,,,FSMC_D11,,,EVENTOUT, +PortE,PE15,,TIM1_BKIN,,,,,,,,,,,FSMC_D12,,,EVENTOUT, +PortF,PF0,,,,,I2C2_SDA,,,,,,,,FSMC_A0,,,EVENTOUT, +PortF,PF1,,,,,I2C2_SCL,,,,,,,,FSMC_A1,,,EVENTOUT, +PortF,PF2,,,,,I2C2_SMBA,,,,,,,,FSMC_A2,,,EVENTOUT, +PortF,PF3,,,,,,,,,,,,,FSMC_A3,,,EVENTOUT,ADC3_IN9 +PortF,PF4,,,,,,,,,,,,,FSMC_A4,,,EVENTOUT,ADC3_IN14 +PortF,PF5,,,,,,,,,,,,,FSMC_A5,,,EVENTOUT,ADC3_IN15 +PortF,PF6,,,,TIM10_CH1,,,,,,,,,FSMC_NIORD,,,EVENTOUT,ADC3_IN4 +PortF,PF7,,,,TIM11_CH1,,,,,,,,,FSMC_NREG,,,EVENTOUT,ADC3_IN5 +PortF,PF8,,,,,,,,,,TIM13_CH1,,,FSMC_NIOWR,,,EVENTOUT,ADC3_IN6 +PortF,PF9,,,,,,,,,,TIM14_CH1,,,FSMC_CD,,,EVENTOUT,ADC3_IN7 +PortF,PF10,,,,,,,,,,,,,FSMC_INTR,,,EVENTOUT,ADC3_IN8 +PortF,PF11,,,,,,,,,,,,,,DCMI_D12,,EVENTOUT, +PortF,PF12,,,,,,,,,,,,,FSMC_A6,,,EVENTOUT, +PortF,PF13,,,,,,,,,,,,,FSMC_A7,,,EVENTOUT, +PortF,PF14,,,,,,,,,,,,,FSMC_A8,,,EVENTOUT, +PortF,PF15,,,,,,,,,,,,,FSMC_A9,,,EVENTOUT, +PortG,PG0,,,,,,,,,,,,,FSMC_A10,,,EVENTOUT, +PortG,PG1,,,,,,,,,,,,,FSMC_A11,,,EVENTOUT, +PortG,PG2,,,,,,,,,,,,,FSMC_A12,,,EVENTOUT, +PortG,PG3,,,,,,,,,,,,,FSMC_A13,,,EVENTOUT, +PortG,PG4,,,,,,,,,,,,,FSMC_A14,,,EVENTOUT, +PortG,PG5,,,,,,,,,,,,,FSMC_A15,,,EVENTOUT, +PortG,PG6,,,,,,,,,,,,,FSMC_INT2,,,EVENTOUT, +PortG,PG7,,,,,,,,,USART6_CK,,,,FSMC_INT3,,,EVENTOUT, +PortG,PG8,,,,,,,,,USART6_RTS,,,ETH_PPS_OUT,,,,EVENTOUT, +PortG,PG9,,,,,,,,,USART6_RX,,,,FSMC_NE2/FSMC_NCE3,,,EVENTOUT, +PortG,PG10,,,,,,,,,,,,,FSMC_NCE4_1/FSMC_NE3,,,EVENTOUT, +PortG,PG11,,,,,,,,,,,,ETH_MII_TX_EN/ETH_RMII_TX_EN,FSMC_NCE4_2,,,EVENTOUT, +PortG,PG12,,,,,,,,,USART6_RTS,,,,FSMC_NE4,,,EVENTOUT, +PortG,PG13,,,,,,,,,USART6_CTS,,,ETH_MII_TXD0/ETH_RMII_TXD0,FSMC_A24,,,EVENTOUT, +PortG,PG14,,,,,,,,,USART6_TX,,,ETH_MII_TXD1/ETH_RMII_TXD1,FSMC_A25,,,EVENTOUT, +PortG,PG15,,,,,,,,,USART6_CTS,,,,,DCMI_D13,,EVENTOUT, +PortH,PH0,,,,,,,,,,,,,,,,EVENTOUT, +PortH,PH1,,,,,,,,,,,,,,,,EVENTOUT, +PortH,PH2,,,,,,,,,,,,ETH_MII_CRS,,,,EVENTOUT, +PortH,PH3,,,,,,,,,,,,ETH_MII_COL,,,,EVENTOUT, +PortH,PH4,,,,,I2C2_SCL,,,,,,OTG_HS_ULPI_NXT,,,,,EVENTOUT, +PortH,PH5,,,,,I2C2_SDA,,,,,,,,,,,EVENTOUT, +PortH,PH6,,,,,I2C2_SMBA,,,,,TIM12_CH1,,ETH_MII_RXD2,,,,EVENTOUT, +PortH,PH7,,,,,I2C3_SCL,,,,,,,ETH_MII_RXD3,,,,EVENTOUT, +PortH,PH8,,,,,I2C3_SDA,,,,,,,,,DCMI_HSYNC,,EVENTOUT, +PortH,PH9,,,,,I2C3_SMBA,,,,,TIM12_CH2,,,,DCMI_D0,,EVENTOUT, +PortH,PH10,,,TIM5_CH1,,,,,,,,,,,DCMI_D1,,EVENTOUT, +PortH,PH11,,,TIM5_CH2,,,,,,,,,,,DCMI_D2,,EVENTOUT, +PortH,PH12,,,TIM5_CH3,,,,,,,,,,,DCMI_D3,,EVENTOUT, +PortH,PH13,,,,TIM8_CH1N,,,,,,CAN1_TX,,,,,,EVENTOUT, +PortH,PH14,,,,TIM8_CH2N,,,,,,,,,,DCMI_D4,,EVENTOUT, +PortH,PH15,,,,TIM8_CH3N,,,,,,,,,,DCMI_D11,,EVENTOUT, +PortI,PI0,,,TIM5_CH4,,,SPI2_NSS/I2S2_WS,,,,,,,,DCMI_D13,,EVENTOUT, +PortI,PI1,,,,,,SPI2_SCK/I2S2_CK,,,,,,,,DCMI_D8,,EVENTOUT, +PortI,PI2,,,,TIM8_CH4,,SPI2_MISO,I2S2ext_SD,,,,,,,DCMI_D9,,EVENTOUT, +PortI,PI3,,,,TIM8_ETR,,SPI2_MOSI/I2S2_SD,,,,,,,,DCMI_D10,,EVENTOUT, +PortI,PI4,,,,TIM8_BKIN,,,,,,,,,,DCMI_D5,,EVENTOUT, +PortI,PI5,,,,TIM8_CH1,,,,,,,,,,DCMI_VSYNC,,EVENTOUT, +PortI,PI6,,,,TIM8_CH2,,,,,,,,,,DCMI_D6,,EVENTOUT, +PortI,PI7,,,,TIM8_CH3,,,,,,,,,,DCMI_D7,,EVENTOUT, +PortI,PI8,,,,,,,,,,,,,,,,EVENTOUT, +PortI,PI9,,,,,,,,,,CAN1_RX,,,,,,EVENTOUT, +PortI,PI10,,,,,,,,,,,,ETH_MII_RX_ER,,,,EVENTOUT, +PortI,PI11,,,,,,,,,,,OTG_HS_ULPI_DIR,,,,,EVENTOUT, diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index 4ab636d79f..56baf8c765 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -26,6 +26,10 @@ import csv import sys # Use: parse_af_csf.py Filename.csv -pins-only +# Designed for use with .csv files from Micropython, or in identical format +# created via Datasheet peripheral tables with a Sheets program. +# +# See examples/stm32f405.csv for example formatting. # Most peripherals (SPI, I2C) output 3 values: # peripheral index, alt function, pin string @@ -130,8 +134,4 @@ with open(sys.argv[1]) as csv_file: for line in outlist: print("extern const mcu_pin_obj_t pin_" + line[0] + ";") - - - print(f'Processed {line_count} lines.') - diff --git a/ports/stm/tools/parse_pins_csv.py b/ports/stm/tools/parse_pins_csv.py new file mode 100644 index 0000000000..b69b4791be --- /dev/null +++ b/ports/stm/tools/parse_pins_csv.py @@ -0,0 +1,49 @@ +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2020 Lucian Copeland for Adafruit Industries +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import csv +import sys + +# Use: parse_pins_csv.py Filename.csv +# Designed for use with .csv files from Micropython, or in identical format +# created via Datasheet peripheral tables with a Sheets program. +# +# See examples/nucleo_h743.csv for example formatting. + +# Open target file +with open(sys.argv[1]) as csv_file: + csv_reader = csv.reader(csv_file, delimiter=',') + line_count = 0 + + print("STATIC const mp_rom_map_elem_t board_module_globals_table[] = {") + + for row in csv_reader: + label = row[0] + pin = row[1] + if len(pin) < 4: + pin = pin[:2] + '0' + pin[2:] + print("{ MP_ROM_QSTR(MP_QSTR_" + label + "), MP_ROM_PTR(&pin_" + pin + ") },") + line_count += 1 + + print(f'Processed {line_count} lines.') From 7cfa8e1a687f570acb758cc272d805ffb4bd7a36 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Sun, 29 Mar 2020 18:59:00 -0400 Subject: [PATCH 142/919] board_vina_m0:pins.c: PGM_LED is on PA28 not PA15. --- ports/atmel-samd/boards/bdmicro_vina_m0/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c b/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c index 610d16d863..0ebceb28dd 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c @@ -18,7 +18,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_PGM_LED), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, @@ -29,6 +28,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_PGM_LED), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, From 13022be299f9082f6c75422e7dc287fa9f7311f4 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Tue, 31 Mar 2020 00:51:13 +0200 Subject: [PATCH 143/919] mimxrt10xx: Fix neopixel_write --- .../common-hal/neopixel_write/__init__.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 9ea2335021..3e1d343ec8 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -32,7 +32,6 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" -#include "fsl_gpio.h" uint64_t next_start_tick_ms = 0; uint32_t next_start_tick_us = 1000; @@ -45,7 +44,7 @@ uint32_t next_start_tick_us = 1000; #pragma GCC push_options #pragma GCC optimize ("Os") -void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, +void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; uint32_t start = 0; @@ -54,14 +53,10 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout //assumes 800_000Hz frequency //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us //TODO: try to get dynamic weighting working again -#ifdef MIMXRT1011_SERIES - uint32_t sys_freq = CLOCK_GetCoreFreq(); -#else - uint32_t sys_freq = CLOCK_GetAhbFreq(); -#endif - uint32_t interval = sys_freq/MAGIC_800_INT; - uint32_t t0 = (sys_freq/MAGIC_800_T0H); - uint32_t t1 = (sys_freq/MAGIC_800_T1H); + const uint32_t sys_freq = SystemCoreClock; + const uint32_t interval = (sys_freq / MAGIC_800_INT); + const uint32_t t0 = (sys_freq / MAGIC_800_T0H); + const uint32_t t1 = (sys_freq / MAGIC_800_T1H); // This must be called while interrupts are on in case we're waiting for a // future ms tick. @@ -79,9 +74,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout for(;;) { cyc = (pix & mask) ? t1 : t0; start = DWT->CYCCNT; - GPIO_PinWrite(gpio, pin, 1); + gpio->DR |= (1U << pin); while((DWT->CYCCNT - start) < cyc); - GPIO_PinWrite(gpio, pin, 0); + gpio->DR &= ~(1U << pin); while((DWT->CYCCNT - start) < interval); if(!(mask >>= 1)) { if(p >= end) break; From 81139aec235003c6de40342a126435a82a9a5677 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 30 Mar 2020 17:04:33 -0700 Subject: [PATCH 144/919] Update translations --- locale/ID.po | 7 ++++++- locale/circuitpython.pot | 7 ++++++- locale/de_DE.po | 7 ++++++- locale/en_US.po | 7 ++++++- locale/en_x_pirate.po | 7 ++++++- locale/es.po | 7 ++++++- locale/fil.po | 7 ++++++- locale/fr.po | 7 ++++++- locale/it_IT.po | 7 ++++++- locale/ko.po | 7 ++++++- locale/pl.po | 7 ++++++- locale/pt_BR.po | 7 ++++++- locale/zh_Latn_pinyin.po | 7 ++++++- 13 files changed, 78 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8c5725428e..619f7e6b75 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -398,6 +398,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 53ee647957..177eee2bf0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -394,6 +394,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/de_DE.po b/locale/de_DE.po index df62a978c6..351da58936 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -398,6 +398,11 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/en_US.po b/locale/en_US.po index 0a2f870e72..095d175ebd 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -394,6 +394,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index ae56216d7f..a7f00a7b2e 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -398,6 +398,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/es.po b/locale/es.po index 2f2b206b26..3f4313de93 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -400,6 +400,11 @@ msgstr "Buffer debe ser de longitud 1 como minimo" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/fil.po b/locale/fil.po index f8c1471d59..cd6f52c393 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -400,6 +400,11 @@ msgstr "Buffer dapat ay hindi baba sa 1 na haba" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/fr.po b/locale/fr.po index 56f20106bc..64abb8f9fd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -404,6 +404,11 @@ msgstr "Le tampon doit être de longueur au moins 1" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/it_IT.po b/locale/it_IT.po index 1b31c5645b..89fb9329e2 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -400,6 +400,11 @@ msgstr "Il buffer deve essere lungo almeno 1" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/ko.po b/locale/ko.po index 575a88b62a..d502e60c07 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -398,6 +398,11 @@ msgstr "잘못된 크기의 버퍼. >1 여야합니다" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/pl.po b/locale/pl.po index ad726ac7fc..67eff44f3a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -397,6 +397,11 @@ msgstr "Bufor musi mieć długość 1 lub więcej" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 48af7b7978..c6fe5dcba2 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -397,6 +397,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5e545a66f8..8be47eb864 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-03-30 17:03-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -403,6 +403,11 @@ msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" msgid "Buffer too large and unable to allocate" msgstr "huǎn chōng qū tài dà , wú fǎ fēn pèi" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format From 786e79ebc9b45c83dc0013e39b1e217889a9506b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 4 Feb 2020 09:20:29 +0800 Subject: [PATCH 145/919] ports: litex: add port and fomu board This adds support for Litex, along with support for the Fomu FPGA board. Signed-off-by: Sean Cross --- conf.py | 1 + ports/litex/Makefile | 200 ++++++ ports/litex/background.c | 60 ++ ports/litex/background.h | 35 + ports/litex/boards/board.h | 45 ++ ports/litex/boards/fomu/board.c | 75 ++ ports/litex/boards/fomu/csr.h | 647 ++++++++++++++++++ ports/litex/boards/fomu/fomu-spi.ld | 118 ++++ ports/litex/boards/fomu/generated/soc.h | 58 ++ ports/litex/boards/fomu/mpconfigboard.h | 37 + ports/litex/boards/fomu/mpconfigboard.mk | 20 + ports/litex/boards/fomu/pins.c | 9 + ports/litex/boards/fomu/profiling.gdb.txt | 16 + .../litex/common-hal/digitalio/DigitalInOut.c | 119 ++++ .../litex/common-hal/digitalio/DigitalInOut.h | 38 + ports/litex/common-hal/digitalio/__init__.c | 1 + ports/litex/common-hal/microcontroller/Pin.c | 56 ++ ports/litex/common-hal/microcontroller/Pin.h | 59 ++ .../common-hal/microcontroller/Processor.c | 64 ++ .../common-hal/microcontroller/Processor.h | 39 ++ .../common-hal/microcontroller/__init__.c | 111 +++ .../common-hal/neopixel_write/__init__.c | 93 +++ ports/litex/common-hal/supervisor/Runtime.c | 38 + ports/litex/common-hal/supervisor/Runtime.h | 37 + ports/litex/common-hal/supervisor/__init__.c | 40 ++ ports/litex/common-hal/time/__init__.c | 45 ++ ports/litex/crt0-vexriscv.S | 94 +++ ports/litex/fatfs_port.c | 33 + ports/litex/hw/common.h | 33 + ports/litex/irq.h | 71 ++ ports/litex/mpconfigport.h | 43 ++ ports/litex/mpconfigport.mk | 31 + ports/litex/mphalport.c | 81 +++ ports/litex/mphalport.h | 42 ++ ports/litex/qstrdefsport.h | 1 + ports/litex/supervisor/internal_flash.c | 350 ++++++++++ ports/litex/supervisor/internal_flash.h | 38 + .../supervisor/internal_flash_root_pointers.h | 31 + ports/litex/supervisor/port.c | 85 +++ ports/litex/supervisor/usb.c | 36 + ports/litex/tick.c | 82 +++ ports/litex/tick.h | 46 ++ 42 files changed, 3158 insertions(+) create mode 100644 ports/litex/Makefile create mode 100644 ports/litex/background.c create mode 100644 ports/litex/background.h create mode 100644 ports/litex/boards/board.h create mode 100644 ports/litex/boards/fomu/board.c create mode 100644 ports/litex/boards/fomu/csr.h create mode 100644 ports/litex/boards/fomu/fomu-spi.ld create mode 100644 ports/litex/boards/fomu/generated/soc.h create mode 100644 ports/litex/boards/fomu/mpconfigboard.h create mode 100644 ports/litex/boards/fomu/mpconfigboard.mk create mode 100644 ports/litex/boards/fomu/pins.c create mode 100644 ports/litex/boards/fomu/profiling.gdb.txt create mode 100644 ports/litex/common-hal/digitalio/DigitalInOut.c create mode 100644 ports/litex/common-hal/digitalio/DigitalInOut.h create mode 100644 ports/litex/common-hal/digitalio/__init__.c create mode 100644 ports/litex/common-hal/microcontroller/Pin.c create mode 100644 ports/litex/common-hal/microcontroller/Pin.h create mode 100644 ports/litex/common-hal/microcontroller/Processor.c create mode 100644 ports/litex/common-hal/microcontroller/Processor.h create mode 100644 ports/litex/common-hal/microcontroller/__init__.c create mode 100644 ports/litex/common-hal/neopixel_write/__init__.c create mode 100644 ports/litex/common-hal/supervisor/Runtime.c create mode 100644 ports/litex/common-hal/supervisor/Runtime.h create mode 100644 ports/litex/common-hal/supervisor/__init__.c create mode 100644 ports/litex/common-hal/time/__init__.c create mode 100644 ports/litex/crt0-vexriscv.S create mode 100644 ports/litex/fatfs_port.c create mode 100644 ports/litex/hw/common.h create mode 100644 ports/litex/irq.h create mode 100644 ports/litex/mpconfigport.h create mode 100644 ports/litex/mpconfigport.mk create mode 100644 ports/litex/mphalport.c create mode 100644 ports/litex/mphalport.h create mode 100644 ports/litex/qstrdefsport.h create mode 100644 ports/litex/supervisor/internal_flash.c create mode 100644 ports/litex/supervisor/internal_flash.h create mode 100644 ports/litex/supervisor/internal_flash_root_pointers.h create mode 100644 ports/litex/supervisor/port.c create mode 100644 ports/litex/supervisor/usb.c create mode 100644 ports/litex/tick.c create mode 100644 ports/litex/tick.h diff --git a/conf.py b/conf.py index 2ea0e8dc0f..1dde709d75 100644 --- a/conf.py +++ b/conf.py @@ -123,6 +123,7 @@ exclude_patterns = ["**/build*", "ports/atmel-samd/tools", "ports/cxd56/mkspk", "ports/cxd56/spresense-exported-sdk", + "ports/litex/hw", "ports/minimal", "ports/mimxrt10xx/peripherals", "ports/mimxrt10xx/sdk", diff --git a/ports/litex/Makefile b/ports/litex/Makefile new file mode 100644 index 0000000000..36d5874121 --- /dev/null +++ b/ports/litex/Makefile @@ -0,0 +1,200 @@ +# 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. + +# Select the board to build for. +ifeq ($(BOARD),) + $(error You must provide a BOARD parameter) +else + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD specified) + endif +endif + +# If the build directory is not given, make it reflect the board name. +BUILD ?= build-$(BOARD) + +include ../../py/mkenv.mk +# Board-specific +include boards/$(BOARD)/mpconfigboard.mk +# Port-specific +include mpconfigport.mk + +# CircuitPython-specific +include $(TOP)/py/circuitpy_mpconfig.mk + +# qstr definitions (must come before including py.mk) +QSTR_DEFS = qstrdefsport.h + +# include py core make definitions +include $(TOP)/py/py.mk + +include $(TOP)/supervisor/supervisor.mk + +# Include make rules and variables common across CircuitPython builds. +include $(TOP)/py/circuitpy_defns.mk + +CROSS_COMPILE = riscv64-unknown-elf- + +####################################### +# CFLAGS +####################################### + +INC += -I. +INC += -I../.. +INC += -I$(BUILD) +INC += -I$(BUILD)/genhdr +INC += -I./boards +INC += -I./boards/$(BOARD) +INC += -I./peripherals +INC += -I../../lib/mp-readline +INC += -I../../lib/tinyusb/src +INC += -I../../supervisor/shared/usb + + +#Debugging/Optimization +ifeq ($(DEBUG), 1) + CFLAGS += -ggdb + # You may want to enable these flags to make setting breakpoints easier. + CFLAGS += -fno-inline -fno-ipa-sra +else + CFLAGS += -Os -DNDEBUG -ggdb3 + # TODO: Test with -flto + ### CFLAGS += -flto +endif + +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) + +# TODO: check this +CFLAGS += -D__START=main + +LD_FILE := boards/$(BOARD)/$(BOARD)-spi.ld + +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv +LIBS := -lgcc -lc + + +LDFLAGS += -flto -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ + -Wl,--no-warn-mismatch \ + -Wl,--build-id=none + +# Use toolchain libm if we're not using our own. +ifndef INTERNAL_LIBM +LIBS += -lm +endif + +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 + + +###################################### +# source +###################################### + + +SRC_C += \ + background.c \ + fatfs_port.c \ + mphalport.c \ + tick.c \ + boards/$(BOARD)/board.c \ + boards/$(BOARD)/pins.c \ + lib/libc/string0.c \ + lib/mp-readline/readline.c \ + lib/oofatfs/ff.c \ + lib/oofatfs/option/ccsbcs.c \ + lib/timeutils/timeutils.c \ + lib/utils/buffer_helper.c \ + lib/utils/context_manager_helpers.c \ + lib/utils/interrupt_char.c \ + lib/utils/pyexec.c \ + lib/utils/stdout_helpers.c \ + lib/utils/sys_stdio_mphal.c \ + supervisor/shared/memory.c + +ifneq ($(USB),FALSE) +SRC_C += lib/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.c +endif + +SRC_S = \ + crt0-vexriscv.S + +SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ + $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ + $(addprefix common-hal/, $(SRC_COMMON_HAL)) + +SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) + + +ifneq ($(FROZEN_MPY_DIR),) +FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') +FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +endif + +OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +ifeq ($(INTERNAL_LIBM),1) +OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) +endif +OBJ += $(addprefix $(BUILD)/, $(SRC_S:.S=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) + +$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os +$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os + +# List of sources for qstr extraction +SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) +# Sources that only hold QSTRs after pre-processing. +SRC_QSTR_PREPROCESSOR += + + +all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 + +$(BUILD)/firmware.elf: $(OBJ) + $(STEPECHO) "LINK $@" + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + +$(BUILD)/firmware.bin: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O binary $^ $@ +# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.hex: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O ihex $^ $@ +# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.uf2: $(BUILD)/firmware.hex + $(ECHO) "Create $@" + $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA00001 -c -o "$(BUILD)/firmware.uf2" $^ + +include $(TOP)/py/mkrules.mk + +# Print out the value of a make variable. +# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile +print-%: + @echo $* = $($*) diff --git a/ports/litex/background.c b/ports/litex/background.c new file mode 100644 index 0000000000..8c18970434 --- /dev/null +++ b/ports/litex/background.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "supervisor/filesystem.h" +#include "supervisor/usb.h" +#include "supervisor/shared/stack.h" + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif + +static bool running_background_tasks = false; + +void background_tasks_reset(void) { + running_background_tasks = false; +} + +void run_background_tasks(void) { + // Don't call ourselves recursively. + if (running_background_tasks) { + return; + } + running_background_tasks = true; + filesystem_background(); + + #if USB_AVAILABLE + usb_background(); + #endif + + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif + running_background_tasks = false; + + assert_heap_ok(); +} diff --git a/ports/litex/background.h b/ports/litex/background.h new file mode 100644 index 0000000000..09551c7fbb --- /dev/null +++ b/ports/litex/background.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_BACKGROUND_H +#define MICROPY_INCLUDED_LITEX_BACKGROUND_H + +#include + +void background_tasks_reset(void); +void run_background_tasks(void); + +#endif // MICROPY_INCLUDED_LITEX_BACKGROUND_H diff --git a/ports/litex/boards/board.h b/ports/litex/boards/board.h new file mode 100644 index 0000000000..837b371904 --- /dev/null +++ b/ports/litex/boards/board.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// This file defines board specific functions. + +#ifndef MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H +#define MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H + +#include + +// Initializes board related state once on start up. +void board_init(void); + +// Returns true if the user initiates safe mode in a board specific way. +// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific +// way. +bool board_requests_safe_mode(void); + +// Reset the state of off MCU components such as neopixels. +void reset_board(void); + +#endif // MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H diff --git a/ports/litex/boards/fomu/board.c b/ports/litex/boards/fomu/board.c new file mode 100644 index 0000000000..97e1ecadd6 --- /dev/null +++ b/ports/litex/boards/fomu/board.c @@ -0,0 +1,75 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "csr.h" + +// ICE40 LED Driver hard macro. +// See http://www.latticesemi.com/-/media/LatticeSemi/Documents/ApplicationNotes/IK/ICE40LEDDriverUsageGuide.ashx?document_id=50668 +enum led_registers { + LEDDCR0 = 8, + LEDDBR = 9, + LEDDONR = 10, + LEDDOFR = 11, + LEDDBCRR = 5, + LEDDBCFR = 6, + LEDDPWRR = 1, + LEDDPWRG = 2, + LEDDPWRB = 3, +}; + +#define BREATHE_ENABLE (1 << 7) +#define BREATHE_EDGE_ON (0 << 6) +#define BREATHE_EDGE_BOTH (1 << 6) +#define BREATHE_MODE_MODULATE (1 << 5) +#define BREATHE_RATE(x) ((x & 7) << 0) + +// Write a value into the LEDDA_IP register. +static void ledda_write(uint8_t value, uint8_t addr) { + rgb_addr_write(addr); + rgb_dat_write(value); +} + +void board_init(void) { + uint8_t onrate = 15; + uint8_t offrate = 1; + + ledda_write(BREATHE_ENABLE | BREATHE_MODE_MODULATE | BREATHE_RATE(onrate), LEDDBCRR); + ledda_write(BREATHE_ENABLE | BREATHE_MODE_MODULATE | BREATHE_RATE(offrate), LEDDBCFR); + + ledda_write(123, LEDDPWRR); // Red + ledda_write(3, LEDDPWRG); // Green + ledda_write(98, LEDDPWRB); // Blue +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/litex/boards/fomu/csr.h b/ports/litex/boards/fomu/csr.h new file mode 100644 index 0000000000..bf66fe3a17 --- /dev/null +++ b/ports/litex/boards/fomu/csr.h @@ -0,0 +1,647 @@ +//-------------------------------------------------------------------------------- +// Auto-generated by Migen (f4fcd10) & LiteX (de205d4a) on 2019-11-25 14:57:34 +//-------------------------------------------------------------------------------- +#include +#ifndef __GENERATED_CSR_H +#define __GENERATED_CSR_H +#include +#ifdef CSR_ACCESSORS_DEFINED +extern void csr_writeb(uint8_t value, unsigned long addr); +extern uint8_t csr_readb(unsigned long addr); +extern void csr_writew(uint16_t value, unsigned long addr); +extern uint16_t csr_readw(unsigned long addr); +extern void csr_writel(uint32_t value, unsigned long addr); +extern uint32_t csr_readl(unsigned long addr); +#else /* ! CSR_ACCESSORS_DEFINED */ +#include +#endif /* ! CSR_ACCESSORS_DEFINED */ + +/* ctrl */ +#define CSR_CTRL_BASE 0xe0000000L +#define CSR_CTRL_RESET_ADDR 0xe0000000L +#define CSR_CTRL_RESET_SIZE 1 +static inline unsigned char ctrl_reset_read(void) { + unsigned char r = csr_readl(0xe0000000L); + return r; +} +static inline void ctrl_reset_write(unsigned char value) { + csr_writel(value, 0xe0000000L); +} +#define CSR_CTRL_SCRATCH_ADDR 0xe0000004L +#define CSR_CTRL_SCRATCH_SIZE 4 +static inline unsigned int ctrl_scratch_read(void) { + unsigned int r = csr_readl(0xe0000004L); + r <<= 8; + r |= csr_readl(0xe0000008L); + r <<= 8; + r |= csr_readl(0xe000000cL); + r <<= 8; + r |= csr_readl(0xe0000010L); + return r; +} +static inline void ctrl_scratch_write(unsigned int value) { + csr_writel(value >> 24, 0xe0000004L); + csr_writel(value >> 16, 0xe0000008L); + csr_writel(value >> 8, 0xe000000cL); + csr_writel(value, 0xe0000010L); +} +#define CSR_CTRL_BUS_ERRORS_ADDR 0xe0000014L +#define CSR_CTRL_BUS_ERRORS_SIZE 4 +static inline unsigned int ctrl_bus_errors_read(void) { + unsigned int r = csr_readl(0xe0000014L); + r <<= 8; + r |= csr_readl(0xe0000018L); + r <<= 8; + r |= csr_readl(0xe000001cL); + r <<= 8; + r |= csr_readl(0xe0000020L); + return r; +} + +/* lxspi */ +#define CSR_LXSPI_BASE 0xe0007800L +#define CSR_LXSPI_BITBANG_ADDR 0xe0007800L +#define CSR_LXSPI_BITBANG_SIZE 1 +static inline unsigned char lxspi_bitbang_read(void) { + unsigned char r = csr_readl(0xe0007800L); + return r; +} +static inline void lxspi_bitbang_write(unsigned char value) { + csr_writel(value, 0xe0007800L); +} +#define CSR_LXSPI_BITBANG_MOSI_OFFSET 0 +#define CSR_LXSPI_BITBANG_MOSI_SIZE 1 +#define CSR_LXSPI_BITBANG_CLK_OFFSET 1 +#define CSR_LXSPI_BITBANG_CLK_SIZE 1 +#define CSR_LXSPI_BITBANG_CS_N_OFFSET 2 +#define CSR_LXSPI_BITBANG_CS_N_SIZE 1 +#define CSR_LXSPI_BITBANG_DIR_OFFSET 3 +#define CSR_LXSPI_BITBANG_DIR_SIZE 1 +#define CSR_LXSPI_MISO_ADDR 0xe0007804L +#define CSR_LXSPI_MISO_SIZE 1 +static inline unsigned char lxspi_miso_read(void) { + unsigned char r = csr_readl(0xe0007804L); + return r; +} +#define CSR_LXSPI_BITBANG_EN_ADDR 0xe0007808L +#define CSR_LXSPI_BITBANG_EN_SIZE 1 +static inline unsigned char lxspi_bitbang_en_read(void) { + unsigned char r = csr_readl(0xe0007808L); + return r; +} +static inline void lxspi_bitbang_en_write(unsigned char value) { + csr_writel(value, 0xe0007808L); +} + +/* messible */ +#define CSR_MESSIBLE_BASE 0xe0008000L +#define CSR_MESSIBLE_IN_ADDR 0xe0008000L +#define CSR_MESSIBLE_IN_SIZE 1 +static inline unsigned char messible_in_read(void) { + unsigned char r = csr_readl(0xe0008000L); + return r; +} +static inline void messible_in_write(unsigned char value) { + csr_writel(value, 0xe0008000L); +} +#define CSR_MESSIBLE_OUT_ADDR 0xe0008004L +#define CSR_MESSIBLE_OUT_SIZE 1 +static inline unsigned char messible_out_read(void) { + unsigned char r = csr_readl(0xe0008004L); + return r; +} +#define CSR_MESSIBLE_STATUS_ADDR 0xe0008008L +#define CSR_MESSIBLE_STATUS_SIZE 1 +static inline unsigned char messible_status_read(void) { + unsigned char r = csr_readl(0xe0008008L); + return r; +} +#define CSR_MESSIBLE_STATUS_FULL_OFFSET 0 +#define CSR_MESSIBLE_STATUS_FULL_SIZE 1 +#define CSR_MESSIBLE_STATUS_HAVE_OFFSET 1 +#define CSR_MESSIBLE_STATUS_HAVE_SIZE 1 + +/* reboot */ +#define CSR_REBOOT_BASE 0xe0006000L +#define CSR_REBOOT_CTRL_ADDR 0xe0006000L +#define CSR_REBOOT_CTRL_SIZE 1 +static inline unsigned char reboot_ctrl_read(void) { + unsigned char r = csr_readl(0xe0006000L); + return r; +} +static inline void reboot_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0006000L); +} +#define CSR_REBOOT_CTRL_IMAGE_OFFSET 0 +#define CSR_REBOOT_CTRL_IMAGE_SIZE 2 +#define CSR_REBOOT_CTRL_KEY_OFFSET 2 +#define CSR_REBOOT_CTRL_KEY_SIZE 6 +#define CSR_REBOOT_ADDR_ADDR 0xe0006004L +#define CSR_REBOOT_ADDR_SIZE 4 +static inline unsigned int reboot_addr_read(void) { + unsigned int r = csr_readl(0xe0006004L); + r <<= 8; + r |= csr_readl(0xe0006008L); + r <<= 8; + r |= csr_readl(0xe000600cL); + r <<= 8; + r |= csr_readl(0xe0006010L); + return r; +} +static inline void reboot_addr_write(unsigned int value) { + csr_writel(value >> 24, 0xe0006004L); + csr_writel(value >> 16, 0xe0006008L); + csr_writel(value >> 8, 0xe000600cL); + csr_writel(value, 0xe0006010L); +} + +/* rgb */ +#define CSR_RGB_BASE 0xe0006800L +#define CSR_RGB_DAT_ADDR 0xe0006800L +#define CSR_RGB_DAT_SIZE 1 +static inline unsigned char rgb_dat_read(void) { + unsigned char r = csr_readl(0xe0006800L); + return r; +} +static inline void rgb_dat_write(unsigned char value) { + csr_writel(value, 0xe0006800L); +} +#define CSR_RGB_ADDR_ADDR 0xe0006804L +#define CSR_RGB_ADDR_SIZE 1 +static inline unsigned char rgb_addr_read(void) { + unsigned char r = csr_readl(0xe0006804L); + return r; +} +static inline void rgb_addr_write(unsigned char value) { + csr_writel(value, 0xe0006804L); +} +#define CSR_RGB_CTRL_ADDR 0xe0006808L +#define CSR_RGB_CTRL_SIZE 1 +static inline unsigned char rgb_ctrl_read(void) { + unsigned char r = csr_readl(0xe0006808L); + return r; +} +static inline void rgb_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0006808L); +} +#define CSR_RGB_CTRL_EXE_OFFSET 0 +#define CSR_RGB_CTRL_EXE_SIZE 1 +#define CSR_RGB_CTRL_CURREN_OFFSET 1 +#define CSR_RGB_CTRL_CURREN_SIZE 1 +#define CSR_RGB_CTRL_RGBLEDEN_OFFSET 2 +#define CSR_RGB_CTRL_RGBLEDEN_SIZE 1 +#define CSR_RGB_CTRL_RRAW_OFFSET 3 +#define CSR_RGB_CTRL_RRAW_SIZE 1 +#define CSR_RGB_CTRL_GRAW_OFFSET 4 +#define CSR_RGB_CTRL_GRAW_SIZE 1 +#define CSR_RGB_CTRL_BRAW_OFFSET 5 +#define CSR_RGB_CTRL_BRAW_SIZE 1 +#define CSR_RGB_RAW_ADDR 0xe000680cL +#define CSR_RGB_RAW_SIZE 1 +static inline unsigned char rgb_raw_read(void) { + unsigned char r = csr_readl(0xe000680cL); + return r; +} +static inline void rgb_raw_write(unsigned char value) { + csr_writel(value, 0xe000680cL); +} +#define CSR_RGB_RAW_R_OFFSET 0 +#define CSR_RGB_RAW_R_SIZE 1 +#define CSR_RGB_RAW_G_OFFSET 1 +#define CSR_RGB_RAW_G_SIZE 1 +#define CSR_RGB_RAW_B_OFFSET 2 +#define CSR_RGB_RAW_B_SIZE 1 + +/* timer0 */ +#define CSR_TIMER0_BASE 0xe0002800L +#define CSR_TIMER0_LOAD_ADDR 0xe0002800L +#define CSR_TIMER0_LOAD_SIZE 4 +static inline unsigned int timer0_load_read(void) { + unsigned int r = csr_readl(0xe0002800L); + r <<= 8; + r |= csr_readl(0xe0002804L); + r <<= 8; + r |= csr_readl(0xe0002808L); + r <<= 8; + r |= csr_readl(0xe000280cL); + return r; +} +static inline void timer0_load_write(unsigned int value) { + csr_writel(value >> 24, 0xe0002800L); + csr_writel(value >> 16, 0xe0002804L); + csr_writel(value >> 8, 0xe0002808L); + csr_writel(value, 0xe000280cL); +} +#define CSR_TIMER0_RELOAD_ADDR 0xe0002810L +#define CSR_TIMER0_RELOAD_SIZE 4 +static inline unsigned int timer0_reload_read(void) { + unsigned int r = csr_readl(0xe0002810L); + r <<= 8; + r |= csr_readl(0xe0002814L); + r <<= 8; + r |= csr_readl(0xe0002818L); + r <<= 8; + r |= csr_readl(0xe000281cL); + return r; +} +static inline void timer0_reload_write(unsigned int value) { + csr_writel(value >> 24, 0xe0002810L); + csr_writel(value >> 16, 0xe0002814L); + csr_writel(value >> 8, 0xe0002818L); + csr_writel(value, 0xe000281cL); +} +#define CSR_TIMER0_EN_ADDR 0xe0002820L +#define CSR_TIMER0_EN_SIZE 1 +static inline unsigned char timer0_en_read(void) { + unsigned char r = csr_readl(0xe0002820L); + return r; +} +static inline void timer0_en_write(unsigned char value) { + csr_writel(value, 0xe0002820L); +} +#define CSR_TIMER0_UPDATE_VALUE_ADDR 0xe0002824L +#define CSR_TIMER0_UPDATE_VALUE_SIZE 1 +static inline unsigned char timer0_update_value_read(void) { + unsigned char r = csr_readl(0xe0002824L); + return r; +} +static inline void timer0_update_value_write(unsigned char value) { + csr_writel(value, 0xe0002824L); +} +#define CSR_TIMER0_VALUE_ADDR 0xe0002828L +#define CSR_TIMER0_VALUE_SIZE 4 +static inline unsigned int timer0_value_read(void) { + unsigned int r = csr_readl(0xe0002828L); + r <<= 8; + r |= csr_readl(0xe000282cL); + r <<= 8; + r |= csr_readl(0xe0002830L); + r <<= 8; + r |= csr_readl(0xe0002834L); + return r; +} +#define CSR_TIMER0_EV_STATUS_ADDR 0xe0002838L +#define CSR_TIMER0_EV_STATUS_SIZE 1 +static inline unsigned char timer0_ev_status_read(void) { + unsigned char r = csr_readl(0xe0002838L); + return r; +} +static inline void timer0_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0002838L); +} +#define CSR_TIMER0_EV_PENDING_ADDR 0xe000283cL +#define CSR_TIMER0_EV_PENDING_SIZE 1 +static inline unsigned char timer0_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000283cL); + return r; +} +static inline void timer0_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000283cL); +} +#define CSR_TIMER0_EV_ENABLE_ADDR 0xe0002840L +#define CSR_TIMER0_EV_ENABLE_SIZE 1 +static inline unsigned char timer0_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0002840L); + return r; +} +static inline void timer0_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0002840L); +} + +/* touch */ +#define CSR_TOUCH_BASE 0xe0005800L +#define CSR_TOUCH_O_ADDR 0xe0005800L +#define CSR_TOUCH_O_SIZE 1 +static inline unsigned char touch_o_read(void) { + unsigned char r = csr_readl(0xe0005800L); + return r; +} +static inline void touch_o_write(unsigned char value) { + csr_writel(value, 0xe0005800L); +} +#define CSR_TOUCH_OE_ADDR 0xe0005804L +#define CSR_TOUCH_OE_SIZE 1 +static inline unsigned char touch_oe_read(void) { + unsigned char r = csr_readl(0xe0005804L); + return r; +} +static inline void touch_oe_write(unsigned char value) { + csr_writel(value, 0xe0005804L); +} +#define CSR_TOUCH_I_ADDR 0xe0005808L +#define CSR_TOUCH_I_SIZE 1 +static inline unsigned char touch_i_read(void) { + unsigned char r = csr_readl(0xe0005808L); + return r; +} + +/* usb */ +#define CSR_USB_BASE 0xe0004800L +#define CSR_USB_PULLUP_OUT_ADDR 0xe0004800L +#define CSR_USB_PULLUP_OUT_SIZE 1 +static inline unsigned char usb_pullup_out_read(void) { + unsigned char r = csr_readl(0xe0004800L); + return r; +} +static inline void usb_pullup_out_write(unsigned char value) { + csr_writel(value, 0xe0004800L); +} +#define CSR_USB_ADDRESS_ADDR 0xe0004804L +#define CSR_USB_ADDRESS_SIZE 1 +static inline unsigned char usb_address_read(void) { + unsigned char r = csr_readl(0xe0004804L); + return r; +} +static inline void usb_address_write(unsigned char value) { + csr_writel(value, 0xe0004804L); +} +#define CSR_USB_ADDRESS_ADDR_OFFSET 0 +#define CSR_USB_ADDRESS_ADDR_SIZE 7 +#define CSR_USB_NEXT_EV_ADDR 0xe0004808L +#define CSR_USB_NEXT_EV_SIZE 1 +static inline unsigned char usb_next_ev_read(void) { + unsigned char r = csr_readl(0xe0004808L); + return r; +} +#define CSR_USB_NEXT_EV_IN_OFFSET 0 +#define CSR_USB_NEXT_EV_IN_SIZE 1 +#define CSR_USB_NEXT_EV_OUT_OFFSET 1 +#define CSR_USB_NEXT_EV_OUT_SIZE 1 +#define CSR_USB_NEXT_EV_SETUP_OFFSET 2 +#define CSR_USB_NEXT_EV_SETUP_SIZE 1 +#define CSR_USB_NEXT_EV_RESET_OFFSET 3 +#define CSR_USB_NEXT_EV_RESET_SIZE 1 +#define CSR_USB_SETUP_DATA_ADDR 0xe000480cL +#define CSR_USB_SETUP_DATA_SIZE 1 +static inline unsigned char usb_setup_data_read(void) { + unsigned char r = csr_readl(0xe000480cL); + return r; +} +#define CSR_USB_SETUP_DATA_DATA_OFFSET 0 +#define CSR_USB_SETUP_DATA_DATA_SIZE 8 +#define CSR_USB_SETUP_CTRL_ADDR 0xe0004810L +#define CSR_USB_SETUP_CTRL_SIZE 1 +static inline unsigned char usb_setup_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004810L); + return r; +} +static inline void usb_setup_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004810L); +} +#define CSR_USB_SETUP_CTRL_RESET_OFFSET 5 +#define CSR_USB_SETUP_CTRL_RESET_SIZE 1 +#define CSR_USB_SETUP_STATUS_ADDR 0xe0004814L +#define CSR_USB_SETUP_STATUS_SIZE 1 +static inline unsigned char usb_setup_status_read(void) { + unsigned char r = csr_readl(0xe0004814L); + return r; +} +#define CSR_USB_SETUP_STATUS_EPNO_OFFSET 0 +#define CSR_USB_SETUP_STATUS_EPNO_SIZE 4 +#define CSR_USB_SETUP_STATUS_HAVE_OFFSET 4 +#define CSR_USB_SETUP_STATUS_HAVE_SIZE 1 +#define CSR_USB_SETUP_STATUS_PEND_OFFSET 5 +#define CSR_USB_SETUP_STATUS_PEND_SIZE 1 +#define CSR_USB_SETUP_STATUS_IS_IN_OFFSET 6 +#define CSR_USB_SETUP_STATUS_IS_IN_SIZE 1 +#define CSR_USB_SETUP_STATUS_DATA_OFFSET 7 +#define CSR_USB_SETUP_STATUS_DATA_SIZE 1 +#define CSR_USB_SETUP_EV_STATUS_ADDR 0xe0004818L +#define CSR_USB_SETUP_EV_STATUS_SIZE 1 +static inline unsigned char usb_setup_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004818L); + return r; +} +static inline void usb_setup_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004818L); +} +#define CSR_USB_SETUP_EV_PENDING_ADDR 0xe000481cL +#define CSR_USB_SETUP_EV_PENDING_SIZE 1 +static inline unsigned char usb_setup_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000481cL); + return r; +} +static inline void usb_setup_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000481cL); +} +#define CSR_USB_SETUP_EV_ENABLE_ADDR 0xe0004820L +#define CSR_USB_SETUP_EV_ENABLE_SIZE 1 +static inline unsigned char usb_setup_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004820L); + return r; +} +static inline void usb_setup_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004820L); +} +#define CSR_USB_IN_DATA_ADDR 0xe0004824L +#define CSR_USB_IN_DATA_SIZE 1 +static inline unsigned char usb_in_data_read(void) { + unsigned char r = csr_readl(0xe0004824L); + return r; +} +static inline void usb_in_data_write(unsigned char value) { + csr_writel(value, 0xe0004824L); +} +#define CSR_USB_IN_DATA_DATA_OFFSET 0 +#define CSR_USB_IN_DATA_DATA_SIZE 8 +#define CSR_USB_IN_CTRL_ADDR 0xe0004828L +#define CSR_USB_IN_CTRL_SIZE 1 +static inline unsigned char usb_in_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004828L); + return r; +} +static inline void usb_in_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004828L); +} +#define CSR_USB_IN_CTRL_EPNO_OFFSET 0 +#define CSR_USB_IN_CTRL_EPNO_SIZE 4 +#define CSR_USB_IN_CTRL_RESET_OFFSET 5 +#define CSR_USB_IN_CTRL_RESET_SIZE 1 +#define CSR_USB_IN_CTRL_STALL_OFFSET 6 +#define CSR_USB_IN_CTRL_STALL_SIZE 1 +#define CSR_USB_IN_STATUS_ADDR 0xe000482cL +#define CSR_USB_IN_STATUS_SIZE 1 +static inline unsigned char usb_in_status_read(void) { + unsigned char r = csr_readl(0xe000482cL); + return r; +} +#define CSR_USB_IN_STATUS_IDLE_OFFSET 0 +#define CSR_USB_IN_STATUS_IDLE_SIZE 1 +#define CSR_USB_IN_STATUS_HAVE_OFFSET 4 +#define CSR_USB_IN_STATUS_HAVE_SIZE 1 +#define CSR_USB_IN_STATUS_PEND_OFFSET 5 +#define CSR_USB_IN_STATUS_PEND_SIZE 1 +#define CSR_USB_IN_EV_STATUS_ADDR 0xe0004830L +#define CSR_USB_IN_EV_STATUS_SIZE 1 +static inline unsigned char usb_in_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004830L); + return r; +} +static inline void usb_in_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004830L); +} +#define CSR_USB_IN_EV_PENDING_ADDR 0xe0004834L +#define CSR_USB_IN_EV_PENDING_SIZE 1 +static inline unsigned char usb_in_ev_pending_read(void) { + unsigned char r = csr_readl(0xe0004834L); + return r; +} +static inline void usb_in_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe0004834L); +} +#define CSR_USB_IN_EV_ENABLE_ADDR 0xe0004838L +#define CSR_USB_IN_EV_ENABLE_SIZE 1 +static inline unsigned char usb_in_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004838L); + return r; +} +static inline void usb_in_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004838L); +} +#define CSR_USB_OUT_DATA_ADDR 0xe000483cL +#define CSR_USB_OUT_DATA_SIZE 1 +static inline unsigned char usb_out_data_read(void) { + unsigned char r = csr_readl(0xe000483cL); + return r; +} +#define CSR_USB_OUT_DATA_DATA_OFFSET 0 +#define CSR_USB_OUT_DATA_DATA_SIZE 8 +#define CSR_USB_OUT_CTRL_ADDR 0xe0004840L +#define CSR_USB_OUT_CTRL_SIZE 1 +static inline unsigned char usb_out_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004840L); + return r; +} +static inline void usb_out_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004840L); +} +#define CSR_USB_OUT_CTRL_EPNO_OFFSET 0 +#define CSR_USB_OUT_CTRL_EPNO_SIZE 4 +#define CSR_USB_OUT_CTRL_ENABLE_OFFSET 4 +#define CSR_USB_OUT_CTRL_ENABLE_SIZE 1 +#define CSR_USB_OUT_CTRL_RESET_OFFSET 5 +#define CSR_USB_OUT_CTRL_RESET_SIZE 1 +#define CSR_USB_OUT_CTRL_STALL_OFFSET 6 +#define CSR_USB_OUT_CTRL_STALL_SIZE 1 +#define CSR_USB_OUT_STATUS_ADDR 0xe0004844L +#define CSR_USB_OUT_STATUS_SIZE 1 +static inline unsigned char usb_out_status_read(void) { + unsigned char r = csr_readl(0xe0004844L); + return r; +} +#define CSR_USB_OUT_STATUS_EPNO_OFFSET 0 +#define CSR_USB_OUT_STATUS_EPNO_SIZE 4 +#define CSR_USB_OUT_STATUS_HAVE_OFFSET 4 +#define CSR_USB_OUT_STATUS_HAVE_SIZE 1 +#define CSR_USB_OUT_STATUS_PEND_OFFSET 5 +#define CSR_USB_OUT_STATUS_PEND_SIZE 1 +#define CSR_USB_OUT_EV_STATUS_ADDR 0xe0004848L +#define CSR_USB_OUT_EV_STATUS_SIZE 1 +static inline unsigned char usb_out_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004848L); + return r; +} +static inline void usb_out_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004848L); +} +#define CSR_USB_OUT_EV_PENDING_ADDR 0xe000484cL +#define CSR_USB_OUT_EV_PENDING_SIZE 1 +static inline unsigned char usb_out_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000484cL); + return r; +} +static inline void usb_out_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000484cL); +} +#define CSR_USB_OUT_EV_ENABLE_ADDR 0xe0004850L +#define CSR_USB_OUT_EV_ENABLE_SIZE 1 +static inline unsigned char usb_out_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004850L); + return r; +} +static inline void usb_out_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004850L); +} +#define CSR_USB_OUT_ENABLE_STATUS_ADDR 0xe0004854L +#define CSR_USB_OUT_ENABLE_STATUS_SIZE 1 +static inline unsigned char usb_out_enable_status_read(void) { + unsigned char r = csr_readl(0xe0004854L); + return r; +} +#define CSR_USB_OUT_STALL_STATUS_ADDR 0xe0004858L +#define CSR_USB_OUT_STALL_STATUS_SIZE 1 +static inline unsigned char usb_out_stall_status_read(void) { + unsigned char r = csr_readl(0xe0004858L); + return r; +} + +/* version */ +#define CSR_VERSION_BASE 0xe0007000L +#define CSR_VERSION_MAJOR_ADDR 0xe0007000L +#define CSR_VERSION_MAJOR_SIZE 1 +static inline unsigned char version_major_read(void) { + unsigned char r = csr_readl(0xe0007000L); + return r; +} +#define CSR_VERSION_MINOR_ADDR 0xe0007004L +#define CSR_VERSION_MINOR_SIZE 1 +static inline unsigned char version_minor_read(void) { + unsigned char r = csr_readl(0xe0007004L); + return r; +} +#define CSR_VERSION_REVISION_ADDR 0xe0007008L +#define CSR_VERSION_REVISION_SIZE 1 +static inline unsigned char version_revision_read(void) { + unsigned char r = csr_readl(0xe0007008L); + return r; +} +#define CSR_VERSION_GITREV_ADDR 0xe000700cL +#define CSR_VERSION_GITREV_SIZE 4 +static inline unsigned int version_gitrev_read(void) { + unsigned int r = csr_readl(0xe000700cL); + r <<= 8; + r |= csr_readl(0xe0007010L); + r <<= 8; + r |= csr_readl(0xe0007014L); + r <<= 8; + r |= csr_readl(0xe0007018L); + return r; +} +#define CSR_VERSION_GITEXTRA_ADDR 0xe000701cL +#define CSR_VERSION_GITEXTRA_SIZE 2 +static inline unsigned short int version_gitextra_read(void) { + unsigned short int r = csr_readl(0xe000701cL); + r <<= 8; + r |= csr_readl(0xe0007020L); + return r; +} +#define CSR_VERSION_DIRTY_ADDR 0xe0007024L +#define CSR_VERSION_DIRTY_SIZE 1 +static inline unsigned char version_dirty_read(void) { + unsigned char r = csr_readl(0xe0007024L); + return r; +} +#define CSR_VERSION_DIRTY_DIRTY_OFFSET 0 +#define CSR_VERSION_DIRTY_DIRTY_SIZE 1 +#define CSR_VERSION_MODEL_ADDR 0xe0007028L +#define CSR_VERSION_MODEL_SIZE 1 +static inline unsigned char version_model_read(void) { + unsigned char r = csr_readl(0xe0007028L); + return r; +} +#define CSR_VERSION_MODEL_MODEL_OFFSET 0 +#define CSR_VERSION_MODEL_MODEL_SIZE 8 +#define CSR_VERSION_SEED_ADDR 0xe000702cL +#define CSR_VERSION_SEED_SIZE 4 +static inline unsigned int version_seed_read(void) { + unsigned int r = csr_readl(0xe000702cL); + r <<= 8; + r |= csr_readl(0xe0007030L); + r <<= 8; + r |= csr_readl(0xe0007034L); + r <<= 8; + r |= csr_readl(0xe0007038L); + return r; +} + +#endif diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld new file mode 100644 index 0000000000..b6b00becd3 --- /dev/null +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -0,0 +1,118 @@ +/* + GNU linker script for Fomu +*/ + +ENTRY(_start) + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ +} + +/* top end of the stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* define output sections */ +SECTIONS +{ + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : AT ( _sidata ) + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + + /* These functions must be in RAM for USB to respond in time. */ + *(.text.timer0_ev_pending_write) + *(.text.mp_parse) + *(.text.parse_compile_execute) + *(.text.cmp_lfn) + *(.text.qstr_find_strn) + *(.text.dcd_edpt_xfer) + *(.text.pop_rule) + *(.text.ff_wtoupper) + *(.text.dir_find) + *(.text.push_rule) + *(.text.csr_writel) + *(.text.csr_readl) + *(.text.autoreload_tick) + *(.text.filesystem_tick) + + /* These two functions are called twice as often as any other function */ + *(.text.mp_map_lookup) + *(.text.mp_execute_bytecode) /* Note: this function is 7kb */ + + /* These functions are hot, and placing them in ram greatly + * improves performance + */ + *(.text.mp_decode_uint_value) + *(.text.tud_cdc_n_write_flush) + *(.text.mp_load_method_maybe) + *(.text.mp_convert_member_lookup) + *(.text.irq_getmask) + *(.text.irq_setmask) + *(.text.tu_edpt_dir) + *(.text.tu_fifo_empty) + *(.text.irq_pending) + *(.text.tud_task) + *(.text.usb_background) + *(.text._osal_q_lock) + *(.text.osal_queue_receive) + *(.text.mp_obj_get_type) + *(.text.usbd_edpt_busy) + + *(.ramtext) /* .text* sections (code) */ + *(.ramtext*) /* .text* sections (code) */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.sdata) /* .data sections */ + *(.sdata*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + KEEP(*(.text.start)) /* isr vector table */ + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + *(.srodata) /* .rodata sections (constants, strings, etc.) */ + *(.srodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ + } >FLASH + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss) + *(.bss*) + *(.sbss) + *(.sbss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code */ + } >RAM + + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + _heap_start = .; /* define a global symbol at heap start */ + } >RAM +} diff --git a/ports/litex/boards/fomu/generated/soc.h b/ports/litex/boards/fomu/generated/soc.h new file mode 100644 index 0000000000..91b2f1a310 --- /dev/null +++ b/ports/litex/boards/fomu/generated/soc.h @@ -0,0 +1,58 @@ +//-------------------------------------------------------------------------------- +// Auto-generated by Migen (f4fcd10) & LiteX (de205d4a) on 2019-11-25 15:17:59 +//-------------------------------------------------------------------------------- +#ifndef __GENERATED_SOC_H +#define __GENERATED_SOC_H +#define CONFIG_BITSTREAM_SYNC_HEADER1 2123999870 +static inline int config_bitstream_sync_header1_read(void) { + return 2123999870; +} +#define CONFIG_BITSTREAM_SYNC_HEADER2 2125109630 +static inline int config_bitstream_sync_header2_read(void) { + return 2125109630; +} +#define CONFIG_CLOCK_FREQUENCY 12000000 +static inline int config_clock_frequency_read(void) { + return 12000000; +} +#define CONFIG_CPU_RESET_ADDR 0 +static inline int config_cpu_reset_addr_read(void) { + return 0; +} +#define CONFIG_CPU_TYPE "VEXRISCV" +static inline const char * config_cpu_type_read(void) { + return "VEXRISCV"; +} +#define CONFIG_CPU_TYPE_VEXRISCV +#define CONFIG_CPU_VARIANT "MIN" +static inline const char * config_cpu_variant_read(void) { + return "MIN"; +} +#define CONFIG_CPU_VARIANT_MIN +#define CONFIG_CSR_ALIGNMENT 32 +static inline int config_csr_alignment_read(void) { + return 32; +} +#define CONFIG_CSR_DATA_WIDTH 8 +static inline int config_csr_data_width_read(void) { + return 8; +} +#define CONFIG_FOMU_REV "HACKER" +static inline const char * config_fomu_rev_read(void) { + return "HACKER"; +} +#define CONFIG_FOMU_REV_HACKER +#define CONFIG_SHADOW_BASE 2147483648 +static inline int config_shadow_base_read(void) { + return 2147483648; +} +#define TIMER0_INTERRUPT 2 +static inline int timer0_interrupt_read(void) { + return 2; +} +#define USB_INTERRUPT 3 +static inline int usb_interrupt_read(void) { + return 3; +} + +#endif diff --git a/ports/litex/boards/fomu/mpconfigboard.h b/ports/litex/boards/fomu/mpconfigboard.h new file mode 100644 index 0000000000..127301eee2 --- /dev/null +++ b/ports/litex/boards/fomu/mpconfigboard.h @@ -0,0 +1,37 @@ +/* + * 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 "Fomu" +#define MICROPY_HW_MCU_NAME "VexRiscv" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x1000) +#define FLASH_PARTITION_OFFSET_BYTES (1024*1024) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE) diff --git a/ports/litex/boards/fomu/mpconfigboard.mk b/ports/litex/boards/fomu/mpconfigboard.mk new file mode 100644 index 0000000000..4787803ccd --- /dev/null +++ b/ports/litex/boards/fomu/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x1209 +USB_PID = 0x5BF0 +USB_PRODUCT = "Fomu" +USB_MANUFACTURER = "Foosn" +USB_DEVICES = "CDC,MSC,AUDIO,HID" + +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 + +# Fomu only implements rv32i +CFLAGS += -march=rv32i -mabi=ilp32 +LDFLAGS += -march=rv32i -mabi=ilp32 + +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_MICROCONTROLLER = 1 diff --git a/ports/litex/boards/fomu/pins.c b/ports/litex/boards/fomu/pins.c new file mode 100644 index 0000000000..6be495c331 --- /dev/null +++ b/ports/litex/boards/fomu/pins.c @@ -0,0 +1,9 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_TOUCH1) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_TOUCH2) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_TOUCH3) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_TOUCH4) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/litex/boards/fomu/profiling.gdb.txt b/ports/litex/boards/fomu/profiling.gdb.txt new file mode 100644 index 0000000000..28faf45b73 --- /dev/null +++ b/ports/litex/boards/fomu/profiling.gdb.txt @@ -0,0 +1,16 @@ +set pagination 0 +set logging file profile.txt +set logging overwrite + +server define poor_profile +set $total = $arg0 +set $i = 0 + set logging on + while($i<$total) + set $i = $i + 1 + cont + p $pc + bt + end + set logging off +end diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c new file mode 100644 index 0000000000..574d0de567 --- /dev/null +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -0,0 +1,119 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "csr.h" + +void common_hal_digitalio_digitalinout_never_reset( + digitalio_digitalinout_obj_t *self) { + (void)self; +} + +digitalinout_result_t common_hal_digitalio_digitalinout_construct( + digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { + + // claim_pin(pin); + self->pin = pin; + + return DIGITALINOUT_OK; +} + +bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { + return self->pin == mp_const_none; +} + +void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_deinited(self)) { + return; + } + + // reset_pin_number(0, self->pin->number); + self->pin = mp_const_none; +} + +void common_hal_digitalio_digitalinout_switch_to_input( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + (void)pull; + touch_oe_write(touch_oe_read() & ~(1 << self->pin->number)); +} + +void common_hal_digitalio_digitalinout_switch_to_output( + digitalio_digitalinout_obj_t *self, bool value, + digitalio_drive_mode_t drive_mode) { + (void)drive_mode; + common_hal_digitalio_digitalinout_set_value(self, value); + touch_oe_write(touch_oe_read() | (1 << self->pin->number)); +} + +digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( + digitalio_digitalinout_obj_t *self) { + + return (touch_oe_read() & (1 << self->pin->number)) + ? DIRECTION_OUTPUT : DIRECTION_INPUT; +} + +void common_hal_digitalio_digitalinout_set_value( + digitalio_digitalinout_obj_t *self, bool value) { + if (value) + touch_o_write(touch_o_read() | (1 << self->pin->number)); + else + touch_o_write(touch_o_read() & ~(1 << self->pin->number)); +} + +bool common_hal_digitalio_digitalinout_get_value( + digitalio_digitalinout_obj_t *self) { + return !!(touch_i_read() & (1 << self->pin->number)); +} + +void common_hal_digitalio_digitalinout_set_drive_mode( + digitalio_digitalinout_obj_t *self, + digitalio_drive_mode_t drive_mode) { + (void)self; + (void)drive_mode; +} + +digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( + digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_get_direction(self) == DIRECTION_OUTPUT) + return DRIVE_MODE_PUSH_PULL; + else + return DRIVE_MODE_OPEN_DRAIN; +} + +void common_hal_digitalio_digitalinout_set_pull( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + (void)self; + (void)pull; +} + +digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( + digitalio_digitalinout_obj_t *self) { + return PULL_NONE; +} diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.h b/ports/litex/common-hal/digitalio/DigitalInOut.h new file mode 100644 index 0000000000..3c5bdafaf2 --- /dev/null +++ b/ports/litex/common-hal/digitalio/DigitalInOut.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin; +} digitalio_digitalinout_obj_t; + +#endif // MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/litex/common-hal/digitalio/__init__.c b/ports/litex/common-hal/digitalio/__init__.c new file mode 100644 index 0000000000..20fad45959 --- /dev/null +++ b/ports/litex/common-hal/digitalio/__init__.c @@ -0,0 +1 @@ +// No digitalio module functions. diff --git a/ports/litex/common-hal/microcontroller/Pin.c b/ports/litex/common-hal/microcontroller/Pin.c new file mode 100644 index 0000000000..632468f6d0 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Pin.c @@ -0,0 +1,56 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" + +#include "py/mphal.h" + +STATIC uint8_t claimed_pins[1]; + +// Mark pin as free and return it to a quiescent state. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if (pin_port == 0x0F) { + return; + } + + // Clear claimed bit. + claimed_pins[pin_port] &= ~(1<number; +} + +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { + return !(claimed_pins[pin_port] & 1<number); +} diff --git a/ports/litex/common-hal/microcontroller/Pin.h b/ports/litex/common-hal/microcontroller/Pin.h new file mode 100644 index 0000000000..186e120a28 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Pin.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H +#define MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H + +#include "py/mphal.h" + + +typedef struct { + mp_obj_base_t base; + uint8_t number; +} mcu_pin_obj_t; + +#define PIN(p_number) \ +{ \ + { &mcu_pin_type }, \ + .number = p_number \ +} + +extern const mcu_pin_obj_t pin_TOUCH1; +extern const mcu_pin_obj_t pin_TOUCH2; +extern const mcu_pin_obj_t pin_TOUCH3; +extern const mcu_pin_obj_t pin_TOUCH4; + +void reset_all_pins(void); +// reset_pin_number takes the pin number instead of the pointer so that objects don't +// need to store a full pointer. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number); +void claim_pin(const mcu_pin_obj_t* pin); +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number); +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); +// GPIO_TypeDef * pin_port(uint8_t pin_port); +uint16_t pin_mask(uint8_t pin_number); + +#endif // MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/litex/common-hal/microcontroller/Processor.c b/ports/litex/common-hal/microcontroller/Processor.c new file mode 100644 index 0000000000..9d2b05aade --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Processor.c @@ -0,0 +1,64 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "common-hal/microcontroller/Processor.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "csr.h" +#include "generated/soc.h" + +float common_hal_mcu_processor_get_temperature(void) { + return NAN; +} + +float common_hal_mcu_processor_get_voltage(void) { + return NAN; +} + +uint32_t common_hal_mcu_processor_get_frequency(void) { + return CONFIG_CLOCK_FREQUENCY; +} + +void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { + raw_id[0] = csr_readl(CSR_VERSION_MAJOR_ADDR); + raw_id[1] = csr_readl(CSR_VERSION_MINOR_ADDR); + raw_id[2] = csr_readl(CSR_VERSION_REVISION_ADDR); + raw_id[3] = csr_readl(CSR_VERSION_GITREV_ADDR + 0); + raw_id[4] = csr_readl(CSR_VERSION_GITREV_ADDR + 4); + raw_id[5] = csr_readl(CSR_VERSION_GITREV_ADDR + 8); + raw_id[6] = csr_readl(CSR_VERSION_GITREV_ADDR + 12); + raw_id[7] = csr_readl(CSR_VERSION_GITEXTRA_ADDR + 0); + raw_id[8] = csr_readl(CSR_VERSION_GITEXTRA_ADDR + 4); + raw_id[9] = csr_readl(CSR_VERSION_DIRTY_ADDR); + raw_id[10] = csr_readl(CSR_VERSION_MODEL_ADDR); + raw_id[11] = csr_readl(CSR_VERSION_SEED_ADDR + 0); + raw_id[12] = csr_readl(CSR_VERSION_SEED_ADDR + 4); + raw_id[13] = csr_readl(CSR_VERSION_SEED_ADDR + 8); + raw_id[14] = csr_readl(CSR_VERSION_SEED_ADDR + 12); +} diff --git a/ports/litex/common-hal/microcontroller/Processor.h b/ports/litex/common-hal/microcontroller/Processor.h new file mode 100644 index 0000000000..a2ea261c8f --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Processor.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H + +#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 15 + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} mcu_processor_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/litex/common-hal/microcontroller/__init__.c b/ports/litex/common-hal/microcontroller/__init__.c new file mode 100644 index 0000000000..3c91661144 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/__init__.c @@ -0,0 +1,111 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/microcontroller/Processor.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Processor.h" + +#include "supervisor/filesystem.h" +#include "supervisor/shared/safe_mode.h" + +#include "csr.h" +#include "irq.h" + +void common_hal_mcu_delay_us(uint32_t delay) { + // if (__get_PRIMASK() == 0x00000000) { + // //by default use ticks_ms + // uint32_t start = get_us(); + // while (get_us()-start < delay) { + // __asm__ __volatile__("nop"); + // } + // } else { + // //when SysTick is disabled, approximate with busy loop + // const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; + // for (uint32_t count = 0; ++count <= ucount;) { + // } + // } +} + +volatile uint32_t nesting_count = 0; + +void common_hal_mcu_disable_interrupts(void) { + irq_setie(0); + // __DMB(); + nesting_count++; +} + +void common_hal_mcu_enable_interrupts(void) { + if (nesting_count == 0) { + // This is very very bad because it means there was mismatched disable/enables so we + // "HardFault". + asm("ebreak"); + } + nesting_count--; + if (nesting_count > 0) { + return; + } + irq_setie(1); +} + +void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { + if(runmode == RUNMODE_SAFE_MODE) + safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); +} + +void common_hal_mcu_reset(void) { + filesystem_flush(); //TODO: implement as part of flash improvements + // NVIC_SystemReset(); + while(1); +} + +// The singleton microcontroller.Processor object, bound to microcontroller.cpu +// It currently only has properties, and no state. +const mcu_processor_obj_t common_hal_mcu_processor_obj = { + .base = { + .type = &mcu_processor_type, + }, +}; + +const mcu_pin_obj_t pin_TOUCH1 = PIN(0); +const mcu_pin_obj_t pin_TOUCH2 = PIN(1); +const mcu_pin_obj_t pin_TOUCH3 = PIN(2); +const mcu_pin_obj_t pin_TOUCH4 = PIN(3); + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_TOUCH1) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_TOUCH2) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_TOUCH3) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_TOUCH4) }, +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/litex/common-hal/neopixel_write/__init__.c b/ports/litex/common-hal/neopixel_write/__init__.c new file mode 100644 index 0000000000..29fd318d40 --- /dev/null +++ b/ports/litex/common-hal/neopixel_write/__init__.c @@ -0,0 +1,93 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "shared-bindings/neopixel_write/__init__.h" +#include "csr.h" + +// ICE40 LED Driver hard macro. +// See http://www.latticesemi.com/-/media/LatticeSemi/Documents/ApplicationNotes/IK/ICE40LEDDriverUsageGuide.ashx?document_id=50668 +enum led_registers { + LEDDCR0 = 8, + LEDDBR = 9, + LEDDONR = 10, + LEDDOFR = 11, + LEDDBCRR = 5, + LEDDBCFR = 6, + LEDDPWRR = 1, + LEDDPWRG = 2, + LEDDPWRB = 3, +}; + +// Control register definitions +#define LEDDCR0_LEDDEN (1 << 7) +#define LEDDCR0_FR250 (1 << 6) +#define LEDDCR0_OUTPOL (1 << 5) +#define LEDDCR0_OUTSKEW (1 << 4) +#define LEDDCR0_QUICKSTOP (1 << 3) +#define LEDDCR0_PWM_MODE (1 << 2) +#define LEDDCR0_BRMSBEXT (1 << 0) + +// Write a value into the LEDDA_IP register. +static void ledda_write(uint8_t value, uint8_t addr) { + rgb_addr_write(addr); + rgb_dat_write(value); +} + +static int ledda_init_done; + +static void ledda_init(void) { + if (ledda_init_done) + return; + + // Enable the driver + rgb_ctrl_write((1 << CSR_RGB_CTRL_EXE_OFFSET) | (1 << CSR_RGB_CTRL_CURREN_OFFSET) | (1 << CSR_RGB_CTRL_RGBLEDEN_OFFSET)); + + ledda_write(LEDDCR0_LEDDEN | LEDDCR0_FR250 | LEDDCR0_QUICKSTOP, LEDDCR0); + + // Set clock register to 12 MHz / 64 kHz - 1 + ledda_write((12000000/64000)-1, LEDDBR); + + // Ensure LED "breathe" effect is diabled + ledda_write(0, LEDDBCRR); + ledda_write(0, LEDDBCFR); + + // Also disable the LED blink time + ledda_write(0, LEDDONR); + ledda_write(0, LEDDOFR); + + ledda_init_done = 1; +} + +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { + (void)digitalinout; + (void)numBytes; + ledda_init(); + + ledda_write(pixels[0], LEDDPWRR); // Red + ledda_write(pixels[1], LEDDPWRG); // Green + ledda_write(pixels[2], LEDDPWRB); // Blue +} diff --git a/ports/litex/common-hal/supervisor/Runtime.c b/ports/litex/common-hal/supervisor/Runtime.c new file mode 100644 index 0000000000..feab6987d8 --- /dev/null +++ b/ports/litex/common-hal/supervisor/Runtime.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * 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 +#include "shared-bindings/supervisor/Runtime.h" +#include "supervisor/serial.h" + +bool common_hal_get_serial_connected(void) { + return (bool) serial_connected(); +} + +bool common_hal_get_serial_bytes_available(void) { + return (bool) serial_bytes_available(); +} + diff --git a/ports/litex/common-hal/supervisor/Runtime.h b/ports/litex/common-hal/supervisor/Runtime.h new file mode 100644 index 0000000000..d1fe246211 --- /dev/null +++ b/ports/litex/common-hal/supervisor/Runtime.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} super_runtime_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/litex/common-hal/supervisor/__init__.c b/ports/litex/common-hal/supervisor/__init__.c new file mode 100644 index 0000000000..ac88556b45 --- /dev/null +++ b/ports/litex/common-hal/supervisor/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "py/obj.h" + +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/Runtime.h" + + +// The singleton supervisor.Runtime object, bound to supervisor.runtime +// It currently only has properties, and no state. +const super_runtime_obj_t common_hal_supervisor_runtime_obj = { + .base = { + .type = &supervisor_runtime_type, + }, +}; \ No newline at end of file diff --git a/ports/litex/common-hal/time/__init__.c b/ports/litex/common-hal/time/__init__.c new file mode 100644 index 0000000000..c85077868a --- /dev/null +++ b/ports/litex/common-hal/time/__init__.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "py/mphal.h" + +#include "tick.h" + +uint64_t common_hal_time_monotonic(void) { + return supervisor_ticks_ms64(); +} + +uint64_t common_hal_time_monotonic_ns(void) { + uint64_t ms; + uint32_t us_until_ms; + current_tick(&ms, &us_until_ms); + // us counts down. + return 1000 * (ms * 1000 + (1000 - us_until_ms)); +} + +void common_hal_time_delay_ms(uint32_t delay) { + mp_hal_delay_ms(delay); +} diff --git a/ports/litex/crt0-vexriscv.S b/ports/litex/crt0-vexriscv.S new file mode 100644 index 0000000000..0419acf851 --- /dev/null +++ b/ports/litex/crt0-vexriscv.S @@ -0,0 +1,94 @@ +.global main +.global isr + +.section .text.start +.global _start + +_start: + j crt_init + # This sentinal ensures that this program is loaded + # to RAM when loaded using dfu-util. + #.word 0x17ab0f23 + #.word 0x10001000 + +.section .ramtext +.global trap_entry +.align 4 +trap_entry: + sw x1, - 1*4(sp) + sw x5, - 2*4(sp) + sw x6, - 3*4(sp) + sw x7, - 4*4(sp) + sw x10, - 5*4(sp) + sw x11, - 6*4(sp) + sw x12, - 7*4(sp) + sw x13, - 8*4(sp) + sw x14, - 9*4(sp) + sw x15, -10*4(sp) + sw x16, -11*4(sp) + sw x17, -12*4(sp) + sw x28, -13*4(sp) + sw x29, -14*4(sp) + sw x30, -15*4(sp) + sw x31, -16*4(sp) + addi sp,sp,-16*4 + call isr + lw x1 , 15*4(sp) + lw x5, 14*4(sp) + lw x6, 13*4(sp) + lw x7, 12*4(sp) + lw x10, 11*4(sp) + lw x11, 10*4(sp) + lw x12, 9*4(sp) + lw x13, 8*4(sp) + lw x14, 7*4(sp) + lw x15, 6*4(sp) + lw x16, 5*4(sp) + lw x17, 4*4(sp) + lw x28, 3*4(sp) + lw x29, 2*4(sp) + lw x30, 1*4(sp) + lw x31, 0*4(sp) + addi sp,sp,16*4 + mret + +.text + +crt_init: + # # Flush the caches + # .word 16399 + # .word 19 + # .word 19 + # .word 19 + la sp, _estack - 4 + la a0, trap_entry + csrw mtvec, a0 + +bss_init: + la a0, _sbss + la a1, _ebss +bss_loop: + beq a0,a1,bss_done + sw zero,0(a0) + add a0,a0,4 + j bss_loop +bss_done: + + /* Load DATA */ + la t0, _sidata + la t1, _sdata + la t2, _edata +3: + lw t3, 0(t0) + sw t3, 0(t1) + /* _edata is aligned to 16 bytes. Use word-xfers. */ + addi t0, t0, 4 + addi t1, t1, 4 + bltu t1, t2, 3b + + li a0, 0x880 //880 enable timer + external interrupt sources (until mstatus.MIE is set, they will never trigger an interrupt) + csrw mie,a0 + + call main +infinite_loop: + j infinite_loop diff --git a/ports/litex/fatfs_port.c b/ports/litex/fatfs_port.c new file mode 100644 index 0000000000..13ac21fb1b --- /dev/null +++ b/ports/litex/fatfs_port.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +DWORD get_fattime(void) { + // TODO: Implement this function. For now, fake it. + return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); +} diff --git a/ports/litex/hw/common.h b/ports/litex/hw/common.h new file mode 100644 index 0000000000..6a97ca2e93 --- /dev/null +++ b/ports/litex/hw/common.h @@ -0,0 +1,33 @@ +#ifndef _HW_COMMON_H_ +#define _HW_COMMON_H_ +#include +static inline void csr_writeb(uint8_t value, uint32_t addr) +{ + *((volatile uint8_t *)addr) = value; +} + +static inline uint8_t csr_readb(uint32_t addr) +{ + return *(volatile uint8_t *)addr; +} + +static inline void csr_writew(uint16_t value, uint32_t addr) +{ + *((volatile uint16_t *)addr) = value; +} + +static inline uint16_t csr_readw(uint32_t addr) +{ + return *(volatile uint16_t *)addr; +} + +static inline void csr_writel(uint32_t value, uint32_t addr) +{ + *((volatile uint32_t *)addr) = value; +} + +static inline uint32_t csr_readl(uint32_t addr) +{ + return *(volatile uint32_t *)addr; +} +#endif /* _HW_COMMON_H_ */ \ No newline at end of file diff --git a/ports/litex/irq.h b/ports/litex/irq.h new file mode 100644 index 0000000000..a822189071 --- /dev/null +++ b/ports/litex/irq.h @@ -0,0 +1,71 @@ +#ifndef __IRQ_H +#define __IRQ_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#define CSR_MSTATUS_MIE 0x8 + +#define CSR_IRQ_MASK 0xBC0 +#define CSR_IRQ_PENDING 0xFC0 + +#define CSR_DCACHE_INFO 0xCC0 + +#define csrr(reg) ({ unsigned long __tmp; \ + asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \ + __tmp; }) + +#define csrw(reg, val) ({ \ + if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ + asm volatile ("csrw " #reg ", %0" :: "i"(val)); \ + else \ + asm volatile ("csrw " #reg ", %0" :: "r"(val)); }) + +#define csrs(reg, bit) ({ \ + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrs x0, " #reg ", %0" :: "i"(bit)); \ + else \ + asm volatile ("csrrs x0, " #reg ", %0" :: "r"(bit)); }) + +#define csrc(reg, bit) ({ \ + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrc x0, " #reg ", %0" :: "i"(bit)); \ + else \ + asm volatile ("csrrc x0, " #reg ", %0" :: "r"(bit)); }) + +static inline unsigned int irq_getie(void) +{ + return (csrr(mstatus) & CSR_MSTATUS_MIE) != 0; +} + +static inline void irq_setie(unsigned int ie) +{ + if(ie) csrs(mstatus,CSR_MSTATUS_MIE); else csrc(mstatus,CSR_MSTATUS_MIE); +} + +static inline unsigned int irq_getmask(void) +{ + unsigned int mask; + asm volatile ("csrr %0, %1" : "=r"(mask) : "i"(CSR_IRQ_MASK)); + return mask; +} + +static inline void irq_setmask(unsigned int mask) +{ + asm volatile ("csrw %0, %1" :: "i"(CSR_IRQ_MASK), "r"(mask)); +} + +static inline unsigned int irq_pending(void) +{ + unsigned int pending; + asm volatile ("csrr %0, %1" : "=r"(pending) : "i"(CSR_IRQ_PENDING)); + return pending; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __IRQ_H */ \ No newline at end of file diff --git a/ports/litex/mpconfigport.h b/ports/litex/mpconfigport.h new file mode 100644 index 0000000000..cfa3eb5c74 --- /dev/null +++ b/ports/litex/mpconfigport.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef FPGA_MPCONFIGPORT_H__ +#define FPGA_MPCONFIGPORT_H__ + +#define MICROPY_PY_UJSON (0) +#define CIRCUITPY_INTERNAL_NVM_SIZE (0) +#define MICROPY_NLR_THUMB (0) + +#include "py/circuitpy_mpconfig.h" + +#define MICROPY_PORT_ROOT_POINTERS \ + CIRCUITPY_COMMON_ROOT_POINTERS +#define MICROPY_NLR_SETJMP (1) +#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 + + +#endif // __INCLUDED_FPGA_MPCONFIGPORT_H diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk new file mode 100644 index 0000000000..47e2b1abc8 --- /dev/null +++ b/ports/litex/mpconfigport.mk @@ -0,0 +1,31 @@ +# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk +# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. +# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + +# Internal math library is substantially smaller than toolchain one +INTERNAL_LIBM = 1 + +# Chip supplied serial number, in bytes +USB_SERIAL_NUMBER_LENGTH = 30 + +# Longints can be implemented as mpz, as longlong, or not +LONGINT_IMPL = MPZ + +#Reduced feature set for early port +CIRCUITPY_MINIMAL_BUILD = 1 + +# CIRCUITPY_BOARD = 1 +# CIRCUITPY_DIGITALIO = 1 +# CIRCUITPY_ANALOGIO = 1 +# CIRCUITPY_MICROCONTROLLER = 1 +# CIRCUITPY_BUSIO = 1 +# CIRCUITPY_PULSEIO = 1 +# CIRCUITPY_OS = 1 +# CIRCUITPY_STORAGE = 1 +# CIRCUITPY_RANDOM = 1 +CIRCUITPY_USB_HID = 1 +CIRCUITPY_USB_MIDI = 1 + +#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) +#endif diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c new file mode 100644 index 0000000000..005a65aac4 --- /dev/null +++ b/ports/litex/mphalport.c @@ -0,0 +1,81 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2018 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/mphal.h" +#include "py/mpstate.h" +#include "py/gc.h" + +#include "csr.h" +#include "generated/soc.h" + +#include "irq.h" + +#ifdef CFG_TUSB_MCU + void hal_dcd_isr(uint8_t rhport); +#endif + +/*------------------------------------------------------------------*/ +/* delay + *------------------------------------------------------------------*/ +void mp_hal_delay_ms(mp_uint_t delay) { + uint64_t start_tick = supervisor_ticks_ms64(); + uint64_t duration = 0; + while (duration < delay) { + #ifdef MICROPY_VM_HOOK_LOOP + MICROPY_VM_HOOK_LOOP + #endif + // Check to see if we've been CTRL-Ced by autoreload or the user. + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + break; + } + duration = (supervisor_ticks_ms64() - start_tick); + // TODO(tannewt): Go to sleep for a little while while we wait. + } +} + +extern void SysTick_Handler(void); + +__attribute__((section(".ramtext"))) +void isr(void) { + uint8_t irqs = irq_pending() & irq_getmask(); + +#ifdef CFG_TUSB_MCU + if (irqs & (1 << USB_INTERRUPT)) + hal_dcd_isr(0); +#endif + if (irqs & (1 << TIMER0_INTERRUPT)) + SysTick_Handler(); +} + +mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) { + unsigned long __tmp; + asm volatile ("mv %0, x2" :"=r"(__tmp)); + return __tmp; +} diff --git a/ports/litex/mphalport.h b/ports/litex/mphalport.h new file mode 100644 index 0000000000..540575c587 --- /dev/null +++ b/ports/litex/mphalport.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __FOMU_HAL +#define __FOMU_HAL + +#include +#include + +#include "lib/utils/interrupt_char.h" +#include "py/mpconfig.h" +#include "supervisor/shared/tick.h" + +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) +//#define mp_hal_delay_us(us) NRFX_DELAY_US((uint32_t) (us)) + +bool mp_hal_stdin_any(void); + +#endif diff --git a/ports/litex/qstrdefsport.h b/ports/litex/qstrdefsport.h new file mode 100644 index 0000000000..3ba897069b --- /dev/null +++ b/ports/litex/qstrdefsport.h @@ -0,0 +1 @@ +// qstrs specific to this port diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c new file mode 100644 index 0000000000..93aeda8cbd --- /dev/null +++ b/ports/litex/supervisor/internal_flash.c @@ -0,0 +1,350 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "supervisor/internal_flash.h" + +#include +#include +#include + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +#include "supervisor/usb.h" + +#include "csr.h" +#include "irq.h" + +enum pin { + PIN_MOSI = 0, + PIN_CLK = 1, + PIN_CS = 2, + PIN_MISO_EN = 3, + PIN_MISO = 4, // Value is ignored +}; + +#define NO_CACHE 0xffffffff + +static uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); +static uint32_t _flash_page_addr = NO_CACHE; +static bool _flash_cache_dirty; +// ------------------------------------------------------------------------- +// When performing SPI operations, the flash cannot be accessed. Since we +// normally execute directly from SPI, this can cause problems. +// To work around this, we execute from RAM. This is accomplished by marking +// functions as being in the section ".ramtext". +// When building under GCC with -O0 or -Od, the `inline` attribute is ignored. +// Therefore, we must re-implement these functions here and explicitly mark +// them as being in `.ramtext`, even though they really ought to be inlined. +__attribute__((section(".ramtext"))) +static inline void spi_writel(uint32_t value, uint32_t addr) +{ + *((volatile uint32_t *)addr) = value; +} + +__attribute__((section(".ramtext"))) +static inline uint32_t spi_readl(uint32_t addr) +{ + return *(volatile uint32_t *)addr; +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_write(unsigned char value) { + spi_writel(value, CSR_LXSPI_BITBANG_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline uint32_t bb_read(void) { + return spi_readl(CSR_LXSPI_MISO_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_en(unsigned int en) { + spi_writel(en, CSR_LXSPI_BITBANG_EN_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_irq_setie(unsigned int ie) +{ + if(ie) csrs(mstatus,CSR_MSTATUS_MIE); else csrc(mstatus,CSR_MSTATUS_MIE); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_begin(void) { + bb_spi_write((0 << PIN_CLK) | (0 << PIN_CS)); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_end(void) { + bb_spi_write((0 << PIN_CLK) | (1 << PIN_CS)); +} + +__attribute__((section(".ramtext"))) +static void spi_single_tx(uint8_t out) { + int bit; + + for (bit = 7; bit >= 0; bit--) { + if (out & (1 << bit)) { + bb_spi_write((0 << PIN_CLK) | (1 << PIN_MOSI)); + bb_spi_write((1 << PIN_CLK) | (1 << PIN_MOSI)); + bb_spi_write((0 << PIN_CLK) | (1 << PIN_MOSI)); + } else { + bb_spi_write((0 << PIN_CLK) | (0 << PIN_MOSI)); + bb_spi_write((1 << PIN_CLK) | (0 << PIN_MOSI)); + bb_spi_write((0 << PIN_CLK) | (0 << PIN_MOSI)); + } + } +} + +__attribute__((section(".ramtext"))) +static uint8_t spi_single_rx(void) { + int bit = 0; + uint8_t in = 0; + + bb_spi_write((1 << PIN_MISO_EN) | (0 << PIN_CLK)); + + while (bit++ < 8) { + bb_spi_write((1 << PIN_MISO_EN) | (1 << PIN_CLK)); + in = (in << 1) | bb_read(); + bb_spi_write((1 << PIN_MISO_EN) | (0 << PIN_CLK)); + } + + return in; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_beginErase4(uint32_t erase_addr) { + // Enable Write-Enable Latch (WEL) + bb_spi_begin(); + spi_single_tx(0x06); + bb_spi_end(); + + bb_spi_begin(); + spi_single_tx(0x20); + spi_single_tx(erase_addr >> 16); + spi_single_tx(erase_addr >> 8); + spi_single_tx(erase_addr >> 0); + bb_spi_end(); + return 0; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_beginWrite(uint32_t addr, const void *v_data, unsigned int count) { + const uint8_t write_cmd = 0x02; + const uint8_t *data = v_data; + unsigned int i; + +#ifdef NDEBUG + if (v_data < (const void *)_flash_cache) { + asm("ebreak"); + } + if ((v_data+count) > (const void *)&_flash_cache[4096]) { + asm("ebreak"); + } +#endif + + // Enable Write-Enable Latch (WEL) + bb_spi_begin(); + spi_single_tx(0x06); + bb_spi_end(); + + bb_spi_begin(); + spi_single_tx(write_cmd); + spi_single_tx(addr >> 16); + spi_single_tx(addr >> 8); + spi_single_tx(addr >> 0); + for (i = 0; (i < count) && (i < 256); i++) + spi_single_tx(*data++); + bb_spi_end(); + + return 0; +} + +__attribute__((section(".ramtext"))) +static uint8_t spi_read_status(void) { + uint8_t val; + + bb_spi_begin(); + spi_single_tx(0x05); + val = spi_single_rx(); + bb_spi_end(); + return val; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_is_busy(void) { + return spi_read_status() & (1 << 0); +} + +__attribute__((used)) +uint32_t page_write_log[128]; +__attribute__((used)) +uint32_t page_write_log_offset; + +__attribute__((section(".ramtext"))) +static void bb_spi_write_page(uint32_t flash_address, const uint8_t *data) { + const uint32_t flash_address_end = flash_address + FLASH_PAGE_SIZE; + + // Ensure we're within the target flash address range. + if ((flash_address - FLASH_PARTITION_OFFSET_BYTES) > FLASH_SIZE) { + asm("ebreak"); + return; + } + if (flash_address < FLASH_PARTITION_OFFSET_BYTES) { + asm("ebreak"); + return; + } + + if ((flash_address_end - FLASH_PARTITION_OFFSET_BYTES) > FLASH_SIZE) { + asm("ebreak"); + return; + } + if (flash_address_end < FLASH_PARTITION_OFFSET_BYTES) { + asm("ebreak"); + return; + } + + // Ensure we're not erasing the middle of a flash bank + if ((flash_address & 0xfff) != 0) { + asm("ebreak"); + return; + } + + page_write_log[page_write_log_offset++] = flash_address; + if (page_write_log_offset > sizeof(page_write_log)/sizeof(*page_write_log)) page_write_log_offset=0; + + while (bb_spi_is_busy()) + ; // relax + bb_spi_beginErase4(flash_address); + while (bb_spi_is_busy()) + ; // relax + while (flash_address < flash_address_end) { + bb_spi_beginWrite(flash_address, data, 256); + while (bb_spi_is_busy()) + ; // relax + flash_address += 256; + data += 256; + } +} + +static inline uint32_t lba2addr(uint32_t block) { + return (0x20000000 + FLASH_PARTITION_OFFSET_BYTES) + (block * FILESYSTEM_BLOCK_SIZE); +} + +void supervisor_flash_init(void) { +} + +uint32_t supervisor_flash_get_block_size(void) { + return FILESYSTEM_BLOCK_SIZE; +} + +uint32_t supervisor_flash_get_block_count(void) { + return FLASH_SIZE/FILESYSTEM_BLOCK_SIZE; +} + +__attribute__((section(".ramtext"))) +void supervisor_flash_flush(void) { + // Skip if data is the same, or if there is no data in the cache + if (_flash_page_addr == NO_CACHE) + return; + if (!_flash_cache_dirty) + return; + + // Disable interrupts and enable bit-bang mode on the SPI flash. + // This function is running from RAM -- otherwise enabling bitbang mode + // would crash the CPU as the program suddenly became an endless stream + // of `0xffffffff`. + bb_spi_irq_setie(0); + bb_spi_write((0 << PIN_CLK) | (1 << PIN_CS)); + bb_spi_en(1); + + bb_spi_write_page(_flash_page_addr & 0x00ffffff, (const uint8_t *)_flash_cache); + + bb_spi_en(0); + bb_spi_irq_setie(1); + + _flash_cache_dirty = false; +} + +mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { + // Must write out anything in cache before trying to read. + supervisor_flash_flush(); + + uint32_t src = lba2addr(block); + memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); + + #if USB_AVAILABLE + usb_background(); + #endif + + return 0; +} + +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32_t num_blocks) { + while (num_blocks) { + uint32_t const addr = lba2addr(lba); + uint32_t const page_addr = addr & ~(FLASH_PAGE_SIZE - 1); + + uint32_t count = 8 - (lba % 8); // up to page boundary + count = MIN(num_blocks, count); + + if (page_addr != _flash_page_addr) { + // Write out anything in cache before overwriting it. + supervisor_flash_flush(); + + _flash_page_addr = page_addr; + _flash_cache_dirty = false; + + // Copy the current contents of the entire page into the cache. + memcpy(_flash_cache, (void *)page_addr, FLASH_PAGE_SIZE); + } + + // Overwrite part or all of the page cache with the src data, but only if it's changed. + if (_flash_cache_dirty || memcmp(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE)) { + memcpy(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE); + _flash_cache_dirty = true; + } + + // adjust for next run + lba += count; + src += count * FILESYSTEM_BLOCK_SIZE; + num_blocks -= count; + + #if USB_AVAILABLE + usb_background(); + #endif + } + + return 0; // success +} + +void supervisor_flash_release_cache(void) { +} + diff --git a/ports/litex/supervisor/internal_flash.h b/ports/litex/supervisor/internal_flash.h new file mode 100644 index 0000000000..41a69e2abe --- /dev/null +++ b/ports/litex/supervisor/internal_flash.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H + +#include +#include + +#include "py/mpconfig.h" + +#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms +#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) + +#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H diff --git a/ports/litex/supervisor/internal_flash_root_pointers.h b/ports/litex/supervisor/internal_flash_root_pointers.h new file mode 100644 index 0000000000..ae3e45e14c --- /dev/null +++ b/ports/litex/supervisor/internal_flash_root_pointers.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H +#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H + +#define FLASH_ROOT_POINTERS + +#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c new file mode 100644 index 0000000000..9688c7baef --- /dev/null +++ b/ports/litex/supervisor/port.c @@ -0,0 +1,85 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "supervisor/port.h" +#include "boards/board.h" +#include "tick.h" +#include "irq.h" +#include "csr.h" + +safe_mode_t port_init(void) { + irq_setmask(0); + irq_setie(1); + tick_init(); + board_init(); + return NO_SAFE_MODE; +} + +extern uint32_t _ebss; +extern uint32_t _heap_start; +extern uint32_t _estack; + +void reset_port(void) { + // reset_all_pins(); + // i2c_reset(); + // spi_reset(); + // uart_reset(); + // pwmout_reset(); +} + +void reset_to_bootloader(void) { + reboot_ctrl_write(0xac); +} + +void reset_cpu(void) { +} + +uint32_t *port_heap_get_bottom(void) { + return port_stack_get_limit(); +} + +uint32_t *port_heap_get_top(void) { + return port_stack_get_top(); +} + +uint32_t *port_stack_get_limit(void) { + return &_ebss; +} + +uint32_t *port_stack_get_top(void) { + return &_estack; +} + +// Place the word to save just after our BSS section that gets blanked. +void port_set_saved_word(uint32_t value) { + _ebss = value; +} + +uint32_t port_get_saved_word(void) { + return _ebss; +} diff --git a/ports/litex/supervisor/usb.c b/ports/litex/supervisor/usb.c new file mode 100644 index 0000000000..182360b713 --- /dev/null +++ b/ports/litex/supervisor/usb.c @@ -0,0 +1,36 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "tick.h" +#include "supervisor/usb.h" +#include "lib/utils/interrupt_char.h" +#include "lib/mp-readline/readline.h" + +void init_usb_hardware(void) { + +} diff --git a/ports/litex/tick.c b/ports/litex/tick.c new file mode 100644 index 0000000000..8ba06044ac --- /dev/null +++ b/ports/litex/tick.c @@ -0,0 +1,82 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "csr.h" +#include "tick.h" +#include "irq.h" + +#include "supervisor/shared/autoreload.h" +#include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" +#include "shared-module/gamepad/__init__.h" +#include "shared-bindings/microcontroller/Processor.h" + +// Global millisecond tick count +// volatile uint64_t ticks_ms = 0; + +__attribute__((section(".ramtext"))) +void SysTick_Handler(void) { + timer0_ev_pending_write(1); + supervisor_tick(); +} + +void tick_init() { + int t; + + timer0_en_write(0); + t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick + timer0_reload_write(t); + timer0_load_write(t); + timer0_en_write(1); + timer0_ev_enable_write(1); + timer0_ev_pending_write(1); + irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); +} + +void tick_delay(uint32_t us) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; + // uint64_t start_ms = ticks_ms; + // while (us > 1000) { + // while (ticks_ms == start_ms) {} + // us -= us_between_ticks; + // start_ms = ticks_ms; + // us_between_ticks = 1000; + // } + // while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} +} + +// us counts down! +void current_tick(uint64_t* ms, uint32_t* us_until_ms) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // *ms = ticks_ms; + // *us_until_ms = SysTick->VAL / ticks_per_us; +} + +void wait_until(uint64_t ms, uint32_t us_until_ms) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} +} diff --git a/ports/litex/tick.h b/ports/litex/tick.h new file mode 100644 index 0000000000..b4d27b8416 --- /dev/null +++ b/ports/litex/tick.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_TICK_H +#define MICROPY_INCLUDED_LITEX_TICK_H + +#include "py/mpconfig.h" + +#include + +extern volatile uint64_t ticks_ms; + +extern struct timer_descriptor ms_timer; + +void tick_init(void); + +void tick_delay(uint32_t us); + +void current_tick(uint64_t* ms, uint32_t* us_until_ms); +// Do not call this with interrupts disabled because it may be waiting for +// ticks_ms to increment. +void wait_until(uint64_t ms, uint32_t us_until_ms); + +#endif // MICROPY_INCLUDED_LITEX_TICK_H From 1902579b465342e1adf7dcdc0c3abd5e035aa64b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 30 Mar 2020 11:06:36 +0800 Subject: [PATCH 146/919] supervisor: enable itcm memory region for fomu Signed-off-by: Sean Cross --- supervisor/linker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/linker.h b/supervisor/linker.h index b584144338..d68be24373 100755 --- a/supervisor/linker.h +++ b/supervisor/linker.h @@ -29,7 +29,7 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_LINKER_H #define MICROPY_INCLUDED_SUPERVISOR_LINKER_H -#if defined(IMXRT10XX) +#if defined(IMXRT10XX) || defined(FOMU) #define PLACE_IN_DTCM_DATA(name) name __attribute__((section(".dtcm_data." #name ))) #define PLACE_IN_DTCM_BSS(name) name __attribute__((section(".dtcm_bss." #name ))) #define PLACE_IN_ITCM(name) __attribute__((section(".itcm." #name ))) name From 065441e58c5e56060e7cc690f284e1f12b442f1c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 30 Mar 2020 11:06:52 +0800 Subject: [PATCH 147/919] ports: litex: enable itcm region for fomu This adds a new command line flag -DFOMU to indicate we're building for a Fomu board. Signed-off-by: Sean Cross --- ports/litex/Makefile | 2 +- ports/litex/boards/fomu/fomu-spi.ld | 42 +++-------------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 36d5874121..b3a57e1547 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -86,7 +86,7 @@ endif CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) # TODO: check this -CFLAGS += -D__START=main +CFLAGS += -D__START=main -DFOMU LD_FILE := boards/$(BOARD)/$(BOARD)-spi.ld diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index b6b00becd3..161ba607b1 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -26,45 +26,8 @@ SECTIONS . = ALIGN(4); _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - /* These functions must be in RAM for USB to respond in time. */ - *(.text.timer0_ev_pending_write) - *(.text.mp_parse) - *(.text.parse_compile_execute) - *(.text.cmp_lfn) - *(.text.qstr_find_strn) - *(.text.dcd_edpt_xfer) - *(.text.pop_rule) - *(.text.ff_wtoupper) - *(.text.dir_find) - *(.text.push_rule) - *(.text.csr_writel) - *(.text.csr_readl) - *(.text.autoreload_tick) - *(.text.filesystem_tick) - - /* These two functions are called twice as often as any other function */ - *(.text.mp_map_lookup) - *(.text.mp_execute_bytecode) /* Note: this function is 7kb */ - - /* These functions are hot, and placing them in ram greatly - * improves performance - */ - *(.text.mp_decode_uint_value) - *(.text.tud_cdc_n_write_flush) - *(.text.mp_load_method_maybe) - *(.text.mp_convert_member_lookup) - *(.text.irq_getmask) - *(.text.irq_setmask) - *(.text.tu_edpt_dir) - *(.text.tu_fifo_empty) - *(.text.irq_pending) - *(.text.tud_task) - *(.text.usb_background) - *(.text._osal_q_lock) - *(.text.osal_queue_receive) - *(.text.mp_obj_get_type) - *(.text.usbd_edpt_busy) - + *(.itcm.*) /* Instruction Tightly Coupled Memory */ + *(.dtcm_data.*) /* Data Tightly Coupled Memory */ *(.ramtext) /* .text* sections (code) */ *(.ramtext*) /* .text* sections (code) */ *(.data) /* .data sections */ @@ -100,6 +63,7 @@ SECTIONS _sbss = .; /* define a global symbol at bss start; used by startup code */ *(.bss) *(.bss*) + *(.dtcm_bss.*) /* Data Tightly Coupled Memory */ *(.sbss) *(.sbss*) *(COMMON) From 56ef51d3927eff75df5cc7b09ee5eaa02181bd89 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 31 Mar 2020 10:05:31 +0800 Subject: [PATCH 148/919] workflow: add litex_fomu to ci This adds fomu and litex and fomu to build on ci. It requires downloading a riscv toolchain. Signed-off-by: Sean Cross --- .github/workflows/build.yml | 4 ++++ tools/build_board_info.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0be05ade47..2ca1670519 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,7 @@ jobs: - "feather_nrf52840_express" - "feather_radiofruit_zigbee" - "feather_stm32f405_express" + - "fomu" - "gemma_m0" - "grandcentral_m4_express" - "hallowing_m0_express" @@ -254,10 +255,13 @@ jobs: pip install requests sh click setuptools awscli wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 + wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz + sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz - name: Versions run: | gcc --version arm-none-eabi-gcc --version + riscv64-unknown-elf-gcc --version python3 --version - uses: actions/checkout@v1 with: diff --git a/tools/build_board_info.py b/tools/build_board_info.py index b64f734f88..dffbb33ff1 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -12,7 +12,7 @@ from sh.contrib import git sys.path.append("adabot") import adabot.github_requests as github -SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx"] +SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx", "litex"] BIN = ('bin',) UF2 = ('uf2',) @@ -32,6 +32,7 @@ extension_by_port = { "stm": BIN, "cxd56": SPK, "mimxrt10xx": HEX_UF2, + "litex": BIN, } # Per board overrides From 3c767cc5e11de4a63d0be0690be07badd99ba009 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 31 Mar 2020 10:53:58 +0800 Subject: [PATCH 149/919] workflows: move riscv to its own section The riscv compilers shouldn't be in a section called "build-arm". Signed-off-by: Sean Cross --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ca1670519..e6ba3725cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,7 +167,6 @@ jobs: - "feather_nrf52840_express" - "feather_radiofruit_zigbee" - "feather_stm32f405_express" - - "fomu" - "gemma_m0" - "grandcentral_m4_express" - "hallowing_m0_express" @@ -255,12 +254,55 @@ jobs: pip install requests sh click setuptools awscli wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 + - name: Versions + run: | + gcc --version + arm-none-eabi-gcc --version + python3 --version + - uses: actions/checkout@v1 + with: + submodules: true + - name: mpy-cross + run: make -C mpy-cross -j2 + - name: build + run: python3 -u build_release_files.py + working-directory: tools + env: + BOARDS: ${{ matrix.board }} + - uses: actions/upload-artifact@v1.0.0 + with: + name: ${{ matrix.board }} + path: bin/${{ matrix.board }} + - name: Upload to S3 + run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + + build-riscv: + runs-on: ubuntu-16.04 + needs: test + strategy: + fail-fast: false + matrix: + board: + - "fomu" + + steps: + - name: Set up Python 3.5 + uses: actions/setup-python@v1 + with: + python-version: 3.5 + - name: Install deps + run: | + sudo apt-get install -y gettext + pip install requests sh click setuptools awscli wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz - name: Versions run: | gcc --version - arm-none-eabi-gcc --version riscv64-unknown-elf-gcc --version python3 --version - uses: actions/checkout@v1 From c91d364a58118100871acd5a195b73c3bbbe5141 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 31 Mar 2020 11:36:57 +0800 Subject: [PATCH 150/919] tools: add dfu-suffix.py This reproduces `dfu-suffix` from the `dfu-tools` package. Signed-off-by: Sean Cross --- tools/dfu-suffix.py | 95 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 tools/dfu-suffix.py diff --git a/tools/dfu-suffix.py b/tools/dfu-suffix.py new file mode 100644 index 0000000000..dd6019235b --- /dev/null +++ b/tools/dfu-suffix.py @@ -0,0 +1,95 @@ +#!/usr/bin/python + +# Written by Antonio Galea - 2010/11/18 +# Updated for DFU 1.1 by Sean Cross - 2020/03/31 +# Distributed under Gnu LGPL 3.0 +# see http://www.gnu.org/licenses/lgpl-3.0.txt + +import sys,struct,zlib,os +from optparse import OptionParser + +DEFAULT_DEVICE="0x0483:0xdf11" + +def named(tuple,names): + return dict(zip(names.split(),tuple)) +def consume(fmt,data,names): + n = struct.calcsize(fmt) + return named(struct.unpack(fmt,data[:n]),names),data[n:] +def cstring(string): + return string.split('\0',1)[0] +def compute_crc(data): + return 0xFFFFFFFF & -zlib.crc32(data) -1 + +def parse(file,dump_images=False): + print ('File: "%s"' % file) + data = open(file,'rb').read() + crc = compute_crc(data[:-4]) + data = data[len(data)-16:] + suffix = named(struct.unpack('<4H3sBI',data[:16]),'device product vendor dfu ufd len crc') + print ('usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % suffix) + if crc != suffix['crc']: + print ("CRC ERROR: computed crc32 is 0x%08x" % crc) + data = data[16:] + if data: + print ("PARSE ERROR") + +def build(file,data,device=DEFAULT_DEVICE): + # Parse the VID and PID from the `device` argument + v,d=map(lambda x: int(x,0) & 0xFFFF, device.split(':',1)) + + # Generate the DFU suffix, consisting of these fields: + # Field name | Length | Description + # ================+=========+================================ + # bcdDevice | 2 | The release number of this firmware (0xffff - don't care) + # idProduct | 2 | PID of this device + # idVendor | 2 | VID of this device + # bcdDFU | 2 | Version of this DFU spec (0x01 0x00) + # ucDfuSignature | 3 | The characters 'DFU', printed in reverse order + # bLength | 1 | The length of this suffix (16 bytes) + # dwCRC | 4 | A CRC32 of the data, including this suffix + data += struct.pack('<4H3sB',0xffff,d,v,0x0100,b'UFD',16) + crc = compute_crc(data) + # Append the CRC32 of the entire block + data += struct.pack(' Date: Tue, 31 Mar 2020 11:42:55 +0800 Subject: [PATCH 151/919] ports: fomu: build dfu as part of Makefile Now that we have a replacement for `dfu-suffix`, construct a dfu image rather than a UF2 image. Signed-off-by: Sean Cross --- ports/litex/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/litex/Makefile b/ports/litex/Makefile index b3a57e1547..de1124aca1 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -171,7 +171,7 @@ SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(S SRC_QSTR_PREPROCESSOR += -all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 +all: $(BUILD)/firmware.bin $(BUILD)/firmware.dfu $(BUILD)/firmware.elf: $(OBJ) $(STEPECHO) "LINK $@" @@ -188,9 +188,9 @@ $(BUILD)/firmware.hex: $(BUILD)/firmware.elf $(Q)$(OBJCOPY) -O ihex $^ $@ # $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ -$(BUILD)/firmware.uf2: $(BUILD)/firmware.hex +$(BUILD)/firmware.dfu: $(BUILD)/firmware.bin $(ECHO) "Create $@" - $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xADA00001 -c -o "$(BUILD)/firmware.uf2" $^ + $(PYTHON3) $(TOP)/tools/dfu-suffix.py -b $^ -D 0x1209:0x5bf0 "$(BUILD)/firmware.dfu" include $(TOP)/py/mkrules.mk From e8db880e7fd14beab381f1225971f8cdc120abba Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 31 Mar 2020 13:03:53 +0800 Subject: [PATCH 152/919] tools: rename dfu-suffix.py to dfu.py dfu.py is unused in circuitpython, so rename dfu-suffix.py to replace it. Signed-off-by: Sean Cross --- tools/dfu-suffix.py | 95 --------------------------------------------- tools/dfu.py | 84 ++++++++++++++------------------------- 2 files changed, 29 insertions(+), 150 deletions(-) delete mode 100644 tools/dfu-suffix.py mode change 100755 => 100644 tools/dfu.py diff --git a/tools/dfu-suffix.py b/tools/dfu-suffix.py deleted file mode 100644 index dd6019235b..0000000000 --- a/tools/dfu-suffix.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/python - -# Written by Antonio Galea - 2010/11/18 -# Updated for DFU 1.1 by Sean Cross - 2020/03/31 -# Distributed under Gnu LGPL 3.0 -# see http://www.gnu.org/licenses/lgpl-3.0.txt - -import sys,struct,zlib,os -from optparse import OptionParser - -DEFAULT_DEVICE="0x0483:0xdf11" - -def named(tuple,names): - return dict(zip(names.split(),tuple)) -def consume(fmt,data,names): - n = struct.calcsize(fmt) - return named(struct.unpack(fmt,data[:n]),names),data[n:] -def cstring(string): - return string.split('\0',1)[0] -def compute_crc(data): - return 0xFFFFFFFF & -zlib.crc32(data) -1 - -def parse(file,dump_images=False): - print ('File: "%s"' % file) - data = open(file,'rb').read() - crc = compute_crc(data[:-4]) - data = data[len(data)-16:] - suffix = named(struct.unpack('<4H3sBI',data[:16]),'device product vendor dfu ufd len crc') - print ('usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % suffix) - if crc != suffix['crc']: - print ("CRC ERROR: computed crc32 is 0x%08x" % crc) - data = data[16:] - if data: - print ("PARSE ERROR") - -def build(file,data,device=DEFAULT_DEVICE): - # Parse the VID and PID from the `device` argument - v,d=map(lambda x: int(x,0) & 0xFFFF, device.split(':',1)) - - # Generate the DFU suffix, consisting of these fields: - # Field name | Length | Description - # ================+=========+================================ - # bcdDevice | 2 | The release number of this firmware (0xffff - don't care) - # idProduct | 2 | PID of this device - # idVendor | 2 | VID of this device - # bcdDFU | 2 | Version of this DFU spec (0x01 0x00) - # ucDfuSignature | 3 | The characters 'DFU', printed in reverse order - # bLength | 1 | The length of this suffix (16 bytes) - # dwCRC | 4 | A CRC32 of the data, including this suffix - data += struct.pack('<4H3sB',0xffff,d,v,0x0100,b'UFD',16) - crc = compute_crc(data) - # Append the CRC32 of the entire block - data += struct.pack(' Date: Tue, 31 Mar 2020 13:04:59 +0800 Subject: [PATCH 153/919] ports: litex: use dfu.py instead of dfu-suffix.py dfu.py now generates proper dfu suffixes without the nonstandard prefix. Signed-off-by: Sean Cross --- ports/litex/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/litex/Makefile b/ports/litex/Makefile index de1124aca1..51cb186356 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -190,7 +190,7 @@ $(BUILD)/firmware.hex: $(BUILD)/firmware.elf $(BUILD)/firmware.dfu: $(BUILD)/firmware.bin $(ECHO) "Create $@" - $(PYTHON3) $(TOP)/tools/dfu-suffix.py -b $^ -D 0x1209:0x5bf0 "$(BUILD)/firmware.dfu" + $(PYTHON3) $(TOP)/tools/dfu.py -b $^ -D 0x1209:0x5bf0 "$(BUILD)/firmware.dfu" include $(TOP)/py/mkrules.mk From 79595443221d8cd1a4b50e2e6dc0229f28aa52b4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 31 Mar 2020 14:08:14 +0800 Subject: [PATCH 154/919] tools: add dfu extension and mark litex as dfu Signed-off-by: Sean Cross --- tools/build_board_info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index dffbb33ff1..543224faea 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -20,6 +20,8 @@ BIN_UF2 = ('bin', 'uf2') HEX = ('hex',) HEX_UF2 = ('hex', 'uf2') SPK = ('spk',) +DFU = ('dfu',) +BIN_DFU = ('bin', 'dfu') # Example: # https://downloads.circuitpython.org/bin/trinket_m0/en_US/adafruit-circuitpython-trinket_m0-en_US-5.0.0-rc.0.uf2 @@ -32,7 +34,7 @@ extension_by_port = { "stm": BIN, "cxd56": SPK, "mimxrt10xx": HEX_UF2, - "litex": BIN, + "litex": DFU, } # Per board overrides From 4b063aeb29c889809af0758351e68eda48e37f3a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Mar 2020 15:12:11 -0700 Subject: [PATCH 155/919] Hack up STM32 PulseIn so it builds --- ports/stm/common-hal/pulseio/PulseIn.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 5e94653fcd..c44d03cf09 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -61,7 +61,10 @@ void TIM6_IRQHandler(void) static void pulsein_handler(uint8_t num) { // Grab the current time first. uint32_t current_overflow = overflow_count; - uint32_t current_count = TIM6->CNT; + uint32_t current_count = 0; + #if HAS_BASIC_TIM + current_count = TIM6->CNT; + #endif // Interrupt register must be cleared manually EXTI->PR = 1 << num; @@ -105,12 +108,17 @@ void pulsein_reset(void) { } memset(_objs, 0, sizeof(_objs)); + #if HAS_BASIC_TIM __HAL_RCC_TIM6_CLK_DISABLE(); refcount = 0; + #endif } void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { +#if !(HAS_BASIC_TIM) + mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); +#else // STM32 has one shared EXTI for each pin number, 0-15 uint8_t p_num = pin->number; if(_objs[p_num]) { @@ -153,6 +161,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu } // Add to active PulseIns refcount++; +#endif // EXTI pins can also be read as an input GPIO_InitTypeDef GPIO_InitStruct = {0}; From 8b5fd95897b967e5077527f50657ac4ded39a9aa Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 17 Aug 2018 15:42:51 +1000 Subject: [PATCH 156/919] tests/basics/set_pop.py: Sort set before printing for consistent output. --- tests/basics/set_pop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basics/set_pop.py b/tests/basics/set_pop.py index 5e1196c9f0..e951ca5931 100644 --- a/tests/basics/set_pop.py +++ b/tests/basics/set_pop.py @@ -15,4 +15,4 @@ while s: print(s.pop()) # last pop() should trigger the optimisation for i in range(N): s.add(i) # check that we can add the numbers back to the set -print(list(s)) +print(sorted(s)) From 4c4f81f8f2f68a5dc47d37ba185a2506224d7159 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 17 Aug 2018 15:43:47 +1000 Subject: [PATCH 157/919] tests/basics/int_big_error.py: Use bytearray to test for int overflow. In Python 3.7 "1 >> (big int)" is now allowed, it no longer raises an OverflowError. So use bytearray to test big-int conversion overflow. --- tests/basics/int_big_error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/basics/int_big_error.py b/tests/basics/int_big_error.py index e036525d1b..79809aef11 100644 --- a/tests/basics/int_big_error.py +++ b/tests/basics/int_big_error.py @@ -17,9 +17,9 @@ try: except TypeError: print("TypeError") -# overflow because rhs of >> is being converted to machine int +# overflow because arg of bytearray is being converted to machine int try: - 1 >> i + bytearray(i) except OverflowError: print('OverflowError') From 8f0147cf00e3fa8db283adbd1698c60fbe76a62a Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 17 Aug 2018 15:46:04 +1000 Subject: [PATCH 158/919] tests: Modify tests that print repr of an exception with 1 arg. In Python 3.7 the behaviour of repr() of an exception with one argument changed: it no longer prints a trailing comma in the argument list. See https://bugs.python.org/issue30399 This patch modifies tests that rely on this behaviour to not rely on it. And the python34.py test is updated to include a test for this behaviour with a .exp file. --- tests/basics/dict1.py | 2 +- tests/basics/exception1.py | 1 - tests/basics/generator_return.py | 2 +- tests/basics/python34.py | 6 +++++- tests/basics/python34.py.exp | 1 + tests/basics/subclass_native3.py | 4 ++-- tests/basics/try_as_var.py | 2 +- tests/misc/sys_exc_info.py | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/basics/dict1.py b/tests/basics/dict1.py index 20fa9def31..0cec51173a 100644 --- a/tests/basics/dict1.py +++ b/tests/basics/dict1.py @@ -27,7 +27,7 @@ print({1:1} == {2:1}) try: {}[0] except KeyError as er: - print('KeyError', er, repr(er), er.args) + print('KeyError', er, er.args) # unsupported unary op try: diff --git a/tests/basics/exception1.py b/tests/basics/exception1.py index 739dd32753..d83764cb93 100644 --- a/tests/basics/exception1.py +++ b/tests/basics/exception1.py @@ -1,7 +1,6 @@ print(repr(IndexError())) print(str(IndexError())) -print(repr(IndexError("foo"))) print(str(IndexError("foo"))) a = IndexError(1, "test", [100, 200]) diff --git a/tests/basics/generator_return.py b/tests/basics/generator_return.py index a3ac88575e..5814ce8379 100644 --- a/tests/basics/generator_return.py +++ b/tests/basics/generator_return.py @@ -7,4 +7,4 @@ print(next(g)) try: print(next(g)) except StopIteration as e: - print(repr(e)) + print(type(e), e.args) diff --git a/tests/basics/python34.py b/tests/basics/python34.py index 36531f11cf..4030db143c 100644 --- a/tests/basics/python34.py +++ b/tests/basics/python34.py @@ -1,4 +1,4 @@ -# tests that differ when running under Python 3.4 vs 3.5/3.6 +# tests that differ when running under Python 3.4 vs 3.5/3.6/3.7 try: exec @@ -36,3 +36,7 @@ test_syntax("del ()") # can't delete empty tuple (in 3.6 we can) import sys print(sys.version[:3]) print(sys.version_info[0], sys.version_info[1]) + +# from basics/exception1.py +# in 3.7 no comma is printed if there is only 1 arg (in 3.4-3.6 one is printed) +print(repr(IndexError("foo"))) diff --git a/tests/basics/python34.py.exp b/tests/basics/python34.py.exp index 590fc364f4..8480171307 100644 --- a/tests/basics/python34.py.exp +++ b/tests/basics/python34.py.exp @@ -11,3 +11,4 @@ SyntaxError SyntaxError 3.4 3 4 +IndexError('foo',) diff --git a/tests/basics/subclass_native3.py b/tests/basics/subclass_native3.py index bd99ab0d6a..6745b77bb2 100644 --- a/tests/basics/subclass_native3.py +++ b/tests/basics/subclass_native3.py @@ -7,12 +7,12 @@ print(repr(e)) print(e.args) try: - raise MyExc("Some error") + raise MyExc("Some error", 1) except MyExc as e: print("Caught exception:", repr(e)) try: - raise MyExc("Some error2") + raise MyExc("Some error2", 2) except Exception as e: print("Caught exception:", repr(e)) diff --git a/tests/basics/try_as_var.py b/tests/basics/try_as_var.py index 0a92f1caee..4f02f9c106 100644 --- a/tests/basics/try_as_var.py +++ b/tests/basics/try_as_var.py @@ -1,7 +1,7 @@ try: raise ValueError(534) except ValueError as e: - print(repr(e)) + print(type(e), e.args) # Var bound in except block is automatically deleted try: diff --git a/tests/misc/sys_exc_info.py b/tests/misc/sys_exc_info.py index 4bb2c61e89..bf9438e462 100644 --- a/tests/misc/sys_exc_info.py +++ b/tests/misc/sys_exc_info.py @@ -9,7 +9,7 @@ def f(): print(sys.exc_info()[0:2]) try: - 1/0 + raise ValueError('value', 123) except: print(sys.exc_info()[0:2]) f() From 764e65fb11ab6aa80c540a8f9d15237f406d62fd Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 17 Aug 2018 15:50:21 +1000 Subject: [PATCH 159/919] tests/basics: Provide .exp files for generator tests that fail PEP479. PEP479 (see https://www.python.org/dev/peps/pep-0479/) prohibited raising StopIteration from within a generator (it is turned into a RuntimeError). This behaviour was introduced in Python 3.5 and in 3.7 was made compulsory. Until uPy implements PEP479, this patch adds .py.exp files for the relevant tests so they can be run under Python 3.7. --- tests/basics/gen_yield_from.py.exp | 14 ++++++++++++++ tests/basics/gen_yield_from_close.py.exp | 20 ++++++++++++++++++++ tests/basics/gen_yield_from_throw.py.exp | 6 ++++++ tests/basics/generator_close.py.exp | 10 ++++++++++ 4 files changed, 50 insertions(+) create mode 100644 tests/basics/gen_yield_from.py.exp create mode 100644 tests/basics/gen_yield_from_close.py.exp create mode 100644 tests/basics/gen_yield_from_throw.py.exp create mode 100644 tests/basics/generator_close.py.exp diff --git a/tests/basics/gen_yield_from.py.exp b/tests/basics/gen_yield_from.py.exp new file mode 100644 index 0000000000..507f2b9caf --- /dev/null +++ b/tests/basics/gen_yield_from.py.exp @@ -0,0 +1,14 @@ +here1 +3 +here2 +[1, 2] +here1 +None +here2 +[1, 2] +here1 +123 +here2 +[1, 2] +444 +[0, 1, 2] diff --git a/tests/basics/gen_yield_from_close.py.exp b/tests/basics/gen_yield_from_close.py.exp new file mode 100644 index 0000000000..a44d1353df --- /dev/null +++ b/tests/basics/gen_yield_from_close.py.exp @@ -0,0 +1,20 @@ +-1 +1 +StopIteration +-1 +1 +2 +leaf caught GeneratorExit and swallowed it +delegating caught GeneratorExit +StopIteration +-1 +1 +2 +leaf caught GeneratorExit and raised StopIteration instead +delegating caught GeneratorExit +StopIteration +123 +RuntimeError +0 +1 +close diff --git a/tests/basics/gen_yield_from_throw.py.exp b/tests/basics/gen_yield_from_throw.py.exp new file mode 100644 index 0000000000..6ce97ad86e --- /dev/null +++ b/tests/basics/gen_yield_from_throw.py.exp @@ -0,0 +1,6 @@ +1 +got ValueError from upstream! +str1 +got TypeError from downstream! +123 +got StopIteration from downstream! diff --git a/tests/basics/generator_close.py.exp b/tests/basics/generator_close.py.exp new file mode 100644 index 0000000000..fcd5839357 --- /dev/null +++ b/tests/basics/generator_close.py.exp @@ -0,0 +1,10 @@ +None +StopIteration +1 +None +StopIteration +[1, 2] +None +StopIteration +None +ValueError From 317b96e93a1437bb3d1b214b496088696de222e9 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Mar 2020 17:00:30 -0700 Subject: [PATCH 160/919] Fix iMX builds --- ports/mimxrt10xx/common-hal/neopixel_write/__init__.c | 1 + shared-bindings/neopixel_write/__init__.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 7272a6d499..b86077015c 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -28,6 +28,7 @@ #include "shared-bindings/neopixel_write/__init__.h" #include "common-hal/microcontroller/Pin.h" +#include "supervisor/linker.h" #include "supervisor/port.h" uint64_t next_start_raw_ticks = 0; diff --git a/shared-bindings/neopixel_write/__init__.h b/shared-bindings/neopixel_write/__init__.h index 39b565ee2f..9799e3413d 100644 --- a/shared-bindings/neopixel_write/__init__.h +++ b/shared-bindings/neopixel_write/__init__.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef SAMD_NEOPIXEL_WRITE_H -#define SAMD_NEOPIXEL_WRITE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H #include #include @@ -34,4 +34,4 @@ extern void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* gpio, uint8_t *pixels, uint32_t numBytes); -#endif +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_NEOPIXEL_WRITE_H From 10719247010c958f4bc2227aa9f98577580688e1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Mar 2020 17:05:37 -0700 Subject: [PATCH 161/919] Fix thunderpack build --- ports/stm/boards/thunderpack/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 0b3c55819a..1bf7064ddd 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -44,6 +44,8 @@ #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) +#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI + // Status LEDs #define MICROPY_HW_LED_STATUS (&pin_PA02) From 75b7f583d2a7eba4890373f2f75b159b01a86308 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Mar 2020 17:52:23 -0700 Subject: [PATCH 162/919] Update LiteX APIs for new tick --- ports/litex/.gitignore | 1 + ports/litex/Makefile | 1 - ports/litex/README.rst | 13 ++++ ports/litex/mphalport.c | 20 ------ ports/litex/supervisor/internal_flash.c | 3 +- ports/litex/supervisor/port.c | 52 +++++++++++++++- ports/litex/supervisor/usb.c | 2 - ports/litex/tick.c | 82 ------------------------- ports/litex/tick.h | 46 -------------- 9 files changed, 67 insertions(+), 153 deletions(-) create mode 100644 ports/litex/.gitignore create mode 100644 ports/litex/README.rst delete mode 100644 ports/litex/tick.c delete mode 100644 ports/litex/tick.h diff --git a/ports/litex/.gitignore b/ports/litex/.gitignore new file mode 100644 index 0000000000..414487d53e --- /dev/null +++ b/ports/litex/.gitignore @@ -0,0 +1 @@ +build-*/ diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 51cb186356..596eaf2bb3 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -116,7 +116,6 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ - tick.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ lib/libc/string0.c \ diff --git a/ports/litex/README.rst b/ports/litex/README.rst new file mode 100644 index 0000000000..d3c66b22cd --- /dev/null +++ b/ports/litex/README.rst @@ -0,0 +1,13 @@ +You'll need `dfu-util` to install CircuitPython on the Fomu. + +Make sure the foboot bootloader is updated. Instructions are here: https://github.com/im-tomu/fomu-workshop/blob/master/docs/bootloader.rst + +Once you've updated the bootloader, you should know how to use `dfu-util`. It's pretty easy! + +To install CircuitPython do: + +.. code-block:: shell + + dfu-util -D adafruit-circuitpython-fomu-en_US-.dfu + +It will install and then restart. CIRCUITPY should appear as it usually does and work the same. diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 005a65aac4..12eaaac3cc 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -40,26 +40,6 @@ void hal_dcd_isr(uint8_t rhport); #endif -/*------------------------------------------------------------------*/ -/* delay - *------------------------------------------------------------------*/ -void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = supervisor_ticks_ms64(); - uint64_t duration = 0; - while (duration < delay) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif - // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { - break; - } - duration = (supervisor_ticks_ms64() - start_tick); - // TODO(tannewt): Go to sleep for a little while while we wait. - } -} - extern void SysTick_Handler(void); __attribute__((section(".ramtext"))) diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c index 93aeda8cbd..2dbf46b3a6 100644 --- a/ports/litex/supervisor/internal_flash.c +++ b/ports/litex/supervisor/internal_flash.c @@ -37,6 +37,7 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/flash.h" #include "supervisor/usb.h" #include "csr.h" @@ -270,7 +271,7 @@ uint32_t supervisor_flash_get_block_count(void) { } __attribute__((section(".ramtext"))) -void supervisor_flash_flush(void) { +void port_internal_flash_flush(void) { // Skip if data is the same, or if there is no data in the cache if (_flash_page_addr == NO_CACHE) return; diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 9688c7baef..c2af0d2a93 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -27,11 +27,43 @@ #include #include "supervisor/port.h" +#include "supervisor/shared/tick.h" #include "boards/board.h" -#include "tick.h" #include "irq.h" #include "csr.h" +// Global millisecond tick count. 1024 per second because most RTCs are clocked with 32.768khz +// crystals. +volatile uint64_t raw_ticks = 0; +volatile int subsecond = 0; +__attribute__((section(".ramtext"))) +void SysTick_Handler(void) { + timer0_ev_pending_write(1); + raw_ticks += 1; + subsecond += 1; + // We track subsecond ticks so that we can increment raw_ticks one extra every 40 ms. We do this + // every 40 except 0 to make it 24 increments and not 25. + if (subsecond == 1000) { + subsecond = 0; + } else if (subsecond % 40 == 0) { + raw_ticks += 1; + } + supervisor_tick(); +} + +static void tick_init(void) { + int t; + + timer0_en_write(0); + t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick + timer0_reload_write(t); + timer0_load_write(t); + timer0_en_write(1); + timer0_ev_enable_write(1); + timer0_ev_pending_write(1); + irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); +} + safe_mode_t port_init(void) { irq_setmask(0); irq_setie(1); @@ -83,3 +115,21 @@ void port_set_saved_word(uint32_t value) { uint32_t port_get_saved_word(void) { return _ebss; } + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + return raw_ticks; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { +} + +void port_interrupt_after_ticks(uint32_t ticks) { +} + +void port_sleep_until_interrupt(void) { +} diff --git a/ports/litex/supervisor/usb.c b/ports/litex/supervisor/usb.c index 182360b713..b626aaf496 100644 --- a/ports/litex/supervisor/usb.c +++ b/ports/litex/supervisor/usb.c @@ -25,8 +25,6 @@ * THE SOFTWARE. */ - -#include "tick.h" #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" diff --git a/ports/litex/tick.c b/ports/litex/tick.c deleted file mode 100644 index 8ba06044ac..0000000000 --- a/ports/litex/tick.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "csr.h" -#include "tick.h" -#include "irq.h" - -#include "supervisor/shared/autoreload.h" -#include "supervisor/filesystem.h" -#include "supervisor/shared/tick.h" -#include "shared-module/gamepad/__init__.h" -#include "shared-bindings/microcontroller/Processor.h" - -// Global millisecond tick count -// volatile uint64_t ticks_ms = 0; - -__attribute__((section(".ramtext"))) -void SysTick_Handler(void) { - timer0_ev_pending_write(1); - supervisor_tick(); -} - -void tick_init() { - int t; - - timer0_en_write(0); - t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick - timer0_reload_write(t); - timer0_load_write(t); - timer0_en_write(1); - timer0_ev_enable_write(1); - timer0_ev_pending_write(1); - irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); -} - -void tick_delay(uint32_t us) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - // uint64_t start_ms = ticks_ms; - // while (us > 1000) { - // while (ticks_ms == start_ms) {} - // us -= us_between_ticks; - // start_ms = ticks_ms; - // us_between_ticks = 1000; - // } - // while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} -} - -// us counts down! -void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // *ms = ticks_ms; - // *us_until_ms = SysTick->VAL / ticks_per_us; -} - -void wait_until(uint64_t ms, uint32_t us_until_ms) { - // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - // while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} -} diff --git a/ports/litex/tick.h b/ports/litex/tick.h deleted file mode 100644 index b4d27b8416..0000000000 --- a/ports/litex/tick.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_LITEX_TICK_H -#define MICROPY_INCLUDED_LITEX_TICK_H - -#include "py/mpconfig.h" - -#include - -extern volatile uint64_t ticks_ms; - -extern struct timer_descriptor ms_timer; - -void tick_init(void); - -void tick_delay(uint32_t us); - -void current_tick(uint64_t* ms, uint32_t* us_until_ms); -// Do not call this with interrupts disabled because it may be waiting for -// ticks_ms to increment. -void wait_until(uint64_t ms, uint32_t us_until_ms); - -#endif // MICROPY_INCLUDED_LITEX_TICK_H From 77562a2acde3c82e5949096533535b211f747c6d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Mar 2020 18:27:55 -0700 Subject: [PATCH 163/919] Update the supported ports --- docs/supported_ports.rst | 11 ++++++++--- ports/atmel-samd/README.rst | 19 +++++-------------- ports/litex/README.rst | 16 ++++++++++++++-- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst index bd237fb5da..09571afb67 100644 --- a/docs/supported_ports.rst +++ b/docs/supported_ports.rst @@ -1,14 +1,19 @@ Supported Ports ============================== -Adafruit's CircuitPython currently has limited support with a focus on supporting the Atmel SAMD -and ESP8266. +CircuitPython supports a number of microcontroller families. Support quality for each varies +depending on the active contributors for each port. + +Adafruit sponsored developers are actively contributing to atmel-samd, mimxrt10xx, nrf and stm +ports. They also maintain the other ports in order to ensure the boards build. Additional testing +is limited. .. toctree:: :maxdepth: 2 ../ports/atmel-samd/README + ../ports/cxd56/README + ../ports/litex/README ../ports/mimxrt10xx/README ../ports/nrf/README ../ports/stm/README - ../ports/cxd56/README diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index b4d2085777..c10159682a 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -1,17 +1,8 @@ -SAMD21x18 -========= +SAMD21 and SAMD51 +================== -This port brings MicroPython to SAMD21x18 based development boards under the name -CircuitPython. Supported boards include: - -- Adafruit CircuitPlayground Express -- Adafruit Feather M0 Basic -- Adafruit Feather M0 Express -- Adafruit Metro M0 Express -- Adafruit M0 Bluefruit LE -- Arduino Zero -- Arduino MKR Zero -- Arduino Nano 33 IoT +This port supports many development boards that utilize SAMD21 and SAMD51 chips. See +https://circuitpython.org/downloads for all supported boards. Pinout @@ -138,7 +129,7 @@ utilities. They can be installed as follows: .. code-block:: shell - sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib + sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib For other systems, the `GNU Arm Embedded Toolchain `_ may be available in binary form. diff --git a/ports/litex/README.rst b/ports/litex/README.rst index d3c66b22cd..bc1d20e617 100644 --- a/ports/litex/README.rst +++ b/ports/litex/README.rst @@ -1,8 +1,20 @@ -You'll need `dfu-util` to install CircuitPython on the Fomu. +LiteX (FPGA) +============ + +`LiteX `_ is a Python-based System on a Chip (SoC) designer +for open source supported Field Programmable Gate Array (FPGA) chips. This means that the CPU +core(s) and peripherals are not defined by the physical chip. Instead, they are loaded as separate +"gateware". Once this gateware is loaded, CircuitPython can be loaded on top of it to work as +expected. + +Installation +------------- + +You'll need ``dfu-util`` to install CircuitPython on the Fomu. Make sure the foboot bootloader is updated. Instructions are here: https://github.com/im-tomu/fomu-workshop/blob/master/docs/bootloader.rst -Once you've updated the bootloader, you should know how to use `dfu-util`. It's pretty easy! +Once you've updated the bootloader, you should know how to use ``dfu-util``. It's pretty easy! To install CircuitPython do: From a89928c13c748b7f25bd4e734cfe487b0020a25d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 1 Apr 2020 13:02:05 -0400 Subject: [PATCH 164/919] Implement requested changes --- .github/workflows/build.yml | 1 + extmod/ulab | 2 +- locale/ID.po | 2 +- locale/circuitpython.pot | 2 +- locale/de_DE.po | 2 +- locale/en_US.po | 2 +- locale/en_x_pirate.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- ports/stm/Makefile | 7 +- ports/stm/boards/STM32H743_fs.ld | 56 ++++++++++++- .../board.c | 0 .../mpconfigboard.h | 3 +- .../mpconfigboard.mk | 2 +- .../pins.c | 0 .../stm32h7xx_hal_conf.h | 0 .../peripherals/stm32h7/stm32h743xx/clocks.c | 79 ------------------- ports/stm/supervisor/internal_flash.c | 19 ----- ports/stm/supervisor/internal_flash.h | 8 +- ports/stm/supervisor/usb.c | 8 +- supervisor/linker.h | 2 +- 27 files changed, 81 insertions(+), 132 deletions(-) rename ports/stm/boards/{stm32h743zi2_discovery => nucleo_h743zi_2}/board.c (100%) rename ports/stm/boards/{stm32h743zi2_discovery => nucleo_h743zi_2}/mpconfigboard.h (93%) rename ports/stm/boards/{stm32h743zi2_discovery => nucleo_h743zi_2}/mpconfigboard.mk (83%) rename ports/stm/boards/{stm32h743zi2_discovery => nucleo_h743zi_2}/pins.c (100%) rename ports/stm/boards/{stm32h743zi2_discovery => nucleo_h743zi_2}/stm32h7xx_hal_conf.h (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb6bb28da3..2e1a6188be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -188,6 +188,7 @@ jobs: - "mini_sam_m4" - "monster_m4sk" - "ndgarage_ndbit6" + - "nucleo_h743zi_2" - "ohs2020_badge" - "openbook_m4" - "particle_argon" diff --git a/extmod/ulab b/extmod/ulab index 66b89de8c7..a91b36986d 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 66b89de8c714790de8647dc55f59430002044171 +Subproject commit a91b36986d81fd906a6232010778f2a93d690f8e diff --git a/locale/ID.po b/locale/ID.po index 8c5725428e..567fe5ff3e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 53ee647957..a6dabdaec0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index df62a978c6..5d4bec8723 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" diff --git a/locale/en_US.po b/locale/en_US.po index 0a2f870e72..17a4fb9dc1 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index ae56216d7f..f356c6e163 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" diff --git a/locale/es.po b/locale/es.po index 2f2b206b26..417a0126ac 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index f8c1471d59..12baeea9dd 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 56f20106bc..a8d896b525 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index 1b31c5645b..901ced7e47 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index 575a88b62a..f84979c645 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pl.po b/locale/pl.po index ad726ac7fc..12bd980bd8 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 48af7b7978..3291296972 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 5e545a66f8..7cf00580b4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-04-01 12:29-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" diff --git a/ports/stm/Makefile b/ports/stm/Makefile index ef70cad81e..a654feac01 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -78,7 +78,6 @@ INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb - #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb @@ -106,9 +105,9 @@ CFLAGS += -Wno-cast-align CFLAGS += -mthumb -mabi=aapcs-linux # Arm core selection -MCU_FLAGS_F4 = -mtune=cortex-m4 -mcpu=cortex-m4 -MCU_FLAGS_F7 = -mtune=cortex-m7 -mcpu=cortex-m7 -MCU_FLAGS_H7 = -mtune=cortex-m7 -mcpu=cortex-m7 +MCU_FLAGS_F4 = -mcpu=cortex-m4 +MCU_FLAGS_F7 = -mcpu=cortex-m7 +MCU_FLAGS_H7 = -mcpu=cortex-m7 CFLAGS += $(MCU_FLAGS_$(MCU_SERIES)) CFLAGS += -DSTM32_HAL_H='' diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 395a074d32..fdeab9a3d0 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -54,9 +54,6 @@ ENTRY(Reset_Handler) /* Highest address of the user mode stack */ _estack = 0x20020000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY @@ -65,14 +62,20 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ FLASH_TEXT (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ - DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* Used for storage cache */ + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ + SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ + SRAM_D3 (xrw) : ORIGIN = 0x30040000, LENGTH = 64K /* AHB2 SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K } /* produce a link error if there is not this amount of RAM for these sections */ _minimum_stack_size = 2K; _minimum_heap_size = 16K; +/* brainless copy paste for stack code. Results in ambiguous hard crash */ +/* _ld_default_stack_size = 20K; */ + /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ @@ -158,6 +161,51 @@ SECTIONS . = ALIGN(4); } >RAM + /* itcm stuff doesn't work, results in arcane hard crashes + .itcm : + { + . = ALIGN(4); + + *(.itcm.*) + + . = ALIGN(4); + } > ITCM AT> FLASH_TEXT + _ld_itcm_destination = ADDR(.itcm); + _ld_itcm_flash_copy = LOADADDR(.itcm); + _ld_itcm_size = SIZEOF(.itcm); + + .dtcm_data : + { + . = ALIGN(4); + + *(.dtcm_data.*) + + . = ALIGN(4); + } > DTCM AT> FLASH_TEXT + _ld_dtcm_data_destination = ADDR(.dtcm_data); + _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); + _ld_dtcm_data_size = SIZEOF(.dtcm_data); + + .dtcm_bss : + { + . = ALIGN(4); + + *(.dtcm_bss.*) + + . = ALIGN(4); + } > DTCM AT> DTCM + _ld_dtcm_bss_start = ADDR(.dtcm_bss); + _ld_dtcm_bss_size = SIZEOF(.dtcm_bss); + + .stack : + { + . = ALIGN(8); + _ld_stack_bottom = .; + . += _ld_default_stack_size; + } > DTCM + _ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM); + */ + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ports/stm/boards/stm32h743zi2_discovery/board.c b/ports/stm/boards/nucleo_h743zi_2/board.c similarity index 100% rename from ports/stm/boards/stm32h743zi2_discovery/board.c rename to ports/stm/boards/nucleo_h743zi_2/board.c diff --git a/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h similarity index 93% rename from ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.h rename to ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 6a62ff512a..3678d8a39e 100644 --- a/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -26,10 +26,9 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "STM32H743_DISCO" +#define MICROPY_HW_BOARD_NAME "NUCLEO STM32H743" #define MICROPY_HW_MCU_NAME "STM32H743" -// #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk similarity index 83% rename from ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk rename to ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index 3a37ffe75d..0f003d5fe3 100644 --- a/ports/stm/boards/stm32h743zi2_discovery/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x239A #REPLACE USB_PID = 0x808A #REPLACE -USB_PRODUCT = "STM32H743ZI Discovery Board - CPy" +USB_PRODUCT = "Nucleo H743ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm/boards/stm32h743zi2_discovery/pins.c b/ports/stm/boards/nucleo_h743zi_2/pins.c similarity index 100% rename from ports/stm/boards/stm32h743zi2_discovery/pins.c rename to ports/stm/boards/nucleo_h743zi_2/pins.c diff --git a/ports/stm/boards/stm32h743zi2_discovery/stm32h7xx_hal_conf.h b/ports/stm/boards/nucleo_h743zi_2/stm32h7xx_hal_conf.h similarity index 100% rename from ports/stm/boards/stm32h743zi2_discovery/stm32h7xx_hal_conf.h rename to ports/stm/boards/nucleo_h743zi_2/stm32h7xx_hal_conf.h diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c index 494b7709e6..a961362aa0 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c @@ -79,84 +79,5 @@ void stm32_peripherals_clocks_init(void) { RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); - - // RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - // RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - // RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; - - // /** Supply configuration update enable - // */ - // HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); - // /** Configure the main internal regulator output voltage - // */ - // __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - // while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} - // /** Macro to configure the PLL clock source - // */ - // __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_PLLSOURCE_HSE); - // /** Initializes the CPU, AHB and APB busses clocks - // */ - // RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - // RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; - // RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - // RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - // RCC_OscInitStruct.PLL.PLLM = 4; - // RCC_OscInitStruct.PLL.PLLN = 400; - // RCC_OscInitStruct.PLL.PLLP = 2; - // RCC_OscInitStruct.PLL.PLLQ = 4; - // RCC_OscInitStruct.PLL.PLLR = 2; - // RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_1; - // RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; - // RCC_OscInitStruct.PLL.PLLFRACN = 0; - // if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - // { - - // } - // /** Initializes the CPU, AHB and APB busses clocks - // */ - // RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - // |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 - // |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; - // RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - // RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; - // RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; - // RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; - // RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; - // RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; - // RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; - - // if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) - // { - - // } - // PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; /*RCC_PERIPHCLK_USART3|RCC_PERIPHCLK_UART4 - // |RCC_PERIPHCLK_SPI1|RCC_PERIPHCLK_ADC - // |RCC_PERIPHCLK_I2C1| */ - // // PeriphClkInitStruct.PLL2.PLL2M = 1; - // // PeriphClkInitStruct.PLL2.PLL2N = 19; - // // PeriphClkInitStruct.PLL2.PLL2P = 2; - // // PeriphClkInitStruct.PLL2.PLL2Q = 2; - // // PeriphClkInitStruct.PLL2.PLL2R = 2; - // // PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_3; - // // PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM; - // // PeriphClkInitStruct.PLL2.PLL2FRACN = 0; - // PeriphClkInitStruct.PLL3.PLL3M = 4; - // PeriphClkInitStruct.PLL3.PLL3N = 120; - // PeriphClkInitStruct.PLL3.PLL3P = 2; - // PeriphClkInitStruct.PLL3.PLL3Q = 5; - // PeriphClkInitStruct.PLL3.PLL3R = 2; - // PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_1; - // PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE; - // PeriphClkInitStruct.PLL3.PLL3FRACN = 0; - // PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL; - // PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1; - // PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_D2PCLK1; - // PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3; - // PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2; - // if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) - // { - - // } } diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 003ccdd908..5bd6e8758e 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -181,25 +181,6 @@ void supervisor_flash_flush(void) { reset_into_safe_mode(FLASH_WRITE_FAIL); } - // __HAL_FLASH_DATA_CACHE_DISABLE(); - // __HAL_FLASH_INSTRUCTION_CACHE_DISABLE(); - - // __HAL_FLASH_DATA_CACHE_RESET(); - // __HAL_FLASH_INSTRUCTION_CACHE_RESET(); - - // __HAL_FLASH_INSTRUCTION_CACHE_ENABLE(); - // __HAL_FLASH_DATA_CACHE_ENABLE(); - - // // reprogram the sector - // for (uint32_t i = 0; i < sector_size; i++) { - // if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, sector_start_addr, (uint64_t)_flash_cache[i]) != HAL_OK) { - // // error occurred during flash write - // HAL_FLASH_Lock(); // lock the flash - // mp_printf(&mp_plat_print, "FLASH WRITE ERROR"); - // } - // sector_start_addr += 1; - // } - uint32_t * cache_addr = (uint32_t*)_flash_cache; #if defined(STM32H7) diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 37f0b25e46..665b194c5f 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -36,7 +36,6 @@ #define STM32_FLASH_SIZE 0x80000 //512KiB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F411xE @@ -46,7 +45,6 @@ #else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #endif @@ -54,30 +52,28 @@ #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F405xx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32F407xx #define STM32_FLASH_SIZE 0x100000 //1MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif #ifdef STM32H743xx #define STM32_FLASH_SIZE 0x200000 //2MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 //128KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08020000 -#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #endif +#define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) + #define STM32_FLASH_OFFSET 0x8000000 //All STM32 chips map to this flash location #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 66c55d7605..997bf413f8 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -80,8 +80,10 @@ void init_usb_hardware(void) { GPIO_InitStruct.Pull = GPIO_NOPULL; #if defined(STM32H7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #else + #elif defined(STM32F4) GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + #else + #error Unsupported processor #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 11); @@ -103,8 +105,10 @@ void init_usb_hardware(void) { GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; #if defined(STM32H7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #else + #elif defined(STM32F4) GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; + #else + #error Unsupported processor #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 10); diff --git a/supervisor/linker.h b/supervisor/linker.h index b584144338..57ae146158 100755 --- a/supervisor/linker.h +++ b/supervisor/linker.h @@ -29,7 +29,7 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_LINKER_H #define MICROPY_INCLUDED_SUPERVISOR_LINKER_H -#if defined(IMXRT10XX) +#if defined(IMXRT10XX) // || defined(STM32H7) #define PLACE_IN_DTCM_DATA(name) name __attribute__((section(".dtcm_data." #name ))) #define PLACE_IN_DTCM_BSS(name) name __attribute__((section(".dtcm_bss." #name ))) #define PLACE_IN_ITCM(name) __attribute__((section(".itcm." #name ))) name From 2f764ded6379786d8d17322fa2e859fd102d5397 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 1 Apr 2020 13:52:53 -0400 Subject: [PATCH 165/919] merge and docs --- .github/workflows/build.yml | 47 ++ conf.py | 2 + locale/ID.po | 5 + locale/circuitpython.pot | 5 + locale/de_DE.po | 5 + locale/en_US.po | 5 + locale/en_x_pirate.po | 5 + locale/es.po | 5 + locale/fil.po | 5 + locale/fr.po | 5 + locale/it_IT.po | 5 + locale/ko.po | 5 + locale/pl.po | 5 + locale/pt_BR.po | 5 + locale/zh_Latn_pinyin.po | 5 + .../atmel-samd/boards/bdmicro_vina_m0/board.c | 48 ++ .../boards/bdmicro_vina_m0/mpconfigboard.h | 35 + .../boards/bdmicro_vina_m0/mpconfigboard.mk | 18 + .../atmel-samd/boards/bdmicro_vina_m0/pins.c | 39 ++ .../boards/hallowing_m0_express/board.c | 4 +- .../boards/hallowing_m4_express/board.c | 4 +- ports/atmel-samd/boards/monster_m4sk/board.c | 4 +- ports/atmel-samd/boards/openbook_m4/board.c | 4 +- ports/atmel-samd/boards/pewpew_m4/board.c | 4 +- ports/atmel-samd/boards/pybadge/board.c | 4 +- .../atmel-samd/boards/pybadge_airlift/board.c | 4 +- ports/atmel-samd/boards/pygamer/board.c | 4 +- .../atmel-samd/boards/pygamer_advance/board.c | 4 +- ports/atmel-samd/boards/ugame10/board.c | 4 +- ports/litex/Makefile | 200 ++++++ ports/litex/background.c | 60 ++ ports/litex/background.h | 35 + ports/litex/boards/board.h | 45 ++ ports/litex/boards/fomu/board.c | 75 ++ ports/litex/boards/fomu/csr.h | 647 ++++++++++++++++++ ports/litex/boards/fomu/fomu-spi.ld | 82 +++ ports/litex/boards/fomu/generated/soc.h | 58 ++ ports/litex/boards/fomu/mpconfigboard.h | 37 + ports/litex/boards/fomu/mpconfigboard.mk | 20 + ports/litex/boards/fomu/pins.c | 9 + ports/litex/boards/fomu/profiling.gdb.txt | 16 + .../litex/common-hal/digitalio/DigitalInOut.c | 119 ++++ .../litex/common-hal/digitalio/DigitalInOut.h | 38 + ports/litex/common-hal/digitalio/__init__.c | 1 + ports/litex/common-hal/microcontroller/Pin.c | 56 ++ ports/litex/common-hal/microcontroller/Pin.h | 59 ++ .../common-hal/microcontroller/Processor.c | 64 ++ .../common-hal/microcontroller/Processor.h | 39 ++ .../common-hal/microcontroller/__init__.c | 111 +++ .../common-hal/neopixel_write/__init__.c | 93 +++ ports/litex/common-hal/supervisor/Runtime.c | 38 + ports/litex/common-hal/supervisor/Runtime.h | 37 + ports/litex/common-hal/supervisor/__init__.c | 40 ++ ports/litex/common-hal/time/__init__.c | 45 ++ ports/litex/crt0-vexriscv.S | 94 +++ ports/litex/fatfs_port.c | 33 + ports/litex/hw/common.h | 33 + ports/litex/irq.h | 71 ++ ports/litex/mpconfigport.h | 43 ++ ports/litex/mpconfigport.mk | 31 + ports/litex/mphalport.c | 81 +++ ports/litex/mphalport.h | 42 ++ ports/litex/qstrdefsport.h | 1 + ports/litex/supervisor/internal_flash.c | 350 ++++++++++ ports/litex/supervisor/internal_flash.h | 38 + .../supervisor/internal_flash_root_pointers.h | 31 + ports/litex/supervisor/port.c | 85 +++ ports/litex/supervisor/usb.c | 36 + ports/litex/tick.c | 82 +++ ports/litex/tick.h | 46 ++ .../common-hal/neopixel_write/__init__.c | 19 +- .../nrf/boards/clue_nrf52840_express/board.c | 4 +- ports/nrf/boards/ohs2020_badge/board.c | 4 +- ports/nrf/common-hal/_bleio/Connection.c | 3 +- ports/nrf/common-hal/_bleio/PacketBuffer.c | 14 +- ports/stm/boards/meowbit_v121/board.c | 6 +- shared-bindings/_bleio/PacketBuffer.c | 7 +- shared-bindings/displayio/FourWire.c | 20 +- shared-bindings/displayio/FourWire.h | 3 +- shared-module/displayio/FourWire.c | 7 +- supervisor/linker.h | 2 +- tools/build_board_info.py | 5 +- tools/dfu.py | 84 +-- 83 files changed, 3497 insertions(+), 96 deletions(-) create mode 100644 ports/atmel-samd/boards/bdmicro_vina_m0/board.c create mode 100644 ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/bdmicro_vina_m0/pins.c create mode 100644 ports/litex/Makefile create mode 100644 ports/litex/background.c create mode 100644 ports/litex/background.h create mode 100644 ports/litex/boards/board.h create mode 100644 ports/litex/boards/fomu/board.c create mode 100644 ports/litex/boards/fomu/csr.h create mode 100644 ports/litex/boards/fomu/fomu-spi.ld create mode 100644 ports/litex/boards/fomu/generated/soc.h create mode 100644 ports/litex/boards/fomu/mpconfigboard.h create mode 100644 ports/litex/boards/fomu/mpconfigboard.mk create mode 100644 ports/litex/boards/fomu/pins.c create mode 100644 ports/litex/boards/fomu/profiling.gdb.txt create mode 100644 ports/litex/common-hal/digitalio/DigitalInOut.c create mode 100644 ports/litex/common-hal/digitalio/DigitalInOut.h create mode 100644 ports/litex/common-hal/digitalio/__init__.c create mode 100644 ports/litex/common-hal/microcontroller/Pin.c create mode 100644 ports/litex/common-hal/microcontroller/Pin.h create mode 100644 ports/litex/common-hal/microcontroller/Processor.c create mode 100644 ports/litex/common-hal/microcontroller/Processor.h create mode 100644 ports/litex/common-hal/microcontroller/__init__.c create mode 100644 ports/litex/common-hal/neopixel_write/__init__.c create mode 100644 ports/litex/common-hal/supervisor/Runtime.c create mode 100644 ports/litex/common-hal/supervisor/Runtime.h create mode 100644 ports/litex/common-hal/supervisor/__init__.c create mode 100644 ports/litex/common-hal/time/__init__.c create mode 100644 ports/litex/crt0-vexriscv.S create mode 100644 ports/litex/fatfs_port.c create mode 100644 ports/litex/hw/common.h create mode 100644 ports/litex/irq.h create mode 100644 ports/litex/mpconfigport.h create mode 100644 ports/litex/mpconfigport.mk create mode 100644 ports/litex/mphalport.c create mode 100644 ports/litex/mphalport.h create mode 100644 ports/litex/qstrdefsport.h create mode 100644 ports/litex/supervisor/internal_flash.c create mode 100644 ports/litex/supervisor/internal_flash.h create mode 100644 ports/litex/supervisor/internal_flash_root_pointers.h create mode 100644 ports/litex/supervisor/port.c create mode 100644 ports/litex/supervisor/usb.c create mode 100644 ports/litex/tick.c create mode 100644 ports/litex/tick.h mode change 100755 => 100644 tools/dfu.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e1a6188be..847cdf0249 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -131,6 +131,7 @@ jobs: - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" + - "bdmicro_vina_m0" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" @@ -279,3 +280,49 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + + build-riscv: + runs-on: ubuntu-16.04 + needs: test + strategy: + fail-fast: false + matrix: + board: + - "fomu" + + steps: + - name: Set up Python 3.5 + uses: actions/setup-python@v1 + with: + python-version: 3.5 + - name: Install deps + run: | + sudo apt-get install -y gettext + pip install requests sh click setuptools awscli + wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz + sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz + - name: Versions + run: | + gcc --version + riscv64-unknown-elf-gcc --version + python3 --version + - uses: actions/checkout@v1 + with: + submodules: true + - name: mpy-cross + run: make -C mpy-cross -j2 + - name: build + run: python3 -u build_release_files.py + working-directory: tools + env: + BOARDS: ${{ matrix.board }} + - uses: actions/upload-artifact@v1.0.0 + with: + name: ${{ matrix.board }} + path: bin/${{ matrix.board }} + - name: Upload to S3 + run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) diff --git a/conf.py b/conf.py index 2ea0e8dc0f..6f0cd8b03b 100644 --- a/conf.py +++ b/conf.py @@ -123,6 +123,7 @@ exclude_patterns = ["**/build*", "ports/atmel-samd/tools", "ports/cxd56/mkspk", "ports/cxd56/spresense-exported-sdk", + "ports/litex/hw", "ports/minimal", "ports/mimxrt10xx/peripherals", "ports/mimxrt10xx/sdk", @@ -133,6 +134,7 @@ exclude_patterns = ["**/build*", "ports/nrf/peripherals", "ports/nrf/usb", "ports/stm/st_driver", + "ports/stm/packages", "ports/stm/peripherals", "ports/stm/ref", "ports/unix", diff --git a/locale/ID.po b/locale/ID.po index 567fe5ff3e..de158c568a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -398,6 +398,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a6dabdaec0..7e9b3aadf2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -394,6 +394,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/de_DE.po b/locale/de_DE.po index 5d4bec8723..709a34ed57 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -398,6 +398,11 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/en_US.po b/locale/en_US.po index 17a4fb9dc1..d516d41d9b 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -394,6 +394,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index f356c6e163..e3f02c246f 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -398,6 +398,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/es.po b/locale/es.po index 417a0126ac..115fc8037e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -400,6 +400,11 @@ msgstr "Buffer debe ser de longitud 1 como minimo" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/fil.po b/locale/fil.po index 12baeea9dd..da2bc9459e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -400,6 +400,11 @@ msgstr "Buffer dapat ay hindi baba sa 1 na haba" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/fr.po b/locale/fr.po index a8d896b525..100fc2b9c2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -404,6 +404,11 @@ msgstr "Le tampon doit être de longueur au moins 1" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/it_IT.po b/locale/it_IT.po index 901ced7e47..8b868f83fa 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -400,6 +400,11 @@ msgstr "Il buffer deve essere lungo almeno 1" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/ko.po b/locale/ko.po index f84979c645..5cc2bcf3a6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -398,6 +398,11 @@ msgstr "잘못된 크기의 버퍼. >1 여야합니다" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/pl.po b/locale/pl.po index 12bd980bd8..659d633013 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -397,6 +397,11 @@ msgstr "Bufor musi mieć długość 1 lub więcej" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3291296972..511f0a5bb6 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -397,6 +397,11 @@ msgstr "" msgid "Buffer too large and unable to allocate" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, fuzzy, c-format diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 7cf00580b4..2319bf4d7d 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -403,6 +403,11 @@ msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" msgid "Buffer too large and unable to allocate" msgstr "huǎn chōng qū tài dà , wú fǎ fēn pèi" +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/board.c b/ports/atmel-samd/boards/bdmicro_vina_m0/board.c new file mode 100644 index 0000000000..bd63baa6fd --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/board.c @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) +{ + // struct port_config pin_conf; + // port_get_config_defaults(&pin_conf); + // + // pin_conf.direction = PORT_PIN_DIR_OUTPUT; + // port_pin_set_config(MICROPY_HW_LED_TX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_TX, true); + // + // port_pin_set_config(MICROPY_HW_LED_RX, &pin_conf); + // port_pin_set_output_level(MICROPY_HW_LED_RX, true); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h new file mode 100644 index 0000000000..458b1e12a6 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.h @@ -0,0 +1,35 @@ +#define MICROPY_HW_BOARD_NAME "BDMICRO Vina M0" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_STATUS (&pin_PA28) +#define MICROPY_HW_LED_TX &pin_PA27 +#define MICROPY_HW_LED_RX &pin_PA31 + +// Clock rates are off: Salae reads 12MHz which is the limit even though we set it to the safer 8MHz. +#define SPI_FLASH_BAUDRATE (8000000) + +#define SPI_FLASH_MOSI_PIN &pin_PB22 +#define SPI_FLASH_MISO_PIN &pin_PB03 +#define SPI_FLASH_SCK_PIN &pin_PB23 +#define SPI_FLASH_CS_PIN &pin_PA13 + +// These are pins not to reset. +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define BOARD_HAS_CRYSTAL 0 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk new file mode 100644 index 0000000000..1537540424 --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x31e2 +USB_PID = 0x2002 +USB_PRODUCT = "Vina M0" +USB_MANUFACTURER = "BDMICRO LLC" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25L51245G" +LONGINT_IMPL = MPZ + +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_I2CSLAVE = 0 + +CFLAGS_INLINE_LIMIT = 60 +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c b/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c new file mode 100644 index 0000000000..0ebceb28dd --- /dev/null +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/pins.c @@ -0,0 +1,39 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_RTC_INT), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_RTC_CLK), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_RTC_TS), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_PGM_LED), MP_ROM_PTR(&pin_PA28) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 07546abf5c..0b44bd4bb1 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -79,7 +79,9 @@ void board_init(void) { &pin_PA28, // Command or data &pin_PA01, // Chip select &pin_PA27, // Reset - 12000000); + 12000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 6822368d72..5dbdd499af 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_PB31, // TFT_DC Command or data &pin_PA27, // TFT_CS Chip select &pin_PB30, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index eeafdb4b80..684639c309 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PA07, // TFT_DC Command or data &pin_PA06, // TFT_CS Chip select &pin_PA04, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 2d9b316474..02270e7e57 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -65,7 +65,9 @@ void board_init(void) { &pin_PB05, // EPD_DC Command or data &pin_PB07, // EPD_CS Chip select &pin_PA00, // EPD_RST Reset - 1000000); + 1000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_epaperdisplay_obj_t* display = &displays[0].epaper_display; display->base.type = &displayio_epaperdisplay_type; diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index ef259e27a6..0f8936696f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -107,7 +107,9 @@ void board_init(void) { &pin_PA16, // TFT_DC Command or data &pin_PA11, // TFT_CS Chip select &pin_PA17, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase uint32_t cfg0 = lookupCfg(CFG_DISPLAY_CFG0, 0x000000); uint32_t offX = (cfg0 >> 8) & 0xff; diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 1209c027ee..257d72e30d 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -82,7 +82,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB07, // TFT_CS Chip select &pin_PA00, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index dfbf7023fa..7df245a724 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB06, // TFT_CS Chip select &pin_PB07, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 6df485fa9e..7c3ca6e335 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -82,7 +82,9 @@ void board_init(void) { &pin_PB05, // TFT_DC Command or data &pin_PB12, // TFT_CS Chip select &pin_PA00, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index ad5abd3f6c..7fd3ebc5e1 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -60,7 +60,9 @@ void board_init(void) { &pin_PA00, // TFT_DC Command or data &pin_PB15, // TFT_CS Chip select &pin_PB05, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 96f2361fd6..07814d558b 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -79,7 +79,9 @@ void board_init(void) { &pin_PA09, // Command or data &pin_PA08, // Chip select NULL, // Reset - 24000000); + 24000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/litex/Makefile b/ports/litex/Makefile new file mode 100644 index 0000000000..51cb186356 --- /dev/null +++ b/ports/litex/Makefile @@ -0,0 +1,200 @@ +# 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. + +# Select the board to build for. +ifeq ($(BOARD),) + $(error You must provide a BOARD parameter) +else + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD specified) + endif +endif + +# If the build directory is not given, make it reflect the board name. +BUILD ?= build-$(BOARD) + +include ../../py/mkenv.mk +# Board-specific +include boards/$(BOARD)/mpconfigboard.mk +# Port-specific +include mpconfigport.mk + +# CircuitPython-specific +include $(TOP)/py/circuitpy_mpconfig.mk + +# qstr definitions (must come before including py.mk) +QSTR_DEFS = qstrdefsport.h + +# include py core make definitions +include $(TOP)/py/py.mk + +include $(TOP)/supervisor/supervisor.mk + +# Include make rules and variables common across CircuitPython builds. +include $(TOP)/py/circuitpy_defns.mk + +CROSS_COMPILE = riscv64-unknown-elf- + +####################################### +# CFLAGS +####################################### + +INC += -I. +INC += -I../.. +INC += -I$(BUILD) +INC += -I$(BUILD)/genhdr +INC += -I./boards +INC += -I./boards/$(BOARD) +INC += -I./peripherals +INC += -I../../lib/mp-readline +INC += -I../../lib/tinyusb/src +INC += -I../../supervisor/shared/usb + + +#Debugging/Optimization +ifeq ($(DEBUG), 1) + CFLAGS += -ggdb + # You may want to enable these flags to make setting breakpoints easier. + CFLAGS += -fno-inline -fno-ipa-sra +else + CFLAGS += -Os -DNDEBUG -ggdb3 + # TODO: Test with -flto + ### CFLAGS += -flto +endif + +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) + +# TODO: check this +CFLAGS += -D__START=main -DFOMU + +LD_FILE := boards/$(BOARD)/$(BOARD)-spi.ld + +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv +LIBS := -lgcc -lc + + +LDFLAGS += -flto -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ + -Wl,--no-warn-mismatch \ + -Wl,--build-id=none + +# Use toolchain libm if we're not using our own. +ifndef INTERNAL_LIBM +LIBS += -lm +endif + +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 + + +###################################### +# source +###################################### + + +SRC_C += \ + background.c \ + fatfs_port.c \ + mphalport.c \ + tick.c \ + boards/$(BOARD)/board.c \ + boards/$(BOARD)/pins.c \ + lib/libc/string0.c \ + lib/mp-readline/readline.c \ + lib/oofatfs/ff.c \ + lib/oofatfs/option/ccsbcs.c \ + lib/timeutils/timeutils.c \ + lib/utils/buffer_helper.c \ + lib/utils/context_manager_helpers.c \ + lib/utils/interrupt_char.c \ + lib/utils/pyexec.c \ + lib/utils/stdout_helpers.c \ + lib/utils/sys_stdio_mphal.c \ + supervisor/shared/memory.c + +ifneq ($(USB),FALSE) +SRC_C += lib/tinyusb/src/portable/valentyusb/eptri/dcd_eptri.c +endif + +SRC_S = \ + crt0-vexriscv.S + +SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ + $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ + $(addprefix common-hal/, $(SRC_COMMON_HAL)) + +SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) + + +ifneq ($(FROZEN_MPY_DIR),) +FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') +FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +endif + +OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +ifeq ($(INTERNAL_LIBM),1) +OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) +endif +OBJ += $(addprefix $(BUILD)/, $(SRC_S:.S=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) + +$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os +$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os + +# List of sources for qstr extraction +SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) +# Sources that only hold QSTRs after pre-processing. +SRC_QSTR_PREPROCESSOR += + + +all: $(BUILD)/firmware.bin $(BUILD)/firmware.dfu + +$(BUILD)/firmware.elf: $(OBJ) + $(STEPECHO) "LINK $@" + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + +$(BUILD)/firmware.bin: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O binary $^ $@ +# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.hex: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)$(OBJCOPY) -O ihex $^ $@ +# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.dfu: $(BUILD)/firmware.bin + $(ECHO) "Create $@" + $(PYTHON3) $(TOP)/tools/dfu.py -b $^ -D 0x1209:0x5bf0 "$(BUILD)/firmware.dfu" + +include $(TOP)/py/mkrules.mk + +# Print out the value of a make variable. +# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile +print-%: + @echo $* = $($*) diff --git a/ports/litex/background.c b/ports/litex/background.c new file mode 100644 index 0000000000..8c18970434 --- /dev/null +++ b/ports/litex/background.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "supervisor/filesystem.h" +#include "supervisor/usb.h" +#include "supervisor/shared/stack.h" + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif + +static bool running_background_tasks = false; + +void background_tasks_reset(void) { + running_background_tasks = false; +} + +void run_background_tasks(void) { + // Don't call ourselves recursively. + if (running_background_tasks) { + return; + } + running_background_tasks = true; + filesystem_background(); + + #if USB_AVAILABLE + usb_background(); + #endif + + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif + running_background_tasks = false; + + assert_heap_ok(); +} diff --git a/ports/litex/background.h b/ports/litex/background.h new file mode 100644 index 0000000000..09551c7fbb --- /dev/null +++ b/ports/litex/background.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_BACKGROUND_H +#define MICROPY_INCLUDED_LITEX_BACKGROUND_H + +#include + +void background_tasks_reset(void); +void run_background_tasks(void); + +#endif // MICROPY_INCLUDED_LITEX_BACKGROUND_H diff --git a/ports/litex/boards/board.h b/ports/litex/boards/board.h new file mode 100644 index 0000000000..837b371904 --- /dev/null +++ b/ports/litex/boards/board.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// This file defines board specific functions. + +#ifndef MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H +#define MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H + +#include + +// Initializes board related state once on start up. +void board_init(void); + +// Returns true if the user initiates safe mode in a board specific way. +// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific +// way. +bool board_requests_safe_mode(void); + +// Reset the state of off MCU components such as neopixels. +void reset_board(void); + +#endif // MICROPY_INCLUDED_LITEX_BOARDS_BOARD_H diff --git a/ports/litex/boards/fomu/board.c b/ports/litex/boards/fomu/board.c new file mode 100644 index 0000000000..97e1ecadd6 --- /dev/null +++ b/ports/litex/boards/fomu/board.c @@ -0,0 +1,75 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "csr.h" + +// ICE40 LED Driver hard macro. +// See http://www.latticesemi.com/-/media/LatticeSemi/Documents/ApplicationNotes/IK/ICE40LEDDriverUsageGuide.ashx?document_id=50668 +enum led_registers { + LEDDCR0 = 8, + LEDDBR = 9, + LEDDONR = 10, + LEDDOFR = 11, + LEDDBCRR = 5, + LEDDBCFR = 6, + LEDDPWRR = 1, + LEDDPWRG = 2, + LEDDPWRB = 3, +}; + +#define BREATHE_ENABLE (1 << 7) +#define BREATHE_EDGE_ON (0 << 6) +#define BREATHE_EDGE_BOTH (1 << 6) +#define BREATHE_MODE_MODULATE (1 << 5) +#define BREATHE_RATE(x) ((x & 7) << 0) + +// Write a value into the LEDDA_IP register. +static void ledda_write(uint8_t value, uint8_t addr) { + rgb_addr_write(addr); + rgb_dat_write(value); +} + +void board_init(void) { + uint8_t onrate = 15; + uint8_t offrate = 1; + + ledda_write(BREATHE_ENABLE | BREATHE_MODE_MODULATE | BREATHE_RATE(onrate), LEDDBCRR); + ledda_write(BREATHE_ENABLE | BREATHE_MODE_MODULATE | BREATHE_RATE(offrate), LEDDBCFR); + + ledda_write(123, LEDDPWRR); // Red + ledda_write(3, LEDDPWRG); // Green + ledda_write(98, LEDDPWRB); // Blue +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/litex/boards/fomu/csr.h b/ports/litex/boards/fomu/csr.h new file mode 100644 index 0000000000..bf66fe3a17 --- /dev/null +++ b/ports/litex/boards/fomu/csr.h @@ -0,0 +1,647 @@ +//-------------------------------------------------------------------------------- +// Auto-generated by Migen (f4fcd10) & LiteX (de205d4a) on 2019-11-25 14:57:34 +//-------------------------------------------------------------------------------- +#include +#ifndef __GENERATED_CSR_H +#define __GENERATED_CSR_H +#include +#ifdef CSR_ACCESSORS_DEFINED +extern void csr_writeb(uint8_t value, unsigned long addr); +extern uint8_t csr_readb(unsigned long addr); +extern void csr_writew(uint16_t value, unsigned long addr); +extern uint16_t csr_readw(unsigned long addr); +extern void csr_writel(uint32_t value, unsigned long addr); +extern uint32_t csr_readl(unsigned long addr); +#else /* ! CSR_ACCESSORS_DEFINED */ +#include +#endif /* ! CSR_ACCESSORS_DEFINED */ + +/* ctrl */ +#define CSR_CTRL_BASE 0xe0000000L +#define CSR_CTRL_RESET_ADDR 0xe0000000L +#define CSR_CTRL_RESET_SIZE 1 +static inline unsigned char ctrl_reset_read(void) { + unsigned char r = csr_readl(0xe0000000L); + return r; +} +static inline void ctrl_reset_write(unsigned char value) { + csr_writel(value, 0xe0000000L); +} +#define CSR_CTRL_SCRATCH_ADDR 0xe0000004L +#define CSR_CTRL_SCRATCH_SIZE 4 +static inline unsigned int ctrl_scratch_read(void) { + unsigned int r = csr_readl(0xe0000004L); + r <<= 8; + r |= csr_readl(0xe0000008L); + r <<= 8; + r |= csr_readl(0xe000000cL); + r <<= 8; + r |= csr_readl(0xe0000010L); + return r; +} +static inline void ctrl_scratch_write(unsigned int value) { + csr_writel(value >> 24, 0xe0000004L); + csr_writel(value >> 16, 0xe0000008L); + csr_writel(value >> 8, 0xe000000cL); + csr_writel(value, 0xe0000010L); +} +#define CSR_CTRL_BUS_ERRORS_ADDR 0xe0000014L +#define CSR_CTRL_BUS_ERRORS_SIZE 4 +static inline unsigned int ctrl_bus_errors_read(void) { + unsigned int r = csr_readl(0xe0000014L); + r <<= 8; + r |= csr_readl(0xe0000018L); + r <<= 8; + r |= csr_readl(0xe000001cL); + r <<= 8; + r |= csr_readl(0xe0000020L); + return r; +} + +/* lxspi */ +#define CSR_LXSPI_BASE 0xe0007800L +#define CSR_LXSPI_BITBANG_ADDR 0xe0007800L +#define CSR_LXSPI_BITBANG_SIZE 1 +static inline unsigned char lxspi_bitbang_read(void) { + unsigned char r = csr_readl(0xe0007800L); + return r; +} +static inline void lxspi_bitbang_write(unsigned char value) { + csr_writel(value, 0xe0007800L); +} +#define CSR_LXSPI_BITBANG_MOSI_OFFSET 0 +#define CSR_LXSPI_BITBANG_MOSI_SIZE 1 +#define CSR_LXSPI_BITBANG_CLK_OFFSET 1 +#define CSR_LXSPI_BITBANG_CLK_SIZE 1 +#define CSR_LXSPI_BITBANG_CS_N_OFFSET 2 +#define CSR_LXSPI_BITBANG_CS_N_SIZE 1 +#define CSR_LXSPI_BITBANG_DIR_OFFSET 3 +#define CSR_LXSPI_BITBANG_DIR_SIZE 1 +#define CSR_LXSPI_MISO_ADDR 0xe0007804L +#define CSR_LXSPI_MISO_SIZE 1 +static inline unsigned char lxspi_miso_read(void) { + unsigned char r = csr_readl(0xe0007804L); + return r; +} +#define CSR_LXSPI_BITBANG_EN_ADDR 0xe0007808L +#define CSR_LXSPI_BITBANG_EN_SIZE 1 +static inline unsigned char lxspi_bitbang_en_read(void) { + unsigned char r = csr_readl(0xe0007808L); + return r; +} +static inline void lxspi_bitbang_en_write(unsigned char value) { + csr_writel(value, 0xe0007808L); +} + +/* messible */ +#define CSR_MESSIBLE_BASE 0xe0008000L +#define CSR_MESSIBLE_IN_ADDR 0xe0008000L +#define CSR_MESSIBLE_IN_SIZE 1 +static inline unsigned char messible_in_read(void) { + unsigned char r = csr_readl(0xe0008000L); + return r; +} +static inline void messible_in_write(unsigned char value) { + csr_writel(value, 0xe0008000L); +} +#define CSR_MESSIBLE_OUT_ADDR 0xe0008004L +#define CSR_MESSIBLE_OUT_SIZE 1 +static inline unsigned char messible_out_read(void) { + unsigned char r = csr_readl(0xe0008004L); + return r; +} +#define CSR_MESSIBLE_STATUS_ADDR 0xe0008008L +#define CSR_MESSIBLE_STATUS_SIZE 1 +static inline unsigned char messible_status_read(void) { + unsigned char r = csr_readl(0xe0008008L); + return r; +} +#define CSR_MESSIBLE_STATUS_FULL_OFFSET 0 +#define CSR_MESSIBLE_STATUS_FULL_SIZE 1 +#define CSR_MESSIBLE_STATUS_HAVE_OFFSET 1 +#define CSR_MESSIBLE_STATUS_HAVE_SIZE 1 + +/* reboot */ +#define CSR_REBOOT_BASE 0xe0006000L +#define CSR_REBOOT_CTRL_ADDR 0xe0006000L +#define CSR_REBOOT_CTRL_SIZE 1 +static inline unsigned char reboot_ctrl_read(void) { + unsigned char r = csr_readl(0xe0006000L); + return r; +} +static inline void reboot_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0006000L); +} +#define CSR_REBOOT_CTRL_IMAGE_OFFSET 0 +#define CSR_REBOOT_CTRL_IMAGE_SIZE 2 +#define CSR_REBOOT_CTRL_KEY_OFFSET 2 +#define CSR_REBOOT_CTRL_KEY_SIZE 6 +#define CSR_REBOOT_ADDR_ADDR 0xe0006004L +#define CSR_REBOOT_ADDR_SIZE 4 +static inline unsigned int reboot_addr_read(void) { + unsigned int r = csr_readl(0xe0006004L); + r <<= 8; + r |= csr_readl(0xe0006008L); + r <<= 8; + r |= csr_readl(0xe000600cL); + r <<= 8; + r |= csr_readl(0xe0006010L); + return r; +} +static inline void reboot_addr_write(unsigned int value) { + csr_writel(value >> 24, 0xe0006004L); + csr_writel(value >> 16, 0xe0006008L); + csr_writel(value >> 8, 0xe000600cL); + csr_writel(value, 0xe0006010L); +} + +/* rgb */ +#define CSR_RGB_BASE 0xe0006800L +#define CSR_RGB_DAT_ADDR 0xe0006800L +#define CSR_RGB_DAT_SIZE 1 +static inline unsigned char rgb_dat_read(void) { + unsigned char r = csr_readl(0xe0006800L); + return r; +} +static inline void rgb_dat_write(unsigned char value) { + csr_writel(value, 0xe0006800L); +} +#define CSR_RGB_ADDR_ADDR 0xe0006804L +#define CSR_RGB_ADDR_SIZE 1 +static inline unsigned char rgb_addr_read(void) { + unsigned char r = csr_readl(0xe0006804L); + return r; +} +static inline void rgb_addr_write(unsigned char value) { + csr_writel(value, 0xe0006804L); +} +#define CSR_RGB_CTRL_ADDR 0xe0006808L +#define CSR_RGB_CTRL_SIZE 1 +static inline unsigned char rgb_ctrl_read(void) { + unsigned char r = csr_readl(0xe0006808L); + return r; +} +static inline void rgb_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0006808L); +} +#define CSR_RGB_CTRL_EXE_OFFSET 0 +#define CSR_RGB_CTRL_EXE_SIZE 1 +#define CSR_RGB_CTRL_CURREN_OFFSET 1 +#define CSR_RGB_CTRL_CURREN_SIZE 1 +#define CSR_RGB_CTRL_RGBLEDEN_OFFSET 2 +#define CSR_RGB_CTRL_RGBLEDEN_SIZE 1 +#define CSR_RGB_CTRL_RRAW_OFFSET 3 +#define CSR_RGB_CTRL_RRAW_SIZE 1 +#define CSR_RGB_CTRL_GRAW_OFFSET 4 +#define CSR_RGB_CTRL_GRAW_SIZE 1 +#define CSR_RGB_CTRL_BRAW_OFFSET 5 +#define CSR_RGB_CTRL_BRAW_SIZE 1 +#define CSR_RGB_RAW_ADDR 0xe000680cL +#define CSR_RGB_RAW_SIZE 1 +static inline unsigned char rgb_raw_read(void) { + unsigned char r = csr_readl(0xe000680cL); + return r; +} +static inline void rgb_raw_write(unsigned char value) { + csr_writel(value, 0xe000680cL); +} +#define CSR_RGB_RAW_R_OFFSET 0 +#define CSR_RGB_RAW_R_SIZE 1 +#define CSR_RGB_RAW_G_OFFSET 1 +#define CSR_RGB_RAW_G_SIZE 1 +#define CSR_RGB_RAW_B_OFFSET 2 +#define CSR_RGB_RAW_B_SIZE 1 + +/* timer0 */ +#define CSR_TIMER0_BASE 0xe0002800L +#define CSR_TIMER0_LOAD_ADDR 0xe0002800L +#define CSR_TIMER0_LOAD_SIZE 4 +static inline unsigned int timer0_load_read(void) { + unsigned int r = csr_readl(0xe0002800L); + r <<= 8; + r |= csr_readl(0xe0002804L); + r <<= 8; + r |= csr_readl(0xe0002808L); + r <<= 8; + r |= csr_readl(0xe000280cL); + return r; +} +static inline void timer0_load_write(unsigned int value) { + csr_writel(value >> 24, 0xe0002800L); + csr_writel(value >> 16, 0xe0002804L); + csr_writel(value >> 8, 0xe0002808L); + csr_writel(value, 0xe000280cL); +} +#define CSR_TIMER0_RELOAD_ADDR 0xe0002810L +#define CSR_TIMER0_RELOAD_SIZE 4 +static inline unsigned int timer0_reload_read(void) { + unsigned int r = csr_readl(0xe0002810L); + r <<= 8; + r |= csr_readl(0xe0002814L); + r <<= 8; + r |= csr_readl(0xe0002818L); + r <<= 8; + r |= csr_readl(0xe000281cL); + return r; +} +static inline void timer0_reload_write(unsigned int value) { + csr_writel(value >> 24, 0xe0002810L); + csr_writel(value >> 16, 0xe0002814L); + csr_writel(value >> 8, 0xe0002818L); + csr_writel(value, 0xe000281cL); +} +#define CSR_TIMER0_EN_ADDR 0xe0002820L +#define CSR_TIMER0_EN_SIZE 1 +static inline unsigned char timer0_en_read(void) { + unsigned char r = csr_readl(0xe0002820L); + return r; +} +static inline void timer0_en_write(unsigned char value) { + csr_writel(value, 0xe0002820L); +} +#define CSR_TIMER0_UPDATE_VALUE_ADDR 0xe0002824L +#define CSR_TIMER0_UPDATE_VALUE_SIZE 1 +static inline unsigned char timer0_update_value_read(void) { + unsigned char r = csr_readl(0xe0002824L); + return r; +} +static inline void timer0_update_value_write(unsigned char value) { + csr_writel(value, 0xe0002824L); +} +#define CSR_TIMER0_VALUE_ADDR 0xe0002828L +#define CSR_TIMER0_VALUE_SIZE 4 +static inline unsigned int timer0_value_read(void) { + unsigned int r = csr_readl(0xe0002828L); + r <<= 8; + r |= csr_readl(0xe000282cL); + r <<= 8; + r |= csr_readl(0xe0002830L); + r <<= 8; + r |= csr_readl(0xe0002834L); + return r; +} +#define CSR_TIMER0_EV_STATUS_ADDR 0xe0002838L +#define CSR_TIMER0_EV_STATUS_SIZE 1 +static inline unsigned char timer0_ev_status_read(void) { + unsigned char r = csr_readl(0xe0002838L); + return r; +} +static inline void timer0_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0002838L); +} +#define CSR_TIMER0_EV_PENDING_ADDR 0xe000283cL +#define CSR_TIMER0_EV_PENDING_SIZE 1 +static inline unsigned char timer0_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000283cL); + return r; +} +static inline void timer0_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000283cL); +} +#define CSR_TIMER0_EV_ENABLE_ADDR 0xe0002840L +#define CSR_TIMER0_EV_ENABLE_SIZE 1 +static inline unsigned char timer0_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0002840L); + return r; +} +static inline void timer0_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0002840L); +} + +/* touch */ +#define CSR_TOUCH_BASE 0xe0005800L +#define CSR_TOUCH_O_ADDR 0xe0005800L +#define CSR_TOUCH_O_SIZE 1 +static inline unsigned char touch_o_read(void) { + unsigned char r = csr_readl(0xe0005800L); + return r; +} +static inline void touch_o_write(unsigned char value) { + csr_writel(value, 0xe0005800L); +} +#define CSR_TOUCH_OE_ADDR 0xe0005804L +#define CSR_TOUCH_OE_SIZE 1 +static inline unsigned char touch_oe_read(void) { + unsigned char r = csr_readl(0xe0005804L); + return r; +} +static inline void touch_oe_write(unsigned char value) { + csr_writel(value, 0xe0005804L); +} +#define CSR_TOUCH_I_ADDR 0xe0005808L +#define CSR_TOUCH_I_SIZE 1 +static inline unsigned char touch_i_read(void) { + unsigned char r = csr_readl(0xe0005808L); + return r; +} + +/* usb */ +#define CSR_USB_BASE 0xe0004800L +#define CSR_USB_PULLUP_OUT_ADDR 0xe0004800L +#define CSR_USB_PULLUP_OUT_SIZE 1 +static inline unsigned char usb_pullup_out_read(void) { + unsigned char r = csr_readl(0xe0004800L); + return r; +} +static inline void usb_pullup_out_write(unsigned char value) { + csr_writel(value, 0xe0004800L); +} +#define CSR_USB_ADDRESS_ADDR 0xe0004804L +#define CSR_USB_ADDRESS_SIZE 1 +static inline unsigned char usb_address_read(void) { + unsigned char r = csr_readl(0xe0004804L); + return r; +} +static inline void usb_address_write(unsigned char value) { + csr_writel(value, 0xe0004804L); +} +#define CSR_USB_ADDRESS_ADDR_OFFSET 0 +#define CSR_USB_ADDRESS_ADDR_SIZE 7 +#define CSR_USB_NEXT_EV_ADDR 0xe0004808L +#define CSR_USB_NEXT_EV_SIZE 1 +static inline unsigned char usb_next_ev_read(void) { + unsigned char r = csr_readl(0xe0004808L); + return r; +} +#define CSR_USB_NEXT_EV_IN_OFFSET 0 +#define CSR_USB_NEXT_EV_IN_SIZE 1 +#define CSR_USB_NEXT_EV_OUT_OFFSET 1 +#define CSR_USB_NEXT_EV_OUT_SIZE 1 +#define CSR_USB_NEXT_EV_SETUP_OFFSET 2 +#define CSR_USB_NEXT_EV_SETUP_SIZE 1 +#define CSR_USB_NEXT_EV_RESET_OFFSET 3 +#define CSR_USB_NEXT_EV_RESET_SIZE 1 +#define CSR_USB_SETUP_DATA_ADDR 0xe000480cL +#define CSR_USB_SETUP_DATA_SIZE 1 +static inline unsigned char usb_setup_data_read(void) { + unsigned char r = csr_readl(0xe000480cL); + return r; +} +#define CSR_USB_SETUP_DATA_DATA_OFFSET 0 +#define CSR_USB_SETUP_DATA_DATA_SIZE 8 +#define CSR_USB_SETUP_CTRL_ADDR 0xe0004810L +#define CSR_USB_SETUP_CTRL_SIZE 1 +static inline unsigned char usb_setup_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004810L); + return r; +} +static inline void usb_setup_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004810L); +} +#define CSR_USB_SETUP_CTRL_RESET_OFFSET 5 +#define CSR_USB_SETUP_CTRL_RESET_SIZE 1 +#define CSR_USB_SETUP_STATUS_ADDR 0xe0004814L +#define CSR_USB_SETUP_STATUS_SIZE 1 +static inline unsigned char usb_setup_status_read(void) { + unsigned char r = csr_readl(0xe0004814L); + return r; +} +#define CSR_USB_SETUP_STATUS_EPNO_OFFSET 0 +#define CSR_USB_SETUP_STATUS_EPNO_SIZE 4 +#define CSR_USB_SETUP_STATUS_HAVE_OFFSET 4 +#define CSR_USB_SETUP_STATUS_HAVE_SIZE 1 +#define CSR_USB_SETUP_STATUS_PEND_OFFSET 5 +#define CSR_USB_SETUP_STATUS_PEND_SIZE 1 +#define CSR_USB_SETUP_STATUS_IS_IN_OFFSET 6 +#define CSR_USB_SETUP_STATUS_IS_IN_SIZE 1 +#define CSR_USB_SETUP_STATUS_DATA_OFFSET 7 +#define CSR_USB_SETUP_STATUS_DATA_SIZE 1 +#define CSR_USB_SETUP_EV_STATUS_ADDR 0xe0004818L +#define CSR_USB_SETUP_EV_STATUS_SIZE 1 +static inline unsigned char usb_setup_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004818L); + return r; +} +static inline void usb_setup_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004818L); +} +#define CSR_USB_SETUP_EV_PENDING_ADDR 0xe000481cL +#define CSR_USB_SETUP_EV_PENDING_SIZE 1 +static inline unsigned char usb_setup_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000481cL); + return r; +} +static inline void usb_setup_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000481cL); +} +#define CSR_USB_SETUP_EV_ENABLE_ADDR 0xe0004820L +#define CSR_USB_SETUP_EV_ENABLE_SIZE 1 +static inline unsigned char usb_setup_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004820L); + return r; +} +static inline void usb_setup_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004820L); +} +#define CSR_USB_IN_DATA_ADDR 0xe0004824L +#define CSR_USB_IN_DATA_SIZE 1 +static inline unsigned char usb_in_data_read(void) { + unsigned char r = csr_readl(0xe0004824L); + return r; +} +static inline void usb_in_data_write(unsigned char value) { + csr_writel(value, 0xe0004824L); +} +#define CSR_USB_IN_DATA_DATA_OFFSET 0 +#define CSR_USB_IN_DATA_DATA_SIZE 8 +#define CSR_USB_IN_CTRL_ADDR 0xe0004828L +#define CSR_USB_IN_CTRL_SIZE 1 +static inline unsigned char usb_in_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004828L); + return r; +} +static inline void usb_in_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004828L); +} +#define CSR_USB_IN_CTRL_EPNO_OFFSET 0 +#define CSR_USB_IN_CTRL_EPNO_SIZE 4 +#define CSR_USB_IN_CTRL_RESET_OFFSET 5 +#define CSR_USB_IN_CTRL_RESET_SIZE 1 +#define CSR_USB_IN_CTRL_STALL_OFFSET 6 +#define CSR_USB_IN_CTRL_STALL_SIZE 1 +#define CSR_USB_IN_STATUS_ADDR 0xe000482cL +#define CSR_USB_IN_STATUS_SIZE 1 +static inline unsigned char usb_in_status_read(void) { + unsigned char r = csr_readl(0xe000482cL); + return r; +} +#define CSR_USB_IN_STATUS_IDLE_OFFSET 0 +#define CSR_USB_IN_STATUS_IDLE_SIZE 1 +#define CSR_USB_IN_STATUS_HAVE_OFFSET 4 +#define CSR_USB_IN_STATUS_HAVE_SIZE 1 +#define CSR_USB_IN_STATUS_PEND_OFFSET 5 +#define CSR_USB_IN_STATUS_PEND_SIZE 1 +#define CSR_USB_IN_EV_STATUS_ADDR 0xe0004830L +#define CSR_USB_IN_EV_STATUS_SIZE 1 +static inline unsigned char usb_in_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004830L); + return r; +} +static inline void usb_in_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004830L); +} +#define CSR_USB_IN_EV_PENDING_ADDR 0xe0004834L +#define CSR_USB_IN_EV_PENDING_SIZE 1 +static inline unsigned char usb_in_ev_pending_read(void) { + unsigned char r = csr_readl(0xe0004834L); + return r; +} +static inline void usb_in_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe0004834L); +} +#define CSR_USB_IN_EV_ENABLE_ADDR 0xe0004838L +#define CSR_USB_IN_EV_ENABLE_SIZE 1 +static inline unsigned char usb_in_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004838L); + return r; +} +static inline void usb_in_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004838L); +} +#define CSR_USB_OUT_DATA_ADDR 0xe000483cL +#define CSR_USB_OUT_DATA_SIZE 1 +static inline unsigned char usb_out_data_read(void) { + unsigned char r = csr_readl(0xe000483cL); + return r; +} +#define CSR_USB_OUT_DATA_DATA_OFFSET 0 +#define CSR_USB_OUT_DATA_DATA_SIZE 8 +#define CSR_USB_OUT_CTRL_ADDR 0xe0004840L +#define CSR_USB_OUT_CTRL_SIZE 1 +static inline unsigned char usb_out_ctrl_read(void) { + unsigned char r = csr_readl(0xe0004840L); + return r; +} +static inline void usb_out_ctrl_write(unsigned char value) { + csr_writel(value, 0xe0004840L); +} +#define CSR_USB_OUT_CTRL_EPNO_OFFSET 0 +#define CSR_USB_OUT_CTRL_EPNO_SIZE 4 +#define CSR_USB_OUT_CTRL_ENABLE_OFFSET 4 +#define CSR_USB_OUT_CTRL_ENABLE_SIZE 1 +#define CSR_USB_OUT_CTRL_RESET_OFFSET 5 +#define CSR_USB_OUT_CTRL_RESET_SIZE 1 +#define CSR_USB_OUT_CTRL_STALL_OFFSET 6 +#define CSR_USB_OUT_CTRL_STALL_SIZE 1 +#define CSR_USB_OUT_STATUS_ADDR 0xe0004844L +#define CSR_USB_OUT_STATUS_SIZE 1 +static inline unsigned char usb_out_status_read(void) { + unsigned char r = csr_readl(0xe0004844L); + return r; +} +#define CSR_USB_OUT_STATUS_EPNO_OFFSET 0 +#define CSR_USB_OUT_STATUS_EPNO_SIZE 4 +#define CSR_USB_OUT_STATUS_HAVE_OFFSET 4 +#define CSR_USB_OUT_STATUS_HAVE_SIZE 1 +#define CSR_USB_OUT_STATUS_PEND_OFFSET 5 +#define CSR_USB_OUT_STATUS_PEND_SIZE 1 +#define CSR_USB_OUT_EV_STATUS_ADDR 0xe0004848L +#define CSR_USB_OUT_EV_STATUS_SIZE 1 +static inline unsigned char usb_out_ev_status_read(void) { + unsigned char r = csr_readl(0xe0004848L); + return r; +} +static inline void usb_out_ev_status_write(unsigned char value) { + csr_writel(value, 0xe0004848L); +} +#define CSR_USB_OUT_EV_PENDING_ADDR 0xe000484cL +#define CSR_USB_OUT_EV_PENDING_SIZE 1 +static inline unsigned char usb_out_ev_pending_read(void) { + unsigned char r = csr_readl(0xe000484cL); + return r; +} +static inline void usb_out_ev_pending_write(unsigned char value) { + csr_writel(value, 0xe000484cL); +} +#define CSR_USB_OUT_EV_ENABLE_ADDR 0xe0004850L +#define CSR_USB_OUT_EV_ENABLE_SIZE 1 +static inline unsigned char usb_out_ev_enable_read(void) { + unsigned char r = csr_readl(0xe0004850L); + return r; +} +static inline void usb_out_ev_enable_write(unsigned char value) { + csr_writel(value, 0xe0004850L); +} +#define CSR_USB_OUT_ENABLE_STATUS_ADDR 0xe0004854L +#define CSR_USB_OUT_ENABLE_STATUS_SIZE 1 +static inline unsigned char usb_out_enable_status_read(void) { + unsigned char r = csr_readl(0xe0004854L); + return r; +} +#define CSR_USB_OUT_STALL_STATUS_ADDR 0xe0004858L +#define CSR_USB_OUT_STALL_STATUS_SIZE 1 +static inline unsigned char usb_out_stall_status_read(void) { + unsigned char r = csr_readl(0xe0004858L); + return r; +} + +/* version */ +#define CSR_VERSION_BASE 0xe0007000L +#define CSR_VERSION_MAJOR_ADDR 0xe0007000L +#define CSR_VERSION_MAJOR_SIZE 1 +static inline unsigned char version_major_read(void) { + unsigned char r = csr_readl(0xe0007000L); + return r; +} +#define CSR_VERSION_MINOR_ADDR 0xe0007004L +#define CSR_VERSION_MINOR_SIZE 1 +static inline unsigned char version_minor_read(void) { + unsigned char r = csr_readl(0xe0007004L); + return r; +} +#define CSR_VERSION_REVISION_ADDR 0xe0007008L +#define CSR_VERSION_REVISION_SIZE 1 +static inline unsigned char version_revision_read(void) { + unsigned char r = csr_readl(0xe0007008L); + return r; +} +#define CSR_VERSION_GITREV_ADDR 0xe000700cL +#define CSR_VERSION_GITREV_SIZE 4 +static inline unsigned int version_gitrev_read(void) { + unsigned int r = csr_readl(0xe000700cL); + r <<= 8; + r |= csr_readl(0xe0007010L); + r <<= 8; + r |= csr_readl(0xe0007014L); + r <<= 8; + r |= csr_readl(0xe0007018L); + return r; +} +#define CSR_VERSION_GITEXTRA_ADDR 0xe000701cL +#define CSR_VERSION_GITEXTRA_SIZE 2 +static inline unsigned short int version_gitextra_read(void) { + unsigned short int r = csr_readl(0xe000701cL); + r <<= 8; + r |= csr_readl(0xe0007020L); + return r; +} +#define CSR_VERSION_DIRTY_ADDR 0xe0007024L +#define CSR_VERSION_DIRTY_SIZE 1 +static inline unsigned char version_dirty_read(void) { + unsigned char r = csr_readl(0xe0007024L); + return r; +} +#define CSR_VERSION_DIRTY_DIRTY_OFFSET 0 +#define CSR_VERSION_DIRTY_DIRTY_SIZE 1 +#define CSR_VERSION_MODEL_ADDR 0xe0007028L +#define CSR_VERSION_MODEL_SIZE 1 +static inline unsigned char version_model_read(void) { + unsigned char r = csr_readl(0xe0007028L); + return r; +} +#define CSR_VERSION_MODEL_MODEL_OFFSET 0 +#define CSR_VERSION_MODEL_MODEL_SIZE 8 +#define CSR_VERSION_SEED_ADDR 0xe000702cL +#define CSR_VERSION_SEED_SIZE 4 +static inline unsigned int version_seed_read(void) { + unsigned int r = csr_readl(0xe000702cL); + r <<= 8; + r |= csr_readl(0xe0007030L); + r <<= 8; + r |= csr_readl(0xe0007034L); + r <<= 8; + r |= csr_readl(0xe0007038L); + return r; +} + +#endif diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld new file mode 100644 index 0000000000..161ba607b1 --- /dev/null +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -0,0 +1,82 @@ +/* + GNU linker script for Fomu +*/ + +ENTRY(_start) + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ +} + +/* top end of the stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* define output sections */ +SECTIONS +{ + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : AT ( _sidata ) + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + + *(.itcm.*) /* Instruction Tightly Coupled Memory */ + *(.dtcm_data.*) /* Data Tightly Coupled Memory */ + *(.ramtext) /* .text* sections (code) */ + *(.ramtext*) /* .text* sections (code) */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.sdata) /* .data sections */ + *(.sdata*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + KEEP(*(.text.start)) /* isr vector table */ + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + *(.srodata) /* .rodata sections (constants, strings, etc.) */ + *(.srodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ + } >FLASH + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss) + *(.bss*) + *(.dtcm_bss.*) /* Data Tightly Coupled Memory */ + *(.sbss) + *(.sbss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code */ + } >RAM + + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + _heap_start = .; /* define a global symbol at heap start */ + } >RAM +} diff --git a/ports/litex/boards/fomu/generated/soc.h b/ports/litex/boards/fomu/generated/soc.h new file mode 100644 index 0000000000..91b2f1a310 --- /dev/null +++ b/ports/litex/boards/fomu/generated/soc.h @@ -0,0 +1,58 @@ +//-------------------------------------------------------------------------------- +// Auto-generated by Migen (f4fcd10) & LiteX (de205d4a) on 2019-11-25 15:17:59 +//-------------------------------------------------------------------------------- +#ifndef __GENERATED_SOC_H +#define __GENERATED_SOC_H +#define CONFIG_BITSTREAM_SYNC_HEADER1 2123999870 +static inline int config_bitstream_sync_header1_read(void) { + return 2123999870; +} +#define CONFIG_BITSTREAM_SYNC_HEADER2 2125109630 +static inline int config_bitstream_sync_header2_read(void) { + return 2125109630; +} +#define CONFIG_CLOCK_FREQUENCY 12000000 +static inline int config_clock_frequency_read(void) { + return 12000000; +} +#define CONFIG_CPU_RESET_ADDR 0 +static inline int config_cpu_reset_addr_read(void) { + return 0; +} +#define CONFIG_CPU_TYPE "VEXRISCV" +static inline const char * config_cpu_type_read(void) { + return "VEXRISCV"; +} +#define CONFIG_CPU_TYPE_VEXRISCV +#define CONFIG_CPU_VARIANT "MIN" +static inline const char * config_cpu_variant_read(void) { + return "MIN"; +} +#define CONFIG_CPU_VARIANT_MIN +#define CONFIG_CSR_ALIGNMENT 32 +static inline int config_csr_alignment_read(void) { + return 32; +} +#define CONFIG_CSR_DATA_WIDTH 8 +static inline int config_csr_data_width_read(void) { + return 8; +} +#define CONFIG_FOMU_REV "HACKER" +static inline const char * config_fomu_rev_read(void) { + return "HACKER"; +} +#define CONFIG_FOMU_REV_HACKER +#define CONFIG_SHADOW_BASE 2147483648 +static inline int config_shadow_base_read(void) { + return 2147483648; +} +#define TIMER0_INTERRUPT 2 +static inline int timer0_interrupt_read(void) { + return 2; +} +#define USB_INTERRUPT 3 +static inline int usb_interrupt_read(void) { + return 3; +} + +#endif diff --git a/ports/litex/boards/fomu/mpconfigboard.h b/ports/litex/boards/fomu/mpconfigboard.h new file mode 100644 index 0000000000..127301eee2 --- /dev/null +++ b/ports/litex/boards/fomu/mpconfigboard.h @@ -0,0 +1,37 @@ +/* + * 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 "Fomu" +#define MICROPY_HW_MCU_NAME "VexRiscv" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x1000) +#define FLASH_PARTITION_OFFSET_BYTES (1024*1024) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE) diff --git a/ports/litex/boards/fomu/mpconfigboard.mk b/ports/litex/boards/fomu/mpconfigboard.mk new file mode 100644 index 0000000000..4787803ccd --- /dev/null +++ b/ports/litex/boards/fomu/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x1209 +USB_PID = 0x5BF0 +USB_PRODUCT = "Fomu" +USB_MANUFACTURER = "Foosn" +USB_DEVICES = "CDC,MSC,AUDIO,HID" + +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 + +# Fomu only implements rv32i +CFLAGS += -march=rv32i -mabi=ilp32 +LDFLAGS += -march=rv32i -mabi=ilp32 + +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_MICROCONTROLLER = 1 diff --git a/ports/litex/boards/fomu/pins.c b/ports/litex/boards/fomu/pins.c new file mode 100644 index 0000000000..6be495c331 --- /dev/null +++ b/ports/litex/boards/fomu/pins.c @@ -0,0 +1,9 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_TOUCH1) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_TOUCH2) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_TOUCH3) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_TOUCH4) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/litex/boards/fomu/profiling.gdb.txt b/ports/litex/boards/fomu/profiling.gdb.txt new file mode 100644 index 0000000000..28faf45b73 --- /dev/null +++ b/ports/litex/boards/fomu/profiling.gdb.txt @@ -0,0 +1,16 @@ +set pagination 0 +set logging file profile.txt +set logging overwrite + +server define poor_profile +set $total = $arg0 +set $i = 0 + set logging on + while($i<$total) + set $i = $i + 1 + cont + p $pc + bt + end + set logging off +end diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c new file mode 100644 index 0000000000..574d0de567 --- /dev/null +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -0,0 +1,119 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "csr.h" + +void common_hal_digitalio_digitalinout_never_reset( + digitalio_digitalinout_obj_t *self) { + (void)self; +} + +digitalinout_result_t common_hal_digitalio_digitalinout_construct( + digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { + + // claim_pin(pin); + self->pin = pin; + + return DIGITALINOUT_OK; +} + +bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { + return self->pin == mp_const_none; +} + +void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_deinited(self)) { + return; + } + + // reset_pin_number(0, self->pin->number); + self->pin = mp_const_none; +} + +void common_hal_digitalio_digitalinout_switch_to_input( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + (void)pull; + touch_oe_write(touch_oe_read() & ~(1 << self->pin->number)); +} + +void common_hal_digitalio_digitalinout_switch_to_output( + digitalio_digitalinout_obj_t *self, bool value, + digitalio_drive_mode_t drive_mode) { + (void)drive_mode; + common_hal_digitalio_digitalinout_set_value(self, value); + touch_oe_write(touch_oe_read() | (1 << self->pin->number)); +} + +digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( + digitalio_digitalinout_obj_t *self) { + + return (touch_oe_read() & (1 << self->pin->number)) + ? DIRECTION_OUTPUT : DIRECTION_INPUT; +} + +void common_hal_digitalio_digitalinout_set_value( + digitalio_digitalinout_obj_t *self, bool value) { + if (value) + touch_o_write(touch_o_read() | (1 << self->pin->number)); + else + touch_o_write(touch_o_read() & ~(1 << self->pin->number)); +} + +bool common_hal_digitalio_digitalinout_get_value( + digitalio_digitalinout_obj_t *self) { + return !!(touch_i_read() & (1 << self->pin->number)); +} + +void common_hal_digitalio_digitalinout_set_drive_mode( + digitalio_digitalinout_obj_t *self, + digitalio_drive_mode_t drive_mode) { + (void)self; + (void)drive_mode; +} + +digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( + digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_get_direction(self) == DIRECTION_OUTPUT) + return DRIVE_MODE_PUSH_PULL; + else + return DRIVE_MODE_OPEN_DRAIN; +} + +void common_hal_digitalio_digitalinout_set_pull( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + (void)self; + (void)pull; +} + +digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( + digitalio_digitalinout_obj_t *self) { + return PULL_NONE; +} diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.h b/ports/litex/common-hal/digitalio/DigitalInOut.h new file mode 100644 index 0000000000..3c5bdafaf2 --- /dev/null +++ b/ports/litex/common-hal/digitalio/DigitalInOut.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin; +} digitalio_digitalinout_obj_t; + +#endif // MICROPY_INCLUDED_FOMU_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/litex/common-hal/digitalio/__init__.c b/ports/litex/common-hal/digitalio/__init__.c new file mode 100644 index 0000000000..20fad45959 --- /dev/null +++ b/ports/litex/common-hal/digitalio/__init__.c @@ -0,0 +1 @@ +// No digitalio module functions. diff --git a/ports/litex/common-hal/microcontroller/Pin.c b/ports/litex/common-hal/microcontroller/Pin.c new file mode 100644 index 0000000000..632468f6d0 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Pin.c @@ -0,0 +1,56 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" + +#include "py/mphal.h" + +STATIC uint8_t claimed_pins[1]; + +// Mark pin as free and return it to a quiescent state. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if (pin_port == 0x0F) { + return; + } + + // Clear claimed bit. + claimed_pins[pin_port] &= ~(1<number; +} + +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { + return !(claimed_pins[pin_port] & 1<number); +} diff --git a/ports/litex/common-hal/microcontroller/Pin.h b/ports/litex/common-hal/microcontroller/Pin.h new file mode 100644 index 0000000000..186e120a28 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Pin.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H +#define MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H + +#include "py/mphal.h" + + +typedef struct { + mp_obj_base_t base; + uint8_t number; +} mcu_pin_obj_t; + +#define PIN(p_number) \ +{ \ + { &mcu_pin_type }, \ + .number = p_number \ +} + +extern const mcu_pin_obj_t pin_TOUCH1; +extern const mcu_pin_obj_t pin_TOUCH2; +extern const mcu_pin_obj_t pin_TOUCH3; +extern const mcu_pin_obj_t pin_TOUCH4; + +void reset_all_pins(void); +// reset_pin_number takes the pin number instead of the pointer so that objects don't +// need to store a full pointer. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number); +void claim_pin(const mcu_pin_obj_t* pin); +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number); +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); +// GPIO_TypeDef * pin_port(uint8_t pin_port); +uint16_t pin_mask(uint8_t pin_number); + +#endif // MICROPY_INCLUDED_FOMU_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/litex/common-hal/microcontroller/Processor.c b/ports/litex/common-hal/microcontroller/Processor.c new file mode 100644 index 0000000000..9d2b05aade --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Processor.c @@ -0,0 +1,64 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "common-hal/microcontroller/Processor.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "csr.h" +#include "generated/soc.h" + +float common_hal_mcu_processor_get_temperature(void) { + return NAN; +} + +float common_hal_mcu_processor_get_voltage(void) { + return NAN; +} + +uint32_t common_hal_mcu_processor_get_frequency(void) { + return CONFIG_CLOCK_FREQUENCY; +} + +void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { + raw_id[0] = csr_readl(CSR_VERSION_MAJOR_ADDR); + raw_id[1] = csr_readl(CSR_VERSION_MINOR_ADDR); + raw_id[2] = csr_readl(CSR_VERSION_REVISION_ADDR); + raw_id[3] = csr_readl(CSR_VERSION_GITREV_ADDR + 0); + raw_id[4] = csr_readl(CSR_VERSION_GITREV_ADDR + 4); + raw_id[5] = csr_readl(CSR_VERSION_GITREV_ADDR + 8); + raw_id[6] = csr_readl(CSR_VERSION_GITREV_ADDR + 12); + raw_id[7] = csr_readl(CSR_VERSION_GITEXTRA_ADDR + 0); + raw_id[8] = csr_readl(CSR_VERSION_GITEXTRA_ADDR + 4); + raw_id[9] = csr_readl(CSR_VERSION_DIRTY_ADDR); + raw_id[10] = csr_readl(CSR_VERSION_MODEL_ADDR); + raw_id[11] = csr_readl(CSR_VERSION_SEED_ADDR + 0); + raw_id[12] = csr_readl(CSR_VERSION_SEED_ADDR + 4); + raw_id[13] = csr_readl(CSR_VERSION_SEED_ADDR + 8); + raw_id[14] = csr_readl(CSR_VERSION_SEED_ADDR + 12); +} diff --git a/ports/litex/common-hal/microcontroller/Processor.h b/ports/litex/common-hal/microcontroller/Processor.h new file mode 100644 index 0000000000..a2ea261c8f --- /dev/null +++ b/ports/litex/common-hal/microcontroller/Processor.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H + +#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 15 + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} mcu_processor_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/litex/common-hal/microcontroller/__init__.c b/ports/litex/common-hal/microcontroller/__init__.c new file mode 100644 index 0000000000..3c91661144 --- /dev/null +++ b/ports/litex/common-hal/microcontroller/__init__.c @@ -0,0 +1,111 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/microcontroller/Processor.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Processor.h" + +#include "supervisor/filesystem.h" +#include "supervisor/shared/safe_mode.h" + +#include "csr.h" +#include "irq.h" + +void common_hal_mcu_delay_us(uint32_t delay) { + // if (__get_PRIMASK() == 0x00000000) { + // //by default use ticks_ms + // uint32_t start = get_us(); + // while (get_us()-start < delay) { + // __asm__ __volatile__("nop"); + // } + // } else { + // //when SysTick is disabled, approximate with busy loop + // const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; + // for (uint32_t count = 0; ++count <= ucount;) { + // } + // } +} + +volatile uint32_t nesting_count = 0; + +void common_hal_mcu_disable_interrupts(void) { + irq_setie(0); + // __DMB(); + nesting_count++; +} + +void common_hal_mcu_enable_interrupts(void) { + if (nesting_count == 0) { + // This is very very bad because it means there was mismatched disable/enables so we + // "HardFault". + asm("ebreak"); + } + nesting_count--; + if (nesting_count > 0) { + return; + } + irq_setie(1); +} + +void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { + if(runmode == RUNMODE_SAFE_MODE) + safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); +} + +void common_hal_mcu_reset(void) { + filesystem_flush(); //TODO: implement as part of flash improvements + // NVIC_SystemReset(); + while(1); +} + +// The singleton microcontroller.Processor object, bound to microcontroller.cpu +// It currently only has properties, and no state. +const mcu_processor_obj_t common_hal_mcu_processor_obj = { + .base = { + .type = &mcu_processor_type, + }, +}; + +const mcu_pin_obj_t pin_TOUCH1 = PIN(0); +const mcu_pin_obj_t pin_TOUCH2 = PIN(1); +const mcu_pin_obj_t pin_TOUCH3 = PIN(2); +const mcu_pin_obj_t pin_TOUCH4 = PIN(3); + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_TOUCH1) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_TOUCH2) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_TOUCH3) }, + { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_TOUCH4) }, +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/litex/common-hal/neopixel_write/__init__.c b/ports/litex/common-hal/neopixel_write/__init__.c new file mode 100644 index 0000000000..29fd318d40 --- /dev/null +++ b/ports/litex/common-hal/neopixel_write/__init__.c @@ -0,0 +1,93 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "shared-bindings/neopixel_write/__init__.h" +#include "csr.h" + +// ICE40 LED Driver hard macro. +// See http://www.latticesemi.com/-/media/LatticeSemi/Documents/ApplicationNotes/IK/ICE40LEDDriverUsageGuide.ashx?document_id=50668 +enum led_registers { + LEDDCR0 = 8, + LEDDBR = 9, + LEDDONR = 10, + LEDDOFR = 11, + LEDDBCRR = 5, + LEDDBCFR = 6, + LEDDPWRR = 1, + LEDDPWRG = 2, + LEDDPWRB = 3, +}; + +// Control register definitions +#define LEDDCR0_LEDDEN (1 << 7) +#define LEDDCR0_FR250 (1 << 6) +#define LEDDCR0_OUTPOL (1 << 5) +#define LEDDCR0_OUTSKEW (1 << 4) +#define LEDDCR0_QUICKSTOP (1 << 3) +#define LEDDCR0_PWM_MODE (1 << 2) +#define LEDDCR0_BRMSBEXT (1 << 0) + +// Write a value into the LEDDA_IP register. +static void ledda_write(uint8_t value, uint8_t addr) { + rgb_addr_write(addr); + rgb_dat_write(value); +} + +static int ledda_init_done; + +static void ledda_init(void) { + if (ledda_init_done) + return; + + // Enable the driver + rgb_ctrl_write((1 << CSR_RGB_CTRL_EXE_OFFSET) | (1 << CSR_RGB_CTRL_CURREN_OFFSET) | (1 << CSR_RGB_CTRL_RGBLEDEN_OFFSET)); + + ledda_write(LEDDCR0_LEDDEN | LEDDCR0_FR250 | LEDDCR0_QUICKSTOP, LEDDCR0); + + // Set clock register to 12 MHz / 64 kHz - 1 + ledda_write((12000000/64000)-1, LEDDBR); + + // Ensure LED "breathe" effect is diabled + ledda_write(0, LEDDBCRR); + ledda_write(0, LEDDBCFR); + + // Also disable the LED blink time + ledda_write(0, LEDDONR); + ledda_write(0, LEDDOFR); + + ledda_init_done = 1; +} + +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { + (void)digitalinout; + (void)numBytes; + ledda_init(); + + ledda_write(pixels[0], LEDDPWRR); // Red + ledda_write(pixels[1], LEDDPWRG); // Green + ledda_write(pixels[2], LEDDPWRB); // Blue +} diff --git a/ports/litex/common-hal/supervisor/Runtime.c b/ports/litex/common-hal/supervisor/Runtime.c new file mode 100644 index 0000000000..feab6987d8 --- /dev/null +++ b/ports/litex/common-hal/supervisor/Runtime.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * 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 +#include "shared-bindings/supervisor/Runtime.h" +#include "supervisor/serial.h" + +bool common_hal_get_serial_connected(void) { + return (bool) serial_connected(); +} + +bool common_hal_get_serial_bytes_available(void) { + return (bool) serial_bytes_available(); +} + diff --git a/ports/litex/common-hal/supervisor/Runtime.h b/ports/litex/common-hal/supervisor/Runtime.h new file mode 100644 index 0000000000..d1fe246211 --- /dev/null +++ b/ports/litex/common-hal/supervisor/Runtime.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} super_runtime_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/litex/common-hal/supervisor/__init__.c b/ports/litex/common-hal/supervisor/__init__.c new file mode 100644 index 0000000000..ac88556b45 --- /dev/null +++ b/ports/litex/common-hal/supervisor/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "py/obj.h" + +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/Runtime.h" + + +// The singleton supervisor.Runtime object, bound to supervisor.runtime +// It currently only has properties, and no state. +const super_runtime_obj_t common_hal_supervisor_runtime_obj = { + .base = { + .type = &supervisor_runtime_type, + }, +}; \ No newline at end of file diff --git a/ports/litex/common-hal/time/__init__.c b/ports/litex/common-hal/time/__init__.c new file mode 100644 index 0000000000..c85077868a --- /dev/null +++ b/ports/litex/common-hal/time/__init__.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "py/mphal.h" + +#include "tick.h" + +uint64_t common_hal_time_monotonic(void) { + return supervisor_ticks_ms64(); +} + +uint64_t common_hal_time_monotonic_ns(void) { + uint64_t ms; + uint32_t us_until_ms; + current_tick(&ms, &us_until_ms); + // us counts down. + return 1000 * (ms * 1000 + (1000 - us_until_ms)); +} + +void common_hal_time_delay_ms(uint32_t delay) { + mp_hal_delay_ms(delay); +} diff --git a/ports/litex/crt0-vexriscv.S b/ports/litex/crt0-vexriscv.S new file mode 100644 index 0000000000..0419acf851 --- /dev/null +++ b/ports/litex/crt0-vexriscv.S @@ -0,0 +1,94 @@ +.global main +.global isr + +.section .text.start +.global _start + +_start: + j crt_init + # This sentinal ensures that this program is loaded + # to RAM when loaded using dfu-util. + #.word 0x17ab0f23 + #.word 0x10001000 + +.section .ramtext +.global trap_entry +.align 4 +trap_entry: + sw x1, - 1*4(sp) + sw x5, - 2*4(sp) + sw x6, - 3*4(sp) + sw x7, - 4*4(sp) + sw x10, - 5*4(sp) + sw x11, - 6*4(sp) + sw x12, - 7*4(sp) + sw x13, - 8*4(sp) + sw x14, - 9*4(sp) + sw x15, -10*4(sp) + sw x16, -11*4(sp) + sw x17, -12*4(sp) + sw x28, -13*4(sp) + sw x29, -14*4(sp) + sw x30, -15*4(sp) + sw x31, -16*4(sp) + addi sp,sp,-16*4 + call isr + lw x1 , 15*4(sp) + lw x5, 14*4(sp) + lw x6, 13*4(sp) + lw x7, 12*4(sp) + lw x10, 11*4(sp) + lw x11, 10*4(sp) + lw x12, 9*4(sp) + lw x13, 8*4(sp) + lw x14, 7*4(sp) + lw x15, 6*4(sp) + lw x16, 5*4(sp) + lw x17, 4*4(sp) + lw x28, 3*4(sp) + lw x29, 2*4(sp) + lw x30, 1*4(sp) + lw x31, 0*4(sp) + addi sp,sp,16*4 + mret + +.text + +crt_init: + # # Flush the caches + # .word 16399 + # .word 19 + # .word 19 + # .word 19 + la sp, _estack - 4 + la a0, trap_entry + csrw mtvec, a0 + +bss_init: + la a0, _sbss + la a1, _ebss +bss_loop: + beq a0,a1,bss_done + sw zero,0(a0) + add a0,a0,4 + j bss_loop +bss_done: + + /* Load DATA */ + la t0, _sidata + la t1, _sdata + la t2, _edata +3: + lw t3, 0(t0) + sw t3, 0(t1) + /* _edata is aligned to 16 bytes. Use word-xfers. */ + addi t0, t0, 4 + addi t1, t1, 4 + bltu t1, t2, 3b + + li a0, 0x880 //880 enable timer + external interrupt sources (until mstatus.MIE is set, they will never trigger an interrupt) + csrw mie,a0 + + call main +infinite_loop: + j infinite_loop diff --git a/ports/litex/fatfs_port.c b/ports/litex/fatfs_port.c new file mode 100644 index 0000000000..13ac21fb1b --- /dev/null +++ b/ports/litex/fatfs_port.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +DWORD get_fattime(void) { + // TODO: Implement this function. For now, fake it. + return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); +} diff --git a/ports/litex/hw/common.h b/ports/litex/hw/common.h new file mode 100644 index 0000000000..6a97ca2e93 --- /dev/null +++ b/ports/litex/hw/common.h @@ -0,0 +1,33 @@ +#ifndef _HW_COMMON_H_ +#define _HW_COMMON_H_ +#include +static inline void csr_writeb(uint8_t value, uint32_t addr) +{ + *((volatile uint8_t *)addr) = value; +} + +static inline uint8_t csr_readb(uint32_t addr) +{ + return *(volatile uint8_t *)addr; +} + +static inline void csr_writew(uint16_t value, uint32_t addr) +{ + *((volatile uint16_t *)addr) = value; +} + +static inline uint16_t csr_readw(uint32_t addr) +{ + return *(volatile uint16_t *)addr; +} + +static inline void csr_writel(uint32_t value, uint32_t addr) +{ + *((volatile uint32_t *)addr) = value; +} + +static inline uint32_t csr_readl(uint32_t addr) +{ + return *(volatile uint32_t *)addr; +} +#endif /* _HW_COMMON_H_ */ \ No newline at end of file diff --git a/ports/litex/irq.h b/ports/litex/irq.h new file mode 100644 index 0000000000..a822189071 --- /dev/null +++ b/ports/litex/irq.h @@ -0,0 +1,71 @@ +#ifndef __IRQ_H +#define __IRQ_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#define CSR_MSTATUS_MIE 0x8 + +#define CSR_IRQ_MASK 0xBC0 +#define CSR_IRQ_PENDING 0xFC0 + +#define CSR_DCACHE_INFO 0xCC0 + +#define csrr(reg) ({ unsigned long __tmp; \ + asm volatile ("csrr %0, " #reg : "=r"(__tmp)); \ + __tmp; }) + +#define csrw(reg, val) ({ \ + if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \ + asm volatile ("csrw " #reg ", %0" :: "i"(val)); \ + else \ + asm volatile ("csrw " #reg ", %0" :: "r"(val)); }) + +#define csrs(reg, bit) ({ \ + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrs x0, " #reg ", %0" :: "i"(bit)); \ + else \ + asm volatile ("csrrs x0, " #reg ", %0" :: "r"(bit)); }) + +#define csrc(reg, bit) ({ \ + if (__builtin_constant_p(bit) && (unsigned long)(bit) < 32) \ + asm volatile ("csrrc x0, " #reg ", %0" :: "i"(bit)); \ + else \ + asm volatile ("csrrc x0, " #reg ", %0" :: "r"(bit)); }) + +static inline unsigned int irq_getie(void) +{ + return (csrr(mstatus) & CSR_MSTATUS_MIE) != 0; +} + +static inline void irq_setie(unsigned int ie) +{ + if(ie) csrs(mstatus,CSR_MSTATUS_MIE); else csrc(mstatus,CSR_MSTATUS_MIE); +} + +static inline unsigned int irq_getmask(void) +{ + unsigned int mask; + asm volatile ("csrr %0, %1" : "=r"(mask) : "i"(CSR_IRQ_MASK)); + return mask; +} + +static inline void irq_setmask(unsigned int mask) +{ + asm volatile ("csrw %0, %1" :: "i"(CSR_IRQ_MASK), "r"(mask)); +} + +static inline unsigned int irq_pending(void) +{ + unsigned int pending; + asm volatile ("csrr %0, %1" : "=r"(pending) : "i"(CSR_IRQ_PENDING)); + return pending; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __IRQ_H */ \ No newline at end of file diff --git a/ports/litex/mpconfigport.h b/ports/litex/mpconfigport.h new file mode 100644 index 0000000000..cfa3eb5c74 --- /dev/null +++ b/ports/litex/mpconfigport.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef FPGA_MPCONFIGPORT_H__ +#define FPGA_MPCONFIGPORT_H__ + +#define MICROPY_PY_UJSON (0) +#define CIRCUITPY_INTERNAL_NVM_SIZE (0) +#define MICROPY_NLR_THUMB (0) + +#include "py/circuitpy_mpconfig.h" + +#define MICROPY_PORT_ROOT_POINTERS \ + CIRCUITPY_COMMON_ROOT_POINTERS +#define MICROPY_NLR_SETJMP (1) +#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 + + +#endif // __INCLUDED_FPGA_MPCONFIGPORT_H diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk new file mode 100644 index 0000000000..47e2b1abc8 --- /dev/null +++ b/ports/litex/mpconfigport.mk @@ -0,0 +1,31 @@ +# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk +# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. +# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + +# Internal math library is substantially smaller than toolchain one +INTERNAL_LIBM = 1 + +# Chip supplied serial number, in bytes +USB_SERIAL_NUMBER_LENGTH = 30 + +# Longints can be implemented as mpz, as longlong, or not +LONGINT_IMPL = MPZ + +#Reduced feature set for early port +CIRCUITPY_MINIMAL_BUILD = 1 + +# CIRCUITPY_BOARD = 1 +# CIRCUITPY_DIGITALIO = 1 +# CIRCUITPY_ANALOGIO = 1 +# CIRCUITPY_MICROCONTROLLER = 1 +# CIRCUITPY_BUSIO = 1 +# CIRCUITPY_PULSEIO = 1 +# CIRCUITPY_OS = 1 +# CIRCUITPY_STORAGE = 1 +# CIRCUITPY_RANDOM = 1 +CIRCUITPY_USB_HID = 1 +CIRCUITPY_USB_MIDI = 1 + +#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) +#endif diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c new file mode 100644 index 0000000000..005a65aac4 --- /dev/null +++ b/ports/litex/mphalport.c @@ -0,0 +1,81 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2018 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/mphal.h" +#include "py/mpstate.h" +#include "py/gc.h" + +#include "csr.h" +#include "generated/soc.h" + +#include "irq.h" + +#ifdef CFG_TUSB_MCU + void hal_dcd_isr(uint8_t rhport); +#endif + +/*------------------------------------------------------------------*/ +/* delay + *------------------------------------------------------------------*/ +void mp_hal_delay_ms(mp_uint_t delay) { + uint64_t start_tick = supervisor_ticks_ms64(); + uint64_t duration = 0; + while (duration < delay) { + #ifdef MICROPY_VM_HOOK_LOOP + MICROPY_VM_HOOK_LOOP + #endif + // Check to see if we've been CTRL-Ced by autoreload or the user. + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + break; + } + duration = (supervisor_ticks_ms64() - start_tick); + // TODO(tannewt): Go to sleep for a little while while we wait. + } +} + +extern void SysTick_Handler(void); + +__attribute__((section(".ramtext"))) +void isr(void) { + uint8_t irqs = irq_pending() & irq_getmask(); + +#ifdef CFG_TUSB_MCU + if (irqs & (1 << USB_INTERRUPT)) + hal_dcd_isr(0); +#endif + if (irqs & (1 << TIMER0_INTERRUPT)) + SysTick_Handler(); +} + +mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) { + unsigned long __tmp; + asm volatile ("mv %0, x2" :"=r"(__tmp)); + return __tmp; +} diff --git a/ports/litex/mphalport.h b/ports/litex/mphalport.h new file mode 100644 index 0000000000..540575c587 --- /dev/null +++ b/ports/litex/mphalport.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __FOMU_HAL +#define __FOMU_HAL + +#include +#include + +#include "lib/utils/interrupt_char.h" +#include "py/mpconfig.h" +#include "supervisor/shared/tick.h" + +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) +//#define mp_hal_delay_us(us) NRFX_DELAY_US((uint32_t) (us)) + +bool mp_hal_stdin_any(void); + +#endif diff --git a/ports/litex/qstrdefsport.h b/ports/litex/qstrdefsport.h new file mode 100644 index 0000000000..3ba897069b --- /dev/null +++ b/ports/litex/qstrdefsport.h @@ -0,0 +1 @@ +// qstrs specific to this port diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c new file mode 100644 index 0000000000..93aeda8cbd --- /dev/null +++ b/ports/litex/supervisor/internal_flash.c @@ -0,0 +1,350 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "supervisor/internal_flash.h" + +#include +#include +#include + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +#include "supervisor/usb.h" + +#include "csr.h" +#include "irq.h" + +enum pin { + PIN_MOSI = 0, + PIN_CLK = 1, + PIN_CS = 2, + PIN_MISO_EN = 3, + PIN_MISO = 4, // Value is ignored +}; + +#define NO_CACHE 0xffffffff + +static uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); +static uint32_t _flash_page_addr = NO_CACHE; +static bool _flash_cache_dirty; +// ------------------------------------------------------------------------- +// When performing SPI operations, the flash cannot be accessed. Since we +// normally execute directly from SPI, this can cause problems. +// To work around this, we execute from RAM. This is accomplished by marking +// functions as being in the section ".ramtext". +// When building under GCC with -O0 or -Od, the `inline` attribute is ignored. +// Therefore, we must re-implement these functions here and explicitly mark +// them as being in `.ramtext`, even though they really ought to be inlined. +__attribute__((section(".ramtext"))) +static inline void spi_writel(uint32_t value, uint32_t addr) +{ + *((volatile uint32_t *)addr) = value; +} + +__attribute__((section(".ramtext"))) +static inline uint32_t spi_readl(uint32_t addr) +{ + return *(volatile uint32_t *)addr; +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_write(unsigned char value) { + spi_writel(value, CSR_LXSPI_BITBANG_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline uint32_t bb_read(void) { + return spi_readl(CSR_LXSPI_MISO_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_en(unsigned int en) { + spi_writel(en, CSR_LXSPI_BITBANG_EN_ADDR); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_irq_setie(unsigned int ie) +{ + if(ie) csrs(mstatus,CSR_MSTATUS_MIE); else csrc(mstatus,CSR_MSTATUS_MIE); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_begin(void) { + bb_spi_write((0 << PIN_CLK) | (0 << PIN_CS)); +} + +__attribute__((section(".ramtext"))) +static inline void bb_spi_end(void) { + bb_spi_write((0 << PIN_CLK) | (1 << PIN_CS)); +} + +__attribute__((section(".ramtext"))) +static void spi_single_tx(uint8_t out) { + int bit; + + for (bit = 7; bit >= 0; bit--) { + if (out & (1 << bit)) { + bb_spi_write((0 << PIN_CLK) | (1 << PIN_MOSI)); + bb_spi_write((1 << PIN_CLK) | (1 << PIN_MOSI)); + bb_spi_write((0 << PIN_CLK) | (1 << PIN_MOSI)); + } else { + bb_spi_write((0 << PIN_CLK) | (0 << PIN_MOSI)); + bb_spi_write((1 << PIN_CLK) | (0 << PIN_MOSI)); + bb_spi_write((0 << PIN_CLK) | (0 << PIN_MOSI)); + } + } +} + +__attribute__((section(".ramtext"))) +static uint8_t spi_single_rx(void) { + int bit = 0; + uint8_t in = 0; + + bb_spi_write((1 << PIN_MISO_EN) | (0 << PIN_CLK)); + + while (bit++ < 8) { + bb_spi_write((1 << PIN_MISO_EN) | (1 << PIN_CLK)); + in = (in << 1) | bb_read(); + bb_spi_write((1 << PIN_MISO_EN) | (0 << PIN_CLK)); + } + + return in; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_beginErase4(uint32_t erase_addr) { + // Enable Write-Enable Latch (WEL) + bb_spi_begin(); + spi_single_tx(0x06); + bb_spi_end(); + + bb_spi_begin(); + spi_single_tx(0x20); + spi_single_tx(erase_addr >> 16); + spi_single_tx(erase_addr >> 8); + spi_single_tx(erase_addr >> 0); + bb_spi_end(); + return 0; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_beginWrite(uint32_t addr, const void *v_data, unsigned int count) { + const uint8_t write_cmd = 0x02; + const uint8_t *data = v_data; + unsigned int i; + +#ifdef NDEBUG + if (v_data < (const void *)_flash_cache) { + asm("ebreak"); + } + if ((v_data+count) > (const void *)&_flash_cache[4096]) { + asm("ebreak"); + } +#endif + + // Enable Write-Enable Latch (WEL) + bb_spi_begin(); + spi_single_tx(0x06); + bb_spi_end(); + + bb_spi_begin(); + spi_single_tx(write_cmd); + spi_single_tx(addr >> 16); + spi_single_tx(addr >> 8); + spi_single_tx(addr >> 0); + for (i = 0; (i < count) && (i < 256); i++) + spi_single_tx(*data++); + bb_spi_end(); + + return 0; +} + +__attribute__((section(".ramtext"))) +static uint8_t spi_read_status(void) { + uint8_t val; + + bb_spi_begin(); + spi_single_tx(0x05); + val = spi_single_rx(); + bb_spi_end(); + return val; +} + +__attribute__((section(".ramtext"))) +static int bb_spi_is_busy(void) { + return spi_read_status() & (1 << 0); +} + +__attribute__((used)) +uint32_t page_write_log[128]; +__attribute__((used)) +uint32_t page_write_log_offset; + +__attribute__((section(".ramtext"))) +static void bb_spi_write_page(uint32_t flash_address, const uint8_t *data) { + const uint32_t flash_address_end = flash_address + FLASH_PAGE_SIZE; + + // Ensure we're within the target flash address range. + if ((flash_address - FLASH_PARTITION_OFFSET_BYTES) > FLASH_SIZE) { + asm("ebreak"); + return; + } + if (flash_address < FLASH_PARTITION_OFFSET_BYTES) { + asm("ebreak"); + return; + } + + if ((flash_address_end - FLASH_PARTITION_OFFSET_BYTES) > FLASH_SIZE) { + asm("ebreak"); + return; + } + if (flash_address_end < FLASH_PARTITION_OFFSET_BYTES) { + asm("ebreak"); + return; + } + + // Ensure we're not erasing the middle of a flash bank + if ((flash_address & 0xfff) != 0) { + asm("ebreak"); + return; + } + + page_write_log[page_write_log_offset++] = flash_address; + if (page_write_log_offset > sizeof(page_write_log)/sizeof(*page_write_log)) page_write_log_offset=0; + + while (bb_spi_is_busy()) + ; // relax + bb_spi_beginErase4(flash_address); + while (bb_spi_is_busy()) + ; // relax + while (flash_address < flash_address_end) { + bb_spi_beginWrite(flash_address, data, 256); + while (bb_spi_is_busy()) + ; // relax + flash_address += 256; + data += 256; + } +} + +static inline uint32_t lba2addr(uint32_t block) { + return (0x20000000 + FLASH_PARTITION_OFFSET_BYTES) + (block * FILESYSTEM_BLOCK_SIZE); +} + +void supervisor_flash_init(void) { +} + +uint32_t supervisor_flash_get_block_size(void) { + return FILESYSTEM_BLOCK_SIZE; +} + +uint32_t supervisor_flash_get_block_count(void) { + return FLASH_SIZE/FILESYSTEM_BLOCK_SIZE; +} + +__attribute__((section(".ramtext"))) +void supervisor_flash_flush(void) { + // Skip if data is the same, or if there is no data in the cache + if (_flash_page_addr == NO_CACHE) + return; + if (!_flash_cache_dirty) + return; + + // Disable interrupts and enable bit-bang mode on the SPI flash. + // This function is running from RAM -- otherwise enabling bitbang mode + // would crash the CPU as the program suddenly became an endless stream + // of `0xffffffff`. + bb_spi_irq_setie(0); + bb_spi_write((0 << PIN_CLK) | (1 << PIN_CS)); + bb_spi_en(1); + + bb_spi_write_page(_flash_page_addr & 0x00ffffff, (const uint8_t *)_flash_cache); + + bb_spi_en(0); + bb_spi_irq_setie(1); + + _flash_cache_dirty = false; +} + +mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { + // Must write out anything in cache before trying to read. + supervisor_flash_flush(); + + uint32_t src = lba2addr(block); + memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); + + #if USB_AVAILABLE + usb_background(); + #endif + + return 0; +} + +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32_t num_blocks) { + while (num_blocks) { + uint32_t const addr = lba2addr(lba); + uint32_t const page_addr = addr & ~(FLASH_PAGE_SIZE - 1); + + uint32_t count = 8 - (lba % 8); // up to page boundary + count = MIN(num_blocks, count); + + if (page_addr != _flash_page_addr) { + // Write out anything in cache before overwriting it. + supervisor_flash_flush(); + + _flash_page_addr = page_addr; + _flash_cache_dirty = false; + + // Copy the current contents of the entire page into the cache. + memcpy(_flash_cache, (void *)page_addr, FLASH_PAGE_SIZE); + } + + // Overwrite part or all of the page cache with the src data, but only if it's changed. + if (_flash_cache_dirty || memcmp(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE)) { + memcpy(_flash_cache + (addr & (FLASH_PAGE_SIZE - 1)), src, count * FILESYSTEM_BLOCK_SIZE); + _flash_cache_dirty = true; + } + + // adjust for next run + lba += count; + src += count * FILESYSTEM_BLOCK_SIZE; + num_blocks -= count; + + #if USB_AVAILABLE + usb_background(); + #endif + } + + return 0; // success +} + +void supervisor_flash_release_cache(void) { +} + diff --git a/ports/litex/supervisor/internal_flash.h b/ports/litex/supervisor/internal_flash.h new file mode 100644 index 0000000000..41a69e2abe --- /dev/null +++ b/ports/litex/supervisor/internal_flash.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H + +#include +#include + +#include "py/mpconfig.h" + +#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms +#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) + +#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_H diff --git a/ports/litex/supervisor/internal_flash_root_pointers.h b/ports/litex/supervisor/internal_flash_root_pointers.h new file mode 100644 index 0000000000..ae3e45e14c --- /dev/null +++ b/ports/litex/supervisor/internal_flash_root_pointers.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H +#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H + +#define FLASH_ROOT_POINTERS + +#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c new file mode 100644 index 0000000000..9688c7baef --- /dev/null +++ b/ports/litex/supervisor/port.c @@ -0,0 +1,85 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "supervisor/port.h" +#include "boards/board.h" +#include "tick.h" +#include "irq.h" +#include "csr.h" + +safe_mode_t port_init(void) { + irq_setmask(0); + irq_setie(1); + tick_init(); + board_init(); + return NO_SAFE_MODE; +} + +extern uint32_t _ebss; +extern uint32_t _heap_start; +extern uint32_t _estack; + +void reset_port(void) { + // reset_all_pins(); + // i2c_reset(); + // spi_reset(); + // uart_reset(); + // pwmout_reset(); +} + +void reset_to_bootloader(void) { + reboot_ctrl_write(0xac); +} + +void reset_cpu(void) { +} + +uint32_t *port_heap_get_bottom(void) { + return port_stack_get_limit(); +} + +uint32_t *port_heap_get_top(void) { + return port_stack_get_top(); +} + +uint32_t *port_stack_get_limit(void) { + return &_ebss; +} + +uint32_t *port_stack_get_top(void) { + return &_estack; +} + +// Place the word to save just after our BSS section that gets blanked. +void port_set_saved_word(uint32_t value) { + _ebss = value; +} + +uint32_t port_get_saved_word(void) { + return _ebss; +} diff --git a/ports/litex/supervisor/usb.c b/ports/litex/supervisor/usb.c new file mode 100644 index 0000000000..182360b713 --- /dev/null +++ b/ports/litex/supervisor/usb.c @@ -0,0 +1,36 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "tick.h" +#include "supervisor/usb.h" +#include "lib/utils/interrupt_char.h" +#include "lib/mp-readline/readline.h" + +void init_usb_hardware(void) { + +} diff --git a/ports/litex/tick.c b/ports/litex/tick.c new file mode 100644 index 0000000000..8ba06044ac --- /dev/null +++ b/ports/litex/tick.c @@ -0,0 +1,82 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "csr.h" +#include "tick.h" +#include "irq.h" + +#include "supervisor/shared/autoreload.h" +#include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" +#include "shared-module/gamepad/__init__.h" +#include "shared-bindings/microcontroller/Processor.h" + +// Global millisecond tick count +// volatile uint64_t ticks_ms = 0; + +__attribute__((section(".ramtext"))) +void SysTick_Handler(void) { + timer0_ev_pending_write(1); + supervisor_tick(); +} + +void tick_init() { + int t; + + timer0_en_write(0); + t = CONFIG_CLOCK_FREQUENCY / 1000; // 1000 kHz tick + timer0_reload_write(t); + timer0_load_write(t); + timer0_en_write(1); + timer0_ev_enable_write(1); + timer0_ev_pending_write(1); + irq_setmask(irq_getmask() | (1 << TIMER0_INTERRUPT)); +} + +void tick_delay(uint32_t us) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; + // uint64_t start_ms = ticks_ms; + // while (us > 1000) { + // while (ticks_ms == start_ms) {} + // us -= us_between_ticks; + // start_ms = ticks_ms; + // us_between_ticks = 1000; + // } + // while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} +} + +// us counts down! +void current_tick(uint64_t* ms, uint32_t* us_until_ms) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // *ms = ticks_ms; + // *us_until_ms = SysTick->VAL / ticks_per_us; +} + +void wait_until(uint64_t ms, uint32_t us_until_ms) { + // uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; + // while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} +} diff --git a/ports/litex/tick.h b/ports/litex/tick.h new file mode 100644 index 0000000000..b4d27b8416 --- /dev/null +++ b/ports/litex/tick.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_TICK_H +#define MICROPY_INCLUDED_LITEX_TICK_H + +#include "py/mpconfig.h" + +#include + +extern volatile uint64_t ticks_ms; + +extern struct timer_descriptor ms_timer; + +void tick_init(void); + +void tick_delay(uint32_t us); + +void current_tick(uint64_t* ms, uint32_t* us_until_ms); +// Do not call this with interrupts disabled because it may be waiting for +// ticks_ms to increment. +void wait_until(uint64_t ms, uint32_t us_until_ms); + +#endif // MICROPY_INCLUDED_LITEX_TICK_H diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 9ea2335021..3e1d343ec8 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -32,7 +32,6 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" -#include "fsl_gpio.h" uint64_t next_start_tick_ms = 0; uint32_t next_start_tick_us = 1000; @@ -45,7 +44,7 @@ uint32_t next_start_tick_us = 1000; #pragma GCC push_options #pragma GCC optimize ("Os") -void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, +void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; uint32_t start = 0; @@ -54,14 +53,10 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout //assumes 800_000Hz frequency //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us //TODO: try to get dynamic weighting working again -#ifdef MIMXRT1011_SERIES - uint32_t sys_freq = CLOCK_GetCoreFreq(); -#else - uint32_t sys_freq = CLOCK_GetAhbFreq(); -#endif - uint32_t interval = sys_freq/MAGIC_800_INT; - uint32_t t0 = (sys_freq/MAGIC_800_T0H); - uint32_t t1 = (sys_freq/MAGIC_800_T1H); + const uint32_t sys_freq = SystemCoreClock; + const uint32_t interval = (sys_freq / MAGIC_800_INT); + const uint32_t t0 = (sys_freq / MAGIC_800_T0H); + const uint32_t t1 = (sys_freq / MAGIC_800_T1H); // This must be called while interrupts are on in case we're waiting for a // future ms tick. @@ -79,9 +74,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout for(;;) { cyc = (pix & mask) ? t1 : t0; start = DWT->CYCCNT; - GPIO_PinWrite(gpio, pin, 1); + gpio->DR |= (1U << pin); while((DWT->CYCCNT - start) < cyc); - GPIO_PinWrite(gpio, pin, 0); + gpio->DR &= ~(1U << pin); while((DWT->CYCCNT - start) < interval); if(!(mask >>= 1)) { if(p >= end) break; diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index 03b212f9e0..e9f8d244e4 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_P0_13, // TFT_DC Command or data &pin_P0_12, // TFT_CS Chip select &pin_P1_03, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 106bbd6e16..88c68bcb84 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -59,7 +59,9 @@ void board_init(void) { &pin_P0_08, // TFT_DC Command or data &pin_P0_14, // TFT_CS Chip select &pin_P0_13, // TFT_RST Reset - 60000000); + 60000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 96e8b8fbe9..d4c7308fd1 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -162,7 +162,8 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { self->do_bond_cccds = true; self->do_bond_cccds_request_time = supervisor_ticks_ms64(); } - break; + // Return false so other handlers get this event as well. + return false; case BLE_GATTS_EVT_SYS_ATTR_MISSING: sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 27dacb4938..6ed6d14514 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -148,6 +148,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { // A client wrote to this server characteristic. ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; + // Event handle must match the handle for my characteristic. if (evt_write->handle == self->characteristic->handle) { if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { @@ -156,8 +157,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { return false; } write_to_ringbuf(self, evt_write->data, evt_write->len); - } else if (evt_write->handle == self->characteristic->cccd_handle && - self->conn_handle == BLE_CONN_HANDLE_INVALID) { + } else if (evt_write->handle == self->characteristic->cccd_handle) { uint16_t cccd = *((uint16_t*) evt_write->data); if (cccd & BLE_GATT_HVX_NOTIFICATION) { self->conn_handle = conn_handle; @@ -167,6 +167,11 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { } break; } + case BLE_GAP_EVT_DISCONNECTED: { + if (self->conn_handle == conn_handle) { + self->conn_handle = BLE_CONN_HANDLE_INVALID; + } + } case BLE_GATTS_EVT_HVN_TX_COMPLETE: { queue_next_write(self); } @@ -192,6 +197,8 @@ void common_hal_bleio_packet_buffer_construct( incoming = outgoing; outgoing = temp; self->conn_handle = bleio_connection_get_conn_handle(MP_OBJ_TO_PTR(self->characteristic->service->connection)); + } else { + self->conn_handle = BLE_CONN_HANDLE_INVALID; } if (incoming) { @@ -255,8 +262,7 @@ int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uin sd_nvic_critical_region_enter(&is_nested_critical_region); if (packet_length > len) { - // TODO: raise an exception. - packet_length = len; + return len - packet_length; } ringbuf_get_n(&self->ringbuf, data, packet_length); diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index da87f00ec2..9e2d99bce0 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -61,7 +61,7 @@ uint8_t display_init_sequence[] = { 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2d, - 0x29, 0x25, 0x2B, 0x39, + 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, @@ -80,7 +80,9 @@ void board_init(void) { &pin_PA08, // Command or data &pin_PB12, // Chip select &pin_PB10, // Reset - 24000000); + 24000000, // Baudrate + 0, // Polarity + 0); // Phase displayio_display_obj_t* display = &displays[0].display; display->base.type = &displayio_display_type; diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 3ed295f017..9e3666044a 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -109,7 +109,12 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o mp_buffer_info_t bufinfo; mp_get_buffer_raise(buffer_obj, &bufinfo, MP_BUFFER_WRITE); - return MP_OBJ_NEW_SMALL_INT(common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len)); + int size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); + if (size < 0) { + mp_raise_ValueError_varg(translate("Buffer too short by %d bytes"), size * -1); + } + + return MP_OBJ_NEW_SMALL_INT(size); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 2cbceec48c..77329578a4 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -46,7 +46,7 @@ //| Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization. //| -//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000) +//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, phase=0) //| //| Create a FourWire object associated with the given pins. //| @@ -60,15 +60,20 @@ //| :param microcontroller.Pin chip_select: Chip select pin //| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used //| :param int baudrate: Maximum baudrate in Hz for the display on the bus +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. //| STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset, ARG_baudrate }; + enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset, ARG_baudrate, ARG_polarity, ARG_phase }; static const mp_arg_t allowed_args[] = { { MP_QSTR_spi_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_command, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_chip_select, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_reset, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, { MP_QSTR_baudrate, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 24000000} }, + { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -91,8 +96,17 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_RuntimeError(translate("Too many display busses")); } + uint8_t polarity = args[ARG_polarity].u_int; + if (polarity != 0 && polarity != 1) { + mp_raise_ValueError(translate("Invalid polarity")); + } + uint8_t phase = args[ARG_phase].u_int; + if (phase != 0 && phase != 1) { + mp_raise_ValueError(translate("Invalid phase")); + } + common_hal_displayio_fourwire_construct(self, - MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int); + MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int, polarity, phase); return self; } diff --git a/shared-bindings/displayio/FourWire.h b/shared-bindings/displayio/FourWire.h index d0935f0639..ac186d2c3e 100644 --- a/shared-bindings/displayio/FourWire.h +++ b/shared-bindings/displayio/FourWire.h @@ -38,7 +38,8 @@ extern const mp_obj_type_t displayio_fourwire_type; void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, - const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate); + const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate, + uint8_t polarity, uint8_t phase); void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self); diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 256c29642d..fe7234aa7a 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -40,7 +40,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, busio_spi_obj_t* spi, const mcu_pin_obj_t* command, - const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate) { + const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate, + uint8_t polarity, uint8_t phase) { self->bus = spi; common_hal_busio_spi_never_reset(self->bus); @@ -49,8 +50,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, gc_never_free(self->bus); self->frequency = baudrate; - self->polarity = 0; - self->phase = 0; + self->polarity = polarity; + self->phase = phase; common_hal_digitalio_digitalinout_construct(&self->command, command); common_hal_digitalio_digitalinout_switch_to_output(&self->command, true, DRIVE_MODE_PUSH_PULL); diff --git a/supervisor/linker.h b/supervisor/linker.h index 57ae146158..878268c734 100755 --- a/supervisor/linker.h +++ b/supervisor/linker.h @@ -29,7 +29,7 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_LINKER_H #define MICROPY_INCLUDED_SUPERVISOR_LINKER_H -#if defined(IMXRT10XX) // || defined(STM32H7) +#if defined(IMXRT10XX) || defined(FOMU) // || defined(STM32H7) #define PLACE_IN_DTCM_DATA(name) name __attribute__((section(".dtcm_data." #name ))) #define PLACE_IN_DTCM_BSS(name) name __attribute__((section(".dtcm_bss." #name ))) #define PLACE_IN_ITCM(name) __attribute__((section(".itcm." #name ))) name diff --git a/tools/build_board_info.py b/tools/build_board_info.py index b64f734f88..543224faea 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -12,7 +12,7 @@ from sh.contrib import git sys.path.append("adabot") import adabot.github_requests as github -SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx"] +SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx", "litex"] BIN = ('bin',) UF2 = ('uf2',) @@ -20,6 +20,8 @@ BIN_UF2 = ('bin', 'uf2') HEX = ('hex',) HEX_UF2 = ('hex', 'uf2') SPK = ('spk',) +DFU = ('dfu',) +BIN_DFU = ('bin', 'dfu') # Example: # https://downloads.circuitpython.org/bin/trinket_m0/en_US/adafruit-circuitpython-trinket_m0-en_US-5.0.0-rc.0.uf2 @@ -32,6 +34,7 @@ extension_by_port = { "stm": BIN, "cxd56": SPK, "mimxrt10xx": HEX_UF2, + "litex": DFU, } # Per board overrides diff --git a/tools/dfu.py b/tools/dfu.py old mode 100755 new mode 100644 index 54b602438b..dd6019235b --- a/tools/dfu.py +++ b/tools/dfu.py @@ -1,6 +1,7 @@ #!/usr/bin/python # Written by Antonio Galea - 2010/11/18 +# Updated for DFU 1.1 by Sean Cross - 2020/03/31 # Distributed under Gnu LGPL 3.0 # see http://www.gnu.org/licenses/lgpl-3.0.txt @@ -23,30 +24,7 @@ def parse(file,dump_images=False): print ('File: "%s"' % file) data = open(file,'rb').read() crc = compute_crc(data[:-4]) - prefix, data = consume('<5sBIB',data,'signature version size targets') - print ('%(signature)s v%(version)d, image size: %(size)d, targets: %(targets)d' % prefix) - for t in range(prefix['targets']): - tprefix, data = consume('<6sBI255s2I',data,'signature altsetting named name size elements') - tprefix['num'] = t - if tprefix['named']: - tprefix['name'] = cstring(tprefix['name']) - else: - tprefix['name'] = '' - print ('%(signature)s %(num)d, alt setting: %(altsetting)s, name: "%(name)s", size: %(size)d, elements: %(elements)d' % tprefix) - tsize = tprefix['size'] - target, data = data[:tsize], data[tsize:] - for e in range(tprefix['elements']): - eprefix, target = consume('<2I',target,'address size') - eprefix['num'] = e - print (' %(num)d, address: 0x%(address)08x, size: %(size)d' % eprefix) - esize = eprefix['size'] - image, target = target[:esize], target[esize:] - if dump_images: - out = '%s.target%d.image%d.bin' % (file,t,e) - open(out,'wb').write(image) - print (' DUMPED IMAGE TO "%s"' % out) - if len(target): - print ("target %d: PARSE ERROR" % t) + data = data[len(data)-16:] suffix = named(struct.unpack('<4H3sBI',data[:16]),'device product vendor dfu ufd len crc') print ('usb: %(vendor)04x:%(product)04x, device: 0x%(device)04x, dfu: 0x%(dfu)04x, %(ufd)s, %(len)d, 0x%(crc)08x' % suffix) if crc != suffix['crc']: @@ -55,53 +33,49 @@ def parse(file,dump_images=False): if data: print ("PARSE ERROR") -def build(file,targets,device=DEFAULT_DEVICE): - data = b'' - for t,target in enumerate(targets): - tdata = b'' - for image in target: - tdata += struct.pack('<2I',image['address'],len(image['data']))+image['data'] - tdata = struct.pack('<6sBI255s2I',b'Target',0,1, b'ST...',len(tdata),len(target)) + tdata - data += tdata - data = struct.pack('<5sBIB',b'DfuSe',1,len(data)+11,len(targets)) + data +def build(file,data,device=DEFAULT_DEVICE): + # Parse the VID and PID from the `device` argument v,d=map(lambda x: int(x,0) & 0xFFFF, device.split(':',1)) - data += struct.pack('<4H3sB',0,d,v,0x011a,b'UFD',16) + + # Generate the DFU suffix, consisting of these fields: + # Field name | Length | Description + # ================+=========+================================ + # bcdDevice | 2 | The release number of this firmware (0xffff - don't care) + # idProduct | 2 | PID of this device + # idVendor | 2 | VID of this device + # bcdDFU | 2 | Version of this DFU spec (0x01 0x00) + # ucDfuSignature | 3 | The characters 'DFU', printed in reverse order + # bLength | 1 | The length of this suffix (16 bytes) + # dwCRC | 4 | A CRC32 of the data, including this suffix + data += struct.pack('<4H3sB',0xffff,d,v,0x0100,b'UFD',16) crc = compute_crc(data) + # Append the CRC32 of the entire block data += struct.pack(' Date: Fri, 13 Dec 2019 13:49:34 +1100 Subject: [PATCH 166/919] tests: Add .exp files for basics/parser and import/import_override. Because CPython 3.8.0 now produces different output: - basics/parser.py: CPython does not allow '\\\n' as input. - import/import_override: CPython imports _io. --- tests/basics/parser.py.exp | 3 +++ tests/import/import_override.py.exp | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 tests/basics/parser.py.exp create mode 100644 tests/import/import_override.py.exp diff --git a/tests/basics/parser.py.exp b/tests/basics/parser.py.exp new file mode 100644 index 0000000000..4d9886a09c --- /dev/null +++ b/tests/basics/parser.py.exp @@ -0,0 +1,3 @@ +SyntaxError +SyntaxError +SyntaxError diff --git a/tests/import/import_override.py.exp b/tests/import/import_override.py.exp new file mode 100644 index 0000000000..365248da6d --- /dev/null +++ b/tests/import/import_override.py.exp @@ -0,0 +1,2 @@ +import import1b None 0 +456 From ffe73a4c3fb1329e5598f135aa11bed2943fb481 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Apr 2020 16:13:19 -0500 Subject: [PATCH 167/919] workflows: use current (3.8) python now the need for 3.5 has been fixed --- .github/workflows/build.yml | 18 +++++++++--------- .github/workflows/create_website_pr.yml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6ba3725cc..b56fb35b88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Set up Python 3.5 + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: 3.5 + python-version: 3.8 - name: Install deps run: | sudo apt-get install -y eatmydata @@ -42,7 +42,7 @@ jobs: make -C ports/unix -j2 make -C ports/unix coverage -j2 - name: Test all - run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 + run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 working-directory: tests - name: Print failure info run: | @@ -54,10 +54,10 @@ jobs: working-directory: tests if: failure() - name: Native Tests - run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native + run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native working-directory: tests - name: mpy Tests - run: MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float + run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests - name: Docs run: sphinx-build -E -W -b html . _build/html @@ -244,10 +244,10 @@ jobs: - "xinabox_cs11" steps: - - name: Set up Python 3.5 + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: 3.5 + python-version: 3.8 - name: Install deps run: | sudo apt-get install -y gettext @@ -290,10 +290,10 @@ jobs: - "fomu" steps: - - name: Set up Python 3.5 + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: 3.5 + python-version: 3.8 - name: Install deps run: | sudo apt-get install -y gettext diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 69ca8f12b9..963fadd3dd 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -12,10 +12,10 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Set up Python 3.5 + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: 3.5 + python-version: 3.8 - name: Install deps run: | pip install requests sh click From 9845a064ad22dd6cc6c720a8b765978a16e71ff7 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 2 Apr 2020 11:21:22 +0800 Subject: [PATCH 168/919] ports: fomu: move more functions into ram for stability The SPI flash on current Fomu firmware is slow. Circuitpython runs XIP from SPI flash, and so execution time can also be slow. Ordinarily this isn't a problem, however certain operations are time-sensitive. In particular, USB function needs to be handled quickly in order to prevent the host from re-enumerating the device. Place several critical TinyUSB structures into RAM, as well as several hot functions that are frequently called. This reduces execution time at the expense of system memory, and greatly improves system stability. Signed-off-by: Sean Cross --- ports/litex/boards/fomu/fomu-spi.ld | 40 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index 161ba607b1..486c3cad11 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -26,8 +26,42 @@ SECTIONS . = ALIGN(4); _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.itcm.*) /* Instruction Tightly Coupled Memory */ - *(.dtcm_data.*) /* Data Tightly Coupled Memory */ + *(.itcm.*) /* Instruction Tightly Coupled Memory */ + *(.dtcm_data.*) /* Data Tightly Coupled Memory */ + + *(.text.cmp_lfn) + *(.text.qstr_find_strn) + *(.text.dcd_edpt_xfer) + *(.text.pop_rule) + *(.text.ff_wtoupper) + *(.text.dir_find) + *(.text.push_rule) + *(.text.csr_writel) + *(.text.csr_readl) + *(.text.timer0_ev_pending_write) + *(.text.autoreload_tick) + *(.text.filesystem_tick) + *(.text.usb_background) + + *(.text.dcd_*) + *(.text.tud_control_*) + *(.text.tud_cdc_n_write_flush) + *(.text.tud_task) + *(.text.tu_edpt_dir) + *(.text.tu_fifo_empty) + *(.text.usbd_edpt_busy) + *(.text.irq_getmask) + *(.text.irq_setmask) + *(.text.irq_pending) + *(.text._osal_q_lock) + *(.text.osal_queue_receive) + + *(.text.mp_obj_get_type) + *(.text.mp_parse) + *(.text.parse_compile_execute) + *(.text.mp_map_lookup) + *(.text.mp_execute_bytecode) /* Note: this function is 7kb */ + *(.ramtext) /* .text* sections (code) */ *(.ramtext*) /* .text* sections (code) */ *(.data) /* .data sections */ @@ -63,7 +97,7 @@ SECTIONS _sbss = .; /* define a global symbol at bss start; used by startup code */ *(.bss) *(.bss*) - *(.dtcm_bss.*) /* Data Tightly Coupled Memory */ + *(.dtcm_bss.*) /* Data Tightly Coupled Memory */ *(.sbss) *(.sbss*) *(COMMON) From 47a5d83267e1b30cad10e821a35b51d99d80a2de Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 2 Apr 2020 11:47:16 -0400 Subject: [PATCH 169/919] Implement F7 Nucleo --- ports/mimxrt10xx/supervisor/port.c | 2 +- ports/stm/Makefile | 7 +- ports/stm/boards/STM32F767ZITx_FLASH.ld | 189 ++++++ ports/stm/boards/STM32F767_fs.ld | 107 +++ ports/stm/boards/nucleo_f767zi/board.c | 38 ++ .../stm/boards/nucleo_f767zi/mpconfigboard.h | 35 + .../stm/boards/nucleo_f767zi/mpconfigboard.mk | 14 + ports/stm/boards/nucleo_f767zi/pins.c | 142 ++++ .../boards/nucleo_f767zi/stm32f7xx_hal_conf.h | 445 +++++++++++++ ports/stm/boards/startup_stm32f767xx.s | 618 ++++++++++++++++++ ports/stm/common-hal/digitalio/DigitalInOut.c | 2 + ports/stm/mpconfigport.mk | 16 + ports/stm/peripherals/periph.h | 9 + ports/stm/peripherals/pins.h | 5 + .../peripherals/stm32f7/stm32f767xx/clocks.c | 66 ++ .../peripherals/stm32f7/stm32f767xx/gpio.c | 48 ++ .../peripherals/stm32f7/stm32f767xx/periph.c | 248 +++++++ .../peripherals/stm32f7/stm32f767xx/periph.h | 55 ++ .../peripherals/stm32f7/stm32f767xx/pins.c | 200 ++++++ .../peripherals/stm32f7/stm32f767xx/pins.h | 199 ++++++ ports/stm/supervisor/internal_flash.c | 56 +- ports/stm/supervisor/internal_flash.h | 6 + ports/stm/supervisor/usb.c | 5 +- ports/stm/system_stm32f7xx.c | 247 +++++++ ports/stm/tools/parse_af_csv.py | 2 +- ports/stm/tools/pins.csv | 137 ++++ ports/stm/tools/stm32f767_af.csv | 168 +++++ 27 files changed, 3038 insertions(+), 28 deletions(-) create mode 100644 ports/stm/boards/STM32F767ZITx_FLASH.ld create mode 100644 ports/stm/boards/STM32F767_fs.ld create mode 100644 ports/stm/boards/nucleo_f767zi/board.c create mode 100644 ports/stm/boards/nucleo_f767zi/mpconfigboard.h create mode 100644 ports/stm/boards/nucleo_f767zi/mpconfigboard.mk create mode 100644 ports/stm/boards/nucleo_f767zi/pins.c create mode 100644 ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h create mode 100644 ports/stm/boards/startup_stm32f767xx.s create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/periph.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/periph.h create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/pins.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/pins.h create mode 100644 ports/stm/system_stm32f7xx.c create mode 100644 ports/stm/tools/pins.csv create mode 100644 ports/stm/tools/stm32f767_af.csv diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index b311e89206..7ba7a77011 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -154,7 +154,7 @@ __attribute__((used, naked)) void Reset_Handler(void) { /* Disable MPU */ ARM_MPU_Disable(); - // Copy all of the code to run from ITCM. Do this while the MPU is disabled because we write + // Copy all of the itcm code to run from ITCM. Do this while the MPU is disabled because we write // protect it. for (uint32_t i = 0; i < ((size_t) &_ld_itcm_size) / 4; i++) { (&_ld_itcm_destination)[i] = (&_ld_itcm_flash_copy)[i]; diff --git a/ports/stm/Makefile b/ports/stm/Makefile index a654feac01..9b90079381 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -96,11 +96,8 @@ C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) # Undo some warnings. -# STM32 apparently also uses undefined preprocessor variables quite casually, -# so we can't do warning checks for these. -CFLAGS += -Wno-undef -# STM32 might do casts that increase alignment requirements. -CFLAGS += -Wno-cast-align +# STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs +CFLAGS += -Wno-undef -Wno-shadow -Wno-cast-align CFLAGS += -mthumb -mabi=aapcs-linux diff --git a/ports/stm/boards/STM32F767ZITx_FLASH.ld b/ports/stm/boards/STM32F767ZITx_FLASH.ld new file mode 100644 index 0000000000..78a794402d --- /dev/null +++ b/ports/stm/boards/STM32F767ZITx_FLASH.ld @@ -0,0 +1,189 @@ +/* +****************************************************************************** +** + +** File : LinkerScript.ld +** +** Author : Auto-generated by System Workbench for STM32 +** +** Abstract : Linker script for STM32F767ZITx series +** 2048Kbytes FLASH and 512Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 STMicroelectronics

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of STMicroelectronics nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20080000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K +FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld new file mode 100644 index 0000000000..f0fb2d323d --- /dev/null +++ b/ports/stm/boards/STM32F767_fs.ld @@ -0,0 +1,107 @@ +/* + GNU linker script for STM32F405 via Micropython +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + +ENTRY(Reset_Handler) + +/* define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + + /* This first flash block is 16K annd the isr vectors only take up + about 400 bytes. Micropython pads this with files, but this didn't + work with the size of Circuitpython's ff object. */ + + . = ALIGN(4); + } >FLASH_ISR + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text*) /* .text* sections (code) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ + + . = ALIGN(4); + _etext = .; /* define a global symbol at end of code */ + } >FLASH_TEXT + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ + } >RAM AT> FLASH_TEXT + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start; used by startup code */ + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ + } >RAM + + /* this is to define the start of the heap, and make sure we have a minimum size */ + .heap : + { + . = ALIGN(4); + . = . + _minimum_heap_size; + . = ALIGN(4); + } >RAM + + /* this just checks there is enough RAM for the stack */ + .stack : + { + . = ALIGN(4); + . = . + _minimum_stack_size; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} + + diff --git a/ports/stm/boards/nucleo_f767zi/board.c b/ports/stm/boards/nucleo_f767zi/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/nucleo_f767zi/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h new file mode 100644 index 0000000000..b481a2835b --- /dev/null +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "NUCLEO STM32F767" +#define MICROPY_HW_MCU_NAME "STM32F767" + +#define FLASH_SIZE (0x200000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk new file mode 100644 index 0000000000..11c2215196 --- /dev/null +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A #REPLACE +USB_PID = 0x808A #REPLACE +USB_PRODUCT = "Nucleo F767ZI - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = F7 +MCU_VARIANT = STM32F767xx +MCU_PACKAGE = LQFP144 + +LD_FILE = boards/STM32F767_fs.ld + diff --git a/ports/stm/boards/nucleo_f767zi/pins.c b/ports/stm/boards/nucleo_f767zi/pins.c new file mode 100644 index 0000000000..9ecc38f01f --- /dev/null +++ b/ports/stm/boards/nucleo_f767zi/pins.c @@ -0,0 +1,142 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { +{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, +{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, +{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, +{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PF03) }, +{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PF05) }, +{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF10) }, +{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, +{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PC02) }, +{ MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PF04) }, +{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, +{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, +{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, +{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, +{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PF13) }, +{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF12) }, +{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, +{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PD14) }, +{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, +{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, +{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB15) }, +{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA15) }, +{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_PB05) }, +{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_PB06) }, +{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PB02) }, +{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_PD13) }, +{ MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_PD12) }, +{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PD11) }, +{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PE02) }, +{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PA00) }, +{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PB00) }, +{ MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_PE00) }, +{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_PB11) }, +{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_PB10) }, +{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_PE15) }, +{ MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PE14) }, +{ MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_PE12) }, +{ MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_PE10) }, +{ MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_PE07) }, +{ MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_PE08) }, +{ MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_PC08) }, +{ MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_PC09) }, +{ MP_ROM_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_PC10) }, +{ MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_PC11) }, +{ MP_ROM_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_PC12) }, +{ MP_ROM_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_PD02) }, +{ MP_ROM_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_PG02) }, +{ MP_ROM_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_PG03) }, +{ MP_ROM_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_PD07) }, +{ MP_ROM_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_D55), MP_ROM_PTR(&pin_PD03) }, +{ MP_ROM_QSTR(MP_QSTR_D56), MP_ROM_PTR(&pin_PE02) }, +{ MP_ROM_QSTR(MP_QSTR_D57), MP_ROM_PTR(&pin_PE04) }, +{ MP_ROM_QSTR(MP_QSTR_D58), MP_ROM_PTR(&pin_PE05) }, +{ MP_ROM_QSTR(MP_QSTR_D59), MP_ROM_PTR(&pin_PE06) }, +{ MP_ROM_QSTR(MP_QSTR_D60), MP_ROM_PTR(&pin_PE03) }, +{ MP_ROM_QSTR(MP_QSTR_D61), MP_ROM_PTR(&pin_PF08) }, +{ MP_ROM_QSTR(MP_QSTR_D62), MP_ROM_PTR(&pin_PF07) }, +{ MP_ROM_QSTR(MP_QSTR_D63), MP_ROM_PTR(&pin_PF09) }, +{ MP_ROM_QSTR(MP_QSTR_D64), MP_ROM_PTR(&pin_PG01) }, +{ MP_ROM_QSTR(MP_QSTR_D65), MP_ROM_PTR(&pin_PG00) }, +{ MP_ROM_QSTR(MP_QSTR_D66), MP_ROM_PTR(&pin_PD01) }, +{ MP_ROM_QSTR(MP_QSTR_D67), MP_ROM_PTR(&pin_PD00) }, +{ MP_ROM_QSTR(MP_QSTR_D68), MP_ROM_PTR(&pin_PF00) }, +{ MP_ROM_QSTR(MP_QSTR_D69), MP_ROM_PTR(&pin_PF01) }, +{ MP_ROM_QSTR(MP_QSTR_D70), MP_ROM_PTR(&pin_PF02) }, +{ MP_ROM_QSTR(MP_QSTR_D71), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, +{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, +{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB07) }, +{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, +{ MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D0), MP_ROM_PTR(&pin_PC08) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D1), MP_ROM_PTR(&pin_PC09) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D2), MP_ROM_PTR(&pin_PC10) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D3), MP_ROM_PTR(&pin_PC11) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_PD02) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CK), MP_ROM_PTR(&pin_PC12) }, +{ MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PG02) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PG06) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PG07) }, +{ MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PA09) }, +{ MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_PD03) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_UART5_TX), MP_ROM_PTR(&pin_PB06) }, +{ MP_ROM_QSTR(MP_QSTR_UART5_RX), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_TX), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_RX), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_UART7_TX), MP_ROM_PTR(&pin_PF07) }, +{ MP_ROM_QSTR(MP_QSTR_UART7_RX), MP_ROM_PTR(&pin_PF06) }, +{ MP_ROM_QSTR(MP_QSTR_UART8_TX), MP_ROM_PTR(&pin_PE01) }, +{ MP_ROM_QSTR(MP_QSTR_UART8_RX), MP_ROM_PTR(&pin_PE00) }, +{ MP_ROM_QSTR(MP_QSTR_SPI3_NSS), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_SPI3_SCK), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_SPI3_MISO), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_SPI3_MOSI), MP_ROM_PTR(&pin_PB05) }, +{ MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_I2C1_SCL), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PF00) }, +{ MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PF01) }, +{ MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDC), MP_ROM_PTR(&pin_PC01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDIO), MP_ROM_PTR(&pin_PA02) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_REF_CLK), MP_ROM_PTR(&pin_PA01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_CRS_DV), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD0), MP_ROM_PTR(&pin_PC04) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD1), MP_ROM_PTR(&pin_PC05) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TX_EN), MP_ROM_PTR(&pin_PG11) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD0), MP_ROM_PTR(&pin_PG13) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD1), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA13) }, +{ MP_ROM_QSTR(MP_QSTR_SWDCLK), MP_ROM_PTR(&pin_PA14) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h b/ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h new file mode 100644 index 0000000000..84699bd784 --- /dev/null +++ b/ports/stm/boards/nucleo_f767zi/stm32f7xx_hal_conf.h @@ -0,0 +1,445 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + + #define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_MDIOS_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define ART_ACCLERATOR_ENABLE 0U /* To enable instruction cache and prefetch */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* LAN8742A_PHY_ADDRESS Address*/ +#define LAN8742A_PHY_ADDRESS 0 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ + +#define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ +#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/startup_stm32f767xx.s b/ports/stm/boards/startup_stm32f767xx.s new file mode 100644 index 0000000000..84309d4dad --- /dev/null +++ b/ports/stm/boards/startup_stm32f767xx.s @@ -0,0 +1,618 @@ +/** + ****************************************************************************** + * @file startup_stm32f767xx.s + * @author MCD Application Team + * @brief STM32F767xx Devices vector table for GCC based toolchain. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M7 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m7 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system initialization function.*/ + bl SystemInit +/* Call static constructors */ +/* bl __libc_init_array */ +/* Call the application's entry point.*/ + bl main + bx lr +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex M7. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +*******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + +g_pfnVectors: + .word _estack + .word Reset_Handler + + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + + /* External Interrupts */ + .word WWDG_IRQHandler /* Window WatchDog */ + .word PVD_IRQHandler /* PVD through EXTI Line detection */ + .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ + .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ + .word FLASH_IRQHandler /* FLASH */ + .word RCC_IRQHandler /* RCC */ + .word EXTI0_IRQHandler /* EXTI Line0 */ + .word EXTI1_IRQHandler /* EXTI Line1 */ + .word EXTI2_IRQHandler /* EXTI Line2 */ + .word EXTI3_IRQHandler /* EXTI Line3 */ + .word EXTI4_IRQHandler /* EXTI Line4 */ + .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ + .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ + .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ + .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ + .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ + .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ + .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ + .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ + .word CAN1_TX_IRQHandler /* CAN1 TX */ + .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ + .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ + .word CAN1_SCE_IRQHandler /* CAN1 SCE */ + .word EXTI9_5_IRQHandler /* External Line[9:5]s */ + .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ + .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ + .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ + .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ + .word TIM2_IRQHandler /* TIM2 */ + .word TIM3_IRQHandler /* TIM3 */ + .word TIM4_IRQHandler /* TIM4 */ + .word I2C1_EV_IRQHandler /* I2C1 Event */ + .word I2C1_ER_IRQHandler /* I2C1 Error */ + .word I2C2_EV_IRQHandler /* I2C2 Event */ + .word I2C2_ER_IRQHandler /* I2C2 Error */ + .word SPI1_IRQHandler /* SPI1 */ + .word SPI2_IRQHandler /* SPI2 */ + .word USART1_IRQHandler /* USART1 */ + .word USART2_IRQHandler /* USART2 */ + .word USART3_IRQHandler /* USART3 */ + .word EXTI15_10_IRQHandler /* External Line[15:10]s */ + .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ + .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ + .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ + .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ + .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ + .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ + .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ + .word FMC_IRQHandler /* FMC */ + .word SDMMC1_IRQHandler /* SDMMC1 */ + .word TIM5_IRQHandler /* TIM5 */ + .word SPI3_IRQHandler /* SPI3 */ + .word UART4_IRQHandler /* UART4 */ + .word UART5_IRQHandler /* UART5 */ + .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ + .word TIM7_IRQHandler /* TIM7 */ + .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ + .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ + .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ + .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ + .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ + .word ETH_IRQHandler /* Ethernet */ + .word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */ + .word CAN2_TX_IRQHandler /* CAN2 TX */ + .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ + .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ + .word CAN2_SCE_IRQHandler /* CAN2 SCE */ + .word OTG_FS_IRQHandler /* USB OTG FS */ + .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ + .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ + .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ + .word USART6_IRQHandler /* USART6 */ + .word I2C3_EV_IRQHandler /* I2C3 event */ + .word I2C3_ER_IRQHandler /* I2C3 error */ + .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ + .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ + .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ + .word OTG_HS_IRQHandler /* USB OTG HS */ + .word DCMI_IRQHandler /* DCMI */ + .word 0 /* Reserved */ + .word RNG_IRQHandler /* RNG */ + .word FPU_IRQHandler /* FPU */ + .word UART7_IRQHandler /* UART7 */ + .word UART8_IRQHandler /* UART8 */ + .word SPI4_IRQHandler /* SPI4 */ + .word SPI5_IRQHandler /* SPI5 */ + .word SPI6_IRQHandler /* SPI6 */ + .word SAI1_IRQHandler /* SAI1 */ + .word LTDC_IRQHandler /* LTDC */ + .word LTDC_ER_IRQHandler /* LTDC error */ + .word DMA2D_IRQHandler /* DMA2D */ + .word SAI2_IRQHandler /* SAI2 */ + .word QUADSPI_IRQHandler /* QUADSPI */ + .word LPTIM1_IRQHandler /* LPTIM1 */ + .word CEC_IRQHandler /* HDMI_CEC */ + .word I2C4_EV_IRQHandler /* I2C4 Event */ + .word I2C4_ER_IRQHandler /* I2C4 Error */ + .word SPDIF_RX_IRQHandler /* SPDIF_RX */ + .word 0 /* Reserved */ + .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter 0 global Interrupt */ + .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter 1 global Interrupt */ + .word DFSDM1_FLT2_IRQHandler /* DFSDM1 Filter 2 global Interrupt */ + .word DFSDM1_FLT3_IRQHandler /* DFSDM1 Filter 3 global Interrupt */ + .word SDMMC2_IRQHandler /* SDMMC2 */ + .word CAN3_TX_IRQHandler /* CAN3 TX */ + .word CAN3_RX0_IRQHandler /* CAN3 RX0 */ + .word CAN3_RX1_IRQHandler /* CAN3 RX1 */ + .word CAN3_SCE_IRQHandler /* CAN3 SCE */ + .word JPEG_IRQHandler /* JPEG */ + .word MDIOS_IRQHandler /* MDIOS */ + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Stream0_IRQHandler + .thumb_set DMA1_Stream0_IRQHandler,Default_Handler + + .weak DMA1_Stream1_IRQHandler + .thumb_set DMA1_Stream1_IRQHandler,Default_Handler + + .weak DMA1_Stream2_IRQHandler + .thumb_set DMA1_Stream2_IRQHandler,Default_Handler + + .weak DMA1_Stream3_IRQHandler + .thumb_set DMA1_Stream3_IRQHandler,Default_Handler + + .weak DMA1_Stream4_IRQHandler + .thumb_set DMA1_Stream4_IRQHandler,Default_Handler + + .weak DMA1_Stream5_IRQHandler + .thumb_set DMA1_Stream5_IRQHandler,Default_Handler + + .weak DMA1_Stream6_IRQHandler + .thumb_set DMA1_Stream6_IRQHandler,Default_Handler + + .weak ADC_IRQHandler + .thumb_set ADC_IRQHandler,Default_Handler + + .weak CAN1_TX_IRQHandler + .thumb_set CAN1_TX_IRQHandler,Default_Handler + + .weak CAN1_RX0_IRQHandler + .thumb_set CAN1_RX0_IRQHandler,Default_Handler + + .weak CAN1_RX1_IRQHandler + .thumb_set CAN1_RX1_IRQHandler,Default_Handler + + .weak CAN1_SCE_IRQHandler + .thumb_set CAN1_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM9_IRQHandler + .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM10_IRQHandler + .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM11_IRQHandler + .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak OTG_FS_WKUP_IRQHandler + .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler + + .weak TIM8_BRK_TIM12_IRQHandler + .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler + + .weak TIM8_UP_TIM13_IRQHandler + .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler + + .weak TIM8_TRG_COM_TIM14_IRQHandler + .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler + + .weak TIM8_CC_IRQHandler + .thumb_set TIM8_CC_IRQHandler,Default_Handler + + .weak DMA1_Stream7_IRQHandler + .thumb_set DMA1_Stream7_IRQHandler,Default_Handler + + .weak FMC_IRQHandler + .thumb_set FMC_IRQHandler,Default_Handler + + .weak SDMMC1_IRQHandler + .thumb_set SDMMC1_IRQHandler,Default_Handler + + .weak TIM5_IRQHandler + .thumb_set TIM5_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak UART4_IRQHandler + .thumb_set UART4_IRQHandler,Default_Handler + + .weak UART5_IRQHandler + .thumb_set UART5_IRQHandler,Default_Handler + + .weak TIM6_DAC_IRQHandler + .thumb_set TIM6_DAC_IRQHandler,Default_Handler + + .weak TIM7_IRQHandler + .thumb_set TIM7_IRQHandler,Default_Handler + + .weak DMA2_Stream0_IRQHandler + .thumb_set DMA2_Stream0_IRQHandler,Default_Handler + + .weak DMA2_Stream1_IRQHandler + .thumb_set DMA2_Stream1_IRQHandler,Default_Handler + + .weak DMA2_Stream2_IRQHandler + .thumb_set DMA2_Stream2_IRQHandler,Default_Handler + + .weak DMA2_Stream3_IRQHandler + .thumb_set DMA2_Stream3_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak DMA2_Stream4_IRQHandler + .thumb_set DMA2_Stream4_IRQHandler,Default_Handler + + .weak ETH_IRQHandler + .thumb_set ETH_IRQHandler,Default_Handler + + .weak ETH_WKUP_IRQHandler + .thumb_set ETH_WKUP_IRQHandler,Default_Handler + + .weak CAN2_TX_IRQHandler + .thumb_set CAN2_TX_IRQHandler,Default_Handler + + .weak CAN2_RX0_IRQHandler + .thumb_set CAN2_RX0_IRQHandler,Default_Handler + + .weak CAN2_RX1_IRQHandler + .thumb_set CAN2_RX1_IRQHandler,Default_Handler + + .weak CAN2_SCE_IRQHandler + .thumb_set CAN2_SCE_IRQHandler,Default_Handler + + .weak OTG_FS_IRQHandler + .thumb_set OTG_FS_IRQHandler,Default_Handler + + .weak DMA2_Stream5_IRQHandler + .thumb_set DMA2_Stream5_IRQHandler,Default_Handler + + .weak DMA2_Stream6_IRQHandler + .thumb_set DMA2_Stream6_IRQHandler,Default_Handler + + .weak DMA2_Stream7_IRQHandler + .thumb_set DMA2_Stream7_IRQHandler,Default_Handler + + .weak USART6_IRQHandler + .thumb_set USART6_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_OUT_IRQHandler + .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler + + .weak OTG_HS_EP1_IN_IRQHandler + .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler + + .weak OTG_HS_WKUP_IRQHandler + .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler + + .weak OTG_HS_IRQHandler + .thumb_set OTG_HS_IRQHandler,Default_Handler + + .weak DCMI_IRQHandler + .thumb_set DCMI_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak UART7_IRQHandler + .thumb_set UART7_IRQHandler,Default_Handler + + .weak UART8_IRQHandler + .thumb_set UART8_IRQHandler,Default_Handler + + .weak SPI4_IRQHandler + .thumb_set SPI4_IRQHandler,Default_Handler + + .weak SPI5_IRQHandler + .thumb_set SPI5_IRQHandler,Default_Handler + + .weak SPI6_IRQHandler + .thumb_set SPI6_IRQHandler,Default_Handler + + .weak SAI1_IRQHandler + .thumb_set SAI1_IRQHandler,Default_Handler + + .weak LTDC_IRQHandler + .thumb_set LTDC_IRQHandler,Default_Handler + + .weak LTDC_ER_IRQHandler + .thumb_set LTDC_ER_IRQHandler,Default_Handler + + .weak DMA2D_IRQHandler + .thumb_set DMA2D_IRQHandler,Default_Handler + + .weak SAI2_IRQHandler + .thumb_set SAI2_IRQHandler,Default_Handler + + .weak QUADSPI_IRQHandler + .thumb_set QUADSPI_IRQHandler,Default_Handler + + .weak LPTIM1_IRQHandler + .thumb_set LPTIM1_IRQHandler,Default_Handler + + .weak CEC_IRQHandler + .thumb_set CEC_IRQHandler,Default_Handler + + .weak I2C4_EV_IRQHandler + .thumb_set I2C4_EV_IRQHandler,Default_Handler + + .weak I2C4_ER_IRQHandler + .thumb_set I2C4_ER_IRQHandler,Default_Handler + + .weak SPDIF_RX_IRQHandler + .thumb_set SPDIF_RX_IRQHandler,Default_Handler + + .weak DFSDM1_FLT0_IRQHandler + .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler + + .weak DFSDM1_FLT1_IRQHandler + .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler + + .weak DFSDM1_FLT2_IRQHandler + .thumb_set DFSDM1_FLT2_IRQHandler,Default_Handler + + .weak DFSDM1_FLT3_IRQHandler + .thumb_set DFSDM1_FLT3_IRQHandler,Default_Handler + + .weak SDMMC2_IRQHandler + .thumb_set SDMMC2_IRQHandler,Default_Handler + + .weak CAN3_TX_IRQHandler + .thumb_set CAN3_TX_IRQHandler,Default_Handler + + .weak CAN3_RX0_IRQHandler + .thumb_set CAN3_RX0_IRQHandler,Default_Handler + + .weak CAN3_RX1_IRQHandler + .thumb_set CAN3_RX1_IRQHandler,Default_Handler + + .weak CAN3_SCE_IRQHandler + .thumb_set CAN3_SCE_IRQHandler,Default_Handler + + .weak JPEG_IRQHandler + .thumb_set JPEG_IRQHandler,Default_Handler + + .weak MDIOS_IRQHandler + .thumb_set MDIOS_IRQHandler,Default_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ + diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 40e13ca3ba..82a8a72e4f 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -32,6 +32,8 @@ //TODO: rework this module to use HAL only #ifdef STM32H743xx #include "stm32h7xx_ll_gpio.h" +#elif STM32F767xx +#include "stm32f7xx_ll_gpio.h" #else #include "stm32f4xx_ll_gpio.h" #endif diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 0342fc7639..e1e983e39f 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -88,3 +88,19 @@ ifeq ($(MCU_SERIES), H7) CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_DISPLAYIO = 0 endif + +ifeq ($(MCU_SERIES), F7) + CIRCUITPY_BOARD = 1 + CIRCUITPY_DIGITALIO = 1 + CIRCUITPY_ANALOGIO = 0 + CIRCUITPY_MICROCONTROLLER = 1 + CIRCUITPY_BUSIO = 0 + CIRCUITPY_PULSEIO = 0 + CIRCUITPY_OS = 0 + CIRCUITPY_STORAGE = 0 + CIRCUITPY_RANDOM = 0 + CIRCUITPY_USB_HID = 0 + CIRCUITPY_USB_MIDI = 0 + CIRCUITPY_NEOPIXEL_WRITE = 0 + CIRCUITPY_DISPLAYIO = 0 +endif diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 394ab25b11..209d35ee95 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -105,6 +105,15 @@ typedef struct { #include "stm32f4/stm32f407xx/periph.h" #endif +// F7 Series + +#ifdef STM32F767xx +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f7/stm32f767xx/periph.h" +#endif + // H7 Series // Single Core diff --git a/ports/stm/peripherals/pins.h b/ports/stm/peripherals/pins.h index c6f1ec322b..628e09695a 100644 --- a/ports/stm/peripherals/pins.h +++ b/ports/stm/peripherals/pins.h @@ -92,6 +92,11 @@ extern const mp_obj_type_t mcu_pin_type; #include "stm32f4/stm32f407xx/pins.h" #endif +// F7 Series +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/pins.h" +#endif + // H7 Series #ifdef STM32H743xx #include "stm32h7/stm32h743xx/pins.h" diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c new file mode 100644 index 0000000000..15f1188706 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c @@ -0,0 +1,66 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mpconfig.h" + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = 432; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 9; + RCC_OscInitStruct.PLL.PLLR = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Activate the OverDrive to reach the 216 MHz Frequency */ + HAL_PWREx_EnableOverDrive(); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7); + +} diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c new file mode 100644 index 0000000000..d51ff53c1f --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c @@ -0,0 +1,48 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK +} + + diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.c b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.c new file mode 100644 index 0000000000..07d226db30 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.c @@ -0,0 +1,248 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[4] = {I2C1, I2C2, I2C3, I2C4}; + +const mcu_periph_obj_t mcu_i2c_sda_list[12] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(4, 11, &pin_PB07), + PERIPH(4, 1, &pin_PB09), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), + PERIPH(4, 4, &pin_PD13), + PERIPH(2, 4, &pin_PF00), + PERIPH(4, 4, &pin_PF15), + PERIPH(2, 4, &pin_PH05), + PERIPH(3, 4, &pin_PH08), + PERIPH(4, 4, &pin_PH12), +}; +const mcu_periph_obj_t mcu_i2c_scl_list[12] = { + PERIPH(3, 4, &pin_PA08), + PERIPH(1, 4, &pin_PB06), + PERIPH(4, 11, &pin_PB06), + PERIPH(4, 1, &pin_PB08), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(4, 4, &pin_PD12), + PERIPH(2, 4, &pin_PF01), + PERIPH(4, 4, &pin_PF14), + PERIPH(2, 4, &pin_PH04), + PERIPH(3, 4, &pin_PH07), + PERIPH(4, 4, &pin_PH11), +}; + +//SPI + +SPI_TypeDef * mcu_spi_banks[6] = {SPI1, SPI2, SPI3, SPI4, SPI5, SPI6}; + +const mcu_periph_obj_t mcu_spi_sck_list[18] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(6, 8, &pin_PA05), + PERIPH(2, 5, &pin_PA09), + PERIPH(2, 5, &pin_PA12), + PERIPH(1, 5, &pin_PB03), + PERIPH(3, 6, &pin_PB03), + PERIPH(6, 8, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(3, 6, &pin_PC10), + PERIPH(2, 5, &pin_PD03), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 5, &pin_PF07), + PERIPH(1, 5, &pin_PG11), + PERIPH(6, 5, &pin_PG13), + PERIPH(5, 5, &pin_PH06), + PERIPH(2, 5, &pin_PI01), +}; +const mcu_periph_obj_t mcu_spi_mosi_list[18] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(6, 8, &pin_PA07), + PERIPH(3, 7, &pin_PB02), + PERIPH(1, 5, &pin_PB05), + PERIPH(3, 6, &pin_PB05), + PERIPH(6, 8, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC01), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(1, 5, &pin_PD07), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 5, &pin_PF09), + PERIPH(5, 5, &pin_PF11), + PERIPH(6, 5, &pin_PG14), + PERIPH(2, 5, &pin_PI03), +}; +const mcu_periph_obj_t mcu_spi_miso_list[15] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(6, 8, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(3, 6, &pin_PB04), + PERIPH(6, 8, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 5, &pin_PF08), + PERIPH(1, 5, &pin_PG09), + PERIPH(6, 5, &pin_PG12), + PERIPH(5, 5, &pin_PH07), + PERIPH(2, 5, &pin_PI02), +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6, UART7, UART8}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, true, true, true, true, true}; + +const mcu_periph_obj_t mcu_uart_tx_list[24] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(4, 6, &pin_PA12), + PERIPH(7, 12, &pin_PA15), + PERIPH(7, 12, &pin_PB04), + PERIPH(5, 1, &pin_PB06), + PERIPH(1, 7, &pin_PB06), + PERIPH(5, 7, &pin_PB09), + PERIPH(3, 7, &pin_PB10), + PERIPH(5, 8, &pin_PB13), + PERIPH(1, 4, &pin_PB14), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(4, 8, &pin_PD01), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(8, 8, &pin_PE01), + PERIPH(7, 8, &pin_PE08), + PERIPH(7, 8, &pin_PF07), + PERIPH(6, 8, &pin_PG14), + PERIPH(4, 8, &pin_PH13), +}; +const mcu_periph_obj_t mcu_uart_rx_list[25] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(7, 12, &pin_PA08), + PERIPH(1, 7, &pin_PA10), + PERIPH(4, 6, &pin_PA11), + PERIPH(7, 12, &pin_PB03), + PERIPH(5, 1, &pin_PB05), + PERIPH(1, 7, &pin_PB07), + PERIPH(5, 7, &pin_PB08), + PERIPH(3, 7, &pin_PB11), + PERIPH(5, 8, &pin_PB12), + PERIPH(1, 4, &pin_PB15), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(4, 8, &pin_PD00), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(8, 8, &pin_PE00), + PERIPH(7, 8, &pin_PE07), + PERIPH(7, 8, &pin_PF06), + PERIPH(6, 8, &pin_PG09), + PERIPH(4, 8, &pin_PH14), + PERIPH(4, 8, &pin_PI09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +//TODO: H7 has more timers than this, but are they tied to pins? +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, NULL, NULL, + NULL, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[55] = { + TIM(2, 1, 1, &pin_PA00), + TIM(5, 2, 1, &pin_PA00), + TIM(2, 1, 2, &pin_PA01), + TIM(5, 2, 2, &pin_PA01), + TIM(2, 1, 3, &pin_PA02), + TIM(5, 2, 3, &pin_PA02), + TIM(9, 3, 1, &pin_PA02), + TIM(2, 1, 4, &pin_PA03), + TIM(5, 2, 4, &pin_PA03), + TIM(9, 3, 2, &pin_PA03), + TIM(2, 1, 1, &pin_PA05), + TIM(3, 2, 1, &pin_PA06), + TIM(3, 2, 2, &pin_PA07), + TIM(1, 1, 1, &pin_PA08), + TIM(1, 1, 2, &pin_PA09), + TIM(1, 1, 3, &pin_PA10), + TIM(1, 1, 4, &pin_PA11), + TIM(2, 1, 1, &pin_PA15), + TIM(3, 2, 3, &pin_PB00), + TIM(3, 2, 4, &pin_PB01), + TIM(2, 1, 2, &pin_PB03), + TIM(3, 2, 1, &pin_PB04), + TIM(3, 2, 2, &pin_PB05), + TIM(4, 2, 1, &pin_PB06), + TIM(4, 2, 2, &pin_PB07), + TIM(4, 2, 3, &pin_PB08), + TIM(4, 2, 4, &pin_PB09), + TIM(2, 1, 3, &pin_PB10), + TIM(2, 1, 4, &pin_PB11), + TIM(3, 2, 1, &pin_PC06), + TIM(8, 3, 1, &pin_PC06), + TIM(3, 2, 2, &pin_PC07), + TIM(8, 3, 2, &pin_PC07), + TIM(3, 2, 3, &pin_PC08), + TIM(8, 3, 3, &pin_PC08), + TIM(3, 2, 4, &pin_PC09), + TIM(8, 3, 4, &pin_PC09), + TIM(4, 2, 1, &pin_PD12), + TIM(4, 2, 2, &pin_PD13), + TIM(4, 2, 3, &pin_PD14), + TIM(4, 2, 4, &pin_PD15), + TIM(9, 3, 1, &pin_PE05), + TIM(9, 3, 2, &pin_PE06), + TIM(1, 1, 1, &pin_PE09), + TIM(1, 1, 2, &pin_PE11), + TIM(1, 1, 3, &pin_PE13), + TIM(1, 1, 4, &pin_PE14), + TIM(5, 2, 1, &pin_PH10), + TIM(5, 2, 2, &pin_PH11), + TIM(5, 2, 3, &pin_PH12), + TIM(5, 2, 4, &pin_PI00), + TIM(8, 3, 4, &pin_PI02), + TIM(8, 3, 1, &pin_PI05), + TIM(8, 3, 2, &pin_PI06), + TIM(8, 3, 3, &pin_PI07), +}; diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h new file mode 100644 index 0000000000..f1878ee2e6 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[4]; + +const mcu_periph_obj_t mcu_i2c_sda_list[12]; +const mcu_periph_obj_t mcu_i2c_scl_list[12]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[6]; + +const mcu_periph_obj_t mcu_spi_sck_list[18]; +const mcu_periph_obj_t mcu_spi_mosi_list[18]; +const mcu_periph_obj_t mcu_spi_miso_list[15]; + +//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[24]; +const mcu_periph_obj_t mcu_uart_rx_list[25]; + +//Timers +#define TIM_BANK_ARRAY_LEN 14 +#define TIM_PIN_ARRAY_LEN 55 +TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c new file mode 100644 index 0000000000..870545f994 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c @@ -0,0 +1,200 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" + +// Todo: some pins do have ADCs, but the module isn't set up yet. + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, NO_ADC); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, NO_ADC); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, NO_ADC); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, NO_ADC); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, NO_ADC); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, NO_ADC); +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, NO_ADC); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, NO_ADC); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, NO_ADC); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, NO_ADC); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, NO_ADC); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, NO_ADC); +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, NO_ADC); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, NO_ADC); +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); +const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC); +const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC); +const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC); +const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC); +const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC); +const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC); +const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC); +const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC); +const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC); +const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC); +const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC); +const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC); +const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC); +const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC); +const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC); +const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC); +const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC); +const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC); +const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC); +const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC); +const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC); +const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC); +const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC); +const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC); +const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC); +const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC); +const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC); +const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC); +const mcu_pin_obj_t pin_PI12 = PIN(8, 12, NO_ADC); +const mcu_pin_obj_t pin_PI13 = PIN(8, 13, NO_ADC); +const mcu_pin_obj_t pin_PI14 = PIN(8, 14, NO_ADC); +const mcu_pin_obj_t pin_PI15 = PIN(8, 15, NO_ADC); +const mcu_pin_obj_t pin_PJ00 = PIN(9, 0, NO_ADC); +const mcu_pin_obj_t pin_PJ01 = PIN(9, 1, NO_ADC); +const mcu_pin_obj_t pin_PJ02 = PIN(9, 2, NO_ADC); +const mcu_pin_obj_t pin_PJ03 = PIN(9, 3, NO_ADC); +const mcu_pin_obj_t pin_PJ04 = PIN(9, 4, NO_ADC); +const mcu_pin_obj_t pin_PJ05 = PIN(9, 5, NO_ADC); +const mcu_pin_obj_t pin_PJ06 = PIN(9, 6, NO_ADC); +const mcu_pin_obj_t pin_PJ07 = PIN(9, 7, NO_ADC); +const mcu_pin_obj_t pin_PJ08 = PIN(9, 8, NO_ADC); +const mcu_pin_obj_t pin_PJ09 = PIN(9, 9, NO_ADC); +const mcu_pin_obj_t pin_PJ10 = PIN(9, 10, NO_ADC); +const mcu_pin_obj_t pin_PJ11 = PIN(9, 11, NO_ADC); +const mcu_pin_obj_t pin_PJ12 = PIN(9, 12, NO_ADC); +const mcu_pin_obj_t pin_PJ13 = PIN(9, 13, NO_ADC); +const mcu_pin_obj_t pin_PJ14 = PIN(9, 14, NO_ADC); +const mcu_pin_obj_t pin_PJ15 = PIN(9, 15, NO_ADC); +const mcu_pin_obj_t pin_PK00 = PIN(10, 0, NO_ADC); +const mcu_pin_obj_t pin_PK01 = PIN(10, 1, NO_ADC); +const mcu_pin_obj_t pin_PK02 = PIN(10, 2, NO_ADC); +const mcu_pin_obj_t pin_PK03 = PIN(10, 3, NO_ADC); +const mcu_pin_obj_t pin_PK04 = PIN(10, 4, NO_ADC); +const mcu_pin_obj_t pin_PK05 = PIN(10, 5, NO_ADC); +const mcu_pin_obj_t pin_PK06 = PIN(10, 6, NO_ADC); +const mcu_pin_obj_t pin_PK07 = PIN(10, 7, NO_ADC); diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.h b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.h new file mode 100644 index 0000000000..e0f2bb0566 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.h @@ -0,0 +1,199 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PINS_H + +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PF00; +extern const mcu_pin_obj_t pin_PF01; +extern const mcu_pin_obj_t pin_PF02; +extern const mcu_pin_obj_t pin_PF03; +extern const mcu_pin_obj_t pin_PF04; +extern const mcu_pin_obj_t pin_PF05; +extern const mcu_pin_obj_t pin_PF06; +extern const mcu_pin_obj_t pin_PF07; +extern const mcu_pin_obj_t pin_PF08; +extern const mcu_pin_obj_t pin_PF09; +extern const mcu_pin_obj_t pin_PF10; +extern const mcu_pin_obj_t pin_PF11; +extern const mcu_pin_obj_t pin_PF12; +extern const mcu_pin_obj_t pin_PF13; +extern const mcu_pin_obj_t pin_PF14; +extern const mcu_pin_obj_t pin_PF15; +extern const mcu_pin_obj_t pin_PG00; +extern const mcu_pin_obj_t pin_PG01; +extern const mcu_pin_obj_t pin_PG02; +extern const mcu_pin_obj_t pin_PG03; +extern const mcu_pin_obj_t pin_PG04; +extern const mcu_pin_obj_t pin_PG05; +extern const mcu_pin_obj_t pin_PG06; +extern const mcu_pin_obj_t pin_PG07; +extern const mcu_pin_obj_t pin_PG08; +extern const mcu_pin_obj_t pin_PG09; +extern const mcu_pin_obj_t pin_PG10; +extern const mcu_pin_obj_t pin_PG11; +extern const mcu_pin_obj_t pin_PG12; +extern const mcu_pin_obj_t pin_PG13; +extern const mcu_pin_obj_t pin_PG14; +extern const mcu_pin_obj_t pin_PG15; +extern const mcu_pin_obj_t pin_PH00; +extern const mcu_pin_obj_t pin_PH01; +extern const mcu_pin_obj_t pin_PH02; +extern const mcu_pin_obj_t pin_PH03; +extern const mcu_pin_obj_t pin_PH04; +extern const mcu_pin_obj_t pin_PH05; +extern const mcu_pin_obj_t pin_PH06; +extern const mcu_pin_obj_t pin_PH07; +extern const mcu_pin_obj_t pin_PH08; +extern const mcu_pin_obj_t pin_PH09; +extern const mcu_pin_obj_t pin_PH10; +extern const mcu_pin_obj_t pin_PH11; +extern const mcu_pin_obj_t pin_PH12; +extern const mcu_pin_obj_t pin_PH13; +extern const mcu_pin_obj_t pin_PH14; +extern const mcu_pin_obj_t pin_PH15; +extern const mcu_pin_obj_t pin_PI00; +extern const mcu_pin_obj_t pin_PI01; +extern const mcu_pin_obj_t pin_PI02; +extern const mcu_pin_obj_t pin_PI03; +extern const mcu_pin_obj_t pin_PI04; +extern const mcu_pin_obj_t pin_PI05; +extern const mcu_pin_obj_t pin_PI06; +extern const mcu_pin_obj_t pin_PI07; +extern const mcu_pin_obj_t pin_PI08; +extern const mcu_pin_obj_t pin_PI09; +extern const mcu_pin_obj_t pin_PI10; +extern const mcu_pin_obj_t pin_PI11; +extern const mcu_pin_obj_t pin_PI12; +extern const mcu_pin_obj_t pin_PI13; +extern const mcu_pin_obj_t pin_PI14; +extern const mcu_pin_obj_t pin_PI15; +extern const mcu_pin_obj_t pin_PJ00; +extern const mcu_pin_obj_t pin_PJ01; +extern const mcu_pin_obj_t pin_PJ02; +extern const mcu_pin_obj_t pin_PJ03; +extern const mcu_pin_obj_t pin_PJ04; +extern const mcu_pin_obj_t pin_PJ05; +extern const mcu_pin_obj_t pin_PJ06; +extern const mcu_pin_obj_t pin_PJ07; +extern const mcu_pin_obj_t pin_PJ08; +extern const mcu_pin_obj_t pin_PJ09; +extern const mcu_pin_obj_t pin_PJ10; +extern const mcu_pin_obj_t pin_PJ11; +extern const mcu_pin_obj_t pin_PJ12; +extern const mcu_pin_obj_t pin_PJ13; +extern const mcu_pin_obj_t pin_PJ14; +extern const mcu_pin_obj_t pin_PJ15; +extern const mcu_pin_obj_t pin_PK00; +extern const mcu_pin_obj_t pin_PK01; +extern const mcu_pin_obj_t pin_PK02; +extern const mcu_pin_obj_t pin_PK03; +extern const mcu_pin_obj_t pin_PK04; +extern const mcu_pin_obj_t pin_PK05; +extern const mcu_pin_obj_t pin_PK06; +extern const mcu_pin_obj_t pin_PK07; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PINS_H diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 5bd6e8758e..7d394d187a 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -49,27 +49,47 @@ typedef struct { #if defined(STM32F4) -STATIC const flash_layout_t flash_layout[] = { - { 0x08000000, 0x04000, 4 }, - { 0x08010000, 0x10000, 1 }, - { 0x08020000, 0x20000, 3 }, - #if defined(FLASH_SECTOR_8) - { 0x08080000, 0x20000, 4 }, - #endif - #if defined(FLASH_SECTOR_12) - { 0x08100000, 0x04000, 4 }, - { 0x08110000, 0x10000, 1 }, - { 0x08120000, 0x20000, 7 }, - #endif -}; -STATIC uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); + STATIC const flash_layout_t flash_layout[] = { + { 0x08000000, 0x04000, 4 }, + { 0x08010000, 0x10000, 1 }, + { 0x08020000, 0x20000, 3 }, + #if defined(FLASH_SECTOR_8) + { 0x08080000, 0x20000, 4 }, + #endif + #if defined(FLASH_SECTOR_12) + { 0x08100000, 0x04000, 4 }, + { 0x08110000, 0x10000, 1 }, + { 0x08120000, 0x20000, 7 }, + #endif + }; + STATIC uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); +#elif defined(STM32F7) + + // FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to + // FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F7 + #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR + #if defined(STM32F722xx) || defined(STM32F723xx) || defined(STM32F732xx) || defined(STM32F733xx) + static const flash_layout_t flash_layout[] = { + { 0x08000000, 0x04000, 4 }, + { 0x08010000, 0x10000, 1 }, + { 0x08020000, 0x20000, 3 }, + }; + STATIC uint8_t _flash_cache[0x4000] __attribute__((aligned(4))); + #else + static const flash_layout_t flash_layout[] = { + { 0x08000000, 0x08000, 4 }, + { 0x08020000, 0x20000, 1 }, + { 0x08040000, 0x40000, 3 }, + }; + STATIC uint8_t _flash_cache[0x8000] __attribute__((aligned(4))); + #endif #elif defined(STM32H7) -STATIC const flash_layout_t flash_layout[] = { - { 0x08000000, 0x20000, 16 }, -}; -STATIC uint8_t _flash_cache[0x20000] __attribute__((aligned(4))); + STATIC const flash_layout_t flash_layout[] = { + { 0x08000000, 0x20000, 16 }, + }; + STATIC uint8_t _flash_cache[0x20000] __attribute__((aligned(4))); #else #error Unsupported processor diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 665b194c5f..e54cd92311 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -66,6 +66,12 @@ #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif +#ifdef STM32F767xx +#define STM32_FLASH_SIZE 0x200000 //2MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x18000 //96KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08008000 +#endif + #ifdef STM32H743xx #define STM32_FLASH_SIZE 0x200000 //2MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 //128KiB diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 997bf413f8..501550aed7 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -80,7 +80,7 @@ void init_usb_hardware(void) { GPIO_InitStruct.Pull = GPIO_NOPULL; #if defined(STM32H7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #elif defined(STM32F4) + #elif defined(STM32F4) || defined(STM32F7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; #else #error Unsupported processor @@ -105,7 +105,7 @@ void init_usb_hardware(void) { GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; #if defined(STM32H7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #elif defined(STM32F4) + #elif defined(STM32F4) || defined(STM32F7) GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; #else #error Unsupported processor @@ -128,7 +128,6 @@ void init_usb_hardware(void) { __HAL_RCC_USB2_OTG_FS_CLK_ENABLE(); #else /* Peripheral clock enable */ - __HAL_RCC_USB_OTG_FS_CLK_DISABLE(); __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); #endif diff --git a/ports/stm/system_stm32f7xx.c b/ports/stm/system_stm32f7xx.c new file mode 100644 index 0000000000..184fefb36c --- /dev/null +++ b/ports/stm/system_stm32f7xx.c @@ -0,0 +1,247 @@ +/** + ****************************************************************************** + * @file system_stm32f7xx.c + * @author MCD Application Team + * @brief CMSIS Cortex-M7 Device Peripheral Access Layer System Source File. + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32f7xx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2016 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32f7xx_system + * @{ + */ + +/** @addtogroup STM32F7xx_System_Private_Includes + * @{ + */ + +#include "stm32f7xx.h" + +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_Defines + * @{ + */ + +/************************* Miscellaneous Configuration ************************/ + +/*!< Uncomment the following line if you need to relocate your vector Table in + Internal SRAM. */ +/* #define VECT_TAB_SRAM */ +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. + This value must be a multiple of 0x200. */ +/******************************************************************************/ + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_Variables + * @{ + */ + + /* This variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock; then there + is no need to call the 2 first functions listed above, since SystemCoreClock + variable is updated automatically. + */ + uint32_t SystemCoreClock = 16000000; + const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F7xx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system + * Initialize the Embedded Flash Interface, the PLL and update the + * SystemFrequency variable. + * @param None + * @retval None + */ +void SystemInit(void) +{ + /* FPU settings ------------------------------------------------------------*/ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ +#endif + + /* Configure the Vector Table location add offset address ------------------*/ +#if !(BOARD_VTOR_DEFER) //only set VTOR if the bootloader hasn't already + #ifdef VECT_TAB_SRAM + SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ + #else + SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + #endif +#endif + +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * or HSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (*) HSI_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (**) HSE_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value + * 25 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; + + /* Get SYSCLK source -------------------------------------------------------*/ + tmp = RCC->CFGR & RCC_CFGR_SWS; + + switch (tmp) + { + case 0x00: /* HSI used as system clock source */ + SystemCoreClock = HSI_VALUE; + break; + case 0x04: /* HSE used as system clock source */ + SystemCoreClock = HSE_VALUE; + break; + case 0x08: /* PLL used as system clock source */ + + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N + SYSCLK = PLL_VCO / PLL_P + */ + pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; + pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; + + if (pllsource != 0) + { + /* HSE used as PLL clock source */ + pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + } + else + { + /* HSI used as PLL clock source */ + pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + } + + pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; + SystemCoreClock = pllvco/pllp; + break; + default: + SystemCoreClock = HSI_VALUE; + break; + } + /* Compute HCLK frequency --------------------------------------------------*/ + /* Get HCLK prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; + /* HCLK frequency */ + SystemCoreClock >>= tmp; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index 56baf8c765..b257a450c2 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -102,7 +102,7 @@ with open(sys.argv[1]) as csv_file: for i in range(len(todo)): ins = (todo[i][0]).lower() + '_' + (todo[i][1]).lower() + '_' # const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - print("const mcu_" + ins + "obj_t mcu_" + ins + "list[" + str(len(outlist[i])) + "] = {") + print("const mcu_periph_obj_t mcu_" + ins + "list[" + str(len(outlist[i])) + "] = {") for row in outlist[i]: print(" PERIPH(" + row[0] + ", " + str(row[1]) + ", &pin_" + row[2] + "),") print("};") diff --git a/ports/stm/tools/pins.csv b/ports/stm/tools/pins.csv new file mode 100644 index 0000000000..e447b76b05 --- /dev/null +++ b/ports/stm/tools/pins.csv @@ -0,0 +1,137 @@ +A0,PA3 +A1,PC0 +A2,PC3 +A3,PF3 +A4,PF5 +A5,PF10 +A6,PB1 +A7,PC2 +A8,PF4 +D0,PG9 +D1,PG14 +D2,PF15 +D3,PE13 +D4,PF14 +D5,PE11 +D6,PE9 +D7,PF13 +D8,PF12 +D9,PD15 +D10,PD14 +D11,PA7 +D12,PA6 +D13,PA5 +D14,PB9 +D15,PB8 +D16,PC6 +D17,PB15 +D18,PB13 +D19,PB12 +D20,PA15 +D21,PC7 +D22,PB5 +D23,PB3 +D24,PA4 +D25,PB4 +D26,PB6 +D27,PB2 +D28,PD13 +D29,PD12 +D30,PD11 +D31,PE2 +D32,PA0 +D33,PB0 +D34,PE0 +D35,PB11 +D36,PB10 +D37,PE15 +D38,PE14 +D39,PE12 +D40,PE10 +D41,PE7 +D42,PE8 +D43,PC8 +D44,PC9 +D45,PC10 +D46,PC11 +D47,PC12 +D48,PD2 +D49,PG2 +D50,PG3 +D51,PD7 +D52,PD6 +D53,PD5 +D54,PD4 +D55,PD3 +D56,PE2 +D57,PE4 +D58,PE5 +D59,PE6 +D60,PE3 +D61,PF8 +D62,PF7 +D63,PF9 +D64,PG1 +D65,PG0 +D66,PD1 +D67,PD0 +D68,PF0 +D69,PF1 +D70,PF2 +D71,PA7 +DAC1,PA4 +DAC2,PA5 +LED1,PB0 +LED2,PB7 +LED3,PB14 +SW,PC13 +SD_D0,PC8 +SD_D1,PC9 +SD_D2,PC10 +SD_D3,PC11 +SD_CMD,PD2 +SD_CK,PC12 +SD_SW,PG2 +OTG_FS_POWER,PG6 +OTG_FS_OVER_CURRENT,PG7 +USB_VBUS,PA9 +USB_ID,PA10 +USB_DM,PA11 +USB_DP,PA12 +UART2_TX,PD5 +UART2_RX,PD6 +UART2_RTS,PD4 +UART2_CTS,PD3 +VCP_TX,PD8 +VCP_RX,PD9 +UART3_TX,PD8 +UART3_RX,PD9 +UART5_TX,PB6 +UART5_RX,PB12 +UART6_TX,PC6 +UART6_RX,PC7 +UART7_TX,PF7 +UART7_RX,PF6 +UART8_TX,PE1 +UART8_RX,PE0 +SPI3_NSS,PA4 +SPI3_SCK,PB3 +SPI3_MISO,PB4 +SPI3_MOSI,PB5 +I2C1_SDA,PB9 +I2C1_SCL,PB8 +I2C2_SDA,PF0 +I2C2_SCL,PF1 +I2C4_SCL,PF14 +I2C4_SDA,PF15 +ETH_MDC,PC1 +ETH_MDIO,PA2 +ETH_RMII_REF_CLK,PA1 +ETH_RMII_CRS_DV,PA7 +ETH_RMII_RXD0,PC4 +ETH_RMII_RXD1,PC5 +ETH_RMII_TX_EN,PG11 +ETH_RMII_TXD0,PG13 +ETH_RMII_TXD1,PB13 +SWDIO,PA13 +SWDCLK,PA14 diff --git a/ports/stm/tools/stm32f767_af.csv b/ports/stm/tools/stm32f767_af.csv new file mode 100644 index 0000000000..86f10b6dc8 --- /dev/null +++ b/ports/stm/tools/stm32f767_af.csv @@ -0,0 +1,168 @@ +PortA,PA0,,TIM2_CH1/TIM2_ETR,TIM5_CH1,TIM8_ETR,,,,USART2_CTS,UART4_TX,,SAI2_SD_B,ETH_MII_CRS,,,,EVENTOUT,ADC123_IN0 +PortA,PA1,,TIM2_CH2,TIM5_CH2,,,,,USART2_RTS,UART4_RX,QUADSPI_BK1_IO3,SAI2_MCK_B,ETH_MII_RX_CLK/ETH_RMII_REF_CLK,,,LCD_R2,EVENTOUT,ADC123_IN1 +PortA,PA2,,TIM2_CH3,TIM5_CH3,TIM9_CH1,,,,USART2_TX,SAI2_SCK_B,,,ETH_MDIO,MDIOS_MDIO,,LCD_R1,EVENTOUT,ADC123_IN2 +PortA,PA3,,TIM2_CH4,TIM5_CH4,TIM9_CH2,,,,USART2_RX,,LCD_B2,OTG_HS_ULPI_D0,ETH_MII_COL,,,LCD_B5,EVENTOUT,ADC123_IN3 +PortA,PA4,,,,,,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,USART2_CK,SPI6_NSS,,,,OTG_HS_SOF,DCMI_HSYNC,LCD_VSYNC,EVENTOUT,ADC12_IN4 +PortA,PA5,,TIM2_CH1/TIM2_ETR,,TIM8_CH1N,,SPI1_SCK/I2S1_CK,,,SPI6_SCK,,OTG_HS_ULPI_CK,,,,LCD_R4,EVENTOUT,ADC12_IN5 +PortA,PA6,,TIM1_BKIN,TIM3_CH1,TIM8_BKIN,,SPI1_MISO,,,SPI6_MISO,TIM13_CH1,,,MDIOS_MDC,DCMI_PIXCLK,LCD_G2,EVENTOUT,ADC12_IN6 +PortA,PA7,,TIM1_CH1N,TIM3_CH2,TIM8_CH1N,,SPI1_MOSI/I2S1_SD,,,SPI6_MOSI,TIM14_CH1,,ETH_MII_RX_DV/ETH_RMII_CRS_DV,FMC_SDNWE,,,EVENTOUT,ADC12_IN7 +PortA,PA8,MCO1,TIM1_CH1,,TIM8_BKIN2,I2C3_SCL,,,USART1_CK,,,OTG_FS_SOF,CAN3_RX,UART7_RX,LCD_B3,LCD_R6,EVENTOUT, +PortA,PA9,,TIM1_CH2,,,I2C3_SMBA,SPI2_SCK/I2S2_CK,,USART1_TX,,,,,,DCMI_D0,LCD_R5,EVENTOUT, +PortA,PA10,,TIM1_CH3,,,,,,USART1_RX,,LCD_B4,OTG_FS_ID,,MDIOS_MDIO,DCMI_D1,LCD_B1,EVENTOUT, +PortA,PA11,,TIM1_CH4,,,,SPI2_NSS/I2S2_WS,UART4_RX,USART1_CTS,,CAN1_RX,OTG_FS_DM,,,,LCD_R4,EVENTOUT, +PortA,PA12,,TIM1_ETR,,,,SPI2_SCK/I2S2_CK,UART4_TX,USART1_RTS,SAI2_FS_B,CAN1_TX,OTG_FS_DP,,,,LCD_R5,EVENTOUT, +PortA,PA13,JTMS/SWDIO,,,,,,,,,,,,,,,EVENTOUT, +PortA,PA14,JTCK/SWCLK,,,,,,,,,,,,,,,EVENTOUT, +PortA,PA15,JTDI,TIM2_CH1/TIM2_ETR,,,HDMI_CEC,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,SPI6_NSS,UART4_RTS,,,CAN3_TX,UART7_TX,,,EVENTOUT, +PortB,PB0,,TIM1_CH2N,TIM3_CH3,TIM8_CH2N,,,DFSDM1_CKOUT,,UART4_CTS,LCD_R3,OTG_HS_ULPI_D1,ETH_MII_RXD2,,,LCD_G1,EVENTOUT,ADC12_IN8 +PortB,PB1,,TIM1_CH3N,TIM3_CH4,TIM8_CH3N,,,DFSDM1_DATAIN1,,,LCD_R6,OTG_HS_ULPI_D2,ETH_MII_RXD3,,,LCD_G0,EVENTOUT,ADC12_IN9 +PortB,PB2,,,,,,,SAI1_SD_A,SPI3_MOSI/I2S3_SD,,QUADSPI_CLK,DFSDM1_CKIN1,,,,,EVENTOUT, +PortB,PB3,JTDO/TRACESWO,TIM2_CH2,,,,SPI1_SCK/I2S1_CK,SPI3_SCK/I2S3_CK,,SPI6_SCK,,SDMMC2_D2,CAN3_RX,UART7_RX,,,EVENTOUT, +PortB,PB4,NJTRST,,TIM3_CH1,,,SPI1_MISO,SPI3_MISO,SPI2_NSS/I2S2_WS,SPI6_MISO,,SDMMC2_D3,CAN3_TX,UART7_TX,,,EVENTOUT, +PortB,PB5,,UART5_RX,TIM3_CH2,,I2C1_SMBA,SPI1_MOSI/I2S1_SD,SPI3_MOSI/I2S3_SD,,SPI6_MOSI,CAN2_RX,OTG_HS_ULPI_D7,ETH_PPS_OUT,FMC_SDCKE1,DCMI_D10,LCD_G7,EVENTOUT, +PortB,PB6,,UART5_TX,TIM4_CH1,HDMI_CEC,I2C1_SCL,,DFSDM1_DATAIN5,USART1_TX,,CAN2_TX,QUADSPI_BK1_NCS,I2C4_SCL,FMC_SDNE1,DCMI_D5,,EVENTOUT, +PortB,PB7,,,TIM4_CH2,,I2C1_SDA,,DFSDM1_CKIN5,USART1_RX,,,,I2C4_SDA,FMC_NL,DCMI_VSYNC,,EVENTOUT, +PortB,PB8,,I2C4_SCL,TIM4_CH3,TIM10_CH1,I2C1_SCL,,DFSDM1_CKIN7,UART5_RX,,CAN1_RX,SDMMC2_D4,ETH_MII_TXD3,SDMMC1_D4,DCMI_D6,LCD_B6,EVENTOUT, +PortB,PB9,,I2C4_SDA,TIM4_CH4,TIM11_CH1,I2C1_SDA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN7,UART5_TX,,CAN1_TX,SDMMC2_D5,I2C4_SMBA,SDMMC1_D5,DCMI_D7,LCD_B7,EVENTOUT, +PortB,PB10,,TIM2_CH3,,,I2C2_SCL,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN7,USART3_TX,,QUADSPI_BK1_NCS,OTG_HS_ULPI_D3,ETH_MII_RX_ER,,,LCD_G4,EVENTOUT, +PortB,PB11,,TIM2_CH4,,,I2C2_SDA,,DFSDM1_CKIN7,USART3_RX,,,OTG_HS_ULPI_D4,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DSI_TE,LCD_G5,EVENTOUT, +PortB,PB12,,TIM1_BKIN,,,I2C2_SMBA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN1,USART3_CK,UART5_RX,CAN2_RX,OTG_HS_ULPI_D5,ETH_MII_TXD0/ETH_RMII_TXD0,OTG_HS_ID,,,EVENTOUT, +PortB,PB13,,TIM1_CH1N,,,,SPI2_SCK/I2S2_CK,DFSDM1_CKIN1,USART3_CTS,UART5_TX,CAN2_TX,OTG_HS_ULPI_D6,ETH_MII_TXD1/ETH_RMII_TXD1,,,,EVENTOUT, +PortB,PB14,,TIM1_CH2N,,TIM8_CH2N,USART1_TX,SPI2_MISO,DFSDM1_DATAIN2,USART3_RTS,UART4_RTS,TIM12_CH1,SDMMC2_D0,,OTG_HS_DM,,,EVENTOUT, +PortB,PB15,RTC_REFIN,TIM1_CH3N,,TIM8_CH3N,USART1_RX,SPI2_MOSI/I2S2_SD,DFSDM1_CKIN2,,UART4_CTS,TIM12_CH2,SDMMC2_D1,,OTG_HS_DP,,,EVENTOUT, +PortC,PC0,,,,DFSDM1_CKIN0,,,DFSDM1_DATAIN4,,SAI2_FS_B,,OTG_HS_ULPI_STP,,FMC_SDNWE,,LCD_R5,EVENTOUT,ADC123_IN10 +PortC,PC1,TRACED0,,,DFSDM1_DATAIN0,,SPI2_MOSI/I2S2_SD,SAI1_SD_A,,,,DFSDM1_CKIN4,ETH_MDC,MDIOS_MDC,,,EVENTOUT,ADC123_IN11 +PortC,PC2,,,,DFSDM1_CKIN1,,SPI2_MISO,DFSDM1_CKOUT,,,,OTG_HS_ULPI_DIR,ETH_MII_TXD2,FMC_SDNE0,,,EVENTOUT,ADC123_IN12 +PortC,PC3,,,,DFSDM1_DATAIN1,,SPI2_MOSI/I2S2_SD,,,,,OTG_HS_ULPI_NXT,ETH_MII_TX_CLK,FMC_SDCKE0,,,EVENTOUT,ADC123_IN13 +PortC,PC4,,,,DFSDM1_CKIN2,,I2S1_MCK,,,SPDIFRX_IN2,,,ETH_MII_RXD0/ETH_RMII_RXD0,FMC_SDNE0,,,EVENTOUT,ADC12_IN14 +PortC,PC5,,,,DFSDM1_DATAIN2,,,,,SPDIFRX_IN3,,,ETH_MII_RXD1/ETH_RMII_RXD1,FMC_SDCKE0,,,EVENTOUT,ADC12_IN15 +PortC,PC6,,,TIM3_CH1,TIM8_CH1,,I2S2_MCK,,DFSDM1_CKIN3,USART6_TX,FMC_NWAIT,SDMMC2_D6,,SDMMC1_D6,DCMI_D0,LCD_HSYNC,EVENTOUT, +PortC,PC7,,,TIM3_CH2,TIM8_CH2,,,I2S3_MCK,DFSDM1_DATAIN3,USART6_RX,FMC_NE1,SDMMC2_D7,,SDMMC1_D7,DCMI_D1,LCD_G6,EVENTOUT, +PortC,PC8,TRACED1,,TIM3_CH3,TIM8_CH3,,,,UART5_RTS,USART6_CK,FMC_NE2/FMC_NCE,,,SDMMC1_D0,DCMI_D2,,EVENTOUT, +PortC,PC9,MCO2,,TIM3_CH4,TIM8_CH4,I2C3_SDA,I2S_CKIN,,UART5_CTS,,QUADSPI_BK1_IO0,LCD_G3,,SDMMC1_D1,DCMI_D3,LCD_B2,EVENTOUT, +PortC,PC10,,,,DFSDM1_CKIN5,,,SPI3_SCK/I2S3_CK,USART3_TX,UART4_TX,QUADSPI_BK1_IO1,,,SDMMC1_D2,DCMI_D8,LCD_R2,EVENTOUT, +PortC,PC11,,,,DFSDM1_DATAIN5,,,SPI3_MISO,USART3_RX,UART4_RX,QUADSPI_BK2_NCS,,,SDMMC1_D3,DCMI_D4,,EVENTOUT, +PortC,PC12,TRACED3,,,,,,SPI3_MOSI/I2S3_SD,USART3_CK,UART5_TX,,,,SDMMC1_CK,DCMI_D9,,EVENTOUT, +PortC,PC13,,,,,,,,,,,,,,,,EVENTOUT, +PortC,PC14,,,,,,,,,,,,,,,,EVENTOUT, +PortC,PC15,,,,,,,,,,,,,,,,EVENTOUT, +PortD,PD0,,,,DFSDM1_CKIN6,,,DFSDM1_DATAIN7,,UART4_RX,CAN1_RX,,,FMC_D2,,,EVENTOUT, +PortD,PD1,,,,DFSDM1_DATAIN6,,,DFSDM1_CKIN7,,UART4_TX,CAN1_TX,,,FMC_D3,,,EVENTOUT, +PortD,PD2,TRACED2,,TIM3_ETR,,,,,,UART5_RX,,,,SDMMC1_CMD,DCMI_D11,,EVENTOUT, +PortD,PD3,,,,DFSDM1_CKOUT,,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN0,USART2_CTS,,,,,FMC_CLK,DCMI_D5,LCD_G7,EVENTOUT, +PortD,PD4,,,,,,,DFSDM1_CKIN0,USART2_RTS,,,,,FMC_NOE,,,EVENTOUT, +PortD,PD5,,,,,,,,USART2_TX,,,,,FMC_NWE,,,EVENTOUT, +PortD,PD6,,,,DFSDM1_CKIN4,,SPI3_MOSI/I2S3_SD,SAI1_SD_A,USART2_RX,,,DFSDM1_DATAIN1,SDMMC2_CK,FMC_NWAIT,DCMI_D10,LCD_B2,EVENTOUT, +PortD,PD7,,,,DFSDM1_DATAIN4,,SPI1_MOSI/I2S1_SD,DFSDM1_CKIN1,USART2_CK,SPDIFRX_IN0,,,SDMMC2_CMD,FMC_NE1,,,EVENTOUT, +PortD,PD8,,,,DFSDM1_CKIN3,,,,USART3_TX,SPDIFRX_IN1,,,,FMC_D13,,,EVENTOUT, +PortD,PD9,,,,DFSDM1_DATAIN3,,,,USART3_RX,,,,,FMC_D14,,,EVENTOUT, +PortD,PD10,,,,DFSDM1_CKOUT,,,,USART3_CK,,,,,FMC_D15,,LCD_B3,EVENTOUT, +PortD,PD11,,,,,I2C4_SMBA,,,USART3_CTS,,QUADSPI_BK1_IO0,SAI2_SD_A,,FMC_A16/FMC_CLE,,,EVENTOUT, +PortD,PD12,,,TIM4_CH1,LPTIM1_IN1,I2C4_SCL,,,USART3_RTS,,QUADSPI_BK1_IO1,SAI2_FS_A,,FMC_A17/FMC_ALE,,,EVENTOUT, +PortD,PD13,,,TIM4_CH2,LPTIM1_OUT,I2C4_SDA,,,,,QUADSPI_BK1_IO3,SAI2_SCK_A,,FMC_A18,,,EVENTOUT, +PortD,PD14,,,TIM4_CH3,,,,,,UART8_CTS,,,,FMC_D0,,,EVENTOUT, +PortD,PD15,,,TIM4_CH4,,,,,,UART8_RTS,,,,FMC_D1,,,EVENTOUT, +PortE,PE0,,,TIM4_ETR,LPTIM1_ETR,,,,,UART8_RX,,SAI2_MCK_A,,FMC_NBL0,DCMI_D2,,EVENTOUT, +PortE,PE1,,,,LPTIM1_IN2,,,,,UART8_TX,,,,FMC_NBL1,DCMI_D3,,EVENTOUT, +PortE,PE2,TRACECLK,,,,,SPI4_SCK,SAI1_MCLK_A,,,QUADSPI_BK1_IO2,,ETH_MII_TXD3,FMC_A23,,,EVENTOUT, +PortE,PE3,TRACED0,,,,,,SAI1_SD_B,,,,,,FMC_A19,,,EVENTOUT, +PortE,PE4,TRACED1,,,,,SPI4_NSS,SAI1_FS_A,,,,DFSDM1_DATAIN3,,FMC_A20,DCMI_D4,LCD_B0,EVENTOUT, +PortE,PE5,TRACED2,,,TIM9_CH1,,SPI4_MISO,SAI1_SCK_A,,,,DFSDM1_CKIN3,,FMC_A21,DCMI_D6,LCD_G0,EVENTOUT, +PortE,PE6,TRACED3,TIM1_BKIN2,,TIM9_CH2,,SPI4_MOSI,SAI1_SD_A,,,,SAI2_MCK_B,,FMC_A22,DCMI_D7,LCD_G1,EVENTOUT, +PortE,PE7,,TIM1_ETR,,,,,DFSDM1_DATAIN2,,UART7_RX,,QUADSPI_BK2_IO0,,FMC_D4,,,EVENTOUT, +PortE,PE8,,TIM1_CH1N,,,,,DFSDM1_CKIN2,,UART7_TX,,QUADSPI_BK2_IO1,,FMC_D5,,,EVENTOUT, +PortE,PE9,,TIM1_CH1,,,,,DFSDM1_CKOUT,,UART7_RTS,,QUADSPI_BK2_IO2,,FMC_D6,,,EVENTOUT, +PortE,PE10,,TIM1_CH2N,,,,,DFSDM1_DATAIN4,,UART7_CTS,,QUADSPI_BK2_IO3,,FMC_D7,,,EVENTOUT, +PortE,PE11,,TIM1_CH2,,,,SPI4_NSS,DFSDM1_CKIN4,,,,SAI2_SD_B,,FMC_D8,,LCD_G3,EVENTOUT, +PortE,PE12,,TIM1_CH3N,,,,SPI4_SCK,DFSDM1_DATAIN5,,,,SAI2_SCK_B,,FMC_D9,,LCD_B4,EVENTOUT, +PortE,PE13,,TIM1_CH3,,,,SPI4_MISO,DFSDM1_CKIN5,,,,SAI2_FS_B,,FMC_D10,,LCD_DE,EVENTOUT, +PortE,PE14,,TIM1_CH4,,,,SPI4_MOSI,,,,,SAI2_MCK_B,,FMC_D11,,LCD_CLK,EVENTOUT, +PortE,PE15,,TIM1_BKIN,,,,,,,,,,,FMC_D12,,LCD_R7,EVENTOUT, +PortF,PF0,,,,,I2C2_SDA,,,,,,,,FMC_A0,,,EVENTOUT, +PortF,PF1,,,,,I2C2_SCL,,,,,,,,FMC_A1,,,EVENTOUT, +PortF,PF2,,,,,I2C2_SMBA,,,,,,,,FMC_A2,,,EVENTOUT, +PortF,PF3,,,,,,,,,,,,,FMC_A3,,,EVENTOUT,ADC3_IN9 +PortF,PF4,,,,,,,,,,,,,FMC_A4,,,EVENTOUT,ADC3_IN14 +PortF,PF5,,,,,,,,,,,,,FMC_A5,,,EVENTOUT,ADC3_IN15 +PortF,PF6,,,,TIM10_CH1,,SPI5_NSS,SAI1_SD_B,,UART7_RX,QUADSPI_BK1_IO3,,,,,,EVENTOUT,ADC3_IN4 +PortF,PF7,,,,TIM11_CH1,,SPI5_SCK,SAI1_MCLK_B,,UART7_TX,QUADSPI_BK1_IO2,,,,,,EVENTOUT,ADC3_IN5 +PortF,PF8,,,,,,SPI5_MISO,SAI1_SCK_B,,UART7_RTS,TIM13_CH1,QUADSPI_BK1_IO0,,,,,EVENTOUT,ADC3_IN6 +PortF,PF9,,,,,,SPI5_MOSI,SAI1_FS_B,,UART7_CTS,TIM14_CH1,QUADSPI_BK1_IO1,,,,,EVENTOUT,ADC3_IN7 +PortF,PF10,,,,,,,,,,QUADSPI_CLK,,,,DCMI_D11,LCD_DE,EVENTOUT,ADC3_IN8 +PortF,PF11,,,,,,SPI5_MOSI,,,,,SAI2_SD_B,,FMC_SDNRAS,DCMI_D12,,EVENTOUT, +PortF,PF12,,,,,,,,,,,,,FMC_A6,,,EVENTOUT, +PortF,PF13,,,,,I2C4_SMBA,,DFSDM1_DATAIN6,,,,,,FMC_A7,,,EVENTOUT, +PortF,PF14,,,,,I2C4_SCL,,DFSDM1_CKIN6,,,,,,FMC_A8,,,EVENTOUT, +PortF,PF15,,,,,I2C4_SDA,,,,,,,,FMC_A9,,,EVENTOUT, +PortG,PG0,,,,,,,,,,,,,FMC_A10,,,EVENTOUT, +PortG,PG1,,,,,,,,,,,,,FMC_A11,,,EVENTOUT, +PortG,PG2,,,,,,,,,,,,,FMC_A12,,,EVENTOUT, +PortG,PG3,,,,,,,,,,,,,FMC_A13,,,EVENTOUT, +PortG,PG4,,,,,,,,,,,,,FMC_A14/FMC_BA0,,,EVENTOUT, +PortG,PG5,,,,,,,,,,,,,FMC_A15/FMC_BA1,,,EVENTOUT, +PortG,PG6,,,,,,,,,,,,,FMC_NE3,DCMI_D12,LCD_R7,EVENTOUT, +PortG,PG7,,,,,,,SAI1_MCLK_A,,USART6_CK,,,,FMC_INT,DCMI_D13,LCD_CLK,EVENTOUT, +PortG,PG8,,,,,,SPI6_NSS,,SPDIFRX_IN2,USART6_RTS,,,ETH_PPS_OUT,FMC_SDCLK,,LCD_G7,EVENTOUT, +PortG,PG9,,,,,,SPI1_MISO,,SPDIFRX_IN3,USART6_RX,QUADSPI_BK2_IO2,SAI2_FS_B,SDMMC2_D0,FMC_NE2/FMC_NCE,DCMI_VSYNC,,EVENTOUT, +PortG,PG10,,,,,,SPI1_NSS/I2S1_WS,,,,LCD_G3,SAI2_SD_B,SDMMC2_D1,FMC_NE3,DCMI_D2,LCD_B2,EVENTOUT, +PortG,PG11,,,,,,SPI1_SCK/I2S1_CK,,SPDIFRX_IN0,,,SDMMC2_D2,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DCMI_D3,LCD_B3,EVENTOUT, +PortG,PG12,,,,LPTIM1_IN1,,SPI6_MISO,,SPDIFRX_IN1,USART6_RTS,LCD_B4,,SDMMC2_D3,FMC_NE4,,LCD_B1,EVENTOUT, +PortG,PG13,TRACED0,,,LPTIM1_OUT,,SPI6_SCK,,,USART6_CTS,,,ETH_MII_TXD0/ETH_RMII_TXD0,FMC_A24,,LCD_R0,EVENTOUT, +PortG,PG14,TRACED1,,,LPTIM1_ETR,,SPI6_MOSI,,,USART6_TX,QUADSPI_BK2_IO3,,ETH_MII_TXD1/ETH_RMII_TXD1,FMC_A25,,LCD_B0,EVENTOUT, +PortG,PG15,,,,,,,,,USART6_CTS,,,,FMC_SDNCAS,DCMI_D13,,EVENTOUT, +PortH,PH0,,,,,,,,,,,,,,,,EVENTOUT, +PortH,PH1,,,,,,,,,,,,,,,,EVENTOUT, +PortH,PH2,,,,LPTIM1_IN2,,,,,,QUADSPI_BK2_IO0,SAI2_SCK_B,ETH_MII_CRS,FMC_SDCKE0,,LCD_R0,EVENTOUT, +PortH,PH3,,,,,,,,,,QUADSPI_BK2_IO1,SAI2_MCK_B,ETH_MII_COL,FMC_SDNE0,,LCD_R1,EVENTOUT, +PortH,PH4,,,,,I2C2_SCL,,,,,LCD_G5,OTG_HS_ULPI_NXT,,,,LCD_G4,EVENTOUT, +PortH,PH5,,,,,I2C2_SDA,SPI5_NSS,,,,,,,FMC_SDNWE,,,EVENTOUT, +PortH,PH6,,,,,I2C2_SMBA,SPI5_SCK,,,,TIM12_CH1,,ETH_MII_RXD2,FMC_SDNE1,DCMI_D8,,EVENTOUT, +PortH,PH7,,,,,I2C3_SCL,SPI5_MISO,,,,,,ETH_MII_RXD3,FMC_SDCKE1,DCMI_D9,,EVENTOUT, +PortH,PH8,,,,,I2C3_SDA,,,,,,,,FMC_D16,DCMI_HSYNC,LCD_R2,EVENTOUT, +PortH,PH9,,,,,I2C3_SMBA,,,,,TIM12_CH2,,,FMC_D17,DCMI_D0,LCD_R3,EVENTOUT, +PortH,PH10,,,TIM5_CH1,,I2C4_SMBA,,,,,,,,FMC_D18,DCMI_D1,LCD_R4,EVENTOUT, +PortH,PH11,,,TIM5_CH2,,I2C4_SCL,,,,,,,,FMC_D19,DCMI_D2,LCD_R5,EVENTOUT, +PortH,PH12,,,TIM5_CH3,,I2C4_SDA,,,,,,,,FMC_D20,DCMI_D3,LCD_R6,EVENTOUT, +PortH,PH13,,,,TIM8_CH1N,,,,,UART4_TX,CAN1_TX,,,FMC_D21,,LCD_G2,EVENTOUT, +PortH,PH14,,,,TIM8_CH2N,,,,,UART4_RX,CAN1_RX,,,FMC_D22,DCMI_D4,LCD_G3,EVENTOUT, +PortH,PH15,,,,TIM8_CH3N,,,,,,,,,FMC_D23,DCMI_D11,LCD_G4,EVENTOUT, +PortI,PI0,,,TIM5_CH4,,,SPI2_NSS/I2S2_WS,,,,,,,FMC_D24,DCMI_D13,LCD_G5,EVENTOUT, +PortI,PI1,,,,TIM8_BKIN2,,SPI2_SCK/I2S2_CK,,,,,,,FMC_D25,DCMI_D8,LCD_G6,EVENTOUT, +PortI,PI2,,,,TIM8_CH4,,SPI2_MISO,,,,,,,FMC_D26,DCMI_D9,LCD_G7,EVENTOUT, +PortI,PI3,,,,TIM8_ETR,,SPI2_MOSI/I2S2_SD,,,,,,,FMC_D27,DCMI_D10,,EVENTOUT, +PortI,PI4,,,,TIM8_BKIN,,,,,,,SAI2_MCK_A,,FMC_NBL2,DCMI_D5,LCD_B4,EVENTOUT, +PortI,PI5,,,,TIM8_CH1,,,,,,,SAI2_SCK_A,,FMC_NBL3,DCMI_VSYNC,LCD_B5,EVENTOUT, +PortI,PI6,,,,TIM8_CH2,,,,,,,SAI2_SD_A,,FMC_D28,DCMI_D6,LCD_B6,EVENTOUT, +PortI,PI7,,,,TIM8_CH3,,,,,,,SAI2_FS_A,,FMC_D29,DCMI_D7,LCD_B7,EVENTOUT, +PortI,PI8,,,,,,,,,,,,,,,,EVENTOUT, +PortI,PI9,,,,,,,,,UART4_RX,CAN1_RX,,,FMC_D30,,LCD_VSYNC,EVENTOUT, +PortI,PI10,,,,,,,,,,,,ETH_MII_RX_ER,FMC_D31,,LCD_HSYNC,EVENTOUT, +PortI,PI11,,,,,,,,,,LCD_G6,OTG_HS_ULPI_DIR,,,,,EVENTOUT, +PortI,PI12,,,,,,,,,,,,,,,LCD_HSYNC,EVENTOUT, +PortI,PI13,,,,,,,,,,,,,,,LCD_VSYNC,EVENTOUT, +PortI,PI14,,,,,,,,,,,,,,,LCD_CLK,EVENTOUT, +PortI,PI15,,,,,,,,,,LCD_G2,,,,,LCD_R0,EVENTOUT, +PortJ,PJ0,,,,,,,,,,LCD_R7,,,,,LCD_R1,EVENTOUT, +PortJ,PJ1,,,,,,,,,,,,,,,LCD_R2,EVENTOUT, +PortJ,PJ2,,,,,,,,,,,,,,DSI_TE,LCD_R3,EVENTOUT, +PortJ,PJ3,,,,,,,,,,,,,,,LCD_R4,EVENTOUT, +PortJ,PJ4,,,,,,,,,,,,,,,LCD_R5,EVENTOUT, +PortJ,PJ5,,,,,,,,,,,,,,,LCD_R6,EVENTOUT, +PortJ,PJ6,,,,,,,,,,,,,,,LCD_R7,EVENTOUT, +PortJ,PJ7,,,,,,,,,,,,,,,LCD_G0,EVENTOUT, +PortJ,PJ8,,,,,,,,,,,,,,,LCD_G1,EVENTOUT, +PortJ,PJ9,,,,,,,,,,,,,,,LCD_G2,EVENTOUT, +PortJ,PJ10,,,,,,,,,,,,,,,LCD_G3,EVENTOUT, +PortJ,PJ11,,,,,,,,,,,,,,,LCD_G4,EVENTOUT, +PortJ,PJ12,,,,,,,,,,LCD_G3,,,,,LCD_B0,EVENTOUT, +PortJ,PJ13,,,,,,,,,,LCD_G4,,,,,LCD_B1,EVENTOUT, +PortJ,PJ14,,,,,,,,,,,,,,,LCD_B2,EVENTOUT, +PortJ,PJ15,,,,,,,,,,,,,,,LCD_B3,EVENTOUT, +PortK,PK0,,,,,,,,,,,,,,,LCD_G5,EVENTOUT, +PortK,PK1,,,,,,,,,,,,,,,LCD_G6,EVENTOUT, +PortK,PK2,,,,,,,,,,,,,,,LCD_G7,EVENTOUT, +PortK,PK3,,,,,,,,,,,,,,,LCD_B4,EVENTOUT, +PortK,PK4,,,,,,,,,,,,,,,LCD_B5,EVENTOUT, +PortK,PK5,,,,,,,,,,,,,,,LCD_B6,EVENTOUT, +PortK,PK6,,,,,,,,,,,,,,,LCD_B7,EVENTOUT, +PortK,PK7,,,,,,,,,,,,,,,LCD_DE,EVENTOUT, From 46af4bdd0e4028dcc4be4cd74f434e8ad199db50 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Apr 2020 17:35:52 -0700 Subject: [PATCH 170/919] Fix SAMD21 PulseIn --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index d51a674171..4ddee4933c 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -48,7 +48,7 @@ static uint8_t refcount = 0; static uint8_t pulsein_tc_index = 0xff; -static uint32_t overflow_count = 0; +volatile static uint32_t overflow_count = 0; void pulsein_timer_interrupt_handler(uint8_t index) { if (index != pulsein_tc_index) return; @@ -91,7 +91,13 @@ void pulsein_interrupt_handler(uint8_t channel) { self->first_edge = false; pulsein_set_config(self, false); } else { + // Sometimes we beat the overflow interrupt so just fudge overflow in + // that case. + if (current_count < self->last_count && current_overflow == self->last_overflow) { + current_overflow += 1; + } uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; + // The SAMD21 clock is 48mhz. We prescale it to 3mhz so // 3 here. #ifdef SAMD21 total_diff /= 3; #endif @@ -133,8 +139,6 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, self->start = 0; self->len = 0; self->first_edge = true; - self->last_overflow = 0; - self->last_count = 0; self->errored_too_fast = false; if (refcount == 0) { @@ -178,11 +182,20 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, #endif tc_set_enable(tc, true); + + // Clear our interrupt in case it was set earlier + tc->COUNT16.INTFLAG.reg = TC_INTFLAG_OVF; + tc->COUNT16.INTENSET.reg = TC_INTENSET_OVF; + tc_enable_interrupts(pulsein_tc_index); tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_RETRIGGER; + //mp_printf(&mp_plat_print, "timer started\n"); + overflow_count = 0; } refcount++; + self->last_overflow = overflow_count; + self->last_count = 0; set_eic_channel_data(pin->extint_channel, (void*) self); From c248730bd1c837fe682232bf096e7260c4d5be3c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 2 Apr 2020 17:36:09 -0700 Subject: [PATCH 171/919] Clean up --- py/circuitpy_defns.mk | 4 ++-- supervisor/shared/tick.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 342ea4da45..42289c96c6 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -300,7 +300,7 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ microcontroller/RunMode.c \ math/__init__.c \ - _eve/__init__.c \ + _eve/__init__.c \ ) SRC_BINDINGS_ENUMS += \ @@ -364,7 +364,7 @@ SRC_SHARED_MODULE_ALL = \ ustack/__init__.c \ _pew/__init__.c \ _pew/PewPew.c \ - _eve/__init__.c + _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index de56b64f55..516dff7470 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -110,7 +110,6 @@ void mp_hal_delay_ms(mp_uint_t delay) { } // Sleep until an interrupt happens. port_sleep_until_interrupt(); - // asm("bkpt"); duration = (port_get_raw_ticks(NULL) - start_tick); port_interrupt_after_ticks(duration); } From 9761672d42c489af215a8873ddfa71b62434623c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 2 Apr 2020 16:15:12 -0400 Subject: [PATCH 172/919] Linker file restructure, TCM and MPU additions --- ports/stm/Makefile | 17 +- ports/stm/boards/STM32F401xd_fs.ld | 83 +------- ports/stm/boards/STM32F401xe_boot.ld | 82 +------- ports/stm/boards/STM32F401xe_fs.ld | 81 -------- ports/stm/boards/STM32F405_boot.ld | 80 -------- ports/stm/boards/STM32F405_default.ld | 82 +------- ports/stm/boards/STM32F405_fs.ld | 82 +------- ports/stm/boards/STM32F407_fs.ld | 82 +------- ports/stm/boards/STM32F411_fs.ld | 27 +++ ports/stm/boards/STM32F411_nvm.ld | 27 +++ ports/stm/boards/STM32F412_fs.ld | 27 +++ ports/stm/boards/STM32F767ZITx_FLASH.ld | 189 ------------------ ports/stm/boards/STM32F767_fs.ld | 82 +------- ports/stm/boards/STM32H743_fs.ld | 179 +---------------- ...M32F412ZGTx_FLASH.ld => common_default.ld} | 48 ++--- .../{STM32F411VETx_FLASH.ld => common_nvm.ld} | 56 +++--- ...M32F411VETx_nvm_FLASH.ld => common_tcm.ld} | 105 ++++++---- .../stm/boards/espruino_pico/mpconfigboard.mk | 1 + .../stm/boards/espruino_wifi/mpconfigboard.mk | 3 +- .../mpconfigboard.mk | 1 + .../stm/boards/meowbit_v121/mpconfigboard.mk | 1 + .../stm/boards/nucleo_f767zi/mpconfigboard.mk | 1 + .../boards/nucleo_h743zi_2/mpconfigboard.mk | 1 + ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 3 +- ports/stm/boards/pyboard_v11/mpconfigboard.mk | 1 + .../stm32f411ce_blackpill/mpconfigboard.mk | 3 +- .../stm32f411ve_discovery/mpconfigboard.mk | 3 +- .../stm32f412zg_discovery/mpconfigboard.mk | 3 +- .../boards/stm32f4_discovery/mpconfigboard.mk | 1 + ports/stm/boards/thunderpack/mpconfigboard.mk | 11 +- ports/stm/mpconfigport.h | 7 +- ports/stm/packages/LQFP100_f4.c | 2 +- ports/stm/packages/LQFP64.c | 2 +- ports/stm/supervisor/port.c | 168 +++++++++++++++- supervisor/linker.h | 2 +- supervisor/shared/stack.c | 2 +- 36 files changed, 409 insertions(+), 1136 deletions(-) create mode 100644 ports/stm/boards/STM32F411_fs.ld create mode 100644 ports/stm/boards/STM32F411_nvm.ld create mode 100644 ports/stm/boards/STM32F412_fs.ld delete mode 100644 ports/stm/boards/STM32F767ZITx_FLASH.ld rename ports/stm/boards/{STM32F412ZGTx_FLASH.ld => common_default.ld} (68%) rename ports/stm/boards/{STM32F411VETx_FLASH.ld => common_nvm.ld} (69%) rename ports/stm/boards/{STM32F411VETx_nvm_FLASH.ld => common_tcm.ld} (62%) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 9b90079381..ec15e4f7f6 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -93,7 +93,8 @@ endif # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Werror -Wall -std=gnu11 $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) +# Removed -nostdlib since it conflicts with stm32 startup files # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs @@ -107,6 +108,7 @@ MCU_FLAGS_F7 = -mcpu=cortex-m7 MCU_FLAGS_H7 = -mcpu=cortex-m7 CFLAGS += $(MCU_FLAGS_$(MCU_SERIES)) +# Select HAL file for distribution via mpconfigport CFLAGS += -DSTM32_HAL_H='' # Floating point settings @@ -132,7 +134,7 @@ ifndef BOOTLOADER_OFFSET BOOTLOADER_OFFSET := 0x8000000 endif -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb $(MCU_FLAGS_$(MCU_SERIES)) @@ -143,7 +145,13 @@ LIBS += -lm endif # TinyUSB defines -CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32$(MCU_SERIES) -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 +CFLAGS += \ + -DCFG_TUSB_MCU=OPT_MCU_STM32$(MCU_SERIES) \ + -DCFG_TUD_CDC_RX_BUFSIZE=1024 \ + -DCFG_TUD_CDC_TX_BUFSIZE=1024 \ + -DCFG_TUD_MSC_BUFSIZE=4096 \ + -DCFG_TUD_MIDI_RX_BUFSIZE=128 \ + -DCFG_TUD_MIDI_TX_BUFSIZE=128 SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ hal_adc.c \ @@ -218,7 +226,7 @@ endif SRC_S = \ supervisor/cpu.s \ - boards/startup_$(MCU_VARIANT_LOWER).s + st_driver/CMSIS/Device/ST/STM32$(MCU_SERIES)xx/Source/Templates/gcc/startup_$(MCU_VARIANT_LOWER).s SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ @@ -241,6 +249,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif +#OBJ += $(addprefix $(BUILD)/, $(SRC_O)) OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld index c42dfcca8c..826e1d4043 100644 --- a/ports/stm/boards/STM32F401xd_fs.ld +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F401 with bootloader (such as the Meowbit) + GNU linker script for STM32F401 with filesystem */ /* Specify the memory areas */ @@ -24,84 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 125d785fc2..17dac2f1a6 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F401 with bootloader (such as the Meowbit) + GNU linker script for STM32F401 with bootloader (such as the Meowbit). No internal fs. */ /* Specify the memory areas */ @@ -24,83 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld index fd30e16228..f0136943ad 100644 --- a/ports/stm/boards/STM32F401xe_fs.ld +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -24,84 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 64da3b6520..7e611be9d8 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -1,6 +1,5 @@ /* GNU linker script for STM32F405 with bootloader - Based on Micropython */ /* Specify the memory areas */ @@ -26,82 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index c2b8c843ee..6b497356dd 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F405 via Micropython + GNU linker script for STM32F405, no filesystem */ /* Specify the memory areas */ @@ -25,83 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index 7f7c917846..72ee49633c 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F405 via Micropython + GNU linker script for STM32F405 with filesystem */ /* Specify the memory areas */ @@ -26,83 +26,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index 7f7c917846..d08cb8972c 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F405 via Micropython + GNU linker script for STM32F407 with filesystem */ /* Specify the memory areas */ @@ -26,83 +26,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld new file mode 100644 index 0000000000..28667214e0 --- /dev/null +++ b/ports/stm/boards/STM32F411_fs.ld @@ -0,0 +1,27 @@ +/* + GNU linker script for STM32F411 with filesystem +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld new file mode 100644 index 0000000000..bb37c081b3 --- /dev/null +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -0,0 +1,27 @@ +/* + GNU linker script for STM32F411 with nvm +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define the top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld new file mode 100644 index 0000000000..5985b209e4 --- /dev/null +++ b/ports/stm/boards/STM32F412_fs.ld @@ -0,0 +1,27 @@ +/* + GNU linker script for STM32F412 with filesystem, tcm +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + diff --git a/ports/stm/boards/STM32F767ZITx_FLASH.ld b/ports/stm/boards/STM32F767ZITx_FLASH.ld deleted file mode 100644 index 78a794402d..0000000000 --- a/ports/stm/boards/STM32F767ZITx_FLASH.ld +++ /dev/null @@ -1,189 +0,0 @@ -/* -****************************************************************************** -** - -** File : LinkerScript.ld -** -** Author : Auto-generated by System Workbench for STM32 -** -** Abstract : Linker script for STM32F767ZITx series -** 2048Kbytes FLASH and 512Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2019 STMicroelectronics

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of STMicroelectronics nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20080000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index f0fb2d323d..40f7d740ae 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F405 via Micropython + GNU linker script for STM32F767 with filesystem */ /* Specify the memory areas */ @@ -25,83 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index fdeab9a3d0..28cc12b4aa 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -1,59 +1,11 @@ /* -****************************************************************************** -** - -** File : LinkerScript.ld -** -** Author : Auto-generated by System Workbench for STM32 -** -** Abstract : Linker script for STM32H743ZITx series -** 2048Kbytes FLASH and 1056Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2019 STMicroelectronics

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of STMicroelectronics nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** + GNU linker script for STM32H743 with filesystem, tcm */ /* Entry Point */ ENTRY(Reset_Handler) -/* Highest address of the user mode stack */ -_estack = 0x20020000; /* end of RAM */ +_ld_default_stack_size = 24K; /* Specify the memory areas */ MEMORY @@ -79,134 +31,9 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); -ENTRY(Reset_Handler) - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - /* This first flash block is 16K annd the isr vectors only take up - about 400 bytes. Micropython pads this with files, but this didn't - work with the size of Circuitpython's ff object. */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text*) /* .text* sections (code) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - . = . + _minimum_heap_size; - . = ALIGN(4); - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - /* itcm stuff doesn't work, results in arcane hard crashes - .itcm : - { - . = ALIGN(4); - - *(.itcm.*) - - . = ALIGN(4); - } > ITCM AT> FLASH_TEXT - _ld_itcm_destination = ADDR(.itcm); - _ld_itcm_flash_copy = LOADADDR(.itcm); - _ld_itcm_size = SIZEOF(.itcm); - - .dtcm_data : - { - . = ALIGN(4); - - *(.dtcm_data.*) - - . = ALIGN(4); - } > DTCM AT> FLASH_TEXT - _ld_dtcm_data_destination = ADDR(.dtcm_data); - _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); - _ld_dtcm_data_size = SIZEOF(.dtcm_data); - - .dtcm_bss : - { - . = ALIGN(4); - - *(.dtcm_bss.*) - - . = ALIGN(4); - } > DTCM AT> DTCM - _ld_dtcm_bss_start = ADDR(.dtcm_bss); - _ld_dtcm_bss_size = SIZEOF(.dtcm_bss); - - .stack : - { - . = ALIGN(8); - _ld_stack_bottom = .; - . += _ld_default_stack_size; - } > DTCM - _ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM); - */ - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/STM32F412ZGTx_FLASH.ld b/ports/stm/boards/common_default.ld similarity index 68% rename from ports/stm/boards/STM32F412ZGTx_FLASH.ld rename to ports/stm/boards/common_default.ld index e0586709e6..41fe4dfb67 100644 --- a/ports/stm/boards/STM32F412ZGTx_FLASH.ld +++ b/ports/stm/boards/common_default.ld @@ -1,34 +1,20 @@ -/* - GNU linker script for STM32F412 +/* Memory layout for default case. + + FLASH_ISR .isr_vector + FLASH_TEXT .text + FLASH_TEXT .data + FLASH_FS // ignored for fs use + + RAM .data + RAM .bss + RAM .heap + RAM .stack */ -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_start = _ebss; /* heap starts just after statically allocated memory */ -_heap_end = 0x20020000; /* tunable */ - ENTRY(Reset_Handler) +_ld_default_stack_size = _minimum_stack_size; + /* define output sections */ SECTIONS { @@ -51,6 +37,8 @@ SECTIONS . = ALIGN(4); *(.text*) /* .text* sections (code) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + /* *(.glue_7) */ /* glue arm to thumb code */ + /* *(.glue_7t) */ /* glue thumb to arm code */ . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ @@ -89,17 +77,23 @@ SECTIONS .heap : { . = ALIGN(4); + _ld_heap_start = .; . = . + _minimum_heap_size; . = ALIGN(4); } >RAM + _ld_heap_end = ORIGIN(RAM) + LENGTH(RAM); /* this just checks there is enough RAM for the stack */ .stack : { . = ALIGN(4); + _ld_stack_bottom = .; . = . + _minimum_stack_size; . = ALIGN(4); } >RAM + _ld_stack_top = ORIGIN(RAM) + LENGTH(RAM); + .ARM.attributes 0 : { *(.ARM.attributes) } } + diff --git a/ports/stm/boards/STM32F411VETx_FLASH.ld b/ports/stm/boards/common_nvm.ld similarity index 69% rename from ports/stm/boards/STM32F411VETx_FLASH.ld rename to ports/stm/boards/common_nvm.ld index ac1ba32408..cee71d1944 100644 --- a/ports/stm/boards/STM32F411VETx_FLASH.ld +++ b/ports/stm/boards/common_nvm.ld @@ -1,34 +1,22 @@ -/* - GNU linker script for STM32F411 via Micropython +/* Memory layout for case with dedicated nvm sector (inefficient) +TODO: rewrite nvm module, remove this file entirely + + FLASH_ISR .isr_vector + FLASH_TEXT .text + FLASH_TEXT .data + FLASH_NVM .nvm_data + FLASH_FS // ignored for fs use + + RAM .data + RAM .bss + RAM .heap + RAM .stack */ -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define tho top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_start = _ebss; /* heap starts just after statically allocated memory */ -_heap_end = 0x2001c000; /* tunable */ - ENTRY(Reset_Handler) +_ld_default_stack_size = _minimum_stack_size; + /* define output sections */ SECTIONS { @@ -45,6 +33,14 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR + /* Non-volitile memory */ + .nvm_data : + { + . = ALIGN(4); + KEEP(*(.nvm_data)) + . = ALIGN(4); + } >FLASH_NVM + /* The program code and other data goes into FLASH */ .text : { @@ -91,19 +87,23 @@ SECTIONS .heap : { . = ALIGN(4); + _ld_heap_start = .; . = . + _minimum_heap_size; . = ALIGN(4); } >RAM + _ld_heap_end = ORIGIN(RAM) + LENGTH(RAM); /* this just checks there is enough RAM for the stack */ .stack : { . = ALIGN(4); + _ld_stack_bottom = .; . = . + _minimum_stack_size; . = ALIGN(4); } >RAM + _ld_stack_top = ORIGIN(RAM) + LENGTH(RAM); + .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/stm/boards/STM32F411VETx_nvm_FLASH.ld b/ports/stm/boards/common_tcm.ld similarity index 62% rename from ports/stm/boards/STM32F411VETx_nvm_FLASH.ld rename to ports/stm/boards/common_tcm.ld index 8382cb7818..0aab4c7f9e 100644 --- a/ports/stm/boards/STM32F411VETx_nvm_FLASH.ld +++ b/ports/stm/boards/common_tcm.ld @@ -1,33 +1,20 @@ -/* - GNU linker script for STM32F411 via Micropython +/* Memory layout for cases with itcm and dtcm + + FLASH_ISR .isr_vector + FLASH_TEXT .text + FLASH_TEXT .data + FLASH_FS // ignored for fs use + + RAM .data + RAM .bss + RAM .heap + + ITCM .itcm + DTCM .dtcm_data + DTCM .dtcm_bss + DTCM .stack */ -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 16K; - -/* Define the top end of the stack. The stack is full descending so begins just - above last byte of RAM. Note that EABI requires the stack to be 8-byte - aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_start = _ebss; /* heap starts just after statically allocated memory */ -_heap_end = 0x2001c000; /* tunable */ - ENTRY(Reset_Handler) /* define output sections */ @@ -46,14 +33,6 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR - /* Non-volitile memory */ - .nvm_data : - { - . = ALIGN(4); - KEEP(*(.nvm_data)) - . = ALIGN(4); - } >FLASH_NVM - /* The program code and other data goes into FLASH */ .text : { @@ -83,6 +62,9 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM AT> FLASH_TEXT + _ld_d1_ram_data_destination = ADDR(.data); + _ld_d1_ram_data_flash_copy = LOADADDR(.data); + _ld_d1_ram_data_size = SIZEOF(.data); /* Uninitialized data section */ .bss : @@ -95,6 +77,10 @@ SECTIONS . = ALIGN(4); _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ } >RAM + _ld_d1_ram_bss_start = ADDR(.bss); + _ld_d1_ram_bss_size = SIZEOF(.bss); + _ld_heap_start = _ld_d1_ram_bss_start + _ld_d1_ram_bss_size; + _ld_heap_end = ORIGIN(RAM) + LENGTH(RAM); /* this is to define the start of the heap, and make sure we have a minimum size */ .heap : @@ -104,15 +90,50 @@ SECTIONS . = ALIGN(4); } >RAM - /* this just checks there is enough RAM for the stack */ - .stack : + /* itcm stuff */ + .itcm : { . = ALIGN(4); - . = . + _minimum_stack_size; + + *(.itcm.*) + . = ALIGN(4); - } >RAM + } > ITCM AT> FLASH_TEXT + _ld_itcm_destination = ADDR(.itcm); + _ld_itcm_flash_copy = LOADADDR(.itcm); + _ld_itcm_size = SIZEOF(.itcm); + + .dtcm_data : + { + . = ALIGN(4); + + *(.dtcm_data.*) + + . = ALIGN(4); + } > DTCM AT> FLASH_TEXT + _ld_dtcm_data_destination = ADDR(.dtcm_data); + _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); + _ld_dtcm_data_size = SIZEOF(.dtcm_data); + + .dtcm_bss : + { + . = ALIGN(4); + + *(.dtcm_bss.*) + + . = ALIGN(4); + } > DTCM AT> DTCM + _ld_dtcm_bss_start = ADDR(.dtcm_bss); + _ld_dtcm_bss_size = SIZEOF(.dtcm_bss); + + .stack : + { + . = ALIGN(8); + _ld_stack_bottom = .; + . += _ld_default_stack_size; + } > DTCM + _ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM); + .ARM.attributes 0 : { *(.ARM.attributes) } } - - diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 01264d512b..b7937dd04c 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = UFQFPN48 +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index b4b3944439..70d0ea2bdf 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_FILE = boards/STM32F411VETx_FLASH.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F411_fs.ld diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 351adf1b8c..85ed18f4f6 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -12,6 +12,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx 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_OFFSET = 0x8010000 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 0a725d75ba..cd8d3b548e 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -15,6 +15,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xe_boot.ld # LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index 11c2215196..cac4a273eb 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F767_fs.ld diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index 0f003d5fe3..dd7f05f290 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = H7 MCU_VARIANT = STM32H743xx MCU_PACKAGE = LQFP144 +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32H743_fs.ld diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index e9f1d0369e..0a06852fb8 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -12,5 +12,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_FILE = boards/STM32F411VETx_FLASH.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F411_fs.ld diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index ab2ce86a98..9d8b0f3f27 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx MCU_PACKAGE = LQFP64 +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F405_fs.ld diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index bf2dd55965..62887c0289 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -15,5 +15,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_FILE = boards/STM32F411VETx_FLASH.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F411_fs.ld diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index da24fe3f0a..761602acdf 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = LQFP100_f4 -LD_FILE = boards/STM32F411VETx_FLASH.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F411_fs.ld diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index d227803de7..09e7bda85d 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -15,6 +15,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F412Zx MCU_PACKAGE = LQFP144 -LD_FILE = boards/STM32F412ZGTx_FLASH.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F412_fs.ld diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index c8c424c0c4..57a65f75ae 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -10,5 +10,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F407xx MCU_PACKAGE = LQFP100_f4 +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F407_fs.ld diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 6fcaae6ab0..40b0e92506 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -9,12 +9,9 @@ LONGINT_IMPL = NONE CIRCUITPY_NVM = 1 -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe +MCU_SERIES = F4 +MCU_VARIANT = STM32F411xE MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_nvm_FLASH.ld -STARTUP_FILE = startup_stm32f411xe.s - +LD_FILE = boards/common_nvm.ld +LD_FILE = boards/STM32F411_nvm.ld diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index 297c7338ed..65b0611241 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -28,14 +28,19 @@ #ifndef STM32_MPCONFIGPORT_H__ #define STM32_MPCONFIGPORT_H__ +#include + #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) #define MICROPY_PY_IO (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) #define MICROPY_PY_UJSON (1) +extern uint8_t _ld_default_stack_size; + // 24kiB stack -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +// #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 +#define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t) &_ld_default_stack_size) #include "py/circuitpy_mpconfig.h" diff --git a/ports/stm/packages/LQFP100_f4.c b/ports/stm/packages/LQFP100_f4.c index a2219ccc08..5bc0a5158e 100644 --- a/ports/stm/packages/LQFP100_f4.c +++ b/ports/stm/packages/LQFP100_f4.c @@ -53,7 +53,7 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED +#if defined(STM32F405xx) || defined(STM32F412Zx) || defined(STM32F407xx) || defined(STM32F767xx) { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, #endif //or VCAP1 -----------------------------------*/ // VCAP1 or VSS -----------------------------------*/ diff --git a/ports/stm/packages/LQFP64.c b/ports/stm/packages/LQFP64.c index 02dcfa00ca..e6a492bc33 100644 --- a/ports/stm/packages/LQFP64.c +++ b/ports/stm/packages/LQFP64.c @@ -35,7 +35,7 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_LINE == FOUNDATION || MCU_LINE == ADVANCED +#if defined(STM32F405xx) || defined(STM32F412Zx) || defined(STM32F407xx) || defined(STM32F767xx) { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, #endif //or VCAP1 -----------------------------------*/ // VCAP1 or VSS -----------------------------------*/ diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index fa377e74a9..16796d9ce3 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -44,6 +44,131 @@ #include "clocks.h" #include "gpio.h" +//only enable the Reset Handler overwrite for the H7 for now +#if defined(STM32H7) + +// Device memories must be accessed in order. +#define DEVICE 2 +// Normal memory can have accesses reorder and prefetched. +#define NORMAL 0 +// Prevents instruction access. +#define NO_EXECUTION 1 +#define EXECUTION 0 +// Shareable if the memory system manages coherency. +#define NOT_SHAREABLE 0 +#define SHAREABLE 1 +#define NOT_CACHEABLE 0 +#define CACHEABLE 1 +#define NOT_BUFFERABLE 0 +#define BUFFERABLE 1 +#define NO_SUBREGIONS 0 + +extern uint32_t _ld_stack_top; + +extern uint32_t _ld_d1_ram_bss_start; +extern uint32_t _ld_d1_ram_bss_size; +extern uint32_t _ld_d1_ram_data_destination; +extern uint32_t _ld_d1_ram_data_size; +extern uint32_t _ld_d1_ram_data_flash_copy; +extern uint32_t _ld_dtcm_bss_start; +extern uint32_t _ld_dtcm_bss_size; +extern uint32_t _ld_dtcm_data_destination; +extern uint32_t _ld_dtcm_data_size; +extern uint32_t _ld_dtcm_data_flash_copy; +extern uint32_t _ld_itcm_destination; +extern uint32_t _ld_itcm_size; +extern uint32_t _ld_itcm_flash_copy; + +extern void main(void); +extern void SystemInit(void); + +// This replaces the Reset_Handler in startup_*.S and SystemInit in system_*.c. +__attribute__((used, naked)) void Reset_Handler(void) { + __disable_irq(); + __set_MSP((uint32_t) &_ld_stack_top); + + // TODO: Is any of this commented stuff actually required? + + /* Disable I cache and D cache */ + // SCB_DisableICache(); + // SCB_DisableDCache(); // this causes an instant hardfault if used + + // #if ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) + // SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2)); /* set CP10, CP11 Full Access */ + // #endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */ + + // /* Disable Systick which might be enabled by bootrom */ + // if (SysTick->CTRL & SysTick_CTRL_ENABLE_Msk) + // { + // SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; + // } + + /* Disable MPU */ + ARM_MPU_Disable(); + + // Copy all of the itcm code to run from ITCM. Do this while the MPU is disabled because we write + // protect it. + for (uint32_t i = 0; i < ((size_t) &_ld_itcm_size) / 4; i++) { + (&_ld_itcm_destination)[i] = (&_ld_itcm_flash_copy)[i]; + } + + // The first number in RBAR is the region number. When searching for a policy, the region with + // the highest number wins. If none match, then the default policy set at enable applies. + // TODO: what is the default policy? Where is that set? + + // TODO: do I need to subdivide this up? + // Mark all the flash the same until instructed otherwise. + MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); + + // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to + // accidentally write the wrong value to 0x00000000 (aka NULL). + MPU->RBAR = ARM_MPU_RBAR(12, 0x00000000U); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + + // This the DTCM. + MPU->RBAR = ARM_MPU_RBAR(14, 0x20000000U); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + + // This is AXI SRAM (D1). + MPU->RBAR = ARM_MPU_RBAR(15, 0x24000000U); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + + // TODO: what is the mask here doing? + /* Enable MPU */ + ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); + + // We're done mucking with memory so enable I cache and D cache + // SCB_EnableDCache(); + // SCB_EnableICache(); + + // Copy all of the data to run from DTCM. + for (uint32_t i = 0; i < ((size_t) &_ld_dtcm_data_size) / 4; i++) { + (&_ld_dtcm_data_destination)[i] = (&_ld_dtcm_data_flash_copy)[i]; + } + + // Clear DTCM bss. + for (uint32_t i = 0; i < ((size_t) &_ld_dtcm_bss_size) / 4; i++) { + (&_ld_dtcm_bss_start)[i] = 0; + } + + // Copy all of the data to run from D1 RAM. + for (uint32_t i = 0; i < ((size_t) &_ld_d1_ram_data_size) / 4; i++) { + (&_ld_d1_ram_data_destination)[i] = (&_ld_d1_ram_data_flash_copy)[i]; + } + + // Clear D1 RAM bss. + for (uint32_t i = 0; i < ((size_t) &_ld_d1_ram_bss_size) / 4; i++) { + (&_ld_d1_ram_bss_start)[i] = 0; + } + + SystemInit(); + __enable_irq(); + main(); +} + +#endif //end H7 specific code + safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); @@ -63,6 +188,7 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); + // TODO: it'd be nice if this was more automatic #if defined(STM32F4) i2c_reset(); spi_reset(); @@ -81,22 +207,25 @@ void reset_cpu(void) { NVIC_SystemReset(); } +extern uint32_t _ld_heap_start, _ld_heap_end, _ld_stack_top, _ld_stack_bottom; + uint32_t *port_heap_get_bottom(void) { - return port_stack_get_limit(); + return &_ld_heap_start; } uint32_t *port_heap_get_top(void) { - return port_stack_get_top(); + return &_ld_heap_end; } uint32_t *port_stack_get_limit(void) { - return &_ebss; + return &_ld_stack_bottom; } uint32_t *port_stack_get_top(void) { - return &_estack; + return &_ld_stack_top; } +// TODO: what even are these extern uint32_t _ebss; // Place the word to save just after our BSS section that gets blanked. void port_set_saved_word(uint32_t value) { @@ -107,7 +236,36 @@ uint32_t port_get_saved_word(void) { return _ebss; } -void HardFault_Handler(void) { +__attribute__((used)) void MemManage_Handler(void) +{ + __ASM volatile ("bkpt"); + reset_into_safe_mode(MEM_MANAGE); + while (true) { + asm("nop;"); + } +} + +__attribute__((used)) void BusFault_Handler(void) +{ + __ASM volatile ("bkpt"); + reset_into_safe_mode(MEM_MANAGE); + while (true) { + asm("nop;"); + } +} + +__attribute__((used)) void UsageFault_Handler(void) +{ + __ASM volatile ("bkpt"); + reset_into_safe_mode(MEM_MANAGE); + while (true) { + asm("nop;"); + } +} + +__attribute__((used)) void HardFault_Handler(void) +{ + __ASM volatile ("bkpt"); reset_into_safe_mode(HARD_CRASH); while (true) { asm("nop;"); diff --git a/supervisor/linker.h b/supervisor/linker.h index 878268c734..74b2dd5a6d 100755 --- a/supervisor/linker.h +++ b/supervisor/linker.h @@ -29,7 +29,7 @@ #ifndef MICROPY_INCLUDED_SUPERVISOR_LINKER_H #define MICROPY_INCLUDED_SUPERVISOR_LINKER_H -#if defined(IMXRT10XX) || defined(FOMU) // || defined(STM32H7) +#if defined(IMXRT10XX) || defined(FOMU) || defined(STM32H7) #define PLACE_IN_DTCM_DATA(name) name __attribute__((section(".dtcm_data." #name ))) #define PLACE_IN_DTCM_BSS(name) name __attribute__((section(".dtcm_bss." #name ))) #define PLACE_IN_ITCM(name) __attribute__((section(".itcm." #name ))) name diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index 2b7b1c03a4..2a7daf4658 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -46,7 +46,7 @@ void allocate_stack(void) { mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; - if (port_stack_get_top() != port_heap_get_top()) { + if (port_stack_get_top() != port_heap_get_top()) { //Why is this here? Doesn't apply to some chips. return; } From 7e69d30c027659540860af894342872129e4343f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Apr 2020 14:22:56 -0700 Subject: [PATCH 173/919] Fix nRF PulseIn --- ports/nrf/common-hal/pulseio/PulseIn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 55ca956ff7..be2903e444 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -152,7 +152,8 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu nrfx_timer_init(timer, &timer_config, &timer_overflow_event_handler); // Interrupt on overflow so we can track when it rolls over. - nrfx_timer_compare(timer, 0, 0, true); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, 0, true); + nrfx_timer_resume(timer); } refcount++; From e99cf6e441db5f8f3c6378cf0a0ce2b12f1b72cd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 3 Apr 2020 18:07:56 -0700 Subject: [PATCH 174/919] Rework sleep timing It didn't account for background task time and could end up sleeping for way longer than it should because the RTC compare time had already passed. --- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 13 ++++++-- ports/atmel-samd/supervisor/port.c | 1 + supervisor/shared/tick.c | 33 +++++++++---------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 4ddee4933c..54343a8e3e 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -79,6 +79,11 @@ void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. uint32_t current_overflow = overflow_count; Tc* tc = tc_insts[pulsein_tc_index]; + #ifdef SAMD51 + tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_READSYNC; + while (tc->COUNT16.SYNCBUSY.bit.COUNT == 1 || + tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val) {} + #endif uint32_t current_count = tc->COUNT16.COUNT.reg; pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); @@ -119,6 +124,12 @@ void pulsein_interrupt_handler(uint8_t channel) { self->last_count = current_count; } +void pulsein_reset() { + refcount = 0; + pulsein_tc_index = 0xff; + overflow_count = 0; +} + void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { if (!pin->has_extint) { @@ -189,8 +200,6 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, tc_enable_interrupts(pulsein_tc_index); tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_RETRIGGER; - //mp_printf(&mp_plat_print, "timer started\n"); - overflow_count = 0; } refcount++; diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 92ef35680c..271faecd96 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -306,6 +306,7 @@ void reset_port(void) { #endif eic_reset(); #if CIRCUITPY_PULSEIO + pulsein_reset(); pulseout_reset(); pwmout_reset(); #endif diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 516dff7470..dc38e76f61 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -79,39 +79,36 @@ uint32_t supervisor_ticks_ms32() { extern void run_background_tasks(void); void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { - uint8_t subticks; - uint64_t now = port_get_raw_ticks(&subticks); - - if (now == background_ticks && (subticks & 0x3) != 0) { - return; - } - background_ticks = now; - + // TODO: Add a global that can be set by anyone to indicate we should run background tasks. That + // way we can short circuit the background tasks early. We used to do it based on time but it + // breaks cases where we wake up for a short period and then sleep. If we skipped the last + // background task or more before sleeping we may end up starving a task like USB. run_background_tasks(); } -void supervisor_fake_tick() { - uint32_t now = port_get_raw_ticks(NULL); - background_ticks = (now - 1); -} - void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. delay = delay * 1024 / 1000; - uint64_t duration = 0; - port_interrupt_after_ticks(delay); - while (duration < delay) { + uint64_t end_tick = start_tick + delay; + int64_t remaining = delay; + while (remaining > 0) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { break; } + remaining = end_tick - port_get_raw_ticks(NULL); + // We break a bit early so we don't risk setting the alarm before the time when we call + // sleep. + if (remaining < 1) { + break; + } + port_interrupt_after_ticks(remaining); // Sleep until an interrupt happens. port_sleep_until_interrupt(); - duration = (port_get_raw_ticks(NULL) - start_tick); - port_interrupt_after_ticks(duration); + remaining = end_tick - port_get_raw_ticks(NULL); } } From 08f369ea9671e49196fc5ca9e699632798b47f84 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Mon, 6 Apr 2020 22:10:12 +0200 Subject: [PATCH 175/919] mimxrt1011: Only re-init SPI when it's actually needed If some crazy code (*cough* FourWire) decides to reconfigure the bus before every transfer, it might get a bit slow... --- ports/mimxrt10xx/common-hal/busio/SPI.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index b262d1a461..24a6dbff6d 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -210,6 +210,18 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { + + LPSPI_Enable(self->spi, false); + uint32_t tcrPrescaleValue; + self->baudrate = LPSPI_MasterSetBaudRate(self->spi, baudrate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue); + LPSPI_Enable(self->spi, true); + + if ((polarity == common_hal_busio_spi_get_polarity(self)) && + (phase == common_hal_busio_spi_get_phase(self)) && + (bits == ((self->spi->TCR & LPSPI_TCR_FRAMESZ_MASK) >> LPSPI_TCR_FRAMESZ_SHIFT)) + 1) { + return true; + } + lpspi_master_config_t config = { 0 }; LPSPI_MasterGetDefaultConfig(&config); @@ -221,11 +233,6 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, LPSPI_Deinit(self->spi); LPSPI_MasterInit(self->spi, &config, LPSPI_MASTER_CLK_FREQ); - LPSPI_Enable(self->spi, false); - uint32_t tcrPrescaleValue; - self->baudrate = LPSPI_MasterSetBaudRate(self->spi, config.baudRate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue); - LPSPI_Enable(self->spi, true); - return true; } From c0ba2a839fabb8fca05adaf3450d2465d260cc50 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 6 Apr 2020 16:03:31 -0700 Subject: [PATCH 176/919] Updates based on feedback from jepler --- ports/atmel-samd/common-hal/rtc/RTC.c | 1 + ports/cxd56/common-hal/pulseio/PulseIn.c | 2 +- ports/cxd56/common-hal/pulseio/PulseIn.h | 2 +- supervisor/shared/autoreload.c | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index 7651fdef60..203187b4ff 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -39,6 +39,7 @@ #include "supervisor/shared/translate.h" // This is the time in seconds since 2000 that the RTC was started. +// TODO: Change the offset to ticks so that it can be a subsecond adjustment. static uint32_t rtc_offset = 0; void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index f474c0a105..221fa5b6eb 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -54,7 +54,7 @@ static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg) // Grab the current time first. struct timeval tv; gettimeofday(&tv, NULL); - uint32_t current_us = tv.tv_sec * 1000000 + tv.tv_usec; + uint64_t current_us = ((uint64_t) tv.tv_sec) * 1000000 + tv.tv_usec; pulseio_pulsein_obj_t *self = pulsein_objects[irq - CXD56_IRQ_EXDEVICE_0]; diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.h b/ports/cxd56/common-hal/pulseio/PulseIn.h index ff31712abc..70d1413b63 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.h +++ b/ports/cxd56/common-hal/pulseio/PulseIn.h @@ -38,7 +38,7 @@ typedef struct { uint16_t maxlen; uint16_t start; uint16_t len; - uint32_t last_us; + uint64_t last_us; bool idle_state; bool first_edge; bool paused; diff --git a/supervisor/shared/autoreload.c b/supervisor/shared/autoreload.c index bc818e6b08..1976f66470 100644 --- a/supervisor/shared/autoreload.c +++ b/supervisor/shared/autoreload.c @@ -71,6 +71,9 @@ inline bool autoreload_is_enabled() { } void autoreload_start() { + // Enable ticks if we haven't been tracking an autoreload delay. We check + // our current state so that we only turn ticks on once. Multiple starts + // can occur before we reload and then turn ticks off. if (autoreload_delay_ms == 0) { supervisor_enable_tick(); } From c49d2ea278ef01f87c47ecec40524dd2facef5e1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 6 Apr 2020 16:38:51 -0700 Subject: [PATCH 177/919] Don't upgrade to Sphinx 3 The doc build doesn't complete and is likely broken for the inline RST. We can move to 3 when we move the inline docs to Python stubs. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6ba3725cc..e06477979e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls "Sphinx<3" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | gcc --version From fa7e35ab4add4786203ffeed0d26ce0aa3b56f1f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 6 Apr 2020 16:38:51 -0700 Subject: [PATCH 178/919] Don't upgrade to Sphinx 3 The doc build doesn't complete and is likely broken for the inline RST. We can move to 3 when we move the inline docs to Python stubs. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b56fb35b88..455f83a21b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls "Sphinx<3" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | gcc --version From a8dfba235c6aa4370e7b07ad15539d86f0308edb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 7 Apr 2020 13:07:29 -0700 Subject: [PATCH 179/919] Fix alarm so that it is correctly set. --- ports/mimxrt10xx/common-hal/rtc/RTC.c | 1 + ports/mimxrt10xx/supervisor/port.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/rtc/RTC.c b/ports/mimxrt10xx/common-hal/rtc/RTC.c index 5d6cae5201..6940a1817d 100644 --- a/ports/mimxrt10xx/common-hal/rtc/RTC.c +++ b/ports/mimxrt10xx/common-hal/rtc/RTC.c @@ -72,5 +72,6 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { + // SNVS has HPCALB_VAL bits for calibration. mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); } diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index ef6fe2f978..842aa1be4a 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -328,7 +328,7 @@ uint32_t *port_heap_get_top(void) { return &_ld_heap_end; } -// Place the word to save just after our BSS section that gets blanked. +// Place the word into the low power section of the SNVS. void port_set_saved_word(uint32_t value) { SNVS->LPGPR[1] = value; } @@ -366,8 +366,11 @@ void port_interrupt_after_ticks(uint32_t ticks) { uint8_t subticks; uint64_t current_ticks = port_get_raw_ticks(&subticks); current_ticks += ticks; - SNVS->HPTALR = current_ticks << 5 | subticks; + SNVS->HPCR &= ~SNVS_HPCR_HPTA_EN_MASK; + // Wait for the alarm to be disabled. + while ((SNVS->HPCR & SNVS_HPCR_HPTA_EN_MASK) != 0) {} SNVS->HPTAMR = current_ticks >> (32 - 5); + SNVS->HPTALR = current_ticks << 5 | subticks; SNVS->HPCR |= SNVS_HPCR_HPTA_EN_MASK; } @@ -379,8 +382,10 @@ void port_sleep_until_interrupt(void) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); (void) __get_FPSCR(); } - // Call wait for interrupt ourselves if the SD isn't enabled. + NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn); + CLOCK_SetMode(kCLOCK_ModeWait); __WFI(); + CLOCK_SetMode(kCLOCK_ModeRun); } /** From aae0ce6badacf07a07d9ac4badb8e312e26e50fb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 7 Apr 2020 14:16:07 -0700 Subject: [PATCH 180/919] Fix autoreload and ticks on IMX RT --- ports/mimxrt10xx/supervisor/port.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 842aa1be4a..242b0592e1 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -53,6 +53,7 @@ #include "shared-module/gamepadshift/__init__.h" #endif #include "shared-module/_pew/PewPew.h" +#include "supervisor/shared/tick.h" #include "clocks.h" @@ -243,6 +244,8 @@ __attribute__((used, naked)) void Reset_Handler(void) { } safe_mode_t port_init(void) { + CLOCK_SetMode(kCLOCK_ModeRun); + clocks_init(); #if CIRCUITPY_RTC @@ -350,8 +353,19 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { return ticks / 32; } +void SNVS_HP_WRAPPER_IRQHandler(void) { + if ((SNVS->HPSR & SNVS_HPSR_PI_MASK) != 0) { + supervisor_tick(); + SNVS->HPSR = SNVS_HPSR_PI_MASK; + } + if ((SNVS->HPSR & SNVS_HPSR_HPTA_MASK) != 0) { + SNVS->HPSR = SNVS_HPSR_HPTA_MASK; + } +} + // Enable 1/1024 second tick. void port_enable_tick(void) { + NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); uint32_t hpcr = SNVS->HPCR; hpcr &= ~SNVS_HPCR_PI_FREQ_MASK; SNVS->HPCR = hpcr | SNVS_HPCR_PI_FREQ(5) | SNVS_HPCR_PI_EN_MASK; @@ -360,6 +374,7 @@ void port_enable_tick(void) { // Disable 1/1024 second tick. void port_disable_tick(void) { SNVS->HPCR &= ~SNVS_HPCR_PI_EN_MASK; + NVIC_DisableIRQ(SNVS_HP_WRAPPER_IRQn); } void port_interrupt_after_ticks(uint32_t ticks) { From 6544bf52fb87fd47c234a8ab3fc26865b124c039 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 7 Apr 2020 17:15:18 -0700 Subject: [PATCH 181/919] Enable SNVS interrupt The iMX RT has a separate wake up controller, the GPC, that replaces the NVIC when asleep. It adds the ability to only wake up on certain interrupts. It seems that it requires at least one enabled interrupt in the NVIC to turn on it's wake up circuitry. It doesn't need to be the same interrupt as the wake up signal. For example, the RTC in the SNVS can wake us up if a USB interrupt is enabled. Before then it won't work. So, we enable the SNVS interrupt on start up so it can wake us up. --- ports/mimxrt10xx/supervisor/port.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 242b0592e1..1a4f9520b8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -252,6 +252,10 @@ safe_mode_t port_init(void) { rtc_init(); #endif + // Always enable the SNVS interrupt. The GPC won't wake us up unless at least one interrupt is + // enabled. It won't occur very often so it'll be low overhead. + NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); + // Reset everything into a known state before board_init. reset_port(); @@ -365,7 +369,6 @@ void SNVS_HP_WRAPPER_IRQHandler(void) { // Enable 1/1024 second tick. void port_enable_tick(void) { - NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); uint32_t hpcr = SNVS->HPCR; hpcr &= ~SNVS_HPCR_PI_FREQ_MASK; SNVS->HPCR = hpcr | SNVS_HPCR_PI_FREQ(5) | SNVS_HPCR_PI_EN_MASK; @@ -374,7 +377,6 @@ void port_enable_tick(void) { // Disable 1/1024 second tick. void port_disable_tick(void) { SNVS->HPCR &= ~SNVS_HPCR_PI_EN_MASK; - NVIC_DisableIRQ(SNVS_HP_WRAPPER_IRQn); } void port_interrupt_after_ticks(uint32_t ticks) { From 826837186c9668805b58edb4e57b68363aba0149 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 7 Apr 2020 18:17:25 -0700 Subject: [PATCH 182/919] adds standard (non-queued) SPI support to QSPI for external flash --- .github/workflows/build.yml | 1 + .../atmel-samd/boards/pycubed/mpconfigboard.h | 2 + ports/atmel-samd/boards/pycubed_mram/board.c | 61 ++++++++++ .../boards/pycubed_mram/mpconfigboard.h | 37 ++++++ .../boards/pycubed_mram/mpconfigboard.mk | 24 ++++ ports/atmel-samd/boards/pycubed_mram/pins.c | 55 +++++++++ ports/atmel-samd/supervisor/qspi_flash.c | 15 ++- .../shared/external_flash/common_commands.h | 1 + supervisor/shared/external_flash/devices.h | 17 +++ .../shared/external_flash/external_flash.c | 105 ++++++++++-------- 10 files changed, 272 insertions(+), 46 deletions(-) create mode 100644 ports/atmel-samd/boards/pycubed_mram/board.c create mode 100644 ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/pycubed_mram/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 455f83a21b..e2455f0cd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -204,6 +204,7 @@ jobs: - "pybadge_airlift" - "pyboard_v11" - "pycubed" + - "pycubed_mram" - "pygamer" - "pygamer_advance" - "pyportal" diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.h b/ports/atmel-samd/boards/pycubed/mpconfigboard.h index 49a98e8d45..8d046c75bd 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.h +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.h @@ -3,6 +3,7 @@ #define MICROPY_HW_MCU_NAME "samd51j19" #define CIRCUITPY_MCU_FAMILY samd51 +#define MICROPY_HW_LED_STATUS (&pin_PA16) #define MICROPY_HW_NEOPIXEL (&pin_PA21) #define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) @@ -16,6 +17,7 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) +// External flash W25Q80DV #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/pycubed_mram/board.c b/ports/atmel-samd/boards/pycubed_mram/board.c new file mode 100644 index 0000000000..31b0812094 --- /dev/null +++ b/ports/atmel-samd/boards/pycubed_mram/board.c @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include + +#include "boards/board.h" +#include "py/mpconfig.h" +#include "shared-bindings/nvm/ByteArray.h" +#include "common-hal/microcontroller/Pin.h" +#include "hal/include/hal_gpio.h" +#include "shared-bindings/pulseio/PWMOut.h" + +nvm_bytearray_obj_t bootcnt = { + .base = { + .type = &nvm_bytearray_type + }, + .len = ( uint32_t) 8192, + .start_address = (uint8_t*) (0x00080000 - 8192) + }; + + +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); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + uint8_t value_out = 0; + common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out); + ++value_out; + common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1); +} \ No newline at end of file diff --git a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h new file mode 100644 index 0000000000..aca9e3c368 --- /dev/null +++ b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h @@ -0,0 +1,37 @@ + +#define MICROPY_HW_BOARD_NAME "PyCubedv04-MRAM" +#define MICROPY_HW_MCU_NAME "samd51j19" +#define CIRCUITPY_MCU_FAMILY samd51 + +#define MICROPY_HW_LED_STATUS (&pin_PA16) +#define MICROPY_HW_NEOPIXEL (&pin_PA21) + +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +#define MICROPY_PORT_B (PORT_PA21 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +// External flash MR2xH40 MRAM +#define EXTERNAL_FLASH_QSPI_SINGLE + +#define AUTORESET_DELAY_MS 500 + +#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB13) +#define DEFAULT_I2C_BUS_SDA (&pin_PB12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA12) +#define DEFAULT_SPI_BUS_MISO (&pin_PA14) + +#define DEFAULT_UART_BUS_TX (&pin_PB02) +#define DEFAULT_UART_BUS_RX (&pin_PB03) + +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + diff --git a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk new file mode 100644 index 0000000000..ef92b4db56 --- /dev/null +++ b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk @@ -0,0 +1,24 @@ +LD_FILE = boards/samd51x19-bootloader-external-flash.ld +USB_VID = 0x04D8 +USB_PID = 0xEC44 +USB_PRODUCT = "PyCubed" +USB_MANUFACTURER = "maholli" + +CHIP_VARIANT = SAMD51J19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = MR2xH40 +LONGINT_IMPL = MPZ + +# Not needed. +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_PS2IO = 0 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD \ No newline at end of file diff --git a/ports/atmel-samd/boards/pycubed_mram/pins.c b/ports/atmel-samd/boards/pycubed_mram/pins.c new file mode 100644 index 0000000000..4c97f58a80 --- /dev/null +++ b/ports/atmel-samd/boards/pycubed_mram/pins.c @@ -0,0 +1,55 @@ +#include "shared-bindings/board/__init__.h" +#include "boards/board.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) }, + + { MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_BURN1), MP_ROM_PTR(&pin_PB31) }, + { MP_ROM_QSTR(MP_QSTR_BURN2), MP_ROM_PTR(&pin_PA15) }, + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_L1PROG), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_CHRG), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA17), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_PA18), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_PA19), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_PA20), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_PA22), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_PB16), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_PB17), MP_ROM_PTR(&pin_PB17) }, + { MP_ROM_QSTR(MP_QSTR_PB22), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_PB23), MP_ROM_PTR(&pin_PB23) }, + + { MP_ROM_QSTR(MP_QSTR_RF1_RST), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_RF1_CS), MP_ROM_PTR(&pin_PB30) }, + { MP_ROM_QSTR(MP_QSTR_RF1_IO0), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_RF1_IO4), MP_ROM_PTR(&pin_PB04) }, + + { MP_ROM_QSTR(MP_QSTR_RF2_RST), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_RF2_CS), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_RF2_IO1), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_RF2_BSY), MP_ROM_PTR(&pin_PB07) }, + + { MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, + + { MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file diff --git a/ports/atmel-samd/supervisor/qspi_flash.c b/ports/atmel-samd/supervisor/qspi_flash.c index eca47b1648..434446f67d 100644 --- a/ports/atmel-samd/supervisor/qspi_flash.c +++ b/ports/atmel-samd/supervisor/qspi_flash.c @@ -166,7 +166,10 @@ bool spi_flash_write_data(uint32_t address, uint8_t* data, uint32_t length) { bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { samd_peripherals_disable_and_clear_cache(); - #ifdef EXTERNAL_FLASH_QSPI_DUAL + #ifdef EXTERNAL_FLASH_QSPI_SINGLE + QSPI->INSTRCTRL.bit.INSTR = CMD_READ_DATA; + uint32_t mode = QSPI_INSTRFRAME_WIDTH_SINGLE_BIT_SPI; + #elif defined EXTERNAL_FLASH_QSPI_DUAL QSPI->INSTRCTRL.bit.INSTR = CMD_DUAL_READ; uint32_t mode = QSPI_INSTRFRAME_WIDTH_DUAL_OUTPUT; #else @@ -174,6 +177,15 @@ bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { uint32_t mode = QSPI_INSTRFRAME_WIDTH_QUAD_OUTPUT; #endif + #ifdef IS_MRAM + QSPI->INSTRFRAME.reg = mode | + QSPI_INSTRFRAME_ADDRLEN_24BITS | + QSPI_INSTRFRAME_TFRTYPE_READMEMORY | + QSPI_INSTRFRAME_INSTREN | + QSPI_INSTRFRAME_ADDREN | + QSPI_INSTRFRAME_DATAEN | + QSPI_INSTRFRAME_DUMMYLEN(0); + #else QSPI->INSTRFRAME.reg = mode | QSPI_INSTRFRAME_ADDRLEN_24BITS | QSPI_INSTRFRAME_TFRTYPE_READMEMORY | @@ -181,6 +193,7 @@ bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { QSPI_INSTRFRAME_ADDREN | QSPI_INSTRFRAME_DATAEN | QSPI_INSTRFRAME_DUMMYLEN(8); + #endif memcpy(data, ((uint8_t *) QSPI_AHB) + address, length); // TODO(tannewt): Fix DMA and enable it. diff --git a/supervisor/shared/external_flash/common_commands.h b/supervisor/shared/external_flash/common_commands.h index cc0da21759..2eaa848331 100644 --- a/supervisor/shared/external_flash/common_commands.h +++ b/supervisor/shared/external_flash/common_commands.h @@ -43,5 +43,6 @@ #define CMD_QUAD_READ 0x6b #define CMD_ENABLE_RESET 0x66 #define CMD_RESET 0x99 +#define CMD_WAKE 0xab #endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_COMMON_COMMANDS_H diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index fd9224f561..05e9e3c95c 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -426,6 +426,23 @@ typedef struct { .single_status_byte = false, \ } +// Everspin MRAM +#define MR2xH40 {\ + .total_size = (1 << 22), /* 4 MiB */ \ + .start_up_time_us = 10000, \ + .manufacturer_id = 0xef, /*no JDEC*/ \ + .memory_type = 0x40, /*no JDEC*/ \ + .capacity = 0x14, /*no JDEC*/ \ + .max_clock_speed_mhz = 40, \ + .quad_enable_bit_mask = 0x00, \ + .has_sector_protection = false, \ + .supports_fast_read = false, \ + .supports_qspi = false, \ + .supports_qspi_writes = false, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} + // Settings for the Macronix MX25L1606 2MiB SPI flash. // Datasheet: #define MX25L1606 {\ diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 9d38c07d89..7f5496d3ac 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -27,7 +27,7 @@ #include #include - +#include "mpconfigboard.h" #include "supervisor/spi_flash_api.h" #include "supervisor/shared/external_flash/common_commands.h" #include "extmod/vfs.h" @@ -57,13 +57,18 @@ static supervisor_allocation* supervisor_cache = NULL; // Wait until both the write enable and write in progress bits have cleared. static bool wait_for_flash_ready(void) { - uint8_t read_status_response[1] = {0x00}; bool ok = true; // Both the write enable and write in progress bits should be low. - do { - ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); - } while (ok && (read_status_response[0] & 0x3) != 0); - return ok; + #ifdef EXTERNAL_FLASH_QSPI_SINGLE + // For NVM without a ready bit in status register + return ok; + #else + uint8_t read_status_response[1] = {0x00}; + do { + ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); + } while (ok && (read_status_response[0] & 0x3) != 0); + return ok; + #endif } // Turn on the write enable bit so we can program and erase the flash. @@ -91,16 +96,18 @@ static bool write_flash(uint32_t address, const uint8_t* data, uint32_t data_len } // Don't bother writing if the data is all 1s. Thats equivalent to the flash // state after an erase. - bool all_ones = true; - for (uint16_t i = 0; i < data_length; i++) { - if (data[i] != 0xff) { - all_ones = false; - break; + #ifndef EXTERNAL_FLASH_QSPI_SINGLE + bool all_ones = true; + for (uint16_t i = 0; i < data_length; i++) { + if (data[i] != 0xff) { + all_ones = false; + break; + } } - } - if (all_ones) { - return true; - } + if (all_ones) { + return true; + } + #endif for (uint32_t bytes_written = 0; bytes_written < data_length; @@ -191,41 +198,49 @@ void supervisor_flash_init(void) { spi_flash_init(); - // The response will be 0xff if the flash needs more time to start up. - uint8_t jedec_id_response[3] = {0xff, 0xff, 0xff}; - while (jedec_id_response[0] == 0xff) { - spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); - } - - for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { - const external_flash_device* possible_device = &possible_devices[i]; - if (jedec_id_response[0] == possible_device->manufacturer_id && - jedec_id_response[1] == possible_device->memory_type && - jedec_id_response[2] == possible_device->capacity) { +#ifdef EXTERNAL_FLASH_QSPI_SINGLE + // For NVM that don't have JEDEC response + spi_flash_command(CMD_WAKE); + for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { + const external_flash_device* possible_device = &possible_devices[i]; flash_device = possible_device; break; } - } +#else + // The response will be 0xff if the flash needs more time to start up. + uint8_t jedec_id_response[3] = {0xff, 0xff, 0xff}; + while (jedec_id_response[0] == 0xff) { + spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); + } - if (flash_device == NULL) { - return; - } - - // We don't know what state the flash is in so wait for any remaining writes and then reset. - uint8_t read_status_response[1] = {0x00}; - // The write in progress bit should be low. - do { - spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); - } while ((read_status_response[0] & 0x1) != 0); - // The suspended write/erase bit should be low. - do { - spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); - } while ((read_status_response[0] & 0x80) != 0); - - - spi_flash_command(CMD_ENABLE_RESET); - spi_flash_command(CMD_RESET); + for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { + const external_flash_device* possible_device = &possible_devices[i]; + if (jedec_id_response[0] == possible_device->manufacturer_id && + jedec_id_response[1] == possible_device->memory_type && + jedec_id_response[2] == possible_device->capacity) { + flash_device = possible_device; + break; + } + } +#endif + if (flash_device == NULL) { + return; + } + // We don't know what state the flash is in so wait for any remaining writes and then reset. + uint8_t read_status_response[1] = {0x00}; + // The write in progress bit should be low. + do { + spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); + } while ((read_status_response[0] & 0x1) != 0); +#ifndef EXTERNAL_FLASH_QSPI_SINGLE + // The suspended write/erase bit should be low. + do { + spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); + } while ((read_status_response[0] & 0x80) != 0); + spi_flash_command(CMD_ENABLE_RESET); + spi_flash_command(CMD_RESET); +#endif // Wait 30us for the reset common_hal_mcu_delay_us(30); From a53a26be70588685a300e4c693ab9f8db65b1212 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 7 Apr 2020 18:24:53 -0700 Subject: [PATCH 183/919] missed a debug flag --- ports/atmel-samd/Makefile | 2 +- ports/atmel-samd/supervisor/qspi_flash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f4886f96ef..4e34a3904d 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -53,7 +53,7 @@ include $(TOP)/supervisor/supervisor.mk # Include make rules and variables common across CircuitPython builds. include $(TOP)/py/circuitpy_defns.mk -CROSS_COMPILE = arm-none-eabi- +CROSS_COMPILE = ~/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- HAL_DIR=hal/$(MCU_SERIES) diff --git a/ports/atmel-samd/supervisor/qspi_flash.c b/ports/atmel-samd/supervisor/qspi_flash.c index 434446f67d..fc538f95f3 100644 --- a/ports/atmel-samd/supervisor/qspi_flash.c +++ b/ports/atmel-samd/supervisor/qspi_flash.c @@ -177,7 +177,7 @@ bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { uint32_t mode = QSPI_INSTRFRAME_WIDTH_QUAD_OUTPUT; #endif - #ifdef IS_MRAM + #ifdef EXTERNAL_FLASH_QSPI_SINGLE QSPI->INSTRFRAME.reg = mode | QSPI_INSTRFRAME_ADDRLEN_24BITS | QSPI_INSTRFRAME_TFRTYPE_READMEMORY | From 181ecf4a9be1062601c5d07039efe1f592ed01e1 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 7 Apr 2020 21:54:46 -0700 Subject: [PATCH 184/919] fixing my goofy CROSS_COMPILE fix --- ports/atmel-samd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 4e34a3904d..f4886f96ef 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -53,7 +53,7 @@ include $(TOP)/supervisor/supervisor.mk # Include make rules and variables common across CircuitPython builds. include $(TOP)/py/circuitpy_defns.mk -CROSS_COMPILE = ~/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- +CROSS_COMPILE = arm-none-eabi- HAL_DIR=hal/$(MCU_SERIES) From 4ee6754ccd531bb50e059e9a4d962dee5c93bae3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Apr 2020 10:32:54 -0700 Subject: [PATCH 185/919] Save backlight_on_high correctly. Fixes #2750 --- shared-module/displayio/Display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 820fbcce62..2edded9278 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -69,6 +69,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->auto_brightness = auto_brightness; self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; + self->backlight_on_high = backlight_on_high; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; From d0a25ca9acf4d96923fe81bf7ee6b313e86595ef Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Apr 2020 10:49:46 -0700 Subject: [PATCH 186/919] Tweaks based on dhalberts feedback --- ports/atmel-samd/README.rst | 219 +----------------- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 6 +- ports/atmel-samd/supervisor/port.c | 1 - ports/litex/supervisor/port.c | 1 + ports/stm/supervisor/port.c | 1 - 5 files changed, 7 insertions(+), 221 deletions(-) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index c10159682a..7211772750 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -5,230 +5,17 @@ This port supports many development boards that utilize SAMD21 and SAMD51 chips. https://circuitpython.org/downloads for all supported boards. -Pinout ------- - -All of the boards share the same core pin functionality but call pins by -different names. The table below matches the pin order in -`the datasheet `_ -and omits the pins only available on the largest package because all supported -boards use smaller version. - -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ -`microcontroller.pin` `board` ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -Datasheet arduino_mkrzero arduino_nano_33_iot arduino_zero circuitplayground_express feather_m0_adalogger feather_m0_basic feather_m0_express gemma_m0 metro_m0_express sparkfun_samd21_mini sparkfun_samd21_dev trinket_m0 -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ -PA00 ``ACCELEROMETER_SDA`` ``APA102_MOSI`` ``APA102_MOSI`` -PA01 ``ACCELEROMETER_SCL`` ``APA102_SCK`` ``APA102_SCK`` -PA02 ``A0`` ``A0`` ``A0`` ``A0`` / ``SPEAKER`` ``A0`` ``A0`` ``A0`` ``A0`` / ``D1`` ``A0`` ``A0`` ``A0`` ``D1`` / ``A0`` -PA03 -PB08 ``L`` ``A4`` / ``SDA`` ``A1`` ``A7`` / ``TX`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` -PB09 ``BATTERY`` ``A5`` / ``SCL`` ``A2`` ``A6`` / ``RX`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` -PA04 ``A3`` ``D6`` ``A3`` ``IR_PROXIMITY`` ``A3`` ``A3`` ``A3`` ``D0`` / ``TX`` / ``SDA`` ``A3`` ``A3`` ``A3`` -PA05 ``A4`` ``D5`` ``A4`` ``A1`` ``A4`` ``A4`` ``A4`` ``D2`` / ``RX`` / ``SCL`` ``A4`` ``A4`` -PA06 ``A5`` ``D7`` ``D8`` ``A2`` ``D8`` / ``GREEN_LED`` ``NEOPIXEL`` ``D8`` ``D8`` ``D8`` ``D4`` / ``TX`` -PA07 ``A6`` ``D4`` ``D9`` ``A3`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D3`` / ``RX`` -PA08 ``D11`` / ``SDA`` ``ESP_RESET`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` -PA09 ``D12`` / ``SCL`` ``A6`` ``D3`` ``TEMPERATURE`` / ``A9`` ``D3`` ``D3`` ``D3`` ``D2`` / ``SCL`` -PA10 ``D2`` ``A3`` ``D1`` / ``TX`` ``MICROPHONE_SCK`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D13`` -PA11 ``D3`` ``A2`` ``D0`` / ``RX`` ``LIGHT`` / ``A8`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` -PB10 ``D4`` ``D2`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` -PB11 ``D5`` ``D3`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` -PA12 ``SD_MOSI`` ``ESP_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` -PA13 ``SD_SCK`` ``ESP_MISO`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` -PA14 ``SD_CS`` ``ESP_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` -PA15 ``SD_MISO`` ``ESP_SCK`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` -PA16 ``D8`` / ``MOSI`` ``D11`` / ``MOSI`` ``D11`` ``MISO`` ``D11`` ``D11`` ``D11`` ``D11`` ``D11`` / ``MOSI`` ``D11`` -PA17 ``D9`` / ``SCK`` ``D13`` / ``SCK`` ``D13`` ``D13`` ``D13`` / ``RED_LED`` ``D13`` ``D13`` ``D13`` ``D13`` / ``SCK`` / ``BLUE_LED`` ``D13`` / ``BLUE_LED`` -PA18 ``D8`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` -PA19 ``D10`` / ``MISO`` ``D12`` / ``MISO`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` / ``MISO`` ``D12`` -PA20 ``D6`` ``D9`` ``D6`` ``MOSI`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` -PA21 ``D7`` ``D10`` ``D7`` ``SCK`` ``D7`` / ``SD_CD`` ``D7`` ``D7`` ``D7`` -PA22 ``D0`` ``ESP_TX`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` -PA23 ``D1`` ``ESP_RX`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` -PA24 -PA25 -PB22 ``D14`` / ``TX`` ``D1`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` -PB23 ``D13`` / ``RX`` ``D0`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` -PA27 ``SD_CD`` ``ESP_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` -PA28 ``ESP_BUSY`` ``BUTTON_A`` / ``D4`` -PA29 -PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` -PA31 -PB02 ``A1`` ``A1`` ``A5`` ``A5`` / ``SDA`` ``A5`` ``A5`` ``A5`` ``A5`` ``A5`` -PB03 ``A2`` ``A7`` ``A4`` / ``SCL`` ``YELLOW_LED`` ``YELLOW_LED`` -===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ - -Here is a table about which pins can do what in CircuitPython terms. However, -just because something is listed, doesn't mean it will always work. Existing use -of other pins and functionality will impact your ability to use a pin for your -desired purpose. For example, only certain combinations of SPI pins will work -because they use shared hardware internally. - -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= -`microcontroller.pin` `analogio` `audioio` `bitbangio` `busio` `digitalio` `pulseio` `touchio` ---------------------- ------------------- --------- ------------------------- -------------------------------------------------------------------------------------- ------------ ---------------- --------- -Datasheet AnalogIn AnalogOut AudioOut I2C OneWire SPI I2C - SDA I2C - SCL OneWire SPI - MISO SPI - MOSI SPI - SCK UART - RX UART - TX DigitalInOut PulseIn PWMOut TouchIn -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= -PA00 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA01 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA02 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA03 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB08 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB09 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA04 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA05 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA06 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA07 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA08 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA09 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA10 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA11 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB10 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB11 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA12 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA13 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA14 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA15 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA16 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA17 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA18 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA19 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA20 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA21 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA22 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA23 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA24 -PA25 -PB22 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB23 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA27 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA28 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA29 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA30 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PA31 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB02 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -PB03 **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** **Yes** -===================== ======== ========= ========= ======= ======= ======= ========= ========= ======= ========== ========== ========= ========= ========= ============ ======= ======= ========= - -Setup ------ - -An ARM compiler is required for the build, along with the associated binary -utilities. They can be installed as follows: - -- Ubuntu - - .. code-block:: shell - - sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa - sudo apt-get install gcc-arm-embedded - -- Arch Linux - - .. code-block:: shell - - sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib - -For other systems, the `GNU Arm Embedded Toolchain `_ -may be available in binary form. - -The latest available package from team-gcc-arm-embedded is used to produce the -binaries shipped by AdaFruit. Other compiler versions, particularly older -ones, may not work properly. In particular, the ``gcc-arm-none-eabi`` package -in Debian Stretch is too old. - -The compiler can be changed using the ``CROSS_COMPILE`` variable when invoking -``make``. - Building -------- -Before building the firmware for a given board, there are two additional steps. -These commands should be executed from the root directory of the repository -(``circuitpython/``). - -1. There are various submodules that reside in different repositories. In order - to have these submodules locally, you must pull them into your clone, using: - -.. code-block:: shell - - git submodule update --init --recursive - -2. The MicroPython cross-compiler must be built; it will be used to pre-compile - some of the built-in scripts to bytecode. The cross-compiler is built and - run on the host machine, using: - -.. code-block:: shell - - make -C mpy-cross +For build instructions see this guide: https://learn.adafruit.com/building-circuitpython/ -Build commands are run from the ``circuitpython/ports/atmel-samd`` directory. - -To build for a given board you must specify it by setting ``BOARD``. For example: - -.. code-block:: shell - - make BOARD=feather_m0_basic - -Board names are the directory names in the `boards `_ folder. - -Deploying +Debugging --------- -Arduino Bootloader -^^^^^^^^^^^^^^^^^^ +For debugging instructions see this guide: https://learn.adafruit.com/debugging-the-samd21-with-gdb -If your board has an existing Arduino bootloader on it then you can use bossac -to flash MicroPython. First, activate the bootloader. On Adafruit Feathers you -can double click the reset button and the #13 will fade in and out. Finally, -run bossac: - - tools/bossac_osx -e -w -v -b -R build-feather_m0_basic/firmware.bin - -No Bootloader via GDB -^^^^^^^^^^^^^^^^^^^^^ - -This method works for loading MicroPython onto the Arduino Zero via the -programming port rather than the native USB port. - -Note: These instructions are tested on Mac OSX and will vary for different -platforms. - - openocd -f ~/Library/Arduino15/packages/arduino/hardware/samd/1.6.6/variants/arduino_zero/openocd_scripts/arduino_zero.cfg - -In another terminal from ``micropython/atmel-samd``: - - arm-none-eabi-gdb build-arduino_zero/firmware.elf - (gdb) tar ext :3333 - ... - (gdb) load - ... - (gdb) monitor reset init - ... - (gdb) continue - -Connecting ----------- - -Serial -^^^^^^ - -All boards are currently configured to work over USB rather than UART. To -connect to it from OSX do something like this: - - screen /dev/tty.usbmodem142422 115200 - -You may not see a prompt immediately because it doesn't know you connected. To -get one either hit enter to get `>>>` or do CTRL-B to get the full header. - -Mass storage -^^^^^^^^^^^^ - -All boards will also show up as a mass storage device. Make sure to eject it -before resetting or disconnecting the board. Port Specific modules --------------------- diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 54343a8e3e..508ee8d385 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -102,7 +102,7 @@ void pulsein_interrupt_handler(uint8_t channel) { current_overflow += 1; } uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; - // The SAMD21 clock is 48mhz. We prescale it to 3mhz so // 3 here. + // The SAMD21 clock is 48MHz. We prescale it to 3MHz so // 3 here. #ifdef SAMD21 total_diff /= 3; #endif @@ -170,11 +170,11 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, set_timer_handler(true, index, TC_HANDLER_PULSEIN); #ifdef SAMD21 - // We use GCLK0 for SAMD21 which is 48mhz. We prescale it to 3mhz. + // We use GCLK0 for SAMD21 which is 48MHz. We prescale it to 3MHz. turn_on_clocks(true, index, 0); #endif #ifdef SAMD51 - // We use GCLK5 for SAMD51 because it runs at 2mhz and we can use it for a 1mhz clock, + // We use GCLK5 for SAMD51 because it runs at 2MHz and we can use it for a 1MHz clock, // 1us per tick. turn_on_clocks(true, index, 5); #endif diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 271faecd96..b3903bb862 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -488,7 +488,6 @@ void port_sleep_until_interrupt(void) { (void) __get_FPSCR(); } #endif - // Call wait for interrupt ourselves if the SD isn't enabled. __WFI(); } diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index c2af0d2a93..2297b15b17 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -131,5 +131,6 @@ void port_disable_tick(void) { void port_interrupt_after_ticks(uint32_t ticks) { } +// TODO: Add sleep support if the SoC supports sleep. void port_sleep_until_interrupt(void) { } diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 3d59ba49cf..2bc2479267 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -235,7 +235,6 @@ void port_sleep_until_interrupt(void) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); (void) __get_FPSCR(); } - // Call wait for interrupt ourselves if the SD isn't enabled. __WFI(); } From 9e34da44c37ccb592a54c325832528fe3b0389bf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Apr 2020 10:53:42 -0700 Subject: [PATCH 187/919] Use newer Ubuntu for CI. Maybe it's update server will be more reliable. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e06477979e..b773c2bf39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: test: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 steps: - name: Dump GitHub context env: @@ -116,7 +116,7 @@ jobs: path: mpy-cross/mpy-cross build-arm: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: test strategy: fail-fast: false @@ -281,7 +281,7 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) build-riscv: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 needs: test strategy: fail-fast: false From 01941c027b7391897db90fc0a8c1155ca4e37c47 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 8 Apr 2020 14:41:57 -0700 Subject: [PATCH 188/919] Fix up STM Enable the Alarm IRQ earlier and correct bit clearing. --- ports/stm/common-hal/busio/SPI.c | 4 +--- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/supervisor/port.c | 12 ++++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 7e25e0a571..a7a8011709 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -178,9 +178,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } //handle typedef selection, errors - if ( (self->sck != NULL && self->mosi != NULL && self->miso != NULL) || - (self->sck != NULL && self->mosi != NULL && miso == NULL) || - (self->sck != NULL && self->miso != NULL && mosi == NULL)) { + if (self->sck != NULL && (self->mosi != NULL || self->miso != NULL)) { SPIx = mcu_spi_banks[self->sck->spi_index - 1]; } else { if (spi_taken) { diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index c44d03cf09..2536ae73bd 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -117,7 +117,7 @@ void pulsein_reset(void) { void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin, uint16_t maxlen, bool idle_state) { #if !(HAS_BASIC_TIM) - mp_raise_NotImplementedError(translate("PulseOut not supported on this chip")); + mp_raise_NotImplementedError(translate("PulseIn not supported on this chip")); #else // STM32 has one shared EXTI for each pin number, 0-15 uint8_t p_num = pin->number; diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 2bc2479267..75ee71f896 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -79,6 +79,8 @@ safe_mode_t port_init(void) { HAL_RTC_Init(&_hrtc); + HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); + return NO_SAFE_MODE; } @@ -182,10 +184,12 @@ void RTC_WKUP_IRQHandler(void) { __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&_hrtc, RTC_FLAG_WUTF); __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); } - +volatile bool alarmed_already = false; void RTC_Alarm_IRQHandler(void) { - RTC->ISR = ~RTC_FLAG_ALRAF; + __HAL_RTC_ALARM_CLEAR_FLAG(&_hrtc, RTC_FLAG_ALRAF); + __HAL_RTC_ALARM_EXTI_CLEAR_FLAG(); HAL_RTC_DeactivateAlarm(&_hrtc, RTC_ALARM_A); + alarmed_already = true; } // Enable 1/1024 second tick. @@ -227,6 +231,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { alarm.Alarm = RTC_ALARM_A; HAL_RTC_SetAlarm_IT(&_hrtc, &alarm, RTC_FORMAT_BIN); + alarmed_already = false; } void port_sleep_until_interrupt(void) { @@ -235,6 +240,9 @@ void port_sleep_until_interrupt(void) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); (void) __get_FPSCR(); } + if (alarmed_already) { + return; + } __WFI(); } From 1c45a261c4ec26ea2d6a286e9ac54371980e0e41 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 08:44:35 -0500 Subject: [PATCH 189/919] network.rst: remove duplicate method directive --- docs/library/network.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/library/network.rst b/docs/library/network.rst index cdcc5f3232..bd32267fe9 100644 --- a/docs/library/network.rst +++ b/docs/library/network.rst @@ -247,7 +247,7 @@ Methods nic.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8')) .. method:: wlan.config('param') -.. method:: wlan.config(param=value, ...) + wlan.config(param=value, ...) Get or set general network interface parameters. These methods allow to work with additional parameters beyond standard IP configuration (as dealt with by From 61bab8e62e4cd4f0585bc387cde2943d6c4c8033 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 08:45:26 -0500 Subject: [PATCH 190/919] ulab/__init__.rst: fix attribute name; uint8 -> uint16 --- shared-bindings/ulab/__init__.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index 1379e56f3f..d8c10dcc86 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -126,7 +126,7 @@ Array type codes Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array` -.. attribute:: uint8 +.. attribute:: uint16 Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array` From cb818ca83266af6eae846bdc6e4be5f8fe722e6e Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 08:47:33 -0500 Subject: [PATCH 191/919] conf.py: update deprecated stylesheet API; 'add_stylesheet()' renamed to 'add_css_file()' --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 1dde709d75..f71e09adc1 100644 --- a/conf.py +++ b/conf.py @@ -357,4 +357,4 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} def setup(app): - app.add_stylesheet("customstyle.css") + app.add_css_file("customstyle.css") From ae07ced795e51653ce6d69e5a2d30688ca420dd4 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 08:49:32 -0500 Subject: [PATCH 192/919] conf.py: drop '.h' docs rendering (nothing to build); fix deprecated 'source_parsers' usage --- conf.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index f71e09adc1..19542ad9f0 100644 --- a/conf.py +++ b/conf.py @@ -17,7 +17,7 @@ import json import sys import os -from recommonmark.parser import CommonMarkParser +import recommonmark # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -55,16 +55,20 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.coverage', 'rstjinja', - 'c2rst' + 'c2rst', + 'recommonmark', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['templates'] # The suffix of source filenames. -source_suffix = ['.rst', '.md', '.c', '.h'] +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', + '.c': '' +} -source_parsers = {'.md': CommonMarkParser} # The encoding of source files. #source_encoding = 'utf-8-sig' From 4ac88e4df87f37cd4eba832174b58ffacc5aca90 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 09:13:02 -0500 Subject: [PATCH 193/919] build.yml: unpin Sphinx install; --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 455f83a21b..b56fb35b88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<3" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | gcc --version From 49fff2d9b47a51e0f2f600602aaa2fddc234b4be Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 9 Apr 2020 08:37:07 -0700 Subject: [PATCH 194/919] initial working fill --- shared-bindings/displayio/Bitmap.c | 19 ++++++++++++++++++ shared-bindings/displayio/Bitmap.h | 1 + shared-module/displayio/Bitmap.c | 32 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 91c17f2d13..48d04c2157 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -178,9 +178,28 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } +//| .. method:: fill() +//| +//| Fills the bitmap. +//| +STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { + displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t value = mp_obj_get_int(value_obj); + if (value >= 1 << common_hal_displayio_bitmap_get_bits_per_value(self)) { + mp_raise_ValueError(translate("pixel value requires too many bits")); + } + common_hal_displayio_bitmap_fill(self, value); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_bitmap_fill_obj, displayio_bitmap_obj_fill); + STATIC const mp_rom_map_elem_t displayio_bitmap_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_bitmap_height_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_bitmap_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&displayio_bitmap_fill_obj) }, + }; STATIC MP_DEFINE_CONST_DICT(displayio_bitmap_locals_dict, displayio_bitmap_locals_dict_table); diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 90694951fa..46c3373292 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -41,5 +41,6 @@ uint16_t common_hal_displayio_bitmap_get_width(displayio_bitmap_t *self); uint32_t common_hal_displayio_bitmap_get_bits_per_value(displayio_bitmap_t *self); void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y, uint32_t value); uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); +void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BITMAP_H diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 59971d25cc..2b0165f2f7 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -162,3 +162,35 @@ void displayio_bitmap_finish_refresh(displayio_bitmap_t *self) { self->dirty_area.x1 = 0; self->dirty_area.x2 = 0; } + +void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) { + + for (uint32_t x=0; xwidth; x++) { + for (uint32_t y=0; yheight; y++) { + int32_t row_start = y * self->stride; + uint32_t bytes_per_value = self->bits_per_value / 8; + if (bytes_per_value < 1) { + uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value); + uint32_t index = row_start + (x >> self->x_shift); + uint32_t word = self->data[index]; + word &= ~(self->bitmask << bit_position); + word |= (value & self->bitmask) << bit_position; + self->data[index] = word; + } else { + size_t* row = self->data + row_start; + if (bytes_per_value == 1) { + ((uint8_t*) row)[x] = value; + } else if (bytes_per_value == 2) { + ((uint16_t*) row)[x] = value; + } else if (bytes_per_value == 4) { + ((uint32_t*) row)[x] = value; + } + } + } + } + + self->dirty_area.x1 = 0; + self->dirty_area.x2 = self->width; + self->dirty_area.y1 = 0; + self->dirty_area.y2 = self->height; +} From dc7574684297cd3812fdb82967d0dfa7443af027 Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 9 Apr 2020 08:59:26 -0700 Subject: [PATCH 195/919] add docstring, clean up --- shared-bindings/displayio/Bitmap.c | 4 ++-- shared-module/displayio/Bitmap.c | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 48d04c2157..391f3e5955 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -178,9 +178,9 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| .. method:: fill() +//| .. method:: fill(value) //| -//| Fills the bitmap. +//| Fills the bitmap with the supplied palette index value. //| STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 2b0165f2f7..503c360730 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -164,11 +164,21 @@ void displayio_bitmap_finish_refresh(displayio_bitmap_t *self) { } void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only object")); + } + // Update the dirty area. + self->dirty_area.x1 = 0; + self->dirty_area.x2 = self->width; + self->dirty_area.y1 = 0; + self->dirty_area.y2 = self->height; + // Update our data + int32_t row_start; + uint32_t bytes_per_value = self->bits_per_value / 8; for (uint32_t x=0; xwidth; x++) { for (uint32_t y=0; yheight; y++) { - int32_t row_start = y * self->stride; - uint32_t bytes_per_value = self->bits_per_value / 8; + row_start = y * self->stride; if (bytes_per_value < 1) { uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value); uint32_t index = row_start + (x >> self->x_shift); @@ -188,9 +198,4 @@ void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) } } } - - self->dirty_area.x1 = 0; - self->dirty_area.x2 = self->width; - self->dirty_area.y1 = 0; - self->dirty_area.y2 = self->height; } From 92a0621e5956fee84591859ffa58c04be8e46158 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 6 Apr 2020 19:13:55 -0400 Subject: [PATCH 196/919] Add busio support, cleanup --- .github/workflows/build.yml | 1 + ports/stm/Makefile | 16 +- ports/stm/boards/STM32H743ZITx_FLASH.ld | 193 ----- ports/stm/boards/nucleo_h743zi_2/pins.c | 2 +- ports/stm/boards/startup_stm32f401xe.s | 448 ----------- ports/stm/boards/startup_stm32f405xx.s | 516 ------------ ports/stm/boards/startup_stm32f407xx.s | 516 ------------ ports/stm/boards/startup_stm32f411xe.s | 452 ----------- ports/stm/boards/startup_stm32f412zx.s | 524 ------------ ports/stm/boards/startup_stm32f767xx.s | 618 --------------- ports/stm/boards/startup_stm32h743xx.s | 748 ------------------ ports/stm/{ => boards}/system_stm32f4xx.c | 0 ports/stm/{ => boards}/system_stm32f7xx.c | 0 ports/stm/{ => boards}/system_stm32h7xx.c | 0 ports/stm/boards/thunderpack/mpconfigboard.mk | 2 +- ports/stm/common-hal/busio/I2C.c | 45 +- ports/stm/common-hal/busio/SPI.c | 49 +- ports/stm/common-hal/busio/UART.c | 13 + ports/stm/common-hal/digitalio/DigitalInOut.c | 9 +- ports/stm/fatfs_port.c | 2 +- ports/stm/mpconfigport.h | 18 + ports/stm/mpconfigport.mk | 4 +- .../peripherals/stm32f4/stm32f407xx/gpio.c | 2 +- .../peripherals/stm32f4/stm32f412zx/gpio.c | 1 - .../peripherals/stm32f7/stm32f767xx/clocks.c | 2 +- .../peripherals/stm32h7/stm32h743xx/clocks.c | 72 +- ports/stm/supervisor/internal_flash.h | 3 +- ports/stm/supervisor/port.c | 13 +- 28 files changed, 175 insertions(+), 4094 deletions(-) delete mode 100644 ports/stm/boards/STM32H743ZITx_FLASH.ld delete mode 100644 ports/stm/boards/startup_stm32f401xe.s delete mode 100644 ports/stm/boards/startup_stm32f405xx.s delete mode 100644 ports/stm/boards/startup_stm32f407xx.s delete mode 100644 ports/stm/boards/startup_stm32f411xe.s delete mode 100644 ports/stm/boards/startup_stm32f412zx.s delete mode 100644 ports/stm/boards/startup_stm32f767xx.s delete mode 100644 ports/stm/boards/startup_stm32h743xx.s rename ports/stm/{ => boards}/system_stm32f4xx.c (100%) rename ports/stm/{ => boards}/system_stm32f7xx.c (100%) rename ports/stm/{ => boards}/system_stm32h7xx.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 847cdf0249..8f9d03d008 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -189,6 +189,7 @@ jobs: - "mini_sam_m4" - "monster_m4sk" - "ndgarage_ndbit6" + - "nucleo_f767zi" - "nucleo_h743zi_2" - "ohs2020_badge" - "openbook_m4" diff --git a/ports/stm/Makefile b/ports/stm/Makefile index ec15e4f7f6..355fd1d026 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -25,11 +25,11 @@ # Select the board to build for. ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) +$(error You must provide a BOARD parameter) else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) - endif +ifeq ($(wildcard boards/$(BOARD)/.),) +$(error Invalid BOARD specified) +endif endif # If the build directory is not given, make it reflect the board name. @@ -193,7 +193,13 @@ SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ ll_exti.c \ ) -SRC_STM32 += system_stm32$(MCU_SERIES_LOWER)xx.c +# Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks. +# Does not exist for F4 and lower +ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) + SRC_STM32 += $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_hal_uart_ex.c +endif + +SRC_STM32 += boards/system_stm32$(MCU_SERIES_LOWER)xx.c SRC_C += \ background.c \ diff --git a/ports/stm/boards/STM32H743ZITx_FLASH.ld b/ports/stm/boards/STM32H743ZITx_FLASH.ld deleted file mode 100644 index 38b1fe4eaa..0000000000 --- a/ports/stm/boards/STM32H743ZITx_FLASH.ld +++ /dev/null @@ -1,193 +0,0 @@ -/* -****************************************************************************** -** - -** File : LinkerScript.ld -** -** Author : Auto-generated by System Workbench for STM32 -** -** Abstract : Linker script for STM32H743ZITx series -** 2048Kbytes FLASH and 1056Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2019 STMicroelectronics

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of STMicroelectronics nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20020000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K -RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K -RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K -ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >DTCMRAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >DTCMRAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >DTCMRAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/ports/stm/boards/nucleo_h743zi_2/pins.c b/ports/stm/boards/nucleo_h743zi_2/pins.c index dc2db9e184..3ba172df17 100644 --- a/ports/stm/boards/nucleo_h743zi_2/pins.c +++ b/ports/stm/boards/nucleo_h743zi_2/pins.c @@ -23,7 +23,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PD14) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB05) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PC06) }, diff --git a/ports/stm/boards/startup_stm32f401xe.s b/ports/stm/boards/startup_stm32f401xe.s deleted file mode 100644 index 815ac17197..0000000000 --- a/ports/stm/boards/startup_stm32f401xe.s +++ /dev/null @@ -1,448 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f401xe.s - * @author MCD Application Team - * @brief STM32F401xExx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ - /* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word 0 /* Reserved */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm/boards/startup_stm32f405xx.s b/ports/stm/boards/startup_stm32f405xx.s deleted file mode 100644 index 6b77655ca1..0000000000 --- a/ports/stm/boards/startup_stm32f405xx.s +++ /dev/null @@ -1,516 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f405xx.s - * @author MCD Application Team - * @brief STM32F405xx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FSMC_IRQHandler /* FSMC */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word HASH_RNG_IRQHandler /* Hash and Rng */ - .word FPU_IRQHandler /* FPU */ - - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FSMC_IRQHandler - .thumb_set FSMC_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak HASH_RNG_IRQHandler - .thumb_set HASH_RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - - diff --git a/ports/stm/boards/startup_stm32f407xx.s b/ports/stm/boards/startup_stm32f407xx.s deleted file mode 100644 index 6b77655ca1..0000000000 --- a/ports/stm/boards/startup_stm32f407xx.s +++ /dev/null @@ -1,516 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f405xx.s - * @author MCD Application Team - * @brief STM32F405xx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FSMC_IRQHandler /* FSMC */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word HASH_RNG_IRQHandler /* Hash and Rng */ - .word FPU_IRQHandler /* FPU */ - - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FSMC_IRQHandler - .thumb_set FSMC_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak HASH_RNG_IRQHandler - .thumb_set HASH_RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - - diff --git a/ports/stm/boards/startup_stm32f411xe.s b/ports/stm/boards/startup_stm32f411xe.s deleted file mode 100644 index 3aac640cb2..0000000000 --- a/ports/stm/boards/startup_stm32f411xe.s +++ /dev/null @@ -1,452 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f411xe.s - * @author MCD Application Team - * @brief STM32F411xExx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word 0 /* Reserved */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm/boards/startup_stm32f412zx.s b/ports/stm/boards/startup_stm32f412zx.s deleted file mode 100644 index 8012207957..0000000000 --- a/ports/stm/boards/startup_stm32f412zx.s +++ /dev/null @@ -1,524 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f412zx.s - * @author MCD Application Team - * @brief STM32F412Zx Devices vector table for GCC based toolchains. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M4 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m4 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M3. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - -g_pfnVectors: - .word _estack - .word Reset_Handler - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word 0 /* Reserved */ - .word SDIO_IRQHandler /* SDIO */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word TIM6_IRQHandler /* TIM6 */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter0 */ - .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter1 */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word RNG_IRQHandler /* RNG */ - .word FPU_IRQHandler /* FPU */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word QUADSPI_IRQHandler /* QuadSPI */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word FMPI2C1_EV_IRQHandler /* FMPI2C1 Event */ - .word FMPI2C1_ER_IRQHandler /* FMPI2C1 Error */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak SDIO_IRQHandler - .thumb_set SDIO_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak TIM6_IRQHandler - .thumb_set TIM6_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak DFSDM1_FLT0_IRQHandler - .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler - - .weak DFSDM1_FLT1_IRQHandler - .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak RNG_IRQHandler - .thumb_set RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - - .weak QUADSPI_IRQHandler - .thumb_set QUADSPI_IRQHandler,Default_Handler - - .weak FMPI2C1_EV_IRQHandler - .thumb_set FMPI2C1_EV_IRQHandler,Default_Handler - - .weak FMPI2C1_ER_IRQHandler - .thumb_set FMPI2C1_ER_IRQHandler,Default_Handler -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/startup_stm32f767xx.s b/ports/stm/boards/startup_stm32f767xx.s deleted file mode 100644 index 84309d4dad..0000000000 --- a/ports/stm/boards/startup_stm32f767xx.s +++ /dev/null @@ -1,618 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32f767xx.s - * @author MCD Application Team - * @brief STM32F767xx Devices vector table for GCC based toolchain. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M7 processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2016 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m7 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system initialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M7. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_IRQHandler /* PVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word CAN1_TX_IRQHandler /* CAN1 TX */ - .word CAN1_RX0_IRQHandler /* CAN1 RX0 */ - .word CAN1_RX1_IRQHandler /* CAN1 RX1 */ - .word CAN1_SCE_IRQHandler /* CAN1 SCE */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ - .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ - .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FMC_IRQHandler /* FMC */ - .word SDMMC1_IRQHandler /* SDMMC1 */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word ETH_IRQHandler /* Ethernet */ - .word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */ - .word CAN2_TX_IRQHandler /* CAN2 TX */ - .word CAN2_RX0_IRQHandler /* CAN2 RX0 */ - .word CAN2_RX1_IRQHandler /* CAN2 RX1 */ - .word CAN2_SCE_IRQHandler /* CAN2 SCE */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word DCMI_IRQHandler /* DCMI */ - .word 0 /* Reserved */ - .word RNG_IRQHandler /* RNG */ - .word FPU_IRQHandler /* FPU */ - .word UART7_IRQHandler /* UART7 */ - .word UART8_IRQHandler /* UART8 */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - .word SPI6_IRQHandler /* SPI6 */ - .word SAI1_IRQHandler /* SAI1 */ - .word LTDC_IRQHandler /* LTDC */ - .word LTDC_ER_IRQHandler /* LTDC error */ - .word DMA2D_IRQHandler /* DMA2D */ - .word SAI2_IRQHandler /* SAI2 */ - .word QUADSPI_IRQHandler /* QUADSPI */ - .word LPTIM1_IRQHandler /* LPTIM1 */ - .word CEC_IRQHandler /* HDMI_CEC */ - .word I2C4_EV_IRQHandler /* I2C4 Event */ - .word I2C4_ER_IRQHandler /* I2C4 Error */ - .word SPDIF_RX_IRQHandler /* SPDIF_RX */ - .word 0 /* Reserved */ - .word DFSDM1_FLT0_IRQHandler /* DFSDM1 Filter 0 global Interrupt */ - .word DFSDM1_FLT1_IRQHandler /* DFSDM1 Filter 1 global Interrupt */ - .word DFSDM1_FLT2_IRQHandler /* DFSDM1 Filter 2 global Interrupt */ - .word DFSDM1_FLT3_IRQHandler /* DFSDM1 Filter 3 global Interrupt */ - .word SDMMC2_IRQHandler /* SDMMC2 */ - .word CAN3_TX_IRQHandler /* CAN3 TX */ - .word CAN3_RX0_IRQHandler /* CAN3 RX0 */ - .word CAN3_RX1_IRQHandler /* CAN3 RX1 */ - .word CAN3_SCE_IRQHandler /* CAN3 SCE */ - .word JPEG_IRQHandler /* JPEG */ - .word MDIOS_IRQHandler /* MDIOS */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_IRQHandler - .thumb_set PVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak CAN1_TX_IRQHandler - .thumb_set CAN1_TX_IRQHandler,Default_Handler - - .weak CAN1_RX0_IRQHandler - .thumb_set CAN1_RX0_IRQHandler,Default_Handler - - .weak CAN1_RX1_IRQHandler - .thumb_set CAN1_RX1_IRQHandler,Default_Handler - - .weak CAN1_SCE_IRQHandler - .thumb_set CAN1_SCE_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_TIM9_IRQHandler - .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler - - .weak TIM1_UP_TIM10_IRQHandler - .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_TIM11_IRQHandler - .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FMC_IRQHandler - .thumb_set FMC_IRQHandler,Default_Handler - - .weak SDMMC1_IRQHandler - .thumb_set SDMMC1_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak ETH_IRQHandler - .thumb_set ETH_IRQHandler,Default_Handler - - .weak ETH_WKUP_IRQHandler - .thumb_set ETH_WKUP_IRQHandler,Default_Handler - - .weak CAN2_TX_IRQHandler - .thumb_set CAN2_TX_IRQHandler,Default_Handler - - .weak CAN2_RX0_IRQHandler - .thumb_set CAN2_RX0_IRQHandler,Default_Handler - - .weak CAN2_RX1_IRQHandler - .thumb_set CAN2_RX1_IRQHandler,Default_Handler - - .weak CAN2_SCE_IRQHandler - .thumb_set CAN2_SCE_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak DCMI_IRQHandler - .thumb_set DCMI_IRQHandler,Default_Handler - - .weak RNG_IRQHandler - .thumb_set RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak UART7_IRQHandler - .thumb_set UART7_IRQHandler,Default_Handler - - .weak UART8_IRQHandler - .thumb_set UART8_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - - .weak SPI6_IRQHandler - .thumb_set SPI6_IRQHandler,Default_Handler - - .weak SAI1_IRQHandler - .thumb_set SAI1_IRQHandler,Default_Handler - - .weak LTDC_IRQHandler - .thumb_set LTDC_IRQHandler,Default_Handler - - .weak LTDC_ER_IRQHandler - .thumb_set LTDC_ER_IRQHandler,Default_Handler - - .weak DMA2D_IRQHandler - .thumb_set DMA2D_IRQHandler,Default_Handler - - .weak SAI2_IRQHandler - .thumb_set SAI2_IRQHandler,Default_Handler - - .weak QUADSPI_IRQHandler - .thumb_set QUADSPI_IRQHandler,Default_Handler - - .weak LPTIM1_IRQHandler - .thumb_set LPTIM1_IRQHandler,Default_Handler - - .weak CEC_IRQHandler - .thumb_set CEC_IRQHandler,Default_Handler - - .weak I2C4_EV_IRQHandler - .thumb_set I2C4_EV_IRQHandler,Default_Handler - - .weak I2C4_ER_IRQHandler - .thumb_set I2C4_ER_IRQHandler,Default_Handler - - .weak SPDIF_RX_IRQHandler - .thumb_set SPDIF_RX_IRQHandler,Default_Handler - - .weak DFSDM1_FLT0_IRQHandler - .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler - - .weak DFSDM1_FLT1_IRQHandler - .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler - - .weak DFSDM1_FLT2_IRQHandler - .thumb_set DFSDM1_FLT2_IRQHandler,Default_Handler - - .weak DFSDM1_FLT3_IRQHandler - .thumb_set DFSDM1_FLT3_IRQHandler,Default_Handler - - .weak SDMMC2_IRQHandler - .thumb_set SDMMC2_IRQHandler,Default_Handler - - .weak CAN3_TX_IRQHandler - .thumb_set CAN3_TX_IRQHandler,Default_Handler - - .weak CAN3_RX0_IRQHandler - .thumb_set CAN3_RX0_IRQHandler,Default_Handler - - .weak CAN3_RX1_IRQHandler - .thumb_set CAN3_RX1_IRQHandler,Default_Handler - - .weak CAN3_SCE_IRQHandler - .thumb_set CAN3_SCE_IRQHandler,Default_Handler - - .weak JPEG_IRQHandler - .thumb_set JPEG_IRQHandler,Default_Handler - - .weak MDIOS_IRQHandler - .thumb_set MDIOS_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm/boards/startup_stm32h743xx.s b/ports/stm/boards/startup_stm32h743xx.s deleted file mode 100644 index 357f7a7bab..0000000000 --- a/ports/stm/boards/startup_stm32h743xx.s +++ /dev/null @@ -1,748 +0,0 @@ -/** - ****************************************************************************** - * @file startup_stm32h743xx.s - * @author MCD Application Team - * @brief STM32H743xx Devices vector table for GCC based toolchain. - * This module performs: - * - Set the initial SP - * - Set the initial PC == Reset_Handler, - * - Set the vector table entries with the exceptions ISR address - * - Branches to main in the C library (which eventually - * calls main()). - * After Reset the Cortex-M processor is in Thread mode, - * priority is Privileged, and the Stack is set to Main. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - - .syntax unified - .cpu cortex-m7 - .fpu softvfp - .thumb - -.global g_pfnVectors -.global Default_Handler - -/* start address for the initialization values of the .data section. -defined in linker script */ -.word _sidata -/* start address for the .data section. defined in linker script */ -.word _sdata -/* end address for the .data section. defined in linker script */ -.word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss -/* stack used for SystemInit_ExtMemCtl; always internal RAM used */ - -/** - * @brief This is the code that gets called when the processor first - * starts execution following a reset event. Only the absolutely - * necessary set is performed, after which the application - * supplied main() routine is called. - * @param None - * @retval : None -*/ - - .section .text.Reset_Handler - .weak Reset_Handler - .type Reset_Handler, %function -Reset_Handler: - ldr sp, =_estack /* set stack pointer */ - -/* Copy the data segment initializers from flash to SRAM */ - movs r1, #0 - b LoopCopyDataInit - -CopyDataInit: - ldr r3, =_sidata - ldr r3, [r3, r1] - str r3, [r0, r1] - adds r1, r1, #4 - -LoopCopyDataInit: - ldr r0, =_sdata - ldr r3, =_edata - adds r2, r0, r1 - cmp r2, r3 - bcc CopyDataInit - ldr r2, =_sbss - b LoopFillZerobss -/* Zero fill the bss segment. */ -FillZerobss: - movs r3, #0 - str r3, [r2], #4 - -LoopFillZerobss: - ldr r3, = _ebss - cmp r2, r3 - bcc FillZerobss - -/* Call the clock system intitialization function.*/ - bl SystemInit -/* Call static constructors */ -/* bl __libc_init_array */ -/* Call the application's entry point.*/ - bl main - bx lr -.size Reset_Handler, .-Reset_Handler - -/** - * @brief This is the code that gets called when the processor receives an - * unexpected interrupt. This simply enters an infinite loop, preserving - * the system state for examination by a debugger. - * @param None - * @retval None -*/ - .section .text.Default_Handler,"ax",%progbits -Default_Handler: -Infinite_Loop: - b Infinite_Loop - .size Default_Handler, .-Default_Handler -/****************************************************************************** -* -* The minimal vector table for a Cortex M. Note that the proper constructs -* must be placed on this to ensure that it ends up at physical address -* 0x0000.0000. -* -*******************************************************************************/ - .section .isr_vector,"a",%progbits - .type g_pfnVectors, %object - .size g_pfnVectors, .-g_pfnVectors - - -g_pfnVectors: - .word _estack - .word Reset_Handler - - .word NMI_Handler - .word HardFault_Handler - .word MemManage_Handler - .word BusFault_Handler - .word UsageFault_Handler - .word 0 - .word 0 - .word 0 - .word 0 - .word SVC_Handler - .word DebugMon_Handler - .word 0 - .word PendSV_Handler - .word SysTick_Handler - - /* External Interrupts */ - .word WWDG_IRQHandler /* Window WatchDog */ - .word PVD_AVD_IRQHandler /* PVD/AVD through EXTI Line detection */ - .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ - .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ - .word FLASH_IRQHandler /* FLASH */ - .word RCC_IRQHandler /* RCC */ - .word EXTI0_IRQHandler /* EXTI Line0 */ - .word EXTI1_IRQHandler /* EXTI Line1 */ - .word EXTI2_IRQHandler /* EXTI Line2 */ - .word EXTI3_IRQHandler /* EXTI Line3 */ - .word EXTI4_IRQHandler /* EXTI Line4 */ - .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ - .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ - .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ - .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ - .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ - .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ - .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ - .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ - .word FDCAN1_IT0_IRQHandler /* FDCAN1 interrupt line 0 */ - .word FDCAN2_IT0_IRQHandler /* FDCAN2 interrupt line 0 */ - .word FDCAN1_IT1_IRQHandler /* FDCAN1 interrupt line 1 */ - .word FDCAN2_IT1_IRQHandler /* FDCAN2 interrupt line 1 */ - .word EXTI9_5_IRQHandler /* External Line[9:5]s */ - .word TIM1_BRK_IRQHandler /* TIM1 Break interrupt */ - .word TIM1_UP_IRQHandler /* TIM1 Update interrupt */ - .word TIM1_TRG_COM_IRQHandler /* TIM1 Trigger and Commutation interrupt */ - .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ - .word TIM2_IRQHandler /* TIM2 */ - .word TIM3_IRQHandler /* TIM3 */ - .word TIM4_IRQHandler /* TIM4 */ - .word I2C1_EV_IRQHandler /* I2C1 Event */ - .word I2C1_ER_IRQHandler /* I2C1 Error */ - .word I2C2_EV_IRQHandler /* I2C2 Event */ - .word I2C2_ER_IRQHandler /* I2C2 Error */ - .word SPI1_IRQHandler /* SPI1 */ - .word SPI2_IRQHandler /* SPI2 */ - .word USART1_IRQHandler /* USART1 */ - .word USART2_IRQHandler /* USART2 */ - .word USART3_IRQHandler /* USART3 */ - .word EXTI15_10_IRQHandler /* External Line[15:10]s */ - .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ - .word 0 /* Reserved */ - .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */ - .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */ - .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */ - .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */ - .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ - .word FMC_IRQHandler /* FMC */ - .word SDMMC1_IRQHandler /* SDMMC1 */ - .word TIM5_IRQHandler /* TIM5 */ - .word SPI3_IRQHandler /* SPI3 */ - .word UART4_IRQHandler /* UART4 */ - .word UART5_IRQHandler /* UART5 */ - .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */ - .word TIM7_IRQHandler /* TIM7 */ - .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ - .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ - .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ - .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ - .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ - .word ETH_IRQHandler /* Ethernet */ - .word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */ - .word FDCAN_CAL_IRQHandler /* FDCAN calibration unit interrupt*/ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ - .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ - .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ - .word USART6_IRQHandler /* USART6 */ - .word I2C3_EV_IRQHandler /* I2C3 event */ - .word I2C3_ER_IRQHandler /* I2C3 error */ - .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */ - .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */ - .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */ - .word OTG_HS_IRQHandler /* USB OTG HS */ - .word DCMI_IRQHandler /* DCMI */ - .word 0 /* Reserved */ - .word RNG_IRQHandler /* Rng */ - .word FPU_IRQHandler /* FPU */ - .word UART7_IRQHandler /* UART7 */ - .word UART8_IRQHandler /* UART8 */ - .word SPI4_IRQHandler /* SPI4 */ - .word SPI5_IRQHandler /* SPI5 */ - .word SPI6_IRQHandler /* SPI6 */ - .word SAI1_IRQHandler /* SAI1 */ - .word LTDC_IRQHandler /* LTDC */ - .word LTDC_ER_IRQHandler /* LTDC error */ - .word DMA2D_IRQHandler /* DMA2D */ - .word SAI2_IRQHandler /* SAI2 */ - .word QUADSPI_IRQHandler /* QUADSPI */ - .word LPTIM1_IRQHandler /* LPTIM1 */ - .word CEC_IRQHandler /* HDMI_CEC */ - .word I2C4_EV_IRQHandler /* I2C4 Event */ - .word I2C4_ER_IRQHandler /* I2C4 Error */ - .word SPDIF_RX_IRQHandler /* SPDIF_RX */ - .word OTG_FS_EP1_OUT_IRQHandler /* USB OTG FS End Point 1 Out */ - .word OTG_FS_EP1_IN_IRQHandler /* USB OTG FS End Point 1 In */ - .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI */ - .word OTG_FS_IRQHandler /* USB OTG FS */ - .word DMAMUX1_OVR_IRQHandler /* DMAMUX1 Overrun interrupt */ - .word HRTIM1_Master_IRQHandler /* HRTIM Master Timer global Interrupt */ - .word HRTIM1_TIMA_IRQHandler /* HRTIM Timer A global Interrupt */ - .word HRTIM1_TIMB_IRQHandler /* HRTIM Timer B global Interrupt */ - .word HRTIM1_TIMC_IRQHandler /* HRTIM Timer C global Interrupt */ - .word HRTIM1_TIMD_IRQHandler /* HRTIM Timer D global Interrupt */ - .word HRTIM1_TIME_IRQHandler /* HRTIM Timer E global Interrupt */ - .word HRTIM1_FLT_IRQHandler /* HRTIM Fault global Interrupt */ - .word DFSDM1_FLT0_IRQHandler /* DFSDM Filter0 Interrupt */ - .word DFSDM1_FLT1_IRQHandler /* DFSDM Filter1 Interrupt */ - .word DFSDM1_FLT2_IRQHandler /* DFSDM Filter2 Interrupt */ - .word DFSDM1_FLT3_IRQHandler /* DFSDM Filter3 Interrupt */ - .word SAI3_IRQHandler /* SAI3 global Interrupt */ - .word SWPMI1_IRQHandler /* Serial Wire Interface 1 global interrupt */ - .word TIM15_IRQHandler /* TIM15 global Interrupt */ - .word TIM16_IRQHandler /* TIM16 global Interrupt */ - .word TIM17_IRQHandler /* TIM17 global Interrupt */ - .word MDIOS_WKUP_IRQHandler /* MDIOS Wakeup Interrupt */ - .word MDIOS_IRQHandler /* MDIOS global Interrupt */ - .word JPEG_IRQHandler /* JPEG global Interrupt */ - .word MDMA_IRQHandler /* MDMA global Interrupt */ - .word 0 /* Reserved */ - .word SDMMC2_IRQHandler /* SDMMC2 global Interrupt */ - .word HSEM1_IRQHandler /* HSEM1 global Interrupt */ - .word 0 /* Reserved */ - .word ADC3_IRQHandler /* ADC3 global Interrupt */ - .word DMAMUX2_OVR_IRQHandler /* DMAMUX Overrun interrupt */ - .word BDMA_Channel0_IRQHandler /* BDMA Channel 0 global Interrupt */ - .word BDMA_Channel1_IRQHandler /* BDMA Channel 1 global Interrupt */ - .word BDMA_Channel2_IRQHandler /* BDMA Channel 2 global Interrupt */ - .word BDMA_Channel3_IRQHandler /* BDMA Channel 3 global Interrupt */ - .word BDMA_Channel4_IRQHandler /* BDMA Channel 4 global Interrupt */ - .word BDMA_Channel5_IRQHandler /* BDMA Channel 5 global Interrupt */ - .word BDMA_Channel6_IRQHandler /* BDMA Channel 6 global Interrupt */ - .word BDMA_Channel7_IRQHandler /* BDMA Channel 7 global Interrupt */ - .word COMP1_IRQHandler /* COMP1 global Interrupt */ - .word LPTIM2_IRQHandler /* LP TIM2 global interrupt */ - .word LPTIM3_IRQHandler /* LP TIM3 global interrupt */ - .word LPTIM4_IRQHandler /* LP TIM4 global interrupt */ - .word LPTIM5_IRQHandler /* LP TIM5 global interrupt */ - .word LPUART1_IRQHandler /* LP UART1 interrupt */ - .word 0 /* Reserved */ - .word CRS_IRQHandler /* Clock Recovery Global Interrupt */ - .word ECC_IRQHandler /* ECC diagnostic Global Interrupt */ - .word SAI4_IRQHandler /* SAI4 global interrupt */ - .word 0 /* Reserved */ - .word 0 /* Reserved */ - .word WAKEUP_PIN_IRQHandler /* Interrupt for all 6 wake-up pins */ - -/******************************************************************************* -* -* Provide weak aliases for each Exception handler to the Default_Handler. -* As they are weak aliases, any function with the same name will override -* this definition. -* -*******************************************************************************/ - .weak NMI_Handler - .thumb_set NMI_Handler,Default_Handler - - .weak HardFault_Handler - .thumb_set HardFault_Handler,Default_Handler - - .weak MemManage_Handler - .thumb_set MemManage_Handler,Default_Handler - - .weak BusFault_Handler - .thumb_set BusFault_Handler,Default_Handler - - .weak UsageFault_Handler - .thumb_set UsageFault_Handler,Default_Handler - - .weak SVC_Handler - .thumb_set SVC_Handler,Default_Handler - - .weak DebugMon_Handler - .thumb_set DebugMon_Handler,Default_Handler - - .weak PendSV_Handler - .thumb_set PendSV_Handler,Default_Handler - - .weak SysTick_Handler - .thumb_set SysTick_Handler,Default_Handler - - .weak WWDG_IRQHandler - .thumb_set WWDG_IRQHandler,Default_Handler - - .weak PVD_AVD_IRQHandler - .thumb_set PVD_AVD_IRQHandler,Default_Handler - - .weak TAMP_STAMP_IRQHandler - .thumb_set TAMP_STAMP_IRQHandler,Default_Handler - - .weak RTC_WKUP_IRQHandler - .thumb_set RTC_WKUP_IRQHandler,Default_Handler - - .weak FLASH_IRQHandler - .thumb_set FLASH_IRQHandler,Default_Handler - - .weak RCC_IRQHandler - .thumb_set RCC_IRQHandler,Default_Handler - - .weak EXTI0_IRQHandler - .thumb_set EXTI0_IRQHandler,Default_Handler - - .weak EXTI1_IRQHandler - .thumb_set EXTI1_IRQHandler,Default_Handler - - .weak EXTI2_IRQHandler - .thumb_set EXTI2_IRQHandler,Default_Handler - - .weak EXTI3_IRQHandler - .thumb_set EXTI3_IRQHandler,Default_Handler - - .weak EXTI4_IRQHandler - .thumb_set EXTI4_IRQHandler,Default_Handler - - .weak DMA1_Stream0_IRQHandler - .thumb_set DMA1_Stream0_IRQHandler,Default_Handler - - .weak DMA1_Stream1_IRQHandler - .thumb_set DMA1_Stream1_IRQHandler,Default_Handler - - .weak DMA1_Stream2_IRQHandler - .thumb_set DMA1_Stream2_IRQHandler,Default_Handler - - .weak DMA1_Stream3_IRQHandler - .thumb_set DMA1_Stream3_IRQHandler,Default_Handler - - .weak DMA1_Stream4_IRQHandler - .thumb_set DMA1_Stream4_IRQHandler,Default_Handler - - .weak DMA1_Stream5_IRQHandler - .thumb_set DMA1_Stream5_IRQHandler,Default_Handler - - .weak DMA1_Stream6_IRQHandler - .thumb_set DMA1_Stream6_IRQHandler,Default_Handler - - .weak ADC_IRQHandler - .thumb_set ADC_IRQHandler,Default_Handler - - .weak FDCAN1_IT0_IRQHandler - .thumb_set FDCAN1_IT0_IRQHandler,Default_Handler - - .weak FDCAN2_IT0_IRQHandler - .thumb_set FDCAN2_IT0_IRQHandler,Default_Handler - - .weak FDCAN1_IT1_IRQHandler - .thumb_set FDCAN1_IT1_IRQHandler,Default_Handler - - .weak FDCAN2_IT1_IRQHandler - .thumb_set FDCAN2_IT1_IRQHandler,Default_Handler - - .weak EXTI9_5_IRQHandler - .thumb_set EXTI9_5_IRQHandler,Default_Handler - - .weak TIM1_BRK_IRQHandler - .thumb_set TIM1_BRK_IRQHandler,Default_Handler - - .weak TIM1_UP_IRQHandler - .thumb_set TIM1_UP_IRQHandler,Default_Handler - - .weak TIM1_TRG_COM_IRQHandler - .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler - - .weak TIM1_CC_IRQHandler - .thumb_set TIM1_CC_IRQHandler,Default_Handler - - .weak TIM2_IRQHandler - .thumb_set TIM2_IRQHandler,Default_Handler - - .weak TIM3_IRQHandler - .thumb_set TIM3_IRQHandler,Default_Handler - - .weak TIM4_IRQHandler - .thumb_set TIM4_IRQHandler,Default_Handler - - .weak I2C1_EV_IRQHandler - .thumb_set I2C1_EV_IRQHandler,Default_Handler - - .weak I2C1_ER_IRQHandler - .thumb_set I2C1_ER_IRQHandler,Default_Handler - - .weak I2C2_EV_IRQHandler - .thumb_set I2C2_EV_IRQHandler,Default_Handler - - .weak I2C2_ER_IRQHandler - .thumb_set I2C2_ER_IRQHandler,Default_Handler - - .weak SPI1_IRQHandler - .thumb_set SPI1_IRQHandler,Default_Handler - - .weak SPI2_IRQHandler - .thumb_set SPI2_IRQHandler,Default_Handler - - .weak USART1_IRQHandler - .thumb_set USART1_IRQHandler,Default_Handler - - .weak USART2_IRQHandler - .thumb_set USART2_IRQHandler,Default_Handler - - .weak USART3_IRQHandler - .thumb_set USART3_IRQHandler,Default_Handler - - .weak EXTI15_10_IRQHandler - .thumb_set EXTI15_10_IRQHandler,Default_Handler - - .weak RTC_Alarm_IRQHandler - .thumb_set RTC_Alarm_IRQHandler,Default_Handler - - .weak TIM8_BRK_TIM12_IRQHandler - .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler - - .weak TIM8_UP_TIM13_IRQHandler - .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler - - .weak TIM8_TRG_COM_TIM14_IRQHandler - .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler - - .weak TIM8_CC_IRQHandler - .thumb_set TIM8_CC_IRQHandler,Default_Handler - - .weak DMA1_Stream7_IRQHandler - .thumb_set DMA1_Stream7_IRQHandler,Default_Handler - - .weak FMC_IRQHandler - .thumb_set FMC_IRQHandler,Default_Handler - - .weak SDMMC1_IRQHandler - .thumb_set SDMMC1_IRQHandler,Default_Handler - - .weak TIM5_IRQHandler - .thumb_set TIM5_IRQHandler,Default_Handler - - .weak SPI3_IRQHandler - .thumb_set SPI3_IRQHandler,Default_Handler - - .weak UART4_IRQHandler - .thumb_set UART4_IRQHandler,Default_Handler - - .weak UART5_IRQHandler - .thumb_set UART5_IRQHandler,Default_Handler - - .weak TIM6_DAC_IRQHandler - .thumb_set TIM6_DAC_IRQHandler,Default_Handler - - .weak TIM7_IRQHandler - .thumb_set TIM7_IRQHandler,Default_Handler - - .weak DMA2_Stream0_IRQHandler - .thumb_set DMA2_Stream0_IRQHandler,Default_Handler - - .weak DMA2_Stream1_IRQHandler - .thumb_set DMA2_Stream1_IRQHandler,Default_Handler - - .weak DMA2_Stream2_IRQHandler - .thumb_set DMA2_Stream2_IRQHandler,Default_Handler - - .weak DMA2_Stream3_IRQHandler - .thumb_set DMA2_Stream3_IRQHandler,Default_Handler - - .weak DMA2_Stream4_IRQHandler - .thumb_set DMA2_Stream4_IRQHandler,Default_Handler - - .weak ETH_IRQHandler - .thumb_set ETH_IRQHandler,Default_Handler - - .weak ETH_WKUP_IRQHandler - .thumb_set ETH_WKUP_IRQHandler,Default_Handler - - .weak FDCAN_CAL_IRQHandler - .thumb_set FDCAN_CAL_IRQHandler,Default_Handler - - .weak DMA2_Stream5_IRQHandler - .thumb_set DMA2_Stream5_IRQHandler,Default_Handler - - .weak DMA2_Stream6_IRQHandler - .thumb_set DMA2_Stream6_IRQHandler,Default_Handler - - .weak DMA2_Stream7_IRQHandler - .thumb_set DMA2_Stream7_IRQHandler,Default_Handler - - .weak USART6_IRQHandler - .thumb_set USART6_IRQHandler,Default_Handler - - .weak I2C3_EV_IRQHandler - .thumb_set I2C3_EV_IRQHandler,Default_Handler - - .weak I2C3_ER_IRQHandler - .thumb_set I2C3_ER_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_OUT_IRQHandler - .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_HS_EP1_IN_IRQHandler - .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_HS_WKUP_IRQHandler - .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler - - .weak OTG_HS_IRQHandler - .thumb_set OTG_HS_IRQHandler,Default_Handler - - .weak DCMI_IRQHandler - .thumb_set DCMI_IRQHandler,Default_Handler - - .weak RNG_IRQHandler - .thumb_set RNG_IRQHandler,Default_Handler - - .weak FPU_IRQHandler - .thumb_set FPU_IRQHandler,Default_Handler - - .weak UART7_IRQHandler - .thumb_set UART7_IRQHandler,Default_Handler - - .weak UART8_IRQHandler - .thumb_set UART8_IRQHandler,Default_Handler - - .weak SPI4_IRQHandler - .thumb_set SPI4_IRQHandler,Default_Handler - - .weak SPI5_IRQHandler - .thumb_set SPI5_IRQHandler,Default_Handler - - .weak SPI6_IRQHandler - .thumb_set SPI6_IRQHandler,Default_Handler - - .weak SAI1_IRQHandler - .thumb_set SAI1_IRQHandler,Default_Handler - - .weak LTDC_IRQHandler - .thumb_set LTDC_IRQHandler,Default_Handler - - .weak LTDC_ER_IRQHandler - .thumb_set LTDC_ER_IRQHandler,Default_Handler - - .weak DMA2D_IRQHandler - .thumb_set DMA2D_IRQHandler,Default_Handler - - .weak SAI2_IRQHandler - .thumb_set SAI2_IRQHandler,Default_Handler - - .weak QUADSPI_IRQHandler - .thumb_set QUADSPI_IRQHandler,Default_Handler - - .weak LPTIM1_IRQHandler - .thumb_set LPTIM1_IRQHandler,Default_Handler - - .weak CEC_IRQHandler - .thumb_set CEC_IRQHandler,Default_Handler - - .weak I2C4_EV_IRQHandler - .thumb_set I2C4_EV_IRQHandler,Default_Handler - - .weak I2C4_ER_IRQHandler - .thumb_set I2C4_ER_IRQHandler,Default_Handler - - .weak SPDIF_RX_IRQHandler - .thumb_set SPDIF_RX_IRQHandler,Default_Handler - - .weak OTG_FS_EP1_OUT_IRQHandler - .thumb_set OTG_FS_EP1_OUT_IRQHandler,Default_Handler - - .weak OTG_FS_EP1_IN_IRQHandler - .thumb_set OTG_FS_EP1_IN_IRQHandler,Default_Handler - - .weak OTG_FS_WKUP_IRQHandler - .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler - - .weak OTG_FS_IRQHandler - .thumb_set OTG_FS_IRQHandler,Default_Handler - - .weak DMAMUX1_OVR_IRQHandler - .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler - - .weak HRTIM1_Master_IRQHandler - .thumb_set HRTIM1_Master_IRQHandler,Default_Handler - - .weak HRTIM1_TIMA_IRQHandler - .thumb_set HRTIM1_TIMA_IRQHandler,Default_Handler - - .weak HRTIM1_TIMB_IRQHandler - .thumb_set HRTIM1_TIMB_IRQHandler,Default_Handler - - .weak HRTIM1_TIMC_IRQHandler - .thumb_set HRTIM1_TIMC_IRQHandler,Default_Handler - - .weak HRTIM1_TIMD_IRQHandler - .thumb_set HRTIM1_TIMD_IRQHandler,Default_Handler - - .weak HRTIM1_TIME_IRQHandler - .thumb_set HRTIM1_TIME_IRQHandler,Default_Handler - - .weak HRTIM1_FLT_IRQHandler - .thumb_set HRTIM1_FLT_IRQHandler,Default_Handler - - .weak DFSDM1_FLT0_IRQHandler - .thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler - - .weak DFSDM1_FLT1_IRQHandler - .thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler - - .weak DFSDM1_FLT2_IRQHandler - .thumb_set DFSDM1_FLT2_IRQHandler,Default_Handler - - .weak DFSDM1_FLT3_IRQHandler - .thumb_set DFSDM1_FLT3_IRQHandler,Default_Handler - - .weak SAI3_IRQHandler - .thumb_set SAI3_IRQHandler,Default_Handler - - .weak SWPMI1_IRQHandler - .thumb_set SWPMI1_IRQHandler,Default_Handler - - .weak TIM15_IRQHandler - .thumb_set TIM15_IRQHandler,Default_Handler - - .weak TIM16_IRQHandler - .thumb_set TIM16_IRQHandler,Default_Handler - - .weak TIM17_IRQHandler - .thumb_set TIM17_IRQHandler,Default_Handler - - .weak MDIOS_WKUP_IRQHandler - .thumb_set MDIOS_WKUP_IRQHandler,Default_Handler - - .weak MDIOS_IRQHandler - .thumb_set MDIOS_IRQHandler,Default_Handler - - .weak JPEG_IRQHandler - .thumb_set JPEG_IRQHandler,Default_Handler - - .weak MDMA_IRQHandler - .thumb_set MDMA_IRQHandler,Default_Handler - - .weak SDMMC2_IRQHandler - .thumb_set SDMMC2_IRQHandler,Default_Handler - - .weak HSEM1_IRQHandler - .thumb_set HSEM1_IRQHandler,Default_Handler - - .weak ADC3_IRQHandler - .thumb_set ADC3_IRQHandler,Default_Handler - - .weak DMAMUX2_OVR_IRQHandler - .thumb_set DMAMUX2_OVR_IRQHandler,Default_Handler - - .weak BDMA_Channel0_IRQHandler - .thumb_set BDMA_Channel0_IRQHandler,Default_Handler - - .weak BDMA_Channel1_IRQHandler - .thumb_set BDMA_Channel1_IRQHandler,Default_Handler - - .weak BDMA_Channel2_IRQHandler - .thumb_set BDMA_Channel2_IRQHandler,Default_Handler - - .weak BDMA_Channel3_IRQHandler - .thumb_set BDMA_Channel3_IRQHandler,Default_Handler - - .weak BDMA_Channel4_IRQHandler - .thumb_set BDMA_Channel4_IRQHandler,Default_Handler - - .weak BDMA_Channel5_IRQHandler - .thumb_set BDMA_Channel5_IRQHandler,Default_Handler - - .weak BDMA_Channel6_IRQHandler - .thumb_set BDMA_Channel6_IRQHandler,Default_Handler - - .weak BDMA_Channel7_IRQHandler - .thumb_set BDMA_Channel7_IRQHandler,Default_Handler - - .weak COMP1_IRQHandler - .thumb_set COMP1_IRQHandler,Default_Handler - - .weak LPTIM2_IRQHandler - .thumb_set LPTIM2_IRQHandler,Default_Handler - - .weak LPTIM3_IRQHandler - .thumb_set LPTIM3_IRQHandler,Default_Handler - - .weak LPTIM4_IRQHandler - .thumb_set LPTIM4_IRQHandler,Default_Handler - - .weak LPTIM5_IRQHandler - .thumb_set LPTIM5_IRQHandler,Default_Handler - - .weak LPUART1_IRQHandler - .thumb_set LPUART1_IRQHandler,Default_Handler - - .weak CRS_IRQHandler - .thumb_set CRS_IRQHandler,Default_Handler - - .weak ECC_IRQHandler - .thumb_set ECC_IRQHandler,Default_Handler - - .weak SAI4_IRQHandler - .thumb_set SAI4_IRQHandler,Default_Handler - - .weak WAKEUP_PIN_IRQHandler - .thumb_set WAKEUP_PIN_IRQHandler,Default_Handler - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/ports/stm/system_stm32f4xx.c b/ports/stm/boards/system_stm32f4xx.c similarity index 100% rename from ports/stm/system_stm32f4xx.c rename to ports/stm/boards/system_stm32f4xx.c diff --git a/ports/stm/system_stm32f7xx.c b/ports/stm/boards/system_stm32f7xx.c similarity index 100% rename from ports/stm/system_stm32f7xx.c rename to ports/stm/boards/system_stm32f7xx.c diff --git a/ports/stm/system_stm32h7xx.c b/ports/stm/boards/system_stm32h7xx.c similarity index 100% rename from ports/stm/system_stm32h7xx.c rename to ports/stm/boards/system_stm32h7xx.c diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 40b0e92506..37aded8366 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -11,7 +11,7 @@ CIRCUITPY_NVM = 1 MCU_SERIES = F4 MCU_VARIANT = STM32F411xE -MCU_PACKAGE = 48 +MCU_PACKAGE = UFQFPN48 LD_FILE = boards/common_nvm.ld LD_FILE = boards/STM32F411_nvm.ld diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 4daefb58bc..31a1278d35 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -34,8 +34,9 @@ #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -//arrays use 0 based numbering: I2C1 is stored at index 0 -#define MAX_I2C 3 +// Arrays use 0 based numbering: I2C1 is stored at index 0 +#define MAX_I2C 4 + STATIC bool reserved_i2c[MAX_I2C]; STATIC bool never_reset_i2c[MAX_I2C]; @@ -58,31 +59,37 @@ void i2c_reset(void) { void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { - //match pins to I2C objects + // Match pins to I2C objects I2C_TypeDef * I2Cx; uint8_t sda_len = MP_ARRAY_SIZE(mcu_i2c_sda_list); uint8_t scl_len = MP_ARRAY_SIZE(mcu_i2c_scl_list); bool i2c_taken = false; + bool search_done = false; for (uint i = 0; i < sda_len; i++) { if (mcu_i2c_sda_list[i].pin == sda) { for (uint j = 0; j < scl_len; j++) { if ((mcu_i2c_scl_list[j].pin == scl) && (mcu_i2c_scl_list[j].periph_index == mcu_i2c_sda_list[i].periph_index)) { - //keep looking if the I2C is taken, could be another SCL that works - if (reserved_i2c[mcu_i2c_scl_list[i].periph_index - 1]) { + // Keep looking if the I2C is taken, could be another SCL that works + if (reserved_i2c[mcu_i2c_scl_list[j].periph_index - 1]) { i2c_taken = true; continue; } self->scl = &mcu_i2c_scl_list[j]; self->sda = &mcu_i2c_sda_list[i]; + // Multi-level break here, or it'll pick the highest numbered peripheral (inefficient) + search_done = true; break; } } + if (search_done) { + break; + } } } - //handle typedef selection, errors + // Handle typedef selection, errors if (self->sda != NULL && self->scl != NULL ) { I2Cx = mcu_i2c_banks[self->sda->periph_index - 1]; } else { @@ -93,7 +100,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } } - //Start GPIO for each pin + // Start GPIO for each pin GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = pin_mask(sda->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; @@ -109,13 +116,19 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, GPIO_InitStruct.Alternate = self->scl->altfn_index; HAL_GPIO_Init(pin_port(scl->port), &GPIO_InitStruct); - //Note: due to I2C soft reboot issue, do not relocate clock init. + // Note: due to I2C soft reboot issue, do not relocate clock init. i2c_clock_enable(1 << (self->sda->periph_index - 1)); reserved_i2c[self->sda->periph_index - 1] = true; - self->handle.Instance = I2Cx; + // Handle the HAL handle differences + #if (CPY_STM32H7 || CPY_STM32F7) + self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples + #else self->handle.Init.ClockSpeed = 100000; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; + #endif + + self->handle.Instance = I2Cx; self->handle.Init.OwnAddress1 = 0; self->handle.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; self->handle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; @@ -206,7 +219,7 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, } STATIC void i2c_clock_enable(uint8_t mask) { - //Note: hard reset required due to soft reboot issue. + // Note: hard reset required due to soft reboot issue. #ifdef I2C1 if (mask & (1 << 0)) { __HAL_RCC_I2C1_CLK_ENABLE(); @@ -228,6 +241,13 @@ STATIC void i2c_clock_enable(uint8_t mask) { __HAL_RCC_I2C3_RELEASE_RESET(); } #endif + #ifdef I2C4 + if (mask & (1 << 3)) { + __HAL_RCC_I2C4_CLK_ENABLE(); + __HAL_RCC_I2C4_FORCE_RESET(); + __HAL_RCC_I2C4_RELEASE_RESET(); + } + #endif } STATIC void i2c_clock_disable(uint8_t mask) { @@ -246,4 +266,9 @@ STATIC void i2c_clock_disable(uint8_t mask) { __HAL_RCC_I2C3_CLK_DISABLE(); } #endif + #ifdef I2C4 + if (mask & (1 << 3)) { + __HAL_RCC_I2C4_CLK_DISABLE(); + } + #endif } diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index cf00155609..a83f8703c7 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -40,6 +40,7 @@ //arrays use 0 based numbering: SPI1 is stored at index 0 #define MAX_SPI 6 + STATIC bool reserved_spi[MAX_SPI]; STATIC bool never_reset_spi[MAX_SPI]; @@ -48,14 +49,24 @@ STATIC void spi_clock_enable(uint8_t mask); STATIC void spi_clock_disable(uint8_t mask); STATIC uint32_t get_busclock(SPI_TypeDef * instance) { - //SPI2 and 3 are on PCLK1, if they exist. - #ifdef SPI2 - if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + #if (CPY_STM32H7) + if (instance == SPI1 || instance == SPI2 || instance == SPI3) { + return HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SPI123); + } else if (instance == SPI4 || instance == SPI5) { + return HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SPI45); + } else { + return HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SPI6); + } + #elif (CPY_STM32F4 || CPY_STM32F7) + //SPI2 and 3 are on PCLK1, if they exist. + #ifdef SPI2 + if (instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + #endif + #ifdef SPI3 + if (instance == SPI3) return HAL_RCC_GetPCLK1Freq(); + #endif + return HAL_RCC_GetPCLK2Freq(); #endif - #ifdef SPI3 - if (instance == SPI3) return HAL_RCC_GetPCLK1Freq(); - #endif - return HAL_RCC_GetPCLK2Freq(); } STATIC uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler, uint32_t busclock) { @@ -107,6 +118,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); bool spi_taken = false; + bool search_done = false; //SCK is not optional. MOSI and MISO are for (uint i = 0; i < sck_len; i++) { @@ -130,11 +142,20 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->sck = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; self->miso = &mcu_spi_miso_list[k]; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } + if (search_done) { + break; + } } } + if (search_done) { + break; + } // if just MISO, reduce search } else if (miso != NULL) { for (uint j = 0; j < miso_len; j++) { @@ -149,9 +170,15 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->sck = &mcu_spi_sck_list[i]; self->mosi = NULL; self->miso = &mcu_spi_miso_list[j]; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } + if (search_done) { + break; + } // if just MOSI, reduce search } else if (mosi != NULL) { for (uint j = 0; j < mosi_len; j++) { @@ -166,9 +193,15 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->sck = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; self->miso = NULL; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } + if (search_done) { + break; + } } else { //throw an error immediately mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); @@ -222,7 +255,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; // Direction change only required for RX-only, see RefMan RM0090:884 - self->handle.Init.Direction = (self->mosi == NULL) ? SPI_CR1_RXONLY : SPI_DIRECTION_2LINES; + self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; self->handle.Init.DataSize = SPI_DATASIZE_8BIT; self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index df05a68cb4..a5a76ef828 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -84,6 +84,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t rx_len = MP_ARRAY_SIZE(mcu_uart_rx_list); bool uart_taken = false; uint8_t periph_index = 0; //origin 0 corrected + bool search_done = false; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); @@ -106,9 +107,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, //store pins if not self->tx = &mcu_uart_tx_list[i]; self->rx = &mcu_uart_rx_list[j]; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } + if (search_done) { + break; + } } } periph_index = self->tx->periph_index - 1; @@ -125,6 +132,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } //store pins if not self->rx = &mcu_uart_rx_list[i]; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } @@ -142,6 +152,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } //store pins if not self->tx = &mcu_uart_tx_list[i]; + + // Multi-level break to pick lowest peripheral + search_done = true; break; } } diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 82a8a72e4f..647a46e907 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -29,12 +29,12 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//TODO: rework this module to use HAL only -#ifdef STM32H743xx +// The HAL is sparse on obtaining register information, so we use the LLs here. +#if (CPY_STM32H7) #include "stm32h7xx_ll_gpio.h" -#elif STM32F767xx +#elif (CPY_STM32F7) #include "stm32f7xx_ll_gpio.h" -#else +#elif (CPY_STM32F4) #include "stm32f4xx_ll_gpio.h" #endif @@ -152,7 +152,6 @@ void common_hal_digitalio_digitalinout_set_pull( digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( digitalio_digitalinout_obj_t *self) { - switch (LL_GPIO_GetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number))) { case LL_GPIO_PULL_UP: return PULL_UP; diff --git a/ports/stm/fatfs_port.c b/ports/stm/fatfs_port.c index 13ac21fb1b..6a17f627bd 100644 --- a/ports/stm/fatfs_port.c +++ b/ports/stm/fatfs_port.c @@ -28,6 +28,6 @@ #include "lib/oofatfs/ff.h" DWORD get_fattime(void) { - // TODO: Implement this function. For now, fake it. + // TODO: Implement this function. For now, fake it. return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); } diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h index 65b0611241..f570d32e5f 100644 --- a/ports/stm/mpconfigport.h +++ b/ports/stm/mpconfigport.h @@ -47,6 +47,24 @@ extern uint8_t _ld_default_stack_size; // The STM32 HAL file is included virtually everywhere: #include STM32_HAL_H +// These prevent you from accidentally omitting a python file that links mpconfigport +// and having a file accept a lack of chip family as an option. +#if defined(STM32F4) +#define CPY_STM32F4 1 +#define CPY_STM32F7 0 +#define CPY_STM32H7 0 +#elif defined(STM32F7) +#define CPY_STM32F4 0 +#define CPY_STM32F7 1 +#define CPY_STM32H7 0 +#elif defined(STM32H7) +#define CPY_STM32F4 0 +#define CPY_STM32F7 0 +#define CPY_STM32H7 1 +#else +#error undefined processor +#endif + // Board flags: #ifndef BOARD_OVERWRITE_SWD #define BOARD_OVERWRITE_SWD (0) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index e1e983e39f..323fd76466 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -78,7 +78,7 @@ ifeq ($(MCU_SERIES), H7) CIRCUITPY_DIGITALIO = 1 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 0 + CIRCUITPY_BUSIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_OS = 0 CIRCUITPY_STORAGE = 0 @@ -94,7 +94,7 @@ ifeq ($(MCU_SERIES), F7) CIRCUITPY_DIGITALIO = 1 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 0 + CIRCUITPY_BUSIO = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_OS = 0 CIRCUITPY_STORAGE = 0 diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c index dfdd61fde4..a5f4eae78c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c @@ -27,7 +27,7 @@ #include "peripherals/gpio.h" #include "common-hal/microcontroller/Pin.h" -void stm32f4_peripherals_gpio_init(void) { +void stm32_peripherals_gpio_init(void) { //Enable all GPIO for now __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 97ec933eab..3ec1b5b795 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -29,7 +29,6 @@ void stm32_peripherals_gpio_init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE(); diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c index 15f1188706..a0d58f4fcf 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c @@ -44,7 +44,7 @@ void stm32_peripherals_clocks_init(void) { RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; RCC_OscInitStruct.PLL.PLLN = 432; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 9; diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c index a961362aa0..d231f25d0b 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c @@ -28,56 +28,56 @@ #include "py/mpconfig.h" void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; - /* The PWR block is always enabled on the H7 series- there is no clock + /* The PWR block is always enabled on the H7 series- there is no clock enable. For now, use the default VOS3 scale mode (lowest) and limit clock frequencies to avoid potential current draw problems from bus power when using the max clock speeds throughout the chip. */ - /* Enable HSE Oscillator and activate PLL1 with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.CSIState = RCC_CSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = 2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; - RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; - RCC_OscInitStruct.PLL.PLLFRACN = 0; - HAL_RCC_OscConfig(&RCC_OscInitStruct); + /* Enable HSE Oscillator and activate PLL1 with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.CSIState = RCC_CSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = 2; + RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + HAL_RCC_OscConfig(&RCC_OscInitStruct); - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \ - RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \ - RCC_CLOCKTYPE_D3PCLK1); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \ + RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \ + RCC_CLOCKTYPE_D3PCLK1); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; - /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are + /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are device-dependent- 120 MHz for this board according to Figure 2 of the datasheet. Dividing by half will be safe for now. */ - RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; - RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; - RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; + RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; - /* 4 wait states required for 168MHz and VOS3. */ - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); + /* 4 wait states required for 168MHz and VOS3. */ + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); - /* Like on F4, on H7, USB's actual peripheral clock and bus clock are + /* Like on F4, on H7, USB's actual peripheral clock and bus clock are separate. However, the main system PLL (PLL1) doesn't have a direct connection to the USB peripheral clock to generate 48 MHz, so we do this dance. This will connect PLL1's Q output to the USB peripheral clock. */ - RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct; + RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct; - RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; - RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; - HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); + RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; + RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); } diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index e54cd92311..53388d3544 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -40,8 +40,9 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB -#ifdef CIRCUITPY_NVM +#if CIRCUITPY_NVM #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 16796d9ce3..d9d720280d 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -31,11 +31,11 @@ #include "tick.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/busio/I2C.h" +#include "common-hal/busio/SPI.h" +#include "common-hal/busio/UART.h" #if defined(STM32F4) - #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" @@ -187,12 +187,13 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); + i2c_reset(); + spi_reset(); + uart_reset(); // TODO: it'd be nice if this was more automatic #if defined(STM32F4) - i2c_reset(); - spi_reset(); - uart_reset(); + pwmout_reset(); pulseout_reset(); pulsein_reset(); From 49771b4d7f46a056579d3690977e772fa91f30b5 Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Thu, 9 Apr 2020 14:27:51 -0500 Subject: [PATCH 197/919] Update to v1.3 --- .../boards/{nfc_copy => nfc_copy_cat}/board.c | 0 .../{nfc_copy => nfc_copy_cat}/mpconfigboard.h | 13 +++++++------ .../{nfc_copy => nfc_copy_cat}/mpconfigboard.mk | 5 ++++- .../boards/{nfc_copy => nfc_copy_cat}/pins.c | 5 ++--- 4 files changed, 13 insertions(+), 10 deletions(-) rename ports/atmel-samd/boards/{nfc_copy => nfc_copy_cat}/board.c (100%) rename ports/atmel-samd/boards/{nfc_copy => nfc_copy_cat}/mpconfigboard.h (84%) rename ports/atmel-samd/boards/{nfc_copy => nfc_copy_cat}/mpconfigboard.mk (67%) rename ports/atmel-samd/boards/{nfc_copy => nfc_copy_cat}/pins.c (83%) diff --git a/ports/atmel-samd/boards/nfc_copy/board.c b/ports/atmel-samd/boards/nfc_copy_cat/board.c similarity index 100% rename from ports/atmel-samd/boards/nfc_copy/board.c rename to ports/atmel-samd/boards/nfc_copy_cat/board.c diff --git a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.h b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h similarity index 84% rename from ports/atmel-samd/boards/nfc_copy/mpconfigboard.h rename to ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h index 126b2119f5..3790d23ff6 100644 --- a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.h +++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.h @@ -1,23 +1,24 @@ #define MICROPY_HW_BOARD_NAME "Electronic Cats NFC Copy Cat" #define MICROPY_HW_MCU_NAME "samd21e18" +#define MICROPY_HW_LED_STATUS (&pin_PA14) + #define MICROPY_PORT_A (0) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +#define SPI_FLASH_MOSI_PIN &pin_PA08 +#define SPI_FLASH_MISO_PIN &pin_PA11 +#define SPI_FLASH_SCK_PIN &pin_PA09 +#define SPI_FLASH_CS_PIN &pin_PA10 + // No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define DEFAULT_I2C_BUS_SCL (&pin_PA08) -#define DEFAULT_I2C_BUS_SDA (&pin_PA09) - #define DEFAULT_SPI_BUS_SCK (&pin_PA17) #define DEFAULT_SPI_BUS_MOSI (&pin_PA16) #define DEFAULT_SPI_BUS_MISO (&pin_PA19) -#define DEFAULT_UART_BUS_RX (&pin_PA01) -#define DEFAULT_UART_BUS_TX (&pin_PA00) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA20 1 #define IGNORE_PIN_PA21 1 diff --git a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk similarity index 67% rename from ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk rename to ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk index 582c584d8c..4f6d1e70d5 100644 --- a/ports/atmel-samd/boards/nfc_copy/mpconfigboard.mk +++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk @@ -6,6 +6,9 @@ USB_MANUFACTURER = "Electronic Cats" CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 -INTERNAL_FLASH_FILESYSTEM = 1 +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" LONGINT_IMPL = NONE + CIRCUITPY_SMALL_BUILD = 1 diff --git a/ports/atmel-samd/boards/nfc_copy/pins.c b/ports/atmel-samd/boards/nfc_copy_cat/pins.c similarity index 83% rename from ports/atmel-samd/boards/nfc_copy/pins.c rename to ports/atmel-samd/boards/nfc_copy_cat/pins.c index 46a7ed3c93..ebe6e89e47 100644 --- a/ports/atmel-samd/boards/nfc_copy/pins.c +++ b/ports/atmel-samd/boards/nfc_copy_cat/pins.c @@ -4,8 +4,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA02) }, // IRQ { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, // IN_A { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, // IN_B - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA10) }, // LED - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA11) }, // LED + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA05) }, // LED + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA04) }, // LED { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) }, // LED { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_PA27) }, // Switch { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_PA28) }, // Switch @@ -15,7 +15,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA18) }, // CS - { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 1d64c51b7e84a72f443e6bc43cdd0d2e7520247b Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 9 Apr 2020 15:14:26 -0500 Subject: [PATCH 198/919] build.yml: pin Sphinx to '<4' --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b56fb35b88..333c988464 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | gcc --version From a6fb0beaa9f1065256bfe7ea97b2fc32ba80a43b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 9 Apr 2020 13:16:32 -0700 Subject: [PATCH 199/919] Update translations --- locale/ID.po | 10 +++++++++- locale/circuitpython.pot | 10 +++++++++- locale/de_DE.po | 10 +++++++++- locale/en_US.po | 10 +++++++++- locale/en_x_pirate.po | 10 +++++++++- locale/es.po | 10 +++++++++- locale/fil.po | 10 +++++++++- locale/fr.po | 10 +++++++++- locale/it_IT.po | 10 +++++++++- locale/ko.po | 10 +++++++++- locale/pl.po | 10 +++++++++- locale/pt_BR.po | 10 +++++++++- locale/zh_Latn_pinyin.po | 10 +++++++++- 13 files changed, 117 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 619f7e6b75..370b5028c5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -280,9 +280,11 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -900,6 +902,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -931,6 +934,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1200,6 +1204,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 177eee2bf0..5836fd97c5 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -278,9 +278,11 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -889,6 +891,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +923,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1186,6 +1190,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 351da58936..1a337b23e3 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -280,9 +280,11 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -897,6 +899,7 @@ msgid "Invalid number of bits" msgstr "Ungültige Anzahl von Bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Ungültige Phase" @@ -928,6 +931,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Ungültige Polarität" @@ -1203,6 +1207,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 095d175ebd..7112ca2f20 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -278,9 +278,11 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -889,6 +891,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +923,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1186,6 +1190,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index a7f00a7b2e..f5529ace18 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -280,9 +280,11 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -893,6 +895,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -924,6 +927,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1190,6 +1194,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/es.po b/locale/es.po index 3f4313de93..6314e9eec4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -282,9 +282,11 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -897,6 +899,7 @@ msgid "Invalid number of bits" msgstr "Numero inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase inválida" @@ -928,6 +931,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polaridad inválida" @@ -1202,6 +1206,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index cd6f52c393..a900cc9e13 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -282,9 +282,11 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -905,6 +907,7 @@ msgid "Invalid number of bits" msgstr "Mali ang bilang ng bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Mali ang phase" @@ -936,6 +939,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Mali ang polarity" @@ -1208,6 +1212,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 64abb8f9fd..4d05c32084 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -285,9 +285,11 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -911,6 +913,7 @@ msgid "Invalid number of bits" msgstr "Nombre de bits invalide" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Phase invalide" @@ -942,6 +945,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarité invalide" @@ -1221,6 +1225,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/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 89fb9329e2..24266db3fe 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -281,9 +281,11 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -907,6 +909,7 @@ msgid "Invalid number of bits" msgstr "Numero di bit non valido" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase non valida" @@ -938,6 +941,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarità non valida" @@ -1217,6 +1221,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index d502e60c07..9d6eb433ba 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -280,9 +280,11 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -893,6 +895,7 @@ msgid "Invalid number of bits" msgstr "비트 수가 유효하지 않습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "단계가 잘못되었습니다" @@ -924,6 +927,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1190,6 +1194,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 67eff44f3a..4e2705a90f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -279,9 +279,11 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -894,6 +896,7 @@ msgid "Invalid number of bits" msgstr "Zła liczba bitów" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Zła faza" @@ -925,6 +928,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Zła polaryzacja" @@ -1191,6 +1195,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/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c6fe5dcba2..4bf7fdc18d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -281,9 +281,11 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -900,6 +902,7 @@ msgid "Invalid number of bits" msgstr "Número inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase Inválida" @@ -931,6 +934,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1202,6 +1206,10 @@ msgstr "" msgid "Pull not used when direction is output." msgstr "" +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 8be47eb864..a71df889dc 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-09 13:15-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -285,9 +285,11 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" @@ -902,6 +904,7 @@ msgid "Invalid number of bits" msgstr "Wèi shù wúxiào" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Jiēduàn wúxiào" @@ -933,6 +936,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" @@ -1205,6 +1209,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/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" msgstr "" From 2a47623283911c8ebac6152560affc8c419dbddf Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Thu, 9 Apr 2020 17:00:42 -0500 Subject: [PATCH 200/919] update build.yml --- .github/workflows/build.yml | 81 +++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 921a40d273..8e4b6f2d01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,8 @@ jobs: python-version: 3.5 - name: Install deps run: | - sudo apt-get install -y gettext librsvg2-bin + sudo apt-get install -y eatmydata + sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 pip install requests sh click setuptools cpp-coveralls Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | @@ -66,6 +67,54 @@ jobs: run: python3 -u ci_new_boards_check.py working-directory: tools + - name: Build mpy-cross.static-raspbian + run: make -C mpy-cross -j2 -f Makefile.static-raspbian + - uses: actions/upload-artifact@v1.0.0 + with: + name: mpy-cross.static-raspbian + path: mpy-cross/mpy-cross.static-raspbian + + - name: Build mpy-cross.static + run: make -C mpy-cross -j2 -f Makefile.static + - uses: actions/upload-artifact@v1.0.0 + with: + name: mpy-cross.static-amd64-linux + path: mpy-cross/mpy-cross.static + + - name: Build mpy-cross.static-mingw + run: make -C mpy-cross -j2 -f Makefile.static-mingw + - uses: actions/upload-artifact@v1.0.0 + with: + name: mpy-cross.static-x64-windows + path: mpy-cross/mpy-cross.static.exe + + mpy-cross-mac: + runs-on: macos-latest + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Install deps + run: | + brew link --force gettext + - name: Versions + run: | + gcc --version + python3 --version + msgfmt --version + - uses: actions/checkout@v1 + with: + submodules: true + - name: CircuitPython version + run: git describe --dirty --always --tags + - name: Build mpy-cross + run: make -C mpy-cross -j2 + - uses: actions/upload-artifact@v1.0.0 + with: + name: mpy-cross-macos-catalina + path: mpy-cross/mpy-cross + build-arm: runs-on: ubuntu-16.04 needs: test @@ -73,14 +122,18 @@ jobs: fail-fast: false matrix: board: + - "TG-Watch02A" - "aramcon_badge_2019" - "arduino_mkr1300" - "arduino_mkrzero" - "arduino_nano_33_ble" + - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - "capablerobot_usbhub" - "catwan_usbstick" + - "circuitbrains_basic_m0" + - "circuitbrains_deluxe_m4" - "circuitplayground_bluefruit" - "circuitplayground_express" - "circuitplayground_express_crickit" @@ -95,6 +148,9 @@ jobs: - "electronut_labs_blip" - "electronut_labs_papyr" - "escornabot_makech" + - "espruino_pico" + - "espruino_wifi" + - "feather_bluefruit_sense" - "feather_m0_adalogger" - "feather_m0_basic" - "feather_m0_express" @@ -103,6 +159,7 @@ jobs: - "feather_m0_rfm9x" - "feather_m0_supersized" - "feather_m4_express" + - "feather_m7_1011" - "feather_mimxrt1011" - "feather_mimxrt1062" - "feather_nrf52840_express" @@ -113,12 +170,15 @@ jobs: - "hallowing_m0_express" - "hallowing_m4_express" - "imxrt1010_evk" + - "imxrt1020_evk" + - "imxrt1060_evk" - "itsybitsy_m0_express" - "itsybitsy_m4_express" - "itsybitsy_nrf52840_express" - "kicksat-sprite" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" + - "meowbit_v121" - "meowmeow" - "metro_m0_express" - "metro_m4_airlift_lite" @@ -126,6 +186,8 @@ jobs: - "metro_nrf52840_express" - "mini_sam_m4" - "monster_m4sk" + - "ndgarage_ndbit6" + - "nfc_copy_cat" - "ohs2020_badge" - "openbook_m4" - "particle_argon" @@ -140,6 +202,7 @@ jobs: - "pybadge" - "pybadge_airlift" - "pyboard_v11" + - "pycubed" - "pygamer" - "pygamer_advance" - "pyportal" @@ -158,17 +221,21 @@ jobs: - "sparkfun_redboard_turbo" - "sparkfun_samd21_dev" - "sparkfun_samd21_mini" + - "sparkfun_samd51_thing_plus" - "spresense" - "stm32f411ce_blackpill" - "stm32f411ve_discovery" - "stm32f412zg_discovery" + - "stm32f4_discovery" - "stringcar_m0_express" + - "teensy40" - "teknikio_bluebird" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" - "uchip" - "ugame10" + - "winterbloom_big_honking_button" - "winterbloom_sol" - "xinabox_cc03" - "xinabox_cs11" @@ -208,14 +275,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) - - name: Install upload deps - run: | - pip install uritemplate - - name: Upload to Release - run: "[ -z \"$ADABOT_GITHUB_ACCESS_TOKEN\" ] || python3 -u upload_release_files.py" - working-directory: tools - env: - UPLOAD_URL: ${{ github.event.release.upload_url }} - ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.BLINKA_GITHUB_ACCESS_TOKEN }} - if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested') + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file From 0e06a88fdd078d5ffc995113b89acfcc637b441e Mon Sep 17 00:00:00 2001 From: sabas1080 Date: Thu, 9 Apr 2020 17:19:06 -0500 Subject: [PATCH 201/919] update YML --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36cf1e83a6..7111b2f363 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -325,4 +325,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file From abf79de785b8cdd516d8bd546236263e943485a5 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Sat, 11 Apr 2020 08:59:51 -0400 Subject: [PATCH 202/919] Fix bad submodule path The repository URL for extmod/ulab had a trailing slash, causing errors when trying to clone it. Closes #2762 --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5c3387077c..365d9ff72f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -109,7 +109,7 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git [submodule "extmod/ulab"] path = extmod/ulab - url = https://github.com/v923z/micropython-ulab/ + url = https://github.com/v923z/micropython-ulab [submodule "frozen/Adafruit_CircuitPython_ESP32SPI"] path = frozen/Adafruit_CircuitPython_ESP32SPI url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI From 8797e3347f892d39880f4f92967b1fd664ca5dbe Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Sat, 11 Apr 2020 09:05:42 -0400 Subject: [PATCH 203/919] Fix maximum keycode in keyboard HID descriptor The HID descriptor reported by circuitpython erroneously limited the maximum keycode to 101, which prevented circuitpython from sending a number of otherwise valid keycodes. Closes #274 --- tools/hid_report_descriptors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hid_report_descriptors.py b/tools/hid_report_descriptors.py index 92c962d59b..07ed26744f 100644 --- a/tools/hid_report_descriptors.py +++ b/tools/hid_report_descriptors.py @@ -68,9 +68,9 @@ def keyboard_hid_descriptor(report_id): 0x81, 0x02, # Input (Data, Variable, Absolute) 0x81, 0x01, # Input (Constant) 0x19, 0x00, # Usage Minimum (0) - 0x29, 101, # Usage Maximum (101) + 0x29, 0xDD, # Usage Maximum (221) 0x15, 0x00, # Logical Minimum (0) - 0x25, 101, # Logical Maximum (101) + 0x25, 0xDD, # Logical Maximum (221) 0x75, 0x08, # Report Size (8) 0x95, 0x06, # Report Count (6) 0x81, 0x00, # Input (Data, Array) From f817bfe3c6d66c9b5ebd673aeef2e4cf773c70be Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 23 Mar 2020 08:40:20 -0500 Subject: [PATCH 204/919] switch to checkout@v2 with submodules and fetch-depth 0 In order to get tags, including in submodules, we use our own fetching procedure on top of checkout@v2. A problem occuring in about 1% of jobs was that some submodules inexplicably did not have an "origin" remote configured. "git submodule sync" configures the "origin" remote in those cases. No cause for the problem was determined. Besides keeping up to date on actions/checkout, @v2 is supposed to fix a bug where "re-run" of a pull request would fail checking out the code. --- .github/workflows/build.yml | 33 ++++++++++++++++++------- .github/workflows/create_website_pr.yml | 7 ++++-- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fc6ce5a47..ddd41412f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,16 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* + - name: CircuitPython version + run: git describe --dirty --tags - name: Set up Python 3.8 uses: actions/setup-python@v1 with: @@ -29,11 +39,6 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v1 - with: - submodules: true - - name: CircuitPython version - run: git describe --dirty --always --tags - name: Build mpy-cross run: make -C mpy-cross -j2 - name: Build unix port @@ -103,11 +108,16 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version - run: git describe --dirty --always --tags + run: git describe --dirty --tags - name: Build mpy-cross run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v1.0.0 @@ -260,9 +270,14 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -325,4 +340,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) \ No newline at end of file + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 963fadd3dd..da4dad1790 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,11 +23,14 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version - run: git describe --dirty --always --tags + run: git describe --dirty --tags - name: Website run: python3 build_board_info.py working-directory: tools From 5ac38c95cc914c69e56a0f646131b34826b6f59a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 13 Apr 2020 12:03:05 -0400 Subject: [PATCH 205/919] Various requested fixes --- ports/stm/Makefile | 1 - .../stm/boards/nucleo_f767zi/mpconfigboard.mk | 4 +-- .../boards/nucleo_h743zi_2/mpconfigboard.mk | 4 +-- ports/stm/boards/thunderpack/mpconfigboard.mk | 2 +- ports/stm/common-hal/busio/I2C.c | 6 ++-- ports/stm/common-hal/busio/SPI.c | 24 ++++----------- ports/stm/common-hal/busio/UART.c | 12 +------- ports/stm/supervisor/internal_flash.c | 10 ------- ports/stm/supervisor/port.c | 30 +++++++++---------- ports/stm/supervisor/usb.c | 26 +++++++--------- supervisor/shared/stack.c | 2 +- 11 files changed, 40 insertions(+), 81 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 355fd1d026..dc32f6c7a8 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -255,7 +255,6 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif -#OBJ += $(addprefix $(BUILD)/, $(SRC_O)) OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index cac4a273eb..c8c2a3d2b1 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A #REPLACE -USB_PID = 0x808A #REPLACE +USB_VID = 0x239A +USB_PID = 0x809A USB_PRODUCT = "Nucleo F767ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index dd7f05f290..01ace06a23 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A #REPLACE -USB_PID = 0x808A #REPLACE +USB_VID = 0x239A +USB_PID = 0x8098 USB_PRODUCT = "Nucleo H743ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 37aded8366..007b00cdd1 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -13,5 +13,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_FILE = boards/common_nvm.ld +LD_COMMON = boards/common_nvm.ld LD_FILE = boards/STM32F411_nvm.ld diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 31a1278d35..e3c59e7e05 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -64,7 +64,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, uint8_t sda_len = MP_ARRAY_SIZE(mcu_i2c_sda_list); uint8_t scl_len = MP_ARRAY_SIZE(mcu_i2c_scl_list); bool i2c_taken = false; - bool search_done = false; for (uint i = 0; i < sda_len; i++) { if (mcu_i2c_sda_list[i].pin == sda) { @@ -78,12 +77,11 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } self->scl = &mcu_i2c_scl_list[j]; self->sda = &mcu_i2c_sda_list[i]; - // Multi-level break here, or it'll pick the highest numbered peripheral (inefficient) - search_done = true; break; } } - if (search_done) { + if (self->scl != NULL) { + // Multi-level break to pick lowest peripheral break; } } diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index a83f8703c7..2572c7f26a 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -118,7 +118,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, uint8_t mosi_len = MP_ARRAY_SIZE(mcu_spi_mosi_list); uint8_t miso_len = MP_ARRAY_SIZE(mcu_spi_miso_list); bool spi_taken = false; - bool search_done = false; //SCK is not optional. MOSI and MISO are for (uint i = 0; i < sck_len; i++) { @@ -142,18 +141,15 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->sck = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; self->miso = &mcu_spi_miso_list[k]; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } - if (search_done) { - break; + if (self->sck != NULL) { + break; // Multi-level break to pick lowest peripheral } } } - if (search_done) { + if (self->sck != NULL) { break; } // if just MISO, reduce search @@ -161,22 +157,17 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, for (uint j = 0; j < miso_len; j++) { if ((mcu_spi_miso_list[j].pin == miso) //only SCK and MISO need the same index && (mcu_spi_sck_list[i].periph_index == mcu_spi_miso_list[j].periph_index)) { - //keep looking if the SPI is taken, edge case if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { spi_taken = true; continue; } - //store pins if not self->sck = &mcu_spi_sck_list[i]; self->mosi = NULL; self->miso = &mcu_spi_miso_list[j]; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } - if (search_done) { + if (self->sck != NULL) { break; } // if just MOSI, reduce search @@ -184,22 +175,17 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, for (uint j = 0; j < mosi_len; j++) { if ((mcu_spi_mosi_list[j].pin == mosi) //only SCK and MOSI need the same index && (mcu_spi_sck_list[i].periph_index == mcu_spi_mosi_list[j].periph_index)) { - //keep looking if the SPI is taken, edge case if (reserved_spi[mcu_spi_sck_list[i].periph_index - 1]) { spi_taken = true; continue; } - //store pins if not self->sck = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; self->miso = NULL; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } - if (search_done) { + if (self->sck != NULL) { break; } } else { diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index a5a76ef828..cb5460c68e 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -84,7 +84,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t rx_len = MP_ARRAY_SIZE(mcu_uart_rx_list); bool uart_taken = false; uint8_t periph_index = 0; //origin 0 corrected - bool search_done = false; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); @@ -107,13 +106,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, //store pins if not self->tx = &mcu_uart_tx_list[i]; self->rx = &mcu_uart_rx_list[j]; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } - if (search_done) { + if (self->tx != NULL) { break; } } @@ -132,9 +128,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } //store pins if not self->rx = &mcu_uart_rx_list[i]; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } @@ -152,9 +145,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } //store pins if not self->tx = &mcu_uart_tx_list[i]; - - // Multi-level break to pick lowest peripheral - search_done = true; break; } } diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 7d394d187a..03fa73d5fb 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -181,8 +181,6 @@ void supervisor_flash_flush(void) { EraseInitStruct.Sector = flash_get_sector_info(_cache_flash_addr, §or_start_addr, §or_size); EraseInitStruct.NbSectors = 1; if (sector_size > sizeof(_flash_cache)) { - __ASM volatile ("bkpt"); - mp_printf(&mp_plat_print, "FLASH ERR: invalid sector\n"); reset_into_safe_mode(FLASH_WRITE_FAIL); } @@ -196,8 +194,6 @@ void supervisor_flash_flush(void) { if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) { // error occurred during sector erase HAL_FLASH_Lock(); // lock the flash - __ASM volatile ("bkpt"); - mp_printf(&mp_plat_print, "FLASH ERR: erase failure\n"); reset_into_safe_mode(FLASH_WRITE_FAIL); } @@ -211,7 +207,6 @@ void supervisor_flash_flush(void) { (uint32_t)cache_addr) != HAL_OK) { // error occurred during flash write HAL_FLASH_Lock(); // lock the flash - __ASM volatile ("bkpt"); reset_into_safe_mode(FLASH_WRITE_FAIL); } // RAM memory is by word (4 byte), but flash memory is by byte @@ -226,7 +221,6 @@ void supervisor_flash_flush(void) { (uint64_t)*cache_addr) != HAL_OK) { // error occurred during flash write HAL_FLASH_Lock(); // lock the flash - __ASM volatile ("bkpt"); reset_into_safe_mode(FLASH_WRITE_FAIL); } // RAM memory is by word (4 byte), but flash memory is by byte @@ -267,8 +261,6 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, int32_t dest = convert_block_to_flash_addr(block_num); if (dest == -1) { // bad block number - __ASM volatile ("bkpt"); - mp_printf(&mp_plat_print, "BAD FLASH BLOCK ERROR"); return false; } @@ -281,8 +273,6 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, // Fail for any sector outside the 16k ones for now if (sector_size > sizeof(_flash_cache)) { - __ASM volatile ("bkpt"); - mp_printf(&mp_plat_print, "FLASH ERR: invalid sector\n"); reset_into_safe_mode(FLASH_WRITE_FAIL); } diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index d9d720280d..81a12d6c4b 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -31,14 +31,16 @@ #include "tick.h" #include "common-hal/microcontroller/Pin.h" + +#if CIRCUITPY_BUSIO #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" #include "common-hal/busio/UART.h" - -#if defined(STM32F4) - #include "common-hal/pulseio/PWMOut.h" - #include "common-hal/pulseio/PulseOut.h" - #include "common-hal/pulseio/PulseIn.h" +#endif +#if CIRCUITPY_PULSEIO +#include "common-hal/pulseio/PWMOut.h" +#include "common-hal/pulseio/PulseOut.h" +#include "common-hal/pulseio/PulseIn.h" #endif #include "clocks.h" @@ -114,7 +116,6 @@ __attribute__((used, naked)) void Reset_Handler(void) { // The first number in RBAR is the region number. When searching for a policy, the region with // the highest number wins. If none match, then the default policy set at enable applies. - // TODO: what is the default policy? Where is that set? // TODO: do I need to subdivide this up? // Mark all the flash the same until instructed otherwise. @@ -124,7 +125,7 @@ __attribute__((used, naked)) void Reset_Handler(void) { // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to // accidentally write the wrong value to 0x00000000 (aka NULL). MPU->RBAR = ARM_MPU_RBAR(12, 0x00000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_64KB); // This the DTCM. MPU->RBAR = ARM_MPU_RBAR(14, 0x20000000U); @@ -187,17 +188,16 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); +#if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); uart_reset(); - - // TODO: it'd be nice if this was more automatic - #if defined(STM32F4) - - pwmout_reset(); - pulseout_reset(); - pulsein_reset(); - #endif +#endif +#if CIRCUITPY_PULSEIO + pwmout_reset(); + pulseout_reset(); + pulsein_reset(); +#endif } void reset_to_bootloader(void) { diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index 501550aed7..b66107b7ba 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -78,58 +78,54 @@ void init_usb_hardware(void) { GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; - #if defined(STM32H7) + #if CPY_STM32H7 GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #elif defined(STM32F4) || defined(STM32F7) + #elif CPY_STM32F4 || CPY_STM32F7 GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; - #else - #error Unsupported processor #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 11); never_reset_pin_number(0, 12); /* Configure VBUS Pin */ -#if !(BOARD_NO_VBUS_SENSE) + #if !(BOARD_NO_VBUS_SENSE) GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); -#endif + #endif /* This for ID line debug */ GPIO_InitStruct.Pin = GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_HIGH; - #if defined(STM32H7) + #if CPY_STM32H7 GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - #elif defined(STM32F4) || defined(STM32F7) + #elif CPY_STM32F4 || CPY_STM32F7 GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS; - #else - #error Unsupported processor #endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 10); -#ifdef STM32F412Zx + #ifdef STM32F412Zx /* Configure POWER_SWITCH IO pin (F412 ONLY)*/ GPIO_InitStruct.Pin = GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); never_reset_pin_number(0, 8); -#endif + #endif -#if defined(STM32H7) + #if CPY_STM32H7 HAL_PWREx_EnableUSBVoltageDetector(); __HAL_RCC_USB2_OTG_FS_CLK_ENABLE(); -#else + #else /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); -#endif + #endif init_usb_vbus_sense(); } diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index 2a7daf4658..2b7b1c03a4 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -46,7 +46,7 @@ void allocate_stack(void) { mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; - if (port_stack_get_top() != port_heap_get_top()) { //Why is this here? Doesn't apply to some chips. + if (port_stack_get_top() != port_heap_get_top()) { return; } From 426d2afe28a70ede4203f69a91b50ed436cbc4e1 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 13 Apr 2020 14:36:49 -0400 Subject: [PATCH 206/919] Fix pin mapping for the H7 Nucleo --- ports/stm/boards/nucleo_h743zi_2/pins.c | 53 +++----------- ports/stm/tools/pins.csv | 94 +++++++------------------ 2 files changed, 33 insertions(+), 114 deletions(-) diff --git a/ports/stm/boards/nucleo_h743zi_2/pins.c b/ports/stm/boards/nucleo_h743zi_2/pins.c index 3ba172df17..d35f40dd2d 100644 --- a/ports/stm/boards/nucleo_h743zi_2/pins.c +++ b/ports/stm/boards/nucleo_h743zi_2/pins.c @@ -81,55 +81,18 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D68), MP_ROM_PTR(&pin_PF00) }, { MP_ROM_QSTR(MP_QSTR_D69), MP_ROM_PTR(&pin_PF01) }, { MP_ROM_QSTR(MP_QSTR_D70), MP_ROM_PTR(&pin_PF02) }, - { MP_ROM_QSTR(MP_QSTR_D71), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_D71), MP_ROM_PTR(&pin_PE00) }, { MP_ROM_QSTR(MP_QSTR_D72), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB06) }, { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PE01) }, { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_I2C1_SCL), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PF00) }, - { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PF01) }, - { MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PF14) }, - { MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PF15) }, - { MP_ROM_QSTR(MP_QSTR_SD_D0), MP_ROM_PTR(&pin_PC08) }, - { MP_ROM_QSTR(MP_QSTR_SD_D1), MP_ROM_PTR(&pin_PC09) }, - { MP_ROM_QSTR(MP_QSTR_SD_D2), MP_ROM_PTR(&pin_PC10) }, - { MP_ROM_QSTR(MP_QSTR_SD_D3), MP_ROM_PTR(&pin_PC11) }, - { MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_PD02) }, - { MP_ROM_QSTR(MP_QSTR_SD_CK), MP_ROM_PTR(&pin_PC12) }, - { MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PG02) }, - { MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PG06) }, - { MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PG07) }, - { MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, - { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, - { MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, - { MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_PD03) }, - { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PD08) }, - { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PD09) }, - { MP_ROM_QSTR(MP_QSTR_UART5_TX), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_UART5_RX), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_UART6_TX), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_UART6_RX), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_UART7_TX), MP_ROM_PTR(&pin_PF07) }, - { MP_ROM_QSTR(MP_QSTR_UART7_RX), MP_ROM_PTR(&pin_PF06) }, - { MP_ROM_QSTR(MP_QSTR_UART8_TX), MP_ROM_PTR(&pin_PE01) }, - { MP_ROM_QSTR(MP_QSTR_UART8_RX), MP_ROM_PTR(&pin_PE00) }, - { MP_ROM_QSTR(MP_QSTR_ETH_MDC), MP_ROM_PTR(&pin_PC01) }, - { MP_ROM_QSTR(MP_QSTR_ETH_MDIO), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_REF_CLK), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_CRS_DV), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD0), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD1), MP_ROM_PTR(&pin_PC05) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TX_EN), MP_ROM_PTR(&pin_PG11) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD0), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD1), MP_ROM_PTR(&pin_PB13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/tools/pins.csv b/ports/stm/tools/pins.csv index e447b76b05..b424c2f78f 100644 --- a/ports/stm/tools/pins.csv +++ b/ports/stm/tools/pins.csv @@ -1,24 +1,24 @@ A0,PA3 A1,PC0 A2,PC3 -A3,PF3 -A4,PF5 +A3,PB1 +A4,PC2 A5,PF10 -A6,PB1 -A7,PC2 -A8,PF4 -D0,PG9 -D1,PG14 -D2,PF15 +A6,PF4 +A7,PF5 +A8,PF6 +D0,PB7 +D1,PB6 +D2,PG14 D3,PE13 -D4,PF14 +D4,PE14 D5,PE11 D6,PE9 -D7,PF13 -D8,PF12 +D7,PG12 +D8,PF3 D9,PD15 D10,PD14 -D11,PA7 +D11,PB5 D12,PA6 D13,PA5 D14,PB9 @@ -33,7 +33,7 @@ D22,PB5 D23,PB3 D24,PA4 D25,PB4 -D26,PB6 +D26,PG6 D27,PB2 D28,PD13 D29,PD12 @@ -45,7 +45,7 @@ D34,PE0 D35,PB11 D36,PB10 D37,PE15 -D38,PE14 +D38,PE6 D39,PE12 D40,PE10 D41,PE7 @@ -78,60 +78,16 @@ D67,PD0 D68,PF0 D69,PF1 D70,PF2 -D71,PA7 -DAC1,PA4 -DAC2,PA5 -LED1,PB0 -LED2,PB7 +D71,PE0 +D72,PB2 +SDA,PB9 +SCL,PB8 +MOSI,PB5 +MISO,PA6 +SCK,PA5 +RX,PB7 +TX,PB6 +LED1,PB00 +LED2,PE01 LED3,PB14 SW,PC13 -SD_D0,PC8 -SD_D1,PC9 -SD_D2,PC10 -SD_D3,PC11 -SD_CMD,PD2 -SD_CK,PC12 -SD_SW,PG2 -OTG_FS_POWER,PG6 -OTG_FS_OVER_CURRENT,PG7 -USB_VBUS,PA9 -USB_ID,PA10 -USB_DM,PA11 -USB_DP,PA12 -UART2_TX,PD5 -UART2_RX,PD6 -UART2_RTS,PD4 -UART2_CTS,PD3 -VCP_TX,PD8 -VCP_RX,PD9 -UART3_TX,PD8 -UART3_RX,PD9 -UART5_TX,PB6 -UART5_RX,PB12 -UART6_TX,PC6 -UART6_RX,PC7 -UART7_TX,PF7 -UART7_RX,PF6 -UART8_TX,PE1 -UART8_RX,PE0 -SPI3_NSS,PA4 -SPI3_SCK,PB3 -SPI3_MISO,PB4 -SPI3_MOSI,PB5 -I2C1_SDA,PB9 -I2C1_SCL,PB8 -I2C2_SDA,PF0 -I2C2_SCL,PF1 -I2C4_SCL,PF14 -I2C4_SDA,PF15 -ETH_MDC,PC1 -ETH_MDIO,PA2 -ETH_RMII_REF_CLK,PA1 -ETH_RMII_CRS_DV,PA7 -ETH_RMII_RXD0,PC4 -ETH_RMII_RXD1,PC5 -ETH_RMII_TX_EN,PG11 -ETH_RMII_TXD0,PG13 -ETH_RMII_TXD1,PB13 -SWDIO,PA13 -SWDCLK,PA14 From 83a55f65a4ba5ffd2d99a808401807241840b2d0 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 13 Apr 2020 15:14:38 -0400 Subject: [PATCH 207/919] Implement cache-based reads --- ports/stm/supervisor/internal_flash.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 03fa73d5fb..df4e97d8e1 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -234,7 +234,7 @@ void supervisor_flash_flush(void) { } } -static int32_t convert_block_to_flash_addr(uint32_t block) { +static uint32_t convert_block_to_flash_addr(uint32_t block) { if (0 <= block && block < INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS) { // a block in partition 1 return INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; @@ -244,15 +244,30 @@ static int32_t convert_block_to_flash_addr(uint32_t block) { } mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { - // Must write out anything in cache before trying to read. - supervisor_flash_flush(); - int32_t src = convert_block_to_flash_addr(block); if (src == -1) { // bad block number return false; } - memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); + + // Determine whether the read is contained within the sector + uint32_t sector_size; + uint32_t sector_start_addr; + flash_get_sector_info(src, §or_start_addr, §or_size); + // Count how many blocks are left in the sector + uint32_t count = (sector_size - (src - sector_start_addr))/FILESYSTEM_BLOCK_SIZE; + count = MIN(num_blocks, count); + + if (count < num_blocks && _cache_flash_addr == sector_start_addr) { + // Read is contained in the cache, so just read cache + memcpy(dest, (_flash_cache + (src-sector_start_addr)), FILESYSTEM_BLOCK_SIZE*num_blocks); + } else { + // The read spans multiple sectors or is in another sector + // Must write out anything in cache before trying to read. + supervisor_flash_flush(); + memcpy(dest, (uint8_t*) src, FILESYSTEM_BLOCK_SIZE*num_blocks); + } + return 0; // success } @@ -271,7 +286,7 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t sector_start_addr; flash_get_sector_info(dest, §or_start_addr, §or_size); - // Fail for any sector outside the 16k ones for now + // Fail for any sector outside what's supported by the cache if (sector_size > sizeof(_flash_cache)) { reset_into_safe_mode(FLASH_WRITE_FAIL); } From a9fb34eb93ff19df1bcf6498d492a31fd00c2c96 Mon Sep 17 00:00:00 2001 From: caternuson Date: Mon, 13 Apr 2020 16:48:27 -0700 Subject: [PATCH 208/919] make packed word and copy it in --- shared-module/displayio/Bitmap.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 503c360730..8bcda6086f 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -173,29 +173,13 @@ void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) self->dirty_area.y1 = 0; self->dirty_area.y2 = self->height; - // Update our data - int32_t row_start; - uint32_t bytes_per_value = self->bits_per_value / 8; - for (uint32_t x=0; xwidth; x++) { - for (uint32_t y=0; yheight; y++) { - row_start = y * self->stride; - if (bytes_per_value < 1) { - uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value); - uint32_t index = row_start + (x >> self->x_shift); - uint32_t word = self->data[index]; - word &= ~(self->bitmask << bit_position); - word |= (value & self->bitmask) << bit_position; - self->data[index] = word; - } else { - size_t* row = self->data + row_start; - if (bytes_per_value == 1) { - ((uint8_t*) row)[x] = value; - } else if (bytes_per_value == 2) { - ((uint16_t*) row)[x] = value; - } else if (bytes_per_value == 4) { - ((uint32_t*) row)[x] = value; - } - } - } + // build the packed word + uint32_t word = 0; + for (uint8_t i=0; i<32 / self->bits_per_value; i++) { + word |= (value & self->bitmask) << (32 - ((i+1)*self->bits_per_value)); + } + // copy it in + for (uint32_t i=0; istride * self->height; i++) { + self->data[i] = word; } } From ca9796470115cef7ec22e9f59a3e68c319a5c32e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 16:03:35 -0500 Subject: [PATCH 209/919] ulab: Get updates from upstream --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index a91b36986d..22813d6736 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit a91b36986d81fd906a6232010778f2a93d690f8e +Subproject commit 22813d673691490b74ba21b57a1853fbfcbfac5b From d1a2a1a33374441cb619f4d2ff5d3a3c503975c6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 16:18:42 -0500 Subject: [PATCH 210/919] test requires yield, can't run native --- tests/run-tests | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run-tests b/tests/run-tests index f6c727a8a6..6e980f03ce 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -385,6 +385,7 @@ def run_tests(pyb, tests, args, base_path=".", num_threads=1): skip_tests.add('stress/gc_trace.py') # requires yield skip_tests.add('stress/recursive_gen.py') # requires yield skip_tests.add('extmod/vfs_userfs.py') # because native doesn't properly handle globals across different modules + skip_tests.add('../extmod/ulab/tests/argminmax.py') # requires yield def run_one_test(test_file): test_file = test_file.replace('\\', '/') From d19700e975cb73f66863d2b735843318fdad353e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 17:17:51 -0500 Subject: [PATCH 211/919] make translate --- locale/ID.po | 32 +++++++++----------------------- locale/circuitpython.pot | 32 +++++++++----------------------- locale/de_DE.po | 32 +++++++++----------------------- locale/en_US.po | 32 +++++++++----------------------- locale/en_x_pirate.po | 32 +++++++++----------------------- locale/es.po | 32 +++++++++----------------------- locale/fil.po | 32 +++++++++----------------------- locale/fr.po | 32 +++++++++----------------------- locale/it_IT.po | 32 +++++++++----------------------- locale/ko.po | 32 +++++++++----------------------- locale/pl.po | 32 +++++++++----------------------- locale/pt_BR.po | 32 +++++++++----------------------- locale/zh_Latn_pinyin.po | 32 +++++++++----------------------- 13 files changed, 117 insertions(+), 299 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 619f7e6b75..ab8aa844c8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -900,6 +900,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -931,6 +932,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1647,6 +1649,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "" @@ -2158,10 +2164,6 @@ msgstr "" msgid "full" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "fungsi tidak dapat mengambil argumen keyword" @@ -2175,10 +2177,6 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2659,14 +2657,6 @@ msgstr "modul tidak ditemukan" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2676,10 +2666,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3095,7 +3081,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3107,7 +3093,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 177eee2bf0..a421b4ef18 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -889,6 +889,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +921,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1624,6 +1626,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "" @@ -2134,10 +2140,6 @@ msgstr "" msgid "full" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2151,10 +2153,6 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2634,14 +2632,6 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2651,10 +2641,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3069,7 +3055,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3081,7 +3067,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 351da58936..ec343d7f20 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -897,6 +897,7 @@ msgid "Invalid number of bits" msgstr "Ungültige Anzahl von Bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Ungültige Phase" @@ -928,6 +929,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Ungültige Polarität" @@ -1652,6 +1654,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "Array/Bytes auf der rechten Seite erforderlich" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "Attribute werden noch nicht unterstützt" @@ -2163,10 +2169,6 @@ msgstr "" msgid "full" msgstr "voll" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "Funktion akzeptiert keine Keyword-Argumente" @@ -2180,10 +2182,6 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2670,14 +2668,6 @@ msgstr "offset außerhalb der Grenzen" msgid "only bit_depth=16 is supported" msgstr "nur eine bit_depth=16 wird unterstützt" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "nur eine sample_rate=16000 wird unterstützt" @@ -2687,10 +2677,6 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3114,7 +3100,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3126,7 +3112,7 @@ msgid "wrong number of values to unpack" msgstr "falsche Anzahl zu entpackender Werte" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/en_US.po b/locale/en_US.po index 095d175ebd..a28fc10302 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -889,6 +889,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +921,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1624,6 +1626,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "" @@ -2134,10 +2140,6 @@ msgstr "" msgid "full" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2151,10 +2153,6 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2634,14 +2632,6 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2651,10 +2641,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3069,7 +3055,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3081,7 +3067,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index a7f00a7b2e..946c3af24f 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -893,6 +893,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -924,6 +925,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1628,6 +1630,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "" @@ -2138,10 +2144,6 @@ msgstr "" msgid "full" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2155,10 +2157,6 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2638,14 +2636,6 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2655,10 +2645,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3073,7 +3059,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3085,7 +3071,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/es.po b/locale/es.po index 3f4313de93..f3f6c45914 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -897,6 +897,7 @@ msgid "Invalid number of bits" msgstr "Numero inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase inválida" @@ -928,6 +929,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polaridad inválida" @@ -1648,6 +1650,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "array/bytes requeridos en el lado derecho" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "atributos aún no soportados" @@ -2165,10 +2171,6 @@ msgstr "format requiere un dict" msgid "full" msgstr "lleno" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la función no tiene argumentos por palabra clave" @@ -2182,10 +2184,6 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2672,14 +2670,6 @@ msgstr "address fuera de límites" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2689,10 +2679,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3110,7 +3096,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3122,7 +3108,7 @@ msgid "wrong number of values to unpack" msgstr "numero erroneo de valores a descomprimir" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/fil.po b/locale/fil.po index cd6f52c393..44da9b7557 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -905,6 +905,7 @@ msgid "Invalid number of bits" msgstr "Mali ang bilang ng bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Mali ang phase" @@ -936,6 +937,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Mali ang polarity" @@ -1657,6 +1659,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "array/bytes kinakailangan sa kanang bahagi" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" @@ -2179,10 +2185,6 @@ msgstr "kailangan ng format ng dict" msgid "full" msgstr "puno" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "ang function ay hindi kumukuha ng mga argumento ng keyword" @@ -2196,10 +2198,6 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2685,14 +2683,6 @@ msgstr "wala sa sakop ang address" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2702,10 +2692,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3125,7 +3111,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3137,7 +3123,7 @@ msgid "wrong number of values to unpack" msgstr "maling number ng value na i-unpack" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/fr.po b/locale/fr.po index 64abb8f9fd..17746f41fd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -911,6 +911,7 @@ msgid "Invalid number of bits" msgstr "Nombre de bits invalide" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Phase invalide" @@ -942,6 +943,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarité invalide" @@ -1674,6 +1676,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "tableau/octets requis à droite" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "attribut pas encore supporté" @@ -2204,10 +2210,6 @@ msgstr "le format nécessite un dict" msgid "full" msgstr "plein" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la fonction ne prend pas d'arguments nommés" @@ -2221,10 +2223,6 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2712,14 +2710,6 @@ msgstr "adresse hors limites" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2729,10 +2719,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3159,7 +3145,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3171,7 +3157,7 @@ msgid "wrong number of values to unpack" msgstr "mauvais nombre de valeurs à dégrouper" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 89fb9329e2..1717f20f95 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -907,6 +907,7 @@ msgid "Invalid number of bits" msgstr "Numero di bit non valido" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase non valida" @@ -938,6 +939,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarità non valida" @@ -1660,6 +1662,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "attributi non ancora supportati" @@ -2180,10 +2186,6 @@ msgstr "la formattazione richiede un dict" msgid "full" msgstr "pieno" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "la funzione non prende argomenti nominati" @@ -2197,10 +2199,6 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2690,14 +2688,6 @@ msgstr "indirizzo fuori limite" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2707,10 +2697,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3132,7 +3118,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3144,7 +3130,7 @@ msgid "wrong number of values to unpack" msgstr "numero di valori da scompattare non corretto" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/ko.po b/locale/ko.po index d502e60c07..9a1770f33b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -893,6 +893,7 @@ msgid "Invalid number of bits" msgstr "비트 수가 유효하지 않습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "단계가 잘못되었습니다" @@ -924,6 +925,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1629,6 +1631,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "" @@ -2139,10 +2145,6 @@ msgstr "" msgid "full" msgstr "완전한(full)" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "" @@ -2156,10 +2158,6 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2639,14 +2637,6 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2656,10 +2646,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3074,7 +3060,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3086,7 +3072,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/pl.po b/locale/pl.po index 67eff44f3a..d26dff9416 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -894,6 +894,7 @@ msgid "Invalid number of bits" msgstr "Zła liczba bitów" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Zła faza" @@ -925,6 +926,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Zła polaryzacja" @@ -1632,6 +1634,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "tablica/bytes wymagane po prawej stronie" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "atrybuty nie są jeszcze obsługiwane" @@ -2143,10 +2149,6 @@ msgstr "format wymaga słownika" msgid "full" msgstr "pełny" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "funkcja nie bierze argumentów nazwanych" @@ -2160,10 +2162,6 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2643,14 +2641,6 @@ msgstr "offset poza zakresem" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2660,10 +2650,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3080,7 +3066,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3092,7 +3078,7 @@ msgid "wrong number of values to unpack" msgstr "zła liczba wartości do rozpakowania" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c6fe5dcba2..153dadd910 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -900,6 +900,7 @@ msgid "Invalid number of bits" msgstr "Número inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase Inválida" @@ -931,6 +932,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" @@ -1642,6 +1644,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "atributos ainda não suportados" @@ -2156,10 +2162,6 @@ msgstr "" msgid "full" msgstr "cheio" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "função não aceita argumentos de palavras-chave" @@ -2173,10 +2175,6 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2656,14 +2654,6 @@ msgstr "" msgid "only bit_depth=16 is supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "" @@ -2673,10 +2663,6 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3093,7 +3079,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3105,7 +3091,7 @@ msgid "wrong number of values to unpack" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 8be47eb864..d1c0d5b79c 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-30 17:03-0700\n" +"POT-Creation-Date: 2020-04-13 19:22-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -902,6 +902,7 @@ msgid "Invalid number of bits" msgstr "Wèi shù wúxiào" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Jiēduàn wúxiào" @@ -933,6 +934,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" @@ -1657,6 +1659,10 @@ msgstr "" msgid "array/bytes required on right side" msgstr "yòu cè xūyào shùzǔ/zì jié" +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + #: py/objstr.c msgid "attributes not supported yet" msgstr "shǔxìng shàngwèi zhīchí" @@ -2171,10 +2177,6 @@ msgstr "géshì yāoqiú yīgè yǔjù" msgid "full" msgstr "chōngfèn" -#: extmod/ulab/code/linalg.c -msgid "function defined for ndarrays only" -msgstr "" - #: py/argcheck.c msgid "function does not take keyword arguments" msgstr "hánshù méiyǒu guānjiàn cí cānshù" @@ -2188,10 +2190,6 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" -#: extmod/ulab/code/linalg.c -msgid "function is defined for ndarrays only" -msgstr "" - #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2673,14 +2671,6 @@ msgstr "piānlí biānjiè" msgid "only bit_depth=16 is supported" msgstr "Jǐn zhīchí wèi shēndù = 16" -#: extmod/ulab/code/linalg.c -msgid "only ndarray objects can be inverted" -msgstr "" - -#: extmod/ulab/code/linalg.c -msgid "only ndarrays can be inverted" -msgstr "" - #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" @@ -2690,10 +2680,6 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" -#: extmod/ulab/code/linalg.c -msgid "only square matrices can be inverted" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" @@ -3110,7 +3096,7 @@ msgid "wrong argument type" msgstr "" #: extmod/ulab/code/ndarray.c -msgid "wrong input type" +msgid "wrong index type" msgstr "" #: py/objstr.c @@ -3122,7 +3108,7 @@ msgid "wrong number of values to unpack" msgstr "wúfǎ jiě bāo de zhí shù" #: extmod/ulab/code/ndarray.c -msgid "wrong operand type on the right hand side" +msgid "wrong operand type" msgstr "" #: shared-module/displayio/Shape.c From db01f88cc32ddb307c09692eb28ef29389c774cb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 19:58:52 -0500 Subject: [PATCH 212/919] enable MICROPY_PY_REVERSE_SPECIAL_METHODS where ulab is enabled --- ports/cxd56/boards/spresense/mpconfigboard.h | 3 +++ ports/mimxrt10xx/mpconfigport.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/cxd56/boards/spresense/mpconfigboard.h b/ports/cxd56/boards/spresense/mpconfigboard.h index 0245e20450..c53f6b418c 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.h +++ b/ports/cxd56/boards/spresense/mpconfigboard.h @@ -36,3 +36,6 @@ #define DEFAULT_UART_BUS_RX (&pin_UART2_RXD) #define DEFAULT_UART_BUS_TX (&pin_UART2_TXD) + +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) + diff --git a/ports/mimxrt10xx/mpconfigport.h b/ports/mimxrt10xx/mpconfigport.h index 745c12f7de..7e7df01230 100644 --- a/ports/mimxrt10xx/mpconfigport.h +++ b/ports/mimxrt10xx/mpconfigport.h @@ -44,7 +44,7 @@ extern uint8_t _ld_default_stack_size; #define MICROPY_PY_FUNCTION_ATTRS (0) #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR ((uint32_t) &_ld_filesystem_start) From 693928d201c22338e34ffe9c8133f8f0f01ca617 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 20:10:02 -0500 Subject: [PATCH 213/919] doc updates --- shared-bindings/ulab/__init__.rst | 36 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index d8c10dcc86..c9f2617ff0 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -79,26 +79,30 @@ ulab.array -- 1- and 2- dimensional array .. method:: __add__() Adds corresponding elements of the two arrays, or adds a number to all - elements of the array. A number must be on the right hand side. If - both arguments are arrays, their sizes must match. + elements of the array. If both arguments are arrays, their sizes must match. .. method:: __sub__() - Subtracts corresponding elements of the two arrays, or subtracts a - number from all elements of the array. A number must be on the right - hand side. If both arguments are arrays, their sizes must match. + Subtracts corresponding elements of the two arrays, or adds a number to all + elements of the array. If both arguments are arrays, their sizes must match. .. method:: __mul__() Multiplies corresponding elements of the two arrays, or multiplies - all elements of the array by a number. A number must be on the right - hand side. If both arguments are arrays, their sizes must match. + all elements of the array by a number. If both arguments are arrays, + their sizes must match. .. method:: __div__() Multiplies corresponding elements of the two arrays, or divides - all elements of the array by a number. A number must be on the right - hand side. If both arguments are arrays, their sizes must match. + all elements of the array by a number. If both arguments are arrays, + their sizes must match. + + .. method:: __pow__() + + Computes the power (x**y) of corresponding elements of the the two arrays, + or one number and one array. If both arguments are arrays, their sizes + must match. .. method:: __getitem__() @@ -348,6 +352,12 @@ much more efficient than expressing the same operation as a Python loop. Return the total number of elements in the array, as an integer. +.. method:: trace(m) + + :param m: a square matrix + + Compute the trace of the matrix, the sum of its diagonal elements. + :mod:`ulab.filter` --- Filtering functions ========================================== @@ -404,11 +414,11 @@ operate over the flattened array (None), rows (0), or columns (1). .. method:: argmax(array, \*, axis=None) - Return the index of the maximum element of the 1D array, as an array with 1 element + Return the index of the maximum element of the 1D array .. method:: argmin(array, \*, axis=None) - Return the index of the minimum element of the 1D array, as an array with 1 element + Return the index of the minimum element of the 1D array .. method:: argsort(array, \*, axis=None) @@ -426,7 +436,7 @@ operate over the flattened array (None), rows (0), or columns (1). .. method:: max(array, \*, axis=None) - Return the maximum element of the 1D array, as an array with 1 element + Return the maximum element of the 1D array .. method:: mean(array, \*, axis=None) @@ -434,7 +444,7 @@ operate over the flattened array (None), rows (0), or columns (1). .. method:: min(array, \*, axis=None) - Return the minimum element of the 1D array, as an array with 1 element + Return the minimum element of the 1D array .. method:: roll(array, distance, \*, axis=None) From cc21bed0e40e10790478cb643b9e5bd831069804 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 16:03:35 -0500 Subject: [PATCH 214/919] ulab: Get updates from upstream --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 22813d6736..a746bd8e09 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 22813d673691490b74ba21b57a1853fbfcbfac5b +Subproject commit a746bd8e0953853056ee405e2fa02c8ebca4fb79 From 135fb5b8870050f8045dcea88c8896a1a35b493c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Apr 2020 10:08:07 -0500 Subject: [PATCH 215/919] py.mk: update warning flags needed for ulab --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index bac237b7dd..bca6ac14c3 100644 --- a/py/py.mk +++ b/py/py.mk @@ -119,7 +119,7 @@ ulab.c \ vectorise.c \ ) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 -$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY +$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif # External modules written in C. From 6378d600c40d462836fd6599b9bdadf5e78df8f1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 28 Mar 2020 10:34:18 -0500 Subject: [PATCH 216/919] displayio: implement, use allocate_display_or_raise --- shared-bindings/displayio/Display.c | 13 ++----------- shared-bindings/displayio/EPaperDisplay.c | 13 ++----------- shared-module/displayio/__init__.c | 18 ++++++++++++++++++ shared-module/displayio/__init__.h | 3 +++ 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 3ef7e74e9e..4c6e525b27 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -152,17 +152,8 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } - displayio_display_obj_t *self = NULL; - for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].display.base.type == NULL || - displays[i].display.base.type == &mp_type_NoneType) { - self = &displays[i].display; - break; - } - } - if (self == NULL) { - mp_raise_RuntimeError(translate("Too many displays")); - } + primary_display_t *disp = allocate_display_or_raise(); + displayio_display_obj_t *self = &disp->display;; self->base.type = &displayio_display_type; common_hal_displayio_display_construct( self, diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 25a4a41e92..1459c16809 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -136,17 +136,8 @@ STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } - displayio_epaperdisplay_obj_t *self = NULL; - for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].display.base.type == NULL || - displays[i].display.base.type == &mp_type_NoneType) { - self = &displays[i].epaper_display; - break; - } - } - if (self == NULL) { - mp_raise_RuntimeError(translate("Too many displays")); - } + primary_display_t *disp = allocate_display_or_raise(); + displayio_epaperdisplay_obj_t *self = &disp->epaper_display;; mp_float_t refresh_time = mp_obj_get_float(args[ARG_refresh_time].u_obj); mp_float_t seconds_per_frame = mp_obj_get_float(args[ARG_seconds_per_frame].u_obj); diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index efa61265e6..fd58a0322a 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -308,3 +308,21 @@ void displayio_area_transform_within(bool mirror_x, bool mirror_y, bool transpos transformed->x1 = whole->x1 + (y1 - whole->y1); } } + +primary_display_t *allocate_display() { + for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { + mp_const_obj_t display_type = displays[i].display.base.type; + if (display_type == NULL || display_type == &mp_type_NoneType) { + return &displays[i]; + } + } + return NULL; + +primary_display_t *allocate_display_or_raise() { + primary_display_t *result = allocate_display(); + if (!result) { + mp_raise_RuntimeError(translate("Too many displays")); + } +} + +} diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index e78bc61ce4..4e1297c8d1 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -54,4 +54,7 @@ void displayio_background(void); void reset_displays(void); void displayio_gc_collect(void); +primary_display_t *allocate_display(void); +primary_display_t *allocate_display_or_raise(void); + #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO___INIT___H From 8cba145c90294a001ec5814fb501a7b96a055780 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 30 Mar 2020 10:47:14 -0500 Subject: [PATCH 217/919] displayio: implement, use allocate_new_display_bus_or_raise --- shared-bindings/displayio/FourWire.c | 13 +------------ shared-bindings/displayio/I2CDisplay.c | 13 +------------ shared-bindings/displayio/ParallelBus.c | 13 +------------ shared-module/displayio/__init__.c | 17 +++++++++++++++++ shared-module/displayio/__init__.h | 2 ++ 5 files changed, 22 insertions(+), 36 deletions(-) diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 77329578a4..1cd51b2e2d 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -82,19 +82,8 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mcu_pin_obj_t *chip_select = validate_obj_is_free_pin(args[ARG_chip_select].u_obj); mcu_pin_obj_t *reset = validate_obj_is_free_pin_or_none(args[ARG_reset].u_obj); - displayio_fourwire_obj_t* self = NULL; mp_obj_t spi = args[ARG_spi_bus].u_obj; - for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].fourwire_bus.base.type == NULL || - displays[i].fourwire_bus.base.type == &mp_type_NoneType) { - self = &displays[i].fourwire_bus; - self->base.type = &displayio_fourwire_type; - break; - } - } - if (self == NULL) { - mp_raise_RuntimeError(translate("Too many display busses")); - } + displayio_fourwire_obj_t* self = &allocate_display_bus_or_raise()->fourwire_bus; uint8_t polarity = args[ARG_polarity].u_int; if (polarity != 0 && polarity != 1) { diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 2e312aa14e..dd3333f6de 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -71,19 +71,8 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t mcu_pin_obj_t *reset = validate_obj_is_free_pin_or_none(args[ARG_reset].u_obj); - displayio_i2cdisplay_obj_t* self = NULL; mp_obj_t i2c = args[ARG_i2c_bus].u_obj; - for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].i2cdisplay_bus.base.type == NULL || - displays[i].i2cdisplay_bus.base.type == &mp_type_NoneType) { - self = &displays[i].i2cdisplay_bus; - self->base.type = &displayio_i2cdisplay_type; - break; - } - } - if (self == NULL) { - mp_raise_RuntimeError(translate("Too many display busses")); - } + displayio_i2cdisplay_obj_t* self = &allocate_display_bus_or_raise()->i2cdisplay_bus; common_hal_displayio_i2cdisplay_construct(self, MP_OBJ_TO_PTR(i2c), args[ARG_device_address].u_int, reset); diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index b3a876f903..4d9ffb0a1e 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -83,18 +83,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t mcu_pin_obj_t *read = validate_obj_is_free_pin(args[ARG_read].u_obj); mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); - displayio_parallelbus_obj_t* self = NULL; - for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].parallel_bus.base.type== NULL || - displays[i].parallel_bus.base.type == &mp_type_NoneType) { - self = &displays[i].parallel_bus; - self->base.type = &displayio_parallelbus_type; - break; - } - } - if (self == NULL) { - mp_raise_RuntimeError(translate("Too many display busses")); - } + displayio_parallelbus_obj_t* self = &allocate_display_bus_or_raise()->parallel_bus; common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset); return self; diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index fd58a0322a..4844dfe60b 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -326,3 +326,20 @@ primary_display_t *allocate_display_or_raise() { } } +primary_display_t *allocate_display_bus(void) { + for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { + mp_const_obj_t display_type = displays[i].display.base.type; + if (display_type == NULL || display_type == &mp_type_NoneType) { + return &displays[i]; + } + } + return NULL; +} + +primary_display_t *allocate_display_bus_or_raise(void) { + primary_display_t *result = allocate_display_bus(); + if (result) { + return result; + } + mp_raise_RuntimeError(translate("Too many display busses")); +} diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 4e1297c8d1..638c2091e0 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -56,5 +56,7 @@ void displayio_gc_collect(void); primary_display_t *allocate_display(void); primary_display_t *allocate_display_or_raise(void); +primary_display_t *allocate_display_bus(void); +primary_display_t *allocate_display_bus_or_raise(void); #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO___INIT___H From 094fe05bdd68332fa617df8a98858e324afa15ec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 25 Mar 2020 13:40:48 -0500 Subject: [PATCH 218/919] allow retrieving info about a supervisor allocation --- supervisor/memory.h | 1 + supervisor/shared/memory.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/supervisor/memory.h b/supervisor/memory.h index f557744ae5..f4359ca46e 100755 --- a/supervisor/memory.h +++ b/supervisor/memory.h @@ -43,6 +43,7 @@ typedef struct { void memory_init(void); void free_memory(supervisor_allocation* allocation); +supervisor_allocation* allocation_from_ptr(void *ptr); supervisor_allocation* allocate_remaining_memory(void); // Allocate a piece of a given length in bytes. If high_address is true then it should be allocated diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 14c3b4979b..51037bd6d8 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -82,6 +82,15 @@ void free_memory(supervisor_allocation* allocation) { allocation->ptr = NULL; } +supervisor_allocation* allocation_from_ptr(void *ptr) { + for (size_t index = 0; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) { + if (allocations[index].ptr == ptr) { + return &allocations[index]; + } + } + return NULL; +} + supervisor_allocation* allocate_remaining_memory(void) { if (low_address == high_address) { return NULL; From a51d4f7a45ba19dfe419bbdd7f744ded50f0c38e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 31 Mar 2020 13:32:32 -0500 Subject: [PATCH 219/919] pycubed: add trailing newline to file POSIX specifies that text files end in a trailing newline --- ports/atmel-samd/boards/pycubed/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index adbb4aedb9..14e6883c08 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -21,4 +21,4 @@ CIRCUITPY_PS2IO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD From 09dc46a98480350b157636ffff8b89470f595f6e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Mar 2020 13:12:01 -0500 Subject: [PATCH 220/919] Add Protomatter and FramebufferDisplay --- .gitmodules | 3 + lib/protomatter | 1 + .../boards/hallowing_m0_express/board.c | 1 + .../boards/hallowing_m4_express/board.c | 1 + .../boards/kicksat-sprite/mpconfigboard.mk | 2 + ports/atmel-samd/boards/monster_m4sk/board.c | 1 + ports/atmel-samd/boards/pewpew_m4/board.c | 1 + ports/atmel-samd/boards/pybadge/board.c | 1 + .../atmel-samd/boards/pybadge_airlift/board.c | 1 + .../boards/pycubed/mpconfigboard.mk | 2 + ports/atmel-samd/boards/pygamer/board.c | 1 + .../atmel-samd/boards/pygamer_advance/board.c | 1 + ports/atmel-samd/boards/pyportal/board.c | 1 + .../atmel-samd/boards/pyportal_titano/board.c | 3 +- .../boards/robohatmm1_m4/mpconfigboard.mk | 2 + ports/atmel-samd/boards/ugame10/board.c | 1 + .../mpconfigboard.mk | 2 + .../boards/winterbloom_sol/mpconfigboard.mk | 2 + .../common-hal/_protomatter/Protomatter.c | 77 +++ .../common-hal/_protomatter/Protomatter.h | 35 ++ .../common-hal/_protomatter/__init__.c | 0 .../common-hal/microcontroller/Pin.c | 12 + ports/atmel-samd/common-hal/pulseio/PWMOut.c | 27 +- ports/atmel-samd/mpconfigport.mk | 12 + ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/timer_handler.c | 7 + ports/atmel-samd/timer_handler.h | 5 + .../nrf/boards/clue_nrf52840_express/board.c | 1 + ports/nrf/boards/ohs2020_badge/board.c | 1 + ports/stm/boards/meowbit_v121/board.c | 1 + py/circuitpy_defns.mk | 18 + py/circuitpy_mpconfig.h | 16 + py/circuitpy_mpconfig.mk | 11 + shared-bindings/_protomatter/Protomatter.c | 293 ++++++++++++ shared-bindings/_protomatter/Protomatter.h | 56 +++ shared-bindings/_protomatter/__init__.c | 55 +++ shared-bindings/displayio/Display.c | 9 +- shared-bindings/displayio/Display.h | 2 +- .../framebufferio/FramebufferDisplay.c | 452 ++++++++++++++++++ .../framebufferio/FramebufferDisplay.h | 74 +++ shared-bindings/framebufferio/__init__.c | 63 +++ shared-bindings/framebufferio/__init__.h | 0 shared-bindings/microcontroller/Pin.h | 6 + shared-module/_protomatter/Protomatter.c | 169 +++++++ shared-module/_protomatter/Protomatter.h | 0 shared-module/_protomatter/__init__.c | 0 shared-module/_protomatter/__init__.h | 0 shared-module/_protomatter/allocator.h | 30 ++ shared-module/displayio/ColorConverter.c | 11 +- shared-module/displayio/Display.c | 4 +- shared-module/displayio/EPaperDisplay.c | 2 +- shared-module/displayio/Palette.h | 1 + shared-module/displayio/__init__.c | 43 +- shared-module/displayio/__init__.h | 10 + shared-module/displayio/display_core.c | 46 +- shared-module/displayio/display_core.h | 2 +- .../framebufferio/FramebufferDisplay.c | 339 +++++++++++++ .../framebufferio/FramebufferDisplay.h | 82 ++++ shared-module/framebufferio/__init__.c | 0 shared-module/framebufferio/__init__.h | 0 tools/convert_release_notes.py | 3 + 61 files changed, 1954 insertions(+), 50 deletions(-) create mode 160000 lib/protomatter create mode 100644 ports/atmel-samd/common-hal/_protomatter/Protomatter.c create mode 100644 ports/atmel-samd/common-hal/_protomatter/Protomatter.h create mode 100644 ports/atmel-samd/common-hal/_protomatter/__init__.c create mode 100644 shared-bindings/_protomatter/Protomatter.c create mode 100644 shared-bindings/_protomatter/Protomatter.h create mode 100644 shared-bindings/_protomatter/__init__.c create mode 100644 shared-bindings/framebufferio/FramebufferDisplay.c create mode 100644 shared-bindings/framebufferio/FramebufferDisplay.h create mode 100644 shared-bindings/framebufferio/__init__.c create mode 100644 shared-bindings/framebufferio/__init__.h create mode 100644 shared-module/_protomatter/Protomatter.c create mode 100644 shared-module/_protomatter/Protomatter.h create mode 100644 shared-module/_protomatter/__init__.c create mode 100644 shared-module/_protomatter/__init__.h create mode 100644 shared-module/_protomatter/allocator.h create mode 100644 shared-module/framebufferio/FramebufferDisplay.c create mode 100644 shared-module/framebufferio/FramebufferDisplay.h create mode 100644 shared-module/framebufferio/__init__.c create mode 100644 shared-module/framebufferio/__init__.h diff --git a/.gitmodules b/.gitmodules index 365d9ff72f..ebff8ecb2a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -119,3 +119,6 @@ [submodule "ports/stm/st_driver"] path = ports/stm/st_driver url = https://github.com/hathach/st_driver.git +[submodule "lib/protomatter"] + path = lib/protomatter + url = https://github.com/adafruit/Adafruit_Protomatter diff --git a/lib/protomatter b/lib/protomatter new file mode 160000 index 0000000000..c3a3e35731 --- /dev/null +++ b/lib/protomatter @@ -0,0 +1 @@ +Subproject commit c3a3e35731d641cb5a21ae7319634afc419f5afe diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 0b44bd4bb1..9a1db9ca97 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -97,6 +97,7 @@ void board_init(void) { false, // Pixels in a byte share a row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 5dbdd499af..3e4a04ae22 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -77,6 +77,7 @@ void board_init(void) { false, // Pixels in a byte share a row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 5429bcf86e..f7223790ac 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -11,8 +11,10 @@ LONGINT_IMPL = MPZ # Not needed. CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_NETWORK = 0 +CIRCUITPY_PROTOMATTER = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 684639c309..55d6f80c91 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -78,6 +78,7 @@ void board_init(void) { false, // pixels in a byte share a row. Only valid for depths < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 0f8936696f..cf8439cf0e 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -128,6 +128,7 @@ void board_init(void) { false, // pixels in byte share row. only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 257d72e30d..ffddf03977 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -100,6 +100,7 @@ void board_init(void) { false, // pixels in byte share row. only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pybadge_airlift/board.c b/ports/atmel-samd/boards/pybadge_airlift/board.c index 7df245a724..8274d0ebeb 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/board.c +++ b/ports/atmel-samd/boards/pybadge_airlift/board.c @@ -78,6 +78,7 @@ void board_init(void) { false, // pixels in byte share row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index 14e6883c08..c14a296159 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -15,7 +15,9 @@ LONGINT_IMPL = MPZ # Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_PROTOMATTER = 0 CIRCUITPY_PS2IO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 7c3ca6e335..c7f2f6e1d8 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -100,6 +100,7 @@ void board_init(void) { false, // pixels in a byte share a row. Only valid for depths < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pygamer_advance/board.c b/ports/atmel-samd/boards/pygamer_advance/board.c index 7fd3ebc5e1..6053fedb09 100644 --- a/ports/atmel-samd/boards/pygamer_advance/board.c +++ b/ports/atmel-samd/boards/pygamer_advance/board.c @@ -78,6 +78,7 @@ void board_init(void) { false, // pixels in a byte share a row. Only valid for depths < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index a86f0ee48a..ed3006e3cc 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -87,6 +87,7 @@ void board_init(void) { false, // pixels_in_byte_share_row (unused for depths > 8) 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index a9ded1760d..40b7e84025 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -101,9 +101,10 @@ void board_init(void) { 0, // rotation 16, // Color depth false, // grayscale - false, // pixels_in_byte_share_row (unused for depths > 8) + false, // pixels_i|n_byte_share_row (unused for depths > 8) 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index fd4f222306..57eb7f1b9c 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -17,7 +17,9 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 # Make room for more stuff CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_PROTOMATTER = 0 # Include these Python libraries in firmware. #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 07814d558b..38661950f4 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -97,6 +97,7 @@ void board_init(void) { false, // pixels in byte share row. Only used with depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index d91369f75e..691c1c1365 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_AUDIOIO = 1 # Disable modules that are unusable on this special-purpose board. CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_AUDIOBUSIO = 0 @@ -27,6 +28,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_PROTOMATTER = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 166eaad3f7..ed97aef4c0 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -21,10 +21,12 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_PROTOMATTER = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 diff --git a/ports/atmel-samd/common-hal/_protomatter/Protomatter.c b/ports/atmel-samd/common-hal/_protomatter/Protomatter.c new file mode 100644 index 0000000000..702de0e3d4 --- /dev/null +++ b/ports/atmel-samd/common-hal/_protomatter/Protomatter.c @@ -0,0 +1,77 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "common-hal/_protomatter/Protomatter.h" + +#include "samd/timers.h" +#include "timer_handler.h" + +void *common_hal_protomatter_timer_allocate() { + uint8_t timer_index = find_free_timer(); + if (timer_index == 0xff) { + return NULL; + } + timer_never_reset(timer_index, true); + return tc_insts[timer_index]; +} + +static uint8_t tc_index_from_ptr(void* ptr) { + for (uint8_t i = TC_INST_NUM; i > 0; i--) { + if (tc_insts[i] == ptr) { + return i; + } + } + return 0xff; +} + +void common_hal_protomatter_timer_enable(void* ptr) { + uint8_t timer_index = tc_index_from_ptr(ptr); + if (timer_index == 0xff) { + return; + } + set_timer_handler(true, timer_index, TC_HANDLER_PROTOMATTER); + turn_on_clocks(true, timer_index, 1); +} + +void common_hal_protomatter_timer_disable(void* ptr) { + uint8_t timer_index = tc_index_from_ptr(ptr); + if (timer_index == 0xff) { + return; + } + set_timer_handler(true, timer_index, TC_HANDLER_NO_INTERRUPT); +} + +void common_hal_protomatter_timer_free(void* ptr) { + uint8_t timer_index = tc_index_from_ptr(ptr); + if (timer_index == 0xff) { + return; + } + tc_set_enable(ptr, false); + tc_reset(ptr); + timer_reset_ok(timer_index, true); +} diff --git a/ports/atmel-samd/common-hal/_protomatter/Protomatter.h b/ports/atmel-samd/common-hal/_protomatter/Protomatter.h new file mode 100644 index 0000000000..8185bed0e5 --- /dev/null +++ b/ports/atmel-samd/common-hal/_protomatter/Protomatter.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H + +void *common_hal_protomatter_timer_allocate(void); +void common_hal_protomatter_timer_enable(void*); +void common_hal_protomatter_timer_disable(void*); +void common_hal_protomatter_timer_free(void*); + +#endif diff --git a/ports/atmel-samd/common-hal/_protomatter/__init__.c b/ports/atmel-samd/common-hal/_protomatter/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 9719ea5b11..cf78673b20 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -240,3 +240,15 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { return pin_number_is_free(pin->number); } + +uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) { + return pin->number; +} + +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + return claim_pin(pin); +} + +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { + reset_pin_number(pin_no); +} diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index fef581584f..1da0da8444 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -61,22 +61,31 @@ uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 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) { - if (self->timer->is_tc) { - never_reset_tc_or_tcc[self->timer->index] += 1; +STATIC void timer_refcount(int index, bool is_tc, int increment) { + if (is_tc) { + never_reset_tc_or_tcc[index] += increment; } else { - never_reset_tc_or_tcc[TC_INST_NUM + self->timer->index] += 1; + never_reset_tc_or_tcc[TC_INST_NUM + index] += increment; } +} + +void timer_never_reset(int index, bool is_tc) { + timer_refcount(index, is_tc, 1); +} + +void timer_reset_ok(int index, bool is_tc) { + timer_refcount(index, is_tc, -1); +} + + +void common_hal_pulseio_pwmout_never_reset(pulseio_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) { - if (self->timer->is_tc) { - never_reset_tc_or_tcc[self->timer->index] -= 1; - } else { - never_reset_tc_or_tcc[TC_INST_NUM + self->timer->index] -= 1; - } + timer_reset_ok(self->timer->index, self->timer->is_tc); } void pwmout_reset(void) { diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index c2408feae3..61f7c206ab 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -70,6 +70,18 @@ CIRCUITPY_ULAB = 1 endif endif +ifndef CIRCUITPY_PROTOMATTER +ifneq ($(CIRCUITPY_SMALL_BUILD),1) +CIRCUITPY_PROTOMATTER = 1 +endif +endif + +ifndef CIRCUITPY_FRAMEBUFFERIO +ifneq ($(CIRCUITPY_SMALL_BUILD),1) +CIRCUITPY_FRAMEBUFFERIO = 1 +endif +endif + endif # samd51 INTERNAL_LIBM = 1 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index b89811f22a..f528240c2a 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit b89811f22a24ac350079ceaf0cdf0e62aa03f4f4 +Subproject commit f528240c2a4c2d7a39de786f1aa56895c12227b4 diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 5d6de3093f..598fad564a 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -33,6 +33,8 @@ #include "shared-module/_pew/PewPew.h" #include "common-hal/frequencyio/FrequencyIn.h" +extern void _PM_IRQ_HANDLER(void); + static uint8_t tc_handler[TC_INST_NUM]; void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler) { @@ -62,6 +64,11 @@ void shared_timer_handler(bool is_tc, uint8_t index) { frequencyin_interrupt_handler(index); #endif break; + case TC_HANDLER_PROTOMATTER: + #if CIRCUITPY_PROTOMATTER + _PM_IRQ_HANDLER(); + #endif + break; default: break; } diff --git a/ports/atmel-samd/timer_handler.h b/ports/atmel-samd/timer_handler.h index 4a7adb58c3..646cd54ec8 100644 --- a/ports/atmel-samd/timer_handler.h +++ b/ports/atmel-samd/timer_handler.h @@ -30,8 +30,13 @@ #define TC_HANDLER_PULSEOUT 0x1 #define TC_HANDLER_PEW 0x2 #define TC_HANDLER_FREQUENCYIN 0x3 +#define TC_HANDLER_PROTOMATTER 0x4 void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler); void shared_timer_handler(bool is_tc, uint8_t index); +// implementation of these functions is in PWMOut.c +void timer_never_reset(int index, bool is_tc); +void timer_reset_ok(int index, bool is_tc); + #endif // MICROPY_INCLUDED_ATMEL_SAMD_TIMER_HANDLER_H diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index e9f8d244e4..2370a0aa1b 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -77,6 +77,7 @@ void board_init(void) { false, // Pixels in a byte share a row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 88c68bcb84..bbb20cc6e5 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -77,6 +77,7 @@ void board_init(void) { false, // Pixels in a byte share a row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 9e2d99bce0..68eed29269 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -98,6 +98,7 @@ void board_init(void) { false, // Pixels in a byte share a row. Only used for depth < 8 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f84d0b5b1d..b6b0cacaf8 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -142,6 +142,9 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% terminalio/% fontio/% endif +ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1) +SRC_PATTERNS += framebufferio/% +endif ifeq ($(CIRCUITPY_FREQUENCYIO),1) SRC_PATTERNS += frequencyio/% endif @@ -178,6 +181,9 @@ endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += _pixelbuf/% endif +ifeq ($(CIRCUITPY_PROTOMATTER),1) +SRC_PATTERNS += _protomatter/% +endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% endif @@ -242,6 +248,8 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ + _protomatter/Protomatter.c \ + _protomatter/__init__.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -315,6 +323,8 @@ SRC_SHARED_MODULE_ALL = \ _bleio/ScanResults.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ + _protomatter/Protomatter.c \ + _protomatter/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ @@ -348,6 +358,8 @@ SRC_SHARED_MODULE_ALL = \ displayio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ + framebufferio/FramebufferDisplay.c \ + framebufferio/__init__.c \ gamepad/GamePad.c \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ @@ -401,6 +413,12 @@ SRC_MOD += $(addprefix lib/mp3/src/, \ ) $(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)' endif +ifeq ($(CIRCUITPY_PROTOMATTER),1) +SRC_MOD += $(addprefix lib/protomatter/, \ + core.c \ +) +$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/_protomatter/allocator.h" -DCIRCUITPY -Wno-missing-braces +endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE_INTERNAL = \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 04e1912643..06289258d1 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -345,6 +345,13 @@ extern const struct _mp_obj_module_t terminalio_module; #define CIRCUITPY_DISPLAY_LIMIT (0) #endif +#if CIRCUITPY_FRAMEBUFFERIO +extern const struct _mp_obj_module_t framebufferio_module; +#define FRAMEBUFFERIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_framebufferio), (mp_obj_t)&framebufferio_module }, +#else +#define FRAMEBUFFERIO_MODULE +#endif + #if CIRCUITPY_FREQUENCYIO extern const struct _mp_obj_module_t frequencyio_module; #define FREQUENCYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_frequencyio), (mp_obj_t)&frequencyio_module }, @@ -454,6 +461,13 @@ extern const struct _mp_obj_module_t pixelbuf_module; #define PIXELBUF_MODULE #endif +#if CIRCUITPY_PROTOMATTER +extern const struct _mp_obj_module_t protomatter_module; +#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__protomatter),(mp_obj_t)&protomatter_module }, +#else +#define PROTOMATTER_MODULE +#endif + #if CIRCUITPY_PULSEIO extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, @@ -628,6 +642,7 @@ extern const struct _mp_obj_module_t ustack_module; FONTIO_MODULE \ TERMINALIO_MODULE \ ERRNO_MODULE \ + FRAMEBUFFERIO_MODULE \ FREQUENCYIO_MODULE \ GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ @@ -643,6 +658,7 @@ extern const struct _mp_obj_module_t ustack_module; PEW_MODULE \ PIXELBUF_MODULE \ PS2IO_MODULE \ + PROTOMATTER_MODULE \ PULSEIO_MODULE \ RANDOM_MODULE \ RE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1a375efc65..ba94f9784f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -149,6 +149,11 @@ CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD) endif CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) +ifndef CIRCUITPY_FRAMEBUFFERIO +CIRCUITPY_FRAMEBUFFERIO = 0 +endif +CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) + ifndef CIRCUITPY_FREQUENCYIO CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD) endif @@ -210,6 +215,12 @@ CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD) endif CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) +# Only for SAMD boards for the moment +ifndef CIRCUITPY_PROTOMATTER +CIRCUITPY_PROTOMATTER = 0 +endif +CFLAGS += -DCIRCUITPY_PROTOMATTER=$(CIRCUITPY_PROTOMATTER) + ifndef CIRCUITPY_PULSEIO CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD) endif diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c new file mode 100644 index 0000000000..8d0d223bb5 --- /dev/null +++ b/shared-bindings/_protomatter/Protomatter.c @@ -0,0 +1,293 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "common-hal/_protomatter/Protomatter.h" +#include "shared-bindings/_protomatter/Protomatter.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/util.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/framebufferio/__init__.h" +#include "shared-module/framebufferio/FramebufferDisplay.h" + +//| .. currentmodule:: _protomatter +//| +//| :class:`protomatter` -- Driver for HUB75-style RGB LED matrices +//| ================================================================ +//| + +extern Protomatter_core *_PM_protoPtr; + +STATIC uint8_t validate_pin(mp_obj_t obj) { + mcu_pin_obj_t *result = validate_obj_is_free_pin(obj); + return common_hal_mcu_pin_number(result); +} + +STATIC void validate_pins(qstr what, uint8_t* pin_nos, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out) { + mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); + if (len > max_pins) { + mp_raise_ValueError_varg(translate("At most %d %q may be specified"), max_pins, what); + } + *count_out = len; + for (mp_int_t i=0; iprotomatter; + self->base.type = &protomatter_Protomatter_type; + + uint8_t rgb_count, addr_count; + uint8_t rgb_pins[MP_ARRAY_SIZE(self->rgb_pins)]; + uint8_t addr_pins[MP_ARRAY_SIZE(self->addr_pins)]; + uint8_t clock_pin = validate_pin(args[ARG_clock_pin].u_obj); + uint8_t latch_pin = validate_pin(args[ARG_latch_pin].u_obj); + uint8_t oe_pin = validate_pin(args[ARG_oe_pin].u_obj); + + validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); + validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); + + mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; + if (framebuffer == mp_const_none) { + int width = args[ARG_width].u_int; + int bufsize = 2 * width * rgb_count / 3 * (1 << addr_count); + framebuffer = mp_obj_new_bytearray_of_zeros(bufsize); + } + + common_hal_protomatter_protomatter_construct(self, + args[ARG_width].u_int, + args[ARG_bit_depth].u_int, + rgb_count, rgb_pins, + addr_count, addr_pins, + clock_pin, latch_pin, oe_pin, + args[ARG_doublebuffer].u_bool, + framebuffer, NULL); + + claim_pins_nr(args[ARG_rgb_list].u_obj); + claim_pins_nr(args[ARG_addr_list].u_obj); + claim_pin_nr(args[ARG_clock_pin].u_obj); + claim_pin_nr(args[ARG_oe_pin].u_obj); + claim_pin_nr(args[ARG_latch_pin].u_obj); + + return MP_OBJ_FROM_PTR(self); +} + +//| .. method:: deinit +//| +//| Free the resources (pins, timers, etc.) associated with this +//| protomatter instance. After deinitialization, no further operations +//| may be performed. +//| +STATIC mp_obj_t protomatter_protomatter_deinit(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + common_hal_protomatter_protomatter_deinit(self); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_deinit_obj, protomatter_protomatter_deinit); + +static void check_for_deinit(protomatter_protomatter_obj_t *self) { + if (!self->core.rgbPins) { + raise_deinited_error(); + } +} + +//| .. attribute:: paused +//| +//| When paused, the matrix is not driven and all its LEDs are unlit. +//| +STATIC mp_obj_t protomatter_protomatter_get_paused(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + return mp_obj_new_bool(self->paused); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_paused_obj, protomatter_protomatter_get_paused); + +STATIC mp_obj_t protomatter_protomatter_set_paused(mp_obj_t self_in, mp_obj_t value_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + bool paused = mp_obj_is_true(value_in); + if (paused && !self->paused) { + _PM_stop(&self->core); + } else if (!paused && self->paused) { + _PM_resume(&self->core); + } + self->paused = paused; + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(protomatter_protomatter_set_paused_obj, protomatter_protomatter_set_paused); + +const mp_obj_property_t protomatter_protomatter_paused_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_paused_obj, + (mp_obj_t)&protomatter_protomatter_set_paused_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. method:: write(buf) +//| +//| Transmits the color data in the buffer to the pixels so that they are shown. +//| +//| The data in the buffer must be in "RGB565" format. This means +//| that it is organized as a series of 16-bit numbers where the highest 5 +//| bits are interpreted as red, the next 6 as green, and the final 5 as +//| blue. The object can be any buffer, but `array.array` and `ulab.array` +//| objects are most often useful. +//| +STATIC mp_obj_t protomatter_protomatter_swapbuffers(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + + _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->core); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_swapbuffers_obj, protomatter_protomatter_swapbuffers); + +STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_paused), MP_ROM_PTR(&protomatter_protomatter_paused_obj) }, + { MP_ROM_QSTR(MP_QSTR_swapbuffers), MP_ROM_PTR(&protomatter_protomatter_swapbuffers_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); + +STATIC void protomatter_protomatter_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t *bufinfo) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + + *bufinfo = self->bufinfo; +} + +STATIC void protomatter_protomatter_swapbuffers_void(mp_obj_t self_in) { + protomatter_protomatter_swapbuffers(self_in); +} + +STATIC void protomatter_protomatter_deinit_void(mp_obj_t self_in) { + protomatter_protomatter_deinit(self_in); +} + +STATIC void protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t value) { + protomatter_protomatter_set_paused(self_in, mp_obj_new_bool(value <= 0)); +} + +STATIC const framebuffer_p_t protomatter_protomatter_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuffer) + .get_bufinfo = protomatter_protomatter_get_bufinfo, + .set_brightness = protomatter_protomatter_set_brightness, + .swapbuffers = protomatter_protomatter_swapbuffers_void, + .deinit = protomatter_protomatter_deinit_void, +}; + +STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + // a readonly framebuffer would be unusual but not impossible + if((flags & MP_BUFFER_WRITE) && !(self->bufinfo.typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) { + return 1; + } + *bufinfo = self->bufinfo; + return 0; +} + +const mp_obj_type_t protomatter_Protomatter_type = { + { &mp_type_type }, + .name = MP_QSTR_Protomatter, + .buffer_p = { .get_buffer = protomatter_protomatter_get_buffer, }, + .make_new = protomatter_protomatter_make_new, + .protocol = &protomatter_protomatter_proto, + .locals_dict = (mp_obj_dict_t*)&protomatter_protomatter_locals_dict, +}; diff --git a/shared-bindings/_protomatter/Protomatter.h b/shared-bindings/_protomatter/Protomatter.h new file mode 100644 index 0000000000..cacc39a304 --- /dev/null +++ b/shared-bindings/_protomatter/Protomatter.h @@ -0,0 +1,56 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H + +#include "shared-module/_protomatter/Protomatter.h" +#include "lib/protomatter/core.h" + +extern const mp_obj_type_t protomatter_Protomatter_type; +typedef struct { + mp_obj_base_t base; + mp_obj_t framebuffer; + mp_buffer_info_t bufinfo; + Protomatter_core core; + void *timer; + uint16_t bufsize, width; + uint8_t rgb_pins[30]; + uint8_t addr_pins[10]; + uint8_t clock_pin, latch_pin, oe_pin; + uint8_t rgb_count, addr_count; + uint8_t bit_depth; + bool core_is_initialized; + bool paused; + bool doublebuffer; +} protomatter_protomatter_obj_t; + +void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t* self, int width, int bit_depth, uint8_t rgb_count, uint8_t* rgb_pins, uint8_t addr_count, uint8_t* addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void* timer); +void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t*); +void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t*); +void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer); + +#endif diff --git a/shared-bindings/_protomatter/__init__.c b/shared-bindings/_protomatter/__init__.c new file mode 100644 index 0000000000..2281b15f10 --- /dev/null +++ b/shared-bindings/_protomatter/__init__.c @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/_protomatter/Protomatter.h" + +//| :mod:`_protomatter` --- Low-level routines for bitbanged LED matrices +//| ===================================================================== +//| +//| .. module:: _protomatter +//| :synopsis: Low-level routines for bitbanged LED matrices +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| Protomatter + +STATIC const mp_rom_map_elem_t protomatter_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__protomatter) }, + { MP_ROM_QSTR(MP_QSTR_Protomatter), MP_ROM_PTR(&protomatter_Protomatter_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(protomatter_module_globals, protomatter_module_globals_table); + +const mp_obj_module_t protomatter_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&protomatter_module_globals, +}; diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 4c6e525b27..a22b2add22 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -92,6 +92,7 @@ //| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. //| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. //| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) +//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 //| :param int set_column_command: Command used to set the start and end columns to update //| :param int set_row_command: Command used so set the start and end rows to update //| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. @@ -107,7 +108,7 @@ //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. //| STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high }; + enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -121,6 +122,7 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a { MP_QSTR_pixels_in_byte_share_row, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, { MP_QSTR_reverse_pixels_in_byte, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_reverse_bytes_in_word, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_set_column_command, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0x2a} }, { MP_QSTR_set_row_command, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0x2b} }, { MP_QSTR_write_ram_command, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0x2c} }, @@ -159,7 +161,10 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a self, display_bus, args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, - args[ARG_pixels_in_byte_share_row].u_bool, args[ARG_bytes_per_cell].u_bool, args[ARG_reverse_pixels_in_byte].u_bool, + args[ARG_pixels_in_byte_share_row].u_bool, + args[ARG_bytes_per_cell].u_bool, + args[ARG_reverse_pixels_in_byte].u_bool, + args[ARG_reverse_bytes_in_word].u_bool, args[ARG_set_column_command].u_int, args[ARG_set_row_command].u_int, args[ARG_write_ram_command].u_int, args[ARG_set_vertical_scroll].u_int, diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index 8c2e20262b..e69c5b6b52 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -41,7 +41,7 @@ extern const mp_obj_type_t displayio_display_type; void common_hal_displayio_display_construct(displayio_display_obj_t* self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, - bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, + bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c new file mode 100644 index 0000000000..9f1df8bfaa --- /dev/null +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -0,0 +1,452 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "shared-bindings/framebufferio/FramebufferDisplay.h" + +#include + +#include "lib/utils/context_manager_helpers.h" +#include "py/binary.h" +#include "py/objproperty.h" +#include "py/objtype.h" +#include "py/runtime.h" +#include "shared-bindings/displayio/Group.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "shared-module/displayio/__init__.h" +#include "supervisor/shared/translate.h" + +//| .. currentmodule:: framebufferio +//| +//| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM +//| ================================================================================ +//| +//| This initializes a display and connects it into CircuitPython. Unlike other +//| objects in CircuitPython, Display objects live until `displayio.release_displays()` +//| is called. This is done so that CircuitPython can use the display itself. +//| +//| .. class:: FramebufferDisplay(framebuffer, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, grayscale=False, pixels_in_byte_share_row=True, bytes_per_cell=1, reverse_pixels_in_byte=False, backlight_pin=None, brightness=1.0, auto_brightness=False, auto_refresh=True, native_frames_per_second=60) +//| +//| Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) +//| +//| :param framebuffer: The framebuffer that the display is connected to +//| :type framebuffer: any core object implementing the framebuffer protocol +//| :param callback: Function or bound method to call when the framebuffer has been updated. The callback receives one argument, the framebuffer object. +//| :param int width: Width in pixels +//| :param int height: Height in pixels +//| :param int colstart: The index if the first visible column +//| :param int rowstart: The index if the first visible row +//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) +//| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays +//| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.) +//| :param bool grayscale: True if the display only shows a single color. +//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. +//| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. +//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) +//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) +//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 +//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight +//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. +//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. +//| :param bool auto_refresh: Automatically refresh the screen +//| :param int native_frames_per_second: Number of display refreshes per second +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_framebuffer, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, + { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, + { MP_QSTR_colstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_rowstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, + { MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_pixels_in_byte_share_row, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, + { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, + { MP_QSTR_reverse_pixels_in_byte, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_reverse_bytes_in_word, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, + { MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} }, + { MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, + { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; + + const mcu_pin_obj_t* backlight_pin = validate_obj_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); + + mp_float_t brightness = mp_obj_get_float(args[ARG_brightness].u_obj); + + mp_int_t rotation = args[ARG_rotation].u_int; + if (rotation % 90 != 0) { + mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); + } + + primary_display_t *disp = allocate_display_or_raise(); + framebufferio_framebufferdisplay_obj_t *self = &disp->framebuffer_display; + self->base.type = &framebufferio_framebufferdisplay_type; + common_hal_framebufferio_framebufferdisplay_construct( + self, + framebuffer, + args[ARG_width].u_int, args[ARG_height].u_int, + args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, + args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, + args[ARG_pixels_in_byte_share_row].u_bool, + args[ARG_bytes_per_cell].u_bool, + args[ARG_reverse_pixels_in_byte].u_bool, + args[ARG_reverse_bytes_in_word].u_bool, + MP_OBJ_TO_PTR(backlight_pin), + brightness, + args[ARG_auto_brightness].u_bool, + args[ARG_auto_refresh].u_bool, + args[ARG_native_frames_per_second].u_int + ); + + return self; +} + +// Helper to ensure we have the native super class instead of a subclass. +static framebufferio_framebufferdisplay_obj_t* native_display(mp_obj_t display_obj) { + mp_obj_t native_display = mp_instance_cast_to_native_base(display_obj, &framebufferio_framebufferdisplay_type); + mp_obj_assert_native_inited(native_display); + return MP_OBJ_TO_PTR(native_display); +} + +//| .. method:: show(group) +//| +//| Switches to displaying the given group of layers. When group is None, the default +//| CircuitPython terminal will be shown. +//| +//| :param Group group: The group to show. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_show(mp_obj_t self_in, mp_obj_t group_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + displayio_group_t* group = NULL; + if (group_in != mp_const_none) { + group = MP_OBJ_TO_PTR(native_group(group_in)); + } + + bool ok = common_hal_framebufferio_framebufferdisplay_show(self, group); + if (!ok) { + mp_raise_ValueError(translate("Group already used")); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_show_obj, framebufferio_framebufferdisplay_obj_show); + +//| .. method:: refresh(*, target_frames_per_second=60, minimum_frames_per_second=1) +//| +//| When auto refresh is off, waits for the target frame rate and then refreshes the display, +//| returning True. If the call has taken too long since the last refresh call for the given +//| target frame rate, then the refresh returns False immediately without updating the screen to +//| hopefully help getting caught up. +//| +//| If the time since the last successful refresh is below the minimum frame rate, then an +//| exception will be raised. Set minimum_frames_per_second to 0 to disable. +//| +//| When auto refresh is on, updates the display immediately. (The display will also update +//| without calls to this.) +//| +//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. +//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_target_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 60} }, + { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + framebufferio_framebufferdisplay_obj_t *self = native_display(pos_args[0]); + uint32_t maximum_ms_per_real_frame = 0xffffffff; + mp_int_t minimum_frames_per_second = args[ARG_minimum_frames_per_second].u_int; + if (minimum_frames_per_second > 0) { + maximum_ms_per_real_frame = 1000 / minimum_frames_per_second; + } + return mp_obj_new_bool(common_hal_framebufferio_framebufferdisplay_refresh(self, 1000 / args[ARG_target_frames_per_second].u_int, maximum_ms_per_real_frame)); +} +MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh); + +//| .. attribute:: auto_refresh +//| +//| True when the display is refreshed automatically. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return mp_obj_new_bool(common_hal_framebufferio_framebufferdisplay_get_auto_refresh(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_auto_refresh_obj, framebufferio_framebufferdisplay_obj_get_auto_refresh); + +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_auto_refresh(mp_obj_t self_in, mp_obj_t auto_refresh) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + + common_hal_framebufferio_framebufferdisplay_set_auto_refresh(self, mp_obj_is_true(auto_refresh)); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_auto_refresh_obj, framebufferio_framebufferdisplay_obj_set_auto_refresh); + +const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_refresh_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_auto_refresh_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: brightness +//| +//| The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When +//| `auto_brightness` is True, the value of `brightness` will change automatically. +//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_brightness(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + mp_float_t brightness = common_hal_framebufferio_framebufferdisplay_get_brightness(self); + if (brightness < 0) { + mp_raise_RuntimeError(translate("Brightness not adjustable")); + } + return mp_obj_new_float(brightness); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_brightness_obj, framebufferio_framebufferdisplay_obj_get_brightness); + +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_brightness(mp_obj_t self_in, mp_obj_t brightness_obj) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, false); + mp_float_t brightness = mp_obj_get_float(brightness_obj); + if (brightness < 0 || brightness > 1.0) { + mp_raise_ValueError(translate("Brightness must be 0-1.0")); + } + bool ok = common_hal_framebufferio_framebufferdisplay_set_brightness(self, brightness); + if (!ok) { + mp_raise_RuntimeError(translate("Brightness not adjustable")); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_brightness_obj, framebufferio_framebufferdisplay_obj_set_brightness); + +const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_brightness_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_brightness_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: auto_brightness +//| +//| True when the display brightness is adjusted automatically, based on an ambient +//| light sensor or other method. Note that some displays may have this set to True by default, +//| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False +//| if `brightness` is set manually. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_brightness(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return mp_obj_new_bool(common_hal_framebufferio_framebufferdisplay_get_auto_brightness(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_auto_brightness_obj, framebufferio_framebufferdisplay_obj_get_auto_brightness); + +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_auto_brightness(mp_obj_t self_in, mp_obj_t auto_brightness) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + + common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, mp_obj_is_true(auto_brightness)); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_auto_brightness_obj, framebufferio_framebufferdisplay_obj_set_auto_brightness); + +const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_brightness_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_auto_brightness_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: width +//| +//| Gets the width of the framebuffer +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_framebufferio_framebufferdisplay_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_width_obj, framebufferio_framebufferdisplay_obj_get_width); + +const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_width_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: height +//| +//| Gets the height of the framebuffer +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_framebufferio_framebufferdisplay_get_height(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_height_obj, framebufferio_framebufferdisplay_obj_get_height); + +const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_height_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: rotation +//| +//| The rotation of the display as an int in degrees. +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_framebufferio_framebufferdisplay_get_rotation(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_rotation_obj, framebufferio_framebufferdisplay_obj_get_rotation); +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_rotation(mp_obj_t self_in, mp_obj_t value) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + common_hal_framebufferio_framebufferdisplay_set_rotation(self, mp_obj_get_int(value)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_rotation_obj, framebufferio_framebufferdisplay_obj_set_rotation); + + +const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_rotation_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_rotation_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: framebuffer +//| +//| The framebuffer being used by the display +//| +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_framebuffer(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return common_hal_framebufferio_framebufferdisplay_get_framebuffer(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_framebuffer_obj, framebufferio_framebufferdisplay_obj_get_framebuffer); + +const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_framebuffer_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +//| .. method:: fill_row(y, buffer) +//| +//| Extract the pixels from a single row +//| +//| :param int y: The top edge of the area +//| :param bytearray buffer: The buffer in which to place the pixel data +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_y, ARG_buffer }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_y, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = -1} }, + { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED, {} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + framebufferio_framebufferdisplay_obj_t *self = native_display(pos_args[0]); + mp_int_t y = args[ARG_y].u_int; + mp_obj_t *result = args[ARG_buffer].u_obj; + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(result, &bufinfo, MP_BUFFER_WRITE); + + if (bufinfo.typecode != BYTEARRAY_TYPECODE) { + mp_raise_ValueError(translate("Buffer is not a bytearray.")); + } + if (self->core.colorspace.depth != 16) { + mp_raise_ValueError(translate("Display must have a 16 bit colorspace.")); + } + + displayio_area_t area = { + .x1 = 0, + .y1 = y, + .x2 = self->core.width, + .y2 = y + 1 + }; + uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth; + uint16_t buffer_size = self->core.width / pixels_per_word; + uint16_t pixels_per_buffer = displayio_area_size(&area); + if (pixels_per_buffer % pixels_per_word) { + buffer_size += 1; + } + + uint32_t *result_buffer = bufinfo.buf; + size_t result_buffer_size = bufinfo.len; + + if (result_buffer_size >= (buffer_size * 4)) { + volatile uint32_t mask_length = (pixels_per_buffer / 32) + 1; + uint32_t mask[mask_length]; + + for (uint16_t k = 0; k < mask_length; k++) { + mask[k] = 0x00000000; + } + + displayio_display_core_fill_area(&self->core, &area, mask, result_buffer); + return result; + } else { + mp_raise_ValueError(translate("Buffer is too small")); + } +} +MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_fill_row_obj, 1, framebufferio_framebufferdisplay_obj_fill_row); + +STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&framebufferio_framebufferdisplay_show_obj) }, + { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_refresh_obj) }, + { MP_ROM_QSTR(MP_QSTR_fill_row), MP_ROM_PTR(&framebufferio_framebufferdisplay_fill_row_obj) }, + + { MP_ROM_QSTR(MP_QSTR_auto_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_auto_refresh_obj) }, + + { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&framebufferio_framebufferdisplay_brightness_obj) }, + { MP_ROM_QSTR(MP_QSTR_auto_brightness), MP_ROM_PTR(&framebufferio_framebufferdisplay_auto_brightness_obj) }, + + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&framebufferio_framebufferdisplay_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&framebufferio_framebufferdisplay_height_obj) }, + { MP_ROM_QSTR(MP_QSTR_rotation), MP_ROM_PTR(&framebufferio_framebufferdisplay_rotation_obj) }, + { MP_ROM_QSTR(MP_QSTR_framebuffer), MP_ROM_PTR(&framebufferio_framebufferframebuffer_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(framebufferio_framebufferdisplay_locals_dict, framebufferio_framebufferdisplay_locals_dict_table); + +const mp_obj_type_t framebufferio_framebufferdisplay_type = { + { &mp_type_type }, + .name = MP_QSTR_FramebufferDisplay, + .make_new = framebufferio_framebufferdisplay_make_new, + .locals_dict = (mp_obj_dict_t*)&framebufferio_framebufferdisplay_locals_dict, +}; diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h new file mode 100644 index 0000000000..af0bd2c415 --- /dev/null +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -0,0 +1,74 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H + +#include "common-hal/microcontroller/Pin.h" + +#include "shared-module/framebufferio/FramebufferDisplay.h" +#include "shared-module/displayio/Group.h" + +extern const mp_obj_type_t framebufferio_framebufferdisplay_type; + +#define DELAY 0x80 + +#define NO_BRIGHTNESS_COMMAND 0x100 + +void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, + mp_obj_t framebuffer, uint16_t width, uint16_t height, + int16_t colstart, int16_t rowstart, + uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, + uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, + const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, + bool auto_refresh, uint16_t native_frames_per_second); + +bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self, + displayio_group_t* root_group); + +bool common_hal_framebufferio_framebufferdisplay_refresh(framebufferio_framebufferdisplay_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame); + +bool common_hal_framebufferio_framebufferdisplay_get_auto_refresh(framebufferio_framebufferdisplay_obj_t* self); +void common_hal_framebufferio_framebufferdisplay_set_auto_refresh(framebufferio_framebufferdisplay_obj_t* self, bool auto_refresh); + +uint16_t common_hal_framebufferio_framebufferdisplay_get_width(framebufferio_framebufferdisplay_obj_t* self); +uint16_t common_hal_framebufferio_framebufferdisplay_get_height(framebufferio_framebufferdisplay_obj_t* self); +uint16_t common_hal_framebufferio_framebufferdisplay_get_rotation(framebufferio_framebufferdisplay_obj_t* self); +void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t* self, int rotation); + +bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t* self); +void common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness); + +bool common_hal_framebufferio_framebufferdisplay_get_dither(framebufferio_framebufferdisplay_obj_t* self); +void common_hal_framebufferio_framebufferdisplay_set_dither(framebufferio_framebufferdisplay_obj_t* self, bool dither); + +mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self); +bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_framebufferdisplay_obj_t* self, mp_float_t brightness); + +mp_obj_t common_hal_framebufferio_framebufferdisplay_framebuffer(framebufferio_framebufferdisplay_obj_t* self); + + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c new file mode 100644 index 0000000000..0f0823a25f --- /dev/null +++ b/shared-bindings/framebufferio/__init__.c @@ -0,0 +1,63 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "shared-bindings/framebufferio/__init__.h" +#include "shared-bindings/framebufferio/FramebufferDisplay.h" + +//| :mod:`framebufferio` --- Native framebuffer display driving +//| ========================================================================= +//| +//| .. module:: framebufferio +//| :synopsis: Native helpers for driving displays +//| :platform: SAMD51, nRF52 +//| +//| The `framebufferio` module contains classes to manage display output +//| including synchronizing with refresh rates and partial updating. +//| It is used in conjunction with classes from `displayio` to actually +//| place items on the display; and classes like `Protomatter` to actually +//| drive the display. +//| +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| FramebufferDisplay +//| + +#if CIRCUITPY_FRAMEBUFFERIO +static const mp_rom_map_elem_t framebufferio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_framebufferio) }, + { MP_ROM_QSTR(MP_QSTR_FramebufferDisplay), MP_ROM_PTR(&framebufferio_framebufferdisplay_type) }, +}; +STATIC MP_DEFINE_CONST_DICT(framebufferio_module_globals, framebufferio_module_globals_table); +const mp_obj_module_t framebufferio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&framebufferio_module_globals, +}; +#endif + diff --git a/shared-bindings/framebufferio/__init__.h b/shared-bindings/framebufferio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 4f29322a06..bb5256b558 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -43,5 +43,11 @@ void assert_pin_free(const mcu_pin_obj_t* pin); bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin); void common_hal_never_reset_pin(const mcu_pin_obj_t* pin); void common_hal_reset_pin(const mcu_pin_obj_t* pin); +uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin); +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin); +void common_hal_mcu_pin_claim_number(uint8_t pin_no); +void common_hal_mcu_pin_reset_number(uint8_t pin_no); + +#define COMMON_HAL_MCU_NO_PIN ((uint8_t)0xff) #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PIN_H diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c new file mode 100644 index 0000000000..cbb60db6d3 --- /dev/null +++ b/shared-module/_protomatter/Protomatter.c @@ -0,0 +1,169 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/gc.h" +#include "py/obj.h" +#include "py/objarray.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "common-hal/_protomatter/Protomatter.h" +#include "shared-module/_protomatter/allocator.h" +#include "shared-bindings/_protomatter/Protomatter.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/util.h" +#include "shared-module/framebufferio/FramebufferDisplay.h" + +extern Protomatter_core *_PM_protoPtr; + +void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t *self, int width, int bit_depth, uint8_t rgb_count, uint8_t *rgb_pins, uint8_t addr_count, uint8_t *addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void *timer) { + self->width = width; + self->bit_depth = bit_depth; + self->rgb_count = rgb_count; + memcpy(self->rgb_pins, rgb_pins, rgb_count); + self->addr_count = addr_count; + memcpy(self->addr_pins, addr_pins, addr_count); + self->clock_pin = clock_pin; + self->oe_pin = oe_pin; + self->latch_pin = latch_pin; + self->doublebuffer = doublebuffer; + + self->timer = timer ? timer : common_hal_protomatter_timer_allocate(); + if (self->timer == NULL) { + mp_raise_ValueError(translate("No timer available")); + } + + self->width = width; + self->bufsize = 2 * width * rgb_count / 3 * (1 << addr_count); + + common_hal_protomatter_protomatter_reconstruct(self, framebuffer); +} + +void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer) { + if (framebuffer) { + self->framebuffer = framebuffer; + framebuffer = mp_obj_new_bytearray_of_zeros(self->bufsize); + mp_get_buffer_raise(self->framebuffer, &self->bufinfo, MP_BUFFER_READ); + if (mp_get_buffer(self->framebuffer, &self->bufinfo, MP_BUFFER_RW)) { + self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; + } else { + self->bufinfo.typecode = 'H'; + } + // verify that the matrix is big enough + mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); + } else { + self->framebuffer = NULL; + self->bufinfo.buf = _PM_allocator_impl(self->bufsize); + self->bufinfo.len = self->bufsize; + self->bufinfo.typecode = 'H' | MP_OBJ_ARRAY_TYPECODE_FLAG_RW; + } + + ProtomatterStatus stat = _PM_init(&self->core, + self->width, self->bit_depth, + self->rgb_count/6, self->rgb_pins, + self->addr_count, self->addr_pins, + self->clock_pin, self->latch_pin, self->oe_pin, + self->doublebuffer, self->timer); + + if (stat == PROTOMATTER_OK) { + _PM_protoPtr = &self->core; + common_hal_mcu_disable_interrupts(); + common_hal_protomatter_timer_enable(self->timer); + stat = _PM_begin(&self->core); + _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + common_hal_mcu_enable_interrupts(); + _PM_swapbuffer_maybe(&self->core); + } + + if (stat != PROTOMATTER_OK) { + // XXX this deinit() actually makes crashy-crashy + // can trigger it by sending inappropriate pins + common_hal_protomatter_protomatter_deinit(self); + switch (stat) { + case PROTOMATTER_ERR_PINS: + mp_raise_ValueError(translate("Invalid pin")); + break; + case PROTOMATTER_ERR_ARG: + mp_raise_ValueError(translate("Invalid argument")); + break; + case PROTOMATTER_ERR_MALLOC: /// should have already been signaled as NLR + default: + mp_raise_msg_varg(&mp_type_RuntimeError, + translate("Protomatter internal error #%d"), (int)stat); + break; + } + } + + self->paused = 0; + +} + +STATIC void free_pin(uint8_t *pin) { + if (*pin != COMMON_HAL_MCU_NO_PIN) { + common_hal_mcu_pin_reset_number(*pin); + } + *pin = COMMON_HAL_MCU_NO_PIN; +} + +STATIC void free_pin_seq(uint8_t *seq, int count) { + for (int i=0; itimer) { + common_hal_protomatter_timer_free(self->timer); + self->timer = 0; + } + + if (_PM_protoPtr == &self->core) { + _PM_protoPtr = NULL; + } + + free_pin_seq(self->rgb_pins, self->rgb_count); + free_pin_seq(self->addr_pins, self->addr_count); + free_pin(&self->clock_pin); + free_pin(&self->latch_pin); + free_pin(&self->oe_pin); + + if (self->core.rgbPins) { + _PM_free(&self->core); + } + + self->base.type = NULL; +} + +void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) { + gc_collect_ptr(self->framebuffer); + gc_collect_ptr(self->core.rgbPins); + gc_collect_ptr(self->core.addr); + gc_collect_ptr(self->core.screenData); +} + diff --git a/shared-module/_protomatter/Protomatter.h b/shared-module/_protomatter/Protomatter.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/_protomatter/__init__.c b/shared-module/_protomatter/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/_protomatter/__init__.h b/shared-module/_protomatter/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h new file mode 100644 index 0000000000..8d9d7ff960 --- /dev/null +++ b/shared-module/_protomatter/allocator.h @@ -0,0 +1,30 @@ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H +#define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H + +#include +#include "py/misc.h" +#include "supervisor/memory.h" + +#define _PM_ALLOCATOR _PM_allocator_impl +#define _PM_FREE _PM_free_impl + +static inline void *_PM_allocator_impl(size_t sz) { + supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); + if (allocation) { + return allocation->ptr; + } else { + return m_malloc(sz + sizeof(void*), true); + } +} + +static inline void _PM_free_impl(void *ptr_in) { + supervisor_allocation *allocation = allocation_from_ptr(ptr_in); + + if (allocation) { + free_memory(allocation); + } else { + m_free(ptr_in); + } +} + +#endif diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index a5d7f0b051..2c9fb6d789 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -47,9 +47,7 @@ uint16_t displayio_colorconverter_compute_rgb565(uint32_t color_rgb888) { uint32_t r5 = (color_rgb888 >> 19); uint32_t g6 = (color_rgb888 >> 10) & 0x3f; uint32_t b5 = (color_rgb888 >> 3) & 0x1f; - uint32_t packed = r5 << 11 | g6 << 5 | b5; - // swap bytes - return __builtin_bswap16(packed); + return r5 << 11 | g6 << 5 | b5; } uint8_t displayio_colorconverter_compute_luma(uint32_t color_rgb888) { @@ -156,7 +154,12 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d } if (colorspace->depth == 16) { - output_color->pixel = displayio_colorconverter_compute_rgb565(pixel); + uint16_t packed = displayio_colorconverter_compute_rgb565(pixel); + if (colorspace->reverse_bytes_in_word) { + // swap bytes + packed = __builtin_bswap16(packed); + } + output_color->pixel = packed; output_color->opaque = true; return; } else if (colorspace->tricolor) { diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 2edded9278..aaddbb4714 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -46,7 +46,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, - uint8_t bytes_per_cell, bool reverse_pixels_in_byte, uint8_t set_column_command, + uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, @@ -60,7 +60,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, ram_height = 0xff; } displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, - color_depth, grayscale, pixels_in_byte_share_row, bytes_per_cell, reverse_pixels_in_byte); + color_depth, grayscale, pixels_in_byte_share_row, bytes_per_cell, reverse_pixels_in_byte, reverse_bytes_in_word); self->set_column_command = set_column_command; self->set_row_command = set_row_command; diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 91d4bb7f9f..5b4a8f916b 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -58,7 +58,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* self->core.colorspace.tricolor_luma = displayio_colorconverter_compute_luma(highlight_color); } - displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, 1, true, true, 1, true); + displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, 1, true, true, 1, true, true); self->set_column_window_command = set_column_window_command; self->set_row_window_command = set_row_window_command; diff --git a/shared-module/displayio/Palette.h b/shared-module/displayio/Palette.h index 758fd43fc1..da72f250f9 100644 --- a/shared-module/displayio/Palette.h +++ b/shared-module/displayio/Palette.h @@ -41,6 +41,7 @@ typedef struct { bool tricolor; bool pixels_in_byte_share_row; bool reverse_pixels_in_byte; + bool reverse_bytes_in_word; bool dither; } _displayio_colorspace_t; diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 4844dfe60b..225aa2008e 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -47,6 +47,10 @@ void displayio_background(void) { } if (displays[i].display.base.type == &displayio_display_type) { displayio_display_background(&displays[i].display); +#if CIRCUITPY_FRAMEBUFFERIO + } else if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { + framebufferio_framebufferdisplay_background(&displays[i].framebuffer_display); +#endif } else if (displays[i].epaper_display.base.type == &displayio_epaperdisplay_type) { displayio_epaperdisplay_background(&displays[i].epaper_display); } @@ -67,6 +71,10 @@ void common_hal_displayio_release_displays(void) { release_display(&displays[i].display); } else if (display_type == &displayio_epaperdisplay_type) { release_epaperdisplay(&displays[i].epaper_display); +#if CIRCUITPY_FRAMEBUFFERIO + } else if (display_type == &framebufferio_framebufferdisplay_type) { + release_framebufferdisplay(&displays[i].framebuffer_display); +#endif } displays[i].display.base.type = &mp_type_NoneType; } @@ -141,6 +149,11 @@ void reset_displays(void) { } } } +#if CIRCUITPY_PROTOMATTER + } else if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { + protomatter_protomatter_obj_t * pm = &displays[i].protomatter; + common_hal_protomatter_protomatter_reconstruct(pm, NULL); +#endif } else { // Not an active display bus. continue; @@ -155,12 +168,24 @@ void reset_displays(void) { } else if (displays[i].epaper_display.base.type == &displayio_epaperdisplay_type) { displayio_epaperdisplay_obj_t* display = &displays[i].epaper_display; common_hal_displayio_epaperdisplay_show(display, NULL); +#if CIRCUITPY_FRAMEBUFFERIO + } else if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { + framebufferio_framebufferdisplay_obj_t* display = &displays[i].framebuffer_display; + display->auto_refresh = true; + common_hal_framebufferio_framebufferdisplay_show(display, NULL); +#endif } } } void displayio_gc_collect(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { +#if CIRCUITPY_PROTOMATTER + if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { + protomatter_protomatter_collect_ptrs(&displays[i].protomatter); + } +#endif + if (displays[i].display.base.type == NULL) { continue; } @@ -169,6 +194,10 @@ void displayio_gc_collect(void) { // but this is more precise, and is the only field that needs marking. if (displays[i].display.base.type == &displayio_display_type) { displayio_display_collect_ptrs(&displays[i].display); +#if CIRCUITPY_FRAMEBUFFERIO + } else if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { + framebufferio_framebufferdisplay_collect_ptrs(&displays[i].framebuffer_display); +#endif } else if (displays[i].epaper_display.base.type == &displayio_epaperdisplay_type) { displayio_epaperdisplay_collect_ptrs(&displays[i].epaper_display); } @@ -309,7 +338,7 @@ void displayio_area_transform_within(bool mirror_x, bool mirror_y, bool transpos } } -primary_display_t *allocate_display() { +primary_display_t *allocate_display(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { mp_const_obj_t display_type = displays[i].display.base.type; if (display_type == NULL || display_type == &mp_type_NoneType) { @@ -317,14 +346,14 @@ primary_display_t *allocate_display() { } } return NULL; - -primary_display_t *allocate_display_or_raise() { - primary_display_t *result = allocate_display(); - if (!result) { - mp_raise_RuntimeError(translate("Too many displays")); - } } +primary_display_t *allocate_display_or_raise(void) { + primary_display_t *result = allocate_display(); + if (result) { + return result; + } + mp_raise_RuntimeError(translate("Too many displays")); } primary_display_t *allocate_display_bus(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 638c2091e0..278a5e78f3 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -29,20 +29,30 @@ #include "shared-bindings/displayio/Display.h" #include "shared-bindings/displayio/EPaperDisplay.h" +#if CIRCUITPY_FRAMEBUFFERIO +#include "shared-bindings/framebufferio/FramebufferDisplay.h" +#endif #include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/I2CDisplay.h" #include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/_protomatter/Protomatter.h" typedef struct { union { displayio_fourwire_obj_t fourwire_bus; displayio_i2cdisplay_obj_t i2cdisplay_bus; displayio_parallelbus_obj_t parallel_bus; +#if CIRCUITPY_PROTOMATTER + protomatter_protomatter_obj_t protomatter; +#endif }; union { displayio_display_obj_t display; displayio_epaperdisplay_obj_t epaper_display; +#if CIRCUITPY_FRAMEBUFFERIO + framebufferio_framebufferdisplay_obj_t framebuffer_display; +#endif }; } primary_display_t; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 120b70f76a..4cc7564d09 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -44,38 +44,42 @@ void displayio_display_core_construct(displayio_display_core_t* self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, - uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte) { + uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word) { self->colorspace.depth = color_depth; self->colorspace.grayscale = grayscale; self->colorspace.pixels_in_byte_share_row = pixels_in_byte_share_row; self->colorspace.bytes_per_cell = bytes_per_cell; self->colorspace.reverse_pixels_in_byte = reverse_pixels_in_byte; + self->colorspace.reverse_bytes_in_word = reverse_bytes_in_word; self->colorspace.dither = false; self->current_group = NULL; self->colstart = colstart; self->rowstart = rowstart; self->last_refresh = 0; - if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) { - self->bus_reset = common_hal_displayio_parallelbus_reset; - self->bus_free = common_hal_displayio_parallelbus_bus_free; - self->begin_transaction = common_hal_displayio_parallelbus_begin_transaction; - self->send = common_hal_displayio_parallelbus_send; - self->end_transaction = common_hal_displayio_parallelbus_end_transaction; - } else if (MP_OBJ_IS_TYPE(bus, &displayio_fourwire_type)) { - self->bus_reset = common_hal_displayio_fourwire_reset; - self->bus_free = common_hal_displayio_fourwire_bus_free; - self->begin_transaction = common_hal_displayio_fourwire_begin_transaction; - self->send = common_hal_displayio_fourwire_send; - self->end_transaction = common_hal_displayio_fourwire_end_transaction; - } else if (MP_OBJ_IS_TYPE(bus, &displayio_i2cdisplay_type)) { - self->bus_reset = common_hal_displayio_i2cdisplay_reset; - self->bus_free = common_hal_displayio_i2cdisplay_bus_free; - self->begin_transaction = common_hal_displayio_i2cdisplay_begin_transaction; - self->send = common_hal_displayio_i2cdisplay_send; - self->end_transaction = common_hal_displayio_i2cdisplay_end_transaction; - } else { - mp_raise_ValueError(translate("Unsupported display bus type")); + // (framebufferdisplay already validated its 'bus' is a buffer-protocol object) + if (bus) { + if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) { + self->bus_reset = common_hal_displayio_parallelbus_reset; + self->bus_free = common_hal_displayio_parallelbus_bus_free; + self->begin_transaction = common_hal_displayio_parallelbus_begin_transaction; + self->send = common_hal_displayio_parallelbus_send; + self->end_transaction = common_hal_displayio_parallelbus_end_transaction; + } else if (MP_OBJ_IS_TYPE(bus, &displayio_fourwire_type)) { + self->bus_reset = common_hal_displayio_fourwire_reset; + self->bus_free = common_hal_displayio_fourwire_bus_free; + self->begin_transaction = common_hal_displayio_fourwire_begin_transaction; + self->send = common_hal_displayio_fourwire_send; + self->end_transaction = common_hal_displayio_fourwire_end_transaction; + } else if (MP_OBJ_IS_TYPE(bus, &displayio_i2cdisplay_type)) { + self->bus_reset = common_hal_displayio_i2cdisplay_reset; + self->bus_free = common_hal_displayio_i2cdisplay_bus_free; + self->begin_transaction = common_hal_displayio_i2cdisplay_begin_transaction; + self->send = common_hal_displayio_i2cdisplay_send; + self->end_transaction = common_hal_displayio_i2cdisplay_end_transaction; + } else { + mp_raise_ValueError(translate("Unsupported display bus type")); + } } self->bus = bus; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index 1c3d0f09c6..e4fd62d4a5 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -58,7 +58,7 @@ typedef struct { void displayio_display_core_construct(displayio_display_core_t* self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, - uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte); + uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word); bool displayio_display_core_show(displayio_display_core_t* self, displayio_group_t* root_group); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c new file mode 100644 index 0000000000..967316c21d --- /dev/null +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -0,0 +1,339 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "shared-bindings/framebufferio/FramebufferDisplay.h" + +#include "py/gc.h" +#include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/time/__init__.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/display_core.h" +#include "supervisor/shared/display.h" +#include "supervisor/shared/tick.h" +#include "supervisor/usb.h" + +#include +#include + +#include "tick.h" + +void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, + mp_obj_t framebuffer, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, + uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, + uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, + const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, + bool auto_refresh, uint16_t native_frames_per_second) { + // Turn off auto-refresh as we init. + self->auto_refresh = false; + self->framebuffer = framebuffer; + self->framebuffer_protocol = mp_proto_get_or_throw(MP_QSTR_protocol_framebuffer, framebuffer); + + uint16_t ram_width = 0x100; + uint16_t ram_height = 0x100; + + displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, colstart, rowstart, rotation, + color_depth, grayscale, pixels_in_byte_share_row, bytes_per_cell, reverse_pixels_in_byte, reverse_bytes_in_word); + + self->auto_brightness = auto_brightness; + self->first_manual_refresh = !auto_refresh; + + self->native_frames_per_second = native_frames_per_second; + self->native_ms_per_frame = 1000 / native_frames_per_second; + + supervisor_start_terminal(width, height); + + // Always set the backlight type in case we're reusing memory. + self->backlight_inout.base.type = &mp_type_NoneType; + if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { + pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); + if (result != PWMOUT_OK) { + self->backlight_inout.base.type = &digitalio_digitalinout_type; + common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); + common_hal_never_reset_pin(backlight_pin); + } else { + self->backlight_pwm.base.type = &pulseio_pwmout_type; + common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); + } + } + if (!self->auto_brightness && (self->framebuffer_protocol->set_brightness != NULL || self->backlight_inout.base.type != &mp_type_NoneType)) { + common_hal_framebufferio_framebufferdisplay_set_brightness(self, brightness); + } else { + self->current_brightness = -1.0; + } + + // Set the group after initialization otherwise we may send pixels while we delay in + // initialization. + common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash); + self->auto_refresh = auto_refresh; +} + +bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self, displayio_group_t* root_group) { + return displayio_display_core_show(&self->core, root_group); +} + +uint16_t common_hal_framebufferio_framebufferdisplay_get_width(framebufferio_framebufferdisplay_obj_t* self){ + return displayio_display_core_get_width(&self->core); +} + +uint16_t common_hal_framebufferio_framebufferdisplay_get_height(framebufferio_framebufferdisplay_obj_t* self){ + return displayio_display_core_get_height(&self->core); +} + +bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t* self) { + return self->auto_brightness; +} + +void common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness) { + self->auto_brightness = auto_brightness; +} + +mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self) { + return self->current_brightness; +} + +bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_framebufferdisplay_obj_t* self, mp_float_t brightness) { + self->updating_backlight = true; + bool ok = false; + if (self->framebuffer_protocol->set_brightness) { + self->framebuffer_protocol->set_brightness(self->framebuffer, brightness); + ok = true; + } else if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { + common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); + ok = true; + } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { + common_hal_digitalio_digitalinout_set_value(&self->backlight_inout, brightness > 0.99); + ok = true; + } + self->updating_backlight = false; + if (ok) { + self->current_brightness = brightness; + } + return ok; +} + +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_framebuffer(framebufferio_framebufferdisplay_obj_t* self) { + return self->framebuffer; +} + +STATIC const displayio_area_t* _get_refresh_areas(framebufferio_framebufferdisplay_obj_t *self) { + if (self->core.full_refresh) { + self->core.area.next = NULL; + return &self->core.area; + } else if (self->core.current_group != NULL) { + return displayio_group_get_refresh_areas(self->core.current_group, NULL); + } + return NULL; +} + +STATIC bool _refresh_area(framebufferio_framebufferdisplay_obj_t* self, const displayio_area_t* area) { + uint16_t buffer_size = 128; // In uint32_ts + + displayio_area_t clipped; + // Clip the area to the display by overlapping the areas. If there is no overlap then we're done. + if (!displayio_display_core_clip_area(&self->core, area, &clipped)) { + return true; + } + uint16_t subrectangles = 1; + uint16_t rows_per_buffer = displayio_area_height(&clipped); + uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth; + uint16_t pixels_per_buffer = displayio_area_size(&clipped); + if (displayio_area_size(&clipped) > buffer_size * pixels_per_word) { + rows_per_buffer = buffer_size * pixels_per_word / displayio_area_width(&clipped); + if (rows_per_buffer == 0) { + rows_per_buffer = 1; + } + // If pixels are packed by column then ensure rows_per_buffer is on a byte boundary. + if (self->core.colorspace.depth < 8 && !self->core.colorspace.pixels_in_byte_share_row) { + uint8_t pixels_per_byte = 8 / self->core.colorspace.depth; + if (rows_per_buffer % pixels_per_byte != 0) { + rows_per_buffer -= rows_per_buffer % pixels_per_byte; + } + } + subrectangles = displayio_area_height(&clipped) / rows_per_buffer; + if (displayio_area_height(&clipped) % rows_per_buffer != 0) { + subrectangles++; + } + pixels_per_buffer = rows_per_buffer * displayio_area_width(&clipped); + buffer_size = pixels_per_buffer / pixels_per_word; + if (pixels_per_buffer % pixels_per_word) { + buffer_size += 1; + } + } + + // Allocated and shared as a uint32_t array so the compiler knows the + // alignment everywhere. + uint32_t buffer[buffer_size]; + uint32_t mask_length = (pixels_per_buffer / 32) + 1; + uint32_t mask[mask_length]; + uint16_t remaining_rows = displayio_area_height(&clipped); + + for (uint16_t j = 0; j < subrectangles; j++) { + displayio_area_t subrectangle = { + .x1 = clipped.x1, + .y1 = clipped.y1 + rows_per_buffer * j, + .x2 = clipped.x2, + .y2 = clipped.y1 + rows_per_buffer * (j + 1) + }; + if (remaining_rows < rows_per_buffer) { + subrectangle.y2 = subrectangle.y1 + remaining_rows; + } + remaining_rows -= rows_per_buffer; + + memset(mask, 0, mask_length * sizeof(mask[0])); + memset(buffer, 0, buffer_size * sizeof(buffer[0])); + + displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); + + // COULDDO: this arithmetic only supports multiple-of-8 bpp + uint8_t *dest = self->bufinfo.buf + (subrectangle.y1 * self->core.width + subrectangle.x1) * (self->core.colorspace.depth / 8); + uint8_t *src = (uint8_t*)buffer; + size_t rowsize = (subrectangle.x2 - subrectangle.x1) * (self->core.colorspace.depth / 8); + size_t rowstride = self->core.width * (self->core.colorspace.depth/8); + for (uint16_t i = subrectangle.y1; i < subrectangle.y2; i++) { + memcpy(dest, src, rowsize); + dest += rowstride; + src += rowsize; + } + + // TODO(tannewt): Make refresh displays faster so we don't starve other + // background tasks. + usb_background(); + } + return true; +} + +STATIC void _refresh_display(framebufferio_framebufferdisplay_obj_t* self) { + displayio_display_core_start_refresh(&self->core); + self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); + const displayio_area_t* current_area = _get_refresh_areas(self); + while (current_area != NULL) { + _refresh_area(self, current_area); + current_area = current_area->next; + } + displayio_display_core_finish_refresh(&self->core); + self->framebuffer_protocol->swapbuffers(self->framebuffer); +} + +void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t* self, int rotation){ + bool transposed = (self->core.rotation == 90 || self->core.rotation == 270); + bool will_transposed = (rotation == 90 || rotation == 270); + if(transposed != will_transposed) { + int tmp = self->core.width; + self->core.width = self->core.height; + self->core.height = tmp; + } + displayio_display_core_set_rotation(&self->core, rotation); + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + if (self->core.current_group != NULL) { + displayio_group_update_transform(self->core.current_group, &self->core.transform); + } +} + +uint16_t common_hal_framebufferio_framebufferdisplay_get_rotation(framebufferio_framebufferdisplay_obj_t* self){ + return self->core.rotation; +} + + +bool common_hal_framebufferio_framebufferdisplay_refresh(framebufferio_framebufferdisplay_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame) { + if (!self->auto_refresh && !self->first_manual_refresh) { + uint64_t current_time = supervisor_ticks_ms64(); + uint32_t current_ms_since_real_refresh = current_time - self->core.last_refresh; + // Test to see if the real frame time is below our minimum. + if (current_ms_since_real_refresh > maximum_ms_per_real_frame) { + mp_raise_RuntimeError(translate("Below minimum frame rate")); + } + uint32_t current_ms_since_last_call = current_time - self->last_refresh_call; + self->last_refresh_call = current_time; + // Skip the actual refresh to help catch up. + if (current_ms_since_last_call > target_ms_per_frame) { + return false; + } + uint32_t remaining_time = target_ms_per_frame - (current_ms_since_real_refresh % target_ms_per_frame); + // We're ahead of the game so wait until we align with the frame rate. + while (supervisor_ticks_ms64() - self->last_refresh_call < remaining_time) { + RUN_BACKGROUND_TASKS; + } + } + self->first_manual_refresh = false; + _refresh_display(self); + return true; +} + +bool common_hal_framebufferio_framebufferdisplay_get_auto_refresh(framebufferio_framebufferdisplay_obj_t* self) { + return self->auto_refresh; +} + +void common_hal_framebufferio_framebufferdisplay_set_auto_refresh(framebufferio_framebufferdisplay_obj_t* self, + bool auto_refresh) { + self->first_manual_refresh = !auto_refresh; + self->auto_refresh = auto_refresh; +} + +STATIC void _update_backlight(framebufferio_framebufferdisplay_obj_t* self) { + if (!self->auto_brightness || self->updating_backlight) { + return; + } + if (supervisor_ticks_ms64() - self->last_backlight_refresh < 100) { + return; + } + // TODO(tannewt): Fade the backlight based on it's existing value and a target value. The target + // should account for ambient light when possible. + common_hal_framebufferio_framebufferdisplay_set_brightness(self, 1.0); + + self->last_backlight_refresh = supervisor_ticks_ms64(); +} + +void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self) { + _update_backlight(self); + + if (self->auto_refresh && (supervisor_ticks_ms64() - self->core.last_refresh) > self->native_ms_per_frame) { + _refresh_display(self); + } +} + +void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { + release_display_core(&self->core); + if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { + common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); + common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { + common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); + } + self->framebuffer_protocol->deinit(self->framebuffer); +} + +void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { + self->auto_refresh = true; + self->auto_brightness = true; + common_hal_framebufferio_framebufferdisplay_show(self, NULL); +} + +void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisplay_obj_t* self) { + gc_collect_ptr(self->framebuffer); + displayio_display_core_collect_ptrs(&self->core); +} diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h new file mode 100644 index 0000000000..a5c8607bbc --- /dev/null +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -0,0 +1,82 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_FRAMEBUFFERDISPLAY_H +#define MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_FRAMEBUFFERDISPLAY_H + +#include "py/obj.h" +#include "py/proto.h" + +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/displayio/Group.h" +#include "shared-bindings/pulseio/PWMOut.h" + +#include "shared-module/displayio/area.h" +#include "shared-module/displayio/display_core.h" + +typedef struct { + mp_obj_base_t base; + displayio_display_core_t core; + union { + digitalio_digitalinout_obj_t backlight_inout; + pulseio_pwmout_obj_t backlight_pwm; + }; + mp_obj_t framebuffer; + const struct _framebuffer_p_t *framebuffer_protocol; + mp_buffer_info_t bufinfo; + uint64_t last_backlight_refresh; + uint64_t last_refresh_call; + mp_float_t current_brightness; + uint16_t native_frames_per_second; + uint16_t native_ms_per_frame; + bool auto_refresh; + bool first_manual_refresh; + bool auto_brightness; + bool updating_backlight; +} framebufferio_framebufferdisplay_obj_t; + +void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self); +void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); +void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self); + +void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisplay_obj_t* self); + +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_framebuffer(framebufferio_framebufferdisplay_obj_t* self); + +typedef void (*framebuffer_get_bufinfo_fun)(mp_obj_t, mp_buffer_info_t *bufinfo); +typedef void (*framebuffer_swapbuffers_fun)(mp_obj_t); +typedef void (*framebuffer_deinit_fun)(mp_obj_t); +typedef void (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); + +typedef struct _framebuffer_p_t { + MP_PROTOCOL_HEAD // MP_QSTR_protocol_framebuffer + framebuffer_get_bufinfo_fun get_bufinfo; + framebuffer_swapbuffers_fun swapbuffers; + framebuffer_deinit_fun deinit; + framebuffer_set_brightness_fun set_brightness; +} framebuffer_p_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-module/framebufferio/__init__.c b/shared-module/framebufferio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/framebufferio/__init__.h b/shared-module/framebufferio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/convert_release_notes.py b/tools/convert_release_notes.py index 87b7e444b7..6491841029 100644 --- a/tools/convert_release_notes.py +++ b/tools/convert_release_notes.py @@ -52,6 +52,9 @@ class AdafruitBBCodeRenderer: def double_emphasis(self, text): return "[b]{}[/b]".format(text) + def emphasis(self, text): + return "[b]{}[/b]".format(text) + bbcode = mistune.Markdown(renderer=AdafruitBBCodeRenderer()) print() From 1d8a073c05c36133e02d839ed187b9d7abf24d79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Apr 2020 11:57:52 -0500 Subject: [PATCH 221/919] nrf: protomatter port --- lib/protomatter | 2 +- .../nrf/common-hal/_protomatter/Protomatter.c | 66 +++++++++++++++++++ .../nrf/common-hal/_protomatter/Protomatter.h | 35 ++++++++++ ports/nrf/common-hal/_protomatter/__init__.c | 0 ports/nrf/common-hal/microcontroller/Pin.c | 12 ++++ ports/nrf/common-hal/pulseio/PulseOut.c | 5 +- ports/nrf/mpconfigport.mk | 3 + ports/nrf/peripherals/nrf/timers.c | 55 ++++++++++++++-- ports/nrf/peripherals/nrf/timers.h | 5 ++ 9 files changed, 171 insertions(+), 12 deletions(-) create mode 100644 ports/nrf/common-hal/_protomatter/Protomatter.c create mode 100644 ports/nrf/common-hal/_protomatter/Protomatter.h create mode 100644 ports/nrf/common-hal/_protomatter/__init__.c diff --git a/lib/protomatter b/lib/protomatter index c3a3e35731..c411714cbd 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit c3a3e35731d641cb5a21ae7319634afc419f5afe +Subproject commit c411714cbdc05725e80398acb18c3c1fb6fa68a4 diff --git a/ports/nrf/common-hal/_protomatter/Protomatter.c b/ports/nrf/common-hal/_protomatter/Protomatter.c new file mode 100644 index 0000000000..b6e55bbd4c --- /dev/null +++ b/ports/nrf/common-hal/_protomatter/Protomatter.c @@ -0,0 +1,66 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "common-hal/_protomatter/Protomatter.h" + +#include "peripherals/nrf/timers.h" + +extern void _PM_IRQ_HANDLER(void); + +void *common_hal_protomatter_timer_allocate() { + nrfx_timer_t *timer = nrf_peripherals_allocate_timer_or_throw(); + nrf_peripherals_timer_never_reset(timer); + return timer->p_reg; +} + + +static void protomatter_event_handler(nrf_timer_event_t event_type, void *p_context) { + _PM_IRQ_HANDLER(); +} + +void common_hal_protomatter_timer_enable(void* ptr) { + nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); + static const nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_16MHz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_16, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = NULL, + }; + nrfx_timer_init(timer, &timer_config, &protomatter_event_handler); +} + +void common_hal_protomatter_timer_disable(void* ptr) { + nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); + nrfx_timer_uninit(timer); +} + +void common_hal_protomatter_timer_free(void* ptr) { + nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); + nrf_peripherals_free_timer(timer); +} diff --git a/ports/nrf/common-hal/_protomatter/Protomatter.h b/ports/nrf/common-hal/_protomatter/Protomatter.h new file mode 100644 index 0000000000..8185bed0e5 --- /dev/null +++ b/ports/nrf/common-hal/_protomatter/Protomatter.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H + +void *common_hal_protomatter_timer_allocate(void); +void common_hal_protomatter_timer_enable(void*); +void common_hal_protomatter_timer_disable(void*); +void common_hal_protomatter_timer_free(void*); + +#endif diff --git a/ports/nrf/common-hal/_protomatter/__init__.c b/ports/nrf/common-hal/_protomatter/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c index b7931a2e16..3132c76318 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.c +++ b/ports/nrf/common-hal/microcontroller/Pin.c @@ -196,3 +196,15 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { return pin_number_is_free(pin->number); } + +uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) { + return pin->number; +} + +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); +} + +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { + reset_pin_number(pin_no); +} diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index d0433247ac..270cb45d6d 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -102,10 +102,7 @@ void pulseout_reset() { void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, const pulseio_pwmout_obj_t* carrier) { if (refcount == 0) { - timer = nrf_peripherals_allocate_timer(); - if (timer == NULL) { - mp_raise_RuntimeError(translate("All timers in use")); - } + timer = nrf_peripherals_allocate_timer_or_throw(); } refcount++; diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index fcc59c484a..5ca1f0f35b 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -51,6 +51,9 @@ endif # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_PROTOMATTER = 1 +CIRCUITPY_FRAMEBUFFERIO = 1 + # nRF52840-specific ifeq ($(MCU_CHIP),nrf52840) diff --git a/ports/nrf/peripherals/nrf/timers.c b/ports/nrf/peripherals/nrf/timers.c index 88f3dd4681..fd814968dc 100644 --- a/ports/nrf/peripherals/nrf/timers.c +++ b/ports/nrf/peripherals/nrf/timers.c @@ -25,6 +25,7 @@ */ #include "common-hal/pulseio/PulseOut.h" +#include "peripherals/nrf/timers.h" #include @@ -54,14 +55,47 @@ STATIC nrfx_timer_t nrfx_timers[] = { }; static bool nrfx_timer_allocated[ARRAY_SIZE(nrfx_timers)]; +static bool nrfx_timer_never_reset[ARRAY_SIZE(nrfx_timers)]; void timers_reset(void) { for (size_t i = 0; i < ARRAY_SIZE(nrfx_timers); i ++) { + if (nrfx_timer_never_reset[i]) { + continue; + } nrfx_timer_uninit(&nrfx_timers[i]); nrfx_timer_allocated[i] = false; } } +void nrf_peripherals_timer_never_reset(nrfx_timer_t* timer) { + int idx = nrf_peripherals_timer_idx_from_timer(timer); + nrfx_timer_never_reset[idx] = true; +} + +void nrf_peripherals_timer_reset_ok(nrfx_timer_t* timer) { + int idx = nrf_peripherals_timer_idx_from_timer(timer); + nrfx_timer_never_reset[idx] = false; +} + +nrfx_timer_t* nrf_peripherals_timer_from_reg(NRF_TIMER_Type* ptr) { + for (size_t i = 0; i < ARRAY_SIZE(nrfx_timers); i ++) { + if (nrfx_timers[i].p_reg == ptr) { + return &nrfx_timers[i]; + } + } + return NULL; +} + +size_t nrf_peripherals_timer_idx_from_timer(nrfx_timer_t* ptr) { + for (size_t i = 0; i < ARRAY_SIZE(nrfx_timers); i ++) { + if (&nrfx_timers[i] == ptr) { + return i; + } + } + return ~(size_t)0; +} + + // Returns a free nrfx_timer instance, and marks it as allocated. // The caller should init as with the desired config. // Returns NULL if no timer is available. @@ -75,14 +109,21 @@ nrfx_timer_t* nrf_peripherals_allocate_timer(void) { return NULL; } +nrfx_timer_t* nrf_peripherals_allocate_timer_or_throw(void) { + nrfx_timer_t* result = nrf_peripherals_allocate_timer(); + if (!result) { + mp_raise_RuntimeError(translate("All timers in use")); + } + return result; +} + // Free a timer, which may or may not have been initialized. void nrf_peripherals_free_timer(nrfx_timer_t* timer) { - for (size_t i = 0; i < ARRAY_SIZE(nrfx_timers); i ++) { - if (timer == &nrfx_timers[i]) { - nrfx_timer_allocated[i] = false; - // Safe to call even if not initialized. - nrfx_timer_uninit(timer); - return; - } + size_t idx = nrf_peripherals_timer_idx_from_timer(timer); + if (idx != ~(size_t)0) { + nrfx_timer_allocated[idx] = false; + nrfx_timer_never_reset[idx] = false; + // Safe to call even if not initialized. + nrfx_timer_uninit(timer); } } diff --git a/ports/nrf/peripherals/nrf/timers.h b/ports/nrf/peripherals/nrf/timers.h index 7d3815579a..cf96c6273b 100644 --- a/ports/nrf/peripherals/nrf/timers.h +++ b/ports/nrf/peripherals/nrf/timers.h @@ -29,4 +29,9 @@ void timers_reset(void); nrfx_timer_t* nrf_peripherals_allocate_timer(void); +nrfx_timer_t* nrf_peripherals_allocate_timer_or_throw(void); void nrf_peripherals_free_timer(nrfx_timer_t* timer); +void nrf_peripherals_timer_never_reset(nrfx_timer_t* timer); +void nrf_peripherals_timer_reset_ok(nrfx_timer_t* timer); +nrfx_timer_t* nrf_peripherals_timer_from_reg(NRF_TIMER_Type* ptr); +size_t nrf_peripherals_timer_idx_from_timer(nrfx_timer_t* ptr); From 3a94412cd35c39bf30f29cb2b79be3870709c809 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Apr 2020 11:59:15 -0500 Subject: [PATCH 222/919] protomatter: more memory allocation fixes - bump supervisor alloc count by 4 (we actually use 5) - move reconstruct to after gc heap is reset - destroy protomatter object entirely if not used by a FramebufferDisplay - ensure previous supervisor allocations are released - zero out pointers so GC can collect them --- shared-module/_protomatter/Protomatter.c | 6 ++++++ shared-module/_protomatter/allocator.h | 4 +--- shared-module/displayio/__init__.c | 16 +++++++++++++++- supervisor/shared/display.c | 9 +++++++++ supervisor/shared/memory.c | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c index cbb60db6d3..bec9586f86 100644 --- a/shared-module/_protomatter/Protomatter.c +++ b/shared-module/_protomatter/Protomatter.c @@ -78,6 +78,11 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ // verify that the matrix is big enough mp_get_index(mp_obj_get_type(self->framebuffer), self->bufinfo.len, MP_OBJ_NEW_SMALL_INT(self->bufsize-1), false); } else { + _PM_FREE(self->bufinfo.buf); + _PM_FREE(self->core.rgbPins); + _PM_FREE(self->core.addr); + _PM_FREE(self->core.screenData); + self->framebuffer = NULL; self->bufinfo.buf = _PM_allocator_impl(self->bufsize); self->bufinfo.len = self->bufsize; @@ -156,6 +161,7 @@ void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t* se if (self->core.rgbPins) { _PM_free(&self->core); } + memset(&self->core, 0, sizeof(self->core)); self->base.type = NULL; } diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h index 8d9d7ff960..9b7590df35 100644 --- a/shared-module/_protomatter/allocator.h +++ b/shared-module/_protomatter/allocator.h @@ -6,7 +6,7 @@ #include "supervisor/memory.h" #define _PM_ALLOCATOR _PM_allocator_impl -#define _PM_FREE _PM_free_impl +#define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0) static inline void *_PM_allocator_impl(size_t sz) { supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); @@ -22,8 +22,6 @@ static inline void _PM_free_impl(void *ptr_in) { if (allocation) { free_memory(allocation); - } else { - m_free(ptr_in); } } diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 225aa2008e..dfa3e74737 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -21,6 +21,18 @@ primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; +STATIC bool any_display_uses_this_protomatter(protomatter_protomatter_obj_t* pm) { + for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { + if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { + framebufferio_framebufferdisplay_obj_t* display = &displays[i].framebuffer_display; + if (display->framebuffer == pm) { + return true; + } + } + } + return false; +} + // Check for recursive calls to displayio_background. bool displayio_background_in_progress = false; @@ -152,7 +164,9 @@ void reset_displays(void) { #if CIRCUITPY_PROTOMATTER } else if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { protomatter_protomatter_obj_t * pm = &displays[i].protomatter; - common_hal_protomatter_protomatter_reconstruct(pm, NULL); + if(!any_display_uses_this_protomatter(pm)) { + common_hal_protomatter_protomatter_deinit(pm); + } #endif } else { // Not an active display bus. diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 855432d645..050ba6e196 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -29,6 +29,7 @@ #include #include "py/mpstate.h" +#include "shared-module/displayio/__init__.h" #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/TileGrid.h" @@ -112,6 +113,14 @@ void supervisor_display_move_memory(void) { grid->inline_tiles = false; } MP_STATE_VM(terminal_tilegrid_tiles) = NULL; + #if CIRCUITPY_PROTOMATTER + for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { + if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { + protomatter_protomatter_obj_t * pm = &displays[i].protomatter; + common_hal_protomatter_protomatter_reconstruct(pm, NULL); + } + } + #endif #endif } diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 51037bd6d8..d52334eb49 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -31,7 +31,7 @@ #include "supervisor/shared/display.h" -#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT 8 +#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12) static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT]; // We use uint32_t* to ensure word (4 byte) alignment. From 1f3821220e396721ab83127f0965032639d613ba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Apr 2020 16:10:19 -0500 Subject: [PATCH 223/919] fix build for non-displayio & non-protomatter targets --- shared-module/displayio/__init__.c | 2 ++ supervisor/shared/display.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index dfa3e74737..21cbfa83ae 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -21,6 +21,7 @@ primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; +#if CIRCUITPY_PROTOMATTER STATIC bool any_display_uses_this_protomatter(protomatter_protomatter_obj_t* pm) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { @@ -32,6 +33,7 @@ STATIC bool any_display_uses_this_protomatter(protomatter_protomatter_obj_t* pm) } return false; } +#endif // Check for recursive calls to displayio_background. bool displayio_background_in_progress = false; diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 050ba6e196..cdf710d268 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -29,12 +29,15 @@ #include #include "py/mpstate.h" -#include "shared-module/displayio/__init__.h" #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/TileGrid.h" #include "supervisor/memory.h" +#if CIRCUITPY_PROTOMATTER +#include "shared-module/displayio/__init__.h" +#endif + extern size_t blinka_bitmap_data[]; extern displayio_bitmap_t blinka_bitmap; extern displayio_group_t circuitpython_splash; From 759fdffda51811f333772e8746aed45e15e6565f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Apr 2020 20:08:01 -0500 Subject: [PATCH 224/919] Update ports/atmel-samd/boards/pyportal_titano/board.c Co-Authored-By: Scott Shawcroft --- ports/atmel-samd/boards/pyportal_titano/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 40b7e84025..e7763b6e5c 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -101,7 +101,7 @@ void board_init(void) { 0, // rotation 16, // Color depth false, // grayscale - false, // pixels_i|n_byte_share_row (unused for depths > 8) + false, // pixels_in_byte_share_row (unused for depths > 8) 1, // bytes per cell. Only valid for depths < 8 false, // reverse_pixels_in_byte. Only valid for depths < 8 true, // reverse_pixels_in_word From 89eb45a13c48509a18ecadaacd983e880e17aa9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 2 Apr 2020 14:22:08 -0500 Subject: [PATCH 225/919] use floor division in docstring Co-Authored-By: Scott Shawcroft --- shared-bindings/_protomatter/Protomatter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index 8d0d223bb5..cb3ed7c4f3 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -80,7 +80,7 @@ STATIC void claim_pins_nr(mp_obj_t seq) { //| //| Create a Protomatter object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: -//| len(rgb_pins)/3 * 2 ** len(address_pins). With 6 RGB pins and 4 +//| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 //| address lines, the display will be 32 pixels tall. //| //| Up to 30 RGB pins and 8 address pins are supported. From 5fcba97a5185bd69c2213b38f6c8fc580dafde23 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 3 Apr 2020 10:50:12 -0500 Subject: [PATCH 226/919] Make function name more descriptive --- shared-bindings/_protomatter/Protomatter.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index cb3ed7c4f3..3c790ff7da 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -62,15 +62,15 @@ STATIC void validate_pins(qstr what, uint8_t* pin_nos, mp_int_t max_pins, mp_obj } } -STATIC void claim_pin_nr(mp_obj_t pin) { +STATIC void claim_and_never_reset_pin(mp_obj_t pin) { common_hal_mcu_pin_claim(pin); common_hal_never_reset_pin(pin); } -STATIC void claim_pins_nr(mp_obj_t seq) { +STATIC void claim_and_never_reset_pins(mp_obj_t seq) { mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); for (mp_int_t i=0; i Date: Fri, 3 Apr 2020 10:55:14 -0500 Subject: [PATCH 227/919] deinit: Work harder to ensure storage is released at deinit --- shared-module/_protomatter/Protomatter.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c index bec9586f86..59dac3e6d1 100644 --- a/shared-module/_protomatter/Protomatter.c +++ b/shared-module/_protomatter/Protomatter.c @@ -163,7 +163,14 @@ void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t* se } memset(&self->core, 0, sizeof(self->core)); + // If it was supervisor-allocated, it is supervisor-freed and the pointer + // is zeroed, otherwise the pointer is just zeroed + _PM_FREE(self->bufinfo.buf); self->base.type = NULL; + + // If a framebuffer was passed in to the constructor, NULL the reference + // here so that it will become GC'able + self->framebuffer = NULL; } void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) { From a663a7dd30d2cfed78644dcaa6e5ef25566acd82 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 3 Apr 2020 10:52:50 -0500 Subject: [PATCH 228/919] _protomatter: move get/set paused into shared-module --- shared-bindings/_protomatter/Protomatter.c | 11 +++-------- shared-bindings/_protomatter/Protomatter.h | 2 ++ shared-module/_protomatter/Protomatter.c | 12 ++++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index 3c790ff7da..b7b28630dc 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -193,7 +193,7 @@ static void check_for_deinit(protomatter_protomatter_obj_t *self) { STATIC mp_obj_t protomatter_protomatter_get_paused(mp_obj_t self_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - return mp_obj_new_bool(self->paused); + return mp_obj_new_bool(common_hal_protomatter_protomatter_get_paused(self)); } MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_paused_obj, protomatter_protomatter_get_paused); @@ -201,12 +201,7 @@ STATIC mp_obj_t protomatter_protomatter_set_paused(mp_obj_t self_in, mp_obj_t va protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); bool paused = mp_obj_is_true(value_in); - if (paused && !self->paused) { - _PM_stop(&self->core); - } else if (!paused && self->paused) { - _PM_resume(&self->core); - } - self->paused = paused; + common_hal_protomatter_protomatter_set_paused(self, paused); return mp_const_none; } @@ -262,7 +257,7 @@ STATIC void protomatter_protomatter_deinit_void(mp_obj_t self_in) { } STATIC void protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t value) { - protomatter_protomatter_set_paused(self_in, mp_obj_new_bool(value <= 0)); + common_hal_protomatter_protomatter_set_paused(self_in, value <= 0); } STATIC const framebuffer_p_t protomatter_protomatter_proto = { diff --git a/shared-bindings/_protomatter/Protomatter.h b/shared-bindings/_protomatter/Protomatter.h index cacc39a304..0a52c556fc 100644 --- a/shared-bindings/_protomatter/Protomatter.h +++ b/shared-bindings/_protomatter/Protomatter.h @@ -52,5 +52,7 @@ void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t* void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t*); void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t*); void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer); +void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused); +bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self); #endif diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c index 59dac3e6d1..9f67bfad31 100644 --- a/shared-module/_protomatter/Protomatter.c +++ b/shared-module/_protomatter/Protomatter.c @@ -180,3 +180,15 @@ void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) { gc_collect_ptr(self->core.screenData); } +void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused) { + if (paused && !self->paused) { + _PM_stop(&self->core); + } else if (!paused && self->paused) { + _PM_resume(&self->core); + } + self->paused = paused; +} + +bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self) { + return self->paused; +} From 50219862e13f60aadb0515a01131d7909bb07def Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 3 Apr 2020 10:54:15 -0500 Subject: [PATCH 229/919] protomatter: make docstring match implementation --- shared-bindings/_protomatter/Protomatter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index b7b28630dc..d5f9aa1aed 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -214,7 +214,7 @@ const mp_obj_property_t protomatter_protomatter_paused_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: write(buf) +//| .. method:: swapbuffers() //| //| Transmits the color data in the buffer to the pixels so that they are shown. //| From baf04b7738bdcf234eecad9e03904c1cadc44f50 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 3 Apr 2020 10:59:06 -0500 Subject: [PATCH 230/919] FramebufferDisplay: remove probably not needed constructor arguments --- .../framebufferio/FramebufferDisplay.c | 25 +++---------------- .../framebufferio/FramebufferDisplay.h | 5 ++-- .../framebufferio/FramebufferDisplay.c | 10 ++++---- 3 files changed, 11 insertions(+), 29 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 9f1df8bfaa..9b761dd2d2 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -54,20 +54,12 @@ //| //| :param framebuffer: The framebuffer that the display is connected to //| :type framebuffer: any core object implementing the framebuffer protocol -//| :param callback: Function or bound method to call when the framebuffer has been updated. The callback receives one argument, the framebuffer object. //| :param int width: Width in pixels //| :param int height: Height in pixels -//| :param int colstart: The index if the first visible column -//| :param int rowstart: The index if the first visible row //| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) //| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays //| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.) -//| :param bool grayscale: True if the display only shows a single color. -//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. //| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. -//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) -//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) -//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 //| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight //| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. //| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. @@ -75,20 +67,14 @@ //| :param int native_frames_per_second: Number of display refreshes per second //| STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_framebuffer, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; + enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, - { MP_QSTR_colstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - { MP_QSTR_rowstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, - { MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, - { MP_QSTR_pixels_in_byte_share_row, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, - { MP_QSTR_reverse_pixels_in_byte, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, - { MP_QSTR_reverse_bytes_in_word, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, { MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} }, { MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, @@ -117,12 +103,9 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t self, framebuffer, args[ARG_width].u_int, args[ARG_height].u_int, - args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, - args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, - args[ARG_pixels_in_byte_share_row].u_bool, - args[ARG_bytes_per_cell].u_bool, - args[ARG_reverse_pixels_in_byte].u_bool, - args[ARG_reverse_bytes_in_word].u_bool, + rotation, + args[ARG_color_depth].u_int, + args[ARG_bytes_per_cell].u_int, MP_OBJ_TO_PTR(backlight_pin), brightness, args[ARG_auto_brightness].u_bool, diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index af0bd2c415..b63439e0c4 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -40,9 +40,8 @@ extern const mp_obj_type_t framebufferio_framebufferdisplay_type; void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, mp_obj_t framebuffer, uint16_t width, uint16_t height, - int16_t colstart, int16_t rowstart, - uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, - uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, + uint16_t rotation, uint16_t color_depth, + uint8_t bytes_per_cell, const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, bool auto_refresh, uint16_t native_frames_per_second); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 967316c21d..ec2fe7b314 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -42,9 +42,9 @@ #include "tick.h" void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, - mp_obj_t framebuffer, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, - uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, - uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, + mp_obj_t framebuffer, uint16_t width, uint16_t height, + uint16_t rotation, uint16_t color_depth, + uint8_t bytes_per_cell, const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, bool auto_refresh, uint16_t native_frames_per_second) { // Turn off auto-refresh as we init. @@ -55,8 +55,8 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu uint16_t ram_width = 0x100; uint16_t ram_height = 0x100; - displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, colstart, rowstart, rotation, - color_depth, grayscale, pixels_in_byte_share_row, bytes_per_cell, reverse_pixels_in_byte, reverse_bytes_in_word); + displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, 0, 0, rotation, + color_depth, false, false, bytes_per_cell, false, false); self->auto_brightness = auto_brightness; self->first_manual_refresh = !auto_refresh; From 23bced26da40d5d87b0aac18e6aac525d4d27bac Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Apr 2020 11:18:57 -0500 Subject: [PATCH 231/919] samd: actually disable protomatter timer Just setting the timer handler to NO_INTERRUPT doesn't stop the interrupt from occurring. --- ports/atmel-samd/common-hal/_protomatter/Protomatter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/common-hal/_protomatter/Protomatter.c b/ports/atmel-samd/common-hal/_protomatter/Protomatter.c index 702de0e3d4..bf9cafb6b9 100644 --- a/ports/atmel-samd/common-hal/_protomatter/Protomatter.c +++ b/ports/atmel-samd/common-hal/_protomatter/Protomatter.c @@ -64,6 +64,7 @@ void common_hal_protomatter_timer_disable(void* ptr) { return; } set_timer_handler(true, timer_index, TC_HANDLER_NO_INTERRUPT); + tc_set_enable(ptr, false); } void common_hal_protomatter_timer_free(void* ptr) { From 0ca270172f36817c14790eb87053e3c326001822 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Apr 2020 11:19:24 -0500 Subject: [PATCH 232/919] protomatter: allocator: Never supervisor-alloc while gc available This may have been contributing to fragmentation of the supervisor heap --- shared-module/_protomatter/allocator.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h index 9b7590df35..501a26098f 100644 --- a/shared-module/_protomatter/allocator.h +++ b/shared-module/_protomatter/allocator.h @@ -2,6 +2,7 @@ #define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #include +#include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" @@ -9,11 +10,11 @@ #define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0) static inline void *_PM_allocator_impl(size_t sz) { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); - if (allocation) { - return allocation->ptr; - } else { + if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); + } else { + supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); + return allocation ? allocation->ptr : NULL; } } From 5dae23c0e787e38ea737f8333a1ad85a1de5184d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 7 Apr 2020 11:19:47 -0500 Subject: [PATCH 233/919] protomatter: release the protomatter object during release_displays() --- shared-module/displayio/__init__.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 21cbfa83ae..cf1bc45d9d 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -102,6 +102,10 @@ void common_hal_displayio_release_displays(void) { common_hal_displayio_i2cdisplay_deinit(&displays[i].i2cdisplay_bus); } else if (bus_type == &displayio_parallelbus_type) { common_hal_displayio_parallelbus_deinit(&displays[i].parallel_bus); +#if CIRCUITPY_FRAMEBUFFERIO + } else if (bus_type == &protomatter_Protomatter_type) { + common_hal_protomatter_protomatter_deinit(&displays[i].protomatter); +#endif } displays[i].fourwire_bus.base.type = &mp_type_NoneType; } From b1fab1cdac6a3e878a7d7a654f6ea6f92f60cc88 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 9 Apr 2020 09:10:09 -0500 Subject: [PATCH 234/919] Make stripping circuitpython optional, not the default --- py/mkrules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 292d257465..13a73b90e6 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -145,7 +145,7 @@ $(PROG): $(OBJ) # Do not pass COPT here - it's *C* compiler optimizations. For example, # we may want to compile using Thumb, but link with non-Thumb libc. $(Q)$(CC) -o $@ $^ $(LIB) $(LDFLAGS) -ifndef DEBUG +ifdef STRIP_CIRCUITPYTHON $(Q)$(STRIP) $(STRIPFLAGS_EXTRA) $(PROG) endif $(Q)$(SIZE) $$(find $(BUILD) -path "$(BUILD)/build/frozen*.o") $(PROG) From 9019710a1e75d4042d37dd3285d06e3f24aec449 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 9 Apr 2020 09:11:37 -0500 Subject: [PATCH 235/919] protomatter: improve an error message --- shared-bindings/_protomatter/Protomatter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index d5f9aa1aed..f3de6a86e0 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -54,7 +54,7 @@ STATIC uint8_t validate_pin(mp_obj_t obj) { STATIC void validate_pins(qstr what, uint8_t* pin_nos, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out) { mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); if (len > max_pins) { - mp_raise_ValueError_varg(translate("At most %d %q may be specified"), max_pins, what); + mp_raise_ValueError_varg(translate("At most %d %q may be specified (not %d)"), max_pins, what, len); } *count_out = len; for (mp_int_t i=0; i Date: Thu, 9 Apr 2020 09:11:55 -0500 Subject: [PATCH 236/919] protomatter: Use low end of supervisor heap Per @tannewt, this area "sees more churn", so it's probably the right choice here --- shared-module/_protomatter/allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h index 501a26098f..1ae127de21 100644 --- a/shared-module/_protomatter/allocator.h +++ b/shared-module/_protomatter/allocator.h @@ -13,7 +13,7 @@ static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), true); + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); return allocation ? allocation->ptr : NULL; } } From 4a05e938ed8bd33f0ec3204d988fa6948e1e11d2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Apr 2020 08:45:37 -0500 Subject: [PATCH 237/919] protomatter: validate pins to give better error message The numbered error from the underlying library is not helpful for beginning users --- shared-bindings/_protomatter/Protomatter.c | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index f3de6a86e0..88974e658e 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -74,6 +74,65 @@ STATIC void claim_and_never_reset_pins(mp_obj_t seq) { } } +STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_t rgb_pin_count, bool allow_inefficient) { + uint32_t port = clock_pin / 32; + uint32_t bit_mask = 1 << (clock_pin % 32); + + for (uint8_t i = 0; i < rgb_pin_count; i++) { + uint32_t pin_port = rgb_pins[i] / 32; + + if (pin_port != port) { + mp_raise_ValueError_varg( + translate("rgb_pins[%d] is not on the same port as clock"), i); + } + + uint32_t pin_mask = 1 << (rgb_pins[i] % 32); + if (pin_mask & bit_mask) { + mp_raise_ValueError_varg( + translate("rgb_pins[%d] duplicates another pin assignment"), i); + } + + bit_mask |= pin_mask; + } + + if (allow_inefficient) { + return; + } + + uint8_t byte_mask = 0; + if (bit_mask & 0x000000FF) byte_mask |= 0b0001; + if (bit_mask & 0x0000FF00) byte_mask |= 0b0010; + if (bit_mask & 0x00FF0000) byte_mask |= 0b0100; + if (bit_mask & 0xFF000000) byte_mask |= 0b1000; + + uint8_t bytes_per_element = 0xff; + uint8_t ideal_bytes_per_element = (rgb_pin_count + 7) / 8; + + switch(byte_mask) { + case 0b0001: + case 0b0010: + case 0b0100: + case 0b1000: + bytes_per_element = 1; + break; + + case 0b0011: + case 0b1100: + bytes_per_element = 2; + break; + + default: + bytes_per_element = 4; + break; + } + + if (bytes_per_element != ideal_bytes_per_element) { + mp_raise_ValueError_varg( + translate("Pinout uses %d bytes per element, which consumes more than the ideal %d bytes. If this cannot be avoided, pass allow_inefficient=True to the constructor"), + bytes_per_element, ideal_bytes_per_element); + } +} + //| :class:`~_protomatter.Protomatter` displays an in-memory framebuffer to an LED matrix. //| //| .. class:: Protomatter(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, oe_pin, *, doublebuffer=True, framebuffer=None) @@ -141,6 +200,8 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); + preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true); + mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; if (framebuffer == mp_const_none) { int width = args[ARG_width].u_int; From 129c6369cfd510b12e5f8ae1d9c9a51853f1b498 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Apr 2020 08:45:42 -0500 Subject: [PATCH 238/919] protomatter: code style --- shared-bindings/_protomatter/Protomatter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index 88974e658e..f6ac191889 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -332,7 +332,7 @@ STATIC const framebuffer_p_t protomatter_protomatter_proto = { STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; // a readonly framebuffer would be unusual but not impossible - if((flags & MP_BUFFER_WRITE) && !(self->bufinfo.typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) { + if ((flags & MP_BUFFER_WRITE) && !(self->bufinfo.typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) { return 1; } *bufinfo = self->bufinfo; From ba20bc8b4322373ec9ed55ed9f299675ea2801f8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Apr 2020 09:07:06 -0500 Subject: [PATCH 239/919] framebufferio: move backlight down to the underlying framebuffer --- shared-bindings/_protomatter/Protomatter.c | 3 +- .../framebufferio/FramebufferDisplay.c | 17 ++--- .../framebufferio/FramebufferDisplay.h | 3 +- .../framebufferio/FramebufferDisplay.c | 65 ++++--------------- .../framebufferio/FramebufferDisplay.h | 15 ++--- 5 files changed, 28 insertions(+), 75 deletions(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index f6ac191889..50480004cc 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -317,8 +317,9 @@ STATIC void protomatter_protomatter_deinit_void(mp_obj_t self_in) { protomatter_protomatter_deinit(self_in); } -STATIC void protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t value) { +STATIC bool protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t value) { common_hal_protomatter_protomatter_set_paused(self_in, value <= 0); + return true; } STATIC const framebuffer_p_t protomatter_protomatter_proto = { diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 9b761dd2d2..538d3afb46 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -67,7 +67,7 @@ //| :param int native_frames_per_second: Number of display refreshes per second //| STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; + enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, @@ -75,9 +75,6 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, - { MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, - { MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} }, - { MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, }; @@ -87,10 +84,6 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; - const mcu_pin_obj_t* backlight_pin = validate_obj_is_free_pin_or_none(args[ARG_backlight_pin].u_obj); - - mp_float_t brightness = mp_obj_get_float(args[ARG_brightness].u_obj); - mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); @@ -106,9 +99,6 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t rotation, args[ARG_color_depth].u_int, args[ARG_bytes_per_cell].u_int, - MP_OBJ_TO_PTR(backlight_pin), - brightness, - args[ARG_auto_brightness].u_bool, args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int ); @@ -260,7 +250,10 @@ MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_auto_brightness_o STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_auto_brightness(mp_obj_t self_in, mp_obj_t auto_brightness) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); - common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, mp_obj_is_true(auto_brightness)); + bool ok = common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, mp_obj_is_true(auto_brightness)); + if (!ok) { + mp_raise_RuntimeError(translate("Brightness not adjustable")); + } return mp_const_none; } diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index b63439e0c4..56ef8abc47 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -42,7 +42,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu mp_obj_t framebuffer, uint16_t width, uint16_t height, uint16_t rotation, uint16_t color_depth, uint8_t bytes_per_cell, - const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, bool auto_refresh, uint16_t native_frames_per_second); bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self, @@ -59,7 +58,7 @@ uint16_t common_hal_framebufferio_framebufferdisplay_get_rotation(framebufferio_ void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t* self, int rotation); bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t* self); -void common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness); +bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness); bool common_hal_framebufferio_framebufferdisplay_get_dither(framebufferio_framebufferdisplay_obj_t* self); void common_hal_framebufferio_framebufferdisplay_set_dither(framebufferio_framebufferdisplay_obj_t* self, bool dither); diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index ec2fe7b314..bd0764e8e4 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -45,7 +45,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu mp_obj_t framebuffer, uint16_t width, uint16_t height, uint16_t rotation, uint16_t color_depth, uint8_t bytes_per_cell, - const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness, bool auto_refresh, uint16_t native_frames_per_second) { // Turn off auto-refresh as we init. self->auto_refresh = false; @@ -58,7 +57,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, 0, 0, rotation, color_depth, false, false, bytes_per_cell, false, false); - self->auto_brightness = auto_brightness; self->first_manual_refresh = !auto_refresh; self->native_frames_per_second = native_frames_per_second; @@ -66,25 +64,6 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu supervisor_start_terminal(width, height); - // Always set the backlight type in case we're reusing memory. - self->backlight_inout.base.type = &mp_type_NoneType; - if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { - pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); - if (result != PWMOUT_OK) { - self->backlight_inout.base.type = &digitalio_digitalinout_type; - common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); - common_hal_never_reset_pin(backlight_pin); - } else { - self->backlight_pwm.base.type = &pulseio_pwmout_type; - common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); - } - } - if (!self->auto_brightness && (self->framebuffer_protocol->set_brightness != NULL || self->backlight_inout.base.type != &mp_type_NoneType)) { - common_hal_framebufferio_framebufferdisplay_set_brightness(self, brightness); - } else { - self->current_brightness = -1.0; - } - // Set the group after initialization otherwise we may send pixels while we delay in // initialization. common_hal_framebufferio_framebufferdisplay_show(self, &circuitpython_splash); @@ -104,33 +83,31 @@ uint16_t common_hal_framebufferio_framebufferdisplay_get_height(framebufferio_fr } bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t* self) { - return self->auto_brightness; + if (self->framebuffer_protocol->get_auto_brightness) { + return self->framebuffer_protocol->get_auto_brightness(self->framebuffer); + } + return true; } -void common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness) { - self->auto_brightness = auto_brightness; +bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness) { + if (self->framebuffer_protocol->set_auto_brightness) { + return self->framebuffer_protocol->set_auto_brightness(self->framebuffer, auto_brightness); + } + return false; } mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self) { - return self->current_brightness; + if (self->framebuffer_protocol->set_brightness) { + return self->framebuffer_protocol->get_brightness(self->framebuffer); + } + return -1; } bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_framebufferdisplay_obj_t* self, mp_float_t brightness) { - self->updating_backlight = true; bool ok = false; if (self->framebuffer_protocol->set_brightness) { self->framebuffer_protocol->set_brightness(self->framebuffer, brightness); ok = true; - } else if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { - common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); - ok = true; - } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { - common_hal_digitalio_digitalinout_set_value(&self->backlight_inout, brightness > 0.99); - ok = true; - } - self->updating_backlight = false; - if (ok) { - self->current_brightness = brightness; } return ok; } @@ -295,17 +272,8 @@ void common_hal_framebufferio_framebufferdisplay_set_auto_refresh(framebufferio_ } STATIC void _update_backlight(framebufferio_framebufferdisplay_obj_t* self) { - if (!self->auto_brightness || self->updating_backlight) { - return; - } - if (supervisor_ticks_ms64() - self->last_backlight_refresh < 100) { - return; - } // TODO(tannewt): Fade the backlight based on it's existing value and a target value. The target // should account for ambient light when possible. - common_hal_framebufferio_framebufferdisplay_set_brightness(self, 1.0); - - self->last_backlight_refresh = supervisor_ticks_ms64(); } void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self) { @@ -318,18 +286,11 @@ void framebufferio_framebufferdisplay_background(framebufferio_framebufferdispla void release_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { release_display_core(&self->core); - if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { - common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); - } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { - common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); - } self->framebuffer_protocol->deinit(self->framebuffer); } void reset_framebufferdisplay(framebufferio_framebufferdisplay_obj_t* self) { self->auto_refresh = true; - self->auto_brightness = true; common_hal_framebufferio_framebufferdisplay_show(self, NULL); } diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index a5c8607bbc..a7b91a522e 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -40,22 +40,15 @@ typedef struct { mp_obj_base_t base; displayio_display_core_t core; - union { - digitalio_digitalinout_obj_t backlight_inout; - pulseio_pwmout_obj_t backlight_pwm; - }; mp_obj_t framebuffer; const struct _framebuffer_p_t *framebuffer_protocol; mp_buffer_info_t bufinfo; uint64_t last_backlight_refresh; uint64_t last_refresh_call; - mp_float_t current_brightness; uint16_t native_frames_per_second; uint16_t native_ms_per_frame; bool auto_refresh; bool first_manual_refresh; - bool auto_brightness; - bool updating_backlight; } framebufferio_framebufferdisplay_obj_t; void framebufferio_framebufferdisplay_background(framebufferio_framebufferdisplay_obj_t* self); @@ -69,14 +62,20 @@ mp_obj_t common_hal_framebufferio_framebufferdisplay_get_framebuffer(framebuffer typedef void (*framebuffer_get_bufinfo_fun)(mp_obj_t, mp_buffer_info_t *bufinfo); typedef void (*framebuffer_swapbuffers_fun)(mp_obj_t); typedef void (*framebuffer_deinit_fun)(mp_obj_t); -typedef void (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); +typedef bool (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); +typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); +typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); +typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); typedef struct _framebuffer_p_t { MP_PROTOCOL_HEAD // MP_QSTR_protocol_framebuffer framebuffer_get_bufinfo_fun get_bufinfo; framebuffer_swapbuffers_fun swapbuffers; framebuffer_deinit_fun deinit; + framebuffer_get_brightness_fun get_brightness; framebuffer_set_brightness_fun set_brightness; + framebuffer_get_auto_brightness_fun get_auto_brightness; + framebuffer_set_auto_brightness_fun set_auto_brightness; } framebuffer_p_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_FRAMEBUFFERDISPLAY_H From 5d328c3b449dbd0eaf40c2edc205fb7c5d381589 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 10 Apr 2020 09:07:16 -0500 Subject: [PATCH 240/919] protomatter: clarify by comment why these functions exist --- shared-bindings/_protomatter/Protomatter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index 50480004cc..3b3fdae8c9 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -309,10 +309,12 @@ STATIC void protomatter_protomatter_get_bufinfo(mp_obj_t self_in, mp_buffer_info *bufinfo = self->bufinfo; } +// This version exists so that the return value of the function can be none, matching the protocol STATIC void protomatter_protomatter_swapbuffers_void(mp_obj_t self_in) { protomatter_protomatter_swapbuffers(self_in); } +// This version exists so that the return value of the function can be none, matching the protocol STATIC void protomatter_protomatter_deinit_void(mp_obj_t self_in) { protomatter_protomatter_deinit(self_in); } From 880fff80e904ef4b173d551742b7acde56114f0c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 13 Apr 2020 08:51:35 -0500 Subject: [PATCH 241/919] protomatter: Respond to review comments - rename oe_pin -> output_enable_pin - improve and reorganize docstrings - rename swapbuffers->refresh - rename "paused" -> "brightness", change semantics slightly - common_hal several functions - clarify why the common_hal routines can't be used directly in the protocol's function pointers - whitespace cleanups - remove prototypes for nonexistent functions --- shared-bindings/_protomatter/Protomatter.c | 108 ++++++++++-------- shared-bindings/_protomatter/Protomatter.h | 1 + .../framebufferio/FramebufferDisplay.c | 2 +- .../framebufferio/FramebufferDisplay.h | 3 - shared-module/_protomatter/Protomatter.c | 10 +- shared-module/_protomatter/allocator.h | 4 +- 6 files changed, 71 insertions(+), 57 deletions(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index 3b3fdae8c9..cfc0ba6edf 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -135,7 +135,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| :class:`~_protomatter.Protomatter` displays an in-memory framebuffer to an LED matrix. //| -//| .. class:: Protomatter(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, oe_pin, *, doublebuffer=True, framebuffer=None) +//| .. class:: Protomatter(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, *, doublebuffer=True, framebuffer=None) //| //| Create a Protomatter object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: @@ -153,12 +153,17 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| microcontroller board. For instance, the Feather M4 Express works //| together with the RGB Matrix Feather. //| -//| When specified as True, double buffering can reduce some flickering of -//| the matrix; however, this increases memory usage. +//| The framebuffer is in "RGB565" format. //| -//| The framebuffer is in "RGB565" format. If a framebuffer is not -//| passed in, one is allocated and initialized to all black. To update -//| the content, modify the framebuffer and call swapbuffers. +//| "RGB565" means that it is organized as a series of 16-bit numbers +//| where the highest 5 bits are interpreted as red, the next 6 as +//| green, and the final 5 as blue. The object can be any buffer, but +//| `array.array` and `ulab.array` objects are most often useful. +//| To update the content, modify the framebuffer and call refresh. +//| +//| If a framebuffer is not passed in, one is allocated and initialized +//| to all black. In any case, the framebuffer can be retrieved +//| by passing the protomatter object to memoryview(). //| //| If doublebuffer is False, some memory is saved, but the display may //| flicker during updates. @@ -166,10 +171,13 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| If a framebuffer is not passed in, one is allocated internally. To //| retrieve it, pass the protomatter object to memoryview(). //| +//| A Protomatter framebuffer is often used in conjunction with a +//| `framebufferio.FramebufferDisplay`. +//| STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_width, ARG_bit_depth, ARG_rgb_list, ARG_addr_list, - ARG_clock_pin, ARG_latch_pin, ARG_oe_pin, ARG_doublebuffer, ARG_framebuffer }; + ARG_clock_pin, ARG_latch_pin, ARG_output_enable_pin, ARG_doublebuffer, ARG_framebuffer }; static const mp_arg_t allowed_args[] = { { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED }, { MP_QSTR_bit_depth, MP_ARG_INT | MP_ARG_REQUIRED }, @@ -177,7 +185,7 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size { MP_QSTR_addr_pins, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_clock_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_latch_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_oe_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_output_enable_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_doublebuffer, MP_ARG_BOOL, { .u_bool = true } }, { MP_QSTR_framebuffer, MP_ARG_OBJ, { .u_obj = mp_const_none } }, }; @@ -195,7 +203,7 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size uint8_t addr_pins[MP_ARRAY_SIZE(self->addr_pins)]; uint8_t clock_pin = validate_pin(args[ARG_clock_pin].u_obj); uint8_t latch_pin = validate_pin(args[ARG_latch_pin].u_obj); - uint8_t oe_pin = validate_pin(args[ARG_oe_pin].u_obj); + uint8_t output_enable_pin = validate_pin(args[ARG_output_enable_pin].u_obj); validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); @@ -214,14 +222,14 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size args[ARG_bit_depth].u_int, rgb_count, rgb_pins, addr_count, addr_pins, - clock_pin, latch_pin, oe_pin, + clock_pin, latch_pin, output_enable_pin, args[ARG_doublebuffer].u_bool, framebuffer, NULL); claim_and_never_reset_pins(args[ARG_rgb_list].u_obj); claim_and_never_reset_pins(args[ARG_addr_list].u_obj); claim_and_never_reset_pin(args[ARG_clock_pin].u_obj); - claim_and_never_reset_pin(args[ARG_oe_pin].u_obj); + claim_and_never_reset_pin(args[ARG_output_enable_pin].u_obj); claim_and_never_reset_pin(args[ARG_latch_pin].u_obj); return MP_OBJ_FROM_PTR(self); @@ -247,79 +255,80 @@ static void check_for_deinit(protomatter_protomatter_obj_t *self) { } } -//| .. attribute:: paused +//| .. attribute:: brightness //| -//| When paused, the matrix is not driven and all its LEDs are unlit. +//| In the current implementation, 0.0 turns the display off entirely +//| and any other value up to 1.0 turns the display on fully. //| -STATIC mp_obj_t protomatter_protomatter_get_paused(mp_obj_t self_in) { +STATIC mp_obj_t protomatter_protomatter_get_brightness(mp_obj_t self_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - return mp_obj_new_bool(common_hal_protomatter_protomatter_get_paused(self)); + return mp_obj_new_float(common_hal_protomatter_protomatter_get_paused(self)? 0.0f : 1.0f); } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_paused_obj, protomatter_protomatter_get_paused); +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_brightness_obj, protomatter_protomatter_get_brightness); -STATIC mp_obj_t protomatter_protomatter_set_paused(mp_obj_t self_in, mp_obj_t value_in) { +STATIC mp_obj_t protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_obj_t value_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - bool paused = mp_obj_is_true(value_in); - common_hal_protomatter_protomatter_set_paused(self, paused); + mp_float_t brightness = mp_obj_get_float(value_in); + if (brightness < 0.0f || brightness > 1.0f) { + mp_raise_ValueError(translate("Brightness must be 0-1.0")); + } + common_hal_protomatter_protomatter_set_paused(self_in, brightness <= 0); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(protomatter_protomatter_set_paused_obj, protomatter_protomatter_set_paused); +MP_DEFINE_CONST_FUN_OBJ_2(protomatter_protomatter_set_brightness_obj, protomatter_protomatter_set_brightness); -const mp_obj_property_t protomatter_protomatter_paused_obj = { +const mp_obj_property_t protomatter_protomatter_brightness_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_paused_obj, - (mp_obj_t)&protomatter_protomatter_set_paused_obj, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_brightness_obj, + (mp_obj_t)&protomatter_protomatter_set_brightness_obj, (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: swapbuffers() +//| .. method:: refresh() //| -//| Transmits the color data in the buffer to the pixels so that they are shown. +//| Transmits the color data in the buffer to the pixels so that +//| they are shown. //| -//| The data in the buffer must be in "RGB565" format. This means -//| that it is organized as a series of 16-bit numbers where the highest 5 -//| bits are interpreted as red, the next 6 as green, and the final 5 as -//| blue. The object can be any buffer, but `array.array` and `ulab.array` -//| objects are most often useful. -//| -STATIC mp_obj_t protomatter_protomatter_swapbuffers(mp_obj_t self_in) { +STATIC mp_obj_t protomatter_protomatter_refresh(mp_obj_t self_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - - _PM_convert_565(&self->core, self->bufinfo.buf, self->width); - _PM_swapbuffer_maybe(&self->core); + common_hal_protomatter_protomatter_refresh(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_swapbuffers_obj, protomatter_protomatter_swapbuffers); +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_refresh_obj, protomatter_protomatter_refresh); STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_paused), MP_ROM_PTR(&protomatter_protomatter_paused_obj) }, - { MP_ROM_QSTR(MP_QSTR_swapbuffers), MP_ROM_PTR(&protomatter_protomatter_swapbuffers_obj) }, + { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&protomatter_protomatter_brightness_obj) }, + { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&protomatter_protomatter_refresh_obj) }, }; STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); STATIC void protomatter_protomatter_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t *bufinfo) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - + *bufinfo = self->bufinfo; } -// This version exists so that the return value of the function can be none, matching the protocol -STATIC void protomatter_protomatter_swapbuffers_void(mp_obj_t self_in) { - protomatter_protomatter_swapbuffers(self_in); +// These version exists so that the prototype matches the protocol, +// avoiding a type cast that can hide errors +STATIC void protomatter_protomatter_swapbuffers(mp_obj_t self_in) { + common_hal_protomatter_protomatter_refresh(self_in); } -// This version exists so that the return value of the function can be none, matching the protocol -STATIC void protomatter_protomatter_deinit_void(mp_obj_t self_in) { - protomatter_protomatter_deinit(self_in); +STATIC void protomatter_protomatter_deinit_proto(mp_obj_t self_in) { + common_hal_protomatter_protomatter_deinit(self_in); } -STATIC bool protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t value) { +STATIC float protomatter_protomatter_get_brightness_proto(mp_obj_t self_in) { + return common_hal_protomatter_protomatter_get_paused(self_in) ? 0.0f : 1.0f; +} + +STATIC bool protomatter_protomatter_set_brightness_proto(mp_obj_t self_in, mp_float_t value) { common_hal_protomatter_protomatter_set_paused(self_in, value <= 0); return true; } @@ -327,9 +336,10 @@ STATIC bool protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_float_t STATIC const framebuffer_p_t protomatter_protomatter_proto = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuffer) .get_bufinfo = protomatter_protomatter_get_bufinfo, - .set_brightness = protomatter_protomatter_set_brightness, - .swapbuffers = protomatter_protomatter_swapbuffers_void, - .deinit = protomatter_protomatter_deinit_void, + .set_brightness = protomatter_protomatter_set_brightness_proto, + .get_brightness = protomatter_protomatter_get_brightness_proto, + .swapbuffers = protomatter_protomatter_swapbuffers, + .deinit = protomatter_protomatter_deinit_proto, }; STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { diff --git a/shared-bindings/_protomatter/Protomatter.h b/shared-bindings/_protomatter/Protomatter.h index 0a52c556fc..9499da22c0 100644 --- a/shared-bindings/_protomatter/Protomatter.h +++ b/shared-bindings/_protomatter/Protomatter.h @@ -54,5 +54,6 @@ void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t*); void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer); void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused); bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self); +void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* self); #endif diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 538d3afb46..aa8fc1a630 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -216,7 +216,7 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_brightness(mp_obj_t sel framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, false); mp_float_t brightness = mp_obj_get_float(brightness_obj); - if (brightness < 0 || brightness > 1.0) { + if (brightness < 0.0f || brightness > 1.0f) { mp_raise_ValueError(translate("Brightness must be 0-1.0")); } bool ok = common_hal_framebufferio_framebufferdisplay_set_brightness(self, brightness); diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index 56ef8abc47..b472088d20 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -60,9 +60,6 @@ void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_fram bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t* self); bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t* self, bool auto_brightness); -bool common_hal_framebufferio_framebufferdisplay_get_dither(framebufferio_framebufferdisplay_obj_t* self); -void common_hal_framebufferio_framebufferdisplay_set_dither(framebufferio_framebufferdisplay_obj_t* self, bool dither); - mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t* self); bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_framebufferdisplay_obj_t* self, mp_float_t brightness); diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/_protomatter/Protomatter.c index 9f67bfad31..77ca634763 100644 --- a/shared-module/_protomatter/Protomatter.c +++ b/shared-module/_protomatter/Protomatter.c @@ -53,7 +53,7 @@ void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t self->oe_pin = oe_pin; self->latch_pin = latch_pin; self->doublebuffer = doublebuffer; - + self->timer = timer ? timer : common_hal_protomatter_timer_allocate(); if (self->timer == NULL) { mp_raise_ValueError(translate("No timer available")); @@ -90,7 +90,7 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ } ProtomatterStatus stat = _PM_init(&self->core, - self->width, self->bit_depth, + self->width, self->bit_depth, self->rgb_count/6, self->rgb_pins, self->addr_count, self->addr_pins, self->clock_pin, self->latch_pin, self->oe_pin, @@ -192,3 +192,9 @@ void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self) { return self->paused; } + +void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* self) { + _PM_convert_565(&self->core, self->bufinfo.buf, self->width); + _PM_swapbuffer_maybe(&self->core); +} + diff --git a/shared-module/_protomatter/allocator.h b/shared-module/_protomatter/allocator.h index 1ae127de21..b7f517ce5b 100644 --- a/shared-module/_protomatter/allocator.h +++ b/shared-module/_protomatter/allocator.h @@ -13,14 +13,14 @@ static inline void *_PM_allocator_impl(size_t sz) { if (gc_alloc_possible()) { return m_malloc(sz + sizeof(void*), true); } else { - supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); + supervisor_allocation *allocation = allocate_memory(align32_size(sz), false); return allocation ? allocation->ptr : NULL; } } static inline void _PM_free_impl(void *ptr_in) { supervisor_allocation *allocation = allocation_from_ptr(ptr_in); - + if (allocation) { free_memory(allocation); } From 0ce9c008c5d54f59224bda91af36c9c86aa64c09 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Apr 2020 10:02:08 -0500 Subject: [PATCH 242/919] Protomatter: Make all arguments kw-only, add rgb count and optional height checking They're not readily distinguishable by type. I also added the requested height optional parameter; this is checked against the computed one. It's not feasible to use this parameter to artificailly reduce the number of used rows, because changes in the underlying C protomatter library would be required. Finally, I added a better error message when the number of RGB pins was not what was expected. --- shared-bindings/_protomatter/Protomatter.c | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index cfc0ba6edf..bb43390796 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -177,17 +177,18 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_width, ARG_bit_depth, ARG_rgb_list, ARG_addr_list, - ARG_clock_pin, ARG_latch_pin, ARG_output_enable_pin, ARG_doublebuffer, ARG_framebuffer }; + ARG_clock_pin, ARG_latch_pin, ARG_output_enable_pin, ARG_doublebuffer, ARG_framebuffer, ARG_height }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED }, - { MP_QSTR_bit_depth, MP_ARG_INT | MP_ARG_REQUIRED }, - { MP_QSTR_rgb_pins, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_addr_pins, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_clock_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_latch_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_output_enable_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_doublebuffer, MP_ARG_BOOL, { .u_bool = true } }, - { MP_QSTR_framebuffer, MP_ARG_OBJ, { .u_obj = mp_const_none } }, + { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_bit_depth, MP_ARG_INT | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_rgb_pins, MP_ARG_OBJ | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_addr_pins, MP_ARG_OBJ | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_clock_pin, MP_ARG_OBJ | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_latch_pin, MP_ARG_OBJ | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_output_enable_pin, MP_ARG_OBJ | MP_ARG_REQUIRED | MP_ARG_KW_ONLY }, + { MP_QSTR_doublebuffer, MP_ARG_BOOL | MP_ARG_KW_ONLY, { .u_bool = true } }, + { MP_QSTR_framebuffer, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, + { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -208,6 +209,19 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); + if (rgb_count % 6) { + mp_raise_ValueError_varg(translate("Must use a multiple of 6 rgb pins, not %d"), rgb_count); + } + + // TODO(@jepler) Use fewer than all rows of pixels if height < computed_height + if (args[ARG_height].u_int != 0) { + int computed_height = (rgb_count / 3) << (addr_count); + if (computed_height != args[ARG_height].u_int) { + mp_raise_ValueError_varg( + translate("%d address pins and %d rgb pins indicate a height of %d, not %d"), addr_count, rgb_count, computed_height, args[ARG_height].u_int); + } + } + preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true); mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; From d8362ef654d86d29561db2cbcc2a20ab488316a8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Apr 2020 17:34:53 -0500 Subject: [PATCH 243/919] displayio: swap colors in palettes too .. change the in-rom palette to be in RGB565 order --- shared-module/displayio/Palette.c | 7 ++++++- supervisor/shared/display.c | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index 3bce86f484..1ef03aab44 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -83,7 +83,12 @@ bool displayio_palette_get_color(displayio_palette_t *self, const _displayio_col } else if (colorspace->grayscale) { *color = self->colors[palette_index].luma >> (8 - colorspace->depth); } else { - *color = self->colors[palette_index].rgb565; + uint16_t packed = self->colors[palette_index].rgb565; + if (colorspace->reverse_bytes_in_word) { + // swap bytes + packed = __builtin_bswap16(packed); + } + *color = packed; } return true; diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index cdf710d268..95926bc9c0 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -169,28 +169,28 @@ _displayio_color_t blinka_colors[7] = { }, { .rgb888 = 0x8428bc, - .rgb565 = 0x7889, + .rgb565 = 0x8978, .luma = 0xff, // We cheat the luma here. It is actually 0x60 .hue = 184, .chroma = 148 }, { .rgb888 = 0xff89bc, - .rgb565 = 0xB8FC, + .rgb565 = 0xFCB8, .luma = 0xb5, .hue = 222, .chroma = 118 }, { .rgb888 = 0x7beffe, - .rgb565 = 0x9F86, + .rgb565 = 0x869F, .luma = 0xe0, .hue = 124, .chroma = 131 }, { .rgb888 = 0x51395f, - .rgb565 = 0x0D5A, + .rgb565 = 0x5A0D, .luma = 0x47, .hue = 185, .chroma = 38 @@ -203,7 +203,7 @@ _displayio_color_t blinka_colors[7] = { }, { .rgb888 = 0x0736a0, - .rgb565 = 0xf501, + .rgb565 = 0x01f5, .luma = 0x44, .hue = 147, .chroma = 153 From 3c018bf7fd8142132bdd063a9c898188c825b2a7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 14 Apr 2020 18:25:21 -0500 Subject: [PATCH 244/919] make translate --- locale/ID.po | 64 +++++++++++++++++++++++++++++++++++----- locale/circuitpython.pot | 64 +++++++++++++++++++++++++++++++++++----- locale/de_DE.po | 64 +++++++++++++++++++++++++++++++++++----- locale/en_US.po | 64 +++++++++++++++++++++++++++++++++++----- locale/en_x_pirate.po | 64 +++++++++++++++++++++++++++++++++++----- locale/es.po | 64 +++++++++++++++++++++++++++++++++++----- locale/fil.po | 64 +++++++++++++++++++++++++++++++++++----- locale/fr.po | 64 +++++++++++++++++++++++++++++++++++----- locale/it_IT.po | 64 +++++++++++++++++++++++++++++++++++----- locale/ko.po | 64 +++++++++++++++++++++++++++++++++++----- locale/pl.po | 64 +++++++++++++++++++++++++++++++++++----- locale/pt_BR.po | 64 +++++++++++++++++++++++++++++++++++----- locale/zh_Latn_pinyin.po | 64 +++++++++++++++++++++++++++++++++++----- 13 files changed, 728 insertions(+), 104 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ab8aa844c8..5715f446f5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,6 +53,11 @@ msgstr "output:\n" msgid "%%c requires int or char" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -283,7 +288,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -323,6 +328,10 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -340,6 +349,7 @@ msgstr "" "menjalankannya atau masuk ke REPL untukmenonaktifkan.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -355,7 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "Kedua pin harus mendukung hardware interrut" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -364,6 +376,7 @@ msgid "Brightness must be between 0 and 255" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -378,10 +391,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -641,11 +656,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -763,6 +780,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -851,7 +869,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "" @@ -906,7 +924,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Pin tidak valid" @@ -1021,6 +1039,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1104,6 +1127,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1180,6 +1207,14 @@ msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" @@ -1198,6 +1233,11 @@ msgstr "" "Tekan tombol apa saja untuk masuk ke dalam REPL. Gunakan CTRL+D untuk reset " "(Reload)" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1392,13 +1432,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2779,6 +2817,16 @@ msgstr "anotasi return harus sebuah identifier" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a421b4ef18..a679a0b6e2 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,6 +53,11 @@ msgstr "" msgid "%%c requires int or char" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -281,7 +286,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -321,6 +326,10 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -336,6 +345,7 @@ msgid "" msgstr "" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -351,7 +361,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -360,6 +372,7 @@ msgid "Brightness must be between 0 and 255" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -374,10 +387,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -630,11 +645,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -752,6 +769,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -840,7 +858,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "" @@ -895,7 +913,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "" @@ -1010,6 +1028,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1093,6 +1116,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1168,6 +1195,14 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1184,6 +1219,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1376,13 +1416,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2754,6 +2792,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ec343d7f20..9c65306058 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -55,6 +55,11 @@ msgstr " Ausgabe:\n" msgid "%%c requires int or char" msgstr "%%c erwartet int oder char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in Benutzung" @@ -283,7 +288,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -323,6 +328,10 @@ msgstr "Array muss Halbwörter enthalten (type 'H')" msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -340,6 +349,7 @@ msgstr "" "auszuführen oder verbinde dich mit der REPL zum Deaktivieren.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "Unterhalb der minimalen Frame Rate" @@ -355,7 +365,9 @@ msgstr "Bit depth muss ein Vielfaches von 8 sein." msgid "Both pins must support hardware interrupts" msgstr "Beide pins müssen Hardware Interrupts unterstützen" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "Die Helligkeit muss zwischen 0 und 1.0 liegen" @@ -364,6 +376,7 @@ msgid "Brightness must be between 0 and 255" msgstr "Die Helligkeit muss zwischen 0 und 255 liegen" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "Die Helligkeit ist nicht einstellbar" @@ -378,10 +391,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Der Puffer ist kein Byte-Array" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Der Puffer ist zu klein" @@ -634,11 +649,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "Display muss einen 16 Bit Farbraum haben." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "Die Rotation der Anzeige muss in 90-Grad-Schritten erfolgen" @@ -758,6 +775,7 @@ msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Gruppe schon benutzt" @@ -848,7 +866,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -903,7 +921,7 @@ msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Ungültiger Pin" @@ -1019,6 +1037,11 @@ msgstr "Muss eine %q Unterklasse sein." msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1102,6 +1125,10 @@ msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1183,6 +1210,14 @@ msgstr "Pin hat keine ADC Funktionalität" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" @@ -1201,6 +1236,11 @@ msgstr "" "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " "laden" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -1395,13 +1435,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Zu viele displays" @@ -2792,6 +2830,16 @@ msgstr "return annotation muss ein identifier sein" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index a28fc10302..b753d40a7d 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -53,6 +53,11 @@ msgstr "" msgid "%%c requires int or char" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -281,7 +286,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -321,6 +326,10 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -336,6 +345,7 @@ msgid "" msgstr "" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -351,7 +361,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -360,6 +372,7 @@ msgid "Brightness must be between 0 and 255" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -374,10 +387,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -630,11 +645,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -752,6 +769,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -840,7 +858,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "" @@ -895,7 +913,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "" @@ -1010,6 +1028,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1093,6 +1116,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1168,6 +1195,14 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1184,6 +1219,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1376,13 +1416,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2754,6 +2792,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 946c3af24f..57c6500a20 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -55,6 +55,11 @@ msgstr "" msgid "%%c requires int or char" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -283,7 +288,7 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "" @@ -323,6 +328,10 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -340,6 +349,7 @@ msgstr "" "t' the REPL t' scuttle.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -355,7 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -364,6 +376,7 @@ msgid "Brightness must be between 0 and 255" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -378,10 +391,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -634,11 +649,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -756,6 +773,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -844,7 +862,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "" @@ -899,7 +917,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "" @@ -1014,6 +1032,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1097,6 +1120,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1172,6 +1199,14 @@ msgstr "Belay that! Th' Pin be not ADC capable" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1188,6 +1223,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1380,13 +1420,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2758,6 +2796,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/es.po b/locale/es.po index f3f6c45914..b1cfbad702 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -55,6 +55,11 @@ msgstr " salida:\n" msgid "%%c requires int or char" msgstr "%%c requiere int o char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q está siendo utilizado" @@ -285,7 +290,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -325,6 +330,10 @@ msgstr "Array debe contener media palabra (type 'H')" msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -342,6 +351,7 @@ msgstr "" "ejecutarlos o entra al REPL para desabilitarlos.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -357,7 +367,9 @@ msgstr "Bits depth debe ser múltiplo de 8." msgid "Both pins must support hardware interrupts" msgstr "Ambos pines deben soportar interrupciones por hardware" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -366,6 +378,7 @@ msgid "Brightness must be between 0 and 255" msgstr "El brillo debe estar entro 0 y 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "El brillo no se puede ajustar" @@ -380,10 +393,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -636,11 +651,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "Rotación de display debe ser en incrementos de 90 grados" @@ -758,6 +775,7 @@ msgstr "La función requiere lock" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -848,7 +866,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -903,7 +921,7 @@ msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Pin inválido" @@ -1018,6 +1036,11 @@ msgstr "Debe de ser una subclase de %q" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1101,6 +1124,10 @@ msgstr "No queda espacio en el dispositivo" msgid "No such file/directory" msgstr "No existe el archivo/directorio" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1182,6 +1209,14 @@ msgstr "Pin no tiene capacidad ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1200,6 +1235,11 @@ msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." @@ -1393,13 +1433,11 @@ msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" msgid "Too many channels in sample." msgstr "Demasiados canales en sample." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "Demasiados buses de pantalla" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Muchos displays" @@ -2792,6 +2830,16 @@ msgstr "la anotación de retorno debe ser un identificador" msgid "return expected '%q' but got '%q'" msgstr "retorno esperado '%q' pero se obtuvo '%q'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 44da9b7557..4049cce7d3 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -53,6 +53,11 @@ msgstr " output:\n" msgid "%%c requires int or char" msgstr "%%c nangangailangan ng int o char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q ay ginagamit" @@ -285,7 +290,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -325,6 +330,10 @@ msgstr "May halfwords (type 'H') dapat ang array" msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -342,6 +351,7 @@ msgstr "" "para patakbuhin sila o pasukin ang REPL para i-disable ito.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -357,7 +367,9 @@ msgstr "Bit depth ay dapat multiple ng 8." msgid "Both pins must support hardware interrupts" msgstr "Ang parehong mga pin ay dapat na sumusuporta sa hardware interrupts" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -366,6 +378,7 @@ msgid "Brightness must be between 0 and 255" msgstr "Ang liwanag ay dapat sa gitna ng 0 o 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -380,10 +393,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Mali ang size ng buffer. Dapat %d bytes." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -642,11 +657,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -766,6 +783,7 @@ msgstr "Function nangangailangan ng lock" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -856,7 +874,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Maling argumento" @@ -911,7 +929,7 @@ msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Mali ang pin" @@ -1026,6 +1044,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1109,6 +1132,10 @@ msgstr "" msgid "No such file/directory" msgstr "Walang file/directory" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1188,6 +1215,14 @@ msgstr "Ang pin ay walang kakayahan sa ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" @@ -1206,6 +1241,11 @@ msgstr "" "Pindutin ang anumang key upang pumasok sa REPL. Gamitin ang CTRL-D upang i-" "reload." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." @@ -1399,13 +1439,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2806,6 +2844,16 @@ msgstr "return annotation ay dapat na identifier" msgid "return expected '%q' but got '%q'" msgstr "return umasa ng '%q' pero ang nakuha ay ‘%q’" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 17746f41fd..54f4d06450 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -55,6 +55,11 @@ msgstr " sortie:\n" msgid "%%c requires int or char" msgstr "%%c nécessite un entier 'int' ou un caractère 'char'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q utilisé" @@ -288,7 +293,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -329,6 +334,10 @@ msgstr "Le tableau doit contenir des demi-mots (type 'H')" msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -346,6 +355,7 @@ msgstr "" "lancer ou entrez sur REPL pour le désactiver.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -361,7 +371,9 @@ msgstr "La profondeur de bit doit être un multiple de 8." msgid "Both pins must support hardware interrupts" msgstr "Les deux entrées doivent supporter les interruptions matérielles" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -370,6 +382,7 @@ msgid "Brightness must be between 0 and 255" msgstr "La luminosité doit être entre 0 et 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "Luminosité non-ajustable" @@ -384,10 +397,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Tampon de taille incorrect. Devrait être de %d octets." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -645,11 +660,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "La rotation d'affichage doit se faire par incréments de 90 degrés" @@ -769,6 +786,7 @@ msgstr "La fonction nécessite un verrou" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -860,7 +878,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Argument invalide" @@ -917,7 +935,7 @@ msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Broche invalide" @@ -1033,6 +1051,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1116,6 +1139,10 @@ msgstr "Il n'y a plus d'espace libre sur le périphérique" msgid "No such file/directory" msgstr "Fichier/dossier introuvable" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1202,6 +1229,14 @@ msgstr "La broche ne peut être utilisée pour l'ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1219,6 +1254,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." @@ -1414,13 +1454,11 @@ msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "Trop de bus d'affichage" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Trop d'affichages" @@ -2838,6 +2876,16 @@ msgstr "l'annotation de return doit être un identifiant" msgid "return expected '%q' but got '%q'" msgstr "return attendait '%q' mais a reçu '%q'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 1717f20f95..5111c3eef6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -53,6 +53,11 @@ msgstr " output:\n" msgid "%%c requires int or char" msgstr "%%c necessita di int o char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in uso" @@ -284,7 +289,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -324,6 +329,10 @@ msgstr "Array deve avere mezzoparole (typo 'H')" msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -341,6 +350,7 @@ msgstr "" "per disabilitarlo.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -357,7 +367,9 @@ msgstr "La profondità di bit deve essere multipla di 8." msgid "Both pins must support hardware interrupts" msgstr "Entrambi i pin devono supportare gli interrupt hardware" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -366,6 +378,7 @@ msgid "Brightness must be between 0 and 255" msgstr "La luminosità deve essere compreso tra 0 e 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "Illiminazione non è regolabile" @@ -380,10 +393,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -642,11 +657,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -766,6 +783,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -856,7 +874,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -913,7 +931,7 @@ msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Pin non valido" @@ -1030,6 +1048,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1113,6 +1136,10 @@ msgstr "Non che spazio sul dispositivo" msgid "No such file/directory" msgstr "Nessun file/directory esistente" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1197,6 +1224,14 @@ msgstr "Il pin non ha capacità di ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1215,6 +1250,11 @@ msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Premi un qualunque tasto per entrare nel REPL. Usa CTRL-D per ricaricare." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1410,13 +1450,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Troppi schermi" @@ -2813,6 +2851,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "return aspettava '%q' ma ha ottenuto '%q'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 9a1770f33b..6fb1789551 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -55,6 +55,11 @@ msgstr " 산출:\n" msgid "%%c requires int or char" msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q 사용 중입니다" @@ -283,7 +288,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -323,6 +328,10 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -340,6 +349,7 @@ msgstr "" "성화하려면 REPL을 입력하십시오.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -355,7 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -364,6 +376,7 @@ msgid "Brightness must be between 0 and 255" msgstr "밝기는 0에서 255 사이 여야합니다" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "밝기를 조절할 수 없습니다" @@ -378,10 +391,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -634,11 +649,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -756,6 +773,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -844,7 +862,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "" @@ -899,7 +917,7 @@ msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "핀이 잘못되었습니다" @@ -1014,6 +1032,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1097,6 +1120,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1172,6 +1199,14 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "" @@ -1188,6 +1223,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1380,13 +1420,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2759,6 +2797,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index d26dff9416..49442ceb1c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -54,6 +54,11 @@ msgstr " wyjście:\n" msgid "%%c requires int or char" msgstr "%%c wymaga int lub char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q w użyciu" @@ -282,7 +287,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -322,6 +327,10 @@ msgstr "Tablica musi zawierać pół-słowa (typ 'H')" msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -339,6 +348,7 @@ msgstr "" "uruchomić, albo wejdź w konsolę aby wyłączyć.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -354,7 +364,9 @@ msgstr "Głębia musi być wielokrotnością 8." msgid "Both pins must support hardware interrupts" msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -363,6 +375,7 @@ msgid "Brightness must be between 0 and 255" msgstr "Jasność musi być pomiędzy 0 a 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "Jasność nie jest regulowana" @@ -377,10 +390,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Zła wielkość bufora. Powinno być %d bajtów." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -633,11 +648,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "Wyświetlacz można obracać co 90 stopni" @@ -755,6 +772,7 @@ msgstr "Funkcja wymaga blokady" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -845,7 +863,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Zły argument" @@ -900,7 +918,7 @@ msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Zła nóżka" @@ -1015,6 +1033,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1098,6 +1121,10 @@ msgstr "Brak miejsca" msgid "No such file/directory" msgstr "Brak pliku/katalogu" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1173,6 +1200,14 @@ msgstr "Nóżka nie obsługuje ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" @@ -1189,6 +1224,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." @@ -1381,13 +1421,11 @@ msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "Zbyt wiele magistrali" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Zbyt wiele wyświetlaczy" @@ -2764,6 +2802,16 @@ msgstr "anotacja wartości musi być identyfikatorem" msgid "return expected '%q' but got '%q'" msgstr "return oczekiwał '%q', a jest '%q'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 153dadd910..197d57d02b 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -53,6 +53,11 @@ msgstr " saída:\n" msgid "%%c requires int or char" msgstr "%%c requer int ou char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q em uso" @@ -284,7 +289,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -324,6 +329,10 @@ msgstr "Array deve conter meias palavras (tipo 'H')" msgid "Array values should be single bytes." msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" @@ -339,6 +348,7 @@ msgid "" msgstr "" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "" @@ -354,7 +364,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "Ambos os pinos devem suportar interrupções de hardware" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "" @@ -363,6 +375,7 @@ msgid "Brightness must be between 0 and 255" msgstr "O brilho deve estar entre 0 e 255" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "" @@ -377,10 +390,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "" @@ -637,11 +652,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -761,6 +778,7 @@ msgstr "" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "" @@ -849,7 +867,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -906,7 +924,7 @@ msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Pino inválido" @@ -1022,6 +1040,11 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1105,6 +1128,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "" @@ -1183,6 +1210,14 @@ msgstr "O pino não tem recursos de ADC" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c #, fuzzy msgid "Plus any modules on the filesystem\n" @@ -1200,6 +1235,11 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -1393,13 +1433,11 @@ msgstr "" msgid "Too many channels in sample." msgstr "Muitos canais na amostra." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "" @@ -2776,6 +2814,16 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d1c0d5b79c..457e35b625 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-13 19:22-0500\n" +"POT-Creation-Date: 2020-04-14 18:26-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -60,6 +60,11 @@ msgstr " shūchū:\n" msgid "%%c requires int or char" msgstr "%%c xūyào zhěngshù huò char" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q zhèngzài shǐyòng" @@ -288,7 +293,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: ports/nrf/peripherals/nrf/timers.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -328,6 +333,10 @@ msgstr "Shùzǔ bìxū bāohán bàn zìshù (type 'H')" msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." +#: shared-bindings/_protomatter/Protomatter.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī." @@ -345,6 +354,7 @@ msgstr "" "huò shūrù REPL jìnyòng.\n" #: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" msgstr "Dī yú zuìdī zhèng sùlǜ" @@ -360,7 +370,9 @@ msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." msgid "Both pins must support hardware interrupts" msgstr "Liǎng gè yǐn jiǎo dōu bìxū zhīchí yìngjiàn zhōngduàn" +#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness must be 0-1.0" msgstr "Liàngdù bìxū wèi 0-1.0" @@ -369,6 +381,7 @@ msgid "Brightness must be between 0 and 255" msgstr "Liàngdù bìxū jiè yú 0 dào 255 zhī jiān" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" msgstr "Liàngdù wúfǎ tiáozhěng" @@ -383,10 +396,12 @@ msgid "Buffer incorrect size. Should be %d bytes." msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Huǎnchōng qū bùshì bytearray" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" msgstr "Huǎnchōng qū tài xiǎo" @@ -641,11 +656,13 @@ msgid "DigitalInOut not supported on given pin" msgstr "Gěi dìng de yǐn jiǎo bù zhīchí DigitalInOut" #: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." msgstr "Xiǎnshì bìxū jùyǒu 16 wèi yánsè kōngjiān." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "Xiǎnshì xuánzhuǎn bìxū 90 dù jiā xīn" @@ -763,6 +780,7 @@ msgstr "Hánshù xūyào suǒdìng" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" msgstr "Jítuán yǐjīng shǐyòngguò" @@ -853,7 +871,7 @@ msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" -#: py/moduerrno.c +#: py/moduerrno.c shared-module/_protomatter/Protomatter.c msgid "Invalid argument" msgstr "Wúxiào de cānshù" @@ -908,7 +926,7 @@ msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c msgid "Invalid pin" msgstr "Wúxiào de yǐn jiǎo" @@ -1023,6 +1041,11 @@ msgstr "Bìxū shì %q zi lèi." msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + #: py/parse.c msgid "Name too long" msgstr "" @@ -1106,6 +1129,10 @@ msgstr "Shèbèi shàng méiyǒu kònggé" msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" +#: shared-module/_protomatter/Protomatter.c +msgid "No timer available" +msgstr "" + #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." msgstr "Nordic ruǎn shèbèi gùzhàng shēngmíng." @@ -1187,6 +1214,14 @@ msgstr "Pin méiyǒu ADC nénglì" msgid "Pin number already reserved by EXTI" msgstr "" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" @@ -1203,6 +1238,11 @@ msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài." +#: shared-module/_protomatter/Protomatter.c +#, c-format +msgid "Protomatter internal error #%d" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." @@ -1402,13 +1442,11 @@ msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-module/displayio/__init__.c msgid "Too many display busses" msgstr "Xiǎnshì zǒngxiàn tài duōle" -#: shared-bindings/displayio/Display.c -#: shared-bindings/displayio/EPaperDisplay.c +#: shared-module/displayio/__init__.c msgid "Too many displays" msgstr "Xiǎnshì tài duō" @@ -2793,6 +2831,16 @@ msgstr "fǎnhuí zhùshì bìxū shì biāozhì fú" msgid "return expected '%q' but got '%q'" msgstr "fǎnhuí yùqí de '%q' dàn huòdéle '%q'" +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/_protomatter/Protomatter.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" msgstr "" From ebd98bfc7b317bf28ebaccd8daf63c0d65087ea4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 14 Apr 2020 16:50:08 -0700 Subject: [PATCH 245/919] Update to the Adafruit Community Code of Conduct It better reflects our standards and also addresses chats. History of how it evolved from the Contributor Covenant is here: https://github.com/adafruit/Adafruit_Community_Code_of_Conduct/commits/master --- CODE_OF_CONDUCT.md | 127 ++++++++++++++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 36 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1617586f3a..134d51026a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,74 +1,129 @@ -# Contributor Covenant Code of Conduct +# Adafruit Community Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and +contributors and leaders pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +size, disability, ethnicity, gender identity and expression, level or type of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. ## Our Standards +We are committed to providing a friendly, safe and welcoming environment for +all. + Examples of behavior that contributes to creating a positive environment include: +* Be kind and courteous to others * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences +* Collaborating with other community members * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or -advances +* The use of sexualized language or imagery and sexual attention or advances +* The use of inappropriate images, including in a community member's avatar +* The use of inappropriate language, including in a community member's nickname +* Any spamming, flaming, baiting or other attention-stealing behavior +* Excessive or unwelcome helping; answering outside the scope of the question + asked * Trolling, insulting/derogatory comments, and personal or political attacks +* Promoting or spreading disinformation, lies, or conspiracy theories against + a person, group, organisation, project, or community * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +* Other conduct which could reasonably be considered inappropriate + +The goal of the standards and moderation guidelines outlined here is to build +and maintain a respectful community. We ask that you don’t just aim to be +"technically unimpeachable", but rather try to be your best self. + +We value many things beyond technical expertise, including collaboration and +supporting others within our community. Providing a positive experience for +other community members can have a much more significant impact than simply +providing the correct answer. ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable +Project leaders are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions +Project leaders have the right and responsibility to remove, edit, or +reject messages, comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +permanently any community member for other behaviors that they deem +inappropriate, threatening, offensive, or harmful. + +## Moderation + +Instances of behaviors that violate the Adafruit Community Code of Conduct +may be reported by any member of the community. Community members are +encouraged to report these situations, including situations they witness +involving other community members. + +You may report in the following ways: + +In any situation, you may send an email to . + +On the Adafruit Discord, you may send an open message from any channel +to all Community Moderators by tagging @community moderators. You may +also send an open message from any channel, or a direct message to +@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442, +@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. + +Email and direct message reports will be kept confidential. + +In situations on Discord where the issue is particularly egregious, possibly +illegal, requires immediate action, or violates the Discord terms of service, +you should also report the message directly to Discord. + +These are the steps for upholding our community’s standards of conduct. + +1. Any member of the community may report any situation that violates the +Adafruit Community Code of Conduct. All reports will be reviewed and +investigated. +2. If the behavior is an egregious violation, the community member who +committed the violation may be banned immediately, without warning. +3. Otherwise, moderators will first respond to such behavior with a warning. +4. Moderators follow a soft "three strikes" policy - the community member may +be given another chance, if they are receptive to the warning and change their +behavior. +5. If the community member is unreceptive or unreasonable when warned by a +moderator, or the warning goes unheeded, they may be banned for a first or +second offense. Repeated offenses will result in the community member being +banned. ## Scope +This Code of Conduct and the enforcement policies listed above apply to all +Adafruit Community venues. This includes but is not limited to any community +spaces (both public and private), the entire Adafruit Discord server, and +Adafruit GitHub repositories. Examples of Adafruit Community spaces include +but are not limited to meet-ups, audio chats on the Adafruit Discord, or +interaction at a conference. + This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at support@adafruit.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +when an individual is representing the project or its community. As a community +member, you are representing our community, and are expected to behave +accordingly. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +, +and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +For other projects adopting the Adafruit Community Code of +Conduct, please contact the maintainers of those projects for enforcement. +If you wish to use this code of conduct for your own project, consider +explicitly mentioning your moderation policy or making a copy with your +own moderation policy so as to avoid confusion. From 11d6e177c091eb478aad595ae37f13f890ca6ead Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 14 Apr 2020 19:56:36 -0400 Subject: [PATCH 246/919] Fix my discord username --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 134d51026a..7eb8d93eae 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -76,7 +76,7 @@ In any situation, you may send an email to . On the Adafruit Discord, you may send an open message from any channel to all Community Moderators by tagging @community moderators. You may also send an open message from any channel, or a direct message to -@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442, +@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, @sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. Email and direct message reports will be kept confidential. From 7dfcae6067ee07ad644278a66aaa114759b181a8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 14 Apr 2020 17:09:48 -0700 Subject: [PATCH 247/919] Tweaks from jepler --- ports/stm/common-hal/pulseio/PulseIn.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 2536ae73bd..227d77a08e 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -79,12 +79,9 @@ static void pulsein_handler(uint8_t num) { self->first_edge = false; } } else { - uint32_t total_diff = current_count + 0xffff * (current_overflow - self->last_overflow) - self->last_count; + uint32_t total_diff = current_count + 0x10000 * (current_overflow - self->last_overflow) - self->last_count; // Cap duration at 16 bits. - uint16_t duration = 0xffff; - if (total_diff < duration) { - duration = total_diff; - } + uint16_t duration = MIN(0xffff, total_diff); uint16_t i = (self->start + self->len) % self->maxlen; self->buffer[i] = duration; From 6427994b146ff25e8bc7565031d90ab6d6744157 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 15 Apr 2020 10:18:09 -0400 Subject: [PATCH 248/919] Implement requested changes --- ports/stm/Makefile | 2 -- ports/stm/supervisor/internal_flash.c | 1 - ports/stm/supervisor/port.c | 28 +-------------------------- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index dc32f6c7a8..765f062fea 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -137,8 +137,6 @@ endif LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc -LDFLAGS += -mthumb $(MCU_FLAGS_$(MCU_SERIES)) - # Use toolchain libm if we're not using our own. ifndef INTERNAL_LIBM LIBS += -lm diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index df4e97d8e1..8c04112c01 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -202,7 +202,6 @@ void supervisor_flash_flush(void) { #if defined(STM32H7) for (uint32_t i = 0; i < (sector_size / 32); i++) { // Note that the STM32H7 HAL interface differs by taking an address, not 64 bit data - // This is because ST's code is written by a large room of chimpanzees if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, sector_start_addr, (uint32_t)cache_addr) != HAL_OK) { // error occurred during flash write diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 81a12d6c4b..639abeb186 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -89,22 +89,6 @@ __attribute__((used, naked)) void Reset_Handler(void) { __disable_irq(); __set_MSP((uint32_t) &_ld_stack_top); - // TODO: Is any of this commented stuff actually required? - - /* Disable I cache and D cache */ - // SCB_DisableICache(); - // SCB_DisableDCache(); // this causes an instant hardfault if used - - // #if ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) - // SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2)); /* set CP10, CP11 Full Access */ - // #endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */ - - // /* Disable Systick which might be enabled by bootrom */ - // if (SysTick->CTRL & SysTick_CTRL_ENABLE_Msk) - // { - // SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; - // } - /* Disable MPU */ ARM_MPU_Disable(); @@ -117,7 +101,6 @@ __attribute__((used, naked)) void Reset_Handler(void) { // The first number in RBAR is the region number. When searching for a policy, the region with // the highest number wins. If none match, then the default policy set at enable applies. - // TODO: do I need to subdivide this up? // Mark all the flash the same until instructed otherwise. MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); @@ -135,14 +118,9 @@ __attribute__((used, naked)) void Reset_Handler(void) { MPU->RBAR = ARM_MPU_RBAR(15, 0x24000000U); MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); - // TODO: what is the mask here doing? /* Enable MPU */ ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); - // We're done mucking with memory so enable I cache and D cache - // SCB_EnableDCache(); - // SCB_EnableICache(); - // Copy all of the data to run from DTCM. for (uint32_t i = 0; i < ((size_t) &_ld_dtcm_data_size) / 4; i++) { (&_ld_dtcm_data_destination)[i] = (&_ld_dtcm_data_flash_copy)[i]; @@ -226,8 +204,8 @@ uint32_t *port_stack_get_top(void) { return &_ld_stack_top; } -// TODO: what even are these extern uint32_t _ebss; + // Place the word to save just after our BSS section that gets blanked. void port_set_saved_word(uint32_t value) { _ebss = value; @@ -239,7 +217,6 @@ uint32_t port_get_saved_word(void) { __attribute__((used)) void MemManage_Handler(void) { - __ASM volatile ("bkpt"); reset_into_safe_mode(MEM_MANAGE); while (true) { asm("nop;"); @@ -248,7 +225,6 @@ __attribute__((used)) void MemManage_Handler(void) __attribute__((used)) void BusFault_Handler(void) { - __ASM volatile ("bkpt"); reset_into_safe_mode(MEM_MANAGE); while (true) { asm("nop;"); @@ -257,7 +233,6 @@ __attribute__((used)) void BusFault_Handler(void) __attribute__((used)) void UsageFault_Handler(void) { - __ASM volatile ("bkpt"); reset_into_safe_mode(MEM_MANAGE); while (true) { asm("nop;"); @@ -266,7 +241,6 @@ __attribute__((used)) void UsageFault_Handler(void) __attribute__((used)) void HardFault_Handler(void) { - __ASM volatile ("bkpt"); reset_into_safe_mode(HARD_CRASH); while (true) { asm("nop;"); From 0f87a75f4f0675ff55e31437907101226d5fb66b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 15 Apr 2020 10:24:51 -0400 Subject: [PATCH 249/919] translations --- locale/ID.po | 4 +++- locale/circuitpython.pot | 4 +++- locale/de_DE.po | 4 +++- locale/en_US.po | 4 +++- locale/en_x_pirate.po | 4 +++- locale/es.po | 4 +++- locale/fil.po | 4 +++- locale/fr.po | 4 +++- locale/it_IT.po | 4 +++- locale/ko.po | 4 +++- locale/pl.po | 4 +++- locale/pt_BR.po | 4 +++- locale/zh_Latn_pinyin.po | 4 +++- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index de158c568a..4a628aad42 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -900,6 +900,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -931,6 +932,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7e9b3aadf2..6da3148b73 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -889,6 +889,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +921,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 709a34ed57..55d20e47ce 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -897,6 +897,7 @@ msgid "Invalid number of bits" msgstr "Ungültige Anzahl von Bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Ungültige Phase" @@ -928,6 +929,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Ungültige Polarität" diff --git a/locale/en_US.po b/locale/en_US.po index d516d41d9b..ee4bff32b0 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -889,6 +889,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -920,6 +921,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e3f02c246f..3b9d9f46c5 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -893,6 +893,7 @@ msgid "Invalid number of bits" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "" @@ -924,6 +925,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/es.po b/locale/es.po index 115fc8037e..be4e1b0367 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -897,6 +897,7 @@ msgid "Invalid number of bits" msgstr "Numero inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase inválida" @@ -928,6 +929,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polaridad inválida" diff --git a/locale/fil.po b/locale/fil.po index da2bc9459e..1fda3d0e3b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -905,6 +905,7 @@ msgid "Invalid number of bits" msgstr "Mali ang bilang ng bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Mali ang phase" @@ -936,6 +937,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Mali ang polarity" diff --git a/locale/fr.po b/locale/fr.po index 100fc2b9c2..0ab6582d3a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -911,6 +911,7 @@ msgid "Invalid number of bits" msgstr "Nombre de bits invalide" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Phase invalide" @@ -942,6 +943,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarité invalide" diff --git a/locale/it_IT.po b/locale/it_IT.po index 8b868f83fa..6060f26d30 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -907,6 +907,7 @@ msgid "Invalid number of bits" msgstr "Numero di bit non valido" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase non valida" @@ -938,6 +939,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Polarità non valida" diff --git a/locale/ko.po b/locale/ko.po index 5cc2bcf3a6..46c4af2269 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -893,6 +893,7 @@ msgid "Invalid number of bits" msgstr "비트 수가 유효하지 않습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "단계가 잘못되었습니다" @@ -924,6 +925,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 659d633013..a590761804 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -894,6 +894,7 @@ msgid "Invalid number of bits" msgstr "Zła liczba bitów" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Zła faza" @@ -925,6 +926,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Zła polaryzacja" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 511f0a5bb6..01024c23bd 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -900,6 +900,7 @@ msgid "Invalid number of bits" msgstr "Número inválido de bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Fase Inválida" @@ -931,6 +932,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2319bf4d7d..9305817461 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-01 12:29-0400\n" +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -902,6 +902,7 @@ msgid "Invalid number of bits" msgstr "Wèi shù wúxiào" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid phase" msgstr "Jiēduàn wúxiào" @@ -933,6 +934,7 @@ msgid "Invalid pins for PWMOut" msgstr "" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" msgstr "Wúxiào liǎng jí zhí" From a1451aae51305dd9e1f5b25bd56751bdee0b0b88 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 15 Apr 2020 11:32:50 -0400 Subject: [PATCH 250/919] Correct submodule desync --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index a91b36986d..a746bd8e09 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit a91b36986d81fd906a6232010778f2a93d690f8e +Subproject commit a746bd8e0953853056ee405e2fa02c8ebca4fb79 From 00b2e6a1db38dee707a2a8e71a1055748e7001a7 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 15 Apr 2020 12:25:13 -0400 Subject: [PATCH 251/919] Fix korea translation error, minor submodule change --- locale/circuitpython.pot | 2 +- locale/ko.po | 2 +- ports/atmel-samd/peripherals | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 73818046dc..e9e7838cbb 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-15 12:24-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/ko.po b/locale/ko.po index 7adc2b7a3c..d232133e2a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n +"POT-Creation-Date: 2020-04-15 10:24-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index b89811f22a..f528240c2a 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit b89811f22a24ac350079ceaf0cdf0e62aa03f4f4 +Subproject commit f528240c2a4c2d7a39de786f1aa56895c12227b4 From f39ca6052e4fd33e3ea1d879c80e11f643d0834a Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Wed, 15 Apr 2020 23:41:38 +0200 Subject: [PATCH 252/919] Fix RGB/BGR colors in Stage This makes the colors used by the stage library compatible with those used by the displayio library. --- frozen/circuitpython-stage | 2 +- ports/atmel-samd/boards/pewpew_m4/board.c | 2 +- ports/atmel-samd/boards/ugame10/board.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 19a66d79f0..e2a318085b 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 19a66d79f0650a15e502464b42e16692365eab36 +Subproject commit e2a318085bad99d5eb83e3b04fb15474456b17e4 diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index cf8439cf0e..0e28fe4fc1 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -79,7 +79,7 @@ uint8_t display_init_sequence[] = { 0xc4, 2, 0x8a, 0xee, 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF - 0x36, 1, 0xa8, // _MADCTL + 0x36, 1, 0xa0, // _MADCTL // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 38661950f4..04a4c7addf 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = { 0xc4, 2, 0x8a, 0xee, 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF - 0x36, 1, 0xa0, // _MADCTL bottom to top refresh + 0x36, 1, 0xa8, // _MADCTL bottom to top refresh // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color From 6885ffc9afd8b5558bf301e2ade6c8a89abf6bf3 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 14 Apr 2020 11:07:53 +0800 Subject: [PATCH 253/919] litex: mphalport: add fake mp_hal_delay_us Add a mp_hal_delay_us, which is required by some of the modules, that simply calls mp_hal_delay_ms / 1000. Signed-off-by: Sean Cross --- ports/litex/mphalport.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 005a65aac4..0b8f012985 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -60,6 +60,10 @@ void mp_hal_delay_ms(mp_uint_t delay) { } } +void mp_hal_delay_us(mp_uint_t delay) { + mp_hal_delay_ms(delay / 1000); +} + extern void SysTick_Handler(void); __attribute__((section(".ramtext"))) From db3933429a700aac95f58b83f7538ea8d896316d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 14 Apr 2020 11:11:09 +0800 Subject: [PATCH 254/919] litex: add os module Signed-off-by: Sean Cross --- ports/litex/common-hal/os/__init__.c | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 ports/litex/common-hal/os/__init__.c diff --git a/ports/litex/common-hal/os/__init__.c b/ports/litex/common-hal/os/__init__.c new file mode 100644 index 0000000000..219be930f1 --- /dev/null +++ b/ports/litex/common-hal/os/__init__.c @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "genhdr/mpversion.h" +#include "py/mpconfig.h" +#include "py/objstr.h" +#include "py/objtuple.h" +#include "py/qstr.h" + +STATIC const qstr os_uname_info_fields[] = { + MP_QSTR_sysname, MP_QSTR_nodename, + MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine +}; +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "litex"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "litex"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); + + +STATIC MP_DEFINE_ATTRTUPLE( + os_uname_info_obj, + os_uname_info_fields, + 5, + (mp_obj_t)&os_uname_info_sysname_obj, + (mp_obj_t)&os_uname_info_nodename_obj, + (mp_obj_t)&os_uname_info_release_obj, + (mp_obj_t)&os_uname_info_version_obj, + (mp_obj_t)&os_uname_info_machine_obj +); + +mp_obj_t common_hal_os_uname(void) { + return (mp_obj_t)&os_uname_info_obj; +} + +bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { + return false; +} From bb527ac9ea8407ed2aa4b51fb665c8ad7fb89476 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 14 Apr 2020 11:06:32 +0800 Subject: [PATCH 255/919] litex: disable minimal build Manually specify available modules and disable any modules that are currently unsupported on the litex target. Signed-off-by: Sean Cross --- ports/litex/mpconfigport.mk | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 47e2b1abc8..0a82f41619 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -12,20 +12,20 @@ USB_SERIAL_NUMBER_LENGTH = 30 # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ -#Reduced feature set for early port -CIRCUITPY_MINIMAL_BUILD = 1 +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BOARD = 0 +CIRCUITPY_BUSIO = 0 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 -# CIRCUITPY_BOARD = 1 -# CIRCUITPY_DIGITALIO = 1 -# CIRCUITPY_ANALOGIO = 1 -# CIRCUITPY_MICROCONTROLLER = 1 -# CIRCUITPY_BUSIO = 1 -# CIRCUITPY_PULSEIO = 1 -# CIRCUITPY_OS = 1 -# CIRCUITPY_STORAGE = 1 -# CIRCUITPY_RANDOM = 1 +# Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 - -#ifeq ($(MCU_SUB_VARIANT), stm32f412zx) -#endif From 61f777c9c613039f2262f9f650f977877b642c66 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 14 Apr 2020 12:55:37 +0800 Subject: [PATCH 256/919] litex: enable binascii and ujson modules Signed-off-by: Sean Cross --- ports/litex/mpconfigport.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/litex/mpconfigport.h b/ports/litex/mpconfigport.h index cfa3eb5c74..fcf9d3b73b 100644 --- a/ports/litex/mpconfigport.h +++ b/ports/litex/mpconfigport.h @@ -28,9 +28,12 @@ #ifndef FPGA_MPCONFIGPORT_H__ #define FPGA_MPCONFIGPORT_H__ -#define MICROPY_PY_UJSON (0) #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #define MICROPY_NLR_THUMB (0) +#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) +#define MICROPY_PY_UBINASCII (1) +#define MICROPY_PY_UJSON (1) #include "py/circuitpy_mpconfig.h" From f7e89879295ce131e6a36d9ab92890d70566a67d Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Thu, 16 Apr 2020 13:56:03 +0200 Subject: [PATCH 257/919] Bump circuitpython-stage to 1.0.11 to fix audio problems Fix #2773 --- frozen/circuitpython-stage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index e2a318085b..0d2c083a2f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit e2a318085bad99d5eb83e3b04fb15474456b17e4 +Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae From b3552efc760e1a4d789153f7435e1039b1031959 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 Apr 2020 11:28:01 -0700 Subject: [PATCH 258/919] Remove accidental file --- ports/atmel-samd/build-steps.txt | 721 ------------------------------- 1 file changed, 721 deletions(-) delete mode 100644 ports/atmel-samd/build-steps.txt diff --git a/ports/atmel-samd/build-steps.txt b/ports/atmel-samd/build-steps.txt deleted file mode 100644 index cfc1aa3899..0000000000 --- a/ports/atmel-samd/build-steps.txt +++ /dev/null @@ -1,721 +0,0 @@ -GEN build-feather_m0_express/genhdr/mpversion.h -GEN autogen_usb_descriptor.intermediate -install -d build-feather_m0_express/genhdr -python3 ../../py/makeversionhdr.py build-feather_m0_express/genhdr/mpversion.h -mkdir -p build-feather_m0_express/asf4/samd21/hpl/rtc -python3 ../../tools/gen_usb_descriptor.py --manufacturer "Adafruit Industries LLC" --product "Feather M0 Express" --vid 0x239A --pid 0x8023 --serial_number_length 32 --interface_name "CircuitPython" --devices "CDC,MSC,AUDIO,HID" --hid_devices "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" --msc_max_packet_size 64 --cdc_ep_num_notification 0 --cdc_ep_num_data_out 0 --cdc_ep_num_data_in 0 --msc_ep_num_out 1 --msc_ep_num_in 0 --hid_ep_num_out 0 --hid_ep_num_in 0 --midi_ep_num_out 0 --midi_ep_num_in 0 --output_c_file build-feather_m0_express/autogen_usb_descriptor.c --output_h_file build-feather_m0_express/genhdr/autogen_usb_descriptor.h -mkdir -p build-feather_m0_express/common-hal/time -msgfmt -o build-feather_m0_express/genhdr/en_US.mo ../../locale/en_US.po -GEN build-feather_m0_express/genhdr/moduledefs.h -python3 ../../py/makemoduledefs.py --vpath="., ../.., " py/mpstate.c py/malloc.c py/gc.c py/gc_long_lived.c py/pystack.c py/qstr.c py/vstr.c py/mpprint.c py/unicode.c py/mpz.c py/reader.c py/lexer.c py/parse.c py/scope.c py/compile.c py/emitcommon.c py/emitbc.c py/asmbase.c py/asmx64.c py/emitnx64.c py/asmx86.c py/emitnx86.c py/asmthumb.c py/emitnthumb.c py/emitinlinethumb.c py/asmarm.c py/emitnarm.c py/asmxtensa.c py/emitnxtensa.c py/emitinlinextensa.c py/formatfloat.c py/parsenumbase.c py/parsenum.c py/emitglue.c py/persistentcode.c py/runtime.c py/runtime_utils.c py/scheduler.c py/nativeglue.c py/stackctrl.c py/argcheck.c py/warning.c py/map.c py/obj.c py/objarray.c py/objattrtuple.c py/objbool.c py/objboundmeth.c py/objcell.c py/objclosure.c py/objcomplex.c py/objdeque.c py/objdict.c py/objenumerate.c py/objexcept.c py/objfilter.c py/objfloat.c py/objfun.c py/objgenerator.c py/objgetitemiter.c py/objint.c py/objint_longlong.c py/objint_mpz.c py/objlist.c py/objmap.c py/objmodule.c py/objobject.c py/objpolyiter.c py/objproperty.c py/objnone.c py/objnamedtuple.c py/objrange.c py/objreversed.c py/objset.c py/objsingleton.c py/objslice.c py/objstr.c py/objstrunicode.c py/objstringio.c py/objtuple.c py/objtype.c py/objzip.c py/opmethods.c py/proto.c py/reload.c py/sequence.c py/stream.c py/binary.c py/builtinimport.c py/builtinevex.c py/builtinhelp.c py/modarray.c py/modbuiltins.c py/modcollections.c py/modgc.c py/modio.c py/modmath.c py/modcmath.c py/modmicropython.c py/modstruct.c py/modsys.c py/moduerrno.c py/modthread.c py/vm.c py/bc.c py/showbc.c py/repl.c py/smallint.c py/frozenmod.c extmod/moductypes.c extmod/modujson.c extmod/modure.c extmod/moduzlib.c extmod/moduheapq.c extmod/modutimeq.c extmod/moduhashlib.c extmod/modubinascii.c extmod/virtpin.c extmod/modussl_axtls.c extmod/modussl_mbedtls.c extmod/modurandom.c extmod/moduselect.c extmod/modwebsocket.c extmod/modwebrepl.c extmod/modframebuf.c extmod/vfs.c extmod/vfs_reader.c extmod/vfs_posix.c extmod/vfs_posix_file.c extmod/vfs_fat.c extmod/vfs_fat_diskio.c extmod/vfs_fat_file.c extmod/utime_mphal.c extmod/uos_dupterm.c lib/embed/abort_.c lib/utils/printf.c build-feather_m0_express/genhdr/moduledefs.h audio_dma.c background.c bindings/samd/Clock.c bindings/samd/__init__.c boards/feather_m0_express/board.c boards/feather_m0_express/pins.c eic_handler.c fatfs_port.c freetouch/adafruit_ptc.c lib/libc/string0.c lib/mp-readline/readline.c lib/oofatfs/ff.c lib/oofatfs/option/ccsbcs.c lib/timeutils/timeutils.c lib/tinyusb/src/portable/microchip/samd/dcd_samd.c lib/utils/buffer_helper.c lib/utils/context_manager_helpers.c lib/utils/interrupt_char.c lib/utils/pyexec.c lib/utils/stdout_helpers.c lib/utils/sys_stdio_mphal.c mphalport.c peripherals/samd/samd21/adc.c peripherals/samd/samd21/cache.c peripherals/samd/samd21/clocks.c peripherals/samd/samd21/dma.c peripherals/samd/samd21/events.c peripherals/samd/samd21/external_interrupts.c peripherals/samd/samd21/pins.c peripherals/samd/samd21/sercom.c peripherals/samd/samd21/timers.c peripherals/samd/clocks.c peripherals/samd/dma.c peripherals/samd/events.c peripherals/samd/external_interrupts.c peripherals/samd/sercom.c peripherals/samd/timers.c reset.c supervisor/shared/memory.c tick.c timer_handler.c peripherals/samd/i2s.c peripherals/samd/samd21/i2s.c main.c supervisor/port.c supervisor/shared/autoreload.c supervisor/shared/board.c supervisor/shared/display.c supervisor/shared/filesystem.c supervisor/shared/flash.c supervisor/shared/micropython.c supervisor/shared/rgb_led_status.c supervisor/shared/safe_mode.c supervisor/shared/stack.c supervisor/shared/status_leds.c supervisor/shared/tick.c supervisor/shared/translate.c supervisor/shared/external_flash/external_flash.c supervisor/shared/external_flash/spi_flash.c lib/tinyusb/src/common/tusb_fifo.c lib/tinyusb/src/device/usbd.c lib/tinyusb/src/device/usbd_control.c lib/tinyusb/src/class/msc/msc_device.c lib/tinyusb/src/class/cdc/cdc_device.c lib/tinyusb/src/class/hid/hid_device.c lib/tinyusb/src/class/midi/midi_device.c lib/tinyusb/src/tusb.c supervisor/shared/serial.c supervisor/usb.c supervisor/shared/usb/usb_desc.c supervisor/shared/usb/usb.c supervisor/shared/usb/usb_msc_flash.c shared-bindings/usb_hid/__init__.c shared-bindings/usb_hid/Device.c shared-bindings/usb_midi/__init__.c shared-bindings/usb_midi/PortIn.c shared-bindings/usb_midi/PortOut.c shared-module/usb_hid/__init__.c shared-module/usb_hid/Device.c shared-module/usb_midi/__init__.c shared-module/usb_midi/PortIn.c shared-module/usb_midi/PortOut.c build-feather_m0_express/autogen_usb_descriptor.c shared-bindings/analogio/AnalogIn.c shared-bindings/analogio/AnalogOut.c shared-bindings/analogio/__init__.c shared-bindings/audiobusio/__init__.c shared-bindings/audiobusio/I2SOut.c shared-bindings/audiobusio/PDMIn.c shared-bindings/audioio/__init__.c shared-bindings/audioio/AudioOut.c shared-bindings/board/__init__.c shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c shared-bindings/busio/UART.c shared-bindings/busio/__init__.c shared-bindings/digitalio/DigitalInOut.c shared-bindings/digitalio/__init__.c shared-bindings/displayio/ParallelBus.c shared-bindings/microcontroller/Pin.c shared-bindings/microcontroller/Processor.c shared-bindings/microcontroller/__init__.c shared-bindings/neopixel_write/__init__.c shared-bindings/nvm/ByteArray.c shared-bindings/nvm/__init__.c shared-bindings/os/__init__.c shared-bindings/pulseio/PWMOut.c shared-bindings/pulseio/PulseIn.c shared-bindings/pulseio/PulseOut.c shared-bindings/pulseio/__init__.c shared-bindings/rotaryio/IncrementalEncoder.c shared-bindings/rotaryio/__init__.c shared-bindings/rtc/RTC.c shared-bindings/rtc/__init__.c shared-bindings/supervisor/Runtime.c shared-bindings/supervisor/__init__.c shared-bindings/time/__init__.c shared-bindings/touchio/TouchIn.c shared-bindings/touchio/__init__.c shared-bindings/digitalio/Direction.c shared-bindings/digitalio/DriveMode.c shared-bindings/digitalio/Pull.c shared-bindings/fontio/Glyph.c shared-bindings/microcontroller/RunMode.c shared-bindings/math/__init__.c shared-bindings/help.c shared-bindings/util.c common-hal/analogio/AnalogIn.c common-hal/analogio/AnalogOut.c common-hal/analogio/__init__.c common-hal/audiobusio/__init__.c common-hal/audiobusio/I2SOut.c common-hal/audiobusio/PDMIn.c common-hal/audioio/__init__.c common-hal/audioio/AudioOut.c common-hal/board/__init__.c common-hal/busio/I2C.c common-hal/busio/SPI.c common-hal/busio/UART.c common-hal/busio/__init__.c common-hal/digitalio/DigitalInOut.c common-hal/digitalio/__init__.c common-hal/displayio/ParallelBus.c common-hal/microcontroller/Pin.c common-hal/microcontroller/Processor.c common-hal/microcontroller/__init__.c common-hal/neopixel_write/__init__.c common-hal/nvm/ByteArray.c common-hal/nvm/__init__.c common-hal/os/__init__.c common-hal/pulseio/PWMOut.c common-hal/pulseio/PulseIn.c common-hal/pulseio/PulseOut.c common-hal/pulseio/__init__.c common-hal/rotaryio/IncrementalEncoder.c common-hal/rotaryio/__init__.c common-hal/rtc/RTC.c common-hal/rtc/__init__.c common-hal/supervisor/Runtime.c common-hal/supervisor/__init__.c common-hal/time/__init__.c common-hal/touchio/TouchIn.c common-hal/touchio/__init__.c shared-bindings/_pixelbuf/PixelBuf.c shared-bindings/_pixelbuf/__init__.c shared-bindings/audioio/__init__.c shared-bindings/audiocore/__init__.c shared-bindings/audiocore/RawSample.c shared-bindings/audiocore/WaveFile.c shared-bindings/bitbangio/OneWire.c shared-bindings/board/__init__.c shared-bindings/busio/OneWire.c shared-bindings/displayio/Bitmap.c shared-bindings/displayio/ColorConverter.c shared-bindings/displayio/Display.c shared-bindings/displayio/EPaperDisplay.c shared-bindings/displayio/FourWire.c shared-bindings/displayio/Group.c shared-bindings/displayio/I2CDisplay.c shared-bindings/displayio/OnDiskBitmap.c shared-bindings/displayio/Palette.c shared-bindings/displayio/Shape.c shared-bindings/displayio/TileGrid.c shared-bindings/displayio/__init__.c shared-bindings/fontio/BuiltinFont.c shared-bindings/fontio/__init__.c shared-bindings/gamepad/GamePad.c shared-bindings/gamepad/__init__.c shared-bindings/os/__init__.c shared-bindings/random/__init__.c shared-bindings/storage/__init__.c shared-bindings/struct/__init__.c shared-bindings/terminalio/Terminal.c shared-bindings/terminalio/__init__.c shared-module/_pixelbuf/PixelBuf.c shared-module/_pixelbuf/__init__.c shared-module/audioio/__init__.c shared-module/audiocore/__init__.c shared-module/audiocore/RawSample.c shared-module/audiocore/WaveFile.c shared-module/bitbangio/OneWire.c shared-module/board/__init__.c shared-module/busio/OneWire.c shared-module/displayio/Bitmap.c shared-module/displayio/ColorConverter.c shared-module/displayio/Display.c shared-module/displayio/EPaperDisplay.c shared-module/displayio/FourWire.c shared-module/displayio/Group.c shared-module/displayio/I2CDisplay.c shared-module/displayio/OnDiskBitmap.c shared-module/displayio/Palette.c shared-module/displayio/Shape.c shared-module/displayio/TileGrid.c shared-module/displayio/__init__.c shared-module/fontio/BuiltinFont.c shared-module/fontio/__init__.c shared-module/gamepad/GamePad.c shared-module/gamepad/__init__.c shared-module/os/__init__.c shared-module/random/__init__.c shared-module/storage/__init__.c shared-module/struct/__init__.c shared-module/terminalio/Terminal.c shared-module/terminalio/__init__.c shared-module/displayio/display_core.c > build-feather_m0_express/genhdr/moduledefs.h -GEN build-feather_m0_express/genhdr/qstr.i.last -grep -lE "(MP_QSTR|translate)" ../../py/runtime.c build-feather_m0_express/genhdr/moduledefs.h background.c ../../lib/tinyusb/src/portable/microchip/samd/dcd_samd.c mphalport.c peripherals/samd/samd21/clocks.c peripherals/samd/samd21/pins.c tick.c timer_handler.c ../../main.c supervisor/port.c ../../supervisor/shared/autoreload.c ../../supervisor/shared/flash.c ../../supervisor/shared/rgb_led_status.c ../../supervisor/shared/tick.c ../../supervisor/shared/external_flash/external_flash.c ../../lib/tinyusb/src/device/usbd.c ../../lib/tinyusb/src/device/usbd_control.c ../../lib/tinyusb/src/class/msc/msc_device.c ../../lib/tinyusb/src/class/cdc/cdc_device.c ../../lib/tinyusb/src/class/midi/midi_device.c ../../lib/tinyusb/src/tusb.c ../../supervisor/shared/usb/usb.c ../../shared-module/usb_hid/Device.c common-hal/audiobusio/PDMIn.c common-hal/displayio/ParallelBus.c common-hal/neopixel_write/__init__.c common-hal/pulseio/PulseIn.c common-hal/rtc/RTC.c common-hal/time/__init__.c common-hal/touchio/TouchIn.c ../../shared-bindings/displayio/Display.c ../../shared-bindings/displayio/FourWire.c ../../shared-module/_pixelbuf/PixelBuf.c ../../shared-module/displayio/Display.c ../../shared-module/displayio/EPaperDisplay.c ../../shared-module/displayio/FourWire.c ../../shared-module/displayio/I2CDisplay.c ../../shared-module/displayio/display_core.c | xargs arm-none-eabi-gcc -E -DNO_QSTR -Ibuild-feather_m0_express/tmp -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 ../../py/emitnx64.c ../../py/emitnx86.c ../../py/emitnthumb.c ../../py/emitnarm.c ../../py/emitnxtensa.c peripherals/samd/samd21/clocks.c >build-feather_m0_express/genhdr/qstr.i.last; -GEN build-feather_m0_express/genhdr/qstr.split -python3 ../../py/makeqstrdefs.py split build-feather_m0_express/genhdr/qstr.i.last build-feather_m0_express/genhdr/qstr build-feather_m0_express/genhdr/qstrdefs.collected.h -touch build-feather_m0_express/genhdr/qstr.split -GEN build-feather_m0_express/genhdr/qstrdefs.collected.h -python3 ../../py/makeqstrdefs.py cat build-feather_m0_express/genhdr/qstr.i.last build-feather_m0_express/genhdr/qstr build-feather_m0_express/genhdr/qstrdefs.collected.h -QSTR updated -GEN build-feather_m0_express/genhdr/qstrdefs.preprocessed.h -cat ../../py/qstrdefs.h qstrdefsport.h build-feather_m0_express/genhdr/qstrdefs.collected.h | sed 's/^Q(.*)/"&"/' | arm-none-eabi-gcc -E -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 - | sed 's/^"\(Q(.*)\)"/\1/' > build-feather_m0_express/genhdr/qstrdefs.preprocessed.h -GEN build-feather_m0_express/genhdr/qstrdefs.enum.h -GEN build-feather_m0_express/genhdr/qstrdefs.generated.h -python3 ../../py/makeqstrdata.py --compression_filename build-feather_m0_express/genhdr/compression.generated.h --translation build-feather_m0_express/genhdr/en_US.mo build-feather_m0_express/genhdr/qstrdefs.preprocessed.h > build-feather_m0_express/genhdr/qstrdefs.generated.h -python3 ../../py/makeqstrdata.py build-feather_m0_express/genhdr/qstrdefs.preprocessed.h > build-feather_m0_express/genhdr/qstrdefs.enum.h -CC ../../py/mpstate.c -CC ../../py/nlr.c -CC ../../py/nlrx86.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/mpstate.o ../../py/mpstate.c -CC ../../py/nlrx64.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -Os -c -MD -o build-feather_m0_express/py/nlrx86.o ../../py/nlrx86.c -CC ../../py/nlrthumb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -Os -c -MD -o build-feather_m0_express/py/nlrthumb.o ../../py/nlrthumb.c -CC ../../py/nlrxtensa.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -Os -c -MD -o build-feather_m0_express/py/nlrx64.o ../../py/nlrx64.c -CC ../../py/nlrsetjmp.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -Os -c -MD -o build-feather_m0_express/py/nlrxtensa.o ../../py/nlrxtensa.c -CC ../../py/gc.c -CC ../../py/malloc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/gc.o ../../py/gc.c -CC ../../py/gc_long_lived.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/malloc.o ../../py/malloc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/gc_long_lived.o ../../py/gc_long_lived.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -Os -c -MD -o build-feather_m0_express/py/nlrsetjmp.o ../../py/nlrsetjmp.c -CC ../../py/pystack.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/nlr.o ../../py/nlr.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/pystack.o ../../py/pystack.c -CC ../../py/vstr.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/vstr.o ../../py/vstr.c -CC ../../py/mpprint.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/mpprint.o ../../py/mpprint.c -CC ../../py/unicode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/unicode.o ../../py/unicode.c -CC ../../py/mpz.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/mpz.o ../../py/mpz.c -CC ../../py/reader.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/reader.o ../../py/reader.c -CC ../../py/lexer.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/lexer.o ../../py/lexer.c -CC ../../py/parse.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/parse.o ../../py/parse.c -CC ../../py/compile.c -CC ../../py/scope.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -CC ../../py/emitcommon.c -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/compile.o ../../py/compile.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitcommon.o ../../py/emitcommon.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/scope.o ../../py/scope.c -CC ../../py/emitbc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitbc.o ../../py/emitbc.c -CC ../../py/asmbase.c -CC ../../py/asmx64.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmx64.o ../../py/asmx64.c -CC ../../py/emitnx64.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmbase.o ../../py/asmbase.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitnx64.o ../../py/emitnx64.c -CC ../../py/asmx86.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmx86.o ../../py/asmx86.c -CC ../../py/emitnx86.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitnx86.o ../../py/emitnx86.c -CC ../../py/asmthumb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmthumb.o ../../py/asmthumb.c -CC ../../py/emitnthumb.c -CC ../../py/emitinlinethumb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitinlinethumb.o ../../py/emitinlinethumb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitnthumb.o ../../py/emitnthumb.c -CC ../../py/asmarm.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmarm.o ../../py/asmarm.c -CC ../../py/emitnarm.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitnarm.o ../../py/emitnarm.c -CC ../../py/asmxtensa.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/asmxtensa.o ../../py/asmxtensa.c -CC ../../py/emitnxtensa.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitnxtensa.o ../../py/emitnxtensa.c -CC ../../py/emitinlinextensa.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitinlinextensa.o ../../py/emitinlinextensa.c -CC ../../py/formatfloat.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/formatfloat.o ../../py/formatfloat.c -CC ../../py/parsenumbase.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/parsenumbase.o ../../py/parsenumbase.c -CC ../../py/parsenum.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/parsenum.o ../../py/parsenum.c -CC ../../py/emitglue.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/emitglue.o ../../py/emitglue.c -CC ../../py/persistentcode.c -CC ../../py/runtime.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/persistentcode.o ../../py/persistentcode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/runtime.o ../../py/runtime.c -CC ../../py/runtime_utils.c -CC ../../py/scheduler.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/runtime_utils.o ../../py/runtime_utils.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/scheduler.o ../../py/scheduler.c -CC ../../py/nativeglue.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/nativeglue.o ../../py/nativeglue.c -CC ../../py/stackctrl.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/stackctrl.o ../../py/stackctrl.c -CC ../../py/argcheck.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/argcheck.o ../../py/argcheck.c -CC ../../py/warning.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/warning.o ../../py/warning.c -CC ../../py/map.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/map.o ../../py/map.c -CC ../../py/obj.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/obj.o ../../py/obj.c -CC ../../py/objarray.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objarray.o ../../py/objarray.c -CC ../../py/objattrtuple.c -CC ../../py/objbool.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objbool.o ../../py/objbool.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objattrtuple.o ../../py/objattrtuple.c -CC ../../py/objboundmeth.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objboundmeth.o ../../py/objboundmeth.c -CC ../../py/objcell.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objcell.o ../../py/objcell.c -CC ../../py/objclosure.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objclosure.o ../../py/objclosure.c -CC ../../py/objcomplex.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objcomplex.o ../../py/objcomplex.c -CC ../../py/objdeque.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objdeque.o ../../py/objdeque.c -CC ../../py/objdict.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objdict.o ../../py/objdict.c -CC ../../py/objenumerate.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objenumerate.o ../../py/objenumerate.c -CC ../../py/objexcept.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objexcept.o ../../py/objexcept.c -CC ../../py/objfilter.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objfilter.o ../../py/objfilter.c -CC ../../py/objfloat.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objfloat.o ../../py/objfloat.c -CC ../../py/objfun.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objfun.o ../../py/objfun.c -CC ../../py/objgenerator.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objgenerator.o ../../py/objgenerator.c -CC ../../py/objgetitemiter.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objgetitemiter.o ../../py/objgetitemiter.c -CC ../../py/objint.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objint.o ../../py/objint.c -CC ../../py/objint_longlong.c -CC ../../py/objint_mpz.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objint_mpz.o ../../py/objint_mpz.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objint_longlong.o ../../py/objint_longlong.c -CC ../../py/objlist.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objlist.o ../../py/objlist.c -CC ../../py/objmap.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objmap.o ../../py/objmap.c -CC ../../py/objmodule.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objmodule.o ../../py/objmodule.c -CC ../../py/objobject.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objobject.o ../../py/objobject.c -CC ../../py/objpolyiter.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objpolyiter.o ../../py/objpolyiter.c -CC ../../py/objproperty.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objproperty.o ../../py/objproperty.c -CC ../../py/objnone.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objnone.o ../../py/objnone.c -CC ../../py/objnamedtuple.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objnamedtuple.o ../../py/objnamedtuple.c -CC ../../py/objrange.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objrange.o ../../py/objrange.c -CC ../../py/objreversed.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objreversed.o ../../py/objreversed.c -CC ../../py/objset.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objset.o ../../py/objset.c -CC ../../py/objsingleton.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objsingleton.o ../../py/objsingleton.c -CC ../../py/objslice.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objslice.o ../../py/objslice.c -CC ../../py/objstr.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objstr.o ../../py/objstr.c -CC ../../py/objstrunicode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objstrunicode.o ../../py/objstrunicode.c -CC ../../py/objstringio.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objstringio.o ../../py/objstringio.c -CC ../../py/objtuple.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objtuple.o ../../py/objtuple.c -CC ../../py/objtype.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objtype.o ../../py/objtype.c -CC ../../py/objzip.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/objzip.o ../../py/objzip.c -CC ../../py/opmethods.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/opmethods.o ../../py/opmethods.c -CC ../../py/proto.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/proto.o ../../py/proto.c -CC ../../py/reload.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/reload.o ../../py/reload.c -CC ../../py/sequence.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/sequence.o ../../py/sequence.c -CC ../../py/stream.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/stream.o ../../py/stream.c -CC ../../py/binary.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/binary.o ../../py/binary.c -CC ../../py/builtinimport.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/builtinimport.o ../../py/builtinimport.c -CC ../../py/builtinevex.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/builtinevex.o ../../py/builtinevex.c -CC ../../py/builtinhelp.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/builtinhelp.o ../../py/builtinhelp.c -CC ../../py/modarray.c -CC ../../py/modbuiltins.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modarray.o ../../py/modarray.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modbuiltins.o ../../py/modbuiltins.c -CC ../../py/modcollections.c -CC ../../py/modgc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modcollections.o ../../py/modcollections.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modgc.o ../../py/modgc.c -CC ../../py/modio.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modio.o ../../py/modio.c -CC ../../py/modmath.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modmath.o ../../py/modmath.c -CC ../../py/modcmath.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modcmath.o ../../py/modcmath.c -CC ../../py/modmicropython.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modmicropython.o ../../py/modmicropython.c -CC ../../py/modstruct.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modstruct.o ../../py/modstruct.c -CC ../../py/modsys.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modsys.o ../../py/modsys.c -CC ../../py/moduerrno.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/moduerrno.o ../../py/moduerrno.c -CC ../../py/modthread.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/modthread.o ../../py/modthread.c -CC ../../py/vm.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -O3 -c -MD -o build-feather_m0_express/py/vm.o ../../py/vm.c -CC ../../py/bc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/bc.o ../../py/bc.c -CC ../../py/showbc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/showbc.o ../../py/showbc.c -CC ../../py/repl.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/repl.o ../../py/repl.c -CC ../../py/smallint.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/smallint.o ../../py/smallint.c -CC ../../py/frozenmod.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/frozenmod.o ../../py/frozenmod.c -CC ../../extmod/moductypes.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/moductypes.o ../../extmod/moductypes.c -CC ../../extmod/modujson.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modujson.o ../../extmod/modujson.c -CC ../../extmod/modure.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modure.o ../../extmod/modure.c -CC ../../extmod/moduzlib.c -CC ../../extmod/moduheapq.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/moduzlib.o ../../extmod/moduzlib.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/moduheapq.o ../../extmod/moduheapq.c -CC ../../extmod/modutimeq.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modutimeq.o ../../extmod/modutimeq.c -CC ../../extmod/moduhashlib.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/moduhashlib.o ../../extmod/moduhashlib.c -CC ../../extmod/modubinascii.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modubinascii.o ../../extmod/modubinascii.c -CC ../../extmod/virtpin.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/virtpin.o ../../extmod/virtpin.c -CC ../../extmod/modussl_axtls.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modussl_axtls.o ../../extmod/modussl_axtls.c -CC ../../extmod/modussl_mbedtls.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modussl_mbedtls.o ../../extmod/modussl_mbedtls.c -CC ../../extmod/modurandom.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modurandom.o ../../extmod/modurandom.c -CC ../../extmod/moduselect.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/moduselect.o ../../extmod/moduselect.c -CC ../../extmod/modwebsocket.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modwebsocket.o ../../extmod/modwebsocket.c -CC ../../extmod/modwebrepl.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modwebrepl.o ../../extmod/modwebrepl.c -CC ../../extmod/modframebuf.c -CC ../../extmod/vfs.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/modframebuf.o ../../extmod/modframebuf.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs.o ../../extmod/vfs.c -CC ../../extmod/vfs_reader.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_reader.o ../../extmod/vfs_reader.c -CC ../../extmod/vfs_posix.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_posix.o ../../extmod/vfs_posix.c -CC ../../extmod/vfs_posix_file.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_posix_file.o ../../extmod/vfs_posix_file.c -CC ../../extmod/vfs_fat.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_fat.o ../../extmod/vfs_fat.c -CC ../../extmod/vfs_fat_diskio.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_fat_diskio.o ../../extmod/vfs_fat_diskio.c -CC ../../extmod/vfs_fat_file.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/vfs_fat_file.o ../../extmod/vfs_fat_file.c -CC ../../extmod/utime_mphal.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/utime_mphal.o ../../extmod/utime_mphal.c -CC ../../extmod/uos_dupterm.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/extmod/uos_dupterm.o ../../extmod/uos_dupterm.c -CC ../../lib/embed/abort_.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/embed/abort_.o ../../lib/embed/abort_.c -CC ../../lib/utils/printf.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/printf.o ../../lib/utils/printf.c -CC ../../main.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/main.o ../../main.c -CC supervisor/port.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/port.o supervisor/port.c -CC ../../supervisor/shared/autoreload.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/autoreload.o ../../supervisor/shared/autoreload.c -CC ../../supervisor/shared/board.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/board.o ../../supervisor/shared/board.c -CC ../../supervisor/shared/display.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/display.o ../../supervisor/shared/display.c -CC ../../supervisor/shared/filesystem.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/filesystem.o ../../supervisor/shared/filesystem.c -CC ../../supervisor/shared/flash.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/flash.o ../../supervisor/shared/flash.c -CC ../../supervisor/shared/micropython.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/micropython.o ../../supervisor/shared/micropython.c -CC ../../supervisor/shared/rgb_led_status.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/rgb_led_status.o ../../supervisor/shared/rgb_led_status.c -CC ../../supervisor/shared/safe_mode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/safe_mode.o ../../supervisor/shared/safe_mode.c -CC ../../supervisor/shared/stack.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/stack.o ../../supervisor/shared/stack.c -CC ../../supervisor/shared/status_leds.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/status_leds.o ../../supervisor/shared/status_leds.c -CC ../../supervisor/shared/tick.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/tick.o ../../supervisor/shared/tick.c -CC ../../supervisor/shared/translate.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/translate.o ../../supervisor/shared/translate.c -CC ../../supervisor/shared/external_flash/external_flash.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/external_flash/external_flash.o ../../supervisor/shared/external_flash/external_flash.c -CC ../../supervisor/shared/external_flash/spi_flash.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/external_flash/spi_flash.o ../../supervisor/shared/external_flash/spi_flash.c -CC ../../lib/tinyusb/src/common/tusb_fifo.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/common/tusb_fifo.o ../../lib/tinyusb/src/common/tusb_fifo.c -CC ../../lib/tinyusb/src/device/usbd.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/device/usbd.o ../../lib/tinyusb/src/device/usbd.c -CC ../../lib/tinyusb/src/device/usbd_control.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/device/usbd_control.o ../../lib/tinyusb/src/device/usbd_control.c -CC ../../lib/tinyusb/src/class/msc/msc_device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/class/msc/msc_device.o ../../lib/tinyusb/src/class/msc/msc_device.c -CC ../../lib/tinyusb/src/class/cdc/cdc_device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/class/cdc/cdc_device.o ../../lib/tinyusb/src/class/cdc/cdc_device.c -CC ../../lib/tinyusb/src/class/hid/hid_device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/class/hid/hid_device.o ../../lib/tinyusb/src/class/hid/hid_device.c -CC ../../lib/tinyusb/src/class/midi/midi_device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/class/midi/midi_device.o ../../lib/tinyusb/src/class/midi/midi_device.c -CC ../../lib/tinyusb/src/tusb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/tusb.o ../../lib/tinyusb/src/tusb.c -CC ../../supervisor/shared/serial.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/serial.o ../../supervisor/shared/serial.c -CC ../../supervisor/shared/usb/usb_desc.c -CC ../../supervisor/shared/usb/usb.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/usb/usb_desc.o ../../supervisor/shared/usb/usb_desc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/usb/usb.o ../../supervisor/shared/usb/usb.c -CC ../../supervisor/shared/usb/usb_msc_flash.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/usb/usb_msc_flash.o ../../supervisor/shared/usb/usb_msc_flash.c -CC ../../shared-bindings/usb_hid/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/usb_hid/__init__.o ../../shared-bindings/usb_hid/__init__.c -CC ../../shared-bindings/usb_hid/Device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/usb_hid/Device.o ../../shared-bindings/usb_hid/Device.c -CC ../../shared-bindings/usb_midi/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/usb_midi/__init__.o ../../shared-bindings/usb_midi/__init__.c -CC ../../shared-bindings/usb_midi/PortIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/usb_midi/PortIn.o ../../shared-bindings/usb_midi/PortIn.c -CC ../../shared-bindings/usb_midi/PortOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/usb_midi/PortOut.o ../../shared-bindings/usb_midi/PortOut.c -CC ../../shared-module/usb_hid/Device.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/usb_hid/Device.o ../../shared-module/usb_hid/Device.c -CC ../../shared-module/usb_midi/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/usb_midi/__init__.o ../../shared-module/usb_midi/__init__.c -CC ../../shared-module/usb_midi/PortIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/usb_midi/PortIn.o ../../shared-module/usb_midi/PortIn.c -CC ../../shared-module/usb_midi/PortOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/usb_midi/PortOut.o ../../shared-module/usb_midi/PortOut.c -CC build-feather_m0_express/autogen_usb_descriptor.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/build-feather_m0_express/autogen_usb_descriptor.o build-feather_m0_express/autogen_usb_descriptor.c -GEN build-feather_m0_express/autogen_display_resources.c -CC audio_dma.c -install -d build-feather_m0_express/genhdr -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/audio_dma.o audio_dma.c -python3 ../../tools/gen_display_resources.py \ - --font "../../tools/fonts/ter-u12n.bdf" \ - --sample_file build-feather_m0_express/genhdr/qstrdefs.generated.h \ - --output_c_file build-feather_m0_express/autogen_display_resources.c -CC background.c -CC bindings/samd/Clock.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/background.o background.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/bindings/samd/Clock.o bindings/samd/Clock.c -CC bindings/samd/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/bindings/samd/__init__.o bindings/samd/__init__.c -CC boards/feather_m0_express/board.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/boards/feather_m0_express/board.o boards/feather_m0_express/board.c -CC boards/feather_m0_express/pins.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/boards/feather_m0_express/pins.o boards/feather_m0_express/pins.c -CC eic_handler.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/eic_handler.o eic_handler.c -CC fatfs_port.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/fatfs_port.o fatfs_port.c -CC ../../lib/mp-readline/readline.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/mp-readline/readline.o ../../lib/mp-readline/readline.c -CC ../../lib/oofatfs/ff.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/oofatfs/ff.o ../../lib/oofatfs/ff.c -CC ../../lib/oofatfs/option/ccsbcs.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/oofatfs/option/ccsbcs.o ../../lib/oofatfs/option/ccsbcs.c -CC ../../lib/timeutils/timeutils.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/timeutils/timeutils.o ../../lib/timeutils/timeutils.c -CC ../../lib/tinyusb/src/portable/microchip/samd/dcd_samd.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/tinyusb/src/portable/microchip/samd/dcd_samd.o ../../lib/tinyusb/src/portable/microchip/samd/dcd_samd.c -CC ../../lib/utils/context_manager_helpers.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/context_manager_helpers.o ../../lib/utils/context_manager_helpers.c -CC ../../lib/utils/interrupt_char.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/interrupt_char.o ../../lib/utils/interrupt_char.c -CC ../../lib/utils/pyexec.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/pyexec.o ../../lib/utils/pyexec.c -CC ../../lib/utils/stdout_helpers.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/stdout_helpers.o ../../lib/utils/stdout_helpers.c -CC ../../lib/utils/sys_stdio_mphal.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/lib/utils/sys_stdio_mphal.o ../../lib/utils/sys_stdio_mphal.c -CC mphalport.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/mphalport.o mphalport.c -CC peripherals/samd/samd21/clocks.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/samd21/clocks.o peripherals/samd/samd21/clocks.c -CC peripherals/samd/samd21/dma.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/samd21/dma.o peripherals/samd/samd21/dma.c -CC peripherals/samd/samd21/events.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/samd21/events.o peripherals/samd/samd21/events.c -CC peripherals/samd/samd21/pins.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/samd21/pins.o peripherals/samd/samd21/pins.c -CC peripherals/samd/samd21/timers.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/samd21/timers.o peripherals/samd/samd21/timers.c -CC peripherals/samd/clocks.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/clocks.o peripherals/samd/clocks.c -CC peripherals/samd/dma.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/dma.o peripherals/samd/dma.c -CC peripherals/samd/external_interrupts.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/external_interrupts.o peripherals/samd/external_interrupts.c -CC peripherals/samd/timers.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/peripherals/samd/timers.o peripherals/samd/timers.c -CC reset.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/reset.o reset.c -CC ../../supervisor/shared/memory.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/supervisor/shared/memory.o ../../supervisor/shared/memory.c -CC tick.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/tick.o tick.c -CC timer_handler.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/timer_handler.o timer_handler.c -CC asf4/samd21/hpl/rtc/hpl_rtc.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/asf4/samd21/hpl/rtc/hpl_rtc.o asf4/samd21/hpl/rtc/hpl_rtc.c -CC common-hal/analogio/AnalogIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/analogio/AnalogIn.o common-hal/analogio/AnalogIn.c -CC common-hal/analogio/AnalogOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/analogio/AnalogOut.o common-hal/analogio/AnalogOut.c -CC common-hal/audiobusio/I2SOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/audiobusio/I2SOut.o common-hal/audiobusio/I2SOut.c -CC common-hal/audiobusio/PDMIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/audiobusio/PDMIn.o common-hal/audiobusio/PDMIn.c -CC common-hal/audioio/AudioOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/audioio/AudioOut.o common-hal/audioio/AudioOut.c -CC common-hal/board/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/board/__init__.o common-hal/board/__init__.c -CC common-hal/busio/I2C.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/busio/I2C.o common-hal/busio/I2C.c -CC common-hal/busio/SPI.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/busio/SPI.o common-hal/busio/SPI.c -CC common-hal/busio/UART.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/busio/UART.o common-hal/busio/UART.c -CC common-hal/digitalio/DigitalInOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/digitalio/DigitalInOut.o common-hal/digitalio/DigitalInOut.c -CC common-hal/displayio/ParallelBus.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/displayio/ParallelBus.o common-hal/displayio/ParallelBus.c -CC common-hal/microcontroller/Pin.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/microcontroller/Pin.o common-hal/microcontroller/Pin.c -CC common-hal/microcontroller/Processor.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/microcontroller/Processor.o common-hal/microcontroller/Processor.c -CC common-hal/microcontroller/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/microcontroller/__init__.o common-hal/microcontroller/__init__.c -CC common-hal/neopixel_write/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/neopixel_write/__init__.o common-hal/neopixel_write/__init__.c -CC common-hal/nvm/ByteArray.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/nvm/ByteArray.o common-hal/nvm/ByteArray.c -CC common-hal/os/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/os/__init__.o common-hal/os/__init__.c -CC common-hal/pulseio/PWMOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/pulseio/PWMOut.o common-hal/pulseio/PWMOut.c -CC common-hal/pulseio/PulseIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/pulseio/PulseIn.o common-hal/pulseio/PulseIn.c -CC common-hal/pulseio/PulseOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/pulseio/PulseOut.o common-hal/pulseio/PulseOut.c -CC common-hal/rotaryio/IncrementalEncoder.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/rotaryio/IncrementalEncoder.o common-hal/rotaryio/IncrementalEncoder.c -CC common-hal/rtc/RTC.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/rtc/RTC.o common-hal/rtc/RTC.c -CC common-hal/supervisor/Runtime.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/supervisor/Runtime.o common-hal/supervisor/Runtime.c -CC common-hal/supervisor/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/supervisor/__init__.o common-hal/supervisor/__init__.c -CC common-hal/time/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/time/__init__.o common-hal/time/__init__.c -CC common-hal/touchio/TouchIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/common-hal/touchio/TouchIn.o common-hal/touchio/TouchIn.c -CC ../../shared-bindings/_pixelbuf/PixelBuf.c -CC ../../shared-bindings/_pixelbuf/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/_pixelbuf/PixelBuf.o ../../shared-bindings/_pixelbuf/PixelBuf.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/_pixelbuf/__init__.o ../../shared-bindings/_pixelbuf/__init__.c -CC ../../shared-bindings/analogio/AnalogIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/analogio/AnalogIn.o ../../shared-bindings/analogio/AnalogIn.c -CC ../../shared-bindings/analogio/AnalogOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/analogio/AnalogOut.o ../../shared-bindings/analogio/AnalogOut.c -CC ../../shared-bindings/analogio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/analogio/__init__.o ../../shared-bindings/analogio/__init__.c -CC ../../shared-bindings/audiobusio/I2SOut.c -CC ../../shared-bindings/audiobusio/PDMIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiobusio/I2SOut.o ../../shared-bindings/audiobusio/I2SOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiobusio/PDMIn.o ../../shared-bindings/audiobusio/PDMIn.c -CC ../../shared-bindings/audiobusio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiobusio/__init__.o ../../shared-bindings/audiobusio/__init__.c -CC ../../shared-bindings/audiocore/RawSample.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiocore/RawSample.o ../../shared-bindings/audiocore/RawSample.c -CC ../../shared-bindings/audiocore/WaveFile.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiocore/WaveFile.o ../../shared-bindings/audiocore/WaveFile.c -CC ../../shared-bindings/audiocore/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audiocore/__init__.o ../../shared-bindings/audiocore/__init__.c -CC ../../shared-bindings/audioio/AudioOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audioio/AudioOut.o ../../shared-bindings/audioio/AudioOut.c -CC ../../shared-bindings/audioio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/audioio/__init__.o ../../shared-bindings/audioio/__init__.c -CC ../../shared-bindings/bitbangio/OneWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/bitbangio/OneWire.o ../../shared-bindings/bitbangio/OneWire.c -CC ../../shared-bindings/board/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/board/__init__.o ../../shared-bindings/board/__init__.c -CC ../../shared-bindings/busio/I2C.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/busio/I2C.o ../../shared-bindings/busio/I2C.c -CC ../../shared-bindings/busio/OneWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/busio/OneWire.o ../../shared-bindings/busio/OneWire.c -CC ../../shared-bindings/busio/SPI.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/busio/SPI.o ../../shared-bindings/busio/SPI.c -CC ../../shared-bindings/busio/UART.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/busio/UART.o ../../shared-bindings/busio/UART.c -CC ../../shared-bindings/busio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/busio/__init__.o ../../shared-bindings/busio/__init__.c -CC ../../shared-bindings/digitalio/DigitalInOut.c -CC ../../shared-bindings/digitalio/Direction.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/digitalio/DigitalInOut.o ../../shared-bindings/digitalio/DigitalInOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/digitalio/Direction.o ../../shared-bindings/digitalio/Direction.c -CC ../../shared-bindings/digitalio/DriveMode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/digitalio/DriveMode.o ../../shared-bindings/digitalio/DriveMode.c -CC ../../shared-bindings/digitalio/Pull.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/digitalio/Pull.o ../../shared-bindings/digitalio/Pull.c -CC ../../shared-bindings/digitalio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/digitalio/__init__.o ../../shared-bindings/digitalio/__init__.c -CC ../../shared-bindings/displayio/Bitmap.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/Bitmap.o ../../shared-bindings/displayio/Bitmap.c -CC ../../shared-bindings/displayio/ColorConverter.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/ColorConverter.o ../../shared-bindings/displayio/ColorConverter.c -CC ../../shared-bindings/displayio/Display.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/Display.o ../../shared-bindings/displayio/Display.c -CC ../../shared-bindings/displayio/EPaperDisplay.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/EPaperDisplay.o ../../shared-bindings/displayio/EPaperDisplay.c -CC ../../shared-bindings/displayio/FourWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/FourWire.o ../../shared-bindings/displayio/FourWire.c -CC ../../shared-bindings/displayio/Group.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/Group.o ../../shared-bindings/displayio/Group.c -CC ../../shared-bindings/displayio/I2CDisplay.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/I2CDisplay.o ../../shared-bindings/displayio/I2CDisplay.c -CC ../../shared-bindings/displayio/OnDiskBitmap.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/OnDiskBitmap.o ../../shared-bindings/displayio/OnDiskBitmap.c -CC ../../shared-bindings/displayio/Palette.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/Palette.o ../../shared-bindings/displayio/Palette.c -CC ../../shared-bindings/displayio/ParallelBus.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/ParallelBus.o ../../shared-bindings/displayio/ParallelBus.c -CC ../../shared-bindings/displayio/Shape.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/Shape.o ../../shared-bindings/displayio/Shape.c -CC ../../shared-bindings/displayio/TileGrid.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/TileGrid.o ../../shared-bindings/displayio/TileGrid.c -CC ../../shared-bindings/displayio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/displayio/__init__.o ../../shared-bindings/displayio/__init__.c -CC ../../shared-bindings/fontio/BuiltinFont.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/fontio/BuiltinFont.o ../../shared-bindings/fontio/BuiltinFont.c -CC ../../shared-bindings/fontio/Glyph.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/fontio/Glyph.o ../../shared-bindings/fontio/Glyph.c -CC ../../shared-bindings/fontio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/fontio/__init__.o ../../shared-bindings/fontio/__init__.c -CC ../../shared-bindings/gamepad/GamePad.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/gamepad/GamePad.o ../../shared-bindings/gamepad/GamePad.c -CC ../../shared-bindings/gamepad/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/gamepad/__init__.o ../../shared-bindings/gamepad/__init__.c -CC ../../shared-bindings/math/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/math/__init__.o ../../shared-bindings/math/__init__.c -CC ../../shared-bindings/microcontroller/Pin.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/microcontroller/Pin.o ../../shared-bindings/microcontroller/Pin.c -CC ../../shared-bindings/microcontroller/Processor.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/microcontroller/Processor.o ../../shared-bindings/microcontroller/Processor.c -CC ../../shared-bindings/microcontroller/RunMode.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/microcontroller/RunMode.o ../../shared-bindings/microcontroller/RunMode.c -CC ../../shared-bindings/microcontroller/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/microcontroller/__init__.o ../../shared-bindings/microcontroller/__init__.c -CC ../../shared-bindings/neopixel_write/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/neopixel_write/__init__.o ../../shared-bindings/neopixel_write/__init__.c -CC ../../shared-bindings/nvm/ByteArray.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/nvm/ByteArray.o ../../shared-bindings/nvm/ByteArray.c -CC ../../shared-bindings/nvm/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/nvm/__init__.o ../../shared-bindings/nvm/__init__.c -CC ../../shared-bindings/os/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/os/__init__.o ../../shared-bindings/os/__init__.c -CC ../../shared-bindings/pulseio/PWMOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/pulseio/PWMOut.o ../../shared-bindings/pulseio/PWMOut.c -CC ../../shared-bindings/pulseio/PulseIn.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/pulseio/PulseIn.o ../../shared-bindings/pulseio/PulseIn.c -CC ../../shared-bindings/pulseio/PulseOut.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/pulseio/PulseOut.o ../../shared-bindings/pulseio/PulseOut.c -CC ../../shared-bindings/pulseio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/pulseio/__init__.o ../../shared-bindings/pulseio/__init__.c -CC ../../shared-bindings/random/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/random/__init__.o ../../shared-bindings/random/__init__.c -CC ../../shared-bindings/rotaryio/IncrementalEncoder.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/rotaryio/IncrementalEncoder.o ../../shared-bindings/rotaryio/IncrementalEncoder.c -CC ../../shared-bindings/rotaryio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/rotaryio/__init__.o ../../shared-bindings/rotaryio/__init__.c -CC ../../shared-bindings/rtc/RTC.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/rtc/RTC.o ../../shared-bindings/rtc/RTC.c -CC ../../shared-bindings/rtc/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/rtc/__init__.o ../../shared-bindings/rtc/__init__.c -CC ../../shared-bindings/storage/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/storage/__init__.o ../../shared-bindings/storage/__init__.c -CC ../../shared-bindings/struct/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/struct/__init__.o ../../shared-bindings/struct/__init__.c -CC ../../shared-bindings/supervisor/Runtime.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/supervisor/Runtime.o ../../shared-bindings/supervisor/Runtime.c -CC ../../shared-bindings/supervisor/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/supervisor/__init__.o ../../shared-bindings/supervisor/__init__.c -CC ../../shared-bindings/terminalio/Terminal.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/terminalio/Terminal.o ../../shared-bindings/terminalio/Terminal.c -CC ../../shared-bindings/terminalio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/terminalio/__init__.o ../../shared-bindings/terminalio/__init__.c -CC ../../shared-bindings/time/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/time/__init__.o ../../shared-bindings/time/__init__.c -CC ../../shared-bindings/touchio/TouchIn.c -CC ../../shared-bindings/touchio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/touchio/__init__.o ../../shared-bindings/touchio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/touchio/TouchIn.o ../../shared-bindings/touchio/TouchIn.c -CC ../../shared-bindings/util.c -CC ../../shared-module/_pixelbuf/PixelBuf.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/_pixelbuf/PixelBuf.o ../../shared-module/_pixelbuf/PixelBuf.c -CC ../../shared-module/audiocore/RawSample.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-bindings/util.o ../../shared-bindings/util.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/audiocore/RawSample.o ../../shared-module/audiocore/RawSample.c -CC ../../shared-module/audiocore/WaveFile.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/audiocore/WaveFile.o ../../shared-module/audiocore/WaveFile.c -CC ../../shared-module/audiocore/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/audiocore/__init__.o ../../shared-module/audiocore/__init__.c -CC ../../shared-module/bitbangio/OneWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/bitbangio/OneWire.o ../../shared-module/bitbangio/OneWire.c -CC ../../shared-module/board/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/board/__init__.o ../../shared-module/board/__init__.c -CC ../../shared-module/busio/OneWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/busio/OneWire.o ../../shared-module/busio/OneWire.c -CC ../../shared-module/displayio/Bitmap.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/Bitmap.o ../../shared-module/displayio/Bitmap.c -CC ../../shared-module/displayio/ColorConverter.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/ColorConverter.o ../../shared-module/displayio/ColorConverter.c -CC ../../shared-module/displayio/Display.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/Display.o ../../shared-module/displayio/Display.c -CC ../../shared-module/displayio/EPaperDisplay.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/EPaperDisplay.o ../../shared-module/displayio/EPaperDisplay.c -CC ../../shared-module/displayio/FourWire.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/FourWire.o ../../shared-module/displayio/FourWire.c -CC ../../shared-module/displayio/Group.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/Group.o ../../shared-module/displayio/Group.c -CC ../../shared-module/displayio/I2CDisplay.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/I2CDisplay.o ../../shared-module/displayio/I2CDisplay.c -CC ../../shared-module/displayio/OnDiskBitmap.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/OnDiskBitmap.o ../../shared-module/displayio/OnDiskBitmap.c -CC ../../shared-module/displayio/Palette.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/Palette.o ../../shared-module/displayio/Palette.c -CC ../../shared-module/displayio/Shape.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/Shape.o ../../shared-module/displayio/Shape.c -CC ../../shared-module/displayio/TileGrid.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/TileGrid.o ../../shared-module/displayio/TileGrid.c -CC ../../shared-module/displayio/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/__init__.o ../../shared-module/displayio/__init__.c -CC ../../shared-module/displayio/display_core.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/displayio/display_core.o ../../shared-module/displayio/display_core.c -CC ../../shared-module/fontio/BuiltinFont.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/fontio/BuiltinFont.o ../../shared-module/fontio/BuiltinFont.c -CC ../../shared-module/gamepad/GamePad.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/gamepad/GamePad.o ../../shared-module/gamepad/GamePad.c -CC ../../shared-module/gamepad/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/gamepad/__init__.o ../../shared-module/gamepad/__init__.c -CC ../../shared-module/os/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/os/__init__.o ../../shared-module/os/__init__.c -CC ../../shared-module/random/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/random/__init__.o ../../shared-module/random/__init__.c -CC ../../shared-module/storage/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/storage/__init__.o ../../shared-module/storage/__init__.c -CC ../../shared-module/struct/__init__.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/struct/__init__.o ../../shared-module/struct/__init__.c -CC ../../shared-module/terminalio/Terminal.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/shared-module/terminalio/Terminal.o ../../shared-module/terminalio/Terminal.c -CC ../../py/qstr.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/py/qstr.o ../../py/qstr.c -CC build-feather_m0_express/autogen_display_resources.c -arm-none-eabi-gcc -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -c -MD -o build-feather_m0_express/autogen_display_resources.o build-feather_m0_express/autogen_display_resources.c -LINK build-feather_m0_express/firmware.elf -arm-none-eabi-gcc -o build-feather_m0_express/firmware.elf -DCIRCUITPY_FULL_BUILD=1 -DCIRCUITPY_MINIMAL_BUILD=0 -DCIRCUITPY_DEFAULT_BUILD=1 -DCIRCUITPY_ALWAYS_BUILD=1 -DCIRCUITPY_ANALOGIO=1 -DCIRCUITPY_AUDIOBUSIO=1 -DCIRCUITPY_AUDIOIO=1 -DCIRCUITPY_AUDIOIO_COMPAT=1 -DCIRCUITPY_AUDIOPWMIO=0 -DCIRCUITPY_AUDIOCORE=1 -DCIRCUITPY_AUDIOMIXER=0 -DCIRCUITPY_AUDIOMP3=0 -DCIRCUITPY_BITBANGIO=0 -DCIRCUITPY_BLEIO=0 -DCIRCUITPY_BOARD=1 -DCIRCUITPY_BUSIO=1 -DCIRCUITPY_DIGITALIO=1 -DCIRCUITPY_DISPLAYIO=1 -DCIRCUITPY_FREQUENCYIO=0 -DCIRCUITPY_GAMEPAD=1 -DCIRCUITPY_GAMEPADSHIFT=0 -DCIRCUITPY_I2CSLAVE=0 -DCIRCUITPY_MATH=1 -DCIRCUITPY__EVE=0 -DCIRCUITPY_MICROCONTROLLER=1 -DCIRCUITPY_NEOPIXEL_WRITE=1 -DCIRCUITPY_NETWORK=0 -DCIRCUITPY_NVM=1 -DCIRCUITPY_OS=1 -DCIRCUITPY_PIXELBUF=1 -DCIRCUITPY_PULSEIO=1 -DCIRCUITPY_PS2IO=0 -DCIRCUITPY_RANDOM=1 -DCIRCUITPY_ROTARYIO=1 -DCIRCUITPY_RTC=1 -DCIRCUITPY_SAMD=0 -DCIRCUITPY_STAGE=0 -DCIRCUITPY_STORAGE=1 -DCIRCUITPY_STRUCT=1 -DCIRCUITPY_SUPERVISOR=1 -DCIRCUITPY_TIME=1 -DCIRCUITPY_TOUCHIO_USE_NATIVE=1 -DCIRCUITPY_TOUCHIO=1 -DCIRCUITPY_UHEAP=0 -DCIRCUITPY_USB_HID=1 -DCIRCUITPY_USB_MIDI=1 -DCIRCUITPY_PEW=0 -DCIRCUITPY_USTACK=0 -DCIRCUITPY_BITBANG_APA102=0 -DCIRCUITPY_REQUIRE_I2C_PULLUPS=1 -DCIRCUITPY_SERIAL_BLE=0 -DCIRCUITPY_BLE_FILE_SERVICE=0 -DCIRCUITPY_SERIAL_UART=0 -DCIRCUITPY_ENABLE_MPY_NATIVE=0 -DINTERNAL_FLASH_FILESYSTEM=0 -DQSPI_FLASH_FILESYSTEM=0 -DSPI_FLASH_FILESYSTEM=1 -DEXTERNAL_FLASH_DEVICES="S25FL216K, GD25Q16C" -DEXTERNAL_FLASH_DEVICE_COUNT=2 -DUSB_AVAILABLE -DLONGINT_IMPL_MPZ -Os -DNDEBUG -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 -finline-limit=60 -flto -flto-partition=none -I. -I../.. -I../lib/mp-readline -I../lib/timeutils -Iasf4/samd21 -Iasf4/samd21/hal/include -Iasf4/samd21/hal/utils/include -Iasf4/samd21/hri -Iasf4/samd21/hpl/core -Iasf4/samd21/hpl/gclk -Iasf4/samd21/hpl/pm -Iasf4/samd21/hpl/port -Iasf4/samd21/hpl/rtc -Iasf4/samd21/hpl/tc -Iasf4/samd21/include -Iasf4/samd21/CMSIS/Include -Iasf4_conf/samd21 -Iboards/feather_m0_express -Iboards/ -Iperipherals/ -Ifreetouch -I../../lib/tinyusb/src -I../../supervisor/shared/usb -Ibuild-feather_m0_express -Wall -Werror -std=gnu11 -nostdlib -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D__SAMD21G18A__ -ffunction-sections -fdata-sections -fshort-enums -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF -DCIRCUITPY_CANARY_WORD=0xADAF00 -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF --param max-inline-insns-single=500 -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -mthumb -mabi=aapcs-linux -mcpu=cortex-m0plus -msoft-float -mfloat-abi=soft -DSAMD21 -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,build-feather_m0_express/common.ld -Wl,-Map=build-feather_m0_express/firmware.elf.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/ build-feather_m0_express/py/mpstate.o build-feather_m0_express/py/nlr.o build-feather_m0_express/py/nlrx86.o build-feather_m0_express/py/nlrx64.o build-feather_m0_express/py/nlrthumb.o build-feather_m0_express/py/nlrxtensa.o build-feather_m0_express/py/nlrsetjmp.o build-feather_m0_express/py/malloc.o build-feather_m0_express/py/gc.o build-feather_m0_express/py/gc_long_lived.o build-feather_m0_express/py/pystack.o build-feather_m0_express/py/qstr.o build-feather_m0_express/py/vstr.o build-feather_m0_express/py/mpprint.o build-feather_m0_express/py/unicode.o build-feather_m0_express/py/mpz.o build-feather_m0_express/py/reader.o build-feather_m0_express/py/lexer.o build-feather_m0_express/py/parse.o build-feather_m0_express/py/scope.o build-feather_m0_express/py/compile.o build-feather_m0_express/py/emitcommon.o build-feather_m0_express/py/emitbc.o build-feather_m0_express/py/asmbase.o build-feather_m0_express/py/asmx64.o build-feather_m0_express/py/emitnx64.o build-feather_m0_express/py/asmx86.o build-feather_m0_express/py/emitnx86.o build-feather_m0_express/py/asmthumb.o build-feather_m0_express/py/emitnthumb.o build-feather_m0_express/py/emitinlinethumb.o build-feather_m0_express/py/asmarm.o build-feather_m0_express/py/emitnarm.o build-feather_m0_express/py/asmxtensa.o build-feather_m0_express/py/emitnxtensa.o build-feather_m0_express/py/emitinlinextensa.o build-feather_m0_express/py/formatfloat.o build-feather_m0_express/py/parsenumbase.o build-feather_m0_express/py/parsenum.o build-feather_m0_express/py/emitglue.o build-feather_m0_express/py/persistentcode.o build-feather_m0_express/py/runtime.o build-feather_m0_express/py/runtime_utils.o build-feather_m0_express/py/scheduler.o build-feather_m0_express/py/nativeglue.o build-feather_m0_express/py/stackctrl.o build-feather_m0_express/py/argcheck.o build-feather_m0_express/py/warning.o build-feather_m0_express/py/map.o build-feather_m0_express/py/obj.o build-feather_m0_express/py/objarray.o build-feather_m0_express/py/objattrtuple.o build-feather_m0_express/py/objbool.o build-feather_m0_express/py/objboundmeth.o build-feather_m0_express/py/objcell.o build-feather_m0_express/py/objclosure.o build-feather_m0_express/py/objcomplex.o build-feather_m0_express/py/objdeque.o build-feather_m0_express/py/objdict.o build-feather_m0_express/py/objenumerate.o build-feather_m0_express/py/objexcept.o build-feather_m0_express/py/objfilter.o build-feather_m0_express/py/objfloat.o build-feather_m0_express/py/objfun.o build-feather_m0_express/py/objgenerator.o build-feather_m0_express/py/objgetitemiter.o build-feather_m0_express/py/objint.o build-feather_m0_express/py/objint_longlong.o build-feather_m0_express/py/objint_mpz.o build-feather_m0_express/py/objlist.o build-feather_m0_express/py/objmap.o build-feather_m0_express/py/objmodule.o build-feather_m0_express/py/objobject.o build-feather_m0_express/py/objpolyiter.o build-feather_m0_express/py/objproperty.o build-feather_m0_express/py/objnone.o build-feather_m0_express/py/objnamedtuple.o build-feather_m0_express/py/objrange.o build-feather_m0_express/py/objreversed.o build-feather_m0_express/py/objset.o build-feather_m0_express/py/objsingleton.o build-feather_m0_express/py/objslice.o build-feather_m0_express/py/objstr.o build-feather_m0_express/py/objstrunicode.o build-feather_m0_express/py/objstringio.o build-feather_m0_express/py/objtuple.o build-feather_m0_express/py/objtype.o build-feather_m0_express/py/objzip.o build-feather_m0_express/py/opmethods.o build-feather_m0_express/py/proto.o build-feather_m0_express/py/reload.o build-feather_m0_express/py/sequence.o build-feather_m0_express/py/stream.o build-feather_m0_express/py/binary.o build-feather_m0_express/py/builtinimport.o build-feather_m0_express/py/builtinevex.o build-feather_m0_express/py/builtinhelp.o build-feather_m0_express/py/modarray.o build-feather_m0_express/py/modbuiltins.o build-feather_m0_express/py/modcollections.o build-feather_m0_express/py/modgc.o build-feather_m0_express/py/modio.o build-feather_m0_express/py/modmath.o build-feather_m0_express/py/modcmath.o build-feather_m0_express/py/modmicropython.o build-feather_m0_express/py/modstruct.o build-feather_m0_express/py/modsys.o build-feather_m0_express/py/moduerrno.o build-feather_m0_express/py/modthread.o build-feather_m0_express/py/vm.o build-feather_m0_express/py/bc.o build-feather_m0_express/py/showbc.o build-feather_m0_express/py/repl.o build-feather_m0_express/py/smallint.o build-feather_m0_express/py/frozenmod.o build-feather_m0_express/extmod/moductypes.o build-feather_m0_express/extmod/modujson.o build-feather_m0_express/extmod/modure.o build-feather_m0_express/extmod/moduzlib.o build-feather_m0_express/extmod/moduheapq.o build-feather_m0_express/extmod/modutimeq.o build-feather_m0_express/extmod/moduhashlib.o build-feather_m0_express/extmod/modubinascii.o build-feather_m0_express/extmod/virtpin.o build-feather_m0_express/extmod/modussl_axtls.o build-feather_m0_express/extmod/modussl_mbedtls.o build-feather_m0_express/extmod/modurandom.o build-feather_m0_express/extmod/moduselect.o build-feather_m0_express/extmod/modwebsocket.o build-feather_m0_express/extmod/modwebrepl.o build-feather_m0_express/extmod/modframebuf.o build-feather_m0_express/extmod/vfs.o build-feather_m0_express/extmod/vfs_reader.o build-feather_m0_express/extmod/vfs_posix.o build-feather_m0_express/extmod/vfs_posix_file.o build-feather_m0_express/extmod/vfs_fat.o build-feather_m0_express/extmod/vfs_fat_diskio.o build-feather_m0_express/extmod/vfs_fat_file.o build-feather_m0_express/extmod/utime_mphal.o build-feather_m0_express/extmod/uos_dupterm.o build-feather_m0_express/lib/embed/abort_.o build-feather_m0_express/lib/utils/printf.o build-feather_m0_express/main.o build-feather_m0_express/supervisor/port.o build-feather_m0_express/supervisor/shared/autoreload.o build-feather_m0_express/supervisor/shared/board.o build-feather_m0_express/supervisor/shared/display.o build-feather_m0_express/supervisor/shared/filesystem.o build-feather_m0_express/supervisor/shared/flash.o build-feather_m0_express/supervisor/shared/micropython.o build-feather_m0_express/supervisor/shared/rgb_led_status.o build-feather_m0_express/supervisor/shared/safe_mode.o build-feather_m0_express/supervisor/shared/stack.o build-feather_m0_express/supervisor/shared/status_leds.o build-feather_m0_express/supervisor/shared/tick.o build-feather_m0_express/supervisor/shared/translate.o build-feather_m0_express/supervisor/shared/external_flash/external_flash.o build-feather_m0_express/supervisor/shared/external_flash/spi_flash.o build-feather_m0_express/lib/tinyusb/src/common/tusb_fifo.o build-feather_m0_express/lib/tinyusb/src/device/usbd.o build-feather_m0_express/lib/tinyusb/src/device/usbd_control.o build-feather_m0_express/lib/tinyusb/src/class/msc/msc_device.o build-feather_m0_express/lib/tinyusb/src/class/cdc/cdc_device.o build-feather_m0_express/lib/tinyusb/src/class/hid/hid_device.o build-feather_m0_express/lib/tinyusb/src/class/midi/midi_device.o build-feather_m0_express/lib/tinyusb/src/tusb.o build-feather_m0_express/supervisor/shared/serial.o build-feather_m0_express/supervisor/usb.o build-feather_m0_express/supervisor/shared/usb/usb_desc.o build-feather_m0_express/supervisor/shared/usb/usb.o build-feather_m0_express/supervisor/shared/usb/usb_msc_flash.o build-feather_m0_express/shared-bindings/usb_hid/__init__.o build-feather_m0_express/shared-bindings/usb_hid/Device.o build-feather_m0_express/shared-bindings/usb_midi/__init__.o build-feather_m0_express/shared-bindings/usb_midi/PortIn.o build-feather_m0_express/shared-bindings/usb_midi/PortOut.o build-feather_m0_express/shared-module/usb_hid/__init__.o build-feather_m0_express/shared-module/usb_hid/Device.o build-feather_m0_express/shared-module/usb_midi/__init__.o build-feather_m0_express/shared-module/usb_midi/PortIn.o build-feather_m0_express/shared-module/usb_midi/PortOut.o build-feather_m0_express/build-feather_m0_express/autogen_usb_descriptor.o build-feather_m0_express/autogen_display_resources.o build-feather_m0_express/audio_dma.o build-feather_m0_express/background.o build-feather_m0_express/bindings/samd/Clock.o build-feather_m0_express/bindings/samd/__init__.o build-feather_m0_express/boards/feather_m0_express/board.o build-feather_m0_express/boards/feather_m0_express/pins.o build-feather_m0_express/eic_handler.o build-feather_m0_express/fatfs_port.o build-feather_m0_express/freetouch/adafruit_ptc.o build-feather_m0_express/lib/libc/string0.o build-feather_m0_express/lib/mp-readline/readline.o build-feather_m0_express/lib/oofatfs/ff.o build-feather_m0_express/lib/oofatfs/option/ccsbcs.o build-feather_m0_express/lib/timeutils/timeutils.o build-feather_m0_express/lib/tinyusb/src/portable/microchip/samd/dcd_samd.o build-feather_m0_express/lib/utils/buffer_helper.o build-feather_m0_express/lib/utils/context_manager_helpers.o build-feather_m0_express/lib/utils/interrupt_char.o build-feather_m0_express/lib/utils/pyexec.o build-feather_m0_express/lib/utils/stdout_helpers.o build-feather_m0_express/lib/utils/sys_stdio_mphal.o build-feather_m0_express/mphalport.o build-feather_m0_express/peripherals/samd/samd21/adc.o build-feather_m0_express/peripherals/samd/samd21/cache.o build-feather_m0_express/peripherals/samd/samd21/clocks.o build-feather_m0_express/peripherals/samd/samd21/dma.o build-feather_m0_express/peripherals/samd/samd21/events.o build-feather_m0_express/peripherals/samd/samd21/external_interrupts.o build-feather_m0_express/peripherals/samd/samd21/pins.o build-feather_m0_express/peripherals/samd/samd21/sercom.o build-feather_m0_express/peripherals/samd/samd21/timers.o build-feather_m0_express/peripherals/samd/clocks.o build-feather_m0_express/peripherals/samd/dma.o build-feather_m0_express/peripherals/samd/events.o build-feather_m0_express/peripherals/samd/external_interrupts.o build-feather_m0_express/peripherals/samd/sercom.o build-feather_m0_express/peripherals/samd/timers.o build-feather_m0_express/reset.o build-feather_m0_express/supervisor/shared/memory.o build-feather_m0_express/tick.o build-feather_m0_express/timer_handler.o build-feather_m0_express/peripherals/samd/i2s.o build-feather_m0_express/peripherals/samd/samd21/i2s.o build-feather_m0_express/asf4/samd21/gcc/gcc/startup_samd21.o build-feather_m0_express/asf4/samd21/gcc/system_samd21.o build-feather_m0_express/asf4/samd21/hal/src/hal_adc_sync.o build-feather_m0_express/asf4/samd21/hal/src/hal_atomic.o build-feather_m0_express/asf4/samd21/hal/src/hal_calendar.o build-feather_m0_express/asf4/samd21/hal/src/hal_dac_sync.o build-feather_m0_express/asf4/samd21/hal/src/hal_delay.o build-feather_m0_express/asf4/samd21/hal/src/hal_flash.o build-feather_m0_express/asf4/samd21/hal/src/hal_i2c_m_sync.o build-feather_m0_express/asf4/samd21/hal/src/hal_io.o build-feather_m0_express/asf4/samd21/hal/src/hal_sleep.o build-feather_m0_express/asf4/samd21/hal/src/hal_spi_m_sync.o build-feather_m0_express/asf4/samd21/hal/src/hal_timer.o build-feather_m0_express/asf4/samd21/hal/src/hal_usart_async.o build-feather_m0_express/asf4/samd21/hpl/adc/hpl_adc.o build-feather_m0_express/asf4/samd21/hpl/core/hpl_init.o build-feather_m0_express/asf4/samd21/hpl/dac/hpl_dac.o build-feather_m0_express/asf4/samd21/hpl/gclk/hpl_gclk.o build-feather_m0_express/asf4/samd21/hpl/nvmctrl/hpl_nvmctrl.o build-feather_m0_express/asf4/samd21/hpl/pm/hpl_pm.o build-feather_m0_express/asf4/samd21/hpl/rtc/hpl_rtc.o build-feather_m0_express/asf4/samd21/hpl/sercom/hpl_sercom.o build-feather_m0_express/asf4/samd21/hpl/systick/hpl_systick.o build-feather_m0_express/asf4/samd21/hal/utils/src/utils_list.o build-feather_m0_express/asf4/samd21/hal/utils/src/utils_ringbuffer.o build-feather_m0_express/asf4/samd21/hpl/core/hpl_core_m0plus_base.o build-feather_m0_express/asf4/samd21/hpl/sysctrl/hpl_sysctrl.o build-feather_m0_express/common-hal/analogio/AnalogIn.o build-feather_m0_express/common-hal/analogio/AnalogOut.o build-feather_m0_express/common-hal/analogio/__init__.o build-feather_m0_express/common-hal/audiobusio/I2SOut.o build-feather_m0_express/common-hal/audiobusio/PDMIn.o build-feather_m0_express/common-hal/audiobusio/__init__.o build-feather_m0_express/common-hal/audioio/AudioOut.o build-feather_m0_express/common-hal/audioio/__init__.o build-feather_m0_express/common-hal/board/__init__.o build-feather_m0_express/common-hal/busio/I2C.o build-feather_m0_express/common-hal/busio/SPI.o build-feather_m0_express/common-hal/busio/UART.o build-feather_m0_express/common-hal/busio/__init__.o build-feather_m0_express/common-hal/digitalio/DigitalInOut.o build-feather_m0_express/common-hal/digitalio/__init__.o build-feather_m0_express/common-hal/displayio/ParallelBus.o build-feather_m0_express/common-hal/microcontroller/Pin.o build-feather_m0_express/common-hal/microcontroller/Processor.o build-feather_m0_express/common-hal/microcontroller/__init__.o build-feather_m0_express/common-hal/neopixel_write/__init__.o build-feather_m0_express/common-hal/nvm/ByteArray.o build-feather_m0_express/common-hal/nvm/__init__.o build-feather_m0_express/common-hal/os/__init__.o build-feather_m0_express/common-hal/pulseio/PWMOut.o build-feather_m0_express/common-hal/pulseio/PulseIn.o build-feather_m0_express/common-hal/pulseio/PulseOut.o build-feather_m0_express/common-hal/pulseio/__init__.o build-feather_m0_express/common-hal/rotaryio/IncrementalEncoder.o build-feather_m0_express/common-hal/rotaryio/__init__.o build-feather_m0_express/common-hal/rtc/RTC.o build-feather_m0_express/common-hal/rtc/__init__.o build-feather_m0_express/common-hal/supervisor/Runtime.o build-feather_m0_express/common-hal/supervisor/__init__.o build-feather_m0_express/common-hal/time/__init__.o build-feather_m0_express/common-hal/touchio/TouchIn.o build-feather_m0_express/common-hal/touchio/__init__.o build-feather_m0_express/shared-bindings/_pixelbuf/PixelBuf.o build-feather_m0_express/shared-bindings/_pixelbuf/__init__.o build-feather_m0_express/shared-bindings/analogio/AnalogIn.o build-feather_m0_express/shared-bindings/analogio/AnalogOut.o build-feather_m0_express/shared-bindings/analogio/__init__.o build-feather_m0_express/shared-bindings/audiobusio/I2SOut.o build-feather_m0_express/shared-bindings/audiobusio/PDMIn.o build-feather_m0_express/shared-bindings/audiobusio/__init__.o build-feather_m0_express/shared-bindings/audiocore/RawSample.o build-feather_m0_express/shared-bindings/audiocore/WaveFile.o build-feather_m0_express/shared-bindings/audiocore/__init__.o build-feather_m0_express/shared-bindings/audioio/AudioOut.o build-feather_m0_express/shared-bindings/audioio/__init__.o build-feather_m0_express/shared-bindings/bitbangio/OneWire.o build-feather_m0_express/shared-bindings/board/__init__.o build-feather_m0_express/shared-bindings/busio/I2C.o build-feather_m0_express/shared-bindings/busio/OneWire.o build-feather_m0_express/shared-bindings/busio/SPI.o build-feather_m0_express/shared-bindings/busio/UART.o build-feather_m0_express/shared-bindings/busio/__init__.o build-feather_m0_express/shared-bindings/digitalio/DigitalInOut.o build-feather_m0_express/shared-bindings/digitalio/Direction.o build-feather_m0_express/shared-bindings/digitalio/DriveMode.o build-feather_m0_express/shared-bindings/digitalio/Pull.o build-feather_m0_express/shared-bindings/digitalio/__init__.o build-feather_m0_express/shared-bindings/displayio/Bitmap.o build-feather_m0_express/shared-bindings/displayio/ColorConverter.o build-feather_m0_express/shared-bindings/displayio/Display.o build-feather_m0_express/shared-bindings/displayio/EPaperDisplay.o build-feather_m0_express/shared-bindings/displayio/FourWire.o build-feather_m0_express/shared-bindings/displayio/Group.o build-feather_m0_express/shared-bindings/displayio/I2CDisplay.o build-feather_m0_express/shared-bindings/displayio/OnDiskBitmap.o build-feather_m0_express/shared-bindings/displayio/Palette.o build-feather_m0_express/shared-bindings/displayio/ParallelBus.o build-feather_m0_express/shared-bindings/displayio/Shape.o build-feather_m0_express/shared-bindings/displayio/TileGrid.o build-feather_m0_express/shared-bindings/displayio/__init__.o build-feather_m0_express/shared-bindings/fontio/BuiltinFont.o build-feather_m0_express/shared-bindings/fontio/Glyph.o build-feather_m0_express/shared-bindings/fontio/__init__.o build-feather_m0_express/shared-bindings/gamepad/GamePad.o build-feather_m0_express/shared-bindings/gamepad/__init__.o build-feather_m0_express/shared-bindings/help.o build-feather_m0_express/shared-bindings/math/__init__.o build-feather_m0_express/shared-bindings/microcontroller/Pin.o build-feather_m0_express/shared-bindings/microcontroller/Processor.o build-feather_m0_express/shared-bindings/microcontroller/RunMode.o build-feather_m0_express/shared-bindings/microcontroller/__init__.o build-feather_m0_express/shared-bindings/neopixel_write/__init__.o build-feather_m0_express/shared-bindings/nvm/ByteArray.o build-feather_m0_express/shared-bindings/nvm/__init__.o build-feather_m0_express/shared-bindings/os/__init__.o build-feather_m0_express/shared-bindings/pulseio/PWMOut.o build-feather_m0_express/shared-bindings/pulseio/PulseIn.o build-feather_m0_express/shared-bindings/pulseio/PulseOut.o build-feather_m0_express/shared-bindings/pulseio/__init__.o build-feather_m0_express/shared-bindings/random/__init__.o build-feather_m0_express/shared-bindings/rotaryio/IncrementalEncoder.o build-feather_m0_express/shared-bindings/rotaryio/__init__.o build-feather_m0_express/shared-bindings/rtc/RTC.o build-feather_m0_express/shared-bindings/rtc/__init__.o build-feather_m0_express/shared-bindings/storage/__init__.o build-feather_m0_express/shared-bindings/struct/__init__.o build-feather_m0_express/shared-bindings/supervisor/Runtime.o build-feather_m0_express/shared-bindings/supervisor/__init__.o build-feather_m0_express/shared-bindings/terminalio/Terminal.o build-feather_m0_express/shared-bindings/terminalio/__init__.o build-feather_m0_express/shared-bindings/time/__init__.o build-feather_m0_express/shared-bindings/touchio/TouchIn.o build-feather_m0_express/shared-bindings/touchio/__init__.o build-feather_m0_express/shared-bindings/util.o build-feather_m0_express/shared-module/_pixelbuf/PixelBuf.o build-feather_m0_express/shared-module/_pixelbuf/__init__.o build-feather_m0_express/shared-module/audiocore/RawSample.o build-feather_m0_express/shared-module/audiocore/WaveFile.o build-feather_m0_express/shared-module/audiocore/__init__.o build-feather_m0_express/shared-module/audioio/__init__.o build-feather_m0_express/shared-module/bitbangio/OneWire.o build-feather_m0_express/shared-module/board/__init__.o build-feather_m0_express/shared-module/busio/OneWire.o build-feather_m0_express/shared-module/displayio/Bitmap.o build-feather_m0_express/shared-module/displayio/ColorConverter.o build-feather_m0_express/shared-module/displayio/Display.o build-feather_m0_express/shared-module/displayio/EPaperDisplay.o build-feather_m0_express/shared-module/displayio/FourWire.o build-feather_m0_express/shared-module/displayio/Group.o build-feather_m0_express/shared-module/displayio/I2CDisplay.o build-feather_m0_express/shared-module/displayio/OnDiskBitmap.o build-feather_m0_express/shared-module/displayio/Palette.o build-feather_m0_express/shared-module/displayio/Shape.o build-feather_m0_express/shared-module/displayio/TileGrid.o build-feather_m0_express/shared-module/displayio/__init__.o build-feather_m0_express/shared-module/displayio/display_core.o build-feather_m0_express/shared-module/fontio/BuiltinFont.o build-feather_m0_express/shared-module/fontio/__init__.o build-feather_m0_express/shared-module/gamepad/GamePad.o build-feather_m0_express/shared-module/gamepad/__init__.o build-feather_m0_express/shared-module/os/__init__.o build-feather_m0_express/shared-module/random/__init__.o build-feather_m0_express/shared-module/storage/__init__.o build-feather_m0_express/shared-module/struct/__init__.o build-feather_m0_express/shared-module/terminalio/Terminal.o build-feather_m0_express/shared-module/terminalio/__init__.o build-feather_m0_express/lib/libm/math.o build-feather_m0_express/lib/libm/roundf.o build-feather_m0_express/lib/libm/fmodf.o build-feather_m0_express/lib/libm/nearbyintf.o build-feather_m0_express/lib/libm/ef_sqrt.o build-feather_m0_express/lib/libm/kf_rem_pio2.o build-feather_m0_express/lib/libm/kf_sin.o build-feather_m0_express/lib/libm/kf_cos.o build-feather_m0_express/lib/libm/kf_tan.o build-feather_m0_express/lib/libm/ef_rem_pio2.o build-feather_m0_express/lib/libm/sf_sin.o build-feather_m0_express/lib/libm/sf_cos.o build-feather_m0_express/lib/libm/sf_tan.o build-feather_m0_express/lib/libm/sf_frexp.o build-feather_m0_express/lib/libm/sf_modf.o build-feather_m0_express/lib/libm/sf_ldexp.o build-feather_m0_express/lib/libm/asinfacosf.o build-feather_m0_express/lib/libm/atanf.o build-feather_m0_express/lib/libm/atan2f.o build-feather_m0_express/supervisor/samd21_cpu.o -Wl,--start-group -lgcc -lc -Wl,--end-group -arm-none-eabi-size build-feather_m0_express/firmware.elf | python3 ../../tools/build_memory_info.py build-feather_m0_express/common.ld - -4784 bytes free in flash firmware space out of 253696 bytes (247.75kB). -22784 bytes free in ram for stack and heap out of 32768 bytes (32.0kB). - -Create build-feather_m0_express/firmware.bin -arm-none-eabi-objcopy -O binary -j .vectors -j .text -j .data build-feather_m0_express/firmware.elf build-feather_m0_express/firmware.bin -Create build-feather_m0_express/firmware.uf2 -python3 ../../tools/uf2/utils/uf2conv.py -b 0x2000 -c -o build-feather_m0_express/firmware.uf2 build-feather_m0_express/firmware.bin -Converting to uf2, output size: 498176, start address: 0x2000 -Wrote 498176 bytes to build-feather_m0_express/firmware.uf2 From abd340a8e465fedd2b5d74989440532c767ccf9e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 Apr 2020 11:35:19 -0700 Subject: [PATCH 259/919] Remove tick.h from merged file. --- shared-module/framebufferio/FramebufferDisplay.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index bd0764e8e4..3e8797e13d 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -39,8 +39,6 @@ #include #include -#include "tick.h" - void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, mp_obj_t framebuffer, uint16_t width, uint16_t height, uint16_t rotation, uint16_t color_depth, From 5b0d9bdeb0cd86c33a932ccda901c89dacc11239 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 16 Apr 2020 14:21:26 -0700 Subject: [PATCH 260/919] Update copyright to bump the CI --- ports/litex/common-hal/os/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/litex/common-hal/os/__init__.c b/ports/litex/common-hal/os/__init__.c index 219be930f1..578f3e8c63 100644 --- a/ports/litex/common-hal/os/__init__.c +++ b/ports/litex/common-hal/os/__init__.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Sean Cross * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From 9e49fc13f4f894855c464427f8725e58fb2d8557 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 16 Apr 2020 14:53:52 -0400 Subject: [PATCH 261/919] startup file crash fix, H7 bin fix --- ports/stm/Makefile | 15 +++++++++------ ports/stm/supervisor/port.c | 8 ++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 765f062fea..c152b76f1a 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -93,8 +93,7 @@ endif # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -# Removed -nostdlib since it conflicts with stm32 startup files +CFLAGS += $(INC) -Werror -Wall -std=gnu11 $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs @@ -264,6 +263,12 @@ SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(S # Sources that only hold QSTRs after pre-processing. SRC_QSTR_PREPROCESSOR += +# Bin section settings specific to the STM32H7 +ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32H743xx)) +MCU_SECTIONS = -j .isr_vector -j .text -j .data -j .itcm -j .dtcm_data $^ $@ +else +MCU_SECTIONS = $^ $@ +endif all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 @@ -274,13 +279,11 @@ $(BUILD)/firmware.elf: $(OBJ) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" - $(Q)$(OBJCOPY) -O binary $^ $@ -# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ + $(Q)$(OBJCOPY) -O binary $(MCU_SECTIONS) $(BUILD)/firmware.hex: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" - $(Q)$(OBJCOPY) -O ihex $^ $@ -# $(Q)$(OBJCOPY) -O ihex -j .vectors -j .text -j .data $^ $@ + $(Q)$(OBJCOPY) -O ihex $(MCU_SECTIONS) $(BUILD)/firmware.uf2: $(BUILD)/firmware.hex $(ECHO) "Create $@" diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 639abeb186..21ff0b5751 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -246,3 +246,11 @@ __attribute__((used)) void HardFault_Handler(void) asm("nop;"); } } + +// Required by __libc_init_array in startup code if we are compiling using +// -nostdlib/-nostartfiles. +void _init(void) +{ + +} + From 43022d829491b47710c2c1d9689239c2ea7f2a8a Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 17 Apr 2020 09:50:11 +0200 Subject: [PATCH 262/919] Add copyrights to pewpew m4 and ugame board.c --- ports/atmel-samd/boards/pewpew_m4/board.c | 3 ++- ports/atmel-samd/boards/ugame10/board.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 0e28fe4fc1..bfec489e70 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -3,7 +3,8 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries, 2020 Radomir + * Dopieralski * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 04a4c7addf..d3a452119c 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -3,7 +3,8 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries, 2020 Radomir + * Dopieralski * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From 7e3d4c61b5495a4190bc8c911557abb58a9f2e7b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Apr 2020 14:16:49 -0700 Subject: [PATCH 263/919] Update TinyUSB and add interrupt hooks. --- lib/tinyusb | 2 +- ports/atmel-samd/supervisor/usb.c | 25 +++++++++++++++++++++++++ ports/litex/mphalport.c | 3 +-- ports/mimxrt10xx/supervisor/usb.c | 2 +- ports/nrf/supervisor/usb.c | 4 ++++ ports/stm/supervisor/usb.c | 8 ++++++-- supervisor/shared/usb/usb_desc.c | 2 +- 7 files changed, 39 insertions(+), 7 deletions(-) diff --git a/lib/tinyusb b/lib/tinyusb index 1f95f439e1..3ed9515e70 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 1f95f439e11f519e69d75a4a8b7b9f28eaf5060e +Subproject commit 3ed9515e70b0c6bc375cd058dcc6b8b78b00899a diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index d13ca0ef13..b8a94790d7 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -28,6 +28,7 @@ #include "hpl/pm/hpl_pm_base.h" #include "hpl/gclk/hpl_gclk_base.h" #include "hal_gpio.h" +#include "lib/tinyusb/src/device/usbd.h" void init_usb_hardware(void) { #ifdef SAMD21 @@ -57,3 +58,27 @@ void init_usb_hardware(void) { gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP); #endif } + +#ifdef SAMD21 +void USB_Handler(void) { + tud_int_handler(0); +} +#endif + +#ifdef SAMD51 +void USB_0_Handler (void) { + tud_int_handler(0); +} + +void USB_1_Handler (void) { + tud_int_handler(0); +} + +void USB_2_Handler (void) { + tud_int_handler(0); +} + +void USB_3_Handler (void) { + tud_int_handler(0); +} +#endif diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 0b8f012985..b65b59cca0 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -37,7 +37,6 @@ #include "irq.h" #ifdef CFG_TUSB_MCU - void hal_dcd_isr(uint8_t rhport); #endif /*------------------------------------------------------------------*/ @@ -72,7 +71,7 @@ void isr(void) { #ifdef CFG_TUSB_MCU if (irqs & (1 << USB_INTERRUPT)) - hal_dcd_isr(0); + tud_int_handler(0); #endif if (irqs & (1 << TIMER0_INTERRUPT)) SysTick_Handler(); diff --git a/ports/mimxrt10xx/supervisor/usb.c b/ports/mimxrt10xx/supervisor/usb.c index 051fcca9de..1bc7ea9b56 100644 --- a/ports/mimxrt10xx/supervisor/usb.c +++ b/ports/mimxrt10xx/supervisor/usb.c @@ -56,5 +56,5 @@ void init_usb_hardware(void) { } void USB_OTG1_IRQHandler(void) { - tud_isr(0); + tud_int_handler(0); } diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index bb9d78101c..75aeec651f 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -87,3 +87,7 @@ void init_usb_hardware(void) { } } } + +void USBD_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index b66107b7ba..e981723d67 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -63,13 +63,13 @@ STATIC void init_usb_vbus_sense(void) { } void init_usb_hardware(void) { - //TODO: if future chips overload this with options, move to peripherals management. + //TODO: if future chips overload this with options, move to peripherals management. GPIO_InitTypeDef GPIO_InitStruct = {0}; /**USB_OTG_FS GPIO Configuration PA10 ------> USB_OTG_FS_ID PA11 ------> USB_OTG_FS_DM - PA12 ------> USB_OTG_FS_DP + PA12 ------> USB_OTG_FS_DP */ __HAL_RCC_GPIOA_CLK_ENABLE(); @@ -129,3 +129,7 @@ void init_usb_hardware(void) { init_usb_vbus_sense(); } + +void OTG_FS_IRQHandler(void) { + tud_int_handler(0); +} diff --git a/supervisor/shared/usb/usb_desc.c b/supervisor/shared/usb/usb_desc.c index 9b333d6fea..080187ebc5 100644 --- a/supervisor/shared/usb/usb_desc.c +++ b/supervisor/shared/usb/usb_desc.c @@ -52,7 +52,7 @@ uint8_t const * tud_hid_descriptor_report_cb(void) { // Invoked when received GET STRING DESCRIPTOR request // Application return pointer to descriptor, whose contents must exist long enough for transfer to complete -uint16_t const* tud_descriptor_string_cb(uint8_t index) { +uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) { uint8_t const max_index = sizeof(string_desc_arr)/sizeof(string_desc_arr[0]); return (index < max_index) ? string_desc_arr[index] : NULL; } From d2aac7a754b748c48250c4d53de2d5601bd761ab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 09:12:40 -0500 Subject: [PATCH 264/919] Protomatter: add width, height properties --- shared-bindings/_protomatter/Protomatter.c | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/_protomatter/Protomatter.c index bb43390796..1efdb2c0c0 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/_protomatter/Protomatter.c @@ -314,10 +314,49 @@ STATIC mp_obj_t protomatter_protomatter_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_refresh_obj, protomatter_protomatter_refresh); +//| .. attribute:: width +//| +//| The width of the display, in pixels +//| +STATIC mp_obj_t protomatter_protomatter_get_width(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(self->width); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_width_obj, protomatter_protomatter_get_width); +const mp_obj_property_t protomatter_protomatter_width_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_width_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: height +//| +//| The height of the display, in pixels +//| +STATIC mp_obj_t protomatter_protomatter_get_height(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + int computed_get_height = (self->rgb_count / 3) << (self->addr_count); + return MP_OBJ_NEW_SMALL_INT(computed_get_height); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_height_obj, protomatter_protomatter_get_height); + +const mp_obj_property_t protomatter_protomatter_height_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_height_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&protomatter_protomatter_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&protomatter_protomatter_refresh_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&protomatter_protomatter_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&protomatter_protomatter_height_obj) }, }; STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); From d1ff23e0046a6462d4939b4b8c79f10182fabf9d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 09:13:02 -0500 Subject: [PATCH 265/919] framebufferio: get width, height from framebuffer properties --- .../framebufferio/FramebufferDisplay.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index aa8fc1a630..cccbc423ce 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -39,6 +39,10 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" +STATIC int get_int_property(mp_obj_t obj, qstr attr) { + return mp_obj_get_int(mp_load_attr(obj, attr)); +} + //| .. currentmodule:: framebufferio //| //| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM @@ -70,8 +74,8 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, - { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, }, + { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, @@ -84,6 +88,14 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; + if (args[ARG_width].u_int == 0) { + args[ARG_width].u_int = get_int_property(framebuffer, MP_QSTR_width); + } + + if (args[ARG_height].u_int == 0) { + args[ARG_height].u_int = get_int_property(framebuffer, MP_QSTR_height); + } + mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); From a32337718d48fa83e5ebd8c7168019b4196acd0e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 09:21:04 -0500 Subject: [PATCH 266/919] Rename _protomatter -> protomatter I originally believed that there would be a wrapper library around it, like with _pixelbuf; but this proves not to be the case, as there's too little for the library to do. --- .../{_protomatter => protomatter}/Protomatter.c | 2 +- .../{_protomatter => protomatter}/Protomatter.h | 0 .../{_protomatter => protomatter}/__init__.c | 0 .../{_protomatter => protomatter}/Protomatter.c | 2 +- .../{_protomatter => protomatter}/Protomatter.h | 0 .../{_protomatter => protomatter}/__init__.c | 0 py/circuitpy_defns.mk | 12 ++++++------ py/circuitpy_mpconfig.h | 2 +- .../{_protomatter => protomatter}/Protomatter.c | 4 ++-- .../{_protomatter => protomatter}/Protomatter.h | 2 +- .../{_protomatter => protomatter}/__init__.c | 4 ++-- shared-module/displayio/__init__.h | 2 +- .../{_protomatter => protomatter}/Protomatter.c | 6 +++--- .../{_protomatter => protomatter}/Protomatter.h | 0 .../{_protomatter => protomatter}/__init__.c | 0 .../{_protomatter => protomatter}/__init__.h | 0 .../{_protomatter => protomatter}/allocator.h | 0 17 files changed, 18 insertions(+), 18 deletions(-) rename ports/atmel-samd/common-hal/{_protomatter => protomatter}/Protomatter.c (98%) rename ports/atmel-samd/common-hal/{_protomatter => protomatter}/Protomatter.h (100%) rename ports/atmel-samd/common-hal/{_protomatter => protomatter}/__init__.c (100%) rename ports/nrf/common-hal/{_protomatter => protomatter}/Protomatter.c (98%) rename ports/nrf/common-hal/{_protomatter => protomatter}/Protomatter.h (100%) rename ports/nrf/common-hal/{_protomatter => protomatter}/__init__.c (100%) rename shared-bindings/{_protomatter => protomatter}/Protomatter.c (99%) rename shared-bindings/{_protomatter => protomatter}/Protomatter.h (98%) rename shared-bindings/{_protomatter => protomatter}/__init__.c (94%) rename shared-module/{_protomatter => protomatter}/Protomatter.c (97%) rename shared-module/{_protomatter => protomatter}/Protomatter.h (100%) rename shared-module/{_protomatter => protomatter}/__init__.c (100%) rename shared-module/{_protomatter => protomatter}/__init__.h (100%) rename shared-module/{_protomatter => protomatter}/allocator.h (100%) diff --git a/ports/atmel-samd/common-hal/_protomatter/Protomatter.c b/ports/atmel-samd/common-hal/protomatter/Protomatter.c similarity index 98% rename from ports/atmel-samd/common-hal/_protomatter/Protomatter.c rename to ports/atmel-samd/common-hal/protomatter/Protomatter.c index bf9cafb6b9..c9e2b0ce1c 100644 --- a/ports/atmel-samd/common-hal/_protomatter/Protomatter.c +++ b/ports/atmel-samd/common-hal/protomatter/Protomatter.c @@ -26,7 +26,7 @@ #include -#include "common-hal/_protomatter/Protomatter.h" +#include "common-hal/protomatter/Protomatter.h" #include "samd/timers.h" #include "timer_handler.h" diff --git a/ports/atmel-samd/common-hal/_protomatter/Protomatter.h b/ports/atmel-samd/common-hal/protomatter/Protomatter.h similarity index 100% rename from ports/atmel-samd/common-hal/_protomatter/Protomatter.h rename to ports/atmel-samd/common-hal/protomatter/Protomatter.h diff --git a/ports/atmel-samd/common-hal/_protomatter/__init__.c b/ports/atmel-samd/common-hal/protomatter/__init__.c similarity index 100% rename from ports/atmel-samd/common-hal/_protomatter/__init__.c rename to ports/atmel-samd/common-hal/protomatter/__init__.c diff --git a/ports/nrf/common-hal/_protomatter/Protomatter.c b/ports/nrf/common-hal/protomatter/Protomatter.c similarity index 98% rename from ports/nrf/common-hal/_protomatter/Protomatter.c rename to ports/nrf/common-hal/protomatter/Protomatter.c index b6e55bbd4c..45d75e9127 100644 --- a/ports/nrf/common-hal/_protomatter/Protomatter.c +++ b/ports/nrf/common-hal/protomatter/Protomatter.c @@ -26,7 +26,7 @@ #include -#include "common-hal/_protomatter/Protomatter.h" +#include "common-hal/protomatter/Protomatter.h" #include "peripherals/nrf/timers.h" diff --git a/ports/nrf/common-hal/_protomatter/Protomatter.h b/ports/nrf/common-hal/protomatter/Protomatter.h similarity index 100% rename from ports/nrf/common-hal/_protomatter/Protomatter.h rename to ports/nrf/common-hal/protomatter/Protomatter.h diff --git a/ports/nrf/common-hal/_protomatter/__init__.c b/ports/nrf/common-hal/protomatter/__init__.c similarity index 100% rename from ports/nrf/common-hal/_protomatter/__init__.c rename to ports/nrf/common-hal/protomatter/__init__.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b6b0cacaf8..9954121397 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -182,7 +182,7 @@ ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += _pixelbuf/% endif ifeq ($(CIRCUITPY_PROTOMATTER),1) -SRC_PATTERNS += _protomatter/% +SRC_PATTERNS += protomatter/% endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% @@ -248,8 +248,6 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ - _protomatter/Protomatter.c \ - _protomatter/__init__.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -279,6 +277,8 @@ SRC_COMMON_HAL_ALL = \ nvm/ByteArray.c \ nvm/__init__.c \ os/__init__.c \ + protomatter/Protomatter.c \ + protomatter/__init__.c \ pulseio/PWMOut.c \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ @@ -323,8 +323,6 @@ SRC_SHARED_MODULE_ALL = \ _bleio/ScanResults.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ - _protomatter/Protomatter.c \ - _protomatter/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ @@ -368,6 +366,8 @@ SRC_SHARED_MODULE_ALL = \ random/__init__.c \ socket/__init__.c \ network/__init__.c \ + protomatter/Protomatter.c \ + protomatter/__init__.c \ storage/__init__.c \ struct/__init__.c \ terminalio/Terminal.c \ @@ -417,7 +417,7 @@ ifeq ($(CIRCUITPY_PROTOMATTER),1) SRC_MOD += $(addprefix lib/protomatter/, \ core.c \ ) -$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/_protomatter/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/protomatter/allocator.h" -DCIRCUITPY -Wno-missing-braces endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 06289258d1..55e04b2936 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -463,7 +463,7 @@ extern const struct _mp_obj_module_t pixelbuf_module; #if CIRCUITPY_PROTOMATTER extern const struct _mp_obj_module_t protomatter_module; -#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__protomatter),(mp_obj_t)&protomatter_module }, +#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_protomatter),(mp_obj_t)&protomatter_module }, #else #define PROTOMATTER_MODULE #endif diff --git a/shared-bindings/_protomatter/Protomatter.c b/shared-bindings/protomatter/Protomatter.c similarity index 99% rename from shared-bindings/_protomatter/Protomatter.c rename to shared-bindings/protomatter/Protomatter.c index 1efdb2c0c0..cb46186345 100644 --- a/shared-bindings/_protomatter/Protomatter.c +++ b/shared-bindings/protomatter/Protomatter.c @@ -29,8 +29,8 @@ #include "py/runtime.h" #include "py/objarray.h" -#include "common-hal/_protomatter/Protomatter.h" -#include "shared-bindings/_protomatter/Protomatter.h" +#include "common-hal/protomatter/Protomatter.h" +#include "shared-bindings/protomatter/Protomatter.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" diff --git a/shared-bindings/_protomatter/Protomatter.h b/shared-bindings/protomatter/Protomatter.h similarity index 98% rename from shared-bindings/_protomatter/Protomatter.h rename to shared-bindings/protomatter/Protomatter.h index 9499da22c0..4704a626ff 100644 --- a/shared-bindings/_protomatter/Protomatter.h +++ b/shared-bindings/protomatter/Protomatter.h @@ -27,7 +27,7 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H #define MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H -#include "shared-module/_protomatter/Protomatter.h" +#include "shared-module/protomatter/Protomatter.h" #include "lib/protomatter/core.h" extern const mp_obj_type_t protomatter_Protomatter_type; diff --git a/shared-bindings/_protomatter/__init__.c b/shared-bindings/protomatter/__init__.c similarity index 94% rename from shared-bindings/_protomatter/__init__.c rename to shared-bindings/protomatter/__init__.c index 2281b15f10..fc429898f6 100644 --- a/shared-bindings/_protomatter/__init__.c +++ b/shared-bindings/protomatter/__init__.c @@ -29,7 +29,7 @@ #include "py/obj.h" #include "py/runtime.h" -#include "shared-bindings/_protomatter/Protomatter.h" +#include "shared-bindings/protomatter/Protomatter.h" //| :mod:`_protomatter` --- Low-level routines for bitbanged LED matrices //| ===================================================================== @@ -43,7 +43,7 @@ //| Protomatter STATIC const mp_rom_map_elem_t protomatter_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__protomatter) }, + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_protomatter) }, { MP_ROM_QSTR(MP_QSTR_Protomatter), MP_ROM_PTR(&protomatter_Protomatter_type) }, }; diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 278a5e78f3..f5045b19a2 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -36,7 +36,7 @@ #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/I2CDisplay.h" #include "shared-bindings/displayio/ParallelBus.h" -#include "shared-bindings/_protomatter/Protomatter.h" +#include "shared-bindings/protomatter/Protomatter.h" typedef struct { union { diff --git a/shared-module/_protomatter/Protomatter.c b/shared-module/protomatter/Protomatter.c similarity index 97% rename from shared-module/_protomatter/Protomatter.c rename to shared-module/protomatter/Protomatter.c index 77ca634763..37721cb1cf 100644 --- a/shared-module/_protomatter/Protomatter.c +++ b/shared-module/protomatter/Protomatter.c @@ -32,9 +32,9 @@ #include "py/objproperty.h" #include "py/runtime.h" -#include "common-hal/_protomatter/Protomatter.h" -#include "shared-module/_protomatter/allocator.h" -#include "shared-bindings/_protomatter/Protomatter.h" +#include "common-hal/protomatter/Protomatter.h" +#include "shared-module/protomatter/allocator.h" +#include "shared-bindings/protomatter/Protomatter.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" diff --git a/shared-module/_protomatter/Protomatter.h b/shared-module/protomatter/Protomatter.h similarity index 100% rename from shared-module/_protomatter/Protomatter.h rename to shared-module/protomatter/Protomatter.h diff --git a/shared-module/_protomatter/__init__.c b/shared-module/protomatter/__init__.c similarity index 100% rename from shared-module/_protomatter/__init__.c rename to shared-module/protomatter/__init__.c diff --git a/shared-module/_protomatter/__init__.h b/shared-module/protomatter/__init__.h similarity index 100% rename from shared-module/_protomatter/__init__.h rename to shared-module/protomatter/__init__.h diff --git a/shared-module/_protomatter/allocator.h b/shared-module/protomatter/allocator.h similarity index 100% rename from shared-module/_protomatter/allocator.h rename to shared-module/protomatter/allocator.h From 1a91a75b9cf13e5ccfda9e6ef92b842ca6474d9e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 09:29:59 -0500 Subject: [PATCH 267/919] framebufferio: get more properties direct from underlying framebuffer --- .../framebufferio/FramebufferDisplay.c | 43 +++++--------- shared-bindings/protomatter/Protomatter.c | 58 +++++++++++++++++++ 2 files changed, 72 insertions(+), 29 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index cccbc423ce..5014f39242 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -52,35 +52,21 @@ STATIC int get_int_property(mp_obj_t obj, qstr attr) { //| objects in CircuitPython, Display objects live until `displayio.release_displays()` //| is called. This is done so that CircuitPython can use the display itself. //| -//| .. class:: FramebufferDisplay(framebuffer, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, grayscale=False, pixels_in_byte_share_row=True, bytes_per_cell=1, reverse_pixels_in_byte=False, backlight_pin=None, brightness=1.0, auto_brightness=False, auto_refresh=True, native_frames_per_second=60) +//| .. class:: FramebufferDisplay(framebuffer, *, rotation=0, auto_refresh=True) //| //| Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| //| :param framebuffer: The framebuffer that the display is connected to //| :type framebuffer: any core object implementing the framebuffer protocol -//| :param int width: Width in pixels -//| :param int height: Height in pixels -//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) -//| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays -//| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.) -//| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. -//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight -//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. -//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. //| :param bool auto_refresh: Automatically refresh the screen -//| :param int native_frames_per_second: Number of display refreshes per second +//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) //| STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS }; + enum { ARG_framebuffer, ARG_rotation, ARG_auto_refresh, NUM_ARGS }; static const mp_arg_t allowed_args[] = { { MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - { MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} }, - { MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} }, { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, - { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, }; MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -88,31 +74,30 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; - if (args[ARG_width].u_int == 0) { - args[ARG_width].u_int = get_int_property(framebuffer, MP_QSTR_width); - } - - if (args[ARG_height].u_int == 0) { - args[ARG_height].u_int = get_int_property(framebuffer, MP_QSTR_height); - } - mp_int_t rotation = args[ARG_rotation].u_int; if (rotation % 90 != 0) { mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } + int width = get_int_property(framebuffer, MP_QSTR_width); + int height = get_int_property(framebuffer, MP_QSTR_height); + int color_depth = get_int_property(framebuffer, MP_QSTR_color_depth); + int bytes_per_cell = get_int_property(framebuffer, MP_QSTR_bytes_per_cell); + int native_frames_per_second = get_int_property(framebuffer, MP_QSTR_native_frames_per_second); + primary_display_t *disp = allocate_display_or_raise(); framebufferio_framebufferdisplay_obj_t *self = &disp->framebuffer_display; self->base.type = &framebufferio_framebufferdisplay_type; common_hal_framebufferio_framebufferdisplay_construct( self, framebuffer, - args[ARG_width].u_int, args[ARG_height].u_int, + width, + height, rotation, - args[ARG_color_depth].u_int, - args[ARG_bytes_per_cell].u_int, + color_depth, + bytes_per_cell, args[ARG_auto_refresh].u_bool, - args[ARG_native_frames_per_second].u_int + native_frames_per_second ); return self; diff --git a/shared-bindings/protomatter/Protomatter.c b/shared-bindings/protomatter/Protomatter.c index cb46186345..59e41ceeb1 100644 --- a/shared-bindings/protomatter/Protomatter.c +++ b/shared-bindings/protomatter/Protomatter.c @@ -350,6 +350,61 @@ const mp_obj_property_t protomatter_protomatter_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| .. attribute:: bytes_per_cell +//| +//| The bytes_per_cell of the display, in pixels. Always equal to 1. +//| +STATIC mp_obj_t protomatter_protomatter_get_bytes_per_cell(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(1); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_bytes_per_cell_obj, protomatter_protomatter_get_bytes_per_cell); + +const mp_obj_property_t protomatter_protomatter_bytes_per_cell_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_bytes_per_cell_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: color_depth +//| +//| The color_depth of the framebuffer, in bits. Always equal to 16. This +//| is different than the constructor's "bit_depth". +//| +STATIC mp_obj_t protomatter_protomatter_get_color_depth(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(16); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_color_depth_obj, protomatter_protomatter_get_color_depth); + +const mp_obj_property_t protomatter_protomatter_color_depth_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_color_depth_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: native_frames_per_second +//| +//| The native_frames_per_second of the display. Always equal to 250. +//| +STATIC mp_obj_t protomatter_protomatter_get_native_frames_per_second(mp_obj_t self_in) { + protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(250); +} +MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_native_frames_per_second_obj, protomatter_protomatter_get_native_frames_per_second); + +const mp_obj_property_t protomatter_protomatter_native_frames_per_second_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&protomatter_protomatter_get_native_frames_per_second_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, @@ -357,6 +412,9 @@ STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&protomatter_protomatter_refresh_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&protomatter_protomatter_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&protomatter_protomatter_height_obj) }, + { MP_ROM_QSTR(MP_QSTR_color_depth), MP_ROM_PTR(&protomatter_protomatter_color_depth_obj) }, + { MP_ROM_QSTR(MP_QSTR_bytes_per_cell), MP_ROM_PTR(&protomatter_protomatter_bytes_per_cell_obj) }, + { MP_ROM_QSTR(MP_QSTR_native_frames_per_second), MP_ROM_PTR(&protomatter_protomatter_native_frames_per_second_obj) }, }; STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); From 545b6e560a206fe2836647829e1707240d364c5f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 10:00:07 -0500 Subject: [PATCH 268/919] fix doc build --- shared-bindings/protomatter/Protomatter.c | 6 +++--- shared-bindings/protomatter/__init__.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared-bindings/protomatter/Protomatter.c b/shared-bindings/protomatter/Protomatter.c index 59e41ceeb1..e3f735dde6 100644 --- a/shared-bindings/protomatter/Protomatter.c +++ b/shared-bindings/protomatter/Protomatter.c @@ -38,9 +38,9 @@ #include "shared-module/framebufferio/__init__.h" #include "shared-module/framebufferio/FramebufferDisplay.h" -//| .. currentmodule:: _protomatter +//| .. currentmodule:: protomatter //| -//| :class:`protomatter` -- Driver for HUB75-style RGB LED matrices +//| :class:`Protomatter` -- Driver for HUB75-style RGB LED matrices //| ================================================================ //| @@ -133,7 +133,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| :class:`~_protomatter.Protomatter` displays an in-memory framebuffer to an LED matrix. +//| :class:`~protomatter.Protomatter` displays an in-memory framebuffer to an LED matrix. //| //| .. class:: Protomatter(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, *, doublebuffer=True, framebuffer=None) //| diff --git a/shared-bindings/protomatter/__init__.c b/shared-bindings/protomatter/__init__.c index fc429898f6..8f145d1968 100644 --- a/shared-bindings/protomatter/__init__.c +++ b/shared-bindings/protomatter/__init__.c @@ -31,10 +31,10 @@ #include "shared-bindings/protomatter/Protomatter.h" -//| :mod:`_protomatter` --- Low-level routines for bitbanged LED matrices +//| :mod:`protomatter` --- Low-level routines for bitbanged LED matrices //| ===================================================================== //| -//| .. module:: _protomatter +//| .. module:: protomatter //| :synopsis: Low-level routines for bitbanged LED matrices //| //| .. toctree:: From 64c3968a2e2c626036fcd3d148eae7ba092e6096 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 10:19:33 -0500 Subject: [PATCH 269/919] protomatter: move get_width/height to common_hal --- shared-bindings/protomatter/Protomatter.c | 5 ++--- shared-bindings/protomatter/Protomatter.h | 2 ++ shared-module/protomatter/Protomatter.c | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/shared-bindings/protomatter/Protomatter.c b/shared-bindings/protomatter/Protomatter.c index e3f735dde6..4554c30bf0 100644 --- a/shared-bindings/protomatter/Protomatter.c +++ b/shared-bindings/protomatter/Protomatter.c @@ -321,7 +321,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_refresh_obj, protomatter_proto STATIC mp_obj_t protomatter_protomatter_get_width(mp_obj_t self_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(self->width); + return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_width(self)); } MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_width_obj, protomatter_protomatter_get_width); const mp_obj_property_t protomatter_protomatter_width_obj = { @@ -338,8 +338,7 @@ const mp_obj_property_t protomatter_protomatter_width_obj = { STATIC mp_obj_t protomatter_protomatter_get_height(mp_obj_t self_in) { protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; check_for_deinit(self); - int computed_get_height = (self->rgb_count / 3) << (self->addr_count); - return MP_OBJ_NEW_SMALL_INT(computed_get_height); + return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_height(self)); } MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_height_obj, protomatter_protomatter_get_height); diff --git a/shared-bindings/protomatter/Protomatter.h b/shared-bindings/protomatter/Protomatter.h index 4704a626ff..061c8de4e5 100644 --- a/shared-bindings/protomatter/Protomatter.h +++ b/shared-bindings/protomatter/Protomatter.h @@ -55,5 +55,7 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused); bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self); void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* self); +int common_hal_protomatter_protomatter_get_width(protomatter_protomatter_obj_t* self); +int common_hal_protomatter_protomatter_get_height(protomatter_protomatter_obj_t* self); #endif diff --git a/shared-module/protomatter/Protomatter.c b/shared-module/protomatter/Protomatter.c index 37721cb1cf..e7fa4ba9ae 100644 --- a/shared-module/protomatter/Protomatter.c +++ b/shared-module/protomatter/Protomatter.c @@ -198,3 +198,12 @@ void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* s _PM_swapbuffer_maybe(&self->core); } +int common_hal_protomatter_protomatter_get_width(protomatter_protomatter_obj_t* self) { + return self->width; +} + +int common_hal_protomatter_protomatter_get_height(protomatter_protomatter_obj_t* self) { + int computed_height = (self->rgb_count / 3) << (self->addr_count); + return computed_height; +} + From 3d6258f63dce84519704251b86a16c832958c8a6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 11:22:16 -0500 Subject: [PATCH 270/919] Rename Protomatter -> RGBMatrix This is a quick rename, it changes the user-facing names but not the internal names of things. --- .../Protomatter.c => rgbmatrix/RGBMatrix.c} | 2 +- .../Protomatter.h => rgbmatrix/RGBMatrix.h} | 0 .../{protomatter => rgbmatrix}/__init__.c | 0 .../Protomatter.c => rgbmatrix/RGBMatrix.c} | 2 +- .../Protomatter.h => rgbmatrix/RGBMatrix.h} | 0 .../{protomatter => rgbmatrix}/__init__.c | 0 py/circuitpy_defns.mk | 12 ++++++------ py/circuitpy_mpconfig.h | 2 +- shared-bindings/framebufferio/__init__.c | 2 +- .../Protomatter.c => rgbmatrix/RGBMatrix.c} | 18 +++++++++--------- .../Protomatter.h => rgbmatrix/RGBMatrix.h} | 2 +- .../{protomatter => rgbmatrix}/__init__.c | 12 ++++++------ shared-module/displayio/__init__.h | 2 +- .../Protomatter.c => rgbmatrix/RGBMatrix.c} | 6 +++--- .../Protomatter.h => rgbmatrix/RGBMatrix.h} | 0 .../{protomatter => rgbmatrix}/__init__.c | 0 .../{protomatter => rgbmatrix}/__init__.h | 0 .../{protomatter => rgbmatrix}/allocator.h | 0 18 files changed, 30 insertions(+), 30 deletions(-) rename ports/atmel-samd/common-hal/{protomatter/Protomatter.c => rgbmatrix/RGBMatrix.c} (98%) rename ports/atmel-samd/common-hal/{protomatter/Protomatter.h => rgbmatrix/RGBMatrix.h} (100%) rename ports/atmel-samd/common-hal/{protomatter => rgbmatrix}/__init__.c (100%) rename ports/nrf/common-hal/{protomatter/Protomatter.c => rgbmatrix/RGBMatrix.c} (98%) rename ports/nrf/common-hal/{protomatter/Protomatter.h => rgbmatrix/RGBMatrix.h} (100%) rename ports/nrf/common-hal/{protomatter => rgbmatrix}/__init__.c (100%) rename shared-bindings/{protomatter/Protomatter.c => rgbmatrix/RGBMatrix.c} (96%) rename shared-bindings/{protomatter/Protomatter.h => rgbmatrix/RGBMatrix.h} (98%) rename shared-bindings/{protomatter => rgbmatrix}/__init__.c (84%) rename shared-module/{protomatter/Protomatter.c => rgbmatrix/RGBMatrix.c} (98%) rename shared-module/{protomatter/Protomatter.h => rgbmatrix/RGBMatrix.h} (100%) rename shared-module/{protomatter => rgbmatrix}/__init__.c (100%) rename shared-module/{protomatter => rgbmatrix}/__init__.h (100%) rename shared-module/{protomatter => rgbmatrix}/allocator.h (100%) diff --git a/ports/atmel-samd/common-hal/protomatter/Protomatter.c b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c similarity index 98% rename from ports/atmel-samd/common-hal/protomatter/Protomatter.c rename to ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c index c9e2b0ce1c..aef17f10ea 100644 --- a/ports/atmel-samd/common-hal/protomatter/Protomatter.c +++ b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c @@ -26,7 +26,7 @@ #include -#include "common-hal/protomatter/Protomatter.h" +#include "common-hal/rgbmatrix/RGBMatrix.h" #include "samd/timers.h" #include "timer_handler.h" diff --git a/ports/atmel-samd/common-hal/protomatter/Protomatter.h b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h similarity index 100% rename from ports/atmel-samd/common-hal/protomatter/Protomatter.h rename to ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h diff --git a/ports/atmel-samd/common-hal/protomatter/__init__.c b/ports/atmel-samd/common-hal/rgbmatrix/__init__.c similarity index 100% rename from ports/atmel-samd/common-hal/protomatter/__init__.c rename to ports/atmel-samd/common-hal/rgbmatrix/__init__.c diff --git a/ports/nrf/common-hal/protomatter/Protomatter.c b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c similarity index 98% rename from ports/nrf/common-hal/protomatter/Protomatter.c rename to ports/nrf/common-hal/rgbmatrix/RGBMatrix.c index 45d75e9127..a04e14930b 100644 --- a/ports/nrf/common-hal/protomatter/Protomatter.c +++ b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c @@ -26,7 +26,7 @@ #include -#include "common-hal/protomatter/Protomatter.h" +#include "common-hal/rgbmatrix/RGBMatrix.h" #include "peripherals/nrf/timers.h" diff --git a/ports/nrf/common-hal/protomatter/Protomatter.h b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h similarity index 100% rename from ports/nrf/common-hal/protomatter/Protomatter.h rename to ports/nrf/common-hal/rgbmatrix/RGBMatrix.h diff --git a/ports/nrf/common-hal/protomatter/__init__.c b/ports/nrf/common-hal/rgbmatrix/__init__.c similarity index 100% rename from ports/nrf/common-hal/protomatter/__init__.c rename to ports/nrf/common-hal/rgbmatrix/__init__.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 9954121397..ad5a80dc7e 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -182,7 +182,7 @@ ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += _pixelbuf/% endif ifeq ($(CIRCUITPY_PROTOMATTER),1) -SRC_PATTERNS += protomatter/% +SRC_PATTERNS += rgbmatrix/% endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% @@ -277,8 +277,8 @@ SRC_COMMON_HAL_ALL = \ nvm/ByteArray.c \ nvm/__init__.c \ os/__init__.c \ - protomatter/Protomatter.c \ - protomatter/__init__.c \ + rgbmatrix/RGBMatrix.c \ + rgbmatrix/__init__.c \ pulseio/PWMOut.c \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ @@ -366,8 +366,8 @@ SRC_SHARED_MODULE_ALL = \ random/__init__.c \ socket/__init__.c \ network/__init__.c \ - protomatter/Protomatter.c \ - protomatter/__init__.c \ + rgbmatrix/RGBMatrix.c \ + rgbmatrix/__init__.c \ storage/__init__.c \ struct/__init__.c \ terminalio/Terminal.c \ @@ -417,7 +417,7 @@ ifeq ($(CIRCUITPY_PROTOMATTER),1) SRC_MOD += $(addprefix lib/protomatter/, \ core.c \ ) -$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/protomatter/allocator.h" -DCIRCUITPY -Wno-missing-braces +$(BUILD)/lib/protomatter/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 55e04b2936..7f1da2e30c 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -463,7 +463,7 @@ extern const struct _mp_obj_module_t pixelbuf_module; #if CIRCUITPY_PROTOMATTER extern const struct _mp_obj_module_t protomatter_module; -#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_protomatter),(mp_obj_t)&protomatter_module }, +#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&protomatter_module }, #else #define PROTOMATTER_MODULE #endif diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index 0f0823a25f..88f69bb2c3 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -38,7 +38,7 @@ //| The `framebufferio` module contains classes to manage display output //| including synchronizing with refresh rates and partial updating. //| It is used in conjunction with classes from `displayio` to actually -//| place items on the display; and classes like `Protomatter` to actually +//| place items on the display; and classes like `RGBMatrix` to actually //| drive the display. //| //| Libraries diff --git a/shared-bindings/protomatter/Protomatter.c b/shared-bindings/rgbmatrix/RGBMatrix.c similarity index 96% rename from shared-bindings/protomatter/Protomatter.c rename to shared-bindings/rgbmatrix/RGBMatrix.c index 4554c30bf0..c62b587bf2 100644 --- a/shared-bindings/protomatter/Protomatter.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -29,8 +29,8 @@ #include "py/runtime.h" #include "py/objarray.h" -#include "common-hal/protomatter/Protomatter.h" -#include "shared-bindings/protomatter/Protomatter.h" +#include "common-hal/rgbmatrix/RGBMatrix.h" +#include "shared-bindings/rgbmatrix/RGBMatrix.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" @@ -38,9 +38,9 @@ #include "shared-module/framebufferio/__init__.h" #include "shared-module/framebufferio/FramebufferDisplay.h" -//| .. currentmodule:: protomatter +//| .. currentmodule:: rgbmatrix //| -//| :class:`Protomatter` -- Driver for HUB75-style RGB LED matrices +//| :class:`RGBMatrix` -- Driver for HUB75-style RGB LED matrices //| ================================================================ //| @@ -133,11 +133,11 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| :class:`~protomatter.Protomatter` displays an in-memory framebuffer to an LED matrix. +//| :class:`~rgbmatrix.RGBMatrix` displays an in-memory framebuffer to an LED matrix. //| -//| .. class:: Protomatter(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, *, doublebuffer=True, framebuffer=None) +//| .. class:: RGBMatrix(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, *, doublebuffer=True, framebuffer=None) //| -//| Create a Protomatter object with the given attributes. The height of +//| Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 //| address lines, the display will be 32 pixels tall. @@ -171,7 +171,7 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| If a framebuffer is not passed in, one is allocated internally. To //| retrieve it, pass the protomatter object to memoryview(). //| -//| A Protomatter framebuffer is often used in conjunction with a +//| A RGBMatrix is often used in conjunction with a //| `framebufferio.FramebufferDisplay`. //| @@ -464,7 +464,7 @@ STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_i const mp_obj_type_t protomatter_Protomatter_type = { { &mp_type_type }, - .name = MP_QSTR_Protomatter, + .name = MP_QSTR_RGBMatrix, .buffer_p = { .get_buffer = protomatter_protomatter_get_buffer, }, .make_new = protomatter_protomatter_make_new, .protocol = &protomatter_protomatter_proto, diff --git a/shared-bindings/protomatter/Protomatter.h b/shared-bindings/rgbmatrix/RGBMatrix.h similarity index 98% rename from shared-bindings/protomatter/Protomatter.h rename to shared-bindings/rgbmatrix/RGBMatrix.h index 061c8de4e5..0f139abff2 100644 --- a/shared-bindings/protomatter/Protomatter.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -27,7 +27,7 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H #define MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H -#include "shared-module/protomatter/Protomatter.h" +#include "shared-module/rgbmatrix/RGBMatrix.h" #include "lib/protomatter/core.h" extern const mp_obj_type_t protomatter_Protomatter_type; diff --git a/shared-bindings/protomatter/__init__.c b/shared-bindings/rgbmatrix/__init__.c similarity index 84% rename from shared-bindings/protomatter/__init__.c rename to shared-bindings/rgbmatrix/__init__.c index 8f145d1968..4b16c0e499 100644 --- a/shared-bindings/protomatter/__init__.c +++ b/shared-bindings/rgbmatrix/__init__.c @@ -29,22 +29,22 @@ #include "py/obj.h" #include "py/runtime.h" -#include "shared-bindings/protomatter/Protomatter.h" +#include "shared-bindings/rgbmatrix/RGBMatrix.h" -//| :mod:`protomatter` --- Low-level routines for bitbanged LED matrices +//| :mod:`rgbmatrix` --- Low-level routines for bitbanged LED matrices //| ===================================================================== //| -//| .. module:: protomatter +//| .. module:: rgbmatrix //| :synopsis: Low-level routines for bitbanged LED matrices //| //| .. toctree:: //| :maxdepth: 3 //| -//| Protomatter +//| RGBMatrix STATIC const mp_rom_map_elem_t protomatter_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_protomatter) }, - { MP_ROM_QSTR(MP_QSTR_Protomatter), MP_ROM_PTR(&protomatter_Protomatter_type) }, + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rgbmatrix) }, + { MP_ROM_QSTR(MP_QSTR_RGBMatrix), MP_ROM_PTR(&protomatter_Protomatter_type) }, }; STATIC MP_DEFINE_CONST_DICT(protomatter_module_globals, protomatter_module_globals_table); diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index f5045b19a2..87c0d33568 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -36,7 +36,7 @@ #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/I2CDisplay.h" #include "shared-bindings/displayio/ParallelBus.h" -#include "shared-bindings/protomatter/Protomatter.h" +#include "shared-bindings/rgbmatrix/RGBMatrix.h" typedef struct { union { diff --git a/shared-module/protomatter/Protomatter.c b/shared-module/rgbmatrix/RGBMatrix.c similarity index 98% rename from shared-module/protomatter/Protomatter.c rename to shared-module/rgbmatrix/RGBMatrix.c index e7fa4ba9ae..17049494d6 100644 --- a/shared-module/protomatter/Protomatter.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -32,9 +32,9 @@ #include "py/objproperty.h" #include "py/runtime.h" -#include "common-hal/protomatter/Protomatter.h" -#include "shared-module/protomatter/allocator.h" -#include "shared-bindings/protomatter/Protomatter.h" +#include "common-hal/rgbmatrix/RGBMatrix.h" +#include "shared-module/rgbmatrix/allocator.h" +#include "shared-bindings/rgbmatrix/RGBMatrix.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" diff --git a/shared-module/protomatter/Protomatter.h b/shared-module/rgbmatrix/RGBMatrix.h similarity index 100% rename from shared-module/protomatter/Protomatter.h rename to shared-module/rgbmatrix/RGBMatrix.h diff --git a/shared-module/protomatter/__init__.c b/shared-module/rgbmatrix/__init__.c similarity index 100% rename from shared-module/protomatter/__init__.c rename to shared-module/rgbmatrix/__init__.c diff --git a/shared-module/protomatter/__init__.h b/shared-module/rgbmatrix/__init__.h similarity index 100% rename from shared-module/protomatter/__init__.h rename to shared-module/rgbmatrix/__init__.h diff --git a/shared-module/protomatter/allocator.h b/shared-module/rgbmatrix/allocator.h similarity index 100% rename from shared-module/protomatter/allocator.h rename to shared-module/rgbmatrix/allocator.h From 57ce2d1f417bd4c2988155d45739a3a61950471f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 12:29:32 -0500 Subject: [PATCH 271/919] framebufferio: get width, etc., from protocol, not object property --- .../framebufferio/FramebufferDisplay.c | 17 +--------- .../framebufferio/FramebufferDisplay.h | 7 ++--- shared-bindings/rgbmatrix/RGBMatrix.c | 26 ++++++++++++++++ .../framebufferio/FramebufferDisplay.c | 31 +++++++++++++------ .../framebufferio/FramebufferDisplay.h | 10 ++++++ 5 files changed, 62 insertions(+), 29 deletions(-) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 5014f39242..820eda51af 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -39,10 +39,6 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -STATIC int get_int_property(mp_obj_t obj, qstr attr) { - return mp_obj_get_int(mp_load_attr(obj, attr)); -} - //| .. currentmodule:: framebufferio //| //| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM @@ -79,25 +75,14 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } - int width = get_int_property(framebuffer, MP_QSTR_width); - int height = get_int_property(framebuffer, MP_QSTR_height); - int color_depth = get_int_property(framebuffer, MP_QSTR_color_depth); - int bytes_per_cell = get_int_property(framebuffer, MP_QSTR_bytes_per_cell); - int native_frames_per_second = get_int_property(framebuffer, MP_QSTR_native_frames_per_second); - primary_display_t *disp = allocate_display_or_raise(); framebufferio_framebufferdisplay_obj_t *self = &disp->framebuffer_display; self->base.type = &framebufferio_framebufferdisplay_type; common_hal_framebufferio_framebufferdisplay_construct( self, framebuffer, - width, - height, rotation, - color_depth, - bytes_per_cell, - args[ARG_auto_refresh].u_bool, - native_frames_per_second + args[ARG_auto_refresh].u_bool ); return self; diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index b472088d20..e7ead6ac55 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -39,10 +39,9 @@ extern const mp_obj_type_t framebufferio_framebufferdisplay_type; #define NO_BRIGHTNESS_COMMAND 0x100 void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, - mp_obj_t framebuffer, uint16_t width, uint16_t height, - uint16_t rotation, uint16_t color_depth, - uint8_t bytes_per_cell, - bool auto_refresh, uint16_t native_frames_per_second); + mp_obj_t framebuffer, + uint16_t rotation, + bool auto_refresh); bool common_hal_framebufferio_framebufferdisplay_show(framebufferio_framebufferdisplay_obj_t* self, displayio_group_t* root_group); diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index c62b587bf2..368b73091c 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -443,11 +443,37 @@ STATIC bool protomatter_protomatter_set_brightness_proto(mp_obj_t self_in, mp_fl return true; } +STATIC int protomatter_protomatter_get_width_proto(mp_obj_t self_in) { + return common_hal_protomatter_protomatter_get_width(self_in); +} + +STATIC int protomatter_protomatter_get_height_proto(mp_obj_t self_in) { + return common_hal_protomatter_protomatter_get_height(self_in); +} + +STATIC int protomatter_protomatter_get_color_depth_proto(mp_obj_t self_in) { + return 16; +} + +STATIC int protomatter_protomatter_get_bytes_per_cell_proto(mp_obj_t self_in) { + return 1; +} + +STATIC int protomatter_protomatter_get_native_frames_per_second_proto(mp_obj_t self_in) { + return 250; +} + + STATIC const framebuffer_p_t protomatter_protomatter_proto = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuffer) .get_bufinfo = protomatter_protomatter_get_bufinfo, .set_brightness = protomatter_protomatter_set_brightness_proto, .get_brightness = protomatter_protomatter_get_brightness_proto, + .get_width = protomatter_protomatter_get_width_proto, + .get_height = protomatter_protomatter_get_height_proto, + .get_color_depth = protomatter_protomatter_get_color_depth_proto, + .get_bytes_per_cell = protomatter_protomatter_get_bytes_per_cell_proto, + .get_native_frames_per_second = protomatter_protomatter_get_native_frames_per_second_proto, .swapbuffers = protomatter_protomatter_swapbuffers, .deinit = protomatter_protomatter_deinit_proto, }; diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index bd0764e8e4..db17013ead 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -42,10 +42,9 @@ #include "tick.h" void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self, - mp_obj_t framebuffer, uint16_t width, uint16_t height, - uint16_t rotation, uint16_t color_depth, - uint8_t bytes_per_cell, - bool auto_refresh, uint16_t native_frames_per_second) { + mp_obj_t framebuffer, + uint16_t rotation, + bool auto_refresh) { // Turn off auto-refresh as we init. self->auto_refresh = false; self->framebuffer = framebuffer; @@ -54,15 +53,29 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu uint16_t ram_width = 0x100; uint16_t ram_height = 0x100; - displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, 0, 0, rotation, - color_depth, false, false, bytes_per_cell, false, false); + displayio_display_core_construct( + &self->core, + NULL, + self->framebuffer_protocol->get_width(self->framebuffer), + self->framebuffer_protocol->get_height(self->framebuffer), + ram_width, + ram_height, + 0, + 0, + rotation, + self->framebuffer_protocol->get_color_depth(self->framebuffer), + false, + false, + self->framebuffer_protocol->get_bytes_per_cell(self->framebuffer), + false, + false); self->first_manual_refresh = !auto_refresh; - self->native_frames_per_second = native_frames_per_second; - self->native_ms_per_frame = 1000 / native_frames_per_second; + self->native_frames_per_second = self->framebuffer_protocol->get_native_frames_per_second(self->framebuffer); + self->native_ms_per_frame = 1000 / self->native_frames_per_second; - supervisor_start_terminal(width, height); + supervisor_start_terminal(self->core.width, self->core.height); // Set the group after initialization otherwise we may send pixels while we delay in // initialization. diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index a7b91a522e..ea2fe168ea 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -66,12 +66,22 @@ typedef bool (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); typedef mp_float_t (*framebuffer_get_brightness_fun)(mp_obj_t); typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); +typedef int (*framebuffer_get_width_fun)(mp_obj_t); +typedef int (*framebuffer_get_height_fun)(mp_obj_t); +typedef int (*framebuffer_get_color_depth_fun)(mp_obj_t); +typedef int (*framebuffer_get_bytes_per_cell_fun)(mp_obj_t); +typedef int (*framebuffer_get_native_frames_per_second_fun)(mp_obj_t); typedef struct _framebuffer_p_t { MP_PROTOCOL_HEAD // MP_QSTR_protocol_framebuffer framebuffer_get_bufinfo_fun get_bufinfo; framebuffer_swapbuffers_fun swapbuffers; framebuffer_deinit_fun deinit; + framebuffer_get_width_fun get_width; + framebuffer_get_height_fun get_height; + framebuffer_get_color_depth_fun get_color_depth; + framebuffer_get_bytes_per_cell_fun get_bytes_per_cell; + framebuffer_get_native_frames_per_second_fun get_native_frames_per_second; framebuffer_get_brightness_fun get_brightness; framebuffer_set_brightness_fun set_brightness; framebuffer_get_auto_brightness_fun get_auto_brightness; From 1b478bbae6145e8e4d4e97a7c72b730df292e602 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 12:29:41 -0500 Subject: [PATCH 272/919] RGBMatrix: remove unneeded properties --- shared-bindings/rgbmatrix/RGBMatrix.c | 59 --------------------------- 1 file changed, 59 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 368b73091c..91b42b90d6 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -349,71 +349,12 @@ const mp_obj_property_t protomatter_protomatter_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: bytes_per_cell -//| -//| The bytes_per_cell of the display, in pixels. Always equal to 1. -//| -STATIC mp_obj_t protomatter_protomatter_get_bytes_per_cell(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(1); -} -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_bytes_per_cell_obj, protomatter_protomatter_get_bytes_per_cell); - -const mp_obj_property_t protomatter_protomatter_bytes_per_cell_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_bytes_per_cell_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| .. attribute:: color_depth -//| -//| The color_depth of the framebuffer, in bits. Always equal to 16. This -//| is different than the constructor's "bit_depth". -//| -STATIC mp_obj_t protomatter_protomatter_get_color_depth(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(16); -} -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_color_depth_obj, protomatter_protomatter_get_color_depth); - -const mp_obj_property_t protomatter_protomatter_color_depth_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_color_depth_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| .. attribute:: native_frames_per_second -//| -//| The native_frames_per_second of the display. Always equal to 250. -//| -STATIC mp_obj_t protomatter_protomatter_get_native_frames_per_second(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(250); -} -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_native_frames_per_second_obj, protomatter_protomatter_get_native_frames_per_second); - -const mp_obj_property_t protomatter_protomatter_native_frames_per_second_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_native_frames_per_second_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - - STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&protomatter_protomatter_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&protomatter_protomatter_refresh_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&protomatter_protomatter_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&protomatter_protomatter_height_obj) }, - { MP_ROM_QSTR(MP_QSTR_color_depth), MP_ROM_PTR(&protomatter_protomatter_color_depth_obj) }, - { MP_ROM_QSTR(MP_QSTR_bytes_per_cell), MP_ROM_PTR(&protomatter_protomatter_bytes_per_cell_obj) }, - { MP_ROM_QSTR(MP_QSTR_native_frames_per_second), MP_ROM_PTR(&protomatter_protomatter_native_frames_per_second_obj) }, }; STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); From 5fcc6d62869310b2b1dd96279e5a121623e07aba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 15 Apr 2020 15:01:24 -0500 Subject: [PATCH 273/919] RGBMatrix: finish renaming from Protomatter This gets all the purely internal references. Some uses of protomatter/Protomatter/PROTOMATTER remain, as they are references to symbols in the Protomatter C library itself. --- .../boards/kicksat-sprite/mpconfigboard.mk | 2 +- .../boards/pycubed/mpconfigboard.mk | 2 +- .../boards/robohatmm1_m4/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../boards/winterbloom_sol/mpconfigboard.mk | 2 +- .../common-hal/rgbmatrix/RGBMatrix.c | 10 +- .../common-hal/rgbmatrix/RGBMatrix.h | 12 +- ports/atmel-samd/mpconfigport.mk | 4 +- ports/atmel-samd/timer_handler.c | 4 +- ports/atmel-samd/timer_handler.h | 2 +- ports/nrf/common-hal/rgbmatrix/RGBMatrix.c | 12 +- ports/nrf/common-hal/rgbmatrix/RGBMatrix.h | 12 +- ports/nrf/mpconfigport.mk | 2 +- py/circuitpy_defns.mk | 4 +- py/circuitpy_mpconfig.h | 10 +- py/circuitpy_mpconfig.mk | 6 +- shared-bindings/rgbmatrix/RGBMatrix.c | 165 +++++++++--------- shared-bindings/rgbmatrix/RGBMatrix.h | 26 +-- shared-bindings/rgbmatrix/__init__.c | 10 +- shared-module/displayio/__init__.c | 24 +-- shared-module/displayio/__init__.h | 4 +- shared-module/rgbmatrix/RGBMatrix.c | 30 ++-- shared-module/rgbmatrix/allocator.h | 4 +- supervisor/shared/display.c | 10 +- 24 files changed, 179 insertions(+), 182 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index f7223790ac..febd2a6c36 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -14,7 +14,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_NETWORK = 0 -CIRCUITPY_PROTOMATTER = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_AUDIOMP3 = 0 diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index c14a296159..adaeecb893 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -17,7 +17,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_PROTOMATTER = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index 57eb7f1b9c..fd6e25f6cb 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -19,7 +19,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_PROTOMATTER = 0 +CIRCUITPY_RGBMATRIX = 0 # Include these Python libraries in firmware. #FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 691c1c1365..466e345911 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -28,7 +28,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_PROTOMATTER = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index ed97aef4c0..6a78a4ff99 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -26,7 +26,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_PROTOMATTER = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 diff --git a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c index aef17f10ea..55b0c2f125 100644 --- a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c @@ -31,7 +31,7 @@ #include "samd/timers.h" #include "timer_handler.h" -void *common_hal_protomatter_timer_allocate() { +void *common_hal_rgbmatrix_timer_allocate() { uint8_t timer_index = find_free_timer(); if (timer_index == 0xff) { return NULL; @@ -49,16 +49,16 @@ static uint8_t tc_index_from_ptr(void* ptr) { return 0xff; } -void common_hal_protomatter_timer_enable(void* ptr) { +void common_hal_rgbmatrix_timer_enable(void* ptr) { uint8_t timer_index = tc_index_from_ptr(ptr); if (timer_index == 0xff) { return; } - set_timer_handler(true, timer_index, TC_HANDLER_PROTOMATTER); + set_timer_handler(true, timer_index, TC_HANDLER_RGBMATRIX); turn_on_clocks(true, timer_index, 1); } -void common_hal_protomatter_timer_disable(void* ptr) { +void common_hal_rgbmatrix_timer_disable(void* ptr) { uint8_t timer_index = tc_index_from_ptr(ptr); if (timer_index == 0xff) { return; @@ -67,7 +67,7 @@ void common_hal_protomatter_timer_disable(void* ptr) { tc_set_enable(ptr, false); } -void common_hal_protomatter_timer_free(void* ptr) { +void common_hal_rgbmatrix_timer_free(void* ptr) { uint8_t timer_index = tc_index_from_ptr(ptr); if (timer_index == 0xff) { return; diff --git a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h index 8185bed0e5..48de4dcb21 100644 --- a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h +++ b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H -void *common_hal_protomatter_timer_allocate(void); -void common_hal_protomatter_timer_enable(void*); -void common_hal_protomatter_timer_disable(void*); -void common_hal_protomatter_timer_free(void*); +void *common_hal_rgbmatrix_timer_allocate(void); +void common_hal_rgbmatrix_timer_enable(void*); +void common_hal_rgbmatrix_timer_disable(void*); +void common_hal_rgbmatrix_timer_free(void*); #endif diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 61f7c206ab..039263be79 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -70,9 +70,9 @@ CIRCUITPY_ULAB = 1 endif endif -ifndef CIRCUITPY_PROTOMATTER +ifndef CIRCUITPY_RGBMATRIX ifneq ($(CIRCUITPY_SMALL_BUILD),1) -CIRCUITPY_PROTOMATTER = 1 +CIRCUITPY_RGBMATRIX = 1 endif endif diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 598fad564a..51c6f0a39f 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -64,8 +64,8 @@ void shared_timer_handler(bool is_tc, uint8_t index) { frequencyin_interrupt_handler(index); #endif break; - case TC_HANDLER_PROTOMATTER: - #if CIRCUITPY_PROTOMATTER + case TC_HANDLER_RGBMATRIX: + #if CIRCUITPY_RGBMATRIX _PM_IRQ_HANDLER(); #endif break; diff --git a/ports/atmel-samd/timer_handler.h b/ports/atmel-samd/timer_handler.h index 646cd54ec8..8115cd73be 100644 --- a/ports/atmel-samd/timer_handler.h +++ b/ports/atmel-samd/timer_handler.h @@ -30,7 +30,7 @@ #define TC_HANDLER_PULSEOUT 0x1 #define TC_HANDLER_PEW 0x2 #define TC_HANDLER_FREQUENCYIN 0x3 -#define TC_HANDLER_PROTOMATTER 0x4 +#define TC_HANDLER_RGBMATRIX 0x4 void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler); void shared_timer_handler(bool is_tc, uint8_t index); diff --git a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c index a04e14930b..e13b761abf 100644 --- a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.c @@ -32,18 +32,18 @@ extern void _PM_IRQ_HANDLER(void); -void *common_hal_protomatter_timer_allocate() { +void *common_hal_rgbmatrix_timer_allocate() { nrfx_timer_t *timer = nrf_peripherals_allocate_timer_or_throw(); nrf_peripherals_timer_never_reset(timer); return timer->p_reg; } -static void protomatter_event_handler(nrf_timer_event_t event_type, void *p_context) { +static void rgbmatrix_event_handler(nrf_timer_event_t event_type, void *p_context) { _PM_IRQ_HANDLER(); } -void common_hal_protomatter_timer_enable(void* ptr) { +void common_hal_rgbmatrix_timer_enable(void* ptr) { nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); static const nrfx_timer_config_t timer_config = { .frequency = NRF_TIMER_FREQ_16MHz, @@ -52,15 +52,15 @@ void common_hal_protomatter_timer_enable(void* ptr) { .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, .p_context = NULL, }; - nrfx_timer_init(timer, &timer_config, &protomatter_event_handler); + nrfx_timer_init(timer, &timer_config, &rgbmatrix_event_handler); } -void common_hal_protomatter_timer_disable(void* ptr) { +void common_hal_rgbmatrix_timer_disable(void* ptr) { nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); nrfx_timer_uninit(timer); } -void common_hal_protomatter_timer_free(void* ptr) { +void common_hal_rgbmatrix_timer_free(void* ptr) { nrfx_timer_t *timer = nrf_peripherals_timer_from_reg(ptr); nrf_peripherals_free_timer(timer); } diff --git a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h index 8185bed0e5..48de4dcb21 100644 --- a/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h +++ b/ports/nrf/common-hal/rgbmatrix/RGBMatrix.h @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PROTOMATTER_PROTOMATTER_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H -void *common_hal_protomatter_timer_allocate(void); -void common_hal_protomatter_timer_enable(void*); -void common_hal_protomatter_timer_disable(void*); -void common_hal_protomatter_timer_free(void*); +void *common_hal_rgbmatrix_timer_allocate(void); +void common_hal_rgbmatrix_timer_enable(void*); +void common_hal_rgbmatrix_timer_disable(void*); +void common_hal_rgbmatrix_timer_free(void*); #endif diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 5ca1f0f35b..ec6850ebb6 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -51,7 +51,7 @@ endif # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_PROTOMATTER = 1 +CIRCUITPY_RGBMATRIX = 1 CIRCUITPY_FRAMEBUFFERIO = 1 # nRF52840-specific diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index ad5a80dc7e..78ab41e129 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -181,7 +181,7 @@ endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += _pixelbuf/% endif -ifeq ($(CIRCUITPY_PROTOMATTER),1) +ifeq ($(CIRCUITPY_RGBMATRIX),1) SRC_PATTERNS += rgbmatrix/% endif ifeq ($(CIRCUITPY_PULSEIO),1) @@ -413,7 +413,7 @@ SRC_MOD += $(addprefix lib/mp3/src/, \ ) $(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)' endif -ifeq ($(CIRCUITPY_PROTOMATTER),1) +ifeq ($(CIRCUITPY_RGBMATRIX),1) SRC_MOD += $(addprefix lib/protomatter/, \ core.c \ ) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 7f1da2e30c..497fd95235 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -461,11 +461,11 @@ extern const struct _mp_obj_module_t pixelbuf_module; #define PIXELBUF_MODULE #endif -#if CIRCUITPY_PROTOMATTER -extern const struct _mp_obj_module_t protomatter_module; -#define PROTOMATTER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&protomatter_module }, +#if CIRCUITPY_RGBMATRIX +extern const struct _mp_obj_module_t rgbmatrix_module; +#define RGBMATRIX_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&rgbmatrix_module }, #else -#define PROTOMATTER_MODULE +#define RGBMATRIX_MODULE #endif #if CIRCUITPY_PULSEIO @@ -658,10 +658,10 @@ extern const struct _mp_obj_module_t ustack_module; PEW_MODULE \ PIXELBUF_MODULE \ PS2IO_MODULE \ - PROTOMATTER_MODULE \ PULSEIO_MODULE \ RANDOM_MODULE \ RE_MODULE \ + RGBMATRIX_MODULE \ ROTARYIO_MODULE \ RTC_MODULE \ SAMD_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ba94f9784f..601f1c4e43 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -216,10 +216,10 @@ endif CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) # Only for SAMD boards for the moment -ifndef CIRCUITPY_PROTOMATTER -CIRCUITPY_PROTOMATTER = 0 +ifndef CIRCUITPY_RGBMATRIX +CIRCUITPY_RGBMATRIX = 0 endif -CFLAGS += -DCIRCUITPY_PROTOMATTER=$(CIRCUITPY_PROTOMATTER) +CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) ifndef CIRCUITPY_PULSEIO CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 91b42b90d6..3fa9d560e1 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -163,19 +163,16 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| //| If a framebuffer is not passed in, one is allocated and initialized //| to all black. In any case, the framebuffer can be retrieved -//| by passing the protomatter object to memoryview(). +//| by passing the RGBMatrix object to memoryview(). //| //| If doublebuffer is False, some memory is saved, but the display may //| flicker during updates. //| -//| If a framebuffer is not passed in, one is allocated internally. To -//| retrieve it, pass the protomatter object to memoryview(). -//| //| A RGBMatrix is often used in conjunction with a //| `framebufferio.FramebufferDisplay`. //| -STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_width, ARG_bit_depth, ARG_rgb_list, ARG_addr_list, ARG_clock_pin, ARG_latch_pin, ARG_output_enable_pin, ARG_doublebuffer, ARG_framebuffer, ARG_height }; static const mp_arg_t allowed_args[] = { @@ -193,11 +190,11 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - // Because interrupt handlers point directly at protomatter objects, + // Because interrupt handlers point directly at rgbmatrix objects, // it is NOT okay to move them to the long-lived pool later. Allocate // them there to begin with, since generally they'll be long-lived anyway. - protomatter_protomatter_obj_t *self = &allocate_display_bus_or_raise()->protomatter; - self->base.type = &protomatter_Protomatter_type; + rgbmatrix_rgbmatrix_obj_t *self = &allocate_display_bus_or_raise()->rgbmatrix; + self->base.type = &rgbmatrix_RGBMatrix_type; uint8_t rgb_count, addr_count; uint8_t rgb_pins[MP_ARRAY_SIZE(self->rgb_pins)]; @@ -231,7 +228,7 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size framebuffer = mp_obj_new_bytearray_of_zeros(bufsize); } - common_hal_protomatter_protomatter_construct(self, + common_hal_rgbmatrix_rgbmatrix_construct(self, args[ARG_width].u_int, args[ARG_bit_depth].u_int, rgb_count, rgb_pins, @@ -252,18 +249,18 @@ STATIC mp_obj_t protomatter_protomatter_make_new(const mp_obj_type_t *type, size //| .. method:: deinit //| //| Free the resources (pins, timers, etc.) associated with this -//| protomatter instance. After deinitialization, no further operations +//| rgbmatrix instance. After deinitialization, no further operations //| may be performed. //| -STATIC mp_obj_t protomatter_protomatter_deinit(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; - common_hal_protomatter_protomatter_deinit(self); +STATIC mp_obj_t rgbmatrix_rgbmatrix_deinit(mp_obj_t self_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; + common_hal_rgbmatrix_rgbmatrix_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_deinit_obj, protomatter_protomatter_deinit); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_deinit_obj, rgbmatrix_rgbmatrix_deinit); -static void check_for_deinit(protomatter_protomatter_obj_t *self) { +static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { if (!self->core.rgbPins) { raise_deinited_error(); } @@ -274,30 +271,30 @@ static void check_for_deinit(protomatter_protomatter_obj_t *self) { //| In the current implementation, 0.0 turns the display off entirely //| and any other value up to 1.0 turns the display on fully. //| -STATIC mp_obj_t protomatter_protomatter_get_brightness(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_obj_t rgbmatrix_rgbmatrix_get_brightness(mp_obj_t self_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); - return mp_obj_new_float(common_hal_protomatter_protomatter_get_paused(self)? 0.0f : 1.0f); + return mp_obj_new_float(common_hal_rgbmatrix_rgbmatrix_get_paused(self)? 0.0f : 1.0f); } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_brightness_obj, protomatter_protomatter_get_brightness); +MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_brightness_obj, rgbmatrix_rgbmatrix_get_brightness); -STATIC mp_obj_t protomatter_protomatter_set_brightness(mp_obj_t self_in, mp_obj_t value_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_obj_t rgbmatrix_rgbmatrix_set_brightness(mp_obj_t self_in, mp_obj_t value_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); mp_float_t brightness = mp_obj_get_float(value_in); if (brightness < 0.0f || brightness > 1.0f) { mp_raise_ValueError(translate("Brightness must be 0-1.0")); } - common_hal_protomatter_protomatter_set_paused(self_in, brightness <= 0); + common_hal_rgbmatrix_rgbmatrix_set_paused(self_in, brightness <= 0); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(protomatter_protomatter_set_brightness_obj, protomatter_protomatter_set_brightness); +MP_DEFINE_CONST_FUN_OBJ_2(rgbmatrix_rgbmatrix_set_brightness_obj, rgbmatrix_rgbmatrix_set_brightness); -const mp_obj_property_t protomatter_protomatter_brightness_obj = { +const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_brightness_obj, - (mp_obj_t)&protomatter_protomatter_set_brightness_obj, + .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_brightness_obj, + (mp_obj_t)&rgbmatrix_rgbmatrix_set_brightness_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -306,27 +303,27 @@ const mp_obj_property_t protomatter_protomatter_brightness_obj = { //| Transmits the color data in the buffer to the pixels so that //| they are shown. //| -STATIC mp_obj_t protomatter_protomatter_refresh(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); - common_hal_protomatter_protomatter_refresh(self); + common_hal_rgbmatrix_rgbmatrix_refresh(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_refresh_obj, protomatter_protomatter_refresh); +MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_refresh_obj, rgbmatrix_rgbmatrix_refresh); //| .. attribute:: width //| //| The width of the display, in pixels //| -STATIC mp_obj_t protomatter_protomatter_get_width(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_obj_t rgbmatrix_rgbmatrix_get_width(mp_obj_t self_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_width(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_rgbmatrix_rgbmatrix_get_width(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_width_obj, protomatter_protomatter_get_width); -const mp_obj_property_t protomatter_protomatter_width_obj = { +MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_width_obj, rgbmatrix_rgbmatrix_get_width); +const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_width_obj, + .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_width_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; @@ -335,31 +332,31 @@ const mp_obj_property_t protomatter_protomatter_width_obj = { //| //| The height of the display, in pixels //| -STATIC mp_obj_t protomatter_protomatter_get_height(mp_obj_t self_in) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_obj_t rgbmatrix_rgbmatrix_get_height(mp_obj_t self_in) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_protomatter_protomatter_get_height(self)); + return MP_OBJ_NEW_SMALL_INT(common_hal_rgbmatrix_rgbmatrix_get_height(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(protomatter_protomatter_get_height_obj, protomatter_protomatter_get_height); +MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_height_obj, rgbmatrix_rgbmatrix_get_height); -const mp_obj_property_t protomatter_protomatter_height_obj = { +const mp_obj_property_t rgbmatrix_rgbmatrix_height_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&protomatter_protomatter_get_height_obj, + .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_height_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; -STATIC const mp_rom_map_elem_t protomatter_protomatter_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&protomatter_protomatter_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&protomatter_protomatter_brightness_obj) }, - { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&protomatter_protomatter_refresh_obj) }, - { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&protomatter_protomatter_width_obj) }, - { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&protomatter_protomatter_height_obj) }, +STATIC const mp_rom_map_elem_t rgbmatrix_rgbmatrix_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rgbmatrix_rgbmatrix_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&rgbmatrix_rgbmatrix_brightness_obj) }, + { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&rgbmatrix_rgbmatrix_refresh_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&rgbmatrix_rgbmatrix_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&rgbmatrix_rgbmatrix_height_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(protomatter_protomatter_locals_dict, protomatter_protomatter_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(rgbmatrix_rgbmatrix_locals_dict, rgbmatrix_rgbmatrix_locals_dict_table); -STATIC void protomatter_protomatter_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t *bufinfo) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC void rgbmatrix_rgbmatrix_get_bufinfo(mp_obj_t self_in, mp_buffer_info_t *bufinfo) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; check_for_deinit(self); *bufinfo = self->bufinfo; @@ -367,60 +364,60 @@ STATIC void protomatter_protomatter_get_bufinfo(mp_obj_t self_in, mp_buffer_info // These version exists so that the prototype matches the protocol, // avoiding a type cast that can hide errors -STATIC void protomatter_protomatter_swapbuffers(mp_obj_t self_in) { - common_hal_protomatter_protomatter_refresh(self_in); +STATIC void rgbmatrix_rgbmatrix_swapbuffers(mp_obj_t self_in) { + common_hal_rgbmatrix_rgbmatrix_refresh(self_in); } -STATIC void protomatter_protomatter_deinit_proto(mp_obj_t self_in) { - common_hal_protomatter_protomatter_deinit(self_in); +STATIC void rgbmatrix_rgbmatrix_deinit_proto(mp_obj_t self_in) { + common_hal_rgbmatrix_rgbmatrix_deinit(self_in); } -STATIC float protomatter_protomatter_get_brightness_proto(mp_obj_t self_in) { - return common_hal_protomatter_protomatter_get_paused(self_in) ? 0.0f : 1.0f; +STATIC float rgbmatrix_rgbmatrix_get_brightness_proto(mp_obj_t self_in) { + return common_hal_rgbmatrix_rgbmatrix_get_paused(self_in) ? 0.0f : 1.0f; } -STATIC bool protomatter_protomatter_set_brightness_proto(mp_obj_t self_in, mp_float_t value) { - common_hal_protomatter_protomatter_set_paused(self_in, value <= 0); +STATIC bool rgbmatrix_rgbmatrix_set_brightness_proto(mp_obj_t self_in, mp_float_t value) { + common_hal_rgbmatrix_rgbmatrix_set_paused(self_in, value <= 0); return true; } -STATIC int protomatter_protomatter_get_width_proto(mp_obj_t self_in) { - return common_hal_protomatter_protomatter_get_width(self_in); +STATIC int rgbmatrix_rgbmatrix_get_width_proto(mp_obj_t self_in) { + return common_hal_rgbmatrix_rgbmatrix_get_width(self_in); } -STATIC int protomatter_protomatter_get_height_proto(mp_obj_t self_in) { - return common_hal_protomatter_protomatter_get_height(self_in); +STATIC int rgbmatrix_rgbmatrix_get_height_proto(mp_obj_t self_in) { + return common_hal_rgbmatrix_rgbmatrix_get_height(self_in); } -STATIC int protomatter_protomatter_get_color_depth_proto(mp_obj_t self_in) { +STATIC int rgbmatrix_rgbmatrix_get_color_depth_proto(mp_obj_t self_in) { return 16; } -STATIC int protomatter_protomatter_get_bytes_per_cell_proto(mp_obj_t self_in) { +STATIC int rgbmatrix_rgbmatrix_get_bytes_per_cell_proto(mp_obj_t self_in) { return 1; } -STATIC int protomatter_protomatter_get_native_frames_per_second_proto(mp_obj_t self_in) { +STATIC int rgbmatrix_rgbmatrix_get_native_frames_per_second_proto(mp_obj_t self_in) { return 250; } -STATIC const framebuffer_p_t protomatter_protomatter_proto = { +STATIC const framebuffer_p_t rgbmatrix_rgbmatrix_proto = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuffer) - .get_bufinfo = protomatter_protomatter_get_bufinfo, - .set_brightness = protomatter_protomatter_set_brightness_proto, - .get_brightness = protomatter_protomatter_get_brightness_proto, - .get_width = protomatter_protomatter_get_width_proto, - .get_height = protomatter_protomatter_get_height_proto, - .get_color_depth = protomatter_protomatter_get_color_depth_proto, - .get_bytes_per_cell = protomatter_protomatter_get_bytes_per_cell_proto, - .get_native_frames_per_second = protomatter_protomatter_get_native_frames_per_second_proto, - .swapbuffers = protomatter_protomatter_swapbuffers, - .deinit = protomatter_protomatter_deinit_proto, + .get_bufinfo = rgbmatrix_rgbmatrix_get_bufinfo, + .set_brightness = rgbmatrix_rgbmatrix_set_brightness_proto, + .get_brightness = rgbmatrix_rgbmatrix_get_brightness_proto, + .get_width = rgbmatrix_rgbmatrix_get_width_proto, + .get_height = rgbmatrix_rgbmatrix_get_height_proto, + .get_color_depth = rgbmatrix_rgbmatrix_get_color_depth_proto, + .get_bytes_per_cell = rgbmatrix_rgbmatrix_get_bytes_per_cell_proto, + .get_native_frames_per_second = rgbmatrix_rgbmatrix_get_native_frames_per_second_proto, + .swapbuffers = rgbmatrix_rgbmatrix_swapbuffers, + .deinit = rgbmatrix_rgbmatrix_deinit_proto, }; -STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { - protomatter_protomatter_obj_t *self = (protomatter_protomatter_obj_t*)self_in; +STATIC mp_int_t rgbmatrix_rgbmatrix_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags) { + rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; // a readonly framebuffer would be unusual but not impossible if ((flags & MP_BUFFER_WRITE) && !(self->bufinfo.typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW)) { return 1; @@ -429,11 +426,11 @@ STATIC mp_int_t protomatter_protomatter_get_buffer(mp_obj_t self_in, mp_buffer_i return 0; } -const mp_obj_type_t protomatter_Protomatter_type = { +const mp_obj_type_t rgbmatrix_RGBMatrix_type = { { &mp_type_type }, .name = MP_QSTR_RGBMatrix, - .buffer_p = { .get_buffer = protomatter_protomatter_get_buffer, }, - .make_new = protomatter_protomatter_make_new, - .protocol = &protomatter_protomatter_proto, - .locals_dict = (mp_obj_dict_t*)&protomatter_protomatter_locals_dict, + .buffer_p = { .get_buffer = rgbmatrix_rgbmatrix_get_buffer, }, + .make_new = rgbmatrix_rgbmatrix_make_new, + .protocol = &rgbmatrix_rgbmatrix_proto, + .locals_dict = (mp_obj_dict_t*)&rgbmatrix_rgbmatrix_locals_dict, }; diff --git a/shared-bindings/rgbmatrix/RGBMatrix.h b/shared-bindings/rgbmatrix/RGBMatrix.h index 0f139abff2..027f817bb6 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.h +++ b/shared-bindings/rgbmatrix/RGBMatrix.h @@ -24,13 +24,13 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_PROTOMATTER_PROTOMATTER_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_RGBMATRIX_RGBMATRIX_H #include "shared-module/rgbmatrix/RGBMatrix.h" #include "lib/protomatter/core.h" -extern const mp_obj_type_t protomatter_Protomatter_type; +extern const mp_obj_type_t rgbmatrix_RGBMatrix_type; typedef struct { mp_obj_base_t base; mp_obj_t framebuffer; @@ -46,16 +46,16 @@ typedef struct { bool core_is_initialized; bool paused; bool doublebuffer; -} protomatter_protomatter_obj_t; +} rgbmatrix_rgbmatrix_obj_t; -void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t* self, int width, int bit_depth, uint8_t rgb_count, uint8_t* rgb_pins, uint8_t addr_count, uint8_t* addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void* timer); -void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t*); -void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t*); -void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer); -void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused); -bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self); -void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* self); -int common_hal_protomatter_protomatter_get_width(protomatter_protomatter_obj_t* self); -int common_hal_protomatter_protomatter_get_height(protomatter_protomatter_obj_t* self); +void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t* self, int width, int bit_depth, uint8_t rgb_count, uint8_t* rgb_pins, uint8_t addr_count, uint8_t* addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void* timer); +void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t*); +void rgbmatrix_rgbmatrix_collect_ptrs(rgbmatrix_rgbmatrix_obj_t*); +void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, mp_obj_t framebuffer); +void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, bool paused); +bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self); +void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self); +int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self); +int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self); #endif diff --git a/shared-bindings/rgbmatrix/__init__.c b/shared-bindings/rgbmatrix/__init__.c index 4b16c0e499..662d2c4f6c 100644 --- a/shared-bindings/rgbmatrix/__init__.c +++ b/shared-bindings/rgbmatrix/__init__.c @@ -42,14 +42,14 @@ //| //| RGBMatrix -STATIC const mp_rom_map_elem_t protomatter_module_globals_table[] = { +STATIC const mp_rom_map_elem_t rgbmatrix_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rgbmatrix) }, - { MP_ROM_QSTR(MP_QSTR_RGBMatrix), MP_ROM_PTR(&protomatter_Protomatter_type) }, + { MP_ROM_QSTR(MP_QSTR_RGBMatrix), MP_ROM_PTR(&rgbmatrix_RGBMatrix_type) }, }; -STATIC MP_DEFINE_CONST_DICT(protomatter_module_globals, protomatter_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(rgbmatrix_module_globals, rgbmatrix_module_globals_table); -const mp_obj_module_t protomatter_module = { +const mp_obj_module_t rgbmatrix_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&protomatter_module_globals, + .globals = (mp_obj_dict_t*)&rgbmatrix_module_globals, }; diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index cf1bc45d9d..c898bbb98f 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -21,8 +21,8 @@ primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; -#if CIRCUITPY_PROTOMATTER -STATIC bool any_display_uses_this_protomatter(protomatter_protomatter_obj_t* pm) { +#if CIRCUITPY_RGBMATRIX +STATIC bool any_display_uses_this_rgbmatrix(rgbmatrix_rgbmatrix_obj_t* pm) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { if (displays[i].framebuffer_display.base.type == &framebufferio_framebufferdisplay_type) { framebufferio_framebufferdisplay_obj_t* display = &displays[i].framebuffer_display; @@ -103,8 +103,8 @@ void common_hal_displayio_release_displays(void) { } else if (bus_type == &displayio_parallelbus_type) { common_hal_displayio_parallelbus_deinit(&displays[i].parallel_bus); #if CIRCUITPY_FRAMEBUFFERIO - } else if (bus_type == &protomatter_Protomatter_type) { - common_hal_protomatter_protomatter_deinit(&displays[i].protomatter); + } else if (bus_type == &rgbmatrix_RGBMatrix_type) { + common_hal_rgbmatrix_rgbmatrix_deinit(&displays[i].rgbmatrix); #endif } displays[i].fourwire_bus.base.type = &mp_type_NoneType; @@ -167,11 +167,11 @@ void reset_displays(void) { } } } -#if CIRCUITPY_PROTOMATTER - } else if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { - protomatter_protomatter_obj_t * pm = &displays[i].protomatter; - if(!any_display_uses_this_protomatter(pm)) { - common_hal_protomatter_protomatter_deinit(pm); +#if CIRCUITPY_RGBMATRIX + } else if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { + rgbmatrix_rgbmatrix_obj_t * pm = &displays[i].rgbmatrix; + if(!any_display_uses_this_rgbmatrix(pm)) { + common_hal_rgbmatrix_rgbmatrix_deinit(pm); } #endif } else { @@ -200,9 +200,9 @@ void reset_displays(void) { void displayio_gc_collect(void) { for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { -#if CIRCUITPY_PROTOMATTER - if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { - protomatter_protomatter_collect_ptrs(&displays[i].protomatter); +#if CIRCUITPY_RGBMATRIX + if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { + rgbmatrix_rgbmatrix_collect_ptrs(&displays[i].rgbmatrix); } #endif diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 87c0d33568..9eb10c28b2 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -43,8 +43,8 @@ typedef struct { displayio_fourwire_obj_t fourwire_bus; displayio_i2cdisplay_obj_t i2cdisplay_bus; displayio_parallelbus_obj_t parallel_bus; -#if CIRCUITPY_PROTOMATTER - protomatter_protomatter_obj_t protomatter; +#if CIRCUITPY_RGBMATRIX + rgbmatrix_rgbmatrix_obj_t rgbmatrix; #endif }; union { diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 17049494d6..df064ff81f 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -42,7 +42,7 @@ extern Protomatter_core *_PM_protoPtr; -void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t *self, int width, int bit_depth, uint8_t rgb_count, uint8_t *rgb_pins, uint8_t addr_count, uint8_t *addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void *timer) { +void common_hal_rgbmatrix_rgbmatrix_construct(rgbmatrix_rgbmatrix_obj_t *self, int width, int bit_depth, uint8_t rgb_count, uint8_t *rgb_pins, uint8_t addr_count, uint8_t *addr_pins, uint8_t clock_pin, uint8_t latch_pin, uint8_t oe_pin, bool doublebuffer, mp_obj_t framebuffer, void *timer) { self->width = width; self->bit_depth = bit_depth; self->rgb_count = rgb_count; @@ -54,7 +54,7 @@ void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t self->latch_pin = latch_pin; self->doublebuffer = doublebuffer; - self->timer = timer ? timer : common_hal_protomatter_timer_allocate(); + self->timer = timer ? timer : common_hal_rgbmatrix_timer_allocate(); if (self->timer == NULL) { mp_raise_ValueError(translate("No timer available")); } @@ -62,10 +62,10 @@ void common_hal_protomatter_protomatter_construct(protomatter_protomatter_obj_t self->width = width; self->bufsize = 2 * width * rgb_count / 3 * (1 << addr_count); - common_hal_protomatter_protomatter_reconstruct(self, framebuffer); + common_hal_rgbmatrix_rgbmatrix_reconstruct(self, framebuffer); } -void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_t* self, mp_obj_t framebuffer) { +void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t* self, mp_obj_t framebuffer) { if (framebuffer) { self->framebuffer = framebuffer; framebuffer = mp_obj_new_bytearray_of_zeros(self->bufsize); @@ -99,7 +99,7 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ if (stat == PROTOMATTER_OK) { _PM_protoPtr = &self->core; common_hal_mcu_disable_interrupts(); - common_hal_protomatter_timer_enable(self->timer); + common_hal_rgbmatrix_timer_enable(self->timer); stat = _PM_begin(&self->core); _PM_convert_565(&self->core, self->bufinfo.buf, self->width); common_hal_mcu_enable_interrupts(); @@ -109,7 +109,7 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ if (stat != PROTOMATTER_OK) { // XXX this deinit() actually makes crashy-crashy // can trigger it by sending inappropriate pins - common_hal_protomatter_protomatter_deinit(self); + common_hal_rgbmatrix_rgbmatrix_deinit(self); switch (stat) { case PROTOMATTER_ERR_PINS: mp_raise_ValueError(translate("Invalid pin")); @@ -120,7 +120,7 @@ void common_hal_protomatter_protomatter_reconstruct(protomatter_protomatter_obj_ case PROTOMATTER_ERR_MALLOC: /// should have already been signaled as NLR default: mp_raise_msg_varg(&mp_type_RuntimeError, - translate("Protomatter internal error #%d"), (int)stat); + translate("Internal error #%d"), (int)stat); break; } } @@ -142,9 +142,9 @@ STATIC void free_pin_seq(uint8_t *seq, int count) { } } -void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t* self) { +void common_hal_rgbmatrix_rgbmatrix_deinit(rgbmatrix_rgbmatrix_obj_t* self) { if (self->timer) { - common_hal_protomatter_timer_free(self->timer); + common_hal_rgbmatrix_timer_free(self->timer); self->timer = 0; } @@ -173,14 +173,14 @@ void common_hal_protomatter_protomatter_deinit(protomatter_protomatter_obj_t* se self->framebuffer = NULL; } -void protomatter_protomatter_collect_ptrs(protomatter_protomatter_obj_t* self) { +void rgbmatrix_rgbmatrix_collect_ptrs(rgbmatrix_rgbmatrix_obj_t* self) { gc_collect_ptr(self->framebuffer); gc_collect_ptr(self->core.rgbPins); gc_collect_ptr(self->core.addr); gc_collect_ptr(self->core.screenData); } -void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t* self, bool paused) { +void common_hal_rgbmatrix_rgbmatrix_set_paused(rgbmatrix_rgbmatrix_obj_t* self, bool paused) { if (paused && !self->paused) { _PM_stop(&self->core); } else if (!paused && self->paused) { @@ -189,20 +189,20 @@ void common_hal_protomatter_protomatter_set_paused(protomatter_protomatter_obj_t self->paused = paused; } -bool common_hal_protomatter_protomatter_get_paused(protomatter_protomatter_obj_t* self) { +bool common_hal_rgbmatrix_rgbmatrix_get_paused(rgbmatrix_rgbmatrix_obj_t* self) { return self->paused; } -void common_hal_protomatter_protomatter_refresh(protomatter_protomatter_obj_t* self) { +void common_hal_rgbmatrix_rgbmatrix_refresh(rgbmatrix_rgbmatrix_obj_t* self) { _PM_convert_565(&self->core, self->bufinfo.buf, self->width); _PM_swapbuffer_maybe(&self->core); } -int common_hal_protomatter_protomatter_get_width(protomatter_protomatter_obj_t* self) { +int common_hal_rgbmatrix_rgbmatrix_get_width(rgbmatrix_rgbmatrix_obj_t* self) { return self->width; } -int common_hal_protomatter_protomatter_get_height(protomatter_protomatter_obj_t* self) { +int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self) { int computed_height = (self->rgb_count / 3) << (self->addr_count); return computed_height; } diff --git a/shared-module/rgbmatrix/allocator.h b/shared-module/rgbmatrix/allocator.h index b7f517ce5b..5e6f0b41d2 100644 --- a/shared-module/rgbmatrix/allocator.h +++ b/shared-module/rgbmatrix/allocator.h @@ -1,5 +1,5 @@ -#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H -#define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H +#ifndef MICROPY_INCLUDED_SHARED_MODULE_RGBMATRIX_ALLOCATOR_H +#define MICROPY_INCLUDED_SHARED_MODULE_RGBMATRIX_ALLOCATOR_H #include #include "py/gc.h" diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 95926bc9c0..9c074209b8 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -34,7 +34,7 @@ #include "shared-bindings/displayio/TileGrid.h" #include "supervisor/memory.h" -#if CIRCUITPY_PROTOMATTER +#if CIRCUITPY_RGBMATRIX #include "shared-module/displayio/__init__.h" #endif @@ -116,11 +116,11 @@ void supervisor_display_move_memory(void) { grid->inline_tiles = false; } MP_STATE_VM(terminal_tilegrid_tiles) = NULL; - #if CIRCUITPY_PROTOMATTER + #if CIRCUITPY_RGBMATRIX for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) { - if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) { - protomatter_protomatter_obj_t * pm = &displays[i].protomatter; - common_hal_protomatter_protomatter_reconstruct(pm, NULL); + if (displays[i].rgbmatrix.base.type == &rgbmatrix_RGBMatrix_type) { + rgbmatrix_rgbmatrix_obj_t * pm = &displays[i].rgbmatrix; + common_hal_rgbmatrix_rgbmatrix_reconstruct(pm, NULL); } } #endif From 37cb6bafa80f0c5f634f261aca57e377a16a37b0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 16 Apr 2020 12:39:54 -0500 Subject: [PATCH 274/919] RGBMatrix: documentation got behind the code --- shared-bindings/rgbmatrix/RGBMatrix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 3fa9d560e1..ef2f554c6b 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -135,12 +135,14 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ //| :class:`~rgbmatrix.RGBMatrix` displays an in-memory framebuffer to an LED matrix. //| -//| .. class:: RGBMatrix(width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, *, doublebuffer=True, framebuffer=None) +//| .. class:: RGBMatrix(*, width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, doublebuffer=True, framebuffer=None, height=0) //| //| Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: //| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 -//| address lines, the display will be 32 pixels tall. +//| address lines, the display will be 32 pixels tall. If the optional height +//| parameter is specified and is not 0, it is checked against the calculated +//| height. //| //| Up to 30 RGB pins and 8 address pins are supported. //| From 8c455f24bf639e83ef1f9c74d9df3c35a81a8710 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 16 Apr 2020 12:40:17 -0500 Subject: [PATCH 275/919] RGBMatrix: this comment no longer describes the code ... allocate_display_bus_or_raise() uses fixed storage, not heap storage. --- shared-bindings/rgbmatrix/RGBMatrix.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index ef2f554c6b..af89053284 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -192,9 +192,6 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - // Because interrupt handlers point directly at rgbmatrix objects, - // it is NOT okay to move them to the long-lived pool later. Allocate - // them there to begin with, since generally they'll be long-lived anyway. rgbmatrix_rgbmatrix_obj_t *self = &allocate_display_bus_or_raise()->rgbmatrix; self->base.type = &rgbmatrix_RGBMatrix_type; From 9bfe6b719718441ce9b661f1c3d92e707ad10131 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Apr 2020 08:16:56 -0500 Subject: [PATCH 276/919] framebufferio: update copyright information --- shared-bindings/framebufferio/FramebufferDisplay.c | 1 + shared-bindings/framebufferio/FramebufferDisplay.h | 1 + shared-module/framebufferio/FramebufferDisplay.c | 1 + shared-module/framebufferio/FramebufferDisplay.h | 1 + 4 files changed, 4 insertions(+) diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 820eda51af..9ff6cc12d7 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index e7ead6ac55..c41e041cea 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index db17013ead..13fbb26299 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index ea2fe168ea..1b68d2ab02 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Jeff Epler for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From b4c1b355bb621c0b1e9980d2d83262327bd001f8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 17 Apr 2020 18:44:35 -0500 Subject: [PATCH 277/919] make translate --- locale/ID.po | 32 ++++++++++++++++---------------- locale/circuitpython.pot | 32 ++++++++++++++++---------------- locale/de_DE.po | 32 ++++++++++++++++---------------- locale/en_US.po | 32 ++++++++++++++++---------------- locale/en_x_pirate.po | 32 ++++++++++++++++---------------- locale/es.po | 32 ++++++++++++++++---------------- locale/fil.po | 32 ++++++++++++++++---------------- locale/fr.po | 32 ++++++++++++++++---------------- locale/it_IT.po | 32 ++++++++++++++++---------------- locale/ko.po | 32 ++++++++++++++++---------------- locale/pl.po | 32 ++++++++++++++++---------------- locale/pt_BR.po | 32 ++++++++++++++++---------------- locale/zh_Latn_pinyin.po | 32 ++++++++++++++++---------------- 13 files changed, 208 insertions(+), 208 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 57cdce469b..fe503d20a5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,7 +53,7 @@ msgstr "output:\n" msgid "%%c requires int or char" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -328,7 +328,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -365,9 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "Kedua pin harus mendukung hardware interrut" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -834,6 +834,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -869,7 +874,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -924,7 +929,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin tidak valid" @@ -1039,7 +1044,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1127,7 +1132,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1207,7 +1212,7 @@ msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1233,11 +1238,6 @@ msgstr "" "Tekan tombol apa saja untuk masuk ke dalam REPL. Gunakan CTRL+D untuk reset " "(Reload)" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2817,12 +2817,12 @@ msgstr "anotasi return harus sebuah identifier" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e9e7838cbb..7a7eb5d440 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 12:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,7 +53,7 @@ msgstr "" msgid "%%c requires int or char" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -326,7 +326,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -361,9 +361,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -823,6 +823,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -858,7 +863,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -913,7 +918,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1028,7 +1033,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1116,7 +1121,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1195,7 +1200,7 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1219,11 +1224,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2792,12 +2792,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index bdc4c9bf49..ac7ff8cad0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -55,7 +55,7 @@ msgstr " Ausgabe:\n" msgid "%%c requires int or char" msgstr "%%c erwartet int oder char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -328,7 +328,7 @@ msgstr "Array muss Halbwörter enthalten (type 'H')" msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -365,9 +365,9 @@ msgstr "Bit depth muss ein Vielfaches von 8 sein." msgid "Both pins must support hardware interrupts" msgstr "Beide pins müssen Hardware Interrupts unterstützen" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "Die Helligkeit muss zwischen 0 und 1.0 liegen" @@ -831,6 +831,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -866,7 +871,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -921,7 +926,7 @@ msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Ungültiger Pin" @@ -1037,7 +1042,7 @@ msgstr "Muss eine %q Unterklasse sein." msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1125,7 +1130,7 @@ msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1210,7 +1215,7 @@ msgstr "Pin hat keine ADC Funktionalität" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1236,11 +1241,6 @@ msgstr "" "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " "laden" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -2830,12 +2830,12 @@ msgstr "return annotation muss ein identifier sein" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 8028a42da1..ab482425e8 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -53,7 +53,7 @@ msgstr "" msgid "%%c requires int or char" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -326,7 +326,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -361,9 +361,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -823,6 +823,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -858,7 +863,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -913,7 +918,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1028,7 +1033,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1116,7 +1121,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1195,7 +1200,7 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1219,11 +1224,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2792,12 +2792,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index c98c0faa74..7deda37182 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -55,7 +55,7 @@ msgstr "" msgid "%%c requires int or char" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -328,7 +328,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -365,9 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -827,6 +827,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -862,7 +867,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -917,7 +922,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "" @@ -1032,7 +1037,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1120,7 +1125,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1199,7 +1204,7 @@ msgstr "Belay that! Th' Pin be not ADC capable" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1223,11 +1228,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2796,12 +2796,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/es.po b/locale/es.po index 7cf5086441..388a8b3be9 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -55,7 +55,7 @@ msgstr " salida:\n" msgid "%%c requires int or char" msgstr "%%c requiere int o char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -330,7 +330,7 @@ msgstr "Array debe contener media palabra (type 'H')" msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -367,9 +367,9 @@ msgstr "Bits depth debe ser múltiplo de 8." msgid "Both pins must support hardware interrupts" msgstr "Ambos pines deben soportar interrupciones por hardware" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -831,6 +831,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -866,7 +871,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -921,7 +926,7 @@ msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin inválido" @@ -1036,7 +1041,7 @@ msgstr "Debe de ser una subclase de %q" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1124,7 +1129,7 @@ msgstr "No queda espacio en el dispositivo" msgid "No such file/directory" msgstr "No existe el archivo/directorio" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1209,7 +1214,7 @@ msgstr "Pin no tiene capacidad ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1235,11 +1240,6 @@ msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." @@ -2830,12 +2830,12 @@ msgstr "la anotación de retorno debe ser un identificador" msgid "return expected '%q' but got '%q'" msgstr "retorno esperado '%q' pero se obtuvo '%q'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 3b6fee0380..90e650374a 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -53,7 +53,7 @@ msgstr " output:\n" msgid "%%c requires int or char" msgstr "%%c nangangailangan ng int o char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -330,7 +330,7 @@ msgstr "May halfwords (type 'H') dapat ang array" msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -367,9 +367,9 @@ msgstr "Bit depth ay dapat multiple ng 8." msgid "Both pins must support hardware interrupts" msgstr "Ang parehong mga pin ay dapat na sumusuporta sa hardware interrupts" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -839,6 +839,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -874,7 +879,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Maling argumento" @@ -929,7 +934,7 @@ msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Mali ang pin" @@ -1044,7 +1049,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1132,7 +1137,7 @@ msgstr "" msgid "No such file/directory" msgstr "Walang file/directory" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1215,7 +1220,7 @@ msgstr "Ang pin ay walang kakayahan sa ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1241,11 +1246,6 @@ msgstr "" "Pindutin ang anumang key upang pumasok sa REPL. Gamitin ang CTRL-D upang i-" "reload." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." @@ -2844,12 +2844,12 @@ msgstr "return annotation ay dapat na identifier" msgid "return expected '%q' but got '%q'" msgstr "return umasa ng '%q' pero ang nakuha ay ‘%q’" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 64c78b57a5..ee0a05439b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -55,7 +55,7 @@ msgstr " sortie:\n" msgid "%%c requires int or char" msgstr "%%c nécessite un entier 'int' ou un caractère 'char'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -334,7 +334,7 @@ msgstr "Le tableau doit contenir des demi-mots (type 'H')" msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -371,9 +371,9 @@ msgstr "La profondeur de bit doit être un multiple de 8." msgid "Both pins must support hardware interrupts" msgstr "Les deux entrées doivent supporter les interruptions matérielles" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -842,6 +842,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -878,7 +883,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argument invalide" @@ -935,7 +940,7 @@ msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Broche invalide" @@ -1051,7 +1056,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1139,7 +1144,7 @@ msgstr "Il n'y a plus d'espace libre sur le périphérique" msgid "No such file/directory" msgstr "Fichier/dossier introuvable" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1229,7 +1234,7 @@ msgstr "La broche ne peut être utilisée pour l'ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1254,11 +1259,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." @@ -2876,12 +2876,12 @@ msgstr "l'annotation de return doit être un identifiant" msgid "return expected '%q' but got '%q'" msgstr "return attendait '%q' mais a reçu '%q'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 99e99a3cb0..7085f9a4b4 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -53,7 +53,7 @@ msgstr " output:\n" msgid "%%c requires int or char" msgstr "%%c necessita di int o char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -329,7 +329,7 @@ msgstr "Array deve avere mezzoparole (typo 'H')" msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -367,9 +367,9 @@ msgstr "La profondità di bit deve essere multipla di 8." msgid "Both pins must support hardware interrupts" msgstr "Entrambi i pin devono supportare gli interrupt hardware" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -839,6 +839,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -874,7 +879,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -931,7 +936,7 @@ msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pin non valido" @@ -1048,7 +1053,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1136,7 +1141,7 @@ msgstr "Non che spazio sul dispositivo" msgid "No such file/directory" msgstr "Nessun file/directory esistente" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1224,7 +1229,7 @@ msgstr "Il pin non ha capacità di ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1250,11 +1255,6 @@ msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Premi un qualunque tasto per entrare nel REPL. Usa CTRL-D per ricaricare." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2851,12 +2851,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "return aspettava '%q' ma ha ottenuto '%q'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index d232133e2a..760010c706 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -55,7 +55,7 @@ msgstr " 산출:\n" msgid "%%c requires int or char" msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -328,7 +328,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -365,9 +365,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -827,6 +827,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -862,7 +867,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -917,7 +922,7 @@ msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "핀이 잘못되었습니다" @@ -1032,7 +1037,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1120,7 +1125,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1199,7 +1204,7 @@ msgstr "" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1223,11 +1228,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2797,12 +2797,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 6b58cbc4e5..12881677b3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -54,7 +54,7 @@ msgstr " wyjście:\n" msgid "%%c requires int or char" msgstr "%%c wymaga int lub char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -327,7 +327,7 @@ msgstr "Tablica musi zawierać pół-słowa (typ 'H')" msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -364,9 +364,9 @@ msgstr "Głębia musi być wielokrotnością 8." msgid "Both pins must support hardware interrupts" msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -828,6 +828,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -863,7 +868,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Zły argument" @@ -918,7 +923,7 @@ msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Zła nóżka" @@ -1033,7 +1038,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1121,7 +1126,7 @@ msgstr "Brak miejsca" msgid "No such file/directory" msgstr "Brak pliku/katalogu" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1200,7 +1205,7 @@ msgstr "Nóżka nie obsługuje ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1224,11 +1229,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." @@ -2802,12 +2802,12 @@ msgstr "anotacja wartości musi być identyfikatorem" msgid "return expected '%q' but got '%q'" msgstr "return oczekiwał '%q', a jest '%q'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6ef31ef4a7..da8276d752 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -53,7 +53,7 @@ msgstr " saída:\n" msgid "%%c requires int or char" msgstr "%%c requer int ou char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -329,7 +329,7 @@ msgstr "Array deve conter meias palavras (tipo 'H')" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -364,9 +364,9 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "Ambos os pinos devem suportar interrupções de hardware" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "" @@ -832,6 +832,11 @@ msgstr "" msgid "Internal define error" msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -867,7 +872,7 @@ msgstr "" msgid "Invalid UART pin selection" msgstr "" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -924,7 +929,7 @@ msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Pino inválido" @@ -1040,7 +1045,7 @@ msgstr "" msgid "Must provide MISO or MOSI pin" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1128,7 +1133,7 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1210,7 +1215,7 @@ msgstr "O pino não tem recursos de ADC" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1235,11 +1240,6 @@ msgstr "" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2814,12 +2814,12 @@ msgstr "" msgid "return expected '%q' but got '%q'" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 253760ff51..0ca59446f7 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-15 10:24-0400\n" +"POT-Creation-Date: 2020-04-17 18:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -60,7 +60,7 @@ msgstr " shūchū:\n" msgid "%%c requires int or char" msgstr "%%c xūyào zhěngshù huò char" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" @@ -333,7 +333,7 @@ msgstr "Shùzǔ bìxū bāohán bàn zìshù (type 'H')" msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -370,9 +370,9 @@ msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." msgid "Both pins must support hardware interrupts" msgstr "Liǎng gè yǐn jiǎo dōu bìxū zhīchí yìngjiàn zhōngduàn" -#: shared-bindings/_protomatter/Protomatter.c #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" msgstr "Liàngdù bìxū wèi 0-1.0" @@ -836,6 +836,11 @@ msgstr "Jiāmì bùzú" msgid "Internal define error" msgstr "Nèibù dìngyì cuòwù" +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -871,7 +876,7 @@ msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" -#: py/moduerrno.c shared-module/_protomatter/Protomatter.c +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Wúxiào de cānshù" @@ -926,7 +931,7 @@ msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_protomatter/Protomatter.c +#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" msgstr "Wúxiào de yǐn jiǎo" @@ -1041,7 +1046,7 @@ msgstr "Bìxū shì %q zi lèi." msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "" @@ -1129,7 +1134,7 @@ msgstr "Shèbèi shàng méiyǒu kònggé" msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" -#: shared-module/_protomatter/Protomatter.c +#: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" msgstr "" @@ -1214,7 +1219,7 @@ msgstr "Pin méiyǒu ADC nénglì" msgid "Pin number already reserved by EXTI" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "" "Pinout uses %d bytes per element, which consumes more than the ideal %d " @@ -1238,11 +1243,6 @@ msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng" msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài." -#: shared-module/_protomatter/Protomatter.c -#, c-format -msgid "Protomatter internal error #%d" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." @@ -2831,12 +2831,12 @@ msgstr "fǎnhuí zhùshì bìxū shì biāozhì fú" msgid "return expected '%q' but got '%q'" msgstr "fǎnhuí yùqí de '%q' dàn huòdéle '%q'" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" msgstr "" -#: shared-bindings/_protomatter/Protomatter.c +#: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" From 898c09c35e994402ae0bafb25dba5ba284838a82 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 19 Apr 2020 09:10:08 -0500 Subject: [PATCH 278/919] RGBMatrix: nonessential change to kick Actions --- shared-bindings/rgbmatrix/RGBMatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index af89053284..d758774d9f 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -284,7 +284,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_set_brightness(mp_obj_t self_in, mp_obj_t va if (brightness < 0.0f || brightness > 1.0f) { mp_raise_ValueError(translate("Brightness must be 0-1.0")); } - common_hal_rgbmatrix_rgbmatrix_set_paused(self_in, brightness <= 0); + common_hal_rgbmatrix_rgbmatrix_set_paused(self, brightness <= 0); return mp_const_none; } From 506f340c7d8ca8f266bce39cd603b812329467f6 Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Mon, 20 Apr 2020 17:55:08 +0200 Subject: [PATCH 279/919] STM32: f767: Fixes linker settings. --- ports/stm/boards/STM32F767_fs.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 40f7d740ae..4acca4d660 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K } From 05b5356accefa02a868064fbc402a4646535004d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 17 Apr 2020 10:37:46 +0800 Subject: [PATCH 280/919] external_flash: add support for mx25r1635f This flash chip is used in Simmel. Signed-off-by: Sean Cross --- supervisor/shared/external_flash/devices.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index fd9224f561..57c52e2ea3 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -481,6 +481,25 @@ typedef struct { .single_status_byte = true, \ } +// Settings for the Macronix MX25R1635F 8MiB SPI flash. +// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F,%20Wide%20Range,%2016Mb,%20v1.6.pdf +// In low power mode, quad operations can only run at 8 MHz. +#define MX25R1635F {\ + .total_size = (1 << 21), /* 2 MiB */ \ + .start_up_time_us = 800, \ + .manufacturer_id = 0xc2, \ + .memory_type = 0x28, \ + .capacity = 0x18, \ + .max_clock_speed_mhz = 33, /* 8 mhz for dual/quad */ \ + .quad_enable_bit_mask = 0x80, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} + // Settings for the Macronix MX25L51245G 64MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7437/MX25L51245G,%203V,%20512Mb,%20v1.6.pdf #define MX25L51245G {\ From ac9d336f40634419617d13464e87ab6917f9152a Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 17 Apr 2020 10:36:26 +0800 Subject: [PATCH 281/919] nrf: make neopixel support optional Add a conditional around the call to neopixel_write(), allowing us to build for nrf without neopixel support. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index cbe0cec54d..1b92e78326 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -104,7 +104,10 @@ void reset_port(void) { i2c_reset(); spi_reset(); uart_reset(); + +#if CIRCUITPY_NEOPIXEL_WRITE neopixel_write_reset(); +#endif #if CIRCUITPY_AUDIOBUSIO i2s_reset(); From 066f486b28c38c71f89cbba44e31857125ff243e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 19 Apr 2020 13:53:51 +0800 Subject: [PATCH 282/919] nrf: supervisor: support building without BUSIO Only initialize i2c, spi, and uart if building with BUSIO. Signed-off-by: Sean Cross --- ports/nrf/nrfx_config.h | 15 ++++++++------- ports/nrf/supervisor/port.c | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index e37c609340..a13ddf018a 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -31,8 +31,8 @@ #define CIRCUITPY_NRF_NUM_I2C 2 #endif -#if CIRCUITPY_NRF_NUM_I2C != 1 && CIRCUITPY_NRF_NUM_I2C != 2 -# error CIRCUITPY_NRF_NUM_I2C must be 1 or 2 +#if CIRCUITPY_NRF_NUM_I2C != 0 && CIRCUITPY_NRF_NUM_I2C != 1 && CIRCUITPY_NRF_NUM_I2C != 2 +# error CIRCUITPY_NRF_NUM_I2C must be 0, 1, or 2 #endif // Enable SPIM1, SPIM2 and SPIM3 (if available) @@ -44,7 +44,7 @@ #ifdef NRF52840_XXAA #define NRFX_SPIM_EXTENDED_ENABLED 1 #define NRFX_SPIM3_ENABLED 1 -#else +#elif CIRCUITPY_NRF_NUM_I2C == 2 #define NRFX_SPIM3_ENABLED 0 #endif @@ -56,17 +56,18 @@ #define NRFX_QSPI_ENABLED 1 // TWI aka. I2C; always enable TWIM0 (no conflict with SPIM1 and SPIM2) +#if CIRCUITPY_NRF_NUM_I2C == 1 || CIRCUITPY_NRF_NUM_I2C == 2 #define NRFX_TWIM_ENABLED 1 #define NRFX_TWIM0_ENABLED 1 +#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7 +#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY NRF_TWIM_FREQ_400K +#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 +#endif #if CIRCUITPY_NRF_NUM_I2C == 2 #define NRFX_TWIM1_ENABLED 1 #endif -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7 -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY NRF_TWIM_FREQ_400K -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 - // UART #define NRFX_UARTE_ENABLED 1 #define NRFX_UARTE0_ENABLED 1 diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 1b92e78326..3f16e090f6 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -101,9 +101,11 @@ void reset_port(void) { gamepad_reset(); #endif +#if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); uart_reset(); +#endif #if CIRCUITPY_NEOPIXEL_WRITE neopixel_write_reset(); From 4ad1cbeea37a514ab37a7c819f6d5e359948c368 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 21 Apr 2020 10:02:24 +0800 Subject: [PATCH 283/919] nrf: make rgbmatrix and framebufferio optional Ports can set CIRCUITPY_RGBMATRIX and CIRCUITPY_FRAMEBUFFERIO to 0 in their .mk file in order to prevent these from being built. This is necessary for resource-constrained devices. Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index ec6850ebb6..342f1384a1 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -51,8 +51,8 @@ endif # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_RGBMATRIX = 1 -CIRCUITPY_FRAMEBUFFERIO = 1 +CIRCUITPY_RGBMATRIX ?= 1 +CIRCUITPY_FRAMEBUFFERIO ?= 1 # nRF52840-specific From 3ed5b87b8fea218c0485282ed1cf9fdf5a6f687f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 17 Apr 2020 10:35:33 +0800 Subject: [PATCH 284/919] nrf: add support for nrf52833 This adds preliminary support for the nRF52833, which is a variant of the nRF52840 with half the RAM, half the flash, and fewer peripherals. Signed-off-by: Sean Cross --- ports/nrf/Makefile | 5 + ports/nrf/boards/common.template.ld | 4 +- .../nrf/common-hal/microcontroller/__init__.c | 12 ++ ports/nrf/device/nrf52/startup_nrf52833.c | 184 ++++++++++++++++++ ports/nrf/ld_defines.c | 3 + ports/nrf/mpconfigport.h | 17 +- ports/nrf/mpconfigport.mk | 14 ++ ports/nrf/nrfx_config.h | 4 +- ports/nrf/peripherals/nrf/nrf52833/pins.c | 72 +++++++ ports/nrf/peripherals/nrf/nrf52833/pins.h | 73 +++++++ ports/nrf/peripherals/nrf/nrf52833/power.c | 50 +++++ ports/nrf/peripherals/nrf/pins.h | 5 + 12 files changed, 437 insertions(+), 6 deletions(-) create mode 100644 ports/nrf/device/nrf52/startup_nrf52833.c create mode 100644 ports/nrf/peripherals/nrf/nrf52833/pins.c create mode 100644 ports/nrf/peripherals/nrf/nrf52833/pins.h create mode 100644 ports/nrf/peripherals/nrf/nrf52833/power.c diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 89d88ce366..876628342d 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -182,6 +182,11 @@ SRC_C += \ lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c endif +ifeq ($(MCU_SUB_VARIANT),nrf52833) +SRC_C += \ + lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c +endif + ifeq ($(CIRCUITPY_NETWORK),1) CFLAGS += -DMICROPY_PY_NETWORK=1 diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 2fca167079..a2bbf0ec80 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -5,7 +5,7 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = ${FLASH_SIZE} /* entire flash */ /* nRF SoftDevice */ FLASH_MBR (rx) : ORIGIN = ${MBR_START_ADDR}, LENGTH = ${MBR_SIZE} FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE} @@ -23,7 +23,7 @@ MEMORY /* To measure the minimum required amount of memory for given configuration, set this number high enough to work and then check the mutation of the value done by sd_ble_enable. */ SPIM3_RAM (rw) : ORIGIN = 0x20000000 + ${SOFTDEVICE_RAM_SIZE}, LENGTH = ${SPIM3_BUFFER_SIZE} - RAM (xrw) : ORIGIN = 0x20000000 + ${SOFTDEVICE_RAM_SIZE} + ${SPIM3_BUFFER_SIZE}, LENGTH = 256K - ${SOFTDEVICE_RAM_SIZE} -${SPIM3_BUFFER_SIZE} + RAM (xrw) : ORIGIN = 0x20000000 + ${SOFTDEVICE_RAM_SIZE} + ${SPIM3_BUFFER_SIZE}, LENGTH = ${RAM_SIZE} - ${SOFTDEVICE_RAM_SIZE} -${SPIM3_BUFFER_SIZE} } diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 7eb1c06149..90d97f8689 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -168,5 +168,17 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P1_14), MP_ROM_PTR(&pin_P1_14) }, { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, #endif +#ifdef NRF52833 + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_03), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_05), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_08), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, +#endif }; MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/nrf/device/nrf52/startup_nrf52833.c b/ports/nrf/device/nrf52/startup_nrf52833.c new file mode 100644 index 0000000000..ad875dceed --- /dev/null +++ b/ports/nrf/device/nrf52/startup_nrf52833.c @@ -0,0 +1,184 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Glenn Ruben Bakke + * + * 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 + +extern uint32_t _estack; +extern uint32_t _sidata; +extern uint32_t _sdata; +extern uint32_t _edata; +extern uint32_t _sbss; +extern uint32_t _ebss; + +typedef void (*func)(void); + +#define _start main + +extern void _start(void) __attribute__((noreturn)); +extern void SystemInit(void); + +void Default_Handler(void) { + while (1); +} + +void Reset_Handler(void) { + uint32_t * p_src = &_sidata; + uint32_t * p_dest = &_sdata; + + while (p_dest < &_edata) { + *p_dest++ = *p_src++; + } + + uint32_t * p_bss = &_sbss; + uint32_t * p_bss_end = &_ebss; + while (p_bss < p_bss_end) { + *p_bss++ = 0ul; + } + + SystemInit(); + _start(); +} + +void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void HardFault_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void MemoryManagement_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void BusFault_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void UsageFault_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void DebugMon_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler"))); + +void POWER_CLOCK_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void RADIO_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void UARTE0_UART0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void NFCT_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void GPIOTE_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SAADC_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TIMER0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TIMER1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TIMER2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void RTC0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TEMP_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void RNG_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void ECB_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void CCM_AAR_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void WDT_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void RTC1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void QDEC_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void COMP_LPCOMP_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI0_EGU0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI1_EGU1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI2_EGU2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI3_EGU3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI4_EGU4_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SWI5_EGU5_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TIMER3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void TIMER4_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PWM0_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PDM_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void MWU_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PWM1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PWM2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SPIM2_SPIS2_SPI2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void RTC2_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void I2S_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void FPU_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void USBD_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void UARTE1_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void PWM3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); +void SPIM3_IRQHandler (void) __attribute__ ((weak, alias("Default_Handler"))); + +const func __Vectors[] __attribute__ ((used, section(".isr_vector"))) = { + (func)&_estack, + Reset_Handler, + NMI_Handler, + HardFault_Handler, + MemoryManagement_Handler, + BusFault_Handler, + UsageFault_Handler, + 0, + 0, + 0, + 0, + SVC_Handler, + DebugMon_Handler, + 0, + PendSV_Handler, + SysTick_Handler, + + /* External Interrupts */ + POWER_CLOCK_IRQHandler, + RADIO_IRQHandler, + UARTE0_UART0_IRQHandler, + SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler, + SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler, + NFCT_IRQHandler, + GPIOTE_IRQHandler, + SAADC_IRQHandler, + TIMER0_IRQHandler, + TIMER1_IRQHandler, + TIMER2_IRQHandler, + RTC0_IRQHandler, + TEMP_IRQHandler, + RNG_IRQHandler, + ECB_IRQHandler, + CCM_AAR_IRQHandler, + WDT_IRQHandler, + RTC1_IRQHandler, + QDEC_IRQHandler, + COMP_LPCOMP_IRQHandler, + SWI0_EGU0_IRQHandler, + SWI1_EGU1_IRQHandler, + SWI2_EGU2_IRQHandler, + SWI3_EGU3_IRQHandler, + SWI4_EGU4_IRQHandler, + SWI5_EGU5_IRQHandler, + TIMER3_IRQHandler, + TIMER4_IRQHandler, + PWM0_IRQHandler, + PDM_IRQHandler, + 0, + 0, + MWU_IRQHandler, + PWM1_IRQHandler, + PWM2_IRQHandler, + SPIM2_SPIS2_SPI2_IRQHandler, + RTC2_IRQHandler, + I2S_IRQHandler, + FPU_IRQHandler, + USBD_IRQHandler, + UARTE1_IRQHandler, + 0, + 0, + 0, + 0, + PWM3_IRQHandler, + 0, + SPIM3_IRQHandler, +}; diff --git a/ports/nrf/ld_defines.c b/ports/nrf/ld_defines.c index ebe9c4929e..8430daccb9 100644 --- a/ports/nrf/ld_defines.c +++ b/ports/nrf/ld_defines.c @@ -9,6 +9,9 @@ // The next line is a marker to start looking for definitions. Lines above the next line are ignored. // START_LD_DEFINES +/*FLASH_SIZE=*/ FLASH_SIZE; +/*RAM_SIZE=*/ RAM_SIZE; + /*MBR_START_ADDR=*/ MBR_START_ADDR; /*MBR_SIZE=*/ MBR_SIZE; diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 44e51fc5f3..464a0b3bd5 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -41,6 +41,16 @@ #ifdef NRF52840 #define MICROPY_PY_SYS_PLATFORM "nRF52840" #define FLASH_SIZE (0x100000) // 1MiB +#define RAM_SIZE (0x40000) // 256 KiB +// Special RAM area for SPIM3 transmit buffer, to work around hardware bug. +// See common.template.ld. +#define SPIM3_BUFFER_SIZE (8192) +#endif + +#ifdef NRF52833 +#define MICROPY_PY_SYS_PLATFORM "nRF52833" +#define FLASH_SIZE (0x80000) // 512 KiB +#define RAM_SIZE (0x20000) // 128 KiB // Special RAM area for SPIM3 transmit buffer, to work around hardware bug. // See common.template.ld. #define SPIM3_BUFFER_SIZE (8192) @@ -112,14 +122,15 @@ // Define these regions starting down from the bootloader: // Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld -#define BOOTLOADER_START_ADDR (0x000F4000) +#define BOOTLOADER_START_ADDR (FLASH_SIZE - BOOTLOADER_SIZE - BOOTLOADER_SETTINGS_SIZE - BOOTLOADER_MBR_SIZE) +#define BOOTLOADER_MBR_SIZE (0x1000) // 4kib #define BOOTLOADER_SIZE (0xA000) // 40kiB -#define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) +#define BOOTLOADER_SETTINGS_START_ADDR (FLASH_SIZE - BOOTLOADER_SETTINGS_SIZE) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) -#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE > 0 && CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR != (BOOTLOADER_START_ADDR - 256*1024) +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE > 0 && CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR != (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) #warning Internal flash filesystem location has moved! #endif diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 342f1384a1..e483d455e7 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -73,4 +73,18 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS CIRCUITPY_ULAB = 1 + +else +ifeq ($(MCU_CHIP),nrf52833) +MCU_SERIES = m4 +MCU_VARIANT = nrf52 +MCU_SUB_VARIANT = nrf52833 + +SD ?= s140 +SOFTDEV_VERSION ?= 6.1.0 + +BOOT_SETTING_ADDR = 0x7F000 +NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 + +endif endif diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index a13ddf018a..05ec95ae38 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -41,7 +41,7 @@ #define NRFX_SPIM1_ENABLED 1 #endif #define NRFX_SPIM2_ENABLED 1 -#ifdef NRF52840_XXAA +#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) #define NRFX_SPIM_EXTENDED_ENABLED 1 #define NRFX_SPIM3_ENABLED 1 #elif CIRCUITPY_NRF_NUM_I2C == 2 @@ -53,7 +53,9 @@ #define NRFX_SPIM_MISO_PULL_CFG 1 // QSPI +#if defined(NRF52840_XXAA) #define NRFX_QSPI_ENABLED 1 +#endif // TWI aka. I2C; always enable TWIM0 (no conflict with SPIM1 and SPIM2) #if CIRCUITPY_NRF_NUM_I2C == 1 || CIRCUITPY_NRF_NUM_I2C == 2 diff --git a/ports/nrf/peripherals/nrf/nrf52833/pins.c b/ports/nrf/peripherals/nrf/nrf52833/pins.c new file mode 100644 index 0000000000..cdd4959cb2 --- /dev/null +++ b/ports/nrf/peripherals/nrf/nrf52833/pins.c @@ -0,0 +1,72 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "nrf/pins.h" + +const mcu_pin_obj_t pin_P0_00 = PIN(P0_00, 0, 0, 0); +const mcu_pin_obj_t pin_P0_01 = PIN(P0_01, 0, 1, 0); +const mcu_pin_obj_t pin_P0_02 = PIN(P0_02, 0, 2, SAADC_CH_PSELP_PSELP_AnalogInput0); +const mcu_pin_obj_t pin_P0_03 = PIN(P0_03, 0, 3, SAADC_CH_PSELP_PSELP_AnalogInput1); +const mcu_pin_obj_t pin_P0_04 = PIN(P0_04, 0, 4, SAADC_CH_PSELP_PSELP_AnalogInput2); +const mcu_pin_obj_t pin_P0_05 = PIN(P0_05, 0, 5, SAADC_CH_PSELP_PSELP_AnalogInput3); +const mcu_pin_obj_t pin_P0_06 = PIN(P0_06, 0, 6, 0); +const mcu_pin_obj_t pin_P0_07 = PIN(P0_07, 0, 7, 0); +const mcu_pin_obj_t pin_P0_08 = PIN(P0_08, 0, 8, 0); +const mcu_pin_obj_t pin_P0_09 = PIN(P0_09, 0, 9, 0); +const mcu_pin_obj_t pin_P0_10 = PIN(P0_10, 0, 10, 0); +const mcu_pin_obj_t pin_P0_11 = PIN(P0_11, 0, 11, 0); +const mcu_pin_obj_t pin_P0_12 = PIN(P0_12, 0, 12, 0); +const mcu_pin_obj_t pin_P0_13 = PIN(P0_13, 0, 13, 0); +const mcu_pin_obj_t pin_P0_14 = PIN(P0_14, 0, 14, 0); +const mcu_pin_obj_t pin_P0_15 = PIN(P0_15, 0, 15, 0); +const mcu_pin_obj_t pin_P0_16 = PIN(P0_16, 0, 16, 0); +const mcu_pin_obj_t pin_P0_17 = PIN(P0_17, 0, 17, 0); +const mcu_pin_obj_t pin_P0_18 = PIN(P0_18, 0, 18, 0); +const mcu_pin_obj_t pin_P0_19 = PIN(P0_19, 0, 19, 0); +const mcu_pin_obj_t pin_P0_20 = PIN(P0_20, 0, 20, 0); +const mcu_pin_obj_t pin_P0_21 = PIN(P0_21, 0, 21, 0); +const mcu_pin_obj_t pin_P0_22 = PIN(P0_22, 0, 22, 0); +const mcu_pin_obj_t pin_P0_23 = PIN(P0_23, 0, 23, 0); +const mcu_pin_obj_t pin_P0_24 = PIN(P0_24, 0, 24, 0); +const mcu_pin_obj_t pin_P0_25 = PIN(P0_25, 0, 25, 0); +const mcu_pin_obj_t pin_P0_26 = PIN(P0_26, 0, 26, 0); +const mcu_pin_obj_t pin_P0_27 = PIN(P0_27, 0, 27, 0); +const mcu_pin_obj_t pin_P0_28 = PIN(P0_28, 0, 28, SAADC_CH_PSELP_PSELP_AnalogInput4); +const mcu_pin_obj_t pin_P0_29 = PIN(P0_29, 0, 29, SAADC_CH_PSELP_PSELP_AnalogInput5); +const mcu_pin_obj_t pin_P0_30 = PIN(P0_30, 0, 30, SAADC_CH_PSELP_PSELP_AnalogInput6); +const mcu_pin_obj_t pin_P0_31 = PIN(P0_31, 0, 31, SAADC_CH_PSELP_PSELP_AnalogInput7); +const mcu_pin_obj_t pin_P1_00 = PIN(P1_00, 1, 0, 0); +const mcu_pin_obj_t pin_P1_01 = PIN(P1_01, 1, 1, 0); +const mcu_pin_obj_t pin_P1_02 = PIN(P1_02, 1, 2, 0); +const mcu_pin_obj_t pin_P1_03 = PIN(P1_03, 1, 3, 0); +const mcu_pin_obj_t pin_P1_04 = PIN(P1_04, 1, 4, 0); +const mcu_pin_obj_t pin_P1_05 = PIN(P1_05, 1, 5, 0); +const mcu_pin_obj_t pin_P1_06 = PIN(P1_06, 1, 6, 0); +const mcu_pin_obj_t pin_P1_07 = PIN(P1_07, 1, 7, 0); +const mcu_pin_obj_t pin_P1_08 = PIN(P1_08, 1, 8, 0); +const mcu_pin_obj_t pin_P1_09 = PIN(P1_09, 1, 9, 0); diff --git a/ports/nrf/peripherals/nrf/nrf52833/pins.h b/ports/nrf/peripherals/nrf/nrf52833/pins.h new file mode 100644 index 0000000000..44baa315b2 --- /dev/null +++ b/ports/nrf/peripherals/nrf/nrf52833/pins.h @@ -0,0 +1,73 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 by Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_NRF_PERIPHERALS_NRF52833_PINS_H +#define MICROPY_INCLUDED_NRF_PERIPHERALS_NRF52833_PINS_H + +extern const mcu_pin_obj_t pin_P0_00; +extern const mcu_pin_obj_t pin_P0_01; +extern const mcu_pin_obj_t pin_P0_02; +extern const mcu_pin_obj_t pin_P0_03; +extern const mcu_pin_obj_t pin_P0_04; +extern const mcu_pin_obj_t pin_P0_05; +extern const mcu_pin_obj_t pin_P0_06; +extern const mcu_pin_obj_t pin_P0_07; +extern const mcu_pin_obj_t pin_P0_08; +extern const mcu_pin_obj_t pin_P0_09; +extern const mcu_pin_obj_t pin_P0_10; +extern const mcu_pin_obj_t pin_P0_11; +extern const mcu_pin_obj_t pin_P0_12; +extern const mcu_pin_obj_t pin_P0_13; +extern const mcu_pin_obj_t pin_P0_14; +extern const mcu_pin_obj_t pin_P0_15; +extern const mcu_pin_obj_t pin_P0_16; +extern const mcu_pin_obj_t pin_P0_17; +extern const mcu_pin_obj_t pin_P0_18; +extern const mcu_pin_obj_t pin_P0_19; +extern const mcu_pin_obj_t pin_P0_20; +extern const mcu_pin_obj_t pin_P0_21; +extern const mcu_pin_obj_t pin_P0_22; +extern const mcu_pin_obj_t pin_P0_23; +extern const mcu_pin_obj_t pin_P0_24; +extern const mcu_pin_obj_t pin_P0_25; +extern const mcu_pin_obj_t pin_P0_26; +extern const mcu_pin_obj_t pin_P0_27; +extern const mcu_pin_obj_t pin_P0_28; +extern const mcu_pin_obj_t pin_P0_29; +extern const mcu_pin_obj_t pin_P0_30; +extern const mcu_pin_obj_t pin_P0_31; +extern const mcu_pin_obj_t pin_P1_00; +extern const mcu_pin_obj_t pin_P1_01; +extern const mcu_pin_obj_t pin_P1_02; +extern const mcu_pin_obj_t pin_P1_03; +extern const mcu_pin_obj_t pin_P1_04; +extern const mcu_pin_obj_t pin_P1_05; +extern const mcu_pin_obj_t pin_P1_06; +extern const mcu_pin_obj_t pin_P1_07; +extern const mcu_pin_obj_t pin_P1_08; +extern const mcu_pin_obj_t pin_P1_09; + +#endif // MICROPY_INCLUDED_NRF_PERIPHERALS_NRF52833_PINS_H diff --git a/ports/nrf/peripherals/nrf/nrf52833/power.c b/ports/nrf/peripherals/nrf/nrf52833/power.c new file mode 100644 index 0000000000..d64c536bb3 --- /dev/null +++ b/ports/nrf/peripherals/nrf/nrf52833/power.c @@ -0,0 +1,50 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx.h" +#include "hal/nrf_nvmc.h" + +void nrf_peripherals_power_init(void) { + // Set GPIO reference voltage to 3.3V if it isn't already. REGOUT0 will get reset to 0xfffffff + // if flash is erased, which sets the default to 1.8V + // This matters only when "high voltage mode" is enabled, which is true on the PCA10059, + // and might be true on other boards. + if (NRF_UICR->REGOUT0 == 0xffffffff && NRF_POWER->MAINREGSTATUS & 1) { + // Expand what nrf_nvmc_word_write() did. + // It's missing from nrfx V2.0.0, and nrfx_nvmc_word_write() does bounds + // checking which prevents writes to UICR. + // Reported: https://devzone.nordicsemi.com/f/nordic-q-a/57243/nrfx_nvmc-h-api-cannot-write-to-uicr + NRF_NVMC->CONFIG = NRF_NVMC_MODE_WRITE; + while (!(NRF_NVMC->READY & NVMC_READY_READY_Msk)) {} + NRF_UICR->REGOUT0 = UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos; + __DMB(); + while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {} + NRF_NVMC->CONFIG = NRF_NVMC_MODE_READONLY; + + // Must reset to enable change. + NVIC_SystemReset(); + } +} diff --git a/ports/nrf/peripherals/nrf/pins.h b/ports/nrf/peripherals/nrf/pins.h index 3a4c995790..efdc8892a4 100644 --- a/ports/nrf/peripherals/nrf/pins.h +++ b/ports/nrf/peripherals/nrf/pins.h @@ -61,4 +61,9 @@ extern const mp_obj_type_t mcu_pin_type; #include "nrf52840/pins.h" #endif +// Choose based on chip, but not specifically revision (e.g., not NRF52840_XXAA) +#ifdef NRF52833 +#include "nrf52833/pins.h" +#endif + #endif // __MICROPY_INCLUDED_NRF_PERIPHERALS_PINS_H__ From 33720af0c6b13e974fdf3246d87ad66082977a46 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 21 Apr 2020 11:09:43 +0800 Subject: [PATCH 285/919] nrf: mpconfigport: subtract config size from firmware size The BLE Config area needs to be subtracted from the size of the firmware. THis is because the firmware is counted by walking backwards from the end of memory, and the BLE config area is placed lower in memory than the firmware. Subtracting the BLE config size ensures the internal flash filesystem doesn't try to use the firmware as storage. Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 464a0b3bd5..5fdc0f0198 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -141,7 +141,7 @@ #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) // The firmware space is the space left over between the fixed lower and upper regions. -#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) +#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) #if BOOTLOADER_START_ADDR % FLASH_ERASE_SIZE != 0 #error BOOTLOADER_START_ADDR must be on a flash erase boundary. From 3537ad40594b3d23785108475be571c6fa92e769 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 21 Apr 2020 11:13:58 +0800 Subject: [PATCH 286/919] nrf: mpconfigport: support configuration of various sizes Conditionally set variables such as the softdevice RAM size, bootloader size, and the spi m3 buffer size. This allows ports to adjust these values to suit their needs. Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 5fdc0f0198..1f10f5e7e3 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -36,7 +36,9 @@ // Max RAM used by SoftDevice. Can be changed when SoftDevice parameters are changed. // See common.template.ld. +#ifndef SOFTDEVICE_RAM_SIZE #define SOFTDEVICE_RAM_SIZE (64*1024) +#endif #ifdef NRF52840 #define MICROPY_PY_SYS_PLATFORM "nRF52840" @@ -53,8 +55,10 @@ #define RAM_SIZE (0x20000) // 128 KiB // Special RAM area for SPIM3 transmit buffer, to work around hardware bug. // See common.template.ld. +#ifndef SPIM3_BUFFER_SIZE #define SPIM3_BUFFER_SIZE (8192) #endif +#endif #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) @@ -124,7 +128,9 @@ // Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld #define BOOTLOADER_START_ADDR (FLASH_SIZE - BOOTLOADER_SIZE - BOOTLOADER_SETTINGS_SIZE - BOOTLOADER_MBR_SIZE) #define BOOTLOADER_MBR_SIZE (0x1000) // 4kib +#ifndef BOOTLOADER_SIZE #define BOOTLOADER_SIZE (0xA000) // 40kiB +#endif #define BOOTLOADER_SETTINGS_START_ADDR (FLASH_SIZE - BOOTLOADER_SETTINGS_SIZE) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB @@ -137,7 +143,9 @@ #define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) // 32kiB for bonding, etc. +#ifndef CIRCUITPY_BLE_CONFIG_SIZE #define CIRCUITPY_BLE_CONFIG_SIZE (32*1024) +#endif #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) // The firmware space is the space left over between the fixed lower and upper regions. From c04e6d6f52cf7f4393604b9c3eb493f55d6730fd Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 21 Apr 2020 11:28:36 +0800 Subject: [PATCH 287/919] nrf: bleio: parameterize softradio configuration Allow for setting various softradio memory settings as part of a board in order to support lower-memory configurations. If a parameter is unspecified then the previously-defined value is used. Signed-off-by: Sean Cross --- ports/nrf/common-hal/_bleio/Adapter.c | 30 ++++++++++++++++++++++----- ports/nrf/common-hal/_bleio/Adapter.h | 2 ++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 53015364a6..cb526a6a85 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -56,6 +56,26 @@ #define BLE_SLAVE_LATENCY 0 #define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) +#ifndef BLEIO_VS_UUID_COUNT +#define BLEIO_VS_UUID_COUNT 75 +#endif + +#ifndef BLEIO_HVN_TX_QUEUE_SIZE +#define BLEIO_HVN_TX_QUEUE_SIZE 9 +#endif + +#ifndef BLEIO_CENTRAL_ROLE_COUNT +#define BLEIO_CENTRAL_ROLE_COUNT 4 +#endif + +#ifndef BLEIO_PERIPH_ROLE_COUNT +#define BLEIO_PERIPH_ROLE_COUNT 4 +#endif + +#ifndef BLEIO_ATTR_TAB_SIZE +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 5) +#endif + const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { .base = { .type = &nvm_bytearray_type, @@ -124,9 +144,9 @@ STATIC uint32_t ble_stack_enable(void) { // adv_set_count must be == 1 for S140. Cannot be increased. ble_conf.gap_cfg.role_count_cfg.adv_set_count = 1; // periph_role_count costs 1232 bytes for 2 to 3, then ~1840 for each further increment. - ble_conf.gap_cfg.role_count_cfg.periph_role_count = 4; + ble_conf.gap_cfg.role_count_cfg.periph_role_count = BLEIO_PERIPH_ROLE_COUNT; // central_role_count costs 648 bytes for 1 to 2, then ~1250 for each further increment. - ble_conf.gap_cfg.role_count_cfg.central_role_count = 4; + ble_conf.gap_cfg.role_count_cfg.central_role_count = BLEIO_CENTRAL_ROLE_COUNT; err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &ble_conf, app_ram_start); if (err_code != NRF_SUCCESS) { return err_code; @@ -137,7 +157,7 @@ STATIC uint32_t ble_stack_enable(void) { // Each increment to hvn_tx_queue_size costs 2064 bytes. // DevZone recommends not setting this directly, but instead changing gap_conn_cfg.event_length. // However, we are setting connection extension, so this seems to make sense. - ble_conf.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = 9; + ble_conf.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size = BLEIO_HVN_TX_QUEUE_SIZE; err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATTS, &ble_conf, app_ram_start); if (err_code != NRF_SUCCESS) { return err_code; @@ -156,7 +176,7 @@ STATIC uint32_t ble_stack_enable(void) { // and anything the user does. memset(&ble_conf, 0, sizeof(ble_conf)); // Each increment to the BLE_GATTS_ATTR_TAB_SIZE_DEFAULT multiplier costs 1408 bytes. - ble_conf.gatts_cfg.attr_tab_size.attr_tab_size = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 5; + ble_conf.gatts_cfg.attr_tab_size.attr_tab_size = BLEIO_ATTR_TAB_SIZE; err_code = sd_ble_cfg_set(BLE_GATTS_CFG_ATTR_TAB_SIZE, &ble_conf, app_ram_start); if (err_code != NRF_SUCCESS) { return err_code; @@ -166,7 +186,7 @@ STATIC uint32_t ble_stack_enable(void) { // service and characteristic. memset(&ble_conf, 0, sizeof(ble_conf)); // Each additional vs_uuid_count costs 16 bytes. - ble_conf.common_cfg.vs_uuid_cfg.vs_uuid_count = 75; // Defaults to 10. + ble_conf.common_cfg.vs_uuid_cfg.vs_uuid_count = BLEIO_VS_UUID_COUNT; // Defaults to 10. err_code = sd_ble_cfg_set(BLE_COMMON_CFG_VS_UUID, &ble_conf, app_ram_start); if (err_code != NRF_SUCCESS) { return err_code; diff --git a/ports/nrf/common-hal/_bleio/Adapter.h b/ports/nrf/common-hal/_bleio/Adapter.h index 90c88dcbe6..837e5c111e 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.h +++ b/ports/nrf/common-hal/_bleio/Adapter.h @@ -35,7 +35,9 @@ #include "shared-bindings/_bleio/Connection.h" #include "shared-bindings/_bleio/ScanResults.h" +#ifndef BLEIO_TOTAL_CONNECTION_COUNT #define BLEIO_TOTAL_CONNECTION_COUNT 5 +#endif extern bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; From 507e17fbf15715b28d17cc69aab54a48dd001c52 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 21 Apr 2020 13:46:03 -0500 Subject: [PATCH 288/919] displayio: Fix "bus type" problem introduced at 8cba145c9029 When allocate_display_bus_or_raise was factored out, the assignment of the bus's Python type was lost. Restore it. This would have affected displays of any type other than RGBMatrix, when they were created dynamically. Boards with displays configured in flash were unaffected. Closes: #2792 --- shared-bindings/displayio/FourWire.c | 1 + shared-bindings/displayio/I2CDisplay.c | 1 + shared-bindings/displayio/ParallelBus.c | 1 + 3 files changed, 3 insertions(+) diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 1cd51b2e2d..6ad1624114 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ mp_obj_t spi = args[ARG_spi_bus].u_obj; displayio_fourwire_obj_t* self = &allocate_display_bus_or_raise()->fourwire_bus; + self->base.type = &displayio_fourwire_type; uint8_t polarity = args[ARG_polarity].u_int; if (polarity != 0 && polarity != 1) { diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index dd3333f6de..963e8377c5 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -73,6 +73,7 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t mp_obj_t i2c = args[ARG_i2c_bus].u_obj; displayio_i2cdisplay_obj_t* self = &allocate_display_bus_or_raise()->i2cdisplay_bus; + self->base.type = &displayio_i2cdisplay_type; common_hal_displayio_i2cdisplay_construct(self, MP_OBJ_TO_PTR(i2c), args[ARG_device_address].u_int, reset); diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index 4d9ffb0a1e..bdafdaef6d 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -84,6 +84,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); displayio_parallelbus_obj_t* self = &allocate_display_bus_or_raise()->parallel_bus; + self->base.type = &displayio_parallelbus_type; common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset); return self; From 17d038830d93946a2ed393376d62e33932153214 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Apr 2020 14:14:30 -0700 Subject: [PATCH 289/919] Use our own flag for board crystal config. --- ports/stm/boards/espruino_pico/mpconfigboard.h | 2 +- ports/stm/boards/espruino_wifi/mpconfigboard.h | 2 +- .../boards/feather_stm32f405_express/mpconfigboard.h | 2 +- ports/stm/boards/meowbit_v121/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 2 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 3 +-- ports/stm/boards/pyboard_v11/mpconfigboard.h | 2 +- .../stm/boards/stm32f411ce_blackpill/mpconfigboard.h | 2 +- .../stm/boards/stm32f411ve_discovery/mpconfigboard.h | 4 ++-- .../stm/boards/stm32f412zg_discovery/mpconfigboard.h | 2 +- ports/stm/boards/stm32f4_discovery/mpconfigboard.h | 2 +- ports/stm/boards/thunderpack/mpconfigboard.h | 2 +- ports/stm/supervisor/port.c | 11 +++++++---- 14 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index da75d8669b..890b1b88e7 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -36,5 +36,5 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h index d7cda02a07..80aae3ad42 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -33,5 +33,5 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 0e66a32bde..59c48f88ad 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -36,7 +36,7 @@ #define BOARD_OSC_DIV (12) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB05) diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index 8c7e800f4a..268a660159 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -36,7 +36,7 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) #define BOARD_OSC_DIV (12) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define HSE_VALUE ((uint32_t)12000000U) #define LSE_VALUE ((uint32_t)32000U) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 31dc9b9ee7..314c96cb5a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -33,4 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index ea23ee25a9..8909cc5be1 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -32,4 +32,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 0c3fd81c56..721a91defc 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -33,8 +33,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE -#define LSE_VALUE ((uint32_t)32768U) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB15) diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h index bbad321a6a..77fab2c69e 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -33,7 +33,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (12) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define HSE_VALUE ((uint32_t)12000000U) #define LSE_VALUE ((uint32_t)32000U) diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h index feeee146fc..a21060a848 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -35,7 +35,7 @@ #define BOARD_OSC_DIV (25) #define BOARD_NO_VBUS_SENSE (1) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) #define HSE_VALUE ((uint32_t)25000000U) // On-board flash diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index ffc6ee40c1..3956a365cf 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -34,8 +34,8 @@ #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. -// #define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +// #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // #define LSE_VALUE ((uint32_t)32000U) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index 8ee3734d70..112d2a83c6 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -34,7 +34,7 @@ #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index 32b17e1cd3..28a370afda 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -34,4 +34,4 @@ #define BOARD_OSC_DIV (8) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSE +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 86bba66bc8..7102b12429 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -44,7 +44,7 @@ #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) -#define BOARD_RTC_CLOCK RCC_RTCCLKSOURCE_LSI +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) #define HSE_VALUE ((uint32_t)24000000U) // Status LEDs diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 20e3901145..ab8cb0be21 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -152,7 +152,7 @@ __attribute__((used, naked)) void Reset_Handler(void) { static RTC_HandleTypeDef _hrtc; -#if BOARD_RTC_CLOCK == RCC_RTCCLKSOURCE_LSE +#if BOARD_HAS_LOW_SPEED_CRYSTAL #define RTC_CLOCK_FREQUENCY LSE_VALUE #else #define RTC_CLOCK_FREQUENCY LSI_VALUE @@ -170,14 +170,17 @@ safe_mode_t port_init(void) { stm32_peripherals_gpio_init(); HAL_PWR_EnableBkUpAccess(); - #if BOARD_RTC_CLOCK == RCC_RTCCLKSOURCE_LSE + #if BOARD_HAS_LOW_SPEED_CRYSTAL __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) {} #else __HAL_RCC_LSI_ENABLE(); #endif - - __HAL_RCC_RTC_CONFIG(BOARD_RTC_CLOCK); + #if BOARD_HAS_LOW_SPEED_CRYSTAL + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); + #else + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); + #endif __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; From 5cc8a3ec82ae6e23fe3b1f68ab30475386b1d1d3 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Apr 2020 14:14:49 -0700 Subject: [PATCH 290/919] Add back fake us delay. --- ports/litex/mphalport.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index 12eaaac3cc..0b89009f0a 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -40,6 +40,10 @@ void hal_dcd_isr(uint8_t rhport); #endif +void mp_hal_delay_us(mp_uint_t delay) { + mp_hal_delay_ms(delay / 1000); +} + extern void SysTick_Handler(void); __attribute__((section(".ramtext"))) From dcb0e50f040c4213a7591253cb3a0bb4ea9a178d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Apr 2020 14:15:44 -0700 Subject: [PATCH 291/919] Fix USB midi and hid disable. --- ports/atmel-samd/Makefile | 1 - supervisor/shared/usb/tusb_config.h | 4 ++-- supervisor/supervisor.mk | 32 ++++++++++++++++++----------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 5ec91a811f..4e2ad73e66 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -304,7 +304,6 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) # Doing a $(sort ...) removes duplicates as part of sorting. SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) - SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index ad5825b6c9..1b0c834160 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -74,8 +74,8 @@ //------------- CLASS -------------// #define CFG_TUD_CDC 1 #define CFG_TUD_MSC 1 -#define CFG_TUD_HID 1 -#define CFG_TUD_MIDI 1 +#define CFG_TUD_HID CIRCUITPY_USB_HID +#define CFG_TUD_MIDI CIRCUITPY_USB_MIDI #define CFG_TUD_CUSTOM_CLASS 0 /*------------------------------------------------------------------*/ diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 52d60b52b3..d6422f074e 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -73,26 +73,34 @@ else lib/tinyusb/src/device/usbd_control.c \ lib/tinyusb/src/class/msc/msc_device.c \ lib/tinyusb/src/class/cdc/cdc_device.c \ - lib/tinyusb/src/class/hid/hid_device.c \ - lib/tinyusb/src/class/midi/midi_device.c \ lib/tinyusb/src/tusb.c \ supervisor/shared/serial.c \ supervisor/usb.c \ supervisor/shared/usb/usb_desc.c \ supervisor/shared/usb/usb.c \ supervisor/shared/usb/usb_msc_flash.c \ - shared-bindings/usb_hid/__init__.c \ - shared-bindings/usb_hid/Device.c \ - shared-bindings/usb_midi/__init__.c \ - shared-bindings/usb_midi/PortIn.c \ - shared-bindings/usb_midi/PortOut.c \ - shared-module/usb_hid/__init__.c \ - shared-module/usb_hid/Device.c \ - shared-module/usb_midi/__init__.c \ - shared-module/usb_midi/PortIn.c \ - shared-module/usb_midi/PortOut.c \ $(BUILD)/autogen_usb_descriptor.c + ifeq ($(CIRCUITPY_USB_HID), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/hid/hid_device.c \ + shared-bindings/usb_hid/__init__.c \ + shared-bindings/usb_hid/Device.c \ + shared-module/usb_hid/__init__.c \ + shared-module/usb_hid/Device.c + endif + + ifeq ($(CIRCUITPY_USB_MIDI), 1) + SRC_SUPERVISOR += \ + lib/tinyusb/src/class/midi/midi_device.c \ + shared-bindings/usb_midi/__init__.c \ + shared-bindings/usb_midi/PortIn.c \ + shared-bindings/usb_midi/PortOut.c \ + shared-module/usb_midi/__init__.c \ + shared-module/usb_midi/PortIn.c \ + shared-module/usb_midi/PortOut.c + endif + CFLAGS += -DUSB_AVAILABLE endif From 38ec3bc57476c6fde45cd7d722370a5408fd8e10 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 21 Apr 2020 17:37:22 -0400 Subject: [PATCH 292/919] further ringbuf cleanup --- ports/mimxrt10xx/common-hal/busio/UART.c | 2 + .../mpconfigboard.mk | 1 - .../common-hal/_bleio/CharacteristicBuffer.c | 19 ++- ports/nrf/common-hal/_bleio/PacketBuffer.c | 24 ++-- ports/nrf/common-hal/busio/UART.c | 13 +-- ports/nrf/mpconfigport.mk | 12 +- ports/stm/common-hal/busio/UART.c | 12 +- py/py.mk | 1 + py/ringbuf.c | 109 ++++++++++++++++++ py/ringbuf.h | 82 +++---------- shared-bindings/_bleio/CharacteristicBuffer.h | 2 +- shared-module/_bleio/ScanResults.c | 6 +- 12 files changed, 171 insertions(+), 112 deletions(-) create mode 100644 py/ringbuf.c diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 4633507d8b..399f12e705 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -206,6 +206,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } LPUART_TransferCreateHandle(self->uart, &self->handle, LPUART_UserCallback, self); + // Pass actual allocated size; the LPUART routines are cognizant that + // the capacity is one less than the size. LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->rbuf.buf, self->rbuf.size); claim_pin(self->rx_pin->pin); diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk index f63554e5e8..38c9933340 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk @@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C" # Allocate two, not just one I2C peripheral for CPB, so that we have both # on-board and off-board I2C available. -# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals. # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index 9f9b453de4..12fd73670c 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -42,13 +42,11 @@ #include "supervisor/shared/tick.h" #include "common-hal/_bleio/CharacteristicBuffer.h" +// Push all the data onto the ring buffer. When the buffer is full, new bytes will be dropped. STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { - // Push all the data onto the ring buffer. uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - for (size_t i = 0; i < len; i++) { - ringbuf_put(&self->ringbuf, data[i]); - } + ringbuf_put_n(&self->ringbuf, data, len); sd_nvic_critical_region_exit(is_nested_critical_region); } @@ -100,11 +98,11 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe } -int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { +uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_avail(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -116,21 +114,18 @@ int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_ uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - size_t rx_bytes = MIN(ringbuf_count(&self->ringbuf), len); - for ( size_t i = 0; i < rx_bytes; i++ ) { - data[i] = ringbuf_get(&self->ringbuf); - } + uint32_t num_bytes_read = ringbuf_get_n(&self->ringbuf, data, len); // Writes now OK. sd_nvic_critical_region_exit(is_nested_critical_region); - return rx_bytes; + return num_bytes_read; } uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - uint16_t count = ringbuf_count(&self->ringbuf); + uint16_t count = ringbuf_avail(&self->ringbuf); sd_nvic_critical_region_exit(is_nested_critical_region); return count; } diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 6ed6d14514..2698532198 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -43,7 +43,7 @@ #include "supervisor/shared/tick.h" STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uint16_t len) { - if (len + sizeof(uint16_t) > self->ringbuf.size) { + if (len + sizeof(uint16_t) > ringbuf_capacity(&self->ringbuf)) { // This shouldn't happen. return; } @@ -51,7 +51,7 @@ STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uin uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); // Make room for the new value by dropping the oldest packets first. - while (self->ringbuf.size - ringbuf_count(&self->ringbuf) < (int) (len + sizeof(uint16_t))) { + while (ringbuf_capacity(&self->ringbuf) - ringbuf_avail(&self->ringbuf) < len + sizeof(uint16_t)) { uint16_t packet_length; ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); for (uint16_t i = 0; i < packet_length; i++) { @@ -250,27 +250,33 @@ void common_hal_bleio_packet_buffer_construct( } int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { - if (ringbuf_count(&self->ringbuf) < 2) { + if (ringbuf_avail(&self->ringbuf) < 2) { return 0; } uint16_t packet_length; - ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); + int ret; // Copy received data. Lock out write interrupt handler while copying. uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - if (packet_length > len) { - return len - packet_length; - } + // Get packet length first. + ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); - ringbuf_get_n(&self->ringbuf, data, packet_length); + if (packet_length > len) { + // Packet is longer than requested. Return negative of overrun value. + ret = len - packet_length; + } else { + // Read as much as possible, but might be shorter than len. + ringbuf_get_n(&self->ringbuf, data, packet_length); + ret = packet_length; + } // Writes now OK. sd_nvic_critical_region_exit(is_nested_critical_region); - return packet_length; + return ret; } void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 4a3e74c49d..43f155ca8e 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -240,11 +240,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t mp_raise_ValueError(translate("No RX pin")); } - size_t rx_bytes = 0; uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_avail(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -255,12 +254,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // prevent conflict with uart irq NVIC_DisableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); - // copy received data - rx_bytes = ringbuf_count(&self->rbuf); - rx_bytes = MIN(rx_bytes, len); - for ( uint16_t i = 0; i < rx_bytes; i++ ) { - data[i] = ringbuf_get(&self->rbuf); - } + // Copy as much received data as available, up to len bytes. + size_t rx_bytes = ringbuf_get_n(&self->rbuf, data, len); NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); @@ -317,7 +312,7 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_count(&self->rbuf); + return ringbuf_avail(&self->rbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 5ca1f0f35b..186867fb05 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -24,7 +24,7 @@ CIRCUITPY_AUDIOIO = 0 # The ifndef's allow overriding in mpconfigboard.mk. -ifndef +ifndef CIRCUITPY_BLEIO CIRCUITPY_BLEIO = 1 endif @@ -51,8 +51,17 @@ endif # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 +ifndef CIRCUITPY_PROTOMATTER CIRCUITPY_PROTOMATTER = 1 +endif + +ifndef CIRCUITPY_FRAMEBUFFERIO CIRCUITPY_FRAMEBUFFERIO = 1 +endif + +ifndef CIRCUITPY_ULAB +CIRCUITPY_ULAB = 1 +endif # nRF52840-specific @@ -72,5 +81,4 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS -CIRCUITPY_ULAB = 1 endif diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index cb5460c68e..d1ee146f1c 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -262,7 +262,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout, same as nrf - while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_avail(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; //restart if it failed in the callback if (errflag != HAL_OK) { @@ -276,12 +276,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Halt reception HAL_NVIC_DisableIRQ(self->irq); - // copy received data - rx_bytes = ringbuf_count(&self->rbuf); - rx_bytes = MIN(rx_bytes, len); - for (uint16_t i = 0; i < rx_bytes; i++) { - data[i] = ringbuf_get(&self->rbuf); - } + // Copy as much received data as available, up to len bytes. + size_t rx_bytes = ringbuf_get_n(&self->rbuf, data, len); HAL_NVIC_EnableIRQ(self->irq); if (rx_bytes == 0) { @@ -380,7 +376,7 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_count(&self->rbuf); + return ringbuf_avail(&self->rbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { diff --git a/py/py.mk b/py/py.mk index bca6ac14c3..29d407f7ab 100644 --- a/py/py.mk +++ b/py/py.mk @@ -257,6 +257,7 @@ PY_CORE_O_BASENAME = $(addprefix py/,\ repl.o \ smallint.o \ frozenmod.o \ + ringbuf.o \ ) PY_EXTMOD_O_BASENAME = \ diff --git a/py/ringbuf.c b/py/ringbuf.c new file mode 100644 index 0000000000..70245461f2 --- /dev/null +++ b/py/ringbuf.c @@ -0,0 +1,109 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * 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 "ringbuf.h" + +// Dynamic initialization. This should be accessible from a root pointer. +// capacity is the number of bytes the ring buffer can hold. The actual +// size of the buffer is one greater than that, due to how the buffer +// handles empty and full statuses. +bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { + r->buf = gc_alloc(capacity + 1, false, long_lived); + r->size = capacity + 1; + r->iget = r->iput = 0; + return r->buf != NULL; +} + +size_t ringbuf_capacity(ringbuf_t *r) { + return r->size - 1; +} + +// Returns -1 if buffer is empty, else returns byte fetched. +int ringbuf_get(ringbuf_t *r) { + if (r->iget == r->iput) { + return -1; + } + uint8_t v = r->buf[r->iget++]; + if (r->iget >= r->size) { + r->iget = 0; + } + return v; +} + +// Returns -1 if no room in buffer, else returns 0. +int ringbuf_put(ringbuf_t *r, uint8_t v) { + uint32_t iput_new = r->iput + 1; + if (iput_new >= r->size) { + iput_new = 0; + } + if (iput_new == r->iget) { + return -1; + } + r->buf[r->iput] = v; + r->iput = iput_new; + return 0; +} + +void ringbuf_clear(ringbuf_t *r) { + r->iput = r->iget = 0; +} + +// Number of free slots that can be written. +size_t ringbuf_free(ringbuf_t *r) { + return (r->size + r->iget - r->iput - 1) % r->size; +} + +// Number of bytes available to read. +size_t ringbuf_avail(ringbuf_t *r) { + return (r->size + r->iput - r->iget) % r->size; +} + +// If the ring buffer fills up, not all bytes will be written. +// Returns how many bytes were successfully written. +size_t ringbuf_put_n(ringbuf_t* r, uint8_t* buf, size_t bufsize) +{ + for(size_t i=0; i < bufsize; i++) { + if ( ringbuf_put(r, buf[i]) < 0 ) { + // If ringbuf is full, give up and return how many bytes + // we wrote so far. + return i; + } + } + return bufsize; +} + +// Returns how many bytes were fetched. +size_t ringbuf_get_n(ringbuf_t* r, uint8_t* buf, size_t bufsize) +{ + for(size_t i=0; i < bufsize; i++) { + int b = ringbuf_get(r); + if (b < 0) { + return i; + } + buf[i] = b; + } + return bufsize; +} diff --git a/py/ringbuf.h b/py/ringbuf.h index 7fc35d2661..1e01091ab5 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -32,78 +32,26 @@ typedef struct _ringbuf_t { uint8_t *buf; - uint16_t size; - uint16_t iget; - uint16_t iput; + // Allocated size; capacity is one less. Don't reference this directly. + uint32_t size; + uint32_t iget; + uint32_t iput; } ringbuf_t; +// Note that the capacity of the buffer is N-1! + // Static initialization: // byte buf_array[N]; // ringbuf_t buf = {buf_array, sizeof(buf_array)}; -// Dynamic initialization. This creates root pointer! -#define ringbuf_alloc(r, sz, long_lived) \ -{ \ - (r)->buf = gc_alloc(sz, false, long_lived); \ - (r)->size = sz; \ - (r)->iget = (r)->iput = 0; \ -} +bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived); +size_t ringbuf_capacity(ringbuf_t *r); +int ringbuf_get(ringbuf_t *r); +int ringbuf_put(ringbuf_t *r, uint8_t v); +void ringbuf_clear(ringbuf_t *r); +size_t ringbuf_free(ringbuf_t *r); +size_t ringbuf_avail(ringbuf_t *r); +size_t ringbuf_put_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); +size_t ringbuf_get_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); -static inline int ringbuf_get(ringbuf_t *r) { - if (r->iget == r->iput) { - return -1; - } - uint8_t v = r->buf[r->iget++]; - if (r->iget >= r->size) { - r->iget = 0; - } - return v; -} - -static inline int ringbuf_put(ringbuf_t *r, uint8_t v) { - uint32_t iput_new = r->iput + 1; - if (iput_new >= r->size) { - iput_new = 0; - } - if (iput_new == r->iget) { - return -1; - } - r->buf[r->iput] = v; - r->iput = iput_new; - return 0; -} - -static inline uint16_t ringbuf_count(ringbuf_t *r) -{ - volatile int count = r->iput - r->iget; - if ( count < 0 ) { - count += r->size; - } - - return (uint16_t) count; -} - -static inline void ringbuf_clear(ringbuf_t *r) -{ - r->iput = r->iget = 0; -} - -// will overwrite old data -static inline void ringbuf_put_n(ringbuf_t* r, uint8_t* buf, uint8_t bufsize) -{ - for(uint8_t i=0; i < bufsize; i++) { - if ( ringbuf_put(r, buf[i]) < 0 ) { - // if full overwrite old data - (void) ringbuf_get(r); - ringbuf_put(r, buf[i]); - } - } -} - -static inline void ringbuf_get_n(ringbuf_t* r, uint8_t* buf, uint8_t bufsize) -{ - for(uint8_t i=0; i < bufsize; i++) { - buf[i] = ringbuf_get(r); - } -} #endif // MICROPY_INCLUDED_PY_RINGBUF_H diff --git a/shared-bindings/_bleio/CharacteristicBuffer.h b/shared-bindings/_bleio/CharacteristicBuffer.h index 83e6fef02f..e82e96ca96 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.h +++ b/shared-bindings/_bleio/CharacteristicBuffer.h @@ -32,7 +32,7 @@ extern const mp_obj_type_t bleio_characteristic_buffer_type; extern void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, mp_float_t timeout, size_t buffer_size); -int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode); +uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode); uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self); void common_hal_bleio_characteristic_buffer_clear_rx_buffer(bleio_characteristic_buffer_obj_t *self); bool common_hal_bleio_characteristic_buffer_deinited(bleio_characteristic_buffer_obj_t *self); diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index 7ea0c165f4..2e6fd07ffa 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -45,10 +45,10 @@ bleio_scanresults_obj_t* shared_module_bleio_new_scanresults(size_t buffer_size, } mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { - while (ringbuf_count(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { + while (ringbuf_avail(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - if (ringbuf_count(&self->buf) == 0 || mp_hal_is_interrupted()) { + if (ringbuf_avail(&self->buf) == 0 || mp_hal_is_interrupted()) { return mp_const_none; } @@ -97,7 +97,7 @@ void shared_module_bleio_scanresults_append(bleio_scanresults_obj_t* self, uint16_t len) { int32_t packet_size = sizeof(uint8_t) + sizeof(ticks_ms) + sizeof(rssi) + NUM_BLEIO_ADDRESS_BYTES + sizeof(addr_type) + sizeof(len) + len; - int32_t empty_space = self->buf.size - ringbuf_count(&self->buf); + int32_t empty_space = self->buf.size - ringbuf_avail(&self->buf); if (packet_size >= empty_space) { // We can't fit the packet so skip it. return; From fbc8719fadbffd9b3e4ba1ceb42182c4370d0621 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 21 Apr 2020 22:40:12 -0400 Subject: [PATCH 293/919] ringbuf tested --- ports/mimxrt10xx/common-hal/busio/UART.c | 11 +++-- ports/mimxrt10xx/common-hal/busio/UART.h | 2 +- .../common-hal/_bleio/CharacteristicBuffer.c | 4 +- ports/nrf/common-hal/_bleio/PacketBuffer.c | 43 +++++++++---------- ports/nrf/common-hal/busio/UART.c | 21 ++++----- ports/nrf/common-hal/busio/UART.h | 2 +- ports/stm/common-hal/busio/UART.c | 18 +++----- ports/stm/common-hal/busio/UART.h | 2 +- py/ringbuf.c | 10 ++++- py/ringbuf.h | 5 ++- shared-module/_bleio/ScanResults.c | 6 +-- 11 files changed, 59 insertions(+), 65 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 399f12e705..e3642daf59 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -198,9 +198,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, claim_pin(self->tx_pin->pin); if (self->rx_pin != NULL) { - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); + // The LPUART ring buffer wastes one byte to distinguish between full and empty. + self->ringbuf = gc_alloc(receiver_buffer_size + 1, false, true /*long-lived*/); - if (!self->rbuf.buf) { + if (!self->ringbuf) { LPUART_Deinit(self->uart); mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } @@ -208,7 +209,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, LPUART_TransferCreateHandle(self->uart, &self->handle, LPUART_UserCallback, self); // Pass actual allocated size; the LPUART routines are cognizant that // the capacity is one less than the size. - LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->rbuf.buf, self->rbuf.size); + LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->ringbuf, receiver_buffer_size + 1); claim_pin(self->rx_pin->pin); } @@ -225,9 +226,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { LPUART_Deinit(self->uart); - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + gc_free(self->ringbuf); // reset_pin_number(self->rx_pin); // reset_pin_number(self->tx_pin); diff --git a/ports/mimxrt10xx/common-hal/busio/UART.h b/ports/mimxrt10xx/common-hal/busio/UART.h index 9e768db3c0..3a326eb3a4 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.h +++ b/ports/mimxrt10xx/common-hal/busio/UART.h @@ -40,7 +40,7 @@ typedef struct { mp_obj_base_t base; LPUART_Type *uart; lpuart_handle_t handle; - ringbuf_t rbuf; + uint8_t* ringbuf; bool rx_ongoing; uint32_t baudrate; uint8_t character_bits; diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index 12fd73670c..84e7761210 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -102,7 +102,7 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_avail(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -125,7 +125,7 @@ uint32_t common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer uint32_t common_hal_bleio_characteristic_buffer_rx_characters_available(bleio_characteristic_buffer_obj_t *self) { uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); - uint16_t count = ringbuf_avail(&self->ringbuf); + uint16_t count = ringbuf_num_filled(&self->ringbuf); sd_nvic_critical_region_exit(is_nested_critical_region); return count; } diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 2698532198..29fd86cda1 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -51,7 +51,7 @@ STATIC void write_to_ringbuf(bleio_packet_buffer_obj_t *self, uint8_t *data, uin uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); // Make room for the new value by dropping the oldest packets first. - while (ringbuf_capacity(&self->ringbuf) - ringbuf_avail(&self->ringbuf) < len + sizeof(uint16_t)) { + while (ringbuf_capacity(&self->ringbuf) - ringbuf_num_filled(&self->ringbuf) < len + sizeof(uint16_t)) { uint16_t packet_length; ringbuf_get_n(&self->ringbuf, (uint8_t*) &packet_length, sizeof(uint16_t)); for (uint16_t i = 0; i < packet_length; i++) { @@ -202,10 +202,7 @@ void common_hal_bleio_packet_buffer_construct( } if (incoming) { - // This is a macro. - ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false); - - if (self->ringbuf.buf == NULL) { + if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false)) { mp_raise_ValueError(translate("Buffer too large and unable to allocate")); } } @@ -250,7 +247,7 @@ void common_hal_bleio_packet_buffer_construct( } int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { - if (ringbuf_avail(&self->ringbuf) < 2) { + if (ringbuf_num_filled(&self->ringbuf) < 2) { return 0; } @@ -315,25 +312,25 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 } uint16_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self) { - uint16_t mtu; - if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return 0; - } - bleio_connection_internal_t *connection; - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - connection = &bleio_connections[i]; - if (connection->conn_handle == self->conn_handle) { - break; + // First, assume default MTU size. + uint16_t mtu = BLE_GATT_ATT_MTU_DEFAULT; + + // If there's a connection, get its actual MTU. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + connection = &bleio_connections[i]; + if (connection->conn_handle == self->conn_handle) { + if (connection->mtu != 0) { + mtu = connection->mtu; + } + break; + } } } - if (connection->mtu == 0) { - mtu = BLE_GATT_ATT_MTU_DEFAULT; - } - if (self->characteristic->max_length > mtu) { - mtu = self->characteristic->max_length; - } - uint16_t att_overhead = 3; - return mtu - att_overhead; + + // 3 is bytes of ATT overhead. + return MIN(mtu - 3, self->characteristic->max_length); } bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 43f155ca8e..d223ea91f7 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -99,7 +99,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context) switch ( event->type ) { case NRFX_UARTE_EVT_RX_DONE: - ringbuf_put_n(&self->rbuf, event->data.rxtx.p_data, event->data.rxtx.bytes); + ringbuf_put_n(&self->ringbuf, event->data.rxtx.p_data, event->data.rxtx.bytes); // keep receiving (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1); @@ -113,7 +113,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context) // Possible Error source is Overrun, Parity, Framing, Break // uint32_t errsrc = event->data.error.error_mask; - ringbuf_put_n(&self->rbuf, event->data.error.rxtx.p_data, event->data.error.rxtx.bytes); + ringbuf_put_n(&self->ringbuf, event->data.error.rxtx.p_data, event->data.error.rxtx.bytes); // Keep receiving (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1); @@ -191,9 +191,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // pointers like this are NOT moved, allocating the buffer // in the long-lived pool is not strictly necessary) // (This is a macro.) - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); - - if ( !self->rbuf.buf ) { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { nrfx_uarte_uninit(self->uarte); mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); } @@ -227,10 +225,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx_pin_number); self->tx_pin_number = NO_PIN; self->rx_pin_number = NO_PIN; - - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + ringbuf_free(&self->ringbuf); } } @@ -243,7 +238,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_avail(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -255,7 +250,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t NVIC_DisableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); // Copy as much received data as available, up to len bytes. - size_t rx_bytes = ringbuf_get_n(&self->rbuf, data, len); + size_t rx_bytes = ringbuf_get_n(&self->ringbuf, data, len); NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); @@ -312,13 +307,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_avail(&self->rbuf); + return ringbuf_num_filled(&self->ringbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // prevent conflict with uart irq NVIC_DisableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); - ringbuf_clear(&self->rbuf); + ringbuf_clear(&self->ringbuf); NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); } diff --git a/ports/nrf/common-hal/busio/UART.h b/ports/nrf/common-hal/busio/UART.h index 58432001cd..a251162910 100644 --- a/ports/nrf/common-hal/busio/UART.h +++ b/ports/nrf/common-hal/busio/UART.h @@ -41,7 +41,7 @@ typedef struct { uint32_t baudrate; uint32_t timeout_ms; - ringbuf_t rbuf; + ringbuf_t ringbuf; uint8_t rx_char; // EasyDMA buf uint8_t tx_pin_number; diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index d1ee146f1c..566955cd83 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -211,8 +211,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Init buffer for rx and claim pins if (self->rx != NULL) { - ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); - if (!self->rbuf.buf) { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { mp_raise_ValueError(translate("UART Buffer allocation error")); } claim_pin(rx); @@ -248,9 +247,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = NULL; self->rx = NULL; - gc_free(self->rbuf.buf); - self->rbuf.size = 0; - self->rbuf.iput = self->rbuf.iget = 0; + ringbuf_free(&self->ringbuf); } size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { @@ -258,11 +255,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t mp_raise_ValueError(translate("No RX pin")); } - size_t rx_bytes = 0; uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout, same as nrf - while ( (ringbuf_avail(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; //restart if it failed in the callback if (errflag != HAL_OK) { @@ -277,7 +273,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Halt reception HAL_NVIC_DisableIRQ(self->irq); // Copy as much received data as available, up to len bytes. - size_t rx_bytes = ringbuf_get_n(&self->rbuf, data, len); + size_t rx_bytes = ringbuf_get_n(&self->ringbuf, data, len); HAL_NVIC_EnableIRQ(self->irq); if (rx_bytes == 0) { @@ -317,7 +313,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) if ((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { return; } - ringbuf_put_n(&context->rbuf, &context->rx_char, 1); + ringbuf_put_n(&context->ringbuf, &context->rx_char, 1); errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); return; @@ -376,13 +372,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return ringbuf_avail(&self->rbuf); + return ringbuf_num_filled(&self->ringbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // Halt reception HAL_NVIC_DisableIRQ(self->irq); - ringbuf_clear(&self->rbuf); + ringbuf_clear(&self->ringbuf); HAL_NVIC_EnableIRQ(self->irq); } diff --git a/ports/stm/common-hal/busio/UART.h b/ports/stm/common-hal/busio/UART.h index 5ac1d352ca..d1971ce27a 100644 --- a/ports/stm/common-hal/busio/UART.h +++ b/ports/stm/common-hal/busio/UART.h @@ -47,7 +47,7 @@ typedef struct { const mcu_periph_obj_t *tx; const mcu_periph_obj_t *rx; - ringbuf_t rbuf; + ringbuf_t ringbuf; uint8_t rx_char; uint32_t baudrate; diff --git a/py/ringbuf.c b/py/ringbuf.c index 70245461f2..c19f1d44bc 100644 --- a/py/ringbuf.c +++ b/py/ringbuf.c @@ -37,6 +37,12 @@ bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { return r->buf != NULL; } +void ringbuf_free(ringbuf_t *r) { + gc_free(r->buf); + r->size = 0; + ringbuf_clear(r); +} + size_t ringbuf_capacity(ringbuf_t *r) { return r->size - 1; } @@ -72,12 +78,12 @@ void ringbuf_clear(ringbuf_t *r) { } // Number of free slots that can be written. -size_t ringbuf_free(ringbuf_t *r) { +size_t ringbuf_num_empty(ringbuf_t *r) { return (r->size + r->iget - r->iput - 1) % r->size; } // Number of bytes available to read. -size_t ringbuf_avail(ringbuf_t *r) { +size_t ringbuf_num_filled(ringbuf_t *r) { return (r->size + r->iput - r->iget) % r->size; } diff --git a/py/ringbuf.h b/py/ringbuf.h index 1e01091ab5..476bd428f9 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -45,12 +45,13 @@ typedef struct _ringbuf_t { // ringbuf_t buf = {buf_array, sizeof(buf_array)}; bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived); +void ringbuf_free(ringbuf_t *r); size_t ringbuf_capacity(ringbuf_t *r); int ringbuf_get(ringbuf_t *r); int ringbuf_put(ringbuf_t *r, uint8_t v); void ringbuf_clear(ringbuf_t *r); -size_t ringbuf_free(ringbuf_t *r); -size_t ringbuf_avail(ringbuf_t *r); +size_t ringbuf_num_empty(ringbuf_t *r); +size_t ringbuf_num_filled(ringbuf_t *r); size_t ringbuf_put_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); size_t ringbuf_get_n(ringbuf_t* r, uint8_t* buf, size_t bufsize); diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index 2e6fd07ffa..ae36f8863d 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -45,10 +45,10 @@ bleio_scanresults_obj_t* shared_module_bleio_new_scanresults(size_t buffer_size, } mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { - while (ringbuf_avail(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { + while (ringbuf_num_filled(&self->buf) == 0 && !self->done && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - if (ringbuf_avail(&self->buf) == 0 || mp_hal_is_interrupted()) { + if (ringbuf_num_filled(&self->buf) == 0 || mp_hal_is_interrupted()) { return mp_const_none; } @@ -97,7 +97,7 @@ void shared_module_bleio_scanresults_append(bleio_scanresults_obj_t* self, uint16_t len) { int32_t packet_size = sizeof(uint8_t) + sizeof(ticks_ms) + sizeof(rssi) + NUM_BLEIO_ADDRESS_BYTES + sizeof(addr_type) + sizeof(len) + len; - int32_t empty_space = self->buf.size - ringbuf_avail(&self->buf); + int32_t empty_space = self->buf.size - ringbuf_num_filled(&self->buf); if (packet_size >= empty_space) { // We can't fit the packet so skip it. return; From 2f86e31501d50715150a2109af110525a334af88 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 22 Apr 2020 00:52:54 -0400 Subject: [PATCH 294/919] fix calculation of nrf firmware size --- ports/nrf/mpconfigport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 1f10f5e7e3..4e49568ed8 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -149,7 +149,7 @@ #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) // The firmware space is the space left over between the fixed lower and upper regions. -#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) +#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) #if BOOTLOADER_START_ADDR % FLASH_ERASE_SIZE != 0 #error BOOTLOADER_START_ADDR must be on a flash erase boundary. From 09bef7b0e16199f3d6886e6be73d70e26fe7abbc Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 22 Apr 2020 13:33:39 +0800 Subject: [PATCH 295/919] nrf: bluetooth: add s140 v7.0.1 This is the first version with official support for nRF52833. Signed-off-by: Sean Cross --- .../s140_nrf52_7.0.1_API/doc/ble_api.dox | 3930 +++++++++++++++++ .../s140_nrf52_7.0.1_API/include/ble.h | 678 +++ .../s140_nrf52_7.0.1_API/include/ble_err.h | 93 + .../s140_nrf52_7.0.1_API/include/ble_gap.h | 2851 ++++++++++++ .../s140_nrf52_7.0.1_API/include/ble_gatt.h | 229 + .../s140_nrf52_7.0.1_API/include/ble_gattc.h | 715 +++ .../s140_nrf52_7.0.1_API/include/ble_gatts.h | 845 ++++ .../s140_nrf52_7.0.1_API/include/ble_hci.h | 135 + .../s140_nrf52_7.0.1_API/include/ble_l2cap.h | 507 +++ .../s140_nrf52_7.0.1_API/include/ble_ranges.h | 156 + .../s140_nrf52_7.0.1_API/include/ble_types.h | 215 + .../include/nrf52/nrf_mbr.h | 268 ++ .../s140_nrf52_7.0.1_API/include/nrf_error.h | 90 + .../include/nrf_error_sdm.h | 70 + .../include/nrf_error_soc.h | 85 + .../s140_nrf52_7.0.1_API/include/nrf_nvic.h | 491 ++ .../s140_nrf52_7.0.1_API/include/nrf_sdm.h | 371 ++ .../s140_nrf52_7.0.1_API/include/nrf_soc.h | 1080 +++++ .../s140_nrf52_7.0.1_API/include/nrf_svc.h | 100 + .../s140_nrf52_7.0.1_license-agreement.txt | 35 + .../s140_nrf52_7.0.1_migration-document.pdf | Bin 0 -> 90738 bytes ...140_nrf52_7.0.1_release-notes-update-2.pdf | Bin 0 -> 106909 bytes 22 files changed, 12944 insertions(+) create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_release-notes-update-2.pdf diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox new file mode 100644 index 0000000000..6cdfc88709 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/doc/ble_api.dox @@ -0,0 +1,3930 @@ +/** + * @addtogroup BLE_COMMON + * @{ + * @defgroup BLE_COMMON_MSC Message Sequence Charts + * @{ + * + * @defgroup BLE_COMMON_ENABLE BLE Stack Enable + * @{ + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(cfg_id, cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GAP, cfg = {conn_cfg_tag = 1, gap_conn_cfg.conn_count = 1, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, cfg = {conn_cfg_tag = 1, gatt_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, cfg = {conn_cfg_tag = 1, gattc_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, cfg = {conn_cfg_tag = 1, gatts_conn_cfg, app_ram_base);"]; + * APP<SD [label = "sd_ble_enable(&app_ram_base);"]; + * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT);"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = 1);"]; + * APP<SD [label = "sd_ble_gap_connect(params, conn_cfg_tag = 1);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_nvic_EnableIRQ(SD_EVT_IRQn)"]; + * APP<APP [label = "SD_EVT_IRQHandler()"]; + * APP=>SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_softdevice_enable(clock, assertion_handler);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * SD rbox SD [label="Event Available for the App"]; + * APP<SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * SD rbox SD [label="Event Available for the App"]; + * APP<SD [label = "sd_ble_evt_get(buffer);"]; + * APP<SD [label = "sd_app_evt_wait(void);"]; + * APP rbox APP [label="App Thread Mode blocked, CPU in low power mode"]; + * |||; + * ...; + * |||; + * @endmsc + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GAP + * @{ + * @defgroup BLE_GAP_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GAP_ADV_MSC Advertising + * @{ + * @defgroup BLE_GAP_ADV_MSC_LEGACY Advertising using legacy advertising PDUs + * @msc + * hscale = "1.5"; + * APP,SD,SCANNERS; + * |||; + * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; + * APP<SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD->SCANNERS [label = "Advertisement (ADV_IND/ADV_DIRECT_IND/ADV_NONCONN_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 App Stops Advertisement "]; + * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params : properties : type = BLE_GAP_ADV_TYPE_EXTENDED_*)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle, conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT)"]; + * APP<SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD->SCANNERS [label = "Advertisement (ADV_EXT_IND) on 1MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (AUX_*_IND) on 1MBPS/2MBPS/CODED PHY", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 App Stops Advertisement "]; + * APP=>SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #1 Local Disconnection "]; + * APP=>SD [label = "sd_ble_gap_disconnect(reason)"]; + * APP<CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * |||; + * --- [label = " Variant #2 Remote Disconnection "]; + * SD<:CENTRAL [label = "Connection Termination", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * @endmsc + * + * @defgroup BLE_GAP_CPU_MSC Peripheral Connection Parameter Update + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established with conn. params. CP#1"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; + * APP<CENTRAL [label = "L2CAP Connection Parameter Update Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Central Accepts "]; + * |||; + * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; + * |||; + * --- [label = " Variant #2 Central Rejects "]; + * |||; + * SD<:CENTRAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; + * --- [label = " Variant #3 Central Ignores "]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#1}"]; + * @endmsc + * + * @defgroup BLE_GAP_RSSI_FILT_MSC RSSI for connections with event filter + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * --- [label = " Variant #1: Trigger event when a new RSSI is available"]; + * |||; + * APP=>SD [label = "sd_ble_gap_rssi_start(conn_handle, 0, 0)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x00)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, 0x05, 0x03)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_start(conn_handle, BLE_GAP_RSSI_THRESHOLD_INVALID, 0x00)"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_get(conn_handle, p_rssi, p_ch_index)"]; + * APP<SD [label = "sd_ble_gap_rssi_stop()"]; + * APP<SD [label = "sd_ble_gap_authenticate(params)"]; + * APP<CENTRAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Central initiates Security Establishment "]; + * |||; + * APP rbox CENTRAL [label="Encryption or Pairing/Bonding initiated by Central"]; + * |||; + * --- [label = " Variant #2 Central ignores "]; + * |||; + * ...; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LEGACY_MSC Peripheral Legacy Pairing + * @{ + * + * @defgroup BLE_GAP_PERIPH_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: no_bond, no_mitm, no_io_caps, p_keyset: NULL)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_JW_MSC Bonding: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, no_mitm, no_io_caps, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Peripheral displays + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC Bonding: Passkey Entry, User Inputs on Peripheral or OOB + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, keyboard, p_keyset)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; + * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; + * APP<SD [label = "sd_ble_opt_set(opt_id = BLE_GAP_OPT_PASSKEY, p_opt->p_passkey=passkey)"]; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: bond, mitm, display, p_keyset)"]; + * + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox CENTRAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC Pairing failure: Confirm failed + * This occurs if the random value doesn't match, usually because the user entered a wrong pin + * or out of band data was missing. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: mitm, keyboard, p_keyset: NULL)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * SD:>CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Random", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Confirm value, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_PERIPH_LESC_MSC Peripheral LESC Pairing + * @{ + * + * @defgroup BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, no_bond, no_mitm, no_io_caps, p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_NC_MSC Bonding: Numeric Comparison + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display(kbd/yesno), keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; + * APP rbox APP [label="Passkey displayed to the user, user compares values"]; + * |||; + * --- [label = " Variant #1 User confirms on both sides "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * --- [label = " Variant #2 User does not confirm locally "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; + * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 User does not confirm remotely "]; + * SD<:CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry, Peripheral Displays + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, display, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses from peer "]; + * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * SD<:CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * |||; + * --- [label = ""]; + * SD abox CENTRAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry, User Inputs on Peripheral + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, mitm, keyboard, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {passkey}"]; + * APP rbox APP [label="User enters Passkey"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses sent to peer "]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<CENTRAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = ""]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC Bonding: Out of Band + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; + * APP<SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: lesc, bond, oob, keyset with p_pk_own)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; + * SD:>CENTRAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<CENTRAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox CENTRAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_PERIPH_PAIRING_KS_OUT_OF_RANGE_MSC Pairing failure: Keysize out of supported range + * This occurs if the min key size offered by the peer is above 16, or max key size below 7. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Invalid params, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC GAP Failed Pairing: Keysize too small + * This occurs if the max key size offered by the peer is below the min key size specified by + * the app. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Confirm", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Enc key size, error_src: local}"]; + * SD:>CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC Pairing failure: Pairing aborted by the application + * When the application detects that the pairing should not be performed, for example an + * insufficient IO combination, it can use sd_ble_gap_sec_params_reply() to send + * SMP Pairing failed to the peer. + * + * When the stack handles the response from the application it will also validate + * the passkey (SMP_STC_PASSKEY_ENTRY_FAILED). If any error is detected it will be + * reported when sd_ble_gap_sec_params_reply() is called. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * SD abox APP [label="Stack looks for errors", textbgcolor="#7f7fff"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply()"]; + * APP<CENTRAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: local}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC Pairing failure: Pairing failed from central + * SMP Pairing Failed may be sent from the central at various times. The application should + * prepare for this and gracefully handle the event. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * SD<:CENTRAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: , error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC Pairing failure: Timeout + * This occurs if the central device doesn't continue the pairing sequence within 30 seconds. + * @msc + * hscale = "2"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS)"]; + * APP<CENTRAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * --- [ label = "Wait 30 sec" ]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Timeout, error_src: local}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_ENC_MSC Peripheral Encryption Establishment using stored keys + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established"]; + * |||; + * SD<:CENTRAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_INFO_REQUEST {addr, ediv, rand}"]; + * |||; + * --- [label = " Variant #1 App Replies with Keys "]; + * |||; + * APP rbox APP [label = "Load Peripheral Keys"]; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; + * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * |||; + * --- [label = " Variant #2 App Replies without Keys "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(NULL)"]; + * APP<CENTRAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Link is NOT encrypted"]; + * |||; + * --- [label = " Variant #3 App Replies with Incorrect Keys "]; + * |||; + * APP rbox APP [label = "Load Incorrect Peripheral Keys"]; + * APP=>SD [label = "sd_ble_gap_sec_info_reply(ediv, rand, LTK)"]; + * APP<CENTRAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox CENTRAL [label = "Link Terminated due to authentication error"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="No pairing in progress"]; + * |||; + * PEER rbox PEER [label="Peer misbehaving"]; + * |||; + * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; + * |||; + * @endmsc + * @} + * + * + * @defgroup BLE_GAP_SCAN_MSC Scanning + * @{ + * @defgroup BLE_GAP_SCAN_MSC_LEGACY Scanning for advertisers performing legacy advertising + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params : extended = 0, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 0, active = 1}, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; + * @endmsc + * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, active = 1, report_incomplete_evts = 0}, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Scan Request (AUX_SCAN_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (AUX_SCAN_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params : extended = 0, conn_params)"]; + * APP<PERIPHERAL [label = "LL Connect (CONNECT_IND)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #2 Connection Establishment Cancelled "]; + * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A and PHY_B}, conn_params)"]; + * APP<PERIPHERAL [label = "LL Connect Request(AUX_CONNECT_REQ) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERAL [label = "LL Connect Response(AUX_CONNECT_RSP) on secondary_phy", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED"]; + * |||; + * --- [label = " Variant #2 Connection Establishment Cancelled "]; + * APP=>SD [label = "sd_ble_gap_connect_cancel()"]; + * APP<SD [label = "sd_ble_gap_connect(scan_params={extended=1,scan_phys=PHY_A}, conn_params)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(CP#2)"]; + * APP<PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#2}"]; + * |||; + * --- [label = " Peripheral Solicited procedure"]; + * |||; + * SD<:PERIPHERAL [label = "L2CAP Connection Parameter Update Request {CP#3}", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {CP#3}"]; + * |||; + * --- [label = " Variant #1 App Accepts "]; + * APP=>SD [label = "sd_ble_gap_conn_param_update(CP#3)"]; + * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * SD:>PERIPHERAL [label = "LL Connection Update (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {CP#3}"]; + * |||; + * --- [label = " Variant #2 App Rejects "]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(NULL)"]; + * APP<PERIPHERAL [label = "L2CAP Connection Parameter Update Response: Rejected", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_SEC_MSC Central Security Procedures + * @{ + * + * @defgroup BLE_GAP_CENTRAL_SEC_REQ_MSC Security Request Reception + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Security Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_REQUEST {bond, mitm}"]; + * |||; + * --- [label = " Variant #1 Central initiates Security Establishment "]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_authenticate(params)"]; + * APP<SD [label = "sd_ble_gap_authenticate(NULL)"]; + * APP<PERIPHERAL [label = "SMP Pairing Failed: Pairing Not Supported", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: Pairing Not Supp, error_src: local}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LEGACY_MSC Central Legacy Pairing + * @{ + * + * @defgroup BLE_GAP_CENTRAL_PAIRING_JW_MSC Pairing: Just Works + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(no_bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: no_bond, no_mitm, no_io_caps}"]; + * |||; + * --- [label = " Variant #1 Central Accepts Peripheral parameters "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset: NULL)"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * |||; + * --- [label = " Variant #2 Central Rejects Peripheral parameters "]; + * |||; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(BLE_GAP_SEC_STATUS_INVALID_PARAMS, own_params: NULL, p_keyset: NULL)"]; + * |||; + * SD:>PERIPHERAL [label = "SMP Pairing Failed", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {FAILURE}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_JW_MSC Bonding: Just Works + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC Bonding: Passkey Entry, Central displays + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, display)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=0}"]; + * APP rbox APP [label="Passkey displayed to the user"]; + * |||; + * SD abox PERIPHERAL [label="Legacy Pairing Phase 2", textbgcolor="#7f7fff"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with STK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC Bonding: Passkey Entry, User Inputs on Central or OOB + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(bond, mitm, keyboard)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_keyset)"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_KEY_REQUEST {type}"]; + * APP rbox APP [label="User enters Passkey or data received Out Of Band"]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey or OOB)"]; + * APP<SD [label = "sd_ble_gap_authenticate(lesc, no_bond, no_mitm, no_io_caps)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, no_bond, no_mitm, no_io_caps}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {ENC_NO_MITM}"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC Bonding: Numeric Comparison + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display(kbd/yesno))"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display(kbd/yesno)}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_PASSKEY_DISPLAY {passkey, match_request=1}"]; + * APP rbox APP [label="Passkey displayed to the user, user compares values"]; + * |||; + * --- [label = " Variant #1 User confirms on both sides "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_PASSKEY, NULL)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * --- [label = " Variant #2 User does not confirm locally "]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(BLE_GAP_AUTH_KEY_TYPE_NONE, NULL)"]; + * APP<PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 User does not confirm remotely "]; + * SD<:PERIPHERAL [label = "SMP Pairing failed", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {auth_status: num comp failure, error_src: remote}"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC Bonding: Passkey Entry: Central Displays + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, display)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, keyboard}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses from peer "]; + * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * SD<:PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_KEY_PRESSED {type}"]; + * APP abox APP [label="App displays keypress"]; + * |||; + * --- [label = ""]; + * SD abox PERIPHERAL [label="LESC Authentication Stage 1", textbgcolor="#7f7fff"]; + * |||; + * APP abox APP [label="App completes DHKey calculation"]; + * APP=>SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC Bonding: Passkey Entry: User Inputs on Central + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate(lesc, bond, mitm, keyboard)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, mitm, display}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * --- [label = " Optional keypresses sent to peer "]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_gap_keypress_notify(type)"]; + * APP<PERIPHERAL [label = "Keypress Notification", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = ""]; + * APP=>SD [label = "sd_ble_gap_auth_key_reply(passkey)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC Bonding: Out of Band + * @msc + * hscale = "2"; + * APP,SD,PERIPHERAL; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_lesc_oob_data_get(p_pk_own, p_oobd_own)"]; + * APP<SD [label = "sd_ble_gap_authenticate(lesc, bond, oob)"]; + * APP<PERIPHERAL [label = "SMP Pairing Request", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_SEC_PARAMS_REQUEST {peer_params: lesc, bond, oob}"]; + * APP=>SD [label = "sd_ble_gap_sec_params_reply(SUCCESS, own_params: NULL, keyset with p_pk_own)"]; + * APP<PERIPHERAL [label = "SMP Pairing Public Key: PKa", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing Public Key: PKb", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_LESC_DHKEY_REQUEST {p_peer_pk, oobd_req=1}"]; + * |||; + * APP abox APP [label="App starts DHKey calculation"]; + * |||; + * APP=>SD [label = "sd_ble_gap_lesc_oob_data_set(p_oobd_own, p_oobd_peer)"]; + * APP<SD [label = "sd_ble_gap_lesc_dhkey_reply(p_dhkey)"]; + * APP<PERIPHERAL [label = "SMP Pairing DHKey Check: Ea", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERAL [label = "SMP Pairing DHKey Check: Eb", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {LESC_ENC_MITM}"]; + * |||; + * SD abox PERIPHERAL [label="SMP Pairing Phase 3", textbgcolor="#7f7fff"]; + * |||; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {SUCCESS}"]; + * APP rbox APP [label = "Keys stored in keyset"]; + * @endmsc + * @} + * + * @defgroup BLE_GAP_CENTRAL_INVALID_SMP_PDU_MSC Unexpected Security Packet Reception + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="No pairing in progress"]; + * |||; + * PEER rbox PEER [label="Peer misbehaving"]; + * |||; + * SD<:PEER [label = "SMP Pairing Failed (or other unexpected SMP PDU)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_AUTH_STATUS {PDU_INVALID}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_ENC_MSC Encryption Establishment using stored keys + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<PERIPHERAL [label = "LL Encryption Request (LL_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Peripheral replies with keys "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Keys"]; + * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PERIPHERAL [label = "Encrypted with LTK"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * |||; + * --- [label = " Variant #2 Peripheral keys missing "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Keys Missing"]; + * SD<:PERIPHERAL [label = "LL Reject Ind (LL_REJECT_IND): Pin or Key Missing", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE"]; + * APP rbox PERIPHERAL [label = "Link is NOT encrypted"]; + * |||; + * --- [label = " Variant #3 Incorrect peripheral keys "]; + * |||; + * PERIPHERAL rbox PERIPHERAL [label = "Peripheral Loads Incorrect Keys"]; + * SD<:PERIPHERAL [label = "LL Encryption Response (LL_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PERIPHERAL [label = "Link Terminated due to authentication error"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {MIC Failure}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC Central Encryption and Authentication mutual exclusion + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note SD [label = " Encryption in progress, authentication disallowed"]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate()"]; + * APP<SD [label = "sd_ble_gap_conn_param_update()"]; + * APP<PEER [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_authenticate()"]; + * APP<PEER [label = "Encryption Start (LL_START_ENC_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "Encryption Complete (LL_START_ENC_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE "]; + * |||; + * APP=>SD [label = "sd_ble_gap_authenticate()"]; + * APP<SD [label = "sd_ble_gap_encrypt(ediv, rand, LTK)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_3, CP#3)"]; + * APP<PERIPHERALS [label = "Connection Update Start on link #3 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Additional procedure on link #2 fails, since another one is pending"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#5)"]; + * APP<PERIPHERALS [label = "Connection Update Start on link #1 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start on link #2 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #4"]; + * |||; + * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_4, CP#4}"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_4, CP#4)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start on link #4 (LL_CONNECTION_UPDATE_IND)", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #4", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_4, CP#4}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_MULTILINK_CTRL_PROC_MSC Central Control Procedure Serialization on multiple links + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERALS; + * |||; + * APP rbox PERIPHERALS [label="Connection Established with 4 peers, all with conn. params. CP#0"]; + * |||; + * APP note PERIPHERALS [label = " Peripheral solicited procedure on link #2"]; + * |||; + * SD<:PERIPHERALS [label = "L2CAP Connection Parameter Update Request {CP#2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST {conn_handle_2, CP#3}"]; + * |||; + * APP note PERIPHERALS [label = " Encryption procedure on link #3"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_3, LTK#3)"]; + * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #3", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Connection Update procedure on link #1"]; + * |||; + * APP=>SD [label = "sd_ble_gap_conn_param_update(conn_handle_1, CP#1)"]; + * APP<SD [label = "sd_ble_gap_conn_param_update(conn_handle_2, CP#2)"]; + * APP<PERIPHERALS [label = "L2CAP Connection Parameter Update Response: Accepted", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP note PERIPHERALS [label = " Encryption procedure on link #4"]; + * |||; + * APP=>SD [label = "sd_ble_gap_encrypt(conn_handle_4, LTK#4)"]; + * APP<PERIPHERALS [label = "Encryption Start (LL_START_ENC_REQ) on link #4", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Encryption Complete (LL_START_ENC_RSP) on link #4", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_SEC_UPDATE {conn_handle_4}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND) on link #1", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_1, CP#1}"]; + * |||; + * SD:>PERIPHERALS [label = "Connection Update Start (LL_CONNECTION_UPDATE_IND on link #2", textcolor="#000080", linecolor="#000080"]; + * SD<:PERIPHERALS [label = "Connection Update Complete on link #2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONN_PARAM_UPDATE {conn_handle_2, CP#2}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_WL_SHARE_MSC Whitelist Sharing + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: { fp = CONNREQ })"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#1)"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; + * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_adv_stop(adv_handle)"]; + * APP<SD [label = "sd_ble_gap_scan_stop()"]; + * APP<SD [label = "sd_ble_gap_whitelist_set(WL#2)"]; + * APP<SD [label = "sd_ble_gap_scan_start(use_whitelist = 1, adv_report_buffer)"]; + * APP<SD [label = "sd_ble_gap_connect(use_whitelist = 1)"]; + * APP<SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Advertise with address resolvable by local IRK in device identity list "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Advertise with non-resolvable address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = NULL})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD box SD [label="Private address timeout"]; + * SD->SCANNERS [label = "Advertisement (ADV_*_IND), Addr = Non-Resolvable2", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_SCAN_MSC Private Scanning + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Active Scan with address resolvable by local IRKs "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, {peer_addr2, peer_irk2}, pp_local_irks: {local_irk1, local_irk2}) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "peer_addr1 is in the device identity list, respond with an address generated from local_irk1"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * ...; + * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "Resolvable2 resolved to device identity peer_addr2 in the device identity list, respond with an address generated from local_irk2"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * ...; + * ADVERTISERS->SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND), Addr = peer_addr3", textcolor="#000080", linecolor="#000080"]; + * SD box ADVERTISERS [label = "peer_addr3 is not in the device identity list, respond with an address generated from device_irk"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_RSP), Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Active Scan with non-resolvable address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: NON_RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_IND/ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; + * SD->ADVERTISERS [label = "Scan Request packet (SCAN_REQ), Addr = Non-Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS->SD [label = "Scan Response packet (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC Scan Private Devices + * @msc + * hscale = "1.5"; + * APP,SD,ADVERTISERS; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = peer_addr2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr2, rssi, data}"]; + * |||; + * --- [label = " Variant #2 Scan and resolve private devices with whitelist "]; + * |||; + * APP=>SD [label = "sd_ble_gap_whitelist_set({peer_addr1, Resolvable2}) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable1", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable1 resolved to device identity peer_addr1 which is in the whitelist"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr1, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable2 did not resolve to a device identity but is in the whitelist"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {Resolvable2, rssi, data}"]; + * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Addr = Resolvable3", textcolor="#000080", linecolor="#000080"]; + * SD note ADVERTISERS [label="Resolvable3 is not in the whitelist, no report generated"]; + * |||; + * --- [label = " Variant #3 Scan directed advertisers and resolve initiator address using device IRK"]; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using device_irk"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; + * |||; + * --- [label = " Variant #4 Scan directed advertisers and resolve initiator address using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: local_irk1) "]; + * APP<SD [label = "sd_ble_gap_scan_start(params, adv_report_buffer)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Advertiser Address resolved using peer_irk1, Initiator address resolved using local_irk1"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr1"]; + * |||; + * --- [label = " Variant #5 Scan directed advertisers with unresolved direct address "]; + * |||; + * APP=>SD [label = "sd_ble_gap_scan_start(params: {adv_dir_report = 1}, adv_report)"]; + * APP<SD [label = "Advertisement (ADV_*_IND), Advertiser Addr = peer_addr2, Initiator Addr = Resolvable2", textcolor="#000080", linecolor="#000080"]; + * ADVERTISERS box SD [label = "Resolvable2 could not be resolved, report the unresolved direct address"]; + * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {peer_addr: peer_addr2, direct_addr: Resolvable2}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC Directed Advertising + * @msc + * hscale = "1.5"; + * APP,SD,INITIATOR; + * |||; + * APP=>SD [label = "sd_ble_gap_addr_set(addr)"]; + * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND) , Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = addr, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Private directed advertising to private peer using device IRK"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Private directed advertising to private peer using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = Resolvable", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #4 Private directed advertising to non-private peer using local IRK in device identity list"]; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk=0..0}, pp_local_irks: {local_irk1}) "]; + * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; + * APP<SD [label = "sd_ble_gap_adv_set_configure(&adv_handle, adv_data, params: {p_peer_addr = peer_addr1, properties.type = directed})"]; + * APP<SD [label = "sd_ble_gap_adv_start(adv_handle)"]; + * APP<INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * SD->INITIATOR[label = "Advertisement (ADV_DIRECT_IND), Advertiser Addr = Resolvable, Initiator Addr = peer_addr1", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPH_CONN_PRIV_MSC Peripheral Connection Establishment with Private Peer + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; + * |||; + * --- [label = " Variant #2 Peer used identity address during connection setup "]; + * |||; + * APP rbox CENTRAL [label="Start Connectable Advertising"]; + * |||; + * SD<:>CENTRAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_CENTRAL_CONN_PRIV_MSC Central Connection Establishment with Private Peer + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + + * APP=>SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; + * APP<SD [label = "sd_ble_gap_connect(peer_addr = {peer_addr1, addr_id_peer = 1})"]; + * APP<PERIPHERAL [label = "Scanning", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #1 Peer used resolvable addresses during connection setup "]; + * |||; + * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 1}"]; + * |||; + * --- [label = " Variant #2 Peer used identity address during connection setup "]; + * |||; + * SD<:>PERIPHERAL [label = "Connection Establishment", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_CONNECTED, peer_addr = {peer_addr1, addr_id_peer = 0}"]; + * |||; + * @endmsc + * + * @} + * + * @defgroup BLE_GAP_EVT_PHY_MSC PHY Update Procedure + * @{ + * + * @defgroup BLE_GAP_CENTRAL_PHY_UPDATE Central PHY Update + * @msc + * hscale = "1.5"; + * APP,SD,PERIPHERAL; + * |||; + * APP rbox PERIPHERAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; + * |||; + * --- [label = " Variant #1 Initiated by Peripheral - no change in PHY "]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #2 Initiated by Peripheral - change of PHY required"]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; + * |||; + * --- [label = " Variant #4 Initiated by APP, change required"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label = "PHY Response (LL_PHY_RSP) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD=>PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #5 Initiated by Peripheral - APP has no preferences for TX direction"]; + * SD<=PERIPHERAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; + * APP<PERIPHERAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=1Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #6 Initiated by APP, peer responding with invalid parameters"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<PERIPHERAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=PERIPHERAL [label="PHY Response (LL_PHY_RSP) {tx_phys=0x00, rx_phys=0x00}", textcolor="#000080", linecolor="#000080"]; + * SD=>PERIPHERAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GAP_PERIPHERAL_PHY_UPDATE Peripheral PHY Update + * @msc + * hscale = "1.5"; + * APP,SD,CENTRAL; + * |||; + * APP rbox CENTRAL [label="Connection Established. Current TX PHY and RX PHY are both 1Mbit"]; + * |||; + * --- [label = " Variant #1 Initiated by Central - no change in PHY "]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=1Mbit, rx_phys=1Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=1Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) - No change", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #2 Initiated by Central - change of PHY required"]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=2Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #3 Initiated by APP, not supported by peer"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ)", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Not Supported}"]; + * |||; + * --- [label = " Variant #4 Initiated by APP, change required"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=2Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=2Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #5 Initiated by Central - APP has no preferences for TX direction"]; + * SD<=CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE_REQUEST {peer_preferred_phys={tx_phys=2Mbit, rx_phys=1Mbit}}"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=BLE_GAP_PHY_AUTO, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Response (LL_PHY_RSP) {tx_phys=ALL_PHY, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=2Mbit, S_TO_M_PHY=1Mbit}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Success, {tx_phy=1Mbit, rx_phy=2Mbit}}"]; + * |||; + * --- [label = " Variant #6 Collision between self-initiated PHY Update and peer initiated Channel Map Update procedures"]; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {tx_phys=2Mbit, rx_phys=2Mbit})"]; + * APP<CENTRAL [label = "PHY Request (LL_PHY_REQ) {tx_phys=2Mbit, rx_phys=2Mbit}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label = "Reject Command (LL_REJECT_EXT_IND) {ErrorCode=Different Transaction Collision}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_PHY_UPDATE {status=Different Transaction Collision, {tx_phy=1Mbit, rx_phy=1Mbit}}"]; + * |||; + * --- [label = " Variant #7 Initiated by APP, peer responding with invalid parameters"]; + * |||; + * APP=>SD [label = "sd_ble_gap_phy_update(conn_handle, {ALL_PHY, ALL_PHY}) "]; + * APP<CENTRAL [label="PHY Request (LL_PHY_REQ) {ALL_PHY, ALL_PHY}", textcolor="#000080", linecolor="#000080"]; + * SD<=CENTRAL [label="PHY Update (LL_PHY_UPDATE_IND) {M_TO_S_PHY=(1Mbit|2Mbit), S_TO_M_PHY=(1Mbit|2Mbit)", textcolor="#000080", linecolor="#000080"]; + * SD=>CENTRAL [label="Unknown Response (LL_UNKNOWN_RSP)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label="BLE_GAP_EVT_PHY_UPDATE {Status=Invalid LMP Parameters}"]; + * |||; + * @endmsc + * + * @} + + * @defgroup BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC Data Length Update Procedure + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Self initiated, automatic parameters "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Self initiated, application set parameters "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Peer initiated, automatic parameters "]; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + + * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, NULL, NULL)"]; + * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Peer initiated, application set parameters"]; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * SD<:PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST {.peer_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, NULL)"]; + * APP<PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, memory limited "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=200, rx=200}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=200, .max_rx_octets=200, .max_tx_time_us=1712, .max_rx_time_us=1712}}"]; + + * |||; + * ...; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Using the limitation out parameter to adjust Link Layer Data Channel PDU size, time limited "]; + * |||; + * SD rbox SD [label = "max_tx_octets=27, max_rx_octets=27"]; + * |||; + * ...; + * |||; + * APP=>SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<SD [label = "sd_ble_gap_data_length_update(conn_handle, {.max_tx_octets=251-178=73, .max_rx_octets=251-178=73, .max_tx_time_us=BLE_GAP_DATA_LENGTH_AUTO, .max_rx_time_us=BLE_GAP_DATA_LENGTH_AUTO}, &limitation)"]; + * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=73, rx=73}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; + + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=73, .max_rx_octets=73, .max_tx_time_us=696, .max_rx_time_us=696}}"]; + * @endmsc + * @} + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GATTC + * @{ + * @defgroup BLE_GATTC_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GATTC_PRIM_SRVC_DISC_MSC GATTC Primary Service Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Discover All Services "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Group Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, NULL)"]; + * APP<PEER [label = "ATT Read By Group Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * |||; + * --- [label = " Variant #2 Discover a Specific Service "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find By Type Value Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {SUCCESS, services}"]; + * APP=>SD [label = "sd_ble_gattc_primary_services_discover(handle + N + M, uuid)"]; + * APP<PEER [label = "ATT Find By Type Value Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_REL_DISC_MSC GATTC Relationship Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {SUCCESS, includes}"]; + * APP=>SD [label = "sd_ble_gattc_relationships_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_REL_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_CHAR_DISC_MSC GATTC Characteristic Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {SUCCESS, chars}"]; + * APP=>SD [label = "sd_ble_gattc_characteristics_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_DESC_DISC_MSC GATTC Descriptor Discovery + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Find Information Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {SUCCESS, descs}"]; + * APP=>SD [label = "sd_ble_gattc_descriptors_discover(handle_range + N + M)"]; + * APP<PEER [label = "ATT Find Information Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_DESC_DISC_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_READ_UUID_MSC GATTC Read Characteristic Value by UUID + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read By Type Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {SUCCESS, char_values}"]; + * APP=>SD [label = "sd_ble_gattc_char_value_by_uuid_read(uuid, handle_range + N + M)"]; + * APP<PEER [label = "ATT Read By Type Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Attribute Not Found", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP {ATTRIBUTE_NOT_FOUND}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_READ_MSC GATTC Characteristic or Descriptor Value Read + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 offset == 0 "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_read(handle, 0)"]; + * APP<PEER [label = "ATT Read Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * |||; + * --- [label = " Variant #2 offset != 0 "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Blob Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {SUCCESS, value}"]; + * APP=>SD [label = "sd_ble_gattc_read(handle, offset + N + M + 1)"]; + * APP<PEER [label = "ATT Read Blob Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Invalid Offset", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_READ_RSP {INVALID_OFFSET}"]; + * @endmsc + * + * @defgroup BLE_GATTC_READ_MULT_MSC GATTC Read Multiple Characteristic Values + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Successful request "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; + * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Read Multiple Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {SUCCESS, char_values}"]; + * |||; + * --- [label = " Variant #2 Failing request (invalid handle) "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_char_values_read(handles)"]; + * APP<PEER [label = "ATT Read Multiple Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Error Response: Invalid Handle", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_CHAR_VALS_READ_RSP {INVALID_HANDLE, error_handle=}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC GATTC Characteristic Value Write Without Response + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App does not keep track of the available queue element count for writes without responses "]; + * APP note PEER [label = " This variant makes it possible for APP to transmit writes without responses without keeping track of the available queue element count. However, successful queuing of writes without responses cannot be guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; + * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 3}"]; + * |||; + * --- [label = " Variant #2 App keeps track of the available queue element count for writes without responses "]; + * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of writes without responses is guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTC, gattc_conn_cfg.write_cmd_tx_queue_size = 2)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_1)"]; + * APP<SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_2)"]; + * APP<PEER [label = "ATT Write Command {value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_3)"]; + * APP<PEER [label = "ATT Write Command {value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_CMD, handle, value_4)"]; + * APP<PEER [label = "ATT Write Command {value_3}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Command {value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE {SUCCESS, 2}"]; + * APP abox APP [label="available_queue_element_count += 2"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_WRITE_MSC GATTC Characteristic or Descriptor Value Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_WRITE_REQ, handle, value)"]; + * APP<PEER [label = "ATT Write Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_LONG_WRITE_MSC GATTC Characteristic or Descriptor Value Long Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_1, value_1)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_1, value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle, offset_2, value_2)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle, offset_2, value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; + * |||; + * ...; + * |||; + * --- [label = " Variant #1 App executes the Long Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * |||; + * --- [label = " Variant #2 App cancels the Long Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_VALUE_RELIABLE_WRITE_MSC GATTC Characteristic or Descriptor Value Reliable Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_1, offset, value_1)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle_1, offset, value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_1}"]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_PREP_WRITE_REQ, handle_2, offset, value_2)"]; + * APP<PEER [label = "ATT Prepare Write Request {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Response {handle_2, offset, value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_PREP_WRITE_REQ, SUCCESS, value_2}"]; + * |||; + * ...; + * |||; + * --- [label = " Variant #1 App executes the Reliable Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_WRITE)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x01", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * |||; + * --- [label = " Variant #2 App cancels the Reliable Write procedure "]; + * |||; + * APP=>SD [label = "sd_ble_gattc_write(BLE_GATT_OP_EXEC_WRITE_REQ, PREPARED_CANCEL)"]; + * APP<PEER [label = "ATT Execute Write Request: flags = 0x00", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_WRITE_RSP {BLE_GATT_OP_EXEC_WRITE_REQ, SUCCESS}"]; + * @endmsc + * + * @defgroup BLE_GATTC_HVI_MSC GATTC Handle Value Indication + * GATTC Handle Value Indication MSC + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD<:PEER [label = "ATT Handle Value Indication", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_HVX {INDICATION, data}"]; + * APP=>SD [label = "sd_ble_gattc_hv_confirm(handle)"]; + * APP<PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTC_HVN_MSC GATTC Handle Value Notification + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD<:PEER [label = "ATT Handle Value Notification", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTC_EVT_HVX {NOTIFICATION, data}"]; + * @endmsc + * + * @defgroup BLE_GATTC_TIMEOUT_MSC GATTC Timeout + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="GATTC procedure API call"]; + * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; + * APP note PEER [label = "No Response from Peer"]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTC_EVT_TIMEOUT {source}"]; + * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; + * APP=>SD [label = "Any GATT procedure API call"]; + * APP<SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gattc_exchange_mtu_request(conn_handle, client_rx_mtu=80)"]; + * APP<PEER [label = "ATT Exchange MTU Request {client_rx_mtu=80}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="att_mtu=75"]; + * APP<<=SD [label = "BLE_GATTC_EVT_EXCHANGE_MTU_RSP {SUCCESS, server_rx_mtu=75}"]; + * @endmsc + * + * @} + * @} + */ + +/** + * @addtogroup BLE_GATTS + * @{ + * @defgroup BLE_GATTS_MSC Message Sequence Charts + * @{ + * @defgroup BLE_GATTS_ATT_TABLE_POP_MSC GATTS ATT Table Population + * @msc + * hscale = "1.5"; + * APP,SD; + * |||; + * APP=>SD [label = "sd_ble_gatts_service_add(uuid#1)"]; + * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#1, value)"]; + * APP<SD [label = "sd_ble_gatts_characteristic_add(handle_srvc#1, char_md, value)"]; + * APP<SD [label = "sd_ble_gatts_descriptor_add(handle_char#2, value)"]; + * APP<SD [label = "sd_ble_gatts_service_add(uuid#2)"]; + * APP<SD [label = "sd_ble_gatts_include_add(handle_srvc#2, handle_srvc#1)"]; + * APP<PEER [label = "ATT Read Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_REQ_NO_AUTH_MSC GATTS Write Request without Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: peer_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_REQ, auth_required=0, peer_value}"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_CMD_NO_AUTH_MSC GATTS Write Command Without Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: peer_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=0, peer_value}"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_CMD_AUTH_MSC GATTS Write Command With Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Command {peer_value}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {WRITE_CMD, auth_required=1, peer_value}"]; + * --- [label = " Variant #1 App Authorizes "]; + * APP=>SD [label = "sd_ble_gatts_value_set(peer_value)"]; + * APP<SD [label = "sd_ble_gatts_value_set(app_value)"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; + * APP<PEER [label = "ATT Read Response {app_value}", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #2 App Disallows "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(READ_NOT_PERMITTED)"]; + * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_WRITE_REQ_AUTH_MSC GATTS Write Request with Authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * SD<:PEER [label = "ATT Write Request {peer_value}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, peer_value}"]; + * --- [label = " Variant #1 App Authorizes "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, peer_value)"]; + * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #2 App Authorizes but changes value "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(SUCCESS, app_value)"]; + * APP<PEER [label = "ATT Write Response", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #3 App Disallows "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE_NOT_PERMITTED)"]; + * APP<PEER [label = "ATT Error Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC GATTS Queued Writes: Stack handled, no attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #1 Attribute Values validation passed "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 Attribute Values validation failed "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {Invalid Value Length / Offset}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC GATTS Queued Writes: Stack handled, one or more attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * |||; + * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; + * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC GATTS Queued Writes: App handled, no attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * |||; + * --- [label = " Variant #1 Attribute values in stack memory (VLOC_STACK), attribute values validation passed "]; + * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; + * APP<SD [label = "sd_ble_gatts_value_set {handle_2, offset_2, peer_value_2}"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Attribute values in user memory (VLOC_USER), attribute values validation passed "]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 Attribute values validation failed "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INVALID_OFFSET)"]; + * APP rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {Invalid Offset}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC GATTS Queued Writes: App handled, one or more attributes require authorization + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox APP [label="Values in ATT Table in user memory (VLOC_USER):\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * |||; + * --- [label = " Variant #1 App Authorizes both Prepare Write and Execute Write"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: peer_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 App Disallows Prepare Write and Authorizes Execute Write "]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, INSUF_AUTHORIZATION)"]; + * SD:>PEER [label = "ATT Error Response {Insufficient Authorization}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="Application traverses its queue and executes the write operations (memcpy)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #3 App Authorizes Prepare Write and Disallows Execute Write "]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, APP_ERROR_CODE)"]; + * APP rbox APP [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Error Response {APP_ERROR_CODE}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC GATTS Queued Writes: Peer cancels operation + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * |||; + * --- [label = " Variant #1 Stack handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP rbox APP [label="App queues {handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_2, offset_2, peer_value_2)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_CANCEL}"]; + * APP rbox APP [label="App erases queue"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC GATTS Queued Writes: Prepare Queue Full + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_REQUEST {BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES}"]; + * |||; + * --- [label = " Variant #1 Stack handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {user_mem_block}"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * APP rbox APP [label="App parses the memory it provided"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_EVT_USER_MEM_RELEASE {user_mem_block}"]; + * |||; + * --- [label = " Variant #2 App handled "]; + * APP=>SD [label = "sd_ble_user_mem_reply {NULL}"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_1, offset_1, peer_value_1}"]; + * APP rbox APP [label="App queues {handle_1, offset_1, peer_value_1}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS, handle_1, offset_1, peer_value_1)"]; + * SD:>PEER [label = "ATT Prepare Write Response {handle_1, offset_1, peer_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Prepare Write Request {handle_2, offset_2, peer_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, PREP_WRITE_REQ, handle_2, offset_2, peer_value_2}"]; + * APP=>SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, PREPARE_QUEUE_FULL)"]; + * SD:>PEER [label = "ATT Error Response {Prepare Queue Full}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST {WRITE, EXEC_WRITE_REQ_NOW}"]; + * APP=>SD [label = "sd_ble_gatts_value_set {handle_1, offset_1, peer_value_1}"]; + * APP<SD [label = "sd_ble_gatts_rw_authorize_reply(WRITE, SUCCESS)"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: peer_value_1\nhandle_2: current_value_2"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_QUEUED_WRITE_EXECUTE_WITHOUT_PREPARE_MSC GATTS Queued Writes: Execute Write without Prepare Write + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * |||; + * SD rbox SD [label="No ATT Prepare Write Request has been received by SD"]; + * |||; + * --- [label = " Variant #1 Write cancelled "]; + * SD<:PEER [label = "ATT Execute Write Request {CANCEL}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_CANCEL}"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * --- [label = " Variant #2 Write now "]; + * SD<:PEER [label = "ATT Execute Write Request {WRITE}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="Values in ATT Table:\nhandle_1: current_value_1\nhandle_2: current_value_2"]; + * APP<<=SD [label = "BLE_GATTS_EVT_WRITE {EXEC_WRITE_REQ_NOW}"]; + * SD:>PEER [label = "ATT Execute Write Response", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_MTU_EXCHANGE GATTS ATT_MTU Exchange + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATT, gatt_conn_cfg.att_mtu=100)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_exchange_mtu_reply(conn_handle, server_rx_mtu=75)"]; + * APP<PEER [label = "ATT Exchange MTU Response {server_rx_mtu=75}", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="att_mtu=75"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVI_MSC GATTS Handle Value Indication + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="Indications Enabled in CCCD"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION, app_value)"]; + * APP<PEER [label = "ATT Handle Value Indication {app_value}", textcolor="#000080", linecolor="#000080"]; + * --- [label = " Variant #1 Peer Confirms "]; + * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVC"]; + * --- [label = " Variant #2 Peer Ignores "]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVN_MSC GATTS Handle Value Notification + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App does not keep track of the available queue element count for notifications "]; + * APP note PEER [label = " This variant makes it possible for APP to transmit notifications without keeping track of the available queue element count. However, successful queuing of notifications cannot be guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {3}"]; + * |||; + * --- [label = " Variant #2 App keeps track of the available queue element count for notifications "]; + * APP note PEER [label = " This variant makes it possible for APP to know when successful queuing of notifications is guaranteed. "]; + * |||; + * APP=>SD [label = "sd_ble_cfg_set(BLE_CONN_CFG_GATTS, gatts_conn_cfg.hvn_tx_queue_size=2)"]; + * APP<SD [label = "sd_ble_enable()"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_1)"]; + * APP<SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_2)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_1}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_3)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_2}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {1}"]; + * APP abox APP [label="available_queue_element_count += 1"]; + * APP=>SD [label = "sd_ble_gatts_hvx(NOTIFICATION, app_value_4)"]; + * APP<PEER [label = "ATT Handle Value Notification {app_value_3}", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "ATT Handle Value Notification {app_value_4}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_HVN_TX_COMPLETE {2}"]; + * APP abox APP [label="available_queue_element_count += 2"]; + * @endmsc + * + * @defgroup BLE_GATTS_HVX_DISABLED_MSC GATTS Handle Value Indication or Notification disabled + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="Indications and Notifications Disabled in CCCD"]; + * |||; + * SD rbox SD [label="Value in ATT Table: current_value"]; + * APP=>SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; + * APP<SD [label = "sd_ble_gatts_hvx(INDICATION or NOTIFICATION, app_value)"]; + * APP<SD [label = "sd_ble_gatts_sys_attr_set()"]; + * APP<SD [label = "sd_ble_gatts_service_changed(N, M)"]; + * APP<PEER [label = "ATT Handle Value Indication {N, M}", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "ATT Handle Value Confirmation", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_SC_CONFIRM"]; + * |||; + * SD rbox PEER [label="Service Discovery"]; + * @endmsc + * + * @defgroup BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC GATTS System Attributes Handling: Unknown Peer + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established with an Unknown Peer"]; + * |||; + * SD<:PEER [label = "ATT Read Request {sys_attr_handle}", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_GATTS_EVT_SYS_ATTR_MISSING"]; + * APP=>SD [label = "sd_ble_gatts_sys_attr_set(NULL)"]; + * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC GATTS System Attributes Handling: Bonded Peer + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established with a Bonded Peer"]; + * |||; + * APP rbox PEER [label="ATT Traffic"]; + * |||; + * APP rbox PEER [label="Connection Terminated"]; + * APP<<=SD [label = "BLE_GAP_EVT_DISCONNECTED {reason}"]; + * |||; + * APP=>SD [label = "sd_ble_gatts_sys_attr_get()"]; + * APP<SD [label = "sd_ble_gatts_sys_attr_set(sys_attr_data)"]; + * APP<PEER [label = "ATT Read Response {sys_attr_value}", textcolor="#000080", linecolor="#000080"]; + * @endmsc + * + * @defgroup BLE_GATTS_TIMEOUT_MSC GATTS Timeout + * @msc + * hscale = "2"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="GATTS procedure API call"]; + * SD:>PEER [label = "ATT Packet", textcolor="#000080", linecolor="#000080"]; + * APP note PEER [label = "No Response from Peer"]; + * |||; + * ...; + * |||; + * SD box SD [label="Timeout"]; + * APP<<=SD [label = "BLE_GATTS_EVT_TIMEOUT {source}"]; + * APP rbox PEER [label="No additional ATT Traffic Allowed", textbgcolour="#ff7f7f"]; + * APP=>SD [label = "Any GATT procedure API call"]; + * APP< + * Queued Write + * + * Parameter + * Size (octets) + * Description + * + * + * Handle + * 2 + * Attribute Handle + * + * + * Offset + * 2 + * Value Offset + * + * + * Length + * 2 + * Value Length + * + * + * Value + * Length + * Attribute Value + * + * + * + * The application can parse the array of Queued Write instances at any time, but it is recommended to do so whenever an Execute Write ATT packet + * has been received over the air. See the GATT Server Queued Writes MSCs for more details. + * The array will be terminated by an Queued Write instance with its handle set to @ref BLE_GATT_HANDLE_INVALID. + * @} + */ + + /** + * @addtogroup BLE_GATTS_SYS_ATTRS_FORMAT User memory layout for System Attributes + * @{ + * The following table shows the memory layout used by the SoftDevice to store a + * system attribute. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
System Attribute
ParameterSize (octets)Description
Handle2Attribute handle
Length2Attribute length
DataLengthAttribute data
+ * + * The application can obtain an array of system attributes by using @c sd_ble_gatts_sys_attr_get(). + * The array is terminated by a CRC-16-CCITT checksum of the data in the array. + * @} + * @} + */ + +/** + * @addtogroup BLE_L2CAP + * @{ + * @defgroup BLE_L2CAP_MSC Message Sequence Charts + * @{ + * @defgroup BLE_L2CAP_CH_SETUP_MSC L2CAP Channel Setup + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * --- [label = " Variant #1 Locally initiated, Establishment success "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP {conn_handle, local_cid, tx_mtu, tx_mps, credits}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #2 Locally initiated, Establishment failure - PEER refusal "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: [len, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf: [len, p_data1]}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: REMOTE, status: NO_RESOURCES}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #3 Locally initiated, Establishment failure - PEER does not respond "]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid=INVALID, le_psm, rx_mtu, rx_mps, sdu_buf: p_data=NULL)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD abox SD [label="Timeout"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid, source: LOCAL, status: TIMEOUT}"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #4 Remotely initiated, Establishment success "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, rx_mtu, rx_mps, sdu_buf: [len, p_data1], status: SUCCESS)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection successful", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #5 Remotely initiated, Establishment failure - APP refusal "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REQUEST {conn_handle, local_cid, le_psm, tx_mtu, tx_mps, credits}"]; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(conn_handle, local_cid, status: LE_PSM_NOT_SUPPORTED)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - LE_PSM not supported", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * --- [label = " Variant #6 Remotely initiated, Establishment failure - SD refusal "]; + * SD<:PEER [label = "L2CAP LE Credit Based Connection Request", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="The limit of available L2CAP channels has been reached"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SETUP_REFUSED {conn_handle, local_cid=INVALID, source: LOCAL, status: NO_RESOURCES}"]; + * SD:>PEER [label = "L2CAP LE Credit Based Connection Response: Connection refused - no resources available", textcolor="#000080", linecolor="#000080"]; + * |||; + * APP rbox PEER [label="L2CAP Channel NOT Established"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_RELEASE_MSC L2CAP Channel Release + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP rbox PEER [label="Connection Established"]; + * |||; + * APP rbox PEER [label="L2CAP Channel Established"]; + * |||; + * --- [label = " Variant #1 Locally initiated, PEER responds "]; + * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; + * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="SD currently has three SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf1}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf2}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED {conn_handle, local_cid, sdu_buf3}"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * |||; + * --- [label = " Variant #2 Locally initiated, PEER does not respond "]; + * APP=>SD [label = "sd_ble_l2cap_ch_release(conn_handle, local_cid)"]; + * APP<PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD abox SD [label="Timeout"]; + * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * |||; + * --- [label = " Variant #3 Remotely initiated "]; + * SD<:PEER [label = "L2CAP Disconnection Request", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="SD does not currently have SDU data buffers supplied by APP"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RELEASED {conn_handle, local_cid}"]; + * SD:>PEER [label = "L2CAP Disconnection Response", textcolor="#000080", linecolor="#000080"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_TX_MSC L2CAP Channel SDU Transmit + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * --- [label = " Variant #1 App ignores transmit credits, SD will transmit data as soon as possible "]; + * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; + * APP abox APP [label="App releases memory pointed by p_data1"]; + * SD rbox SD [label="All credits consumed"]; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; + * APP abox APP [label="App releases memory pointed by p_data2"]; + * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD rbox SD [label="All credits consumed"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; + * APP abox APP [label="App releases memory pointed by p_data3"]; + * |||; + * --- [label = " Variant #2 App keeps track of transmission credits and transmits only if credits are available "]; + * APP rbox PEER [label="L2CAP Channel Established, tx_queue_size=2, tx_mps=100, credits=2"]; + * APP abox APP [label="available_credits = 2"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=140, p_data1])"]; + * APP<PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=140, p_data1]}"]; + * APP abox APP [label="App releases memory pointed by p_data1"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * APP abox APP [label="available_credits += 2\n// available_credits == 2"]; + * APP=>SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=80, p_data2])"]; + * APP<SD [label = "sd_ble_l2cap_ch_tx(conn_handle, local_cid, p_sdu_buf: [len=280, p_data3])"]; + * APP<PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=80, p_data2]}"]; + * APP abox APP [label="App releases memory pointed by p_data2"]; + * SD:>PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * ...; + * SD<:PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_CREDIT {conn_handle, local_cid, credits=2}"]; + * APP abox APP [label="available_credits += 2\n// available_credits == 0"]; + * SD:>PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_TX {conn_handle, local_cid, sdu_buf: [len=280, p_data3]}"]; + * APP abox APP [label="App releases memory pointed by p_data3"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_RX_MSC L2CAP Channel SDU Receive + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=1)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 2, Segment 1", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data2"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="All credits consumed"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * |||; + * @endmsc + * + * @defgroup BLE_L2CAP_CH_FLOW_CONTROL_MSC L2CAP Channel advanced SDU reception flow control + * @msc + * hscale = "1.5"; + * APP,SD,PEER; + * |||; + * APP=>SD [label = "sd_ble_l2cap_ch_setup(rx_mtu=1000, rx_mps=100, sdu_buf: p_data=NULL)"]; + * APP<PEER [label = "L2CAP LE Credit Based Connection Request (Initial Credits=0)", textcolor="#000080", linecolor="#000080"]; + * APP rbox PEER [label="L2CAP Channel Established, rx_queue_size=2, rx_mtu=1000, rx_mps=100"]; + * |||; + * --- [label = " Variant #1 App overwrites number of credits peer should have at the start of a SDU "]; + * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=8)"]; + * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=8)", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="8 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="8 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=80, sdu_buf: [len=1000, p_data2]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data2"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="5 credits left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * APP rbox APP [label="Peer has credits remaining so application must provide new reception buffer as soon as possible."]; + * |||; + * --- [label = " Variant #2 App pauses traffic on a L2CAP Channel "]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data1])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * APP=>SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data2])"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 1, Segment 2", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="1 credit left"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=140, sdu_buf: [len=1000, p_data1]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data1"]; + * APP=>SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; + * APP<SD [label = "sd_ble_l2cap_ch_rx(conn_handle, local_cid, p_sdu_buf: [len=1000, p_data3])"]; + * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=0)"]; + * APP<SD [label = "sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, credits=BLE_L2CAP_CREDITS_DEFAULT)"]; + * APP<PEER [label = "LE Flow Control Credit (credits=1)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 1", textcolor="#000080", linecolor="#000080"]; + * SD:>PEER [label = "LE Flow Control Credit (credits=2)", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 2", textcolor="#000080", linecolor="#000080"]; + * SD<:PEER [label = "SDU 3, Segment 3", textcolor="#000080", linecolor="#000080"]; + * PEER rbox PEER [label="All credits consumed"]; + * APP<<=SD [label = "BLE_L2CAP_EVT_CH_RX {conn_handle, local_cid, sdu_len=280, sdu_buf: [len=1000, p_data3]}"]; + * APP abox APP [label="App can process data and release memory pointed by p_data3"]; + * |||; + * @endmsc + * @} + * @} + */ + diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h new file mode 100644 index 0000000000..39944854c2 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h @@ -0,0 +1,678 @@ +/* + * Copyright (c) 2012 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON BLE SoftDevice Common + @{ + @defgroup ble_api Events, type definitions and API calls + @{ + + @brief Module independent events, type definitions and API calls for the BLE SoftDevice. + + */ + +#ifndef BLE_H__ +#define BLE_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_err.h" +#include "ble_gap.h" +#include "ble_l2cap.h" +#include "ble_gatt.h" +#include "ble_gattc.h" +#include "ble_gatts.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_COMMON_ENUMERATIONS Enumerations + * @{ */ + +/** + * @brief Common API SVC numbers. + */ +enum BLE_COMMON_SVCS +{ + SD_BLE_ENABLE = BLE_SVC_BASE, /**< Enable and initialize the BLE stack */ + SD_BLE_EVT_GET, /**< Get an event from the pending events queue. */ + SD_BLE_UUID_VS_ADD, /**< Add a Vendor Specific base UUID. */ + SD_BLE_UUID_DECODE, /**< Decode UUID bytes. */ + SD_BLE_UUID_ENCODE, /**< Encode UUID bytes. */ + SD_BLE_VERSION_GET, /**< Get the local version information (company ID, Link Layer Version, Link Layer Subversion). */ + SD_BLE_USER_MEM_REPLY, /**< User Memory Reply. */ + SD_BLE_OPT_SET, /**< Set a BLE option. */ + SD_BLE_OPT_GET, /**< Get a BLE option. */ + SD_BLE_CFG_SET, /**< Add a configuration to the BLE stack. */ + SD_BLE_UUID_VS_REMOVE, /**< Remove a Vendor Specific base UUID. */ +}; + +/** + * @brief BLE Module Independent Event IDs. + */ +enum BLE_COMMON_EVTS +{ + BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t + \n Reply with @ref sd_ble_user_mem_reply. */ + BLE_EVT_USER_MEM_RELEASE = BLE_EVT_BASE + 1, /**< User Memory release. See @ref ble_evt_user_mem_release_t */ +}; + +/**@brief BLE Connection Configuration IDs. + * + * IDs that uniquely identify a connection configuration. + */ +enum BLE_CONN_CFGS +{ + BLE_CONN_CFG_GAP = BLE_CONN_CFG_BASE + 0, /**< BLE GAP specific connection configuration. */ + BLE_CONN_CFG_GATTC = BLE_CONN_CFG_BASE + 1, /**< BLE GATTC specific connection configuration. */ + BLE_CONN_CFG_GATTS = BLE_CONN_CFG_BASE + 2, /**< BLE GATTS specific connection configuration. */ + BLE_CONN_CFG_GATT = BLE_CONN_CFG_BASE + 3, /**< BLE GATT specific connection configuration. */ + BLE_CONN_CFG_L2CAP = BLE_CONN_CFG_BASE + 4, /**< BLE L2CAP specific connection configuration. */ +}; + +/**@brief BLE Common Configuration IDs. + * + * IDs that uniquely identify a common configuration. + */ +enum BLE_COMMON_CFGS +{ + BLE_COMMON_CFG_VS_UUID = BLE_CFG_BASE, /**< Vendor specific base UUID configuration */ +}; + +/**@brief Common Option IDs. + * IDs that uniquely identify a common option. + */ +enum BLE_COMMON_OPTS +{ + BLE_COMMON_OPT_PA_LNA = BLE_OPT_BASE + 0, /**< PA and LNA options */ + BLE_COMMON_OPT_CONN_EVT_EXT = BLE_OPT_BASE + 1, /**< Extended connection events option */ + BLE_COMMON_OPT_EXTENDED_RC_CAL = BLE_OPT_BASE + 2, /**< Extended RC calibration option */ +}; + +/** @} */ + +/** @addtogroup BLE_COMMON_DEFINES Defines + * @{ */ + +/** @brief Required pointer alignment for BLE Events. +*/ +#define BLE_EVT_PTR_ALIGNMENT 4 + +/** @brief Leaves the maximum of the two arguments. +*/ +#define BLE_MAX(a, b) ((a) < (b) ? (b) : (a)) + +/** @brief Maximum possible length for BLE Events. + * @note The highest value used for @ref ble_gatt_conn_cfg_t::att_mtu in any connection configuration shall be used as a parameter. + * If that value has not been configured for any connections then @ref BLE_GATT_ATT_MTU_DEFAULT must be used instead. +*/ +#define BLE_EVT_LEN_MAX(ATT_MTU) ( \ + offsetof(ble_evt_t, evt.gattc_evt.params.prim_srvc_disc_rsp.services) + ((ATT_MTU) - 1) / 4 * sizeof(ble_gattc_service_t) \ +) + +/** @defgroup BLE_USER_MEM_TYPES User Memory Types + * @{ */ +#define BLE_USER_MEM_TYPE_INVALID 0x00 /**< Invalid User Memory Types. */ +#define BLE_USER_MEM_TYPE_GATTS_QUEUED_WRITES 0x01 /**< User Memory for GATTS queued writes. */ +/** @} */ + +/** @defgroup BLE_UUID_VS_COUNTS Vendor Specific base UUID counts + * @{ + */ +#define BLE_UUID_VS_COUNT_DEFAULT 10 /**< Default VS UUID count. */ +#define BLE_UUID_VS_COUNT_MAX 254 /**< Maximum VS UUID count. */ +/** @} */ + +/** @defgroup BLE_COMMON_CFG_DEFAULTS Configuration defaults. + * @{ + */ +#define BLE_CONN_CFG_TAG_DEFAULT 0 /**< Default configuration tag, SoftDevice default connection configuration. */ + +/** @} */ + +/** @} */ + +/** @addtogroup BLE_COMMON_STRUCTURES Structures + * @{ */ + +/**@brief User Memory Block. */ +typedef struct +{ + uint8_t *p_mem; /**< Pointer to the start of the user memory block. */ + uint16_t len; /**< Length in bytes of the user memory block. */ +} ble_user_mem_block_t; + +/**@brief Event structure for @ref BLE_EVT_USER_MEM_REQUEST. */ +typedef struct +{ + uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */ +} ble_evt_user_mem_request_t; + +/**@brief Event structure for @ref BLE_EVT_USER_MEM_RELEASE. */ +typedef struct +{ + uint8_t type; /**< User memory type, see @ref BLE_USER_MEM_TYPES. */ + ble_user_mem_block_t mem_block; /**< User memory block */ +} ble_evt_user_mem_release_t; + +/**@brief Event structure for events not associated with a specific function module. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which this event occurred. */ + union + { + ble_evt_user_mem_request_t user_mem_request; /**< User Memory Request Event Parameters. */ + ble_evt_user_mem_release_t user_mem_release; /**< User Memory Release Event Parameters. */ + } params; /**< Event parameter union. */ +} ble_common_evt_t; + +/**@brief BLE Event header. */ +typedef struct +{ + uint16_t evt_id; /**< Value from a BLE__EVT series. */ + uint16_t evt_len; /**< Length in octets including this header. */ +} ble_evt_hdr_t; + +/**@brief Common BLE Event type, wrapping the module specific event reports. */ +typedef struct +{ + ble_evt_hdr_t header; /**< Event header. */ + union + { + ble_common_evt_t common_evt; /**< Common Event, evt_id in BLE_EVT_* series. */ + ble_gap_evt_t gap_evt; /**< GAP originated event, evt_id in BLE_GAP_EVT_* series. */ + ble_gattc_evt_t gattc_evt; /**< GATT client originated event, evt_id in BLE_GATTC_EVT* series. */ + ble_gatts_evt_t gatts_evt; /**< GATT server originated event, evt_id in BLE_GATTS_EVT* series. */ + ble_l2cap_evt_t l2cap_evt; /**< L2CAP originated event, evt_id in BLE_L2CAP_EVT* series. */ + } evt; /**< Event union. */ +} ble_evt_t; + + +/** + * @brief Version Information. + */ +typedef struct +{ + uint8_t version_number; /**< Link Layer Version number. See https://www.bluetooth.org/en-us/specification/assigned-numbers/link-layer for assigned values. */ + uint16_t company_id; /**< Company ID, Nordic Semiconductor's company ID is 89 (0x0059) (https://www.bluetooth.org/apps/content/Default.aspx?doc_id=49708). */ + uint16_t subversion_number; /**< Link Layer Sub Version number, corresponds to the SoftDevice Config ID or Firmware ID (FWID). */ +} ble_version_t; + +/** + * @brief Configuration parameters for the PA and LNA. + */ +typedef struct +{ + uint8_t enable :1; /**< Enable toggling for this amplifier */ + uint8_t active_high :1; /**< Set the pin to be active high */ + uint8_t gpio_pin :6; /**< The GPIO pin to toggle for this amplifier */ +} ble_pa_lna_cfg_t; + +/** + * @brief PA & LNA GPIO toggle configuration + * + * This option configures the SoftDevice to toggle pins when the radio is active for use with a power amplifier and/or + * a low noise amplifier. + * + * Toggling the pins is achieved by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided + * by the application and should be regarded as reserved as long as any PA/LNA toggling is enabled. + * + * @note @ref sd_ble_opt_get is not supported for this option. + * @note Setting this option while the radio is in use (i.e. any of the roles are active) may have undefined consequences + * and must be avoided by the application. + */ +typedef struct +{ + ble_pa_lna_cfg_t pa_cfg; /**< Power Amplifier configuration */ + ble_pa_lna_cfg_t lna_cfg; /**< Low Noise Amplifier configuration */ + + uint8_t ppi_ch_id_set; /**< PPI channel used for radio pin setting */ + uint8_t ppi_ch_id_clr; /**< PPI channel used for radio pin clearing */ + uint8_t gpiote_ch_id; /**< GPIOTE channel used for radio pin toggling */ +} ble_common_opt_pa_lna_t; + +/** + * @brief Configuration of extended BLE connection events. + * + * When enabled the SoftDevice will dynamically extend the connection event when possible. + * + * The connection event length is controlled by the connection configuration as set by @ref ble_gap_conn_cfg_t::event_length. + * The connection event can be extended if there is time to send another packet pair before the start of the next connection interval, + * and if there are no conflicts with other BLE roles requesting radio time. + * + * @note @ref sd_ble_opt_get is not supported for this option. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable extended BLE connection events, disabled by default. */ +} ble_common_opt_conn_evt_ext_t; + +/** + * @brief Enable/disable extended RC calibration. + * + * If extended RC calibration is enabled and the internal RC oscillator (@ref NRF_CLOCK_LF_SRC_RC) is used as the SoftDevice + * LFCLK source, the SoftDevice as a peripheral will by default try to increase the receive window if two consecutive packets + * are not received. If it turns out that the packets were not received due to clock drift, the RC calibration is started. + * This calibration comes in addition to the periodic calibration that is configured by @ref sd_softdevice_enable(). When + * using only peripheral connections, the periodic calibration can therefore be configured with a much longer interval as the + * peripheral will be able to detect and adjust automatically to clock drift, and calibrate on demand. + * + * If extended RC calibration is disabled and the internal RC oscillator is used as the SoftDevice LFCLK source, the + * RC oscillator is calibrated periodically as configured by @ref sd_softdevice_enable(). + * + * @note @ref sd_ble_opt_get is not supported for this option. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable extended RC calibration, enabled by default. */ +} ble_common_opt_extended_rc_cal_t; + +/**@brief Option structure for common options. */ +typedef union +{ + ble_common_opt_pa_lna_t pa_lna; /**< Parameters for controlling PA and LNA pin toggling. */ + ble_common_opt_conn_evt_ext_t conn_evt_ext; /**< Parameters for enabling extended connection events. */ + ble_common_opt_extended_rc_cal_t extended_rc_cal; /**< Parameters for enabling extended RC calibration. */ +} ble_common_opt_t; + +/**@brief Common BLE Option type, wrapping the module specific options. */ +typedef union +{ + ble_common_opt_t common_opt; /**< COMMON options, opt_id in @ref BLE_COMMON_OPTS series. */ + ble_gap_opt_t gap_opt; /**< GAP option, opt_id in @ref BLE_GAP_OPTS series. */ +} ble_opt_t; + +/**@brief BLE connection configuration type, wrapping the module specific configurations, set with + * @ref sd_ble_cfg_set. + * + * @note Connection configurations don't have to be set. + * In the case that no configurations has been set, or fewer connection configurations has been set than enabled connections, + * the default connection configuration will be automatically added for the remaining connections. + * When creating connections with the default configuration, @ref BLE_CONN_CFG_TAG_DEFAULT should be used in + * place of @ref ble_conn_cfg_t::conn_cfg_tag. + * + * @sa sd_ble_gap_adv_start() + * @sa sd_ble_gap_connect() + * + * @mscs + * @mmsc{@ref BLE_CONN_CFG} + * @endmscs + + */ +typedef struct +{ + uint8_t conn_cfg_tag; /**< The application chosen tag it can use with the + @ref sd_ble_gap_adv_start() and @ref sd_ble_gap_connect() calls + to select this configuration when creating a connection. + Must be different for all connection configurations added and not @ref BLE_CONN_CFG_TAG_DEFAULT. */ + union { + ble_gap_conn_cfg_t gap_conn_cfg; /**< GAP connection configuration, cfg_id is @ref BLE_CONN_CFG_GAP. */ + ble_gattc_conn_cfg_t gattc_conn_cfg; /**< GATTC connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTC. */ + ble_gatts_conn_cfg_t gatts_conn_cfg; /**< GATTS connection configuration, cfg_id is @ref BLE_CONN_CFG_GATTS. */ + ble_gatt_conn_cfg_t gatt_conn_cfg; /**< GATT connection configuration, cfg_id is @ref BLE_CONN_CFG_GATT. */ + ble_l2cap_conn_cfg_t l2cap_conn_cfg; /**< L2CAP connection configuration, cfg_id is @ref BLE_CONN_CFG_L2CAP. */ + } params; /**< Connection configuration union. */ +} ble_conn_cfg_t; + +/** + * @brief Configuration of Vendor Specific base UUIDs, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_PARAM Too many UUIDs configured. + */ +typedef struct +{ + uint8_t vs_uuid_count; /**< Number of 128-bit Vendor Specific base UUID bases to allocate memory for. + Default value is @ref BLE_UUID_VS_COUNT_DEFAULT. Maximum value is + @ref BLE_UUID_VS_COUNT_MAX. */ +} ble_common_cfg_vs_uuid_t; + +/**@brief Common BLE Configuration type, wrapping the common configurations. */ +typedef union +{ + ble_common_cfg_vs_uuid_t vs_uuid_cfg; /**< Vendor Specific base UUID configuration, cfg_id is @ref BLE_COMMON_CFG_VS_UUID. */ +} ble_common_cfg_t; + +/**@brief BLE Configuration type, wrapping the module specific configurations. */ +typedef union +{ + ble_conn_cfg_t conn_cfg; /**< Connection specific configurations, cfg_id in @ref BLE_CONN_CFGS series. */ + ble_common_cfg_t common_cfg; /**< Global common configurations, cfg_id in @ref BLE_COMMON_CFGS series. */ + ble_gap_cfg_t gap_cfg; /**< Global GAP configurations, cfg_id in @ref BLE_GAP_CFGS series. */ + ble_gatts_cfg_t gatts_cfg; /**< Global GATTS configuration, cfg_id in @ref BLE_GATTS_CFGS series. */ +} ble_cfg_t; + +/** @} */ + +/** @addtogroup BLE_COMMON_FUNCTIONS Functions + * @{ */ + +/**@brief Enable the BLE stack + * + * @param[in, out] p_app_ram_base Pointer to a variable containing the start address of the + * application RAM region (APP_RAM_BASE). On return, this will + * contain the minimum start address of the application RAM region + * required by the SoftDevice for this configuration. + * @warning After this call, the SoftDevice may generate several events. The list of events provided + * below require the application to initiate a SoftDevice API call. The corresponding API call + * is referenced in the event documentation. + * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop + * communicating with the peer device. + * - @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST + * - @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST + * - @ref BLE_GAP_EVT_SEC_INFO_REQUEST + * - @ref BLE_GAP_EVT_SEC_REQUEST + * - @ref BLE_GAP_EVT_AUTH_KEY_REQUEST + * - @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST + * - @ref BLE_EVT_USER_MEM_REQUEST + * - @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST + * + * @note The memory requirement for a specific configuration will not increase between SoftDevices + * with the same major version number. + * + * @note At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located + * between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between + * APP_RAM_BASE and the start of the call stack. + * + * @details This call initializes the BLE stack, no BLE related function other than @ref + * sd_ble_cfg_set can be called before this one. + * + * @mscs + * @mmsc{@ref BLE_COMMON_ENABLE} + * @endmscs + * + * @retval ::NRF_SUCCESS The BLE stack has been initialized successfully. + * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized and cannot be reinitialized. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_NO_MEM One or more of the following is true: + * - The amount of memory assigned to the SoftDevice by *p_app_ram_base is not + * large enough to fit this configuration's memory requirement. Check *p_app_ram_base + * and set the start address of the application RAM region accordingly. + * - Dynamic part of the SoftDevice RAM region is larger then 64 kB which + * is currently not supported. + * @retval ::NRF_ERROR_RESOURCES The total number of L2CAP Channels configured using @ref sd_ble_cfg_set is too large. + */ +SVCALL(SD_BLE_ENABLE, uint32_t, sd_ble_enable(uint32_t * p_app_ram_base)); + +/**@brief Add configurations for the BLE stack + * + * @param[in] cfg_id Config ID, see @ref BLE_CONN_CFGS, @ref BLE_COMMON_CFGS, @ref + * BLE_GAP_CFGS or @ref BLE_GATTS_CFGS. + * @param[in] p_cfg Pointer to a ble_cfg_t structure containing the configuration value. + * @param[in] app_ram_base The start address of the application RAM region (APP_RAM_BASE). + * See @ref sd_ble_enable for details about APP_RAM_BASE. + * + * @note The memory requirement for a specific configuration will not increase between SoftDevices + * with the same major version number. + * + * @note If a configuration is set more than once, the last one set is the one that takes effect on + * @ref sd_ble_enable. + * + * @note Any part of the BLE stack that is NOT configured with @ref sd_ble_cfg_set will have default + * configuration. + * + * @note @ref sd_ble_cfg_set may be called at any time when the SoftDevice is enabled (see @ref + * sd_softdevice_enable) while the BLE part of the SoftDevice is not enabled (see @ref + * sd_ble_enable). + * + * @note Error codes for the configurations are described in the configuration structs. + * + * @mscs + * @mmsc{@ref BLE_COMMON_ENABLE} + * @endmscs + * + * @retval ::NRF_SUCCESS The configuration has been added successfully. + * @retval ::NRF_ERROR_INVALID_STATE The BLE stack had already been initialized. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid cfg_id supplied. + * @retval ::NRF_ERROR_NO_MEM The amount of memory assigned to the SoftDevice by app_ram_base is not + * large enough to fit this configuration's memory requirement. + */ +SVCALL(SD_BLE_CFG_SET, uint32_t, sd_ble_cfg_set(uint32_t cfg_id, ble_cfg_t const * p_cfg, uint32_t app_ram_base)); + +/**@brief Get an event from the pending events queue. + * + * @param[out] p_dest Pointer to buffer to be filled in with an event, or NULL to retrieve the event length. + * This buffer must be aligned to the extend defined by @ref BLE_EVT_PTR_ALIGNMENT. + * The buffer should be interpreted as a @ref ble_evt_t struct. + * @param[in, out] p_len Pointer the length of the buffer, on return it is filled with the event length. + * + * @details This call allows the application to pull a BLE event from the BLE stack. The application is signaled that + * an event is available from the BLE stack by the triggering of the SD_EVT_IRQn interrupt. + * The application is free to choose whether to call this function from thread mode (main context) or directly from the + * Interrupt Service Routine that maps to SD_EVT_IRQn. In any case however, and because the BLE stack runs at a higher + * priority than the application, this function should be called in a loop (until @ref NRF_ERROR_NOT_FOUND is returned) + * every time SD_EVT_IRQn is raised to ensure that all available events are pulled from the BLE stack. Failure to do so + * could potentially leave events in the internal queue without the application being aware of this fact. + * + * Sizing the p_dest buffer is equally important, since the application needs to provide all the memory necessary for the event to + * be copied into application memory. If the buffer provided is not large enough to fit the entire contents of the event, + * @ref NRF_ERROR_DATA_SIZE will be returned and the application can then call again with a larger buffer size. + * The maximum possible event length is defined by @ref BLE_EVT_LEN_MAX. The application may also "peek" the event length + * by providing p_dest as a NULL pointer and inspecting the value of *p_len upon return: + * + * \code + * uint16_t len; + * errcode = sd_ble_evt_get(NULL, &len); + * \endcode + * + * @mscs + * @mmsc{@ref BLE_COMMON_IRQ_EVT_MSC} + * @mmsc{@ref BLE_COMMON_THREAD_EVT_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Event pulled and stored into the supplied buffer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or not sufficiently aligned pointer supplied. + * @retval ::NRF_ERROR_NOT_FOUND No events ready to be pulled. + * @retval ::NRF_ERROR_DATA_SIZE Event ready but could not fit into the supplied buffer. + */ +SVCALL(SD_BLE_EVT_GET, uint32_t, sd_ble_evt_get(uint8_t *p_dest, uint16_t *p_len)); + + +/**@brief Add a Vendor Specific base UUID. + * + * @details This call enables the application to add a Vendor Specific base UUID to the BLE stack's table, for later + * use with all other modules and APIs. This then allows the application to use the shorter, 24-bit @ref ble_uuid_t + * format when dealing with both 16-bit and 128-bit UUIDs without having to check for lengths and having split code + * paths. This is accomplished by extending the grouping mechanism that the Bluetooth SIG standard base UUID uses + * for all other 128-bit UUIDs. The type field in the @ref ble_uuid_t structure is an index (relative to + * @ref BLE_UUID_TYPE_VENDOR_BEGIN) to the table populated by multiple calls to this function, and the UUID field + * in the same structure contains the 2 bytes at indexes 12 and 13. The number of possible 128-bit UUIDs available to + * the application is therefore the number of Vendor Specific UUIDs added with the help of this function times 65536, + * although restricted to modifying bytes 12 and 13 for each of the entries in the supplied array. + * + * @note Bytes 12 and 13 of the provided UUID will not be used internally, since those are always replaced by + * the 16-bit uuid field in @ref ble_uuid_t. + * + * @note If a UUID is already present in the BLE stack's internal table, the corresponding index will be returned in + * p_uuid_type along with an @ref NRF_SUCCESS error code. + * + * @param[in] p_vs_uuid Pointer to a 16-octet (128-bit) little endian Vendor Specific base UUID disregarding + * bytes 12 and 13. + * @param[out] p_uuid_type Pointer to a uint8_t where the type field in @ref ble_uuid_t corresponding to this UUID will be stored. + * + * @retval ::NRF_SUCCESS Successfully added the Vendor Specific base UUID. + * @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid. + * @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs. + */ +SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type)); + + +/**@brief Remove a Vendor Specific base UUID. + * + * @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows + * the application to reuse memory allocated for Vendor Specific base UUIDs. + * + * @note Currently this function can only be called with a p_uuid_type set to @ref BLE_UUID_TYPE_UNKNOWN or the last added UUID type. + * + * @param[inout] p_uuid_type Pointer to a uint8_t where its value matches the UUID type in @ref ble_uuid_t::type to be removed. + * If the type is set to @ref BLE_UUID_TYPE_UNKNOWN, or the pointer is NULL, the last Vendor Specific + * base UUID will be removed. If the function returns successfully, the UUID type that was removed will + * be written back to @p p_uuid_type. If function returns with a failure, it contains the last type that + * is in use by the ATT Server. + * + * @retval ::NRF_SUCCESS Successfully removed the Vendor Specific base UUID. + * @retval ::NRF_ERROR_INVALID_ADDR If p_uuid_type is invalid. + * @retval ::NRF_ERROR_INVALID_PARAM If p_uuid_type points to a non-valid UUID type. + * @retval ::NRF_ERROR_FORBIDDEN If the Vendor Specific base UUID is in use by the ATT Server. + */ +SVCALL(SD_BLE_UUID_VS_REMOVE, uint32_t, sd_ble_uuid_vs_remove(uint8_t *p_uuid_type)); + + +/** @brief Decode little endian raw UUID bytes (16-bit or 128-bit) into a 24 bit @ref ble_uuid_t structure. + * + * @details The raw UUID bytes excluding bytes 12 and 13 (i.e. bytes 0-11 and 14-15) of p_uuid_le are compared + * to the corresponding ones in each entry of the table of Vendor Specific base UUIDs populated with @ref sd_ble_uuid_vs_add + * to look for a match. If there is such a match, bytes 12 and 13 are returned as p_uuid->uuid and the index + * relative to @ref BLE_UUID_TYPE_VENDOR_BEGIN as p_uuid->type. + * + * @note If the UUID length supplied is 2, then the type set by this call will always be @ref BLE_UUID_TYPE_BLE. + * + * @param[in] uuid_le_len Length in bytes of the buffer pointed to by p_uuid_le (must be 2 or 16 bytes). + * @param[in] p_uuid_le Pointer pointing to little endian raw UUID bytes. + * @param[out] p_uuid Pointer to a @ref ble_uuid_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Successfully decoded into the @ref ble_uuid_t structure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid UUID length. + * @retval ::NRF_ERROR_NOT_FOUND For a 128-bit UUID, no match in the populated table of UUIDs. + */ +SVCALL(SD_BLE_UUID_DECODE, uint32_t, sd_ble_uuid_decode(uint8_t uuid_le_len, uint8_t const *p_uuid_le, ble_uuid_t *p_uuid)); + + +/** @brief Encode a @ref ble_uuid_t structure into little endian raw UUID bytes (16-bit or 128-bit). + * + * @note The pointer to the destination buffer p_uuid_le may be NULL, in which case only the validity and size of p_uuid is computed. + * + * @param[in] p_uuid Pointer to a @ref ble_uuid_t structure that will be encoded into bytes. + * @param[out] p_uuid_le_len Pointer to a uint8_t that will be filled with the encoded length (2 or 16 bytes). + * @param[out] p_uuid_le Pointer to a buffer where the little endian raw UUID bytes (2 or 16) will be stored. + * + * @retval ::NRF_SUCCESS Successfully encoded into the buffer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid UUID type. + */ +SVCALL(SD_BLE_UUID_ENCODE, uint32_t, sd_ble_uuid_encode(ble_uuid_t const *p_uuid, uint8_t *p_uuid_le_len, uint8_t *p_uuid_le)); + + +/**@brief Get Version Information. + * + * @details This call allows the application to get the BLE stack version information. + * + * @param[out] p_version Pointer to a ble_version_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Version information stored successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy (typically doing a locally-initiated disconnection procedure). + */ +SVCALL(SD_BLE_VERSION_GET, uint32_t, sd_ble_version_get(ble_version_t *p_version)); + + +/**@brief Provide a user memory block. + * + * @note This call can only be used as a response to a @ref BLE_EVT_USER_MEM_REQUEST event issued to the application. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_block Pointer to a user memory block structure or NULL if memory is managed by the application. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully queued a response to the peer. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid user memory block length supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection state or no user memory request pending. + */ +SVCALL(SD_BLE_USER_MEM_REPLY, uint32_t, sd_ble_user_mem_reply(uint16_t conn_handle, ble_user_mem_block_t const *p_block)); + +/**@brief Set a BLE option. + * + * @details This call allows the application to set the value of an option. + * + * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS. + * @param[in] p_opt Pointer to a ble_opt_t structure containing the option value. + * + * @retval ::NRF_SUCCESS Option set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Unable to set the parameter at this time. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed. + */ +SVCALL(SD_BLE_OPT_SET, uint32_t, sd_ble_opt_set(uint32_t opt_id, ble_opt_t const *p_opt)); + + +/**@brief Get a BLE option. + * + * @details This call allows the application to retrieve the value of an option. + * + * @param[in] opt_id Option ID, see @ref BLE_COMMON_OPTS and @ref BLE_GAP_OPTS. + * @param[out] p_opt Pointer to a ble_opt_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Option retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Unable to retrieve the parameter at this time. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy or the previous procedure has not completed. + * @retval ::NRF_ERROR_NOT_SUPPORTED This option is not supported. + * + */ +SVCALL(SD_BLE_OPT_GET, uint32_t, sd_ble_opt_get(uint32_t opt_id, ble_opt_t *p_opt)); + +/** @} */ +#ifdef __cplusplus +} +#endif +#endif /* BLE_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h new file mode 100644 index 0000000000..1b4820dc3d --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_err.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2012 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @addtogroup nrf_error + @{ + @ingroup BLE_COMMON + @} + + @defgroup ble_err General error codes + @{ + + @brief General error code definitions for the BLE API. + + @ingroup BLE_COMMON +*/ +#ifndef NRF_BLE_ERR_H__ +#define NRF_BLE_ERR_H__ + +#include "nrf_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* @defgroup BLE_ERRORS Error Codes + * @{ */ +#define BLE_ERROR_NOT_ENABLED (NRF_ERROR_STK_BASE_NUM+0x001) /**< @ref sd_ble_enable has not been called. */ +#define BLE_ERROR_INVALID_CONN_HANDLE (NRF_ERROR_STK_BASE_NUM+0x002) /**< Invalid connection handle. */ +#define BLE_ERROR_INVALID_ATTR_HANDLE (NRF_ERROR_STK_BASE_NUM+0x003) /**< Invalid attribute handle. */ +#define BLE_ERROR_INVALID_ADV_HANDLE (NRF_ERROR_STK_BASE_NUM+0x004) /**< Invalid advertising handle. */ +#define BLE_ERROR_INVALID_ROLE (NRF_ERROR_STK_BASE_NUM+0x005) /**< Invalid role. */ +#define BLE_ERROR_BLOCKED_BY_OTHER_LINKS (NRF_ERROR_STK_BASE_NUM+0x006) /**< The attempt to change link settings failed due to the scheduling of other links. */ +/** @} */ + + +/** @defgroup BLE_ERROR_SUBRANGES Module specific error code subranges + * @brief Assignment of subranges for module specific error codes. + * @note For specific error codes, see ble_.h or ble_error_.h. + * @{ */ +#define NRF_L2CAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x100) /**< L2CAP specific errors. */ +#define NRF_GAP_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x200) /**< GAP specific errors. */ +#define NRF_GATTC_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x300) /**< GATT client specific errors. */ +#define NRF_GATTS_ERR_BASE (NRF_ERROR_STK_BASE_NUM+0x400) /**< GATT server specific errors. */ +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif + + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h new file mode 100644 index 0000000000..d657fd6c11 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gap.h @@ -0,0 +1,2851 @@ +/* + * Copyright (c) 2011 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GAP Generic Access Profile (GAP) + @{ + @brief Definitions and prototypes for the GAP interface. + */ + +#ifndef BLE_GAP_H__ +#define BLE_GAP_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup BLE_GAP_ENUMERATIONS Enumerations + * @{ */ + +/**@brief GAP API SVC numbers. + */ +enum BLE_GAP_SVCS +{ + SD_BLE_GAP_ADDR_SET = BLE_GAP_SVC_BASE, /**< Set own Bluetooth Address. */ + SD_BLE_GAP_ADDR_GET = BLE_GAP_SVC_BASE + 1, /**< Get own Bluetooth Address. */ + SD_BLE_GAP_WHITELIST_SET = BLE_GAP_SVC_BASE + 2, /**< Set active whitelist. */ + SD_BLE_GAP_DEVICE_IDENTITIES_SET = BLE_GAP_SVC_BASE + 3, /**< Set device identity list. */ + SD_BLE_GAP_PRIVACY_SET = BLE_GAP_SVC_BASE + 4, /**< Set Privacy settings*/ + SD_BLE_GAP_PRIVACY_GET = BLE_GAP_SVC_BASE + 5, /**< Get Privacy settings*/ + SD_BLE_GAP_ADV_SET_CONFIGURE = BLE_GAP_SVC_BASE + 6, /**< Configure an advertising set. */ + SD_BLE_GAP_ADV_START = BLE_GAP_SVC_BASE + 7, /**< Start Advertising. */ + SD_BLE_GAP_ADV_STOP = BLE_GAP_SVC_BASE + 8, /**< Stop Advertising. */ + SD_BLE_GAP_CONN_PARAM_UPDATE = BLE_GAP_SVC_BASE + 9, /**< Connection Parameter Update. */ + SD_BLE_GAP_DISCONNECT = BLE_GAP_SVC_BASE + 10, /**< Disconnect. */ + SD_BLE_GAP_TX_POWER_SET = BLE_GAP_SVC_BASE + 11, /**< Set TX Power. */ + SD_BLE_GAP_APPEARANCE_SET = BLE_GAP_SVC_BASE + 12, /**< Set Appearance. */ + SD_BLE_GAP_APPEARANCE_GET = BLE_GAP_SVC_BASE + 13, /**< Get Appearance. */ + SD_BLE_GAP_PPCP_SET = BLE_GAP_SVC_BASE + 14, /**< Set PPCP. */ + SD_BLE_GAP_PPCP_GET = BLE_GAP_SVC_BASE + 15, /**< Get PPCP. */ + SD_BLE_GAP_DEVICE_NAME_SET = BLE_GAP_SVC_BASE + 16, /**< Set Device Name. */ + SD_BLE_GAP_DEVICE_NAME_GET = BLE_GAP_SVC_BASE + 17, /**< Get Device Name. */ + SD_BLE_GAP_AUTHENTICATE = BLE_GAP_SVC_BASE + 18, /**< Initiate Pairing/Bonding. */ + SD_BLE_GAP_SEC_PARAMS_REPLY = BLE_GAP_SVC_BASE + 19, /**< Reply with Security Parameters. */ + SD_BLE_GAP_AUTH_KEY_REPLY = BLE_GAP_SVC_BASE + 20, /**< Reply with an authentication key. */ + SD_BLE_GAP_LESC_DHKEY_REPLY = BLE_GAP_SVC_BASE + 21, /**< Reply with an LE Secure Connections DHKey. */ + SD_BLE_GAP_KEYPRESS_NOTIFY = BLE_GAP_SVC_BASE + 22, /**< Notify of a keypress during an authentication procedure. */ + SD_BLE_GAP_LESC_OOB_DATA_GET = BLE_GAP_SVC_BASE + 23, /**< Get the local LE Secure Connections OOB data. */ + SD_BLE_GAP_LESC_OOB_DATA_SET = BLE_GAP_SVC_BASE + 24, /**< Set the remote LE Secure Connections OOB data. */ + SD_BLE_GAP_ENCRYPT = BLE_GAP_SVC_BASE + 25, /**< Initiate encryption procedure. */ + SD_BLE_GAP_SEC_INFO_REPLY = BLE_GAP_SVC_BASE + 26, /**< Reply with Security Information. */ + SD_BLE_GAP_CONN_SEC_GET = BLE_GAP_SVC_BASE + 27, /**< Obtain connection security level. */ + SD_BLE_GAP_RSSI_START = BLE_GAP_SVC_BASE + 28, /**< Start reporting of changes in RSSI. */ + SD_BLE_GAP_RSSI_STOP = BLE_GAP_SVC_BASE + 29, /**< Stop reporting of changes in RSSI. */ + SD_BLE_GAP_SCAN_START = BLE_GAP_SVC_BASE + 30, /**< Start Scanning. */ + SD_BLE_GAP_SCAN_STOP = BLE_GAP_SVC_BASE + 31, /**< Stop Scanning. */ + SD_BLE_GAP_CONNECT = BLE_GAP_SVC_BASE + 32, /**< Connect. */ + SD_BLE_GAP_CONNECT_CANCEL = BLE_GAP_SVC_BASE + 33, /**< Cancel ongoing connection procedure. */ + SD_BLE_GAP_RSSI_GET = BLE_GAP_SVC_BASE + 34, /**< Get the last RSSI sample. */ + SD_BLE_GAP_PHY_UPDATE = BLE_GAP_SVC_BASE + 35, /**< Initiate or respond to a PHY Update Procedure. */ + SD_BLE_GAP_DATA_LENGTH_UPDATE = BLE_GAP_SVC_BASE + 36, /**< Initiate or respond to a Data Length Update Procedure. */ + SD_BLE_GAP_QOS_CHANNEL_SURVEY_START = BLE_GAP_SVC_BASE + 37, /**< Start Quality of Service (QoS) channel survey module. */ + SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP = BLE_GAP_SVC_BASE + 38, /**< Stop Quality of Service (QoS) channel survey module. */ + SD_BLE_GAP_ADV_ADDR_GET = BLE_GAP_SVC_BASE + 39, /**< Get the Address used on air while Advertising. */ + SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET = BLE_GAP_SVC_BASE + 40, /**< Get the next connection event counter. */ + SD_BLE_GAP_CONN_EVT_TRIGGER_START = BLE_GAP_SVC_BASE + 41, /** Start triggering a given task on connection event start. */ + SD_BLE_GAP_CONN_EVT_TRIGGER_STOP = BLE_GAP_SVC_BASE + 42, /** Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start. */ +}; + +/**@brief GAP Event IDs. + * IDs that uniquely identify an event coming from the stack to the application. + */ +enum BLE_GAP_EVTS +{ + BLE_GAP_EVT_CONNECTED = BLE_GAP_EVT_BASE, /**< Connected to peer. \n See @ref ble_gap_evt_connected_t */ + BLE_GAP_EVT_DISCONNECTED = BLE_GAP_EVT_BASE + 1, /**< Disconnected from peer. \n See @ref ble_gap_evt_disconnected_t. */ + BLE_GAP_EVT_CONN_PARAM_UPDATE = BLE_GAP_EVT_BASE + 2, /**< Connection Parameters updated. \n See @ref ble_gap_evt_conn_param_update_t. */ + BLE_GAP_EVT_SEC_PARAMS_REQUEST = BLE_GAP_EVT_BASE + 3, /**< Request to provide security parameters. \n Reply with @ref sd_ble_gap_sec_params_reply. \n See @ref ble_gap_evt_sec_params_request_t. */ + BLE_GAP_EVT_SEC_INFO_REQUEST = BLE_GAP_EVT_BASE + 4, /**< Request to provide security information. \n Reply with @ref sd_ble_gap_sec_info_reply. \n See @ref ble_gap_evt_sec_info_request_t. */ + BLE_GAP_EVT_PASSKEY_DISPLAY = BLE_GAP_EVT_BASE + 5, /**< Request to display a passkey to the user. \n In LESC Numeric Comparison, reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_passkey_display_t. */ + BLE_GAP_EVT_KEY_PRESSED = BLE_GAP_EVT_BASE + 6, /**< Notification of a keypress on the remote device.\n See @ref ble_gap_evt_key_pressed_t */ + BLE_GAP_EVT_AUTH_KEY_REQUEST = BLE_GAP_EVT_BASE + 7, /**< Request to provide an authentication key. \n Reply with @ref sd_ble_gap_auth_key_reply. \n See @ref ble_gap_evt_auth_key_request_t. */ + BLE_GAP_EVT_LESC_DHKEY_REQUEST = BLE_GAP_EVT_BASE + 8, /**< Request to calculate an LE Secure Connections DHKey. \n Reply with @ref sd_ble_gap_lesc_dhkey_reply. \n See @ref ble_gap_evt_lesc_dhkey_request_t */ + BLE_GAP_EVT_AUTH_STATUS = BLE_GAP_EVT_BASE + 9, /**< Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t. */ + BLE_GAP_EVT_CONN_SEC_UPDATE = BLE_GAP_EVT_BASE + 10, /**< Connection security updated. \n See @ref ble_gap_evt_conn_sec_update_t. */ + BLE_GAP_EVT_TIMEOUT = BLE_GAP_EVT_BASE + 11, /**< Timeout expired. \n See @ref ble_gap_evt_timeout_t. */ + BLE_GAP_EVT_RSSI_CHANGED = BLE_GAP_EVT_BASE + 12, /**< RSSI report. \n See @ref ble_gap_evt_rssi_changed_t. */ + BLE_GAP_EVT_ADV_REPORT = BLE_GAP_EVT_BASE + 13, /**< Advertising report. \n See @ref ble_gap_evt_adv_report_t. */ + BLE_GAP_EVT_SEC_REQUEST = BLE_GAP_EVT_BASE + 14, /**< Security Request. \n Reply with @ref sd_ble_gap_authenticate + \n or with @ref sd_ble_gap_encrypt if required security information is available +. \n See @ref ble_gap_evt_sec_request_t. */ + BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 15, /**< Connection Parameter Update Request. \n Reply with @ref sd_ble_gap_conn_param_update. \n See @ref ble_gap_evt_conn_param_update_request_t. */ + BLE_GAP_EVT_SCAN_REQ_REPORT = BLE_GAP_EVT_BASE + 16, /**< Scan request report. \n See @ref ble_gap_evt_scan_req_report_t. */ + BLE_GAP_EVT_PHY_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 17, /**< PHY Update Request. \n Reply with @ref sd_ble_gap_phy_update. \n See @ref ble_gap_evt_phy_update_request_t. */ + BLE_GAP_EVT_PHY_UPDATE = BLE_GAP_EVT_BASE + 18, /**< PHY Update Procedure is complete. \n See @ref ble_gap_evt_phy_update_t. */ + BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 19, /**< Data Length Update Request. \n Reply with @ref sd_ble_gap_data_length_update. \n See @ref ble_gap_evt_data_length_update_request_t. */ + BLE_GAP_EVT_DATA_LENGTH_UPDATE = BLE_GAP_EVT_BASE + 20, /**< LL Data Channel PDU payload length updated. \n See @ref ble_gap_evt_data_length_update_t. */ + BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT = BLE_GAP_EVT_BASE + 21, /**< Channel survey report. \n See @ref ble_gap_evt_qos_channel_survey_report_t. */ + BLE_GAP_EVT_ADV_SET_TERMINATED = BLE_GAP_EVT_BASE + 22, /**< Advertising set terminated. \n See @ref ble_gap_evt_adv_set_terminated_t. */ +}; + +/**@brief GAP Option IDs. + * IDs that uniquely identify a GAP option. + */ +enum BLE_GAP_OPTS +{ + BLE_GAP_OPT_CH_MAP = BLE_GAP_OPT_BASE, /**< Channel Map. @ref ble_gap_opt_ch_map_t */ + BLE_GAP_OPT_LOCAL_CONN_LATENCY = BLE_GAP_OPT_BASE + 1, /**< Local connection latency. @ref ble_gap_opt_local_conn_latency_t */ + BLE_GAP_OPT_PASSKEY = BLE_GAP_OPT_BASE + 2, /**< Set passkey. @ref ble_gap_opt_passkey_t */ + BLE_GAP_OPT_COMPAT_MODE_1 = BLE_GAP_OPT_BASE + 3, /**< Compatibility mode. @ref ble_gap_opt_compat_mode_1_t */ + BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT = BLE_GAP_OPT_BASE + 4, /**< Set Authenticated payload timeout. @ref ble_gap_opt_auth_payload_timeout_t */ + BLE_GAP_OPT_SLAVE_LATENCY_DISABLE = BLE_GAP_OPT_BASE + 5, /**< Disable slave latency. @ref ble_gap_opt_slave_latency_disable_t */ +}; + +/**@brief GAP Configuration IDs. + * + * IDs that uniquely identify a GAP configuration. + */ +enum BLE_GAP_CFGS +{ + BLE_GAP_CFG_ROLE_COUNT = BLE_GAP_CFG_BASE, /**< Role count configuration. */ + BLE_GAP_CFG_DEVICE_NAME = BLE_GAP_CFG_BASE + 1, /**< Device name configuration. */ + BLE_GAP_CFG_PPCP_INCL_CONFIG = BLE_GAP_CFG_BASE + 2, /**< Peripheral Preferred Connection Parameters characteristic + inclusion configuration. */ + BLE_GAP_CFG_CAR_INCL_CONFIG = BLE_GAP_CFG_BASE + 3, /**< Central Address Resolution characteristic + inclusion configuration. */ +}; + +/**@brief GAP TX Power roles. + */ +enum BLE_GAP_TX_POWER_ROLES +{ + BLE_GAP_TX_POWER_ROLE_ADV = 1, /**< Advertiser role. */ + BLE_GAP_TX_POWER_ROLE_SCAN_INIT = 2, /**< Scanner and initiator role. */ + BLE_GAP_TX_POWER_ROLE_CONN = 3, /**< Connection role. */ +}; + +/** @} */ + +/**@addtogroup BLE_GAP_DEFINES Defines + * @{ */ + +/**@defgroup BLE_ERRORS_GAP SVC return values specific to GAP + * @{ */ +#define BLE_ERROR_GAP_UUID_LIST_MISMATCH (NRF_GAP_ERR_BASE + 0x000) /**< UUID list does not contain an integral number of UUIDs. */ +#define BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST (NRF_GAP_ERR_BASE + 0x001) /**< Use of Whitelist not permitted with discoverable advertising. */ +#define BLE_ERROR_GAP_INVALID_BLE_ADDR (NRF_GAP_ERR_BASE + 0x002) /**< The upper two bits of the address do not correspond to the specified address type. */ +#define BLE_ERROR_GAP_WHITELIST_IN_USE (NRF_GAP_ERR_BASE + 0x003) /**< Attempt to modify the whitelist while already in use by another operation. */ +#define BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE (NRF_GAP_ERR_BASE + 0x004) /**< Attempt to modify the device identity list while already in use by another operation. */ +#define BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE (NRF_GAP_ERR_BASE + 0x005) /**< The device identity list contains entries with duplicate identity addresses. */ +/**@} */ + + +/**@defgroup BLE_GAP_ROLES GAP Roles + * @{ */ +#define BLE_GAP_ROLE_INVALID 0x0 /**< Invalid Role. */ +#define BLE_GAP_ROLE_PERIPH 0x1 /**< Peripheral Role. */ +#define BLE_GAP_ROLE_CENTRAL 0x2 /**< Central Role. */ +/**@} */ + + +/**@defgroup BLE_GAP_TIMEOUT_SOURCES GAP Timeout sources + * @{ */ +#define BLE_GAP_TIMEOUT_SRC_SCAN 0x01 /**< Scanning timeout. */ +#define BLE_GAP_TIMEOUT_SRC_CONN 0x02 /**< Connection timeout. */ +#define BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD 0x03 /**< Authenticated payload timeout. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADDR_TYPES GAP Address types + * @{ */ +#define BLE_GAP_ADDR_TYPE_PUBLIC 0x00 /**< Public (identity) address.*/ +#define BLE_GAP_ADDR_TYPE_RANDOM_STATIC 0x01 /**< Random static (identity) address. */ +#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE 0x02 /**< Random private resolvable address. */ +#define BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE 0x03 /**< Random private non-resolvable address. */ +#define BLE_GAP_ADDR_TYPE_ANONYMOUS 0x7F /**< An advertiser may advertise without its address. + This type of advertising is called anonymous. */ +/**@} */ + + +/**@brief The default interval in seconds at which a private address is refreshed. */ +#define BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S (900) /* 15 minutes. */ +/**@brief The maximum interval in seconds at which a private address can be refreshed. */ +#define BLE_GAP_MAX_PRIVATE_ADDR_CYCLE_INTERVAL_S (41400) /* 11 hours 30 minutes. */ + + +/** @brief BLE address length. */ +#define BLE_GAP_ADDR_LEN (6) + +/**@defgroup BLE_GAP_PRIVACY_MODES Privacy modes + * @{ */ +#define BLE_GAP_PRIVACY_MODE_OFF 0x00 /**< Device will send and accept its identity address for its own address. */ +#define BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY 0x01 /**< Device will send and accept only private addresses for its own address. */ +#define BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY 0x02 /**< Device will send and accept only private addresses for its own address, + and will not accept a peer using identity address as sender address when + the peer IRK is exchanged, non-zero and added to the identity list. */ +/**@} */ + +/** @brief Invalid power level. */ +#define BLE_GAP_POWER_LEVEL_INVALID 127 + +/** @brief Advertising set handle not set. */ +#define BLE_GAP_ADV_SET_HANDLE_NOT_SET (0xFF) + +/** @brief The default number of advertising sets. */ +#define BLE_GAP_ADV_SET_COUNT_DEFAULT (1) + +/** @brief The maximum number of advertising sets supported by this SoftDevice. */ +#define BLE_GAP_ADV_SET_COUNT_MAX (1) + +/**@defgroup BLE_GAP_ADV_SET_DATA_SIZES Advertising data sizes. + * @{ */ +#define BLE_GAP_ADV_SET_DATA_SIZE_MAX (31) /**< Maximum data length for an advertising set. + If more advertising data is required, use extended advertising instead. */ +#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for an extended advertising set. */ + +#define BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED (238) /**< Maximum supported data length for an extended connectable advertising set. */ +/**@}. */ + +/** @brief Set ID not available in advertising report. */ +#define BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE 0xFF + +/**@defgroup BLE_GAP_EVT_ADV_SET_TERMINATED_REASON GAP Advertising Set Terminated reasons + * @{ */ +#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT 0x01 /**< Timeout value reached. */ +#define BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED 0x02 /**< @ref ble_gap_adv_params_t::max_adv_evts was reached. */ +/**@} */ + +/**@defgroup BLE_GAP_AD_TYPE_DEFINITIONS GAP Advertising and Scan Response Data format + * @note Found at https://www.bluetooth.org/Technical/AssignedNumbers/generic_access_profile.htm + * @{ */ +#define BLE_GAP_AD_TYPE_FLAGS 0x01 /**< Flags for discoverability. */ +#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE 0x02 /**< Partial list of 16 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE 0x03 /**< Complete list of 16 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE 0x04 /**< Partial list of 32 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE 0x05 /**< Complete list of 32 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE 0x06 /**< Partial list of 128 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE 0x07 /**< Complete list of 128 bit service UUIDs. */ +#define BLE_GAP_AD_TYPE_SHORT_LOCAL_NAME 0x08 /**< Short local device name. */ +#define BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME 0x09 /**< Complete local device name. */ +#define BLE_GAP_AD_TYPE_TX_POWER_LEVEL 0x0A /**< Transmit power level. */ +#define BLE_GAP_AD_TYPE_CLASS_OF_DEVICE 0x0D /**< Class of device. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C 0x0E /**< Simple Pairing Hash C. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R 0x0F /**< Simple Pairing Randomizer R. */ +#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE 0x10 /**< Security Manager TK Value. */ +#define BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS 0x11 /**< Security Manager Out Of Band Flags. */ +#define BLE_GAP_AD_TYPE_SLAVE_CONNECTION_INTERVAL_RANGE 0x12 /**< Slave Connection Interval Range. */ +#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_16BIT 0x14 /**< List of 16-bit Service Solicitation UUIDs. */ +#define BLE_GAP_AD_TYPE_SOLICITED_SERVICE_UUIDS_128BIT 0x15 /**< List of 128-bit Service Solicitation UUIDs. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA 0x16 /**< Service Data - 16-bit UUID. */ +#define BLE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS 0x17 /**< Public Target Address. */ +#define BLE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS 0x18 /**< Random Target Address. */ +#define BLE_GAP_AD_TYPE_APPEARANCE 0x19 /**< Appearance. */ +#define BLE_GAP_AD_TYPE_ADVERTISING_INTERVAL 0x1A /**< Advertising Interval. */ +#define BLE_GAP_AD_TYPE_LE_BLUETOOTH_DEVICE_ADDRESS 0x1B /**< LE Bluetooth Device Address. */ +#define BLE_GAP_AD_TYPE_LE_ROLE 0x1C /**< LE Role. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_HASH_C256 0x1D /**< Simple Pairing Hash C-256. */ +#define BLE_GAP_AD_TYPE_SIMPLE_PAIRING_RANDOMIZER_R256 0x1E /**< Simple Pairing Randomizer R-256. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA_32BIT_UUID 0x20 /**< Service Data - 32-bit UUID. */ +#define BLE_GAP_AD_TYPE_SERVICE_DATA_128BIT_UUID 0x21 /**< Service Data - 128-bit UUID. */ +#define BLE_GAP_AD_TYPE_LESC_CONFIRMATION_VALUE 0x22 /**< LE Secure Connections Confirmation Value */ +#define BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE 0x23 /**< LE Secure Connections Random Value */ +#define BLE_GAP_AD_TYPE_URI 0x24 /**< URI */ +#define BLE_GAP_AD_TYPE_3D_INFORMATION_DATA 0x3D /**< 3D Information Data. */ +#define BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA 0xFF /**< Manufacturer Specific Data. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADV_FLAGS GAP Advertisement Flags + * @{ */ +#define BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE (0x01) /**< LE Limited Discoverable Mode. */ +#define BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE (0x02) /**< LE General Discoverable Mode. */ +#define BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED (0x04) /**< BR/EDR not supported. */ +#define BLE_GAP_ADV_FLAG_LE_BR_EDR_CONTROLLER (0x08) /**< Simultaneous LE and BR/EDR, Controller. */ +#define BLE_GAP_ADV_FLAG_LE_BR_EDR_HOST (0x10) /**< Simultaneous LE and BR/EDR, Host. */ +#define BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE (BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE Limited Discoverable Mode, BR/EDR not supported. */ +#define BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE (BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE | BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) /**< LE General Discoverable Mode, BR/EDR not supported. */ +/**@} */ + + +/**@defgroup BLE_GAP_ADV_INTERVALS GAP Advertising interval max and min + * @{ */ +#define BLE_GAP_ADV_INTERVAL_MIN 0x000020 /**< Minimum Advertising interval in 625 us units, i.e. 20 ms. */ +#define BLE_GAP_ADV_INTERVAL_MAX 0x004000 /**< Maximum Advertising interval in 625 us units, i.e. 10.24 s. */ + /**@} */ + + +/**@defgroup BLE_GAP_SCAN_INTERVALS GAP Scan interval max and min + * @{ */ +#define BLE_GAP_SCAN_INTERVAL_MIN 0x0004 /**< Minimum Scan interval in 625 us units, i.e. 2.5 ms. */ +#define BLE_GAP_SCAN_INTERVAL_MAX 0xFFFF /**< Maximum Scan interval in 625 us units, i.e. 40,959.375 s. */ + /** @} */ + + +/**@defgroup BLE_GAP_SCAN_WINDOW GAP Scan window max and min + * @{ */ +#define BLE_GAP_SCAN_WINDOW_MIN 0x0004 /**< Minimum Scan window in 625 us units, i.e. 2.5 ms. */ +#define BLE_GAP_SCAN_WINDOW_MAX 0xFFFF /**< Maximum Scan window in 625 us units, i.e. 40,959.375 s. */ + /** @} */ + + +/**@defgroup BLE_GAP_SCAN_TIMEOUT GAP Scan timeout max and min + * @{ */ +#define BLE_GAP_SCAN_TIMEOUT_MIN 0x0001 /**< Minimum Scan timeout in 10 ms units, i.e 10 ms. */ +#define BLE_GAP_SCAN_TIMEOUT_UNLIMITED 0x0000 /**< Continue to scan forever. */ + /** @} */ + +/**@defgroup BLE_GAP_SCAN_BUFFER_SIZE GAP Minimum scanner buffer size + * + * Scan buffers are used for storing advertising data received from an advertiser. + * If ble_gap_scan_params_t::extended is set to 0, @ref BLE_GAP_SCAN_BUFFER_MIN is the minimum scan buffer length. + * else the minimum scan buffer size is @ref BLE_GAP_SCAN_BUFFER_EXTENDED_MIN. + * @{ */ +#define BLE_GAP_SCAN_BUFFER_MIN (31) /**< Minimum data length for an + advertising set. */ +#define BLE_GAP_SCAN_BUFFER_MAX (31) /**< Maximum data length for an + advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255) /**< Minimum data length for an + extended advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX (1650) /**< Maximum data length for an + extended advertising set. */ +#define BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED (255) /**< Maximum supported data length for + an extended advertising set. */ +/** @} */ + +/**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types + * + * Advertising types defined in Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.4.2. + * + * The maximum advertising data length is defined by @ref BLE_GAP_ADV_SET_DATA_SIZE_MAX. + * The maximum supported data length for an extended advertiser is defined by + * @ref BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED + * Note that some of the advertising types do not support advertising data. Non-scannable types do not support + * scan response data. + * + * @{ */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED 0x01 /**< Connectable and scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE 0x02 /**< Connectable non-scannable directed advertising + events. Advertising interval is less that 3.75 ms. + Use this type for fast reconnections. + @note Advertising data is not supported. */ +#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED 0x03 /**< Connectable non-scannable directed advertising + events. + @note Advertising data is not supported. */ +#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x04 /**< Non-connectable scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x05 /**< Non-connectable non-scannable undirected + advertising events. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED 0x06 /**< Connectable non-scannable undirected advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED 0x07 /**< Connectable non-scannable directed advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED 0x08 /**< Non-connectable scannable undirected advertising + events using extended advertising PDUs. + @note Only scan response data is supported. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED 0x09 /**< Non-connectable scannable directed advertising + events using extended advertising PDUs. + @note Only scan response data is supported. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED 0x0A /**< Non-connectable non-scannable undirected advertising + events using extended advertising PDUs. */ +#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED 0x0B /**< Non-connectable non-scannable directed advertising + events using extended advertising PDUs. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_FILTER_POLICIES GAP Advertising filter policies + * @{ */ +#define BLE_GAP_ADV_FP_ANY 0x00 /**< Allow scan requests and connect requests from any device. */ +#define BLE_GAP_ADV_FP_FILTER_SCANREQ 0x01 /**< Filter scan requests with whitelist. */ +#define BLE_GAP_ADV_FP_FILTER_CONNREQ 0x02 /**< Filter connect requests with whitelist. */ +#define BLE_GAP_ADV_FP_FILTER_BOTH 0x03 /**< Filter both scan and connect requests with whitelist. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_DATA_STATUS GAP Advertising data status + * @{ */ +#define BLE_GAP_ADV_DATA_STATUS_COMPLETE 0x00 /**< All data in the advertising event have been received. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA 0x01 /**< More data to be received. + @note This value will only be used if + @ref ble_gap_scan_params_t::report_incomplete_evts and + @ref ble_gap_adv_report_type_t::extended_pdu are set to true. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED 0x02 /**< Incomplete data. Buffer size insufficient to receive more. + @note This value will only be used if + @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */ +#define BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MISSED 0x03 /**< Failed to receive the remaining data. + @note This value will only be used if + @ref ble_gap_adv_report_type_t::extended_pdu is set to true. */ +/**@} */ + +/**@defgroup BLE_GAP_SCAN_FILTER_POLICIES GAP Scanner filter policies + * @{ */ +#define BLE_GAP_SCAN_FP_ACCEPT_ALL 0x00 /**< Accept all advertising packets except directed advertising packets + not addressed to this device. */ +#define BLE_GAP_SCAN_FP_WHITELIST 0x01 /**< Accept advertising packets from devices in the whitelist except directed + packets not addressed to this device. */ +#define BLE_GAP_SCAN_FP_ALL_NOT_RESOLVED_DIRECTED 0x02 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_ACCEPT_ALL. + In addition, accept directed advertising packets, where the advertiser's + address is a resolvable private address that cannot be resolved. */ +#define BLE_GAP_SCAN_FP_WHITELIST_NOT_RESOLVED_DIRECTED 0x03 /**< Accept all advertising packets specified in @ref BLE_GAP_SCAN_FP_WHITELIST. + In addition, accept directed advertising packets, where the advertiser's + address is a resolvable private address that cannot be resolved. */ +/**@} */ + +/**@defgroup BLE_GAP_ADV_TIMEOUT_VALUES GAP Advertising timeout values in 10 ms units + * @{ */ +#define BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX (128) /**< Maximum high duty advertising time in 10 ms units. Corresponds to 1.28 s. */ +#define BLE_GAP_ADV_TIMEOUT_LIMITED_MAX (18000) /**< Maximum advertising time in 10 ms units corresponding to TGAP(lim_adv_timeout) = 180 s in limited discoverable mode. */ +#define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED (0) /**< Unlimited advertising in general discoverable mode. + For high duty cycle advertising, this corresponds to @ref BLE_GAP_ADV_TIMEOUT_HIGH_DUTY_MAX. */ +/**@} */ + + +/**@defgroup BLE_GAP_DISC_MODES GAP Discovery modes + * @{ */ +#define BLE_GAP_DISC_MODE_NOT_DISCOVERABLE 0x00 /**< Not discoverable discovery Mode. */ +#define BLE_GAP_DISC_MODE_LIMITED 0x01 /**< Limited Discovery Mode. */ +#define BLE_GAP_DISC_MODE_GENERAL 0x02 /**< General Discovery Mode. */ +/**@} */ + + +/**@defgroup BLE_GAP_IO_CAPS GAP IO Capabilities + * @{ */ +#define BLE_GAP_IO_CAPS_DISPLAY_ONLY 0x00 /**< Display Only. */ +#define BLE_GAP_IO_CAPS_DISPLAY_YESNO 0x01 /**< Display and Yes/No entry. */ +#define BLE_GAP_IO_CAPS_KEYBOARD_ONLY 0x02 /**< Keyboard Only. */ +#define BLE_GAP_IO_CAPS_NONE 0x03 /**< No I/O capabilities. */ +#define BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY 0x04 /**< Keyboard and Display. */ +/**@} */ + + +/**@defgroup BLE_GAP_AUTH_KEY_TYPES GAP Authentication Key Types + * @{ */ +#define BLE_GAP_AUTH_KEY_TYPE_NONE 0x00 /**< No key (may be used to reject). */ +#define BLE_GAP_AUTH_KEY_TYPE_PASSKEY 0x01 /**< 6-digit Passkey. */ +#define BLE_GAP_AUTH_KEY_TYPE_OOB 0x02 /**< Out Of Band data. */ +/**@} */ + + +/**@defgroup BLE_GAP_KP_NOT_TYPES GAP Keypress Notification Types + * @{ */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_START 0x00 /**< Passkey entry started. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_IN 0x01 /**< Passkey digit entered. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_DIGIT_OUT 0x02 /**< Passkey digit erased. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_CLEAR 0x03 /**< Passkey cleared. */ +#define BLE_GAP_KP_NOT_TYPE_PASSKEY_END 0x04 /**< Passkey entry completed. */ +/**@} */ + + +/**@defgroup BLE_GAP_SEC_STATUS GAP Security status + * @{ */ +#define BLE_GAP_SEC_STATUS_SUCCESS 0x00 /**< Procedure completed with success. */ +#define BLE_GAP_SEC_STATUS_TIMEOUT 0x01 /**< Procedure timed out. */ +#define BLE_GAP_SEC_STATUS_PDU_INVALID 0x02 /**< Invalid PDU received. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE1_BEGIN 0x03 /**< Reserved for Future Use range #1 begin. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE1_END 0x80 /**< Reserved for Future Use range #1 end. */ +#define BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED 0x81 /**< Passkey entry failed (user canceled or other). */ +#define BLE_GAP_SEC_STATUS_OOB_NOT_AVAILABLE 0x82 /**< Out of Band Key not available. */ +#define BLE_GAP_SEC_STATUS_AUTH_REQ 0x83 /**< Authentication requirements not met. */ +#define BLE_GAP_SEC_STATUS_CONFIRM_VALUE 0x84 /**< Confirm value failed. */ +#define BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP 0x85 /**< Pairing not supported. */ +#define BLE_GAP_SEC_STATUS_ENC_KEY_SIZE 0x86 /**< Encryption key size. */ +#define BLE_GAP_SEC_STATUS_SMP_CMD_UNSUPPORTED 0x87 /**< Unsupported SMP command. */ +#define BLE_GAP_SEC_STATUS_UNSPECIFIED 0x88 /**< Unspecified reason. */ +#define BLE_GAP_SEC_STATUS_REPEATED_ATTEMPTS 0x89 /**< Too little time elapsed since last attempt. */ +#define BLE_GAP_SEC_STATUS_INVALID_PARAMS 0x8A /**< Invalid parameters. */ +#define BLE_GAP_SEC_STATUS_DHKEY_FAILURE 0x8B /**< DHKey check failure. */ +#define BLE_GAP_SEC_STATUS_NUM_COMP_FAILURE 0x8C /**< Numeric Comparison failure. */ +#define BLE_GAP_SEC_STATUS_BR_EDR_IN_PROG 0x8D /**< BR/EDR pairing in progress. */ +#define BLE_GAP_SEC_STATUS_X_TRANS_KEY_DISALLOWED 0x8E /**< BR/EDR Link Key cannot be used for LE keys. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE2_BEGIN 0x8F /**< Reserved for Future Use range #2 begin. */ +#define BLE_GAP_SEC_STATUS_RFU_RANGE2_END 0xFF /**< Reserved for Future Use range #2 end. */ +/**@} */ + + +/**@defgroup BLE_GAP_SEC_STATUS_SOURCES GAP Security status sources + * @{ */ +#define BLE_GAP_SEC_STATUS_SOURCE_LOCAL 0x00 /**< Local failure. */ +#define BLE_GAP_SEC_STATUS_SOURCE_REMOTE 0x01 /**< Remote failure. */ +/**@} */ + + +/**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits + * @{ */ +#define BLE_GAP_CP_MIN_CONN_INTVL_NONE 0xFFFF /**< No new minimum connection interval specified in connect parameters. */ +#define BLE_GAP_CP_MIN_CONN_INTVL_MIN 0x0006 /**< Lowest minimum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */ +#define BLE_GAP_CP_MIN_CONN_INTVL_MAX 0x0C80 /**< Highest minimum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_NONE 0xFFFF /**< No new maximum connection interval specified in connect parameters. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_MIN 0x0006 /**< Lowest maximum connection interval permitted, in units of 1.25 ms, i.e. 7.5 ms. */ +#define BLE_GAP_CP_MAX_CONN_INTVL_MAX 0x0C80 /**< Highest maximum connection interval permitted, in units of 1.25 ms, i.e. 4 s. */ +#define BLE_GAP_CP_SLAVE_LATENCY_MAX 0x01F3 /**< Highest slave latency permitted, in connection events. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_NONE 0xFFFF /**< No new supervision timeout specified in connect parameters. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN 0x000A /**< Lowest supervision timeout permitted, in units of 10 ms, i.e. 100 ms. */ +#define BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX 0x0C80 /**< Highest supervision timeout permitted, in units of 10 ms, i.e. 32 s. */ +/**@} */ + + +/**@defgroup BLE_GAP_DEVNAME GAP device name defines. + * @{ */ +#define BLE_GAP_DEVNAME_DEFAULT "nRF5x" /**< Default device name value. */ +#define BLE_GAP_DEVNAME_DEFAULT_LEN 31 /**< Default number of octets in device name. */ +#define BLE_GAP_DEVNAME_MAX_LEN 248 /**< Maximum number of octets in device name. */ +/**@} */ + + +/**@brief Disable RSSI events for connections */ +#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF + +/**@defgroup BLE_GAP_PHYS GAP PHYs + * @{ */ +#define BLE_GAP_PHY_AUTO 0x00 /**< Automatic PHY selection. Refer @ref sd_ble_gap_phy_update for more information.*/ +#define BLE_GAP_PHY_1MBPS 0x01 /**< 1 Mbps PHY. */ +#define BLE_GAP_PHY_2MBPS 0x02 /**< 2 Mbps PHY. */ +#define BLE_GAP_PHY_CODED 0x04 /**< Coded PHY. */ +#define BLE_GAP_PHY_NOT_SET 0xFF /**< PHY is not configured. */ + +/**@brief Supported PHYs in connections, for scanning, and for advertising. */ +#define BLE_GAP_PHYS_SUPPORTED (BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_CODED) /**< All PHYs are supported. */ + +/**@} */ + +/**@defgroup BLE_GAP_CONN_SEC_MODE_SET_MACROS GAP attribute security requirement setters + * + * See @ref ble_gap_conn_sec_mode_t. + * @{ */ +/**@brief Set sec_mode pointed to by ptr to have no access rights.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(ptr) do {(ptr)->sm = 0; (ptr)->lv = 0;} while(0) +/**@brief Set sec_mode pointed to by ptr to require no protection, open link.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_OPEN(ptr) do {(ptr)->sm = 1; (ptr)->lv = 1;} while(0) +/**@brief Set sec_mode pointed to by ptr to require encryption, but no MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 2;} while(0) +/**@brief Set sec_mode pointed to by ptr to require encryption and MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 3;} while(0) +/**@brief Set sec_mode pointed to by ptr to require LESC encryption and MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM(ptr) do {(ptr)->sm = 1; (ptr)->lv = 4;} while(0) +/**@brief Set sec_mode pointed to by ptr to require signing or encryption, no MITM protection needed.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_NO_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 1;} while(0) +/**@brief Set sec_mode pointed to by ptr to require signing or encryption with MITM protection.*/ +#define BLE_GAP_CONN_SEC_MODE_SET_SIGNED_WITH_MITM(ptr) do {(ptr)->sm = 2; (ptr)->lv = 2;} while(0) +/**@} */ + + +/**@brief GAP Security Random Number Length. */ +#define BLE_GAP_SEC_RAND_LEN 8 + + +/**@brief GAP Security Key Length. */ +#define BLE_GAP_SEC_KEY_LEN 16 + + +/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key Length. */ +#define BLE_GAP_LESC_P256_PK_LEN 64 + + +/**@brief GAP LE Secure Connections Elliptic Curve Diffie-Hellman DHKey Length. */ +#define BLE_GAP_LESC_DHKEY_LEN 32 + + +/**@brief GAP Passkey Length. */ +#define BLE_GAP_PASSKEY_LEN 6 + + +/**@brief Maximum amount of addresses in the whitelist. */ +#define BLE_GAP_WHITELIST_ADDR_MAX_COUNT (8) + + +/**@brief Maximum amount of identities in the device identities list. */ +#define BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT (8) + + +/**@brief Default connection count for a configuration. */ +#define BLE_GAP_CONN_COUNT_DEFAULT (1) + + +/**@defgroup BLE_GAP_EVENT_LENGTH GAP event length defines. + * @{ */ +#define BLE_GAP_EVENT_LENGTH_MIN (2) /**< Minimum event length, in 1.25 ms units. */ +#define BLE_GAP_EVENT_LENGTH_CODED_PHY_MIN (6) /**< The shortest event length in 1.25 ms units supporting LE Coded PHY. */ +#define BLE_GAP_EVENT_LENGTH_DEFAULT (3) /**< Default event length, in 1.25 ms units. */ +/**@} */ + + +/**@defgroup BLE_GAP_ROLE_COUNT GAP concurrent connection count defines. + * @{ */ +#define BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT (1) /**< Default maximum number of connections concurrently acting as peripherals. */ +#define BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT (3) /**< Default maximum number of connections concurrently acting as centrals. */ +#define BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT (1) /**< Default number of SMP instances shared between all connections acting as centrals. */ +#define BLE_GAP_ROLE_COUNT_COMBINED_MAX (20) /**< Maximum supported number of concurrent connections in the peripheral and central roles combined. */ + +/**@} */ + +/**@brief Automatic data length parameter. */ +#define BLE_GAP_DATA_LENGTH_AUTO 0 + +/**@defgroup BLE_GAP_AUTH_PAYLOAD_TIMEOUT Authenticated payload timeout defines. + * @{ */ +#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX (48000) /**< Maximum authenticated payload timeout in 10 ms units, i.e. 8 minutes. */ +#define BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MIN (1) /**< Minimum authenticated payload timeout in 10 ms units, i.e. 10 ms. */ +/**@} */ + +/**@defgroup GAP_SEC_MODES GAP Security Modes + * @{ */ +#define BLE_GAP_SEC_MODE 0x00 /**< No key (may be used to reject). */ +/**@} */ + +/**@brief The total number of channels in Bluetooth Low Energy. */ +#define BLE_GAP_CHANNEL_COUNT (40) + +/**@defgroup BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS Quality of Service (QoS) Channel survey interval defines + * @{ */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS (0) /**< Continuous channel survey. */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MIN_US (7500) /**< Minimum channel survey interval in microseconds (7.5 ms). */ +#define BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_MAX_US (4000000) /**< Maximum channel survey interval in microseconds (4 s). */ + /**@} */ + +/** @} */ + +/** @defgroup BLE_GAP_CHAR_INCL_CONFIG GAP Characteristic inclusion configurations + * @{ + */ +#define BLE_GAP_CHAR_INCL_CONFIG_INCLUDE (0) /**< Include the characteristic in the Attribute Table */ +#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITH_SPACE (1) /**< Do not include the characteristic in the Attribute table. + The SoftDevice will reserve the attribute handles + which are otherwise used for this characteristic. + By reserving the attribute handles it will be possible + to upgrade the SoftDevice without changing handle of the + Service Changed characteristic. */ +#define BLE_GAP_CHAR_INCL_CONFIG_EXCLUDE_WITHOUT_SPACE (2) /**< Do not include the characteristic in the Attribute table. + The SoftDevice will not reserve the attribute handles + which are otherwise used for this characteristic. */ +/**@} */ + + +/** @defgroup BLE_GAP_CHAR_INCL_CONFIG_DEFAULTS Characteristic inclusion default values + * @{ */ +#define BLE_GAP_PPCP_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE) /**< Included by default. */ +#define BLE_GAP_CAR_INCL_CONFIG_DEFAULT (BLE_GAP_CHAR_INCL_CONFIG_INCLUDE) /**< Included by default. */ +/**@} */ + +/**@addtogroup BLE_GAP_STRUCTURES Structures + * @{ */ + +/**@brief Advertising event properties. */ +typedef struct +{ + uint8_t type; /**< Advertising type. See @ref BLE_GAP_ADV_TYPES. */ + uint8_t anonymous : 1; /**< Omit advertiser's address from all PDUs. + @note Anonymous advertising is only available for + @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED and + @ref BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED. */ + uint8_t include_tx_power : 1; /**< This feature is not supported on this SoftDevice. */ +} ble_gap_adv_properties_t; + + +/**@brief Advertising report type. */ +typedef struct +{ + uint16_t connectable : 1; /**< Connectable advertising event type. */ + uint16_t scannable : 1; /**< Scannable advertising event type. */ + uint16_t directed : 1; /**< Directed advertising event type. */ + uint16_t scan_response : 1; /**< Received a scan response. */ + uint16_t extended_pdu : 1; /**< Received an extended advertising set. */ + uint16_t status : 2; /**< Data status. See @ref BLE_GAP_ADV_DATA_STATUS. */ + uint16_t reserved : 9; /**< Reserved for future use. */ +} ble_gap_adv_report_type_t; + +/**@brief Advertising Auxiliary Pointer. */ +typedef struct +{ + uint16_t aux_offset; /**< Time offset from the beginning of advertising packet to the auxiliary packet in 100 us units. */ + uint8_t aux_phy; /**< Indicates the PHY on which the auxiliary advertising packet is sent. See @ref BLE_GAP_PHYS. */ +} ble_gap_aux_pointer_t; + +/**@brief Bluetooth Low Energy address. */ +typedef struct +{ + uint8_t addr_id_peer : 1; /**< Only valid for peer addresses. + This bit is set by the SoftDevice to indicate whether the address has been resolved from + a Resolvable Private Address (when the peer is using privacy). + If set to 1, @ref addr and @ref addr_type refer to the identity address of the resolved address. + + This bit is ignored when a variable of type @ref ble_gap_addr_t is used as input to API functions. */ + uint8_t addr_type : 7; /**< See @ref BLE_GAP_ADDR_TYPES. */ + uint8_t addr[BLE_GAP_ADDR_LEN]; /**< 48-bit address, LSB format. + @ref addr is not used if @ref addr_type is @ref BLE_GAP_ADDR_TYPE_ANONYMOUS. */ +} ble_gap_addr_t; + + +/**@brief GAP connection parameters. + * + * @note When ble_conn_params_t is received in an event, both min_conn_interval and + * max_conn_interval will be equal to the connection interval set by the central. + * + * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies: + * conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval + * that corresponds to the following Bluetooth Spec requirement: + * The Supervision_Timeout in milliseconds shall be larger than + * (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds. + */ +typedef struct +{ + uint16_t min_conn_interval; /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t max_conn_interval; /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t slave_latency; /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/ + uint16_t conn_sup_timeout; /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/ +} ble_gap_conn_params_t; + + +/**@brief GAP connection security modes. + * + * Security Mode 0 Level 0: No access permissions at all (this level is not defined by the Bluetooth Core specification).\n + * Security Mode 1 Level 1: No security is needed (aka open link).\n + * Security Mode 1 Level 2: Encrypted link required, MITM protection not necessary.\n + * Security Mode 1 Level 3: MITM protected encrypted link required.\n + * Security Mode 1 Level 4: LESC MITM protected encrypted link using a 128-bit strength encryption key required.\n + * Security Mode 2 Level 1: Signing or encryption required, MITM protection not necessary.\n + * Security Mode 2 Level 2: MITM protected signing required, unless link is MITM protected encrypted.\n + */ +typedef struct +{ + uint8_t sm : 4; /**< Security Mode (1 or 2), 0 for no permissions at all. */ + uint8_t lv : 4; /**< Level (1, 2, 3 or 4), 0 for no permissions at all. */ + +} ble_gap_conn_sec_mode_t; + + +/**@brief GAP connection security status.*/ +typedef struct +{ + ble_gap_conn_sec_mode_t sec_mode; /**< Currently active security mode for this connection.*/ + uint8_t encr_key_size; /**< Length of currently active encryption key, 7 to 16 octets (only applicable for bonding procedures). */ +} ble_gap_conn_sec_t; + +/**@brief Identity Resolving Key. */ +typedef struct +{ + uint8_t irk[BLE_GAP_SEC_KEY_LEN]; /**< Array containing IRK. */ +} ble_gap_irk_t; + + +/**@brief Channel mask (40 bits). + * Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0, + * Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents + * channel index 39. If a bit is set to 1, the channel is not used. + */ +typedef uint8_t ble_gap_ch_mask_t[5]; + + +/**@brief GAP advertising parameters. */ +typedef struct +{ + ble_gap_adv_properties_t properties; /**< The properties of the advertising events. */ + ble_gap_addr_t const *p_peer_addr; /**< Address of a known peer. + @note ble_gap_addr_t::addr_type cannot be + @ref BLE_GAP_ADDR_TYPE_ANONYMOUS. + - When privacy is enabled and the local device uses + @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE addresses, + the device identity list is searched for a matching entry. If + the local IRK for that device identity is set, the local IRK + for that device will be used to generate the advertiser address + field in the advertising packet. + - If @ref ble_gap_adv_properties_t::type is directed, this must be + set to the targeted scanner or initiator. If the peer address is + in the device identity list, the peer IRK for that device will be + used to generate @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE + target addresses used in the advertising event PDUs. */ + uint32_t interval; /**< Advertising interval in 625 us units. @sa BLE_GAP_ADV_INTERVALS. + @note If @ref ble_gap_adv_properties_t::type is set to + @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE + advertising, this parameter is ignored. */ + uint16_t duration; /**< Advertising duration in 10 ms units. When timeout is reached, + an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised. + @sa BLE_GAP_ADV_TIMEOUT_VALUES. + @note The SoftDevice will always complete at least one advertising + event even if the duration is set too low. */ + uint8_t max_adv_evts; /**< Maximum advertising events that shall be sent prior to disabling + advertising. Setting the value to 0 disables the limitation. When + the count of advertising events specified by this parameter + (if not 0) is reached, advertising will be automatically stopped + and an event of type @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised + @note If @ref ble_gap_adv_properties_t::type is set to + @ref BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE, + this parameter is ignored. */ + ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels. + At least one of the primary channels, that is channel index 37-39, must be used. + Masking away secondary advertising channels is not supported. */ + uint8_t filter_policy; /**< Filter Policy. @sa BLE_GAP_ADV_FILTER_POLICIES. */ + uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising channel packets + are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS + will be used. + Valid values are @ref BLE_GAP_PHY_1MBPS and @ref BLE_GAP_PHY_CODED. + @note The primary_phy shall indicate @ref BLE_GAP_PHY_1MBPS if + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising channel packets + are transmitted. + If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS will be used. + Valid values are + @ref BLE_GAP_PHY_1MBPS, @ref BLE_GAP_PHY_2MBPS, and @ref BLE_GAP_PHY_CODED. + If @ref ble_gap_adv_properties_t::type is an extended advertising type + and connectable, this is the PHY that will be used to establish a + connection and send AUX_ADV_IND packets on. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t set_id:4; /**< The advertising set identifier distinguishes this advertising set from other + advertising sets transmitted by this and other devices. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is not an extended advertising type. */ + uint8_t scan_req_notification:1; /**< Enable scan request notifications for this advertising set. When a + scan request is received and the scanner address is allowed + by the filter policy, @ref BLE_GAP_EVT_SCAN_REQ_REPORT is raised. + @note This parameter will be ignored when + @ref ble_gap_adv_properties_t::type is a non-scannable + advertising type. */ +} ble_gap_adv_params_t; + + +/**@brief GAP advertising data buffers. + * + * The application must provide the buffers for advertisement. The memory shall reside in application RAM, and + * shall never be modified while advertising. The data shall be kept alive until either: + * - @ref BLE_GAP_EVT_ADV_SET_TERMINATED is raised. + * - @ref BLE_GAP_EVT_CONNECTED is raised with @ref ble_gap_evt_connected_t::adv_handle set to the corresponding + * advertising handle. + * - Advertising is stopped. + * - Advertising data is changed. + * To update advertising data while advertising, provide new buffers to @ref sd_ble_gap_adv_set_configure. */ +typedef struct +{ + ble_data_t adv_data; /**< Advertising data. + @note + Advertising data can only be specified for a @ref ble_gap_adv_properties_t::type + that is allowed to contain advertising data. */ + ble_data_t scan_rsp_data; /**< Scan response data. + @note + Scan response data can only be specified for a @ref ble_gap_adv_properties_t::type + that is scannable. */ +} ble_gap_adv_data_t; + + +/**@brief GAP scanning parameters. */ +typedef struct +{ + uint8_t extended : 1; /**< If 1, the scanner will accept extended advertising packets. + If set to 0, the scanner will not receive advertising packets + on secondary advertising channels, and will not be able + to receive long advertising PDUs. */ + uint8_t report_incomplete_evts : 1; /**< If 1, events of type @ref ble_gap_evt_adv_report_t may have + @ref ble_gap_adv_report_type_t::status set to + @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. + This parameter is ignored when used with @ref sd_ble_gap_connect + @note This may be used to abort receiving more packets from an extended + advertising event, and is only available for extended + scanning, see @ref sd_ble_gap_scan_start. + @note This feature is not supported by this SoftDevice. */ + uint8_t active : 1; /**< If 1, perform active scanning by sending scan requests. + This parameter is ignored when used with @ref sd_ble_gap_connect. */ + uint8_t filter_policy : 2; /**< Scanning filter policy. @sa BLE_GAP_SCAN_FILTER_POLICIES. + @note Only @ref BLE_GAP_SCAN_FP_ACCEPT_ALL and + @ref BLE_GAP_SCAN_FP_WHITELIST are valid when used with + @ref sd_ble_gap_connect */ + uint8_t scan_phys; /**< Bitfield of PHYs to scan on. If set to @ref BLE_GAP_PHY_AUTO, + scan_phys will default to @ref BLE_GAP_PHY_1MBPS. + - If @ref ble_gap_scan_params_t::extended is set to 0, the only + supported PHY is @ref BLE_GAP_PHY_1MBPS. + - When used with @ref sd_ble_gap_scan_start, + the bitfield indicates the PHYs the scanner will use for scanning + on primary advertising channels. The scanner will accept + @ref BLE_GAP_PHYS_SUPPORTED as secondary advertising channel PHYs. + - When used with @ref sd_ble_gap_connect, the bitfield indicates + the PHYs the initiator will use for scanning on primary advertising + channels. The initiator will accept connections initiated on either + of the @ref BLE_GAP_PHYS_SUPPORTED PHYs. + If scan_phys contains @ref BLE_GAP_PHY_1MBPS and/or @ref BLE_GAP_PHY_2MBPS, + the primary scan PHY is @ref BLE_GAP_PHY_1MBPS. + If scan_phys also contains @ref BLE_GAP_PHY_CODED, the primary scan + PHY will also contain @ref BLE_GAP_PHY_CODED. If the only scan PHY is + @ref BLE_GAP_PHY_CODED, the primary scan PHY is + @ref BLE_GAP_PHY_CODED only. */ + uint16_t interval; /**< Scan interval in 625 us units. @sa BLE_GAP_SCAN_INTERVALS. */ + uint16_t window; /**< Scan window in 625 us units. @sa BLE_GAP_SCAN_WINDOW. + If scan_phys contains both @ref BLE_GAP_PHY_1MBPS and + @ref BLE_GAP_PHY_CODED interval shall be larger than or + equal to twice the scan window. */ + uint16_t timeout; /**< Scan timeout in 10 ms units. @sa BLE_GAP_SCAN_TIMEOUT. */ + ble_gap_ch_mask_t channel_mask; /**< Channel mask for primary and secondary advertising channels. + At least one of the primary channels, that is channel index 37-39, must be + set to 0. + Masking away secondary channels is not supported. */ +} ble_gap_scan_params_t; + + +/**@brief Privacy. + * + * The privacy feature provides a way for the device to avoid being tracked over a period of time. + * The privacy feature, when enabled, hides the local device identity and replaces it with a private address + * that is automatically refreshed at a specified interval. + * + * If a device still wants to be recognized by other peers, it needs to share it's Identity Resolving Key (IRK). + * With this key, a device can generate a random private address that can only be recognized by peers in possession of that key, + * and devices can establish connections without revealing their real identities. + * + * Both network privacy (@ref BLE_GAP_PRIVACY_MODE_NETWORK_PRIVACY) and device privacy (@ref BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY) + * are supported. + * + * @note If the device IRK is updated, the new IRK becomes the one to be distributed in all + * bonding procedures performed after @ref sd_ble_gap_privacy_set returns. + * The IRK distributed during bonding procedure is the device IRK that is active when @ref sd_ble_gap_sec_params_reply is called. + */ +typedef struct +{ + uint8_t privacy_mode; /**< Privacy mode, see @ref BLE_GAP_PRIVACY_MODES. Default is @ref BLE_GAP_PRIVACY_MODE_OFF. */ + uint8_t private_addr_type; /**< The private address type must be either @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE or @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE. */ + uint16_t private_addr_cycle_s; /**< Private address cycle interval in seconds. Providing an address cycle value of 0 will use the default value defined by @ref BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S. */ + ble_gap_irk_t *p_device_irk; /**< When used as input, pointer to IRK structure that will be used as the default IRK. If NULL, the device default IRK will be used. + When used as output, pointer to IRK structure where the current default IRK will be written to. If NULL, this argument is ignored. + By default, the default IRK is used to generate random private resolvable addresses for the local device unless instructed otherwise. */ +} ble_gap_privacy_params_t; + + +/**@brief PHY preferences for TX and RX + * @note tx_phys and rx_phys are bit fields. Multiple bits can be set in them to indicate multiple preferred PHYs for each direction. + * @code + * p_gap_phys->tx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS; + * p_gap_phys->rx_phys = BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_2MBPS; + * @endcode + * + */ +typedef struct +{ + uint8_t tx_phys; /**< Preferred transmit PHYs, see @ref BLE_GAP_PHYS. */ + uint8_t rx_phys; /**< Preferred receive PHYs, see @ref BLE_GAP_PHYS. */ +} ble_gap_phys_t; + +/** @brief Keys that can be exchanged during a bonding procedure. */ +typedef struct +{ + uint8_t enc : 1; /**< Long Term Key and Master Identification. */ + uint8_t id : 1; /**< Identity Resolving Key and Identity Address Information. */ + uint8_t sign : 1; /**< Connection Signature Resolving Key. */ + uint8_t link : 1; /**< Derive the Link Key from the LTK. */ +} ble_gap_sec_kdist_t; + + +/**@brief GAP security parameters. */ +typedef struct +{ + uint8_t bond : 1; /**< Perform bonding. */ + uint8_t mitm : 1; /**< Enable Man In The Middle protection. */ + uint8_t lesc : 1; /**< Enable LE Secure Connection pairing. */ + uint8_t keypress : 1; /**< Enable generation of keypress notifications. */ + uint8_t io_caps : 3; /**< IO capabilities, see @ref BLE_GAP_IO_CAPS. */ + uint8_t oob : 1; /**< The OOB data flag. + - In LE legacy pairing, this flag is set if a device has out of band authentication data. + The OOB method is used if both of the devices have out of band authentication data. + - In LE Secure Connections pairing, this flag is set if a device has the peer device's out of band authentication data. + The OOB method is used if at least one device has the peer device's OOB data available. */ + uint8_t min_key_size; /**< Minimum encryption key size in octets between 7 and 16. If 0 then not applicable in this instance. */ + uint8_t max_key_size; /**< Maximum encryption key size in octets between min_key_size and 16. */ + ble_gap_sec_kdist_t kdist_own; /**< Key distribution bitmap: keys that the local device will distribute. */ + ble_gap_sec_kdist_t kdist_peer; /**< Key distribution bitmap: keys that the remote device will distribute. */ +} ble_gap_sec_params_t; + + +/**@brief GAP Encryption Information. */ +typedef struct +{ + uint8_t ltk[BLE_GAP_SEC_KEY_LEN]; /**< Long Term Key. */ + uint8_t lesc : 1; /**< Key generated using LE Secure Connections. */ + uint8_t auth : 1; /**< Authenticated Key. */ + uint8_t ltk_len : 6; /**< LTK length in octets. */ +} ble_gap_enc_info_t; + + +/**@brief GAP Master Identification. */ +typedef struct +{ + uint16_t ediv; /**< Encrypted Diversifier. */ + uint8_t rand[BLE_GAP_SEC_RAND_LEN]; /**< Random Number. */ +} ble_gap_master_id_t; + + +/**@brief GAP Signing Information. */ +typedef struct +{ + uint8_t csrk[BLE_GAP_SEC_KEY_LEN]; /**< Connection Signature Resolving Key. */ +} ble_gap_sign_info_t; + + +/**@brief GAP LE Secure Connections P-256 Public Key. */ +typedef struct +{ + uint8_t pk[BLE_GAP_LESC_P256_PK_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman P-256 Public Key. Stored in the standard SMP protocol format: {X,Y} both in little-endian. */ +} ble_gap_lesc_p256_pk_t; + + +/**@brief GAP LE Secure Connections DHKey. */ +typedef struct +{ + uint8_t key[BLE_GAP_LESC_DHKEY_LEN]; /**< LE Secure Connections Elliptic Curve Diffie-Hellman Key. Stored in little-endian. */ +} ble_gap_lesc_dhkey_t; + + +/**@brief GAP LE Secure Connections OOB data. */ +typedef struct +{ + ble_gap_addr_t addr; /**< Bluetooth address of the device. */ + uint8_t r[BLE_GAP_SEC_KEY_LEN]; /**< Random Number. */ + uint8_t c[BLE_GAP_SEC_KEY_LEN]; /**< Confirm Value. */ +} ble_gap_lesc_oob_data_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONNECTED. */ +typedef struct +{ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 + and the address is the device's identity address. */ + uint8_t role; /**< BLE role for this connection, see @ref BLE_GAP_ROLES */ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ + uint8_t adv_handle; /**< Advertising handle in which advertising has ended. + This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */ + ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated + advertising set. The advertising buffers provided in + @ref sd_ble_gap_adv_set_configure are now released. + This variable is only set if role is set to @ref BLE_GAP_ROLE_PERIPH. */ +} ble_gap_evt_connected_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_DISCONNECTED. */ +typedef struct +{ + uint8_t reason; /**< HCI error code, see @ref BLE_HCI_STATUS_CODES. */ +} ble_gap_evt_disconnected_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE. */ +typedef struct +{ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ +} ble_gap_evt_conn_param_update_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_PHY_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_phys_t peer_preferred_phys; /**< The PHYs the peer prefers to use. */ +} ble_gap_evt_phy_update_request_t; + +/**@brief Event Structure for @ref BLE_GAP_EVT_PHY_UPDATE. */ +typedef struct +{ + uint8_t status; /**< Status of the procedure, see @ref BLE_HCI_STATUS_CODES.*/ + uint8_t tx_phy; /**< TX PHY for this connection, see @ref BLE_GAP_PHYS. */ + uint8_t rx_phy; /**< RX PHY for this connection, see @ref BLE_GAP_PHYS. */ +} ble_gap_evt_phy_update_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. */ +typedef struct +{ + ble_gap_sec_params_t peer_params; /**< Initiator Security Parameters. */ +} ble_gap_evt_sec_params_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_INFO_REQUEST. */ +typedef struct +{ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. */ + ble_gap_master_id_t master_id; /**< Master Identification for LTK lookup. */ + uint8_t enc_info : 1; /**< If 1, Encryption Information required. */ + uint8_t id_info : 1; /**< If 1, Identity Information required. */ + uint8_t sign_info : 1; /**< If 1, Signing Information required. */ +} ble_gap_evt_sec_info_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_PASSKEY_DISPLAY. */ +typedef struct +{ + uint8_t passkey[BLE_GAP_PASSKEY_LEN]; /**< 6-digit passkey in ASCII ('0'-'9' digits only). */ + uint8_t match_request : 1; /**< If 1 requires the application to report the match using @ref sd_ble_gap_auth_key_reply + with either @ref BLE_GAP_AUTH_KEY_TYPE_NONE if there is no match or + @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY if there is a match. */ +} ble_gap_evt_passkey_display_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_KEY_PRESSED. */ +typedef struct +{ + uint8_t kp_not; /**< Keypress notification type, see @ref BLE_GAP_KP_NOT_TYPES. */ +} ble_gap_evt_key_pressed_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_KEY_REQUEST. */ +typedef struct +{ + uint8_t key_type; /**< See @ref BLE_GAP_AUTH_KEY_TYPES. */ +} ble_gap_evt_auth_key_request_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST. */ +typedef struct +{ + ble_gap_lesc_p256_pk_t *p_pk_peer; /**< LE Secure Connections remote P-256 Public Key. This will point to the application-supplied memory + inside the keyset during the call to @ref sd_ble_gap_sec_params_reply. */ + uint8_t oobd_req :1; /**< LESC OOB data required. A call to @ref sd_ble_gap_lesc_oob_data_set is required to complete the procedure. */ +} ble_gap_evt_lesc_dhkey_request_t; + + +/**@brief Security levels supported. + * @note See Bluetooth Specification Version 4.2 Volume 3, Part C, Chapter 10, Section 10.2.1. +*/ +typedef struct +{ + uint8_t lv1 : 1; /**< If 1: Level 1 is supported. */ + uint8_t lv2 : 1; /**< If 1: Level 2 is supported. */ + uint8_t lv3 : 1; /**< If 1: Level 3 is supported. */ + uint8_t lv4 : 1; /**< If 1: Level 4 is supported. */ +} ble_gap_sec_levels_t; + + +/**@brief Encryption Key. */ +typedef struct +{ + ble_gap_enc_info_t enc_info; /**< Encryption Information. */ + ble_gap_master_id_t master_id; /**< Master Identification. */ +} ble_gap_enc_key_t; + + +/**@brief Identity Key. */ +typedef struct +{ + ble_gap_irk_t id_info; /**< Identity Resolving Key. */ + ble_gap_addr_t id_addr_info; /**< Identity Address. */ +} ble_gap_id_key_t; + + +/**@brief Security Keys. */ +typedef struct +{ + ble_gap_enc_key_t *p_enc_key; /**< Encryption Key, or NULL. */ + ble_gap_id_key_t *p_id_key; /**< Identity Key, or NULL. */ + ble_gap_sign_info_t *p_sign_key; /**< Signing Key, or NULL. */ + ble_gap_lesc_p256_pk_t *p_pk; /**< LE Secure Connections P-256 Public Key. When in debug mode the application must use the value defined + in the Core Bluetooth Specification v4.2 Vol.3, Part H, Section 2.3.5.6.1 */ +} ble_gap_sec_keys_t; + + +/**@brief Security key set for both local and peer keys. */ +typedef struct +{ + ble_gap_sec_keys_t keys_own; /**< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. */ + ble_gap_sec_keys_t keys_peer; /**< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. */ +} ble_gap_sec_keyset_t; + + +/**@brief Data Length Update Procedure parameters. */ +typedef struct +{ + uint16_t max_tx_octets; /**< Maximum number of payload octets that a Controller supports for transmission of a single Link Layer Data Channel PDU. */ + uint16_t max_rx_octets; /**< Maximum number of payload octets that a Controller supports for reception of a single Link Layer Data Channel PDU. */ + uint16_t max_tx_time_us; /**< Maximum time, in microseconds, that a Controller supports for transmission of a single Link Layer Data Channel PDU. */ + uint16_t max_rx_time_us; /**< Maximum time, in microseconds, that a Controller supports for reception of a single Link Layer Data Channel PDU. */ +} ble_gap_data_length_params_t; + + +/**@brief Data Length Update Procedure local limitation. */ +typedef struct +{ + uint16_t tx_payload_limited_octets; /**< If > 0, the requested TX packet length is too long by this many octets. */ + uint16_t rx_payload_limited_octets; /**< If > 0, the requested RX packet length is too long by this many octets. */ + uint16_t tx_rx_time_limited_us; /**< If > 0, the requested combination of TX and RX packet lengths is too long by this many microseconds. */ +} ble_gap_data_length_limitation_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_AUTH_STATUS. */ +typedef struct +{ + uint8_t auth_status; /**< Authentication status, see @ref BLE_GAP_SEC_STATUS. */ + uint8_t error_src : 2; /**< On error, source that caused the failure, see @ref BLE_GAP_SEC_STATUS_SOURCES. */ + uint8_t bonded : 1; /**< Procedure resulted in a bond. */ + uint8_t lesc : 1; /**< Procedure resulted in a LE Secure Connection. */ + ble_gap_sec_levels_t sm1_levels; /**< Levels supported in Security Mode 1. */ + ble_gap_sec_levels_t sm2_levels; /**< Levels supported in Security Mode 2. */ + ble_gap_sec_kdist_t kdist_own; /**< Bitmap stating which keys were exchanged (distributed) by the local device. If bonding with LE Secure Connections, the enc bit will be always set. */ + ble_gap_sec_kdist_t kdist_peer; /**< Bitmap stating which keys were exchanged (distributed) by the remote device. If bonding with LE Secure Connections, the enc bit will never be set. */ +} ble_gap_evt_auth_status_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_SEC_UPDATE. */ +typedef struct +{ + ble_gap_conn_sec_t conn_sec; /**< Connection security level. */ +} ble_gap_evt_conn_sec_update_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Source of timeout event, see @ref BLE_GAP_TIMEOUT_SOURCES. */ + union + { + ble_data_t adv_report_buffer; /**< If source is set to @ref BLE_GAP_TIMEOUT_SRC_SCAN, the released + scan buffer is contained in this field. */ + } params; /**< Event Parameters. */ +} ble_gap_evt_timeout_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */ +typedef struct +{ + int8_t rssi; /**< Received Signal Strength Indication in dBm. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + uint8_t ch_index; /**< Data Channel Index on which the Signal Strength is measured (0-36). */ +} ble_gap_evt_rssi_changed_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED */ +typedef struct +{ + uint8_t reason; /**< Reason for why the advertising set terminated. See + @ref BLE_GAP_EVT_ADV_SET_TERMINATED_REASON. */ + uint8_t adv_handle; /**< Advertising handle in which advertising has ended. */ + uint8_t num_completed_adv_events; /**< If @ref ble_gap_adv_params_t::max_adv_evts was not set to 0, + this field indicates the number of completed advertising events. */ + ble_gap_adv_data_t adv_data; /**< Advertising buffers corresponding to the terminated + advertising set. The advertising buffers provided in + @ref sd_ble_gap_adv_set_configure are now released. */ +} ble_gap_evt_adv_set_terminated_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT. + * + * @note If @ref ble_gap_adv_report_type_t::status is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, + * not all fields in the advertising report may be available. + * + * @note When ble_gap_adv_report_type_t::status is not set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, + * scanning will be paused. To continue scanning, call @ref sd_ble_gap_scan_start. + */ +typedef struct +{ + ble_gap_adv_report_type_t type; /**< Advertising report type. See @ref ble_gap_adv_report_type_t. */ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr is resolved: + @ref ble_gap_addr_t::addr_id_peer is set to 1 and the address is the + peer's identity address. */ + ble_gap_addr_t direct_addr; /**< Contains the target address of the advertising event if + @ref ble_gap_adv_report_type_t::directed is set to 1. If the + SoftDevice was able to resolve the address, + @ref ble_gap_addr_t::addr_id_peer is set to 1 and the direct_addr + contains the local identity address. If the target address of the + advertising event is @ref BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, + and the SoftDevice was unable to resolve it, the application may try + to resolve this address to find out if the advertising event was + directed to us. */ + uint8_t primary_phy; /**< Indicates the PHY on which the primary advertising packet was received. + See @ref BLE_GAP_PHYS. */ + uint8_t secondary_phy; /**< Indicates the PHY on which the secondary advertising packet was received. + See @ref BLE_GAP_PHYS. This field is set to @ref BLE_GAP_PHY_NOT_SET if no packets + were received on a secondary advertising channel. */ + int8_t tx_power; /**< TX Power reported by the advertiser in the last packet header received. + This field is set to @ref BLE_GAP_POWER_LEVEL_INVALID if the + last received packet did not contain the Tx Power field. + @note TX Power is only included in extended advertising packets. */ + int8_t rssi; /**< Received Signal Strength Indication in dBm of the last packet received. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + uint8_t ch_index; /**< Channel Index on which the last advertising packet is received (0-39). */ + uint8_t set_id; /**< Set ID of the received advertising data. Set ID is not present + if set to @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */ + uint16_t data_id:12; /**< The advertising data ID of the received advertising data. Data ID + is not present if @ref ble_gap_evt_adv_report_t::set_id is set to + @ref BLE_GAP_ADV_REPORT_SET_ID_NOT_AVAILABLE. */ + ble_data_t data; /**< Received advertising or scan response data. If + @ref ble_gap_adv_report_type_t::status is not set to + @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the data buffer provided + in @ref sd_ble_gap_scan_start is now released. */ + ble_gap_aux_pointer_t aux_pointer; /**< The offset and PHY of the next advertising packet in this extended advertising + event. @note This field is only set if @ref ble_gap_adv_report_type_t::status + is set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. */ +} ble_gap_evt_adv_report_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SEC_REQUEST. */ +typedef struct +{ + uint8_t bond : 1; /**< Perform bonding. */ + uint8_t mitm : 1; /**< Man In The Middle protection requested. */ + uint8_t lesc : 1; /**< LE Secure Connections requested. */ + uint8_t keypress : 1; /**< Generation of keypress notifications requested. */ +} ble_gap_evt_sec_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_conn_params_t conn_params; /**< GAP Connection Parameters. */ +} ble_gap_evt_conn_param_update_request_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_SCAN_REQ_REPORT. */ +typedef struct +{ + uint8_t adv_handle; /**< Advertising handle for the advertising set which received the Scan Request */ + int8_t rssi; /**< Received Signal Strength Indication in dBm. + @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */ + ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1 + and the address is the device's identity address. */ +} ble_gap_evt_scan_req_report_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST. */ +typedef struct +{ + ble_gap_data_length_params_t peer_params; /**< Peer data length parameters. */ +} ble_gap_evt_data_length_update_request_t; + +/**@brief Event structure for @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE. + * + * @note This event may also be raised after a PHY Update procedure. + */ +typedef struct +{ + ble_gap_data_length_params_t effective_params; /**< The effective data length parameters. */ +} ble_gap_evt_data_length_update_t; + + +/**@brief Event structure for @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT. */ +typedef struct +{ + int8_t channel_energy[BLE_GAP_CHANNEL_COUNT]; /**< The measured energy on the Bluetooth Low Energy + channels, in dBm, indexed by Channel Index. + If no measurement is available for the given channel, channel_energy is set to + @ref BLE_GAP_POWER_LEVEL_INVALID. */ +} ble_gap_evt_qos_channel_survey_report_t; + +/**@brief GAP event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which event occurred. */ + union /**< union alternative identified by evt_id in enclosing struct. */ + { + ble_gap_evt_connected_t connected; /**< Connected Event Parameters. */ + ble_gap_evt_disconnected_t disconnected; /**< Disconnected Event Parameters. */ + ble_gap_evt_conn_param_update_t conn_param_update; /**< Connection Parameter Update Parameters. */ + ble_gap_evt_sec_params_request_t sec_params_request; /**< Security Parameters Request Event Parameters. */ + ble_gap_evt_sec_info_request_t sec_info_request; /**< Security Information Request Event Parameters. */ + ble_gap_evt_passkey_display_t passkey_display; /**< Passkey Display Event Parameters. */ + ble_gap_evt_key_pressed_t key_pressed; /**< Key Pressed Event Parameters. */ + ble_gap_evt_auth_key_request_t auth_key_request; /**< Authentication Key Request Event Parameters. */ + ble_gap_evt_lesc_dhkey_request_t lesc_dhkey_request; /**< LE Secure Connections DHKey calculation request. */ + ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */ + ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */ + ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */ + ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event Parameters. */ + ble_gap_evt_adv_report_t adv_report; /**< Advertising Report Event Parameters. */ + ble_gap_evt_adv_set_terminated_t adv_set_terminated; /**< Advertising Set Terminated Event Parameters. */ + ble_gap_evt_sec_request_t sec_request; /**< Security Request Event Parameters. */ + ble_gap_evt_conn_param_update_request_t conn_param_update_request; /**< Connection Parameter Update Parameters. */ + ble_gap_evt_scan_req_report_t scan_req_report; /**< Scan Request Report Parameters. */ + ble_gap_evt_phy_update_request_t phy_update_request; /**< PHY Update Request Event Parameters. */ + ble_gap_evt_phy_update_t phy_update; /**< PHY Update Parameters. */ + ble_gap_evt_data_length_update_request_t data_length_update_request; /**< Data Length Update Request Event Parameters. */ + ble_gap_evt_data_length_update_t data_length_update; /**< Data Length Update Event Parameters. */ + ble_gap_evt_qos_channel_survey_report_t qos_channel_survey_report; /**< Quality of Service (QoS) Channel Survey Report Parameters. */ + } params; /**< Event Parameters. */ +} ble_gap_evt_t; + + +/** + * @brief BLE GAP connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_CONN_COUNT The connection count for the connection configurations is zero. + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - The sum of conn_count for all connection configurations combined exceeds UINT8_MAX. + * - The event length is smaller than @ref BLE_GAP_EVENT_LENGTH_MIN. + */ +typedef struct +{ + uint8_t conn_count; /**< The number of concurrent connections the application can create with this configuration. + The default and minimum value is @ref BLE_GAP_CONN_COUNT_DEFAULT. */ + uint16_t event_length; /**< The time set aside for this connection on every connection interval in 1.25 ms units. + The default value is @ref BLE_GAP_EVENT_LENGTH_DEFAULT, the minimum value is @ref BLE_GAP_EVENT_LENGTH_MIN. + The event length and the connection interval are the primary parameters + for setting the throughput of a connection. + See the SoftDevice Specification for details on throughput. */ +} ble_gap_conn_cfg_t; + + +/** + * @brief Configuration of maximum concurrent connections in the different connected roles, set with + * @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_CONN_COUNT The sum of periph_role_count and central_role_count is too + * large. The maximum supported sum of concurrent connections is + * @ref BLE_GAP_ROLE_COUNT_COMBINED_MAX. + * @retval ::NRF_ERROR_INVALID_PARAM central_sec_count is larger than central_role_count. + * @retval ::NRF_ERROR_RESOURCES The adv_set_count is too large. The maximum + * supported advertising handles is + * @ref BLE_GAP_ADV_SET_COUNT_MAX. + */ +typedef struct +{ + uint8_t adv_set_count; /**< Maximum number of advertising sets. Default value is @ref BLE_GAP_ADV_SET_COUNT_DEFAULT. */ + uint8_t periph_role_count; /**< Maximum number of connections concurrently acting as a peripheral. Default value is @ref BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT. */ + uint8_t central_role_count; /**< Maximum number of connections concurrently acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_DEFAULT. */ + uint8_t central_sec_count; /**< Number of SMP instances shared between all connections acting as a central. Default value is @ref BLE_GAP_ROLE_COUNT_CENTRAL_SEC_DEFAULT. */ + uint8_t qos_channel_survey_role_available:1; /**< If set, the Quality of Service (QoS) channel survey module is available to the + application using @ref sd_ble_gap_qos_channel_survey_start. */ +} ble_gap_cfg_role_count_t; + + +/** + * @brief Device name and its properties, set with @ref sd_ble_cfg_set. + * + * @note If the device name is not configured, the default device name will be + * @ref BLE_GAP_DEVNAME_DEFAULT, the maximum device name length will be + * @ref BLE_GAP_DEVNAME_DEFAULT_LEN, vloc will be set to @ref BLE_GATTS_VLOC_STACK and the device name + * will have no write access. + * + * @note If @ref max_len is more than @ref BLE_GAP_DEVNAME_DEFAULT_LEN and vloc is set to @ref BLE_GATTS_VLOC_STACK, + * the attribute table size must be increased to have room for the longer device name (see + * @ref sd_ble_cfg_set and @ref ble_gatts_cfg_attr_tab_size_t). + * + * @note If vloc is @ref BLE_GATTS_VLOC_STACK : + * - p_value must point to non-volatile memory (flash) or be NULL. + * - If p_value is NULL, the device name will initially be empty. + * + * @note If vloc is @ref BLE_GATTS_VLOC_USER : + * - p_value cannot be NULL. + * - If the device name is writable, p_value must point to volatile memory (RAM). + * + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - Invalid device name location (vloc). + * - Invalid device name security mode. + * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true: + * - The device name length is invalid (must be between 0 and @ref BLE_GAP_DEVNAME_MAX_LEN). + * - The device name length is too long for the given Attribute Table. + * @retval ::NRF_ERROR_NOT_SUPPORTED Device name security mode is not supported. + */ +typedef struct +{ + ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ + uint8_t vloc:2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/ + uint8_t *p_value; /**< Pointer to where the value (device name) is stored or will be stored. */ + uint16_t current_len; /**< Current length in bytes of the memory pointed to by p_value.*/ + uint16_t max_len; /**< Maximum length in bytes of the memory pointed to by p_value.*/ +} ble_gap_cfg_device_name_t; + + +/**@brief Peripheral Preferred Connection Parameters include configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t include_cfg; /**< Inclusion configuration of the Peripheral Preferred Connection Parameters characteristic. + See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_PPCP_INCL_CONFIG_DEFAULT. */ +} ble_gap_cfg_ppcp_incl_cfg_t; + + +/**@brief Central Address Resolution include configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t include_cfg; /**< Inclusion configuration of the Central Address Resolution characteristic. + See @ref BLE_GAP_CHAR_INCL_CONFIG. Default is @ref BLE_GAP_CAR_INCL_CONFIG_DEFAULT. */ +} ble_gap_cfg_car_incl_cfg_t; + + +/**@brief Configuration structure for GAP configurations. */ +typedef union +{ + ble_gap_cfg_role_count_t role_count_cfg; /**< Role count configuration, cfg_id is @ref BLE_GAP_CFG_ROLE_COUNT. */ + ble_gap_cfg_device_name_t device_name_cfg; /**< Device name configuration, cfg_id is @ref BLE_GAP_CFG_DEVICE_NAME. */ + ble_gap_cfg_ppcp_incl_cfg_t ppcp_include_cfg; /**< Peripheral Preferred Connection Parameters characteristic include + configuration, cfg_id is @ref BLE_GAP_CFG_PPCP_INCL_CONFIG. */ + ble_gap_cfg_car_incl_cfg_t car_include_cfg; /**< Central Address Resolution characteristic include configuration, + cfg_id is @ref BLE_GAP_CFG_CAR_INCL_CONFIG. */ +} ble_gap_cfg_t; + + +/**@brief Channel Map option. + * + * @details Used with @ref sd_ble_opt_get to get the current channel map + * or @ref sd_ble_opt_set to set a new channel map. When setting the + * channel map, it applies to all current and future connections. When getting the + * current channel map, it applies to a single connection and the connection handle + * must be supplied. + * + * @note Setting the channel map may take some time, depending on connection parameters. + * The time taken may be different for each connection and the get operation will + * return the previous channel map until the new one has taken effect. + * + * @note After setting the channel map, by spec it can not be set again until at least 1 s has passed. + * See Bluetooth Specification Version 4.1 Volume 2, Part E, Section 7.3.46. + * + * @retval ::NRF_SUCCESS Get or set successful. + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - Less then two bits in @ref ch_map are set. + * - Bits for primary advertising channels (37-39) are set. + * @retval ::NRF_ERROR_BUSY Channel map was set again before enough time had passed. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied for get. + * + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle (only applicable for get) */ + uint8_t ch_map[5]; /**< Channel Map (37-bit). */ +} ble_gap_opt_ch_map_t; + + +/**@brief Local connection latency option. + * + * @details Local connection latency is a feature which enables the slave to improve + * current consumption by ignoring the slave latency set by the peer. The + * local connection latency can only be set to a multiple of the slave latency, + * and cannot be longer than half of the supervision timeout. + * + * @details Used with @ref sd_ble_opt_set to set the local connection latency. The + * @ref sd_ble_opt_get is not supported for this option, but the actual + * local connection latency (unless set to NULL) is set as a return parameter + * when setting the option. + * + * @note The latency set will be truncated down to the closest slave latency event + * multiple, or the nearest multiple before half of the supervision timeout. + * + * @note The local connection latency is disabled by default, and needs to be enabled for new + * connections and whenever the connection is updated. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint16_t requested_latency; /**< Requested local connection latency. */ + uint16_t * p_actual_latency; /**< Pointer to storage for the actual local connection latency (can be set to NULL to skip return value). */ +} ble_gap_opt_local_conn_latency_t; + +/**@brief Disable slave latency + * + * @details Used with @ref sd_ble_opt_set to temporarily disable slave latency of a peripheral connection + * (see @ref ble_gap_conn_params_t::slave_latency). And to re-enable it again. When disabled, the + * peripheral will ignore the slave_latency set by the central. + * + * @note Shall only be called on peripheral links. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_NOT_SUPPORTED Get is not supported. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint8_t disable : 1; /**< Set to 1 to disable slave latency. Set to 0 enable it again.*/ +} ble_gap_opt_slave_latency_disable_t; + +/**@brief Passkey Option. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC} + * @endmscs + * + * @details Structure containing the passkey to be used during pairing. This can be used with @ref + * sd_ble_opt_set to make the SoftDevice use a preprogrammed passkey for authentication + * instead of generating a random one. + * + * @note Repeated pairing attempts using the same preprogrammed passkey makes pairing vulnerable to MITM attacks. + * + * @note @ref sd_ble_opt_get is not supported for this option. + * + */ +typedef struct +{ + uint8_t const * p_passkey; /**< Pointer to 6-digit ASCII string (digit 0..9 only, no NULL termination) passkey to be used during pairing. If this is NULL, the SoftDevice will generate a random passkey if required.*/ +} ble_gap_opt_passkey_t; + + +/**@brief Compatibility mode 1 option. + * + * @details This can be used with @ref sd_ble_opt_set to enable and disable + * compatibility mode 1. Compatibility mode 1 is disabled by default. + * + * @note Compatibility mode 1 enables interoperability with devices that do not support a value of + * 0 for the WinOffset parameter in the Link Layer CONNECT_IND packet. This applies to a + * limited set of legacy peripheral devices from another vendor. Enabling this compatibility + * mode will only have an effect if the local device will act as a central device and + * initiate a connection to a peripheral device. In that case it may lead to the connection + * creation taking up to one connection interval longer to complete for all connections. + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_INVALID_STATE When connection creation is ongoing while mode 1 is set. + */ +typedef struct +{ + uint8_t enable : 1; /**< Enable compatibility mode 1.*/ +} ble_gap_opt_compat_mode_1_t; + + +/**@brief Authenticated payload timeout option. + * + * @details This can be used with @ref sd_ble_opt_set to change the Authenticated payload timeout to a value other + * than the default of @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT_MAX. + * + * @note The authenticated payload timeout event ::BLE_GAP_TIMEOUT_SRC_AUTH_PAYLOAD will be generated + * if auth_payload_timeout time has elapsed without receiving a packet with a valid MIC on an encrypted + * link. + * + * @note The LE ping procedure will be initiated before the timer expires to give the peer a chance + * to reset the timer. In addition the stack will try to prioritize running of LE ping over other + * activities to increase chances of finishing LE ping before timer expires. To avoid side-effects + * on other activities, it is recommended to use high timeout values. + * Recommended timeout > 2*(connInterval * (6 + connSlaveLatency)). + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. auth_payload_timeout was outside of allowed range. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter. + */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle */ + uint16_t auth_payload_timeout; /**< Requested timeout in 10 ms unit, see @ref BLE_GAP_AUTH_PAYLOAD_TIMEOUT. */ +} ble_gap_opt_auth_payload_timeout_t; + +/**@brief Option structure for GAP options. */ +typedef union +{ + ble_gap_opt_ch_map_t ch_map; /**< Parameters for the Channel Map option. */ + ble_gap_opt_local_conn_latency_t local_conn_latency; /**< Parameters for the Local connection latency option */ + ble_gap_opt_passkey_t passkey; /**< Parameters for the Passkey option.*/ + ble_gap_opt_compat_mode_1_t compat_mode_1; /**< Parameters for the compatibility mode 1 option.*/ + ble_gap_opt_auth_payload_timeout_t auth_payload_timeout; /**< Parameters for the authenticated payload timeout option.*/ + ble_gap_opt_slave_latency_disable_t slave_latency_disable; /**< Parameters for the Disable slave latency option */ +} ble_gap_opt_t; + +/**@brief Connection event triggering parameters. */ +typedef struct +{ + uint8_t ppi_ch_id; /**< PPI channel to use. This channel should be regarded as reserved until + connection event PPI task triggering is stopped. + The PPI channel ID can not be one of the PPI channels reserved by + the SoftDevice. See @ref NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK. */ + uint32_t task_endpoint; /**< Task Endpoint to trigger. */ + uint16_t conn_evt_counter_start; /**< The connection event on which the task triggering should start. */ + uint16_t period_in_events; /**< Trigger period. Valid range is [1, 32767]. + If the device is in slave role and slave latency is enabled, + this parameter should be set to a multiple of (slave latency + 1) + to ensure low power operation. */ +} ble_gap_conn_event_trigger_t; +/**@} */ + +/**@addtogroup BLE_GAP_FUNCTIONS Functions + * @{ */ + +/**@brief Set the local Bluetooth identity address. + * + * The local Bluetooth identity address is the address that identifies this device to other peers. + * The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC. + * + * @note The identity address cannot be changed while advertising, scanning or creating a connection. + * + * @note This address will be distributed to the peer during bonding. + * If the address changes, the address stored in the peer device will not be valid and the ability to + * reconnect using the old address will be lost. + * + * @note By default the SoftDevice will set an address of type @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC upon being + * enabled. The address is a random number populated during the IC manufacturing process and remains unchanged + * for the lifetime of each IC. + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @endmscs + * + * @param[in] p_addr Pointer to address structure. + * + * @retval ::NRF_SUCCESS Address successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_STATE The identity address cannot be changed while advertising, + * scanning or creating a connection. + */ +SVCALL(SD_BLE_GAP_ADDR_SET, uint32_t, sd_ble_gap_addr_set(ble_gap_addr_t const *p_addr)); + + +/**@brief Get local Bluetooth identity address. + * + * @note This will always return the identity address irrespective of the privacy settings, + * i.e. the address type will always be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC. + * + * @param[out] p_addr Pointer to address structure to be filled in. + * + * @retval ::NRF_SUCCESS Address successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + */ +SVCALL(SD_BLE_GAP_ADDR_GET, uint32_t, sd_ble_gap_addr_get(ble_gap_addr_t *p_addr)); + + +/**@brief Get the Bluetooth device address used by the advertiser. + * + * @note This function will return the local Bluetooth address used in advertising PDUs. When + * using privacy, the SoftDevice will generate a new private address every + * @ref ble_gap_privacy_params_t::private_addr_cycle_s configured using + * @ref sd_ble_gap_privacy_set. Hence depending on when the application calls this API, the + * address returned may not be the latest address that is used in the advertising PDUs. + * + * @param[in] adv_handle The advertising handle to get the address from. + * @param[out] p_addr Pointer to address structure to be filled in. + * + * @retval ::NRF_SUCCESS Address successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. + * @retval ::NRF_ERROR_INVALID_STATE The advertising set is currently not advertising. + */ +SVCALL(SD_BLE_GAP_ADV_ADDR_GET, uint32_t, sd_ble_gap_adv_addr_get(uint8_t adv_handle, ble_gap_addr_t *p_addr)); + + +/**@brief Set the active whitelist in the SoftDevice. + * + * @note Only one whitelist can be used at a time and the whitelist is shared between the BLE roles. + * The whitelist cannot be set if a BLE role is using the whitelist. + * + * @note If an address is resolved using the information in the device identity list, then the whitelist + * filter policy applies to the peer identity address and not the resolvable address sent on air. + * + * @mscs + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC} + * @endmscs + * + * @param[in] pp_wl_addrs Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared. + * @param[in] len Length of the whitelist, maximum @ref BLE_GAP_WHITELIST_ADDR_MAX_COUNT. + * + * @retval ::NRF_SUCCESS The whitelist is successfully set/cleared. + * @retval ::NRF_ERROR_INVALID_ADDR The whitelist (or one of its entries) provided is invalid. + * @retval ::BLE_ERROR_GAP_WHITELIST_IN_USE The whitelist is in use by a BLE role and cannot be set or cleared. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_DATA_SIZE The given whitelist size is invalid (zero or too large); this can only return when + * pp_wl_addrs is not NULL. + */ +SVCALL(SD_BLE_GAP_WHITELIST_SET, uint32_t, sd_ble_gap_whitelist_set(ble_gap_addr_t const * const * pp_wl_addrs, uint8_t len)); + + +/**@brief Set device identity list. + * + * @note Only one device identity list can be used at a time and the list is shared between the BLE roles. + * The device identity list cannot be set if a BLE role is using the list. + * + * @param[in] pp_id_keys Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared. + * @param[in] pp_local_irks Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index. + * To fill in the list with the currently set device IRK for all peers, set to NULL. + * @param[in] len Length of the device identity list, maximum @ref BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT. + * + * @mscs + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_PRIVATE_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS The device identity list successfully set/cleared. + * @retval ::NRF_ERROR_INVALID_ADDR The device identity list (or one of its entries) provided is invalid. + * This code may be returned if the local IRK list also has an invalid entry. + * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE The device identity list is in use and cannot be set or cleared. + * @retval ::BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE The device identity list contains multiple entries with the same identity address. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_DATA_SIZE The given device identity list size invalid (zero or too large); this can + * only return when pp_id_keys is not NULL. + */ +SVCALL(SD_BLE_GAP_DEVICE_IDENTITIES_SET, uint32_t, sd_ble_gap_device_identities_set(ble_gap_id_key_t const * const * pp_id_keys, ble_gap_irk_t const * const * pp_local_irks, uint8_t len)); + + +/**@brief Set privacy settings. + * + * @note Privacy settings cannot be changed while advertising, scanning or creating a connection. + * + * @param[in] p_privacy_params Privacy settings. + * + * @mscs + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_SCAN_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Set successfully. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid address type is supplied. + * @retval ::NRF_ERROR_INVALID_ADDR The pointer to privacy settings is NULL or invalid. + * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. + * @retval ::NRF_ERROR_INVALID_PARAM Out of range parameters are provided. + * @retval ::NRF_ERROR_NOT_SUPPORTED The SoftDevice does not support privacy if the Central Address Resolution + characteristic is not configured to be included and the SoftDevice is configured + to support central roles. + See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + * @retval ::NRF_ERROR_INVALID_STATE Privacy settings cannot be changed while advertising, scanning + * or creating a connection. + */ +SVCALL(SD_BLE_GAP_PRIVACY_SET, uint32_t, sd_ble_gap_privacy_set(ble_gap_privacy_params_t const *p_privacy_params)); + + +/**@brief Get privacy settings. + * + * @note ::ble_gap_privacy_params_t::p_device_irk must be initialized to NULL or a valid address before this function is called. + * If it is initialized to a valid address, the address pointed to will contain the current device IRK on return. + * + * @param[in,out] p_privacy_params Privacy settings. + * + * @retval ::NRF_SUCCESS Privacy settings read. + * @retval ::NRF_ERROR_INVALID_ADDR The pointer given for returning the privacy settings may be NULL or invalid. + * Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. + */ +SVCALL(SD_BLE_GAP_PRIVACY_GET, uint32_t, sd_ble_gap_privacy_get(ble_gap_privacy_params_t *p_privacy_params)); + + +/**@brief Configure an advertising set. Set, clear or update advertising and scan response data. + * + * @note The format of the advertising data will be checked by this call to ensure interoperability. + * Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and + * duplicating the local name in the advertising data and scan response data. + * + * @note In order to update advertising data while advertising, new advertising buffers must be provided. + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in,out] p_adv_handle Provide a pointer to a handle containing @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure + * a new advertising set. On success, a new handle is then returned through the pointer. + * Provide a pointer to an existing advertising handle to configure an existing advertising set. + * @param[in] p_adv_data Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t. + * @param[in] p_adv_params Advertising parameters. When this function is used to update advertising data while advertising, + * this parameter must be NULL. See @ref ble_gap_adv_params_t. + * + * @retval ::NRF_SUCCESS Advertising set successfully configured. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: + * - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t. + * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. + * - Use of whitelist requested but whitelist has not been set, + * see @ref sd_ble_gap_whitelist_set. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR ble_gap_adv_params_t::p_peer_addr is invalid. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - It is invalid to provide non-NULL advertising set parameters while advertising. + * - It is invalid to provide the same data buffers while advertising. To update + * advertising data, provide new advertising buffers. + * @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to + * configure a new advertising handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied. + * @retval ::NRF_ERROR_INVALID_DATA Invalid data type(s) supplied. Check the advertising data format specification + * given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11. + * @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data length or advertising parameter configuration. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to configure a new advertising handle. Update an + * existing advertising handle instead. + * @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied. + */ +SVCALL(SD_BLE_GAP_ADV_SET_CONFIGURE, uint32_t, sd_ble_gap_adv_set_configure(uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params)); + + +/**@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). + * + * @note Only one advertiser may be active at any time. + * + * @note If privacy is enabled, the advertiser's private address will be refreshed when this function is called. + * See @ref sd_ble_gap_privacy_set(). + * + * @events + * @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.} + * @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.} + * @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] adv_handle Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure. + * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or + * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable + * advertising, this is ignored. + * + * @retval ::NRF_SUCCESS The BLE stack has started advertising. + * @retval ::NRF_ERROR_INVALID_STATE adv_handle is not configured or already advertising. + * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration + * tag has been reached; connectable advertiser cannot be started. + * To increase the number of available connections, + * use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure. + * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: + * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. + * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. + * @retval ::NRF_ERROR_RESOURCES Either: + * - adv_handle is configured with connectable advertising, but the event_length parameter + * associated with conn_cfg_tag is too small to be able to establish a connection on + * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length. + * - Not enough BLE role slots available. + Stop one or more currently active roles (Central, Peripheral, Broadcaster or Observer) and try again. + * - p_adv_params is configured with connectable advertising, but the event_length parameter + * associated with conn_cfg_tag is too small to be able to establish a connection on + * the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length. + */ +SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag)); + + +/**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). + * + * @mscs + * @mmsc{@ref BLE_GAP_ADV_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] adv_handle The advertising handle that should stop advertising. + * + * @retval ::NRF_SUCCESS The BLE stack has stopped advertising. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle. + * @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising. + */ +SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle)); + + + +/**@brief Update connection parameters. + * + * @details In the central role this will initiate a Link Layer connection parameter update procedure, + * otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for + * the central to perform the procedure. In both cases, and regardless of success or failure, the application + * will be informed of the result with a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE event. + * + * @details This function can be used as a central both to reply to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested. + * + * @events + * @event{@ref BLE_GAP_EVT_CONN_PARAM_UPDATE, Result of the connection parameter update procedure.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CPU_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CPU_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CPU_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_conn_params Pointer to desired connection parameters. If NULL is provided on a peripheral role, + * the parameters in the PPCP characteristic of the GAP service will be used instead. + * If NULL is provided on a central role and in response to a @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected + * + * @retval ::NRF_SUCCESS The Connection Update procedure has been started successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, check parameter limits and constraints. + * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established. + * @retval ::NRF_ERROR_BUSY Procedure already in progress, wait for pending procedures to complete and retry. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GAP_CONN_PARAM_UPDATE, uint32_t, sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params)); + + +/**@brief Disconnect (GAP Link Termination). + * + * @details This call initiates the disconnection procedure, and its completion will be communicated to the application + * with a @ref BLE_GAP_EVT_DISCONNECTED event. + * + * @events + * @event{@ref BLE_GAP_EVT_DISCONNECTED, Generated when disconnection procedure is complete.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CONN_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] hci_status_code HCI status code, see @ref BLE_HCI_STATUS_CODES (accepted values are @ref BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and @ref BLE_HCI_CONN_INTERVAL_UNACCEPTABLE). + * + * @retval ::NRF_SUCCESS The disconnection procedure has been started successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE Disconnection in progress or link has not been established. + */ +SVCALL(SD_BLE_GAP_DISCONNECT, uint32_t, sd_ble_gap_disconnect(uint16_t conn_handle, uint8_t hci_status_code)); + + +/**@brief Set the radio's transmit power. + * + * @param[in] role The role to set the transmit power for, see @ref BLE_GAP_TX_POWER_ROLES for + * possible roles. + * @param[in] handle The handle parameter is interpreted depending on role: + * - If role is @ref BLE_GAP_TX_POWER_ROLE_CONN, this value is the specific connection handle. + * - If role is @ref BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle, + * will use the specified transmit power, and include it in the advertising packet headers if + * @ref ble_gap_adv_properties_t::include_tx_power set. + * - For all other roles handle is ignored. + * @param[in] tx_power Radio transmit power in dBm (see note for accepted values). + * + * @note Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +2dBm, +3dBm, +4dBm, +5dBm, +6dBm, +7dBm and +8dBm. + * @note The initiator will have the same transmit power as the scanner. + * @note When a connection is created it will inherit the transmit power from the initiator or + * advertiser leading to the connection. + * + * @retval ::NRF_SUCCESS Successfully changed the transmit power. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_TX_POWER_SET, uint32_t, sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power)); + + +/**@brief Set GAP Appearance value. + * + * @param[in] appearance Appearance (16-bit), see @ref BLE_APPEARANCES. + * + * @retval ::NRF_SUCCESS Appearance value set successfully. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + */ +SVCALL(SD_BLE_GAP_APPEARANCE_SET, uint32_t, sd_ble_gap_appearance_set(uint16_t appearance)); + + +/**@brief Get GAP Appearance value. + * + * @param[out] p_appearance Pointer to appearance (16-bit) to be filled in, see @ref BLE_APPEARANCES. + * + * @retval ::NRF_SUCCESS Appearance value retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GAP_APPEARANCE_GET, uint32_t, sd_ble_gap_appearance_get(uint16_t *p_appearance)); + + +/**@brief Set GAP Peripheral Preferred Connection Parameters. + * + * @param[in] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure with the desired parameters. + * + * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table, + see @ref ble_gap_cfg_ppcp_incl_cfg_t. + */ +SVCALL(SD_BLE_GAP_PPCP_SET, uint32_t, sd_ble_gap_ppcp_set(ble_gap_conn_params_t const *p_conn_params)); + + +/**@brief Get GAP Peripheral Preferred Connection Parameters. + * + * @param[out] p_conn_params Pointer to a @ref ble_gap_conn_params_t structure where the parameters will be stored. + * + * @retval ::NRF_SUCCESS Peripheral Preferred Connection Parameters retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The characteristic is not included in the Attribute Table, + see @ref ble_gap_cfg_ppcp_incl_cfg_t. + */ +SVCALL(SD_BLE_GAP_PPCP_GET, uint32_t, sd_ble_gap_ppcp_get(ble_gap_conn_params_t *p_conn_params)); + + +/**@brief Set GAP device name. + * + * @note If the device name is located in application flash memory (see @ref ble_gap_cfg_device_name_t), + * it cannot be changed. Then @ref NRF_ERROR_FORBIDDEN will be returned. + * + * @param[in] p_write_perm Write permissions for the Device Name characteristic, see @ref ble_gap_conn_sec_mode_t. + * @param[in] p_dev_name Pointer to a UTF-8 encoded, non NULL-terminated string. + * @param[in] len Length of the UTF-8, non NULL-terminated string pointed to by p_dev_name in octets (must be smaller or equal than @ref BLE_GAP_DEVNAME_MAX_LEN). + * + * @retval ::NRF_SUCCESS GAP device name and permissions set successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_FORBIDDEN Device name is not writable. + */ +SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len)); + + +/**@brief Get GAP device name. + * + * @note If the device name is longer than the size of the supplied buffer, + * p_len will return the complete device name length, + * and not the number of bytes actually returned in p_dev_name. + * The application may use this information to allocate a suitable buffer size. + * + * @param[out] p_dev_name Pointer to an empty buffer where the UTF-8 non NULL-terminated string will be placed. Set to NULL to obtain the complete device name length. + * @param[in,out] p_len Length of the buffer pointed by p_dev_name, complete device name length on output. + * + * @retval ::NRF_SUCCESS GAP device name retrieved successfully. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + */ +SVCALL(SD_BLE_GAP_DEVICE_NAME_GET, uint32_t, sd_ble_gap_device_name_get(uint8_t *p_dev_name, uint16_t *p_len)); + + +/**@brief Initiate the GAP Authentication procedure. + * + * @details In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected), + * otherwise in the peripheral role, an SMP Security Request will be sent. + * + * @events + * @event{Depending on the security parameters set and the packet exchanges with the peer\, the following events may be generated:} + * @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST} + * @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST} + * @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY} + * @event{@ref BLE_GAP_EVT_KEY_PRESSED} + * @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST} + * @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST} + * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE} + * @event{@ref BLE_GAP_EVT_AUTH_STATUS} + * @event{@ref BLE_GAP_EVT_TIMEOUT} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure. + * In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used. + * In the central role, this pointer may be NULL to reject a Security Request. + * + * @retval ::NRF_SUCCESS Successfully initiated authentication procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - No link has been established. + * - An encryption is already executing or queued. + * @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported. + * Distribution of own Identity Information is only supported if the Central + * Address Resolution characteristic is configured to be included or + * the Softdevice is configured to support peripheral roles only. + * See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + * @retval ::NRF_ERROR_TIMEOUT A SMP timeout has occurred, and further SMP operations on this link is prohibited. + */ +SVCALL(SD_BLE_GAP_AUTHENTICATE, uint32_t, sd_ble_gap_authenticate(uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params)); + + +/**@brief Reply with GAP security parameters. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS. + * @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have + * already been provided during a previous call to @ref sd_ble_gap_authenticate. + * @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure + * will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application + * upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event. + * Note that the SoftDevice expects the application to provide memory for storing the + * peer's keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key + * can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the + * @ref BLE_GAP_EVT_AUTH_STATUS event. + * + * @retval ::NRF_SUCCESS Successfully accepted security parameter from the application. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported. + * Distribution of own Identity Information is only supported if the Central + * Address Resolution characteristic is configured to be included or + * the Softdevice is configured to support peripheral roles only. + * See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t. + */ +SVCALL(SD_BLE_GAP_SEC_PARAMS_REPLY, uint32_t, sd_ble_gap_sec_params_reply(uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset)); + + +/**@brief Reply with an authentication key. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES. + * @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. + * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination) + * or NULL when confirming LE Secure Connections Numeric Comparison. + * If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format. + * + * @retval ::NRF_SUCCESS Authentication key successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_AUTH_KEY_REPLY, uint32_t, sd_ble_gap_auth_key_reply(uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key)); + + +/**@brief Reply with an LE Secure connections DHKey. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_dhkey LE Secure Connections DHKey. + * + * @retval ::NRF_SUCCESS DHKey successfully set. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - The peer is not authenticated. + * - The application has not pulled a @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_DHKEY_REPLY, uint32_t, sd_ble_gap_lesc_dhkey_reply(uint16_t conn_handle, ble_gap_lesc_dhkey_t const *p_dhkey)); + + +/**@brief Notify the peer of a local keypress. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] kp_not See @ref BLE_GAP_KP_NOT_TYPES. + * + * @retval ::NRF_SUCCESS Keypress notification successfully queued for transmission. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Authentication key not requested. + * - Passkey has not been entered. + * - Keypresses have not been enabled by both peers. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_BUSY The BLE stack is busy. Retry at later time. + */ +SVCALL(SD_BLE_GAP_KEYPRESS_NOTIFY, uint32_t, sd_ble_gap_keypress_notify(uint16_t conn_handle, uint8_t kp_not)); + + +/**@brief Generate a set of OOB data to send to a peer out of band. + * + * @note The @ref ble_gap_addr_t included in the OOB data returned will be the currently active one (or, if a connection has already been established, + * the one used during connection setup). The application may manually overwrite it with an updated value. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. Can be @ref BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet. + * @param[in] p_pk_own LE Secure Connections local P-256 Public Key. + * @param[out] p_oobd_own The OOB data to be sent out of band to a peer. + * + * @retval ::NRF_SUCCESS OOB data successfully generated. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_OOB_DATA_GET, uint32_t, sd_ble_gap_lesc_oob_data_get(uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own)); + +/**@brief Provide the OOB data sent/received out of band. + * + * @note An authentication procedure with OOB selected as an algorithm must be in progress when calling this function. + * @note A @ref BLE_GAP_EVT_LESC_DHKEY_REQUEST event with the oobd_req set to 1 must have been received prior to calling this function. + * + * @events + * @event{This function is used during authentication procedures\, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_oobd_own The OOB data sent out of band to a peer or NULL if the peer has not received OOB data. + * Must correspond to @ref ble_gap_sec_params_t::oob flag in @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST. + * @param[in] p_oobd_peer The OOB data received out of band from a peer or NULL if none received. + * Must correspond to @ref ble_gap_sec_params_t::oob flag + * in @ref sd_ble_gap_authenticate in the central role or + * in @ref sd_ble_gap_sec_params_reply in the peripheral role. + * + * @retval ::NRF_SUCCESS OOB data accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Authentication key not requested + * - Not expecting LESC OOB data + * - Have not actually exchanged passkeys. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_LESC_OOB_DATA_SET, uint32_t, sd_ble_gap_lesc_oob_data_set(uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer)); + + +/**@brief Initiate GAP Encryption procedure. + * + * @details In the central role, this function will initiate the encryption procedure using the encryption information provided. + * + * @events + * @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE, The connection security has been updated.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_AUTH_MUTEX_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_ENC_MSC} + * @mmsc{@ref BLE_GAP_MULTILINK_CTRL_PROC_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_SEC_REQ_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_master_id Pointer to a @ref ble_gap_master_id_t master identification structure. + * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. + * + * @retval ::NRF_SUCCESS Successfully initiated authentication procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::BLE_ERROR_INVALID_ROLE Operation is not supported in the Peripheral role. + * @retval ::NRF_ERROR_BUSY Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry. + */ +SVCALL(SD_BLE_GAP_ENCRYPT, uint32_t, sd_ble_gap_encrypt(uint16_t conn_handle, ble_gap_master_id_t const *p_master_id, ble_gap_enc_info_t const *p_enc_info)); + + +/**@brief Reply with GAP security information. + * + * @details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in @ref NRF_ERROR_INVALID_STATE. + * @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters. + * @note Data signing is not yet supported, and p_sign_info must therefore be NULL. + * + * @mscs + * @mmsc{@ref BLE_GAP_PERIPH_ENC_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_enc_info Pointer to a @ref ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available. + * @param[in] p_id_info Pointer to a @ref ble_gap_irk_t identity information structure. May be NULL to signal none is available. + * @param[in] p_sign_info Pointer to a @ref ble_gap_sign_info_t signing information structure. May be NULL to signal none is available. + * + * @retval ::NRF_SUCCESS Successfully accepted security information. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - No link has been established. + * - No @ref BLE_GAP_EVT_SEC_INFO_REQUEST pending. + * - Encryption information provided by the app without being requested. See @ref ble_gap_evt_sec_info_request_t::enc_info. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_SEC_INFO_REPLY, uint32_t, sd_ble_gap_sec_info_reply(uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info, ble_gap_irk_t const *p_id_info, ble_gap_sign_info_t const *p_sign_info)); + + +/**@brief Get the current connection security. + * + * @param[in] conn_handle Connection handle. + * @param[out] p_conn_sec Pointer to a @ref ble_gap_conn_sec_t structure to be filled in. + * + * @retval ::NRF_SUCCESS Current connection security successfully retrieved. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec)); + + +/**@brief Start reporting the received signal strength to the application. + * + * A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called. + * + * @events + * @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is + * dependent on the settings of the threshold_dbm + * and skip_count input parameters.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID. + * @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event. + * + * @retval ::NRF_SUCCESS Successfully activated RSSI reporting. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is already ongoing. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count)); + + +/**@brief Stop reporting the received signal strength. + * + * @note An RSSI change detected before the call but not yet received by the application + * may be reported after @ref sd_ble_gap_rssi_stop has been called. + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @mmsc{@ref BLE_GAP_RSSI_FILT_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * + * @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + */ +SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle)); + + +/**@brief Get the received signal strength for the last connection event. + * + * @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND + * will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start. + * @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored. + * @param[out] p_ch_index Pointer to the location where Channel Index for the RSSI measurement shall be stored. + * + * @retval ::NRF_SUCCESS Successfully read the RSSI. + * @retval ::NRF_ERROR_NOT_FOUND No sample is available. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing. + */ +SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index)); + + +/**@brief Start or continue scanning (GAP Discovery procedure, Observer Procedure). + * + * @note A call to this function will require the application to keep the memory pointed by + * p_adv_report_buffer alive until the buffer is released. The buffer is released when the scanner is stopped + * or when this function is called with another buffer. + * + * @note The scanner will automatically stop in the following cases: + * - @ref sd_ble_gap_scan_stop is called. + * - @ref sd_ble_gap_connect is called. + * - A @ref BLE_GAP_EVT_TIMEOUT with source set to @ref BLE_GAP_TIMEOUT_SRC_SCAN is received. + * - When a @ref BLE_GAP_EVT_ADV_REPORT event is received and @ref ble_gap_adv_report_type_t::status is not set to + * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA. In this case scanning is only paused to let the application + * access received data. The application must call this function to continue scanning, or call @ref sd_ble_gap_scan_stop + * to stop scanning. + * + * @note If a @ref BLE_GAP_EVT_ADV_REPORT event is received with @ref ble_gap_adv_report_type_t::status set to + * @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_MORE_DATA, the scanner will continue scanning, and the application will + * receive more reports from this advertising event. The following reports will include the old and new received data. + * + * @events + * @event{@ref BLE_GAP_EVT_ADV_REPORT, An advertising or scan response packet has been received.} + * @event{@ref BLE_GAP_EVT_TIMEOUT, Scanner has timed out.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_SCAN_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @param[in] p_scan_params Pointer to scan parameters structure. When this function is used to continue + * scanning, this parameter must be NULL. + * @param[in] p_adv_report_buffer Pointer to buffer used to store incoming advertising data. + * The memory pointed to should be kept alive until the scanning is stopped. + * See @ref BLE_GAP_SCAN_BUFFER_SIZE for minimum and maximum buffer size. + * If the scanner receives advertising data larger than can be stored in the buffer, + * a @ref BLE_GAP_EVT_ADV_REPORT will be raised with @ref ble_gap_adv_report_type_t::status + * set to @ref BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED. + * + * @retval ::NRF_SUCCESS Successfully initiated scanning procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: + * - Scanning is already ongoing and p_scan_params was not NULL + * - Scanning is not running and p_scan_params was NULL. + * - The scanner has timed out when this function is called to continue scanning. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. See @ref ble_gap_scan_params_t. + * @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported parameters supplied. See @ref ble_gap_scan_params_t. + * @retval ::NRF_ERROR_INVALID_LENGTH The provided buffer length is invalid. See @ref BLE_GAP_SCAN_BUFFER_MIN. + * @retval ::NRF_ERROR_RESOURCES Not enough BLE role slots available. + * Stop one or more currently active roles (Central, Peripheral or Broadcaster) and try again + */ +SVCALL(SD_BLE_GAP_SCAN_START, uint32_t, sd_ble_gap_scan_start(ble_gap_scan_params_t const *p_scan_params, ble_data_t const * p_adv_report_buffer)); + + +/**@brief Stop scanning (GAP Discovery procedure, Observer Procedure). + * + * @note The buffer provided in @ref sd_ble_gap_scan_start is released. + * + * @mscs + * @mmsc{@ref BLE_GAP_SCAN_MSC} + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully stopped scanning procedure. + * @retval ::NRF_ERROR_INVALID_STATE Not in the scanning state. + */ +SVCALL(SD_BLE_GAP_SCAN_STOP, uint32_t, sd_ble_gap_scan_stop(void)); + + +/**@brief Create a connection (GAP Link Establishment). + * + * @note If a scanning procedure is currently in progress it will be automatically stopped when calling this function. + * The scanning procedure will be stopped even if the function returns an error. + * + * @events + * @event{@ref BLE_GAP_EVT_CONNECTED, A connection was established.} + * @event{@ref BLE_GAP_EVT_TIMEOUT, Failed to establish a connection.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_WL_SHARE_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_PRIV_MSC} + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC} + * @endmscs + * + * @param[in] p_peer_addr Pointer to peer identity address. If @ref ble_gap_scan_params_t::filter_policy is set to use + * whitelist, then p_peer_addr is ignored. + * @param[in] p_scan_params Pointer to scan parameters structure. + * @param[in] p_conn_params Pointer to desired connection parameters. + * @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or + * @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. + * + * @retval ::NRF_SUCCESS Successfully initiated connection procedure. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid parameter(s) pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * - Invalid parameter(s) in p_scan_params or p_conn_params. + * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. + * - Peer address was not present in the device identity list, see @ref sd_ble_gap_device_identities_set. + * @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found. + * @retval ::NRF_ERROR_INVALID_STATE The SoftDevice is in an invalid state to perform this operation. This may be due to an + * existing locally initiated connect procedure, which must complete before initiating again. + * @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR Invalid Peer address. + * @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration tag has been reached. + * To increase the number of available connections, + * use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP. + * @retval ::NRF_ERROR_RESOURCES Either: + * - Not enough BLE role slots available. + * Stop one or more currently active roles (Central, Peripheral or Observer) and try again. + * - The event_length parameter associated with conn_cfg_tag is too small to be able to + * establish a connection on the selected @ref ble_gap_scan_params_t::scan_phys. + * Use @ref sd_ble_cfg_set to increase the event length. + */ +SVCALL(SD_BLE_GAP_CONNECT, uint32_t, sd_ble_gap_connect(ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag)); + + +/**@brief Cancel a connection establishment. + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_CONN_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully canceled an ongoing connection procedure. + * @retval ::NRF_ERROR_INVALID_STATE No locally initiated connect procedure started or connection + * completed occurred. + */ +SVCALL(SD_BLE_GAP_CONNECT_CANCEL, uint32_t, sd_ble_gap_connect_cancel(void)); + + +/**@brief Initiate or respond to a PHY Update Procedure + * + * @details This function is used to initiate or respond to a PHY Update Procedure. It will always + * generate a @ref BLE_GAP_EVT_PHY_UPDATE event if successfully executed. + * If this function is used to initiate a PHY Update procedure and the only option + * provided in @ref ble_gap_phys_t::tx_phys and @ref ble_gap_phys_t::rx_phys is the + * currently active PHYs in the respective directions, the SoftDevice will generate a + * @ref BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the + * procedure in the Link Layer. + * + * If @ref ble_gap_phys_t::tx_phys or @ref ble_gap_phys_t::rx_phys is @ref BLE_GAP_PHY_AUTO, + * then the stack will select PHYs based on the peer's PHY preferences and the local link + * configuration. The PHY Update procedure will for this case result in a PHY combination + * that respects the time constraints configured with @ref sd_ble_cfg_set and the current + * link layer data length. + * + * When acting as a central, the SoftDevice will select the fastest common PHY in each direction. + * + * If the peer does not support the PHY Update Procedure, then the resulting + * @ref BLE_GAP_EVT_PHY_UPDATE event will have a status set to + * @ref BLE_HCI_UNSUPPORTED_REMOTE_FEATURE. + * + * If the PHY Update procedure was rejected by the peer due to a procedure collision, the status + * will be @ref BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or + * @ref BLE_HCI_DIFFERENT_TRANSACTION_COLLISION. + * If the peer responds to the PHY Update procedure with invalid parameters, the status + * will be @ref BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS. + * If the PHY Update procedure was rejected by the peer for a different reason, the status will + * contain the reason as specified by the peer. + * + * @events + * @event{@ref BLE_GAP_EVT_PHY_UPDATE, Result of the PHY Update Procedure.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GAP_CENTRAL_PHY_UPDATE} + * @mmsc{@ref BLE_GAP_PERIPHERAL_PHY_UPDATE} + * @endmscs + * + * @param[in] conn_handle Connection handle to indicate the connection for which the PHY Update is requested. + * @param[in] p_gap_phys Pointer to PHY structure. + * + * @retval ::NRF_SUCCESS Successfully requested a PHY Update. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the combination of + * @ref ble_gap_phys_t::tx_phys, @ref ble_gap_phys_t::rx_phys, and @ref ble_gap_data_length_params_t. + * The connection event length is configured with @ref BLE_CONN_CFG_GAP using @ref sd_ble_cfg_set. + * @retval ::NRF_ERROR_BUSY Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry. + * + */ +SVCALL(SD_BLE_GAP_PHY_UPDATE, uint32_t, sd_ble_gap_phy_update(uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys)); + + +/**@brief Initiate or respond to a Data Length Update Procedure. + * + * @note If the application uses @ref BLE_GAP_DATA_LENGTH_AUTO for one or more members of + * p_dl_params, the SoftDevice will choose the highest value supported in current + * configuration and connection parameters. + * @note If the link PHY is Coded, the SoftDevice will ensure that the MaxTxTime and/or MaxRxTime + * used in the Data Length Update procedure is at least 2704 us. Otherwise, MaxTxTime and + * MaxRxTime will be limited to maximum 2120 us. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_dl_params Pointer to local parameters to be used in Data Length Update + * Procedure. Set any member to @ref BLE_GAP_DATA_LENGTH_AUTO to let + * the SoftDevice automatically decide the value for that member. + * Set to NULL to use automatic values for all members. + * @param[out] p_dl_limitation Pointer to limitation to be written when local device does not + * have enough resources or does not support the requested Data Length + * Update parameters. Ignored if NULL. + * + * @mscs + * @mmsc{@ref BLE_GAP_DATA_LENGTH_UPDATE_PROCEDURE_MSC} + * @endmscs + * + * @retval ::NRF_SUCCESS Successfully set Data Length Extension initiation/response parameters. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied. + * @retval ::NRF_ERROR_INVALID_STATE No link has been established. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. + * @retval ::NRF_ERROR_NOT_SUPPORTED The requested parameters are not supported by the SoftDevice. Inspect + * p_dl_limitation to see which parameter is not supported. + * @retval ::NRF_ERROR_RESOURCES The connection event length configured for this link is not sufficient for the requested parameters. + * Use @ref sd_ble_cfg_set with @ref BLE_CONN_CFG_GAP to increase the connection event length. + * Inspect p_dl_limitation to see where the limitation is. + * @retval ::NRF_ERROR_BUSY Peer has already initiated a Data Length Update Procedure. Process the + * pending @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond. + */ +SVCALL(SD_BLE_GAP_DATA_LENGTH_UPDATE, uint32_t, sd_ble_gap_data_length_update(uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation)); + +/**@brief Start the Quality of Service (QoS) channel survey module. + * + * @details The channel survey module provides measurements of the energy levels on + * the Bluetooth Low Energy channels. When the module is enabled, @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT + * events will periodically report the measured energy levels for each channel. + * + * @note The measurements are scheduled with lower priority than other Bluetooth Low Energy roles, + * Radio Timeslot API events and Flash API events. + * + * @note The channel survey module will attempt to do measurements so that the average interval + * between measurements will be interval_us. However due to the channel survey module + * having the lowest priority of all roles and modules, this may not be possible. In that + * case fewer than expected channel survey reports may be given. + * + * @note In order to use the channel survey module, @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available + * must be set. This is done using @ref sd_ble_cfg_set. + * + * @param[in] interval_us Requested average interval for the measurements and reports. See + * @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVALS for valid ranges. If set + * to @ref BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS, the channel + * survey role will be scheduled at every available opportunity. + * + * @retval ::NRF_SUCCESS The module is successfully started. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. interval_us is out of the + * allowed range. + * @retval ::NRF_ERROR_INVALID_STATE Trying to start the module when already running. + * @retval ::NRF_ERROR_RESOURCES The channel survey module is not available to the application. + * Set @ref ble_gap_cfg_role_count_t::qos_channel_survey_role_available using + * @ref sd_ble_cfg_set. + */ +SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_START, uint32_t, sd_ble_gap_qos_channel_survey_start(uint32_t interval_us)); + +/**@brief Stop the Quality of Service (QoS) channel survey module. + * + * @note The SoftDevice may generate one @ref BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT event after this + * function is called. + * + * @retval ::NRF_SUCCESS The module is successfully stopped. + * @retval ::NRF_ERROR_INVALID_STATE Trying to stop the module when it is not running. + */ +SVCALL(SD_BLE_GAP_QOS_CHANNEL_SURVEY_STOP, uint32_t, sd_ble_gap_qos_channel_survey_stop(void)); + + +/**@brief Obtain the next connection event counter value. + * + * @details The connection event counter is initialized to zero on the first connection event. The value is incremented + * by one for each connection event. For more information see Bluetooth Core Specification v5.0, Vol 6, Part B, + * Section 4.5.1. + * + * @note The connection event counter obtained through this API will be outdated if this API is called + * at the same time as the connection event counter is incremented. + * + * @note This API will always return the last connection event counter + 1. + * The actual connection event may be multiple connection events later if: + * - Slave latency is enabled and there is no data to transmit or receive. + * - Another role is scheduled with a higher priority at the same time as the next connection event. + * + * @param[in] conn_handle Connection handle. + * @param[out] p_counter Pointer to the variable where the next connection event counter will be written. + * + * @retval ::NRF_SUCCESS The connection event counter was successfully retrieved. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle parameter supplied. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET, uint32_t, sd_ble_gap_next_conn_evt_counter_get(uint16_t conn_handle, uint16_t * p_counter)); + + +/**@brief Start triggering a given task on connection event start. + * + * @details When enabled, this feature will trigger a PPI task at the start of connection events. + * The application can configure the SoftDevice to trigger every N connection events starting from + * a given connection event counter. See also @ref ble_gap_conn_event_trigger_t. + * + * @param[in] conn_handle Connection handle. + * @param[in] p_params Connection event trigger parameters. + * + * @retval ::NRF_SUCCESS Success. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter supplied. See @ref ble_gap_conn_event_trigger_t. + * @retval ::NRF_ERROR_INVALID_STATE Either: + * - Trying to start connection event triggering when it is already ongoing. + * - @ref ble_gap_conn_event_trigger_t::conn_evt_counter_start is in the past. + * Use @ref sd_ble_gap_next_conn_evt_counter_get to find a new value + to be used as ble_gap_conn_event_trigger_t::conn_evt_counter_start. + */ +SVCALL(SD_BLE_GAP_CONN_EVT_TRIGGER_START, uint32_t, sd_ble_gap_conn_evt_trigger_start(uint16_t conn_handle, ble_gap_conn_event_trigger_t const * p_params)); + + +/**@brief Stop triggering the task configured using @ref sd_ble_gap_conn_evt_trigger_start. + * + * @param[in] conn_handle Connection handle. + * + * @retval ::NRF_SUCCESS Success. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. + * @retval ::NRF_ERROR_INVALID_STATE Trying to stop connection event triggering when it is not enabled. + */ +SVCALL(SD_BLE_GAP_CONN_EVT_TRIGGER_STOP, uint32_t, sd_ble_gap_conn_evt_trigger_stop(uint16_t conn_handle)); + + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GAP_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h new file mode 100644 index 0000000000..c392884418 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatt.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2013 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATT Generic Attribute Profile (GATT) Common + @{ + @brief Common definitions and prototypes for the GATT interfaces. + */ + +#ifndef BLE_GATT_H__ +#define BLE_GATT_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATT_DEFINES Defines + * @{ */ + +/** @brief Default ATT MTU, in bytes. */ +#define BLE_GATT_ATT_MTU_DEFAULT 23 + +/**@brief Invalid Attribute Handle. */ +#define BLE_GATT_HANDLE_INVALID 0x0000 + +/**@brief First Attribute Handle. */ +#define BLE_GATT_HANDLE_START 0x0001 + +/**@brief Last Attribute Handle. */ +#define BLE_GATT_HANDLE_END 0xFFFF + +/** @defgroup BLE_GATT_TIMEOUT_SOURCES GATT Timeout sources + * @{ */ +#define BLE_GATT_TIMEOUT_SRC_PROTOCOL 0x00 /**< ATT Protocol timeout. */ +/** @} */ + +/** @defgroup BLE_GATT_WRITE_OPS GATT Write operations + * @{ */ +#define BLE_GATT_OP_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATT_OP_WRITE_REQ 0x01 /**< Write Request. */ +#define BLE_GATT_OP_WRITE_CMD 0x02 /**< Write Command. */ +#define BLE_GATT_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */ +#define BLE_GATT_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */ +#define BLE_GATT_OP_EXEC_WRITE_REQ 0x05 /**< Execute Write Request. */ +/** @} */ + +/** @defgroup BLE_GATT_EXEC_WRITE_FLAGS GATT Execute Write flags + * @{ */ +#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL 0x00 /**< Cancel prepared write. */ +#define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE 0x01 /**< Execute prepared write. */ +/** @} */ + +/** @defgroup BLE_GATT_HVX_TYPES GATT Handle Value operations + * @{ */ +#define BLE_GATT_HVX_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATT_HVX_NOTIFICATION 0x01 /**< Handle Value Notification. */ +#define BLE_GATT_HVX_INDICATION 0x02 /**< Handle Value Indication. */ +/** @} */ + +/** @defgroup BLE_GATT_STATUS_CODES GATT Status Codes + * @{ */ +#define BLE_GATT_STATUS_SUCCESS 0x0000 /**< Success. */ +#define BLE_GATT_STATUS_UNKNOWN 0x0001 /**< Unknown or not applicable status. */ +#define BLE_GATT_STATUS_ATTERR_INVALID 0x0100 /**< ATT Error: Invalid Error Code. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_HANDLE 0x0101 /**< ATT Error: Invalid Attribute Handle. */ +#define BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED 0x0102 /**< ATT Error: Read not permitted. */ +#define BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED 0x0103 /**< ATT Error: Write not permitted. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_PDU 0x0104 /**< ATT Error: Used in ATT as Invalid PDU. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION 0x0105 /**< ATT Error: Authenticated link required. */ +#define BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED 0x0106 /**< ATT Error: Used in ATT as Request Not Supported. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_OFFSET 0x0107 /**< ATT Error: Offset specified was past the end of the attribute. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION 0x0108 /**< ATT Error: Used in ATT as Insufficient Authorization. */ +#define BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL 0x0109 /**< ATT Error: Used in ATT as Prepare Queue Full. */ +#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND 0x010A /**< ATT Error: Used in ATT as Attribute not found. */ +#define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG 0x010B /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE 0x010C /**< ATT Error: Encryption key size used is insufficient. */ +#define BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH 0x010D /**< ATT Error: Invalid value size. */ +#define BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR 0x010E /**< ATT Error: Very unlikely error. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION 0x010F /**< ATT Error: Encrypted link required. */ +#define BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE 0x0110 /**< ATT Error: Attribute type is not a supported grouping attribute. */ +#define BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES 0x0111 /**< ATT Error: Insufficient resources. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN 0x0112 /**< ATT Error: Reserved for Future Use range #1 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END 0x017F /**< ATT Error: Reserved for Future Use range #1 end. */ +#define BLE_GATT_STATUS_ATTERR_APP_BEGIN 0x0180 /**< ATT Error: Application range begin. */ +#define BLE_GATT_STATUS_ATTERR_APP_END 0x019F /**< ATT Error: Application range end. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN 0x01A0 /**< ATT Error: Reserved for Future Use range #2 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END 0x01DF /**< ATT Error: Reserved for Future Use range #2 end. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN 0x01E0 /**< ATT Error: Reserved for Future Use range #3 begin. */ +#define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END 0x01FC /**< ATT Error: Reserved for Future Use range #3 end. */ +#define BLE_GATT_STATUS_ATTERR_CPS_WRITE_REQ_REJECTED 0x01FC /**< ATT Common Profile and Service Error: Write request rejected. */ +#define BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR 0x01FD /**< ATT Common Profile and Service Error: Client Characteristic Configuration Descriptor improperly configured. */ +#define BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG 0x01FE /**< ATT Common Profile and Service Error: Procedure Already in Progress. */ +#define BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE 0x01FF /**< ATT Common Profile and Service Error: Out Of Range. */ +/** @} */ + + +/** @defgroup BLE_GATT_CPF_FORMATS Characteristic Presentation Formats + * @note Found at http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml + * @{ */ +#define BLE_GATT_CPF_FORMAT_RFU 0x00 /**< Reserved For Future Use. */ +#define BLE_GATT_CPF_FORMAT_BOOLEAN 0x01 /**< Boolean. */ +#define BLE_GATT_CPF_FORMAT_2BIT 0x02 /**< Unsigned 2-bit integer. */ +#define BLE_GATT_CPF_FORMAT_NIBBLE 0x03 /**< Unsigned 4-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT8 0x04 /**< Unsigned 8-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT12 0x05 /**< Unsigned 12-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT16 0x06 /**< Unsigned 16-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT24 0x07 /**< Unsigned 24-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT32 0x08 /**< Unsigned 32-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT48 0x09 /**< Unsigned 48-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT64 0x0A /**< Unsigned 64-bit integer. */ +#define BLE_GATT_CPF_FORMAT_UINT128 0x0B /**< Unsigned 128-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT8 0x0C /**< Signed 2-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT12 0x0D /**< Signed 12-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT16 0x0E /**< Signed 16-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT24 0x0F /**< Signed 24-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT32 0x10 /**< Signed 32-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT48 0x11 /**< Signed 48-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT64 0x12 /**< Signed 64-bit integer. */ +#define BLE_GATT_CPF_FORMAT_SINT128 0x13 /**< Signed 128-bit integer. */ +#define BLE_GATT_CPF_FORMAT_FLOAT32 0x14 /**< IEEE-754 32-bit floating point. */ +#define BLE_GATT_CPF_FORMAT_FLOAT64 0x15 /**< IEEE-754 64-bit floating point. */ +#define BLE_GATT_CPF_FORMAT_SFLOAT 0x16 /**< IEEE-11073 16-bit SFLOAT. */ +#define BLE_GATT_CPF_FORMAT_FLOAT 0x17 /**< IEEE-11073 32-bit FLOAT. */ +#define BLE_GATT_CPF_FORMAT_DUINT16 0x18 /**< IEEE-20601 format. */ +#define BLE_GATT_CPF_FORMAT_UTF8S 0x19 /**< UTF-8 string. */ +#define BLE_GATT_CPF_FORMAT_UTF16S 0x1A /**< UTF-16 string. */ +#define BLE_GATT_CPF_FORMAT_STRUCT 0x1B /**< Opaque Structure. */ +/** @} */ + +/** @defgroup BLE_GATT_CPF_NAMESPACES GATT Bluetooth Namespaces + * @{ + */ +#define BLE_GATT_CPF_NAMESPACE_BTSIG 0x01 /**< Bluetooth SIG defined Namespace. */ +#define BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN 0x0000 /**< Namespace Description Unknown. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATT_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATT connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_PARAM att_mtu is smaller than @ref BLE_GATT_ATT_MTU_DEFAULT. + */ +typedef struct +{ + uint16_t att_mtu; /**< Maximum size of ATT packet the SoftDevice can send or receive. + The default and minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + @mscs + @mmsc{@ref BLE_GATTC_MTU_EXCHANGE} + @mmsc{@ref BLE_GATTS_MTU_EXCHANGE} + @endmscs + */ +} ble_gatt_conn_cfg_t; + +/**@brief GATT Characteristic Properties. */ +typedef struct +{ + /* Standard properties */ + uint8_t broadcast :1; /**< Broadcasting of the value permitted. */ + uint8_t read :1; /**< Reading the value permitted. */ + uint8_t write_wo_resp :1; /**< Writing the value with Write Command permitted. */ + uint8_t write :1; /**< Writing the value with Write Request permitted. */ + uint8_t notify :1; /**< Notification of the value permitted. */ + uint8_t indicate :1; /**< Indications of the value permitted. */ + uint8_t auth_signed_wr :1; /**< Writing the value with Signed Write Command permitted. */ +} ble_gatt_char_props_t; + +/**@brief GATT Characteristic Extended Properties. */ +typedef struct +{ + /* Extended properties */ + uint8_t reliable_wr :1; /**< Writing the value with Queued Write operations permitted. */ + uint8_t wr_aux :1; /**< Writing the Characteristic User Description descriptor permitted. */ +} ble_gatt_char_ext_props_t; + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GATT_H__ + +/** @} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h new file mode 100644 index 0000000000..7fb3920244 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gattc.h @@ -0,0 +1,715 @@ +/* + * Copyright (c) 2011 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client + @{ + @brief Definitions and prototypes for the GATT Client interface. + */ + +#ifndef BLE_GATTC_H__ +#define BLE_GATTC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" +#include "ble_gatt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations + * @{ */ + +/**@brief GATTC API SVC numbers. */ +enum BLE_GATTC_SVCS +{ + SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */ + SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */ + SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */ + SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */ + SD_BLE_GATTC_ATTR_INFO_DISCOVER, /**< Attribute Information Discovery. */ + SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */ + SD_BLE_GATTC_READ, /**< Generic read. */ + SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */ + SD_BLE_GATTC_WRITE, /**< Generic write. */ + SD_BLE_GATTC_HV_CONFIRM, /**< Handle Value Confirmation. */ + SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. */ +}; + +/** + * @brief GATT Client Event IDs. + */ +enum BLE_GATTC_EVTS +{ + BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. */ + BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. */ + BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. */ + BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. */ + BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, /**< Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. */ + BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. */ + BLE_GATTC_EVT_READ_RSP, /**< Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. */ + BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. */ + BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. */ + BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. */ + BLE_GATTC_EVT_EXCHANGE_MTU_RSP, /**< Exchange MTU Response event. \n See @ref ble_gattc_evt_exchange_mtu_rsp_t. */ + BLE_GATTC_EVT_TIMEOUT, /**< Timeout event. \n See @ref ble_gattc_evt_timeout_t. */ + BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE /**< Write without Response transmission complete. \n See @ref ble_gattc_evt_write_cmd_tx_complete_t. */ +}; + +/** @} */ + +/** @addtogroup BLE_GATTC_DEFINES Defines + * @{ */ + +/** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC + * @{ */ +#define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */ +/** @} */ + +/** @defgroup BLE_GATTC_ATTR_INFO_FORMAT Attribute Information Formats + * @{ */ +#define BLE_GATTC_ATTR_INFO_FORMAT_16BIT 1 /**< 16-bit Attribute Information Format. */ +#define BLE_GATTC_ATTR_INFO_FORMAT_128BIT 2 /**< 128-bit Attribute Information Format. */ +/** @} */ + +/** @defgroup BLE_GATTC_DEFAULTS GATT Client defaults + * @{ */ +#define BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Write without Response that can be queued for transmission. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATTC_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATTC connection configuration parameters, set with @ref sd_ble_cfg_set. + */ +typedef struct +{ + uint8_t write_cmd_tx_queue_size; /**< The guaranteed minimum number of Write without Response that can be queued for transmission. + The default value is @ref BLE_GATTC_WRITE_CMD_TX_QUEUE_SIZE_DEFAULT */ +} ble_gattc_conn_cfg_t; + +/**@brief Operation Handle Range. */ +typedef struct +{ + uint16_t start_handle; /**< Start Handle. */ + uint16_t end_handle; /**< End Handle. */ +} ble_gattc_handle_range_t; + + +/**@brief GATT service. */ +typedef struct +{ + ble_uuid_t uuid; /**< Service UUID. */ + ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */ +} ble_gattc_service_t; + + +/**@brief GATT include. */ +typedef struct +{ + uint16_t handle; /**< Include Handle. */ + ble_gattc_service_t included_srvc; /**< Handle of the included service. */ +} ble_gattc_include_t; + + +/**@brief GATT characteristic. */ +typedef struct +{ + ble_uuid_t uuid; /**< Characteristic UUID. */ + ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ + uint8_t char_ext_props : 1; /**< Extended properties present. */ + uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */ + uint16_t handle_value; /**< Handle of the Characteristic Value. */ +} ble_gattc_char_t; + + +/**@brief GATT descriptor. */ +typedef struct +{ + uint16_t handle; /**< Descriptor Handle. */ + ble_uuid_t uuid; /**< Descriptor UUID. */ +} ble_gattc_desc_t; + + +/**@brief Write Parameters. */ +typedef struct +{ + uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */ + uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */ + uint16_t handle; /**< Handle to the attribute to be written. */ + uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */ + uint16_t len; /**< Length of data in bytes. */ + uint8_t const *p_value; /**< Pointer to the value data. */ +} ble_gattc_write_params_t; + +/**@brief Attribute Information for 16-bit Attribute UUID. */ +typedef struct +{ + uint16_t handle; /**< Attribute handle. */ + ble_uuid_t uuid; /**< 16-bit Attribute UUID. */ +} ble_gattc_attr_info16_t; + +/**@brief Attribute Information for 128-bit Attribute UUID. */ +typedef struct +{ + uint16_t handle; /**< Attribute handle. */ + ble_uuid128_t uuid; /**< 128-bit Attribute UUID. */ +} ble_gattc_attr_info128_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Service count. */ + ble_gattc_service_t services[1]; /**< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_prim_srvc_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Include count. */ + ble_gattc_include_t includes[1]; /**< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_rel_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Characteristic count. */ + ble_gattc_char_t chars[1]; /**< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Descriptor count. */ + ble_gattc_desc_t descs[1]; /**< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_desc_disc_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP. */ +typedef struct +{ + uint16_t count; /**< Attribute count. */ + uint8_t format; /**< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT. */ + union { + ble_gattc_attr_info16_t attr_info16[1]; /**< Attribute information for 16-bit Attribute UUID. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ + ble_gattc_attr_info128_t attr_info128[1]; /**< Attribute information for 128-bit Attribute UUID. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ + } info; /**< Attribute information union. */ +} ble_gattc_evt_attr_info_disc_rsp_t; + +/**@brief GATT read by UUID handle value pair. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint8_t *p_value; /**< Pointer to the Attribute Value, length is available in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len. */ +} ble_gattc_handle_value_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */ +typedef struct +{ + uint16_t count; /**< Handle-Value Pair Count. */ + uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */ + uint8_t handle_value[1]; /**< Handle-Value(s) list. To iterate through the list use @ref sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter. + @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_val_by_uuid_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint16_t offset; /**< Offset of the attribute data. */ + uint16_t len; /**< Attribute data length. */ + uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */ +typedef struct +{ + uint16_t len; /**< Concatenated Attribute values length. */ + uint8_t values[1]; /**< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_char_vals_read_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */ + uint16_t offset; /**< Data offset. */ + uint16_t len; /**< Data length. */ + uint8_t data[1]; /**< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_write_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */ +typedef struct +{ + uint16_t handle; /**< Handle to which the HVx operation applies. */ + uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ + uint16_t len; /**< Attribute data length. */ + uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gattc_evt_hvx_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP. */ +typedef struct +{ + uint16_t server_rx_mtu; /**< Server RX MTU size. */ +} ble_gattc_evt_exchange_mtu_rsp_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ +} ble_gattc_evt_timeout_t; + +/**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE. */ +typedef struct +{ + uint8_t count; /**< Number of write without response transmissions completed. */ +} ble_gattc_evt_write_cmd_tx_complete_t; + +/**@brief GATTC event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which event occurred. */ + uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ + uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */ + union + { + ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */ + ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */ + ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */ + ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */ + ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */ + ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */ + ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */ + ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */ + ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */ + ble_gattc_evt_exchange_mtu_rsp_t exchange_mtu_rsp; /**< Exchange MTU Response Event Parameters. */ + ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */ + ble_gattc_evt_attr_info_disc_rsp_t attr_info_disc_rsp; /**< Attribute Information Discovery Event Parameters. */ + ble_gattc_evt_write_cmd_tx_complete_t write_cmd_tx_complete; /**< Write without Response transmission complete Event Parameters. */ + } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */ +} ble_gattc_evt_t; +/** @} */ + +/** @addtogroup BLE_GATTC_FUNCTIONS Functions + * @{ */ + +/**@brief Initiate or continue a GATT Primary Service Discovery procedure. + * + * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle. + * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search. + * + * @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with + * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. + * + * @events + * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] start_handle Handle to start searching from. + * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, uint32_t, sd_ble_gattc_primary_services_discover(uint16_t conn_handle, uint16_t start_handle, ble_uuid_t const *p_srvc_uuid)); + + +/**@brief Initiate or continue a GATT Relationship Discovery procedure. + * + * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached, + * this must be called again with an updated handle range to continue the search. + * + * @events + * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_REL_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Characteristic Discovery procedure. + * + * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with + * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure. + * + * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @events + * @event{@ref BLE_GATTC_EVT_DESC_DISC_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Read using Characteristic UUID procedure. + * + * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached, + * this must be called again with an updated handle range to continue the discovery. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_READ_UUID_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_uuid Pointer to a Characteristic value UUID to read. + * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, uint32_t, sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle, ble_uuid_t const *p_uuid, ble_gattc_handle_range_t const *p_handle_range)); + + +/**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure. + * + * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor + * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the + * complete value. + * + * @events + * @event{@ref BLE_GATTC_EVT_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] handle The handle of the attribute to be read. + * @param[in] offset Offset into the attribute value to be read. + * + * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset)); + + +/**@brief Initiate a GATT Read Multiple Characteristic Values procedure. + * + * @details This function initiates a GATT Read Multiple Characteristic Values procedure. + * + * @events + * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_READ_MULT_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read. + * @param[in] handle_count The number of handles in p_handles. + * + * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const *p_handles, uint16_t handle_count)); + + +/**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure. + * + * @details This function can perform all write procedures described in GATT. + * + * @note Only one write with response procedure can be ongoing per connection at a time. + * If the application tries to write with response while another write with response procedure is ongoing, + * the function call will return @ref NRF_ERROR_BUSY. + * A @ref BLE_GATTC_EVT_WRITE_RSP event will be issued as soon as the write response arrives from the peer. + * + * @note The number of Write without Response that can be queued is configured by @ref ble_gattc_conn_cfg_t::write_cmd_tx_queue_size + * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES. + * A @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event will be issued as soon as the transmission of the write without response is complete. + * + * @note The application can keep track of the available queue element count for writes without responses by following the procedure below: + * - Store initial queue element count in a variable. + * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS. + * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event. + * + * @events + * @event{@ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, Write without response transmission complete.} + * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Write response received from the peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_VALUE_WRITE_WITHOUT_RESP_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC} + * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_write_params A pointer to a write parameters structure. + * + * @retval ::NRF_SUCCESS Successfully started the Write procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_BUSY For write with response, procedure already in progress. Wait for a @ref BLE_GATTC_EVT_WRITE_RSP event and retry. + * @retval ::NRF_ERROR_RESOURCES Too many writes without responses queued. + * Wait for a @ref BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event and retry. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params)); + + +/**@brief Send a Handle Value Confirmation to the GATT Server. + * + * @mscs + * @mmsc{@ref BLE_GATTC_HVI_MSC} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] handle The handle of the attribute in the indication. + * + * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle)); + +/**@brief Discovers information about a range of attributes on a GATT server. + * + * @events + * @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.} + * @endevents + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] p_handle_range The range of handles to request information about. + * + * @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_ATTR_INFO_DISCOVER, uint32_t, sd_ble_gattc_attr_info_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * p_handle_range)); + +/**@brief Start an ATT_MTU exchange by sending an Exchange MTU Request to the server. + * + * @details The SoftDevice sets ATT_MTU to the minimum of: + * - The Client RX MTU value, and + * - The Server RX MTU value from @ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP. + * + * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT. + * + * @events + * @event{@ref BLE_GATTC_EVT_EXCHANGE_MTU_RSP} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTC_MTU_EXCHANGE} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] client_rx_mtu Client RX MTU size. + * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration + used for this connection. + * - The value must be equal to Server RX MTU size given in @ref sd_ble_gatts_exchange_mtu_reply + * if an ATT_MTU exchange has already been performed in the other direction. + * + * @retval ::NRF_SUCCESS Successfully sent request to the server. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state or an ATT_MTU exchange was already requested once. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid Client RX MTU size supplied. + * @retval ::NRF_ERROR_BUSY Client procedure already in progress. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTC_EXCHANGE_MTU_REQUEST, uint32_t, sd_ble_gattc_exchange_mtu_request(uint16_t conn_handle, uint16_t client_rx_mtu)); + +/**@brief Iterate through Handle-Value(s) list in @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event. + * + * @param[in] p_gattc_evt Pointer to event buffer containing @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event. + * @note If the buffer contains different event, behavior is undefined. + * @param[in,out] p_iter Iterator, points to @ref ble_gattc_handle_value_t structure that will be filled in with + * the next Handle-Value pair in each iteration. If the function returns other than + * @ref NRF_SUCCESS, it will not be changed. + * - To start iteration, initialize the structure to zero. + * - To continue, pass the value from previous iteration. + * + * \code + * ble_gattc_handle_value_t iter; + * memset(&iter, 0, sizeof(ble_gattc_handle_value_t)); + * while (sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(&ble_evt.evt.gattc_evt, &iter) == NRF_SUCCESS) + * { + * app_handle = iter.handle; + * memcpy(app_value, iter.p_value, ble_evt.evt.gattc_evt.params.char_val_by_uuid_read_rsp.value_len); + * } + * \endcode + * + * @retval ::NRF_SUCCESS Successfully retrieved the next Handle-Value pair. + * @retval ::NRF_ERROR_NOT_FOUND No more Handle-Value pairs available in the list. + */ +__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter); + +/** @} */ + +#ifndef SUPPRESS_INLINE_IMPLEMENTATION + +__STATIC_INLINE uint32_t sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(ble_gattc_evt_t *p_gattc_evt, ble_gattc_handle_value_t *p_iter) +{ + uint32_t value_len = p_gattc_evt->params.char_val_by_uuid_read_rsp.value_len; + uint8_t *p_first = p_gattc_evt->params.char_val_by_uuid_read_rsp.handle_value; + uint8_t *p_next = p_iter->p_value ? p_iter->p_value + value_len : p_first; + + if ((p_next - p_first) / (sizeof(uint16_t) + value_len) < p_gattc_evt->params.char_val_by_uuid_read_rsp.count) + { + p_iter->handle = (uint16_t)p_next[1] << 8 | p_next[0]; + p_iter->p_value = p_next + sizeof(uint16_t); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_NOT_FOUND; + } +} + +#endif /* SUPPRESS_INLINE_IMPLEMENTATION */ + +#ifdef __cplusplus +} +#endif +#endif /* BLE_GATTC_H__ */ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h new file mode 100644 index 0000000000..394d8d1897 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_gatts.h @@ -0,0 +1,845 @@ +/* + * Copyright (c) 2011 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_GATTS Generic Attribute Profile (GATT) Server + @{ + @brief Definitions and prototypes for the GATTS interface. + */ + +#ifndef BLE_GATTS_H__ +#define BLE_GATTS_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_hci.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" +#include "ble_gatt.h" +#include "ble_gap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_GATTS_ENUMERATIONS Enumerations + * @{ */ + +/** + * @brief GATTS API SVC numbers. + */ +enum BLE_GATTS_SVCS +{ + SD_BLE_GATTS_SERVICE_ADD = BLE_GATTS_SVC_BASE, /**< Add a service. */ + SD_BLE_GATTS_INCLUDE_ADD, /**< Add an included service. */ + SD_BLE_GATTS_CHARACTERISTIC_ADD, /**< Add a characteristic. */ + SD_BLE_GATTS_DESCRIPTOR_ADD, /**< Add a generic attribute. */ + SD_BLE_GATTS_VALUE_SET, /**< Set an attribute value. */ + SD_BLE_GATTS_VALUE_GET, /**< Get an attribute value. */ + SD_BLE_GATTS_HVX, /**< Handle Value Notification or Indication. */ + SD_BLE_GATTS_SERVICE_CHANGED, /**< Perform a Service Changed Indication to one or more peers. */ + SD_BLE_GATTS_RW_AUTHORIZE_REPLY, /**< Reply to an authorization request for a read or write operation on one or more attributes. */ + SD_BLE_GATTS_SYS_ATTR_SET, /**< Set the persistent system attributes for a connection. */ + SD_BLE_GATTS_SYS_ATTR_GET, /**< Retrieve the persistent system attributes. */ + SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, /**< Retrieve the first valid user handle. */ + SD_BLE_GATTS_ATTR_GET, /**< Retrieve the UUID and/or metadata of an attribute. */ + SD_BLE_GATTS_EXCHANGE_MTU_REPLY /**< Reply to Exchange MTU Request. */ +}; + +/** + * @brief GATT Server Event IDs. + */ +enum BLE_GATTS_EVTS +{ + BLE_GATTS_EVT_WRITE = BLE_GATTS_EVT_BASE, /**< Write operation performed. \n See @ref ble_gatts_evt_write_t. */ + BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST, /**< Read/Write Authorization request. \n Reply with @ref sd_ble_gatts_rw_authorize_reply. \n See @ref ble_gatts_evt_rw_authorize_request_t. */ + BLE_GATTS_EVT_SYS_ATTR_MISSING, /**< A persistent system attribute access is pending. \n Respond with @ref sd_ble_gatts_sys_attr_set. \n See @ref ble_gatts_evt_sys_attr_missing_t. */ + BLE_GATTS_EVT_HVC, /**< Handle Value Confirmation. \n See @ref ble_gatts_evt_hvc_t. */ + BLE_GATTS_EVT_SC_CONFIRM, /**< Service Changed Confirmation. \n No additional event structure applies. */ + BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, /**< Exchange MTU Request. \n Reply with @ref sd_ble_gatts_exchange_mtu_reply. \n See @ref ble_gatts_evt_exchange_mtu_request_t. */ + BLE_GATTS_EVT_TIMEOUT, /**< Peer failed to respond to an ATT request in time. \n See @ref ble_gatts_evt_timeout_t. */ + BLE_GATTS_EVT_HVN_TX_COMPLETE /**< Handle Value Notification transmission complete. \n See @ref ble_gatts_evt_hvn_tx_complete_t. */ +}; + +/**@brief GATTS Configuration IDs. + * + * IDs that uniquely identify a GATTS configuration. + */ +enum BLE_GATTS_CFGS +{ + BLE_GATTS_CFG_SERVICE_CHANGED = BLE_GATTS_CFG_BASE, /**< Service changed configuration. */ + BLE_GATTS_CFG_ATTR_TAB_SIZE, /**< Attribute table size configuration. */ +}; + +/** @} */ + +/** @addtogroup BLE_GATTS_DEFINES Defines + * @{ */ + +/** @defgroup BLE_ERRORS_GATTS SVC return values specific to GATTS + * @{ */ +#define BLE_ERROR_GATTS_INVALID_ATTR_TYPE (NRF_GATTS_ERR_BASE + 0x000) /**< Invalid attribute type. */ +#define BLE_ERROR_GATTS_SYS_ATTR_MISSING (NRF_GATTS_ERR_BASE + 0x001) /**< System Attributes missing. */ +/** @} */ + +/** @defgroup BLE_GATTS_ATTR_LENS_MAX Maximum attribute lengths + * @{ */ +#define BLE_GATTS_FIX_ATTR_LEN_MAX (510) /**< Maximum length for fixed length Attribute Values. */ +#define BLE_GATTS_VAR_ATTR_LEN_MAX (512) /**< Maximum length for variable length Attribute Values. */ +/** @} */ + +/** @defgroup BLE_GATTS_SRVC_TYPES GATT Server Service Types + * @{ */ +#define BLE_GATTS_SRVC_TYPE_INVALID 0x00 /**< Invalid Service Type. */ +#define BLE_GATTS_SRVC_TYPE_PRIMARY 0x01 /**< Primary Service. */ +#define BLE_GATTS_SRVC_TYPE_SECONDARY 0x02 /**< Secondary Type. */ +/** @} */ + + +/** @defgroup BLE_GATTS_ATTR_TYPES GATT Server Attribute Types + * @{ */ +#define BLE_GATTS_ATTR_TYPE_INVALID 0x00 /**< Invalid Attribute Type. */ +#define BLE_GATTS_ATTR_TYPE_PRIM_SRVC_DECL 0x01 /**< Primary Service Declaration. */ +#define BLE_GATTS_ATTR_TYPE_SEC_SRVC_DECL 0x02 /**< Secondary Service Declaration. */ +#define BLE_GATTS_ATTR_TYPE_INC_DECL 0x03 /**< Include Declaration. */ +#define BLE_GATTS_ATTR_TYPE_CHAR_DECL 0x04 /**< Characteristic Declaration. */ +#define BLE_GATTS_ATTR_TYPE_CHAR_VAL 0x05 /**< Characteristic Value. */ +#define BLE_GATTS_ATTR_TYPE_DESC 0x06 /**< Descriptor. */ +#define BLE_GATTS_ATTR_TYPE_OTHER 0x07 /**< Other, non-GATT specific type. */ +/** @} */ + + +/** @defgroup BLE_GATTS_OPS GATT Server Operations + * @{ */ +#define BLE_GATTS_OP_INVALID 0x00 /**< Invalid Operation. */ +#define BLE_GATTS_OP_WRITE_REQ 0x01 /**< Write Request. */ +#define BLE_GATTS_OP_WRITE_CMD 0x02 /**< Write Command. */ +#define BLE_GATTS_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */ +#define BLE_GATTS_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */ +#define BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL 0x05 /**< Execute Write Request: Cancel all prepared writes. */ +#define BLE_GATTS_OP_EXEC_WRITE_REQ_NOW 0x06 /**< Execute Write Request: Immediately execute all prepared writes. */ +/** @} */ + +/** @defgroup BLE_GATTS_VLOCS GATT Value Locations + * @{ */ +#define BLE_GATTS_VLOC_INVALID 0x00 /**< Invalid Location. */ +#define BLE_GATTS_VLOC_STACK 0x01 /**< Attribute Value is located in stack memory, no user memory is required. */ +#define BLE_GATTS_VLOC_USER 0x02 /**< Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack + will read and write directly to the memory using the pointer provided in the APIs. There are no alignment requirements for the buffer. */ +/** @} */ + +/** @defgroup BLE_GATTS_AUTHORIZE_TYPES GATT Server Authorization Types + * @{ */ +#define BLE_GATTS_AUTHORIZE_TYPE_INVALID 0x00 /**< Invalid Type. */ +#define BLE_GATTS_AUTHORIZE_TYPE_READ 0x01 /**< Authorize a Read Operation. */ +#define BLE_GATTS_AUTHORIZE_TYPE_WRITE 0x02 /**< Authorize a Write Request Operation. */ +/** @} */ + +/** @defgroup BLE_GATTS_SYS_ATTR_FLAGS System Attribute Flags + * @{ */ +#define BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS (1 << 0) /**< Restrict system attributes to system services only. */ +#define BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS (1 << 1) /**< Restrict system attributes to user services only. */ +/** @} */ + +/** @defgroup BLE_GATTS_SERVICE_CHANGED Service Changed Inclusion Values + * @{ + */ +#define BLE_GATTS_SERVICE_CHANGED_DEFAULT (1) /**< Default is to include the Service Changed characteristic in the Attribute Table. */ +/** @} */ + +/** @defgroup BLE_GATTS_ATTR_TAB_SIZE Attribute Table size + * @{ + */ +#define BLE_GATTS_ATTR_TAB_SIZE_MIN (248) /**< Minimum Attribute Table size */ +#define BLE_GATTS_ATTR_TAB_SIZE_DEFAULT (1408) /**< Default Attribute Table size. */ +/** @} */ + +/** @defgroup BLE_GATTS_DEFAULTS GATT Server defaults + * @{ + */ +#define BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT 1 /**< Default number of Handle Value Notifications that can be queued for transmission. */ +/** @} */ + +/** @} */ + +/** @addtogroup BLE_GATTS_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE GATTS connection configuration parameters, set with @ref sd_ble_cfg_set. + */ +typedef struct +{ + uint8_t hvn_tx_queue_size; /**< Minimum guaranteed number of Handle Value Notifications that can be queued for transmission. + The default value is @ref BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT */ +} ble_gatts_conn_cfg_t; + +/**@brief Attribute metadata. */ +typedef struct +{ + ble_gap_conn_sec_mode_t read_perm; /**< Read permissions. */ + ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ + uint8_t vlen :1; /**< Variable length attribute. */ + uint8_t vloc :2; /**< Value location, see @ref BLE_GATTS_VLOCS.*/ + uint8_t rd_auth :1; /**< Read authorization and value will be requested from the application on every read operation. */ + uint8_t wr_auth :1; /**< Write authorization will be requested from the application on every Write Request operation (but not Write Command). */ +} ble_gatts_attr_md_t; + + +/**@brief GATT Attribute. */ +typedef struct +{ + ble_uuid_t const *p_uuid; /**< Pointer to the attribute UUID. */ + ble_gatts_attr_md_t const *p_attr_md; /**< Pointer to the attribute metadata structure. */ + uint16_t init_len; /**< Initial attribute value length in bytes. */ + uint16_t init_offs; /**< Initial attribute value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized. */ + uint16_t max_len; /**< Maximum attribute value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values. */ + uint8_t *p_value; /**< Pointer to the attribute data. Please note that if the @ref BLE_GATTS_VLOC_USER value location is selected in the attribute metadata, this will have to point to a buffer + that remains valid through the lifetime of the attribute. This excludes usage of automatic variables that may go out of scope or any other temporary location. + The stack may access that memory directly without the application's knowledge. For writable characteristics, this value must not be a location in flash memory.*/ +} ble_gatts_attr_t; + +/**@brief GATT Attribute Value. */ +typedef struct +{ + uint16_t len; /**< Length in bytes to be written or read. Length in bytes written or read after successful return.*/ + uint16_t offset; /**< Attribute value offset. */ + uint8_t *p_value; /**< Pointer to where value is stored or will be stored. + If value is stored in user memory, only the attribute length is updated when p_value == NULL. + Set to NULL when reading to obtain the complete length of the attribute value */ +} ble_gatts_value_t; + + +/**@brief GATT Characteristic Presentation Format. */ +typedef struct +{ + uint8_t format; /**< Format of the value, see @ref BLE_GATT_CPF_FORMATS. */ + int8_t exponent; /**< Exponent for integer data types. */ + uint16_t unit; /**< Unit from Bluetooth Assigned Numbers. */ + uint8_t name_space; /**< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ + uint16_t desc; /**< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ +} ble_gatts_char_pf_t; + + +/**@brief GATT Characteristic metadata. */ +typedef struct +{ + ble_gatt_char_props_t char_props; /**< Characteristic Properties. */ + ble_gatt_char_ext_props_t char_ext_props; /**< Characteristic Extended Properties. */ + uint8_t const *p_char_user_desc; /**< Pointer to a UTF-8 encoded string (non-NULL terminated), NULL if the descriptor is not required. */ + uint16_t char_user_desc_max_size; /**< The maximum size in bytes of the user description descriptor. */ + uint16_t char_user_desc_size; /**< The size of the user description, must be smaller or equal to char_user_desc_max_size. */ + ble_gatts_char_pf_t const *p_char_pf; /**< Pointer to a presentation format structure or NULL if the CPF descriptor is not required. */ + ble_gatts_attr_md_t const *p_user_desc_md; /**< Attribute metadata for the User Description descriptor, or NULL for default values. */ + ble_gatts_attr_md_t const *p_cccd_md; /**< Attribute metadata for the Client Characteristic Configuration Descriptor, or NULL for default values. */ + ble_gatts_attr_md_t const *p_sccd_md; /**< Attribute metadata for the Server Characteristic Configuration Descriptor, or NULL for default values. */ +} ble_gatts_char_md_t; + + +/**@brief GATT Characteristic Definition Handles. */ +typedef struct +{ + uint16_t value_handle; /**< Handle to the characteristic value. */ + uint16_t user_desc_handle; /**< Handle to the User Description descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ + uint16_t cccd_handle; /**< Handle to the Client Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ + uint16_t sccd_handle; /**< Handle to the Server Characteristic Configuration Descriptor, or @ref BLE_GATT_HANDLE_INVALID if not present. */ +} ble_gatts_char_handles_t; + + +/**@brief GATT HVx parameters. */ +typedef struct +{ + uint16_t handle; /**< Characteristic Value Handle. */ + uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */ + uint16_t offset; /**< Offset within the attribute value. */ + uint16_t *p_len; /**< Length in bytes to be written, length in bytes written after return. */ + uint8_t const *p_data; /**< Actual data content, use NULL to use the current attribute value. */ +} ble_gatts_hvx_params_t; + +/**@brief GATT Authorization parameters. */ +typedef struct +{ + uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */ + uint8_t update : 1; /**< If set, data supplied in p_data will be used to update the attribute value. + Please note that for @ref BLE_GATTS_AUTHORIZE_TYPE_WRITE operations this bit must always be set, + as the data to be written needs to be stored and later provided by the application. */ + uint16_t offset; /**< Offset of the attribute value being updated. */ + uint16_t len; /**< Length in bytes of the value in p_data pointer, see @ref BLE_GATTS_ATTR_LENS_MAX. */ + uint8_t const *p_data; /**< Pointer to new value used to update the attribute value. */ +} ble_gatts_authorize_params_t; + +/**@brief GATT Read or Write Authorize Reply parameters. */ +typedef struct +{ + uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */ + union { + ble_gatts_authorize_params_t read; /**< Read authorization parameters. */ + ble_gatts_authorize_params_t write; /**< Write authorization parameters. */ + } params; /**< Reply Parameters. */ +} ble_gatts_rw_authorize_reply_params_t; + +/**@brief Service Changed Inclusion configuration parameters, set with @ref sd_ble_cfg_set. */ +typedef struct +{ + uint8_t service_changed : 1; /**< If 1, include the Service Changed characteristic in the Attribute Table. Default is @ref BLE_GATTS_SERVICE_CHANGED_DEFAULT. */ +} ble_gatts_cfg_service_changed_t; + +/**@brief Attribute table size configuration parameters, set with @ref sd_ble_cfg_set. + * + * @retval ::NRF_ERROR_INVALID_LENGTH One or more of the following is true: + * - The specified Attribute Table size is too small. + * The minimum acceptable size is defined by @ref BLE_GATTS_ATTR_TAB_SIZE_MIN. + * - The specified Attribute Table size is not a multiple of 4. + */ +typedef struct +{ + uint32_t attr_tab_size; /**< Attribute table size. Default is @ref BLE_GATTS_ATTR_TAB_SIZE_DEFAULT, minimum is @ref BLE_GATTS_ATTR_TAB_SIZE_MIN. */ +} ble_gatts_cfg_attr_tab_size_t; + +/**@brief Config structure for GATTS configurations. */ +typedef union +{ + ble_gatts_cfg_service_changed_t service_changed; /**< Include service changed characteristic, cfg_id is @ref BLE_GATTS_CFG_SERVICE_CHANGED. */ + ble_gatts_cfg_attr_tab_size_t attr_tab_size; /**< Attribute table size, cfg_id is @ref BLE_GATTS_CFG_ATTR_TAB_SIZE. */ +} ble_gatts_cfg_t; + + +/**@brief Event structure for @ref BLE_GATTS_EVT_WRITE. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + ble_uuid_t uuid; /**< Attribute UUID. */ + uint8_t op; /**< Type of write operation, see @ref BLE_GATTS_OPS. */ + uint8_t auth_required; /**< Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation. */ + uint16_t offset; /**< Offset for the write operation. */ + uint16_t len; /**< Length of the received data. */ + uint8_t data[1]; /**< Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation. + See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */ +} ble_gatts_evt_write_t; + +/**@brief Event substructure for authorized read requests, see @ref ble_gatts_evt_rw_authorize_request_t. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ + ble_uuid_t uuid; /**< Attribute UUID. */ + uint16_t offset; /**< Offset for the read operation. */ +} ble_gatts_evt_read_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST. */ +typedef struct +{ + uint8_t type; /**< Type of authorize operation, see @ref BLE_GATTS_AUTHORIZE_TYPES. */ + union { + ble_gatts_evt_read_t read; /**< Attribute Read Parameters. */ + ble_gatts_evt_write_t write; /**< Attribute Write Parameters. */ + } request; /**< Request Parameters. */ +} ble_gatts_evt_rw_authorize_request_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_SYS_ATTR_MISSING. */ +typedef struct +{ + uint8_t hint; /**< Hint (currently unused). */ +} ble_gatts_evt_sys_attr_missing_t; + + +/**@brief Event structure for @ref BLE_GATTS_EVT_HVC. */ +typedef struct +{ + uint16_t handle; /**< Attribute Handle. */ +} ble_gatts_evt_hvc_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST. */ +typedef struct +{ + uint16_t client_rx_mtu; /**< Client RX MTU size. */ +} ble_gatts_evt_exchange_mtu_request_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_TIMEOUT. */ +typedef struct +{ + uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */ +} ble_gatts_evt_timeout_t; + +/**@brief Event structure for @ref BLE_GATTS_EVT_HVN_TX_COMPLETE. */ +typedef struct +{ + uint8_t count; /**< Number of notification transmissions completed. */ +} ble_gatts_evt_hvn_tx_complete_t; + +/**@brief GATTS event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ + union + { + ble_gatts_evt_write_t write; /**< Write Event Parameters. */ + ble_gatts_evt_rw_authorize_request_t authorize_request; /**< Read or Write Authorize Request Parameters. */ + ble_gatts_evt_sys_attr_missing_t sys_attr_missing; /**< System attributes missing. */ + ble_gatts_evt_hvc_t hvc; /**< Handle Value Confirmation Event Parameters. */ + ble_gatts_evt_exchange_mtu_request_t exchange_mtu_request; /**< Exchange MTU Request Event Parameters. */ + ble_gatts_evt_timeout_t timeout; /**< Timeout Event. */ + ble_gatts_evt_hvn_tx_complete_t hvn_tx_complete; /**< Handle Value Notification transmission complete Event Parameters. */ + } params; /**< Event Parameters. */ +} ble_gatts_evt_t; + +/** @} */ + +/** @addtogroup BLE_GATTS_FUNCTIONS Functions + * @{ */ + +/**@brief Add a service declaration to the Attribute Table. + * + * @note Secondary Services are only relevant in the context of the entity that references them, it is therefore forbidden to + * add a secondary service declaration that is not referenced by another service later in the Attribute Table. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] type Toggles between primary and secondary services, see @ref BLE_GATTS_SRVC_TYPES. + * @param[in] p_uuid Pointer to service UUID. + * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a service declaration. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, Vendor Specific UUIDs need to be present in the table. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GATTS_SERVICE_ADD, uint32_t, sd_ble_gatts_service_add(uint8_t type, ble_uuid_t const *p_uuid, uint16_t *p_handle)); + + +/**@brief Add an include declaration to the Attribute Table. + * + * @note It is currently only possible to add an include declaration to the last added service (i.e. only sequential population is supported at this time). + * + * @note The included service must already be present in the Attribute Table prior to this call. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] service_handle Handle of the service where the included service is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] inc_srvc_handle Handle of the included service. + * @param[out] p_include_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added an include declaration. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, handle values need to match previously added services. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required. + * @retval ::NRF_ERROR_NOT_SUPPORTED Feature is not supported, service_handle must be that of the last added service. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, self inclusions are not allowed. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + */ +SVCALL(SD_BLE_GATTS_INCLUDE_ADD, uint32_t, sd_ble_gatts_include_add(uint16_t service_handle, uint16_t inc_srvc_handle, uint16_t *p_include_handle)); + + +/**@brief Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the Attribute Table. + * + * @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time). + * + * @note Several restrictions apply to the parameters, such as matching permissions between the user description descriptor and the writable auxiliaries bits, + * readable (no security) and writable (selectable) CCCDs and SCCDs and valid presentation format values. + * + * @note If no metadata is provided for the optional descriptors, their permissions will be derived from the characteristic permissions. + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] service_handle Handle of the service where the characteristic is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] p_char_md Characteristic metadata. + * @param[in] p_attr_char_value Pointer to the attribute structure corresponding to the characteristic value. + * @param[out] p_handles Pointer to the structure where the assigned handles will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a characteristic. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, service handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + */ +SVCALL(SD_BLE_GATTS_CHARACTERISTIC_ADD, uint32_t, sd_ble_gatts_characteristic_add(uint16_t service_handle, ble_gatts_char_md_t const *p_char_md, ble_gatts_attr_t const *p_attr_char_value, ble_gatts_char_handles_t *p_handles)); + + +/**@brief Add a descriptor to the Attribute Table. + * + * @note It is currently only possible to add a descriptor to the last added characteristic (i.e. only sequential population is supported at this time). + * + * @mscs + * @mmsc{@ref BLE_GATTS_ATT_TABLE_POP_MSC} + * @endmscs + * + * @param[in] char_handle Handle of the characteristic where the descriptor is to be placed, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. + * @param[in] p_attr Pointer to the attribute structure. + * @param[out] p_handle Pointer to a 16-bit word where the assigned handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully added a descriptor. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied, characteristic handle, Vendor Specific UUIDs, lengths, and permissions need to adhere to the constraints. + * @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation, a characteristic context is required. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden value supplied, certain UUIDs are reserved for the stack. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + */ +SVCALL(SD_BLE_GATTS_DESCRIPTOR_ADD, uint32_t, sd_ble_gatts_descriptor_add(uint16_t char_handle, ble_gatts_attr_t const *p_attr, uint16_t *p_handle)); + +/**@brief Set the value of a given attribute. + * + * @note Values other than system attributes can be set at any time, regardless of whether any active connections exist. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute. + * @param[in] handle Attribute handle. + * @param[in,out] p_value Attribute value information. + * + * @retval ::NRF_SUCCESS Successfully set the value of the attribute. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_FORBIDDEN Forbidden handle supplied, certain attributes are not modifiable by the application. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied, attribute lengths are restricted by @ref BLE_GATTS_ATTR_LENS_MAX. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute. + */ +SVCALL(SD_BLE_GATTS_VALUE_SET, uint32_t, sd_ble_gatts_value_set(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value)); + +/**@brief Get the value of a given attribute. + * + * @note If the attribute value is longer than the size of the supplied buffer, + * @ref ble_gatts_value_t::len will return the total attribute value length (excluding offset), + * and not the number of bytes actually returned in @ref ble_gatts_value_t::p_value. + * The application may use this information to allocate a suitable buffer size. + * + * @note When retrieving system attribute values with this function, the connection handle + * may refer to an already disconnected connection. Refer to the documentation of + * @ref sd_ble_gatts_sys_attr_get for further information. + * + * @param[in] conn_handle Connection handle. Ignored if the value does not belong to a system attribute. + * @param[in] handle Attribute handle. + * @param[in,out] p_value Attribute value information. + * + * @retval ::NRF_SUCCESS Successfully retrieved the value of the attribute. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid attribute offset supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied on a system attribute. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + */ +SVCALL(SD_BLE_GATTS_VALUE_GET, uint32_t, sd_ble_gatts_value_get(uint16_t conn_handle, uint16_t handle, ble_gatts_value_t *p_value)); + +/**@brief Notify or Indicate an attribute value. + * + * @details This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation + * (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that + * the application can atomically perform a value update and a server initiated transaction with a single API call. + * + * @note The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution. + * The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY, + * @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES. + * The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len). + * + * @note Only one indication procedure can be ongoing per connection at a time. + * If the application tries to indicate an attribute value while another indication procedure is ongoing, + * the function call will return @ref NRF_ERROR_BUSY. + * A @ref BLE_GATTS_EVT_HVC event will be issued as soon as the confirmation arrives from the peer. + * + * @note The number of Handle Value Notifications that can be queued is configured by @ref ble_gatts_conn_cfg_t::hvn_tx_queue_size + * When the queue is full, the function call will return @ref NRF_ERROR_RESOURCES. + * A @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event will be issued as soon as the transmission of the notification is complete. + * + * @note The application can keep track of the available queue element count for notifications by following the procedure below: + * - Store initial queue element count in a variable. + * - Decrement the variable, which stores the currently available queue element count, by one when a call to this function returns @ref NRF_SUCCESS. + * - Increment the variable, which stores the current available queue element count, by the count variable in @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event. + * + * @events + * @event{@ref BLE_GATTS_EVT_HVN_TX_COMPLETE, Notification transmission complete.} + * @event{@ref BLE_GATTS_EVT_HVC, Confirmation received from the peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC} + * @mmsc{@ref BLE_GATTS_HVN_MSC} + * @mmsc{@ref BLE_GATTS_HVI_MSC} + * @mmsc{@ref BLE_GATTS_HVX_DISABLED_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in,out] p_hvx_params Pointer to an HVx parameters structure. If @ref ble_gatts_hvx_params_t::p_data + * contains a non-NULL pointer the attribute value will be updated with the contents + * pointed by it before sending the notification or indication. If the attribute value + * is updated, @ref ble_gatts_hvx_params_t::p_len is updated by the SoftDevice to + * contain the number of actual bytes written, else it will be set to 0. + * + * @retval ::NRF_SUCCESS Successfully queued a notification or indication for transmission, and optionally updated the attribute value. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true: + * - Invalid Connection State + * - Notifications and/or indications not enabled in the CCCD + * - An ATT_MTU exchange is ongoing + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied. Only attributes added directly by the application are available to notify and indicate. + * @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated. + * @retval ::NRF_ERROR_NOT_FOUND Attribute not found. + * @retval ::NRF_ERROR_FORBIDDEN The connection's current security level is lower than the one required by the write permissions of the CCCD associated with this characteristic. + * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied. + * @retval ::NRF_ERROR_BUSY For @ref BLE_GATT_HVX_INDICATION Procedure already in progress. Wait for a @ref BLE_GATTS_EVT_HVC event and retry. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + * @retval ::NRF_ERROR_RESOURCES Too many notifications queued. + * Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_HVX, uint32_t, sd_ble_gatts_hvx(uint16_t conn_handle, ble_gatts_hvx_params_t const *p_hvx_params)); + +/**@brief Indicate the Service Changed attribute value. + * + * @details This call will send a Handle Value Indication to one or more peers connected to inform them that the Attribute + * Table layout has changed. As soon as the peer has confirmed the indication, a @ref BLE_GATTS_EVT_SC_CONFIRM event will + * be issued. + * + * @note Some of the restrictions and limitations that apply to @ref sd_ble_gatts_hvx also apply here. + * + * @events + * @event{@ref BLE_GATTS_EVT_SC_CONFIRM, Confirmation of attribute table change received from peer.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_GATTS_SC_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] start_handle Start of affected attribute handle range. + * @param[in] end_handle End of affected attribute handle range. + * + * @retval ::NRF_SUCCESS Successfully queued the Service Changed indication for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_NOT_SUPPORTED Service Changed not enabled at initialization. See @ref + * sd_ble_cfg_set and @ref ble_gatts_cfg_service_changed_t. + * @retval ::NRF_ERROR_INVALID_STATE One or more of the following is true: + * - Invalid Connection State + * - Notifications and/or indications not enabled in the CCCD + * - An ATT_MTU exchange is ongoing + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle(s) supplied, handles must be in the range populated by the application. + * @retval ::NRF_ERROR_BUSY Procedure already in progress. + * @retval ::BLE_ERROR_GATTS_SYS_ATTR_MISSING System attributes missing, use @ref sd_ble_gatts_sys_attr_set to set them to a known value. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_SERVICE_CHANGED, uint32_t, sd_ble_gatts_service_changed(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle)); + +/**@brief Respond to a Read/Write authorization request. + * + * @note This call should only be used as a response to a @ref BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event issued to the application. + * + * @mscs + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_BUF_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_NOBUF_NOAUTH_MSC} + * @mmsc{@ref BLE_GATTS_READ_REQ_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_WRITE_REQ_AUTH_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_QUEUE_FULL_MSC} + * @mmsc{@ref BLE_GATTS_QUEUED_WRITE_PEER_CANCEL_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_rw_authorize_reply_params Pointer to a structure with the attribute provided by the application. + * + * @note @ref ble_gatts_authorize_params_t::p_data is ignored when this function is used to respond + * to a @ref BLE_GATTS_AUTHORIZE_TYPE_READ event if @ref ble_gatts_authorize_params_t::update + * is set to 0. + * + * @retval ::NRF_SUCCESS Successfully queued a response to the peer, and in the case of a write operation, Attribute Table updated. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no authorization request pending. + * @retval ::NRF_ERROR_INVALID_PARAM Authorization op invalid, + * handle supplied does not match requested handle, + * or invalid data to be written provided by the application. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_RW_AUTHORIZE_REPLY, uint32_t, sd_ble_gatts_rw_authorize_reply(uint16_t conn_handle, ble_gatts_rw_authorize_reply_params_t const *p_rw_authorize_reply_params)); + + +/**@brief Update persistent system attribute information. + * + * @details Supply information about persistent system attributes to the stack, + * previously obtained using @ref sd_ble_gatts_sys_attr_get. + * This call is only allowed for active connections, and is usually + * made immediately after a connection is established with an known bonded device, + * often as a response to a @ref BLE_GATTS_EVT_SYS_ATTR_MISSING. + * + * p_sysattrs may point directly to the application's stored copy of the system attributes + * obtained using @ref sd_ble_gatts_sys_attr_get. + * If the pointer is NULL, the system attribute info is initialized, assuming that + * the application does not have any previously saved system attribute data for this device. + * + * @note The state of persistent system attributes is reset upon connection establishment and then remembered for its duration. + * + * @note If this call returns with an error code different from @ref NRF_SUCCESS, the storage of persistent system attributes may have been completed only partially. + * This means that the state of the attribute table is undefined, and the application should either provide a new set of attributes using this same call or + * reset the SoftDevice to return to a known state. + * + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be modified. + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be modified. + * + * @mscs + * @mmsc{@ref BLE_GATTS_HVX_SYS_ATTRS_MISSING_MSC} + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_UNK_PEER_MSC} + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle. + * @param[in] p_sys_attr_data Pointer to a saved copy of system attributes supplied to the stack, or NULL. + * @param[in] len Size of data pointed by p_sys_attr_data, in octets. + * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS + * + * @retval ::NRF_SUCCESS Successfully set the system attribute information. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied. + * @retval ::NRF_ERROR_INVALID_DATA Invalid data supplied, the data should be exactly the same as retrieved with @ref sd_ble_gatts_sys_attr_get. + * @retval ::NRF_ERROR_NO_MEM Not enough memory to complete operation. + */ +SVCALL(SD_BLE_GATTS_SYS_ATTR_SET, uint32_t, sd_ble_gatts_sys_attr_set(uint16_t conn_handle, uint8_t const *p_sys_attr_data, uint16_t len, uint32_t flags)); + + +/**@brief Retrieve persistent system attribute information from the stack. + * + * @details This call is used to retrieve information about values to be stored persistently by the application + * during the lifetime of a connection or after it has been terminated. When a new connection is established with the same bonded device, + * the system attribute information retrieved with this function should be restored using using @ref sd_ble_gatts_sys_attr_set. + * If retrieved after disconnection, the data should be read before a new connection established. The connection handle for + * the previous, now disconnected, connection will remain valid until a new one is created to allow this API call to refer to it. + * Connection handles belonging to active connections can be used as well, but care should be taken since the system attributes + * may be written to at any time by the peer during a connection's lifetime. + * + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS is used with this function, only the system attributes included in system services will be returned. + * @note When the @ref BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS is used with this function, only the system attributes included in user services will be returned. + * + * @mscs + * @mmsc{@ref BLE_GATTS_SYS_ATTRS_BONDED_PEER_MSC} + * @endmscs + * + * @param[in] conn_handle Connection handle of the recently terminated connection. + * @param[out] p_sys_attr_data Pointer to a buffer where updated information about system attributes will be filled in. The format of the data is described + * in @ref BLE_GATTS_SYS_ATTRS_FORMAT. NULL can be provided to obtain the length of the data. + * @param[in,out] p_len Size of application buffer if p_sys_attr_data is not NULL. Unconditionally updated to actual length of system attribute data. + * @param[in] flags Optional additional flags, see @ref BLE_GATTS_SYS_ATTR_FLAGS + * + * @retval ::NRF_SUCCESS Successfully retrieved the system attribute information. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid flags supplied. + * @retval ::NRF_ERROR_DATA_SIZE The system attribute information did not fit into the provided buffer. + * @retval ::NRF_ERROR_NOT_FOUND No system attributes found. + */ +SVCALL(SD_BLE_GATTS_SYS_ATTR_GET, uint32_t, sd_ble_gatts_sys_attr_get(uint16_t conn_handle, uint8_t *p_sys_attr_data, uint16_t *p_len, uint32_t flags)); + + +/**@brief Retrieve the first valid user attribute handle. + * + * @param[out] p_handle Pointer to an integer where the handle will be stored. + * + * @retval ::NRF_SUCCESS Successfully retrieved the handle. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + */ +SVCALL(SD_BLE_GATTS_INITIAL_USER_HANDLE_GET, uint32_t, sd_ble_gatts_initial_user_handle_get(uint16_t *p_handle)); + +/**@brief Retrieve the attribute UUID and/or metadata. + * + * @param[in] handle Attribute handle + * @param[out] p_uuid UUID of the attribute. Use NULL to omit this field. + * @param[out] p_md Metadata of the attribute. Use NULL to omit this field. + * + * @retval ::NRF_SUCCESS Successfully retrieved the attribute metadata, + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameters supplied. Returned when both @c p_uuid and @c p_md are NULL. + * @retval ::NRF_ERROR_NOT_FOUND Attribute was not found. + */ +SVCALL(SD_BLE_GATTS_ATTR_GET, uint32_t, sd_ble_gatts_attr_get(uint16_t handle, ble_uuid_t * p_uuid, ble_gatts_attr_md_t * p_md)); + +/**@brief Reply to an ATT_MTU exchange request by sending an Exchange MTU Response to the client. + * + * @details This function is only used to reply to a @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event. + * + * @details The SoftDevice sets ATT_MTU to the minimum of: + * - The Client RX MTU value from @ref BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, and + * - The Server RX MTU value. + * + * However, the SoftDevice never sets ATT_MTU lower than @ref BLE_GATT_ATT_MTU_DEFAULT. + * + * @mscs + * @mmsc{@ref BLE_GATTS_MTU_EXCHANGE} + * @endmscs + * + * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on. + * @param[in] server_rx_mtu Server RX MTU size. + * - The minimum value is @ref BLE_GATT_ATT_MTU_DEFAULT. + * - The maximum value is @ref ble_gatt_conn_cfg_t::att_mtu in the connection configuration + * used for this connection. + * - The value must be equal to Client RX MTU size given in @ref sd_ble_gattc_exchange_mtu_request + * if an ATT_MTU exchange has already been performed in the other direction. + * + * @retval ::NRF_SUCCESS Successfully sent response to the client. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no ATT_MTU exchange request pending. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid Server RX MTU size supplied. + * @retval ::NRF_ERROR_TIMEOUT There has been a GATT procedure timeout. No new GATT procedure can be performed without reestablishing the connection. + */ +SVCALL(SD_BLE_GATTS_EXCHANGE_MTU_REPLY, uint32_t, sd_ble_gatts_exchange_mtu_reply(uint16_t conn_handle, uint16_t server_rx_mtu)); +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_GATTS_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h new file mode 100644 index 0000000000..f0dde9a03a --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_hci.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ +*/ + + +#ifndef BLE_HCI_H__ +#define BLE_HCI_H__ +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup BLE_HCI_STATUS_CODES Bluetooth status codes + * @{ */ + +#define BLE_HCI_STATUS_CODE_SUCCESS 0x00 /**< Success. */ +#define BLE_HCI_STATUS_CODE_UNKNOWN_BTLE_COMMAND 0x01 /**< Unknown BLE Command. */ +#define BLE_HCI_STATUS_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02 /**< Unknown Connection Identifier. */ +/*0x03 Hardware Failure +0x04 Page Timeout +*/ +#define BLE_HCI_AUTHENTICATION_FAILURE 0x05 /**< Authentication Failure. */ +#define BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING 0x06 /**< Pin or Key missing. */ +#define BLE_HCI_MEMORY_CAPACITY_EXCEEDED 0x07 /**< Memory Capacity Exceeded. */ +#define BLE_HCI_CONNECTION_TIMEOUT 0x08 /**< Connection Timeout. */ +/*0x09 Connection Limit Exceeded +0x0A Synchronous Connection Limit To A Device Exceeded +0x0B ACL Connection Already Exists*/ +#define BLE_HCI_STATUS_CODE_COMMAND_DISALLOWED 0x0C /**< Command Disallowed. */ +/*0x0D Connection Rejected due to Limited Resources +0x0E Connection Rejected Due To Security Reasons +0x0F Connection Rejected due to Unacceptable BD_ADDR +0x10 Connection Accept Timeout Exceeded +0x11 Unsupported Feature or Parameter Value*/ +#define BLE_HCI_STATUS_CODE_INVALID_BTLE_COMMAND_PARAMETERS 0x12 /**< Invalid BLE Command Parameters. */ +#define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION 0x13 /**< Remote User Terminated Connection. */ +#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES 0x14 /**< Remote Device Terminated Connection due to low resources.*/ +#define BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF 0x15 /**< Remote Device Terminated Connection due to power off. */ +#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */ +/* +0x17 Repeated Attempts +0x18 Pairing Not Allowed +0x19 Unknown LMP PDU +*/ +#define BLE_HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A /**< Unsupported Remote Feature. */ +/* +0x1B SCO Offset Rejected +0x1C SCO Interval Rejected +0x1D SCO Air Mode Rejected*/ +#define BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS 0x1E /**< Invalid LMP Parameters. */ +#define BLE_HCI_STATUS_CODE_UNSPECIFIED_ERROR 0x1F /**< Unspecified Error. */ +/*0x20 Unsupported LMP Parameter Value +0x21 Role Change Not Allowed +*/ +#define BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT 0x22 /**< LMP Response Timeout. */ +#define BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION 0x23 /**< LMP Error Transaction Collision/LL Procedure Collision. */ +#define BLE_HCI_STATUS_CODE_LMP_PDU_NOT_ALLOWED 0x24 /**< LMP PDU Not Allowed. */ +/*0x25 Encryption Mode Not Acceptable +0x26 Link Key Can Not be Changed +0x27 Requested QoS Not Supported +*/ +#define BLE_HCI_INSTANT_PASSED 0x28 /**< Instant Passed. */ +#define BLE_HCI_PAIRING_WITH_UNIT_KEY_UNSUPPORTED 0x29 /**< Pairing with Unit Key Unsupported. */ +#define BLE_HCI_DIFFERENT_TRANSACTION_COLLISION 0x2A /**< Different Transaction Collision. */ +/* +0x2B Reserved +0x2C QoS Unacceptable Parameter +0x2D QoS Rejected +0x2E Channel Classification Not Supported +0x2F Insufficient Security +*/ +#define BLE_HCI_PARAMETER_OUT_OF_MANDATORY_RANGE 0x30 /**< Parameter Out Of Mandatory Range. */ +/* +0x31 Reserved +0x32 Role Switch Pending +0x33 Reserved +0x34 Reserved Slot Violation +0x35 Role Switch Failed +0x36 Extended Inquiry Response Too Large +0x37 Secure Simple Pairing Not Supported By Host. +0x38 Host Busy - Pairing +0x39 Connection Rejected due to No Suitable Channel Found*/ +#define BLE_HCI_CONTROLLER_BUSY 0x3A /**< Controller Busy. */ +#define BLE_HCI_CONN_INTERVAL_UNACCEPTABLE 0x3B /**< Connection Interval Unacceptable. */ +#define BLE_HCI_DIRECTED_ADVERTISER_TIMEOUT 0x3C /**< Directed Advertisement Timeout. */ +#define BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE 0x3D /**< Connection Terminated due to MIC Failure. */ +#define BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED 0x3E /**< Connection Failed to be Established. */ + +/** @} */ + + +#ifdef __cplusplus +} +#endif +#endif // BLE_HCI_H__ + +/** @} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h new file mode 100644 index 0000000000..7587350cf9 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2011 - 2020, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_L2CAP Logical Link Control and Adaptation Protocol (L2CAP) + @{ + @brief Definitions and prototypes for the L2CAP interface. + */ + +#ifndef BLE_L2CAP_H__ +#define BLE_L2CAP_H__ + +#include +#include "nrf_svc.h" +#include "nrf_error.h" +#include "ble_ranges.h" +#include "ble_types.h" +#include "ble_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup BLE_L2CAP_TERMINOLOGY Terminology + * @{ + * @details + * + * L2CAP SDU + * - A data unit that the application can send/receive to/from a peer. + * + * L2CAP PDU + * - A data unit that is exchanged between local and remote L2CAP entities. + * It consists of L2CAP protocol control information and payload fields. + * The payload field can contain an L2CAP SDU or a part of an L2CAP SDU. + * + * L2CAP MTU + * - The maximum length of an L2CAP SDU. + * + * L2CAP MPS + * - The maximum length of an L2CAP PDU payload field. + * + * Credits + * - A value indicating the number of L2CAP PDUs that the receiver of the credit can send to the peer. + * @} */ + +/**@addtogroup BLE_L2CAP_ENUMERATIONS Enumerations + * @{ */ + +/**@brief L2CAP API SVC numbers. */ +enum BLE_L2CAP_SVCS +{ + SD_BLE_L2CAP_CH_SETUP = BLE_L2CAP_SVC_BASE + 0, /**< Set up an L2CAP channel. */ + SD_BLE_L2CAP_CH_RELEASE = BLE_L2CAP_SVC_BASE + 1, /**< Release an L2CAP channel. */ + SD_BLE_L2CAP_CH_RX = BLE_L2CAP_SVC_BASE + 2, /**< Receive an SDU on an L2CAP channel. */ + SD_BLE_L2CAP_CH_TX = BLE_L2CAP_SVC_BASE + 3, /**< Transmit an SDU on an L2CAP channel. */ + SD_BLE_L2CAP_CH_FLOW_CONTROL = BLE_L2CAP_SVC_BASE + 4, /**< Advanced SDU reception flow control. */ +}; + +/**@brief L2CAP Event IDs. */ +enum BLE_L2CAP_EVTS +{ + BLE_L2CAP_EVT_CH_SETUP_REQUEST = BLE_L2CAP_EVT_BASE + 0, /**< L2CAP Channel Setup Request event. + \n Reply with @ref sd_ble_l2cap_ch_setup. + \n See @ref ble_l2cap_evt_ch_setup_request_t. */ + BLE_L2CAP_EVT_CH_SETUP_REFUSED = BLE_L2CAP_EVT_BASE + 1, /**< L2CAP Channel Setup Refused event. + \n See @ref ble_l2cap_evt_ch_setup_refused_t. */ + BLE_L2CAP_EVT_CH_SETUP = BLE_L2CAP_EVT_BASE + 2, /**< L2CAP Channel Setup Completed event. + \n See @ref ble_l2cap_evt_ch_setup_t. */ + BLE_L2CAP_EVT_CH_RELEASED = BLE_L2CAP_EVT_BASE + 3, /**< L2CAP Channel Released event. + \n No additional event structure applies. */ + BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED = BLE_L2CAP_EVT_BASE + 4, /**< L2CAP Channel SDU data buffer released event. + \n See @ref ble_l2cap_evt_ch_sdu_buf_released_t. */ + BLE_L2CAP_EVT_CH_CREDIT = BLE_L2CAP_EVT_BASE + 5, /**< L2CAP Channel Credit received. + \n See @ref ble_l2cap_evt_ch_credit_t. */ + BLE_L2CAP_EVT_CH_RX = BLE_L2CAP_EVT_BASE + 6, /**< L2CAP Channel SDU received. + \n See @ref ble_l2cap_evt_ch_rx_t. */ + BLE_L2CAP_EVT_CH_TX = BLE_L2CAP_EVT_BASE + 7, /**< L2CAP Channel SDU transmitted. + \n See @ref ble_l2cap_evt_ch_tx_t. */ +}; + +/** @} */ + +/**@addtogroup BLE_L2CAP_DEFINES Defines + * @{ */ + +/**@brief Maximum number of L2CAP channels per connection. */ +#define BLE_L2CAP_CH_COUNT_MAX (64) + +/**@brief Minimum L2CAP MTU, in bytes. */ +#define BLE_L2CAP_MTU_MIN (23) + +/**@brief Minimum L2CAP MPS, in bytes. */ +#define BLE_L2CAP_MPS_MIN (23) + +/**@brief Invalid CID. */ +#define BLE_L2CAP_CID_INVALID (0x0000) + +/**@brief Default number of credits for @ref sd_ble_l2cap_ch_flow_control. */ +#define BLE_L2CAP_CREDITS_DEFAULT (1) + +/**@defgroup BLE_L2CAP_CH_SETUP_REFUSED_SRCS L2CAP channel setup refused sources + * @{ */ +#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_LOCAL (0x01) /**< Local. */ +#define BLE_L2CAP_CH_SETUP_REFUSED_SRC_REMOTE (0x02) /**< Remote. */ + /** @} */ + + /** @defgroup BLE_L2CAP_CH_STATUS_CODES L2CAP channel status codes + * @{ */ +#define BLE_L2CAP_CH_STATUS_CODE_SUCCESS (0x0000) /**< Success. */ +#define BLE_L2CAP_CH_STATUS_CODE_LE_PSM_NOT_SUPPORTED (0x0002) /**< LE_PSM not supported. */ +#define BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES (0x0004) /**< No resources available. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHENTICATION (0x0005) /**< Insufficient authentication. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_AUTHORIZATION (0x0006) /**< Insufficient authorization. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC_KEY_SIZE (0x0007) /**< Insufficient encryption key size. */ +#define BLE_L2CAP_CH_STATUS_CODE_INSUFF_ENC (0x0008) /**< Insufficient encryption. */ +#define BLE_L2CAP_CH_STATUS_CODE_INVALID_SCID (0x0009) /**< Invalid Source CID. */ +#define BLE_L2CAP_CH_STATUS_CODE_SCID_ALLOCATED (0x000A) /**< Source CID already allocated. */ +#define BLE_L2CAP_CH_STATUS_CODE_UNACCEPTABLE_PARAMS (0x000B) /**< Unacceptable parameters. */ +#define BLE_L2CAP_CH_STATUS_CODE_NOT_UNDERSTOOD (0x8000) /**< Command Reject received instead of LE Credit Based Connection Response. */ +#define BLE_L2CAP_CH_STATUS_CODE_TIMEOUT (0xC000) /**< Operation timed out. */ +/** @} */ + +/** @} */ + +/**@addtogroup BLE_L2CAP_STRUCTURES Structures + * @{ */ + +/** + * @brief BLE L2CAP connection configuration parameters, set with @ref sd_ble_cfg_set. + * + * @note These parameters are set per connection, so all L2CAP channels created on this connection + * will have the same parameters. + * + * @retval ::NRF_ERROR_INVALID_PARAM One or more of the following is true: + * - rx_mps is smaller than @ref BLE_L2CAP_MPS_MIN. + * - tx_mps is smaller than @ref BLE_L2CAP_MPS_MIN. + * - ch_count is greater than @ref BLE_L2CAP_CH_COUNT_MAX. + * @retval ::NRF_ERROR_NO_MEM rx_mps or tx_mps is set too high. + */ +typedef struct +{ + uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall + be able to receive on L2CAP channels on connections with this + configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */ + uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall + be able to transmit on L2CAP channels on connections with this + configuration. The minimum value is @ref BLE_L2CAP_MPS_MIN. */ + uint8_t rx_queue_size; /**< Number of SDU data buffers that can be queued for reception per + L2CAP channel. The minimum value is one. */ + uint8_t tx_queue_size; /**< Number of SDU data buffers that can be queued for transmission + per L2CAP channel. The minimum value is one. */ + uint8_t ch_count; /**< Number of L2CAP channels the application can create per connection + with this configuration. The default value is zero, the maximum + value is @ref BLE_L2CAP_CH_COUNT_MAX. + @note if this parameter is set to zero, all other parameters in + @ref ble_l2cap_conn_cfg_t are ignored. */ +} ble_l2cap_conn_cfg_t; + +/**@brief L2CAP channel RX parameters. */ +typedef struct +{ + uint16_t rx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP shall be able to + receive on this L2CAP channel. + - Must be equal to or greater than @ref BLE_L2CAP_MTU_MIN. */ + uint16_t rx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP shall be + able to receive on this L2CAP channel. + - Must be equal to or greater than @ref BLE_L2CAP_MPS_MIN. + - Must be equal to or less than @ref ble_l2cap_conn_cfg_t::rx_mps. */ + ble_data_t sdu_buf; /**< SDU data buffer for reception. + - If @ref ble_data_t::p_data is non-NULL, initial credits are + issued to the peer. + - If @ref ble_data_t::p_data is NULL, no initial credits are + issued to the peer. */ +} ble_l2cap_ch_rx_params_t; + +/**@brief L2CAP channel setup parameters. */ +typedef struct +{ + ble_l2cap_ch_rx_params_t rx_params; /**< L2CAP channel RX parameters. */ + uint16_t le_psm; /**< LE Protocol/Service Multiplexer. Used when requesting + setup of an L2CAP channel, ignored otherwise. */ + uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES. + Used when replying to a setup request of an L2CAP + channel, ignored otherwise. */ +} ble_l2cap_ch_setup_params_t; + +/**@brief L2CAP channel TX parameters. */ +typedef struct +{ + uint16_t tx_mtu; /**< The maximum L2CAP SDU size, in bytes, that L2CAP is able to + transmit on this L2CAP channel. */ + uint16_t peer_mps; /**< The maximum L2CAP PDU payload size, in bytes, that the peer is + able to receive on this L2CAP channel. */ + uint16_t tx_mps; /**< The maximum L2CAP PDU payload size, in bytes, that L2CAP is able + to transmit on this L2CAP channel. This is effective tx_mps, + selected by the SoftDevice as + MIN( @ref ble_l2cap_ch_tx_params_t::peer_mps, @ref ble_l2cap_conn_cfg_t::tx_mps ) */ + uint16_t credits; /**< Initial credits given by the peer. */ +} ble_l2cap_ch_tx_params_t; + +/**@brief L2CAP Channel Setup Request event. */ +typedef struct +{ + ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */ + uint16_t le_psm; /**< LE Protocol/Service Multiplexer. */ +} ble_l2cap_evt_ch_setup_request_t; + +/**@brief L2CAP Channel Setup Refused event. */ +typedef struct +{ + uint8_t source; /**< Source, see @ref BLE_L2CAP_CH_SETUP_REFUSED_SRCS */ + uint16_t status; /**< Status code, see @ref BLE_L2CAP_CH_STATUS_CODES */ +} ble_l2cap_evt_ch_setup_refused_t; + +/**@brief L2CAP Channel Setup Completed event. */ +typedef struct +{ + ble_l2cap_ch_tx_params_t tx_params; /**< L2CAP channel TX parameters. */ +} ble_l2cap_evt_ch_setup_t; + +/**@brief L2CAP Channel SDU Data Buffer Released event. */ +typedef struct +{ + ble_data_t sdu_buf; /**< Returned reception or transmission SDU data buffer. The SoftDevice + returns SDU data buffers supplied by the application, which have + not yet been returned previously via a @ref BLE_L2CAP_EVT_CH_RX or + @ref BLE_L2CAP_EVT_CH_TX event. */ +} ble_l2cap_evt_ch_sdu_buf_released_t; + +/**@brief L2CAP Channel Credit received event. */ +typedef struct +{ + uint16_t credits; /**< Additional credits given by the peer. */ +} ble_l2cap_evt_ch_credit_t; + +/**@brief L2CAP Channel received SDU event. */ +typedef struct +{ + uint16_t sdu_len; /**< Total SDU length, in bytes. */ + ble_data_t sdu_buf; /**< SDU data buffer. + @note If there is not enough space in the buffer + (sdu_buf.len < sdu_len) then the rest of the SDU will be + silently discarded by the SoftDevice. */ +} ble_l2cap_evt_ch_rx_t; + +/**@brief L2CAP Channel transmitted SDU event. */ +typedef struct +{ + ble_data_t sdu_buf; /**< SDU data buffer. */ +} ble_l2cap_evt_ch_tx_t; + +/**@brief L2CAP event structure. */ +typedef struct +{ + uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or + @ref BLE_L2CAP_CID_INVALID if not present. */ + union + { + ble_l2cap_evt_ch_setup_request_t ch_setup_request; /**< L2CAP Channel Setup Request Event Parameters. */ + ble_l2cap_evt_ch_setup_refused_t ch_setup_refused; /**< L2CAP Channel Setup Refused Event Parameters. */ + ble_l2cap_evt_ch_setup_t ch_setup; /**< L2CAP Channel Setup Completed Event Parameters. */ + ble_l2cap_evt_ch_sdu_buf_released_t ch_sdu_buf_released;/**< L2CAP Channel SDU Data Buffer Released Event Parameters. */ + ble_l2cap_evt_ch_credit_t credit; /**< L2CAP Channel Credit Received Event Parameters. */ + ble_l2cap_evt_ch_rx_t rx; /**< L2CAP Channel SDU Received Event Parameters. */ + ble_l2cap_evt_ch_tx_t tx; /**< L2CAP Channel SDU Transmitted Event Parameters. */ + } params; /**< Event Parameters. */ +} ble_l2cap_evt_t; + +/** @} */ + +/**@addtogroup BLE_L2CAP_FUNCTIONS Functions + * @{ */ + +/**@brief Set up an L2CAP channel. + * + * @details This function is used to: + * - Request setup of an L2CAP channel: sends an LE Credit Based Connection Request packet to a peer. + * - Reply to a setup request of an L2CAP channel (if called in response to a + * @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST event): sends an LE Credit Based Connection + * Response packet to a peer. + * + * @note A call to this function will require the application to keep the SDU data buffer alive + * until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX or + * @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_SETUP, Setup successful.} + * @event{@ref BLE_L2CAP_EVT_CH_SETUP_REFUSED, Setup failed.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_SETUP_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in,out] p_local_cid Pointer to a uint16_t containing Local Channel ID of the L2CAP channel: + * - As input: @ref BLE_L2CAP_CID_INVALID when requesting setup of an L2CAP + * channel or local_cid provided in the @ref BLE_L2CAP_EVT_CH_SETUP_REQUEST + * event when replying to a setup request of an L2CAP channel. + * - As output: local_cid for this channel. + * @param[in] p_params L2CAP channel parameters. + * + * @retval ::NRF_SUCCESS Successfully queued request or response for transmission. + * @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. + * @retval ::NRF_ERROR_INVALID_LENGTH Supplied higher rx_mps than has been configured on this link. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (L2CAP channel already set up). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_RESOURCES The limit has been reached for available L2CAP channels, + * see @ref ble_l2cap_conn_cfg_t::ch_count. + */ +SVCALL(SD_BLE_L2CAP_CH_SETUP, uint32_t, sd_ble_l2cap_ch_setup(uint16_t conn_handle, uint16_t *p_local_cid, ble_l2cap_ch_setup_params_t const *p_params)); + +/**@brief Release an L2CAP channel. + * + * @details This sends a Disconnection Request packet to a peer. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_RELEASED, Release complete.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_RELEASE_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * + * @retval ::NRF_SUCCESS Successfully queued request for transmission. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for the L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + */ +SVCALL(SD_BLE_L2CAP_CH_RELEASE, uint32_t, sd_ble_l2cap_ch_release(uint16_t conn_handle, uint16_t local_cid)); + +/**@brief Receive an SDU on an L2CAP channel. + * + * @details This may issue additional credits to the peer using an LE Flow Control Credit packet. + * + * @note A call to this function will require the application to keep the memory pointed by + * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_RX + * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::rx_queue_size SDU data buffers + * for reception per L2CAP channel. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_RX, The SDU is received.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_RX_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * @param[in] p_sdu_buf Pointer to the SDU data buffer. + * + * @retval ::NRF_SUCCESS Buffer accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for an L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_RESOURCES Too many SDU data buffers supplied. Wait for a + * @ref BLE_L2CAP_EVT_CH_RX event and retry. + */ +SVCALL(SD_BLE_L2CAP_CH_RX, uint32_t, sd_ble_l2cap_ch_rx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf)); + +/**@brief Transmit an SDU on an L2CAP channel. + * + * @note A call to this function will require the application to keep the memory pointed by + * @ref ble_data_t::p_data alive until the SDU data buffer is returned in @ref BLE_L2CAP_EVT_CH_TX + * or @ref BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED event. + * + * @note The SoftDevice can queue up to @ref ble_l2cap_conn_cfg_t::tx_queue_size SDUs for + * transmission per L2CAP channel. + * + * @note The application can keep track of the available credits for transmission by following + * the procedure below: + * - Store initial credits given by the peer in a variable. + * (Initial credits are provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.) + * - Decrement the variable, which stores the currently available credits, by + * ceiling((@ref ble_data_t::len + 2) / tx_mps) when a call to this function returns + * @ref NRF_SUCCESS. (tx_mps is provided in a @ref BLE_L2CAP_EVT_CH_SETUP event.) + * - Increment the variable, which stores the currently available credits, by additional + * credits given by the peer in a @ref BLE_L2CAP_EVT_CH_CREDIT event. + * + * @events + * @event{@ref BLE_L2CAP_EVT_CH_TX, The SDU is transmitted.} + * @endevents + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_TX_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel. + * @param[in] p_sdu_buf Pointer to the SDU data buffer. + * + * @retval ::NRF_SUCCESS Successfully queued L2CAP SDU for transmission. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for the L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + * @retval ::NRF_ERROR_DATA_SIZE Invalid SDU length supplied, must not be more than + * @ref ble_l2cap_ch_tx_params_t::tx_mtu provided in + * @ref BLE_L2CAP_EVT_CH_SETUP event. + * @retval ::NRF_ERROR_RESOURCES Too many SDUs queued for transmission. Wait for a + * @ref BLE_L2CAP_EVT_CH_TX event and retry. + */ +SVCALL(SD_BLE_L2CAP_CH_TX, uint32_t, sd_ble_l2cap_ch_tx(uint16_t conn_handle, uint16_t local_cid, ble_data_t const *p_sdu_buf)); + +/**@brief Advanced SDU reception flow control. + * + * @details Adjust the way the SoftDevice issues credits to the peer. + * This may issue additional credits to the peer using an LE Flow Control Credit packet. + * + * @mscs + * @mmsc{@ref BLE_L2CAP_CH_FLOW_CONTROL_MSC} + * @endmscs + * + * @param[in] conn_handle Connection Handle. + * @param[in] local_cid Local Channel ID of the L2CAP channel or @ref BLE_L2CAP_CID_INVALID to set + * the value that will be used for newly created channels. + * @param[in] credits Number of credits that the SoftDevice will make sure the peer has every + * time it starts using a new reception buffer. + * - @ref BLE_L2CAP_CREDITS_DEFAULT is the default value the SoftDevice will + * use if this function is not called. + * - If set to zero, the SoftDevice will stop issuing credits for new reception + * buffers the application provides or has provided. SDU reception that is + * currently ongoing will be allowed to complete. + * @param[out] p_credits NULL or pointer to a uint16_t. If a valid pointer is provided, it will be + * written by the SoftDevice with the number of credits that is or will be + * available to the peer. If the value written by the SoftDevice is 0 when + * credits parameter was set to 0, the peer will not be able to send more + * data until more credits are provided by calling this function again with + * credits > 0. This parameter is ignored when local_cid is set to + * @ref BLE_L2CAP_CID_INVALID. + * + * @note Application should take care when setting number of credits higher than default value. In + * this case the application must make sure that the SoftDevice always has reception buffers + * available (see @ref sd_ble_l2cap_ch_rx) for that channel. If the SoftDevice does not have + * such buffers available, packets may be NACKed on the Link Layer and all Bluetooth traffic + * on the connection handle may be stalled until the SoftDevice again has an available + * reception buffer. This applies even if the application has used this call to set the + * credits back to default, or zero. + * + * @retval ::NRF_SUCCESS Flow control parameters accepted. + * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. + * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle. + * @retval ::NRF_ERROR_INVALID_STATE Invalid State to perform operation (Setup or release is + * in progress for an L2CAP channel). + * @retval ::NRF_ERROR_NOT_FOUND CID not found. + */ +SVCALL(SD_BLE_L2CAP_CH_FLOW_CONTROL, uint32_t, sd_ble_l2cap_ch_flow_control(uint16_t conn_handle, uint16_t local_cid, uint16_t credits, uint16_t *p_credits)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // BLE_L2CAP_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h new file mode 100644 index 0000000000..0935bca071 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_ranges.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2012 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @defgroup ble_ranges Module specific SVC, event and option number subranges + @{ + + @brief Definition of SVC, event and option number subranges for each API module. + + @note + SVCs, event and option numbers are split into subranges for each API module. + Each module receives its entire allocated range of SVC calls, whether implemented or not, + but return BLE_ERROR_NOT_SUPPORTED for unimplemented or undefined calls in its range. + + Note that the symbols BLE__SVC_LAST is the end of the allocated SVC range, + rather than the last SVC function call actually defined and implemented. + + Specific SVC, event and option values are defined in each module's ble_.h file, + which defines names of each individual SVC code based on the range start value. +*/ + +#ifndef BLE_RANGES_H__ +#define BLE_RANGES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define BLE_SVC_BASE 0x60 /**< Common BLE SVC base. */ +#define BLE_SVC_LAST 0x6B /**< Common BLE SVC last. */ + +#define BLE_GAP_SVC_BASE 0x6C /**< GAP BLE SVC base. */ +#define BLE_GAP_SVC_LAST 0x9A /**< GAP BLE SVC last. */ + +#define BLE_GATTC_SVC_BASE 0x9B /**< GATTC BLE SVC base. */ +#define BLE_GATTC_SVC_LAST 0xA7 /**< GATTC BLE SVC last. */ + +#define BLE_GATTS_SVC_BASE 0xA8 /**< GATTS BLE SVC base. */ +#define BLE_GATTS_SVC_LAST 0xB7 /**< GATTS BLE SVC last. */ + +#define BLE_L2CAP_SVC_BASE 0xB8 /**< L2CAP BLE SVC base. */ +#define BLE_L2CAP_SVC_LAST 0xBF /**< L2CAP BLE SVC last. */ + + +#define BLE_EVT_INVALID 0x00 /**< Invalid BLE Event. */ + +#define BLE_EVT_BASE 0x01 /**< Common BLE Event base. */ +#define BLE_EVT_LAST 0x0F /**< Common BLE Event last. */ + +#define BLE_GAP_EVT_BASE 0x10 /**< GAP BLE Event base. */ +#define BLE_GAP_EVT_LAST 0x2F /**< GAP BLE Event last. */ + +#define BLE_GATTC_EVT_BASE 0x30 /**< GATTC BLE Event base. */ +#define BLE_GATTC_EVT_LAST 0x4F /**< GATTC BLE Event last. */ + +#define BLE_GATTS_EVT_BASE 0x50 /**< GATTS BLE Event base. */ +#define BLE_GATTS_EVT_LAST 0x6F /**< GATTS BLE Event last. */ + +#define BLE_L2CAP_EVT_BASE 0x70 /**< L2CAP BLE Event base. */ +#define BLE_L2CAP_EVT_LAST 0x8F /**< L2CAP BLE Event last. */ + + +#define BLE_OPT_INVALID 0x00 /**< Invalid BLE Option. */ + +#define BLE_OPT_BASE 0x01 /**< Common BLE Option base. */ +#define BLE_OPT_LAST 0x1F /**< Common BLE Option last. */ + +#define BLE_GAP_OPT_BASE 0x20 /**< GAP BLE Option base. */ +#define BLE_GAP_OPT_LAST 0x3F /**< GAP BLE Option last. */ + +#define BLE_GATT_OPT_BASE 0x40 /**< GATT BLE Option base. */ +#define BLE_GATT_OPT_LAST 0x5F /**< GATT BLE Option last. */ + +#define BLE_GATTC_OPT_BASE 0x60 /**< GATTC BLE Option base. */ +#define BLE_GATTC_OPT_LAST 0x7F /**< GATTC BLE Option last. */ + +#define BLE_GATTS_OPT_BASE 0x80 /**< GATTS BLE Option base. */ +#define BLE_GATTS_OPT_LAST 0x9F /**< GATTS BLE Option last. */ + +#define BLE_L2CAP_OPT_BASE 0xA0 /**< L2CAP BLE Option base. */ +#define BLE_L2CAP_OPT_LAST 0xBF /**< L2CAP BLE Option last. */ + + +#define BLE_CFG_INVALID 0x00 /**< Invalid BLE configuration. */ + +#define BLE_CFG_BASE 0x01 /**< Common BLE configuration base. */ +#define BLE_CFG_LAST 0x1F /**< Common BLE configuration last. */ + +#define BLE_CONN_CFG_BASE 0x20 /**< BLE connection configuration base. */ +#define BLE_CONN_CFG_LAST 0x3F /**< BLE connection configuration last. */ + +#define BLE_GAP_CFG_BASE 0x40 /**< GAP BLE configuration base. */ +#define BLE_GAP_CFG_LAST 0x5F /**< GAP BLE configuration last. */ + +#define BLE_GATT_CFG_BASE 0x60 /**< GATT BLE configuration base. */ +#define BLE_GATT_CFG_LAST 0x7F /**< GATT BLE configuration last. */ + +#define BLE_GATTC_CFG_BASE 0x80 /**< GATTC BLE configuration base. */ +#define BLE_GATTC_CFG_LAST 0x9F /**< GATTC BLE configuration last. */ + +#define BLE_GATTS_CFG_BASE 0xA0 /**< GATTS BLE configuration base. */ +#define BLE_GATTS_CFG_LAST 0xBF /**< GATTS BLE configuration last. */ + +#define BLE_L2CAP_CFG_BASE 0xC0 /**< L2CAP BLE configuration base. */ +#define BLE_L2CAP_CFG_LAST 0xDF /**< L2CAP BLE configuration last. */ + + + + + +#ifdef __cplusplus +} +#endif +#endif /* BLE_RANGES_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h new file mode 100644 index 0000000000..88c93180c8 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_types.h @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup BLE_COMMON + @{ + @defgroup ble_types Common types and macro definitions + @{ + + @brief Common types and macro definitions for the BLE SoftDevice. + */ + +#ifndef BLE_TYPES_H__ +#define BLE_TYPES_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup BLE_TYPES_DEFINES Defines + * @{ */ + +/** @defgroup BLE_CONN_HANDLES BLE Connection Handles + * @{ */ +#define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */ +#define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */ +/** @} */ + + +/** @defgroup BLE_UUID_VALUES Assigned Values for BLE UUIDs + * @{ */ +/* Generic UUIDs, applicable to all services */ +#define BLE_UUID_UNKNOWN 0x0000 /**< Reserved UUID. */ +#define BLE_UUID_SERVICE_PRIMARY 0x2800 /**< Primary Service. */ +#define BLE_UUID_SERVICE_SECONDARY 0x2801 /**< Secondary Service. */ +#define BLE_UUID_SERVICE_INCLUDE 0x2802 /**< Include. */ +#define BLE_UUID_CHARACTERISTIC 0x2803 /**< Characteristic. */ +#define BLE_UUID_DESCRIPTOR_CHAR_EXT_PROP 0x2900 /**< Characteristic Extended Properties Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_USER_DESC 0x2901 /**< Characteristic User Description Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG 0x2902 /**< Client Characteristic Configuration Descriptor. */ +#define BLE_UUID_DESCRIPTOR_SERVER_CHAR_CONFIG 0x2903 /**< Server Characteristic Configuration Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT 0x2904 /**< Characteristic Presentation Format Descriptor. */ +#define BLE_UUID_DESCRIPTOR_CHAR_AGGREGATE_FORMAT 0x2905 /**< Characteristic Aggregate Format Descriptor. */ +/* GATT specific UUIDs */ +#define BLE_UUID_GATT 0x1801 /**< Generic Attribute Profile. */ +#define BLE_UUID_GATT_CHARACTERISTIC_SERVICE_CHANGED 0x2A05 /**< Service Changed Characteristic. */ +/* GAP specific UUIDs */ +#define BLE_UUID_GAP 0x1800 /**< Generic Access Profile. */ +#define BLE_UUID_GAP_CHARACTERISTIC_DEVICE_NAME 0x2A00 /**< Device Name Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_APPEARANCE 0x2A01 /**< Appearance Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_RECONN_ADDR 0x2A03 /**< Reconnection Address Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_PPCP 0x2A04 /**< Peripheral Preferred Connection Parameters Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_CAR 0x2AA6 /**< Central Address Resolution Characteristic. */ +#define BLE_UUID_GAP_CHARACTERISTIC_RPA_ONLY 0x2AC9 /**< Resolvable Private Address Only Characteristic. */ +/** @} */ + + +/** @defgroup BLE_UUID_TYPES Types of UUID + * @{ */ +#define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */ +#define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */ +#define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */ +/** @} */ + + +/** @defgroup BLE_APPEARANCES Bluetooth Appearance values + * @note Retrieved from http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml + * @{ */ +#define BLE_APPEARANCE_UNKNOWN 0 /**< Unknown. */ +#define BLE_APPEARANCE_GENERIC_PHONE 64 /**< Generic Phone. */ +#define BLE_APPEARANCE_GENERIC_COMPUTER 128 /**< Generic Computer. */ +#define BLE_APPEARANCE_GENERIC_WATCH 192 /**< Generic Watch. */ +#define BLE_APPEARANCE_WATCH_SPORTS_WATCH 193 /**< Watch: Sports Watch. */ +#define BLE_APPEARANCE_GENERIC_CLOCK 256 /**< Generic Clock. */ +#define BLE_APPEARANCE_GENERIC_DISPLAY 320 /**< Generic Display. */ +#define BLE_APPEARANCE_GENERIC_REMOTE_CONTROL 384 /**< Generic Remote Control. */ +#define BLE_APPEARANCE_GENERIC_EYE_GLASSES 448 /**< Generic Eye-glasses. */ +#define BLE_APPEARANCE_GENERIC_TAG 512 /**< Generic Tag. */ +#define BLE_APPEARANCE_GENERIC_KEYRING 576 /**< Generic Keyring. */ +#define BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 640 /**< Generic Media Player. */ +#define BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 704 /**< Generic Barcode Scanner. */ +#define BLE_APPEARANCE_GENERIC_THERMOMETER 768 /**< Generic Thermometer. */ +#define BLE_APPEARANCE_THERMOMETER_EAR 769 /**< Thermometer: Ear. */ +#define BLE_APPEARANCE_GENERIC_HEART_RATE_SENSOR 832 /**< Generic Heart rate Sensor. */ +#define BLE_APPEARANCE_HEART_RATE_SENSOR_HEART_RATE_BELT 833 /**< Heart Rate Sensor: Heart Rate Belt. */ +#define BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 896 /**< Generic Blood Pressure. */ +#define BLE_APPEARANCE_BLOOD_PRESSURE_ARM 897 /**< Blood Pressure: Arm. */ +#define BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 898 /**< Blood Pressure: Wrist. */ +#define BLE_APPEARANCE_GENERIC_HID 960 /**< Human Interface Device (HID). */ +#define BLE_APPEARANCE_HID_KEYBOARD 961 /**< Keyboard (HID Subtype). */ +#define BLE_APPEARANCE_HID_MOUSE 962 /**< Mouse (HID Subtype). */ +#define BLE_APPEARANCE_HID_JOYSTICK 963 /**< Joystick (HID Subtype). */ +#define BLE_APPEARANCE_HID_GAMEPAD 964 /**< Gamepad (HID Subtype). */ +#define BLE_APPEARANCE_HID_DIGITIZERSUBTYPE 965 /**< Digitizer Tablet (HID Subtype). */ +#define BLE_APPEARANCE_HID_CARD_READER 966 /**< Card Reader (HID Subtype). */ +#define BLE_APPEARANCE_HID_DIGITAL_PEN 967 /**< Digital Pen (HID Subtype). */ +#define BLE_APPEARANCE_HID_BARCODE 968 /**< Barcode Scanner (HID Subtype). */ +#define BLE_APPEARANCE_GENERIC_GLUCOSE_METER 1024 /**< Generic Glucose Meter. */ +#define BLE_APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR 1088 /**< Generic Running Walking Sensor. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE 1089 /**< Running Walking Sensor: In-Shoe. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE 1090 /**< Running Walking Sensor: On-Shoe. */ +#define BLE_APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP 1091 /**< Running Walking Sensor: On-Hip. */ +#define BLE_APPEARANCE_GENERIC_CYCLING 1152 /**< Generic Cycling. */ +#define BLE_APPEARANCE_CYCLING_CYCLING_COMPUTER 1153 /**< Cycling: Cycling Computer. */ +#define BLE_APPEARANCE_CYCLING_SPEED_SENSOR 1154 /**< Cycling: Speed Sensor. */ +#define BLE_APPEARANCE_CYCLING_CADENCE_SENSOR 1155 /**< Cycling: Cadence Sensor. */ +#define BLE_APPEARANCE_CYCLING_POWER_SENSOR 1156 /**< Cycling: Power Sensor. */ +#define BLE_APPEARANCE_CYCLING_SPEED_CADENCE_SENSOR 1157 /**< Cycling: Speed and Cadence Sensor. */ +#define BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 3136 /**< Generic Pulse Oximeter. */ +#define BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 3137 /**< Fingertip (Pulse Oximeter subtype). */ +#define BLE_APPEARANCE_PULSE_OXIMETER_WRIST_WORN 3138 /**< Wrist Worn(Pulse Oximeter subtype). */ +#define BLE_APPEARANCE_GENERIC_WEIGHT_SCALE 3200 /**< Generic Weight Scale. */ +#define BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS_ACT 5184 /**< Generic Outdoor Sports Activity. */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_DISP 5185 /**< Location Display Device (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_DISP 5186 /**< Location and Navigation Display Device (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_POD 5187 /**< Location Pod (Outdoor Sports Activity subtype). */ +#define BLE_APPEARANCE_OUTDOOR_SPORTS_ACT_LOC_AND_NAV_POD 5188 /**< Location and Navigation Pod (Outdoor Sports Activity subtype). */ +/** @} */ + +/** @brief Set .type and .uuid fields of ble_uuid_struct to specified UUID value. */ +#define BLE_UUID_BLE_ASSIGN(instance, value) do {\ + instance.type = BLE_UUID_TYPE_BLE; \ + instance.uuid = value;} while(0) + +/** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */ +#define BLE_UUID_COPY_PTR(dst, src) do {\ + (dst)->type = (src)->type; \ + (dst)->uuid = (src)->uuid;} while(0) + +/** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */ +#define BLE_UUID_COPY_INST(dst, src) do {\ + (dst).type = (src).type; \ + (dst).uuid = (src).uuid;} while(0) + +/** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ +#define BLE_UUID_EQ(p_uuid1, p_uuid2) \ + (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid)) + +/** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */ +#define BLE_UUID_NEQ(p_uuid1, p_uuid2) \ + (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid)) + +/** @} */ + +/** @addtogroup BLE_TYPES_STRUCTURES Structures + * @{ */ + +/** @brief 128 bit UUID values. */ +typedef struct +{ + uint8_t uuid128[16]; /**< Little-Endian UUID bytes. */ +} ble_uuid128_t; + +/** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */ +typedef struct +{ + uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */ + uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is @ref BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */ +} ble_uuid_t; + +/**@brief Data structure. */ +typedef struct +{ + uint8_t *p_data; /**< Pointer to the data buffer provided to/from the application. */ + uint16_t len; /**< Length of the data buffer, in bytes. */ +} ble_data_t; + +/** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* BLE_TYPES_H__ */ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h new file mode 100644 index 0000000000..42e09fc87c --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf52/nrf_mbr.h @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @defgroup nrf_mbr_api Master Boot Record API + @{ + + @brief APIs for updating SoftDevice and BootLoader + +*/ + +#ifndef NRF_MBR_H__ +#define NRF_MBR_H__ + +#include "nrf_svc.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup NRF_MBR_DEFINES Defines + * @{ */ + +/**@brief MBR SVC Base number. */ +#define MBR_SVC_BASE (0x18) + +/**@brief Page size in words. */ +#define MBR_PAGE_SIZE_IN_WORDS (1024) + +/** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash. +This is the offset where the first byte of the SoftDevice hex file is written. */ +#define MBR_SIZE (0x1000) + +/** @brief Location (in the flash memory) of the bootloader address. */ +#define MBR_BOOTLOADER_ADDR (0xFF8) + +/** @brief Location (in UICR) of the bootloader address. */ +#define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0])) + +/** @brief Location (in the flash memory) of the address of the MBR parameter page. */ +#define MBR_PARAM_PAGE_ADDR (0xFFC) + +/** @brief Location (in UICR) of the address of the MBR parameter page. */ +#define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1])) + + +/** @} */ + +/** @addtogroup NRF_MBR_ENUMS Enumerations + * @{ */ + +/**@brief nRF Master Boot Record API SVC numbers. */ +enum NRF_MBR_SVCS +{ + SD_MBR_COMMAND = MBR_SVC_BASE, /**< ::sd_mbr_command */ +}; + +/**@brief Possible values for ::sd_mbr_command_t.command */ +enum NRF_MBR_COMMANDS +{ + SD_MBR_COMMAND_COPY_BL, /**< Copy a new BootLoader. @see ::sd_mbr_command_copy_bl_t*/ + SD_MBR_COMMAND_COPY_SD, /**< Copy a new SoftDevice. @see ::sd_mbr_command_copy_sd_t*/ + SD_MBR_COMMAND_INIT_SD, /**< Initialize forwarding interrupts to SD, and run reset function in SD. Does not require any parameters in ::sd_mbr_command_t params.*/ + SD_MBR_COMMAND_COMPARE, /**< This command works like memcmp. @see ::sd_mbr_command_compare_t*/ + SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, /**< Change the address the MBR starts after a reset. @see ::sd_mbr_command_vector_table_base_set_t*/ + SD_MBR_COMMAND_RESERVED, + SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET, /**< Start forwarding all interrupts to this address. @see ::sd_mbr_command_irq_forward_address_set_t*/ +}; + +/** @} */ + +/** @addtogroup NRF_MBR_TYPES Types + * @{ */ + +/**@brief This command copies part of a new SoftDevice + * + * The destination area is erased before copying. + * If dst is in the middle of a flash page, that whole flash page will be erased. + * If (dst+len) is in the middle of a flash page, that whole flash page will be erased. + * + * The user of this function is responsible for setting the BPROT registers. + * + * @retval ::NRF_SUCCESS indicates that the contents of the memory blocks where copied correctly. + * @retval ::NRF_ERROR_INTERNAL indicates that the contents of the memory blocks where not verified correctly after copying. + */ +typedef struct +{ + uint32_t *src; /**< Pointer to the source of data to be copied.*/ + uint32_t *dst; /**< Pointer to the destination where the content is to be copied.*/ + uint32_t len; /**< Number of 32 bit words to copy. Must be a multiple of @ref MBR_PAGE_SIZE_IN_WORDS words.*/ +} sd_mbr_command_copy_sd_t; + + +/**@brief This command works like memcmp, but takes the length in words. + * + * @retval ::NRF_SUCCESS indicates that the contents of both memory blocks are equal. + * @retval ::NRF_ERROR_NULL indicates that the contents of the memory blocks are not equal. + */ +typedef struct +{ + uint32_t *ptr1; /**< Pointer to block of memory. */ + uint32_t *ptr2; /**< Pointer to block of memory. */ + uint32_t len; /**< Number of 32 bit words to compare.*/ +} sd_mbr_command_compare_t; + + +/**@brief This command copies a new BootLoader. + * + * The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to + * the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize + * @ref MBR_BOOTLOADER_ADDR. + * + * The bootloader destination is erased by this function. + * If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased. + * + * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set, + * see @ref sd_mbr_command. + * + * This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is + * not intended to be written. + * + * On success, this function will not return. It will start the new bootloader from reset-vector as normal. + * + * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen. + * @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set. + * @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area. + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command. + */ +typedef struct +{ + uint32_t *bl_src; /**< Pointer to the source of the bootloader to be be copied.*/ + uint32_t bl_len; /**< Number of 32 bit words to copy for BootLoader. */ +} sd_mbr_command_copy_bl_t; + +/**@brief Change the address the MBR starts after a reset + * + * Once this function has been called, this address is where the MBR will start to forward + * interrupts to after a reset. + * + * To restore default forwarding, this function should be called with @ref address set to 0. If a + * bootloader is present, interrupts will be forwarded to the bootloader. If not, interrupts will + * be forwarded to the SoftDevice. + * + * The location of a bootloader can be specified in @ref MBR_BOOTLOADER_ADDR or + * @ref MBR_UICR_BOOTLOADER_ADDR. If both addresses are set, the MBR will prioritize + * @ref MBR_BOOTLOADER_ADDR. + * + * This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set, + * see @ref sd_mbr_command. + * + * On success, this function will not return. It will reset the device. + * + * @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen. + * @retval ::NRF_ERROR_INVALID_ADDR if parameter address is outside of the flash size. + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command. + */ +typedef struct +{ + uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/ +} sd_mbr_command_vector_table_base_set_t; + +/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the MBR + * + * Unlike sd_mbr_command_vector_table_base_set_t, this function does not reset, and it does not + * change where the MBR starts after reset. + * + * @retval ::NRF_SUCCESS + */ +typedef struct +{ + uint32_t address; /**< The base address of the interrupt vector table for forwarded interrupts.*/ +} sd_mbr_command_irq_forward_address_set_t; + +/**@brief Input structure containing data used when calling ::sd_mbr_command + * + * Depending on what command value that is set, the corresponding params value type must also be + * set. See @ref NRF_MBR_COMMANDS for command types and corresponding params value type. If command + * @ref SD_MBR_COMMAND_INIT_SD is set, it is not necessary to set any values under params. + */ +typedef struct +{ + uint32_t command; /**< Type of command to be issued. See @ref NRF_MBR_COMMANDS. */ + union + { + sd_mbr_command_copy_sd_t copy_sd; /**< Parameters for copy SoftDevice.*/ + sd_mbr_command_compare_t compare; /**< Parameters for verify.*/ + sd_mbr_command_copy_bl_t copy_bl; /**< Parameters for copy BootLoader. Requires parameter page. */ + sd_mbr_command_vector_table_base_set_t base_set; /**< Parameters for vector table base set. Requires parameter page.*/ + sd_mbr_command_irq_forward_address_set_t irq_forward_address_set; /**< Parameters for irq forward address set*/ + } params; /**< Command parameters. */ +} sd_mbr_command_t; + +/** @} */ + +/** @addtogroup NRF_MBR_FUNCTIONS Functions + * @{ */ + +/**@brief Issue Master Boot Record commands + * + * Commands used when updating a SoftDevice and bootloader. + * + * The @ref SD_MBR_COMMAND_COPY_BL and @ref SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET requires + * parameters to be retained by the MBR when resetting the IC. This is done in a separate flash + * page. The location of the flash page should be provided by the application in either + * @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR. If both addresses are set, the MBR + * will prioritize @ref MBR_PARAM_PAGE_ADDR. This page will be cleared by the MBR and is used to + * store the command before reset. When an address is specified, the page it refers to must not be + * used by the application. If no address is provided by the application, i.e. both + * @ref MBR_PARAM_PAGE_ADDR and @ref MBR_UICR_PARAM_PAGE_ADDR is 0xFFFFFFFF, MBR commands which use + * flash will be unavailable and return @ref NRF_ERROR_NO_MEM. + * + * @param[in] param Pointer to a struct describing the command. + * + * @note For a complete set of return values, see ::sd_mbr_command_copy_sd_t, + * ::sd_mbr_command_copy_bl_t, ::sd_mbr_command_compare_t, + * ::sd_mbr_command_vector_table_base_set_t, ::sd_mbr_command_irq_forward_address_set_t + * + * @retval ::NRF_ERROR_NO_MEM No MBR parameter page provided + * @retval ::NRF_ERROR_INVALID_PARAM if an invalid command is given. +*/ +SVCALL(SD_MBR_COMMAND, uint32_t, sd_mbr_command(sd_mbr_command_t* param)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_MBR_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h new file mode 100644 index 0000000000..6badee98e5 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /** + @defgroup nrf_error SoftDevice Global Error Codes + @{ + + @brief Global Error definitions +*/ + +/* Header guard */ +#ifndef NRF_ERROR_H__ +#define NRF_ERROR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions + * @{ */ +#define NRF_ERROR_BASE_NUM (0x0) ///< Global error base +#define NRF_ERROR_SDM_BASE_NUM (0x1000) ///< SDM error base +#define NRF_ERROR_SOC_BASE_NUM (0x2000) ///< SoC error base +#define NRF_ERROR_STK_BASE_NUM (0x3000) ///< STK error base +/** @} */ + +#define NRF_SUCCESS (NRF_ERROR_BASE_NUM + 0) ///< Successful command +#define NRF_ERROR_SVC_HANDLER_MISSING (NRF_ERROR_BASE_NUM + 1) ///< SVC handler is missing +#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED (NRF_ERROR_BASE_NUM + 2) ///< SoftDevice has not been enabled +#define NRF_ERROR_INTERNAL (NRF_ERROR_BASE_NUM + 3) ///< Internal Error +#define NRF_ERROR_NO_MEM (NRF_ERROR_BASE_NUM + 4) ///< No Memory for operation +#define NRF_ERROR_NOT_FOUND (NRF_ERROR_BASE_NUM + 5) ///< Not found +#define NRF_ERROR_NOT_SUPPORTED (NRF_ERROR_BASE_NUM + 6) ///< Not supported +#define NRF_ERROR_INVALID_PARAM (NRF_ERROR_BASE_NUM + 7) ///< Invalid Parameter +#define NRF_ERROR_INVALID_STATE (NRF_ERROR_BASE_NUM + 8) ///< Invalid state, operation disallowed in this state +#define NRF_ERROR_INVALID_LENGTH (NRF_ERROR_BASE_NUM + 9) ///< Invalid Length +#define NRF_ERROR_INVALID_FLAGS (NRF_ERROR_BASE_NUM + 10) ///< Invalid Flags +#define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11) ///< Invalid Data +#define NRF_ERROR_DATA_SIZE (NRF_ERROR_BASE_NUM + 12) ///< Invalid Data size +#define NRF_ERROR_TIMEOUT (NRF_ERROR_BASE_NUM + 13) ///< Operation timed out +#define NRF_ERROR_NULL (NRF_ERROR_BASE_NUM + 14) ///< Null Pointer +#define NRF_ERROR_FORBIDDEN (NRF_ERROR_BASE_NUM + 15) ///< Forbidden Operation +#define NRF_ERROR_INVALID_ADDR (NRF_ERROR_BASE_NUM + 16) ///< Bad Memory Address +#define NRF_ERROR_BUSY (NRF_ERROR_BASE_NUM + 17) ///< Busy +#define NRF_ERROR_CONN_COUNT (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded. +#define NRF_ERROR_RESOURCES (NRF_ERROR_BASE_NUM + 19) ///< Not enough resources for operation + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h new file mode 100644 index 0000000000..530959b9d6 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_sdm.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + /** + @addtogroup nrf_sdm_api + @{ + @defgroup nrf_sdm_error SoftDevice Manager Error Codes + @{ + + @brief Error definitions for the SDM API +*/ + +/* Header guard */ +#ifndef NRF_ERROR_SDM_H__ +#define NRF_ERROR_SDM_H__ + +#include "nrf_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN (NRF_ERROR_SDM_BASE_NUM + 0) ///< Unknown LFCLK source. +#define NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION (NRF_ERROR_SDM_BASE_NUM + 1) ///< Incorrect interrupt configuration (can be caused by using illegal priority levels, or having enabled SoftDevice interrupts). +#define NRF_ERROR_SDM_INCORRECT_CLENR0 (NRF_ERROR_SDM_BASE_NUM + 2) ///< Incorrect CLENR0 (can be caused by erroneous SoftDevice flashing). + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_SDM_H__ + +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h new file mode 100644 index 0000000000..1e784b8db3 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_error_soc.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @addtogroup nrf_soc_api + @{ + @defgroup nrf_soc_error SoC Library Error Codes + @{ + + @brief Error definitions for the SoC library + +*/ + +/* Header guard */ +#ifndef NRF_ERROR_SOC_H__ +#define NRF_ERROR_SOC_H__ + +#include "nrf_error.h" +#ifdef __cplusplus +extern "C" { +#endif + +/* Mutex Errors */ +#define NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN (NRF_ERROR_SOC_BASE_NUM + 0) ///< Mutex already taken + +/* NVIC errors */ +#define NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE (NRF_ERROR_SOC_BASE_NUM + 1) ///< NVIC interrupt not available +#define NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED (NRF_ERROR_SOC_BASE_NUM + 2) ///< NVIC interrupt priority not allowed +#define NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 3) ///< NVIC should not return + +/* Power errors */ +#define NRF_ERROR_SOC_POWER_MODE_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 4) ///< Power mode unknown +#define NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN (NRF_ERROR_SOC_BASE_NUM + 5) ///< Power POF threshold unknown +#define NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN (NRF_ERROR_SOC_BASE_NUM + 6) ///< Power off should not return + +/* Rand errors */ +#define NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES (NRF_ERROR_SOC_BASE_NUM + 7) ///< RAND not enough values + +/* PPI errors */ +#define NRF_ERROR_SOC_PPI_INVALID_CHANNEL (NRF_ERROR_SOC_BASE_NUM + 8) ///< Invalid PPI Channel +#define NRF_ERROR_SOC_PPI_INVALID_GROUP (NRF_ERROR_SOC_BASE_NUM + 9) ///< Invalid PPI Group + +#ifdef __cplusplus +} +#endif +#endif // NRF_ERROR_SOC_H__ +/** + @} + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h new file mode 100644 index 0000000000..1f79cc3c8c --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_nvic.h @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @defgroup nrf_nvic_api SoftDevice NVIC API + * @{ + * + * @note In order to use this module, the following code has to be added to a .c file: + * \code + * nrf_nvic_state_t nrf_nvic_state = {0}; + * \endcode + * + * @note Definitions and declarations starting with __ (double underscore) in this header file are + * not intended for direct use by the application. + * + * @brief APIs for the accessing NVIC when using a SoftDevice. + * + */ + +#ifndef NRF_NVIC_H__ +#define NRF_NVIC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup NRF_NVIC_DEFINES Defines + * @{ */ + +/**@defgroup NRF_NVIC_ISER_DEFINES SoftDevice NVIC internal definitions + * @{ */ + +#define __NRF_NVIC_NVMC_IRQn (30) /**< The peripheral ID of the NVMC. IRQ numbers are used to identify peripherals, but the NVMC doesn't have an IRQ number in the MDK. */ + +#define __NRF_NVIC_ISER_COUNT (2) /**< The number of ISER/ICER registers in the NVIC that are used. */ + +/**@brief Interrupt priority levels used by the SoftDevice. */ +#define __NRF_NVIC_SD_IRQ_PRIOS ((uint8_t)( \ + (1U << 0) /**< Priority level high .*/ \ + | (1U << 1) /**< Priority level medium. */ \ + | (1U << 4) /**< Priority level low. */ \ + )) + +/**@brief Interrupt priority levels available to the application. */ +#define __NRF_NVIC_APP_IRQ_PRIOS ((uint8_t)~__NRF_NVIC_SD_IRQ_PRIOS) + +/**@brief Interrupts used by the SoftDevice, with IRQn in the range 0-31. */ +#define __NRF_NVIC_SD_IRQS_0 ((uint32_t)( \ + (1U << POWER_CLOCK_IRQn) \ + | (1U << RADIO_IRQn) \ + | (1U << RTC0_IRQn) \ + | (1U << TIMER0_IRQn) \ + | (1U << RNG_IRQn) \ + | (1U << ECB_IRQn) \ + | (1U << CCM_AAR_IRQn) \ + | (1U << TEMP_IRQn) \ + | (1U << __NRF_NVIC_NVMC_IRQn) \ + | (1U << (uint32_t)SWI5_IRQn) \ + )) + +/**@brief Interrupts used by the SoftDevice, with IRQn in the range 32-63. */ +#define __NRF_NVIC_SD_IRQS_1 ((uint32_t)0) + +/**@brief Interrupts available for to application, with IRQn in the range 0-31. */ +#define __NRF_NVIC_APP_IRQS_0 (~__NRF_NVIC_SD_IRQS_0) + +/**@brief Interrupts available for to application, with IRQn in the range 32-63. */ +#define __NRF_NVIC_APP_IRQS_1 (~__NRF_NVIC_SD_IRQS_1) + +/**@} */ + +/**@} */ + +/**@addtogroup NRF_NVIC_VARIABLES Variables + * @{ */ + +/**@brief Type representing the state struct for the SoftDevice NVIC module. */ +typedef struct +{ + uint32_t volatile __irq_masks[__NRF_NVIC_ISER_COUNT]; /**< IRQs enabled by the application in the NVIC. */ + uint32_t volatile __cr_flag; /**< Non-zero if already in a critical region */ +} nrf_nvic_state_t; + +/**@brief Variable keeping the state for the SoftDevice NVIC module. This must be declared in an + * application source file. */ +extern nrf_nvic_state_t nrf_nvic_state; + +/**@} */ + +/**@addtogroup NRF_NVIC_INTERNAL_FUNCTIONS SoftDevice NVIC internal functions + * @{ */ + +/**@brief Disables IRQ interrupts globally, including the SoftDevice's interrupts. + * + * @retval The value of PRIMASK prior to disabling the interrupts. + */ +__STATIC_INLINE int __sd_nvic_irq_disable(void); + +/**@brief Enables IRQ interrupts globally, including the SoftDevice's interrupts. + */ +__STATIC_INLINE void __sd_nvic_irq_enable(void); + +/**@brief Checks if IRQn is available to application + * @param[in] IRQn IRQ to check + * + * @retval 1 (true) if the IRQ to check is available to the application + */ +__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn); + +/**@brief Checks if priority is available to application + * @param[in] priority priority to check + * + * @retval 1 (true) if the priority to check is available to the application + */ +__STATIC_INLINE uint32_t __sd_nvic_is_app_accessible_priority(uint32_t priority); + +/**@} */ + +/**@addtogroup NRF_NVIC_FUNCTIONS SoftDevice NVIC public functions + * @{ */ + +/**@brief Enable External Interrupt. + * @note Corresponds to NVIC_EnableIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_EnableIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt was enabled. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt has a priority not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn); + +/**@brief Disable External Interrupt. + * @note Corresponds to NVIC_DisableIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_DisableIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt was disabled. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE The interrupt is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn); + +/**@brief Get Pending Interrupt. + * @note Corresponds to NVIC_GetPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_GetPendingIRQ documentation in CMSIS. + * @param[out] p_pending_irq Return value from NVIC_GetPendingIRQ. + * + * @retval ::NRF_SUCCESS The interrupt is available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq); + +/**@brief Set Pending Interrupt. + * @note Corresponds to NVIC_SetPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_SetPendingIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt is set pending. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn); + +/**@brief Clear Pending Interrupt. + * @note Corresponds to NVIC_ClearPendingIRQ in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_ClearPendingIRQ documentation in CMSIS. + * + * @retval ::NRF_SUCCESS The interrupt pending flag is cleared. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn); + +/**@brief Set Interrupt Priority. + * @note Corresponds to NVIC_SetPriority in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * @pre Priority is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_SetPriority documentation in CMSIS. + * @param[in] priority A valid IRQ priority for use by the application. + * + * @retval ::NRF_SUCCESS The interrupt and priority level is available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE IRQn is not available for the application. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED The interrupt priority is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority); + +/**@brief Get Interrupt Priority. + * @note Corresponds to NVIC_GetPriority in CMSIS. + * + * @pre IRQn is valid and not reserved by the stack. + * + * @param[in] IRQn See the NVIC_GetPriority documentation in CMSIS. + * @param[out] p_priority Return value from NVIC_GetPriority. + * + * @retval ::NRF_SUCCESS The interrupt priority is returned in p_priority. + * @retval ::NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - IRQn is not available for the application. + */ +__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority); + +/**@brief System Reset. + * @note Corresponds to NVIC_SystemReset in CMSIS. + * + * @retval ::NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN + */ +__STATIC_INLINE uint32_t sd_nvic_SystemReset(void); + +/**@brief Enter critical region. + * + * @post Application interrupts will be disabled. + * @note sd_nvic_critical_region_enter() and ::sd_nvic_critical_region_exit() must be called in matching pairs inside each + * execution context + * @sa sd_nvic_critical_region_exit + * + * @param[out] p_is_nested_critical_region If 1, the application is now in a nested critical region. + * + * @retval ::NRF_SUCCESS + */ +__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region); + +/**@brief Exit critical region. + * + * @pre Application has entered a critical region using ::sd_nvic_critical_region_enter. + * @post If not in a nested critical region, the application interrupts will restored to the state before ::sd_nvic_critical_region_enter was called. + * + * @param[in] is_nested_critical_region If this is set to 1, the critical region won't be exited. @sa sd_nvic_critical_region_enter. + * + * @retval ::NRF_SUCCESS + */ +__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region); + +/**@} */ + +#ifndef SUPPRESS_INLINE_IMPLEMENTATION + +__STATIC_INLINE int __sd_nvic_irq_disable(void) +{ + int pm = __get_PRIMASK(); + __disable_irq(); + return pm; +} + +__STATIC_INLINE void __sd_nvic_irq_enable(void) +{ + __enable_irq(); +} + +__STATIC_INLINE uint32_t __sd_nvic_app_accessible_irq(IRQn_Type IRQn) +{ + if (IRQn < 32) + { + return ((1UL<= (1 << __NVIC_PRIO_BITS)) + || (((1 << priority) & __NRF_NVIC_APP_IRQ_PRIOS) == 0) + ) + { + return 0; + } + return 1; +} + + +__STATIC_INLINE uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + if (!__sd_nvic_is_app_accessible_priority(NVIC_GetPriority(IRQn))) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED; + } + + if (nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] |= (uint32_t)(1 << ((uint32_t)((int32_t)IRQn) & (uint32_t)0x1F)); + } + else + { + NVIC_EnableIRQ(IRQn); + } + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + + if (nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__irq_masks[(uint32_t)((int32_t)IRQn) >> 5] &= ~(1UL << ((uint32_t)(IRQn) & 0x1F)); + } + else + { + NVIC_DisableIRQ(IRQn); + } + + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + *p_pending_irq = NVIC_GetPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + NVIC_SetPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + NVIC_ClearPendingIRQ(IRQn); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if (!__sd_nvic_app_accessible_irq(IRQn)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } + + if (!__sd_nvic_is_app_accessible_priority(priority)) + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED; + } + + NVIC_SetPriority(IRQn, (uint32_t)priority); + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority) +{ + if (__sd_nvic_app_accessible_irq(IRQn)) + { + *p_priority = (NVIC_GetPriority(IRQn) & 0xFF); + return NRF_SUCCESS; + } + else + { + return NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE; + } +} + +__STATIC_INLINE uint32_t sd_nvic_SystemReset(void) +{ + NVIC_SystemReset(); + return NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN; +} + +__STATIC_INLINE uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region) +{ + int was_masked = __sd_nvic_irq_disable(); + if (!nrf_nvic_state.__cr_flag) + { + nrf_nvic_state.__cr_flag = 1; + nrf_nvic_state.__irq_masks[0] = ( NVIC->ICER[0] & __NRF_NVIC_APP_IRQS_0 ); + NVIC->ICER[0] = __NRF_NVIC_APP_IRQS_0; + nrf_nvic_state.__irq_masks[1] = ( NVIC->ICER[1] & __NRF_NVIC_APP_IRQS_1 ); + NVIC->ICER[1] = __NRF_NVIC_APP_IRQS_1; + *p_is_nested_critical_region = 0; + } + else + { + *p_is_nested_critical_region = 1; + } + if (!was_masked) + { + __sd_nvic_irq_enable(); + } + return NRF_SUCCESS; +} + +__STATIC_INLINE uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region) +{ + if (nrf_nvic_state.__cr_flag && (is_nested_critical_region == 0)) + { + int was_masked = __sd_nvic_irq_disable(); + NVIC->ISER[0] = nrf_nvic_state.__irq_masks[0]; + NVIC->ISER[1] = nrf_nvic_state.__irq_masks[1]; + nrf_nvic_state.__cr_flag = 0; + if (!was_masked) + { + __sd_nvic_irq_enable(); + } + } + + return NRF_SUCCESS; +} + +#endif /* SUPPRESS_INLINE_IMPLEMENTATION */ + +#ifdef __cplusplus +} +#endif + +#endif // NRF_NVIC_H__ + +/**@} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h new file mode 100644 index 0000000000..6834599e87 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2015 - 2018, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + @defgroup nrf_sdm_api SoftDevice Manager API + @{ + + @brief APIs for SoftDevice management. + +*/ + +#ifndef NRF_SDM_H__ +#define NRF_SDM_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_sdm.h" +#include "nrf_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup NRF_SDM_DEFINES Defines + * @{ */ +#ifdef NRFSOC_DOXYGEN +/// Declared in nrf_mbr.h +#define MBR_SIZE 0 +#warning test +#endif + +/** @brief The major version for the SoftDevice binary distributed with this header file. */ +#define SD_MAJOR_VERSION (7) + +/** @brief The minor version for the SoftDevice binary distributed with this header file. */ +#define SD_MINOR_VERSION (0) + +/** @brief The bugfix version for the SoftDevice binary distributed with this header file. */ +#define SD_BUGFIX_VERSION (1) + +/** @brief The SoftDevice variant of this firmware. */ +#define SD_VARIANT_ID 140 + +/** @brief The full version number for the SoftDevice binary this header file was distributed + * with, as a decimal number in the form Mmmmbbb, where: + * - M is major version (one or more digits) + * - mmm is minor version (three digits) + * - bbb is bugfix version (three digits). */ +#define SD_VERSION (SD_MAJOR_VERSION * 1000000 + SD_MINOR_VERSION * 1000 + SD_BUGFIX_VERSION) + +/** @brief SoftDevice Manager SVC Base number. */ +#define SDM_SVC_BASE 0x10 + +/** @brief SoftDevice unique string size in bytes. */ +#define SD_UNIQUE_STR_SIZE 20 + +/** @brief Invalid info field. Returned when an info field does not exist. */ +#define SDM_INFO_FIELD_INVALID (0) + +/** @brief Defines the SoftDevice Information Structure location (address) as an offset from +the start of the SoftDevice (without MBR)*/ +#define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000) + +/** @brief Defines the absolute SoftDevice Information Structure location (address) when the + * SoftDevice is installed just above the MBR (the usual case). */ +#define SOFTDEVICE_INFO_STRUCT_ADDRESS (SOFTDEVICE_INFO_STRUCT_OFFSET + MBR_SIZE) + +/** @brief Defines the offset for the SoftDevice Information Structure size value relative to the + * SoftDevice base address. The size value is of type uint8_t. */ +#define SD_INFO_STRUCT_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET) + +/** @brief Defines the offset for the SoftDevice size value relative to the SoftDevice base address. + * The size value is of type uint32_t. */ +#define SD_SIZE_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x08) + +/** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value + * is of type uint16_t. */ +#define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C) + +/** @brief Defines the offset for the SoftDevice ID relative to the SoftDevice base address. The ID + * is of type uint32_t. */ +#define SD_ID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x10) + +/** @brief Defines the offset for the SoftDevice version relative to the SoftDevice base address in + * the same format as @ref SD_VERSION, stored as an uint32_t. */ +#define SD_VERSION_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x14) + +/** @brief Defines the offset for the SoftDevice unique string relative to the SoftDevice base address. + * The SD_UNIQUE_STR is stored as an array of uint8_t. The size of array is @ref SD_UNIQUE_STR_SIZE. + */ +#define SD_UNIQUE_STR_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x18) + +/** @brief Defines a macro for retrieving the actual SoftDevice Information Structure size value + * from a given base address. Use @ref MBR_SIZE as the argument when the SoftDevice is + * installed just above the MBR (the usual case). */ +#define SD_INFO_STRUCT_SIZE_GET(baseaddr) (*((uint8_t *) ((baseaddr) + SD_INFO_STRUCT_SIZE_OFFSET))) + +/** @brief Defines a macro for retrieving the actual SoftDevice size value from a given base + * address. Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above + * the MBR (the usual case). */ +#define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET))) + +/** @brief Defines the amount of flash that is used by the SoftDevice. + * Add @ref MBR_SIZE to find the first available flash address when the SoftDevice is installed + * just above the MBR (the usual case). + */ +#define SD_FLASH_SIZE 0x26000 + +/** @brief Defines a macro for retrieving the actual FWID value from a given base address. Use + * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the usual + * case). */ +#define SD_FWID_GET(baseaddr) (*((uint16_t *) ((baseaddr) + SD_FWID_OFFSET))) + +/** @brief Defines a macro for retrieving the actual SoftDevice ID from a given base address. Use + * @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR (the + * usual case). */ +#define SD_ID_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_ID_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (*((uint32_t *) ((baseaddr) + SD_ID_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/** @brief Defines a macro for retrieving the actual SoftDevice version from a given base address. + * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR + * (the usual case). */ +#define SD_VERSION_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_VERSION_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (*((uint32_t *) ((baseaddr) + SD_VERSION_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/** @brief Defines a macro for retrieving the address of SoftDevice unique str based on a given base address. + * Use @ref MBR_SIZE as the argument when the SoftDevice is installed just above the MBR + * (the usual case). */ +#define SD_UNIQUE_STR_ADDR_GET(baseaddr) ((SD_INFO_STRUCT_SIZE_GET(baseaddr) > (SD_UNIQUE_STR_OFFSET - SOFTDEVICE_INFO_STRUCT_OFFSET)) \ + ? (((uint8_t *) ((baseaddr) + SD_UNIQUE_STR_OFFSET))) : SDM_INFO_FIELD_INVALID) + +/**@defgroup NRF_FAULT_ID_RANGES Fault ID ranges + * @{ */ +#define NRF_FAULT_ID_SD_RANGE_START 0x00000000 /**< SoftDevice ID range start. */ +#define NRF_FAULT_ID_APP_RANGE_START 0x00001000 /**< Application ID range start. */ +/**@} */ + +/**@defgroup NRF_FAULT_IDS Fault ID types + * @{ */ +#define NRF_FAULT_ID_SD_ASSERT (NRF_FAULT_ID_SD_RANGE_START + 1) /**< SoftDevice assertion. The info parameter is reserved for future used. */ +#define NRF_FAULT_ID_APP_MEMACC (NRF_FAULT_ID_APP_RANGE_START + 1) /**< Application invalid memory access. The info parameter will contain 0x00000000, + in case of SoftDevice RAM access violation. In case of SoftDevice peripheral + register violation the info parameter will contain the sub-region number of + PREGION[0], on whose address range the disallowed write access caused the + memory access fault. */ +/**@} */ + +/** @} */ + +/** @addtogroup NRF_SDM_ENUMS Enumerations + * @{ */ + +/**@brief nRF SoftDevice Manager API SVC numbers. */ +enum NRF_SD_SVCS +{ + SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */ + SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */ + SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */ + SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, /**< ::sd_softdevice_vector_table_base_set */ + SVC_SDM_LAST /**< Placeholder for last SDM SVC */ +}; + +/** @} */ + +/** @addtogroup NRF_SDM_DEFINES Defines + * @{ */ + +/**@defgroup NRF_CLOCK_LF_ACCURACY Clock accuracy + * @{ */ + +#define NRF_CLOCK_LF_ACCURACY_250_PPM (0) /**< Default: 250 ppm */ +#define NRF_CLOCK_LF_ACCURACY_500_PPM (1) /**< 500 ppm */ +#define NRF_CLOCK_LF_ACCURACY_150_PPM (2) /**< 150 ppm */ +#define NRF_CLOCK_LF_ACCURACY_100_PPM (3) /**< 100 ppm */ +#define NRF_CLOCK_LF_ACCURACY_75_PPM (4) /**< 75 ppm */ +#define NRF_CLOCK_LF_ACCURACY_50_PPM (5) /**< 50 ppm */ +#define NRF_CLOCK_LF_ACCURACY_30_PPM (6) /**< 30 ppm */ +#define NRF_CLOCK_LF_ACCURACY_20_PPM (7) /**< 20 ppm */ +#define NRF_CLOCK_LF_ACCURACY_10_PPM (8) /**< 10 ppm */ +#define NRF_CLOCK_LF_ACCURACY_5_PPM (9) /**< 5 ppm */ +#define NRF_CLOCK_LF_ACCURACY_2_PPM (10) /**< 2 ppm */ +#define NRF_CLOCK_LF_ACCURACY_1_PPM (11) /**< 1 ppm */ + +/** @} */ + +/**@defgroup NRF_CLOCK_LF_SRC Possible LFCLK oscillator sources + * @{ */ + +#define NRF_CLOCK_LF_SRC_RC (0) /**< LFCLK RC oscillator. */ +#define NRF_CLOCK_LF_SRC_XTAL (1) /**< LFCLK crystal oscillator. */ +#define NRF_CLOCK_LF_SRC_SYNTH (2) /**< LFCLK Synthesized from HFCLK. */ + +/** @} */ + +/** @} */ + +/** @addtogroup NRF_SDM_TYPES Types + * @{ */ + +/**@brief Type representing LFCLK oscillator source. */ +typedef struct +{ + uint8_t source; /**< LF oscillator clock source, see @ref NRF_CLOCK_LF_SRC. */ + uint8_t rc_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: Calibration timer interval in 1/4 second + units (nRF52: 1-32). + @note To avoid excessive clock drift, 0.5 degrees Celsius is the + maximum temperature change allowed in one calibration timer + interval. The interval should be selected to ensure this. + + @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC. */ + uint8_t rc_temp_ctiv; /**< Only for ::NRF_CLOCK_LF_SRC_RC: How often (in number of calibration + intervals) the RC oscillator shall be calibrated if the temperature + hasn't changed. + 0: Always calibrate even if the temperature hasn't changed. + 1: Only calibrate if the temperature has changed (legacy - nRF51 only). + 2-33: Check the temperature and only calibrate if it has changed, + however calibration will take place every rc_temp_ctiv + intervals in any case. + + @note Must be 0 if source is not ::NRF_CLOCK_LF_SRC_RC. + + @note For nRF52, the application must ensure calibration at least once + every 8 seconds to ensure +/-500 ppm clock stability. The + recommended configuration for ::NRF_CLOCK_LF_SRC_RC on nRF52 is + rc_ctiv=16 and rc_temp_ctiv=2. This will ensure calibration at + least once every 8 seconds and for temperature changes of 0.5 + degrees Celsius every 4 seconds. See the Product Specification + for the nRF52 device being used for more information.*/ + uint8_t accuracy; /**< External clock accuracy used in the LL to compute timing + windows, see @ref NRF_CLOCK_LF_ACCURACY.*/ +} nrf_clock_lf_cfg_t; + +/**@brief Fault Handler type. + * + * When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back. + * The protocol stack will be in an undefined state when this happens and the only way to recover will be to + * perform a reset, using e.g. CMSIS NVIC_SystemReset(). + * If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset(). + * + * @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device. + * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may + * continously transmit packets. + * + * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback. + * + * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS. + * @param[in] pc The program counter of the instruction that triggered the fault. + * @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details. + * + * @note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when + * the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault. + */ +typedef void (*nrf_fault_handler_t)(uint32_t id, uint32_t pc, uint32_t info); + +/** @} */ + +/** @addtogroup NRF_SDM_FUNCTIONS Functions + * @{ */ + +/**@brief Enables the SoftDevice and by extension the protocol stack. + * + * @note Some care must be taken if a low frequency clock source is already running when calling this function: + * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new + * clock source will be started. + * + * @note This function has no effect when returning with an error. + * + * @post If return code is ::NRF_SUCCESS + * - SoC library and protocol stack APIs are made available. + * - A portion of RAM will be unavailable (see relevant SDS documentation). + * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation). + * - Interrupts will not arrive from protected peripherals or interrupts. + * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the SoftDevice. + * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation). + * - Chosen low frequency clock source will be running. + * + * @param p_clock_lf_cfg Low frequency clock source and accuracy. + If NULL the clock will be configured as an RC source with rc_ctiv = 16 and .rc_temp_ctiv = 2 + In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock. + * @param fault_handler Callback to be invoked in case of fault, cannot be NULL. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_ADDR Invalid or NULL pointer supplied. + * @retval ::NRF_ERROR_INVALID_STATE SoftDevice is already enabled, and the clock source and fault handler cannot be updated. + * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDevice interrupt is already enabled, or an enabled interrupt has an illegal priority level. + * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected. + * @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg. + */ +SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler)); + + +/**@brief Disables the SoftDevice and by extension the protocol stack. + * + * Idempotent function to disable the SoftDevice. + * + * @post SoC library and protocol stack APIs are made unavailable. + * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest). + * @post All peripherals used by the SoftDevice will be reset to default values. + * @post All of RAM become available. + * @post All interrupts are forwarded to the application. + * @post LFCLK source chosen in ::sd_softdevice_enable will be left running. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void)); + +/**@brief Check if the SoftDevice is enabled. + * + * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled)); + +/**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice + * + * This function is only intended to be called when a bootloader is enabled. + * + * @param[in] address The base address of the interrupt vector table for forwarded interrupts. + + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address)); + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_SDM_H__ + +/** + @} +*/ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h new file mode 100644 index 0000000000..3751d133f5 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_soc.h @@ -0,0 +1,1080 @@ +/* + * Copyright (c) 2015 - 2019, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @defgroup nrf_soc_api SoC Library API + * @{ + * + * @brief APIs for the SoC library. + * + */ + +#ifndef NRF_SOC_H__ +#define NRF_SOC_H__ + +#include +#include "nrf.h" +#include "nrf_svc.h" +#include "nrf_error.h" +#include "nrf_error_soc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/**@addtogroup NRF_SOC_DEFINES Defines + * @{ */ + +/**@brief The number of the lowest SVC number reserved for the SoC library. */ +#define SOC_SVC_BASE (0x20) /**< Base value for SVCs that are available when the SoftDevice is disabled. */ +#define SOC_SVC_BASE_NOT_AVAILABLE (0x2C) /**< Base value for SVCs that are not available when the SoftDevice is disabled. */ + +/**@brief Guaranteed time for application to process radio inactive notification. */ +#define NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US (62) + +/**@brief The minimum allowed timeslot extension time. */ +#define NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US (200) + +/**@brief The maximum processing time to handle a timeslot extension. */ +#define NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US (20) + +/**@brief The latest time before the end of a timeslot the timeslot can be extended. */ +#define NRF_RADIO_MIN_EXTENSION_MARGIN_US (82) + +#define SOC_ECB_KEY_LENGTH (16) /**< ECB key length. */ +#define SOC_ECB_CLEARTEXT_LENGTH (16) /**< ECB cleartext length. */ +#define SOC_ECB_CIPHERTEXT_LENGTH (SOC_ECB_CLEARTEXT_LENGTH) /**< ECB ciphertext length. */ + +#define SD_EVT_IRQn (SWI2_IRQn) /**< SoftDevice Event IRQ number. Used for both protocol events and SoC events. */ +#define SD_EVT_IRQHandler (SWI2_IRQHandler) /**< SoftDevice Event IRQ handler. Used for both protocol events and SoC events. + The default interrupt priority for this handler is set to 6 */ +#define RADIO_NOTIFICATION_IRQn (SWI1_IRQn) /**< The radio notification IRQ number. */ +#define RADIO_NOTIFICATION_IRQHandler (SWI1_IRQHandler) /**< The radio notification IRQ handler. + The default interrupt priority for this handler is set to 6 */ +#define NRF_RADIO_LENGTH_MIN_US (100) /**< The shortest allowed radio timeslot, in microseconds. */ +#define NRF_RADIO_LENGTH_MAX_US (100000) /**< The longest allowed radio timeslot, in microseconds. */ + +#define NRF_RADIO_DISTANCE_MAX_US (128000000UL - 1UL) /**< The longest timeslot distance, in microseconds, allowed for the distance parameter (see @ref nrf_radio_request_normal_t) in the request. */ + +#define NRF_RADIO_EARLIEST_TIMEOUT_MAX_US (128000000UL - 1UL) /**< The longest timeout, in microseconds, allowed when requesting the earliest possible timeslot. */ + +#define NRF_RADIO_START_JITTER_US (2) /**< The maximum jitter in @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START relative to the requested start time. */ + +/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is disabled. */ +#define NRF_SOC_SD_PPI_CHANNELS_SD_DISABLED_MSK ((uint32_t)(0)) + +/**@brief Mask of PPI channels reserved by the SoftDevice when the SoftDevice is enabled. */ +#define NRF_SOC_SD_PPI_CHANNELS_SD_ENABLED_MSK ((uint32_t)( \ + (1U << 17) \ + | (1U << 18) \ + | (1U << 19) \ + | (1U << 20) \ + | (1U << 21) \ + | (1U << 22) \ + | (1U << 23) \ + | (1U << 24) \ + | (1U << 25) \ + | (1U << 26) \ + | (1U << 27) \ + | (1U << 28) \ + | (1U << 29) \ + | (1U << 30) \ + | (1U << 31) \ + )) + +/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is disabled. */ +#define NRF_SOC_SD_PPI_GROUPS_SD_DISABLED_MSK ((uint32_t)(0)) + +/**@brief Mask of PPI groups reserved by the SoftDevice when the SoftDevice is enabled. */ +#define NRF_SOC_SD_PPI_GROUPS_SD_ENABLED_MSK ((uint32_t)( \ + (1U << 4) \ + | (1U << 5) \ + )) + +/**@} */ + +/**@addtogroup NRF_SOC_ENUMS Enumerations + * @{ */ + +/**@brief The SVC numbers used by the SVC functions in the SoC library. */ +enum NRF_SOC_SVCS +{ + SD_PPI_CHANNEL_ENABLE_GET = SOC_SVC_BASE, + SD_PPI_CHANNEL_ENABLE_SET = SOC_SVC_BASE + 1, + SD_PPI_CHANNEL_ENABLE_CLR = SOC_SVC_BASE + 2, + SD_PPI_CHANNEL_ASSIGN = SOC_SVC_BASE + 3, + SD_PPI_GROUP_TASK_ENABLE = SOC_SVC_BASE + 4, + SD_PPI_GROUP_TASK_DISABLE = SOC_SVC_BASE + 5, + SD_PPI_GROUP_ASSIGN = SOC_SVC_BASE + 6, + SD_PPI_GROUP_GET = SOC_SVC_BASE + 7, + SD_FLASH_PAGE_ERASE = SOC_SVC_BASE + 8, + SD_FLASH_WRITE = SOC_SVC_BASE + 9, + SD_PROTECTED_REGISTER_WRITE = SOC_SVC_BASE + 11, + SD_MUTEX_NEW = SOC_SVC_BASE_NOT_AVAILABLE, + SD_MUTEX_ACQUIRE = SOC_SVC_BASE_NOT_AVAILABLE + 1, + SD_MUTEX_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 2, + SD_RAND_APPLICATION_POOL_CAPACITY_GET = SOC_SVC_BASE_NOT_AVAILABLE + 3, + SD_RAND_APPLICATION_BYTES_AVAILABLE_GET = SOC_SVC_BASE_NOT_AVAILABLE + 4, + SD_RAND_APPLICATION_VECTOR_GET = SOC_SVC_BASE_NOT_AVAILABLE + 5, + SD_POWER_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 6, + SD_POWER_SYSTEM_OFF = SOC_SVC_BASE_NOT_AVAILABLE + 7, + SD_POWER_RESET_REASON_GET = SOC_SVC_BASE_NOT_AVAILABLE + 8, + SD_POWER_RESET_REASON_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 9, + SD_POWER_POF_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 10, + SD_POWER_POF_THRESHOLD_SET = SOC_SVC_BASE_NOT_AVAILABLE + 11, + SD_POWER_POF_THRESHOLDVDDH_SET = SOC_SVC_BASE_NOT_AVAILABLE + 12, + SD_POWER_RAM_POWER_SET = SOC_SVC_BASE_NOT_AVAILABLE + 13, + SD_POWER_RAM_POWER_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 14, + SD_POWER_RAM_POWER_GET = SOC_SVC_BASE_NOT_AVAILABLE + 15, + SD_POWER_GPREGRET_SET = SOC_SVC_BASE_NOT_AVAILABLE + 16, + SD_POWER_GPREGRET_CLR = SOC_SVC_BASE_NOT_AVAILABLE + 17, + SD_POWER_GPREGRET_GET = SOC_SVC_BASE_NOT_AVAILABLE + 18, + SD_POWER_DCDC_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 19, + SD_POWER_DCDC0_MODE_SET = SOC_SVC_BASE_NOT_AVAILABLE + 20, + SD_APP_EVT_WAIT = SOC_SVC_BASE_NOT_AVAILABLE + 21, + SD_CLOCK_HFCLK_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 22, + SD_CLOCK_HFCLK_RELEASE = SOC_SVC_BASE_NOT_AVAILABLE + 23, + SD_CLOCK_HFCLK_IS_RUNNING = SOC_SVC_BASE_NOT_AVAILABLE + 24, + SD_RADIO_NOTIFICATION_CFG_SET = SOC_SVC_BASE_NOT_AVAILABLE + 25, + SD_ECB_BLOCK_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 26, + SD_ECB_BLOCKS_ENCRYPT = SOC_SVC_BASE_NOT_AVAILABLE + 27, + SD_RADIO_SESSION_OPEN = SOC_SVC_BASE_NOT_AVAILABLE + 28, + SD_RADIO_SESSION_CLOSE = SOC_SVC_BASE_NOT_AVAILABLE + 29, + SD_RADIO_REQUEST = SOC_SVC_BASE_NOT_AVAILABLE + 30, + SD_EVT_GET = SOC_SVC_BASE_NOT_AVAILABLE + 31, + SD_TEMP_GET = SOC_SVC_BASE_NOT_AVAILABLE + 32, + SD_POWER_USBPWRRDY_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 33, + SD_POWER_USBDETECTED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 34, + SD_POWER_USBREMOVED_ENABLE = SOC_SVC_BASE_NOT_AVAILABLE + 35, + SD_POWER_USBREGSTATUS_GET = SOC_SVC_BASE_NOT_AVAILABLE + 36, + SVC_SOC_LAST = SOC_SVC_BASE_NOT_AVAILABLE + 37 +}; + +/**@brief Possible values of a ::nrf_mutex_t. */ +enum NRF_MUTEX_VALUES +{ + NRF_MUTEX_FREE, + NRF_MUTEX_TAKEN +}; + +/**@brief Power modes. */ +enum NRF_POWER_MODES +{ + NRF_POWER_MODE_CONSTLAT, /**< Constant latency mode. See power management in the reference manual. */ + NRF_POWER_MODE_LOWPWR /**< Low power mode. See power management in the reference manual. */ +}; + + +/**@brief Power failure thresholds */ +enum NRF_POWER_THRESHOLDS +{ + NRF_POWER_THRESHOLD_V17 = 4UL, /**< 1.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V18, /**< 1.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V19, /**< 1.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V20, /**< 2.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V21, /**< 2.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V22, /**< 2.2 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V23, /**< 2.3 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V24, /**< 2.4 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V25, /**< 2.5 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V26, /**< 2.6 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V27, /**< 2.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLD_V28 /**< 2.8 Volts power failure threshold. */ +}; + +/**@brief Power failure thresholds for high voltage */ +enum NRF_POWER_THRESHOLDVDDHS +{ + NRF_POWER_THRESHOLDVDDH_V27, /**< 2.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V28, /**< 2.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V29, /**< 2.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V30, /**< 3.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V31, /**< 3.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V32, /**< 3.2 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V33, /**< 3.3 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V34, /**< 3.4 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V35, /**< 3.5 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V36, /**< 3.6 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V37, /**< 3.7 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V38, /**< 3.8 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V39, /**< 3.9 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V40, /**< 4.0 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V41, /**< 4.1 Volts power failure threshold. */ + NRF_POWER_THRESHOLDVDDH_V42 /**< 4.2 Volts power failure threshold. */ +}; + + +/**@brief DC/DC converter modes. */ +enum NRF_POWER_DCDC_MODES +{ + NRF_POWER_DCDC_DISABLE, /**< The DCDC is disabled. */ + NRF_POWER_DCDC_ENABLE /**< The DCDC is enabled. */ +}; + +/**@brief Radio notification distances. */ +enum NRF_RADIO_NOTIFICATION_DISTANCES +{ + NRF_RADIO_NOTIFICATION_DISTANCE_NONE = 0, /**< The event does not have a notification. */ + NRF_RADIO_NOTIFICATION_DISTANCE_800US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_1740US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_2680US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_3620US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_4560US, /**< The distance from the active notification to start of radio activity. */ + NRF_RADIO_NOTIFICATION_DISTANCE_5500US /**< The distance from the active notification to start of radio activity. */ +}; + + +/**@brief Radio notification types. */ +enum NRF_RADIO_NOTIFICATION_TYPES +{ + NRF_RADIO_NOTIFICATION_TYPE_NONE = 0, /**< The event does not have a radio notification signal. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE, /**< Using interrupt for notification when the radio will be enabled. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, /**< Using interrupt for notification when the radio has been disabled. */ + NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH, /**< Using interrupt for notification both when the radio will be enabled and disabled. */ +}; + +/**@brief The Radio signal callback types. */ +enum NRF_RADIO_CALLBACK_SIGNAL_TYPE +{ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_START, /**< This signal indicates the start of the radio timeslot. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0, /**< This signal indicates the NRF_TIMER0 interrupt. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO, /**< This signal indicates the NRF_RADIO interrupt. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED, /**< This signal indicates extend action failed. */ + NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED /**< This signal indicates extend action succeeded. */ +}; + +/**@brief The actions requested by the signal callback. + * + * This code gives the SOC instructions about what action to take when the signal callback has + * returned. + */ +enum NRF_RADIO_SIGNAL_CALLBACK_ACTION +{ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE, /**< Return without action. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND, /**< Request an extension of the current + timeslot. Maximum execution time for this action: + @ref NRF_RADIO_MAX_EXTENSION_PROCESSING_TIME_US. + This action must be started at least + @ref NRF_RADIO_MIN_EXTENSION_MARGIN_US before + the end of the timeslot. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_END, /**< End the current radio timeslot. */ + NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END /**< Request a new radio timeslot and end the current timeslot. */ +}; + +/**@brief Radio timeslot high frequency clock source configuration. */ +enum NRF_RADIO_HFCLK_CFG +{ + NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED, /**< The SoftDevice will guarantee that the high frequency clock source is the + external crystal for the whole duration of the timeslot. This should be the + preferred option for events that use the radio or require high timing accuracy. + @note The SoftDevice will automatically turn on and off the external crystal, + at the beginning and end of the timeslot, respectively. The crystal may also + intentionally be left running after the timeslot, in cases where it is needed + by the SoftDevice shortly after the end of the timeslot. */ + NRF_RADIO_HFCLK_CFG_NO_GUARANTEE /**< This configuration allows for earlier and tighter scheduling of timeslots. + The RC oscillator may be the clock source in part or for the whole duration of the timeslot. + The RC oscillator's accuracy must therefore be taken into consideration. + @note If the application will use the radio peripheral in timeslots with this configuration, + it must make sure that the crystal is running and stable before starting the radio. */ +}; + +/**@brief Radio timeslot priorities. */ +enum NRF_RADIO_PRIORITY +{ + NRF_RADIO_PRIORITY_HIGH, /**< High (equal priority as the normal connection priority of the SoftDevice stack(s)). */ + NRF_RADIO_PRIORITY_NORMAL, /**< Normal (equal priority as the priority of secondary activities of the SoftDevice stack(s)). */ +}; + +/**@brief Radio timeslot request type. */ +enum NRF_RADIO_REQUEST_TYPE +{ + NRF_RADIO_REQ_TYPE_EARLIEST, /**< Request radio timeslot as early as possible. This should always be used for the first request in a session. */ + NRF_RADIO_REQ_TYPE_NORMAL /**< Normal radio timeslot request. */ +}; + +/**@brief SoC Events. */ +enum NRF_SOC_EVTS +{ + NRF_EVT_HFCLKSTARTED, /**< Event indicating that the HFCLK has started. */ + NRF_EVT_POWER_FAILURE_WARNING, /**< Event indicating that a power failure warning has occurred. */ + NRF_EVT_FLASH_OPERATION_SUCCESS, /**< Event indicating that the ongoing flash operation has completed successfully. */ + NRF_EVT_FLASH_OPERATION_ERROR, /**< Event indicating that the ongoing flash operation has timed out with an error. */ + NRF_EVT_RADIO_BLOCKED, /**< Event indicating that a radio timeslot was blocked. */ + NRF_EVT_RADIO_CANCELED, /**< Event indicating that a radio timeslot was canceled by SoftDevice. */ + NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN, /**< Event indicating that a radio timeslot signal callback handler return was invalid. */ + NRF_EVT_RADIO_SESSION_IDLE, /**< Event indicating that a radio timeslot session is idle. */ + NRF_EVT_RADIO_SESSION_CLOSED, /**< Event indicating that a radio timeslot session is closed. */ + NRF_EVT_POWER_USB_POWER_READY, /**< Event indicating that a USB 3.3 V supply is ready. */ + NRF_EVT_POWER_USB_DETECTED, /**< Event indicating that voltage supply is detected on VBUS. */ + NRF_EVT_POWER_USB_REMOVED, /**< Event indicating that voltage supply is removed from VBUS. */ + NRF_EVT_NUMBER_OF_EVTS +}; + +/**@} */ + + +/**@addtogroup NRF_SOC_STRUCTURES Structures + * @{ */ + +/**@brief Represents a mutex for use with the nrf_mutex functions. + * @note Accessing the value directly is not safe, use the mutex functions! + */ +typedef volatile uint8_t nrf_mutex_t; + +/**@brief Parameters for a request for a timeslot as early as possible. */ +typedef struct +{ + uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ + uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ + uint32_t length_us; /**< The radio timeslot length (in the range 100 to 100,000] microseconds). */ + uint32_t timeout_us; /**< Longest acceptable delay until the start of the requested timeslot (up to @ref NRF_RADIO_EARLIEST_TIMEOUT_MAX_US microseconds). */ +} nrf_radio_request_earliest_t; + +/**@brief Parameters for a normal radio timeslot request. */ +typedef struct +{ + uint8_t hfclk; /**< High frequency clock source, see @ref NRF_RADIO_HFCLK_CFG. */ + uint8_t priority; /**< The radio timeslot priority, see @ref NRF_RADIO_PRIORITY. */ + uint32_t distance_us; /**< Distance from the start of the previous radio timeslot (up to @ref NRF_RADIO_DISTANCE_MAX_US microseconds). */ + uint32_t length_us; /**< The radio timeslot length (in the range [100..100,000] microseconds). */ +} nrf_radio_request_normal_t; + +/**@brief Radio timeslot request parameters. */ +typedef struct +{ + uint8_t request_type; /**< Type of request, see @ref NRF_RADIO_REQUEST_TYPE. */ + union + { + nrf_radio_request_earliest_t earliest; /**< Parameters for requesting a radio timeslot as early as possible. */ + nrf_radio_request_normal_t normal; /**< Parameters for requesting a normal radio timeslot. */ + } params; /**< Parameter union. */ +} nrf_radio_request_t; + +/**@brief Return parameters of the radio timeslot signal callback. */ +typedef struct +{ + uint8_t callback_action; /**< The action requested by the application when returning from the signal callback, see @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION. */ + union + { + struct + { + nrf_radio_request_t * p_next; /**< The request parameters for the next radio timeslot. */ + } request; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END. */ + struct + { + uint32_t length_us; /**< Requested extension of the radio timeslot duration (microseconds) (for minimum time see @ref NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US). */ + } extend; /**< Additional parameters for return_code @ref NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND. */ + } params; /**< Parameter union. */ +} nrf_radio_signal_callback_return_param_t; + +/**@brief The radio timeslot signal callback type. + * + * @note In case of invalid return parameters, the radio timeslot will automatically end + * immediately after returning from the signal callback and the + * @ref NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN event will be sent. + * @note The returned struct pointer must remain valid after the signal callback + * function returns. For instance, this means that it must not point to a stack variable. + * + * @param[in] signal_type Type of signal, see @ref NRF_RADIO_CALLBACK_SIGNAL_TYPE. + * + * @return Pointer to structure containing action requested by the application. + */ +typedef nrf_radio_signal_callback_return_param_t * (*nrf_radio_signal_callback_t) (uint8_t signal_type); + +/**@brief AES ECB parameter typedefs */ +typedef uint8_t soc_ecb_key_t[SOC_ECB_KEY_LENGTH]; /**< Encryption key type. */ +typedef uint8_t soc_ecb_cleartext_t[SOC_ECB_CLEARTEXT_LENGTH]; /**< Cleartext data type. */ +typedef uint8_t soc_ecb_ciphertext_t[SOC_ECB_CIPHERTEXT_LENGTH]; /**< Ciphertext data type. */ + +/**@brief AES ECB data structure */ +typedef struct +{ + soc_ecb_key_t key; /**< Encryption key. */ + soc_ecb_cleartext_t cleartext; /**< Cleartext data. */ + soc_ecb_ciphertext_t ciphertext; /**< Ciphertext data. */ +} nrf_ecb_hal_data_t; + +/**@brief AES ECB block. Used to provide multiple blocks in a single call + to @ref sd_ecb_blocks_encrypt.*/ +typedef struct +{ + soc_ecb_key_t const * p_key; /**< Pointer to the Encryption key. */ + soc_ecb_cleartext_t const * p_cleartext; /**< Pointer to the Cleartext data. */ + soc_ecb_ciphertext_t * p_ciphertext; /**< Pointer to the Ciphertext data. */ +} nrf_ecb_hal_data_block_t; + +/**@} */ + +/**@addtogroup NRF_SOC_FUNCTIONS Functions + * @{ */ + +/**@brief Initialize a mutex. + * + * @param[in] p_mutex Pointer to the mutex to initialize. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex)); + +/**@brief Attempt to acquire a mutex. + * + * @param[in] p_mutex Pointer to the mutex to acquire. + * + * @retval ::NRF_SUCCESS The mutex was successfully acquired. + * @retval ::NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN The mutex could not be acquired. + */ +SVCALL(SD_MUTEX_ACQUIRE, uint32_t, sd_mutex_acquire(nrf_mutex_t * p_mutex)); + +/**@brief Release a mutex. + * + * @param[in] p_mutex Pointer to the mutex to release. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_MUTEX_RELEASE, uint32_t, sd_mutex_release(nrf_mutex_t * p_mutex)); + +/**@brief Query the capacity of the application random pool. + * + * @param[out] p_pool_capacity The capacity of the pool. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RAND_APPLICATION_POOL_CAPACITY_GET, uint32_t, sd_rand_application_pool_capacity_get(uint8_t * p_pool_capacity)); + +/**@brief Get number of random bytes available to the application. + * + * @param[out] p_bytes_available The number of bytes currently available in the pool. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RAND_APPLICATION_BYTES_AVAILABLE_GET, uint32_t, sd_rand_application_bytes_available_get(uint8_t * p_bytes_available)); + +/**@brief Get random bytes from the application pool. + * + * @param[out] p_buff Pointer to unit8_t buffer for storing the bytes. + * @param[in] length Number of bytes to take from pool and place in p_buff. + * + * @retval ::NRF_SUCCESS The requested bytes were written to p_buff. + * @retval ::NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES No bytes were written to the buffer, because there were not enough bytes available. +*/ +SVCALL(SD_RAND_APPLICATION_VECTOR_GET, uint32_t, sd_rand_application_vector_get(uint8_t * p_buff, uint8_t length)); + +/**@brief Gets the reset reason register. + * + * @param[out] p_reset_reason Contents of the NRF_POWER->RESETREAS register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RESET_REASON_GET, uint32_t, sd_power_reset_reason_get(uint32_t * p_reset_reason)); + +/**@brief Clears the bits of the reset reason register. + * + * @param[in] reset_reason_clr_msk Contains the bits to clear from the reset reason register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RESET_REASON_CLR, uint32_t, sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk)); + +/**@brief Sets the power mode when in CPU sleep. + * + * @param[in] power_mode The power mode to use when in CPU sleep, see @ref NRF_POWER_MODES. @sa sd_app_evt_wait + * + * @retval ::NRF_SUCCESS The power mode was set. + * @retval ::NRF_ERROR_SOC_POWER_MODE_UNKNOWN The power mode was unknown. + */ +SVCALL(SD_POWER_MODE_SET, uint32_t, sd_power_mode_set(uint8_t power_mode)); + +/**@brief Puts the chip in System OFF mode. + * + * @retval ::NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN + */ +SVCALL(SD_POWER_SYSTEM_OFF, uint32_t, sd_power_system_off(void)); + +/**@brief Enables or disables the power-fail comparator. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_FAILURE_WARNING) when the power failure warning occurs. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] pof_enable True if the power-fail comparator should be enabled, false if it should be disabled. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_POF_ENABLE, uint32_t, sd_power_pof_enable(uint8_t pof_enable)); + +/**@brief Enables or disables the USB power ready event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_POWER_READY) when a USB 3.3 V supply is ready. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbpwrrdy_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBPWRRDY_ENABLE, uint32_t, sd_power_usbpwrrdy_enable(uint8_t usbpwrrdy_enable)); + +/**@brief Enables or disables the power USB-detected event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_DETECTED) when a voltage supply is detected on VBUS. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbdetected_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBDETECTED_ENABLE, uint32_t, sd_power_usbdetected_enable(uint8_t usbdetected_enable)); + +/**@brief Enables or disables the power USB-removed event. + * + * Enabling this will give a SoftDevice event (NRF_EVT_POWER_USB_REMOVED) when a voltage supply is removed from VBUS. + * The event can be retrieved with sd_evt_get(); + * + * @param[in] usbremoved_enable True if the power ready event should be enabled, false if it should be disabled. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBREMOVED_ENABLE, uint32_t, sd_power_usbremoved_enable(uint8_t usbremoved_enable)); + +/**@brief Get USB supply status register content. + * + * @param[out] usbregstatus The content of USBREGSTATUS register. + * + * @note Calling this function on a chip without USBD peripheral will result in undefined behaviour. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_USBREGSTATUS_GET, uint32_t, sd_power_usbregstatus_get(uint32_t * usbregstatus)); + +/**@brief Sets the power failure comparator threshold value. + * + * @note: Power failure comparator threshold setting. This setting applies both for normal voltage + * mode (supply connected to both VDD and VDDH) and high voltage mode (supply connected to + * VDDH only). + * + * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDS. + * + * @retval ::NRF_SUCCESS The power failure threshold was set. + * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown. + */ +SVCALL(SD_POWER_POF_THRESHOLD_SET, uint32_t, sd_power_pof_threshold_set(uint8_t threshold)); + +/**@brief Sets the power failure comparator threshold value for high voltage. + * + * @note: Power failure comparator threshold setting for high voltage mode (supply connected to + * VDDH only). This setting does not apply for normal voltage mode (supply connected to both + * VDD and VDDH). + * + * @param[in] threshold The power-fail threshold value to use, see @ref NRF_POWER_THRESHOLDVDDHS. + * + * @retval ::NRF_SUCCESS The power failure threshold was set. + * @retval ::NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN The power failure threshold is unknown. + */ +SVCALL(SD_POWER_POF_THRESHOLDVDDH_SET, uint32_t, sd_power_pof_thresholdvddh_set(uint8_t threshold)); + +/**@brief Writes the NRF_POWER->RAM[index].POWERSET register. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERSET register to write to. + * @param[in] ram_powerset Contains the word to write to the NRF_POWER->RAM[index].POWERSET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_SET, uint32_t, sd_power_ram_power_set(uint8_t index, uint32_t ram_powerset)); + +/**@brief Writes the NRF_POWER->RAM[index].POWERCLR register. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWERCLR register to write to. + * @param[in] ram_powerclr Contains the word to write to the NRF_POWER->RAM[index].POWERCLR register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_CLR, uint32_t, sd_power_ram_power_clr(uint8_t index, uint32_t ram_powerclr)); + +/**@brief Get contents of NRF_POWER->RAM[index].POWER register, indicates power status of RAM[index] blocks. + * + * @param[in] index Contains the index in the NRF_POWER->RAM[index].POWER register to read from. + * @param[out] p_ram_power Content of NRF_POWER->RAM[index].POWER register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_RAM_POWER_GET, uint32_t, sd_power_ram_power_get(uint8_t index, uint32_t * p_ram_power)); + +/**@brief Set bits in the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[in] gpregret_msk Bits to be set in the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_SET, uint32_t, sd_power_gpregret_set(uint32_t gpregret_id, uint32_t gpregret_msk)); + +/**@brief Clear bits in the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[in] gpregret_msk Bits to be clear in the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_CLR, uint32_t, sd_power_gpregret_clr(uint32_t gpregret_id, uint32_t gpregret_msk)); + +/**@brief Get contents of the general purpose retention registers (NRF_POWER->GPREGRET*). + * + * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2. + * @param[out] p_gpregret Contents of the GPREGRET register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_POWER_GPREGRET_GET, uint32_t, sd_power_gpregret_get(uint32_t gpregret_id, uint32_t *p_gpregret)); + +/**@brief Enable or disable the DC/DC regulator for the regulator stage 1 (REG1). + * + * @param[in] dcdc_mode The mode of the DCDC, see @ref NRF_POWER_DCDC_MODES. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_PARAM The DCDC mode is invalid. + */ +SVCALL(SD_POWER_DCDC_MODE_SET, uint32_t, sd_power_dcdc_mode_set(uint8_t dcdc_mode)); + +/**@brief Enable or disable the DC/DC regulator for the regulator stage 0 (REG0). + * + * For more details on the REG0 stage, please see product specification. + * + * @param[in] dcdc_mode The mode of the DCDC0, see @ref NRF_POWER_DCDC_MODES. + * + * @retval ::NRF_SUCCESS + * @retval ::NRF_ERROR_INVALID_PARAM The dcdc_mode is invalid. + */ +SVCALL(SD_POWER_DCDC0_MODE_SET, uint32_t, sd_power_dcdc0_mode_set(uint8_t dcdc_mode)); + +/**@brief Request the high frequency crystal oscillator. + * + * Will start the high frequency crystal oscillator, the startup time of the crystal varies + * and the ::sd_clock_hfclk_is_running function can be polled to check if it has started. + * + * @see sd_clock_hfclk_is_running + * @see sd_clock_hfclk_release + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_REQUEST, uint32_t, sd_clock_hfclk_request(void)); + +/**@brief Releases the high frequency crystal oscillator. + * + * Will stop the high frequency crystal oscillator, this happens immediately. + * + * @see sd_clock_hfclk_is_running + * @see sd_clock_hfclk_request + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_RELEASE, uint32_t, sd_clock_hfclk_release(void)); + +/**@brief Checks if the high frequency crystal oscillator is running. + * + * @see sd_clock_hfclk_request + * @see sd_clock_hfclk_release + * + * @param[out] p_is_running 1 if the external crystal oscillator is running, 0 if not. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_CLOCK_HFCLK_IS_RUNNING, uint32_t, sd_clock_hfclk_is_running(uint32_t * p_is_running)); + +/**@brief Waits for an application event. + * + * An application event is either an application interrupt or a pended interrupt when the interrupt + * is disabled. + * + * When the application waits for an application event by calling this function, an interrupt that + * is enabled will be taken immediately on pending since this function will wait in thread mode, + * then the execution will return in the application's main thread. + * + * In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M + * MCU's System Control Register (SCR), CMSIS_SCB. In that case, when a disabled interrupt gets + * pended, this function will return to the application's main thread. + * + * @note The application must ensure that the pended flag is cleared using ::sd_nvic_ClearPendingIRQ + * in order to sleep using this function. This is only necessary for disabled interrupts, as + * the interrupt handler will clear the pending flag automatically for enabled interrupts. + * + * @note If an application interrupt has happened since the last time sd_app_evt_wait was + * called this function will return immediately and not go to sleep. This is to avoid race + * conditions that can occur when a flag is updated in the interrupt handler and processed + * in the main loop. + * + * @post An application interrupt has happened or a interrupt pending flag is set. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_APP_EVT_WAIT, uint32_t, sd_app_evt_wait(void)); + +/**@brief Get PPI channel enable register contents. + * + * @param[out] p_channel_enable The contents of the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_GET, uint32_t, sd_ppi_channel_enable_get(uint32_t * p_channel_enable)); + +/**@brief Set PPI channel enable register. + * + * @param[in] channel_enable_set_msk Mask containing the bits to set in the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_SET, uint32_t, sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk)); + +/**@brief Clear PPI channel enable register. + * + * @param[in] channel_enable_clr_msk Mask containing the bits to clear in the PPI CHEN register. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ENABLE_CLR, uint32_t, sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk)); + +/**@brief Assign endpoints to a PPI channel. + * + * @param[in] channel_num Number of the PPI channel to assign. + * @param[in] evt_endpoint Event endpoint of the PPI channel. + * @param[in] task_endpoint Task endpoint of the PPI channel. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_CHANNEL The channel number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_CHANNEL_ASSIGN, uint32_t, sd_ppi_channel_assign(uint8_t channel_num, const volatile void * evt_endpoint, const volatile void * task_endpoint)); + +/**@brief Task to enable a channel group. + * + * @param[in] group_num Number of the channel group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_TASK_ENABLE, uint32_t, sd_ppi_group_task_enable(uint8_t group_num)); + +/**@brief Task to disable a channel group. + * + * @param[in] group_num Number of the PPI group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_TASK_DISABLE, uint32_t, sd_ppi_group_task_disable(uint8_t group_num)); + +/**@brief Assign PPI channels to a channel group. + * + * @param[in] group_num Number of the channel group. + * @param[in] channel_msk Mask of the channels to assign to the group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_ASSIGN, uint32_t, sd_ppi_group_assign(uint8_t group_num, uint32_t channel_msk)); + +/**@brief Gets the PPI channels of a channel group. + * + * @param[in] group_num Number of the channel group. + * @param[out] p_channel_msk Mask of the channels assigned to the group. + * + * @retval ::NRF_ERROR_SOC_PPI_INVALID_GROUP The group number is invalid. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_PPI_GROUP_GET, uint32_t, sd_ppi_group_get(uint8_t group_num, uint32_t * p_channel_msk)); + +/**@brief Configures the Radio Notification signal. + * + * @note + * - The notification signal latency depends on the interrupt priority settings of SWI used + * for notification signal. + * - To ensure that the radio notification signal behaves in a consistent way, the radio + * notifications must be configured when there is no protocol stack or other SoftDevice + * activity in progress. It is recommended that the radio notification signal is + * configured directly after the SoftDevice has been enabled. + * - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice + * will interrupt the application to do Radio Event preparation. + * - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have + * to shorten the connection events to have time for the Radio Notification signals. + * + * @param[in] type Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES. + * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio + * notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is + * recommended (but not required) to be used with + * @ref NRF_RADIO_NOTIFICATION_TYPE_NONE. + * + * @param[in] distance Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES. + * This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or + * @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used. + * + * @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid. + * @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all + * running activities and retry. + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_RADIO_NOTIFICATION_CFG_SET, uint32_t, sd_radio_notification_cfg_set(uint8_t type, uint8_t distance)); + +/**@brief Encrypts a block according to the specified parameters. + * + * 128-bit AES encryption. + * + * @note: + * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while + * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application + * main or low interrupt level. + * + * @param[in, out] p_ecb_data Pointer to the ECB parameters' struct (two input + * parameters and one output parameter). + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_ECB_BLOCK_ENCRYPT, uint32_t, sd_ecb_block_encrypt(nrf_ecb_hal_data_t * p_ecb_data)); + +/**@brief Encrypts multiple data blocks provided as an array of data block structures. + * + * @details: Performs 128-bit AES encryption on multiple data blocks + * + * @note: + * - The application may set the SEVONPEND bit in the SCR to 1 to make the SoftDevice sleep while + * the ECB is running. The SEVONPEND bit should only be cleared (set to 0) from application + * main or low interrupt level. + * + * @param[in] block_count Count of blocks in the p_data_blocks array. + * @param[in,out] p_data_blocks Pointer to the first entry in a contiguous array of + * @ref nrf_ecb_hal_data_block_t structures. + * + * @retval ::NRF_SUCCESS + */ +SVCALL(SD_ECB_BLOCKS_ENCRYPT, uint32_t, sd_ecb_blocks_encrypt(uint8_t block_count, nrf_ecb_hal_data_block_t * p_data_blocks)); + +/**@brief Gets any pending events generated by the SoC API. + * + * The application should keep calling this function to get events, until ::NRF_ERROR_NOT_FOUND is returned. + * + * @param[out] p_evt_id Set to one of the values in @ref NRF_SOC_EVTS, if any events are pending. + * + * @retval ::NRF_SUCCESS An event was pending. The event id is written in the p_evt_id parameter. + * @retval ::NRF_ERROR_NOT_FOUND No pending events. + */ +SVCALL(SD_EVT_GET, uint32_t, sd_evt_get(uint32_t * p_evt_id)); + +/**@brief Get the temperature measured on the chip + * + * This function will block until the temperature measurement is done. + * It takes around 50 us from call to return. + * + * @param[out] p_temp Result of temperature measurement. Die temperature in 0.25 degrees Celsius. + * + * @retval ::NRF_SUCCESS A temperature measurement was done, and the temperature was written to temp + */ +SVCALL(SD_TEMP_GET, uint32_t, sd_temp_get(int32_t * p_temp)); + +/**@brief Flash Write +* +* Commands to write a buffer to flash +* +* If the SoftDevice is enabled: +* This call initiates the flash access command, and its completion will be communicated to the +* application with exactly one of the following events: +* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. +* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. +* +* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the + * write has been completed +* +* @note +* - This call takes control over the radio and the CPU during flash erase and write to make sure that +* they will not interfere with the flash access. This means that all interrupts will be blocked +* for a predictable time (depending on the NVMC specification in the device's Product Specification +* and the command parameters). +* - The data in the p_src buffer should not be modified before the @ref NRF_EVT_FLASH_OPERATION_SUCCESS +* or the @ref NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled. +* - This call will make the SoftDevice trigger a hardfault when the page is written, if it is +* protected. +* +* +* @param[in] p_dst Pointer to start of flash location to be written. +* @param[in] p_src Pointer to buffer with data to be written. +* @param[in] size Number of 32-bit words to write. Maximum size is the number of words in one +* flash page. See the device's Product Specification for details. +* +* @retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned. +* @retval ::NRF_ERROR_BUSY The previous command has not yet completed. +* @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size. +* @retval ::NRF_ERROR_FORBIDDEN Tried to write to an address outside the application flash area. +* @retval ::NRF_SUCCESS The command was accepted. +*/ +SVCALL(SD_FLASH_WRITE, uint32_t, sd_flash_write(uint32_t * p_dst, uint32_t const * p_src, uint32_t size)); + + +/**@brief Flash Erase page +* +* Commands to erase a flash page +* If the SoftDevice is enabled: +* This call initiates the flash access command, and its completion will be communicated to the +* application with exactly one of the following events: +* - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. +* - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started. +* +* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the +* erase has been completed +* +* @note +* - This call takes control over the radio and the CPU during flash erase and write to make sure that +* they will not interfere with the flash access. This means that all interrupts will be blocked +* for a predictable time (depending on the NVMC specification in the device's Product Specification +* and the command parameters). +* - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is +* protected. +* +* +* @param[in] page_number Page number of the page to erase +* +* @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. +* @retval ::NRF_ERROR_INVALID_ADDR Tried to erase to a non existing flash page. +* @retval ::NRF_ERROR_BUSY The previous command has not yet completed. +* @retval ::NRF_ERROR_FORBIDDEN Tried to erase a page outside the application flash area. +* @retval ::NRF_SUCCESS The command was accepted. +*/ +SVCALL(SD_FLASH_PAGE_ERASE, uint32_t, sd_flash_page_erase(uint32_t page_number)); + + + +/**@brief Opens a session for radio timeslot requests. + * + * @note Only one session can be open at a time. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) will be called when the radio timeslot + * starts. From this point the NRF_RADIO and NRF_TIMER0 peripherals can be freely accessed + * by the application. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0) is called whenever the NRF_TIMER0 + * interrupt occurs. + * @note p_radio_signal_callback(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO) is called whenever the NRF_RADIO + * interrupt occurs. + * @note p_radio_signal_callback() will be called at ARM interrupt priority level 0. This + * implies that none of the sd_* API calls can be used from p_radio_signal_callback(). + * + * @param[in] p_radio_signal_callback The signal callback. + * + * @retval ::NRF_ERROR_INVALID_ADDR p_radio_signal_callback is an invalid function pointer. + * @retval ::NRF_ERROR_BUSY If session cannot be opened. + * @retval ::NRF_ERROR_INTERNAL If a new session could not be opened due to an internal error. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_SESSION_OPEN, uint32_t, sd_radio_session_open(nrf_radio_signal_callback_t p_radio_signal_callback)); + +/**@brief Closes a session for radio timeslot requests. + * + * @note Any current radio timeslot will be finished before the session is closed. + * @note If a radio timeslot is scheduled when the session is closed, it will be canceled. + * @note The application cannot consider the session closed until the @ref NRF_EVT_RADIO_SESSION_CLOSED + * event is received. + * + * @retval ::NRF_ERROR_FORBIDDEN If session not opened. + * @retval ::NRF_ERROR_BUSY If session is currently being closed. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_SESSION_CLOSE, uint32_t, sd_radio_session_close(void)); + +/**@brief Requests a radio timeslot. + * + * @note The request type is determined by p_request->request_type, and can be one of @ref NRF_RADIO_REQ_TYPE_EARLIEST + * and @ref NRF_RADIO_REQ_TYPE_NORMAL. The first request in a session must always be of type @ref NRF_RADIO_REQ_TYPE_EARLIEST. + * @note For a normal request (@ref NRF_RADIO_REQ_TYPE_NORMAL), the start time of a radio timeslot is specified by + * p_request->distance_us and is given relative to the start of the previous timeslot. + * @note A too small p_request->distance_us will lead to a @ref NRF_EVT_RADIO_BLOCKED event. + * @note Timeslots scheduled too close will lead to a @ref NRF_EVT_RADIO_BLOCKED event. + * @note See the SoftDevice Specification for more on radio timeslot scheduling, distances and lengths. + * @note If an opportunity for the first radio timeslot is not found before 100 ms after the call to this + * function, it is not scheduled, and instead a @ref NRF_EVT_RADIO_BLOCKED event is sent. + * The application may then try to schedule the first radio timeslot again. + * @note Successful requests will result in nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START). + * Unsuccessful requests will result in a @ref NRF_EVT_RADIO_BLOCKED event, see @ref NRF_SOC_EVTS. + * @note The jitter in the start time of the radio timeslots is +/- @ref NRF_RADIO_START_JITTER_US us. + * @note The nrf_radio_signal_callback_t(@ref NRF_RADIO_CALLBACK_SIGNAL_TYPE_START) call has a latency relative to the + * specified radio timeslot start, but this does not affect the actual start time of the timeslot. + * @note NRF_TIMER0 is reset at the start of the radio timeslot, and is clocked at 1MHz from the high frequency + * (16 MHz) clock source. If p_request->hfclk_force_xtal is true, the high frequency clock is + * guaranteed to be clocked from the external crystal. + * @note The SoftDevice will neither access the NRF_RADIO peripheral nor the NRF_TIMER0 peripheral + * during the radio timeslot. + * + * @param[in] p_request Pointer to the request parameters. + * + * @retval ::NRF_ERROR_FORBIDDEN Either: + * - The session is not open. + * - The session is not IDLE. + * - This is the first request and its type is not @ref NRF_RADIO_REQ_TYPE_EARLIEST. + * - The request type was set to @ref NRF_RADIO_REQ_TYPE_NORMAL after a + * @ref NRF_RADIO_REQ_TYPE_EARLIEST request was blocked. + * @retval ::NRF_ERROR_INVALID_ADDR If the p_request pointer is invalid. + * @retval ::NRF_ERROR_INVALID_PARAM If the parameters of p_request are not valid. + * @retval ::NRF_SUCCESS Otherwise. + */ + SVCALL(SD_RADIO_REQUEST, uint32_t, sd_radio_request(nrf_radio_request_t const * p_request)); + +/**@brief Write register protected by the SoftDevice + * + * This function writes to a register that is write-protected by the SoftDevice. Please refer to your + * SoftDevice Specification for more details about which registers that are protected by SoftDevice. + * This function can write to the following protected peripheral: + * - ACL + * + * @note Protected registers may be read directly. + * @note Register that are write-once will return @ref NRF_SUCCESS on second set, even the value in + * the register has not changed. See the Product Specification for more details about register + * properties. + * + * @param[in] p_register Pointer to register to be written. + * @param[in] value Value to be written to the register. + * + * @retval ::NRF_ERROR_INVALID_ADDR This function can not write to the reguested register. + * @retval ::NRF_SUCCESS Value successfully written to register. + * + */ +SVCALL(SD_PROTECTED_REGISTER_WRITE, uint32_t, sd_protected_register_write(volatile uint32_t * p_register, uint32_t value)); + +/**@} */ + +#ifdef __cplusplus +} +#endif +#endif // NRF_SOC_H__ + +/**@} */ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h new file mode 100644 index 0000000000..231a54f941 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012 - 2019, Nordic Semiconductor ASA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef NRF_SVC__ +#define NRF_SVC__ + +#include "stdint.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief Supervisor call declaration. + * + * A call to a function marked with @ref SVCALL, will trigger a Supervisor Call (SVC) Exception. + * The SVCs with SVC numbers 0x00-0x0F are forwared to the application. All other SVCs are handled by the SoftDevice. + * + * @param[in] number The SVC number to be used. + * @param[in] return_type The return type of the SVC function. + * @param[in] signature Function signature. The function can have at most four arguments. + */ + +#ifdef SVCALL_AS_NORMAL_FUNCTION +#define SVCALL(number, return_type, signature) return_type signature +#else + +#ifndef SVCALL +#if defined (__CC_ARM) +#define SVCALL(number, return_type, signature) return_type __svc(number) signature +#elif defined (__GNUC__) +#ifdef __cplusplus +#define GCC_CAST_CPP (uint16_t) +#else +#define GCC_CAST_CPP +#endif +#define SVCALL(number, return_type, signature) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ + __attribute__((naked)) \ + __attribute__((unused)) \ + static return_type signature \ + { \ + __asm( \ + "svc %0\n" \ + "bx r14" : : "I" (GCC_CAST_CPP number) : "r0" \ + ); \ + } \ + _Pragma("GCC diagnostic pop") + +#elif defined (__ICCARM__) +#define PRAGMA(x) _Pragma(#x) +#define SVCALL(number, return_type, signature) \ +PRAGMA(swi_number = (number)) \ + __swi return_type signature; +#else +#define SVCALL(number, return_type, signature) return_type signature +#endif +#endif // SVCALL + +#endif // SVCALL_AS_NORMAL_FUNCTION + +#ifdef __cplusplus +} +#endif +#endif // NRF_SVC__ diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt new file mode 100644 index 0000000000..9225328db0 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_license-agreement.txt @@ -0,0 +1,35 @@ +Copyright (c) 2007 - 2019, Nordic Semiconductor ASA +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form, except as embedded into a Nordic + Semiconductor ASA integrated circuit in a product or a software update for + such product, must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other + materials provided with the distribution. + +3. Neither the name of Nordic Semiconductor ASA nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +4. This software, with or without modification, must only be used with a + Nordic Semiconductor ASA integrated circuit. + +5. Any software provided in binary form under this license must not be reverse + engineered, decompiled, modified and/or disassembled. + +THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_migration-document.pdf new file mode 100644 index 0000000000000000000000000000000000000000..350288c77155afc99b31d864b1ab213870b4963f GIT binary patch literal 90738 zcmdSBW0WO*m-bm{+qUhKwv9^Lwr$(CZL`w0D{b3ZSyT7(_UgXZ^fS}XOs{^|%=r=# zD`G{&`EY*w+Sj%JhfG04jE;$(6`E}SV0ICjjgXPh&d?H?hlfGT!rIxykwMJbz}ZB^ z#K_Lrgh9r{*38+Qkdu>>kI%{3(Zs+8+C4i(bu#vV9kKg@2HR-^3_QBLEphP@X6+l6 zF$=ik7&s7}B05ClX#pko7mlB0W-+O>#?2ax-V$k*`ekkD+kTIh2j7r~Odzak$&160 z&z&w$-m3xj-~i07TDISFIYOU@->)m-h=R9@n1HXx2q7tN=&Fe#(`-=IaFl#Ra>P(j zel@L|=^~X9%H0S%QKHR8hGrEzwOP|PHOU1^LSH_T_Z%C*&tMsEWH1)e9yqiF#_R$C z)i#?nv7uSheo8!jMR2AP@-8igY2id!2bK{mLlW4c;gjad=dVXih7!^!qG;yC<4{XT zIQ!jXRF{U1bAl7UX}XdmQwAVo0Hc5622IL_)z zLPh~Usua!AlL$E{;aQO96)>XN_WhS{-vaSG_9g>x;;k5Q+#lHA!D)+y&8WyFaH-;#o|4ME1w8bv&6bKfV z&Q{}V)0A994Hb}{V+$i7LSQ(11VQG`L9kl4lJtf9MTqrpqc8aZJ;5+^zm6Z4?$R`PwjrLT2hYycy*?OXCPL?HxFVYndySdew zr+3m?8YR1kbKk}PD$Rh(P*ASXwYRlJ`#sbTbHuKcNx2=7rInq`qJy(cW6-rr47GMC zEVIq%NKvKa5M3Rnk*Wh*o{{`5dxz$&-UlTK;F?L$puZfiy#nde{n6UnQxT&vnsJR5 z+tjKZs31B#J-#ZgmVHyjtwW`jn`lmS_ejZBU+RF2-etQ!e^?jq)%3>TT2+z(4;*kx zFwNKpyNAhMxcIwoF~}~YxS}J}Oh^HuZvatHDDWq+?(8~T?-R>@*Tr5D)79>T8czIx z*yTLC5m2>-jIJy61H(rJ>)~TZV9{j&6(7sG{S#`BQt4{l!cPPpBMQ+?i=*rM87%A= zzVeY;ei$7mpWX6%OXxrzlG?6Pt>Hw?d8LeAHoSmeEYv34rH?|(Z`YTsJ1&5d>O7IE zj*WXIOi>ixiIFg9HR&SVTZqWX%blp2**@zotJ-yvL9NUggE9>{>&Q{%-4Y>h<>-fR zy@9vtLIoauY4;^)hJk*{u`3H(I09ZQ06?eanOFWu`{DQinO zy&Y7&ogXD`#5_E_@rxkn)3ulNlian>-MA(hFXtFH{Bu^%-=R%xjsNWz|7Y(nLNNUY zDTM88olR_=oe2M;hZ2K|hrJ1df`OR{gOZ7por|N9iPImPC^*^~DVsPGYBBsF4k3ez ziMul)gQU%$%Y^=IEBtR;NgW2UKX?2KK}>|q|G1?XGa<|W+F>DN{cDHs&*#rG9REC) zko_NLWKE1M42105wHW^#0$7>o0RTcaPBwaGfDRwuU$6hyO9TF#`!Dgv!~tOa8{ekY zZJe^i5Wi;X*5V{bdmOu2a-2sRP)BX7X;KrtCAeS%l0+i?zcn75<=x3&Z9C`-Bo0Kd zEY6dzL~iz&x#ewb9#q{s7L@CElF#F+2TwQ`bbs%qrdD*>48{=+;=g;t2&uHM_5Rcf zK@|NOSJQrKQ$w{bR8pr!oA9H+UY3EOJVig{8mNnkxxXZy9;Ec=+!PVa4BpI_c{qt; z@NR>MSql|YX)`fDuEUI8XjU;ar<1kGP8D?SDFHik{OQ^%s8Uv9zNR#7-(Q?8?pCx` zE0--6Yqc(@10q`V(4x_z%10S77Fhz)V*L}j2z zN)Ese{xDVLX2R=}FgulcK}lHCw|HoPwOxTJ36oO&bvB?%*;daj zn0It{Ufj!+Ze-$9^0OimXfl8oT?gz$O-IcGl^xlJjvuWTWW82sCnd9g=fc}k$2x$A-G$eX*W{QBit{vgP0=kA^!dothsM4gj*rpCLOuM&L6G37mlEUV zF@b=kCHeC5b=~ABm$Ws={$?poq?2)MHBJZJ_i-gaF?ax5c!<-IT(@hNp+b8O32*h8#r2iWn=qE;x`_<3(}NcNbI<I$$G+%9G};H}McrWMAq3i$ zOWSYRAy|br{@hwMzkmZ<@~YJ->+xo12qic&@*W5ly1rV&>7ZBK34OQ3aKG%G?Z*xV zDQvIJG;qQA5ab39?lKDSdNoj+;(4qiGPxSKR=9eNlpFw?vNT7++3LREiQr4xh6(Mr z9ISMrS)2QXcPZkF5zEXe?G`dkKlcQroP+Ll*O}>&p?uw^@0qFRwq;RAcSkwCY>2GI zvuNe(kUWs8HQHkmkhLK)T!Y3Z9bNHCHi>&hf6x_yuD%U_gWTK|*Tf0Zmgi0}yri_G zZgt;S@qRNs&(Y4!)6;cNYYK7W@wl0m*OjN(9*fqmtV10&;v>#K$ZW#f6r*r@XnYU2nFN4%Lv z(R86quy(e5)U{p^j^}SwwRXD&R7DabcjtWErgWKOX#(R##9j$kC#X@~qpRTNuNcju z&BOE5`l}250Db{g9K5I~7>;$w6;VZN)_rGWCbhoZVnUd7kIczV0la58q$|OAu0ph0 zZs`29sK=lduinzJ3IVg{WE?2z!wWPwBvi%<`3JRpn+DKV3&HT$N&1~p#ieO_G{DUH z9C@oo;eOC3D;%jmuIRqCsuv>hIIOU+t#8*p3#Riv-pCR_KRIrnw72ibVrq{Jg*z-g(N`7j9IefOkLpLHnk z*Y&7Mg%z)a7t{U4P>qsWFn;Jyt+$M{db^U*t=l!W-^7F-G^)Oy&u4FID|Qv#yIMG7 zEPAl!=|H%-^;fr8a9${(xJG1QlXge8uwD*WH~Hkc8Be&@-boeDBIE=IIR?m^=34yN z=b7qm%|YUbO^7H~^KlZQX1cqg8K!I`oXezCi#oYzaWJu_`{sWXtc5Eh&&ONEJ&5Y# z(GR_b0qp!(9fXl?-5}PXLb*a(BQkLE5g17H->sBRau4r9_xfmMRo}IF0XaE3Lg-{` zAF;-q2Y3|2r_V<2&U%Yq_~`qr@Z6{F*3b>JGw+>AuwHR5QZ3lT!&?<*aCR(Tp+vtM z7K@s+6fdV^4$6LNkXg+gtiYInUX<_mK*R4gd!~5jh!HI)+Cxx1KxwHf>CaHl)9hi4 zWrodmi60YPbZWe``i)YVW81OsrvOBxUmvU2?^pR(rVtvO>>0x!hhcU}exKb2Xf@{}~h!}zN_Pnk~IXfMDHEx6^#cX#C!-^PNxeA`<-%Z!oN_(Te8gUhYHRJ?BM;N#tiorYby?SQtX7YCH<8t{Dar(WHm2-%?2Q1ho8yW~Nsz zPg9<3Qu!THTPyw{SH3$of@C7*66R1rGHtuI6s!WT| z*UDhAvX8$c1TV+;MEtaJf?R&7`LNQBki+ZN(F|2|vAD2z;hA)(>7FpJG}hy5tpYIO zRq@$9&#LZB8}~8L!3E&OrhV_*88+DcOu@uTmz&H`a_Onkz%ji~&|zi>`=2oz|DR_dyT;lkJNgRF@W+DKnB(%r3zO z@{|*x-}NoZ{O$V~tFE!6=C{+TtgnvtQytgAnLCR${7-hoE&06~A2ZBoFhG7+U`?iq zK-={q@JgC!a#i_IGdgr}QqFXON8&KC22um4{wN~Gibws3&Pd_FMd&i~kwKMqo|pws zQeVE>W&~{9RN+FunwFrr535sv%@EDg__|V|adc>nXa+;Ehc{P>BCS)kk}9=F)V7Yx zkZ2bLS6|q^&&#pcGf9aDOGTqd0Lt)T932(Q8wz;0P8 zz*~RW;Yp`!ygp@WI2#)|ov!tjr8J5wU2WfsH48l%RGr0otnSJ{59Y2bA*cvEFE*e3 zmPcyA;DSinP}mgj^}Z#4%H4%W4^De4Bx&{3Cp9){+=o6P7yI-n0xNcMX=nwoJjcn$ z+jWV+MMP<|MtnMrBT`Pq3s16E1}DHaEbw@ehQatlN~MSTvGCNTZsXVFEdr8h5)>se z@pXGa8l9}xx&5VG=+Z--pGv@EhI`P=GG9Y@luwYtreJNC86MJ)LqF`k&x&Zf6_+0% zmv=F^To$0*2x!U`;0V~L^QSa{HmcWNoYV@m1c?c(-=Xe!FTX$7wp5v58Ls`n#4&@C zhsy1OQ-*_(u;i!3$UR-d*Gg8<;{`t7Z9_bpnVL3OTV(dE2JWdJtrq^=xu1Ur8b;ba z{m(#T`e!ZBKREM0gT((P0RQTw{%Zg-v;7@_C22a!n*h|%n_o0DWK+(~sbqdnv84h{ znlZgX7ieRgGE4HGgUgy+EnPd91-d2y2D-Rkciesll~ ztak%VJ9eCzD14c->Dk$H1tcn_u5&QTqDke{R4Go6DBn)!ds^;myEme!B!zZ)$XQbg zqN5=X`~$@(g^)uKKY|r$92umb+>8{3_J=yF6_D;kNl+y9bzb?8iK!F3T-kX|0m)WF z=_IcUj*aQTAlB#!YX(KPc&+I0TGBzKI;!R2@L6QR+}5ec=k+c2Yo=57l&j$m!B-!o z4okGMlGxamRDokt2EirlN=aC011dmx&GO5o=H~ngS``H?_H(9F0#vK<_G42@v{^tb zBTiG2QpBUxAx0|;%rt3e%=sp!7WuA2w5$pr=85^iCap%`!X2T(B*&m>%|>$G$T#T? zXjkbeYfLm2{mqlmSaVDiKzp&A2EkmWbhu4eESM8)q_|8@a>$)Q$I-a|5Q^IyH62N3nwRiX7_ZOP?lhx)^MrAh+Oh zG*AntG*#1#HC1lc#?WBsEQsQF0P~e;znqKy)A1R?-p4}wM6$JZHRQd2-*MYU$cw`$ z6K@(mJai7w(3F`a&%;P!Fr!#p)L9bbc}@-kcV~e&;+s-4fzbHQwh8~9;&0tkJHexj zb%oPo7vf(EcBjlg(PsZXs?}_r#myEP{wg@Xoz_8!V5duO)an~LnWFW`ztROGwcAIh z4t&|NZy?A6mS`d(>~T#x1tnLAXq)-5hctdQuBf1Hv(-gW?x8wZigL4)sh?U2!Y6fG z=D<{OG8s2Y&%O=K=c@5(??vS5KOGpm&wtq^{gdKsjB|9DPm0|(b3Jo^+AN&R9ac}{ z;f|x_czD_Q%ff+)I}^7r?5!6@0>vk&!y@;H<4L7EC`-1E{jpHvnINPZXD#(R*cx0z zwDYiu&ra%Vp+A~ypOkaGPRbi}BYG5yo_U)Ig)tOry^2dPOZ17iSMGi~somIO+GL01 za=FDbgQ?mMu)9^|cv(-h76)&2RxQm@PFMnrcEb9wsn+1*XPla9ajj*y{Tqy+ zXie>si`KT;8~@>QRFoolpRjTNB)nf)Pv+t`KNqFe&0O#-eYLcUmeV~k{S#2y6}VcN zZU1_q7!~@GxJ9}MS&E*4AK$r)ubtMF^v(`B4Z^w$ZZCJYf|oFIMhbWE zt#h6dp8UWb-#E#6^jBpiZ^jTRmx(Kt;wXWb0*nPC^&_&=fn9^c$CyC)kwq_MTV+7q0EVR(EOVdS`ehlC?yi15xRyq;#(rK$)p_)}%a$h|< zykPbtbWs}-ceIai2F~?(9MG; z4=!q+B$tD0#aVWXm=#x@O85oygZz}5iZ`iWRW8edKMS4ExWD9XELfx)4UnLIpo?zs zEQJV8he$}o^M^+rAw1`#k>ez9x1lYvk!N|+!Z^rZp;i8x(5%FN1ZGv``Wl0#pnq!OzhieXz?OwQ zdESOI%6KgZVjq1$QrBHqc!C`**zF=s|xa zQJ>+X(60=+5?U)1#RNnN_-jS zPW}4}Hz4nrDOlWgn#(a|0AaNe^c=N<%|E91YlxeWByym zyQO9$zbS$Eb*;xlP_Un>(>JU-9Ht<&sVvxB+{rCyVsq)TztRx2N@QR5!SK11rL#HU znjf5+B$tM`cX!>*`!H4QV}ctC2OWEZxESPM96d53elU?AtO)|48Vc37|E?CK2wS`?-BfaBTV{eXX=x#dZ+Bv=k8<9EdL>w6>b1*QI+ue3 zvO~PBDTlKztb-%k<mAG9jKE`92T{0cKZtSkka)cYiiW-Y&(X zN@>(`riHT%N%`PYw6S928;&3kM<;c*p3EdgtyVz5Jo~-$@QZy3&2HBM_H)Ywg7CKd zc?i?Zt>G7;%^C~NL5Imj!Z}&hO2tUgx zhmr4Rc163XDa9;389})LPVh(ZSCYhU8HFvUWzgg5S*)S$=LDNp8lRc)R4?GtH>qX*fCHz@rD5YSNL^DJvEc9^^iS#2HN+)$Gpd%Rpa#cha zU3wVp!JzsZWL1`g0iF!>Zka}^AyK{?+aIHlz`{^f#o0je%0IJ@z+$IV?5PfOU7HNh zjj~9w7;K5APGFjOB}GjP7he}OSd8;ZntUl575v*Ji{aB4&@GT1Ljr;gGfd9O_vhUL z0pXC1-N6z4bKhkoBi&LpsEdD!L}Cb4g@^xyE3#5dj!-EbmZf5@=((c}L?CfbIv@vl zy@;0tosLej_Jk;nA!97nR*}gk0R$@=3ipPVXdh9lypiswiY_!M|Jek5$73CV1{Jju3+5$rt_mv z;yBXWX4*bfG72?-Pwb;HVE3$BmWMKZrVC6hW#RUccf~INPYsEDTuM><0TsP_*C`!r5L`u(BIM@72=B?-Z1(5&!vTZaA?$MW3+)g9FtB{h-v>uU3%_ zPeCX!z3(yH8Y2yq^zi)Afo+3LyPwmytbk8%Z=QG5XkUUjxi~TLf$@(;hPtkN{^L2r zp_WZ}v|A(w&Ufp#Ads~g{D-B7FyFYrS-njv#jtkk8c^c`5`ny)>X%lSKq9!GsU4^h z-u@tW@(H79+`L(7U7PE;uW;Nc(|v70X&v+q-M+jToBmp}$sqY0$?#`ZYknbvjr}BM z0XLUQ2q;np^n1%+uJATe*^vULkfZL2I@j7KlFc@m$Nm5`g4QZLqctws0d9(D{HDh7 z=EPQGq@vf@{@iim*($Gg>UU4Ri&>z0Ua)J*gY$9Io;6&yL;T&}M?tjw_x_6sPP z0h0^bE@noHg$`1(A&dQp<(~E%m%qvl9+Di1wLfi3zk{W*-O2TFec4szeqzOwStXqU zvMY4qy~=T|Iuki*g?hmb;&^?dh&i8Iq~||p6jba@T~&HIL<7q@MeVK-J97F#$wHUk zPq&-Bt7TV<_jqtbiaV$x5TEvN^Li(%yNZ5H&JPL7enVQ zkC(;hvC)cWQAWQ?s}Rpny*W88)5N%xoSbg8zLd08oPYvJMS9;JPMR4jVkFTlErkoZ z5|V8-Brx#94`RD-#2m`4-|?u(13j-J)wX$0*H9Q?%nK^ug55vte&0I6@xl83wWL>+ zMUT0orM=I)b+t3mjA#X_$;!a8;W!(Z z6}_6LraxFt2CPKJxKl71mvkzWKQS*8b;ruO@-bOxP>Ou>T!J8^xlA{o3w?FWt3YKe zLJ4J+q77~q18aTuwAyplUPMvNLFI_fVTcoZp=qdO)s$?shBs_^En+H zfUh!--ymgn2P(ft4E2Z3$?#7)i_E;_%7$F-z4|^$#sT4ukyG$p|I(#6TsX&wK#r@iQXm2-Pl0j7qs;2F`HPLaf^R_q0Qd1JjOO$dc6L zj4^4aRN&PrLc6EM8BDfFX{m3%ZzUP%2Y?Ug5>x8epH$9>b+)M5TZd;PDEjH(2Yp%K z(>hx0stT<_nGP40ExFJpM;esU0G8!QES&p2_sSSf{XU)CX<{hBa6C`grXyZ zfLLNCxj{f6tC$B7Xrp6jjlVV=xtn1|Xhbv?LO5boA80k-mE?+0Hq@1SptV>BQ$&UZ zqL(z(%7Ae(r9MMsJ&1g|U_=gwHcKtbF=Cf_rS#)tLk9LRj!@}S$?ZeWWN9ZBrb21w zuwY=-@Q*6#naDlMhVTZkLsCU6m$;C?Wg*q%403JWV&a58+zK;tLF{r3$1(QQbGRE7 zaMN4{Fa#VwO!>vw_M}0kL=Yx7y(3AGHqhb*4@TV)y*z{gXE;MFOH3>pvYk1o*du#d zi|iSp?EE^!5VoL3MKZoJ;zaRPzQY@%b|r^#8^rD7M5OCV`aach1-0Gw0Du}=r0n|n z=QToC?v8~AouB)&+Ukw(ZKu!Aao@V90RmlE@RJ({H`{$Lc4iHP+%3ft6tJZOYwFpc z**$MIzhL(38o%I6(@>0;YVuJ;QZo1UH~if9Yz{d3dpM;J1UrX4S z*x3G7BBs^;7|dLV|47&%xKt#*o}Jwxhin#sl8_g*=o#@*Xm;5fls5%B@V-8D#$AcK z=8)Q^v=b#STY9`=UE@^m-E26PARBpLF6g0ArV(1?H{4?M4FTw#%g&ET*M7^Cf)E>L zoPtp4pIX|Et5w#(W=*GB z*)KC!wj7S7;Zic>$#M2$rv|TLM}IKo7OSVI-%G47;P+D&$K!9p1zhgo)aD; z8?01euXB&8MHZJHR!#!@wbV;2YVy(=z=+aPiHx#w`qH2wK-fM_;;_huO4P`UoI)6{ zO}kBEafwUlym)*H%J1I>TnYeGST7h#F=X(_qa(JG<8n6PY*2fPEL#4$d7nuFvnhEP zl~WjE6(F#%;~oNM<(_m{uR)l=*LeCuaZhFNCzn*AtFlxJgXvy6K1 zaX6aFW|<~w=PXqea6Q`hJc5Mt&cdBM^fKVwgX4 z=i%dl{e8;1M`0&qlF!qUd!LY!4Ha z#`Zo_bhfTkT;i3ki9j@^0lqi+NRT=^!;T-sxv3IVz+QR`ef(9Emxq@7Osx0sqmBPPyNCH-%lB9q|315Yr7o*{06^^d zP&$Ey>c0tOQc_u0>V zx9ajV*>_Te^#ldlT*@{33218Tyj6Q?Ac?1!2AT>3ch-0Ms4xRqj^5D&m{{H@I!iRE-}HC z`2^Wj$X*9DJDkTGz1c+Hd9q866uR3NE^9NFd(f+@t6O#1ucWIIV?UG{b?i#XKN7w4 z7q6R}R}9>sXKZo=f|ibwpK%;&&Q~341dxN~z+xSf%DGq{;{S+to7ybo-*ihNYtn(= zhKW^K5&I;|ig*POt(tT%14@Jo;!`zhwb@wPpckgctP3${3(2F(JK!?ETlc0QEzt=+ zcdRd~Zhw8FTzG@4qF#DBDz3PM4?C{Z#TeqKiG0~Gv6|WZ?jqx^E~@R9qPHhZ0o+T`YgN|OUpOZ{3si6-yU_S)MyH8e@Eem2VDtFGLdO^`gc zJWaW`CK6g_VF@tBcTblrcPY4~Hpvw7&^2Ty+AHdcP&Kq-ITAO^4C(NcvbolR&b?Ee z+{YWcx^9}tOoj?jebU}GCL0Y(zivUy4b{6!h-ZF(19Va>$PsyiL{SUWogjpd{g0gu zfuY8HonDqeXPKK)q8+&H~<-wGN&q zJ6HaRfebE!A{>or(Um7Bsiv6J_3>xY8zkzREc8O&$9sqCyfH7byU^b8kPXK9> zAbL!{5vm#bv;Z>CVlr5XWM@7PevenS%#XuNtAimdg|e3rc%8gw+?|5KuRMB}zW3Ty zC$Gn;H>t3+pnGzwl-#IJhtBZCy+1RW|*{)D3$kY>ZOyzL&41 z$e`(?i`-4mEb?Ga7M_!fgmfOJt3i$5oLHzzRYRa06xH;~$F3T+bvxx{C7M{E1((;0 z#)CFB57EGCBvh;gxAqiFsEC}e&usQd9K-Yu4n7J{e>0ucblp;xRG%VOXUl~7d1-=# zAKv}024cYCb%M_i{gY&8FDg_#_T)${O}EZ(z_yE*Gqt{8l_fVy!7)!?rzX@pfpJkZ zod-;L?$yGw=;rNu7~>>)wvd+-GbV>j-5-me+!}WJKyTpn7t71%LRs0brd~Z6K1tSP z|NU?*rjXIS6;98KzkD?@YIo!L7sCBK#u7to{V+HW(@%2TEBwIp(v z-9rKbKMNgx%l}!0QBFpcsaB~$=c*{iCI}E#EQuPETy$7~&2DCq0%czbuv`m|2ng{5 zj(t&}Ge{q(kJxR@ql};Zfn#$^bj}D7%eTl`0QWAe;d9YFIbBt8D9x3XQeo`i^6Ic$ z{i0dph+Z=@spX?laTw%N(bc0aGr48g4!(UpGg0l6&;5Ottgj+jd6Xg4Do5|ZD}~$u zy7sXgHbbz1Rx;wKVfnU2XWvJK#DtCtq#V6rMBrU$rtI>*47u4GKTE*nDOiXhL>Ie4 zc|ZJIA&DSS{GJxRQQXh-39@OH!~CY}OSkIgrSJEBOpvQzeGR^U-F=o2;%MdrzmH95 zBd5bF?lPl8xUcB_JDpI?-m#t9K+^7r)&kfc`H<(6 z7V%(7-4&{#4^-8nAN6_~Kw~H-qS>S4?G`tfwork6#CnOjcIA~v+E@6`o?o_ZvoD%n zzN1&Ia?d>@ot(C(Emzau$SDGQ*3m{_iOr$BGRZt|3iWi0z!ik2qgciU>hJQYn&7WX z7g6c3O0f8d;fh{$GaWfXh{1xK+P!HDwfWL3bH^RrRWFQQi_Zbl7N9?DgsN!q>C*(c zsJZ5Sc%lg<2?*u1X2MHw$qx}zaKnH1mg<-?UD}_}?<{FVg4^k#m9f0m& z1`5$%04QcznBS&ixUpHTmlJlmTi%bOTMmIsR<0DRSrrCHRMGgerBGXSAB0L%7UM% z_Gam~5MN*8`lzwd4=~V3ndds%RI67$;OqskpA`d3FGI$q&Hg}b{!W2$UsG#ALU@RPDV5}FRr-GspV67#!Y@-9nlk0Z5!Svq@rm3@xyGDERYIwQ<2fi zw5jpQEPs2g^(0W{0=3hb>#deagW{b88dS7YW+E#-`sGU89kE0@vXfOY?Iaqo29ANg zKne^8!w;X`tM=->$DneDB*(658Lb;0W7tngHuY}8nV{8lkEM;iPLh2^Pd%D5;>k%L zcU~yYq;s=Aakl>J%*k{8>yeDrOT}=j^;C92xobsjchaS1HA*k(!-IlbbdV4^mT_D&o)-4UGj!(cwKBWNLBLRLvPOA4d7hcOCTn-*j4C{2I8|(`-~G$ zE6i1N*E)%!Z+PV5eM(&U-1WcEpYIF9CpovTq{{gprrr1KRdO}_K2AGhNA2ID z{zSe{fa^hF=4dnoxuIlw|6gxn6)APS#~X1N)@gS7nzHYn^K5&Yw4|G z6AuzyX@9TLMmgmYZeFD%7O=s#k8Rg22#IBPKCj;@3945T%!#^e8S9di@buK2HsuII zgLdeCAZrG(8OYJoB+R1rM+0a+t{nL3ZL>e)MmZLom@2tkso5gfqb#r2iT1_D_0w=6@_-VEC8TDKh`f3;w@eht15)&i*$qwMA3Q zX_Fn@ceSoxYZD70bvMVu$-3={JpoPH!qseZubqa=ps$Ag}Y}TQQ_kszk@x zp=iAQ^-jmY8@oqeI_3}*uI0NilDsW?l6;aKN)UGHN&HEK^}mqq-cXue_`&7rnudV}yy~YrDF<@1N<7Y!PGn70G0?JNC-^{jy=T zWY@$9v$te0>>?~bRAbbV1EtXg$_&oPsg{b8qy%qHxm+{l!Bt3`I`Sr;ea6sh9r^D5 z!mqDvb~6HV8^A_R+=o`xc$y@;gU|WfkTH7;o$+w_4eO}0pYf98?wa;B-o<3qc;nkd zeMMb^@+dENkfMCi4Z+1E9d{_ea((&Fg{)LoX9%%RCNViDO8xV>Ib7H49_VaAsl9&H z3|5!8aa?p99vdu9mOHF!Ug9ol2Vi5)SE(6X*Bu)0`}*?R{3~e*IU*^N=^dk}`Qz{c z*?6E!O{D4cW^Kk97{!PepH$=cP!xSpw4rv#I7npDV>J-E(D!c-S1qxsFmu?Tcr$zr zJ^sw&&rVR?x^gItJNW@(PJ)#wgx*b(N#Saexe4KBq?36mj{C`$0uwZi`(z%7#3Vei zqB6NjmdmI9SVx$&_AS6h1m%ZVOD?P_698`s(e^EJhgX$QsW^V$&x5kms*#&H5r{^_ z#9kALal@44;4+IZZTvN@BmHx98O@-4LyEcqdHu-iap9J${vy1Wmq&0nbE&-Wyr@$F zaL9sEb8hF48WkeQ$?qjrU3 zms&q0J4|5;|7syqCq=N?fg(tybBFPe zW@*a(PK{+jBSSXTw-kX86RlMXzimszq;)ax@)?Uqx802zOcwZLv7KsGAfeX%PGsIe zPf+M^A8MkkW5@NCZtS^}6%`0^!hPrrC7*|uG`Q9xkK6sBj)jn>)a;V4t*$_uQOo7S z2`304#<;pnMW`cP&yo5Z3N1MpveIIZd;z#}h58ap`R>}X2einHc5-j1O#C$jZf zwn`sF^Ms1bzXs64;7XCUvradOkGX0jsq#4$rNPrhVo zdhw&-R(s3m)13qE#x&~oST8E;>}lG?-49Jy#}`wpJVO$sv?)cBTG|lKGhW$BCSOIT zJOfDZeqza9eTW*D<$OVC9K*RKF#XeDZJoXv!B&}qL4vB1g@P(CvvdahLo>N<)dM~7 zyTQ}74$44%xKKEuH&G4dnIOsvak>E;)M+@u8bS>}y>VXv1KgX*6*kuzDJ^Ct(XnQd zJ8C7#JtmiBN^(5@&0~)omN>jowrM{ zb@K2!6K`eNIfraX9YnzjUka0W82c~gLQAlUm~Yz8Th8d_-tx99H5pGlk7FE+gM53q zTEY6;9w-T5o5uamMpyP&CZ%K?*QvD}P&(z2WeBxAo7}C{kv61S?-op{SBi`C!{r`o zc0F&c=Mtr5jkj#lu-e6JNFcm3L5;Ja^`0cUb#Xd>$uD5l*1}EGtl+=9E>j9welI8Xl$%BaQVOq=V!QC#noGgQr@ZR zOI9)8E5*7X=~K%xx_WnI6vF2Fg zOX`-W#FHdSS|lPH9bRYkId^@;FYk?hdj+mQ3f_DCI zq}5Xg(YBaz$_#qQ660L4_>7>az;=A#BcE}`vvzhB{|FFL?~)^#({|&`>KS+AYYxr5 znJBx0zX3&#F?G*i6?$#e1yKxNax;S$7d@zVT$vPvuWLw=EeX}Fs4c6H{tM?1=IP5kV0*0ewR~o+9eCyzv zpu}Ff|Bxr#VBWYkWeU{~vf}Oc5Qh+=`@P$LTd~g*{7uQHG$~emtO8US(*uT2Qx^Ng z=!Z9gKWIDdS!yp3AwF{4(p?OsgGSQ|F5j#VLNb7SCAdk!5S&qHldIyo%V>++Uvm5m z5l--;VXQ5yukNuq^YQ*Y?W1e9iKLyYGb??`sK~t+38FQ^&-h$5GVLZ9$lP4j9v}QR zE}*t3DHiU;KF8fkKuhP{!=1V?NM7vKY!?27Lk0TS06lKuHs+O)?i`P&G;UyYcTjbA ziRA?kv~-QXDNXisV*u}W*+|*=Zy*uA5B&eE=2-p~HUEd2`%5$ZY7sTux%qVHJ# zmNEU`=sQNHzyA?MjmD*Rp#6Yu7(nKOVez_d1L8)SO#W> z`**wh3YfAb4fa) z%4lMizo5QYthL={_!6?Chyj(8sF7fKq|;z>Of5Z8o}FijWqNS#{AS-Qux}IFvb2>nGSF}qw*B%K#)M-Oy&VL z0AmONQHdBSBP0{@X?x};oy-p}B~UGq^Zpw`Y*=V2wq))n6=LBYpY)Hp0cdl$xq%QP zs?%K@_-1EPP%v!?;Osd?uial|D9$YE{XSLH8%Af!{$;k!!I-0}=cAI+&$jwe)A|2TY z?_~kZyORQxM(cBARXnX)Pt@oIiyZ}g``+OpP^?a#nt`suD)3km#EW9GGp-8Nc&Vv_ zlG5xtHkw4LyL0O$!v%CIq3V7pJl9lP+sW#AolK;EyqoM( zi4F8LCZR`rQFgdWM<5zwUvCI1tyMd{&KsaW%8-G(6nVh4=qB2=2CeywI>Xw2p$ETs zWo$a}ClWsO#;Z1{++rF_jynG4`uy#{J1-y#wd5+B);qTvfV+GwnK;2Gpb!>Rg*@)FRmv)pjDxcByll5v7^1t#sfu4+ja}Kmvo-K?J+~m6? zbWl5;b;)OKaLntFD4WMwjYatRrTeTkO)eusJnW}vIeS?v>f+s73 za*9>p<44y}czv_GlPdeWOGCsR-`o*=|KAM}pK74R0S64X0pm`5{s}@h+9STEqhA6JJdsEB zLcNdI@72T=;GA?Lrr7`9 zOgW&l$zK=^!r8A6+GW5^Mekt{F=4qT z7GFNZ*K?!Wpb@J(McluAy}tWm+0o)d^$Z^~&dQ^0SLN7aSaVV%wOx6v$bbu=CRZ{C z=6|iVgP6GwNkU%rSXxe9b{Hkxn@=*EKsB#tuOPGF^_UJ_LC zTmc3Ypa^yCUKPy_3s0BP=o*Z!JQzF%ZBu^xLsrQc^Gd4ZT+zVV+8(^Y_Z}dv&@!p+ zOALok*79+Z*LXqdQ9ZNg)lSoXu2l%Xy5N;2O*|Gr&nmzDX;>t_(faz%Y=M-+s~tO- zM1u^o>?XNzcUE?FJ~gUGzq7n8`w4QmM^0BGXwWL|G~tWy7VDUuSZ61oOm-1#hWKOc zX#R;F4#utV4;trRc#i*}asFL5{8!O9|6-T^uQd)M3(J2%#x|YK1SF8 z9)36J%E2OY@&VU|kv;iiVb#UXhe^g(aZ)f77Wy5q!jCm1Vjo)tPnIP-+S^1b&-)!q z0G|yaiw?FoV;rp!7Y$KFSA;S+c(%@gRldfPS18#WXKu-~Gj-46&Ga?u-q{u*j!D*| za;n=NqfjR^G7Oi>6uCt`)xwy%pwMyJmTzvHEE(CVUbY6q8FKqv3p-Puv2<4%g?YG+ zuwE1XREd2cPfTgyNZDve3{|>IcvQ{V6*J<2$%-aj1^K;jV0`2B)qAgWR!ddkoneg(C4A>sP zG6Q^^r>6!3BHAEcLQ2uNp>@IrJZ;XbZT?#nJ(JwE0gj6Shi5uLUX$1z(W+HzVxV=S zI1?vFgL~6~aOV+w5VcTj@JdAt`lM1+E14;W7&KWgZe2+0rb@=F^n?U=GOI|)x0?0u zk}mO}R7Xnjs(6zImh8@~LaDEZ^_|a z74E=OJ#c!{J?3uLmCHQLu|@9H2bi^nB{6pxKA)fMCU6~RVq=SIJN zn&gIk7BO0(7}4Fb7}U8GNu3;) zToSM}y(BGRIhQLr@{C;;{Gser0pFgM?cbJ@UI~jlLNyUJ>%>@`>4p7`T)2?UAX$W(b=kOa3auq#*fT+d zvK@9u_34dT$Rqj&%hRw{y|0-uVi}Z&H^FXty*&k{-5kADpunI_6O7Y;gZ|Y>o1aZJ z6NZyh+9lE;TSNO6o0}2*#)8Jh@&=MuLl#fPHr3YW`?Z) z?1uc{?o^iHH%Bkd7it%ty!c5vxqZ+=)7|6K>;9!tQLadC+G?`w1UNh*J7?hvj8?8~ zn`1AZ_T)eb-Vbt$Nd6obRAK2Hmy{EVy&&dZ7ym=rg)tGC51JjZ${b@yj+>$rpO?EE z-&cjc<;W53Vd>9Rx`DFH5Cw6w1hb1TN^s01I)xbj3VD^Bio-Y5HdR|t0 z<@STX&_TX$6w2#9Pk$g=Xm#<%=ZO9u`tkd*Kf57XZCma(n(aKz$WoIclIaA!`dxTl zPWEt(qhnNEw^D?BJtfJr>P44@Z|^lH{Se(YzV(MRyL*Se{TlLYkTL$L`q}aOujTa@ z>ZKd?%Abu?su_R#PjI63H0yuZrTzsj`JcPgzuo!&FYi+S9}O1ff3eg5*P9a)12gl# z7%VlK|J`6Ysq5QlWyYfs3_yRKYDlSZ*BaKP?w)iLACyQKRwF`9ays`<&R=(SAU@M5 zO1UOsJ~qGAx!v2VqnC(*L*iK~O>{Z+uS~G1_bR^%4+z7{1&4 z13d;s@Lh$k_?T~xDQP)6>VwPh$s4PILLP#chcHdaGwt5b-c+fFDt%wzHrz<19&W0= zv@`85ZcUzA!c#2sjIwnSAC*IjNzQW2D~Xm*ng%icVN{}(Z%&WOGU*jW)M7+L%xEle zLnlF6o;ji&&YXY>FuXh0+XCqaH%?&65-pkHkOie;YAC`i2~aN*98p4eG|5LFETXih zmK0N#iR>s)75qYj!V<tARagoJN7rw?OTp3`%_(c-ux{)SNFbmJ zfB|fBiO~#Ga@Q|l*|lJFtyvZFLIZ*xksQfr(Ipg{7RYX{UPDg7?y}Hs=T2;pUtO#% z;6V~+2UzFr2Xh;OZK27k1ZNSO=a@Ll;1~lOpnbw(wTsziy$nywdh0mK5w3fWcc8QD z$qC0G!yN{5pMq`S$?61WQJUu*z~ox;5JDzdu2dZ7(srH;++SEF{8F4@COPBVNBD3p z{+`684d(d*+f0Y`8_q=X#1ABd>BKKZY0gq)meYQvnq153^n}0&g9Ktt6h_*DL}#cz z@A{kK`a#UQNZ#kF<1c#osotZ@-?f~F7cmQ&$bc*VEpiuaLf1`hC-TWpK!)? zr%Q~(H?~X}}WPA$hW#(hn1Pqx<=I;XMV3$Hd0nLo~iqDAWL+_m}>R=6py|r-*@0Os(E_b zGgFbhM^fqUB<0!J+))h58T}bV`Wo=(toI@v}=hf(a!iOtchCI4wj~&mAaW$b!Z3X=btJ!%}I#ccY z_~UF}pZz5|drUt1t?p$ZE^x!WY3tdtS8AAsg) z$KhQlea@uvq8%@uF#E#0TuYU`41+@EuneM)bdK|plAbX7Z_?|Pkgi+o<0#10c;*T} zebv3EI&Kzo+lWw(jZ2mwu)DSL*7C+@V&9BdO9t^;>bAN1$TuLQVN0dzfOaL>|)Z|B)&6H_ntJ+_KSgrk5y`lA*--TMa5|Y{{ zrpB*D<<{}7_@b*-#b0gavu>twv&(YcLFF~KGy}_(=BHNG#R1c-V_`_ewh}oGRK-0A zl*_eEOi#F)ms(X5L;-^`$Wc9B>4dulXzVv9H)7+oEHE;7$>#iBzq8|y79*mH;Wm4+ zV@OSTS;Xkrd+-Kh2jHFc5r+xO6M4v^9tQJ=Tl+ZvP+!t}03*7IH8WA_NIQB9LhQdl zBfgZ52qlOU%6*(bLqx!T4-9!s4#Xrqnts<2P8emdfuGYuuSJ-z`r{{tCv^K`M7~Mv zx+fAt6*+B-lJlN3;|;(nQ%6N><8lAS4|{L*-EjTJ-XsC(|jJ7v#-BxuXggt#p)q=e z1!=KeGVbwNF8;Vfe#BG@AC+Rfk#;5 z(=Sw_AS>0f`r=%pR?U`cwE#PRI)SnG;0Y^?2rY}~cDWzFG%Mzdm%YJcE9I5Vr;nOM zd}8!#mv}#?m)V@Px)1!^ff7c{rdhAJ2rc9-nlMsuqB<;Po;VTI-d=q?07Lt9K8Wwv zH|G1^`vz3aQthJUbog?-+=?kcSU`d zv0~f+B0#;Dvw=CgMu(>%>2lF5dRQW5SW|K_p_%tP+vnVky|$UREM;qbJlGS&?O@jh z*dpM~_}PgsT0@CM=h&tvCwIoYcltX+lt)Q(z|K7B3wPZ=KQf{_`|Cj;Q5$H;e+xD1 z`%|kvMm%UrojI`AnbIVQsb6J0W&f6AXF9LjzSFeHApNOTv$^x=$;hJfZAw)M^{Cim3x#)(z6IiIuXw#?T=2VS+y?ivOd}a1w72bWX3S3bcldwTT`_HkGqGl zBU~$EpU30rw$@C~q+65BEsvpOic@9*H83(Bvj-X_&j=4N8KU|?&@c_H$L0Ebj`?rK z#+gI-ZDxjp+pLB$4>b;d5H#kEbUS8}S&Jciz!Jft2*2p)l=9KFy^s?aKo21T5Q6hR z1;f<@P+(|7ve|3qPLMa48FwL?*yETd3A0AW9n3Xhkn6FQR_9(Uj(Nf%x$BO3j-%GJ zf;od1zY|9QsM`Xyl#NXRJ)6BoJo}4NG^>IJOPcT?HTrF{_XO35jT zm{ZBdDA?lcMh;A##sD16<%iALE}L>7szU5<*mfLh;y}#)IJe}&ex2^`HZFYZek9| z>H3&@D5dpY&noJdyEMAcRucw;8CMZEFRGN&3K)|ji!PbSbeGD82;&+=M%|nWo&td; zl_#0asC1{n5f7sCCxdM;xLOQnq!PM<-6-79LeEvuu@MO}8#*f_Oia_(JWvu88Wmm6 z72vnJE^%FlEvw0>gN$p5SBZn9bES9^x?K{GLo^02_Y@?iW=kaK;j|fLF5*)uHBwt%Q&@DmDvH z)o#n&JZd%MSkgWz*k*vA^t+GJh$VsZu%QtO(}a{=;lk>YhM-){Ig^@dGA4EZ_scJj zdb)MCL6I{p`a{ch>Mw05LxFQNsn1{tU%()Kp|d!apu7?@L#Z}blh$Ge_(yj6EUTodiK+(hLs#>L5sPc~S z+rC2{r2EPZHDM9$IEy&bbja(-4Fqw!%tWSRJrW=}SE0Wb=1_1?8jw<%=T@T_#$Duu zVd10rVyYR7%!K2ZGYvORo(kS1{`Ax;HDHPDW!(C3n7u~K(AZM3EZsJIuYe%;I{<3$ z3+euSLv2t(JMJ~^5#1qSJSbMRPqWeio0{kh$RHs$AW+N9`0r1wg%IJEyal@|fM3cZ zJwyjWr;1QG%(ya(4{t9S!VA`p#lUu0b{_BU&LJM$I8rj4{KG!GqpR}SwD*_WQO|j$ ztv(z%x$fUPS)q+vv|H!SqOk5VyRbbS;2(Fgb3u5b0paSQ%|5#0i!$>oKZ|wT;PPSD zm8DKY=MlH7zV{2>XBGP2?tZHTMjHNm8dz{Z9BE7UWh|G5ID=a~e4G_OIOki9dTAd= zPmIQ+Mw`s_;q+5xgFQ>tb>M8xv)k1gEyl}?!Fm^V7Vl>6qBngUonDIU?EFj&8YO#& z?2PsN6TaTs?jtbZXbK!SrwNNTryVu+v3!XfNSwXT`T6pOAkyVox1j-N1_?3Gd@RGcbSkS9M zLgn;3dFj15dMV}R`4deGZC9$XUyaArmQL)`2;fU4o3A?Eblur1fkgzLmr8+g_Nv8$YNwJl<5 zfFr4gk5WXJKz6r-NXcuG>-yLWVDZ5~2vomBiH~N#T)-R9mybz;%co4^vUu+3zU~^h zI4=u3s^1p069~g$1!mARO*>$Oz@GS~X~nZCz;iM!PER265ttKkA-uKkW^9N9xj#9vUj<6j zi7OAB1ToKl@j#MARVl!dPzYY0WKOmd^On0@o^Ygj$@J(XJ)dr^XYETt%@Yp3=^W30ens9JDf{0Lc8>~*De+s`mdzX_^n4E`Y=*+uGh*F=>UhhH#sSDw!g=nOI$H$FYg zYEfv^@%Hz#MK{^*XO+v{YpFFDmG&RfG)?|%bQ_~2j{3MW4wSOnMUT7p3GG~?Jx0Z9 zk=Gi!Q;6{t^vhrMd*JsRkAZ8MBgKs4E}7j1BOVzDF0Z%c}S&+8Ei? zzfSPg+5%j+)@-u&;C4D&`m24EU@oGpRINV7!k2Y~UhCy^R8$9|6OVn20;P=CH3$3r zdgYDu-KYF?-IvUageM=_=NNP@s5pMf<57eZ{a^*9q2ekkthuh}>DSzx1^g~yU-s@j zunpEDBd3zMgqxo2mrbZBxzf#v1H;u^hdd`*(%0(dug06Cyg-$Ct=+0`Lpaa#^<_)6 zr2J$mdVcam0K{-^(zv)Uw6AsJdaA_BKT|8)u33k3nSC!jY7Ja=6Cdd|ZPHruxRR&{ z=g)eu==`v3uzR*?sd#7I7%1AT{@W9W+LrBMNrX7Vg5y07JrMQ-8oBks8J3N1Nt-=}Yc(X@S7p#x zBH8H7BBZe^F~c;IA}p}Gk~N=JlMZFblp~*cz+~ql_u92ugK0CIRAX>sQaIDAljDj^ zw+dP(O&Y-YhKwmj^lvtqX&E_BoACR~xRseSOpaObP;aj+Nj))CrP5SHZ;mlyAc7@esNgR#W8-X9zBXrTOgc5*b<_W_RSh$dI z28^MgeOF{Z0Nu6h|)`l%PMno8M0 z)hCTBw=NHXE2|)$m>WM%>aIN!kHOYu%ZEZk&PlpPA|XffF2B#|?T1a1{?JU?!)!NQ8)lvTA-~G`CW)Bk6G?_C^weWgESRNB3(~BI+f$6_2Gt8*&?2;Ljioq-6eADEeufxO$i0P02-Wx&HwFY&FKFrHSE`R^G(-TD^Frn5~5s;2>Lu zixnEjBim%`I@zVt%E}#r;_EMDda}JoGC{?C?bN;@cw#J3tI{GCbQd%^^ZKY_n@+=% zis2sIyo0wObTZDs(2mgL=)YVh|71dt5mli$!-I0Wnw4NDq*xu@l zlYZiw(cc+k7@=$GUUam!nuE-7C(`_PO`8Snyfgb0?ZI(17bWi0$|tLGts>*xrU!7L zBx;pp{PQKRymxF()jode|6ixM?0u|s8hpp1oO-RYY+HZ;&JfpmL z)YgUZ#DMymrK+&yqV9L!jVmu<b~I&u%}z=!p#Rgw~M6Vm){TI6avBC~%F#)xNWx>wxW9y)hbL!r2o3j}p; z%BFO-Z(6mfJ4t8^{t|@{zaszbsr>wBvY!LvVjHJz6Bqp_KwKf}r{D`5N1Wv!YC0_c z#F8@q7h*|S{&OrTEAxL~NwsY4|JHQ=M)UQ@(^2M)8d5FyG#8Z$&0X$%#A zpn7Yk!ro*hbv;y>wS2K=x4t~}afi>bA(=okO-apDKz|fW5X|B!<#}n@=#!w8HM^=# z{N%IhqbW4FsVu`(lXe)w{I^{QR1AuS@!1tLxg#u_1N)k_d6tp#tP zxkN3zSU&p*v20*GDu(RO5)HhinNBgNuy%A*)-qF&2urgjo^l#uF=%FjmIx)rx|z&F zf);KZ?z*N3b3EI(v8B15NQ;3bwW6}JmRLeWnj09Wou%-)cv>qGjV*7Pr$h~$xM+6h zxh|9&p*^*D#uo*l+BgNhfD$sLB^F9l2okiY{28WT&_K8v4U3nA_u6HS?$Ejar#HgJr ztX~@4f89KXSS`#+c?hWpFw>g8bSpa2ew{?4B5`6-C2K6n{rxsAIm?)0E#xT6ONUYx z*vo1!6=tO@+#X$QB9D_y1kw~|Yax=AgiNY==t+dR;;fQo7Nh|#=%N&{O)UVWL=Fu~ zPUy*BWF;)Vt-8PiF$1k+to3!9wMlG8xEm6BGn#F9GZK#M;Sn#clFI5bex z0K8>q6fJOTaexVBlXLV;#&iUzly)&*Xrvm~UNVUbT3P}E6WApKUU+JPR=9N_(i<_D zN}%L?!o4~|4RM>>DS*vuSxgxVmon#TDN>{rR=-#ln+BL%k*N5YvypgC%;c43$|TMa zhefSkyHJ$ZJVXqDE*s140@8>BaS^|zZk;bV{LuN`REf<@Iw)4)jV{_~3vhAIg>a>z zD?VJAskIeo&EtzKt7Ul4~q_dq2MQ219&7`kDZa4e7>df1?|H%}1zyQJ5`~yFdhlILt|J zQ8%K=TYQ6Z)}R`;jqprC8y$m+Pxs}@t9BAx2_<-T>nzJJy$4RZUs!4{T{vmBq^|05 zAydL@CVGY8anaFRq{>w@-p@(t%=1oPYjj>Pncn;tJ*1ddN+= zt}V!58YTl4&2Hc+umm;TBnB*3?Euoo{4Zd~S<{yhlUTmXD4u81veBAAa@cFMfFuzt zE?CK`DOkidW71|aAYH)MDD)($ZUl$UlApHHl>Hkc$gA5&%-HNnE8)Yu(eix6Dy+CY0#4xC{eklk zdaFuyFL4}=9A{%B8PhYvnYTX>4k8#BT7sOrqb&t4jG$Q-)?C?vVCZ1biF~~y?8#e~ zJ!sQ*s5wi00cnNKGvqqz8Xvm5;<5n&Dw=&Qb>yiwp1N{?EswFnOIr^8qm}5zij2Vc z7**`ca|gd3eljg6$x+ru6Ttd~I9TCy`Mrm>|9%i2MNXenrtoA)Ifq!bHQK9f$R|Wc zlTKEUW(*7o!{^&c?QZaa0SA!xGw|pJwF{=T=GUP508Djey{2#ov4wgDn;I7Bg^4c@ zf}S5-6NXY>wn34C*K-L(0JoJ%fgoZ#dIzBVLut)S5w<8I8#CTOxV{}ZzrJs#&eo^1 zlRI~wPZ!o!U)9_RW0ZI#?!X^P8zerfA2U3`r=!Yuq3a1JLI$#Z|E1@G4ndW7CGKfu z9&_({wq$I;RJXQJDhp+MHygyfBT1f>L6L2rlahDD?>WAo^gvBS;fpD5xGnvKum0Uo zAIq1FJSL@G&Kc#7ZB|$m&fEG;8;9bxI=yyeLPB)FU&gDon@bPRU_>ma!mT+F(;0h- zv?m@j%;DdMo3IdD{T$bVdNU8}Ag!4xv^1IQPnGoYg}`A4VeFu2#duN47UQi!nYiUz@AAAHS#(A@kDCgMO+F<4VFmiu1_*JSXajW1Yn+M&yKdu!yJzsKE9GGWrNuauPY?14({Q{%W_S*BpTcgB2BTxm*^ z8R~3JXnpn6g4!qbmDeL41*4dNY_51CdL$wyfDb^$(`es+>B>`udQ|Na`uW3GeJXaH zN_i5_K$s2N9%ZD{^9n{9$uPrj*~5W z;h!d0nL~SD5sX8vWqS)q-zmuDdk=v5($5^xS{HtZJye;$4TW~pv_+Zhs*UVV`!L1& z6Md`^;q%4XbtxhB=O3#0BaTI5!hg{FbJqz>5&lIiIYP5R$U zoAk97X?SeTlm3(HnE_d+7xT-{nja8sC{s|oSY`U|YF4!Ga0?9Dl#+SLqL1nH^bvzT znUuGT!DWkMs`vtI3cuY7XC7N!_Sm?qbkkL$E3LoI6A8-HX&pZS_NNVq(q0q#?jK=gbaU9O-+e{4^iCFEf|#czytyqBUuW zh|g$ljTkb5kuxRZR>4DK`Fi42v90pGEG(z+5a5DEfaY4=c-zEy{m$;7zIviA)twZydV7t~;xRGMSlu`W!M6j^EUNg7?CI$%Xn{B=ck zKR=kXlQbRXjOTzLicj+lnkc3eV~O9alXKWl-~t}Gk<>zXC5XmL^Q!tiz$eIl^ob=A zGc#d22r*M=1PVeT|6K_PxQYz8X;HxF-cM5Z2i)*P(hw@r72H0P^fb7-z6f?M zcmm{9#VJcpoofFa1oYpzQTkB&o#ici#^ae=4Ls|IA5y-C+2W237O>cUMn*a3t=$Fh zNqW&;jtbmaifPl{AI;u;4A?Tjz?keok&kA8xJP`Jczz1}d1O{rM9lNdaARorVPdyZ zyu@b+k^CO6uH;cfYa*mE6SmR`n?Oz-siu-Z zkJeO01?fbM$fq@9HWEOP24NV`NsEMGNH0ho)H#+sW3V1DTrTM^{kONlJ#GvlT{8kJ zass+*8mtzFfiQ{$u$tsq+7SdngIJ#{KsOPt6a^$D;8W&}E&CHJMLcU#+F;2iouJ?` zo1mIBn9&d0m?J{;2ben-lUX8y`VXe@%p4~kmj>kw&SMUa3Hf+zCk%uvmPghM()t$~ zCu!MIy74lnF~U*9h9Yn}262J+YGJn$;A^#%$x)veA^j|;a|0-|xufzZdFld@Bu`M5Bh>n0I6ch<44Z0z&r%^!0h?n~1Py>o6`>WdXyJIwh_ERol0|9) zQKBv&0aZOfSx?Z*UxCG(#Py05D7Sy-l`9FTE3GL})@fl*3_NNX0!Xjzd-M^KplhEYO` zATVV;QeKY3B4Luzq-Gt;gGz2pJ5KQy!}>ldBN{LyAKzV&NkibOqoHIxqe(9EX$DFi zQ{&FYWR-|u{DWzjUdqyMXDO&yRXUbrEO1f5V%T6Ub-*l>mcT_sTfv}1n_MK(3X~e@ z{6AhoT1is^=OPXbqn*quA(^d|PG>cA1y3lYEggMiE2K4r)l0AywAQaQfBQ;I&j5 zFszMUf*o8{#jZBw^iK238oX_P7717^X{vt1C}J3EB`r*gIPcM@5%{*Uu@i$KvuhK; zGYr7!%3~Q!D=oYh0uWEm zuKxmHepLQF2$QRJ^dJ71W~WspgVkM-B_q*0S!ZW^5LzK<(J}#Oql?9|cNR-UqyxpI z^91ucc@)6SvuvnvH6cqwkV7+Y4S0+MA#0P~0f=T6Rs#}Yt$)NDC4wcELk6oQgQcA{ zg+vlzXj9@%2y{pm%)>R~F%Xy{OsMJlV7{dB48r0nTrvW8|E?OxOcqNgYXV6q9avgw z-58sW;$Dux&n@FA0+4XZY#Vqn^PZ)?WPS@ZhvnZzX!lVuR6`@M$d}+0o66W1kyqtw^_F z#7o(JHM~r-(Y2`>ed_Sx?l)@n6V*WeYeh26k*eQf*J|zEs#eomt7g2N`or4m_v<0i zjA7d?$;KE?*4D_H+%43DqAFB8AGhs`f$$neeK`!&ck#gS}JsEJ=mCanW8}6UN zLH?2Z(>@pzj{~9ZS@HAph@y7_vOR4RMbeFSmQHh;holeXHn zrlm%66GNrD(dQ?p0W<7YovjAZzsH3Ouv5}UQ=10E&Lf-7GYHmG6jWses0WV4IFD`q zPmdXIOkJ@i!gJ0)>`zW>lj6}{4;zkG^>r0QLpI+28w~036z5nnY`S%5m+dsA1}lis zS`AmSgK1N_Y3o@fw2B2zD2{zG2iWryYYqB5=9Xc)M$waKo+HryQR1zbbhhtCej7Or z5473BF1Bk{YrCQBmA;*MwC7K}%-gGd=}&0Jb3TBE9F}~7xIbEIHVweX@UR;!+AP{x zIBl$fqs*JvUI=vpv1|8POYTp+5CbnDMQ@JhTUb<=Zhr8P4W`*!S65cuwq(9$3w6M| zHo^*aiaXo;IwZy`9FZ4iS=iQ@`J;wF+V+mbN#Y-67wV4#E}@O(Q;c*9yBT< z$b9B!oWYw+Jnl9GFceSt4@UvK3rQLA2p=RxVZ{@V2mw^onYcJ+Y zv>X>-Tz_0;iAc3QHd5KP@Yt?|Z~z@owd=(#Pu&n(w3;a!$8UR^_(W16u;s3-;OfR8 za9-O1mxc2QE%3V_wpLY5nLQh_<=fue{dQ%xyH&h`JGTr*`vwTmnS-?jATS)nw!m7R zy6VDX&yK4e9t2@5_#`K+`xh)Wvc&*~n>)uFG>l}0*uxqy# zhRBYJI8czY&+=s6Zfx`aSUHx6YYr?@-a&JX%iQL-ZB;Ga$o{Ck&m>pMVM6SQ!=Suj zQ{>RruR8E8k0LOhYw8r_iNE!3s=r+~ew)pn42u-u?&*yMMZ zXo@2P9IvCu4+y7$db3^LoBoA_5NQE0Gr#B5we|;eo!JFv#E~aOiBS00d^9^fy`G!E zP-nA5)!HI{PCfjK3U-~^!qvp_fz76ig!EaKoLPl6gMs2;M7}P)x(C}@o+{*p0}VH? z@4Zx#B@j)OtNHkmM={DR577~ivx>eqnXcH4dC7ftd!<~CaOGg(s@6SK86XuDVel08p5Ohmu zRq@?&o}!t1v^-Av3t-9XKjylsoYc2`^ak5DE1h?4ZFX^~;jQ<2`?*F0znsnH*$ht4 z?;3IPVKAyY>HKiQ?67ooVZ;Zc-RtQ7j?vHsJiYuv`JN|D@MGWD&T+d1xY9*iW7-7T zt3_)9cKeK8YYYRL{a|2MMtUGY_^dAe-N$@)USPX{A?3r)XyAazp>4NPHD*_RF@cj_ z-hFcAg><>gz|K zuip-4_zuk)$r)@5);^O*t6Ws$&`A)(X zf62Bjan%VPjKsc#1pj8W;(FbUJ-%3oP@mN9SB#lUkF2E zH47_uEE^82)Zw;ukh8eaQCxJvyby5Xd}BsjJan6LJQdt+eIR^^+ReRbcZydwpl>x4 z2UUlvaQBTqmD;DS0i>v)Wmv3OXIXrg`3|&bBczREW@J4`0BP;EQElGF?m_NUEz~j< zHPRXn!SeZKg4%y|iZ*F&zFPEyCw}S+trp1d3t_@95jTw^ z3k}7k$ES1s(n{%D*@?d3R`Ro(^3B20bRZ?&X@Khi8zkW60EkQWbB}jX`{8=o3|cB?4eou?soC`6eLB4szVobE^C3TuZmjo{ z^m(a}vd~}V@1v`no!w7>C+Al?U&f1JsM#~I`OKO>vNS0cTrvNQw(NrpyjL10Nt9;~ zK93LlWDfe|_d<0U|4)T&UVg9Fvb0X>`Q`ZwdE}(slCR$?@yxTPf^PZQ&lSJU-J(DJ zVR-)!K)k5n(*K+FVELyexqmNZ{8uTv{HMC*7#TVK)nfb`-YWlhw!n9u{+@hQ0rx< z5*AtL?2dwp3MH$wKvzXr)5IM9jXo+=6xdEhW(p?Ay|Y~E)?(v#8uA($!4-fx4Q#%; zEXrPLOI0*!{k0&+&ehfmi!wy^N63ABij5hpNGb>;4xsH=2{vHeP=zM&SLEei4Ca|o zGz$TyDfVNlZ-Pch(wl$TNYi`h9U!9MygpR%GkoZdBT>5C8@uK?{%_V z&pc}q2pkNd-YSMv`Bb`E^{E{<=zi?Wio#rh3XidEybC=JxjF2aChVbR-z}{OilR=S z7n3Sg2~~q|wQ^}hKixA#i{8jRJ% z;J1mg2046kC?e@ewLV-b6?yiuU@Y37YOpr4GcAq1gBkn=aKU$ctB2?$g84b$G!8cp4s<{5{OrG- z#f7PyJ1SV|4X~_xArY6(<;WOsLK2P|_@t9qE?-$##DCo$Hh&3e1Cm6k486i-1J9#z zw!qMQC&uvmS>*0~T$B81hKEcPFYb>tze!4AtS5yH>W;E;Ljwbv)Sk7D#(TABAiHscj<3fAY1Y!$z~jzv1%6sMBdF3Ag6MN&=?eE%J5AlE1){4)~Oo}c|c2B{oj~-2PVPV zZCf*K+p4r}+qP}nwr$(CDp_fpm9|mo%+9@U^f}+{`}K)^;`WZ)KVZd*SS#Xr$2;ek zV_w8?V(ic5;t&~Xty+3`!$z_>TH5BTnovpjV@nz4^^Hj3524Sk{M$Pi zYTN>6PRm?~Mr24SkLh3?4SQ>*05)~Oyl(zT<)Phg5Rj~&q4}H=E_Djeh#N-%j{Fu^zaU6> z+JwMo^c(t~=Ea$vgSnp?vjKM?1N;TZ;5**A^N2gpE65~{N-~fV_{)Q?B_PHCXM*Js z2oNje{9lA=N%ACQi4PI7m99bbAW{i}i&;Vuxy9rXXz^JI0Ss}0?j>l+5ynaEkQDuy z2cDQGcQcq-`($J&zT;*Usw&DdHFBBK$_9Bxff3nbIAkdlwc?Xn9BCp@ydXhED9ZdF zN(18s0F@Nu!8Xf@i%-wX5@8@am33Y%PDC~f^T6Df71rrZ*Hw@#UV$Vd1!VyhD^CY0 zD8*5H06eUfkr*GAlq5nybSh~-f+txXlKLiKKZ0RYtw_cz0>k|i3*(jeUzPhurIciA%juGo7V}}I8 zxIHQ}3UH*A=F^U|LyXPGgd#TkD!d7Zheq}i1Xwa7McNVtFPfc7fFfIqE0PxAkv<~I z`-t)+5zCM69?Ks^jL?kJe}qLcHXjHpq46uB$=?wXK4v^vjB~35dz_JE)&peLdy`TW zPwpPgJ|fe#p1d}sQFh*}tvG|uI)f%>i;Me^`efGT4d~VyGtR68gU$vYGD!f1;P}e& z-g6J*bu(Z%QYu1D-K$&sH^&N77LcH5P#vNWlu#CNyo1W9OY{REW2FQ;Oa8}a#RMIh zogwIg`G__wULH3dB1Qxx5g{z|mj(be5TAcwT6Kf<34rl=R8AxmNUN0ME0M>1rARkF zDMO)aQKc**i+~`ffZ_l(=EO+1dbNlx6Rb&$FR074bo3a~uB7!5pBydC^N$GiO;mpi z70&Ga=Pw{Y){*VsgogF$Mqqh>)Oa}jAHU4CH6J%KE$ukavZKS2At$NOdX^!EkTyVpuozTMH? zx?eUwmJt&oh~F*u^@@WbyP&Az#hTkirClowdzy`&i;B-+uNSKd^X2zmHK?}lJ#GW7CP zR41*L>z|_mQ#hB%5e_ZD-mQoP?npVc5}I*Uk&)VoMpLeW6{F`E4)(9o3-!5FnBIEp z<@2LfE+2Qo&08dH!P53BdE#c*0(*xuP7gic9HW+IN$6s(4K$mEQ_~LsQ16rwiKze zsW6#<=h(mGRtHUY$2b~V9#v87sva|24!f&)Q!YAB)vR^4QSRwvO>CoHMjFHXm!V6g zIUYc>QvC+(bHaLQ(ePs>0E)~>i!>Y0N^Ldm`yn{8A&_(0>*~51L6MSWT{=v&457!? z8f~;}B9~b-e9Me>$n3l8EtgokvQVkW8OY1Vd#$hWOcQrPVy8q;b+G*SSgGbCuJn;)bK(Fhc$pE4CjU_^$33I?H!A)nFTSQbrQz0LVO`UX>_^T`5 zObNUZ%anTN_8Y1k$&VOdG&^XV!)TwCtE)gaSkEnWQ*szHu4B-^KdMjz_{`d>D(O~K zR`_rXbBEiF)?^1MiY(1+I&9WI%TZvAV#|PvtTk#108EXi(!wHy4Gz{4+&}NU|Lm`2 ztt~y7r8S|W)0G|Dnc3<7?0){-d$+WnAHI`?5MO^#);~+v}`3m zUMe(}@j0mFXOOpwDAe*f6-|US*tr3g0tB(|HMINutczXy=+KqT z$cCdaMO;k*JW^@{JcaGH z116ePur7{d&9AEcs`9-v0tK1gp^$;u2K-rwTBr?P+P<0zdxRJ#-yzT8$zaxxFL<)V>@u9`G0(5YP1HEvvGYwJU}>%w_4P zly+~mzns^m^&peyf+2-lYuNF%ZnyvC?$Yq#=;8pnfPH7%gTN0QC>$!4Twn3ixB7%*KDik>KlU%c8j~MWB@-_IcIEQtUd25>kH1&PR-~}vnrU#kX8MI-amFENc(Hl@O{+z};)cp~$G6?(_RM)7J z;i7@hwm-}evcJ<9q(z6re*1(fiUG{FQ%GNWWeEv;0ZZsQzlqitEs$w+1;NlQ#Qxo9wYeFj1xF% z!l~I)h#iUY)WhshJbViVF2`QDUAZd+TkLLrhJlj>MkHxB->lemIbpPtK*I&$_-YY7 z_fm6=;++sX26-Q4xiq--1IEy^$u_w99Z0Xuo*;#b?w(Jq_j)1c{22WvkIlQb>48(| zVEFLi{gQ7+cUm{+gS(#V9z#y=iNe#*;brjr>CF<3L(KZlo;j)J?Wzjb!nmr)Em<>W z(A4wx?ESH;LSzJ1)BdDIEVp7s`nq#Z)CSdWK#%=%O*g0TT`uVhXw79E^Kb5Be;F|P zkFbS*-g^EIR?V3I$3EtNX^98RUnUFw-@_Id7#RPWG4)+Fv)dE>$I2syJR+nL?7H7I zlquq|+8ltpeZ@6`#xM1dz4y>&(zO=JUygh&O;*^^UTWWlBdj8jxRvkw8I#?F+37%n z@vKb_IU0NKqEqqHyqN@PqvhF+h~f@ztzU9EjL_*HSulK&KVw%JXKSdSNuwy)CBkb? zh4Lb7{(+YMl}Oz#h80YbOnlmX%;AF~na>*{xuzr2VyzoLu^3dMUdG3oqCrzIdwyI5b?2@*{P7$5%R@bKNWHCJP(v#$bm5##p8BP^B^`HsG%p zAf%%|iZ^i7HFL5fG#FqC%eko9g5$XuM0AFcwXwUge3y20OC|6~H~d#bkVv0EgaxQb zxi(Z=S$nlYqSYW(bwe?EGhxBX?49M=0~`AAgsM3PhkHD9F)TJ6Ug4rN5)A zwpTj|{tOsTPiWTDq6iuEsC1j6PLU?3QsW?K7rQUbK}E1M@62$EzxRRr<^*|DwkB92 zbVixJMWN8E#$`GFuJnuc`xv~O&bAW3h?F$$0)1}5i=(1Jm-ztYW!n-EW`Sf3ulpe5{*kbdwdo9gRsYt7!MFJ9x1A_9 zKon{xhOq604KD+L+#M5{fo4Z8>5d5EK^4HV28P$#k7Q141x<1;`x6^^nn4H;hZPGH zTD+`g?U=2rLle8`ATxRdV1F|q4P?+8R1h<^B^uWo+DRg_o}odk17$+}^rP*)Bzm#T z={zSblQx+49uIKrUURKtb`2XZc#H8@>vQf>c59n+1nDLh{3Wc3xEA~D(pHCA9lfo& zM-pG;-n37!Lqjy5{}r?>e;FY9577P-UjH7@{!QWQzlGJmm{|V{ta7k1{3W_?N`1p| zK^);b!)9_rP{mdChlTSlO+3h|VbTu9Dows}5OXVNt1(@Y-ROdDDynd8 zEZ0AcEkZYseGg#xU2SN~TvTcnw_AA7yk5OB90MSP0~hIBpV2$;#g}3NrjdaiI6>Fb zlCJ3MbOLJdi*bw9=V?6brZ}^Clj{8zN2_v|}I>||H_G4O_ zY4L)wh5ZYkyxsf6h7D}rOv`RQt>!KeX%{W}N?48tYmR<#!=tTbcC|SEuD+-~Fj$x` z-?}cueSD(&dLuPcH-}Hhu5mwL!0Pz0#Cr3z`Bwf{HbNwif^>E^N-ABihGBm^?Rco5v!Zvf{t*@0!27ItS*y-S}sT zC=0{4svx#*Dm25`WXdhL{sBozdwyYGDyxiHsy;!aEKERnQ9b!ce_LZIq^0 zaoZ;0MBxKt9kdPVl(Pi&x-<=k@yH3Kn6)C*W17i^Bvu-UU31ziWwCbo3XY1&^{drq3~-!tAR6czvGp#1zZ%Vl zwMG@U^S7l9#;iOOEETL%DTrf~?XeRrsIa#w^K%Pm-xxb<3xmMR%<6SV#)wo2y>Nhc zUptoqCMd2gC2Ub^I)l$Kj}%k#_K* z+=(p(a#_}UmDhdUjlZs5@$ulLlqq0k-O>o5wYl|P&E@oPM`qw>_V?QsFbMa|=-}k? z@bR~(XjXl2kXveOJ8E1)*xs0G^SECEf@cu+{l; zO=n7aBbcS{VKHM}nYvL_V6}XxCOE4az2O>?=o+_~_I-?*4#ULk_Q!5t){H%W28UTb zu<%bs1COZZrSqlR;px{2sK=KjM@+WHI|W8aM>Zxeb&e`2=huMid^CLmC=KjXd_lt7 zB_wKSRR2;meq&F;oD-XNMsKB!lMdTZ>C@3K+*&2lAsf0CLcRQLzo$Fk(Iw~QY=c2t zRJ$spmx!KLyk4CkCPJyPQjSeb9OUE!3|mAiqFdA0=^y}G;vcDH`hpH5szLp9Vk28# zTAp*H>KBD-seQS$qn{3+0lDPd{@RFf)pDj!oI-nV!5oa_!MTj&BO4STx7?+RHEC%N|C?MLoG4Ywe&10f9ztLo0>axIxfiMlWfDTWlUSr!v@Lsgeen@Rfl+7LvtD@h_&`!D<-UY zgSGyt4}!_35v$ZziBq*Qoi}(_rGe%4o{3h%04ghnw5RGZVZ0`r#Qckpuskf_;XX!t zc}-C=Iu&E{?ivvR$SoLL9tHrx=e7O&&W=ds5P&WOT1OOxi>R-&$NMQMD9-{O1d83oqYkWvxxdoyykF0X~Q zd9GQ%%*@2Lcn(ra-gd4BcpugQVVpA1Sv;U@T4)B0A8v5eBe`OFJwJE!4ClUD9`Px)t{nbGru=30<3DA} zKg7VlN2dHsOMm`b!sRbEkpDusFf#vDxNNCyIA)6?d~f3Jq@-&c$75j9{vBPCQkYyk ziqxT8jS`Y-(7)RVw%mBf^11i`FfpLpJgQo$NRc85Bb|4}>r?9WAmMRLNqN#Ln+|H5 zFRgvpb0?t?F)o9PhXTg8`xFPIva9%VQw9Y{dnm_{R4P`6B3-CxFBCHV6s%B+%^!f> z$I&mwrUF-cM-*OWPc`qJY1VJ3c{oh3OsA)>?vh;PjGG!B&qr>xg>C0%0bmCgKS8Fd5mD z%~-#FD=ID0UaSTCEUYT_Ic171sW)MD;*K|2v{Qxip#%J&V;CFiT!e~^e02JuSW47- zUB!N1#B8nz4tE!P!m{A}FcNbzv5szI3OncEEq_2YFGxD9b5rpbFKkuuXOXs_ocbWc zg#X#rqQD;(?C*@_Xmw2^Pqc#bqnUF`{tR#^ zY7bVFu411dKsam;zZQX1_ykaav*4zBmmD1-dlyhYI9-OV-ik+m&S?6>#7lq}oZy?E zP8T~r6AKBa7l$u(^|kfmWfxOL%^vKjQZbdPCz1G}ar-Og~j#Ldg~m>#R6dg2+$V%J_G z=7%qX>3$P-U$8$SgmwdWtNW9t*A~96Nq2PLT^?U;9i-qMUIig<{uGCri`&irhfVx) zVjZP0`xvtk<2mIgt&dC814mOth07VNFoqe#wHaWtN`RUrwQUC<_)_YVa)e`6S)uB! zD|z_)jG;_wVnYTWnZo(8o@I^=VnXP)3if{6qUUxxt3kKy?#T_p_BMJ0#IA7gCs75M z_6j8IsO$$_e7Lo$2nbwU==#RtH2qDgUe{ZJ0aPlM@P|hm+jhx)mm5RJoh)hDG#xta zCayha@`9~BZXJvaGDe%8(jlL)RfpcI-kx*9)yi6vlNo8ja_^=b&PoD^{@&v3QbUDO zjQl=FM^*ADVLQ)L{f!xgYeOk&+U@T`UXQhf;>nLwy+W)h@L@>779a2IZFaM?B&rpM z8Nc2;+nKL)0w(DdF(e@wo!rdZA^9Lg$q^igwHzXD)Chw8_=bDtK700Qf9we~$gnp- z^COiefA+q;VFT)ea>Pb58zvtfTBu)XGH^xZUHk`R5^V7JMAnw`QG9u1x6KLBI0KG5 zE=foux_=-RL^KXhj}~#z!@cdOfjzWdC*U+^aEBhS>~vXF16IjZeA)oWYM+XnTmtJ< zr_5alzRK84EWUJK!2SAds{aP>fAN_8C*J=LFF5~i;r%cEk^chk3~X%w)4lXR0+Hr@ z+F8eKx_#T6@df)WI1m#9H+;?IQjO{iynd0k3K8X8{lg`vk%cZK*jXGwOAtJ=o#A16 zw3ZQKb(m9EuHQ*IhjU{ze4i3G-cpF9(k9cc!u$-J=ciTZZmetmr){K(&A~}KX25UK%#6^Vl-R7Gs;YREe(%?{@QT*k6 zqCgYMMrol`pOT^e;?7xw7z}dtX9xWUyauE#KrJT78m9<=sg!ie{Vz-%;A6It1`s|| zsb;E|j+@I0T+YF*PMXWquUX;i(7VYDw3osf^VB!{ zLcS#RETqfvs>2%U0{EtsV$DrrP~b(kVV{l9V`&np*Oqjaje;#;)Z(X|?rG+qw89&} z%K(+FVsNSp3g?QI$?dW{)}J%U=SpgozWd;^QEU8$00{|Z&126;ZN2oJR^urS|1C9)I4OV);Zvuzq zWfU?)p}|z()TA*IgiP9pmek7S(dDQh^EOee^PHNsk=SX3+9fsUA&&);rGc~&nJWcA z#mF3cU835X|9nVIBIPo;v)u$f}phKrqK zbR{DMZ8+QWy%xj07yK-zQt&MV@e?kG*+%{z2C~0({1+N^6;`M=LuvpHGjf>x;98(a zG@ZJ1@gSr0-ie~YV^~#R;C)nr8Xq#@JZbek&YJqjlKq=Kd8cUh$M+{5#`nQ;(DP)M_Weu=BjG+iqUx;lJp-@pVj`v|y>37m)$__^_fXHobR6~w}2 zEHix3&w2{Lt}6VIRfHlauRuu)sbQ<@eV(1!$q}8~i zor$pCYuHz#p9MX_aCm*0C@N0A4G&eW(c|GjSY{+jI11DiG zT&Y6-WTaLei_fPkm&p;KA(K0pK(JNa&n?YJ${IK#Qp@}rThXsDW=|dBj_zY|GOqcU3NACS2NKoZj%Ht~z z3NUgnhc4vw^cuywP*FV?3e~evVXE0b&^DkJxm&wBMXz>&JKQ_{-sPZ7LjJ`h^Q-fj zpxeg@QOhitGbf~UJ25D^!~#+2THP`=Il}~@#|q4X{CI{ne4H~hw1v7ZrDqm*!BTWNs40*+bu2N)EZFUI6HfodUB{^DY|L8LK}pcC21_`Bb) zl^qX@^ypR59Ib%1lsu^40cQnF7c0HY#C;7Fc%gTT6=;w}Irgo04%NJ^yh5McCO(ugKyM$*uu<~DO=Z!Ebpfj=RfeoG{>TY}lj}`^v5Ak5jkTro`=$`dd0*St3 zYqylQ83>Od1(x5~8sQ;W5O<2;P=*-$GUZH*-g|&U@Aa!&_ci!uhT1Klk59WcfMWs=*l~2jaZR3-NZdv~QjA3}=?*^1ayzQU1 zBtwcsn0Z>jb@(bdNY`cHAv9Cj8uK!L&qm+VnP667x@Ktl_`?Rxu_^ydblny7y6e2q zPCJi`!j^a+fnL$=)T9=lR;PPPgfnz*o@QqHpgtp%eFxH7rT-lDnP<753V^4N<`|M$ zN|gitAeEWCA*(g;x_cgETqUoOiVm{g-8XYTHGTKKUOts#8y&R=+u^4-VRe!%A^O@lOgV>BV)5)<5pkqXH0 zZ@<_|)u)@7M-+Dm65++$hLMMUfMYDd7|#6w!x&z8{!^C~297ZrTfaZxd}A<=`FaV* zIHth*@T!e3mb(Y4Tswz-7yH|YMmMmo#?Xk`C8qDKEW(arj=wauBBIsP9ydV>|= z+t}=Y-$r00+(We%*4eaBBEGq(+6g#JK#pco6;C2om}olqIpKR2>)Alk0eM2hkNhK6 zBB}d0*DKa-Jm+p%Nts?J$sEqTfbljtZan9oGTL39**)&JpF%m5+W0Y_GK2%U?u()| z4@a3ka!MdNh4LhFjAbb(iZirx&W@N}%{%?n9ldT}cFn#>YUp90*-P9uy20g|ko6Yf z;w6qVE;Xk3B{PlTSx!zSP0JKx`1Tf<2C>;UxX+wfv1)h*0h1I3t~DEUa@aQ<=3{X; zt#)Qld^T$}DSlE|prT3r&I!re7;e3EjQ`G8I3%vPhLsg~B1H(@+4jEL)Q|jDC78unD0uPbuHb-qHDiDSG3DpxcZi zE{a_TsLPB3{IlHvBv!VQ{(ufOOFQsiHL{3_Ak%B>mf={aM)}H-8-WzBA|F zif+mLxbH+iH?cj~oIGGcrL=v*0X>XfK4_C|gAA6Z#Wdg)#wM}_JRo{HMYJ_F-mq*G2_u}-lA z->5nOM&TJJV6;^Sw$mcx*&%^(>o)CS=s*U5Myarbsz1jQ*I?;SEo*#+4|X9bb)o_4 zJ#rnC&1I-7Sv9z=oeBJ~M}(yPKn0RW-|PsL!0CDHe9-^}?HrvSm&m;=8~5IO`59Yk zl%45&Gj!9wPkV-C1V!P6A&O>c4C0aUsI?NVB*hzfANb?L9GJlYF{4}>T}2*iB8ymE z{8dJ04`vgsA3_5~UwPLfad;ee&dVEhEt8OUGjmrG(PU9tq!5R7iO4m_awdt^zIadO zOdXc0fal>wg3n4);pC7MM);+IT?`dmZ{MXOl;|_*ve|p$8Mvz6SY0&ouC>ojI09*x z@<35_kgt`c?|5veH~}@EC^zZM-I2Gmr+onpyDzsNUMeOo@q^b=L4t1NjGc0whooZBB z75h3S?H@=8PKjpfHd#Yk95KB(|@o~NDC-}>IGCIuj*0{NLpWxBJzHWTNJ2(s!E zL`@Z4Iz=a(4D#-97ad~w&tjs2wNJnU)=`s5%I$i>h(eCz5RxrRA2~2OHvt z{kuU4Eans+QdT^-y-^3&83mm*OlC2!@Q{Crm8 zk~(WFHjc1-*M|gZCqBNI%xGdN(mG!1E7$>}-Q|TbJT~0%cDBWpEWgoicVmAKo%zWT zJ>YeGo`+(nooUC*T3Tj@;U3J05shPdg*@F}Y!faLe zY15Ozg_kG7EIh6eJ%F*1OBxQj%54S5Ew04%_s&c8`b2Q6Hm?qM7t>a_Q;YS);c9cU zpvU|W_1boJG1?ohTwlYQ1^FeUlM-_5Nu<8!@@}=Qb(NLb0BfC=@Gfuduu@BMG_uNq zaEyT0hkC)YLVbcuIW;b;;981A>*4%8$@`1PlJzVSMvE4j>2jHhCdH2cJ(jA4q$EAt zJK?w;7iCfTWRBJoky^;??Def{1?tl`;&N=g7oS=q;Yxu{4KG^A&GFYfTd>F^{$*G! zGzraD1IQyMMtGy>9UK55Pe?UP-UW_i%w%NPBgD!33)%>mXf`=957w$&;rkb6Oi`1> zk}acDK*-=j5G5(PQcj*aT1ql74NRG-9tRGF{h{%sD{M#+AXS?Ox=m>pR73S#H>M*X zs_X_I_1>?dLYwg@;K7WMZFCEP2+C}7tGv3$OQNxan_XhbkDSpfxFaf!_w?6z4B#cM7$O6kI&o8~!t z#f%eI&eEw6)h+|;^1RzO*2QYqv;%EDRrOD=POD$DUynk3-52n*wR}(8A=h+oQmdp* zT)_JQ#J!x1^py75Z8G@F0VJpND+&Q9YGwv}@jHq1D_{dc53|X;wv^xT5RtIpJ$#&s z6Ah42ePG3YQj({kf`K8hR&%@vgz`Bw@oY;YfxG&mfjk7c1eN`wY98s_o{@|5^x&R2 zQ-g*WCA-|?MH+~yW@aXg3u}cJ5 z++x?429-!XHo&Y569F;iZIL5d4DsV|4+uR}{Nawsbq`b~R{elB`%X^c z^JuDV0Iv#>;)=`&f3g?Gl8bbYnApphHfe!r7WBr2h{TGEG$vSgBNudt3Mtn{|<6E1Bfl$d{BW7(~r_~BZqy0{PR+Q zCpLIZ9~bI(+UTwTkEx2xB^kGAB3v<;yl2kD#>MP)QTyOdUOTe0Okl8bW;9Pz`K1MB z4J?n2GC3Ioro2FoNjHh(Ux971VBxBlO~dA%yU@|_b@C1lIV8{jH$48k4(LCr_wV8H z|K}Z0)_<)7O3(P$Ir2+&oqwzZ_gSgiS%?S0m5IbpRE1H`G!}`PlEE$#nu7_ooU4WQ zQ&H4(7WtC$v!tU~D@4&qQNcVJ)CZY$aEJGp>F7rJ*!Ey{gg^@DtBn&)aAI-H<+{cV zguDlNJ!wCoc>l@~f_&ZZ_@EO&M2qG}sgiRHV6{zXb~Yz}2;GfN#JdpyRm`?Q!{ZQ2m8A7Eb`$`p~=q1V^YMF-*<6`7O2>YyFr*`{gFA7mf=46 zd*Jh~qApf3H>%P>MAt2ll18%hz)W#vMre*q4 z`jv4VQg6r^ttV4;rZP>+NJESBVHVc$CPSUJnm30EvyqL5sR)4!xXPWacU_x;jH4kS zgtqiUMW5GQ&gxRqgl$VGgYzuhp|y=%S4Ii)^97yJ|li=`9yn^}t9jAuh~p(a+jnaWi!z$7ysU zMQST*N4sM;jkw6@>R_Rk6{!)Dc5=QH%MSnv;N%%!Wy=d2NqgrT3mXfm&?dC0y#;gw zx1_pu%GuK@fxDhvib>2M4*USG2rWe=fT@iEtQo;oDTE?nvq%vo=J`718tgC3+rn;` zHdLx$BorM6AM3PzY#*deZOdB|WOTK(qBSz6^Mi?aQ^ut1wv0ttBhgAe{Fh}hM-26q z5V!{nPP^?^m7}(J$ZBnMU=y~q(_uBRPCo3}FLN+XJoiR&zc)rgL@CUF&v#C4l26QA ze&#d}nhi#ofrpf~$qjPJCtY3=M>T*R^6YRe!hNAsGue2#gu zG^s|;t>vdwCEH(^siga^mqVy0G52N_*AxO*!Y=gZc{#p)vHkq>RC7GdHf&B~@i!Fw zyGG$Z$@1@^;D5Dy@xRj_Wc}CrgDmuah2MYrRv&&8>(8Fl*281$)o)J?vy-BLYE=qg zX#qDH7ds$*ef$w`q|p;J&NgYFLT%$_@_BXa^m^Cv;#qXA_sPP*gZWXzwYY8ZnAaeBn^JW2_Qc8&r@3`=DuLI8FH5ULcoRN`jezL2M5 z^iDk3ewd7Ca^4(moZ64`y|Ve^24Up^;t?DCaV=e_DyLP*x~XAdQOm}O+K{zPfYq{W zrX~D}g;mqGXX>u6RJp^gu%lO^yCj?182(9wu_fNb6WPyb&@O3CjR%oqsc_a9Jm|A)GI3sS;WFPgLa738wV}T^IVZqK$ z9(Yh&cuKl^@j1ebLa(s@A3^Ens_*t7=y8Vu`%r__3}rL)OT*0;GM93wwN4uA;Lo}u zHW?3NIV!)oP?nZ%J;`hA+?WH8$&*D{G0@bXjAf}wA=;MIZYt+&hlj7BMe;FQH%b(> z?}4nDS$jT{d>7>kIRP;TnbyYJu>|up>_2PD{J6do8kd18*}UL?EiQapKa!tymuh#U z27(x}z^Ehd_<>qC1cCbInA06|)8h05?;rP0PT)^=jC4^dHyEB%P1`8S4~y4cua@jQ z@NUmtUy|yMZwQadnb6s&vxCU}%V1<8{7Vo=(}fa4r~|@(hsO_A@7z!xpVz$jde_Q$ zcMUzgR%3TxJ_JpVjS*n@UbqDb9Pb_6ai73@uH+C#ZdFY*ox{}vtG)!I&qxBaSR&pk zLve%&=NloK_iNz&3U^LEJn4o^GN7J!;4+RC@IEJ)0rZqSasuj67?kVj|4o92$%ZX1%YBLPCB^MzMR z{r<~jVu%TMZvhw?{zJ8NK9ZfSpLwPf3Z4$g!y6|eI}E9YvM46j9DJI-0iD8{@mEX| zW+`+hIK2F}f~Zt#oQH=kWwAaxGF?%-ccJq#?|O>=%(_7Taju_!CIv(#=>__`>a+B3 z6_S=am4)Y=j(Ls_I9bo2t1N@rE_MxK7@QvSGU)SmHT0@CK{zUd9#z^%la%UF#~n6| zm|vcOY1uxONf9!uRhA1r=IdFe`|-+ZNg3iL79fsP(a+h(Y}6hdFT<%8Q7N!Vs)zSj zK71E&wOnRum+h9CthbYTBPvU5e;|S^5aK@RVMaz8Fh&HJlblqb64I1Xo4#G$M5pXi zj(9EbXpa$Xk*F@NLzJ0>VZy1rI90=v2l?HHs}he~I$|y3(63t*y(nJgycQa-GFybU zDh#HhzZh#ulrvF)87NG(=eidI7h1`cn`kR5NlCf0TB>)z;FN0JdA$yNtvvN zfV@-~!vswiC`yNFuozH=TxW0cv``~U+@dJpzoXJ2dMDYOcJ7fG0-2Lqlz916G!mRj zO@V>xpjvF$RjWb7UrQCa?pQ~)tK53*T#&^0AL5*i z?a6auqLI{g>?O4Y$+Bl{fxgR9N^_a+IJuIMHbL${<%*8~nc~z_=BW$UNHGnm{J7k~ z#B->64P>gd%+;961TAy5=!tVV50)Ad9%bayDn)FGc&nm7H*H$(orm31ZUL|R!51mY z#aYYLfC_T#8>Qr<3IfCU*ohnJJJ&goDM&gnKV z;$8z&I#->$D>2b1D5LfP)yP5<>OgNW+*Uan%pj$dn=H3{Hm;ggs}`uKF*B>J<4H!H zN7q{|HtKo<6UFZAMoCTBT3e8;xW_FoD7H{zP;78sA+D_Y*d!dxPJ-HX^lM=o6E0TZ z>#q8#G_0nMhV%E2)-Qn0^^|_*+-rXg!HW{aWpa&`>CZfTz_(W$>H+slqRK**E$UR{ z1-lpIIiq)!H`zDz8*K5v2_a$qyEf}TPmX`j;r72W=%R%e%!A{&3EB2iXg^zQT2z~s)M~fK{?l%Eh z$?MZEF0CU9W)!x|{g{p}8jQ$C)GKGep3cRmO*^i@OT1#33y(f*&hkBX9v1}PzApQt zVTMAAT1ah8I9@l?Kv?Ma{DTHv3weHTjVRi_@A)vGOGgRDkS5Izu`$dbm)qV@+2&}I z=utklKZbMYQBB2tnbK&pu&)*LuUu#V!DeKq<|f)Y4SkR=!M)zCN%etxoksdPkESc@ z^H4(sdvS7Yl#C;w1#bOyFHsHDYYW&pxKzwB-gNb`yrNT)6TMgU+a2%#S{+2=t! zK`Q?5cn2PS-syCD%nVo8Q3J8R^kX_)Wun6F4?d;a@L2aVYRR}E%lm*gcm&71Q(w)q*um^Us&z60^PDJ8CfA~ zTv++6isNng-|>JwGq_I{KsFrcs=TUmCDJCW8Y?XpZKJCFS?S0MQHA6@Ub3 zL|~=QTY^~3`TqgJ0)@4t8wzS~AO{W7i;WP6cVfz ziG{gj31Yr5U@VlCfYIB^^%J2$)R{{ z^hpp?rz-_JATfj-w(@6WSfHQG;V6AVX~1jHVDvU@LGoN3+yR1VbHNj=^i-e~6V>HM z9y(Eo8YsoNP>t009;&`1YbQ3K0Q>aEd{`6Mx8l6Br7dgvl6=fS$V5ix_!g<;z9 zi1DeU*q9Pz8%>~g#nTQABNz}>H1Tn#hKR9&g6AR+P%DIG#*)fD&|-}%5(?B0MWz-! z7uFjbepiglb=QE_rCQ*BV|4#ZS%a- zx5LdK@D)OGK?o5LdSGXIW-cADf~RgmG*fJtxu-fA}>Z$fI`Fhl|9gTq*mh^nm*< zQ5FCGut8)j>OzWFZ;GoKAx}i1O4#30ht`xyA<;k;Vetyx8-E?W7HT90L+HYIagH;y zhws@++Gcgljz=XQUv6;9-X=c3g7L#Y#NJKbWdEyN(icJT>bk%`WwUu)Ow2(kgBVn{ zdQmSbGdpij7W+^ImZ_>cGw}Mc24HW4_%sYoQ?fR4ki4pCdd%e>^$vDBcIeofyd3Te zYq6%m@8Hk9hTw~l8-6pLL!;eOf2)MlEd}WH9fPW0xuDpEddO$>XdmJWQb3w&VP(XJ zp@{x@IXw^iAG}R$!^3@{?zTyU zvDTZ3^*nPvCnj73O90w<-cMZE^2o;lFf2okKVfd~v5WKQ}W#H3= zU02oAvBtY%0_RMT`no#`#8w&&r)H>SGn0Brapj49^Kr{%7)dKcx*n?4ff#GytZ7SV z7F?p4b}L#rw}BE?xMCmCf@br)2}jT>fsT!#LyNpOruSE+V~BZw3f83RR%DczR7k>Lun@IYS}-4X zXAhS)u7lxLh>Hc-{fC12+q8~N%p@+Ea8o_}P~NzRO{_{2w0&OKB?r47waRd#xJC~? zCr&FTS$jQTc%RJusT;%Zat}eI_j_|Tyu#!80xbika-1LvjtKgYSVEp1Edxr{nGwt4 zI?FlJWBL1Z^mo@hTC&W}7c%JO%fn^-7c&7nv|U#AZ&uAbD@$#HruHtb9D9#NAkF64 zbF8@6J{dMd?a%bNV857%=y=Xkap&q1nM<^!KV^xv4rg6I z3LNLE2ghm+kcM1KNQXI?WQPX1cFPSE6FlKGFwvfYH-0dtN^D?ce=tgb2)&I|E8H!A z7v;A6l9t1Q$ySQch?c_GrrXZ!UA$g%bBfzn;3iCQz>}+E(UkovUAaH}%W*-jTXM!1 zeMPq$Ndic4Q#iE~_7(^j7mKvfiI<(0JhEhDav@iAX-%Pb7=jOeVrNa2s>dXl((o?? z=XPE@^L#h;Vo}^jOF>>mn|lO={>7Z40B`1*#h-a@&(kcR5Avhi{xKwt3ad>L>yXyE zDQUeJEQr4^cb;bC>7YdjIlR_F&`J{_BO3#C3o2WATf!Qn<%)XvbrT_5?S@VW9w2KL z26^|!?@jY_cZ&SO&{U=3$9DCDZ4s|u3cBKiqOHl>J|5N>}BNXF_-65jK54{ zq}KPgLWvY&XQ76&_t3`0LxLj$oE`O!jlEMsnn_5QRA^vS!5kQ~34OyB-p0jCZ2_Jc zaaQ0U2;|dTnKThB$_%I`QRRTJnF`g;a(9YS*l1*vp==adctb_!1x=7pc5+(bm~*3t zr<}U{=q30F3K|pPaEa6+dk>jj79x4Q0tdxG4asORvzHmzhoPL`fP`s1nRse;YGE){ zeImYgJw)Su?udz;0GojNsiV#ubf+&v2(7`X5cERc z;4JSUT9YhT(lp$NN0JgLF^qjsi}}f9$0~XZu!A=mBT1Dz?lcaM%r%DfStF#<`bCzF ztfzX9&W2#}GYGnke`$0uS!j>x3akft3hcTAP94OGnYFWNImGoqG#--dOR*#!ZjR{xr-*vfMT zWTR>MXdS1Ul?~Q~8{cw=ui{=_G7CL$e+YJZNJ= zpC?%Sdg!nAS-pk{Jd!VsYJ={0`2;y4fm2Vll9`9@0==rHpo46AtuZTiNP7GWBb7Kr zldsqb89CYrZm7|Nu=uaO=?UMNMwKp=c>w#;?CJv07nsm$)_paf@;lu zV~+euneI@{HPma8Herw?k;*SBVUFBuQ3_LQWUTL**9wBfILY`7W(t0bd!n-1^J5*0 z4?mcg=0s)QjOP>3qujumto~IwFNX)HEh9^5&RlXf@i>P_YZq_ zdp58EyF0bZm*bX)ywZ~*n$aVD6X!Y_M zU8w>mme+>A+neN847mpO`By@Fx!+oGQP`D9AY zk9VEo#}H^)3m%~?wFKoIpIdis^E zCHUFHD)jtw+$~y(uUg3WboNHX69nqKA5b=0G!6 z;4DndK40-hm}(&bNyjDwrIC!CqJQ1~EPpb{1P>0&Ob)Qd2d$lfjhq^U@9QVK#&I%R zIwJP^Sg(=38)^A4&BI9EA3_M?@Kcg|$EaLIi6yiM#zKOV&P7}%9)XrI#ZVDl=verYJH~Lf z8d6a%OacE}GU<^HhHixZkIpQ$@A$@)G#0z(9*g5oh9tjf=>(!BYRH{>JU0gns}G+Q zrHl$6RDPo&@ohDvl%@{vo)*p3*r?Z9>?vI_f~2aa3*%bE9e6~bs`nQ_GFk{p>uN25 zqc_N7CIhVZ)4jczKj|Kk7jmQa2XKmg4O%$jUx0x2g4deFqwA@0ScN{LhzqC-XWc2E z-#%MHLv%hp$k^~eaIZB>N5frUp4if`f~`uIYq&XV#rrP0vCX}3)vr72;!!J#fwN7p zk|$ZJtywcg`wVzGoZt906R!77%_Kq7rSjYgt8T#083_-@(^jXf#6IR)S%rF6|OyC z%)obMMxrx@*Bhfh!fd23{FO99z{ou`t6|qj4(hYAIh%9II_W3g`nU#1RI&j|b#El? zYy|{pU=9DyCg#c`kb{rdx!XXU{~>o;o?=+yAj4ZtJOPh>|6mop9}lEdwo-YJ&SPAX zJy_AauGApYvs-cL@6p?5TI$~osf4xJ`>m-7;g|`W^5d#rFl3KTQLH)&Fa=XdaACj@ zO-+i z9W9H*K~HrIP+pR`OdcaIRMof);lScx(DB$Sw4GDOq#;%ZgD z8zyp>ysumb)f9RXp-SzD%iMaQ@p=jYWjHd1cI*qb>M__-D2LFxt2dreUffS(f9Z+t zcKPO0fl!5;Dn#30Tn&;a)ROVAjl-DSNSTgNF#-R&Qw`R8;)w94sPcgPJXwquD~E0zDrb=y3zs9QzIa8c?@$X8-7U^uQ98r>bC z-Q+VLHDT26oaXPIk}MLk*vmpCAAjL6yn>I~W!K&T&tpDBkrH!$%;`Tnsl6hiz|Js>!gw8I05LaZgLPRha6g@5LasqWi6rt28RiK zF(-7moSM8($*XsSz2Csl$Wo>WIJ?eUzi=y2P5jnH$32rTppB1@st0-&fIg*h<1Yo+ zV8DnQYGIZ}_H8^w0Wr7r4shX%K`T8Pp7%Y@I=ourAss}%svL=i&NkoRsq~%o%$2@Z z_EG0G#^>r>dX~hyNd`WF>GV@WuG~t6g^t@ya=yG>2!H3bY-+Gex6Og|9|W5}I2V5p zHh($re@(FY2Pew^tiY!&g5@?Pp1jAHToVP!?k&oEA%*dA^w4HH)4{lc5~)(go5 z5mu3@yhDxo68zG2s@Nx0cy9%InEmRFJ?43j>++qRx3s&z>#I*EyTg27kPK}RKJ@2C2LNqZUF{z?FY357m{&2!fR56JmOkew5JWWAqEw**>)>zNpWFe;W{`*;_ zv8G`T7_taV%@$Ts5w~zAiAbi7Cr&vcMh~C(TA#r|d@$|EPDj3}+L;a$1&U^Bw;Z?Z zh~Oe`PN1Rni+l#)+<~X4lDLSdvb!RjD9oqgO*TCupYlhf5f}jdZ`0jQPa>WY!ce5q z-;jhRxp=PtJdyxArKR#e>#}4gwomMo+1kTaJ$N`Is!GTwpl?#ysJegsx#2o2_YYemgN$dhFI6B3Gm|3ub~RfB)g~PqlW3PaXlf!|aNuSI$RAZ99tGfnhR5GP zm^h`V#Drk^TL;8i3S`yj*nEY!6Sx>6vLG>-WQ5^vMURaho1eOggo92CgjPW4NWzuS z8iLrc+%d8sEIz;9f@!}7##~Oky1{S!Wv8*2?i~o$9x>psVdeY|86JJ z;g&|$BHohTT3i@|BVE1~a7K6fBUK<#^!Rvru0Ag0&VeJDD)I!4Wpp?X7o3H$q2~(L z+5}@|6sMH(uRjvP#$sh}*bQY8(!vaWc(U3f?8J$NJBMI0m;p<`Tv6a}&8>tH(n=#{ z-EU-Nig4+-urwD#q`SmY!20{`)|1yinHp-7Fju&9O8?{jLf9~Kb4QLk%oTm(;3g)R z^XuhdA&+l3sOMc4pI0Slurl9nG|;q$WFW97m>fU+y+LzsXmSO}VsyILi1biSJ4$%J z9_Z%vSa|fl3C+l2#>XqHi`-g{T*`XH5tW$)y&(0tn=*A;VUYu!b|<)?R|bJ}0}`v$ zT%PSdU=6+Gsq@8KWL`#Ln(aw$XE_hX%!F+yioPGl8*DP3Uvh57I!*(MFnOmE8WsGB z0l)Ay*M5SrJr(J~TJTyKeIw+{jp5osrt}Bd2j-a!4w5@=8MRmY!hpGG$?fO7`eDERbqgw^Gx{TlqhrU9}Lw{h%@5EM#{ zZh55L>Uwmz94*xjT2d-7B5+L6azlA2a=B>Z=em6%6cI7s72rVH$oL~{N<6Jft~xA1 zO0R8H;GNrhYy0j;RPjfGCest|gqkTsWXL@{x*p*e1Vi`+`7QB_9)B@J*`4}c@I4F& zYDZT6=&RD7>+yQ!qN)-1ezpf-(=htPK*xr0({<9Zzx_bJ$$WcG`w1}jeA&h8T)szV zzNC3=PA)901|>M#*x_Yk%1z#YSbpgJ9%6o&Vs`McUtj77hIt_fpLnAKC+%ZfcmMd4 zxNE2od(?Qn%EP`3fIrHv2^+vS<>egUh|=}$bTwfg9McCRql#A?3CpG#%K+d_crnSE z)OQ2-@^L>+_erq=fnMVGB~Z`1?_272;sV6 zeW2qpAwp;8i`;6uBJ(J&dptljJU?YNxAQ%}}8ifBqHtNz`6 z=b90)Ku}p-W-LUo``z-Bk35U9PsAmt$b+4wfq?bag)y9tfTZ4d{>M=j_9?0U zaqN~Tj^cMPrOpbnl73ZMBf7zeQR4X{|yqbwmR#%i@Z@FV!% zo`o?umVoQoZ+u8VXJ~+YsKM_L;&wh~NkQy5s!-5RZ_zZDsB$I0+DzQyg@!J3pY$YK zU6vkjzs1a(QSCm9YPV;7b|Z7Xd~Uttzj>?_{(}VJ4_?yW6NG=A?#2InHTnl;{!dZ{ zCYC?XsFPB)9P`;whBlv3Jl4ER!ejgQXY3QwtP`x+>}_Yy89)Lj=z>A)m|m@K6g&fC zX|0U(nW9OjpO3Zg(1+<4=11!g;W=Eq8YC-DlkNvRYOSo4V)EI?1iE_PZP99He%@dH zV3W+D{w!-`d4CQjfL{fvRE!utT_S{YMHHA5Ni;OCYFY@HGD$LK^gvmqp^Gp^XE(XG zzn7VGLEKTmPv{0%7yIrPmT|9BfX!ROQc+1IrKr9<7eYtQ0 z6#nkbx9E*;h3TYG-HP8>`%wo)5q8;D6%yT*i!k0t$1~oG!E)4-#faU^tyLsk$H>}- zP0ho!Ok4u5u?G%v&m%pB04r=(cb>_Kup$uy(6+jgvD^HfD(iJIJ9qa}igR9+MauLzZ!6)9eA$cGIuAmg5*0#kYG^Xe1I>ck*R>g0z-aH!L@pe8x4 zWXtbn?OdZN3%z$z?vfs!1d-hWHJd2yM9NZ3O+yOW%j$E5eGMo^plYDzuse(rI|Cr|=c zDhjxObwSwf%mq9cj-$T~*G4uC5lM0w3IQ9k%X}H>QTXTx6Fqd|26qh7u&%?JC$g!l z;}0v@rSe2#T}iYpp`2mUQd1x{zU}p*s2n|C1{8+v7W3G)z*IHl2;|oi$`-UHAn}EJ%Cb0gquxbO3(NSZhhWTXhv8(b$5DN`d8^ zsj6|U%BEUjUHIBH63u-h8`uk=??$63A1B}E8XlYTfDLjj0-Rz8gsDj=P)A_L30Kfd zRAdkj;b!e{hhHHQR6S89qm(>U*X)2cAU6G|JvP@A^{myRVGR2YYoANuRD|RQ!K>jr z{1#%=>Ob)Ee=v3a?&bgTod23K@PFLPbNqpz{u3|H!N&GScUNKB>R(i&;LB%}7HJ1R zB#>^Q3mh?t+0t{8Vf+-RDaI>k5#;gO3wi<=TqegJJ63oREibVTEe=GV)ZgyYMZ z3=0%w4e|6nJuaGD%A%WrnT9ZY^y1=ww$X0v5|*~r~r5N zO%=leaZH8r0peMBD9KQx1{llQxXJX$ERzB`!&a%oVaC$U&CzxKvuiPnHksw>xxqwF zN7-%BAE8)AQpw11j#LGvrBkH^YuvO@=|z3^j}^rI4G59@AfMG0Uc67EC}1K$sN(p^ zo6yj$_XM`dsLG?;Px^j**;|J}gDi5hEW}Sg);}YQ){Mtm$;Q+J&RV{EDyG_79mvSK zZ@@d-8;HlqBe#hI3PO%AK_D@;rLL&#Bd}4EwbYVP^ksHc<~Ai%5&z4s@%m%BWHbWh??^?kFvB84rAC(VGttv(u=`cfoKAM-V)Z z0p$;^(A!3U#MFswo+q?Ym9{g=0S5GX?5#tjKPpt&e(!l7`T#&Rke<3?qUqZokRG-Z z>`+~lS)}a8nDxipQ0{O*M1Gj{Qh~?oF=>rnG1#IMBx&WG1rUr1csGii8F16W?KK?$ zVF%+x=ys*2!M^s_)kNLEU;A+eFON8Q2SeY-q^&z12ty8HE|XK7`fs+n?Gu?UP1%eI z#B9~QM3Y$^Q3_uX6;Y;s_2wp`6N`7(Fixt*9Mu{6<3DmD1Txz+Zq3KtP z?m!|ld#ad)K+vZ~`YesBf{lLYi2&DlsXSl3f@C82$<*!eJ`-Q9NNQ|OcPr&a$C482 zOx_j!!yPrx&*0PI``3^7O|;Gh3HYNXkrW`(oiLbrOjpBc)S6ZDIV-R<;>ssHI$O0^ zrRrw)e+4&@_PHGRn^GcL7L|ExC`~OuJKSCOo!SfS`Nr00)2r}fFd8dw)?ig7%ge)* zmcP`k@Ky-0b4=(jSvaGcw~#ZaBwrEyJRyX^EK5quQS8Pz-?6;zj>HhW(^OCb*JyV|sNsTSezYni>BTt+t+?o7QG#MUP}amb9E+^l&2 zy8UrK<@RQ0r*E}5socet?2`Ub6m^AVe_uz=5luxwiA92*-{=H)fbnW z{l4o0ZXV7w?#elqg%CTnQybS!z=yya4+2f_+2bB)ffFA1*sNNF7V$g$=FA$j{Qe>Yb)5n1xJXwp8eF55JIsVHQBzZ;Oo zWfeXbFz&Sc$lX@JT+o!4K)TP6Sc#)wS+4V+iqRpHAez|7119^NJjrNmduW{Zsa2S# zp{iR2c@9I;&XT5|vz}SgnUg6}D0Y)?`8I2<`~Em1H}hHG`hNMp=Mx-%5QF|BpZHsh z{(qcL(2KGXu>XzG#QXK4mp5=Qv2h~!?;JUE`~k=Q*O|pPrvEf=L`}wal>?#kRBgOe z9Lk6&ynwf6NoYj|2*tW-y<|y98=_2j`DE0^Xl6A=Z!_0;Iexdn=|o7MW11tK{dR*p z{`b#YA{Xu0IAQug4p%zE!=H|aEk`%}z34*$YImP;lV4hSl?0Jdu$lgOFa-`iHkDl zt|l3KVO$#c4`$H0&l1~iFu_=$AT~S*3;4-xB7C$mJ#|c=n*xB4FDmS>;exE1cgEJw)*uto*wi~UQ@^}afDGuSzOpDZa(w$BXe2oz1Y|e#_ zVQ=nX@R_(c%s(p?6(I=~uQ14nbw_-u6zz}Mj96^mTy^w8uQ;k~gq_7DdmUUtHN?ql9G%w0sg-OJMc5~dB8PWZ&p5!?3CM=|yWLcH4zi3>fc16yB`7y&M zfgem_3t|Nx?+Kzodyqgf&zZY{yZ%e9Ixb(SMn%PSc}b zCY_>;G@7YNAECH^b-fB~lAXPbx}R0sK>1RuXw5dQHAF+r&GS*dHosg2EHi8Q42~z11YEF%s0`xw~jDDL4<(oxCVAV2X z@sM4K*phQgbn;k=)o?vRxX!T5qraiJ0$xr+A1U8dzf>`~ZC-rLU7e@{tvk)F;Tk@d zE}nSb(Co7%Ra)HDY{|WnKyn(vD#1r?@$p0OKDlkis-Y{eG7%46UN}VZ7!u{&6099$ zr6lO{dn1@?)KqnR7aiTyW*6B|a{5IHmHIrCgGxcUWxMUnSlEz7#P6~um1Ge@sMhkc zwx5kv@T^AEw9x5?MSTS(OoBadvB{A5BE@G>wF9E)_pHQHv*me}6n7hg`MDIDW)dMr zF8Ri#7pi4sQ4f_rXY5W_sO~{x9*npZx*UA~_+V?={(-;xgR<~0#u>}U8^ON4 zjGuC&dZyUsag7039?1Naa38!D@-A&Q<@gxyW$bL<>mZ&15|^Ir*2;x3`-Z&5`8*$ThYuAhY z^|+|4-cZ8kR;RXN^sL6J{N?aDyJe-GAP%34h0&L{;51YEH%uDxOK=gsoT8E6ZiZ!n zri>On6b?HZN`QD7C?h1L$m4~n!VXt$a!<#;MD1SA#k zrj`-SuHli2$)_48lKjr6_dl&ieXZf8={6a~n#qeehv%jjld;~cf5Hi26EM!@c}pV; zY2;QYUns%V0f4EhuZUjJjC!-IhFs0tT!jx5ITE6KA~xLh^@jl$PHA^~$9#`yb_PkR z)1FdP^Y7^_uJkskKle+^+8vMLxYJpO4?3_tb;4Ky2+Kt~H%iACg_0e$!`EwoXQ=7@ z&E~(j8Htv@Ep+|2&lYWy4>JXMeF1a^`pM^Kh7w@3vSW=aP)M^_KbNF$cWLomZ`sOI zf5kDpHC$+O{#`!xe=(b|;%to^XAT%c-M|97=hRjddg3m(_%!4`d_c5SK3o;V^Cj!D zh4TmhQFsrd^>tHp&c7`SL(5}BW3^QiPtBxb7AKD}&P&xrNblDFVz^1+chQ(AxMyVB&t?LP3f@m9J zt85Q{;L}g67DP8yLyb)w_2`b#=Cx8d&}`Nua`JPX5#Ba3ojnMkV^8h z6s{lMizs=64-g$l@dPlnwCfg(b^wSVqx`=2$Vjcxa!ECrwIHXdC>m$oB@~T`-H6*F zluRL_!WN7e9xO!Y$;^%EZe;Fuv=O_C%9htE-8d=E4FL!dl^{?+na}$~g3}E_Un-=u zq;|qG*uujQg`gqnVEt3+4Q_egNE6jTXeW6wmcB%P_XR~TLFB3lKx8yR}+SiZg1hCsH>5>1i%?GAPHA$}JZh)d4XC;Q7Z)bA+B zNq9amtI-z1bQB9GX+=rG{X6C}(cI&OKMC8Yc)Xr=%kN_Si)e)bfD)RI3MMwR#J`MRvlvY&Iq^&x zaM}p|O>wq|7>zxl>QHe_f{RvAMkP%E`KV|PN>SdckV0I7mQ=n~rSRz6uThw(dwVWO zVM>b0leE2_Mw)0cYp4;!IWDNu(o@`^g86${sPrZTP}b5ykf{n+lpEzmE)=KE1pmCs zED1axwM&*f0qkfXBYedJ=hs+4q0+}(6c%ejNlQT~$X~7S3UjZqbvdgciqj4I%ra7! zLQ&?^!AiYfh?9qCeBhio5~2BuVB%b0GLjdw1Vtt{=hqKpPKkmXi!rl!v1!sUQQ?)( zrP=gNPR~G(mq|>`4+1|^QeRlq=eN4&{dQ=Fl;mZhxJK-{icytX-Z={`J{U1(LL6i*V4KGLwS;^5tjGhE`S!a9zX*w2@Qm6 zDt7FByj9uSf>|X8hW%vJxnOwkE;QM1z#4A-2p%3A=8eNJT7qLOpBr(elDRKoj9>EZ z*W2MZ510k2%)gMLG7020Nc4&qdJtglkWPfhmAwNe>W8J)grF|dV)YxZ-%;n-~weriCHtUhD09%CpFq6d^N3pUeDt5xqdharjVU2 z^D`aUXxM?+wrbMnNMrfR5eVb$c1gHGlxP|w_l08~iJnASxmjaf<3(XS34m3}Qr zV&A|CFuOlLyAVP1+G(-abZd}Bk)!m5eobKucYEO89mxd*jH>-huS{dHl!hwRL*CVm zRu@Jqg-{oQE{Jli+mq>Y$dV{pr8|-_6UU=Ur^EB}xghddJruPm1T3wt<;lsOS+AqL zr8TolM_X?_bCAwA*?|Az<>a0{uD%;=O;@kO{rY5Y%jDYvTUK>nob zJdZ4Zn#t?|r4xIf&3BE%%tt$Mf6kHO0$?xp{WECdkIxusDtX)phm&PYM)+4%CA~}^ zrHmMW=89Z8#r>C;_lceNkk--k1SGNo7;qEdhH~=bmuKWy_uAdGvJM}N{UeCEK$Zf= zPYHa$+5yBg)?`w~&p~+=>oCW7E{eiv+g@%B)M5-E$M8%_y(>qRN6!3j__xBRcldCnMh0ErnEoZpc zO2458h19^Ll9@1eADo@_jLV3GR*niXE{!9h_&s$>V|4lK0eWC>b3+*AxLaD=r*;-d=1N1%8GTj}IU8PbGr3yNIsYb-ZfI zjJMbxdo7dJ7WUJh>BBh(XGavcdN*eRRDH+Wp@ z#jc>rFV%<0?2#!~#|8OU{S~)zudNXGKYqUBuPyiy{ex2J4+`GjOQruGlomQ)egqoJzs`y_-bq+ade)B6gFVqtu14^gH8f*I$a77I=JT4nt>@&#a zi|WfXdmOIdJU^L63Q3lsG{@IpwsgOkqXqjw$n8S+g;FudbFXJwn57Mwru+&Gdhnk< z)dJG(Y_xwc5(+5!oJhCfb>wd$CJ3ftDf5z}HR7OCFrZ@)bHE%9PKv0IKcmn+b7!lX z)TM@(ZNPSoTFHT3r^=Z#K->{da+tew(%CO{CxB|&RLLw&!>d7fV#Rn*C-J(Z5BCR%E4uYnIev~E0g8)Be(Fr4lGMqo`38()SL zd=7Jh>&#@+V4JG~e-hHHf>_FgtYVrwT19z{I0vAai---2-o@+1IiLxdK$w=;uZ?=- zWNM)OF*V<~Pw-jguaaCAX|3{ryug55H7oO7`puDW!`yHTKq~bpCn@Qjo0KmlDbBQM zPzt|+r4 zDKjh+M2KcrU`N|mM=$Q$dQ}vd4@Fy*TwB#e^}7fl@*enSfM~G?%XtS5$~UFMwerKr zy5Zat?m+CD`1CH9{PY>92&>0+tlBU)09`{Y@>fjA%;&yyq)nATlg~K7vMxS-=?^_? zA!MH^YR3g)CUsoP^TMDhaTA(lzayP0;}Hd71aeb+L0e{LLLhB+IkVVFB5W50!g@(H zw{O7Kg!s?2mw+4b$FaQ*5Lr`IohLH1I`UWvs1TUpRN{PfMY6;+31U9D!=gXiT0*0% z^6DRp&0ZcLo878xTUv8Rpl5#BJCNQy(L2@QiK++_(d%Ixa^nNwK*Hl0hbVBW?38{fC z%zpOw8f**RL z-&LeAXlC$0`YnnsKGydd3%6?E_6+okc2%ibpJ!7odm{wn>Fp7{#)dIN{o+BRc`o@H zT7%u&a9OU7_gq77p|uaBU5v!?68yO}3IA$Tf*f8Y@R zAQ=7KA^tzrKKO5)Xa529{}ZRj#{B0{j&pUruPJ*7KNgF(jI^90DNby`VeAyDS7VDT zb{gPi2q}=PzbBBYDDI&4{gUE6iAEt+s57FD<~lQgK)R*bSiih*btSr0@#L9xGImE} z(`JciIF^3R@t$|8P#O~aKEdDBbGyl!m+!iANY5G0zsEP=U!L_Q9UI{6Z|WFzby+I_ zGbRe6fUOX2@J-8NYO;>S&YAHVMd+}{KUX0=If}N- zJpF}&b+unvMQGV8lW(ZMt^CEYApMvq0wHT7>A(%8y)u)f4!Vsj)YNwQLenz4L3!G6 zb`q^ZMr#O-eYa(8oFC^1x&Mc6lTg$+CcD^F9B24HoKwN|8_!ro2fu zqzhpwUKuoO2Eo$RX=e0mS+vqFK$k=NEZu471H_}pBcxpy#RKkQPJM^!m`fUo>y!>NR~I|! za42n67gYyW)+N*XgXyFMS#U#a4^;^T+X(qs$g?c1s+G`(dun( z_gEhSrwzZ3KOl1FflCa7x#*7xJjvLw`n%(4aYIc4)F4<3JleIPg<#cVJHX1#jN1J) ztFa4iB!K&GW1-4|pK(3J)(m8ZgFV86+;>lQDu&9}P!|^y(9Jbfdt{JOq(EFB5`$DS z3(axWq#7d8r9Ms1Z!h2NeqEL8`{`zuJnn&er&dLDzJzOwe#rE`iNwANI2{JG=e79+ zGy1g7_ub#(7l!1sX8KwZ7?yCz#AM%ZlU-^69c1J{O;bvtBRs3%fuaf>ilEgUHR)Rp zqkPL0n@3s`&q1X`bupC+_UD${VL&LAu4mN*BQ0ZUfk|;s7WLBTsnWrl@fcA=DYi%L zdqiw|CR278go>oYL{{t{tqFD9Cd;^N#w<3R!qm!twx&vji*I=emXvtqrkYiOI?%-lZgHX~&8ICxZ&ode%GwBHmD>BDw~JB|64ge7;IErO0;$|*!dAUe z)6QYsfz)e~oa7lg7C@w48;(i}Wm9einuH1_aRVD;EoRx>Pl6QsJ9dlw3VD0J3stu| zdw++rz1-&s@eqP z&^~7d`=J}YXjfo3?S3DS%V1jBA=*o>5!iZ_EP&P-sUx8+56>47$V9gU25z{x;~RE3 zvHk$k1!XMX$Z06W|mr_C%9&RzWGmW{z%t7!>#D|@6-8-WuhxR`6CDs zKt#!rUYFE8ZhZi;!zo?=DYk3#yxTVb5~mM^Tu1sU-FJ$>QkN2O3>wYB)-y7lF4J0i z{wRlyUB26`psDOiKAg>2=IhqJtc%xrqL=xWG^U;Dmy-4L_O7?kCo3^~$ipCRNPWrB-KDHO zrJYLC9{iC_Y<1!*8rqO z9;Vh4F?J#ayq<#vZd$m~;>i`{**Q$klJq7qQnmNtk5BmCmd^$6=?_3Wyu9Im5LN#I zZEX!Lp}4u}{~lHUbt5tUOGeuNeVOs?|A?E$#LVy~T2uKKTEl_#B}u+zUt|d_1<>&# z6UK^XyBv))w!FN)Y&e5t?I?+a8Wv9eBVTSEY`SGSUZl>H8vZxqGB|kDg(&c7^GwJx z1%U#ZLRS2;Axl~mZ_KYKAgoXlqH1E<55TEUj9TBd=#Se?UmAeXAFE~-FJDixgn9Sy znMMEJCZ!p7I3zIF+3TyRZ#Cu0+GvCxlZ2nJD31LZ%14NmK z!}z6lGWO@)~7)HW{PE@?~^xRHi59LxYK;MGe z>%!PkcK$tu0ZWuP1rQdqL?PjnITA7ejVb^O2_WjY?=!`uxq0>grHrCc5I=Ko1Vow_ zekDjT4O1l6xEKc(uaL%QS)n~#Z+3+&+4_Mocsx)TMx=?!cYTxZ=El_2z$p1iundiL z--_dsD*ck8rYb5}$Y`Tzmuor}*d<`4wFpJkl!D2O* zzpg#OI8&4-4Q*RklhyHFz0t}xSh2w~-JmZ%)`0E>YndfpV zG_kywi2^LXEfX0jV|=|!WvWBOScYh1X<*`K#99XWP0LV6Do!+3;u~k3l?!Jw|9dI^ zrvo3U$f&lYq`nf8Us5HZYq@!-ao8lSkclA2bqNWLN@j3xU9vF*u$0^eDgqIAlmtjX-aY zEt@#P-;A(BC;2i0*O5=$ZCpF{io;I8|KE*h!6!jlA=s|{+oeG>)nr(tu_I$jnfwxajVx*z0E5EwbSBJnvSLxT62vwf<#p8omi;N|4P#erR@=wW1U2~gT5 zEN;l9#Km-{pcMXao!pozB#YI#?>B}1G|kTpu#}N(T)F){>6a&vUabai2j+o7)e zdr^?%6nE}`4#LOTSoa0sPDGNr7Cf1q37nTFz*Hm=d)BOpo7H6@pC9j+5 zR_W{87u{igL^PrC*^Oc$={(`7o&4-rJ7NHN>D@0qIa0 zqy<5`r9(ncN*eJ!zez?-?$=+7`sVLt%Fg7$S(sj~tr)1}FtvP5ctUmic^PGa zL!CCaqC|aO<6?C$EiJbmzQ9!_r_MO}XgWoIl^bdLRKI45-HS>*X1LD&B z*5SMRG!c_LlOu1^tRdEhh(fNsjwY~3RJO?B>Z48vDdb3BjHL>qVS})A;!2|X0*kfE z10ZdjPP~4Uw6f951gQ{>pUjc-*MC{w{K$gTfW?*_`GR1vSs@zKSL3BB_+Q3nOjCg%Z>{EgKg#P z37e_xwcBcd)cgupn?M~;Hfz=>I(wK3oJ@ce6XA$;%8ZlP~Z~l?42Y)Qm01HW}Ae3m=D=faSC~X zy5Eq_wq*RqLh0hG0BrBxUA2bu@Hi~9j0o19Jzznm)Wb@*$(tkiZ1Y})c6EHeMwbQ- zAD4G(8N0B{LTb+lFuJ)hmX$ArG(Jr2l&-M3v_OClO?BX5?zx@iz8-2{seug?P6kZ@ zBdG*iJBnrfw9_ko2=*4sS+Sa{jx8vMWPKa4C+l+NMg_i()s;zWksN%k?dnAr8w?eA zC_s#S1_RWsJ>%^SE@R|o6m;zvO&5|pyJjoVZ^he+G_1ri7*b_dSqJ=t&ew&ot&dU5KO6|Kb@}|&$b;?`^+1pKdzf_eW z$cQ{>cx>Zyj)KOfx=6-6jf|DG&Mtib_Tq*(BEk`(<&Z-`HcsWr8oXR#vIY!orwrZI z5Pz!5S0cXiQ~JrxA1HuE4Dxo)JuhRzJ&J%t(VtB^?UY0=cX<+Z*@vq*z|d z$Su*NLY0(C{j{dM`^TPryG41MBR4b_9WGhmmcH5IQ&uukqnru7T~i{5w}<87QbuP6^S!oW%S0l<;tJ z^*?h+=RZyfe?3ZwJ~-*92>e^&($K%0GWsvB7YGFMo4oZ=CMFmsz#DDI8-Kpsv@nk@K2#s&P>Df8WFa?b4%R|+HE zrFwrItk)lJ{N$fo*)3?s+bPrU>(=^kY-OA9>6c}(a+h4uz|_6;bMvkak~KGY@gL+U zxV)t6$zx2==hcrs3;dzYSHhNwdOH4O)>N5hh2tF7aqhvh&iJ#oGGechr^?9AQ-tzc z`VGufcSBf8(KKK`EBUsx27B(LHwOI0j&JA&UP!vwx2{Xqy7Dbp_`aiw?wc#nE9}_s zAyJ`eJlkTdPG4WUV3og6z$|TE#L4%7WRnWc#SlEf%GFLEOFKxJPE7U(JBquqF7IhMN-E^b?J$z}-)?F*n8}%-TbOcdw3pLOS%%4-{I_>l8MY zJ#AjO>jVMls9D!7s!=M}0k*0Qxw9bsN%~$hse?TG?G&s0uU&?slDQfgOH;f=iTmyd zh|lgbi0+f6gEYQZ6zAE(>HfPU^oV_Orpg!rrghKe8y z`?rqj&2t}$+CMEfo8QVd*p1V41@@{nmYvppkZKgH6(4I8eCL!)q+b8lDA=7Gv;wcD zFJH>{TBQv++^T|-U0tm^QMd*u* z!}on}%wDYDQ@U)sx?Z9VGtMYU!!6V|O`qS?^uBqnB|3NVToPmkByQmXBr&JhBn^Va zPqH!h?LAX2(Ka@{@Z>F*$9`AA4n>%Xzvj*Li2xd74nlI;DbB=3<$^5^4N~1V9Fl`Ava@m;B>XOSHl;xii!(L^5foW8%dt zQoVz8tMiu#t@q5E)acHb2S={KgcFS-(=Lv>*}}-f(Dmlc_ajz(FOHA-$J$5;WK`J4 z_iGO`?LBORc9_VgJy^5zDEF-ts1S%HT4K%QbT%UjtP05}1QWYVF4vqRKttTghm`W!)RM+*w?rSUR|9ALA&Nr) ztEw6aVz4G1hQp~tnnAUqw3>O>P(J+*gNb*hggsLhrq=EXitinn?v>rfn(Yq_Q9re8+`m@E5#=nbrdUaDFN||< z{QSN)S$f5B>FtBlx@v-4e__jiIl=g+E&rd3JM#bDmjAL1`d@509R6#Ns}c42gC~Ud z+tcV0ZW<7_`L=u>q`|*%#q{!^>Q%HQHQ`y&oa-zXK0L#{C)QLxt-vRx*cGC9y;;FC zVVRk{aIJN{bumYfLr(k&iLVh=tFJ;rZ19VSgC~SJ-jJ23!L}HM9^}ej|JH3bV9YXe&F~}r!=}uvHVBagjsT74xZL@nfJ_G;`HdHinO^u6F;R>jFx;JMW-Hi!@aI=I#(vZ z8lPTD=LU5?^@miEE_eh*4|&hq$HJLbd6r2roT+c?T|cLu-T^$T3v5qyd@gPleev2t z1$>&^c5$dzq>8~;1+Qn)fH3FlxN#ZuWfEVr&sfLD`o5IYH(ucdeUhnoh8OthhSofP z34iM|3hg)+A7grU7L^pOYhShA(wwGLD-;7e5fm3b`??}Uo=K2>s~13{Bhv&g)!YwT z*|h<=?D0%l5ELXnvO7lsb^n>1{jHpH-#I*a#!^N+wP};~Rb+PfP`RYPQ3NugU8sdN zKG$q+;E}9j{|CHHo%#{~h%!&Ldsg*RcfgLb?2>yMY?71y3m1I?oT~=nTy3dV&ToO& zA=cq9t9xat9=Hv6zQ$5DzP2(Rxgh-%<(j_iOSM`Qa}Me+Ds^M51WM05U3%e81J%PyGunpu~yPlL3GB0c8A~3@XJNen&8B09vAVj0e9_ng8kxP za@52_9U`M|7rg{q{00(khu?a}6B%|*M5C2$lG?MgE7(2d3efj0HX} zN>L0>0`L$Aw;T(OcZ!`Bp^;&u5fkRiorxUZi#|J^GUJ^@uwCQY_W!D=@8k>s;i2DS z&K3x$D~$C{*52kU7B6lb3VW?6|{>DCzyvfPE5 zCV|R#4By4ReO@0d&CIrO&ey5yz9kUg``o#aSwym7pS32!78PaEG<1Db#>JRA+iYdl z2jCn#EE+xSq7LEk1bmdTBev?}Z=v6KR?V~@o=liWTO=D zC3t^g12`-sUiof_PoUDJw=P4WmywL;v{mrpkP-g`{|>$_vy6$39NCLYw~%GgP!99E zZ5okyMnL;$F^9@boF!*aiI{m?`7xcMQ)3px)7qJW{sh}(9F^I3-b5z;RNSV;6J&}0 zi(&DX6DfZVi~q~fHvZ8P=a6n_*9^M<*dTECzED?lf zcZcb*xIp54^>Y+@EBgWlOzzi^Li|KvhsM3O6sCAkM~@Lz{iD)_7tn8<`hW{W!Yi=I z5a-!Je(Cq1z|;?@7@y!N{+KGtZ;V5#RNQ3PA_50+S%7|;w4Q=q4_=UIYpH>Y$d&(jXQmdf~Anv%+0Bt_65X3rd6_zIJB$y#1S$J%uuhQV#k zSHW9Vooy&olI+4hIhi1zyTT0V0>e%I2NzQ@C9DFn-s91dMWT12)U)sV#4A2*X_S%S zbWtf05{TJNPJ~)&ZN{#f#b_36SSY=TNTqkn{?-~Kr=qu{Sy>{!blG=LW6X)q+)?yg z1+xsk)*}%TGbv?dHr@K(RobQaVy}imR;%o{DVWgb>mvM8yM&oP!nxt%P{Q~9p(L5W z>;*xi5ee>8ySI<@1|iX+{E}UbE@w@@Uq}hqsW^{X%CbxtKcDc??Bo3p%o^2P_7VZN zSD{Y|u2YGQu# zP4WBxxR@JTntpg z7IzGdelH@d%nRq}mT9ky{~qgle@+HWSvK!t?KBXjh7 z24!WB6~Li;^Q-&lm%X1h93^{FtMrJk^b&v3sed_f@n@(0Uk`)dvX7{Q-h(% zUpKJg)DD9y;I11j8bLyn&Mqy+gs`P+wb)vu_B+5p#CIgvLYSLM=KHsl%3ER*B*S8* zjTv&P1>82g@Rmc@`SUH7jb5UuuSdb;{@YnWLHA7*QYbGpkcMy!x?Y63J{jfJEp6iNpWY1 zM;@;XoGPO+Ck|fyjyF^8n>H)d%)K0GUM5`Xs$J1x>-eke9h`!gO`cOy zbj_7ehPN7C=@=I_L7jetu;0G>N|g#~tx0;7Ml8AiE*0P%Qk{a-#?;0xYC+~<+;dH% zJP*r+PM0V$rL1lxlHL*7S4Z2O1>NYxbusPn- zwie8Q{Wss{)8FK-`P5A}d?W-`3v^H>&cs)8eFHhCkADm`%GEb>v(D zw=vBTDEorX{={28+496kxl-~C)#TgC1y(&dme)j^O;dL20o3c7 zh=INGHBYDJ?Id7bLu(Aa-;h|(V|l??v2ok}kBm*~m%8qb&DiQQ6t*SueJcbYer!&< zh%>m;xTSjkKxV{SF4bN>9qjZz5z6_^9k^jWV3w76>S?PrW(3I?6OlQ2E&8oxCV^Wb zJ$r%4v_{7jZiAsO1mCW|Rq^G!M93vGUn`%r2ApMWAijU@tF1>`O&SHgmN$X=bQwch zWZZn<`6>LXh|VkDQ!UoAu4TBnM6wt=-LI@~YMFgAgdQ)dhA5*>aah_b;ElSdnvL|0 zr0S>fO{17dTl09eMnBuJlY0KFe6YGduVHCZ@i2OLL6W(s2_7opsHYl4+f6(tF^9!+ ziVJ0pn)v%0HGVn${6$24e*6BJqF4BluT=-ek_WS7aAI z8d;JN)!uaVKB<&wtQ6Ca*a%-&$B@%g`HyrNTB=rTdE)R#$bAI zlHh~A3mdL07nJLR&;C5)$i+tnaSDAGIi~sZjM9&e=99w=81&0IgFnZa!^`hLWfvPP z?)JM07O04|w|2BM!rJ2wR><2~8!2HO09ru#TVep9GWMPW0C>j|$0qW}ujn7YcXWVa z)>aOmw8YWW)i34&3U09RK()Lk4>3qONuD7O=;`TfiNs zPIG=SHmzgodS6LaSyI$xaF;~*`P@Jp7dku^Hn5?$qvTA%-uz;+J}8Z%j_P{n^LspF z&O8?!vHYaup(UPD+%F%cgUOy!z7I1{>}D#NexKI_T;2<)kzVcF`aXD_{qfeDvRl1r zK)Orvq0ep1KoxS_#-&UK^&5{Zl}gBH--kLkaKy19Qi%Y<#BH8Jojm;haAZQbpA&)Lr}^e}O{^#No@YIyl`%(c2eT>I zxx=Aml+arwaWLT(KcxJIRgG{yMCP?LDaYFRWWnoK0R^aZJTJm3!An)Q7K(r$@x318 z&2oUDECPwbXTxWW3>H~l44QpCeee3Ix3lOF{vkEP2ltB9#7Ry1?hK2~k8?T7ug9i1 zv2z!xM8`)7@O{aTT2M9&j_U5tKR@D~-h;xUw0STt86#4lAI5pzSZH_Rkf=0TWcKjhgge}r^vtdns*GtC9zK-%N?h_-$_T3r6$;D6zUXM+3V&pCg zi;52y7@F_YGASq9ZHb8wj2mZ?#yIcS;ygL**Js?ek_O2>)nO-`~np$335H7?USJ+S>2S?;B*!s(80H+>kN4N6{;9 z;1PKmU0%vthVMySB#Ff39;%JZZ#BV1wNCi&SuFaKJkA$!%J<1?-%cXC`NZ+Aq7*UQ zU(#Xu`>VIwSqfMMBAJ2pH@p;yy-yT;e+cOM@0(vsim*Dzsuch_&yvJDSUX@-jokAb zK07Jl262_?Yk}q5OTXfuICYn5?n$K7!>OjwW#SLpamg~V;-rk}S zi^Y^qDqW~nz8!*M<<#W~(54Gs)1u1ltH_dkal_0si-L*rXU>N+a>*T~-acr&EOGLd zH^@4olE$-`!l_V#7M;s8*kr7-(oj&_f}xp>xN4G5bjqgNI@qYkmwE1P{tHuw=PPp% zU9pxyOJzUX{pr0qYD`(`dy=Xd7e{F)n=`gsy2;x%{%wXINUIwtCBf%jteq_vp1Y%| zsF*eVDH4N!oq+3OCR$y>$5_XwMdkUjL*=B1BZ+zQCAlk7$)6Sc;1ih{3?5|pG|6u| z=kK6~aZjh&*V=)BcNen)f!jeLUK*bxd3+yUuFG99j5_@`BvM*dg2&0()A4~ zPA;|9N{#9nui)g^H_GnYY*VA9zOK8wK}=okb|L<^F@k73o1O(-tpuMV6&=*VX|NMbBx%-ouA& z!A;wp@e?4zp9ZM04JFV7Rs^xfY8RrrrUD1%dn)#ZPP0dizt0%ksfe&_*-Xb4d(CfR zO%`qzXrI5hB%gOb-%>$t6)tEqdmc(gNI~`_Kw8??GPcmIw5s?$ z<^ZKHE6-6c80l6hx#zCzJ>ZK>*e9H__6M5p{?*X?S6kCZgV_Hkd(&Xh-`kvqBY%yP z+Ny4;6eD?IzbzN_lJ}FVn!acC*DYoi^~&VV%ioLo9q6QKM5P{{0k8A!N9^^uh5Hbd ze(LC>j0^O{bJLBVtyp}Y+x70+hXgHN1sNNbkgpO;DY+rim`|Ms%<0Rt?|yQzLt-V= zUSc8>nuO-b)kXy56GSoi40?)N_DLKWRu9kgoRTCS<%OD>Q>BIKlZhfo-`m2Xg4a+Z zPJ;H=!WUnU{gkFwbh z8cGwcUB)Rnw$6L+a^LKCUy#_`m8{7W0lZej=AgHwwzy@my z#l`a`M99d#@i3O_Qxmwx%{MO&?aQi)Xx6w!9g}}w=qbFd!=EBLCCr%gc^5_SLoM#t z8WAm@f5yP8%s%F>50K1X4oM49XPu<}WZkr3O`~Y<+<)`=!Y<=X&x?RZhWd<}iw@PZ2?GPFtOos0C-n-FBxU zhfs(5c*ZTzr!tBtt+S#7macT8P!r%%659@U7;k0 z@-kJVoABAMlcD5>bGO|YjO%G)6SBg18j8R$&##Gbz8caABHlii%+oLqj}!MKM$>bi z^UjW3o%c$)x*6=RE$zK>fj!3W{NqW69G46wAz70xNK9}eSIeFY-DqKQs9A}dhK!_# zBL&>gmxP4Ldm$c9ioF=zr2Nc*Zg^S5N$}=5;4(n~idU#ZMJaTFj*Y2^JJX=)tV&wg zrBTkhf%e@+1f3DKo^<-!ok>{xJ^$^RR(|p%`pBHp79-h7{;6q0sciSq*0yw6jQQu` z;5v}54ecoA+_Ld^k&<(JGtIWVA=iD~w$D>|KWgKPP9;EZ>VJOWAs=65=_f zl}A4bAOfG(eQS70D=xXc;u6qG7=M=rgHFpyY|t=&&8F;_+|#c@Tg-m7f3*^=^#ps4 zddzN3bCE)W%<$c{@!Vb)s?Vu0qF=bRt?d>J&0QxKT)*vdRc1J4TK()|{1g=6rqa*I z^uwrpgRqh5``34FT|XXbH4P5Vml|yfRpJkGs^~PDHRX#er``C3HD$uY5?V!%w`r8+ zb`{vgi8_`)5-4E}yA?9&)sFD4p9*7lokc72E#F09s5M)?9%w8E$M@1%3RR3O4pygM z^F?)$Kx6llvxiWTfkjIZoEfFt=_ski8s1935#cLW$YmLM-svFd&S}Y*iV)=$YuBFp zw%vbDBIG^sY&3Rq`%7!VZRU9nh1+%0&cs8Relza;nK#^Rc<16M2%OsIztPrE_*Q=DhtK+dqcSK#(Bz$~pN=41CHSzb=@rRS=# zJE$ar$mH|8-)n7ygJpvl6sp2FJ?Q+^=h`Y3rAB%y_vE>wT*jVY#z$ZFMl|)F5h9{y z4Z6f%KAf!zGhiCWF6Vbibm`BeIPdkyi*CKHk@FuRoporKHlDr^Txqz_O83*cr))bd za1CS7V6gk?xw8(FqwOU!d+R;?7$@S-*Rc(|oixmtwSa|>(l zpmlT>OkG10w|Iqv!8{P0=T`@)Z0cZvWwQsvKzdeo#&8J0($vJxz`@ko3V^XTa)#{7A1mR*RlJ;|gN3OT)*g2)!VwqC4h$4CwX?_lf{v~n zN*nz7@n<%_%ukdY4IK`=0SB3Zj~oLBOM9S*fj#!{9|^356V}1h$behU(8AQ#5evL+ zWn_&pwK4&!nOX^3*_;0B`_KG;nLPZ1{6(xSFn=TSUy$jfDgAB0N^7Q$Po+V zhy`-Ug2U&(d_(_+6zESl9;W}Zogu&I>`;OOhyxS>&;#ES?&r`o1b`lf0{}n|5ea}E zvA~X4U`H&lBNo^p%RiF=_RD_Cp$xF2+QE-%2S2JE{73=tBL%>ZSP(}nh$9xn5ewpw z<)6uLc;ohuUU?|P;S;`!0OV2akVmyc9w`8Mq=3Vqn2G?@QQ@eg!cj-^p$_HyXEGc* z)P9xW@PMo$0DV+A`lxX9QQ=44K}DRIIFb+yI^_C`5|RJ0@xh?ut$$R+At)4aQ6LX7 zaC8|NaOCd$i~M0o;2mXkWi|*8moIa4@j2 zHUa*NimTC~CJ()v_PDP@h5nlDfolIy6E4eJ1`b%ZTf7hu7!5)}&|nxC34(BfAgmw| zD?3os4tr>s|2r4XZ;Ej=!rHN!9=c2qYXUHI0f3dE>dL=V>7E_dm;{9DnIIC-zyAOT z+@UZyz!>lc4Oed*Di8huR)5e?2=oCwey1V-f)5EkK-zD7xQ~Or{~Ha3gdOz0V>Ac? z2Zi5gAn;$%pkVNcGN8}{`23z020O4o$7t{q^#H-q;1lH{4&nHFS_B%7gV*mgB>2G4 z{7yr`4?6xa8WM)~~4+4T8*skBw zLLi`npt;9rkOQ;%I}HXsu%X9jaQN~1LXhwiZ4N;q4?6DeX;HX1y2oiaxE$9h6xSZd z(?Y>$@bPk?2=IXw{H+Wq0(xL{hJFeKtcKY}4q&=d8*>G^p3!f?%TT&Hjl z5`0{za1iPQPT>&Tg!h>K;1DSEco}dgP7BBRa1D1NEgXC>a{ksH2Zr>xd?;MqPVgad z;5eQZ2}K^q5F8D`P0x>&fri13^C58cJ>I@Ji4O+<-{eC;&I4gVGocf#0h(V0zpn-5(R>t zzzYgza*mga!p#(pmy3d+5Xbd`f`Sky_+ZErSVO_kC+sfnd6JVdBXDz+V>(6Q+V?od zQ7F&}tf6ow?6~exD9EpEX<|q^r zi|dd`G|IpL0mc}h5m>abG48kzLXh7OV~9o}F;HU^7KJl#P!I-ZhmGJ6Lt{gfkpa?B vPzR`JZGEsh#o-&5t&*uL_Fz7Qo1fV`7}z-+&X7I`RV`gS%W@ct)W@e9>$IQ&k3~gp+X7-uy-__Z@IxFqfJ<>|I zrBY>gR#iksmO}Y-yh$oAEK0*b%M4Arw?6}bW+9*_ursuT=H{jowXk+JaikNqHgGl( zHZig@HldR?u{CoxCtzS?W8vj>a&|N^uz_~Zicwp)-DgGgSyqF6vH%6EEbVyvErU$} z-fWJIp_4~}-YC2-O){5H(((1v&(cg-;&+3sHJCUvve}XS(Inyhk#{-=ZLq~?Czxs5 z{luh)^A=8On=elP((R7g$Jd@cMmMM5_r72(*=HJQ+n4hUp($iTJ@y?Fe z&O0o=S<(F~n~h^iUlO%SaYg48woSDuUGn7sfx`|1TQ=C64mGLv0ahFJ4Oz|yV~zjo z*C5QpUcIwJ?}qW-iC33aJpU+%N{jQ}g4vikMo@O1oxiF51ADb5haX1@iqr4lUZGS6 z+5AeZKa){FaIxfp!68tCwD+(2#WP@et<>|ev3NJhA;h=|;lQf`;}(RswZoS_HIqaS-Na6-J+swLbK*C>qk@r|f<-?y z`@< z4M>VDjZ-GF0@2HD`B6n$tclA_p~ZU@ZH!q=w~RV!k zkS#MmhS@Yk)mn)AY@LxHBkO)wq=`96V{XLB;Zs{nRwv*1hH!}TAT-E_GxX})_DQgs zRjKpp<^&Xy6xC&#ayNc{kbTC77;NjR;1fKl)Hfu%?bJdQ&?_Ev02}Z!LTBFn!I;Y4 zD3z|~nItpbpfmZSNt_h#k8&s) zRh=zW#EZeG6pk57aD%8LGKiR-k~L#`(H#cOua@tDxx044_E14M{8Dx zJFMQLWwrn5odUqEZ_m!oOJe6^|GEql%$Ao%m`OQFhPc1SR9O53y=>2^M#$hAm2N;T zC2a5Ct+sbWi=ASb6nSbNTH6V8j7bU^aNc2hy(WN$gN#QnH6J zI09pQ@a(3`4d(l`5)}JhHuE*<*nTBU{gMk>!lfUoy3GCwV5%<6@iK)>214+}!x?3> zpw?V)YRI&ocmkJjfoQ+pgLA<4mSd(cDT9ML(yFLbUL=>uv=#c4b%bC$cbQ8XsxKg{ z(?U!#*SX%zu5+?@Z&Dpvb@kxY9s8gteqLIXX|WY>+D4EPfAs!Q}(bop_4Z-Goe#7ak6u9G%|7e zn`7l2?TnO6oC&n({-$99I%N}gX97A2o4=O{{`*u;H%wR*2m@QaJpq^;$DP$o-sz5a9S;D|9m8T5&atd`_+zG73fyaFQTBQGl3}1kYainCSqGmvYZ)3@kH7jw{PTr zb8pOIxhA9NMg2O%WV!ljqV7C5=R2a~Q&}RXl$;h+1iySj6Ne;yNTC2k!X-@^*#cKQ z!q#WS)dP7*grM}&SAtNHVy?YIME9)J-rdRpxE`w4_->A;N#nz6j@A(itxSBMd%kom zk6Ka@nBNp=o_t0aPfSy@R@>MlxwWY>{H|Y8!ykH=BPde5KM{$tfXD$FiW%0p)tyUQID+55+>yNmZ1A04lUDMmx7OH|#FQ^d(tR2+j@W%Ni#7Icp2E0M zd*$+?+#t$PDFY=ch+=$R3nx#ya;VQVq5%Qa%pr8Rocd5e!!s&~UAQU%WT>ne8;d(z%q5|eehw7bH*2!I`i*gK5j3ZbX@}&4r={N0UD%>^#HK@0dGvb}VjY=$Ja^_tO z#ii2elH$;8#>@=PiNg8fV&LBm0n(G=8vNKa7BPFjn;?ejWMn|8tvZIe)h+uSkjXiT zAv^fz;tktt0}2S=8Pz&r>jMl4AcGQ^{8QHcc33*tf`9`%YgQyCz@WBRjwb9RpC$7S z`=ZZ>L7!1Z4GTM`3=xRs<`>C1;w5+2n~yg4tD?h2qL^YQ$iLtNMoY! z*z0g44NofMg~H${YGzJ7@z=3=EnH~u;Mx?)+I!9vs1}o!d<_<3XUun1D{;Qi(+=2^ zk&JV8t0**Ii)X`w6DDRsidv0E0h&9b+{|3>>RWj%6%C!V8Ic$AGaUZB=g2{R(C=&vr!ajV?!h! z$6w@nCXe@*Y6!c69=Jx5Z9F5;ew!}O@9``+>6G1-nwWSmJVdzD{*bC7X zfHNvO4l>q|90Hx&qL@MZTa+01=aK8w4M7>yNW>!PU^hIi2=d+JP+KtU13Kd<_9j0o zb=2z2pZPUy!8MJf{o{fMXef@P4wV70!(!%=g}O6H6$L>uay2wkW8Jgz0)bdAA))v~ z>RE1RPxZBOazZ$!OBLk1i+|pCGDArhNqon=A7u1p+Ek)8QLZM(K$|Vo^vtcNhhI|2I>X0aD0z31Q3OV<{0iAT?GrgA)MIl2&>ettVN zl@Du2r9;JNxpb^AKjk!qHk8+qQ2pHYoA%TENg-Oc;{_`pG;iR9(wr2QTWO0sG7Xn^24{|(l)eBUbx{87CI8ijj0w~CWadmqeU#S0D%)jmKx@4Di!wWe9=yZWpGy8sA>OVPRU z{K#=zD65}sLWXT&=hk5uRYP&l9WTSs+VzoyH3?GDV%qmfao`N3e!sw$>gD=AsVviP zhbh|#LF`m*(UmH+PSe-NA*=)r#EWkssC00iXBXhFh!m%*qhpgvip!nBVMk=tISuJG z!>)OZeXSeN8&Jd@z`&QCg)HX^cpP}~)_`l`nDXu2?q^r|1sTT3xzCw)H!&tbAAT>y zL__1~-GenMB^}v@IX$^9K}QyQM8epK1&Pd*LN~#LlM4!bt>*w>n+1hnux|f!B|URp zd47~m`eUvH&J3ZrT5jN_UC&W6AwwQJ+*9I5?FwDW9d1;6IZq@nq!GjyW* z1!57YyIigMxq^hZ^4Y4=uxw&h4pFD13rGi17jAheDJe>B#0-DCo3G2=>rIot)w@b; z&Xo=Dde9D%17htF47|`t^+!F*c?z#HGO_r-_&tP=pWfu;jAp29SaRXKn_gl z>OuatT_-Ig+QX$^FM54i!V>+?ew5fRAGJApGGDJpRh%wPBr0Yu$d%p{65sBsb*U`Q zigg>cs+T?p@U>prd*|Q_&uW`)$;>hx$C#SWi=^%AAzjiB0TD24 zi_XRLIxmY@1o;Q1kkJFF6$GO+Jp|RW3n&Tdwk6Ykb1~brBghbE^ zut6_9mLR#pTHFn5efgigi&A%Z+yUwJR~@)G5K4Ai$mPjt(+?#qJ)d02*XzeBfPv;r z=qrk@6=fVMsq&SI*@e>}=zH^3wU-GjjIq>rsnXbO1o96_4AqlsRNo>=?{DE2_!Tqo zC!k-j@|u0hJDXlX^X-<+)*2^e^49jR7bz#9q-j0ayD$32-^d1PJ|awP#2N?XKOx$e z1K6W8R9g$uoz{2lXD_{0hA<9=aZ$6O|FSV3?~u%6)0SRcZkUaZUY|D5CPX*dI(+8> zUmKVzG`D;Zg?rqs&L_oy1{V+Y zHOaIkjwD&^6C`E(qkGkUVdbyO#*~aNTA-n=>LHCLOHPNim}+zMx6q_)sA@mX#@Y{W3fip08v?X#t;dab5>MOB4VEr;wYBi7AermEKJJwsD0F;l z9c|AeKe{0Ys!#Er?#KOmUUu<+daU8c@pbWi+Izpf9S3qwzd}OOy;vU65O}~y{ou2E zza!+0E$YgW_SP2Q43gL-vqA<#8ibElrE!M#gb2jz-o*kL28o4PS?!@Js0{2Mx;JTQ zrb~>5W*YWasB2f@S@P^=GxB|Hb215?!hZF~*Uzl3%ID~X1(CG)lg&ptNl&VVi=(7z z{~fmMmxk3^KR|b;)OPZlcyfgP1ZejQf~>;qc_J{qOZ1O!I)t69>o)xo+zSSvhwck9 z?WjBU|DH5Q(}^+@u>E80|06Cl{KL}!FL;@m_5Z=kHcsoJ@L$z> zb=%cl5+2&LdiPTi**P^1d*hN^*%L9L=oXn(!jvQ?x$jmVN(k!udgffe8JAC;1e9}V%O6!F;rigCo)W3bmgdAAkpZx?C0>Zx^ zmrLK`+!T!k$cOeU$!?zs5)~4mDU>Obp?4hX(tV!u&nrwxY0qRD&ekkjusgoqhpt~5 zF=C7zP=iCvPC7fQhXgV#Fb5M#%HRQ!phes?b2_+Bt<>=S8-Ch@mJYPY6bYMC)Ktpx zS{^nBIL=0h`(s62=cZ5RmDwhYqbLc+9`P9FE-8tRA^{|)#*sx z6HLVXM(HKm7&SyPt`*hfh%b#6K~`n*#jat1uVU$I1=-F#?M=Ijqh zXJ!coH50LYA?!nzC2Ek=q>dMvU|$J58`Q*7#!OgnQ|B{Tzs0N>eHL1bYobY+zL80K0)UFinVKbRo`Bs3SN> z3AGS4*0=_VuEq>hNPQMnE8hg{sXojX!=I!BakdIrQ7YN|w@NDVJOfJ&HF-hevA^y7 zh~04T0nVsFYO6YabhvYJ^h6D{HdyJR0;>Uz8g=OqR1|-uafX|&_5%7DYaNBMeXhq* zSsH*d7mV=)V+@ojWn}+C16l~_M5B(0bfRu!oP8v=Bjps&LcD!jeW^fVoe#PMI#&d2 z!b3FOT4@M^M~W~6udy}>E{3M#%@k!2AX2GR=_Nwgjpt?7o&Cij06x0l>Q1*STD5cLeTJ2G&PDq3=kpy5Q|$7Z2;{fUHe@V^3!&i$ZM z*H>+5ja4N;!*OAnl0Z&72Y-axuDrs^al$zN^Ve!11dZFQME$IUvG?Cws4OR=F(H4u zwocd5!b3#Ezz{WpB_d0Xd)eeS9#8a9n zO2Kz&H0?yHOXth(h-q+I=oe7mVyFFBvx&+91I;1nACVLl|Ac@LS??8|#p{3wC5_sw z)-=B2QLo^AVuyi_^Gq%(;*C_g0H133*AT-090&I+;16-Q28mYm()49eoA=Zr9H>AP zqLs*h`cNox{079JF;x;YstHpLZJYlz=(~`jp5GeK6dkp=W-$yvGHHa~z>FCRbd|Vg z)-=M=v_XJB>JBKJBA9)>%M+7Fw)S}i{k}x)vnEA0*YJxl1?+ls%T{pr^CgE85 zPk=}N1~}LSN-OFdLLOFz4RH*oMDZvbY=SdllG=iU&~1|+HDtxOUX=ut$#k~qFiRD) zST!9eOOduuEY9I#%i2Sj!ucWI80%Mp1}P7Eql^@Lvce?f6U!Z|({UoFm37haRfVS>h5JR7$GbM}tj8d}Zl+EqpLdgFo2nb#{&}yjh!*hJOl^uReT;w_ zq*29mG9*GIo<4)N8%at8P%&&R7^tz56Ea4fkFsbg}!pIbT9RjEy>fYxSK zqqPu030`7R!?BUFyJ$o;8(o^283F^*wpZM?F0qzZlYz1bE{Oh|m;v_PQxz}K6G_7pHi6a(RdxUV0(y_wQgWVb z95vFai6`@YzRr9?xb5x?TkfH`Ue12Osm0iEz`{PHvG|-j^t^15ZSt^aX+bxn{ig zHgt>3oNC9Hla1@c9_lyar`63tV2(-oV>L5hoygNwQW{=;KMxC=Jv;8lkqkaJ1jr?CHp{D8UaIQ zW;#|})>D`d1ix;3M|xUv1YEI87V8GJK~Ocd1`)|uhrve*^5j*>M5W$Xx`DdG(D{}^ zM)|xgo>N`)s|z*_U&?|=8Z=eI(TLA&hnB#$(~|gRIm!hI@=?t@;fM_$w(IJquA3A^ zP1e(}Jvx?-%xwF7eVJSps^^M$Ea9;p^0e|@y}9bS^r5rnoUqae6O%~0HPP)m{x~V4 z971H~z;(5$^|F&X5y(TC>q#;L;VBIFr!@yUaAzlRLl8~E6~Gv@tf z4^vjpn&iXj@>><89uRxrfWhabospe}AC)NkrKMcGZtLcAA9$Slh}IlIWq;#eP6i;j zpW<5~Pa4|Sedcg2AfWaB{QfoDSVDhNR9D4o)^i5uaUk5++7UdAzEPQxAN)%tEwQ2< zU+Mz`punH(o+6T^J9(SJMzhfC+cH!ept^i+u^Y-mf=1yx@{q^zTbUA9Doh2(5#^|O zqy030Zs?&s6bU@2A(;7R`y)-eB}{7-k0h364p(N#}ha*JV2b@G4j1yeU>ePrLEE!mF|Fdr=g80i@iA zSzz`(XsskS_O#U(0w*|jTCHwVr(cRiYD2D_(?+tfdU*vRcij<(0F8HFo}wy#vX!4T(cE{vU_^od|9LsQg3W2FGifLwt*y1mgn{BR$aN!-$mL+*n%dE|wXCjGtD zYvoX3SvY5b#bSFrL+JB@Km*$#19M%9@2CCq6s@>%A(UG6EqZFv@GbMYTenk z^MGd2EPpm6QOb_?ddZK*Jud77M)ZaR0N7PQ$(H?qz{>V1>fjbXWrP?O<{e!_%7 zDXCfp$tdDGo4as2N48~{8GOlO7+wb;U~dthWE&gGy>8+4@|X6&I1Fth@hDW zAslejq1Fj;(@7)| z+)k}-q2)XLzzQEg#-2vQd*Qw^%Eg|(@&7J6u|tb{##J4_ z=5^!~C{q;3czyFK+gAG~{gTObkc?AFQ(rPu$N8 zEoX+m{TX9+;P9I}Nj?6uH>AX=*Z+FcN8fz!SG&33LO0GD3Zz5UJ|ykTj$Vq01@dk# zo%hgJ9#Z-pwn{!R3FYq zc(?klj3*Rg_7XF;E9_gp&x-?*EP^+D4LE}mj-W8Rc;b0uRWmo~uXy%<+{&GCYs;0m z`&xt6#GAdULB^+}zAOuy?sY5>qqdF~mHu!FNePGB#ZUR>e#e*hlPLW^0h-~zsx$wK zOaFg@(Ek*$|67D+WM*aiPY4~Ov2MG;j_h+?vttB%VJ;HcemLboCV)O_9XHa;8x0vy zY1+YZ`kOOxP4=sp&!s$4B(lCM0f}Ue!6hg;*3 zMFnR_A}4Yr1^GMRwnvQ-Jy*@|3oQzc{{yg1{J4$(XS7f~GV@Y$Z-$suB?F2gQJO>o zERHQ~F>|}!7qGC0;ADPQy_t1ZcTQ*fHN5I;NwQ2CIng`Y-p;nCGD#iV2%YxkLXAr* z(TlwKF7`09|iljw15tj7DA&bU*pb-XM{VL zVNogYvUEyqoSd3;K@=-_X%h7FlLTG59;%*s;_p44t09q$m&O=SR|O5?y%R?aO9GYY z!|4~=A{LBeq2KlWV-WWyr(|`#6V35O8oxn}=O(5FWUh>jU`@7&fax+v)FJCkvCZm9 zSMTdhkWA*setRf;ZmaK@XpPQOPXK%NO{fZ+{Z5?DN=(ux&E|iTuQwGTNla16-3fqK;Z87^2z`twA=lM>r^7iWoql z(r*o9jtz6BA^}ZJslk#!CO_{5OMxw=TM?N@R4X9*7-@E2SQ#Adl%3zBB5~_}LmwL% zj2p|(`Au&RZ)V;#P7OI)aNine7*DyYE^z=F9B|+I^IvhwYSR{|A9r?a3-p%h9LZ

DbFoq zoUm*|7}dZHIa-PV4=!*l%asgWdm)3I(b%DYE;QJ-(DorM;(eo1?!!Bj~PX2WIywb)3 zS{LewZKuYG@d&7V5mb+7bA;W^^mk`8#v#H^Gsg2#VbW6Bu9JO^ zjN<0=SE3qFcSnrJ^GuO*5}YK0w0#tTt12EcW`VI9?K4Im^7WHA>`Y|13($?V}ilA0Jf8- z6iP^uFkR6)4+}oW`fDuP9MY$rcJCM5)(I{JCM#xE6Kxod679`Db6}P=*36Ez@aieME^K2MXJ>5-I*~Ps{W~sHt7u^bPTRoz)%CC=(2o~c{>6^vp92frVn@7 z+!l5?2c6Npm1}O(xb(XD4qg&4)3+KhMg@rVX~Ia&gmbq>TsA#TYZA?CwHT z=|Hjqu#IH*u`PG4X5e+XFE&+`oo>1;szEXZ=3<~8a2%C~3gPsa`TKi9E?}ok(X&4C zH{?sLinJco*RM+z ze_VWfG8700AzYOnZ9Wfq)y0kV0>$R7=KFj;QtK!_Jl#hP>hrC{n!0iAo5Gv|HWQ%S zoV_RC*A7fRo!U|kLh7(YtQEQJ%C|vEJ(o+^Ve8Juo~%D}-(ZVx*qH=oI-l;vEY@sb z%LE^p$L;8qW8#gP%0KsGKZjiTIlW&*t;9G4W2S!BnURU8hz9XgI$DVG!5?Ac{0ZM}*m;r>ZaQp& zDU}_*plEmZT$S-x-T_{`e{i!5m+}4HMTRwywsomRw4yQYaOezmfiWM+fO#K@v*HnC z+zOt5cPi$ofxMeFb5S1`1qRBS@*)ci=>P=L_+46q0&;c7H7Z>i1~8^o6?SKy->)3X zd=s!88W^X_OUhwA^-$Nw!Yubl8Q+c>e~ zZs6Iv%hfFnG%xN$$$qVV*-p;!qxKHRqT)7Fz@Uq#k&q-j{6 znN>2kymQxuPGOA3(iK_^1k(3Ge*~v_tODNt(96yIo;hu!8HjYTW(-fNv%Y z79DBaJoRmfr=)QHW6uE<{S!7ATv4`1;fFYC>uR!2LhFaePI2w7ggLNg({d3eqLbF2 zD!DKtl_b*>e(7(0uebIfLm^rCCxXgj0Ph-)M|UPL!^(=;q*}5Z?!KEJZSFCGjGy}; z^2_Pxs*V(hiM=+hNliZjUBKdt7mi-nS*Myk*78RbZzo>1=9zcJA=M9`#WCF1{XZZ=v5IM#2sHlpHuAm;m3)iq*JgX) zjda%>H&oU|9XD)+oGw)E9;9H$hw}q|b+aMqX=k2H4Ds&DzRxr38a4Y|L^(S_UH$|< zv>QKG&2k(&9OVV;)Yi_f*-v^C$Jsm0{5o-KPTc{HfK#{9v+e;S1DIb>t$uK{y{b(t zUS4G#*Bt;PJp6LgIF~h@{sHEDDOqS18Z5uv&-XL@VpS&D|6-l`k3R9=*LnZD(!=m? z>c#&FLFE5+splVA<$t?QWn$*|&vN)G&2`6hQDmQEwaN80EqHWL|5oldBC{^5iF%S> zDVlb5`pBpW@j#&dij8{va+?4E50k%fru3yMB@_bWrqhwMn;b&vwi#WuS$+n_J;C_m zqou1W&pZ9Q4?2WF*3{xAwc>a0OAQllxm$zZCzmo6|6551A)u#gi4sPzs(P78W*agg z_NZ*0QdR{A^2NO?lZV5uL#0buZLwOndFredXYK0rv4(lwE!$WEHF#)rPQ*j0EQuOG zFJ6#v_`zI362701V!2!*lS(R(76-d8KAEUJ)kNmv)=(K9w6R+?#9@u{ZwkruPi`yI zbojfrj4-UJS|@rq#>r~XY;43~N|+#Zt=g<2k@(g+W`z0;O$~kSJ%Ip^czx;0NPe!c z2M>-0r*tGj18Fj_RDHM@!FwIW0|D4+cvAsJwcs5J3VsOWP*Ze)2@QiEKd50@>KgpL z_c#Rdf(RKX1G#VU;54To_b>tG(GvK0%7X2?>^o{y7u_k5e<9#s;<7eBV86^-Q;${%$_$1I8U zHSS-~JQQGlriJ^fMl6kI2vsUi3ZEmB)EPWs7Psj&r(QZr0>WT~C8do{__Y3Li=RU+ zSRzA+?0;qI6^V|9f?~|L$)t>hT^bU1AaTfIA5x%I{OeN5zg(iGm(AWQ#U!^`D*sWx z@}FG7rNWz$NxQ<4F14+Py~ROWl_cqvq>Xn$qk@SRtKjG(Qd)wBk2R%AF9ipJ=#09OS^Xsq-#a>pr$Ym7nX z3eE6<#EiWCU%mmjK?^4%;pJNoFb+go3I&HTWy@rhbN3zSIOW+}3T9jo*Ey+sBc|np zO{fq=GxovwU+YARAM4^ojJuZc;nozY)PYFz7BmSu31*zNt(NL*F?!~Lx z%Sfa}9&!nIT=Nz8SNS`2{~AGpHZk0u!bE8TRD=~4%RH?UGE{v540UjOT|+N>Q@Pba zb~6oez{aC+VAh%Kzr{D=%!1h#%cWdrqSPVAg{Bbb7pD-?66Wg6T&u}~#f7Hm+us9N z))5N@xy}kJyQgkXJka5<1;}ob1#$juMrg-KCRCNx=|J}l#xsvSEm4qe6VwB=zcC`i zYKopdPxCeOr zOZK&HwqzS#1H=(u`MX!EyUK;rqefaE3osPKRp?)x6e?tTy+w2Ta8Vj3&cUsF-~!?% zvsVCdhMYr{E#`?@2?xIs4aiYfr$P1?=He!YRy6Z5o*(|>eWLiZUu#8qis^tKiRmB^ zgYY44GoK9#x)%MQ0me06<+7D8;UKwYoymYSHbEjfd&|O$hjOj#@K&$io;(f z?81{I4>@@~mnq88>r^;zR+?zmSY`{WwzXC6T6ep&X;M5qYd#BYui;#5T9_ zf82gRTJLkeJ}_g_K~ypCd3C1!0g{!EO|WUqzzF-7r$8Aoo+A6VOo~Ho^jtL7Ef9YrNdJ0=al6{SKeCF4WT%rqc8Q7pGxWLa6%6KVU~q z71`5FHq*Ls-SU{oc3#b6{rBI!+?J|z^f(rEz;#$TzPX)&Udm=Ogz|gy_4!PA=7gh4 z%US!D%4ajKjT5qH-pk=jsKK>EJ>mqN-F8kbi88u&OLs@Puhy2TrP{VNL{qufps^AS zq)N?Vwe{6v_uyTqE^IT+ZzWc$`ahe4@O>uh8;y-esn$||)!{mA6%ZtoBcJ6slr5@N zNf(Xru?|SRm$9QgRc?>^!F+fN44hC5?@R)?O1V>q`%{{%XPvlbO&9Fwk>F}F5kA^H zO6NAKb_+UcMize{_sgj$Sf5pXvAQTBxJW4QTDL#hH!vi|S%RfxcX)Ob$y-i3KUlw$ zZxJv%aduQ;TaT3ds@c}l{f-YClBmNaHgTeLReOfZdVchypF>BpvL6A z?XxKTM2@r2%l>@$`q;bpSbT;%U6f_ixL%x?Kyj7&^#Fs!^WC>?(s&>-pJU8cZ*&}zP7biB7X zlA}}@-0*G_g&W#Ku5{_hPYAc*Ri5p}KA6Kp4N;6JkL=I6h*e;HehX?KyAnz+S7w$H zX)5`d$nKiFPRtTQ4Y%jiASgrME-_iaa!&OY(Co+RU^ogtnnar7#%0Lk-^TU;se>~e zw?uV+M_#1o-gPP>&{;6g7D>w?A)Qv7O8HKXC5(h=e@e@<7)~F{{BE}ORkEA#y6Azk<&+Rlp~;@} zb|+ln+ulELPoAou<{ray{1!z(%(p$%mi&rvZC9`>_2Sq9Gau|;>GE(cDCzrFkHaGROY+x^Dq zq1MepWZ*m$_IZ3GF6hxw^_ellLCLr5L$lHD)e7m5AGt)SnPCf8_^K87cta;f`-Abt zac#*v57qQ-b?GcMs2Mu&NIS|i=sx9`I@Z?I#W_p>MWYB$H5R5o(5^9TNF z9v`#Cf#Ec3los=5v#=7Rnp<(#@j#u}wM-`egn`t9pV(f2?;M`oW(~UOE==LTbId8^ zHurZq%UCmgeReGyIj_eRV3yUO@R5&8;-gf2iVF5RF66^=hV<3xBvu@C2&&5$&tr)4 zd0~?V{`0ser@njkLuB#0vzuMyPSnWni0IZ&Gsj7CVxLI43cZ=n7YAWm-5M35OpaL_ z8J&-}M?LG)xvQ1atIgf%>+N&z?qXo1p~C8PRr_;a4fJEpI0VVEdSbD>aGr?8R!`xE zul*Nphfs-#q3)ii?TkapwJ((ehtO4CZ~t+*O7(LP`uLaCcl%}CdfO2nBo-Z3_d&T# z>VeJn{6u8VlEoG3#}IlBq)-Wqs)AL?ju8$oFd59C-M z2R~hh`PQx~a~dxCy`_bhq+TMxdiOOnltzo^`mF~bW9%{FyiY2K{^EWdxae^zV#@z7 zSoJ?`ef|$t{nx&_|B=mm|JSVg&yK(UmQ@+)*%|*+O=U`b-FAH#{V%J+&Zc6DtHYbQ z!@TXSN#p@I?MXO1N)di!;7C|gD3VfeT`j*Tbv$d6E7r?ouYtpZ5Nl#zv3S+^r00J% z`sQfC-xAHZ3Ng-9A~>B#J(e73Y>()W}IpS3kB;F!6Ws}PG!rq)IhYj*Ln$J%VjVV-?kPVHdu(dsG}t?cu_kL(nq-B=2ItBc4gOPapOJW8UIMo73aHh9Eqf3>a z5n|Yej#E@6TAt?vL2#bXze}pgA2Ywd26G-og%P%SMNWU_2K;ml;mYNnrLz3dNMw0t zHUaL5&&zMK~V>DNowh4X2@TM*GXRw8d`5f9t95cNScQfppMBx(DX5Sw3&gwCSYC(8y|g> z7noq=1w5yU^s@I;6kJj2x_CJmf827%h|=Xx?AtWd4UpD#tsP`MwU`62BPKypf?ydM z#V^$8WUujQAPHy$OUyN#rA8HF04{Oh!dbJD)f$Qg%Y)Mn7o=yiQ?^*Z6wf|qTrc6a z^`8U>9ihXVW+otxm}4Bg5tjS-;5>E?TY)0#)Bx=b61DF^KZ!D22*_076Y=xCpBt;Nd0HLvk)dxW=%I zsr5x2i|C{;8{aNfC$v@-Wxa`U~>$dC2 zKH(i~QxeaYbp~&$ouBmnot%9HL`=*vxF^CT7~z_jxj5Yb9G`X4?oAPZJq*o4N9x|r z$!>PI2&N}`L?uAmt&ZHgC$9nTXR(qouICE(1fx_H3+5v*zTGSptH8(nF2=7LxS4q1y^!*>1Wdm$#=7 z{{Hka;~RQQ4xsim)@R zjv%kRp!*XPT155L5ghqgCA$SwgR^e|9&W7JMVGdZBt%SLGmx2*#%`>jJmMv%l5OaQ zCl%ik*l7&E_15E!;mh6g@tiv+YosJK^>!#M3eeDSY>_rn*XG46gPywMW}OvfRR^|h zc*|o~BTzxC2gE?oYH9{6cf#^`sJW z%IeAfcK4R+@tUY0FaWY7RnrU6c#$ui#r)CUO-GJIZaT-qvikcQU{~_>8| z4*4(aHKa>2jhcq5y8;3!g-A{d@COuBS(S}FW@3roi;iUcLQVQCa%V;6a{0Q#gkn0s zmuH>jxg=a+l<4dRu_I;SdAz$*W|E|Bj8_g`lFmH|XL^6Uca3JEe^{vPh-#!y1NwO3qF(!3jpvlGv9b?;LtUcyb< zG(5;@ULv44vv6@U z8i;Zg8@f3j9iTa2i80jMh0m3x8{sh|%xXMy>x7biLMC&h8n4u&Vv$T#JtWezwNj5y zr@M2BMFYR*QP}6UQ;BKjz-e4W2h;1-AP~|%U>O7xsgvCSlTwq=hzzt&d_a)bz|ctO zB{r4gW~}|~DcGx{|1g=1LDq_Kesg@^Kn!-X`!&%K>$TN;IJ;G8cb}IDn@L(_dC{hwpvt->Tez^op>TI7+}+*X-QC^U zxD^hCySux)ySux)Q^2LZ?$fs;?s@2lKmLb)U6Fh5Tx({oJx9(QBM&9EnoIFS;FR3z z?98^lYtZQYv`!n0v7;Jp27G$AP1MB_DQjY%P4nRZ$@ZlB$X*GWLS zDEUd#D$&XNa)M ziqz8I(f&TUh8t-Si3Rj102Ls?BfHxN21FCX9rupwo?nr@w9@@qgT-0&EGa#;eW8ZM z5zrk)Wt=4P*j-hVh;`$C_oM3sp;KkMvccN+ ztBQQGWDlJztd-74{PDCljwNm}>Mv)5vkyZd{=($R4qQmK7=!1|PN#U{Y5SfcR7fK~ zXLh#~jzJtdmIf^SS%fYSeRuDM(7!z}yi+R=+Cvm{v%>Bd0SR4Uiug z_xv=18DY)7)e26+a%lQLx7GbuHA2AXe)Xzp$bqRN{IsE-)300!%^JaLACe2M(Zh11 zfjW!kL%G&zA55P%8>j-Fb&VoQM#eR^OIDj?mlMCh1;sY?Ppqr?Th7dH5SX#brx-UZ z@&}4yuA+xGY}jqit#BgS3u+v_VOowI?VT4F?4J2KJU=`Nyf-uRU2Q+H(O-}8Xy%(} z+7dQ(wT8XcOd`kpiU1b=J|$-yy9ukUz<=0V0C8xVjS-F)a(qOs z0;2L>W%bXD`*LYTz5UcGU9ANpvG~j|cMe)vLoWl;A|c$KfxT(W@6`$h=z2{>t+`2* z!(#y~!ax!83_rS;S`>nzbbKUYPH5x>zaV=u9M5kYnp%VLEjEHW#tegY($3Pnj2EUk zSt*Qln+%R-E>#g&h)4v($Rm@$Huk8!pbq!?sU<-?IYFJ;|JX0cI-#V{>?7h>NUsh0 z^Q{i{b{BB)PdeAu`mSLM7T3?Spa%6#aWGA>%((}N#f*e)YurM##VBg|)09|J)lP4o zFw}-I5-YDnkwg_wse?LM8S=|D5B8cNtXDEH8#WWR?$R`{A5IR*pMO;d>-U+_*ng7_ z?~m936I_u>y;d^ST?j2G z0onK!9Q7xJ`rTrj4+v&yzA#q3%gnp{DwI){3nV%K?gfIfd`bn#m$YU=<9#L4;n6r8 z5QkGG@M7y&iQyxs5dnelQ};d?#<={^n)Q6u*N4nMjmsC2RqLS*>#I$Y4sCB5Pa6sJ)R7DpH_ZrL6PZ75sibbdBr^a?YJQ*ESQ(U?F3C)!+U%MJ%;j${;+O*{mE#3#41 zxQLruJMS~E=;^BP%oYGlhPK1~4YQbN`<#u7soQhJw5G5oT5y`fQNRfov@LyKFC z-G2JEs6k9I=pNXpn&yId?L+Re=d0^-F&$pB!g4Sl>aI8m-1&T1dqFzW@J<)D_D;2G z!y4hZ(zjc9ew8LZ4${63vCdO_xTB9NkBIt+uuu)+tcLEbIswcX{4WNmmL{i zHZ;-Sn34Fcu(1jgsSlbt8W!Aj%&|S0O}z`w^)BQv2W-gKW~~!Di*M3Kb@Jk(QGW(b zC}*1piFXifYsy$Ryz=DxH4Dqu)5WrrG_S0IB2V%%TQLVRY1>9)g#?!p+wKe~8;fh7 z*j0^lq?C<3F7c90&+WIO<#kgo8Cv1H3j)B7!!3p19`V4hz{N~Cw7qJ}!4~VnK8Lb? z4mUv?+KioQQwYRf)b|7RQYS|dynKASRS5E!7F7~GC618OlKDd}n|$5fHp^*G zaM)Rk`i-}rSoUd7#Drbf4%6$pc)%MUveY;6jeRRknKWIvn0WG7t?|sNEn!|IRN>fWfPZ}; zmzz$~C?#IaEzYpgFWVwfxgbpykp_Er2k+$K!L=w;qtH<)^C87$ala6-yzGm|jak0q z;u{jSev8edwTGIeiAulyZUZLqxvhq$w;86N$0~jEe1zlRY9=Kw&J(8WO&hJWT_pGs zidzu3`0hFSx1$t6(6v&4x{^*mg*Nk7#E)ig*Y}T5K{4n%OQNJvbxxP)pKjD2mPa)#D{uDUu*tkfWzqLMm_E z=77OBZS6_eAZZybqUt?mF5MkF#OTNr8M~S0p#k${9zOpD?hfgw573l)fCFosi)Pod z?Xtbaj1w=Rlo=T$b1?6EG07sSwzvvN6NP6xMPwgHLvu~}8vpr`%i2ehSuVteH)qrJ zESFNBN_=O)8mazm#l=-5h>J>it#>y8d(Soo_z%xg7U>Sws|x32*1hVkE%dXwEuJu+ z7#dQvEUAiAV1d}Q8$Z&0gdG8SIRQSeL`a(rF20IBx>XzdF5D_)XT?ajR_4LltsP+y zAM49PW9-2o@0{Du5qAvJoI)12)~*nTS9_sFN%Xyvk3DrfV>eUQ3fxDa0sBK4&&&q0 zqokd(k*dy>Fmw1fvCSSP4grR&cDW?#E=m@t?&t;H=x((Bx971$_&b1S%SVPSA1n zAYr^S3||YwdIz+$`30P%S$MBp=yLwjAKspl4oBLyuUq4i=53NB_8NCHk;`T6%G6rd z`g5Vndiv*n_iP7gurr}ErTEa7S2uG*3&8Q|hViS?i=pX5v-BC`C(QxsX-GxOK3tHr z{%UVpW{eJLzmMJ@#6R%S43!=KW^4HGc)j%hdx*UZ|1)AQGwXjB!YcT`-5!Qo2YU8h zTpTs&W~zxezgFfKJtVa#e{4NEe~&>4SJo_vcV|1!WHfE{^uYh9 zdDd@%kXA9~*GfI`uy54*Q~PX)@LgZQ=x~mZ#V6!u3r*f^ljh?+Yq}h0*XJEo`t$K8 zgYXX#lNNQMXTT3p`^2c;a4u>9g>+KKqYAMe&s_nM3cVx-$b@=emX`DK zZ?GtS*l-2~-*7DQ^SfC`BQTZuQ#e9EnN*yl%wiVecciZB%jrPia0Rnl)Wjv#3c~vM z7EJp6!(xGNiw%gVm{n#eU>MLS{nOWN=IJRZ8IRbH;KrtMAzi0`PT{!5Obiv^4`t@a z8F2!g&(DA#WY>o&10Bqq^$gD~$rFeMJC-`WvLmNkN#IEo8)hkEKXIWDec9KFGQLaE z;Jk3bF-_h$%Db~exLx6M!BC=LQ+84;-Aygaz-S;F6ZxQ7L30Wn3D zc~R=hDeP11PgI8{y*p%LNJHGv0lj1W!!@Q~r}8pD?9TUf#GwWS@YxaVk^-4uQUMqY z>53V1A*dzE$SK6XK&rTWmt_b3n!}7p@&1++$l(;<< zzklr_+&35e<^mSbArO&q2+pNkBgZe2aWtFn6%dXt_OqiYXtP5aEsi1RV_zsarFS8c zxktYwFJPgEAgt&ER&w&ADpw=t3n_JnA>}KSmVycYrFazMYf)(^5KvwSV;VO!9WI5n z**s1PYpZ3_xnrE|&uAb$AjVH`?Pf^!T)88>jRnmwW6Me*H7Y*LS%uVrv}#PswrPfl zf*m)>><*m14I`}FsKAGtv778vLjji^mM#h`V~>G^Ys9?AmV`ZvpL(xDZzOQ;@l|J@ zd~)|sKZX%jZ~R*4jMHzF)YSCE`kC%Yf$gUpr^CuEDPPYP-n=G+9FF^4P9gCK%J@Zq zIDNlh*C%mxDtjW^L^qm)fxVwZxliF+CT#oka6Q} z#QVZuDT*Y!C)z;>@bCizHVi1Ct%kAr(dj34ZSQ6OQ21iCRA?j32qS8lx){M}$>aP! z)Or-c=pWm8=HQe~^T0L-~w^fd12@pwJGo)(Q=<J1(0f!8&@ zz53y{HaEAhwf!-Fxtmyc@YIsD*2xn>Yut$9ygS>#BxyctOVGyav9I$ZwOi4R^eP3P zHd)IN!KdcHI|Y&R!%&VwLjB%AzONelt!`iaVwh|y=OdHiyR8Q|Od}qi?Io@XKEXE% z9M3d zl2Vc$DA7P%_849_76b0Dv%^P(;ke}BOSH$Pg*J-CNk4;RuqtKu(MXDi3N1rS@5p<) zV5(ELUXN5`^@zs64!jI2Po3vd#%!!uCc;Qrn8_^HUR`XLXeUf`;W_V0Y(+L<2OF!v zEn7LCldMxw8{u4#OUL2DW?Y`wh;=)7L&TP^CMtpq{O8n5#h%pwu1!fR1ZF{VD;-KH ztXGwZTS@xP3g|y$wAj&7&O%Vr;U}`_W;)-DSUTSK%+?kH)Gyi=M2k^|a6|c-zTq*h z0<9Rj)yKi8$wc=N`}+7=Laino=5*T*IZEHsE9=@wHlS z)VF>BU-MSfFtd&OW2Z>rm%su6)1gj8jBy7jV z&+w_=C|XQ6yt?;7`XP88zA-1=y+jhH0zU+7I$quB2im@}=*nuz&}p7i(1CIOywe6x zo5`M{;Bj@90bu8w+E}|;Zko!F{PW>uuv%|NCJ*aA$V7c3JEbTo;}LpnBTPN~?V_S! z53B3Q7()xy29G!t1Mb>RPe+ye}mzSE*yPl!)b60BY4` zGqu{d!uobti52`EUh*>fMuh2{lV^9Pr&zap*QTa#;PJgApsC5##RHJAlFg2l*5Oy^ zXFF{t7`F$!PY|*^n7!avf5F#1<^77Z2t&epl)bHD-)hu^6TLP~I#+M5+A%;GN`qbH zI7`SKC#njr67rfi@L)bx(=(Meb(O%hqa7irld0(@2VYLBV?U$p7sdlxlSE^NzBjOGPzxJw%wA7%gaJsVQljXrVSdeQ_mz z>(Oy}<6TK&@oQu08S1g;lH7I)_P(_F*aHAh4kNjvDy^_1>Y+oK=0Sv0NK&O9fB^Pm z-Ld}6vhDGW*Lo}EuFR)BzeA+zhvgIVIz-P9WLk>xGb54~BP)xREfdi7_A)O&90g7W z)#0TZ^iHMVGX2O!=x!V=c&WA*r$~yIB)C6}m*a9(gR!)JR;u;d2o}C_#f`0-ziAi% zL7^p+DpG9(YY<4#th@eOP}T`pT>7SIk=%D`ra5b; znOWD6uFcI6&EdJtA5!Qtxr-%fpmr(Q+#7;_9%Z^-WGS=G2Xgbfw{GkhKR-Z!(tjw( zMtv*4e?^@X{`}2~e!;sW>iu$yD2b`7a7}`tBA`3Z^2NHYR9`wzV(pG&@oYzuF$|&H z*_WbhuYE?E*G2sVS@8*%|9|l>!@pzY{sSuicd&99{%5RQcGmyiL6V@M?KnS*0NB!{ zkCqd5Vt!TGl(K>##}7VBOH)dB_@!M@F;-bGrh#?)bwo0kl@|*;OkS!t71es=Bs-OY zORcLyORJJ2KE@OZVcFx#8#viU}%y)D!|X?K|~9xi!omAAP#YDH^*{@I03zbKNq zC5Gyqb#&6vUOE&{R7WR{HC5-Cpn%+6u4CAEG@m;V|ACsRkNrzsA$eY7{L(ui$zG1F zT~W)|8kjBx;3T_I?ycKUw*Fn%0#OrmUtA71z63~*5m?^jmM*ly|AB%spg+=BI0nt) z3s&|z`j6rV5U_-GE9b&tl&dnNL_osU-eOexJ*cP$8^`=aI;n=JRS*}PHS(`cKJGOo z=!d7o7e!L1qe`GMvb-JWj!mH75mjNdaBR$>LhWe=eX6OBluTA*B;;d2q9(3hzfbRwvSPL^~e>Ygzvt{;&Aa#vb~2p>1A zmX9f&?!jAGXiHZj3At*0g#oeAC*hc1A1)`;hT1QAWkku&_-NYBg!3q(2;z-G@= z6L!xe(jWGyFh)6kb#01bjgmD=U`etpileiw!USPzl3U*%n`ufUe76i(KLFz8oaG`+ zA2t%P8^j1JyeA9jFLM%-tE@Q`_EkVFjvuiAKIlh>Vp2T`?IROg7t!Bl8%v(Xr_3U7 zY$O1npj^`>HuRyQpd#GT2+Yf3G1!ZoDUbAHB=*akBgZJZ$>~Mx7OT*Qt|u@S&PVK8DVI#rd5 z=l4<^5lW%KZXI>oal`#yX@u^e9r{(ZC}u|LvA0CZQxTWzpCkgRz`*$roRtULfG3@b zxWl3-{cHbv=kL9Ls1vCGFX!b&a!NCU@n1f|f&6P3Cc{aH!B*dvHKtUk5(Z4g5AQY@f`exq%Kfu zr^qukxgyo4Bm1#2dzT_X&=`}UlPzdUIY{pFVY9Kca`8@u{wNY^KM*~v^7)Wu2^NYm z{Q{AH3ko1PhkOhQ8q=Mp#X5C$)7_E zSp_Sfq6kt*m+n+w;zPjL9i0P)DVe%4C)obHG1th~_D&f!{vt~5FD|gB)x9ZD&X%3LfQDjTL-Vxo` zJJW<*J!#BbA{F>gNXW^c02gVU2wJ8~&5r$J9t?A&Wcq-6NQPLs*%wiXa!w%?u#Q3o zqIwNeP`dJ!I!-9?q}2-nDEzVP(V$u*W69U}Wf(*1iv+Yeu9b;)Xf8t*DPSd;l)Cq!Nfvj5f zP7_hBCi0*5$pYrqmP=%`Y$hl|Z2+^TwXvwHN?ojf$XHoia67lGyYRT1E>U-V6I@ur zVsyFVZ>~u;p(Aoz#dYOm#D)*4#2b+WbJJ}|vp9dXJ-kR^Us+##UxtzPw4UsYa^_^x z<~$w`@H3rAGHkGHgp~sO?sLL&z4NE)bJo=V;CdGwY4U1d(Bt`Tin@9ikoFcdbTc3p zW;?;;1L!C#%VD9GF>#roOa0P%)&cQlTVgIa)E~VZupq$p$ci;6xweWq)@{3R)7WC! zMxQP!tiW%m=P4 z^%mPtntdH#x%-I`-Gp@d+YG{1f`r)|XI^@!)A31>=5H!>{@lccW(7(av zAc1R5j$SMRRmYkA;G>V8Wy{+skw*ym4iRD!Qk4vHSB)BycGIbGZXOo#%{`e244iI@H4lu#eIp?}V04>_$quA{D1F@!9YqOmQoF;%2Uvv@x3UK{^c!lL8 zXDg>UCKCdxEV22?1I>}z%`?Hcwbg5m6m*|&dd+>Xzp>i9tHjPC2-YCqa^dy)NlxtK z@UxdE_@{S687gj*u^xB8jtK!T@S+1^MSNg)DYZ-t7gUK;vb4geAXYcn!{jJZ&IFM!`W@zIAp={9d$)>)##me|;4(d_rT zrnOR+4+zHDCwyq>CCx9I>PdOd|Ndd955i*22@p^#%`xrbTG(2VierLd(JMw2Oxo4x zQ<$2{-aU=0wIvtr1B}GpFrFJSGy>mC@vI4P)+d|h_>g|6f6p}4JheBJ>EkUsZGOun zmB|9D>u#U=8`aUbK*^eAeZrxGM@ADoyynWLCWCP(F*Rk&+tU$hDjI)zt#j=+EPyo* zddIl0nJh~TrV;nX1MqQp6-*gi{Hf|^1xhCH5ouRDz$dqM z#{)`xx7KUc&uos4tmWMU;P3&u`3shz$#&w~xCUEsjW7Sx;CEWD!YdcKT3mA!W*N?P z{L}BXo(`|kWpzF}S{?2_7L&3*SagZ9%NA>{`_sxR(4m;nxxJnX%=w;?Ph&Njtu;aO zqi*q6Z6DtJYoqbHmF!qEjc2EJK{GnAUn&Lg%$GHJ>7S&Xw|QeI=W?4` z8bR_kT0u;-WbXa7Z=8)QO0y3ev&Jl6Knr*38MpB{Tog-#@}?En+^TinS}os?Y51!9 ziJ)C;2_3__L3V37LkOnf^3fwMWDGji3f_JHU)9Hd8_xgoQ8uo$9ZI4}P%SD@+ z+S%$$*ZK4GUjKpjVXV{d-vE?B?PIPeU=R{QB= z9<%OO%bQyZgz$PXqJ;3Whuw*V-K7EDuW>aG3@A^~Bp;A_K2%0j-a3EIwrbQs`afT> znBIpp$rI(N1{O>RZnpkIJILv0ebn~eg3HZ>`cl=IgjTAxw)2IDZlw0-?&%jwQ74tm z5UovSjwa$W@Z1GWLpBPZaX7_}MyPe@FeBY?3rsgT0Oztt1|O^TI&=nCz)p zKRw_dlybk-s_ms#A6^h~tCY|2i{XAhCQ2{u+wizQ8`2otY#e{Xa2VN*p*k+LW21pD z+>R$)fjqF_Bw4u8E{=vAwHpJbBUAZ8ygpbtfe8J(VtaqJ706_60dnXxO12tEt~-Qs zxIfzus!*I2`f8b-aJWNxV8hAMP^0V6Y>np=vvK+w6~|1*OUULWKMw^e`;tjjg>N|# zqz<7aoMQLsI3V{U<4Dh~Qeapp@|mE~sP32E^Y%5tjJb}N?tUxC!$*zj%j$4t4~**D zC7S!ku?Qe%Gm7BJXqg_^1@754Gl8vG597B2$f-v;7L%7aRG`O2?N7oivF=Lw9W8% zm9xXIYd1p~(C38w`+;HgK6d3?S>|-HvSros*efD+Nb#RZ2$c{P2gXjfhEtw1uYciz>zZ+i`+gak0ro+pUl zRug3~fv9)hTB4ihi48SG%i#lIJy(2cfva6uak5;g>e%}3{5Xj`= z7mYnn?sPsq3Gkv&5e5~;Bs7rEp2~|#XZ|__T_{dmo_xbxpnu>z7Vj}oN5Q!!k(f@% zVcwlu%&L;BXy)SQU|bXe_ws9{7wuW1cuN)06hGf-QpA1>mL#{s6A&C0P0J1^TLFs+ z`MQ8Y-Lj(~A^HoBh8k+-P+oKpbFyUeL{jZUXc|SUDM@D1Y&J^JCag`u|F$uNW`FBW=WUR1rr8HsHs< z8pQr>q|tEBK-?;2=vm+b0mZ(<3Iq8yT!Iw_oNWdt-^xV=PAw$;n4zKNG~(O-pWvNu zM;y`Y3X2w_cBr@&dwSw2_FXG!L`KKZe%$!%FH5v&E`FsMIh?mK|8)!=CAo%4B0=hOD~B&j6bEA>X^+oY z2Je(Wn)E)0Ffo(cmrW?_?>mIP-sF$EBK#QLFEuk_Cb^tv9H@2od3ydf_6c@ps*qn& z5@ezMWBGx%n!$7kx9gA`{zgOiIWmd*7Vx^J2{IO2Io+9}I4SW__v8y0fMy2il|ESN zn2!K@LSyWq0aq6}FS$|S~FE|G}+K!!KL!AC#TC@HJP7e5s}&}(P8 zy`~E!2i>iNg@9$J4mS0z6z}qo)(!+)p2$L+(@Gp6?$C)&bKL&wt&3J~Cd-?fv?Vm& zbb#tH@y9b^YA1w`dvCrkmb^Y`dn@y9?OH_Dgtj(@)27Q)Zo5qcI_FH<=)9|lQj_sU zuTVjrQDY$vIPaAL>CgmpM%AL|IA^lUdxAKTU*Q2U%b5e!Kq0NIT{|{`*zskf)e@}6 z)llU{+or><~q)uy}?@R^ID z933plZxj81jmjO#O#V!qA^fr2KafCb6~${FvtXSJ_& zYgYZ0R}^)dPds#T2a+$LXlCqWBk^eIt|emIaZuW@44z;!UG#l-;Wf6_snWff*a*Ne z{>1%yq6pxpAv}H{&`rj+e2PW@-%ux>_GE|a> zXxeW*SlVwb<-IIk0!e+7|FKr3d463bR7eXRPy)05#leT|?zs)dX{M<;2A^s3>cSW~*vTL*w0| z*1`F9v46jDws5d8vXDlE3XYgPG6cT9SG1y{lDA?19Ec%zWkV1LO9J8jw)-_Fq|^pe zvs|wlPp*UvNM@^(<6RtPqq7RX=vue5a$}xVF5a@fe6+B$FtTQnQ%*t-sr=Y-@3%S5 zuOxT_YnFpfj4r_V4enths%SYX%^Q6N%K4hdUS3a$S_i@&AVdjV@j?`P#jg;ZjYLB3 zw>9@NiNLq>^}T#HTv{lthVQ>S&++^@3WrYWWRl!4r%;4p7=Ec*cZn}R?Q@3dhfvgE zQRl6w8#KIDS_vsWvVK=Y?!3OepEwQqeYY@jwuP@+xv9n1TJFvBvSDLKIZnF%J#95| zIoTmFBdkAqqXVc5-D6pAQ$Rz1;UcYJIngI|2+Oe_cqez~BTQ33>Wv=JbmKkAwVAcM z07aJZ{m=gHzG<7OTjHgQv^G6sl11Mq8itRDne%?<31O~v8`+XGDSlAu>s2<2rr6#q zXG~m8S*yut3SzlQ3dU(#<7T%Sr@ujKYAvY{q$xvkcBfw-;%(PfuZLMD<@4aQ6H)(p zRR@NM8UJ@KikxWl> z$D+wI6ehH?GzaVuWuGqp&cnvDv#yC!*0#f)JytwjF5a(e{F7SVjnvRC6ag2_c4_n) zH$_cVdf>dn!snmFQK)UPSl*tl(#Mb(dO11W4 zM6iDwKb3a+PTbz8YdqjHT#kY38| z@2hF77#ab)^VRDai9bH+Z%3o+fnsnCsY}*p_WlH{xLknfjKb}QXzbcrL^(iih}Y?2 zjd$Rrcf2EL#uYxV3iEb{EyTVh=RXeyid=z15rw9q^F@f(93pKtG}R#?uL8-jx53s0 zIAc0&B{ge~kG!gJMdeOzL-po9?3YRj6Qp9YEa3#jpiVnPKE7I9CpKqpw!J?j z0>ceaJl$3n)K&U#6PYWaW%MzKFb1L!pI(Cm0n~JN^I$5s@9#q&{KJOV-$CI$WwfS3 zd%mNTEq#c0KS8u}KHf&y1CjgGTK##tTe|9_6m{7L(;i^|P|w=iy0G&$W2)rIFw_Z? zw$6U5Bftq7)4=1D-CK;ejPUYIR?qwyvIcMTGaMKm*^}Bb1i_>`q3W#Xf|u>%RT;>m zSKIW>RV;IEZsDyiYtsA0uCcY5t0=z^3n;Gd`f0i#XbDtuNn^2M134*(pjG&Wt)=UB z9Dhe(7q?31(zbu?bq)a@mSJT1*vH*0hGM7-J{x1wunOAlch7HxN+&tZ-Jx3Dt^v+O z%Trsa@Fo*%i-~umXUPecd!1v&^bTI`gOJ=9n;ZKD8j=sA>oR0KYg2q7c%zQJNO%_A zT{n1~Cctd(;u?#ufo0>yzDXj=5M)ur#S}<1iA4QzSU~^JuZBfYveva)z>lKSg%S4p z#P}ZVHyoz{V(Dk7g;bL`!x4Lwh^uz<53U8gt&flJ<|g70I1j#d-sP~)!8UurB{16L zgYQi)-ZKYBc;_iOjY|!%Y=M|xW5O(KPi1AYz<;PUyXyZ~U&_X8JB)JL8@YId9(qVZ z(^%eu-Q@@u80ajDT_Kiv4nNaH`vfa(1kU_7K>Xiv%^CjpaLpP1M_h9zCIG2!D0a@|rAQ4NdF-!vXEPs}dt|R5O-EwdAOYpd?1(zTf%G52|Kl_djR3xmoQ< zfTAeHm2>;_pRn)mox9%wkM9PkwQSKKu{8r8EV^GqaNc>K1LO+nJ(D3HUDZCHB0|oK zR(L;AYMJ@|*m{QNZgm_{!3s>GreO?Cf%FKc(@h%n=EH1H4cI(R2+viPp|p{^E|ium zg(z>;+oFCBZs;h-jZ$s56dji~Q?C$@ut6G}h&%9zQ~d%y39m6>wC-Yp>K#Xl7YG-| z2xk|)yEHMU2^in4=)o8k`Igs{^{DAur)&D~H9Qryj!im1tz?!CQeouVwGhw`nLa)T z5S2P&c*3?sBmPtja*%kD=iFfRACM;bx4w>L@_q~B=OUJ=A#s>?T0r)6iegzozdW<-a4E5CI3X6A%^!!3>|+VUIgVbBzktXUdBWD>RiQswdVFOcA)U6$~H2 zfunF<+9|YbNC1s#6HG)0!pLFbxIzGr;qYBHBRQ;3l$w-*hHynUhX74+U2exKXk2br zi5oo;8m%DBBa2T?t4dG<>{jH^U%x3_p6A5m*{U$Jld$D;=5U@l<^h^;vU{ZT-j=Q1HmqfvW3yHr5JLB;GPvgO2p}_1yF^BJFX&lL#uj+`zQ9J~q zTjd%K?xVpUBRLCR|(w4i?IVb$z zHT&yGKFAT!aXL7r=af6d*B39u-K7tiJ)A&4G;`vGG`7SO-qfax{D&LZ!&;8y!e6qt z)L@@q0cyAZ@b&t2=MGRl87<$xE^Zu^$oy_zK1Kz6%})`Inaof|u%JL~{EdRiSmhQw zyb~2sE^Wdq+pna~M0!q6fu}F0BgZFEN0GcHs8PBg5OtM>1+=^YW%fG>!B-wxTH%%k zmS!>M3zfs>#4t8}-GksfGzv0+25O2a|@p9s;1 z6YD^x)k7Y(4ihC#FM&{h1!WeFW8@=mxX(c({W$<#+@C1|8r7~dCq+o>Um=m@2|9Hu zAHt9Si`p3-)WP(pKq3dfbo4$!LjS;FgjPCGR1 z0yH+1RVf-Ba=r^G7?pDn6E`9QpLzX!jxmIEsc1~=AK_v7uX`8Y4XK(rbws1zWIgv9 z*Dgi#Ak6N7P=EaEl_S1ui4NaqOo|e1cIOa{AHqMGmj@d173nRlr(a~p>=CWfp_{>! zu$Tf_IYnZ25X9DbIyr4ujFRy*I_7`Of4|;X*1z88EQ)rnh0r0WJ?cyCNNOU~oWY)+thSHsXdo!|d;eIL7lJj(rR6CBhy5y^wq^ zhJ%*cm``Y~({EHgQYoSdRK!q96~cs7V~#6+-gmEimkTq>m+MxP5BKYkTV!w_Gfw*} z!vhe0hB1VQt4!j68}r+j@Na6=qOQky{fpO-lGLri6KL(EpL#eQ*`@2uX*!d-A|VNp`MMbuQ4?q z0MMF+nvP1EP;PfWo9$!LF+}! zM&1u4L!D!A7kpw6_0+(p()fa-93XHIdt;TKs5_j;y62j}%6=TDR8<|?t~z-)*{FnQt3L_rGBbl95=E0J3{%f8-6_qVArQ2y zqOPNPoV~oXt|Nz7!+*>tS$i%&S#7CEYd%Du14$X81Fw|oFk5R@zFy?fqXcSW;;c}- zzRujCUkz~svlflLgbduCzaHWFeKuO@s^VWex6oEi+PT}euzC7CUK-iExZn6!qD>M+ z-tasPJo}K9c9z=S@Y$8LgM(B%FQ8;KqQB@hXhZINKonYd&_Up4)`{`-c*Y3D>E(LH z_P@NHxt5=(ETGQ9{7^?(J5`j-6nHUHRMKpsg%O{7j8vpMWL$f66|Q2w3Y*%;VVx-C zrM@athP0neu#VohSgg1leb5hQQ5f`tX|d+`VQwQi9u$?ZKSDV-+qIgfg5!UenG0hyxju6dp$<_#(HaFZ5o ztD_nqPUa&HyTAQr@W3Xmh#2B#d4rhaIbW;A{7~4+U4Ky1i3W#QmCvYY;PeZdQnsd* z@Y*;-FnsU+UMj~IT%1t%H4jx5nhGtPQGa37V=S)}$l6!=kady0e$Ifj>@R?*b1<%+rA5ZG?_jmdqJ> zzwwsWgT*p(4bpDY3SJv=NM(>zA6wFDqm}`cpak95S{*!`-Gvic92PI1cNvz?&2fWIQ_wNrkN^d5i^DbVHU!|n|{5ZVDXQ0798xooP zKo2P8%`N)X6`Ykxko**(!I&R+rmX@jnZQdI_J9cTKy8@;+%&r{fd+vxXMqGwyTiGf zxv_oy>Z~^fpGU=hsI)IWB9U{SNqK{c%3#FgnZQV(Sa0-P_nImucPFkRHitdqB$^IA`<=ymFS^_YUmE6+jRKSTUAe zoF{NgKj0`{x#xwd2zLw8bBiu_>A2$qS{!$osDzQPO{;*1o^hiYrd6B(bz5&8aZ*v7 z;ig5pBSh`v!iYylNNgeWo7~dUP)ujLF<^!ZxKxFm*NQjBHwTF0;M^6su?b+5S67|X zr#2ys82kQr?4C<{g3b?nyvzK~R2F$%kkzx81e;Lj>&zOXLwLA&qWg3{Je~--QNAYq z)NpHdldjivt!SpkYXbUa_BKkS29_79PC0nxX{DY<#sJ+0=?+C#)I>9ei$M{iX&V^_ z6fvDF&iuAYj*CKiCpdqR>7B7fD{7+&V>nItkz(rp} z2EsJkLx2=;yoy$VX~o{Md@pgBk8pVtVr96HCheDx^-AsziD`Z+z}_@9(<%%MifVuN z%{d0XEt?tK$dA7U(y`n@oB51Nhd0eIcb69;_>ge0h&s7e_^Pn>Iee@ETU?P#YmCZ} znGJHf+>Y6vJJj)`-IEo}k%>ojfdCR_9Sd`Yr%SMA(R;`+& z<`{#qFk@otW77s2Q@Cz6dGXL)b>Q=g(kotb$qR(G2j3lx4-5AbnP0dH7T&jrj<&|G zMg?gLI71MAilSYd^48@r*DA$EaKvA|Dwl@fX=qk`nh zYv)w#4antF)F}4!CFy=t?$`{+Rkx}#RF}o4Y0ienT~+(X#cirhv#1*+*3bThU|}M- zQrM8nwY2Kgd@rc>aEnaPR#<3*Vm;S8o&NLoJ#d z)uZ-QGGVUw8bNn*x-r(7kj)koJBTLmdK5BEp zJcjr~&;FG&%Hh9sp^67lp51@dhQ&&4Agt$2?FW0&RAs&t(v{voBkZD+nDrN@{W>#~ z%(4Fxb*)HM#BnC1hp>54-A0EQXja}rd2&fVN9G9M<*G#Ns1G?_XEJX_Gzk-H*8hBg zkgxBlvm#LIJ%%#1*iWzxg7FXRGIbt0=l2(sfK+qc47e;37l;oE5lk!`EJ-15t>{ru?_ z#*-afYzRX+41UlKoWOe5J@QFy$!Q^>vUdp!L$lAK*Hkv9B|e#&5OK-b2qoO^=rjQVOR)!n+yh2ctYk3^)4xUrtc; zf-@B<{{@otmtOtCdl*_@Dxk@ergJjI&2cAISI zJ}X~VP$1tm6^r;@(rvSBwMJwwr~*YBFh{Xt#hb)_NMLtd{T!3u@{-h(a#ZrFjVkb; zRye-f9GH+E|Bd|78flbzmP`SzZBx*o`oQ>#Jj9dgF@9AT`~kP`Cqis`UAXg!((q*k z^|MFt4ABmJ!UM2si39zfO+hTlOrAcOo{WpH{&q4Xx?*=0shi>RRn2jv@m0;?_y{@u z^gUh&UFSqI5AiU@kb-d`y3}zPbxg8R#(}f6&em()yKT>bkwof;JQ@HE zl}HCj9atr5N@f*(sLvk1+y@6|=sA)hvAg&D+tb%euC#0_Gmxmw# zgpIiK#IRo(^Bypk^zB=2W%yA&iC%Cq08A|pnf+Fiyhd~4rMgaiaW`SEl ze2L0Ymd!RoVi43Hg^#Y&mu_Z3R}v0YK`C=Q+=)D)b>_UT%LP*~VbC(qsb1cqZK06l z;l@MQ!Rwsri4F`WVM{Yhqa;Q;1&aovCE&Y|o@S`&6aw3$nqL?Bgwnh*ijxO3nmFm; zzv()PbtVaBEy9FjnBTP~HNrzHBoG$3WynHF!=inr^8&vnObb5HhgC*?4eVY5dp8nb z&>FO@I&#-53KuI3IFZdsq2Q6DDgf?R9LfLH z7PPG)U1)~GWT2_IJ-BhA+Q z_AIl>_e>2fMns~8%2`NPx6+i(mcDG8a-NTUvzgCXv$iOiJib!pIC3B|qNvo)PIxZm6!xkxJll?(TMzHmOkZ3+Z^2?j_yEcRgOoxIjn+6M2 zsp8KeWDKFS^WH@!a&C=w^~_#|~6Tg!1_&hQ>!Xk&70MhW?#yD6w<9#E$XBspU|@syEK z?UuEI`v)xfgX#*FiAmK0>}U~!m-q7Q2x3_SgygG5i!{In$6FJL3cwe&%qP!lt3rm0 zHy95n&1^?t%t#=ChLZRZz&r3Ba=7q;aadm9)frQg4(;ub7mggvzks8EroiRy5*(*~ z5M3U_Iy5Apg*)Qs{?O}IY7F;4Xoa=*LW8HljbvT5U2NA{?VIOj-8@3SQ^)C*=GU#_ z&30>0uE4Ot4eWRKCMZXJc6gjOW9^heXcAPz3saG&-$R)bxpaSsjAsA*Cd>81^{(8~ zyG506O8K*JzI1l_%&4wf^a39ktZJ5Y{>mFEpv%uD&g_c!{r5}_`^A|-g{OAVMZ47+ zp0tNGb5Opax{%UJXjArz-V@@@;?5G#DUpoAmSrZW9=Y{>0gbSw}C5A8WsCv8YeQ{nEAr z?)7<_&U6H3U)49aJbXE z`2;HIa6-XhvOSd%$xc@7t*<_A83Hk$9@q4q>u%jE#`g{I zcdW^`)oY!efQ_8qE>292RO^m`ikpTyWA0`6N^y(`mytOF$6qDz5`32v>#nbJ@0_xJ zLes06TM--1&-R3q$~8nkbm4dqJG$`+G>orgn1AuXm-{sso;RP#o~}T;1X;ct6Zebr zDgJOhwS^~-H1T(jn%S6Z#RFYvHs)x@$WV?>lGmr&6`uUGU{P~$)N&xbQMKaCbuBR& z2`Kqo)vdD(ODhkBANe!QQ%egV%i{jo*(tnY4BOe+?m2QL)jG7wrvQOYs?wtUvb8Pz z&SuepjTPT1UX zqdiPD52#V4sKqtor8Vj7qUbyh)t(FO5BcxD9)ztQbDt0Fzk9~8YBsfIr-$L+kIl8L zr4Em#A4oJlw$53$LVuwfx((6*6x@tMVTQLjXcW`G*|0NRhe`TWoImG-AIdC!mi>3JAAGnwqSXusccbBd8 zr4udjw}|$^7=%=Z?HaBY(KTz*lMxzuBWlQ~i@`jho`WO-Msn?T=R~=MPIs#0GQFQr zqM*=JHMgQhd*M$VN0-(M^|Uel=%Q-di*wUU_eNFeWt2E(_ zuC7;5H!oF5Y}1@+Jkg!V4k#DL_Q$ESmD=S?kCA=smMI16;I5a=C_; z^R;WjQGS|cCsI~`H5kJW??(A*j88q5C>1ZwDq{ZUJt$SIbPvfIpcAkFDIfa92a7fd zNBTXxq)BOJ4-Fuyz*0=hZ^5kS0omfZaH+5j5t{p#nwCN~(BA5)IdR*_&4xLJFlwkr z85m>a5Kv~I89x$`*Nf)nA=1f&Hdgd-wK2ZcHctI0P9d}GpDV^Y>V}-NvoLF;;2WL^ zKwpLfScQhNLPvlX$xDQ_Jq0_ZL+ZtA(|`LmU2n>fKO4Lg>{!x8=|=gchYWp;S{AMk zSDS?eW0r_4fK7V}xapVBFe5^RItK?yZPH}sk+AG{5aN#PG>1E82z;-ri3OSQ4CT|F z4~C;hM-nb-!xMk-t!vTb8(Oq)){hvT(GiG?`z5zg2;9FWa1=uPgmU(+Ul7}~ z962IfDsWCr;AQ*=k-rd%ElRs&c*^R$EJy`<6~&yM<+FhS7BkDBh7^!RV^RL1)dV(> z8dzb1zlqH<9Ae@R`|s=P$JcvMh_2jw-=aW>7ttVBQyXV+7`5me$@>`0JOLE`$^Aj- z{il&Ca3Ot`BDFfJm+n(c6HPzvvK+$RI*YyDR*qXg5VeHft@ z>gcfz3J0q)E>S3EMGMa@B-AXU(MQTeWWuC?4QXNxzw1uTz9b!jk#3HOK{?PUQ9bcj zG94b7v$IsD>ZF!YEm8So+qcwl3=b2nI}bVxcrn&LU|~lBC_YG~O%UrQ&Gg(fUU27EmwMNH z50HU1ia?i5{n4;AZ0&RfCo58$4D@smZg0;bL=}@MMg)ulFr7*qH$G&_dflKv5f2j{ zKWua1AkTY@wc8wpgThLyj|bWp37}f`L>jjzZh&FNU%9X~U1A{Wqnd$!#aU=;n9 zWq>AhEjWO|bg)z7i=xM62shB3dIz7&>}3xJFxE5{BW1}Si9Wr9ZytO)gHOAH`l9#s zuQ3*IyZt2jEICzkum_cU^nTt$P(=^wPYFFYuBv10A+0>qgFlz5KC2;EH0i*eu6Xm* zEZ1GxgN<&tQBk+4Cpzzm`PuXv0{g& z)39B>!(Sd}1I={|ABOW)d)KE<{rM8-Sr*pR{_X`-^`&Z|{NdYT)e!)v-7Kq|(DlKs z%5u2-*1ftoK%(WW>2i>C&c3rDZJ@|bSVwzfXqN*D$K-3hjR>#$x$6R5MP4&$c;w*C z`OVmTcR>Bble5NUuJW+m{A%{?*K5+2tulQ?)9Z4Rn{M4!VCD>t{Zj?uyHzl84Vg> znIMd|OxeCuD5;ia`mhRE)}Wb;R)mV@!ze8C(_^bp)Vj7>zWVT@w&2uInz-oOtmB0S zu3vWOZVV{5c-f21{qp^0`{v8GHfMCQT1OrgAitC>RO**7ShBqg>ZE^(Lo5sZiBPdl zqDie!BT?k5PCKSXjqm`a5)FK=zxDhU`E0M_sP_1%TR1IU3)^#A>zS3En=id_<(~lY zXx@;Y{i~JztzL;=W0REXSX3X+&@*cvD5xYV2A`Bo!$0>BFnq>ygrK^hFCO+I0-+vA z&b(>I8b5@OG@lF0pcLd!c}uOhpe)E#3-XYUq8%j^{_>+EE!{~R8&*59?`irZJPaGt zu^cBj+oSk*Sm#ETci1g7{HF(zKL&dR>bdPTm@tpCu72pc9d_e6K7n)U$wLT*h*ZW7 z5aYt!JXh2koWCDz2EcdR?2Q_o`$e&hTK(r4Wil@nl9cO~G}jd869dz8o~6nhsxmwe zJ!pSaZYo|`ay^{8_E6dAeFmPM0`mktxg3y`))NNChTvgV9-s?(*=dd8qGk8-;B;EA zFqX>N(Ha)jvTj-kHD_UHPm+WOddc_@Ua;&T#-}iBqLSg$uOy3m{}2MI60Q6W0N&Z; zn~!XORb3x5jn^A!uoco2vq`x7PzQyT`H}zZy$t6_aJ)dFiymtbW>RowmW|r$BPqTw zv1i^!-`?)8#D9s7IZTdo5zN^GtI{PB*TFM}Yo?r;`0{aot2E|r!P437glYCZKX-+o zTpkAP>3X}d^6Y^<5}&Kg&c7l^UxSC|lyF|y#n+wQS30v6V6&s#JfLE#B!m^kzq0iN z3_I21%5WlRrRj31rYhRfrxvXE)BU8|Hwc=eq2sq?w6KBKMn)si{?6xt76UW8tr`{Fx4h=}XA zunlnueyFv9bH>V`tUv>m{C$BB4^J>vyitIs!`fZV97TkB)QLtTOUlEZ(HZ1|YxO-h{IWoH7)4)gY7=)}k$M?>C~Hz=-RhYKmjC zuw!M?*U`_@H;Uhkm!kW4X_edR-fq9-b{aZaP!UOZuJ{Q8IZ91#rG0R&I+J5Un8A!e zp4~qMfSNDeOaea2^Q1*hcFb2Xpm@yU8lKG*pym|YvY)fhD#wH8vm=7)b+5{6*N*ao zD5mx?o&h5K$aNfB(Sw zSUeXi1Xf6#YO7w4q{%U3*m9p0;5YYw$c@TPjnXJG!6pmQsKGd%7}`PiquZlY^Pt8@ zk9eVJ{B$BRzTMdK`@@cI<^Qr{A6CNOokkpIM3veC8?hrEAu}%{kMI*YhN{~6KsrSDl2DUljbIB`~kM4?%tnOxDUbe1&9gjYT*^UzZI zn08J{2O^xJ!K@puA_aGCn~+9Ljl0eCW$p{Qm=t%Vo;kFGu|=Gwm=LK_DS@SqPR=0% z!~_boW05eDkO+4sswTGHWFnf3VLjCA9!#KBR!E9uU0kTd6$h~hdlj<|K>Tve)BtsW zQkK~n;uJGIc0fN=A{5g1Hv$jmB37Z7A{MMA_57k1afA?PX^3F2SE*u2ULy&1*>5Rk zni&0KvB=u0p3_cuFHtI^no=aE*kXGjxdR_ziFd{;W^ttjdk?lP zA+vqixz3yf0g8ZqqT`I?5}eNGiAQqsOw1?KI~`6(ja4$Zy{DxK5Q2EzY?~&F^q;5A zBzU6=>*2~r5*{`e64CiwL`NMcMmJ-!Ax%!l%)}zx2gM?EINj zh(*Z?vlbDJNIW;MSi%)9T3MW+X{{RX(nKr_yU-{7^jSGndAatO4A>$?WW2I4F}Zya znn?Ud9+{Xc+-&K76$?2b&MD<{BeciSre)g+gH!cFyjMYi6668!NHIw+X~OjwkoXp% zbX+tKWm9R6`6NG^6v<^uRD9`lb!r3xN?KRwW^rsi@h`gkRE1b>!qYJn#|vn!zdSMy zmj@HgC5L5B>w5K3EjDes!cA^X!Ip;^3bG=HbvJH`ca>+_n;9mstAa@p zu8m>ZD1I~px~|+bmCTz9-XYzCsTYJeD`OzY;-VhySu8IU#dUzCs#uNB zPJtM+ONeTsI>-g|bM+B0-Gs}>SorUM!;3K); zHBT`ys{J*vWh#S2{T}2DQ%?BNh=@!io|Q)??h5D436wiWpV`|d?&SyJvAsFoc=OZ$ zAepu5jYmNoyj+dLMI^b^7tX#BzW!h|Tu{n!ih+4z9Q&{lw^}%e$HBHqhDoc6=qrH% zqqf7cm%j-1oELUt4NZ$lyWT@DvCWnJt`Y@<+EHw$q~PugtTwyrc*OEns2UQ8_- zRoHd~j{Y5Uwu@T3tx?_jrR>Va7aJz_DM z|1=FED(~pUMEtd035bR0PQYxw-~XEZp50z1EcsJ&E@>0rw@Nz5d-49p{5yQ9O6da; zhl2$F#2mcWM7_av^S@>fQiJ1_0l2*MpHLOA868YM`#x6$Zc_?3#keeIY)L*L=P+&+ zAn~mcHmC}7wW+sOMANtu*-iRMV_t2%OEL4%u!L)q9Z@-;fi6s}v;tb*>XN z98?fT!+1FNQmB?8hVxhLo2hM7!zg5yHtmXr43%6#b~@t~2qovLWV$@`NIcZHMqpO4 zKTfADpI@5Az4@WUn)gq30kBOrB*??&{dU-=gV8hMTJ2F_&SVsAq@2Nn0eLYLYnt(^ zgiOh;T^cm2E+{Qz+6Mzu)u~x`Y+9RUcliE%8v54e7fziVWodPGSi81gRW_>$YOqhB*K| z$DmjYg685ut%_u#Q!1UZ52s|L*&AU=WK!5yKiMp1e-Z0p*X+-nvJnoU z83I>&JA45z=Nev&A{s%wHy}I;o|P9vz2>3tnv^Zl^eZVF3{Nt9TI+!1Yia-dGQIW@ z<1eAH945ppFQt$A<+?!pADfH}e+joqDDrit$1Jj4fvyOtu5yR_nws?VUn}HO;U_7q z`MBQz^YMVh?_saR2PY`sUx&X|-Ps8!pba6O5MT3*#3;UWraCq&4euE3G;;(+fx^gP zERF(9X)wwmgnwiN*(|Lma>MuAW64>&Db4V{{SHs$%#Mo>H=EIl%8hJ;Rr|p4_3nn7 zI=_A=)dKOKcOO(f2#+oT_%>)0&L=0I&Fi;agIDa#f&9xWo!kyfyKa7K?Au#YYyUpN zP~VLg1QW)M{I)^aTMPK7=iLG52S=X94E@}wmXCJLs0sZ)jK*nX?(`?Jxiz1OKr<|{ zLj>$^NChg-R=8Ulc7(Ry6!>r2!)})$PawtF1J_!(mE8@igQjIzV6x8_`g1b|vNMie zXSYE!u!&<2;$@pcISAH~9PSTiosBo#3Zpz~<`+CArz9t3nA(5Z8tkpI%N#)Kn!FAI zTPPpTqYPffz?YuZg7W-{+M>zGUFL=Ivt59A_1b(Kx&69kIw|wb;LKvo^z9kJe?>@y z&dpOBAYqTCOOyF*tpJTpl}IR|C}E&9D$x7pVcy~L3FKFu+4lHQYr$o{WBUea&B^VH zl=h{p`ooY9_-43Mfha~Mf3JaLQC`Kk#ME}bRFBp0 z+K0etplr?C#z4nWcXj6Pcxp-uma$3XlEuuxah~vePTVlttO!+*AG#H@OAD8?*MpbM z*zElm?IQ>xSj-2jcXo^Cx-%E4nnqyUwasrHsnfTM z?!(Y<^0U<7oVg{o+x?TYEBu#(cW!m;9>4+Tp&Kkz&KD$5s&aliRU`q;9cR)V+z{l; zSi!A$q5<0+4NZv@ROS6E>{25&>%s`jEK#jh@#3m0Qyh`P^tP`9Vx3-Z`yDMBEO|wF zI!`U8DbDKG@Xr!D>@k|sHqT(7S}{I&Hn@x#q@_qfBzjePWDqzNM388irx`{L+D+P& zFac|}`h7wy8&k8FIXs9WkxfEs);g$L5X5-jfHiI6z?c4e8jEDXW=CEM%(CueXWd=^+| zOKCF>;@8SylJQGS3l6T+o6hg!@_oPbuw^QR>AI@Zl%Kw*jg3Cv!??2BQ_N>- za6i+oal^I}xH9B%;_x|F4A3I$2I&aSAMoBngBD`A^6QEfKh)UApMH1_@Yr?=QE!3m z{MlHEPoy~rdH|NJFNQ}TOVDTOOc8P5q4_2y5rvDm*9{pD$-z=}RWV?wV{_Fr2^-iZ zw%i>1`}f6Nu>Bb-y^%FBuTN&a42x}MKulq)es!gAQ$hUCSTBJoo*h#587t7Rc)z!O zqVy8rqN?JgFHI$|FwqVg+e-RY8a>DPVE%XDinr$N*=t3({_F=x4cN!0a1eIBtGu-Q z>Y)Z(aR;FjmB=)KQS9+m&ip>_g#0NKbK08J?hU@ZtHm1H2xXY<{;HwbH2^3)a%HKQ z4*B_An?w)W^HIuN?|UiYF^z_CrJLDA!&2CNRBl>N)ifV1|1@-1n=`_@fNTR-FF}0! zl0(*-ut_L8)l5~GdbPfM9BCA?&z-6a$VW=Zh8a2WfC(Zl${Pny_HA- zK0od6Trp1GUDJb@k*UIQqAMHtoq7WZ2#IEudH2APxRel|Br66Xysj?%0-WKjuZZsA z%Zd)lcp_fC1P0Uwj4k}LSA4zGanJM$ay~D$ugWw*b2N{iS6}Mhh}uJQzX>%IzN}SLXbOFA%#z1 zm*0({e<|o%(UU^n#VcWr$Toqrwa?nMJz8lOJUu%|^bYbqv-NolpUZ>61x9NU7 z=d1kTeYOK`JjD=qV`*zbd6^~(n7T(Y*}L59C?{z1rV!qnYhzu)T=v_lYK!vNM(7%hW37pS<9f~*9?+a$2#EG z`PlM>oydjwWc?S|$-gv<{u4X-i%0xV!A}0gRsH|KPFOkrExJ^#t?jfSR_}ZKv)5SZ zkPvh8woIe35G7<;>fx#+R=&;v8MTfG7y_u+-7m)X>~!K`QlMVcdb(U?{GH<>$IjF9 zmC654`bT3HxSkTJZ@SmSly!I3ht1On;3kMtx^qPHagZF-{16E zm#So%$!`_*s9VX;DeRI=k{_gwq^eAkfS8X_wEOkT#^3d;h>qe6Fijd+UJ**>+XDa^ zVt#gadJf1nOaq=*bKj=S598%Yro-ciw4(Cd1ZsGco^T!@YO-&`dgw0+$hA4eAq1Iq zEaDclWd1Duh^&+EEDs{o;<^P1y`JO^x9LZMN+hvXgb1cEFCB!!6S#oT9ZJN%Y)=t? zcVe+~%|230beXtAuz01H{LnUnf%H^rZxdExjhRVjo|26C#q{HFuPlsKD#)lYnx=XV zNa&3400y(cgT{EEdCEbgqY!d@jDXw&F(MM-t!QjhkKGuL*fz7g#lxIKU!yj&4E^+S zD9o#17Jl@Xp{f=he+a}6Pr2~y~CV3b1!Mp2g@Pnkq_RbhN^r>rV0$STc zFQ&DmK$j`Mp4SNI;0cod^EBE*ipUagoQDw z&H*V@smclUwbqSKXljqPWFqA#;i~s6cxS0olLz6)C>$^|ks0j8%+6;6K#!Ttn_1@s z+mnir_mdF4LSZJIGs=R5h`kS^#|iUO<3^2)%NrTra`e&<@kB=tVOdtzX8|c$0`SE# z1w^U)fh<*!>(SE`WkbP6R7M^OXJ>R?6YgN82^7pvnVBB2EWhqs{gbg@<1>_m`3nGM zU#%ZZRFa7L7?&7*L??J#IY!}qL}63gk}*>v7#2}Ar$Oq=dskaiXOmluP@i*eRM5s8GWoRx|Z`KI1ih{Kf%d5{E> zB#CoY&1vxj7L-a1?u82(5^XqdV#SfoAPU>&DqUX{*GYkm%QH+12Q4vx9 z4Kw4RC}DS60p&X+AsdkI$w;%BQbsFpGcjc|G$gR%wb z1?wW5rkwvB-berdJwpRp6Hp5okw8XY_yZO?Haxa9OfR`exX5z_(1(sZHlhvWe+aN*KnPS|P{u1=LqC$!U$ng6lT_f_V< zQ5D!foXHUOq`xN%wFXdBBO{X57h}aj##P2!m?5^-1bhIJ>p_};m6pH8$|v*(@dR{u zD=ji+Ax)IZUUE6M<||Xh*x)o4gO=`VynQl?Q$J}cY0P>ar^Kbs|M`MM>(ICK0_G@{ zGqZ&Mm<(BR7rB7Bv-!9rMak&Z)ImdBZn8SDP`Nqwx_e|XBc`_Xbgc)jb*|h5zfso8Fd6&&- zO)gZ2siJ2ZX#^OTi(m}E;Buy}tAbL6vK|DgOGAgtlELLFR)&*mD2KNPpTlQFjs$=E zW4smvs8%wU&w?tSm!NZ2K+02?>=(G043{kr`C1%|4S^NR2~g#E6B3PDT#$h!54I{$q5%f9;6nv8O@T;&O(0zp66Y1^TEatBd~$bz$VB znWFjlupl!T#N7LSYSMr9&cwInyMl#c`~!_X%`-vr=fE;J1@ls)@2$*>V489Q(GJU@3v(>n z81~v!)jixw&1`=}zf`b0XGN^qSn%EVsp-uaWQyJd5U*QcTS6YTKoPTw&XuS-Y1M2Meu zlkAZiK~1(rHt!d#nu6I&AL7q*sQk;gTS39-TWl8|pVzCqr;oibz*K|$&fCwZLP@-} zMf&Fv-QUA+-q_|;VeQxFN86P+cB`s->X()EKRZkCDtrTvc=~W?7T;s7mDunpc~m_! zo8RhpJmPfW*E_}6^SXIegnfWERR_wgrqjRKjYiIi)W3uDKQtVU&<~QJ8J{=~VzgYV z-EV9lwp6+i*!s1%cV^L(SD`5RK8s-7zlBb5N z=wTxz&x5j{MZtewoA%!o;5NLpEV~U~*N#aetB;{*8zioXy-)(MC6#;IAoqcyj`BBG zaIQ664G8RGwpWRz1{(OPdo!5T-Fh?y{k68zMp6)*bGzRjJ~Dy?H8&LlkN2+jH(KsH zI-r|FM83VdZ0vzM?ooSqX4!6V6jUOpW8;47s^-CePJ|}}wXUoIwJc-?Cn?T^$G3ud z{;0Wx@S%Lp0{%s@@%m@6u3qxZ@HfYs!={gBb}UXf2ud@U_Q0a*cjKicBhDUO9Ub{q zY*ho==)FA^hXjq%K)}V==Uw7R3(M{sViM@!{S5-uL3w4Yxz>8tqdoPrp7NIPd`X%6 zoBT7FJqTCBvxSIi>cB-r^W~|_gb@fFiuy(A`EQtlQOiGHnbe(;M_qdk{WiUyo=+z* z3x;yccJObQOcw89F@T=Pu`qT9=FiKL%ybe3=wexMMT{^4H%#Sc)#18e7}45-CV}@u(z-(+viRkmBx&4kb*UHp0?w(p~7ju_5zo z)sim}(ahWwtLKOGh4oJhZf4Dx^E{0~u{rl-CUR>NNPT#n+Ij%~?Y>mqX?1q>D73)~ z{iB|0->&wK4y{gpj3uTjI=qS2o}K02ZGkZ5`G*BW<8C@)2bzPoVBZ=Xo=K^6;doXOZ>haY%=-ol3>u^`-IjPlCZ8`^Yj6X)cA?90+bK zpDS7Mvcw%QP7o}ZU27Rex6gMBmGdS+a`Scbm`7!S=z>1Z$cn4NOB9u;^cZDWd9*t= zc?3MGyt4Pp&R_418i@1-DL`H$+pCou$^!r{=ET9`h0nQk%U0f{Xv;u7Vra+DS5pn; zmeyf}%KSH~0qlltf=7^9GA*URC=<|X0rh!Ud|Nuc525rU73{S3Y<1I6u%2$eK9$UP zXaK!q^6mp5ha=rgM}@MG1iERm1H0Bs5gde40>5vBo1vhm!N73H;BrAEVv zbKsQgwGVn1Y<~g=f~mX`k3Uw}!%e}v%b1q(xH(uA=mga5Ph_KwjxE=ZAV2;*g!)E@ z7BhA#r{C+M;^)DJJv38~@xxtmywafgrh|X(?gpMT%*~0bPbwJP2v$D7o#9h^pV-LP zLb3e5%jFkJ*a@71L>beY^e!sn4V4P-f(OpFNKy;a1% z$cdeImSix2<~~^YGC#9`3!P~|zm*+9*qi5ox~c2^x3oOkd@dEoo;zOM_Vyd5=Lsn5 zb{D<6*aKenBwFqyGZ{g5^{=zf^`@uKdsQc>sQK(8cD$d78W!^&kb-_e$_mtEerM|> z-d*I7fR%G)^_m`ggj1qe2Y$c|e5|eyWd}W~!Yj;Yb4WZgamY!iEoQ%)x(wXl4j zZ}c_EjV6AhP5#x&$W$ws=IoCk^06@9=?DdXwhW^E}ahaR~EO? zL<50nbG}+7ww68_%opuX&OKhff9P#%2)Qqw-3hj5opmPpdul+R4dk4BdG1d;zW&?N z_zzHOLM>dNyPo94e$N{;seIy)2jcf_%+tDndQEC?x0E7;E2aS>LBQC&5PgqnpX(M* z$=Bu;N{W>|dwr%7G4f8q^Uzsc3OLVw-JQ%BNkh#WtA+93#){x6IIa-eJDs&XyG+A) zHm4^6>mClE-^HHm_`Smqusw>Ja6&AkT<25{G~V>Pyt<@*-~xh57Ux znqE?UW_=XcG|g%qt~yO`##<`+Ht-8zMG^`rqA4WJ;S6q?0zSBdk6AjuH#`FX(uxR zw*jr$$UO_-0Va8ckoWZ}%KW)s&fV;@)I(IQ@a>m=Rp2%=I)bVM{j$bY`wT;D@!>7K z^(Wh#e&~!P!+(K%{Yxb5KasD$Xwv@_V7mtwoi{sJPqp_j5fvG=NBxG?Yq`e#G_Z z^0>R!Y0UaT(xVFwBBuoNm_@1HSR%b6zvGD*lGX?Ff@OWc4u8V!g?GXJx!(z|{tJ8I z{rIzgoNi)>+Azcwe)~)m=aE>S9+3=<)W2VV;M;23p{iQ1t*dUbQT22<>&j2}XK*c+ zYfJ=x*mCcrq;=r}FhL5B!dMr*&@icl6 z*Me|tKm$C!R_JGi@{Z0Th#uzAKR?=5&j3?w0JMi%P}VO~4}cN95Wp&;PWA;%4FKHK z5HRCz3PO0IIZ0^1Jgj-O6d+hKaT<7{m!gfK2L($;-|2QO(xrc0Iv`UIeIs%b00ClT z&x1onVwb?OT^R*Db>FxN{y{g+Q1KYPzz~H+ z`~X1-au;|+4CdruWF*d+(3pyV)$>v_e~FT|z

KsD9+dVe0zp+1a7b*q$H2B|MkS3L)AQwyvwYniqKs*8>9 z#2zpv{WLk0N$qMxLV8YtY8u8zIWf{d|2~#Pn8~<9fR0J*P@Dj}JYq466epk7b65ox z;ucnsF>Z=`iVp@5mWxI6Jx(qh&d4FXlXrCq#Uh%yR*uuLBmmMnMiNzePB* ziOFfe<9Swl+e$+RrNS54XR+W_eou*lV_g%kEpv6DK{jC zDi5S6<(E#Jgp}0zd|pB~PSf}3-K?{$ZkCDaQV#r6=>`M#H0J_jq`*|-wHN`}6KV5G z9v`Z@d5^Tjvz*-7*uND=axQYYnTN3tZBQO(r%rsFVt_BD>#qu>WB(=R;M$EW)j+cG z4w*9F-_Vz36s1aRrCilXxUb$RFI*7}%_fO75xQV#tgt#6jqy@MSTQryx2lQ4Bk{~; zpzuL=f8gvz=VLUH%~|%@m9vhip3EM@Q7(w9fWnRF<3!~gU?o+pj{P0ZP>)xcC621@ z;-lt@1@#>GEypmw)af}t00UgS^D{~-(s?a_e7&y_J~%~bL>-$Bn9Ko32PvJLgUp+s zGm%T#kWZIa8vIALTlo9_81&Er+!mJ|6~I0DA4U7WgXQRjuTgd*cUbic2#=Rqx&6bL z#WVx6l2d-q*4EMD#p}Bk=44(Zam*I(?}a0lFd3YK$W+$ zvis)`ZtshU0t@F6S6vtVWXNV)Zndf_7j~5+v=5J2Sw#F-vxXgvsYq)i9q$((kKado zmydUskJ7I9cc9&H^fK@jrn6fgbO^wNI5ni57@7ddrVw032=UELAZIu7nlmeim-asZJp=agiY<6Y*@H) z$^1@HV%y5nS@EMMM;{GxvTm=|23Eu7kw1pmy0RVH;4zQ!Vo^Q}csb;^+he3|GYw{| z$30}#`Af1=Kb{-c=@?oBY2P>lBjflX;bepOec2sH=BvN4vcM-twkmL{y^tjG(T?of zY;B8A&q`?`7Psx`#c*v7x|#s=QSztV3OP;GmhE}sO@5^U|E%LmQxKivs@95)8$$-C zY#zI4%WK=J9VCRdeN)J2uh{T0_fu_obG*V9a0}q&jAalOq7tInw#n$`v&;0nraEQ; z*{O>l@{T^uk6QKaJJ_TpA$*FbCF@CRSeO0B?pfremNL&Kf>)V&5L!}*ibA2<>w^&Q z1SNMI+2WH7&lqx~h)c_L^cAhj=236W%i$3G0lkW14o)RlDH`T*2{xgeg zJb62!!MEwXaY=d$^=6;sqM2Dl#__@|=JAV;!mTnODm1phI?9pYk*>VSXxxCtQ#4}g#7AHtUE zcX$JXYrv9SNb#OOe~KFX4CR^qI67TSb)0BoiFYwI+vD`+@pS+UI1l&R=64vi0MsgN zq5l_k?-(Unl)ihWZB^Q?%u3s~ZQIUD+pes%ZQHg{Y1_7LRCnLIdS-go>iIP5A0Hw< z#MyB+W9{?q_xU}g&j+HftMJ3s&2p^(8|0r^*G5p;rHmxbvARiJ4VjP0`|G5ysIXwZ zLbKk3XW@yvhx3G-D_5$6K;C^oE-=cB=;t-_*3wE@Q5KwE8Jv*j0IhtFjNpwCQUFAI~ui>TZG{)pF@CM;@o>=Lz@cm8dI@!xBkmUKN zlOX1SyZ4rW5 z>1t63YbgP`)LlH!=gWKY_7@1DGW>to=>8`L3)4RtD9S(WP3Yte%uMJMO`Pmp9F0tz zxVh=%9qo*iOq>a|=;Vb(3F(wg+yPu02^+v=g8%vy`q!rf0K;cz>kKF(%0T!x4PTK? zl#%eC$H$^fg#Sbai!u}b<8Hiw7vN@&CbrIm|6dp^O#dB&g^}&wCBe}eYqsm`ebPLJ(!+T$;r>MOCoS8OZ77N;&!Ru^|_KEEh4v1u*Kc`YW-=hDdN(j&q`})Y%2atSE31;q( zniEX4#a-JYNPVV$D|4D83{piJA;dPX9iQtgEy)bpPBfLaHEpUHEp@kj1l51cNMIak zV=#$bjYIa!)-6yi-ApK&Qlu6_#~zthXl1hMCE3SM!xWO@T=iV>XO3wj4gl^YLL6rKr1U~UXw-@a!fnc5$p2+ zKq^Dr!3=gL2ZXU0%E*(4L)?f~joa$LH|RIgM(Z*BTq@j?;jS>&Flht+{A&VolN!i1 z_@FlHEm7vhX_3tC4TLj~Mp>ban)cc=NgyBKt9jd{q^rb7A~Qq(y8h=jH^gequ>NIb z0kPXP8q{8KR?&q#^-Wm}4;>EUT7+wu0<_I*$BoSlt4DUP5t$wDDa2EdjaN733OO&=2h$hcQ20p&@@HMufJOYgMocu?Va}m?}k4 zRd71zYjfa1xagnwe=K_)O512!7MK=IrixSIu?}&l_T`Z_1n4SQ^3Bc|&8xtmtH9(U zx2JL??6DuT!L<~%OW=bEvn|;K1sb&k2Ezhb5x^Sp?jtzMq4$+8ROL|_%Qj%jL%kVh|a=NHy~`e)APu(3-qCg55^cswR> zF-yqiXJxQxD`uAeAhOyk4UsBAO|xv7fTh8fB|#K-K~$34&;$&ngbTEYpaQ%Yzgem$ z`Q%3!g@FtP*tZ0!k#!A~_*R}y35ODN&XGL@`E`NnmUlPFllFh5>;bU=v_PJ$c)ZCc5Ei5bdt z0*ia5(=fiiE4G9=N1eO|Qn&s>s>q=Xi zZSxS-GNrIW?Ey(##3{|Mw3r>mIEO3@9u8@4kK!c^`4cimbBNA0N-=rF)OL38pC8-1 z_)AGC+E1c<6LUAiGA8D2`j9Ng#aBdV?pdOuV{3Qe=mr(&9azuc8q-Li^b7`LYd$m8 z?_5c7q=&ooG@8Gh>=|k_2t2`Y50YAhpBSvL@^INcH{`2RS?VwU6`EbK)ASCO&6nn5 z-j>w(cF}pV(uTX-$v|thTE?a|A5&yn-nGU!ITTa)u3y^Yw$XU#m*qb-1D9`6e$=nT zRE5~S$<4aqqi+J+^yaXI<2qkCq_?wY`E%+0v2AB8^qZhMTV;Qnpsmd?C*f9o?oab{ z6{X)cCeIGZjJ=r7io0{^Nh)V`!R2(^8d%-k3I(%ra8Sw{u4<2jFeNv0vRduWR$Osb z%U7;CSC6}rI$7Oj$vSIkmOxH0vGCXx-Z3X^^&RJU88N0CBO0kM2)S z0kPbh$Kc3MBei6blm{IX%jMX;h{2yjMqkMxvvA$-%Ro%trjG2lthzs7JJ!3yY}SpM z85(ttU!+0xzh;uxXwN_Ga#XviiPA2ornbIZpCXv94#&Gr7<9?oftyb^doV9`>KPv5 z7fE<@^oyIA8BK+9K%RV_4_mM}fy=&Dw=ljBZ!+K=1fy@3SYuwA!bcl$TW zw*?%;x0dFPdNx+72|iygU9zme+np0Ls2Q`Q!(q5ww;GUO>4PW3v8wHCBukuyAr#T; zT^DUwH|A?8lR)f3ur{&dd)8z)DttLm#ufWr3!LivH&&2;5g$-%q^$D^#rX5;f%m|U zt4~gn?w=e*wo2U24SWQfnUZ~~YC<^#pxKwTwY=N=cq>C@P^7M8kb-WCki%B@DIjkn zWu;oMC(NTd`+aZBN)7MMCF9BqP=xt@Y%Cm_&BK@8v~t;u=GTZQULlO+wAez&Hojdk zImHj4=!q!u&6(eRW>oOG?Y;IJ~GT!pD)g8W_?(hurH1-MSZnlB! zy^X8g(?xJcA^b3v3wZ)HFKU1G;#&$zT;=ulVG*B^6c`Bm^P+rtqLp+8q3#?tm_V2+{+cT zGi2i%`zwAMzUCj=w@{c`qF?6?8aL~YUqT#TFQ*$E7yy<2GP_azQ%I>*I}LYtSL2lS z3F=ZQxEt!`MBAvFsn_Z2^b9^rtjUA5klE?pIJPNlJlMfrd1}|MbHzjL_J#I_$qD<8 z;=ug1^bT>ycgW?d*)QM*6sh(9=RS}5KcQd#v3L3(63}G+uh1|5HyLChAeC=@sMhDN z!MiJZw7$IAyvcg{v|gHTf9b3=H2iJO93y=Nu4C+BJKg$VVfQf_xX zkc~STIX%cRf=IP-5z0A6_&hY@~B)o5{Q+rGJEwDi^T z&Q|r9m%#l4M8hM3SGiddmn_v(0NXR6j$M*QDq#5=>c*tQ**|RF^>J&}6#*JZ<}1^9 zfX%!5I<~f-HNfWmy}@pS_Oo{Rha(nRsdzrfQ)4YXVx1sR9F`vqrBr;V01bS}Hw`S( zM-5f5p9TeRGuS&KAtp#i0fmP4K@;Yr@^tPjK119M3qeNk1HIBjAG8y*j5wk7gvlU( zv-yVn%!vda@<>s@r2cw0m=|6X_Y;e6V@dt?cg99ufNjU+F(TKr9CPa90e+~>&r19m zR}kW%2$DNNGcY1=CVsCz1+-w1LUG+D9gIvJNbG>kQn!AgbeIQDAso(yC!&~mEQbT@ z!aWO24sQK>I>`sej7a#ihZw@#Wk?MPgX~RGF+@NU(;Fjsr;IakXTiPigM#K}? z4`N~pj{w!zml7Js!Y%+f1!N#B{Igr*m4p>}q<~ZmNJlbrxJw+h=mkJaKA2(h=JK=0 z2qkDfnBg3oF#x^*gnvQo4T@5H(V(dS?}v!x(uI*(Ho4R&j10xhIXOc(HZi_%5DoQL z=s4;N&A+Az(g2TwFpdIR8b={M3Htqtu^^C{A0u+K97uml#BO`XdZR(6!v3Komdh*r z3x`i78pVn`KBlJ>@ue5UdaYheiDz4Tc&2ia@D?*H>%LWws2CY16t{sqvi+gNzs~6=43* z1Hn=Q)i*K&87Eb&NFuhyZNjMe4~gUan#(;?31^JYp(iEDzj|r82tx38!#z>0q*yk< zA0vwqi(t?rFP_okah3*qL1R+f{BHOyPEQlmV4k5-WNlrbDUjwTY;;97ns^!yo zUR!ih$RX*IXUL*?OsGWTSvk1`ZFK_xr;I4pUrWd>fUEybTIv1YWaW#&r9msKvNkDW zjC~eDRtbdzRjC0H{^5!tXyK&BKEn%1I4NM{rF&O-4X@1f3YJ+6&}eDb>FV0M&lka^ zG`oa#mF+Zs(HDl8SdmPmfSgod&C*)-zPX0WI&lUHjo(ycH0^|Zjr(K5e^sYP&`qx~ zKKMAHLNLrn~awqv5PG3ghdIJ`$v93m)CXcV&y=`ST1r-}=3H5Bd38aks z*?9-pO1Z=sP*br#M-#j#3@1uCJtB8#@xMk-2484vUxRxpV5G`);f3N!kDsjm~5*Uhbo9zR#i(BBma*Y=9&c-Ll078e%Z#M z9zia2*x&n674jrv8{8)3;H_oTPGdS4zmjyu)~!~MTaz;5P5xQ`;H^5T65uA2WO-2S z@u`t~0uNd)*uQ$hP_i+TJrN8&;Um8>X0LO6*Gi$&nNKX>G^p z)mA<1T|H1tu&Mpw^`fL(Fk4Ij`Ze@+-3KjuQKc8I@@&f8lDQq-Hd4Gnpn5KU8mZx;BKihN*pfG><4IKS6J@eKu|e%hbAd zsB0s#VKdxib(2Q`?el!#R=ZVMuF&h+rdi2zh9(gsJ?P}^0?yeyxtz1$_FH+av85cM zLAW|Z2l9GHcDA>r*)Lt85hI&m5cy5o#iuvgQbqD%7*{{9e>G+J4vu;9A0Cpp%p5f{ zGEVJR7WMkY2Wquv_{xY@4|z6CdiR@1engdxbu_fGcZKSqlrIVHiIvwLsipV$ylq9JP#QbI1>f`&aM8Uo-OPp*99brHKKfm z*t@sR$Byf%E{)G03|rk~Tk>sIhSXv|1!`d@?R|rb{K9v@R@}8AsTvZy;ePTSri{xU zckjEspR_9xV6gx}0G7amnB=`lyag!0^q z%6w(ZpiOR{}>Fdx$gRgKP*J6_&gUSD4Rq*ks*Q0?oh!5MN$ zGwyX_&>5iF(pKsEUA#B@T-^J~U40y=5Hc{APf!6{Z231nfHYIsL_)5` zQcWFbK>4~kRrc^ADwbM=VC)C zqPsgG;$<&iRYC7y)O`{WHCwIYj~b=`P#?4z*}ed=b2M(6;;QHLLRo$Ib$t5MSq-*8 z%PVwdqHSIRzpZfha%vvwOz%S1JK>JfA(&VB4IZC`T$emgllh4>Hiz;_znz-PCdq1f zw{*Pc%cG*fBn-#l8Jkf39|QJ?^7M*7j~lMTW>WkgesfR zrCrz)*WE67@cSVIi&uKXjq0sqE8rMpO{qI+t^pVx_VDj1y}52Fq-!YlU`~31GI!-4 zl`R%sWd^LIc{B`yQ$Tl3k#h?TL3Re2jrhzx+Lf#Pj5{X|O%*-XaFX0Q_Qylv23daE z!*{=Z+2i;_xfqzg$_KXW?~(L$SL{bj*wqs9k*YsBSctl%l~{&9km5l-lmdb0lWinm2L3zu=gQ-Y#0nfkqGRVd@YyP~q)zFF8Lk!G za3ofVVN!I$b!vp}TNaLb1#PRC?}O-3I~{#_ru7R7fSSkm#SFQWur8)-Yf`%K30t z&&>U;JNU=XkZKtI*TB4`HiTBZzp$i2%W)IM#@^}@snrQ5marAyi@UHJ~#~HR4S(J=tFm;$9OVejij#mdSiV89t+N7xO#z`K{u zpVGk`ZwME#fy7+9bof+%+CX4~t)DtW_=W7VTcbfqW3JgB`%M$4FqjJ$L1q{TXKN4e z|8bN_QX&ey+3C$@qQYLDLM<9d(G@hHO2FqQmR-52)8(&G^O;wpV1CNwB*lLZxq62; z)1UtlMLVs!;mTcdOHu!=8*-GL=f{VjC{@>%SWdtFNv5mTSx8H-#P*-6sZXCrk5)#`N`a$RUs#>v-w3>2Q)8?V=*MLU#m}qZq8OYw~w0ZY&up&B=^WyKce1j zum?kjCq)Ga)aHS`UJYKRyJ3C;ZwqVpP9N{0^S<2Y!v>wVASRe#42+J8y!M~yP0`6^ z$2zfFacSNPW<_l#`Yp@`Z*JYY#|_z$TpcO8ip>&ohi z;w%~|L%eu!!8yC$p4`SI1UA^kgt*pSo=^=AB;+yd@r%>#hv9A{du%5?YUHAETgp4* zi_@-Wm$cChGxVSw{pTC$_2BTR@8?-0I{*8U?aX~UqQ5u~A5!E4Y0r@^W{?9h2oWk# zAtc|ox6yWu`KmI-^>S|&)`wH|N0~RD8?LEG6^hb{4njBF4Rjo`sk$gsx}+GBxNMUo z;VkD#;d)-XF6P_!35LX6hDb(aNZ_&d?1I*N#z?m)rkZFV(fsVk%8UIa2_6Yhx=4`> zNxJZv-~PGDhamiMNI>LW6rgwQ8KkY>Zp0IQS`3lHjo@{d>FM++o1eC6D zq{HMsBn{4#jm082W;x{8#WzW%z`Im{xKh7VNODg-utjoWlfPs7TgEB24i_OozkGch zG8T%)4WCJR#B#!Ef@iQ0VPSp()<}w{aPU@`s=QRf-2B*r3qo@e_@LJ0a_^7UX%{b4 zQae`T!mWB#SWIg_(FAcQcg75N^FAKX3PLe( z|5PX5839yr;UjgiUf!P%%Ger@*w`V)L*1i=WQa481OijI2pyuJZupH8qJCa&3uI)? z{%vp_+;!`~3P8uD%ysK5%z%S0P)EyAsWE$N5%B&tQsx@K&x^Jp_vq@p<_>tU%^(WN zA>8-(NI|>;bWPaU5vwu49F6xv)C|_>C%-JTQLvBiN{CQToX!*%?_Exlkud!m8YKjc zgHlUnP>7Kq6~3W@ws2yVNX6AM@_X*z2GPsO{7l$pmsrk+(9Uw7m;)(C9*#dnF(h?W~2ZFCS;H#n_tHOFT^boL3YsVpLV^W&Xt( zFcK{I?mPD|CBBdkgY=*@p}kl?cqJxN@toPPE%6(qOUm$HIQ`sxeO6%nXv^#7NZ)O9 zR2P>S2#YJ+Q~E3Yos3e7btxf}gDQ4i7vhNe8C2A6kUVkf(TlZlQ*!G0R@py<#3oVX?gba3tI3>1WH0Q5YVcO8^Hyf{QSb6uI0 zdEz2q!k4Pxy-H;}kpwtjhw0C(M`4ktI_+0ViQUrYT_(p5+}bkxl|)wZVyh3bFqc_= zhluY|(f~6{j5egXIH&)UNhen{OjF8@@uRShAvOQ7DUxXP*mP#fY5Pm zlRhl8i46{=_=3eeE?o@%*Rq9YrJ9%>-ya=1Axr!y2;K(-Q3CjiZES3nM)W{+wqiKc zbL|!C!J;IdqPD$*mHU((0acP1lF`77m_wf)23dV!C_)4)$ob{Y)2=R^yj1_)fpUyb znQo@Z)&sc2Hp|trQQ^BBO;d!-cU)g=Z*}u4_;z&a(Nxx`)y%9|d$hK6WoFhgQsR&D;RpI? z9cKd49Ml$Z6vAHaNh)5a^G`iy*>(lOLv=v8T2NFv70=45Jiz;ut?q1#+o}RCxcU&U zi;r_(%hetvD^z9)w8$!u96lw(=#WAZi0G%C(UnRI3rzE@wy~QzM9H)@smkh=Ut;yLoTX9KEqoxBf6Uj@6Dedtz1;s zAH09cqMhkB9)o6WeLUNFguJ@d;E&VB%^p3O$w#7gKzhYv+YWixUsf*|sZf)sDD@xq z7GWTA1;4HB@IJ^zL(d~5lSs?&HI<1Oo0>(Lx>;ysPRPY;(|I@|TmILZl9J;7n5{zE@aO2nH_4WWc2s+FXm^5CDZPYeP&c^Jm$U|iOklnrh zT$0Lrfim2cje+8)^2(Bd1VxR_+@%D_%mEg9-ol!;EHb!n;mZiPKm z9XIWk2G0pfEnzBBL(T9DGP0_BQb)A=tg#MHKDr$1uIoe=TQ>KDsm(h_Gz>09^c$F& z4*wBxN;7orr+v5Q((_7xIr>cj%|SJPaPrv-ag?&GPm$}Xp>$F)Zl++kh^FIY?XO+vZbLmoU|3k*D+qOwci zDEdoxO0IzGosuc7QYF2t-@fQi6VD%(M+y3m+)8Zr+G(WTSj(kwo5mH#1&S1O(Y-w0 z%UlJ@Tq$=N*BPB1huUf(SIQdCvKrKK8(H=}F#X4Q>DV?NrSfFRMp}G>TPInhf?npI zo&hi;$jb`f1e0;4r<$z@$56BEt(#8THy*Othaf+0LBLFl)tr zeBx^|D?%Pm1GI6r*=4fccSZSq%7G3S_evQ#df`rn-;a$nwu9TGUUm#?TlhLt=n?7h zOPO-QiIUGbHoOtdD(tY;)!gI@WjY!l#5*^d>|2Dsh55$Pt(rYA&aEDs>d&c`|It?x zN{4*0u5OAu!p~BuZd&DHePum5uD48d&56V2sI<0=dm9}!mfETpe7~<8f5S>EK;dI` zYIX)acwNI$s>&osGe56^Ilb*+NlU10w=!E;q=$JfyJgbWvvP=*893>~4&hz<;0tDf z1L=z4H|WF_45!9wK2+-PnXQDwuq>z1nc7S=tfk9xdB;PT@o=uWgdSLL@v9J^| zeKpkF?ORghe&_TtaY&Ff|MKpN@NHwznYX=#L*+AGlzegt;a6oXBt9(;ib24JTGvIjZuX(Gb~%B6IZVh=Hh_iFKO=}$<7j4`DD@PPE6I5EusgE%qF z{}m^OfrIVe)iTlQ|2v8BdKTEVrQ>+$XXLL@TZ}#bVGI2lbvif=!*-VZB+i7@@UNk4 zPL&Q86AA?q{=E5JDtwHyA}`q=Y|tdBV$RsG_MfjJIUS`+V1*(?Lv* zzu&LEqL_hhrl0*5e0{bHa-x1svhF-{p=%p+>UA$mJi z92t1kzo5Fk<;DvpC6BI?Vm0Jt3qg7px)F4l>avdw#Y5gn~ zBtrvLN9#OCGY)FRF!F48cK-|Tq23}I*OiQB8CEJK;#Nqn5DVa(y8wS`42B$^RfeB8e04p2Y zIpX(#ZvztapQj5cgRmB=v}Upd{hk}cDO3SaaM0lGK=fSd@)Tp|*71&x@F!r28b^e~ z=_;3T0fMd^fe4G?YqT9Ml5h^CPPsb#74^3TI{cQuUW%DcNHyhDFrc@>4b8iQs))h_yu~D-0BgY`5k5;0*!v^)4cK{ z%l9w|a7zhv!ePK)@9b`I;DrF16GtnVmKBkM1g@%MCcaNDc0vBXTjXDhX$%{@a;One zMx)M5IO2Mhf#5PWtIv=CpE_3m%en-%ccp`#%JQj(u%u~*iiz~g`aDy(J||^X8+;HV z18vPsmXrk6rdB)aC`I87$UyX(C0!_cqC*b%+5@j44;L^dv#_EiUXzC$8Hx~*5bl$o zI&p=Hb$~ielEKkYtl)C~s$RjBR5-=k3c<9U7KfwzvMk{KLmmJ|Wu;|kYm zXRRh2$sd#7X(#ZO1{kJnDXWSlJ*1Nc=HDl0SZ@+H9`;yK$+(TtG{@u;R5uLN289UE zMSg2yQcI-4FbM^w9z6_#9Cl35Y@Rc(sM*M!>MZsMk+GkK1$pUr;$X+we_VZScIBF7eA|Vt8u5Xh@OXV0hU@r~ zQeOw$^o$}Ye0{XmpKEmnGc8;-ykk)D=(+GwoBhyIX~{jib{5-g*L87$=l-H=zst?vlWq8|~ThkZaLQn*zpl?O!1F-f3CZf6k`C z$663CJ=u!5XAgur49yq6T@L=z`57R1(uOC_pqjO-a20wp8o71mlhq+1jeKjdJazS8 z1RJxi61)0lVM2gQCxw31*rFybD?XrhLRI*&8*nh&^w{83Ui?shvyMZrRyTs`TQS1C z-w*e~p1M_C1}zw(Em#+aqtnkKaICGf$$#t)J3~bXGzF!QWHfrm8{*ey=h@<2BU;uK zPUbcKl`_C|`t&BqY^ZM=T7}b9VS;AHE{3s8F5eScmFCJcmR&hdpDI`Z)jwZe-R1G8WwMuzPs1*hV6m0YN;6 z6;orRBJ2>O{s78cnUcKo=d3D@9a4n(@pp0ZL9ECw{pf9q2}(g@E+TsU2Eh|A49>UT z>dS=Jr!VR*<4`vD0z$ZmP1J(eHfy1K=H>RCIOLQiiygbC+)@^8_iO8y4~!nV*?ix@ zV>FR%EH5v)yo)`LJzgJoA1AR2MSBj%K4Q_8r!H#QY-&$eUo2QUgA=nlG%yl#+i6Mb7k1ih1}^++n6f8{^5E%^%YE7_?!qqtS?wP%QzmBSQ8Ul0>T2<1sCi{PKM zMYR6`g;$N3VC5Y|ug8TY8?LLgASVIej%nc0#B-|EX8p0Se~5=w)OOKk8KTz_!9A__ ze89!fCnZsMp?f90l>VpCDAzGV&etn3MgN1JvqjLHmLB)`2KfgDI6j5UWwx#>X$P;h zcC5;p0efiufb2Cz{7;7=@uZ^XQfz3hVss;$gr;A*_yi+OA0DD_2hu<1-g0>jOX&la zBAI>CT8Lgitrz3S5A#t~WvOy-OsJdg;HtE#$h1wKy|Lo8seYCqxW$?7;RUUX2i&ek z1;z5E`VLPRSQ8MDcNQKY1sn2kDIL=c?n>M8e0G0ajc)bxB<=i%jmv+M`Tk=w@INK8 z`(Md?nOHggedE#yi0rP3qIe&vNgq&EIU)fCp5^0?J2Y8q#FuEhb`Aze$O{XCFav4M z`b6`($UWV|0gbYzuCA^wq>1%kayS(gx0@Bj)_=Q8t={E+?312UtG{~zJW~&+UcGQe zFK*B%fAu^Q)c2^_nSH%BSF8HncRwaccl)B3EZl*z=uLyXwtj;!$SC1I5w^J4+4Ew1 zd(5*?TU69ZZns=nDDSVcTQ$4mGjFQqlyEr&e;JuIanLIJMYA^$`7pu=C(9^BEEhYe zT+eIsH@<6aTp|RB@1jEjkG7{5wmve3He;9p;=B2yVo#Nm=SvzqQh@lb%6Tz!|5WdQ z6ocnBI5enU`NEU4ey?NFzV7}|0>Bi_$^_VR;2XH9ZV*H5SZ5DM!Sr})W~5jUSh_US zk6vu-m-l+gX>Rx_gd$zE?}FE82ZW%|-dQ3uj!8_w{v1lET(Bb)T@+Bx^rWJ#$s&Pb zqT{LQa-zYoII@5Q6SEZk0UoInf-_i3%od#e792{j=uGhad5397I{X%rBGGlM=$7#k zdxL&xh5ij|k)Y^E#&6$|ADL%Sz9YMG#Tr|IFRLS)?+R3aVaBqm5(!67Fj)JyUeiyluj^M`^;?eK`gEqHA)m7Afn;uc!bfJQh^Y& z7bS59{eRQp*sl{9K9<>lf82XZqQ&s$`|}FrnxE6?1E~GDb5E7OSs7@4V8P%2pXc&_^$!kwJs=YU}xT4g6B`2`o^Db`xg#w_-RQHS&s-DHsTDEp;YB zbB_dh_Xj2YLh2l$bwSB0Rz`dOvg>qG8s99K-FTW5Snk>iUmutO8)wDf^^C`cI0K zg-DI8>Nc0}3^m9`!$HE9r#n4%dG0CpQI`-I?yJA^>49-5VhPJz`18w_HF{(#cMbad zEi12?cv_72(cJO{$?F>(aySbKoH8zlQqpPn;4OsOX=nh6Z1R-Y?ZEp&A<*%Za|?5^ zPV=(iQlg;VT-3(P|42^UWyd=vF*5$qhzbKy3g>taj}`%Fx$Eh%7;Z@t?%KZap{DQina2aLvXodAeS*9H5( zz8t>-PpghVyifi2@3*tkS3MJe+!Wyx_slD3^kXke@|0lDdBXV*r@DYIE5`mgsY>@h z8eXqH%ESxjVW!#n8RJ~7otFH+)Wbo0pH$s-_BAM+GE;Ob_iv;pru z10AWu|K6zr7!Ids$|J)0Ic~bc_X?VQfO3i#7RmUa+Hn-o0;=>!2hl$%j3Io99hyuhPPXQYVTgN@MP_N+jXPjE%~6> zQX^*TEK3udm*-oq-Smoe7ZpL5ZO@8qtPTFu4`0RfJSBp$I@Pn&YRAG?QJ2t*lhp#Ihe(3r+9Jwp=}VYHlW4Wo4IZrY`Dz1!XGU0B+jio1LEShx?6A2*%|HlidWl zha`cU6dz{&iE5-b=+^VsL*7<{NwY;$xro{$1(bivXmq+-M^v7w$`YQWOEXc^MqSBS zS(l1TdBkFI-9>rKw$7rRvfjnm;Y|5j6U}Q~p~xR)F%`AB?{<)8-$(Al;a=NCZPKdL z-kMI*P3ld~nv^bjrGdP~>#LT3a~HTSUKEA;fLpawHxKfRS|6TQm|7f)#WKHX=M(r%>Y@L(IRl%*XH*S=ucc-8CKqTn7Ot~okr zoqzj&*jb{w{8&~!7K8BcX1B%1C4ePEx1y(bxHBS~UsXWzjYP8J2sb6N-zV6dQ#Q0p zbT(x+P&}+;GufsQGT*R#)s*XFamtKU*s84-F>5>5D(-udh??MM9bZFZTZ=~{dv}|M zTcf*!(?`1|iHn8rh=kRzGD&0Nku_XSNeS^`NZF~l)Yy^GHzVzUAkJO?@v0U+6uAyM zqRzSbr&iK9l!*MYm5XMwN$Wrg*?CkH9C!W=@!JKj&wgmMnNkQWt@j0`$+}imzNkj=3=_}27gH+0Hu>5eodv<5Jp=c7T_x3~K zO^u2q8pJ7E{gbgQ_U0tml2abtrQ5hzYzVua(n9yzRmqF%A&EX*CWeN(G>ayfT5i`Y z#=1LHVlaGGCgS8Ajz>d(RqfSLC5cP(jux+4Vx#h90b-+skzMnrNxiz9EcAkw_~pzp zlyu#=vj}WY{$@z;qm8{iwcE$-VV>_x^kq@PyxmT7!9easigDmM<2vO!#av9n~^mNaFSvo!CzA zesKsWic#T76f#oLpeUW1>bePu^vtn6uxKYxczf`=jy z+`y{jl-A;AcH*)RnDDavzL9Ax_lOz1JiZKOCoz0L4juM5kvYkN>pPY%?HeABBWsCLHgqd!K5dkYKKRlVx zxxYacjx=D;T+4qv-B^5YpYUCO@-=XA5U&0~Gv*C{9CTP7z^Ci5< z-7r3vA$m@Og4wk^gI7d{?DE}q#N5heQCVE1>`Wm}jwqo1cY2}|D^0bKxy!Jv=zWm? zrNcfjSZs=MnolG>(O$Ye1XtAtspU3W#{;Yw|g z*om@}X*=>?pY|>lJjHAcH`X>kwQgSahX!;lOSJ6bDa$@LyDY8a!p=MS1jJ>ARlIxP z3Ah?qSQ_%}9rS#^q73V{l%4a-bPPF(K;mc{4NmKp11AlOh2>LbuClU)E-0d|EueJ$yDEOGshLWp&k4o~tA!yOshpIb>+l{|s%+l)gZ}%y4YEn*Fx#hs< zroMO3u4+}O0)XkE&McA_3vO|ODKz{?nvMIAu^%&Q# z-8O_gxFMyMN!}}NSssvoF7T=vr?b~{sg`DXA-)7p%W1A^Ifr3Q%s*An?e3ohY^$}L zvc9z%o6T>)4ybQ2tE)ECCI7g&MLDLjQi>`W_pUL&x+y& z_K(%~rEIgU?pF4CPtxg1MTM+ail-_osD$Cwd@HEzdpH5Kx$4L4C-|3V!)1WAR zYLYsr<&3>yePb80tsADI+a{Z*8BWFvx>p0u(B>OIE=T>1j;E4()hhm>&9kZ_$CGhG zGPRtR{{1W&8=-;wfyevfr3H}@d$|e*GOg($grH7zntwYiQnz*OX;=#7D}uJ*hd+V8 zwj2HC(2E@|r&{-{bEcUT`$z7>bp02|FE?1O|M0;5Z)*Mj!_{K`{~0&H{Fi~CNGD@r zY+)d1=dSfvD#y;u@PnP5kcETg2P3-dz7nQOKr z!^k05FKFHtpi{Cx|$xf3$O$@50x{z5}c`A14BiOXOJxwGTp?LNIr9)1& zoR>w=c*o&!upbj~<>I>2ayN;5gYyYJzn~QPu}gh&xsmutfOmgh8INI;uZ4l%+o(of z=h@X+7>(Vl@PpWcgZP0{W`W6n(kLX(EQz5W3KI%m5-&H9hR|^TR@RT?S5ll342cm3 zOAr9lL<>XdWz18oGNwU8GBpMwvMG|p@t>0vhe$%>p&SLBl6AlH<8Gifu5WJ73YMRR{nJhcF?^1 zKEh2Rw=pcc1vSH)1ghXK%W1VH2(Scxz|F%G1gI0HSS6;q&?Xj*63R1D;syNJSN0Nj(DLZsmxQy9#258Ld@_ zn+$OUM3zfh&nj6+X)fva-UlIyI0&-20;wcKDPgAafIKnKzgpu=h5alQ2gDO7149Aa zk|Ai14idm(o<|x7kwkTRY*m2l#EC@2h8jyBzHm9Ww7NGFH&f%-!6y2*nzVpw{x9m@ zGOErl-4exJHtz238X&m4ySoH;cMb0D?(XjHF2NFe%`s}T>8w%kVc6ijSUkXz$P6K{|g;BAK?tivX!j;fktw^$&|y9I$K^`!xt+zIMkBsB8(=c=+Nhu2MM`Kh#Ohu z3NSYz(i)J2gw~YjLgrE>0GT{y1tt>#ypI}fZ-o#_>gd%wc|-RF_GD3 zmi3nq7f<`M`a7H+1W^jRNNp0Q)b%n_F40p9hkSlX!Nmb1K@__JDEx_J326y&^LReF z+05~smlWmy3t$lc4vc1GtQ3N>FoHH_M&f{Sp*EuhJtnbvG6=~f4WVf!%CF+2?8l6cYK8RpV;H%tWi3HcTi z)(48*IZ?HD)tHPrSXx@Lf0KZ`|0DsY%s>g?5^g(F5%k0d{99}?Z?O{pPMSa`9>IT4 zn&c}~SHmvD=mXDuJ|yho5bS1pR*K*f(H7lVO?ts;YEa=#6~1wHB~KajLBCMH5I>3# zpt}Fj3Rj?3kcX}~37Iqmu#`dKSee`~FUg*AyqAEpqu$eN$>GD5sVtZg>;|D1O;Or} z)6k2BKVLYb6KVuI;6`neIGsntwhOKT-FEqmBaylOhIVh!UM3#wbpT!j^^z zz`+2_>6FJYimAK{qvl)GOYM^@GD5@D3Jcal$t6Q9_OseNj0%WOp9+R-%kmA9D|gB) z2VMp-MEwZ7ZU2)asx$@+%|ynPDGRveCXR<7oiCJ3Mo>mcIv{-!Lt!ogJMe^mSSYcaG>`|AbsB5wPH8XTxk564G2g4V{pRCNEA}mv@6>s6EON8gU%Am6Pj1&;Dd&d$=mg;m1gH>&t`CM zGJ|F@PSw(>9c#yW;3)`v#8B&8XKtb8w@5c*{8h&6LflafH@KQ5Z0%hI^$NSe(D?AR zOkTR3P{ASEs*BH_-`F`3Ulj<|VTxv~VPwMh0f}&q><+S@m|`>O+xDV_zIs!EqPx ze3>4GKI3z}GCQv=PWIj~H5=(jb6qVy8j5H_9!fWkC<+XBdU4}UPVVh#zN8qD{49OC zF~LW}q!pm*e%=1Kwlc}?hz zvVi=g9Jd$k`9z&kROyvxaU37@#UH=Yrn2KrtK6nsz(^1SxkzytfYyt|P3vyY;#%GM z)>#LG38icEqCY+kU2!iw`VL-iE4PDZcLH87YqTw)cAS!RA@F!MPn>WZYVMjqcdI)+Hn&l>c$=VWIzV4Bf;-@Wp-X!PT8te;e9PudOTk`O3xr&Df`H zE9U!~8(-#FH2B+F%JXj*ti#o@Pb!&pUx*kpJYBc5Kl5=P___bS9;u!y;>oQwF4x%*8=#4T|wJ_r&ot55qkn}S32VS0NvRZ;# z;!oNXrq#=dr`DC}at#J6OJOv9~_A6`v=$-)D{CBO_L=5RInjt18#W!J4+P#z{ z{!CeWxW}`o-*`NQCj+}zj(X#d*c z^hTOoq*G`vtTazf##HXmH)eqvD)bFp_l55KajW-5(y|CA&jgiu)(6#=w9%2ul6o<< zs<6eKNycsmVFJ2BkZ@chk}OQr!J3vE zznG9B2A6)DVF{*mA#3_(++vNy-=g0)!hb7qY(S#1U4X3Lo;5+#zxcp!u-!|Wi8VGb zzAx#D^DvrEuKH-X9~i^G;|cC7t93y;g@`S zt)CvK^2sfo0TcsW|3QFe0K2~yXeKM3U(UM$ij>;7`A{)U-p{K6Wpl}fPBu8k=GXLP z&e5#r(Uv7^H|`2UJL=1<-w*K~xea^#*K23GZhRcMBHl>`sPj;^bHrWeF8lV5I-cvg zDtdSHW;S+@UcJ(;dS6_Ad?{key7a*I|INNc8a27ABaISFfaQCY+tQx=?#9>iIg^Pg zZS05iaULrYdfKfoZ{@h2X6}lSNN+b+US8~&#@*x1)2~jBI=|l7F&UpD zpjUNK^i%!**2B(~sqKLKUdrRn@w zuy>-X?!zU|xDW8rV%M4uPFeje%A3+l9RK-)ev2ArDFCP%;nS7D|ad$Yh5<;Zx?fklb_S9D9UZilzr%yCDc5{W} zwUzpgg%O#X@i}MK{OxCboWM82f!aFrF25h$hD{vj7PV)S{1=4eZ2J5I4!M25H@hAE zeaS&MbMUrcx!Qh3Y1J$JVm}ckzKqnk&FF|3I1S~yyCmvmO*`Mr0j-E{h3LI5gY-3T z%iR6=MQ-*pq4rRKX`eTjW@rB8Tr-3z?aF^ku><;!@#mbs2SHia2iq7|)dx5}gm?P? zyy?gB7we|~vFZ1>jkNzCZ`u5}HvRsR0Q&DY{aApO$$#1OOHtnf)*3?hS<}cKgK*H2 zB6s!FBDULUj@~|_rp7!E?U!t>5y#RrK6SQ|i(AoGB> z)z|@!sR&I?v5vrccu-4yNFF4SL7|i|mQ~I;IrS}E`?5SjhTr%Zya2i(*#R@@Q^*qN zQmMrPzW7Nz)W|{igRZ!&yy>de6T@pG=k~ zrK2WQxlo!L*J{=+4+25#t$F#629aF^th+Zx`_Pwmj+4bzN$AZ)-g#;_Bewepi@n5o z=m#&MuP^Pd3#+yw_^->mSy`cG)tHxGFw2XSEM!((T#JHIeDL%~_Fy?5B2N)`>~#{p zkkd!qLZrBrxa3Fi2?!ljGgN`oOei?$PDgE!$?J~8-4=%FDfI@Fiz6ew@?&OIP+8{x z+&9P7H{cJ+s|~99Y3}7t-~(Hi8}xd}%PF8`@_5cHKh#1krrz^PhE`|vhKs4haDLW~ z+Vr#GSR!TeE}7fj-lR@-WZ#)~s6FWrDJPG<#hm(dv_E!SI1 zu^CY?4%#Qm6I47-x2`JH3sLZbIpL%Nw}RMJtpA`VnW&SomQPTQ9Lx_2CkAT^)|E01 z%9UxFg-{zr+>Mw^JW-%8RW3>iUG>%|sVtzPdUvbFjITI>sfm~$274Onb;!x(2C^pq2c*k;#fIc(VyCb>lI(# zqUlwOJ4;~q^NfHzk%F$}1Eo_*;RzR)1%B!wAewWj%v1GhO^(2jzXTG~DD#LZKB|Y_ zh@lY6_5CioWxXskqH9wp6}3&{EVDt+V|T4F(?GakL>});-Wmp<&og{kbbC-|z*ZfR z5lJHYRJ*l2DJoudcq!kSG7ScRN=>IYT*QcwaPo$Lr?=w05rNaSkXzM=`2v4N&7Zdq z=L75$ZxGnO5Wc_UUH?<~{_ceQf5Ke(f90wC-_pCkg;7 z&kFl8z`|j+KhnC)pEowZN};{n7+c%QT@IG0MC4Huv%h%dg-Pg5G!j5lJC)`~`HUsp zOQo9f`0VocZHm#;pfWnUsa@;qU;6F&?uzj#YYkqxC%(b2er!fY^z6L-=tHRjJ;=Mk z6!Z6_&>STjsQvXRu+N#sG?8^cbu#(jr-$n{zt>uvt4ag%%etzsMqXtH5s|@L=&D~O zxe5=KSpG?4_sRwR1o?3!9J!fKswS>8MpT2Je{K)`cO^m?TC0(RYzkpRkGQUCMZU*& z*S{6Z?e@C2Cvfw>>eQq3$Yo9$w%k7{IKa`w(k+G(jWR>g0N!j$!{qyAV>R2fEyZKV zJ{XNj$rr{!m*TXKap2tI+&UdaVI-;!L1)^l!__E z69C75h+R$|%M!r%3l8yT_GM;?QL%6siG`LVqltnxW>D2&Vyf6Mn@vzIftj%AR1~-2 zGS4LHFMir|H07tPC5wQfi&c79vKCUwY%$Tk<3y}<3sB4`5@EfLZ;l8N2q=|qkO{<^ z0RBWB!N3^&kmQtUsR8q7u@a$`S-j?|)EE?96}?bCHmy^UT&dhL#v_oBI22GKmmtnY z^5cMolcL;=Wf$f7ThzJ*5F*zub5HCFj4{{c0t>+;?ZRBzT4SOI)m!!(64Ik0`FZiw zBYb9Q-{mEU*PtY6k5bGOCe>`MKL3T>#M8rAZ>adw2(IT`>YM-RIR8^mw~*q@*^{=9+W$xDFnX+~@Wr67Th5ht<@ z5Zezzg$cx(Dub_BpU_I_`Wipy4_?ycuwdAA4by1AdgAbKtu(0>1p%wq zjb1bw*#Y^?^VI{c>SecDmo-kpQPlM&G(I4)9~xT%^%@L;R_rDK1MHm|tDi0h0&2{$kOZ?&MMV3ktiYH^FG`GWwx7W|rG5%KE- z&~K!_7|UbItQTzN4}x?a5Tes-o@=KBgQfZnZ+K5)kxxa+Q3c~ya?ejUyMicKHv%rP*RF(=K=E^f!3@i^%RR6{&@0}W`#Z|f3G=(Ib3_>n6S3Fe$h2QE>8V|wu zgK_0#!z@gXgi)OINKAHy09$_$ZE7cQ|5tR|isb&3$HN=0etH1|MU@78go7*toI$QA zzVF4TFIZdX2^m5apBJs?22wby>YYedL&z3uMF+2CSY?-{-!0ce#>{UZM?z z=$%)MQHUy}nf^9430U!=3V~EP=tML3DyrY)%tZaOIfP}U;d`%#im{#M&i1m1Wa(E5 zf)G81Kfn7>TQoJV9sA%4No=fK9NcOwbHGw)#l$v=c$RH^T_v#T)Y^+ZuC|%2o!4Aa zyQ~nOFtW_5%${)Kiu09;VfR*=rSLB5+IsGP$F`0)Pctz%#g!E>$`Ys|bv0lL0tx!+ z>+Fp?LF%+>V7^oEV=1X_$qM_$k<&;Zce4XW8zz7-Yd?RiQS4M+qscQPlqnAiAuVQ* zt6%ELk#UQPQov^Fo5|A3jGjuKp#7Fho~~l%6{cL~-ulSO%2=C*e|0EJ*h>t^5l$Ju z1Q*GPp1(cVrxb~q$qB$mz3rMWcwnxVZq<31ZodXIN}hahZKkivGyk4EFC+!r5|S@V z*2De957h5Aaz~Z3rW55ldh)oaR*k3Hc+m5CZ|g*B&yjpIQg(@7U+yY!)}%Q11$Hbo zhxqKZ$H(ooSz;bXl=)xQt`u{oa~wE;;wZ_jA)DV5Gr(EpAu9-~Vmh zCSF%iK<~5H&HF=FnJ22*S{#=!2o+({{H@v9(8bHrBi`k-V45+s-fF)&@~4Sd-><-& zu8!-?@XMYQt!B-OI4(J89;n^)L`31AMRH~4+tsicoz`3Lesp_Zr>sH@aN_%`TCrhw?dS7Ujq63=)vvJ5Zm9D78 z@T?CK;&3681Ii?qHuQA2QYYMSSU~e$MK?&!nCjM8sZDHIk<8s@DL(8)8jK6BW{ZWq+Fx z+ILC#kadH$w;~BN;#vN9lta8<<%!Z0z!wT{d?~i@saPDcg+gZQkM**Y!RDV3`<&}( z_U*fRm&TJE)dBirnmYhtU6XB_x6XOHm#w)!JAPDrCeH+1g~jPifh|58iu;-U)n}0k z`!4gts_xUQGtns94D|$t>y5u~x*`0>*VA#s)Vs2aI0iHSvBYP>(sqDfpT5ES3m%@V z^1$AfPQ9+s)!{u{a2Amvi!&qBG*Yjp`@W4J#f=sR@o&iMhmm6({37mb&#x2jyCEG$9hm7|^Bxw7pB<)vX;JBOwOPY-0CX{b_Aod$X=p0fHzZdnDnR#Gmgh_bhhb|PwB<~z@PRK( z=wc33M}9nfyk32@>xZoWi|O-UvU2}9eg1pdkpC0Y=l@b|lK<8``Y-84|9&3L#>vX@ zmwkg4o&U(rnKn_rA;m_hjcYCB-fYB>FutgXQlZ6$5HpnufD)Y8t-C4v^2e{bk$OIB zQ#u7c{7-Vu{L&J?ssN)tJywBa6nTVGgD%5tTJ#Stt99Eyr~;S%8r5W=*s5%)B`K5JS>z3a?M8;x-5 ziVN((alOsZ=Rk^2w%{#H8s(ZpGe=lhv}Bv=O0n?=V{9CT^_A zWa{fL2^h5F47<45!FCADxqO@Uc9_?gm!wHTxe?^k4q-W=R`CNDtnn341*lrs)K-Em zlF`JiCRT)|9e>PvLYP>mgRw`~D`ARVBj#2Hr%NQ#LpU=4)d3uq=x1{Wq{!$Ft<3NT zqQqbdj-aN3gNk#5<=W_(AVb0`CZE9PseIy4<^xGMX@mIO2stV--2@2D7&je+liQb^ z4)}&2t?y%-NF&hC2`oJ0hv|{Qi?~DJQ|@)P@A8J=&|(EXJs?LDlqHIQ_=B*!z!PQwFh_2|4O3@38OY)zM;AR!n+i%e?5p zu}&KF%ao`&wNasi=&L!|=BkSWX(M8eer99M7KqC`u}#X(1Few@+hbUkv`0$dRBh4I zl;X90VKhfz8!JuC0)AOyq`{hVnxsHvGy)$G^&bxy8RDk?y^VUtXUh%~7_Sl$pOQ^{ zF71YduI~gJsAMi0zKzr6A~qiRMLZ*h6KHHbui@~sw4$gkD&1JrTZB9%BRZjAE}ptE z2XwQdppH14QW?8Sb_~>8)Nmq;#k>%h2J;r71Q5LPYqeIY>dz(Pme60~dl{EAW?KmR<7}9e=Od}h+Vei4KyP&-b}uU*%rTc&3e8f~ zj>BEI+-La?EZBrkl_=pEwPE+e0d@T-NO03A*DM6YSl?geHEs_U%I~S#H zK!hw6QAeRieldhNSlAk}u-c^uN25caAsip)qZ4Sr9u1tJQ%cS+9W@XR%IdI;k;-2P z*;BQP@Kp1#9^#ZSrsJ~h-(D4usosXrQfXu({(cul!fw@of-hK*Jrxp*`H3Ws6~_*k zCsn`{9U|`^ZL;ltA&2QTz=uU9l1HLs`UzZ90bGS|@~c`@c(-eYGNd8ZkrHJQu)mhw z8~IZR_?{H9N)UO|0`0#4X49Ml3Jci~7|%`byY72sXnu48?A`xpJ%l0P+rPLFKFjKM z53BV8G#B6CQS`VsBKnakVB0yoK=rrANnV$U4`)jX4_i+6OT*bVCk%4k#iQekRO7&! zfgnh*;DJdr1LU?x)UJ#iPWLm^NkEJ%RbHgR=;sWPbbpNArM~GhuLNb}n^! zq|Y+aX{67uDq()H$(8*KJx$DG{Bn^pmGtA>WeZJG2_e*ojgg?6IZ_FznF;mZ@FR)Y z-Y~(F$Y!t;h^v5B@{1_S1L}ktP zOaXbqyD031NCQg7MUt3od(pHOGw5jJt;B7oML7VAn|-A{@bBInnr z$661Qil0*+r!Tk9PN#dTes8`w2WCbw7RVKm+|vudT4|ajOw*_i?5jr9^Xujy({0wAVIV zj}5`{{YH_2t`kCr` z|H#x2Hb-h_z5^3#k->EEn{qyV`uDF#7(X_+#tMs|g^FFDk1vngAW4%k9BcKuy8*HR-& zy;^+{uUoCM8bB$*ZAS^8)^tEsAASv%)SWv)FcrS5+D-n#jCnzF1My+^fGbAcZ|3o7XL z&HcL1e-mEcZeL+nqDOVhZ#O#VyF#ggM+bkXOk&y71Paq{m&M9P<`GTb$pu*u+P5h- zC@Bvw7g5dj7x8oz!lMMaoi&H;6<&qI232)6euVZBN0G+|yI@$;^bFcSISd6DVO)?Q zr%?Z)3fLE z&jN2a-Omp@&nru<70Lt2{Oj*t&qeQ#Bd|Dd3QVlse(nVj*@Sjftpuhcgfb(Yec(3@ ztvrGg<3EDa7@6~b4tLOH)d=MLtdc-F(JevV8#$avefeC={(TK_jB*yf=l@ly<2qA4 zJWs}?%4?^&KHiCuvPji9<**|peHk8%HXT22;dHaPEiR|do4Ve8+(<2!LUT~!+>Xcg zcYm119l~6%8b7-Sb0cqssx_x_L#F~2UD%Kd_K%m$bieWjaRYe($I@rrQ;|euM-_Sz zk2UQ*UmgUP#<^^jr!vk(_tTzCJ$DHKLQ!>&42)!V9p3D{MQYXJ-!w+#Qn^TBVB%M56dBYHb?BKEcgknnhPAC zY`rIC_CwJwADMMSP{CQPHdCH{hO2uy!)#-S@RWt6{wE*hE?EU8uP;x5r(*|SU$=n4 z?E1b~rG0C+hp!*TtZf5(QJ!&LJuj-hheTH1dh`T&VV-OaBKwHi-ZPgOG~eswgd*F~jOW|0i)R{lIM(QUqR)4WwgjEmt6YarmF;qE zdPZvnCIh=<`;Mh;%MR<;U4Fxp;!H&~*CVaHRc#*Oim_lmE1J{yJ7)ns#Hyl~D|1pu za9tkno0@2HDeqe*#4k;`_zFoz+=8`(xk26E9jULTg!V9**>al<_L}22g1$0-LO~)Z zL{wGRjKk)=(SRI8;q_Qa#V=#)-}=(97;LIodv)e#3l(zTYvjN0duC@K5*#GPqW&L~!r0b20D5nOpHi$rMUoe{ClrZ_7eT zQ^urF}qevDjE&E(AnQN@B8}E#>WVc*phPPdmMePPu+3 zda=QuXfq6X&-^+#bI?m@JvDnich-|~d7cm3oOd&?g(9o}I!;JwIY?_uGZ%V#dQ1)c zAR4ic{s5D=vETU@%jLg#LHu*M{AUUJf6FoZUuu#5FP6(3Jlua-E|+KnkJ%;v*c7vW zrvYWfPnyIa6Sjmq~ zJk+;SJ!0iKcdD6R z)rqR+`tiuF(k<1;X41rS^AI7-%0~)ihlK>c@60ah zdS#5@1+$Hd1J7O-dRube1h!@t`=^XiUTJ3PTbOT@rwKiT2K&=UANX;w6=xH-qc1dp zUd86c2!>xhl!m6GnM+HYnCjt9JF+u6JVcWW6Ho?FtBuI=K1bh9Cw;RuIumOkhLBT2 zVr4FvYqC_Gb)w8Snq6+r1}#Rrwu0crUK9p;S;&(WIhp@hD$0b1j|Dmj1HCNzfnFAI z3y|pCS8!TaaMnT6vmlFB9Tpu}pRRsZfVzu=UwNrI8x5c=uskMnPB<#CF}ZB3>{7F- zRJO@2DJr6=Izdr$IZ(H4v+c>?yNBYtvsqUhH(;ZvZKvRg!PYH5d7}Twoo>mKV5w2{ zEb-#huZ?#yWhfLXM6@#e_T1s-1ok9*uF~J$fwPpYX)Wqtd%ga6YisE6O;9^nB7HVP zg2cuFvPCT=8{G3dJ)wxJB|TxdKE7rO98YwXl3W<%AHQO=6G##N1Q@}{5++}!*$Z7b ztrs}!C}1S&)~Dd#BMagjGKS?TfEAHqw4FRjM}eOZ(XTBcg3>=Y3GX&!)3A)GjG!*3 zp#|2Cl0!_+ZN3+Qu#qqz0k*ehrROfKJe7IKVCvzcdO?DAz^Z6|CK;2h_^u4&92yl# zh=?J@a0<9z?8246|A;XKTHlc;sn-2O}-?KK_)E8wYB;wx?bRyXoY7%C$N~6w0oHLr+T%cdbEoEE2Hl7Hq zH>%itkSmDG^EC$FnXR&;I5^laxl@rz#BHr6v;Zqpk?EBFY`!{Iu3SSh z)S1B;q>8N|*YJyQ&v1q;YgJqz?1TBV)1)&CDR(Q^tgrwKXNWJJE%|I%^ME+ne}K~g z&xu;b#4#XVXdZ1`#<~F7FPom87&S3mS&XYpuz>7{0MKbeI<&<51p$_&#?E@dp^A`_ z?is80#0h|GXJ(}#vMXXoXli)y0#9P8wDQk*HEoe#$#nnX7m(hVe?Kwa|%`w$)+P`{I zH&ozL0pZ`9V_OSPRPAU-46eE;6dbKouIC5Ba^hA-6qX>&|8imG+EKxN=JcqrK(o1z zI8KH(26kpAbSf=&X3uy!BBjcJY-iSbD2rmd$`E!%+?pPmiu63BQKB3A+wx>Gx4U)B;Wj@H@O@3m$F1lMwL3!hjp9I?lZE|h_`8bz51@IY_q zZAh~egzTD$xD(Zp&?X|Ju!p-!E$es1#c3!+A*!A1BE&|v!AH}vzYgxYNi_7oze zCWcT(M$(|i!~16HISwbr`C$?7ERyiFfE*bToWE{P9;<%#;ONr$eXMM0WaIQWYa}b~ z$Mvp(4|hi2hez*|lhd!~d(W1Jm=(F9J8LHS**(ACKQ;FcAFS8DT5dgfxzFTKbGncC zQg!xjxEC5|6auT;*IIu?TqK{Nvg_BmM0cMWc_`K1Mt>FC5Y*Z*=xO(Q=Hrj#liu2I z_W3l}Q!cA+-&gffo4W1>iuFnL;EP_%N(i*1wT`&7sFp3KqRRDfuk|^9GCJM@XI7NJ zS*Bem7q7=zYde^`@B4dwg{ch0dn)tV~?u}VHuJ;xJkxkWO6@;(a>JK%_tSAA3Y!Ts2(OsPeT+rCgdMO4p z-79p9Qsxw>D|_DAP$zCnjh87*`_6t9cKf0;y|$?-8$prS$;U2Le8f&}txrDhb$4-n zc}$Fqaj?tf)uCWJLA0wl@f0i^c?1P@dBw>rIP}ukD zu3mq{N0YcS>aYZVyUHCz_3p~5nZygQKx>WGM{l?3!r$6T%-k-U1P@g8s~n;9>zD;G z$O;y%I0D@!MAwyi3Ij36l|q;kw+Q0scdk2DZf4H?_u02`nnigkNs`gqm|b3Ku03!| z>H=*>qYFg#InQD=%FvcQU`7bt5lF4X#vnn+cY3g?i z&lQJZ@K?Mf?1vVNNa)MIY*s9honFy@v#%$N7c>q;;bEoeYSLNC-INmO_Ala!TennT z9B#aFX~n2&-Pq*kJ|Lf>|GD_|DxeBelQC@+m#(-WKBFG-Wv3rM7;8i0OM+lVu3Jjk zD9Dz*D z^NdkV0({NnzxN0^eZSrZ)m)5AW_dkgxC+)q(P_%xKdiQYCSv;`i*^ddAcc$A(GI~t zG)jH1vKT#f%vwL}MVg~^ZnxuHex93`R@*<{YR&SaT4EhU9TH^q$cQfLy6le!? zc%pj=r^-5|VcbH~+0t%v-g^L%&n(THUM|F6YNorgT(|Yzp~-v-X?A|1?2(&;+Pszq zW5EUE6}dz+8%iB|*^*934brI3k6@;V+kz?=2STnseT$!ArN+JWp7lG(8E*#v5 z)FF&o7FkokSom2&k82Gw0E^P8OCtT()%AhK2#w z$p71(o2L6v+#(=Si^3N}AoG4^MAagohG1q@or{CWB3A9vsO|6oX`x=Mz3$apv|`IT zn6R~1D=Q|wzhv~#*nPdQL9l`W@Pve6Hvj3B_n}6WYEWT5WTV|Z1iCo!%T2^7=zDXe zlC+<9dUQ}^=O;7$&__ahO!+6yLIBu@%DYTiKU1U3p2_dh{S&(xamjNWo zF1h>_fvZi1zs7(!bNr~J!*vQ-zt%eEIbxn$M`YK9curF`ks5U0VWm}mjD4A1j>3kDaW7SO%!(x8r1L)$xDya|uIJCe9(_z-+W*2EXS90n6UYV{bF zCTP6=$!qK@$)E8)u|1(+@q?-q%3;jw;iyxp=hKapQ_N*B-yNzi*QY!K`6hVQyk4XK=e zHp!CQUtFG*?V(whiDGFx%v5L~F_cV7S~z5`s5W`xG->qqstyCxcRpA4!XLy-e@F}f zQe3$k`FsJMHy`IrlbUG?KPXRThS{++8VD)To+Y}`lNR&J6HJH%dF<}QaeU8DkY&*q$b~xO1#j8g2 z--Eq>KlW_3k*Q~I36`v}>cXuJ#iDmu`Z~|&1UO-x)wM5ENHoio1*^3^0VpEyJ)O5MpT&U`cDl8ohxF>M?3W$EZbG{NaNqZjri#74T@|)oJyWhkA z6-UUN|24k}HtxT!iF2}d63IqTLa!fyeiNh@tuG2Y$1nyz*`T%r>6x+7MjHxpPB&0u zij9iR1{8*hIxFee=DElSF1e3vsp#{j^W!;8+G2LhM~`NUU|hS zrpBICXeIqIcK&vToJW-R#hq(J<9v;CCuQ)=VkW&ksMc7gsF~v943;J`3R2Je?~2eiKaO&Gf>Iq*6N+b2Il?^{Jg3 zqixnkWyJ4-6J{wuv;N131OH6;F&`3yN<*9VMGz=v*^h_ehqax~i!fFF*XZ!Dvn0*R zR*f=ieSVF*n6OgNZjX|<3p95GVk%G^tB>VM6mAA#bqqE3%hHRKP`Ry?Sbo{WicS5T zN-eN|e88`SB{Q9mH6RG z~#E>B5n^s^sENO5_RMt_l*pUk{ z=_Sqg7O`8_DG*SPDY80asu%Je$tY-<u>bbQ`v>oQ!M#XNyf z2GStR8Vkx!vU;Zp3jzXPPY0C^i=__Y8~oKe76i>61b_@fj7zUbrWrhrj#nfhI6fgL zx+&@Hf|DPKmB?Zvx>V|bkRAXI5={&;XXS}YjH+3REybuMEDu4tXg+vq7Rjrt3E7Om zS-}q_+YKt@LmV_-FZ$IGr&^Wgw3CN~3>?ObZU5eBUY*lJt=9-&NSgwql@vu23e7{E z*g9m~u;c;)4>AJi1rmYf5Cp0$F@3-2w;DTNgU`yoOkx2tQ%?hp(Ks`omW99sS{@`K z58^0Z{=*0r9%lm`4`DW&Na8!Yj z+*6VQqG978#ljJQ)XHoZ0@UxU`Mb81xdyYXDTw+h4%iad8q%RPD8Mx*6cCnBNnuUe zPXppOqT(>9iC7+CT7|LcKPQ2?p}Z+*VPU-AWIYW+`|2ehd0p8#vzq}3SbXAvl5{H(ST|=<@r{x z-=E>I{~)qA&AUPfPI&+_KnM^L1yLfC3_UT$DiQ%1p8yful;G|LMgkw1&QW-&!Urci z4jQBi2&96{hpLBJoe)Trz>G%&4QNjD@Y5JVxHIDromgFRlqG<2*bB&f5JOP6Kd21C<=fXQ z&7c?_Ac7o#f{F%1T0__XGK@{`VPJT0A|&yw;uyi%Z-iORzgljh#{y9SF+_p*#>1fS zH&n?yPL zfy9TZo8*cildLKpR3`_UG6b806a5OnsZP!@ECNYD18NwUJoA4LAEh%z#C%3!duIa< zbeVxaNi3j~t_wi{)HpN*AKX&BysQAo7yAE+FM<)!A%=*8%P{IByd$G02^6NL#Kd;w z`1+X^2ce?VxC_5%av>;>Kn8$5MoE9V7{s~l47i`*c!Z$frYv6{f?_zlO+adfE6~J& z@*sdj01#{jqD-aksz_jqr_hX)szTSu~;8EVV_gLtu<5 zYCLyQP;f{j{{Yh@O2D$8!vBlZg_a5d(X~J0wuR0nr{3=(>`x?-qWEZ*;t)Uoh!{-( z2Ka0UJWahGuuph{rF%4i+yuaof=1vD;3iLNL*kPwdw!BVAxW_m=j*2CMy9nctp z&4Ouyqj*SzSO-W-vf2wo~3L72~gFsxqGdwgUq?56&b_1matmmtmo+xUF z5%Wz7r2>VNjHbr5mxPQ80_Osf&@iAG; zgMerT=&^j0ZLbGA!LwC$hDi4S5AYBKSuhOzgNW<{#8XUsQeZ@L!mkrnL7)_ytVWc| z?PD{8LW5umf#fdTvI~-vXS~2VkROQ>liC3Z@JGGW1g8v>Hck46@c_fnq!9=*%P^@4 z$!8M%79l`LPG&-ufRJo_Q+p0`gs@6cU5^qq#F70ob@&6x3Ua_4fQMup!1N6Qy!b2j zT6+ADV$ihm2f4f&jG;O$qWEjbkjx#i{-1`Zu;5d_$+*{MQ0RjI>@*-8 zf}-`an|xqMAu%uz#WTZqQy_Nj?W2_V-%-A+B^p_yiue#iP5qH#K&p0@MSlWw8t`r_ z+s$vMR-k}ohWrsQ)c?ej7Edtzf5j8onh!)>+W6a6E`|K?8)j1vIDpLmQ{8t*MYSw@ zlQRN>D3XRG8746U5+vs&Npc<}XHaq$1d$*?0f|b^ha4rT@T&TwH4eTQU7!(TQ0hNktcTA%e0a;7#_=dvFU2^>vlZbeF+Pjl3{soT$8r!<&}>X_P|ojr7a@X#Qox`giS zoU5O=7f0VYYYsdr>Rrz6L%oK>FOzd$Yy2t&ZTsuzXDON(mc5$=uT6%&JF(jyK6KsT zeRuEOT*3U*QPy_ORIheJBRxq+vU<9or>6JA29^)|j(Q^<_eE{KmSXvOenuY&Fsp zY5wNU_R*Kz7eT=JUDHVaB*MnWPE!*xOldcsAfd5x)PE1_{%wQpiT%a74jH5CQIke= zPbVkmDo$n&xia?)Y@o9oM>21P^)|<(CTmEq3>zG7E{;!ro88yKHfqW;w(QEUH-1!i zXu#(w{y#3&phq#j!K@3 zBCD=7Rv+4nfV0Gpbi-M$NmVD*c{>?YaL03(7dg4{zfG979K_SC_=IOL!t3-oFi@_p z&i93Dns;%Xh9^h3%;yJwhbtv*4>q}-0i!&w#vWp>0E6b9fXF+JpXPj+an%NQEY+m0 zyR|I14Tfp#AMJu}_-r*#UFoJy_Lh~pewc2d>rTkU8`d?v*KLnZ-`~5Vb!$2CTFf^M z*9mS%Cj%&BJa-*7$9F%Ogoh09Kg1fW}QxO$A~M3GvJfn*QW2oH0p(LGzP_S6Ru0*4()Z*d>}$hoh#$2t?%#*NOjX_8 zj`O;t7j&P`1-+y>G^jL}%r~%X-wCvotP?S7Uz@U?(m-e~%oJHn$A?PU-3*`DJxp9Y zvNx#H8mAan5b>-Le){$0>9<|`Mjl^0hf$;TzK-F2A?4!n*{S1gScAZwsZUWS+w}+X zoLSbV<&{L=WBn9FXHHK0+qUfvKY#xA)xc0`r=ZUXp}V>3HhSCp*1hf7ZwK{rZS%9h zX~oT&65pF7i*v)c*5ahTeGj=}UydyUzNN~DY>r-Ik>+?y(?qJ@-d#*qDR^I0G8oT834WdvHu&0nn zlgD!r(>ehWVUGhk-=lba>f^Bhn|1FHH|nPQ`Y~-h4GlAN_VjNT6;^vk{PVvBsgxLc zUPl%ZUp-!s*)(eYzB63Vf2ZmE%fdMC>C(zV;yoj8pS@AOyKUpmer3mZyf9qF_RUJ7}~XDx8sq^>a~Y+L{czeEslrHGudNW*^o06IjH( zd-2MK037@@u+cUtj>C*|+F zsb$NBnRIAaBAn_IW2J6@K{SuhcY_Q|t`o5}eRzyc{&37Hq=$}7PL{IGZC&SGyJfG( zt@k3UwFKi98N$x26FZ(8tsR_!=h@0DwGT|YONOaK2Iy)C$4#1W8!7L%(lSIsOX-yb z!O~93Zpt(6_^z)U2)_~+Ux(eF{d}x^bE(=?rfhT-8}s%+wXoV|65i>nTdgaXOT{~N! zM_(-=*NkJUfwp2;fFQ|>JLVRw#A|wGSszxASD{@Z44uf#i4q4sDvy^wKC_Z}%hs1y z^-U>x{=?T+M@tvcyO~XImffr!26cUs_dDpX(Lh^wvTx6%nwP0ZYaWMjY)%g3a&&(S zi{-3KfO0G>kkQinu%x_D*3G-wl^?Ju?}ww)U)Ov%$o(|k11NU5*9P|W@+CJ)ky+dh zT^OBQGVu1jZb1Lm$8!gMzGL&rJF?)_T_v9zk8cOA(n${GFx1+Q zcjCUf9Z64c?T&nKT;vl%O%d4Y!)htHspdLApAS=U5*S|L!5>d3 zT{qp`3`GK8-Pbv<8IGlEbD1s-mC1dTsxcwj?VnxYf7=$1 zuDBlfy}DxDaBJtu2Z>+!Y&nXylym~Grv`9)W4J{-uY&noBx&ZpQ7Db%-=f}S)m)=$ zfKymE7>(tNXkpc~e18Aj-^Z&j0;9s(y$dtwLb~Ha##YMqsG8wH+b-*s1vg%C$p8AYi9>S;amc>MeMwo^ZRbi zc_76yEOJ0sDSqOb40%dIaw0u?P?F)<8hS-v#MY+9iPj+y+p{7BBUwc=PZYkg`Dxn`L# z6T*=P<-2qGk?FgcG`U8?YFz*|^R2Q@-ywm(;*rFctvO516JyEShq|4tPs$Q>9vMBQ zXqFkx+^B*=c5Eq&$Q6nBxdqHK<${W*fiJ@VA3gODy&;}mC7yL2D(?CKTo1r`yx08(bhA}6>8hiM%TWEZ6+Y43;dA@1Oq%7OIN+xf@$22+nTApfLPcqxz5126j z)CnDRDoUD{c&hiceire(s4vaD+z)@5mBIP6$t8=^cS}NKs-O?ere?~vH$%}$gioOI z9VEB&+1Kmb*PsKBt`!=^9k=h&IGN7rn9LA-zk9yr9|DQf;UN0-rLFx2O{$sl=hY zXVs85__n$xIbP^zPTTWy-(5ODVSjU1@OKqFE@s;Qox6hnsR|yjf2)EA2nvV(w3RX* zbu++Eirh-MWk(BG2p?&DBf=axY!TyXFu9(IYG|6tR8=Px`|PX3X`UdHeEC{-3?=&2 zsCI__o)-c%i(>Wq*0;-qBAgSsB<$)&M65`Xl-=6O-amWWnYMMF{MOYu=WMq`Ssb{X zQzJ7zQ$ppG+xOnN0OYMKFrT1w17vG@gF=Ld+-?WNDNYp~B5NM~dX^`*e9rcWSjEeY z{GB8Ft|xWxsh60vhc2x0Nh<4sbnV0~zGHjl$)|$-puCNJ8sh1i7d&M*+P>XNnx`6B zU#qD!*y3w}Mv1r=Fs?grW8>U#<8BpjoNqBK>J{oz3Z(p_#W@cV@LD~nQY+nqj;}s3 zRe`p8&xWXyooh{zWSX6~FW1ghkArjIBj#i^Eq_1rJ5@|PV=w;#_3@>aap9F(TJO@D z@t3a)uQY+F!@5c$Ur$#Akv#t6C8fwbg>_lCtR3y=Y6oh^%6X6mcJr+?atpT+rsb69 z337H?5JRxKQBKF$9FKP?8`exoiu(ONnyx43I1V@V=7n}n3~@%17inqp)gzv(T0Yv* zl@9zo=%sTtjjP71P76BVAfbTDGO&q-=;b)ymIWN(%qb zm02izR_NAVm75f_e50YKU4MUjZiD&*2XnoULZ`yjZM|CF7cE|5gTkM$JNia2^>W;e z)y5EQCztf~Bq2G4GG~0Umtq(~TeFK{IT?4-Eml^VmXVKIKIsgY7!e{MZpk+pITMQ;IQzC?-5TEZ|9TMg& zKWSCDdN(?`;%diOXt<6Nj|IE{63;DF($a4-9{Q5Y+_U+BL{QYq+&oAUODDElJD7FZ z6cEDNYx>+>ud?xWZv@wMDHbV#TMzB`2=_eQ!I7Nm z|3o-Evt8&g1Rx?3HNR%1f9zJjaB_RUdud(N0Hi8re=xOQ(CHt6ecOVr);2Zcw$^=2 zmgN`k(8@fTjP`wcu5anY)%x(B;mW3oWP8>YtT_5Q!EX^)O?rr4`9|O4l~Wxfw#@>L z@8q$fBGki~A-$99?(40{0=^!u|BB(cyo5FO`=O$SnQQqyL2R7ZrTWC_f6RIsulX0p zKEBZh%TZp$&^0FddQ&68Ict}_ZSNMPP0aDueLkI+#O|ckg<3rAujbcCZa zx`EW2lauIGt_{-bTK6gIh5EzgD^+H55R3%`SQ+*Ls%Q-KgVt=Hzt}%ZG~b`K;TEF~ zAPQz6txMAHo$>RY*QN|zyP`>CIzann;k!xA%h(50bfI`!&nAiJ`tRaobh)$eh{vfO zd=Z@c^gdj)HvN?Q+!0^@hE7;S7xJ+bb~9e9v+KF~W1z424a_ok4LzUYC=ra%0nIAu z($M^LHBdBv<;ShuRd;cZ!s;k+yMl9?I9X%!^BAso;E&CQ4Ji`BGR7R*e!~zw-omN`X(BH4r8fow$n*gvI5VHN+(?C$ii!Kl5;RD@(bug+tt*a?T?m z2_ck8NX7iri5OOB^SE{eSc~+Q77nfB~&@N~2#yr`Vwe!kbz2}v6{^&6`yAYl?x!1BaYNiKO21{r$ zNZ2u|=$ypmx7nVk?CE#YoD+V2wok7T!s`Av)7Rgfpud|qf6sE!sK zcSFVIIxnWXu39v6P5xegTq!WKQ`TvgM4U*CPtV20fzCqGMWgCY*FFJnISGCiO~tbKp@*~ zloF}Q$ES;3G*>8mL_RZAyv6mp)5<@RlNG)6JJlqSDycVKJq?+- zJl24&B^sKQzc8i>6_J(yv|OF03I@W(|MP7uEaa05^XMxKd?T?duTa}K!WQu%ie&M< zSPXI!E503%(|fLvzG4EfagwqGASCl%pSIwVBI|{R-4D-FWO_XqeZ?~Em6-_#TRkSu zI3rLSAIK8)3RP)8Pl1ezMKt<;_`Gc(-LNzl4aqwGx&pFXcnqpsxCg2!2TMNpLVv*f z_f}#!QznSrU((Ow=X=9qkqRK9P_kbqTsBo0Xn0^_yLaz*SOG zF3jjyvD?}l<3r;YyM&PNQdc5tad;$`Os7q8`^M@31DV)ujKFe?yH~YwBa2V%QUuwM-6+I*j;v!YTg0|F@;VGz@BBTaqXi}wWd+wt z4LuJ&?+{034P=W1RYO!$0ftHqVh&26vus#LE+d>kX-^CFMQ(JcRIwgtYm2bepwn_-`Hx!tI13&>#e70n=JOpXGHeYSW$E;RT?n+7@4)0aVNu1j^XwrszPQUKQFTPhWtg? zCs=%`05FYV{td){PgYuvJWETosL}z4r29&Y!Et!$l>=yKLug(&sm|0xXu@$7MXAJH zyJ#(Lcz6luvYh~0F1I+6B34u;ZvQP4mH8`yEyG@6eq^=M zc}~)`>)%p|N2G;;>N54pT|)&a?dJsc_Xv~O>+$?sgi$RR?LNlC`Bv%a*tC(HnfxC` zi#0dBuF9X2{lCUo^oXu-#nb;jTI`Bak&9Si;#;+7IcD$&V9}J#`pSJ#}`FeNMCq@@PjOtN8z% z>|Ke@+cWYD!^_{if@b7yuRn#g}3m?Cl2u1-y8mNUj58S$qe*_LNelo zWeH*T^x583?7dwZtdx7zoPCr{)b3#16`$!o#;;K%);*u;sMDiJoat%I7m|u?KkaR} z1Qo+KtBuvi;0}nlraVeh>X!7zF5_&oI;Oj!-O!8#ghDCj|h#kpE z)=7Hiu!R?NoFppQW_R~^+0tmgq`0@B?QD5>uYYo~(xX{tv$sAg>-%o)5pwh2o8p59 z*)U#vx~LG3re>exg~8VzA2$3ddU7f!=#?4I+#Se;muU6rM`c*f9*vDP4VSWRR@fgr zn4DbocbRN(b|&0ix3D8GKD(7dz^U;1`@DDMWb#C#U}{ffVbH z!q>TRu2l;kzfyL4`1nb6@zwqOxzp*%!3v2@3uGn8lAXDahWgz$1^FCFV-*JX;v&C) z%I9sqLq97&+!=O#oW7^K|2u-N#Lt6Yf9A#fzTfH}VIS9(ucp2`4rzTEnI=CBdsc6> zIJs57dt!(4pe@|rLF6hBwlU9^a6fmo%F<6z?3w<|1Z7f*14JfHU!-EgVQ3|L>D|!^ zN3GlFLe?25Cw{!%Yt>d#bA01jyGD2vZpb76r_l?V({}W{?13MM+0>Rhf44G!CG+Mp z=%Ruud}FxJd_ZRSkm)h{Oi6$DL8vLN>8ODt+xBrs=v9f8h0v=(-jxYjM|1o}RX3_~ zZF@DY`}}bzy&FO*)=kI|^oZqJ4Zt{or`YJ0&yBTaUX4DGF9!0#@~F|<@qWtX#etBW z>qeWSy9?dz2k|E!R?B2KdmzhN&d2EyH$U(28-?E3AN9cf=H__EgL`vXHS~t77_DSB z0{&(PtwhMMd5yBP?-Tdt9N?@x9UzQj;7+Jdvq(tRMmdFX{h=pYYlpf&Q^L#B)`G^5 z3TsX7n@T)(USzIitDV6S6-K1M?(5^c1^#D`omY6SkrR-aB_1^5>1qcopf_P`A0w_U zz00)oy^n3Wwv&wPE>VEIrcuDdvvLAgH_%xh#%bz+D$W%H?U0V~6UMED7dM$59ltv{YcS(i^VO%6sEzO2!^!RnJGyZ1P#l5PlwCu-{(M z{pO|~L)~P-=8s-3XUhNisTA)j_WJFF)xD;7;9Wf4EcNWmA9XGZ=uI2~d$$i~wM(EB9bJ zQpn%Ue?{up3N((1&zHK3RpzDbFK)kA=ntC}<}L$<&Bkb%8uPnTR%&psdG6;~42F{r z5G=vzC=1(}4)Mm=XuRWaYxU&tuNcVTsBr2yBL*{u@#Z@=;H_ z*tLmvF)Hpi$;>pNP%ufgbyh16n?woK6?URRDUcWf<{D^!Nta^ zbJpg9oh|E18bXXl$Gh-knvsBRS_r}{Z__1!$kBNty#%e~Bd{BkJQ3r4#S&U96_kS- zT3Ug)q4#476wYaKx;tz8c_y9j?19oUYZT&eb|InO2tWk4kbK5&SqxVL8DGXABoJo3 z%x*48L+wdWMlEpfX6GQ%2xWHVyE%t)Po`StS-H}SKMiAH^m4z(!YyHL%ZV=}T|J-g zXie}+V$NbTX70C7yIr0MP*?6Pt`iF4A?deEe0P3jlF2Cs`)={a6X$L(W%1c;~zCx$c|Ra?)<`=zG6>lmYyCS&>NZt#R|671>L&Qx2tsmZsw z9=)j-i=Di;>381X{W7#;UB|I?Ba@>3+3h$p+_#8bIM+zHO!@LrBIag3Q=abKDRTBJ z!u|mz{-H$rjEzesoS2)|hd!9C=v7A_h&%-y?&x0?h#Ng)2beta!4aE2T$d{sd_QX? zEu5vzBu$CtD2>hW5Tx_Xigm@pMRKFlc^hItfG##%w$Z!baL356uEFx<_H5MCciey6bEjs3cA3Or+|~NXX9h3q1C!Meri0k^ zOnC%C(|xO2O==oFrNQd9;hmzRDsQw%@=smqXy$pnsU<+9ymDa=eW&YP+?D;;KDa|)_SaJM4S0D=9C#8ra3aN?(DbAdzy^XI^M!`$ zQ#mP!em3oDI5{2OTjlB=dglCSK|qVeVEBEnLrFoo-GXAY>5S5|nBx2^ysPc1)pOpN zSzU{wUrd^jr|HuJ`m-1@4_S8#B-2b8+xlV@j#QLsWSf@XEP}3!5z1x`9+w-gkDcXT zt*0F*q2o7HxQCh0GfkJCKjS<89FG^&Dg$*r z)E+$c;l<&Xb?uI6s68Z&Cj1b1F!yypvyM{yZI2+)SL=Q})&gTK>pYL~ff`kM^i=9M zQ-u^KkA3ALL=Ubt-|^uQY$89~eqHJ+Ml9t3W72fE|2XMrRCQ|>i(lI5N!eXYyV{AM z-L8ahnG5EG3;pqu+r|yLVt#HVxdb2mcd<3De(Dfj^qPlY^wo!!rQ6XRvM&UKX|Tw? z3a`<6ehqo!e!QIKmwQvJ^WC0dDtV{dcC3B~=8;ME!(b5QdCVTYY%S#z;EW-b z1ws8BepW?W!sF%M9Ar-#k8t{%BW$8$jclv=?Nxk&IPHg0rmxO4uHw@cV&cw`ydSOf zhhYe31T%U2>qu8JLlRooI6oUavjI+v>ezf48~*@(JaKPUwmBvcTbYuHfWLtJ3Vvu1 z6ck#aKb_*Js2Xkh(o`W}ZD88nUDA7!?hxQu?cC1^FHBnR;?}sK*|5b0%#^&B7#$aT zV10}%muJk{nCc*!Q}7wUEO|mHEy1S2V)5So6?yc6YhV%fI1Ya-dsd`PmDKZ8^1VrX z>d4U$EV#VYO%azCI1fIQ3qyG2dp&s+ZEft%86u_%4znT7seG!L!TgT}tbo*b{^_-6t+<{IBDI{PJ6ij!UCo?$3za zW0=n`X>>nqwPk%3HdLbg-Gi`mB(i^33^#_9qLLsyzKQkaKv=r?A7z5Dg$!CPJ=yGp z1IVsaoQlf+@px@^x=&hu$x{ohM#m0OqoVh?(^Fz12Itt3`g3V5QyU)_Wrnw>qSv~Z zQkkFH2q&uT)y&37Y;ILPa`bW;4o&&W3Twnmq8k=GrTsW)TSK`b`1GFVPz(U%|8OQ~ zk&|u9lefzLBQcR_^P&rr+LN>gjXt?}7|ODAJtN2(6f0v!v0m{>s`qhyMa%?xXZ!d} z67`%cZLVdj%{+;@TeR!!N-ir{@&KVYa4-Drd_4 zt<=JF6#|?jS@?(U;*}_`crQ~4UG&$aGO(cp8UAJ;ohg_2sFR%!t>4hI^1Dvy@q5$v zi1nvam&;V6M6DT}=hxm95SFtiQ)U|G3*>Q(@;y)u%I0ZxW9r>LybFKP?7iaiM*kkr zZ+@Hj-hw8}G2L2~3`X^GpEo?vLreNe5-%}1Eg#>KDNE?ND)IB8D;ymG?`~0?Ll$`> zzN3TrfUCdXiNb$6{VU;M?~1T@bpgQsKObL)q0UsR@hTzAtxUun9_pcVL)6D5*5I49sW33w5@SScmM%*;U$ zqYa?UT~=4h(gOH~s&uF)#lE_hU;h4+`9>LJT&GPFoxs4^oRN~{69q7sk4+86e~J-w zu;YuaJB!)SgzO9a)dtc#)~y#A5ck#;ru>9IGJ68%)TZ4EO z>F12|EOmioc7dWcWGg`NcAzc9S6FjcGw6fnI{D3)__Q*kXN5skUJYxT%GvR`Y9D1n zY7NX^xKgd93_K7VZ|m)gR(jtO`*r<%HK)EM1a^0~@3~(b!ztQAaKY`r!O~Crga3)8 z3;+D@{HpnLE0YNF#j9%KjD#-WKSIt=JD4O9F0OhgB&qRg>*yli`9L5f&Hz9IUJWZ( zTLha62nsZ^cedaI8^L*iJP!eGj^-w=2ml!1jIc$RxF7)b4z36n_J1e>M{Vm;`w6B$ zZS%S)3!viWYHMYWaN(73a6>8%;+3{?c5wy3e-xirH2LS}zhwM0yy|YIt{#pEUX&=% z#a~`&Wc2ciBQ?4BAd9edN4Q#?CG zCjiiehXEke1_(6(2&D(|?FS3^2MhQI3;2Qsi6oTAR88*x<#gab;c~(9mn*0PF_~><0_%g5^I_;Ub!UR^ei{QUky*Z2KEg z;D0rqaFh-|OZqWn7sIRu_|b9U&*bqpVj*B&ISp+MHZTu}2hRSNm*79a1m#yH2Xh3k zrVHYqv3=oj2@_WnTZj9+|DXbX=2CTbFn2RUII~%4ARf8`F025UdH_Hg5N(a0%z5aH zupj^e;QR!@f4%@PK0XK^zyk0m4Fo~eHbK1r_CIJKAQT8kDt(CtLRoo<21YG${Y*oB zMg`E%G^9Kz3d5IZ5I!W5f2N_n2|?oRR~jD}6%ChYQ1EXw0T2`!qrdVAKp>ZNMvgZ> z3WUG#fxti%z<;IjAzN(xM&n0igh9mp;tzg-ssgYy4&4SqQA zvM-U2t|SZlFm>t7?pQ_u>%T&qVnM-+VB401AzrD%i{w<`7g`kg987C21W(@ zFW2CM!BFY`5{(~pSr-@xIjooXU?4E~@)#h^5cuu8NMBy|2MqSRZ7>)==#qbtK7t8c z)(;NkgJ0qU!ja*7SwA?^y_b9rg!A$L=1VwC0Cj@xmoY#}L(MwB(ggT_i&cJ9M!Uqv z4}t#{tH^KuHqQJ=WiI=J9}b6KwpRfBdp-~VL&3lCK_S4)@&usJ-|&L8_O~1%00Upv z83Y6(o%yS6NE+<2y+|MNqo(wq#|niO$fdDI(jb4s2fv(ikn(`Q->wT0KxXSp*Fc(f z$w$cV3S71q1mpvv?nwWkpR2Qpl`X;)2;{Jd2qE}DFqj20iJ9^P;U-`>*uny03WEtiVGs)_h~HGi ufLG1I0eKIM^aN6>x|JsaIT<0RTNhUoXV;6_38@fB08YTdBBdft@c#fFX?ySh literal 0 HcmV?d00001 From 689dd613791439b04b2cce6a45ebb9b99c95d098 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 22 Apr 2020 13:34:11 +0800 Subject: [PATCH 296/919] nrf: nrf52833: use s140 v7.0.1 Previously, we were using v6.1.1 which worked, but was unsupported. v7.0.1 is the first version of s140 that supports the nRF52833. Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index e483d455e7..410d3750e5 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -81,7 +81,7 @@ MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52833 SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 +SOFTDEV_VERSION ?= 7.0.1 BOOT_SETTING_ADDR = 0x7F000 NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 From b87af3b0719cfd1d75c3ddce6fd1352da510ed55 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 22 Apr 2020 09:04:12 -0500 Subject: [PATCH 297/919] ulab: Update from upstream Closes: #2787 --- shared-bindings/ulab/__init__.rst | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst index c9f2617ff0..d2ff7eb80b 100644 --- a/shared-bindings/ulab/__init__.rst +++ b/shared-bindings/ulab/__init__.rst @@ -191,6 +191,38 @@ Basic Array defining functions Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly. +:mod:`ulab.compare` --- Comparison functions +============================================ + +.. module::ulab.compare + +.. method:: clip(x1, x2, x3) + + Constrain the values from ``x1`` to be between ``x2`` and ``x3``. + ``x2`` is assumed to be less than or equal to ``x3``. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are all scalars, a 1-element + array is returned. + + Shorthand for ``ulab.maximum(x2, ulab.minimum(x1, x3))`` + +.. method:: maximum(x1, x2) + + Compute the element by element maximum of the arguments. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are both scalars, a number is + returned + +.. method:: minimum(x1, x2) + + Compute the element by element minimum of the arguments. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are both scalars, a number is + returned + :mod:`ulab.vector` --- Element-by-element functions =================================================== From b277944cf0b7e35b6c64d668c55bbf05371fb62f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 22 Apr 2020 11:10:51 -0700 Subject: [PATCH 298/919] Fix STM so it matches the correct RTC fields. --- .../feather_stm32f405_express/mpconfigboard.h | 2 +- ports/stm/supervisor/port.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 59c48f88ad..e002bbed1f 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -36,7 +36,7 @@ #define BOARD_OSC_DIV (12) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PB05) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index ab8cb0be21..779348c02a 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -321,7 +321,8 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { *subticks = subseconds % 32; } - return ((uint64_t) 1024) * (seconds_to_date + seconds_to_minute + seconds) + subseconds / 32; + uint64_t raw_ticks = ((uint64_t) 1024) * (seconds_to_date + seconds_to_minute + seconds) + subseconds / 32; + return raw_ticks; } void RTC_WKUP_IRQHandler(void) { @@ -329,11 +330,12 @@ void RTC_WKUP_IRQHandler(void) { __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&_hrtc, RTC_FLAG_WUTF); __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); } + volatile bool alarmed_already = false; void RTC_Alarm_IRQHandler(void) { - __HAL_RTC_ALARM_CLEAR_FLAG(&_hrtc, RTC_FLAG_ALRAF); - __HAL_RTC_ALARM_EXTI_CLEAR_FLAG(); HAL_RTC_DeactivateAlarm(&_hrtc, RTC_ALARM_A); + __HAL_RTC_ALARM_EXTI_CLEAR_FLAG(); + __HAL_RTC_ALARM_CLEAR_FLAG(&_hrtc, RTC_FLAG_ALRAF); alarmed_already = true; } @@ -362,15 +364,19 @@ void port_interrupt_after_ticks(uint32_t ticks) { alarm.AlarmTime.Minutes = tm.tm_min; alarm.AlarmTime.Seconds = tm.tm_sec; alarm.AlarmDateWeekDay = tm.tm_mday; - alarm.AlarmMask = RTC_ALARMMASK_ALL; - } else { + // Masking here means that the value is ignored so we set none. alarm.AlarmMask = RTC_ALARMMASK_NONE; + } else { + // Masking here means that the value is ignored so we set them all. Only the subseconds + // value matters. + alarm.AlarmMask = RTC_ALARMMASK_ALL; } alarm.AlarmTime.SubSeconds = RTC_CLOCK_FREQUENCY - - ((raw_ticks % (1024)) * 32); + ((raw_ticks % 1024) * 32); alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; + // Masking here means that the bits are ignored so we set none of them. alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE; alarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE; alarm.Alarm = RTC_ALARM_A; From a18b991ca90670758afadfe0e78ec97cf56bf5e3 Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 22 Apr 2020 15:22:34 -0400 Subject: [PATCH 299/919] Added pyi to SPI.c --- shared-bindings/busio/SPI.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 043c1089d5..e01e9e35e5 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -40,6 +40,19 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" +class SPI: + def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): ... + def deinit(self, ) -> Any: ... + def __enter__(self, ) -> Any: ... + def __exit__(self, ) -> Any: ... + def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: ... + def try_lock(self, ) -> Any: ... + def unlock(self, ) -> Any: ... + def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... + def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: ... + def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: ... + frequency: Any = ... + //| .. currentmodule:: busio //| //| :class:`SPI` -- a 3-4 wire serial protocol From d0a210654767677d6d26f1d4d40c378e03e9ca8e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 20 Apr 2020 09:44:16 -0400 Subject: [PATCH 300/919] Remove old build flags, add fixes for shared_matrix --- docs/porting.rst | 41 +++++++++- docs/shared_bindings_matrix.py | 13 ++-- ports/stm/mpconfigport.mk | 132 ++++++++++----------------------- py/circuitpy_mpconfig.h | 12 +-- py/circuitpy_mpconfig.mk | 82 +++++++------------- 5 files changed, 113 insertions(+), 167 deletions(-) diff --git a/docs/porting.rst b/docs/porting.rst index 6bb5144588..1fb9d13bc6 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -1,5 +1,5 @@ We love CircuitPython and would love to see it come to more microcontroller -platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to +platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to add support. While there are some major differences between ports, this page covers the similarities that make CircuitPython what it is and how that core fits into a variety of microcontrollers. @@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In CircuitPython we've dubbed this component the supervisor because it monitors and facilitates the VMs which run user Python code. Porting involves the supervisor because many of the tasks it does while interfacing with the -hardware. Once its going though, the REPL works and debugging can migrate to a +hardware. Once complete, the REPL works and debugging can migrate to a Python based approach rather than C. The third core piece is the plethora of low level APIs that CircuitPython @@ -42,6 +42,43 @@ to the port's directory (in the top level until the ``ports`` directory is present). This includes the Makefile and any C library resources. Make sure these resources are compatible with the MIT License of the rest of the code! +Circuitpython has a number of modules enabled by default in +``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in +``mpconfigboard.mk`` during the early stages of a port in order for it to +compile. As the port progresses in module support, this list can be pruned down +as a natural "TODO" list. An example minimal build list is shown below: + +.. code-block:: makefile + + # Items requiring ports//common-hal implementation: + CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create + CIRCUITPY_DIGITALIO = 0 # Typically the second module to create + CIRCUITPY_ANALOGIO = 0 + CIRCUITPY_BUSIO = 0 + CIRCUITPY_NEOPIXEL_WRITE = 0 + CIRCUITPY_PULSEIO = 0 + CIRCUITPY_OS = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) + + # Modules with no common-hal implementation, but depend on something else + CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO + CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO + CIRCUITPY_PIXELBUF = 0 # Does nothing without a neopixel or 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 + Step 2: Init -------------- Once your build is setup, the next step should be to get your clocks going as diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index ab26366c2e..0473c5119a 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -26,7 +26,7 @@ import os import re -SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm32f4", "mimxrt10xx"] +SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"] def parse_port_config(contents, chip_keyword=None): @@ -140,6 +140,9 @@ def get_excluded_boards(base): chip_keyword = "CHIP_FAMILY" elif port in ["nrf"]: re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)") + elif port in ["stm"]: + re_board_chip = re.compile("MCU_SERIES\s*=\s*(\w+)") + chip_keyword = "MCU_SERIES" port_dir = "ports/{}".format(port) @@ -158,10 +161,10 @@ def get_excluded_boards(base): contents = board.read() board_chip = re_board_chip.search(contents) - #print(entry.name, board_chip.group(1)) if not board_chip: board_chip = "Unknown Chip" else: + #print(entry.name, board_chip.group(1)) board_chip = board_chip.group(1) # add port_config results to contents @@ -178,12 +181,6 @@ def get_excluded_boards(base): if small_build and base[module]["full_build"] == "1": board_is_excluded = True - # check if board uses `MINIMAL_BUILD`. if yes, and current - # module is marked as `DEFAULT_BUILD`, board is excluded - min_build = re.search("CIRCUITPY_MINIMAL_BUILD = 1", contents) - if min_build and base[module]["default_value"] == "CIRCUITPY_DEFAULT_BUILD": - board_is_excluded = True - # check if module is specifically disabled for this board re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper()) find_module = re.search(re_pattern, contents) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 323fd76466..15254f9179 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,106 +1,56 @@ -# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk -# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. -# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz - -# Internal math library is substantially smaller than toolchain one +LONGINT_IMPL = MPZ INTERNAL_LIBM = 1 - -# Chip supplied serial number, in bytes USB_SERIAL_NUMBER_LENGTH = 24 -# Longints can be implemented as mpz, as longlong, or not -LONGINT_IMPL = MPZ - -# Reduced feature set for early port -CIRCUITPY_MINIMAL_BUILD = 1 - -# The ifndef's allow overriding in mpconfigboard.mk. - -ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = 1 +ifeq ($(MCU_SERIES),F4) + # Items requiring common-hal implementation: + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + # Can be overridden on board level + ifndef CIRCUITPY_NVM + CIRCUITPY_NVM = 0 + endif endif -ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = 1 -endif - -ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = 1 -endif - -ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = 1 -endif - -ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = 1 -endif - -ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = 1 -endif - -ifndef CIRCUITPY_OS -CIRCUITPY_OS = 1 -endif - -ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = 1 -endif - -ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = 1 -endif - -ifndef CRICUITPY_USB_HID -CIRCUITPY_USB_HID = 1 -endif - -ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = 1 -endif - -ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = 1 -endif - -ifndef CIRCUITPY_DISPLAYIO -CIRCUITPY_DISPLAYIO = 1 -endif - -CFLAGS += -DMICROPY_CPYTHON_COMPAT=1 - -CIRCUITPY_ULAB = 1 - -ifeq ($(MCU_SERIES), H7) - CIRCUITPY_BOARD = 1 - CIRCUITPY_DIGITALIO = 1 +ifeq ($(MCU_SERIES),H7) + # Items requiring common-hal implementation: CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 1 + CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_OS = 0 - CIRCUITPY_STORAGE = 0 - CIRCUITPY_RANDOM = 0 - CIRCUITPY_USB_HID = 0 - CIRCUITPY_USB_MIDI = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_DISPLAYIO = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + # Modules with no common-hal implementation that depend on something else + CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) + CIRCUITPY_RANDOM = 0 # Requires OS + CIRCUITPY_STORAGE = 0 # Requires OS, filesystem endif -ifeq ($(MCU_SERIES), F7) - CIRCUITPY_BOARD = 1 - CIRCUITPY_DIGITALIO = 1 +ifeq ($(MCU_SERIES),F7) + # Items requiring common-hal implementation: CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_MICROCONTROLLER = 1 - CIRCUITPY_BUSIO = 1 + CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_OS = 0 - CIRCUITPY_STORAGE = 0 - CIRCUITPY_RANDOM = 0 - CIRCUITPY_USB_HID = 0 - CIRCUITPY_USB_MIDI = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_DISPLAYIO = 0 + CIRCUITPY_NVM = 0 + CIRCUITPY_AUDIOBUSIO = 0 + CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_RTC = 0 + CIRCUITPY_FREQUENCYIO = 0 + CIRCUITPY_I2CSLAVE = 0 + # Modules with no common-hal implementation that depend on something else + CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) + CIRCUITPY_RANDOM = 0 # Requires OS + CIRCUITPY_STORAGE = 0 # Requires OS, filesystem endif diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 06289258d1..89e9396dda 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -179,17 +179,11 @@ typedef long mp_off_t; // board-specific definitions, which control and may override definitions below. #include "mpconfigboard.h" -// CIRCUITPY_FULL_BUILD is defined in a *.mk file. - +// CIRCUITPY_FULL_BUILD is defined in py/circuitpy_mpconfig.mk // Remove some lesser-used functionality to make small builds fit. #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) -//TODO: replace this with a rework of the FULL_BUILD system -#if !defined(MICROPY_CPYTHON_COMPAT) - #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) -#endif -#if !defined(MICROPY_COMP_FSTRING_LITERAL) +#define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) -#endif #define MICROPY_MODULE_WEAK_LINKS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_BUILTINS_COMPLEX (CIRCUITPY_FULL_BUILD) @@ -223,7 +217,7 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif -#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !CIRCUITPY_MINIMAL_BUILD +#if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !DISABLE_FILESYSTEM #error No *_FLASH_FILESYSTEM set! #endif diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ba94f9784f..1c2afc33e7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -23,13 +23,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# mpconfigboard.mk files can specify: -# CIRCUITPY_FULL_BUILD = 1 (which is the default) -# or -# CIRCUITPY_SMALL_BUILD = 1 -# which is the same as: -# CIRCUITPY_FULL_BUILD = 0 +# Boards default to all modules enabled (with exceptions) +# Manually disable by overriding in #mpconfigboard.mk +# Smaller builds can be forced for resource constrained chips, typically SAMD21s +# without external flash. Avoid using this for incomplete ports, as it changes +# settings in other files. ifndef CIRCUITPY_FULL_BUILD ifeq ($(CIRCUITPY_SMALL_BUILD),1) CIRCUITPY_FULL_BUILD = 0 @@ -39,38 +38,8 @@ ifndef CIRCUITPY_FULL_BUILD endif CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) -# Setting CIRCUITPY_MINIMAL_BUILD = 1 will disable all features -# Use for for early stage or highly restricted ports -ifndef CIRCUITPY_MINIMAL_BUILD -CIRCUITPY_MINIMAL_BUILD = 0 -endif -CFLAGS += -DCIRCUITPY_MINIMAL_BUILD=$(CIRCUITPY_MINIMAL_BUILD) - -ifndef CIRCUITPY_DEFAULT_BUILD - ifeq ($(CIRCUITPY_MINIMAL_BUILD),1) - CIRCUITPY_FULL_BUILD = 0 - CIRCUITPY_DEFAULT_BUILD = 0 - else - CIRCUITPY_DEFAULT_BUILD = 1 - endif -endif -CFLAGS += -DCIRCUITPY_DEFAULT_BUILD=$(CIRCUITPY_DEFAULT_BUILD) - -# Some features have no unique HAL component, and thus there's never -# a reason to not include them. -ifndef CIRCUITPY_ALWAYS_BUILD - CIRCUITPY_ALWAYS_BUILD = 1 -endif -CFLAGS += -DCIRCUITPY_ALWAYS_BUILD=$(CIRCUITPY_ALWAYS_BUILD) - - -# All builtin modules are listed below, with default values (0 for off, 1 for on) -# Some are always on, some are always off, and some depend on CIRCUITPY_FULL_BUILD. -# -# *** You can override any of the defaults by defining them in your mpconfigboard.mk. - ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_ANALOGIO = 1 endif CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) @@ -89,7 +58,6 @@ CIRCUITPY_AUDIOIO_COMPAT = $(CIRCUITPY_AUDIOIO) endif CFLAGS += -DCIRCUITPY_AUDIOIO_COMPAT=$(CIRCUITPY_AUDIOIO_COMPAT) - ifndef CIRCUITPY_AUDIOPWMIO CIRCUITPY_AUDIOPWMIO = 0 endif @@ -130,17 +98,17 @@ endif CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_BOARD = 1 endif CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_BUSIO = 1 endif CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_DIGITALIO = 1 endif CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) @@ -175,7 +143,7 @@ endif CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) ifndef CIRCUITPY_MATH -CIRCUITPY_MATH = $(CIRCUITPY_ALWAYS_BUILD) +CIRCUITPY_MATH = 1 endif CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) @@ -185,12 +153,12 @@ endif CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_MICROCONTROLLER = 1 endif CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER) ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_NEOPIXEL_WRITE = 1 endif CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE) @@ -201,12 +169,12 @@ endif CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK) ifndef CIRCUITPY_NVM -CIRCUITPY_NVM = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_NVM = 1 endif CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM) ifndef CIRCUITPY_OS -CIRCUITPY_OS = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_OS = 1 endif CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) @@ -222,7 +190,7 @@ endif CFLAGS += -DCIRCUITPY_PROTOMATTER=$(CIRCUITPY_PROTOMATTER) ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_PULSEIO = 1 endif CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) @@ -233,17 +201,17 @@ endif CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_RANDOM = 1 endif CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) ifndef CIRCUITPY_ROTARYIO -CIRCUITPY_ROTARYIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_ROTARYIO = 1 endif CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) ifndef CIRCUITPY_RTC -CIRCUITPY_RTC = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_RTC = 1 endif CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC) @@ -262,22 +230,22 @@ endif CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_STORAGE = 1 endif CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE) ifndef CIRCUITPY_STRUCT -CIRCUITPY_STRUCT = $(CIRCUITPY_ALWAYS_BUILD) +CIRCUITPY_STRUCT = 1 endif CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT) ifndef CIRCUITPY_SUPERVISOR -CIRCUITPY_SUPERVISOR = $(CIRCUITPY_ALWAYS_BUILD) +CIRCUITPY_SUPERVISOR = 1 endif CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR) ifndef CIRCUITPY_TIME -CIRCUITPY_TIME = $(CIRCUITPY_ALWAYS_BUILD) +CIRCUITPY_TIME = 1 endif CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME) @@ -288,7 +256,7 @@ endif CFLAGS += -DCIRCUITPY_TOUCHIO_USE_NATIVE=$(CIRCUITPY_TOUCHIO_USE_NATIVE) ifndef CIRCUITPY_TOUCHIO -CIRCUITPY_TOUCHIO = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_TOUCHIO = 1 endif CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO) @@ -299,12 +267,12 @@ endif CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) ifndef CIRCUITPY_USB_HID -CIRCUITPY_USB_HID = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_USB_HID = 1 endif CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID) ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = $(CIRCUITPY_DEFAULT_BUILD) +CIRCUITPY_USB_MIDI = 1 endif CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI) From f13de32208716387ca822fd25625325162b5c2f1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 22 Apr 2020 14:37:24 -0700 Subject: [PATCH 301/919] Add HSE_VALUE for STM feather. --- ports/stm/boards/feather_stm32f405_express/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index e002bbed1f..8f8e245665 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -35,7 +35,7 @@ #define MICROPY_HW_NEOPIXEL (&pin_PC00) #define BOARD_OSC_DIV (12) - +#define HSE_VALUE ((uint32_t)12000000U) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash From 8afa9878fd0165a40d6b693d7328aeedd34c0fc8 Mon Sep 17 00:00:00 2001 From: Mike Weiblen Date: Wed, 22 Apr 2020 23:39:02 -0600 Subject: [PATCH 302/919] tools: upload .bin and .uf2 for Itaca uChip boards uChip boards are shipped with an Arduino bootloader. The .bin files can be installed without first installing a .uf2 bootloader. See https://github.com/adafruit/circuitpython/issues/2798 --- tools/build_board_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 543224faea..3594f2ae76 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -48,6 +48,7 @@ extension_by_board = { "feather_m0_basic": BIN_UF2, "feather_m0_rfm69": BIN_UF2, "feather_m0_rfm9x": BIN_UF2, + "uchip": BIN_UF2, # nRF52840 dev kits that may not have UF2 bootloaders, "makerdiary_nrf52840_mdk": HEX, From 83cc9783cc6c9000c75e35bfe36334191a41bb6d Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Mon, 20 Apr 2020 18:55:27 +0200 Subject: [PATCH 303/919] STM32: adds support for stm32f746xx MCU and the nucleo_f746zg board --- .github/workflows/build.yml | 1 + ports/stm/boards/STM32F746xG_fs.ld | 52 ++ ports/stm/boards/nucleo_f746zg/board.c | 38 ++ .../stm/boards/nucleo_f746zg/mpconfigboard.h | 36 ++ .../stm/boards/nucleo_f746zg/mpconfigboard.mk | 14 + ports/stm/boards/nucleo_f746zg/pins.c | 73 +++ .../boards/nucleo_f746zg/stm32f7xx_hal_conf.h | 445 ++++++++++++++++++ ports/stm/peripherals/periph.h | 7 + ports/stm/peripherals/pins.h | 3 + .../peripherals/stm32f7/stm32f746xx/clocks.c | 67 +++ .../peripherals/stm32f7/stm32f746xx/gpio.c | 53 +++ .../peripherals/stm32f7/stm32f746xx/periph.c | 215 +++++++++ .../peripherals/stm32f7/stm32f746xx/periph.h | 58 +++ .../peripherals/stm32f7/stm32f746xx/pins.c | 208 ++++++++ .../peripherals/stm32f7/stm32f746xx/pins.h | 207 ++++++++ ports/stm/supervisor/internal_flash.h | 8 + 16 files changed, 1485 insertions(+) create mode 100644 ports/stm/boards/STM32F746xG_fs.ld create mode 100644 ports/stm/boards/nucleo_f746zg/board.c create mode 100644 ports/stm/boards/nucleo_f746zg/mpconfigboard.h create mode 100644 ports/stm/boards/nucleo_f746zg/mpconfigboard.mk create mode 100644 ports/stm/boards/nucleo_f746zg/pins.c create mode 100644 ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/periph.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/periph.h create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/pins.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/pins.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..3aba40764f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -200,6 +200,7 @@ jobs: - "monster_m4sk" - "ndgarage_ndbit6" - "nfc_copy_cat" + - "nucleo_f746zg" - "nucleo_f767zi" - "nucleo_h743zi_2" - "ohs2020_badge" diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld new file mode 100644 index 0000000000..8d821d2b5e --- /dev/null +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * GNU linker script for STM32F746 with filesystem + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Mark Olsson + * + * 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. + */ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 16K; + +/* Define tho top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); + diff --git a/ports/stm/boards/nucleo_f746zg/board.c b/ports/stm/boards/nucleo_f746zg/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h new file mode 100644 index 0000000000..1d86149193 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * 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 "NUCLEO STM32F746" +#define MICROPY_HW_MCU_NAME "STM32F746" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (8) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk new file mode 100644 index 0000000000..8a793d5709 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A +USB_PID = 0x809E +USB_PRODUCT = "Nucleo F746zg - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = F7 +MCU_VARIANT = STM32F746xx +MCU_PACKAGE = LQFP144 + +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f746zg/pins.c b/ports/stm/boards/nucleo_f746zg/pins.c new file mode 100644 index 0000000000..56b6a745f9 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { +{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, +{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, +{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, +{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PF03) }, +{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PF05) }, +{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF10) }, +{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, +{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, +{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, +{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, +{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PF13) }, +{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF12) }, +{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, +{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PD14) }, +{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, +{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, +{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB15) }, +{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA15) }, +{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_PB05) }, +{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PB00) }, +{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PB07) }, +{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PB14) }, +{ MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_TP1), MP_ROM_PTR(&pin_PH02) }, +{ MP_ROM_QSTR(MP_QSTR_TP2), MP_ROM_PTR(&pin_PI08) }, +{ MP_ROM_QSTR(MP_QSTR_TP3), MP_ROM_PTR(&pin_PH15) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_INT), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SDA), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SCL), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_RST), MP_ROM_PTR(&pin_PG03) }, +{ MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_BL_CTRL), MP_ROM_PTR(&pin_PK03) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_INT), MP_ROM_PTR(&pin_PI13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_HS_OVER_CURRENT), MP_ROM_PTR(&pin_PE03) }, +{ MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PA09) }, +{ MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_PD03) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_TX), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_UART6_RX), MP_ROM_PTR(&pin_PG09) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_NSS), MP_ROM_PTR(&pin_PA04) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_SCK), MP_ROM_PTR(&pin_PB03) }, +{ MP_ROM_QSTR(MP_QSTR_SPI_B_MOSI), MP_ROM_PTR(&pin_PB05) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h b/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h new file mode 100644 index 0000000000..84699bd784 --- /dev/null +++ b/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h @@ -0,0 +1,445 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + + #define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_MDIOS_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define ART_ACCLERATOR_ENABLE 0U /* To enable instruction cache and prefetch */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* LAN8742A_PHY_ADDRESS Address*/ +#define LAN8742A_PHY_ADDRESS 0 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ + +#define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ +#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 209d35ee95..316dbbec5c 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -107,6 +107,13 @@ typedef struct { // F7 Series +#ifdef STM32F746xx +#define HAS_DAC 0 +#define HAS_TRNG 0 +#define HAS_BASIC_TIM 0 +#include "stm32f7/stm32f746xx/periph.h" +#endif + #ifdef STM32F767xx #define HAS_DAC 0 #define HAS_TRNG 0 diff --git a/ports/stm/peripherals/pins.h b/ports/stm/peripherals/pins.h index 628e09695a..8f06d012ec 100644 --- a/ports/stm/peripherals/pins.h +++ b/ports/stm/peripherals/pins.h @@ -93,6 +93,9 @@ extern const mp_obj_type_t mcu_pin_type; #endif // F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/pins.h" +#endif #ifdef STM32F767xx #include "stm32f7/stm32f767xx/pins.h" #endif diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c new file mode 100644 index 0000000000..b3f56e8510 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c @@ -0,0 +1,67 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mpconfig.h" + +void stm32_peripherals_clocks_init(void) { + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; + RCC_OscInitStruct.PLL.PLLN = 432; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 9; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Activate the OverDrive to reach the 216 MHz Frequency */ + HAL_PWREx_EnableOverDrive(); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; + + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7); + +} \ No newline at end of file diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c new file mode 100644 index 0000000000..cee4b4f457 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c @@ -0,0 +1,53 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * 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 "gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32_peripherals_gpio_init(void) { + //Enable all GPIO for now + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOG_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOI_CLK_ENABLE(); + __HAL_RCC_GPIOJ_CLK_ENABLE(); + __HAL_RCC_GPIOK_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK + never_reset_pin_number(7,0); //PH0 OSC_IN + never_reset_pin_number(7,1); //PH1 OSC_OUT +} + diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c new file mode 100644 index 0000000000..0c33912398 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.c @@ -0,0 +1,215 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" +#include "peripherals/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[4] = {I2C1, I2C2, I2C3, I2C4}; + +const mcu_periph_obj_t mcu_i2c_sda_list[10] = { + PERIPH(1, 4, &pin_PB07), + PERIPH(1, 4, &pin_PB09), + PERIPH(2, 4, &pin_PB11), + PERIPH(3, 4, &pin_PC09), + PERIPH(4, 4, &pin_PD13), + PERIPH(2, 4, &pin_PF00), + PERIPH(4, 4, &pin_PF15), + PERIPH(2, 4, &pin_PH05), + PERIPH(3, 4, &pin_PH08), + PERIPH(4, 4, &pin_PH12), +}; +const mcu_periph_obj_t mcu_i2c_scl_list[10] = { + PERIPH(3, 4, &pin_PA08), + PERIPH(1, 4, &pin_PB06), + PERIPH(1, 4, &pin_PB08), + PERIPH(2, 4, &pin_PB10), + PERIPH(4, 4, &pin_PD12), + PERIPH(2, 4, &pin_PF01), + PERIPH(4, 4, &pin_PF14), + PERIPH(2, 4, &pin_PH04), + PERIPH(3, 4, &pin_PH07), + PERIPH(4, 4, &pin_PH11), +}; + +//SPI + +SPI_TypeDef * mcu_spi_banks[6] = {SPI1, SPI2, SPI3, SPI4, SPI5, SPI6}; + +const mcu_periph_obj_t mcu_spi_sck_list[14] = { + PERIPH(1, 5, &pin_PA05), + PERIPH(2, 5, &pin_PA09), + PERIPH(1, 5, &pin_PB03), + PERIPH(3, 6, &pin_PB03), + PERIPH(2, 5, &pin_PB10), + PERIPH(2, 5, &pin_PB13), + PERIPH(3, 6, &pin_PC10), + PERIPH(2, 5, &pin_PD03), + PERIPH(4, 5, &pin_PE02), + PERIPH(4, 5, &pin_PE12), + PERIPH(5, 5, &pin_PF07), + PERIPH(6, 5, &pin_PG13), + PERIPH(5, 5, &pin_PH06), + PERIPH(2, 5, &pin_PI01), +}; +const mcu_periph_obj_t mcu_spi_mosi_list[15] = { + PERIPH(1, 5, &pin_PA07), + PERIPH(3, 7, &pin_PB02), + PERIPH(1, 5, &pin_PB05), + PERIPH(3, 6, &pin_PB05), + PERIPH(2, 5, &pin_PB15), + PERIPH(2, 5, &pin_PC01), + PERIPH(2, 5, &pin_PC03), + PERIPH(3, 6, &pin_PC12), + PERIPH(3, 5, &pin_PD06), + PERIPH(4, 5, &pin_PE06), + PERIPH(4, 5, &pin_PE14), + PERIPH(5, 5, &pin_PF09), + PERIPH(5, 5, &pin_PF11), + PERIPH(6, 5, &pin_PG14), + PERIPH(2, 5, &pin_PI03), +}; +const mcu_periph_obj_t mcu_spi_miso_list[12] = { + PERIPH(1, 5, &pin_PA06), + PERIPH(1, 5, &pin_PB04), + PERIPH(3, 6, &pin_PB04), + PERIPH(2, 5, &pin_PB14), + PERIPH(2, 5, &pin_PC02), + PERIPH(3, 6, &pin_PC11), + PERIPH(4, 5, &pin_PE05), + PERIPH(4, 5, &pin_PE13), + PERIPH(5, 5, &pin_PF08), + PERIPH(6, 5, &pin_PG12), + PERIPH(5, 5, &pin_PH07), + PERIPH(2, 5, &pin_PI02), +}; + +//UART + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6, UART7, UART8}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, true, true, true, true, true}; + +const mcu_periph_obj_t mcu_uart_tx_list[15] = { + PERIPH(4, 8, &pin_PA00), + PERIPH(2, 7, &pin_PA02), + PERIPH(1, 7, &pin_PA09), + PERIPH(1, 7, &pin_PB06), + PERIPH(3, 7, &pin_PB10), + PERIPH(6, 8, &pin_PC06), + PERIPH(3, 7, &pin_PC10), + PERIPH(4, 8, &pin_PC10), + PERIPH(5, 8, &pin_PC12), + PERIPH(2, 7, &pin_PD05), + PERIPH(3, 7, &pin_PD08), + PERIPH(8, 8, &pin_PE01), + PERIPH(7, 8, &pin_PE08), + PERIPH(7, 8, &pin_PF07), + PERIPH(6, 8, &pin_PG14), +}; +const mcu_periph_obj_t mcu_uart_rx_list[15] = { + PERIPH(4, 8, &pin_PA01), + PERIPH(2, 7, &pin_PA03), + PERIPH(1, 7, &pin_PA10), + PERIPH(1, 7, &pin_PB07), + PERIPH(3, 7, &pin_PB11), + PERIPH(6, 8, &pin_PC07), + PERIPH(3, 7, &pin_PC11), + PERIPH(4, 8, &pin_PC11), + PERIPH(5, 8, &pin_PD02), + PERIPH(2, 7, &pin_PD06), + PERIPH(3, 7, &pin_PD09), + PERIPH(8, 8, &pin_PE00), + PERIPH(7, 8, &pin_PE07), + PERIPH(7, 8, &pin_PF06), + PERIPH(6, 8, &pin_PG09), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10, + TIM11, TIM12, TIM13, TIM14}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[55] = { + TIM(2, 1, 1, &pin_PA00), + TIM(5, 2, 1, &pin_PA00), + TIM(2, 1, 2, &pin_PA01), + TIM(5, 2, 2, &pin_PA01), + TIM(2, 1, 3, &pin_PA02), + TIM(5, 2, 3, &pin_PA02), + TIM(9, 3, 1, &pin_PA02), + TIM(2, 1, 4, &pin_PA03), + TIM(5, 2, 4, &pin_PA03), + TIM(9, 3, 2, &pin_PA03), + TIM(2, 1, 1, &pin_PA05), + TIM(3, 2, 1, &pin_PA06), + TIM(3, 2, 2, &pin_PA07), + TIM(1, 1, 1, &pin_PA08), + TIM(1, 1, 2, &pin_PA09), + TIM(1, 1, 3, &pin_PA10), + TIM(1, 1, 4, &pin_PA11), + TIM(2, 1, 1, &pin_PA15), + TIM(3, 2, 3, &pin_PB00), + TIM(3, 2, 4, &pin_PB01), + TIM(2, 1, 2, &pin_PB03), + TIM(3, 2, 1, &pin_PB04), + TIM(3, 2, 2, &pin_PB05), + TIM(4, 2, 1, &pin_PB06), + TIM(4, 2, 2, &pin_PB07), + TIM(4, 2, 3, &pin_PB08), + TIM(4, 2, 4, &pin_PB09), + TIM(2, 1, 3, &pin_PB10), + TIM(2, 1, 4, &pin_PB11), + TIM(3, 2, 1, &pin_PC06), + TIM(8, 3, 1, &pin_PC06), + TIM(3, 2, 2, &pin_PC07), + TIM(8, 3, 2, &pin_PC07), + TIM(3, 2, 3, &pin_PC08), + TIM(8, 3, 3, &pin_PC08), + TIM(3, 2, 4, &pin_PC09), + TIM(8, 3, 4, &pin_PC09), + TIM(4, 2, 1, &pin_PD12), + TIM(4, 2, 2, &pin_PD13), + TIM(4, 2, 3, &pin_PD14), + TIM(4, 2, 4, &pin_PD15), + TIM(9, 3, 1, &pin_PE05), + TIM(9, 3, 2, &pin_PE06), + TIM(1, 1, 1, &pin_PE09), + TIM(1, 1, 2, &pin_PE11), + TIM(1, 1, 3, &pin_PE13), + TIM(1, 1, 4, &pin_PE14), + TIM(5, 2, 1, &pin_PH10), + TIM(5, 2, 2, &pin_PH11), + TIM(5, 2, 3, &pin_PH12), + TIM(5, 2, 4, &pin_PI00), + TIM(8, 3, 4, &pin_PI02), + TIM(8, 3, 1, &pin_PI05), + TIM(8, 3, 2, &pin_PI06), + TIM(8, 3, 3, &pin_PI07), +}; diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h new file mode 100644 index 0000000000..26f4ad2b54 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/periph.h @@ -0,0 +1,58 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H + +//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]; + +//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]; + +//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]; + +//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]; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c new file mode 100644 index 0000000000..895ad5ec0d --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c @@ -0,0 +1,208 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/mphal.h" +#include "peripherals/pins.h" + +// Todo: some pins do have ADCs, but the module isn't set up yet. + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, NO_ADC); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, NO_ADC); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, NO_ADC); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, NO_ADC); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, NO_ADC); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, NO_ADC); +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, NO_ADC); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, NO_ADC); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, NO_ADC); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, NO_ADC); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, NO_ADC); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, NO_ADC); +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, NO_ADC); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, NO_ADC); +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); +const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC); +const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); +const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); +const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); +const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); +const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); +const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); +const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC); +const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); +const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); +const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); +const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); +const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); +const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); +const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC); +const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC); +const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC); +const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC); +const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC); +const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC); +const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC); +const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC); +const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC); +const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC); +const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC); +const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC); +const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC); +const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC); +const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC); +const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC); +const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC); +const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC); +const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC); +const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC); +const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC); +const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC); +const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC); +const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC); +const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC); +const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC); +const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC); +const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC); +const mcu_pin_obj_t pin_PI12 = PIN(8, 12, NO_ADC); +const mcu_pin_obj_t pin_PI13 = PIN(8, 13, NO_ADC); +const mcu_pin_obj_t pin_PI14 = PIN(8, 14, NO_ADC); +const mcu_pin_obj_t pin_PI15 = PIN(8, 15, NO_ADC); +const mcu_pin_obj_t pin_PJ00 = PIN(9, 0, NO_ADC); +const mcu_pin_obj_t pin_PJ01 = PIN(9, 1, NO_ADC); +const mcu_pin_obj_t pin_PJ02 = PIN(9, 2, NO_ADC); +const mcu_pin_obj_t pin_PJ03 = PIN(9, 3, NO_ADC); +const mcu_pin_obj_t pin_PJ04 = PIN(9, 4, NO_ADC); +const mcu_pin_obj_t pin_PJ05 = PIN(9, 5, NO_ADC); +const mcu_pin_obj_t pin_PJ06 = PIN(9, 6, NO_ADC); +const mcu_pin_obj_t pin_PJ07 = PIN(9, 7, NO_ADC); +const mcu_pin_obj_t pin_PJ08 = PIN(9, 8, NO_ADC); +const mcu_pin_obj_t pin_PJ09 = PIN(9, 9, NO_ADC); +const mcu_pin_obj_t pin_PJ10 = PIN(9, 10, NO_ADC); +const mcu_pin_obj_t pin_PJ11 = PIN(9, 11, NO_ADC); +const mcu_pin_obj_t pin_PJ12 = PIN(9, 12, NO_ADC); +const mcu_pin_obj_t pin_PJ13 = PIN(9, 13, NO_ADC); +const mcu_pin_obj_t pin_PJ14 = PIN(9, 14, NO_ADC); +const mcu_pin_obj_t pin_PJ15 = PIN(9, 15, NO_ADC); +const mcu_pin_obj_t pin_PK00 = PIN(10, 0, NO_ADC); +const mcu_pin_obj_t pin_PK01 = PIN(10, 1, NO_ADC); +const mcu_pin_obj_t pin_PK02 = PIN(10, 2, NO_ADC); +const mcu_pin_obj_t pin_PK03 = PIN(10, 3, NO_ADC); +const mcu_pin_obj_t pin_PK04 = PIN(10, 4, NO_ADC); +const mcu_pin_obj_t pin_PK05 = PIN(10, 5, NO_ADC); +const mcu_pin_obj_t pin_PK06 = PIN(10, 6, NO_ADC); +const mcu_pin_obj_t pin_PK07 = PIN(10, 7, NO_ADC); +const mcu_pin_obj_t pin_PK08 = PIN(10, 8, NO_ADC); +const mcu_pin_obj_t pin_PK09 = PIN(10, 9, NO_ADC); +const mcu_pin_obj_t pin_PK10 = PIN(10, 10, NO_ADC); +const mcu_pin_obj_t pin_PK11 = PIN(10, 11, NO_ADC); +const mcu_pin_obj_t pin_PK12 = PIN(10, 12, NO_ADC); +const mcu_pin_obj_t pin_PK13 = PIN(10, 13, NO_ADC); +const mcu_pin_obj_t pin_PK14 = PIN(10, 14, NO_ADC); +const mcu_pin_obj_t pin_PK15 = PIN(10, 15, NO_ADC); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h new file mode 100644 index 0000000000..3b6f9a15a4 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.h @@ -0,0 +1,207 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H +#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H + +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB11; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +extern const mcu_pin_obj_t pin_PF00; +extern const mcu_pin_obj_t pin_PF01; +extern const mcu_pin_obj_t pin_PF02; +extern const mcu_pin_obj_t pin_PF03; +extern const mcu_pin_obj_t pin_PF04; +extern const mcu_pin_obj_t pin_PF05; +extern const mcu_pin_obj_t pin_PF06; +extern const mcu_pin_obj_t pin_PF07; +extern const mcu_pin_obj_t pin_PF08; +extern const mcu_pin_obj_t pin_PF09; +extern const mcu_pin_obj_t pin_PF10; +extern const mcu_pin_obj_t pin_PF11; +extern const mcu_pin_obj_t pin_PF12; +extern const mcu_pin_obj_t pin_PF13; +extern const mcu_pin_obj_t pin_PF14; +extern const mcu_pin_obj_t pin_PF15; +extern const mcu_pin_obj_t pin_PG00; +extern const mcu_pin_obj_t pin_PG01; +extern const mcu_pin_obj_t pin_PG02; +extern const mcu_pin_obj_t pin_PG03; +extern const mcu_pin_obj_t pin_PG04; +extern const mcu_pin_obj_t pin_PG05; +extern const mcu_pin_obj_t pin_PG06; +extern const mcu_pin_obj_t pin_PG07; +extern const mcu_pin_obj_t pin_PG08; +extern const mcu_pin_obj_t pin_PG09; +extern const mcu_pin_obj_t pin_PG10; +extern const mcu_pin_obj_t pin_PG11; +extern const mcu_pin_obj_t pin_PG12; +extern const mcu_pin_obj_t pin_PG13; +extern const mcu_pin_obj_t pin_PG14; +extern const mcu_pin_obj_t pin_PG15; +extern const mcu_pin_obj_t pin_PH00; +extern const mcu_pin_obj_t pin_PH01; +extern const mcu_pin_obj_t pin_PH02; +extern const mcu_pin_obj_t pin_PH03; +extern const mcu_pin_obj_t pin_PH04; +extern const mcu_pin_obj_t pin_PH05; +extern const mcu_pin_obj_t pin_PH06; +extern const mcu_pin_obj_t pin_PH07; +extern const mcu_pin_obj_t pin_PH08; +extern const mcu_pin_obj_t pin_PH09; +extern const mcu_pin_obj_t pin_PH10; +extern const mcu_pin_obj_t pin_PH11; +extern const mcu_pin_obj_t pin_PH12; +extern const mcu_pin_obj_t pin_PH13; +extern const mcu_pin_obj_t pin_PH14; +extern const mcu_pin_obj_t pin_PH15; +extern const mcu_pin_obj_t pin_PI00; +extern const mcu_pin_obj_t pin_PI01; +extern const mcu_pin_obj_t pin_PI02; +extern const mcu_pin_obj_t pin_PI03; +extern const mcu_pin_obj_t pin_PI04; +extern const mcu_pin_obj_t pin_PI05; +extern const mcu_pin_obj_t pin_PI06; +extern const mcu_pin_obj_t pin_PI07; +extern const mcu_pin_obj_t pin_PI08; +extern const mcu_pin_obj_t pin_PI09; +extern const mcu_pin_obj_t pin_PI10; +extern const mcu_pin_obj_t pin_PI11; +extern const mcu_pin_obj_t pin_PI12; +extern const mcu_pin_obj_t pin_PI13; +extern const mcu_pin_obj_t pin_PI14; +extern const mcu_pin_obj_t pin_PI15; +extern const mcu_pin_obj_t pin_PJ00; +extern const mcu_pin_obj_t pin_PJ01; +extern const mcu_pin_obj_t pin_PJ02; +extern const mcu_pin_obj_t pin_PJ03; +extern const mcu_pin_obj_t pin_PJ04; +extern const mcu_pin_obj_t pin_PJ05; +extern const mcu_pin_obj_t pin_PJ06; +extern const mcu_pin_obj_t pin_PJ07; +extern const mcu_pin_obj_t pin_PJ08; +extern const mcu_pin_obj_t pin_PJ09; +extern const mcu_pin_obj_t pin_PJ10; +extern const mcu_pin_obj_t pin_PJ11; +extern const mcu_pin_obj_t pin_PJ12; +extern const mcu_pin_obj_t pin_PJ13; +extern const mcu_pin_obj_t pin_PJ14; +extern const mcu_pin_obj_t pin_PJ15; +extern const mcu_pin_obj_t pin_PK00; +extern const mcu_pin_obj_t pin_PK01; +extern const mcu_pin_obj_t pin_PK02; +extern const mcu_pin_obj_t pin_PK03; +extern const mcu_pin_obj_t pin_PK04; +extern const mcu_pin_obj_t pin_PK05; +extern const mcu_pin_obj_t pin_PK06; +extern const mcu_pin_obj_t pin_PK07; +extern const mcu_pin_obj_t pin_PK08; +extern const mcu_pin_obj_t pin_PK09; +extern const mcu_pin_obj_t pin_PK10; +extern const mcu_pin_obj_t pin_PK11; +extern const mcu_pin_obj_t pin_PK12; +extern const mcu_pin_obj_t pin_PK13; +extern const mcu_pin_obj_t pin_PK14; +extern const mcu_pin_obj_t pin_PK15; + +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PINS_H diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 53388d3544..97626f9f4e 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -5,6 +5,7 @@ * * Copyright (c) 2013, 2014 Damien P. George * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,6 +68,13 @@ #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif +/* Note this applies to STM32F769xG only, STM32F746xE has 512KB */ +#ifdef STM32F746xx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x18000 //96KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08008000 +#endif + #ifdef STM32F767xx #define STM32_FLASH_SIZE 0x200000 //2MB #define INTERNAL_FLASH_FILESYSTEM_SIZE 0x18000 //96KiB From 8791ca6af3f5a63d286d9f5c3e26f55a1619ff86 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 23 Apr 2020 13:33:41 -0400 Subject: [PATCH 304/919] implement requested changes --- docs/porting.rst | 7 ++++--- docs/shared_bindings_matrix.py | 8 ++++---- ports/atmel-samd/Makefile | 4 ++-- .../atmel-samd/boards/8086_commander/mpconfigboard.mk | 2 +- .../boards/arduino_mkr1300/mpconfigboard.mk | 2 +- .../boards/arduino_mkrzero/mpconfigboard.mk | 2 +- .../boards/arduino_nano_33_iot/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk | 2 +- .../boards/bast_pro_mini_m0/mpconfigboard.mk | 2 +- .../boards/catwan_usbstick/mpconfigboard.mk | 2 +- .../atmel-samd/boards/datum_distance/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/datum_imu/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/datum_light/mpconfigboard.mk | 2 +- .../atmel-samd/boards/datum_weather/mpconfigboard.mk | 2 +- .../boards/escornabot_makech/mpconfigboard.mk | 2 +- .../boards/feather_m0_adalogger/mpconfigboard.mk | 2 +- .../boards/feather_m0_basic/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm69/mpconfigboard.mk | 2 +- .../boards/feather_m0_rfm9x/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/meowmeow/mpconfigboard.mk | 2 +- .../boards/ndgarage_ndbit6/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 2 +- .../atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 2 +- .../sparkfun_qwiic_micro_no_flash/mpconfigboard.mk | 2 +- .../sparkfun_qwiic_micro_with_flash/mpconfigboard.mk | 2 +- .../boards/sparkfun_samd21_dev/mpconfigboard.mk | 2 +- .../boards/sparkfun_samd21_mini/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 +- ports/atmel-samd/mpconfigport.mk | 6 +++--- ports/stm/mpconfigport.mk | 10 +++++----- py/circuitpy_mpconfig.h | 3 +-- py/circuitpy_mpconfig.mk | 11 ++++------- 41 files changed, 57 insertions(+), 60 deletions(-) diff --git a/docs/porting.rst b/docs/porting.rst index 1fb9d13bc6..d28f56f475 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -50,7 +50,7 @@ as a natural "TODO" list. An example minimal build list is shown below: .. code-block:: makefile - # Items requiring ports//common-hal implementation: + # These modules are implemented in ports//common-hal: CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create CIRCUITPY_DIGITALIO = 0 # Typically the second module to create CIRCUITPY_ANALOGIO = 0 @@ -67,10 +67,11 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) - # Modules with no common-hal implementation, but depend on something else + # 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 # Does nothing without a neopixel or dotstar + 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 diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 0473c5119a..d5f838f75b 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -139,9 +139,9 @@ def get_excluded_boards(base): re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)") chip_keyword = "CHIP_FAMILY" elif port in ["nrf"]: - re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)") + re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)") elif port in ["stm"]: - re_board_chip = re.compile("MCU_SERIES\s*=\s*(\w+)") + re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)") chip_keyword = "MCU_SERIES" port_dir = "ports/{}".format(port) @@ -175,9 +175,9 @@ def get_excluded_boards(base): check_dependent_modules = dict() for module in modules: board_is_excluded = False - # check if board uses `SMALL_BUILD`. if yes, and current + # check if board turns off `FULL_BUILD`. if yes, and current # module is marked as `FULL_BUILD`, board is excluded - small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents) + small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents) if small_build and base[module]["full_build"] == "1": board_is_excluded = True diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f4886f96ef..7a626dff71 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -114,7 +114,7 @@ else # Do a default shrink for small builds. ifndef CFLAGS_INLINE_LIMIT - ifeq ($(CIRCUITPY_SMALL_BUILD),1) + ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS_INLINE_LIMIT = 50 endif endif @@ -125,7 +125,7 @@ else CFLAGS += -flto -flto-partition=none - ifeq ($(CIRCUITPY_SMALL_BUILD),1) + ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 endif diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 3e865657ac..dcc62fc9bc 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -13,7 +13,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index bd682ade07..d31d1f54a4 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -8,5 +8,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 894b9b0110..7eb83a1230 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 8a29b0ace0..fd24edafa2 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index f94ec13b7c..a5722c9ade 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index c3f0750a9e..055e6b19e2 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index adae4beb27..8724e0d4bb 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index 4f6c7ab82e..ae05d32f2c 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 336a1b832f..6fd05f403b 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 7ec2efcf96..d42a7869de 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index d3ec1b0fdd..d92cbc71b3 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index dedd49ff71..93f6b1c90f 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 134abf7236..54c5bff6a0 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 3643743509..69ebdfc237 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 40a461b279..7556b9517f 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 736161047a..de79638bd3 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index d649386328..ca3eccbe4f 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index 4b452ecbfe..bd0afb60e2 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk index b73f0951ee..5e5f0ff5fd 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk index 4f6d1e70d5..1b4a16a08d 100644 --- a/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk +++ b/ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C" LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index b3271d062f..7305abf73a 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_PEW = 1 CIRCUITPY_ANALOGIO = 1 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 51b4fc993c..f5b6ca3899 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd51 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 # TODO: Turn off analogio for now for space reasons, but restore it # when frozen module gets smaller. CIRCUITPY_ANALOGIO = 0 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index e6c227b135..8b7066ac7a 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_RTC = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_USB_MIDI = 1 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 # Make more room. SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index ca7ed4bdc3..b799406732 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk index 2741454ce9..bedec87f45 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index bc37b59433..295ba4bce4 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_I2CSLAVE = 1 CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk index 632cd095c2..22e2059a93 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk @@ -9,5 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk index ccf5a41495..dd01c9985b 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/mpconfigboard.mk @@ -11,5 +11,5 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index 0c33ef960e..a2bd577cd3 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index d09785fb8a..9460d0009b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 5c942901a8..aab5efd5dc 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 950910e48b..90b5600dcb 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk index 941d88b459..fdcde4a07e 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 5c418d312c..c1dbf514d7 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ -CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 61f7c206ab..d043ee242e 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -65,19 +65,19 @@ CIRCUITPY_SAMD = 1 endif ifndef CIRCUITPY_ULAB -ifneq ($(CIRCUITPY_SMALL_BUILD),1) +ifneq ($(CIRCUITPY_FULL_BUILD),0) CIRCUITPY_ULAB = 1 endif endif ifndef CIRCUITPY_PROTOMATTER -ifneq ($(CIRCUITPY_SMALL_BUILD),1) +ifneq ($(CIRCUITPY_FULL_BUILD),0) CIRCUITPY_PROTOMATTER = 1 endif endif ifndef CIRCUITPY_FRAMEBUFFERIO -ifneq ($(CIRCUITPY_SMALL_BUILD),1) +ifneq ($(CIRCUITPY_FULL_BUILD),0) CIRCUITPY_FRAMEBUFFERIO = 1 endif endif diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 15254f9179..7ed2aa49a2 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -4,7 +4,7 @@ INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 24 ifeq ($(MCU_SERIES),F4) - # Items requiring common-hal implementation: + # Not yet implemented common-hal modules: CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_ROTARYIO = 0 @@ -18,7 +18,7 @@ ifeq ($(MCU_SERIES),F4) endif ifeq ($(MCU_SERIES),H7) - # Items requiring common-hal implementation: + # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 @@ -30,14 +30,14 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - # Modules with no common-hal implementation that depend on something else + # shared-module modules that still need prerequisites filled CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) CIRCUITPY_RANDOM = 0 # Requires OS CIRCUITPY_STORAGE = 0 # Requires OS, filesystem endif ifeq ($(MCU_SERIES),F7) - # Items requiring common-hal implementation: + # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 @@ -49,7 +49,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - # Modules with no common-hal implementation that depend on something else + # shared-module modules that still need prerequisites filled CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) CIRCUITPY_RANDOM = 0 # Requires OS CIRCUITPY_STORAGE = 0 # Requires OS, filesystem diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 89e9396dda..e09a6309f1 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -179,8 +179,7 @@ typedef long mp_off_t; // board-specific definitions, which control and may override definitions below. #include "mpconfigboard.h" -// CIRCUITPY_FULL_BUILD is defined in py/circuitpy_mpconfig.mk -// Remove some lesser-used functionality to make small builds fit. +// Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1c2afc33e7..61dd9e6dab 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -26,18 +26,15 @@ # Boards default to all modules enabled (with exceptions) # Manually disable by overriding in #mpconfigboard.mk -# Smaller builds can be forced for resource constrained chips, typically SAMD21s -# without external flash. Avoid using this for incomplete ports, as it changes -# settings in other files. +# Smaller builds can be forced for resource constrained chips (typically SAMD21s +# without external flash) by setting CIRCUITPY_FULL_BUILD=0. Avoid using this +# for merely incomplete ports, as it changes settings in other files. ifndef CIRCUITPY_FULL_BUILD - ifeq ($(CIRCUITPY_SMALL_BUILD),1) - CIRCUITPY_FULL_BUILD = 0 - else CIRCUITPY_FULL_BUILD = 1 - endif endif CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) + ifndef CIRCUITPY_ANALOGIO CIRCUITPY_ANALOGIO = 1 endif From b6f07a1c418153dbe90a33e0569fa099c71a8ad8 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 23 Apr 2020 13:44:09 -0400 Subject: [PATCH 305/919] Fix submodule desync --- frozen/circuitpython-stage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 19a66d79f0..0d2c083a2f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 19a66d79f0650a15e502464b42e16692365eab36 +Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae From 855c2033b59c8451bde30387e668ecfb206888b6 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 23 Apr 2020 15:35:20 -0400 Subject: [PATCH 306/919] Reogranized pyi in spi.c --- shared-bindings/busio/SPI.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index e01e9e35e5..db84ac97b5 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -40,18 +40,6 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -class SPI: - def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): ... - def deinit(self, ) -> Any: ... - def __enter__(self, ) -> Any: ... - def __exit__(self, ) -> Any: ... - def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: ... - def try_lock(self, ) -> Any: ... - def unlock(self, ) -> Any: ... - def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... - def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: ... - def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: ... - frequency: Any = ... //| .. currentmodule:: busio //| @@ -89,6 +77,8 @@ class SPI: //| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. //| :param ~microcontroller.Pin MISO: the Master In Slave Out pin. //| +// class SPI: +// def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): ... // TODO(tannewt): Support LSB SPI. STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -115,6 +105,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con //| //| Turn off the SPI bus. //| +// def deinit(self, ) -> Any: ... STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -127,12 +118,14 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); //| No-op used by Context Managers. //| // Provided by context manager helper. +// def __enter__(self, ) -> Any: ... //| .. method:: __exit__() //| //| Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info. //| +// def __exit__(self, ) -> Any: ... STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -176,6 +169,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { //| Two SPI objects may be created, except on the Circuit Playground Bluefruit, //| which allows only one (to allow for an additional I2C object). //| +// def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: ... STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; static const mp_arg_t allowed_args[] = { @@ -218,6 +212,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); //| :return: True when lock has been grabbed //| :rtype: bool //| +// def try_lock(self, ) -> Any: ... STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(common_hal_busio_spi_try_lock(self)); @@ -228,6 +223,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); //| //| Releases the SPI lock. //| +// def unlock(self, ) -> Any: ... STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -245,6 +241,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); //| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` //| +// def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; static const mp_arg_t allowed_args[] = { @@ -288,6 +285,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` //| :param int write_value: Value to write while reading. (Usually ignored.) //| +// def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: ... STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; static const mp_arg_t allowed_args[] = { @@ -335,6 +333,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` //| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)`` //| +// def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: ... STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { @@ -387,6 +386,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_read //| The actual SPI bus frequency. This may not match the frequency requested //| due to internal limitations. //| +// frequency: Any = ... STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From 55bdee688fc021d8afb70b0868b20699c5f0519b Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 23 Apr 2020 16:14:17 -0400 Subject: [PATCH 307/919] Reorganized pyi again --- shared-bindings/busio/SPI.c | 229 +++++++++++++++++------------------- 1 file changed, 108 insertions(+), 121 deletions(-) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index db84ac97b5..1ac9629f80 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -41,44 +41,44 @@ #include "supervisor/shared/translate.h" -//| .. currentmodule:: busio +//|class SPI: +//| """.. currentmodule:: busio //| -//| :class:`SPI` -- a 3-4 wire serial protocol -//| ----------------------------------------------- +//| `SPI` -- a 3-4 wire serial protocol +//| ----------------------------------------------- //| -//| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~busio.I2C` because a -//| separate pin is used to control the active slave rather than a transitted -//| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.) +//| SPI is a serial protocol that has exclusive pins for data in and out of the +//| master. It is typically faster than :py:class:`~busio.I2C` because a +//| separate pin is used to control the active slave rather than a transitted +//| address. This class only manages three of the four SPI lines: `!clock`, +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave +//| select line. (This is common because multiple slaves can share the `!clock`, +//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" //| -//| .. class:: SPI(clock, MOSI=None, MISO=None) +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| -//| Construct an SPI object on the given pins. +//| """Construct an SPI object on the given pins. //| -//| ..note:: The SPI peripherals allocated in order of desirability, if possible, -//| such as highest speed and not shared use first. For instance, on the nRF52840, -//| there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, -//| some of which may also be used for I2C. The 32MHz SPI peripheral is returned -//| first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz -//| peripherals. +//| ..note:: The SPI peripherals allocated in order of desirability, if possible, +//| such as highest speed and not shared use first. For instance, on the nRF52840, +//| there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, +//| some of which may also be used for I2C. The 32MHz SPI peripheral is returned +//| first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz +//| peripherals. //| -//| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to -//| manage locks. +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| manage locks. //| -//| .. seealso:: Using this class to directly read registers requires manual -//| bit unpacking. Instead, use an existing driver or make one with -//| :ref:`Register ` data descriptors. +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. //| -//| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin. -//| -// class SPI: -// def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): ... +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. +//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| ... + // TODO(tannewt): Support LSB SPI. STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -101,11 +101,9 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Turn off the SPI bus. -//| -// def deinit(self, ) -> Any: ... +//| def deinit(self, ) -> Any: +//| """Turn off the SPI bus.""" +//| ... STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -113,19 +111,15 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| -// Provided by context manager helper. -// def __enter__(self, ) -> Any: ... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers. +//| Provided by context manager helper.""" +//| ... -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| -// def __exit__(self, ) -> Any: ... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -146,30 +140,29 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { } } -//| .. method:: configure(*, baudrate=100000, polarity=0, phase=0, bits=8) +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| """Configures the SPI bus. The SPI object must be locked. //| -//| Configures the SPI bus. The SPI object must be locked. +//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower +//| due to the granularity of available clock settings. +//| Check the `frequency` attribute for the actual clock rate. +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. +//| :param int bits: the number of bits per word //| -//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower -//| due to the granularity of available clock settings. -//| Check the `frequency` attribute for the actual clock rate. -//| :param int polarity: the base state of the clock line (0 or 1) -//| :param int phase: the edge of the clock that data is captured. First (0) -//| or second (1). Rising or falling depends on clock polarity. -//| :param int bits: the number of bits per word +//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that +//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is +//| within spec for the SAMD21. //| -//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that -//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is -//| within spec for the SAMD21. -//| -//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, -//| and 8MHz. -//| If you pick a a baudrate other than one of these, the nearest lower -//| baudrate will be chosen, with a minimum of 125kHz. -//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, -//| which allows only one (to allow for an additional I2C object). -//| -// def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: ... +//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, +//| and 8MHz. +//| If you pick a a baudrate other than one of these, the nearest lower +//| baudrate will be chosen, with a minimum of 125kHz. +//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, +//| which allows only one (to allow for an additional I2C object).""" +//| ... + STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; static const mp_arg_t allowed_args[] = { @@ -205,25 +198,23 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//| .. method:: try_lock() +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the SPI lock. Returns True on success. //| -//| Attempts to grab the SPI lock. Returns True on success. -//| -//| :return: True when lock has been grabbed -//| :rtype: bool -//| -// def try_lock(self, ) -> Any: ... +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... + STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(common_hal_busio_spi_try_lock(self)); } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//| .. method:: unlock() -//| -//| Releases the SPI lock. -//| -// def unlock(self, ) -> Any: ... +//| def unlock(self, ) -> Any: +//| """Releases the SPI lock.""" +//| ... + STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -232,16 +223,15 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| .. method:: write(buffer, *, start=0, end=None) +//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... +//| """Write the data contained in ``buffer``. The SPI object must be locked. +//| If the buffer is empty, nothing happens. //| -//| Write the data contained in ``buffer``. The SPI object must be locked. -//| If the buffer is empty, nothing happens. -//| -//| :param bytearray buffer: Write out the data in this buffer -//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -//| -// def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... +//| :param bytearray buffer: Write out the data in this buffer +//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| ... + STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; static const mp_arg_t allowed_args[] = { @@ -274,18 +264,17 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| .. method:: readinto(buffer, *, start=0, end=None, write_value=0) +//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: +//| """Read into ``buffer`` while writing ``write_value`` for each byte read. +//| The SPI object must be locked. +//| If the number of bytes to read is 0, nothing happens. //| -//| Read into ``buffer`` while writing ``write_value`` for each byte read. -//| The SPI object must be locked. -//| If the number of bytes to read is 0, nothing happens. -//| -//| :param bytearray buffer: Read data into this buffer -//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -//| :param int write_value: Value to write while reading. (Usually ignored.) -//| -// def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: ... +//| :param bytearray buffer: Read data into this buffer +//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param int write_value: Value to write while reading. (Usually ignored.)""" +//| ... + STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; static const mp_arg_t allowed_args[] = { @@ -318,22 +307,21 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| .. method:: write_readinto(buffer_out, buffer_in, *, out_start=0, out_end=None, in_start=0, in_end=None) +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//| The SPI object must be locked. +//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//| must be equal. +//| If buffer slice lengths are both 0, nothing happens. //| -//| Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -//| The SPI object must be locked. -//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -//| must be equal. -//| If buffer slice lengths are both 0, nothing happens. -//| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer -//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)`` -//| -// def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: ... +//| :param bytearray buffer_out: Write out the data in this buffer +//| :param bytearray buffer_in: Read data into this buffer +//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| ... + STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { @@ -381,12 +369,11 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//| .. attribute:: frequency -//| -//| The actual SPI bus frequency. This may not match the frequency requested -//| due to internal limitations. -//| -// frequency: Any = ... +//| frequency: Any = +//| """The actual SPI bus frequency. This may not match the frequency requested +//| due to internal limitations.""" +//| ... + STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From bd0df9e3bcd8179ac35ac7b3b3bc6bbc26e2a7ab Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 23 Apr 2020 17:12:55 -0400 Subject: [PATCH 308/919] Minor redundancy fix --- ports/atmel-samd/mpconfigport.mk | 14 ++------------ py/circuitpy_mpconfig.mk | 1 + 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index ee68c079ad..92d47b186a 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -64,22 +64,12 @@ ifndef CIRCUITPY_SAMD CIRCUITPY_SAMD = 1 endif -ifndef CIRCUITPY_ULAB -ifneq ($(CIRCUITPY_FULL_BUILD),0) -CIRCUITPY_ULAB = 1 -endif -endif - ifndef CIRCUITPY_RGBMATRIX -ifneq ($(CIRCUITPY_FULL_BUILD),0) -CIRCUITPY_RGBMATRIX = 1 -endif +CIRCUITPY_RGBMATRIX = $(CIRCUITPY_FULL_BUILD) endif ifndef CIRCUITPY_FRAMEBUFFERIO -ifneq ($(CIRCUITPY_FULL_BUILD),0) -CIRCUITPY_FRAMEBUFFERIO = 1 -endif +CIRCUITPY_FRAMEBUFFERIO = $(CIRCUITPY_FULL_BUILD) endif endif # samd51 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 9f0a1684a8..30ab720d70 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -319,6 +319,7 @@ CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) ifndef CIRCUITPY_ULAB CIRCUITPY_ULAB = $(CIRCUITPY_FULL_BUILD) endif +CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) # Enabled micropython.native decorator (experimental) ifndef CIRCUITPY_ENABLE_MPY_NATIVE From 5a7652ff866a94ee49a0429ba62e895dc00f15cb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 23 Apr 2020 18:03:16 -0700 Subject: [PATCH 309/919] Even newer tinyUSB --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 3ed9515e70..c59fa77427 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 3ed9515e70b0c6bc375cd058dcc6b8b78b00899a +Subproject commit c59fa774274b13790a3ae0fc19d9651eeba560ab From 7126a2f5221ac15fdd53c9a78d0680569a7aa546 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 24 Apr 2020 09:08:55 -0500 Subject: [PATCH 310/919] build.yml: Adjust for change in 'brew' 'brew' apparently introduced an incompatible change, where even "--force" does not actually make the commands available in the default path. Also switch to a numbered macos release instead of "latest", though this did not save us from breaking changes in brew or other preinstalled sw. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..4e4b8bd0b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,15 +94,15 @@ jobs: path: mpy-cross/mpy-cross.static.exe mpy-cross-mac: - runs-on: macos-latest + runs-on: macos-10.15 steps: - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - name: Install deps + - name: Make gettext programs available run: | - brew link --force gettext + echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | gcc --version From f1bf4de452ad16b18cb7fab480732f6ef535eba4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 24 Apr 2020 09:28:12 -0500 Subject: [PATCH 311/919] brew install just for safetys sake --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e4b8bd0b6..91bc6f4a3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,6 +102,7 @@ jobs: run: echo "$GITHUB_CONTEXT" - name: Make gettext programs available run: | + brew install gettext echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" - name: Versions run: | From 91fbbcab196ffb251b4161861a8a37f2d0bb2c18 Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Tue, 21 Apr 2020 13:17:47 +0200 Subject: [PATCH 312/919] adds support for the stm32f746g_disco board --- .github/workflows/build.yml | 1 + ports/stm/boards/stm32f746g_disco/board.c | 57 +++ .../boards/stm32f746g_disco/mpconfigboard.h | 42 ++ .../boards/stm32f746g_disco/mpconfigboard.mk | 14 + ports/stm/boards/stm32f746g_disco/pins.c | 110 +++++ .../stm32f746g_disco/stm32f7xx_hal_conf.h | 445 ++++++++++++++++++ ports/stm/common-hal/microcontroller/Pin.c | 5 +- ports/stm/packages/TFBGA216.c | 231 +++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.c | 39 +- 9 files changed, 938 insertions(+), 6 deletions(-) create mode 100644 ports/stm/boards/stm32f746g_disco/board.c create mode 100644 ports/stm/boards/stm32f746g_disco/mpconfigboard.h create mode 100644 ports/stm/boards/stm32f746g_disco/mpconfigboard.mk create mode 100644 ports/stm/boards/stm32f746g_disco/pins.c create mode 100644 ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h create mode 100644 ports/stm/packages/TFBGA216.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc8ead2c4e..2b1211cda1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,7 @@ jobs: - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stm32f4_discovery" + - "stm32f746g_disco" - "stringcar_m0_express" - "teensy40" - "teknikio_bluebird" diff --git a/ports/stm/boards/stm32f746g_disco/board.c b/ports/stm/boards/stm32f746g_disco/board.c new file mode 100644 index 0000000000..aafc69cf02 --- /dev/null +++ b/ports/stm/boards/stm32f746g_disco/board.c @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * 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 "stm32f7xx_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + GPIO_InitTypeDef GPIO_InitStructure; + + __HAL_RCC_GPIOK_CLK_ENABLE(); + + /* + * Turn off the backlight as it is distracting during development. + * LCD_BL_CTRL = PK3 + */ + GPIO_InitStructure.Pin = GPIO_PIN_3; + GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStructure.Pull = GPIO_PULLUP; + GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(GPIOK, &GPIO_InitStructure); + HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET); + + never_reset_pin_number(10, 3); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/stm32f746g_disco/mpconfigboard.h b/ports/stm/boards/stm32f746g_disco/mpconfigboard.h new file mode 100644 index 0000000000..05184940b2 --- /dev/null +++ b/ports/stm/boards/stm32f746g_disco/mpconfigboard.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * Copyright (c) 2020 Mark Olsson + * + * 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 "ST STM32F746G Discovery" +#define MICROPY_HW_MCU_NAME "STM32F746" +#define STM32F746G_DISCO + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (25) +#define BOARD_OSC_PLLN (400) +#define BOARD_OSC_PLLQ (9) + +#define BOARD_FLASH_LATENCY FLASH_LATENCY_6 +#define BOARD_NO_VBUS_SENSE 1 diff --git a/ports/stm/boards/stm32f746g_disco/mpconfigboard.mk b/ports/stm/boards/stm32f746g_disco/mpconfigboard.mk new file mode 100644 index 0000000000..0b4ccc7604 --- /dev/null +++ b/ports/stm/boards/stm32f746g_disco/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x239A +USB_PID = 0x809C +USB_PRODUCT = "ST STM32F746G Discovery - CPy" +USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = F7 +MCU_VARIANT = STM32F746xx +MCU_PACKAGE = TFBGA216 + +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/stm32f746g_disco/pins.c b/ports/stm/boards/stm32f746g_disco/pins.c new file mode 100644 index 0000000000..a859c8d190 --- /dev/null +++ b/ports/stm/boards/stm32f746g_disco/pins.c @@ -0,0 +1,110 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { +{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, +{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PF10) }, +{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PF09) }, +{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PF08) }, +{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PF07) }, +{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PF06) }, +{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC07) }, +{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC06) }, +{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG06) }, +{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB04) }, +{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG07) }, +{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, +{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PH06) }, +{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PI03) }, +{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PI02) }, +{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA15) }, +{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PI00) }, +{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB15) }, +{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB14) }, +{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PI01) }, +{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PI01) }, +{ MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PI11) }, +{ MP_ROM_QSTR(MP_QSTR_TP1), MP_ROM_PTR(&pin_PH02) }, +{ MP_ROM_QSTR(MP_QSTR_TP2), MP_ROM_PTR(&pin_PI08) }, +{ MP_ROM_QSTR(MP_QSTR_TP3), MP_ROM_PTR(&pin_PH15) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_INT), MP_ROM_PTR(&pin_PD06) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SDA), MP_ROM_PTR(&pin_PB09) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_SCL), MP_ROM_PTR(&pin_PB08) }, +{ MP_ROM_QSTR(MP_QSTR_EXT_RST), MP_ROM_PTR(&pin_PG03) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D0), MP_ROM_PTR(&pin_PC08) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D1), MP_ROM_PTR(&pin_PC09) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D2), MP_ROM_PTR(&pin_PC10) }, +{ MP_ROM_QSTR(MP_QSTR_SD_D3), MP_ROM_PTR(&pin_PC11) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CK), MP_ROM_PTR(&pin_PC12) }, +{ MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_PD02) }, +{ MP_ROM_QSTR(MP_QSTR_SD_SW), MP_ROM_PTR(&pin_PC13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_BL_CTRL), MP_ROM_PTR(&pin_PK03) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_INT), MP_ROM_PTR(&pin_PI13) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_LCD_SCL), MP_ROM_PTR(&pin_PH07) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_POWER), MP_ROM_PTR(&pin_PD05) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_FS_OVER_CURRENT), MP_ROM_PTR(&pin_PD04) }, +{ MP_ROM_QSTR(MP_QSTR_OTG_HS_OVER_CURRENT), MP_ROM_PTR(&pin_PE03) }, +{ MP_ROM_QSTR(MP_QSTR_USB_VBUS), MP_ROM_PTR(&pin_PJ12) }, +{ MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, +{ MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PA09) }, +{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PB07) }, +{ MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB13) }, +{ MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB12) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDC), MP_ROM_PTR(&pin_PC01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_MDIO), MP_ROM_PTR(&pin_PA02) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_REF_CLK), MP_ROM_PTR(&pin_PA01) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_CRS_DV), MP_ROM_PTR(&pin_PA07) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD0), MP_ROM_PTR(&pin_PC04) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXD1), MP_ROM_PTR(&pin_PC05) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_RXER), MP_ROM_PTR(&pin_PG02) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TX_EN), MP_ROM_PTR(&pin_PG11) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD0), MP_ROM_PTR(&pin_PG13) }, +{ MP_ROM_QSTR(MP_QSTR_ETH_RMII_TXD1), MP_ROM_PTR(&pin_PG14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDCKE0), MP_ROM_PTR(&pin_PC03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNE0), MP_ROM_PTR(&pin_PH03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDCLK), MP_ROM_PTR(&pin_PG08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNCAS), MP_ROM_PTR(&pin_PG15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNRAS), MP_ROM_PTR(&pin_PF11) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_SDNWE), MP_ROM_PTR(&pin_PH05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_BA0), MP_ROM_PTR(&pin_PG04) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_BA1), MP_ROM_PTR(&pin_PG05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_NBL0), MP_ROM_PTR(&pin_PE00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_NBL1), MP_ROM_PTR(&pin_PE01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A0), MP_ROM_PTR(&pin_PF00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A1), MP_ROM_PTR(&pin_PF01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A2), MP_ROM_PTR(&pin_PF02) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A3), MP_ROM_PTR(&pin_PF03) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A4), MP_ROM_PTR(&pin_PF04) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A5), MP_ROM_PTR(&pin_PF05) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A6), MP_ROM_PTR(&pin_PF12) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A7), MP_ROM_PTR(&pin_PF13) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A8), MP_ROM_PTR(&pin_PF14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A9), MP_ROM_PTR(&pin_PF15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A10), MP_ROM_PTR(&pin_PG00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_A11), MP_ROM_PTR(&pin_PG01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D0), MP_ROM_PTR(&pin_PD14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D1), MP_ROM_PTR(&pin_PD15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D2), MP_ROM_PTR(&pin_PD00) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D3), MP_ROM_PTR(&pin_PD01) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D4), MP_ROM_PTR(&pin_PE07) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D5), MP_ROM_PTR(&pin_PE08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D6), MP_ROM_PTR(&pin_PE09) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D7), MP_ROM_PTR(&pin_PE10) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D8), MP_ROM_PTR(&pin_PE11) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D9), MP_ROM_PTR(&pin_PE12) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D10), MP_ROM_PTR(&pin_PE13) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D11), MP_ROM_PTR(&pin_PE14) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D12), MP_ROM_PTR(&pin_PE15) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D13), MP_ROM_PTR(&pin_PD08) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D14), MP_ROM_PTR(&pin_PD09) }, +{ MP_ROM_QSTR(MP_QSTR_SDRAM_D15), MP_ROM_PTR(&pin_PD10) }, +{ MP_ROM_QSTR(MP_QSTR_I2C3_SDA), MP_ROM_PTR(&pin_PH08) }, +{ MP_ROM_QSTR(MP_QSTR_I2C3_SCL), MP_ROM_PTR(&pin_PH07) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h b/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h new file mode 100644 index 0000000000..de72c6e024 --- /dev/null +++ b/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h @@ -0,0 +1,445 @@ +/** + ****************************************************************************** + * @file stm32f7xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f7xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F7xx_HAL_CONF_H +#define __STM32F7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + + #define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_MDIOS_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define ART_ACCLERATOR_ENABLE 0U /* To enable instruction cache and prefetch */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* LAN8742A_PHY_ADDRESS Address*/ +#define LAN8742A_PHY_ADDRESS 0 +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ + +#define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ +#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f7xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32f7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32f7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 2c513f4aad..5e131c310f 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -36,7 +36,10 @@ bool neopixel_in_use; #endif -#if defined(LQFP144) +#if defined(TFBGA216) + #define GPIO_PORT_COUNT 11 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; +#elif defined(LQFP144) #define GPIO_PORT_COUNT 7 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; #elif defined(LQFP100_f4) || (LQFP100_x7) diff --git a/ports/stm/packages/TFBGA216.c b/ports/stm/packages/TFBGA216.c new file mode 100644 index 0000000000..af91e70ae4 --- /dev/null +++ b/ports/stm/packages/TFBGA216.c @@ -0,0 +1,231 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Mark Olsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/microcontroller/Pin.h" +#include "py/obj.h" + +STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { +// Row A + { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, + { MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) }, + { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, + { MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) }, + { MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) }, + { MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) }, + { MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, + +// Row B + { MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) }, + { MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) }, + { MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) }, + { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) }, + { MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) }, + { MP_ROM_QSTR(MP_QSTR_PJ13), MP_ROM_PTR(&pin_PJ13) }, + { MP_ROM_QSTR(MP_QSTR_PJ12), MP_ROM_PTR(&pin_PJ12) }, + { MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) }, + +// Row C + { MP_ROM_QSTR(MP_QSTR_PI08), MP_ROM_PTR(&pin_PI08) }, + { MP_ROM_QSTR(MP_QSTR_PI04), MP_ROM_PTR(&pin_PI04) }, + { MP_ROM_QSTR(MP_QSTR_PK07), MP_ROM_PTR(&pin_PK07) }, + { MP_ROM_QSTR(MP_QSTR_PK06), MP_ROM_PTR(&pin_PK06) }, + { MP_ROM_QSTR(MP_QSTR_PK05), MP_ROM_PTR(&pin_PK05) }, + { MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) }, + { MP_ROM_QSTR(MP_QSTR_PJ14), MP_ROM_PTR(&pin_PJ14) }, + { MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_PI03), MP_ROM_PTR(&pin_PI03) }, + { MP_ROM_QSTR(MP_QSTR_PI02), MP_ROM_PTR(&pin_PI02) }, + { MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) }, + +// Row D + { MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) }, + { MP_ROM_QSTR(MP_QSTR_PI05), MP_ROM_PTR(&pin_PI05) }, + { MP_ROM_QSTR(MP_QSTR_PI07), MP_ROM_PTR(&pin_PI07) }, + { MP_ROM_QSTR(MP_QSTR_PI10), MP_ROM_PTR(&pin_PI10) }, + { MP_ROM_QSTR(MP_QSTR_PI06), MP_ROM_PTR(&pin_PI06) }, + { MP_ROM_QSTR(MP_QSTR_PK04), MP_ROM_PTR(&pin_PK04) }, + { MP_ROM_QSTR(MP_QSTR_PK03), MP_ROM_PTR(&pin_PK03) }, + { MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_PJ15), MP_ROM_PTR(&pin_PJ15) }, + { MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_PH15), MP_ROM_PTR(&pin_PH15) }, + { MP_ROM_QSTR(MP_QSTR_PI01), MP_ROM_PTR(&pin_PI01) }, + { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, + +// Row E + // { MP_ROM_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, // OSC32_IN + { MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_PI12), MP_ROM_PTR(&pin_PI12) }, + { MP_ROM_QSTR(MP_QSTR_PI09), MP_ROM_PTR(&pin_PI09) }, + { MP_ROM_QSTR(MP_QSTR_PH13), MP_ROM_PTR(&pin_PH13) }, + { MP_ROM_QSTR(MP_QSTR_PH14), MP_ROM_PTR(&pin_PH14) }, + { MP_ROM_QSTR(MP_QSTR_PI00), MP_ROM_PTR(&pin_PI00) }, + { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, + +// Row F + // { MP_ROM_QSTR(MP_QSTR_PC15), MP_ROM_PTR(&pin_PC15) }, // OSC32_OUT + { MP_ROM_QSTR(MP_QSTR_PK01), MP_ROM_PTR(&pin_PK01) }, + { MP_ROM_QSTR(MP_QSTR_PK02), MP_ROM_PTR(&pin_PK02) }, + { MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) }, + { MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) }, + +// Row G + // { MP_ROM_QSTR(MP_QSTR_PH00), MP_ROM_PTR(&pin_PH00) }, // OSC_IN + { MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) }, + { MP_ROM_QSTR(MP_QSTR_PI13), MP_ROM_PTR(&pin_PI13) }, + { MP_ROM_QSTR(MP_QSTR_PI15), MP_ROM_PTR(&pin_PI15) }, + { MP_ROM_QSTR(MP_QSTR_PJ11), MP_ROM_PTR(&pin_PJ11) }, + { MP_ROM_QSTR(MP_QSTR_PK00), MP_ROM_PTR(&pin_PK00) }, + { MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) }, + { MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + +// Row H + // { MP_ROM_QSTR(MP_QSTR_PH01), MP_ROM_PTR(&pin_PH01) }, // OSC_OUT + { MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) }, + { MP_ROM_QSTR(MP_QSTR_PI14), MP_ROM_PTR(&pin_PI14) }, + { MP_ROM_QSTR(MP_QSTR_PH04), MP_ROM_PTR(&pin_PH04) }, + { MP_ROM_QSTR(MP_QSTR_PJ08), MP_ROM_PTR(&pin_PJ08) }, + { MP_ROM_QSTR(MP_QSTR_PJ10), MP_ROM_PTR(&pin_PJ10) }, + { MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) }, + { MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + +// Row J + { MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) }, + { MP_ROM_QSTR(MP_QSTR_PH05), MP_ROM_PTR(&pin_PH05) }, + { MP_ROM_QSTR(MP_QSTR_PH03), MP_ROM_PTR(&pin_PH03) }, + { MP_ROM_QSTR(MP_QSTR_PJ07), MP_ROM_PTR(&pin_PJ07) }, + { MP_ROM_QSTR(MP_QSTR_PJ09), MP_ROM_PTR(&pin_PJ09) }, + { MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) }, + { MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) }, + +// Row K + { MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) }, + { MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) }, + { MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) }, + { MP_ROM_QSTR(MP_QSTR_PH02), MP_ROM_PTR(&pin_PH02) }, + { MP_ROM_QSTR(MP_QSTR_PJ06), MP_ROM_PTR(&pin_PJ06) }, + { MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + +// Row L + { MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) }, + { MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) }, + { MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) }, + { MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + +// Row M + { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) }, + { MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) }, + { MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_PJ04), MP_ROM_PTR(&pin_PJ04) }, + { MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) }, + { MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) }, + { MP_ROM_QSTR(MP_QSTR_PJ05), MP_ROM_PTR(&pin_PJ05) }, + { MP_ROM_QSTR(MP_QSTR_PH12), MP_ROM_PTR(&pin_PH12) }, + +// Row N + { MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) }, + { MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) }, + { MP_ROM_QSTR(MP_QSTR_PJ03), MP_ROM_PTR(&pin_PJ03) }, + { MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) }, + { MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) }, + { MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) }, + { MP_ROM_QSTR(MP_QSTR_PH07), MP_ROM_PTR(&pin_PH07) }, + { MP_ROM_QSTR(MP_QSTR_PH09), MP_ROM_PTR(&pin_PH09) }, + { MP_ROM_QSTR(MP_QSTR_PH11), MP_ROM_PTR(&pin_PH11) }, + +// Row P + { MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) }, + { MP_ROM_QSTR(MP_QSTR_PJ02), MP_ROM_PTR(&pin_PJ02) }, + { MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) }, + { MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_PH06), MP_ROM_PTR(&pin_PH06) }, + { MP_ROM_QSTR(MP_QSTR_PH08), MP_ROM_PTR(&pin_PH08) }, + { MP_ROM_QSTR(MP_QSTR_PH10), MP_ROM_PTR(&pin_PH10) }, + +// Row R + { MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_PJ00), MP_ROM_PTR(&pin_PJ00) }, + { MP_ROM_QSTR(MP_QSTR_PJ01), MP_ROM_PTR(&pin_PJ01) }, + { MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) }, + { MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) }, + { MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) }, + { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c index b3f56e8510..b73a1a20d9 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c @@ -28,6 +28,22 @@ #include "py/mpconfig.h" +#ifndef BOARD_OSC_DIV +#define BOARD_OSC_DIV (8) +#endif +#ifndef BOARD_OSC_PLLN +#define BOARD_OSC_PLLN (432) +#endif +#ifndef BOARD_OSC_PLLQ +#define BOARD_OSC_PLLQ (9) +#endif +#ifndef BOARD_FLASH_LATENCY +#define BOARD_FLASH_LATENCY FLASH_LATENCY_7 +#endif +#ifndef BOARD_OSC_HSESTATE +#define BOARD_OSC_HSESTATE RCC_HSE_BYPASS +#endif + void stm32_peripherals_clocks_init(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; @@ -42,14 +58,14 @@ void stm32_peripherals_clocks_init(void) { /* Enable HSE Oscillator and activate PLL with HSE as source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.HSEState = BOARD_OSC_HSESTATE; RCC_OscInitStruct.HSIState = RCC_HSI_OFF; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 432; + RCC_OscInitStruct.PLL.PLLN = BOARD_OSC_PLLN; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 9; + RCC_OscInitStruct.PLL.PLLQ = BOARD_OSC_PLLQ; HAL_RCC_OscConfig(&RCC_OscInitStruct); /* Activate the OverDrive to reach the 216 MHz Frequency */ @@ -62,6 +78,19 @@ void stm32_peripherals_clocks_init(void) { RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7); + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, BOARD_FLASH_LATENCY); -} \ No newline at end of file + #ifdef STM32F746G_DISCO + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; + PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; + PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + #endif +} From 5c7f6e621149b42bdfe12738a16c45201ca8fd57 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 24 Apr 2020 11:48:55 -0700 Subject: [PATCH 313/919] Remove empty #if and add missing includes. --- ports/litex/mphalport.c | 3 --- ports/nrf/supervisor/usb.c | 1 + ports/stm/supervisor/usb.c | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index b65b59cca0..d827a92841 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -36,9 +36,6 @@ #include "irq.h" -#ifdef CFG_TUSB_MCU -#endif - /*------------------------------------------------------------------*/ /* delay *------------------------------------------------------------------*/ diff --git a/ports/nrf/supervisor/usb.c b/ports/nrf/supervisor/usb.c index 75aeec651f..11a5a1561f 100644 --- a/ports/nrf/supervisor/usb.c +++ b/ports/nrf/supervisor/usb.c @@ -30,6 +30,7 @@ #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #ifdef SOFTDEVICE_PRESENT #include "nrf_sdm.h" diff --git a/ports/stm/supervisor/usb.c b/ports/stm/supervisor/usb.c index e981723d67..b2f3ad86bd 100644 --- a/ports/stm/supervisor/usb.c +++ b/ports/stm/supervisor/usb.c @@ -30,6 +30,7 @@ #include "supervisor/usb.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "lib/tinyusb/src/device/usbd.h" #include "py/mpconfig.h" From 67c053e9c40f2831e7729791a72aa55f6637dde6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 24 Apr 2020 17:24:05 -0700 Subject: [PATCH 314/919] Add USB include for LiteX --- ports/litex/mphalport.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/litex/mphalport.c b/ports/litex/mphalport.c index d827a92841..689487791e 100644 --- a/ports/litex/mphalport.c +++ b/ports/litex/mphalport.c @@ -27,6 +27,7 @@ #include +#include "lib/tinyusb/src/device/usbd.h" #include "py/mphal.h" #include "py/mpstate.h" #include "py/gc.h" From 8814dd038e7656b9aeebe6f8a9f63462ae30a71d Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Fri, 24 Apr 2020 20:04:22 +0200 Subject: [PATCH 315/919] Adds missing declarations in periph.h for stm32f767xx --- ports/stm/peripherals/stm32f7/stm32f767xx/periph.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h index f1878ee2e6..98aa5782a8 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -52,4 +52,6 @@ const mcu_periph_obj_t mcu_uart_rx_list[25]; #define TIM_PIN_ARRAY_LEN 55 TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; + #endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H \ No newline at end of file From 28430a9919c511330c4fb833469497a346ad2288 Mon Sep 17 00:00:00 2001 From: dherrada Date: Sat, 25 Apr 2020 15:07:58 -0400 Subject: [PATCH 316/919] Added inline pyi to I2C.c --- shared-bindings/busio/I2C.c | 191 +++++++++++++++++------------------- 1 file changed, 90 insertions(+), 101 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index c89215acdb..0cd392f9a8 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -36,34 +36,33 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: busio +//|class I2C: +//| """.. currentmodule:: busio //| -//| :class:`I2C` --- Two wire serial protocol -//| ------------------------------------------ +//| :class:`I2C` --- Two wire serial protocol +//| ------------------------------------------""" +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): +//| """I2C is a two-wire protocol for communicating between devices. At the +//| physical level it consists of 2 wires: SCL and SDA, the clock and data +//| lines respectively. //| -//| .. class:: I2C(scl, sda, *, frequency=400000, timeout=255) +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| manage locks. //| -//| I2C is a two-wire protocol for communicating between devices. At the -//| physical level it consists of 2 wires: SCL and SDA, the clock and data -//| lines respectively. +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. //| -//| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to -//| manage locks. -//| -//| .. seealso:: Using this class to directly read registers requires manual -//| bit unpacking. Instead, use an existing driver or make one with -//| :ref:`Register ` data descriptors. -//| -//| :param ~microcontroller.Pin scl: The clock pin -//| :param ~microcontroller.Pin sda: The data pin -//| :param int frequency: The clock frequency in Hertz -//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) -//| -//| .. note:: On the nRF52840, only one I2C object may be created, -//| except on the Circuit Playground Bluefruit, which allows two, -//| one for the onboard accelerometer, and one for offboard use. +//| :param ~microcontroller.Pin scl: The clock pin +//| :param ~microcontroller.Pin sda: The data pin +//| :param int frequency: The clock frequency in Hertz +//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) //| +//| .. note:: On the nRF52840, only one I2C object may be created, +//| except on the Circuit Playground Bluefruit, which allows two, +//| one for the onboard accelerometer, and one for offboard use.""" +//| ... STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t); self->base.type = &busio_i2c_type; @@ -84,10 +83,9 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//| .. method:: deinit() -//| -//| Releases control of the underlying hardware so other classes can use it. -//| +//| def deinit(self, ) -> Any: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_i2c_deinit(self); @@ -101,17 +99,15 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used in Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_i2c_deinit(args[0]); @@ -126,14 +122,13 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| .. method:: scan() -//| -//| Scan all I2C addresses between 0x08 and 0x77 inclusive and return a -//| list of those that respond. -//| -//| :return: List of device ids on the I2C bus -//| :rtype: list +//| def scan(self, ) -> Any: +//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a +//| list of those that respond. //| +//| :return: List of device ids on the I2C bus +//| :rtype: list""" +//| ... STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -150,13 +145,11 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//| .. method:: try_lock() -//| -//| Attempts to grab the I2C lock. Returns True on success. -//| -//| :return: True when lock has been grabbed -//| :rtype: bool -//| +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the I2C lock. Returns True on success. +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -164,10 +157,9 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| .. method:: unlock() -//| -//| Releases the I2C lock. -//| +//| def unlock(self, ) -> Any: +//| """Releases the I2C lock.""" +//| ... STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -176,21 +168,20 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| .. method:: readfrom_into(address, buffer, *, start=0, end=None) +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| """Read into ``buffer`` from the slave specified by ``address``. +//| The number of bytes read will be the length of ``buffer``. +//| At least one byte must be read. //| -//| Read into ``buffer`` from the slave specified by ``address``. -//| The number of bytes read will be the length of ``buffer``. -//| At least one byte must be read. -//| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buf[start:end]`` will so it saves memory. -//| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into -//| :param int start: Index to start writing at -//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)`` +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buf[start:end]`` will so it saves memory. //| +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer to write into +//| :param int start: Index to start writing at +//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { mp_buffer_info_t bufinfo; @@ -228,27 +219,26 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| .. method:: writeto(address, buffer, *, start=0, end=None, stop=True) +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be +//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and +//| repeated start before a read. //| -//| Write the bytes from ``buffer`` to the slave specified by ``address``. -//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be -//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and -//| repeated start before a read. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buffer[start:end]`` will so it saves memory. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buffer[start:end]`` will so it saves memory. -//| -//| Writing a buffer or slice of length zero is permitted, as it can be used -//| to poll for the existence of a device. -//| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write -//| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True. +//| Writing a buffer or slice of length zero is permitted, as it can be used +//| to poll for the existence of a device. //| +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer containing the bytes to write +//| :param int start: Index to start writing from +//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param bool stop: If true, output an I2C stop condition after the buffer is written. +//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| ... // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { // get the buffer to write the data from @@ -287,24 +277,23 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| .. method:: writeto_then_readfrom(address, out_buffer, in_buffer, *, out_start=0, out_end=None, in_start=0, in_end=None) +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop -//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//| ``in_buffer`` can be the same buffer because they are used sequentially. -//| -//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//| will so it saves memory. -//| -//| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into -//| :param int out_start: Index to start writing from -//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param int in_start: Index to start writing at -//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)`` +//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//| will so it saves memory. //| +//| :param int address: 7-bit device address +//| :param bytearray out_buffer: buffer containing the bytes to write +//| :param bytearray in_buffer: buffer to write into +//| :param int out_start: Index to start writing from +//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param int in_start: Index to start writing at +//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { From 7070fe1995f70e745699682bbc9776bb54a069a6 Mon Sep 17 00:00:00 2001 From: dherrada Date: Sat, 25 Apr 2020 15:25:31 -0400 Subject: [PATCH 317/919] Added inline pyi to UART.c --- shared-bindings/busio/UART.c | 177 +++++++++++++++++------------------ 1 file changed, 86 insertions(+), 91 deletions(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index f231924d50..59c95528d9 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -40,33 +40,32 @@ #include "supervisor/shared/translate.h" -//| .. currentmodule:: busio + +//|class UART: +//| """.. currentmodule:: busio //| -//| :class:`UART` -- a bidirectional serial protocol -//| ================================================= +//| :class:`UART` -- a bidirectional serial protocol +//| =================================================""" +//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): +//| """A common bidirectional serial protocol that uses an an agreed upon speed +//| rather than a shared clock line. //| +//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. +//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. +//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. +//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. +//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. +//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. +//| :param int baudrate: the transmit and receive speed. +//| :param int bits: the number of bits per byte, 7, 8 or 9. +//| :param Parity parity: the parity used for error checking. +//| :param int stop: the number of stop bits, 1 or 2. +//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. +//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) //| -//| .. class:: UART(tx, rx, *, baudrate=9600, bits=8, parity=None, stop=1, timeout=1, receiver_buffer_size=64) -//| -//| A common bidirectional serial protocol that uses an an agreed upon speed -//| rather than a shared clock line. -//| -//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. -//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. -//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. -//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. -//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. -//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. -//| :param int baudrate: the transmit and receive speed. -//| :param int bits: the number of bits per byte, 7, 8 or 9. -//| :param Parity parity: the parity used for error checking. -//| :param int stop: the number of stop bits, 1 or 2. -//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. -//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) -//| -//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. -//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds. -//| +//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. +//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" +//| ... typedef struct { mp_obj_base_t base; } busio_uart_parity_obj_t; @@ -144,10 +143,9 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//| .. method:: deinit() -//| -//| Deinitialises the UART and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the UART and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_uart_obj_deinit(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_uart_deinit(self); @@ -161,17 +159,15 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_uart_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_uart_deinit(args[0]); @@ -181,41 +177,46 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//| .. method:: read(nbytes=None) +//| def read(self, nbytes: Any = None) -> Any: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. //| -//| Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. -//| -//| :return: Data read -//| :rtype: bytes or None -//| -//| .. method:: readinto(buf) -//| -//| Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. -//| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: int or None (on a non-blocking error) -//| -//| *New in CircuitPython 4.0:* No length parameter is permitted. +//| :return: Data read +//| :rtype: bytes or None""" +//| ... -//| .. method:: readline() +//| def readinto(self, buf: Any) -> Any: +//| """.. method:: readinto(buf) //| -//| Read a line, ending in a newline character. +//| Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| -//| :return: the line read -//| :rtype: int or None +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: int or None (on a non-blocking error) //| -//| .. method:: write(buf) +//| *New in CircuitPython 4.0:* No length parameter is permitted.""" +//| ... + +//| def readline(self, ) -> Any: +//| """.. method:: readline() //| -//| Write the buffer of bytes to the bus. +//| Read a line, ending in a newline character. //| -//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. +//| :return: the line read +//| :rtype: int or None""" +//| ... + +//| def write(self, buf: Any) -> Any: +//| """.. method:: write(buf) //| -//| :return: the number of bytes written -//| :rtype: int or None +//| Write the buffer of bytes to the bus. //| +//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. +//| +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -259,10 +260,9 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//| .. attribute:: baudrate -//| -//| The current baudrate. -//| +//| baudrate: Any = +//| """The current baudrate.""" +//| ... STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -286,10 +286,9 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: in_waiting -//| -//| The number of bytes in the input buffer, available to be read -//| +//| in_waiting: Any = +//| """The number of bytes in the input buffer, available to be read""" +//| ... STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -304,10 +303,9 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: timeout -//| -//| The current timeout, in seconds (float). -//| +//| timeout: Any = +//| """The current timeout, in seconds (float).""" +//| ... STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -333,10 +331,9 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: reset_input_buffer() -//| -//| Discard any unread characters in the input buffer. -//| +//| def reset_input_buffer(self, ) -> Any: +//| """Discard any unread characters in the input buffer.""" +//| ... STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -345,18 +342,16 @@ STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer); -//| .. class:: busio.UART.Parity() -//| -//| Enum-like class to define the parity used to verify correct data transfer. -//| -//| .. data:: ODD -//| -//| Total number of ones should be odd. -//| -//| .. data:: EVEN -//| -//| Total number of ones should be even. -//| +//|class busio: +//| def __init__(self, ): +//| """Enum-like class to define the parity used to verify correct data transfer.""" +//| ODD: Any = +//| """Total number of ones should be odd.""" +//| ... +//| EVEN: Any = +//| """Total number of ones should be even.""" +//| ... +//| ... const mp_obj_type_t busio_uart_parity_type; const busio_uart_parity_obj_t busio_uart_parity_odd_obj = { From e7874277abc43d794f521d519f522cb068ab95ef Mon Sep 17 00:00:00 2001 From: dherrada Date: Sat, 25 Apr 2020 15:35:24 -0400 Subject: [PATCH 318/919] Fixed empty lines --- shared-bindings/busio/UART.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 59c95528d9..954cbdd20b 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -39,8 +39,6 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" - - //|class UART: //| """.. currentmodule:: busio //| From 27e085ec360fd625210fe70bf71019b8019363b3 Mon Sep 17 00:00:00 2001 From: dherrada Date: Sat, 25 Apr 2020 15:36:16 -0400 Subject: [PATCH 319/919] Added pyi to OneWire.c --- shared-bindings/busio/OneWire.c | 92 ++++++++++++++++----------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 022d6afcf4..dd4410d468 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -34,34 +34,36 @@ #include "shared-bindings/busio/OneWire.h" #include "shared-bindings/util.h" -//| .. currentmodule:: busio +//|class OneWire: +//| """.. currentmodule:: busio //| -//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//| ================================================================= +//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol +//| =================================================================""" //| -//| :class:`~busio.OneWire` implements the timing-sensitive foundation of the Maxim -//| (formerly Dallas Semi) OneWire protocol. +//| def __init__(self, pin: microcontroller.Pin): +//| """:class:`~busio.OneWire` implements the timing-sensitive foundation of the Maxim +//| (formerly Dallas Semi) OneWire protocol. //| -//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 +//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 //| -//| .. class:: OneWire(pin) +//| .. class:: OneWire(pin) //| -//| Create a OneWire object associated with the given pin. The object -//| implements the lowest level timing-sensitive bits of the protocol. +//| Create a OneWire object associated with the given pin. The object +//| implements the lowest level timing-sensitive bits of the protocol. //| -//| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus +//| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus //| -//| Read a short series of pulses:: +//| Read a short series of pulses:: //| -//| import busio -//| import board -//| -//| onewire = busio.OneWire(board.D7) -//| onewire.reset() -//| onewire.write_bit(True) -//| onewire.write_bit(False) -//| print(onewire.read_bit()) +//| import busio +//| import board //| +//| onewire = busio.OneWire(board.D7) +//| onewire.reset() +//| onewire.write_bit(True) +//| onewire.write_bit(False) +//| print(onewire.read_bit())""" +//| ... STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; static const mp_arg_t allowed_args[] = { @@ -78,10 +80,9 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialize the OneWire bus and release any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_onewire_deinit(self); @@ -95,17 +96,15 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_onewire_deinit(args[0]); @@ -113,13 +112,12 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//| .. method:: reset() -//| -//| Reset the OneWire bus and read presence -//| -//| :returns: False when at least one device is present -//| :rtype: bool +//| def reset(self, ) -> Any: +//| """Reset the OneWire bus and read presence //| +//| :returns: False when at least one device is present +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -128,13 +126,12 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//| .. method:: read_bit() -//| -//| Read in a bit -//| -//| :returns: bit state read -//| :rtype: bool +//| def read_bit(self, ) -> Any: +//| """Read in a bit //| +//| :returns: bit state read +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -143,10 +140,9 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); -//| .. method:: write_bit(value) -//| -//| Write out a bit based on value. -//| +//| def write_bit(self, value: Any) -> Any: +//| """Write out a bit based on value.""" +//| ... STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From c016ea6f0a090663f96dc84c430ff7ab722e4096 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 26 Apr 2020 10:12:56 -0500 Subject: [PATCH 320/919] ulab: actually update the submodule PR#2802 missed the submodule update itself. --- extmod/ulab | 2 +- py/py.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index a746bd8e09..314bb010bb 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit a746bd8e0953853056ee405e2fa02c8ebca4fb79 +Subproject commit 314bb010bb0282888b21c20123eba5d87f20874f diff --git a/py/py.mk b/py/py.mk index bca6ac14c3..ec0625db68 100644 --- a/py/py.mk +++ b/py/py.mk @@ -107,6 +107,7 @@ endif ifeq ($(CIRCUITPY_ULAB),1) SRC_MOD += $(addprefix extmod/ulab/code/, \ +compare.c \ create.c \ extras.c \ fft.c \ From 2c78a7400a84e2e1e366ac62719300e0e0618e81 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 26 Apr 2020 14:46:28 -0500 Subject: [PATCH 321/919] make translate --- locale/ID.po | 9 +++++++-- locale/circuitpython.pot | 9 +++++++-- locale/de_DE.po | 9 +++++++-- locale/en_US.po | 9 +++++++-- locale/en_x_pirate.po | 9 +++++++-- locale/es.po | 9 +++++++-- locale/fil.po | 9 +++++++-- locale/fr.po | 9 +++++++-- locale/it_IT.po | 9 +++++++-- locale/ko.po | 9 +++++++-- locale/pl.po | 9 +++++++-- locale/pt_BR.po | 9 +++++++-- locale/zh_Latn_pinyin.po | 9 +++++++-- 13 files changed, 91 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index fe503d20a5..ef6ea91684 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2215,6 +2215,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2704,7 +2708,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7a7eb5d440..19e26b16f7 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2191,6 +2191,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2679,7 +2683,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ac7ff8cad0..519ce09e91 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -2220,6 +2220,10 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2715,7 +2719,8 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index ab482425e8..936642cc16 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2191,6 +2191,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2679,7 +2683,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 7deda37182..6e0b2b99e7 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -2195,6 +2195,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2683,7 +2687,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/es.po b/locale/es.po index 388a8b3be9..33479e790e 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2222,6 +2222,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2717,7 +2721,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 90e650374a..be471704b6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2236,6 +2236,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2730,7 +2734,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index ee0a05439b..2a6bda3203 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2261,6 +2261,10 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2757,7 +2761,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 7085f9a4b4..5a3d678b84 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2237,6 +2237,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2735,7 +2739,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 760010c706..786e29ecc0 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -2196,6 +2196,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2684,7 +2688,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 12881677b3..c8ffc4af88 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -2200,6 +2200,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2688,7 +2692,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index da8276d752..a6fc3f3720 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2213,6 +2213,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2701,7 +2705,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0ca59446f7..fd5be84e28 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-17 18:44-0500\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2228,6 +2228,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2718,7 +2722,8 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" From 1a6df71cecbfdfe0a2d1fbe081ead2cbce48cf29 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 07:45:57 -0500 Subject: [PATCH 322/919] ulab: update --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 314bb010bb..cf61d728e7 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 314bb010bb0282888b21c20123eba5d87f20874f +Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d From 485f66714156f797d381662ea5992f4f5ac92b80 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 26 Apr 2020 21:41:16 -0500 Subject: [PATCH 323/919] ulab: disable on espruino pico this non-"express" board is nearly full. Right now it's actually possible just to disable the "compare" module, but as this leaves it packed pretty full I prefer to fully disable it in order to avoid the topic returning again soon. --- ports/stm/boards/espruino_pico/mpconfigboard.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index b7937dd04c..054937c33e 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -13,3 +13,8 @@ MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash +# 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 +# lto for this port, and if other stuff hasn't been added in the +# meantime +CIRCUITPY_ULAB = 0 From aff42defda74ad88bfe00be48fb421845983e588 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 08:07:28 -0500 Subject: [PATCH 324/919] stm: Use FLASH_FIRMWARE instead of FLASH_TEXT in linker scripts for compatibility with the build_memory_info script This change was scripted: git grep -l FLASH_TEXT | xargs sed -i s/FLASH_TEXT/FLASH_FIRMWARE/ --- ports/stm/boards/STM32F401xd_fs.ld | 2 +- ports/stm/boards/STM32F401xe_boot.ld | 2 +- ports/stm/boards/STM32F401xe_fs.ld | 2 +- ports/stm/boards/STM32F405_boot.ld | 2 +- ports/stm/boards/STM32F405_default.ld | 2 +- ports/stm/boards/STM32F405_fs.ld | 2 +- ports/stm/boards/STM32F407_fs.ld | 2 +- ports/stm/boards/STM32F411_fs.ld | 2 +- ports/stm/boards/STM32F411_nvm.ld | 2 +- ports/stm/boards/STM32F412_fs.ld | 2 +- ports/stm/boards/STM32F746xG_fs.ld | 2 +- ports/stm/boards/STM32F767_fs.ld | 2 +- ports/stm/boards/STM32H743_fs.ld | 2 +- ports/stm/boards/common_default.ld | 8 ++++---- ports/stm/boards/common_nvm.ld | 8 ++++---- ports/stm/boards/common_tcm.ld | 12 ++++++------ 16 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld index 826e1d4043..099f47cfe1 100644 --- a/ports/stm/boards/STM32F401xd_fs.ld +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 17dac2f1a6..dc860bbf67 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -7,7 +7,7 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 } diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld index f0136943ad..baa100303e 100644 --- a/ports/stm/boards/STM32F401xe_fs.ld +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 7e611be9d8..f2be5419a2 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -7,7 +7,7 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index 6b497356dd..b17ff4d0f0 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -7,7 +7,7 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index 72ee49633c..dbfd3668b8 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index d08cb8972c..8940155439 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index 28667214e0..d554cc6bba 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index bb37c081b3..bc880ec3ea 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -9,7 +9,7 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index 5985b209e4..14e36a819a 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ - FLASH_TEXT (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index 8d821d2b5e..05ccc0fd91 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -32,7 +32,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 4acca4d660..a5ed1c3534 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ - FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K } diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 28cc12b4aa..2ac9a4410e 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -13,7 +13,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ - FLASH_TEXT (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index 41fe4dfb67..fb8c68a789 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -1,8 +1,8 @@ /* Memory layout for default case. FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data FLASH_FS // ignored for fs use RAM .data @@ -42,7 +42,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -59,7 +59,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE /* Uninitialized data section */ .bss : diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index cee71d1944..7e15aa9e75 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -2,8 +2,8 @@ TODO: rewrite nvm module, remove this file entirely FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data FLASH_NVM .nvm_data FLASH_FS // ignored for fs use @@ -52,7 +52,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -69,7 +69,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE /* Uninitialized data section */ .bss : diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 0aab4c7f9e..89fad9e2c2 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -1,8 +1,8 @@ /* Memory layout for cases with itcm and dtcm FLASH_ISR .isr_vector - FLASH_TEXT .text - FLASH_TEXT .data + FLASH_FIRMWARE .text + FLASH_FIRMWARE .data FLASH_FS // ignored for fs use RAM .data @@ -44,7 +44,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT + } >FLASH_FIRMWARE /* used by the startup to initialize data */ _sidata = LOADADDR(.data); @@ -61,7 +61,7 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM AT> FLASH_TEXT + } >RAM AT> FLASH_FIRMWARE _ld_d1_ram_data_destination = ADDR(.data); _ld_d1_ram_data_flash_copy = LOADADDR(.data); _ld_d1_ram_data_size = SIZEOF(.data); @@ -98,7 +98,7 @@ SECTIONS *(.itcm.*) . = ALIGN(4); - } > ITCM AT> FLASH_TEXT + } > ITCM AT> FLASH_FIRMWARE _ld_itcm_destination = ADDR(.itcm); _ld_itcm_flash_copy = LOADADDR(.itcm); _ld_itcm_size = SIZEOF(.itcm); @@ -110,7 +110,7 @@ SECTIONS *(.dtcm_data.*) . = ALIGN(4); - } > DTCM AT> FLASH_TEXT + } > DTCM AT> FLASH_FIRMWARE _ld_dtcm_data_destination = ADDR(.dtcm_data); _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); From 808b4569270083504bb5eae5a9e8f7eb9aaa34ca Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 08:07:47 -0500 Subject: [PATCH 325/919] mimxrt10xx: Use FLASH_FIRMWARE instead of FLASH_TEXT in linker scripts for compatibility with the build_memory_info script This change was scripted: git grep -l FLASH_TEXT | xargs sed -i s/FLASH_TEXT/FLASH_FIRMWARE/ --- ports/mimxrt10xx/linking/common.ld | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 10568bfb86..e9a2a626d2 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -21,7 +21,7 @@ MEMORY /* This can't move because the bootrom looks at this address. */ FLASH_IVT (rx) : ORIGIN = 0x60001000, LENGTH = 4K /* Place the ISRs 48k in to leave room for the bootloader when it is available. */ - FLASH_TEXT (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K + FLASH_FIRMWARE (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K FLASH_FATFS (r) : ORIGIN = 0x60100000, LENGTH = _ld_flash_size - code_size - _ld_reserved_flash_size /* Teensy uses the last bit of flash for recovery. */ RESERVED_FLASH : ORIGIN = 0x60100000 + _ld_flash_size - _ld_reserved_flash_size, LENGTH = _ld_reserved_flash_size @@ -67,7 +67,7 @@ SECTIONS ) .text*) /* .text* sections (code) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ . = ALIGN(4); - } > FLASH_TEXT + } > FLASH_FIRMWARE .ARM.exidx : { @@ -75,7 +75,7 @@ SECTIONS *(.gnu.linkonce.armexidx.*) _etext = .; /* define a global symbol at end of code */ __etext = .; /* define a global symbol at end of code */ - } > FLASH_TEXT + } > FLASH_FIRMWARE _ld_filesystem_start = ORIGIN(FLASH_FATFS); _ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS); @@ -87,7 +87,7 @@ SECTIONS *flexspi_nor_flash_ops.o(.text*) *fsl_flexspi.o(.text*) . = ALIGN(4); - } > OCRAM AT> FLASH_TEXT + } > OCRAM AT> FLASH_FIRMWARE _ld_ocram_data_destination = ADDR(.data); _ld_ocram_data_flash_copy = LOADADDR(.data); _ld_ocram_data_size = SIZEOF(.data); @@ -114,7 +114,7 @@ SECTIONS *(.itcm.*) . = ALIGN(4); - } > ITCM AT> FLASH_TEXT + } > ITCM AT> FLASH_FIRMWARE _ld_itcm_destination = ADDR(.itcm); _ld_itcm_flash_copy = LOADADDR(.itcm); _ld_itcm_size = SIZEOF(.itcm); @@ -126,7 +126,7 @@ SECTIONS *(.dtcm_data.*) . = ALIGN(4); - } > DTCM AT> FLASH_TEXT + } > DTCM AT> FLASH_FIRMWARE _ld_dtcm_data_destination = ADDR(.dtcm_data); _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); From 6f6dc835d2c9a6080a58fb0164b9b0914e0b652b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 08:07:47 -0500 Subject: [PATCH 326/919] litex: Use FLASH_FIRMWARE instead of FLASH in linker scripts for compatibility with the build_memory_info script --- ports/litex/boards/fomu/fomu-spi.ld | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index 486c3cad11..cb91ae49be 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -8,6 +8,7 @@ ENTRY(_start) MEMORY { FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ } @@ -19,7 +20,7 @@ SECTIONS { /* This is the initialized data section The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). + but the loader puts the initial values in the FLASH_FIRMWARE (inidata). It is one task of the startup to copy the initial values from FLASH to RAM. */ .data : AT ( _sidata ) { @@ -73,7 +74,7 @@ SECTIONS _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM - /* The program code and other data goes into FLASH */ + /* The program code and other data goes into FLASH_FIRMWARE */ .text : { . = ALIGN(4); @@ -88,7 +89,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ - } >FLASH + } >FLASH_FIRMWARE /* Uninitialized data section */ .bss : From 85a4dd939f282ce8739f24aaf420505a590593cb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 08:08:12 -0500 Subject: [PATCH 327/919] build_memory_info: Drop support for old FLASH region name This led to incorrect results about free memory in the stm and i.mx ports --- tools/build_memory_info.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index 93b4c1e82f..d4c5c848ee 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -52,7 +52,7 @@ regions = {} with open(sys.argv[1], "r") as f: for line in f: line = line.strip() - if line.startswith(("FLASH_FIRMWARE", "FLASH", "RAM")): + if line.startswith(("FLASH_FIRMWARE", "RAM")): regions[line.split()[0]] = line.split("=")[-1] for region in regions: @@ -63,11 +63,7 @@ for region in regions: space = M_PATTERN.sub(M_REPLACE, space) regions[region] = int(eval(space)) -# TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. -try: - firmware_region = regions["FLASH_FIRMWARE"] -except KeyError: - firmware_region = regions["FLASH"] +firmware_region = regions["FLASH_FIRMWARE"] ram_region = regions["RAM"] free_flash = firmware_region - text - data From f9096d83ac051380ad88710d261c8797d016c28c Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Fri, 24 Apr 2020 15:44:51 +0200 Subject: [PATCH 328/919] Enables PulseIO on STM32F7 Tested on nucleo_f746zg --- ports/stm/common-hal/pulseio/PWMOut.c | 2 +- ports/stm/common-hal/pulseio/PWMOut.h | 2 +- ports/stm/common-hal/pulseio/PulseIn.c | 2 +- ports/stm/common-hal/pulseio/PulseOut.c | 2 +- ports/stm/mpconfigport.mk | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index d62ee2a380..304a1539c0 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" #include "shared-bindings/microcontroller/__init__.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" #define ALL_CLOCKS 0xFFFF diff --git a/ports/stm/common-hal/pulseio/PWMOut.h b/ports/stm/common-hal/pulseio/PWMOut.h index 8519735c62..57ab143b9a 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.h +++ b/ports/stm/common-hal/pulseio/PWMOut.h @@ -29,7 +29,7 @@ #include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "peripherals/periph.h" #include "py/obj.h" diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 8428a22789..721bb02328 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -34,7 +34,7 @@ #include "shared-bindings/pulseio/PulseIn.h" #include "tick.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #define STM32_GPIO_PORT_SIZE 16 diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index d82525ea16..232516f19c 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -35,7 +35,7 @@ #include "shared-bindings/pulseio/PWMOut.h" #include "supervisor/shared/translate.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "common-hal/microcontroller/Pin.h" #include "tick.h" diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7ed2aa49a2..4705933941 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -40,7 +40,7 @@ ifeq ($(MCU_SERIES),F7) # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_PULSEIO = 0 + CIRCUITPY_PULSEIO = 1 CIRCUITPY_OS = 0 CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 From 31d8e46063a897ec3cccb85ed989aec4308d7c08 Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Fri, 24 Apr 2020 17:15:55 +0200 Subject: [PATCH 329/919] Enables os on STM32F7 os.uname() works os.urandom() doesn't work yet, will enable in another PR --- ports/stm/Makefile | 2 ++ ports/stm/common-hal/os/__init__.c | 6 +++--- ports/stm/mpconfigport.mk | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index c152b76f1a..6bb690fc61 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -110,6 +110,8 @@ CFLAGS += $(MCU_FLAGS_$(MCU_SERIES)) # Select HAL file for distribution via mpconfigport CFLAGS += -DSTM32_HAL_H='' +CFLAGS += -DSTM32_SERIES_LOWER='"stm32$(MCU_SERIES_LOWER)"' + # Floating point settings ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx)) CFLAGS += -mfpu=fpv5-d16 -mfloat-abi=hard diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index 1a1efef9ff..eef58bfe22 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -32,15 +32,15 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "stm32f4xx_hal.h" +#include STM32_HAL_H #include "peripherals/periph.h" STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine }; -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "stm32f4"); -STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "stm32f4"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, STM32_SERIES_LOWER); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, STM32_SERIES_LOWER); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7ed2aa49a2..8305c0d0c7 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -22,7 +22,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 - CIRCUITPY_OS = 0 + CIRCUITPY_OS = 1 CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 @@ -41,7 +41,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 - CIRCUITPY_OS = 0 + CIRCUITPY_OS = 1 CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 From 8344fce9940c2c964663e541908069b03cbe14e5 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 13:06:47 -0400 Subject: [PATCH 330/919] Added inline pyi to analogio --- shared-bindings/analogio/AnalogIn.c | 71 +++++++++++++--------------- shared-bindings/analogio/AnalogOut.c | 62 ++++++++++++------------ 2 files changed, 61 insertions(+), 72 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index b4eeb2af1b..a8afe75bda 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -36,27 +36,25 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/util.h" -//| .. currentmodule:: analogio +//|class AnalogIn: +//| """:class:`AnalogIn` -- read analog voltage +//| ============================================ //| -//| :class:`AnalogIn` -- read analog voltage -//| ============================================ +//| Usage:: //| -//| Usage:: +//| import analogio +//| from board import * //| -//| import analogio -//| from board import * +//| adc = analogio.AnalogIn(A1) +//| val = adc.value""" //| -//| adc = analogio.AnalogIn(A1) -//| val = adc.value +//| def __init__(self, pin: microcontroller.Pin): //| - -//| .. class:: AnalogIn(pin) -//| -//| Use the AnalogIn on the given pin. The reference voltage varies by -//| platform so use ``reference_voltage`` to read the configured setting. -//| -//| :param ~microcontroller.Pin pin: the pin to read from +//| """Use the AnalogIn on the given pin. The reference voltage varies by +//| platform so use ``reference_voltage`` to read the configured setting. //| +//| :param ~microcontroller.Pin pin: the pin to read from""" +//| ... STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check number of arguments @@ -72,10 +70,9 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Turn off the AnalogIn and release the pin for other use. -//| +//| def deinit(self, ) -> Any: +//| """Turn off the AnalogIn and release the pin for other use.""" +//| ... STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_analogio_analogin_deinit(self); @@ -88,17 +85,15 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogin_deinit(args[0]); @@ -106,13 +101,12 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| .. attribute:: value -//| -//| The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) -//| -//| Even if the underlying analog to digital converter (ADC) is lower -//| resolution, the value is 16-bit. +//| value: Any = +//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| +//| Even if the underlying analog to digital converter (ADC) is lower +//| resolution, the value is 16-bit.""" +//| ... STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -127,11 +121,10 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: reference_voltage -//| -//| The maximum voltage measurable (also known as the reference voltage) as a -//| `float` in Volts. -//| +//| reference_voltage: Any = +//| """The maximum voltage measurable (also known as the reference voltage) as a +//| `float` in Volts.""" +//| ... STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 89cf147b26..1b5808e6c9 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -36,28 +36,27 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: analogio +//|class AnalogOut: +//| """.. currentmodule:: analogio //| -//| :class:`AnalogOut` -- output analog voltage -//| ============================================ +//| :class:`AnalogOut` -- output analog voltage +//| ============================================ //| -//| The AnalogOut is used to output analog values (a specific voltage). +//| The AnalogOut is used to output analog values (a specific voltage). //| -//| Example usage:: +//| Example usage:: //| -//| import analogio -//| from microcontroller import pin +//| import analogio +//| from microcontroller import pin //| -//| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 -//| dac.value = 32768 # makes PA02 1.65V +//| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 +//| dac.value = 32768 # makes PA02 1.65V""" +//| def __init__(self, pin: microcontroller.Pin): //| - -//| .. class:: AnalogOut(pin) -//| -//| Use the AnalogOut on the given pin. -//| -//| :param ~microcontroller.Pin pin: the pin to output to +//| """Use the AnalogOut on the given pin. //| +//| :param ~microcontroller.Pin pin: the pin to output to""" +//| ... STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -71,10 +70,9 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Turn off the AnalogOut and release the pin for other use. -//| +//| def deinit(self, ) -> Any: +//| """Turn off the AnalogOut and release the pin for other use.""" +//| ... STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { analogio_analogout_obj_t *self = self_in; @@ -84,17 +82,15 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogout_deinit(args[0]); @@ -102,12 +98,12 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| .. attribute:: value +//| value: Any = +//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| -//| The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) -//| -//| Even if the underlying digital to analog converter (DAC) is lower -//| resolution, the value is 16-bit. +//| Even if the underlying digital to analog converter (DAC) is lower +//| resolution, the value is 16-bit.""" +//| ... STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t value) { analogio_analogout_obj_t *self = MP_OBJ_TO_PTR(self_in); if (common_hal_analogio_analogout_deinited(self)) { From 7eff89e9f9da1181a54e8bc731dcdcba4f9ad6b1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 12:47:52 -0500 Subject: [PATCH 331/919] linker scripts: Re-align at ":" With "git show -b" you can verify that this is a whitespace only change because the diff will be empty. --- ports/mimxrt10xx/linking/common.ld | 2 +- ports/stm/boards/STM32F401xd_fs.ld | 8 ++++---- ports/stm/boards/STM32F401xe_boot.ld | 6 +++--- ports/stm/boards/STM32F401xe_fs.ld | 8 ++++---- ports/stm/boards/STM32F405_boot.ld | 8 ++++---- ports/stm/boards/STM32F405_default.ld | 8 ++++---- ports/stm/boards/STM32F405_fs.ld | 10 +++++----- ports/stm/boards/STM32F407_fs.ld | 10 +++++----- ports/stm/boards/STM32F411_fs.ld | 8 ++++---- ports/stm/boards/STM32F411_nvm.ld | 10 +++++----- ports/stm/boards/STM32F412_fs.ld | 8 ++++---- ports/stm/boards/STM32F746xG_fs.ld | 10 +++++----- ports/stm/boards/STM32F767_fs.ld | 8 ++++---- ports/stm/boards/STM32H743_fs.ld | 16 ++++++++-------- ports/stm/boards/common_default.ld | 12 ++++++------ ports/stm/boards/common_nvm.ld | 14 +++++++------- ports/stm/boards/common_tcm.ld | 18 +++++++++--------- 17 files changed, 82 insertions(+), 82 deletions(-) diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index e9a2a626d2..90fc780933 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -21,7 +21,7 @@ MEMORY /* This can't move because the bootrom looks at this address. */ FLASH_IVT (rx) : ORIGIN = 0x60001000, LENGTH = 4K /* Place the ISRs 48k in to leave room for the bootloader when it is available. */ - FLASH_FIRMWARE (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K + FLASH_FIRMWARE (rx) : ORIGIN = 0x6000C000, LENGTH = code_size - 48K FLASH_FATFS (r) : ORIGIN = 0x60100000, LENGTH = _ld_flash_size - code_size - _ld_reserved_flash_size /* Teensy uses the last bit of flash for recovery. */ RESERVED_FLASH : ORIGIN = 0x60100000 + _ld_flash_size - _ld_reserved_flash_size, LENGTH = _ld_reserved_flash_size diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld index 099f47cfe1..3086c2c6b0 100644 --- a/ports/stm/boards/STM32F401xd_fs.ld +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 320K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index dc860bbf67..0409476949 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -5,10 +5,10 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 + RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194 } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld index baa100303e..b55bc4bb4a 100644 --- a/ports/stm/boards/STM32F401xe_fs.ld +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index f2be5419a2..906f56e0d2 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ - FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ + FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */ + FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index b17ff4d0f0..0aafdbcac5 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08004000, LENGTH = 1008K /* sectors 0-7*/ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index dbfd3668b8..bff312660e 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -5,12 +5,12 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index 8940155439..5330b4116f 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -5,12 +5,12 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index d554cc6bba..82c7aea065 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index bc880ec3ea..897b996313 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -5,12 +5,12 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index 14e36a819a..afd51c6b19 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 960K /* sector 4 is 64K, sectors 5,6,7 are 128K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index 05ccc0fd91..f1bd3d5dc0 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -29,12 +29,12 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K - ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index a5ed1c3534..40e67829bf 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -5,11 +5,11 @@ /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 2ac9a4410e..251c6cc270 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -10,15 +10,15 @@ _ld_default_stack_size = 24K; /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ - FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ + FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ - DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ - SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ - SRAM_D3 (xrw) : ORIGIN = 0x30040000, LENGTH = 64K /* AHB2 SRAM */ - ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ + SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ + SRAM_D3 (xrw) : ORIGIN = 0x30040000, LENGTH = 64K /* AHB2 SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K } /* produce a link error if there is not this amount of RAM for these sections */ diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index fb8c68a789..ade3571a59 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -1,14 +1,14 @@ /* Memory layout for default case. - FLASH_ISR .isr_vector + FLASH_ISR .isr_vector FLASH_FIRMWARE .text FLASH_FIRMWARE .data - FLASH_FS // ignored for fs use + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap - RAM .stack + RAM .data + RAM .bss + RAM .heap + RAM .stack */ ENTRY(Reset_Handler) diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index 7e15aa9e75..f948b94e10 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -1,16 +1,16 @@ /* Memory layout for case with dedicated nvm sector (inefficient) TODO: rewrite nvm module, remove this file entirely - FLASH_ISR .isr_vector + FLASH_ISR .isr_vector FLASH_FIRMWARE .text FLASH_FIRMWARE .data - FLASH_NVM .nvm_data - FLASH_FS // ignored for fs use + FLASH_NVM .nvm_data + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap - RAM .stack + RAM .data + RAM .bss + RAM .heap + RAM .stack */ ENTRY(Reset_Handler) diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 89fad9e2c2..1a41853fe6 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -1,18 +1,18 @@ /* Memory layout for cases with itcm and dtcm - FLASH_ISR .isr_vector + FLASH_ISR .isr_vector FLASH_FIRMWARE .text FLASH_FIRMWARE .data - FLASH_FS // ignored for fs use + FLASH_FS // ignored for fs use - RAM .data - RAM .bss - RAM .heap + RAM .data + RAM .bss + RAM .heap - ITCM .itcm - DTCM .dtcm_data - DTCM .dtcm_bss - DTCM .stack + ITCM .itcm + DTCM .dtcm_data + DTCM .dtcm_bss + DTCM .stack */ ENTRY(Reset_Handler) From e96235d0cf7e6548982d1dde4ef69492dfc19cd2 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 16:35:03 -0400 Subject: [PATCH 332/919] Added inline pyi to audiobusio --- shared-bindings/audiobusio/I2SOut.c | 162 +++++++++++++--------------- shared-bindings/audiobusio/PDMIn.c | 100 ++++++++--------- 2 files changed, 127 insertions(+), 135 deletions(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index cd662acb56..cad17ad184 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -35,65 +35,64 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiobusio +//|class I2SOut: +//| """.. currentmodule:: audiobusio //| -//| :class:`I2SOut` -- Output an I2S audio signal -//| ======================================================== +//| :class:`I2SOut` -- Output an I2S audio signal +//| ======================================================== //| -//| I2S is used to output an audio signal on an I2S bus. +//| I2S is used to output an audio signal on an I2S bus.""" +//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): +//| """Create a I2SOut object associated with the given pins. //| -//| .. class:: I2SOut(bit_clock, word_select, data, *, left_justified) +//| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin +//| :param ~microcontroller.Pin word_select: The word select (or left/right clock) pin +//| :param ~microcontroller.Pin data: The data pin +//| :param bool left_justified: True when data bits are aligned with the word select clock. False +//| when they are shifted by one to match classic I2S protocol. //| -//| Create a I2SOut object associated with the given pins. +//| Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ +//| using `UDA1334 Breakout `_:: //| -//| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin -//| :param ~microcontroller.Pin word_select: The word select (or left/right clock) pin -//| :param ~microcontroller.Pin data: The data pin -//| :param bool left_justified: True when data bits are aligned with the word select clock. False -//| when they are shifted by one to match classic I2S protocol. +//| import audiobusio +//| import audiocore +//| import board +//| import array +//| import time +//| import math //| -//| Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ -//| using `UDA1334 Breakout `_:: +//| # Generate one period of sine wave. +//| length = 8000 // 440 +//| sine_wave = array.array("H", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| import audiobusio -//| import audiocore -//| import board -//| import array -//| import time -//| import math +//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//| i2s.play(sine_wave, loop=True) +//| time.sleep(1) +//| i2s.stop() //| -//| # Generate one period of sine wave. -//| length = 8000 // 440 -//| sine_wave = array.array("H", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| Playing a wave file from flash:: //| -//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) -//| i2s.play(sine_wave, loop=True) -//| time.sleep(1) -//| i2s.stop() -//| -//| Playing a wave file from flash:: -//| -//| import board -//| import audioio -//| import audiocore -//| import audiobusio -//| import digitalio +//| import board +//| import audioio +//| import audiocore +//| import audiobusio +//| import digitalio //| //| -//| f = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(f) +//| f = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(f) //| -//| a = audiobusio.I2SOut(board.D1, board.D0, board.D9) -//| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped") +//| a = audiobusio.I2SOut(board.D1, board.D0, board.D9) //| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_bit_clock, ARG_word_select, ARG_data, ARG_left_justified }; static const mp_arg_t allowed_args[] = { @@ -116,10 +115,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the I2SOut and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_deinit(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_i2sout_deinit(self); @@ -132,17 +130,15 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) { raise_deinited_error(); } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_i2sout_deinit(args[0]); @@ -151,15 +147,14 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| .. method:: play(sample, *, loop=False) +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//| Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. -//| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. -//| -//| The sample itself should consist of 8 bit or 16 bit samples. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| +//| The sample itself should consist of 8 bit or 16 bit samples.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -178,10 +173,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play); -//| .. method:: stop() -//| -//| Stops playback. -//| +//| def stop(self, ) -> Any: +//| """Stops playback.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -190,10 +184,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop); -//| .. attribute:: playing -//| -//| True when the audio sample is being output. (read-only) -//| +//| playing: Any = +//| """True when the audio sample is being output. (read-only)""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -208,10 +201,9 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: pause() -//| -//| Stops playback temporarily while remembering the position. Use `resume` to resume playback. -//| +//| def pause(self, ) -> Any: +//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -224,10 +216,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause); -//| .. method:: resume() -//| -//| Resumes sample playback after :py:func:`pause`. -//| +//| def resume(self, ) -> Any: +//| """Resumes sample playback after :py:func:`pause`.""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -240,10 +231,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume); -//| .. attribute:: paused -//| -//| True when playback is paused. (read-only) -//| +//| paused: Any = +//| """True when playback is paused. (read-only)""" +//| ... STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index fce6cf7a2e..b75545ba7b 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -36,32 +36,39 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiobusio + + + + + + + +//|class PDMIn: +//| """.. currentmodule:: audiobusio //| -//| :class:`PDMIn` -- Record an input PDM audio stream -//| ======================================================== +//| :class:`PDMIn` -- Record an input PDM audio stream +//| ======================================================== //| -//| PDMIn can be used to record an input audio signal on a given set of pins. +//| PDMIn can be used to record an input audio signal on a given set of pins.""" //| -//| .. class:: PDMIn(clock_pin, data_pin, *, sample_rate=16000, bit_depth=8, mono=True, oversample=64, startup_delay=0.11) -//| -//| Create a PDMIn object associated with the given pins. This allows you to -//| record audio signals from the given pins. Individual ports may put further -//| restrictions on the recording parameters. The overall sample rate is -//| determined by `sample_rate` x ``oversample``, and the total must be 1MHz or -//| higher, so `sample_rate` must be a minimum of 16000. -//| -//| :param ~microcontroller.Pin clock_pin: The pin to output the clock to -//| :param ~microcontroller.Pin data_pin: The pin to read the data from -//| :param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. -//| Minimum sample_rate is about 16000 Hz. -//| :param int bit_depth: Final number of bits per sample. Must be divisible by 8 -//| :param bool mono: True when capturing a single channel of audio, captures two channels otherwise -//| :param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 -//| :param float startup_delay: seconds to wait after starting microphone clock -//| to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. -//| Must be in range 0.0-1.0 seconds. +//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): +//| """Create a PDMIn object associated with the given pins. This allows you to +//| record audio signals from the given pins. Individual ports may put further +//| restrictions on the recording parameters. The overall sample rate is +//| determined by `sample_rate` x ``oversample``, and the total must be 1MHz or +//| higher, so `sample_rate` must be a minimum of 16000. //| +//| :param ~microcontroller.Pin clock_pin: The pin to output the clock to +//| :param ~microcontroller.Pin data_pin: The pin to read the data from +//| :param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. +//| Minimum sample_rate is about 16000 Hz. +//| :param int bit_depth: Final number of bits per sample. Must be divisible by 8 +//| :param bool mono: True when capturing a single channel of audio, captures two channels otherwise +//| :param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 +//| :param float startup_delay: seconds to wait after starting microphone clock +//| to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. +//| Must be in range 0.0-1.0 seconds.""" +//| ... //| Record 8-bit unsigned samples to buffer:: //| @@ -86,7 +93,7 @@ //| b.append(0) //| with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16) as mic: //| mic.record(b, len(b)) -//| +//| STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_clock_pin, ARG_data_pin, ARG_sample_rate, ARG_bit_depth, ARG_mono, ARG_oversample, ARG_startup_delay }; static const mp_arg_t allowed_args[] = { @@ -138,10 +145,9 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the PDMIn and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the PDMIn and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t audiobusio_pdmin_deinit(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_pdmin_deinit(self); @@ -154,16 +160,14 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) { raise_deinited_error(); } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context.""" +//| ... STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_pdmin_deinit(args[0]); @@ -172,18 +176,17 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| .. method:: record(destination, destination_length) -//| -//| Records destination_length bytes of samples to destination. This is +//| def record(self, destination: Any, destination_length: Any) -> Any: +//| """Records destination_length bytes of samples to destination. This is //| blocking. //| -//| An IOError may be raised when the destination is too slow to record the -//| audio at the given rate. For internal flash, writing all 1s to the file -//| before recording is recommended to speed up writes. -//| -//| :return: The number of samples recorded. If this is less than ``destination_length``, -//| some samples were missed due to processing time. +//| An IOError may be raised when the destination is too slow to record the +//| audio at the given rate. For internal flash, writing all 1s to the file +//| before recording is recommended to speed up writes. //| +//| :return: The number of samples recorded. If this is less than ``destination_length``, +//| some samples were missed due to processing time.""" +//| ... STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destination, mp_obj_t destination_length) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_obj); check_for_deinit(self); @@ -214,11 +217,10 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat } MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record); -//| .. attribute:: sample_rate -//| -//| The actual sample_rate of the recording. This may not match the constructed -//| sample rate due to internal clock limitations. -//| +//| sample_rate: Any = +//| """The actual sample_rate of the recording. This may not match the constructed +//| sample rate due to internal clock limitations.""" +//| ... STATIC mp_obj_t audiobusio_pdmin_obj_get_sample_rate(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From 1efa7076b0748a2c5276b1c5a02296d4532eb905 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 15:43:13 -0500 Subject: [PATCH 333/919] build_memory_info: Report used, free, and total memory .. intead of just free and total as before. --- tools/build_memory_info.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index d4c5c848ee..808b70bd22 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -66,10 +66,12 @@ for region in regions: firmware_region = regions["FLASH_FIRMWARE"] ram_region = regions["RAM"] -free_flash = firmware_region - text - data -free_ram = ram_region - data - bss -print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024)) -print("{} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) +used_flash = data + text +free_flash = firmware_region - used_flash +used_ram = data + bss +free_ram = ram_region - used_ram +print("{} bytes used, {} bytes free in flash firmware space out of {} bytes ({}kB).".format(used_flash, free_flash, firmware_region, firmware_region / 1024)) +print("{} bytes used, {} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(used_ram, free_ram, ram_region, ram_region / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From 088b5b1785c2acd772dfaf97ce09a3098fdca978 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 16:49:12 -0400 Subject: [PATCH 334/919] Added inline pyi to audiocore --- shared-bindings/audiocore/RawSample.c | 98 ++++++++++++------------ shared-bindings/audiocore/WaveFile.c | 105 ++++++++++++-------------- 2 files changed, 96 insertions(+), 107 deletions(-) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 96af58a4f3..b879b1b97f 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -35,45 +35,45 @@ #include "shared-bindings/audiocore/RawSample.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiocore +//|class RawSample: +//| """.. currentmodule:: audiocore //| -//| :class:`RawSample` -- A raw audio sample buffer -//| ======================================================== +//| :class:`RawSample` -- A raw audio sample buffer +//| ======================================================== //| -//| An in-memory sound sample +//| An in-memory sound sample""" //| -//| .. class:: RawSample(buffer, *, channel_count=1, sample_rate=8000) +//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): +//| """Create a RawSample based on the given buffer of signed values. If channel_count is more than +//| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the +//| first sample will be for channel 1, the second sample will be for channel two, the third for +//| channel 1 and so on. //| -//| Create a RawSample based on the given buffer of signed values. If channel_count is more than -//| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the -//| first sample will be for channel 1, the second sample will be for channel two, the third for -//| channel 1 and so on. +//| :param array.array buffer: An `array.array` with samples +//| :param int channel_count: The number of channels in the buffer +//| :param int sample_rate: The desired playback sample rate //| -//| :param array.array buffer: An `array.array` with samples -//| :param int channel_count: The number of channels in the buffer -//| :param int sample_rate: The desired playback sample rate +//| Simple 8ksps 440 Hz sin wave:: //| -//| Simple 8ksps 440 Hz sin wave:: +//| import audiocore +//| import audioio +//| import board +//| import array +//| import time +//| import math //| -//| import audiocore -//| import audioio -//| import board -//| import array -//| import time -//| import math -//| -//| # Generate one period of sine wav. -//| length = 8000 // 440 -//| sine_wave = array.array("h", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) -//| -//| dac = audioio.AudioOut(board.SPEAKER) -//| sine_wave = audiocore.RawSample(sine_wave) -//| dac.play(sine_wave, loop=True) -//| time.sleep(1) -//| dac.stop() +//| # Generate one period of sine wav. +//| length = 8000 // 440 +//| sine_wave = array.array("h", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) //| +//| dac = audioio.AudioOut(board.SPEAKER) +//| sine_wave = audiocore.RawSample(sine_wave) +//| dac.play(sine_wave, loop=True) +//| time.sleep(1) +//| dac.stop()""" +//| ... STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_channel_count, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -105,10 +105,9 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the AudioOut and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t audioio_rawsample_deinit(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_rawsample_deinit(self); @@ -122,17 +121,15 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_rawsample_deinit(args[0]); @@ -140,13 +137,12 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__); -//| .. attribute:: sample_rate -//| -//| 32 bit value that dictates how quickly samples are played in Hertz (cycles per second). -//| When the sample is looped, this can change the pitch output without changing the underlying -//| sample. This will not change the sample rate of any active playback. Call ``play`` again to -//| change it. -//| +//| sample_rate: Any = +//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second). +//| When the sample is looped, this can change the pitch output without changing the underlying +//| sample. This will not change the sample rate of any active playback. Call ``play`` again to +//| change it.""" +//| ... STATIC mp_obj_t audioio_rawsample_obj_get_sample_rate(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 178d2a1393..f57e1f8779 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -33,44 +33,43 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiocore +//|class WaveFile: +//| """.. currentmodule:: audiocore //| -//| :class:`WaveFile` -- Load a wave file for audio playback -//| ======================================================== +//| :class:`WaveFile` -- Load a wave file for audio playback +//| ======================================================== //| -//| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must -//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating -//| an internal buffer. +//| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must +//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating +//| an internal buffer.""" +//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| -//| .. class:: WaveFile(file[, buffer]) -//| -//| Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. -//| -//| :param typing.BinaryIO file: Already opened wave file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. +//| :param typing.BinaryIO file: Already opened wave file +//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. //| //| -//| Playing a wave file from flash:: +//| Playing a wave file from flash:: //| -//| import board -//| import audiocore -//| import audioio -//| import digitalio +//| import board +//| import audiocore +//| import audioio +//| import digitalio //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//| data = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(data) -//| a = audioio.AudioOut(board.A0) -//| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped") +//| data = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(data) +//| a = audioio.AudioOut(board.A0) //| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -93,10 +92,9 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the WaveFile and releases all memory resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the WaveFile and releases all memory resources for reuse.""" +//| ... STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_wavefile_deinit(self); @@ -110,17 +108,15 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_wavefile_deinit(args[0]); @@ -128,12 +124,11 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| .. attribute:: sample_rate -//| -//| 32 bit value that dictates how quickly samples are loaded into the DAC -//| in Hertz (cycles per second). When the sample is looped, this can change -//| the pitch output without changing the underlying sample. -//| +//| sample_rate: Any = +//| """32 bit value that dictates how quickly samples are loaded into the DAC +//| in Hertz (cycles per second). When the sample is looped, this can change +//| the pitch output without changing the underlying sample.""" +//| ... STATIC mp_obj_t audioio_wavefile_obj_get_sample_rate(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -156,10 +151,9 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: bits_per_sample -//| -//| Bits per sample. (read only) -//| +//| bits_per_sample: Any = +//| """Bits per sample. (read only)""" +//| ... STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -174,10 +168,9 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: channel_count -//| -//| Number of audio channels. (read only) -//| +//| channel_count: Any = +//| """Number of audio channels. (read only)""" +//| ... STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From 1363e6e724124b6f51619113b2877da53195dd1e Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 17:02:48 -0400 Subject: [PATCH 335/919] Added inline pyi to audiocore --- shared-bindings/audioio/AudioOut.c | 165 ++++++++++++++--------------- 1 file changed, 78 insertions(+), 87 deletions(-) diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index ea1efcdffb..8df923e6f1 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -36,64 +36,64 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audioio +//|class AudioOut: +//| """.. currentmodule:: audioio //| -//| :class:`AudioOut` -- Output an analog audio signal -//| ======================================================== +//| :class:`AudioOut` -- Output an analog audio signal +//| ======================================================== //| -//| AudioOut can be used to output an analog audio signal on a given pin. +//| AudioOut can be used to output an analog audio signal on a given pin.""" //| -//| .. class:: AudioOut(left_channel, *, right_channel=None, quiescent_value=0x8000) +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| """Create a AudioOut object associated with the given pin(s). This allows you to +//| play audio signals out on the given pin(s). //| -//| Create a AudioOut object associated with the given pin(s). This allows you to -//| play audio signals out on the given pin(s). +//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to +//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to +//| :param int quiescent_value: The output value when no signal is present. Samples should start +//| and end with this value to prevent audible popping. //| -//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to -//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to -//| :param int quiescent_value: The output value when no signal is present. Samples should start -//| and end with this value to prevent audible popping. +//| Simple 8ksps 440 Hz sin wave:: //| -//| Simple 8ksps 440 Hz sin wave:: +//| import audiocore +//| import audioio +//| import board +//| import array +//| import time +//| import math //| -//| import audiocore -//| import audioio -//| import board -//| import array -//| import time -//| import math +//| # Generate one period of sine wav. +//| length = 8000 // 440 +//| sine_wave = array.array("H", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| # Generate one period of sine wav. -//| length = 8000 // 440 -//| sine_wave = array.array("H", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| dac = audioio.AudioOut(board.SPEAKER) +//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//| dac.play(sine_wave, loop=True) +//| time.sleep(1) +//| dac.stop() //| -//| dac = audioio.AudioOut(board.SPEAKER) -//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//| dac.play(sine_wave, loop=True) -//| time.sleep(1) -//| dac.stop() +//| Playing a wave file from flash:: //| -//| Playing a wave file from flash:: +//| import board +//| import audioio +//| import digitalio //| -//| import board -//| import audioio -//| import digitalio +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) -//| -//| data = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(data) -//| a = audioio.AudioOut(board.A0) -//| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped") +//| data = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(data) +//| a = audioio.AudioOut(board.A0) //| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_left_channel, ARG_right_channel, ARG_quiescent_value }; static const mp_arg_t allowed_args[] = { @@ -115,10 +115,9 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the AudioOut and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t audioio_audioout_deinit(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_audioout_deinit(self); @@ -131,17 +130,15 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) { raise_deinited_error(); } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_audioout_deinit(args[0]); @@ -150,17 +147,16 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| .. method:: play(sample, *, loop=False) +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//| Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. -//| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. -//| -//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output -//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit -//| DAC that ignores the lowest 6 bits when playing 16 bit samples. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| +//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output +//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit +//| DAC that ignores the lowest 6 bits when playing 16 bit samples.""" +//| ... STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -179,10 +175,9 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play); -//| .. method:: stop() -//| -//| Stops playback and resets to the start of the sample. -//| +//| def stop(self, ) -> Any: +//| """Stops playback and resets to the start of the sample.""" +//| ... STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -191,10 +186,9 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop); -//| .. attribute:: playing -//| -//| True when an audio sample is being output even if `paused`. (read-only) -//| +//| playing: Any = +//| """True when an audio sample is being output even if `paused`. (read-only)""" +//| ... STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -209,10 +203,9 @@ const mp_obj_property_t audioio_audioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: pause() -//| -//| Stops playback temporarily while remembering the position. Use `resume` to resume playback. -//| +//| def pause(self, ) -> Any: +//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//| ... STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -225,10 +218,9 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause); -//| .. method:: resume() -//| -//| Resumes sample playback after :py:func:`pause`. -//| +//| def resume(self, ) -> Any: +//| """Resumes sample playback after :py:func:`pause`.""" +//| ... STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -241,10 +233,9 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume); -//| .. attribute:: paused -//| -//| True when playback is paused. (read-only) -//| +//| paused: Any = +//| """True when playback is paused. (read-only)""" +//| ... STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From 8330471068c4cba89802c2b0b9a91a60e656c12e Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 17:20:40 -0400 Subject: [PATCH 336/919] Added inline pyi to audiomixer --- shared-bindings/audiomixer/Mixer.c | 141 +++++++++++------------- shared-bindings/audiomixer/MixerVoice.c | 49 ++++---- 2 files changed, 90 insertions(+), 100 deletions(-) diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 03ffb9373b..1949f2addd 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -38,50 +38,50 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiomixer +//|class Mixer: +//| """.. currentmodule:: audiomixer //| -//| :class:`Mixer` -- Mixes one or more audio samples together -//| =========================================================== +//| :class:`Mixer` -- Mixes one or more audio samples together +//| =========================================================== //| -//| Mixer mixes multiple samples into one sample. +//| Mixer mixes multiple samples into one sample.""" //| -//| .. class:: Mixer(voice_count=2, buffer_size=1024, channel_count=2, bits_per_sample=16, samples_signed=True, sample_rate=8000) +//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): +//| """Create a Mixer object that can mix multiple channels with the same sample rate. +//| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. //| -//| Create a Mixer object that can mix multiple channels with the same sample rate. -//| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. +//| :param int voice_count: The maximum number of voices to mix +//| :param int buffer_size: The total size in bytes of the buffers to mix into +//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. +//| :param int bits_per_sample: The bits per sample of the samples being played +//| :param bool samples_signed: Samples are signed (True) or unsigned (False) +//| :param int sample_rate: The sample rate to be used for all samples //| -//| :param int voice_count: The maximum number of voices to mix -//| :param int buffer_size: The total size in bytes of the buffers to mix into -//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. -//| :param int bits_per_sample: The bits per sample of the samples being played -//| :param bool samples_signed: Samples are signed (True) or unsigned (False) -//| :param int sample_rate: The sample rate to be used for all samples +//| Playing a wave file from flash:: //| -//| Playing a wave file from flash:: +//| import board +//| import audioio +//| import audiocore +//| import audiomixer +//| import digitalio //| -//| import board -//| import audioio -//| import audiocore -//| import audiomixer -//| import digitalio -//| -//| a = audioio.AudioOut(board.A0) -//| music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) -//| drum = audiocore.WaveFile(open("drum.wav", "rb")) -//| mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, -//| bits_per_sample=16, samples_signed=True) -//| -//| print("playing") -//| # Have AudioOut play our Mixer source -//| a.play(mixer) -//| # Play the first sample voice -//| mixer.voice[0].play(music) -//| while mixer.playing: -//| # Play the second sample voice -//| mixer.voice[1].play(drum) -//| time.sleep(1) -//| print("stopped") +//| a = audioio.AudioOut(board.A0) +//| music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) +//| drum = audiocore.WaveFile(open("drum.wav", "rb")) +//| mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, +//| bits_per_sample=16, samples_signed=True) //| +//| print("playing") +//| # Have AudioOut play our Mixer source +//| a.play(mixer) +//| # Play the first sample voice +//| mixer.voice[0].play(music) +//| while mixer.playing: +//| # Play the second sample voice +//| mixer.voice[1].play(drum) +//| time.sleep(1) +//| print("stopped")""" +//| ... STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice_count, ARG_buffer_size, ARG_channel_count, ARG_bits_per_sample, ARG_samples_signed, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -125,10 +125,9 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the Mixer and releases any hardware resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the Mixer and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t audiomixer_mixer_deinit(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomixer_mixer_deinit(self); @@ -142,17 +141,15 @@ STATIC void check_for_deinit(audiomixer_mixer_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomixer_mixer_deinit(args[0]); @@ -160,10 +157,9 @@ STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomixer_mixer___exit___obj, 4, 4, audiomixer_mixer_obj___exit__); -//| .. attribute:: playing -//| -//| True when any voice is being output. (read-only) -//| +//| playing: Any = +//| """True when any voice is being output. (read-only)""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -178,10 +174,9 @@ const mp_obj_property_t audiomixer_mixer_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: sample_rate -//| -//| 32 bit value that dictates how quickly samples are played in Hertz (cycles per second). -//| +//| sample_rate: Any = +//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -196,14 +191,14 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: voice +//| voice: Any = +//| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| -//| A tuple of the mixer's `audiomixer.MixerVoice` object(s). +//| .. code-block:: python //| -//| .. code-block:: python -//| -//| >>> mixer.voice -//| (,) +//| >>> mixer.voice +//| (,)""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj_get_voice(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -218,15 +213,14 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: play(sample, *, voice=0, loop=False) +//| def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//| Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. -//| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. -//| -//| The sample must match the Mixer's encoding settings given in the constructor. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| +//| The sample must match the Mixer's encoding settings given in the constructor.""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_voice, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -251,10 +245,9 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixer_play_obj, 1, audiomixer_mixer_obj_play); -//| .. method:: stop_voice(voice=0) -//| -//| Stops playback of the sample on the given voice. -//| +//| def stop_voice(self, voice: Any = 0) -> Any: +//| """Stops playback of the sample on the given voice.""" +//| ... STATIC mp_obj_t audiomixer_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 188f76f579..e6c750bafa 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -37,17 +37,18 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiomixer +//|class MixerVoice: +//| """.. currentmodule:: audiomixer //| -//| :class:`MixerVoice` -- Voice objects used with Mixer -//| ===================================================== +//| :class:`MixerVoice` -- Voice objects used with Mixer +//| ===================================================== //| -//| Used to access and control samples with `audiomixer.Mixer`. +//| Used to access and control samples with `audiomixer.Mixer`.""" //| -//| .. class:: MixerVoice() -//| -//| MixerVoice instance object(s) created by `audiomixer.Mixer`. +//| def __init__(self, ): //| +//| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" +//| ... // TODO: support mono or stereo voices STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { audiomixer_mixervoice_obj_t *self = m_new_obj(audiomixer_mixervoice_obj_t); @@ -58,15 +59,14 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| .. method:: play(sample, *, loop=False) +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. +//| Does not block. Use `playing` to block. //| -//| Plays the sample once when ``loop=False``, and continuously when ``loop=True``. -//| Does not block. Use `playing` to block. -//| -//| Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. -//| -//| The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor. +//| Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. //| +//| The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" +//| ... STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -83,10 +83,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_play_obj, 1, audiomixer_mixervoice_obj_play); -//| .. method:: stop() -//| -//| Stops playback of the sample on this voice. -//| +//| def stop(self, ) -> Any: +//| """Stops playback of the sample on this voice.""" +//| ... STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { @@ -102,10 +101,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//| .. attribute:: level() -//| -//| The volume level of a voice, as a floating point number between 0 and 1. -//| +//| level(): Any = +//| """The volume level of a voice, as a floating point number between 0 and 1.""" +//| ... STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { return mp_obj_new_float(common_hal_audiomixer_mixervoice_get_level(self_in)); } @@ -139,10 +137,9 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: playing -//| -//| True when this voice is being output. (read-only) -//| +//| playing: Any = +//| """True when this voice is being output. (read-only)""" +//| ... STATIC mp_obj_t audiomixer_mixervoice_obj_get_playing(mp_obj_t self_in) { audiomixer_mixervoice_obj_t *self = MP_OBJ_TO_PTR(self_in); From 829da5c12732337cc72f2c089bc72cb437a02e0c Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 27 Apr 2020 17:29:50 -0400 Subject: [PATCH 337/919] Added inline pyi to audiomp3 --- shared-bindings/audiomp3/MP3Decoder.c | 113 ++++++++++++-------------- 1 file changed, 53 insertions(+), 60 deletions(-) diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 2240422127..0bb2c88292 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -34,42 +34,42 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiomp3 +//|class MP3: +//| """.. currentmodule:: audiomp3 //| -//| :class:`MP3Decoder` -- Load a mp3 file for audio playback -//| ========================================================= +//| :class:`MP3Decoder` -- Load a mp3 file for audio playback +//| ========================================================= //| -//| An object that decodes MP3 files for playback on an audio device. +//| An object that decodes MP3 files for playback on an audio device.""" //| -//| .. class:: MP3(file[, buffer]) +//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| -//| Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. -//| -//| :param typing.BinaryIO file: Already opened mp3 file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//| :param typing.BinaryIO file: Already opened mp3 file +//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| //| -//| Playing a mp3 file from flash:: +//| Playing a mp3 file from flash:: //| -//| import board -//| import audiomp3 -//| import audioio -//| import digitalio +//| import board +//| import audiomp3 +//| import audioio +//| import digitalio //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb") -//| mp3 = audiomp3.MP3Decoder(data) -//| a = audioio.AudioOut(board.A0) -//| -//| print("playing") -//| a.play(mp3) -//| while a.playing: -//| pass -//| print("stopped") +//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb") +//| mp3 = audiomp3.MP3Decoder(data) +//| a = audioio.AudioOut(board.A0) //| +//| print("playing") +//| a.play(mp3) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -92,10 +92,9 @@ STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the MP3 and releases all memory resources for reuse. -//| +//| def deinit(self, ) -> Any: +//| """Deinitialises the MP3 and releases all memory resources for reuse.""" +//| ... STATIC mp_obj_t audiomp3_mp3file_deinit(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomp3_mp3file_deinit(self); @@ -109,17 +108,16 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. -//| +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: //| +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomp3_mp3file_deinit(args[0]); @@ -127,10 +125,9 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| .. attribute:: file -//| -//| File to play back. -//| +//| file: Any = +//| """File to play back.""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -158,12 +155,11 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//| .. attribute:: sample_rate -//| -//| 32 bit value that dictates how quickly samples are loaded into the DAC -//| in Hertz (cycles per second). When the sample is looped, this can change -//| the pitch output without changing the underlying sample. -//| +//| sample_rate: Any = +//| """32 bit value that dictates how quickly samples are loaded into the DAC +//| in Hertz (cycles per second). When the sample is looped, this can change +//| the pitch output without changing the underlying sample.""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj_get_sample_rate(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -186,10 +182,9 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: bits_per_sample -//| -//| Bits per sample. (read only) -//| +//| bits_per_sample: Any = +//| """Bits per sample. (read only)""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -204,10 +199,9 @@ const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: channel_count -//| -//| Number of audio channels. (read only) -//| +//| channel_count: Any = +//| """Number of audio channels. (read only)""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -222,10 +216,9 @@ const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: rms_level -//| -//| The RMS audio level of a recently played moment of audio. (read only) -//| +//| rms_level: Any = +//| """The RMS audio level of a recently played moment of audio. (read only)""" +//| ... STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From 46713482f49690f96e55f872c087d245b4ce0489 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Apr 2020 14:36:14 -0700 Subject: [PATCH 338/919] Add verification script --- Makefile | 4 ++-- tools/extract_pyi.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 tools/extract_pyi.py diff --git a/Makefile b/Makefile index 5e949cd40f..aa8fc26d1f 100644 --- a/Makefile +++ b/Makefile @@ -213,8 +213,8 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po) $(PYTHON) tools/check_translations.py $^ stubs: - rst2pyi $(VALIDATE) shared-bindings/ $(STUBDIR) - python setup.py sdist + python tools/extract_pyi.py shared-bindings/ $(STUBDIR) + #python setup.py sdist update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py new file mode 100644 index 0000000000..c7f3e4604e --- /dev/null +++ b/tools/extract_pyi.py @@ -0,0 +1,46 @@ +import os +import sys +import astroid +import traceback + +top_level = sys.argv[1].strip("/") +stub_directory = sys.argv[2] + +if top_level.count("/") == 1: + top_level, module = top_level.split("/") + modules = [module] +else: + modules = os.listdir(top_level) + modules = sorted(modules) + +ok = 0 +total = 0 +for module in modules: + module_path = os.path.join(top_level, module) + if not os.path.isdir(module_path): + continue + pyi_lines = [] + for class_file in os.listdir(module_path): + class_path = os.path.join(module_path, class_file) + with open(class_path, "r") as f: + for line in f: + if line.startswith("//| "): + pyi_lines.append(line[4:]) + + stub_filename = os.path.join(stub_directory, module + ".pyi") + print(stub_filename) + stub_contents = "".join(pyi_lines) + with open(stub_filename, "w") as f: + f.write(stub_contents) + + # Validate that the module is a parseable stub. + total += 1 + try: + astroid.parse(stub_contents) + ok += 1 + except astroid.exceptions.AstroidSyntaxError as e: + e = e.__cause__ + traceback.print_exception(type(e), e, e.__traceback__) + print() + +print(f"{ok} ok out of {total}") From 7f0f0b30d3eee87503b732cd639805f6fd094646 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Apr 2020 12:47:52 -0500 Subject: [PATCH 339/919] linker scripts: Re-align at ":" With "git show -b" you can verify that this is a whitespace only change because the diff will be empty. --- ports/litex/boards/fomu/fomu-spi.ld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index cb91ae49be..9b6443c673 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -7,9 +7,9 @@ ENTRY(_start) /* Specify the memory areas */ MEMORY { - FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ + FLASH (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ FLASH_FIRMWARE (rx) : ORIGIN = 0x20040000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ + RAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x00020000 /* 128 KiB */ } /* top end of the stack */ From 2a0e176a770ee43afa98237c1f7b12a9d3888bd7 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 27 Apr 2020 20:43:35 -0400 Subject: [PATCH 340/919] Add readme and dfu-flashing --- ports/stm/Makefile | 4 +++ ports/stm/README.md | 72 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 6bb690fc61..57a5ad0198 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -291,6 +291,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/firmware.hex $(ECHO) "Create $@" $(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ +flash: $(BUILD)/firmware.bin + $(ECHO) "Writing $< to the board" + dfu-util -a 0 --dfuse-address 0x08000000 -D $(BUILD)/firmware.bin + include $(TOP)/py/mkrules.mk # Print out the value of a make variable. diff --git a/ports/stm/README.md b/ports/stm/README.md index f2e3e9b67b..95e9bd13fd 100644 --- a/ports/stm/README.md +++ b/ports/stm/README.md @@ -1,3 +1,71 @@ -# CircuitPython Port To The ST Microelectronics STM32 Series +# Circuitpython on STM32 # -This is a port of CircuitPython to the STM32 series of chips. +This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. + +Refer to the ST Microelectronics website for more information on features sorted by family and individual chip lines: [st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html](https://www.st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html) + +STM32 SoCs vary product-by-product in clock speed, peripheral capability, pin assignments, and their support within this port. Refer to **mpconfigport.mk** for a full list of enabled modules sorted by family. + +## How this port is organized: ## + +- **boards/** contains the configuration files for each development board and breakout available on the port, as well as system files and both shared and SoC-specific linker files. Board configuration includes a pin mapping of the board, oscillator information, board-specific build flags, and setup for OLED or TFT screens where applicable. +- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. +- **packages/** contains package-specific pin bindings (LQFP100, BGA216, etc) +- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. +- **st-driver/** submodule for ST HAL and LL files generated via CubeMX. Shared with TinyUSB. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. + +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. + +## Build instructions ## + +Ensure your clone of Circuitpython is ready to build by following the [guide on the Adafruit Website](https://learn.adafruit.com/building-circuitpython/introduction). This includes installing the toolchain, synchronizing submodules, and running `mpy-cross`. + +Once the one-time build tasks are complete, you can build at any time by navigating to the port directory: + + $ cd ports/stm + +To build for a specific circuitpython board, run: + + $ make BOARD=feather_stm32f405_express + +You may also build with certain flags available in the makefile, depending on your board and development goals. The following flags would enable debug information and correct flash locations for a pre-flashed UF2 bootloader: + + $ make BOARD=feather_stm32f405_express DEBUG=1 UF2_BOOTLOADER=1 + +## USB connection ## + +Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. + +In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. + +## Flash the bootloader ## + +Most ST development boards come with a built-in STLink programming and debugging probe accessible via USB. This programmer may show up as an `MBED` drive on the host PC, enabling simple drag and drop programming with a .bin file, or they may require a tool like [OpenOCD](http://openocd.org/) or [StLink-org/stlink](https://github.com/stlink-org/stlink) to run flashing and debugging commands. + +Many hobbyist and 3rd party development boards also expose SWD pins. These can be used with a cheap [stlink](https://www.adafruit.com/product/2548) debugger or other common programmers. + +For non-ST products or users without a debugger, all STM32 boards in the high performance families (F4, F7 and H7) include a built-in DFU bootloader stored in ROM. This bootloader is accessed by ensuring the BOOT0 pin is held to a logic 1 and the BOOT1 pin is held to a logic 0 when the chip is reset ([ST Appnote AN2606](https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf)). Most chips hold BOOT low by default, so this can usually be achieved by running a jumper wire from 3.3V power to the BOOT0 pin, if it is exposed, or by flipping the appropriate switch or button as the chip is reset. Once the chip is started in DFU mode, BOOT0 no longer needs to be held high and can be released. An example is available in the [Feather STM32F405 guide](https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details). + +Windows users will need to install [stm32cubeprog](https://www.st.com/en/development-tools/stm32cubeprog.html), while Mac and Linux users will need to install `dfu-util` with `brew install dfu-util` or `sudo apt-get install dfu-util`. More details are available in the [Feather F405 guide](https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details). + +## Flashing the circuitpython image with DFU-Util ## + +Ensure the board is in dfu mode by following the steps in the previous section. Then run: + + $ make BOARD=feather_stm32F405_express flash + +Alternatively, you can navigate to the build directory and run the raw `dfu-util` command: + +`dfu-util -a 0 --dfuse-address 0x08000000 -D firmware.bin` + +## Accessing the board ## + +Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. + +Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: + + screen /dev/tty.usbmodem14111201 115200 + +You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. From 48a191a12677deeaa62c1ccdc326f6f814b4ef34 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Apr 2020 18:35:11 -0700 Subject: [PATCH 341/919] Update translations --- locale/ID.po | 9 +++++++-- locale/circuitpython.pot | 9 +++++++-- locale/de_DE.po | 9 +++++++-- locale/en_US.po | 9 +++++++-- locale/en_x_pirate.po | 9 +++++++-- locale/es.po | 9 +++++++-- locale/fil.po | 9 +++++++-- locale/fr.po | 9 +++++++-- locale/it_IT.po | 9 +++++++-- locale/ko.po | 9 +++++++-- locale/pl.po | 9 +++++++-- locale/pt_BR.po | 9 +++++++-- locale/zh_Latn_pinyin.po | 9 +++++++-- 13 files changed, 91 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f6edf52b02..ac10df5bf8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2220,6 +2220,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2709,7 +2713,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 81a77b7592..4b18bfd478 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2196,6 +2196,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2684,7 +2688,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 454299b596..6cf4b7d479 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -2225,6 +2225,10 @@ msgstr "Funktion erwartet maximal %d Argumente, aber hat %d erhalten" msgid "function got multiple values for argument '%q'" msgstr "Funktion hat mehrere Werte für Argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2720,7 +2724,8 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 2c42b83d5f..428a9c4754 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2196,6 +2196,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2684,7 +2688,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index e50fcbf1ba..aacc176f5c 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -2200,6 +2200,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2688,7 +2692,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/es.po b/locale/es.po index 49a3da5722..db60c9d37a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2227,6 +2227,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2722,7 +2726,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 6d8737aad9..6d577823fa 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2241,6 +2241,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2735,7 +2739,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 9185382880..4d07eda19b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2266,6 +2266,10 @@ msgstr "la fonction attendait au plus %d arguments, reçu %d" msgid "function got multiple values for argument '%q'" msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2762,7 +2766,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index c0be241768..0c0825e5ec 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2242,6 +2242,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2740,7 +2744,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index dc54cf17e5..3e3ac1cf60 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -2201,6 +2201,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2689,7 +2693,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 02463b1bca..8cc3c30b7a 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -2205,6 +2205,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2693,7 +2697,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "tylko fragmenty ze step=1 (lub None) są wspierane" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index af33053286..d833169c0f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2218,6 +2218,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2706,7 +2710,8 @@ msgstr "" msgid "only slices with step=1 (aka None) are supported" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 48d48fc131..e7d6df02fa 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 17:43-0700\n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2233,6 +2233,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" @@ -2723,7 +2727,8 @@ msgstr "Jǐn zhīchí cǎiyàng lǜ = 16000" msgid "only slices with step=1 (aka None) are supported" msgstr "jǐn zhīchí bù zhǎng = 1(jí wú) de qiēpiàn" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/vectorise.c +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" msgstr "" From 76b466a38afb8eb6cc50b6678f10c036f02004c2 Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Mon, 27 Apr 2020 22:49:30 -0400 Subject: [PATCH 342/919] add submodule to TG-Watch02A --- ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index c75c6dd394..c8d87694f5 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -1,6 +1,5 @@ USB_VID = 0x239A USB_PID = 0x802A - USB_PRODUCT = "TG-Watch02A" USB_MANUFACTURER = "TG-Tech" @@ -9,3 +8,6 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register From e45de399984b7f3640525a5bcaa462eeeb3ff30f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Apr 2020 20:28:05 -0700 Subject: [PATCH 343/919] Fix nucleo_f746zg build --- .../boards/nucleo_f746zg/stm32f7xx_hal_conf.h | 445 ------------------ .../peripherals/stm32f7/stm32f746xx/clocks.c | 2 +- 2 files changed, 1 insertion(+), 446 deletions(-) delete mode 100644 ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h diff --git a/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h b/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h deleted file mode 100644 index 84699bd784..0000000000 --- a/ports/stm/boards/nucleo_f746zg/stm32f7xx_hal_conf.h +++ /dev/null @@ -1,445 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f7xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f7xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F7xx_HAL_CONF_H -#define __STM32F7xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - #define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -#define HAL_ETH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 0U -#define ART_ACCLERATOR_ENABLE 0U /* To enable instruction cache and prefetch */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* LAN8742A_PHY_ADDRESS Address*/ -#define LAN8742A_PHY_ADDRESS 0 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ - -#define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ -#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f7xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f7xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f7xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f7xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f7xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f7xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f7xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f7xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f7xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f7xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f7xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f7xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f7xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f7xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f7xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f7xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f7xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f7xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f7xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f7xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f7xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f7xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f7xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f7xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f7xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f7xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f7xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f7xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f7xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f7xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f7xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f7xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f7xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f7xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f7xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f7xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f7xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f7xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f7xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f7xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f7xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f7xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f7xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f7xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_JPEG_MODULE_ENABLED - #include "stm32f7xx_hal_jpeg.h" -#endif /* HAL_JPEG_MODULE_ENABLED */ - -#ifdef HAL_MDIOS_MODULE_ENABLED - #include "stm32f7xx_hal_mdios.h" -#endif /* HAL_MDIOS_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32f7xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F7xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c index b73a1a20d9..2afa2e377a 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c @@ -26,7 +26,7 @@ * THE SOFTWARE. */ -#include "py/mpconfig.h" +#include STM32_HAL_H #ifndef BOARD_OSC_DIV #define BOARD_OSC_DIV (8) From b7804f450b2d73ae73fd058d7ddaafb6c509adcb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 27 Apr 2020 20:34:42 -0700 Subject: [PATCH 344/919] Fix stm32746g_discovery Also, rename it so that matches the other board names. --- .github/workflows/build.yml | 2 +- .../stm32f746g_disco/stm32f7xx_hal_conf.h | 445 ------------------ .../board.c | 0 .../mpconfigboard.h | 1 + .../mpconfigboard.mk | 0 .../pins.c | 0 6 files changed, 2 insertions(+), 446 deletions(-) delete mode 100644 ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h rename ports/stm/boards/{stm32f746g_disco => stm32f746g_discovery}/board.c (100%) rename ports/stm/boards/{stm32f746g_disco => stm32f746g_discovery}/mpconfigboard.h (97%) rename ports/stm/boards/{stm32f746g_disco => stm32f746g_discovery}/mpconfigboard.mk (100%) rename ports/stm/boards/{stm32f746g_disco => stm32f746g_discovery}/pins.c (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14373bb88e..aad7f7cecc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,7 +243,7 @@ jobs: - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stm32f4_discovery" - - "stm32f746g_disco" + - "stm32f746g_discovery" - "stringcar_m0_express" - "teensy40" - "teknikio_bluebird" diff --git a/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h b/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h deleted file mode 100644 index de72c6e024..0000000000 --- a/ports/stm/boards/stm32f746g_disco/stm32f7xx_hal_conf.h +++ /dev/null @@ -1,445 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f7xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f7xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F7xx_HAL_CONF_H -#define __STM32F7xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - #define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -#define HAL_ETH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 0U -#define ART_ACCLERATOR_ENABLE 0U /* To enable instruction cache and prefetch */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* LAN8742A_PHY_ADDRESS Address*/ -#define LAN8742A_PHY_ADDRESS 0 -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x1FU) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */ - -#define PHY_ISFR ((uint16_t)0x001DU) /*!< PHY Interrupt Source Flag register Offset */ -#define PHY_ISFR_INT4 ((uint16_t)0x000BU) /*!< PHY Link down inturrupt */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f7xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f7xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f7xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f7xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f7xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f7xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f7xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f7xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f7xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f7xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f7xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f7xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f7xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f7xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f7xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f7xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f7xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f7xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f7xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f7xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f7xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f7xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f7xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f7xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f7xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f7xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f7xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f7xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f7xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f7xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f7xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f7xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f7xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f7xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f7xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f7xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f7xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f7xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f7xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f7xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f7xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f7xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f7xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f7xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_JPEG_MODULE_ENABLED - #include "stm32f7xx_hal_jpeg.h" -#endif /* HAL_JPEG_MODULE_ENABLED */ - -#ifdef HAL_MDIOS_MODULE_ENABLED - #include "stm32f7xx_hal_mdios.h" -#endif /* HAL_MDIOS_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32f7xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F7xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/stm32f746g_disco/board.c b/ports/stm/boards/stm32f746g_discovery/board.c similarity index 100% rename from ports/stm/boards/stm32f746g_disco/board.c rename to ports/stm/boards/stm32f746g_discovery/board.c diff --git a/ports/stm/boards/stm32f746g_disco/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h similarity index 97% rename from ports/stm/boards/stm32f746g_disco/mpconfigboard.h rename to ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 05184940b2..28784f6ab9 100644 --- a/ports/stm/boards/stm32f746g_disco/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -35,6 +35,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (25) +#define HSE_VALUE ((uint32_t)25000000) #define BOARD_OSC_PLLN (400) #define BOARD_OSC_PLLQ (9) diff --git a/ports/stm/boards/stm32f746g_disco/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk similarity index 100% rename from ports/stm/boards/stm32f746g_disco/mpconfigboard.mk rename to ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk diff --git a/ports/stm/boards/stm32f746g_disco/pins.c b/ports/stm/boards/stm32f746g_discovery/pins.c similarity index 100% rename from ports/stm/boards/stm32f746g_disco/pins.c rename to ports/stm/boards/stm32f746g_discovery/pins.c From b9e494b85aacab795f1c2b8f7c19f1824681b02c Mon Sep 17 00:00:00 2001 From: TG-Techie Date: Tue, 28 Apr 2020 00:03:02 -0400 Subject: [PATCH 345/919] add submodule to TG-Watch02A --- .gitmodules | 18 ++++++++++++++++++ frozen/Adafruit_CircuitPython_BLE | 1 + ...CircuitPython_BLE_Apple_Notification_Center | 1 + frozen/Adafruit_CircuitPython_DRV2605 | 1 + frozen/Adafruit_CircuitPython_DS3231 | 1 + frozen/Adafruit_CircuitPython_FocalTouch | 1 + frozen/Adafruit_CircuitPython_LSM6DS | 1 + ports/nrf/boards/TG-Watch02A/mpconfigboard.mk | 6 ++++++ 8 files changed, 30 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_BLE create mode 160000 frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center create mode 160000 frozen/Adafruit_CircuitPython_DRV2605 create mode 160000 frozen/Adafruit_CircuitPython_DS3231 create mode 160000 frozen/Adafruit_CircuitPython_FocalTouch create mode 160000 frozen/Adafruit_CircuitPython_LSM6DS diff --git a/.gitmodules b/.gitmodules index ebff8ecb2a..2884f79a57 100644 --- a/.gitmodules +++ b/.gitmodules @@ -122,3 +122,21 @@ [submodule "lib/protomatter"] path = lib/protomatter url = https://github.com/adafruit/Adafruit_Protomatter +[submodule "frozen/Adafruit_CircuitPython_LSM6DS"] + path = frozen/Adafruit_CircuitPython_LSM6DS + url = https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS +[submodule "frozen/Adafruit_CircuitPython_FocalTouch"] + path = frozen/Adafruit_CircuitPython_FocalTouch + url = https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch +[submodule "frozen/Adafruit_CircuitPython_DS3231"] + path = frozen/Adafruit_CircuitPython_DS3231 + url = https://github.com/adafruit/Adafruit_CircuitPython_DS3231 +[submodule "frozen/Adafruit_CircuitPython_DRV2605"] + path = frozen/Adafruit_CircuitPython_DRV2605 + url = https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 +[submodule "frozen/Adafruit_CircuitPython_BLE"] + path = frozen/Adafruit_CircuitPython_BLE + url = https://github.com/adafruit/Adafruit_CircuitPython_BLE +[submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"] + path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center + url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE new file mode 160000 index 0000000000..96774b15da --- /dev/null +++ b/frozen/Adafruit_CircuitPython_BLE @@ -0,0 +1 @@ +Subproject commit 96774b15da61da54662bcfbbf15b5bdc27315a9f diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center new file mode 160000 index 0000000000..3ffb3f02d2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -0,0 +1 @@ +Subproject commit 3ffb3f02d2046910e09d1f5a74721bd1a4cdf8cf diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 new file mode 160000 index 0000000000..7914a63903 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -0,0 +1 @@ +Subproject commit 7914a6390318687bb8e2e9c4119aa932fea01531 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 new file mode 160000 index 0000000000..0d49a1fcd9 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -0,0 +1 @@ +Subproject commit 0d49a1fcd96c13a94e8bdf26f92abe79b8517906 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch new file mode 160000 index 0000000000..72968d3546 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -0,0 +1 @@ +Subproject commit 72968d3546f9d6c5af138d4c179343007cb9662c diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS new file mode 160000 index 0000000000..24224cc905 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -0,0 +1 @@ +Subproject commit 24224cc905fad4646506caeb2451b4a495804ffc diff --git a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk index c8d87694f5..08915a19b9 100644 --- a/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch02A/mpconfigboard.mk @@ -11,3 +11,9 @@ EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JV_SQ" FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LSM6DS +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_FocalTouch +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DS3231 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DRV2605 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center From 6c4decd4e280d30c6b45ed74ac3e0c9b12194cd9 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 28 Apr 2020 11:51:07 -0700 Subject: [PATCH 346/919] decoupling chip specific functions from EXTERNAL_FLASH_QSPI_SINGLE --- ports/atmel-samd/Makefile | 2 +- .../boards/pycubed/mpconfigboard.mk | 3 +- .../boards/pycubed_mram/mpconfigboard.h | 6 +- .../boards/pycubed_mram/mpconfigboard.mk | 7 +- ports/atmel-samd/boards/pycubed_mram/pins.c | 8 +- ports/atmel-samd/supervisor/qspi_flash.c | 2 +- supervisor/shared/external_flash/devices.h | 36 +++--- .../shared/external_flash/external_flash.c | 122 +++++++++++------- 8 files changed, 107 insertions(+), 79 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 7a626dff71..d6b3a543ac 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -53,7 +53,7 @@ include $(TOP)/supervisor/supervisor.mk # Include make rules and variables common across CircuitPython builds. include $(TOP)/py/circuitpy_defns.mk -CROSS_COMPILE = arm-none-eabi- +CROSS_COMPILE = ~/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- HAL_DIR=hal/$(MCU_SERIES) diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index adaeecb893..b7b8073ab9 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x04D8 USB_PID = 0xEC44 USB_PRODUCT = "PyCubed" @@ -12,6 +11,8 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = W25Q80DV LONGINT_IMPL = MPZ +CIRCUITPY_DRIVE_LABEL = "PYCUBED" + # Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 diff --git a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h index aca9e3c368..e2a733025d 100644 --- a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h +++ b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h @@ -1,4 +1,3 @@ - #define MICROPY_HW_BOARD_NAME "PyCubedv04-MRAM" #define MICROPY_HW_MCU_NAME "samd51j19" #define CIRCUITPY_MCU_FAMILY samd51 @@ -11,8 +10,12 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) +#define SPI_FLASH_WP_PIN &pin_PA10 +#define SPI_FLASH_HOLD_PIN &pin_PA11 + // External flash MR2xH40 MRAM #define EXTERNAL_FLASH_QSPI_SINGLE +#define EXTERNAL_FLASH_NO_JEDEC #define AUTORESET_DELAY_MS 500 @@ -34,4 +37,3 @@ #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk index ef92b4db56..f49bb3fef0 100644 --- a/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x04D8 USB_PID = 0xEC44 USB_PRODUCT = "PyCubed" @@ -12,13 +11,17 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = MR2xH40 LONGINT_IMPL = MPZ +CIRCUITPY_DRIVE_LABEL = "PYCUBED" + # Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD diff --git a/ports/atmel-samd/boards/pycubed_mram/pins.c b/ports/atmel-samd/boards/pycubed_mram/pins.c index 4c97f58a80..e494fb54bf 100644 --- a/ports/atmel-samd/boards/pycubed_mram/pins.c +++ b/ports/atmel-samd/boards/pycubed_mram/pins.c @@ -40,16 +40,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) }, - + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/supervisor/qspi_flash.c b/ports/atmel-samd/supervisor/qspi_flash.c index fc538f95f3..aaed2a0eee 100644 --- a/ports/atmel-samd/supervisor/qspi_flash.c +++ b/ports/atmel-samd/supervisor/qspi_flash.c @@ -169,7 +169,7 @@ bool spi_flash_read_data(uint32_t address, uint8_t* data, uint32_t length) { #ifdef EXTERNAL_FLASH_QSPI_SINGLE QSPI->INSTRCTRL.bit.INSTR = CMD_READ_DATA; uint32_t mode = QSPI_INSTRFRAME_WIDTH_SINGLE_BIT_SPI; - #elif defined EXTERNAL_FLASH_QSPI_DUAL + #elif defined(EXTERNAL_FLASH_QSPI_DUAL) QSPI->INSTRCTRL.bit.INSTR = CMD_DUAL_READ; uint32_t mode = QSPI_INSTRFRAME_WIDTH_DUAL_OUTPUT; #else diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index e148db9851..08e38ed912 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -64,6 +64,15 @@ typedef struct { // True when the status register is a single byte. This implies the Quad Enable bit is in the // first byte and the Read Status Register 2 command (0x35) is unsupported. bool single_status_byte: 1; + + // Does not support using a ready bit within the status register + bool no_ready_bit: 1; + + // Does not support the erase command (0x20) + bool no_erase_cmd: 1; + + // Device does not have a reset command + bool no_reset_cmd: 1; } external_flash_device; // Settings for the Adesto Tech AT25DF081A 1MiB SPI flash. It's on the SAMD21 @@ -426,14 +435,15 @@ typedef struct { .single_status_byte = false, \ } -// Everspin MRAM +// Settings for the Everspin MR20H40 / MR25H40 magnetic non-volatile RAM +// Datasheet: https://www.everspin.com/supportdocs/MR25H40CDFR #define MR2xH40 {\ .total_size = (1 << 22), /* 4 MiB */ \ .start_up_time_us = 10000, \ .manufacturer_id = 0xef, /*no JDEC*/ \ .memory_type = 0x40, /*no JDEC*/ \ .capacity = 0x14, /*no JDEC*/ \ - .max_clock_speed_mhz = 40, \ + .max_clock_speed_mhz = 10, \ .quad_enable_bit_mask = 0x00, \ .has_sector_protection = false, \ .supports_fast_read = false, \ @@ -441,6 +451,9 @@ typedef struct { .supports_qspi_writes = false, \ .write_status_register_split = false, \ .single_status_byte = true, \ + .no_ready_bit = true, \ + .no_erase_cmd = true, \ + .no_reset_cmd = true, \ } // Settings for the Macronix MX25L1606 2MiB SPI flash. @@ -498,25 +511,6 @@ typedef struct { .single_status_byte = true, \ } -// Settings for the Macronix MX25R1635F 8MiB SPI flash. -// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F,%20Wide%20Range,%2016Mb,%20v1.6.pdf -// In low power mode, quad operations can only run at 8 MHz. -#define MX25R1635F {\ - .total_size = (1 << 21), /* 2 MiB */ \ - .start_up_time_us = 800, \ - .manufacturer_id = 0xc2, \ - .memory_type = 0x28, \ - .capacity = 0x18, \ - .max_clock_speed_mhz = 33, /* 8 mhz for dual/quad */ \ - .quad_enable_bit_mask = 0x80, \ - .has_sector_protection = false, \ - .supports_fast_read = true, \ - .supports_qspi = true, \ - .supports_qspi_writes = true, \ - .write_status_register_split = false, \ - .single_status_byte = true, \ -} - // Settings for the Macronix MX25L51245G 64MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7437/MX25L51245G,%203V,%20512Mb,%20v1.6.pdf #define MX25L51245G {\ diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 7f5496d3ac..6c14da4107 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -59,16 +59,16 @@ static supervisor_allocation* supervisor_cache = NULL; static bool wait_for_flash_ready(void) { bool ok = true; // Both the write enable and write in progress bits should be low. - #ifdef EXTERNAL_FLASH_QSPI_SINGLE + if (flash_device->no_ready_bit){ // For NVM without a ready bit in status register return ok; - #else + } else { uint8_t read_status_response[1] = {0x00}; do { ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); } while (ok && (read_status_response[0] & 0x3) != 0); return ok; - #endif + } } // Turn on the write enable bit so we can program and erase the flash. @@ -96,7 +96,8 @@ static bool write_flash(uint32_t address, const uint8_t* data, uint32_t data_len } // Don't bother writing if the data is all 1s. Thats equivalent to the flash // state after an erase. - #ifndef EXTERNAL_FLASH_QSPI_SINGLE + if (!flash_device->no_erase_cmd){ + // Only do this if the device has an erase command bool all_ones = true; for (uint16_t i = 0; i < data_length; i++) { if (data[i] != 0xff) { @@ -107,7 +108,7 @@ static bool write_flash(uint32_t address, const uint8_t* data, uint32_t data_len if (all_ones) { return true; } - #endif + } for (uint32_t bytes_written = 0; bytes_written < data_length; @@ -127,29 +128,34 @@ static bool write_flash(uint32_t address, const uint8_t* data, uint32_t data_len static bool page_erased(uint32_t sector_address) { // Check the first few bytes to catch the common case where there is data // without using a bunch of memory. - uint8_t short_buffer[4]; - if (read_flash(sector_address, short_buffer, 4)) { - for (uint16_t i = 0; i < 4; i++) { - if (short_buffer[i] != 0xff) { - return false; - } - } + if (flash_device->no_erase_cmd){ + // skip this if device doesn't have an erase command. + return true; } else { - return false; - } + uint8_t short_buffer[4]; + if (read_flash(sector_address, short_buffer, 4)) { + for (uint16_t i = 0; i < 4; i++) { + if (short_buffer[i] != 0xff) { + return false; + } + } + } else { + return false; + } - // Now check the full length. - uint8_t full_buffer[FILESYSTEM_BLOCK_SIZE]; - if (read_flash(sector_address, full_buffer, FILESYSTEM_BLOCK_SIZE)) { - for (uint16_t i = 0; i < FILESYSTEM_BLOCK_SIZE; i++) { - if (short_buffer[i] != 0xff) { - return false; + // Now check the full length. + uint8_t full_buffer[FILESYSTEM_BLOCK_SIZE]; + if (read_flash(sector_address, full_buffer, FILESYSTEM_BLOCK_SIZE)) { + for (uint16_t i = 0; i < FILESYSTEM_BLOCK_SIZE; i++) { + if (short_buffer[i] != 0xff) { + return false; + } } + } else { + return false; } - } else { - return false; + return true; } - return true; } // Erases the given sector. Make sure you copied all of the data out of it you @@ -157,12 +163,20 @@ static bool page_erased(uint32_t sector_address) { static bool erase_sector(uint32_t sector_address) { // Before we erase the sector we need to wait for any writes to finish and // and then enable the write again. - if (!wait_for_flash_ready() || !write_enable()) { - return false; + if (flash_device->no_erase_cmd){ + // skip this if device doesn't have an erase command. + return true; + } else { + if (!wait_for_flash_ready() || !write_enable()) { + return false; + } + if (flash_device->no_erase_cmd) { + return true; + } else { + spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address); + return true; + } } - - spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address); - return true; } // Sector is really 24 bits. @@ -198,20 +212,31 @@ void supervisor_flash_init(void) { spi_flash_init(); -#ifdef EXTERNAL_FLASH_QSPI_SINGLE - // For NVM that don't have JEDEC response - spi_flash_command(CMD_WAKE); - for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { - const external_flash_device* possible_device = &possible_devices[i]; +#ifdef EXTERNAL_FLASH_NO_JEDEC + // For NVM that don't have JEDEC response + spi_flash_command(CMD_WAKE); + for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { + const external_flash_device* possible_device = &possible_devices[i]; + flash_device = possible_device; + break; + } +#else + // The response will be 0xff if the flash needs more time to start up. + uint8_t jedec_id_response[3] = {0xff, 0xff, 0xff}; + while (jedec_id_response[0] == 0xff) { + spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); + } + + for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { + const external_flash_device* possible_device = &possible_devices[i]; + if (jedec_id_response[0] == possible_device->manufacturer_id && + jedec_id_response[1] == possible_device->memory_type && + jedec_id_response[2] == possible_device->capacity) { flash_device = possible_device; break; + } } -#else - // The response will be 0xff if the flash needs more time to start up. - uint8_t jedec_id_response[3] = {0xff, 0xff, 0xff}; - while (jedec_id_response[0] == 0xff) { - spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); - } +#endif for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { const external_flash_device* possible_device = &possible_devices[i]; @@ -227,20 +252,23 @@ void supervisor_flash_init(void) { return; } - // We don't know what state the flash is in so wait for any remaining writes and then reset. - uint8_t read_status_response[1] = {0x00}; - // The write in progress bit should be low. - do { - spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); - } while ((read_status_response[0] & 0x1) != 0); -#ifndef EXTERNAL_FLASH_QSPI_SINGLE + // We don't know what state the flash is in so wait for any remaining writes and then reset. + uint8_t read_status_response[1] = {0x00}; + // The write in progress bit should be low. + do { + spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); + } while ((read_status_response[0] & 0x1) != 0); + + if (!(flash_device->no_reset_cmd)){ // The suspended write/erase bit should be low. do { spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); } while ((read_status_response[0] & 0x80) != 0); + } else { spi_flash_command(CMD_ENABLE_RESET); spi_flash_command(CMD_RESET); -#endif + } + // Wait 30us for the reset common_hal_mcu_delay_us(30); From b2de5a9df9f32349983d02d8e99c334151dc6119 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 28 Apr 2020 12:24:10 -0700 Subject: [PATCH 347/919] fixing my goofy gcc-arm local stuff --- ports/atmel-samd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index d6b3a543ac..7a626dff71 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -53,7 +53,7 @@ include $(TOP)/supervisor/supervisor.mk # Include make rules and variables common across CircuitPython builds. include $(TOP)/py/circuitpy_defns.mk -CROSS_COMPILE = ~/opt/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- +CROSS_COMPILE = arm-none-eabi- HAL_DIR=hal/$(MCU_SERIES) From 724dcda3ec8319e961fb032e4bef2524c9bf6948 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 28 Apr 2020 18:39:58 -0400 Subject: [PATCH 348/919] Fixed whitespace in busio --- shared-bindings/busio/I2C.c | 178 ++++++++++++++-------------- shared-bindings/busio/OneWire.c | 86 +++++++------- shared-bindings/busio/SPI.c | 198 ++++++++++++++++---------------- shared-bindings/busio/UART.c | 160 +++++++++++++------------- 4 files changed, 311 insertions(+), 311 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 0cd392f9a8..8b71be085d 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -37,32 +37,32 @@ #include "supervisor/shared/translate.h" //|class I2C: -//| """.. currentmodule:: busio +//|""".. currentmodule:: busio //| -//| :class:`I2C` --- Two wire serial protocol -//| ------------------------------------------""" -//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): -//| """I2C is a two-wire protocol for communicating between devices. At the -//| physical level it consists of 2 wires: SCL and SDA, the clock and data -//| lines respectively. +//|:class:`I2C` --- Two wire serial protocol +//|------------------------------------------""" +//|def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): +//|"""I2C is a two-wire protocol for communicating between devices. At the +//|physical level it consists of 2 wires: SCL and SDA, the clock and data +//|lines respectively. //| -//| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to -//| manage locks. +//|.. seealso:: Using this class directly requires careful lock management. +//|Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//|manage locks. //| -//| .. seealso:: Using this class to directly read registers requires manual -//| bit unpacking. Instead, use an existing driver or make one with -//| :ref:`Register ` data descriptors. +//|.. seealso:: Using this class to directly read registers requires manual +//|bit unpacking. Instead, use an existing driver or make one with +//|:ref:`Register ` data descriptors. //| -//| :param ~microcontroller.Pin scl: The clock pin -//| :param ~microcontroller.Pin sda: The data pin -//| :param int frequency: The clock frequency in Hertz -//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) +//|:param ~microcontroller.Pin scl: The clock pin +//|:param ~microcontroller.Pin sda: The data pin +//|:param int frequency: The clock frequency in Hertz +//|:param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) //| -//| .. note:: On the nRF52840, only one I2C object may be created, -//| except on the Circuit Playground Bluefruit, which allows two, -//| one for the onboard accelerometer, and one for offboard use.""" -//| ... +//|.. note:: On the nRF52840, only one I2C object may be created, +//|except on the Circuit Playground Bluefruit, which allows two, +//|one for the onboard accelerometer, and one for offboard use.""" +//|... STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t); self->base.type = &busio_i2c_type; @@ -83,9 +83,9 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: -//| """Releases control of the underlying hardware so other classes can use it.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Releases control of the underlying hardware so other classes can use it.""" +//|... STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_i2c_deinit(self); @@ -99,15 +99,15 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used in Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used in Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware on context exit. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_i2c_deinit(args[0]); @@ -122,13 +122,13 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| def scan(self, ) -> Any: -//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a -//| list of those that respond. +//|def scan(self, ) -> Any: +//|"""Scan all I2C addresses between 0x08 and 0x77 inclusive and return a +//|list of those that respond. //| -//| :return: List of device ids on the I2C bus -//| :rtype: list""" -//| ... +//|:return: List of device ids on the I2C bus +//|:rtype: list""" +//|... STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -145,11 +145,11 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//| def try_lock(self, ) -> Any: -//| """Attempts to grab the I2C lock. Returns True on success. -//| :return: True when lock has been grabbed -//| :rtype: bool""" -//| ... +//|def try_lock(self, ) -> Any: +//|"""Attempts to grab the I2C lock. Returns True on success. +//|:return: True when lock has been grabbed +//|:rtype: bool""" +//|... STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -157,9 +157,9 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| def unlock(self, ) -> Any: -//| """Releases the I2C lock.""" -//| ... +//|def unlock(self, ) -> Any: +//|"""Releases the I2C lock.""" +//|... STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -168,20 +168,20 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. -//| The number of bytes read will be the length of ``buffer``. -//| At least one byte must be read. +//|def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//|"""Read into ``buffer`` from the slave specified by ``address``. +//|The number of bytes read will be the length of ``buffer``. +//|At least one byte must be read. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buf[start:end]`` will so it saves memory. +//|If ``start`` or ``end`` is provided, then the buffer will be sliced +//|as if ``buffer[start:end]``. This will not cause an allocation like +//|``buf[start:end]`` will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into -//| :param int start: Index to start writing at -//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//|:param int address: 7-bit device address +//|:param bytearray buffer: buffer to write into +//|:param int start: Index to start writing at +//|:param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//|... // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { mp_buffer_info_t bufinfo; @@ -219,26 +219,26 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address``. -//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be -//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and -//| repeated start before a read. +//|def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//|"""Write the bytes from ``buffer`` to the slave specified by ``address``. +//|Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be +//|removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and +//|repeated start before a read. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buffer[start:end]`` will so it saves memory. +//|If ``start`` or ``end`` is provided, then the buffer will be sliced +//|as if ``buffer[start:end]``. This will not cause an allocation like +//|``buffer[start:end]`` will so it saves memory. //| -//| Writing a buffer or slice of length zero is permitted, as it can be used -//| to poll for the existence of a device. +//|Writing a buffer or slice of length zero is permitted, as it can be used +//|to poll for the existence of a device. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write -//| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True.""" -//| ... +//|:param int address: 7-bit device address +//|:param bytearray buffer: buffer containing the bytes to write +//|:param int start: Index to start writing from +//|:param int end: Index to read up to but not include. Defaults to ``len(buffer)`` +//|:param bool stop: If true, output an I2C stop condition after the buffer is written. +//|Deprecated. Will be removed in 6.x and act as stop=True.""" +//|... // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { // get the buffer to write the data from @@ -277,23 +277,23 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop -//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//| ``in_buffer`` can be the same buffer because they are used sequentially. +//|def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//|"""Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//|bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//|``in_buffer`` can be the same buffer because they are used sequentially. //| -//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//| will so it saves memory. +//|If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//|as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//|will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into -//| :param int out_start: Index to start writing from -//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param int in_start: Index to start writing at -//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//|:param int address: 7-bit device address +//|:param bytearray out_buffer: buffer containing the bytes to write +//|:param bytearray in_buffer: buffer to write into +//|:param int out_start: Index to start writing from +//|:param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//|:param int in_start: Index to start writing at +//|:param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//|... STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index dd4410d468..d6af32bd95 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -35,35 +35,35 @@ #include "shared-bindings/util.h" //|class OneWire: -//| """.. currentmodule:: busio +//|""".. currentmodule:: busio //| -//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//| =================================================================""" +//|:class:`OneWire` -- Lowest-level of the Maxim OneWire protocol +//|=================================================================""" //| -//| def __init__(self, pin: microcontroller.Pin): -//| """:class:`~busio.OneWire` implements the timing-sensitive foundation of the Maxim -//| (formerly Dallas Semi) OneWire protocol. +//|__init__(self, pin: microcontroller.Pin): +//|""":class:`~busio.OneWire` implements the timing-sensitive foundation of the Maxim +//|(formerly Dallas Semi) OneWire protocol. //| -//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 +//|Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 //| -//| .. class:: OneWire(pin) +//|.. class:: OneWire(pin) //| -//| Create a OneWire object associated with the given pin. The object -//| implements the lowest level timing-sensitive bits of the protocol. +//|Create a OneWire object associated with the given pin. The object +//|implements the lowest level timing-sensitive bits of the protocol. //| -//| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus +//|:param ~microcontroller.Pin pin: Pin connected to the OneWire bus //| -//| Read a short series of pulses:: +//|Read a short series of pulses:: //| -//| import busio -//| import board +//|import busio +//|import board //| -//| onewire = busio.OneWire(board.D7) -//| onewire.reset() -//| onewire.write_bit(True) -//| onewire.write_bit(False) -//| print(onewire.read_bit())""" -//| ... +//|onewire = busio.OneWire(board.D7) +//|onewire.reset() +//|onewire.write_bit(True) +//|onewire.write_bit(False) +//|print(onewire.read_bit())""" +//|... STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; static const mp_arg_t allowed_args[] = { @@ -80,9 +80,9 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialize the OneWire bus and release any hardware resources for reuse.""" +//|... STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_onewire_deinit(self); @@ -96,15 +96,15 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_onewire_deinit(args[0]); @@ -112,12 +112,12 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//| def reset(self, ) -> Any: -//| """Reset the OneWire bus and read presence +//|def reset(self, ) -> Any: +//|"""Reset the OneWire bus and read presence //| -//| :returns: False when at least one device is present -//| :rtype: bool""" -//| ... +//|:returns: False when at least one device is present +//|:rtype: bool""" +//|... STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -126,12 +126,12 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//| def read_bit(self, ) -> Any: -//| """Read in a bit +//|def read_bit(self, ) -> Any: +//|"""Read in a bit //| -//| :returns: bit state read -//| :rtype: bool""" -//| ... +//|:returns: bit state read +//|:rtype: bool""" +//|... STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -140,9 +140,9 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); -//| def write_bit(self, value: Any) -> Any: -//| """Write out a bit based on value.""" -//| ... +//|def write_bit(self, value: Any) -> Any: +//|"""Write out a bit based on value.""" +//|... STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 1ac9629f80..5643b0d04e 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -42,42 +42,42 @@ //|class SPI: -//| """.. currentmodule:: busio +//|""".. currentmodule:: busio //| -//| `SPI` -- a 3-4 wire serial protocol -//| ----------------------------------------------- +//|`SPI` -- a 3-4 wire serial protocol +//|----------------------------------------------- //| -//| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~busio.I2C` because a -//| separate pin is used to control the active slave rather than a transitted -//| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//|SPI is a serial protocol that has exclusive pins for data in and out of the +//|master. It is typically faster than :py:class:`~busio.I2C` because a +//|separate pin is used to control the active slave rather than a transitted +//|address. This class only manages three of the four SPI lines: `!clock`, +//|`!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave +//|select line. (This is common because multiple slaves can share the `!clock`, +//|`!MOSI` and `!MISO` lines and therefore the hardware.)""" //| -//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//|def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| -//| """Construct an SPI object on the given pins. +//|"""Construct an SPI object on the given pins. //| -//| ..note:: The SPI peripherals allocated in order of desirability, if possible, -//| such as highest speed and not shared use first. For instance, on the nRF52840, -//| there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, -//| some of which may also be used for I2C. The 32MHz SPI peripheral is returned -//| first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz -//| peripherals. +//|..note:: The SPI peripherals allocated in order of desirability, if possible, +//|such as highest speed and not shared use first. For instance, on the nRF52840, +//|there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, +//|some of which may also be used for I2C. The 32MHz SPI peripheral is returned +//|first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz +//|peripherals. //| -//| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to -//| manage locks. +//|.. seealso:: Using this class directly requires careful lock management. +//|Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//|manage locks. //| -//| .. seealso:: Using this class to directly read registers requires manual -//| bit unpacking. Instead, use an existing driver or make one with -//| :ref:`Register ` data descriptors. +//|.. seealso:: Using this class to directly read registers requires manual +//|bit unpacking. Instead, use an existing driver or make one with +//|:ref:`Register ` data descriptors. //| -//| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" -//| ... +//|:param ~microcontroller.Pin clock: the pin to use for the clock. +//|:param ~microcontroller.Pin MOSI: the Master Out Slave In pin. +//|:param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//|... // TODO(tannewt): Support LSB SPI. @@ -101,9 +101,9 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Turn off the SPI bus.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Turn off the SPI bus.""" +//|... STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -111,15 +111,15 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers. -//| Provided by context manager helper.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers. +//|Provided by context manager helper.""" +//|... -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -140,28 +140,28 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { } } -//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: -//| """Configures the SPI bus. The SPI object must be locked. +//|def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//|"""Configures the SPI bus. The SPI object must be locked. //| -//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower -//| due to the granularity of available clock settings. -//| Check the `frequency` attribute for the actual clock rate. -//| :param int polarity: the base state of the clock line (0 or 1) -//| :param int phase: the edge of the clock that data is captured. First (0) -//| or second (1). Rising or falling depends on clock polarity. -//| :param int bits: the number of bits per word +//|:param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower +//|due to the granularity of available clock settings. +//|Check the `frequency` attribute for the actual clock rate. +//|:param int polarity: the base state of the clock line (0 or 1) +//|:param int phase: the edge of the clock that data is captured. First (0) +//|or second (1). Rising or falling depends on clock polarity. +//|:param int bits: the number of bits per word //| -//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that -//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is -//| within spec for the SAMD21. +//|.. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that +//|speed is not guaranteed to work. 12 MHz is the next available lower speed, and is +//|within spec for the SAMD21. //| -//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, -//| and 8MHz. -//| If you pick a a baudrate other than one of these, the nearest lower -//| baudrate will be chosen, with a minimum of 125kHz. -//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, -//| which allows only one (to allow for an additional I2C object).""" -//| ... +//|.. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, +//|and 8MHz. +//|If you pick a a baudrate other than one of these, the nearest lower +//|baudrate will be chosen, with a minimum of 125kHz. +//|Two SPI objects may be created, except on the Circuit Playground Bluefruit, +//|which allows only one (to allow for an additional I2C object).""" +//|... STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; @@ -198,12 +198,12 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//| def try_lock(self, ) -> Any: -//| """Attempts to grab the SPI lock. Returns True on success. +//|def try_lock(self, ) -> Any: +//|"""Attempts to grab the SPI lock. Returns True on success. //| -//| :return: True when lock has been grabbed -//| :rtype: bool""" -//| ... +//|:return: True when lock has been grabbed +//|:rtype: bool""" +//|... STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -211,9 +211,9 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//| def unlock(self, ) -> Any: -//| """Releases the SPI lock.""" -//| ... +//|unlock(self, ) -> Any: +//|"""Releases the SPI lock.""" +//|... STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -223,14 +223,14 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... -//| """Write the data contained in ``buffer``. The SPI object must be locked. -//| If the buffer is empty, nothing happens. +//|def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... +//|"""Write the data contained in ``buffer``. The SPI object must be locked. +//|If the buffer is empty, nothing happens. //| -//| :param bytearray buffer: Write out the data in this buffer -//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" -//| ... +//|:param bytearray buffer: Write out the data in this buffer +//|:param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` +//|:param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//|... STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; @@ -264,16 +264,16 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: -//| """Read into ``buffer`` while writing ``write_value`` for each byte read. -//| The SPI object must be locked. -//| If the number of bytes to read is 0, nothing happens. +//|def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: +//|"""Read into ``buffer`` while writing ``write_value`` for each byte read. +//|The SPI object must be locked. +//|If the number of bytes to read is 0, nothing happens. //| -//| :param bytearray buffer: Read data into this buffer -//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -//| :param int write_value: Value to write while reading. (Usually ignored.)""" -//| ... +//|:param bytearray buffer: Read data into this buffer +//|:param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` +//|:param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//|:param int write_value: Value to write while reading. (Usually ignored.)""" +//|... STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; @@ -307,20 +307,20 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: -//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -//| The SPI object must be locked. -//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -//| must be equal. -//| If buffer slice lengths are both 0, nothing happens. +//|def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//|"""Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//|The SPI object must be locked. +//|The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//|must be equal. +//|If buffer slice lengths are both 0, nothing happens. //| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer -//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -//| ... +//|:param bytearray buffer_out: Write out the data in this buffer +//|:param bytearray buffer_in: Read data into this buffer +//|:param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//|:param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//|:param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//|:param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//|... STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; @@ -369,10 +369,10 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//| frequency: Any = -//| """The actual SPI bus frequency. This may not match the frequency requested -//| due to internal limitations.""" -//| ... +//|frequency: Any = +//|"""The actual SPI bus frequency. This may not match the frequency requested +//|due to internal limitations.""" +//|... STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 954cbdd20b..b89b331af4 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -40,30 +40,30 @@ #include "supervisor/shared/translate.h" //|class UART: -//| """.. currentmodule:: busio +//|""".. currentmodule:: busio //| -//| :class:`UART` -- a bidirectional serial protocol -//| =================================================""" -//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): -//| """A common bidirectional serial protocol that uses an an agreed upon speed -//| rather than a shared clock line. +//|:class:`UART` -- a bidirectional serial protocol +//|=================================================""" +//|def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): +//|"""A common bidirectional serial protocol that uses an an agreed upon speed +//|rather than a shared clock line. //| -//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. -//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. -//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. -//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. -//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. -//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. -//| :param int baudrate: the transmit and receive speed. -//| :param int bits: the number of bits per byte, 7, 8 or 9. -//| :param Parity parity: the parity used for error checking. -//| :param int stop: the number of stop bits, 1 or 2. -//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. -//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) +//|:param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. +//|:param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. +//|:param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. +//|:param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. +//|:param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. +//|:param bool rs485_invert: set to invert the sense of the rs485_dir pin. +//|:param int baudrate: the transmit and receive speed. +//|:param int bits: the number of bits per byte, 7, 8 or 9. +//|:param Parity parity: the parity used for error checking. +//|:param int stop: the number of stop bits, 1 or 2. +//|:param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. +//|:param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) //| -//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. -//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" -//| ... +//|*New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. +//|The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" +//|... typedef struct { mp_obj_base_t base; } busio_uart_parity_obj_t; @@ -141,9 +141,9 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: -//| """Deinitialises the UART and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the UART and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t busio_uart_obj_deinit(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_uart_deinit(self); @@ -157,15 +157,15 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t busio_uart_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_uart_deinit(args[0]); @@ -175,46 +175,46 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: -//| """Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//|def read(self, nbytes: Any = None) -> Any: +//|"""Read characters. If ``nbytes`` is specified then read at most that many +//|bytes. Otherwise, read everything that arrives until the connection +//|times out. Providing the number of bytes expected is highly recommended +//|because it will be faster. //| -//| :return: Data read -//| :rtype: bytes or None""" -//| ... +//|:return: Data read +//|:rtype: bytes or None""" +//|... -//| def readinto(self, buf: Any) -> Any: -//| """.. method:: readinto(buf) +//|def readinto(self, buf: Any) -> Any: +//|""".. method:: readinto(buf) //| -//| Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. +//|Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: int or None (on a non-blocking error) +//|:return: number of bytes read and stored into ``buf`` +//|:rtype: int or None (on a non-blocking error) //| -//| *New in CircuitPython 4.0:* No length parameter is permitted.""" -//| ... +//|*New in CircuitPython 4.0:* No length parameter is permitted.""" +//|... -//| def readline(self, ) -> Any: -//| """.. method:: readline() +//|def readline(self, ) -> Any: +//|""".. method:: readline() //| -//| Read a line, ending in a newline character. +//|Read a line, ending in a newline character. //| -//| :return: the line read -//| :rtype: int or None""" -//| ... +//|:return: the line read +//|:rtype: int or None""" +//|... -//| def write(self, buf: Any) -> Any: -//| """.. method:: write(buf) +//|def write(self, buf: Any) -> Any: +//|""".. method:: write(buf) //| -//| Write the buffer of bytes to the bus. +//|Write the buffer of bytes to the bus. //| -//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. +//|*New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. //| -//| :return: the number of bytes written -//| :rtype: int or None""" -//| ... +//|:return: the number of bytes written +//|:rtype: int or None""" +//|... // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -258,9 +258,9 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//| baudrate: Any = -//| """The current baudrate.""" -//| ... +//|baudrate: Any = +//|"""The current baudrate.""" +//|... STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -284,9 +284,9 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| in_waiting: Any = -//| """The number of bytes in the input buffer, available to be read""" -//| ... +//|in_waiting: Any = +//|"""The number of bytes in the input buffer, available to be read""" +//|... STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -301,9 +301,9 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timeout: Any = -//| """The current timeout, in seconds (float).""" -//| ... +//|timeout: Any = +//|"""The current timeout, in seconds (float).""" +//|... STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -329,9 +329,9 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset_input_buffer(self, ) -> Any: -//| """Discard any unread characters in the input buffer.""" -//| ... +//|def reset_input_buffer(self, ) -> Any: +//|"""Discard any unread characters in the input buffer.""" +//|... STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -341,15 +341,15 @@ STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer); //|class busio: -//| def __init__(self, ): -//| """Enum-like class to define the parity used to verify correct data transfer.""" -//| ODD: Any = -//| """Total number of ones should be odd.""" -//| ... -//| EVEN: Any = -//| """Total number of ones should be even.""" -//| ... -//| ... +//|def __init__(self, ): +//|"""Enum-like class to define the parity used to verify correct data transfer.""" +//|ODD: Any = +//|"""Total number of ones should be odd.""" +//|... +//|EVEN: Any = +//|"""Total number of ones should be even.""" +//|... +//|... const mp_obj_type_t busio_uart_parity_type; const busio_uart_parity_obj_t busio_uart_parity_odd_obj = { From c3897d0add969e0280e445a80eff34c6a2681592 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 28 Apr 2020 18:43:40 -0400 Subject: [PATCH 349/919] Fixed whitespace in analogio --- shared-bindings/analogio/AnalogIn.c | 62 ++++++++++++++-------------- shared-bindings/analogio/AnalogOut.c | 57 +++++++++++++------------ 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index a8afe75bda..9b6ac086be 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -37,24 +37,24 @@ #include "shared-bindings/util.h" //|class AnalogIn: -//| """:class:`AnalogIn` -- read analog voltage -//| ============================================ +//|""":class:`AnalogIn` -- read analog voltage +//|============================================ //| -//| Usage:: +//|Usage:: //| -//| import analogio -//| from board import * +//|import analogio +//|from board import * //| -//| adc = analogio.AnalogIn(A1) -//| val = adc.value""" +//|adc = analogio.AnalogIn(A1) +//|val = adc.value""" //| -//| def __init__(self, pin: microcontroller.Pin): +//|def __init__(self, pin: microcontroller.Pin): //| -//| """Use the AnalogIn on the given pin. The reference voltage varies by -//| platform so use ``reference_voltage`` to read the configured setting. +//|"""Use the AnalogIn on the given pin. The reference voltage varies by +//|platform so use ``reference_voltage`` to read the configured setting. //| -//| :param ~microcontroller.Pin pin: the pin to read from""" -//| ... +//|:param ~microcontroller.Pin pin: the pin to read from""" +//|... STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check number of arguments @@ -70,9 +70,9 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Turn off the AnalogIn and release the pin for other use.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Turn off the AnalogIn and release the pin for other use.""" +//|... STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_analogio_analogin_deinit(self); @@ -85,15 +85,15 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogin_deinit(args[0]); @@ -101,12 +101,12 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//| value: Any = -//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) +//|value: Any = +//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) //| -//| Even if the underlying analog to digital converter (ADC) is lower -//| resolution, the value is 16-bit.""" -//| ... +//|Even if the underlying analog to digital converter (ADC) is lower +//|resolution, the value is 16-bit.""" +//|... STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -121,10 +121,10 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| reference_voltage: Any = -//| """The maximum voltage measurable (also known as the reference voltage) as a -//| `float` in Volts.""" -//| ... +//|reference_voltage: Any = +//|"""The maximum voltage measurable (also known as the reference voltage) as a +//|`float` in Volts.""" +//|... STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 1b5808e6c9..2316682903 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -37,26 +37,25 @@ #include "supervisor/shared/translate.h" //|class AnalogOut: -//| """.. currentmodule:: analogio +//|""".. currentmodule:: analogio //| -//| :class:`AnalogOut` -- output analog voltage -//| ============================================ +//|:class:`AnalogOut` -- output analog voltage +//|============================================ //| -//| The AnalogOut is used to output analog values (a specific voltage). +//|The AnalogOut is used to output analog values (a specific voltage). //| -//| Example usage:: +//|Example usage:: //| -//| import analogio -//| from microcontroller import pin +//|import analogio +//|from microcontroller import pin //| -//| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 -//| dac.value = 32768 # makes PA02 1.65V""" -//| def __init__(self, pin: microcontroller.Pin): +//|dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 +//|dac.value = 32768 # makes PA02 1.65V""" +//|def __init__(self, pin: microcontroller.Pin): +//|"""Use the AnalogOut on the given pin. //| -//| """Use the AnalogOut on the given pin. -//| -//| :param ~microcontroller.Pin pin: the pin to output to""" -//| ... +//|:param ~microcontroller.Pin pin: the pin to output to""" +//|... STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -70,9 +69,9 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Turn off the AnalogOut and release the pin for other use.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Turn off the AnalogOut and release the pin for other use.""" +//|... STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { analogio_analogout_obj_t *self = self_in; @@ -82,15 +81,15 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogout_deinit(args[0]); @@ -98,12 +97,12 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//| value: Any = -//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) +//|value: Any = +//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) //| -//| Even if the underlying digital to analog converter (DAC) is lower -//| resolution, the value is 16-bit.""" -//| ... +//|Even if the underlying digital to analog converter (DAC) is lower +//|resolution, the value is 16-bit.""" +//|... STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t value) { analogio_analogout_obj_t *self = MP_OBJ_TO_PTR(self_in); if (common_hal_analogio_analogout_deinited(self)) { From aacca615988e29dd58b5083a0199f60f2f40a263 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 28 Apr 2020 18:56:19 -0400 Subject: [PATCH 350/919] Fixed whitespace on audiocore --- shared-bindings/audiocore/RawSample.c | 92 ++++++++++++------------- shared-bindings/audiocore/WaveFile.c | 96 +++++++++++++-------------- 2 files changed, 94 insertions(+), 94 deletions(-) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index b879b1b97f..fdedfe9598 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -36,44 +36,44 @@ #include "supervisor/shared/translate.h" //|class RawSample: -//| """.. currentmodule:: audiocore +//|""".. currentmodule:: audiocore //| -//| :class:`RawSample` -- A raw audio sample buffer -//| ======================================================== +//|:class:`RawSample` -- A raw audio sample buffer +//|======================================================== //| -//| An in-memory sound sample""" +//|An in-memory sound sample""" //| -//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): -//| """Create a RawSample based on the given buffer of signed values. If channel_count is more than -//| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the -//| first sample will be for channel 1, the second sample will be for channel two, the third for -//| channel 1 and so on. +//|def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): +//|"""Create a RawSample based on the given buffer of signed values. If channel_count is more than +//|1 then each channel's samples should alternate. In other words, for a two channel buffer, the +//|first sample will be for channel 1, the second sample will be for channel two, the third for +//|channel 1 and so on. //| -//| :param array.array buffer: An `array.array` with samples -//| :param int channel_count: The number of channels in the buffer -//| :param int sample_rate: The desired playback sample rate +//|:param array.array buffer: An `array.array` with samples +//|:param int channel_count: The number of channels in the buffer +//|:param int sample_rate: The desired playback sample rate //| -//| Simple 8ksps 440 Hz sin wave:: +//|Simple 8ksps 440 Hz sin wave:: //| -//| import audiocore -//| import audioio -//| import board -//| import array -//| import time -//| import math +//|import audiocore +//|import audioio +//|import board +//|import array +//|import time +//|import math //| -//| # Generate one period of sine wav. -//| length = 8000 // 440 -//| sine_wave = array.array("h", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) +//|# Generate one period of sine wav. +//|length = 8000 // 440 +//|sine_wave = array.array("h", [0] * length) +//|for i in range(length): +//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) //| -//| dac = audioio.AudioOut(board.SPEAKER) -//| sine_wave = audiocore.RawSample(sine_wave) -//| dac.play(sine_wave, loop=True) -//| time.sleep(1) -//| dac.stop()""" -//| ... +//|dac = audioio.AudioOut(board.SPEAKER) +//|sine_wave = audiocore.RawSample(sine_wave) +//|dac.play(sine_wave, loop=True) +//|time.sleep(1) +//|dac.stop()""" +//|... STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_channel_count, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -105,9 +105,9 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t audioio_rawsample_deinit(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_rawsample_deinit(self); @@ -121,15 +121,15 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_rawsample_deinit(args[0]); @@ -137,12 +137,12 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__); -//| sample_rate: Any = -//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second). -//| When the sample is looped, this can change the pitch output without changing the underlying -//| sample. This will not change the sample rate of any active playback. Call ``play`` again to -//| change it.""" -//| ... +//|sample_rate: Any = +//|"""32 bit value that dictates how quickly samples are played in Hertz (cycles per second). +//|When the sample is looped, this can change the pitch output without changing the underlying +//|sample. This will not change the sample rate of any active playback. Call ``play`` again to +//|change it.""" +//|... STATIC mp_obj_t audioio_rawsample_obj_get_sample_rate(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index f57e1f8779..9116e71f0f 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -34,42 +34,42 @@ #include "supervisor/shared/translate.h" //|class WaveFile: -//| """.. currentmodule:: audiocore +//|""".. currentmodule:: audiocore //| -//| :class:`WaveFile` -- Load a wave file for audio playback -//| ======================================================== +//|:class:`WaveFile` -- Load a wave file for audio playback +//|======================================================== //| -//| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must -//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating -//| an internal buffer.""" -//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): -//| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//|A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must +//|be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating +//|an internal buffer.""" +//|def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//|"""Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| -//| :param typing.BinaryIO file: Already opened wave file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. +//|:param typing.BinaryIO file: Already opened wave file +//|:param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. //| //| -//| Playing a wave file from flash:: +//|Playing a wave file from flash:: //| -//| import board -//| import audiocore -//| import audioio -//| import digitalio +//|import board +//|import audiocore +//|import audioio +//|import digitalio //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//|# Required for CircuitPlayground Express +//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//|speaker_enable.switch_to_output(value=True) //| -//| data = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(data) -//| a = audioio.AudioOut(board.A0) +//|data = open("cplay-5.1-16bit-16khz.wav", "rb") +//|wav = audiocore.WaveFile(data) +//|a = audioio.AudioOut(board.A0) //| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped")""" -//| ... +//|print("playing") +//|a.play(wav) +//|while a.playing: +//|pass +//|print("stopped")""" +//|... STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -92,9 +92,9 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the WaveFile and releases all memory resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the WaveFile and releases all memory resources for reuse.""" +//|... STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_wavefile_deinit(self); @@ -108,15 +108,15 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_wavefile_deinit(args[0]); @@ -124,11 +124,11 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//| sample_rate: Any = -//| """32 bit value that dictates how quickly samples are loaded into the DAC -//| in Hertz (cycles per second). When the sample is looped, this can change -//| the pitch output without changing the underlying sample.""" -//| ... +//|sample_rate: Any = +//|"""32 bit value that dictates how quickly samples are loaded into the DAC +//|in Hertz (cycles per second). When the sample is looped, this can change +//|the pitch output without changing the underlying sample.""" +//|... STATIC mp_obj_t audioio_wavefile_obj_get_sample_rate(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -151,9 +151,9 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: Any = -//| """Bits per sample. (read only)""" -//| ... +//|bits_per_sample: Any = +//|"""Bits per sample. (read only)""" +//|... STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -168,9 +168,9 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: Any = -//| """Number of audio channels. (read only)""" -//| ... +//|channel_count: Any = +//|"""Number of audio channels. (read only)""" +//|... STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From c7b721f4f19b561006d9d2e1c46d79d9f22bf4b0 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 28 Apr 2020 19:22:03 -0400 Subject: [PATCH 351/919] Fixed some more whitespace --- shared-bindings/audiobusio/I2SOut.c | 150 +++++++++++------------ shared-bindings/audiobusio/PDMIn.c | 129 ++++++++++---------- shared-bindings/audioio/AudioOut.c | 154 ++++++++++++------------ shared-bindings/audiomixer/Mixer.c | 132 ++++++++++---------- shared-bindings/audiomixer/MixerVoice.c | 44 +++---- shared-bindings/audiomp3/MP3Decoder.c | 105 ++++++++-------- 6 files changed, 353 insertions(+), 361 deletions(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index cad17ad184..765e0a12dc 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -36,63 +36,63 @@ #include "supervisor/shared/translate.h" //|class I2SOut: -//| """.. currentmodule:: audiobusio +//|""".. currentmodule:: audiobusio //| -//| :class:`I2SOut` -- Output an I2S audio signal -//| ======================================================== +//|:class:`I2SOut` -- Output an I2S audio signal +//|======================================================== //| -//| I2S is used to output an audio signal on an I2S bus.""" -//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): -//| """Create a I2SOut object associated with the given pins. +//|I2S is used to output an audio signal on an I2S bus.""" +//|def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): +//|"""Create a I2SOut object associated with the given pins. //| -//| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin -//| :param ~microcontroller.Pin word_select: The word select (or left/right clock) pin -//| :param ~microcontroller.Pin data: The data pin -//| :param bool left_justified: True when data bits are aligned with the word select clock. False -//| when they are shifted by one to match classic I2S protocol. +//|:param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin +//|:param ~microcontroller.Pin word_select: The word select (or left/right clock) pin +//|:param ~microcontroller.Pin data: The data pin +//|:param bool left_justified: True when data bits are aligned with the word select clock. False +//|when they are shifted by one to match classic I2S protocol. //| -//| Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ -//| using `UDA1334 Breakout `_:: +//|Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ +//|using `UDA1334 Breakout `_:: //| -//| import audiobusio -//| import audiocore -//| import board -//| import array -//| import time -//| import math +//|import audiobusio +//|import audiocore +//|import board +//|import array +//|import time +//|import math //| -//| # Generate one period of sine wave. -//| length = 8000 // 440 -//| sine_wave = array.array("H", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//|# Generate one period of sine wave. +//|length = 8000 // 440 +//|sine_wave = array.array("H", [0] * length) +//|for i in range(length): +//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) -//| i2s.play(sine_wave, loop=True) -//| time.sleep(1) -//| i2s.stop() +//|sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//|i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//|i2s.play(sine_wave, loop=True) +//|time.sleep(1) +//|i2s.stop() //| -//| Playing a wave file from flash:: +//|Playing a wave file from flash:: //| -//| import board -//| import audioio -//| import audiocore -//| import audiobusio -//| import digitalio +//|import board +//|import audioio +//|import audiocore +//|import audiobusio +//|import digitalio //| //| -//| f = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(f) +//|f = open("cplay-5.1-16bit-16khz.wav", "rb") +//|wav = audiocore.WaveFile(f) //| -//| a = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//|a = audiobusio.I2SOut(board.D1, board.D0, board.D9) //| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped")""" -//| ... +//|print("playing") +//|a.play(wav) +//|while a.playing: +//|pass +//|print("stopped")""" +//|... STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_bit_clock, ARG_word_select, ARG_data, ARG_left_justified }; static const mp_arg_t allowed_args[] = { @@ -115,9 +115,9 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the I2SOut and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t audiobusio_i2sout_deinit(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_i2sout_deinit(self); @@ -130,15 +130,15 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_i2sout_deinit(args[0]); @@ -147,14 +147,14 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//| def play(self, sample: Any, *, loop: Any = False) -> Any: -//| """Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. +//|def play(self, sample: Any, *, loop: Any = False) -> Any: +//|"""Plays the sample once when loop=False and continuously when loop=True. +//|Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| -//| The sample itself should consist of 8 bit or 16 bit samples.""" -//| ... +//|The sample itself should consist of 8 bit or 16 bit samples.""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -173,9 +173,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play); -//| def stop(self, ) -> Any: -//| """Stops playback.""" -//| ... +//|def stop(self, ) -> Any: +//|"""Stops playback.""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -184,9 +184,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop); -//| playing: Any = -//| """True when the audio sample is being output. (read-only)""" -//| ... +//|playing: Any = +//|"""True when the audio sample is being output. (read-only)""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -201,9 +201,9 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> Any: -//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" -//| ... +//|def pause(self, ) -> Any: +//|"""Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -216,9 +216,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause); -//| def resume(self, ) -> Any: -//| """Resumes sample playback after :py:func:`pause`.""" -//| ... +//|def resume(self, ) -> Any: +//|"""Resumes sample playback after :py:func:`pause`.""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -231,9 +231,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume); -//| paused: Any = -//| """True when playback is paused. (read-only)""" -//| ... +//|paused: Any = +//|"""True when playback is paused. (read-only)""" +//|... STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index b75545ba7b..28ff9a4818 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -36,63 +36,56 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" - - - - - - - //|class PDMIn: -//| """.. currentmodule:: audiobusio +//|""".. currentmodule:: audiobusio //| -//| :class:`PDMIn` -- Record an input PDM audio stream -//| ======================================================== +//|:class:`PDMIn` -- Record an input PDM audio stream +//|======================================================== //| -//| PDMIn can be used to record an input audio signal on a given set of pins.""" +//|PDMIn can be used to record an input audio signal on a given set of pins.""" //| -//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): -//| """Create a PDMIn object associated with the given pins. This allows you to -//| record audio signals from the given pins. Individual ports may put further -//| restrictions on the recording parameters. The overall sample rate is -//| determined by `sample_rate` x ``oversample``, and the total must be 1MHz or -//| higher, so `sample_rate` must be a minimum of 16000. +//|def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): +//|"""Create a PDMIn object associated with the given pins. This allows you to +//|record audio signals from the given pins. Individual ports may put further +//|restrictions on the recording parameters. The overall sample rate is +//|determined by `sample_rate` x ``oversample``, and the total must be 1MHz or +//|higher, so `sample_rate` must be a minimum of 16000. //| -//| :param ~microcontroller.Pin clock_pin: The pin to output the clock to -//| :param ~microcontroller.Pin data_pin: The pin to read the data from -//| :param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. -//| Minimum sample_rate is about 16000 Hz. -//| :param int bit_depth: Final number of bits per sample. Must be divisible by 8 -//| :param bool mono: True when capturing a single channel of audio, captures two channels otherwise -//| :param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 -//| :param float startup_delay: seconds to wait after starting microphone clock -//| to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. -//| Must be in range 0.0-1.0 seconds.""" -//| ... +//|:param ~microcontroller.Pin clock_pin: The pin to output the clock to +//|:param ~microcontroller.Pin data_pin: The pin to read the data from +//|:param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. +//|Minimum sample_rate is about 16000 Hz. +//|:param int bit_depth: Final number of bits per sample. Must be divisible by 8 +//|:param bool mono: True when capturing a single channel of audio, captures two channels otherwise +//|:param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 +//|:param float startup_delay: seconds to wait after starting microphone clock +//|to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. +//|Must be in range 0.0-1.0 seconds.""" +//|... -//| Record 8-bit unsigned samples to buffer:: +//|Record 8-bit unsigned samples to buffer:: //| -//| import audiobusio -//| import board +//|import audiobusio +//|import board //| -//| # Prep a buffer to record into -//| b = bytearray(200) -//| with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000) as mic: -//| mic.record(b, len(b)) +//|# Prep a buffer to record into +//|b = bytearray(200) +//|with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000) as mic: +//|mic.record(b, len(b)) //| -//| Record 16-bit unsigned samples to buffer:: +//|Record 16-bit unsigned samples to buffer:: //| -//| import audiobusio -//| import board +//|import audiobusio +//|import board //| -//| # Prep a buffer to record into. The array interface doesn't allow for -//| # constructing with a set size so we append to it until we have the size -//| # we want. -//| b = array.array("H") -//| for i in range(200): -//| b.append(0) -//| with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16) as mic: -//| mic.record(b, len(b)) +//|# Prep a buffer to record into. The array interface doesn't allow for +//|# constructing with a set size so we append to it until we have the size +//|# we want. +//|b = array.array("H") +//|for i in range(200): +//|b.append(0) +//|with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16) as mic: +//|mic.record(b, len(b)) //| STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_clock_pin, ARG_data_pin, ARG_sample_rate, ARG_bit_depth, ARG_mono, ARG_oversample, ARG_startup_delay }; @@ -145,9 +138,9 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the PDMIn and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the PDMIn and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t audiobusio_pdmin_deinit(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_pdmin_deinit(self); @@ -160,14 +153,14 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context.""" +//|... STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_pdmin_deinit(args[0]); @@ -176,17 +169,17 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//| def record(self, destination: Any, destination_length: Any) -> Any: -//| """Records destination_length bytes of samples to destination. This is -//| blocking. +//|def record(self, destination: Any, destination_length: Any) -> Any: +//|"""Records destination_length bytes of samples to destination. This is +//|blocking. //| -//| An IOError may be raised when the destination is too slow to record the -//| audio at the given rate. For internal flash, writing all 1s to the file -//| before recording is recommended to speed up writes. +//|An IOError may be raised when the destination is too slow to record the +//|audio at the given rate. For internal flash, writing all 1s to the file +//|before recording is recommended to speed up writes. //| -//| :return: The number of samples recorded. If this is less than ``destination_length``, -//| some samples were missed due to processing time.""" -//| ... +//|:return: The number of samples recorded. If this is less than ``destination_length``, +//|some samples were missed due to processing time.""" +//|... STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destination, mp_obj_t destination_length) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_obj); check_for_deinit(self); @@ -217,10 +210,10 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat } MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record); -//| sample_rate: Any = -//| """The actual sample_rate of the recording. This may not match the constructed -//| sample rate due to internal clock limitations.""" -//| ... +//|sample_rate: Any = +//|"""The actual sample_rate of the recording. This may not match the constructed +//|sample rate due to internal clock limitations.""" +//|... STATIC mp_obj_t audiobusio_pdmin_obj_get_sample_rate(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 8df923e6f1..28c345d168 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -37,63 +37,63 @@ #include "supervisor/shared/translate.h" //|class AudioOut: -//| """.. currentmodule:: audioio +//|""".. currentmodule:: audioio //| -//| :class:`AudioOut` -- Output an analog audio signal -//| ======================================================== +//|:class:`AudioOut` -- Output an analog audio signal +//|======================================================== //| -//| AudioOut can be used to output an analog audio signal on a given pin.""" +//|AudioOut can be used to output an analog audio signal on a given pin.""" //| -//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): -//| """Create a AudioOut object associated with the given pin(s). This allows you to -//| play audio signals out on the given pin(s). +//|def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//|"""Create a AudioOut object associated with the given pin(s). This allows you to +//|play audio signals out on the given pin(s). //| -//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to -//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to -//| :param int quiescent_value: The output value when no signal is present. Samples should start -//| and end with this value to prevent audible popping. +//|:param ~microcontroller.Pin left_channel: The pin to output the left channel to +//|:param ~microcontroller.Pin right_channel: The pin to output the right channel to +//|:param int quiescent_value: The output value when no signal is present. Samples should start +//|and end with this value to prevent audible popping. //| -//| Simple 8ksps 440 Hz sin wave:: +//|Simple 8ksps 440 Hz sin wave:: //| -//| import audiocore -//| import audioio -//| import board -//| import array -//| import time -//| import math +//|import audiocore +//|import audioio +//|import board +//|import array +//|import time +//|import math //| -//| # Generate one period of sine wav. -//| length = 8000 // 440 -//| sine_wave = array.array("H", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//|# Generate one period of sine wav. +//|length = 8000 // 440 +//|sine_wave = array.array("H", [0] * length) +//|for i in range(length): +//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| dac = audioio.AudioOut(board.SPEAKER) -//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//| dac.play(sine_wave, loop=True) -//| time.sleep(1) -//| dac.stop() +//|dac = audioio.AudioOut(board.SPEAKER) +//|sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//|dac.play(sine_wave, loop=True) +//|time.sleep(1) +//|dac.stop() //| -//| Playing a wave file from flash:: +//|Playing a wave file from flash:: //| -//| import board -//| import audioio -//| import digitalio +//|import board +//|import audioio +//|import digitalio //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//|# Required for CircuitPlayground Express +//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//|speaker_enable.switch_to_output(value=True) //| -//| data = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(data) -//| a = audioio.AudioOut(board.A0) +//|data = open("cplay-5.1-16bit-16khz.wav", "rb") +//|wav = audiocore.WaveFile(data) +//|a = audioio.AudioOut(board.A0) //| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped")""" -//| ... +//|print("playing") +//|a.play(wav) +//|while a.playing: +//|pass +//|print("stopped")""" +//|... STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_left_channel, ARG_right_channel, ARG_quiescent_value }; static const mp_arg_t allowed_args[] = { @@ -115,9 +115,9 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t audioio_audioout_deinit(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_audioout_deinit(self); @@ -130,15 +130,15 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) { raise_deinited_error(); } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_audioout_deinit(args[0]); @@ -147,16 +147,16 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//| def play(self, sample: Any, *, loop: Any = False) -> Any: -//| """Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. +//|def play(self, sample: Any, *, loop: Any = False) -> Any: +//|"""Plays the sample once when loop=False and continuously when loop=True. +//|Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| -//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output -//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit -//| DAC that ignores the lowest 6 bits when playing 16 bit samples.""" -//| ... +//|The sample itself should consist of 16 bit samples. Microcontrollers with a lower output +//|resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit +//|DAC that ignores the lowest 6 bits when playing 16 bit samples.""" +//|... STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -175,9 +175,9 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play); -//| def stop(self, ) -> Any: -//| """Stops playback and resets to the start of the sample.""" -//| ... +//|def stop(self, ) -> Any: +//|"""Stops playback and resets to the start of the sample.""" +//|... STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -186,9 +186,9 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop); -//| playing: Any = -//| """True when an audio sample is being output even if `paused`. (read-only)""" -//| ... +//|playing: Any = +//|"""True when an audio sample is being output even if `paused`. (read-only)""" +//|... STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -203,9 +203,9 @@ const mp_obj_property_t audioio_audioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def pause(self, ) -> Any: -//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" -//| ... +//|def pause(self, ) -> Any: +//|"""Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//|... STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -218,9 +218,9 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause); -//| def resume(self, ) -> Any: -//| """Resumes sample playback after :py:func:`pause`.""" -//| ... +//|def resume(self, ) -> Any: +//|"""Resumes sample playback after :py:func:`pause`.""" +//|... STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -233,9 +233,9 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume); -//| paused: Any = -//| """True when playback is paused. (read-only)""" -//| ... +//|paused: Any = +//|"""True when playback is paused. (read-only)""" +//|... STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 1949f2addd..93b1d3635f 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -39,49 +39,49 @@ #include "supervisor/shared/translate.h" //|class Mixer: -//| """.. currentmodule:: audiomixer +//|""".. currentmodule:: audiomixer //| -//| :class:`Mixer` -- Mixes one or more audio samples together -//| =========================================================== +//|:class:`Mixer` -- Mixes one or more audio samples together +//|=========================================================== //| -//| Mixer mixes multiple samples into one sample.""" +//|Mixer mixes multiple samples into one sample.""" //| -//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): -//| """Create a Mixer object that can mix multiple channels with the same sample rate. -//| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. +//|def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): +//|"""Create a Mixer object that can mix multiple channels with the same sample rate. +//|Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. //| -//| :param int voice_count: The maximum number of voices to mix -//| :param int buffer_size: The total size in bytes of the buffers to mix into -//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. -//| :param int bits_per_sample: The bits per sample of the samples being played -//| :param bool samples_signed: Samples are signed (True) or unsigned (False) -//| :param int sample_rate: The sample rate to be used for all samples +//|:param int voice_count: The maximum number of voices to mix +//|:param int buffer_size: The total size in bytes of the buffers to mix into +//|:param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. +//|:param int bits_per_sample: The bits per sample of the samples being played +//|:param bool samples_signed: Samples are signed (True) or unsigned (False) +//|:param int sample_rate: The sample rate to be used for all samples //| -//| Playing a wave file from flash:: +//|Playing a wave file from flash:: //| -//| import board -//| import audioio -//| import audiocore -//| import audiomixer -//| import digitalio +//|import board +//|import audioio +//|import audiocore +//|import audiomixer +//|import digitalio //| -//| a = audioio.AudioOut(board.A0) -//| music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) -//| drum = audiocore.WaveFile(open("drum.wav", "rb")) -//| mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, -//| bits_per_sample=16, samples_signed=True) +//|a = audioio.AudioOut(board.A0) +//|music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) +//|drum = audiocore.WaveFile(open("drum.wav", "rb")) +//|mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, +//|bits_per_sample=16, samples_signed=True) //| -//| print("playing") -//| # Have AudioOut play our Mixer source -//| a.play(mixer) -//| # Play the first sample voice -//| mixer.voice[0].play(music) -//| while mixer.playing: -//| # Play the second sample voice -//| mixer.voice[1].play(drum) -//| time.sleep(1) -//| print("stopped")""" -//| ... +//|print("playing") +//|# Have AudioOut play our Mixer source +//|a.play(mixer) +//|# Play the first sample voice +//|mixer.voice[0].play(music) +//|while mixer.playing: +//|# Play the second sample voice +//|mixer.voice[1].play(drum) +//|time.sleep(1) +//|print("stopped")""" +//|... STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice_count, ARG_buffer_size, ARG_channel_count, ARG_bits_per_sample, ARG_samples_signed, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -125,9 +125,9 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the Mixer and releases any hardware resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the Mixer and releases any hardware resources for reuse.""" +//|... STATIC mp_obj_t audiomixer_mixer_deinit(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomixer_mixer_deinit(self); @@ -141,15 +141,15 @@ STATIC void check_for_deinit(audiomixer_mixer_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomixer_mixer_deinit(args[0]); @@ -157,9 +157,9 @@ STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomixer_mixer___exit___obj, 4, 4, audiomixer_mixer_obj___exit__); -//| playing: Any = -//| """True when any voice is being output. (read-only)""" -//| ... +//|playing: Any = +//|"""True when any voice is being output. (read-only)""" +//|... STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -174,9 +174,9 @@ const mp_obj_property_t audiomixer_mixer_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| sample_rate: Any = -//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" -//| ... +//|sample_rate: Any = +//|"""32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" +//|... STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -191,14 +191,14 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| voice: Any = -//| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). +//|voice: Any = +//|"""A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| -//| .. code-block:: python +//|.. code-block:: python //| -//| >>> mixer.voice -//| (,)""" -//| ... +//|>>> mixer.voice +//|(,)""" +//|... STATIC mp_obj_t audiomixer_mixer_obj_get_voice(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -213,14 +213,14 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: -//| """Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. +//|def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: +//|"""Plays the sample once when loop=False and continuously when loop=True. +//|Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| -//| The sample must match the Mixer's encoding settings given in the constructor.""" -//| ... +//|The sample must match the Mixer's encoding settings given in the constructor.""" +//|... STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_voice, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -245,9 +245,9 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixer_play_obj, 1, audiomixer_mixer_obj_play); -//| def stop_voice(self, voice: Any = 0) -> Any: -//| """Stops playback of the sample on the given voice.""" -//| ... +//|def stop_voice(self, voice: Any = 0) -> Any: +//|"""Stops playback of the sample on the given voice.""" +//|... STATIC mp_obj_t audiomixer_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index e6c750bafa..299600dd14 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -38,17 +38,17 @@ #include "supervisor/shared/translate.h" //|class MixerVoice: -//| """.. currentmodule:: audiomixer +//|""".. currentmodule:: audiomixer //| -//| :class:`MixerVoice` -- Voice objects used with Mixer -//| ===================================================== +//|:class:`MixerVoice` -- Voice objects used with Mixer +//|===================================================== //| -//| Used to access and control samples with `audiomixer.Mixer`.""" +//|Used to access and control samples with `audiomixer.Mixer`.""" //| -//| def __init__(self, ): +//|def __init__(self, ): //| -//| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" -//| ... +//|"""MixerVoice instance object(s) created by `audiomixer.Mixer`.""" +//|... // TODO: support mono or stereo voices STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { audiomixer_mixervoice_obj_t *self = m_new_obj(audiomixer_mixervoice_obj_t); @@ -59,14 +59,14 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//| def play(self, sample: Any, *, loop: Any = False) -> Any: -//| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. -//| Does not block. Use `playing` to block. +//|def play(self, sample: Any, *, loop: Any = False) -> Any: +//|"""Plays the sample once when ``loop=False``, and continuously when ``loop=True``. +//|Does not block. Use `playing` to block. //| -//| Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. +//|Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. //| -//| The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" -//| ... +//|The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" +//|... STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -83,9 +83,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_play_obj, 1, audiomixer_mixervoice_obj_play); -//| def stop(self, ) -> Any: -//| """Stops playback of the sample on this voice.""" -//| ... +//|def stop(self, ) -> Any: +//|"""Stops playback of the sample on this voice.""" +//|... STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { @@ -101,9 +101,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//| level(): Any = -//| """The volume level of a voice, as a floating point number between 0 and 1.""" -//| ... +//|level(): Any = +//|"""The volume level of a voice, as a floating point number between 0 and 1.""" +//|... STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { return mp_obj_new_float(common_hal_audiomixer_mixervoice_get_level(self_in)); } @@ -137,9 +137,9 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| playing: Any = -//| """True when this voice is being output. (read-only)""" -//| ... +//|playing: Any = +//|"""True when this voice is being output. (read-only)""" +//|... STATIC mp_obj_t audiomixer_mixervoice_obj_get_playing(mp_obj_t self_in) { audiomixer_mixervoice_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 0bb2c88292..7c011b65f3 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -35,41 +35,41 @@ #include "supervisor/shared/translate.h" //|class MP3: -//| """.. currentmodule:: audiomp3 +//|""".. currentmodule:: audiomp3 //| -//| :class:`MP3Decoder` -- Load a mp3 file for audio playback -//| ========================================================= +//|:class:`MP3Decoder` -- Load a mp3 file for audio playback +//|========================================================= //| -//| An object that decodes MP3 files for playback on an audio device.""" +//|An object that decodes MP3 files for playback on an audio device.""" //| -//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): -//| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//|def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//|"""Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| -//| :param typing.BinaryIO file: Already opened mp3 file -//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//|:param typing.BinaryIO file: Already opened mp3 file +//|:param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| //| -//| Playing a mp3 file from flash:: +//|Playing a mp3 file from flash:: //| -//| import board -//| import audiomp3 -//| import audioio -//| import digitalio +//|import board +//|import audiomp3 +//|import audioio +//|import digitalio //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//|# Required for CircuitPlayground Express +//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//|speaker_enable.switch_to_output(value=True) //| -//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb") -//| mp3 = audiomp3.MP3Decoder(data) -//| a = audioio.AudioOut(board.A0) +//|data = open("cplay-16bit-16khz-64kbps.mp3", "rb") +//|mp3 = audiomp3.MP3Decoder(data) +//|a = audioio.AudioOut(board.A0) //| -//| print("playing") -//| a.play(mp3) -//| while a.playing: -//| pass -//| print("stopped")""" -//| ... +//|print("playing") +//|a.play(mp3) +//|while a.playing: +//|pass +//|print("stopped")""" +//|... STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -92,9 +92,9 @@ STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialises the MP3 and releases all memory resources for reuse.""" -//| ... +//|def deinit(self, ) -> Any: +//|"""Deinitialises the MP3 and releases all memory resources for reuse.""" +//|... STATIC mp_obj_t audiomp3_mp3file_deinit(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomp3_mp3file_deinit(self); @@ -108,16 +108,15 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//|def __enter__(self, ) -> Any: +//|"""No-op used by Context Managers.""" +//|... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//|def __exit__(self, ) -> Any: +//|"""Automatically deinitializes the hardware when exiting a context. See +//|:ref:`lifetime-and-contextmanagers` for more info.""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomp3_mp3file_deinit(args[0]); @@ -125,9 +124,9 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//| file: Any = -//| """File to play back.""" -//| ... +//|file: Any = +//|"""File to play back.""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -155,11 +154,11 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//| sample_rate: Any = -//| """32 bit value that dictates how quickly samples are loaded into the DAC -//| in Hertz (cycles per second). When the sample is looped, this can change -//| the pitch output without changing the underlying sample.""" -//| ... +//|sample_rate: Any = +//|"""32 bit value that dictates how quickly samples are loaded into the DAC +//|in Hertz (cycles per second). When the sample is looped, this can change +//|the pitch output without changing the underlying sample.""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj_get_sample_rate(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -182,9 +181,9 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| bits_per_sample: Any = -//| """Bits per sample. (read only)""" -//| ... +//|bits_per_sample: Any = +//|"""Bits per sample. (read only)""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -199,9 +198,9 @@ const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| channel_count: Any = -//| """Number of audio channels. (read only)""" -//| ... +//|channel_count: Any = +//|"""Number of audio channels. (read only)""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -216,9 +215,9 @@ const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| rms_level: Any = -//| """The RMS audio level of a recently played moment of audio. (read only)""" -//| ... +//|rms_level: Any = +//|"""The RMS audio level of a recently played moment of audio. (read only)""" +//|... STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); From cc290c50c677e16ccdddae74ab0861c9101727fc Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Tue, 28 Apr 2020 18:15:38 -0700 Subject: [PATCH 352/919] fixing diff error --- supervisor/shared/external_flash/external_flash.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 6c14da4107..ce47929757 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -226,18 +226,6 @@ void supervisor_flash_init(void) { while (jedec_id_response[0] == 0xff) { spi_flash_read_command(CMD_READ_JEDEC_ID, jedec_id_response, 3); } - - for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { - const external_flash_device* possible_device = &possible_devices[i]; - if (jedec_id_response[0] == possible_device->manufacturer_id && - jedec_id_response[1] == possible_device->memory_type && - jedec_id_response[2] == possible_device->capacity) { - flash_device = possible_device; - break; - } - } -#endif - for (uint8_t i = 0; i < EXTERNAL_FLASH_DEVICE_COUNT; i++) { const external_flash_device* possible_device = &possible_devices[i]; if (jedec_id_response[0] == possible_device->manufacturer_id && From 1d0781bf12e7b792842ea63cb986872ce61160f1 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 19 Apr 2020 15:08:42 +0800 Subject: [PATCH 353/919] nrf: add simmel board This adds support for Simmel, an nRF52833-based bluetooth tracking board designed to aid in pandemic tracing. Signed-off-by: Sean Cross --- ports/nrf/Makefile | 2 +- ports/nrf/boards/simmel/board.c | 38 +++++++++++++++++ ports/nrf/boards/simmel/mpconfigboard.h | 54 ++++++++++++++++++++++++ ports/nrf/boards/simmel/mpconfigboard.mk | 33 +++++++++++++++ ports/nrf/boards/simmel/pins.c | 27 ++++++++++++ 5 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 ports/nrf/boards/simmel/board.c create mode 100644 ports/nrf/boards/simmel/mpconfigboard.h create mode 100644 ports/nrf/boards/simmel/mpconfigboard.mk create mode 100644 ports/nrf/boards/simmel/pins.c diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 876628342d..d6aab39fce 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -88,7 +88,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG + CFLAGS += -Os -DNDEBUG -ggdb3 CFLAGS += -flto -flto-partition=none endif diff --git a/ports/nrf/boards/simmel/board.c b/ports/nrf/boards/simmel/board.c new file mode 100644 index 0000000000..f891f54a13 --- /dev/null +++ b/ports/nrf/boards/simmel/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h new file mode 100644 index 0000000000..4c73e86eb2 --- /dev/null +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -0,0 +1,54 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "Simmel" +#define MICROPY_HW_MCU_NAME "nRF52833" + +#define MICROPY_HW_LED_STATUS (&pin_P0_06) + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_09 +#define SPI_FLASH_MISO_PIN &pin_P1_04 +#define SPI_FLASH_SCK_PIN &pin_P0_10 +#define SPI_FLASH_CS_PIN &pin_P1_06 +#endif + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (84*1024) + +#define BOOTLOADER_SIZE (0x4000) // 12 kiB +#define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) + +// Reduce nRF SoftRadio memory usage +#define BLEIO_VS_UUID_COUNT 10 +#define BLEIO_HVN_TX_QUEUE_SIZE 2 +#define BLEIO_CENTRAL_ROLE_COUNT 2 +#define BLEIO_PERIPH_ROLE_COUNT 2 +#define BLEIO_TOTAL_CONNECTION_COUNT 2 +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk new file mode 100644 index 0000000000..342d1ca39d --- /dev/null +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -0,0 +1,33 @@ +USB_VID = 0x1209 +USB_PID = 0xc051 +USB_PRODUCT = "Simmel" +USB_MANUFACTURER = "Betrusted" + +MCU_CHIP = nrf52833 + +# SPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = "MX25R1635F" + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BUSIO = 1 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 1 +CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_ULAB = 0 +CIRCUITPY_USB_HID = 0 + +# Enable micropython.native +#CIRCUITPY_ENABLE_MPY_NATIVE = 1 + +# These defines must be overridden before mpconfigboard.h is included, which is +# why they are passed on the command line. +CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c new file mode 100644 index 0000000000..c946493d47 --- /dev/null +++ b/ports/nrf/boards/simmel/pins.c @@ -0,0 +1,27 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_SPI_CSN), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_I2S_LRCK), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDIN), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_CHG), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_PWM_N), MP_ROM_PTR(&pin_P0_19) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 1327b62c8d3fa81fb0d5e8e0694bb07aff58ef86 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 29 Apr 2020 22:33:34 +0800 Subject: [PATCH 354/919] github: add simmel to build.yml Signed-off-by: Sean Cross --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b1211cda1..6cccc15fc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -229,6 +229,7 @@ jobs: - "seeeduino_xiao" - "serpente" - "shirtty" + - "simmel" - "snekboard" - "sparkfun_lumidrive" - "sparkfun_nrf52840_mini" From 8c77252adf4b78a2a4fe5d138e470fb70ae7233b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 29 Apr 2020 10:29:12 -0700 Subject: [PATCH 355/919] Better handle //| and do __init__.c first. --- tools/extract_pyi.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index c7f3e4604e..de783eb270 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -20,12 +20,22 @@ for module in modules: if not os.path.isdir(module_path): continue pyi_lines = [] - for class_file in os.listdir(module_path): + classes = os.listdir(module_path) + classes = [x for x in sorted(classes) if x.endswith(".c")] + if classes[-1] == "__init__.c": + classes.insert(0, classes.pop()) + for class_file in classes: class_path = os.path.join(module_path, class_file) with open(class_path, "r") as f: for line in f: - if line.startswith("//| "): - pyi_lines.append(line[4:]) + if line.startswith("//|"): + if line[3] == " ": + line = line[4:] + elif line[3] == "\n": + line = line[3:] + else: + continue + pyi_lines.append(line) stub_filename = os.path.join(stub_directory, module + ".pyi") print(stub_filename) From 18657b6539fec6068dacb9f6f107056511f9b123 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 29 Apr 2020 10:52:26 -0700 Subject: [PATCH 356/919] Update TinyUSB to include SAMD race fix --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index d54343e4a6..a74a823b0a 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit d54343e4a6bc84549caf69ecd26a98852127ef3f +Subproject commit a74a823b0a140667a4e4e80fa2678870faba2bd0 From 93d1e53c66f73b6a2d85398dba7924472f1f053d Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 29 Apr 2020 14:19:04 -0400 Subject: [PATCH 357/919] Hopefully fixed whitespace issues --- shared-bindings/busio/SPI.c | 200 +++++++++++++++---------------- shared-bindings/busio/__init__.c | 4 +- 2 files changed, 102 insertions(+), 102 deletions(-) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 5643b0d04e..9644f4eb5d 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -41,43 +41,43 @@ #include "supervisor/shared/translate.h" -//|class SPI: -//|""".. currentmodule:: busio +//| class SPI: +//| """.. currentmodule:: busio //| -//|`SPI` -- a 3-4 wire serial protocol -//|----------------------------------------------- +//| `SPI` -- a 3-4 wire serial protocol +//| ----------------------------------------------- //| -//|SPI is a serial protocol that has exclusive pins for data in and out of the -//|master. It is typically faster than :py:class:`~busio.I2C` because a -//|separate pin is used to control the active slave rather than a transitted -//|address. This class only manages three of the four SPI lines: `!clock`, -//|`!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//|select line. (This is common because multiple slaves can share the `!clock`, -//|`!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| SPI is a serial protocol that has exclusive pins for data in and out of the +//| master. It is typically faster than :py:class:`~busio.I2C` because a +//| separate pin is used to control the active slave rather than a transitted +//| address. This class only manages three of the four SPI lines: `!clock`, +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave +//| select line. (This is common because multiple slaves can share the `!clock`, +//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" //| -//|def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| -//|"""Construct an SPI object on the given pins. +//| """Construct an SPI object on the given pins. //| -//|..note:: The SPI peripherals allocated in order of desirability, if possible, -//|such as highest speed and not shared use first. For instance, on the nRF52840, -//|there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, -//|some of which may also be used for I2C. The 32MHz SPI peripheral is returned -//|first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz -//|peripherals. +//| ..note:: The SPI peripherals allocated in order of desirability, if possible, +//| such as highest speed and not shared use first. For instance, on the nRF52840, +//| there is a single 32MHz SPI peripheral, and multiple 8MHz peripherals, +//| some of which may also be used for I2C. The 32MHz SPI peripheral is returned +//| first, then the exclusive 8MHz SPI peripheral, and finally the shared 8MHz +//| peripherals. //| -//|.. seealso:: Using this class directly requires careful lock management. -//|Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to -//|manage locks. +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| manage locks. //| -//|.. seealso:: Using this class to directly read registers requires manual -//|bit unpacking. Instead, use an existing driver or make one with -//|:ref:`Register ` data descriptors. +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. //| -//|:param ~microcontroller.Pin clock: the pin to use for the clock. -//|:param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//|:param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" -//|... +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. +//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| ... // TODO(tannewt): Support LSB SPI. @@ -101,9 +101,9 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Turn off the SPI bus.""" -//|... +//| def deinit(self, ) -> Any: +//| """Turn off the SPI bus.""" +//| ... STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -111,15 +111,15 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers. -//|Provided by context manager helper.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers. +//| Provided by context manager helper.""" +//| ... -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -140,28 +140,28 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { } } -//|def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: -//|"""Configures the SPI bus. The SPI object must be locked. +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| """Configures the SPI bus. The SPI object must be locked. //| -//|:param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower -//|due to the granularity of available clock settings. -//|Check the `frequency` attribute for the actual clock rate. -//|:param int polarity: the base state of the clock line (0 or 1) -//|:param int phase: the edge of the clock that data is captured. First (0) -//|or second (1). Rising or falling depends on clock polarity. -//|:param int bits: the number of bits per word +//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower +//| due to the granularity of available clock settings. +//| Check the `frequency` attribute for the actual clock rate. +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. +//| :param int bits: the number of bits per word //| -//|.. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that -//|speed is not guaranteed to work. 12 MHz is the next available lower speed, and is -//|within spec for the SAMD21. +//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that +//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is +//| within spec for the SAMD21. //| -//|.. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, -//|and 8MHz. -//|If you pick a a baudrate other than one of these, the nearest lower -//|baudrate will be chosen, with a minimum of 125kHz. -//|Two SPI objects may be created, except on the Circuit Playground Bluefruit, -//|which allows only one (to allow for an additional I2C object).""" -//|... +//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, +//| and 8MHz. +//| If you pick a a baudrate other than one of these, the nearest lower +//| baudrate will be chosen, with a minimum of 125kHz. +//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, +//| which allows only one (to allow for an additional I2C object).""" +//| ... STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; @@ -198,12 +198,12 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//|def try_lock(self, ) -> Any: -//|"""Attempts to grab the SPI lock. Returns True on success. +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the SPI lock. Returns True on success. //| -//|:return: True when lock has been grabbed -//|:rtype: bool""" -//|... +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -211,9 +211,9 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//|unlock(self, ) -> Any: -//|"""Releases the SPI lock.""" -//|... +//| def unlock(self, ) -> Any: +//| """Releases the SPI lock.""" +//| ... STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -223,14 +223,14 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//|def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: ... -//|"""Write the data contained in ``buffer``. The SPI object must be locked. -//|If the buffer is empty, nothing happens. +//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: +//| """Write the data contained in ``buffer``. The SPI object must be locked. +//| If the buffer is empty, nothing happens. //| -//|:param bytearray buffer: Write out the data in this buffer -//|:param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` -//|:param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" -//|... +//| :param bytearray buffer: Write out the data in this buffer +//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| ... STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; @@ -264,16 +264,16 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//|def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: -//|"""Read into ``buffer`` while writing ``write_value`` for each byte read. -//|The SPI object must be locked. -//|If the number of bytes to read is 0, nothing happens. +//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: +//| """Read into ``buffer`` while writing ``write_value`` for each byte read. +//| The SPI object must be locked. +//| If the number of bytes to read is 0, nothing happens. //| -//|:param bytearray buffer: Read data into this buffer -//|:param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -//|:param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -//|:param int write_value: Value to write while reading. (Usually ignored.)""" -//|... +//| :param bytearray buffer: Read data into this buffer +//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param int write_value: Value to write while reading. (Usually ignored.)""" +//| ... STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; @@ -307,20 +307,20 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//|def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: -//|"""Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -//|The SPI object must be locked. -//|The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -//|must be equal. -//|If buffer slice lengths are both 0, nothing happens. +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//| The SPI object must be locked. +//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//| must be equal. +//| If buffer slice lengths are both 0, nothing happens. //| -//|:param bytearray buffer_out: Write out the data in this buffer -//|:param bytearray buffer_in: Read data into this buffer -//|:param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -//|:param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -//|:param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//|:param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -//|... +//| :param bytearray buffer_out: Write out the data in this buffer +//| :param bytearray buffer_in: Read data into this buffer +//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| ... STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; @@ -369,10 +369,10 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//|frequency: Any = -//|"""The actual SPI bus frequency. This may not match the frequency requested -//|due to internal limitations.""" -//|... +//| frequency: Any = ... +//| """The actual SPI bus frequency. This may not match the frequency requested +//| due to internal limitations.""" +//| STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index ff2933dc6d..212b3218c1 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -38,7 +38,7 @@ #include "py/runtime.h" -//| :mod:`busio` --- Hardware accelerated behavior +//| """:mod:`busio` --- Hardware accelerated behavior //| ================================================= //| //| .. module:: busio @@ -81,7 +81,7 @@ //| This example will initialize the the device, run //| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the //| hardware. The last step is optional because CircuitPython automatically -//| resets hardware after a program finishes. +//| resets hardware after a program finishes.""" //| STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { From deccdcc1d668a9e65036872aa0a3064ae9ec959c Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 29 Apr 2020 15:20:05 -0400 Subject: [PATCH 358/919] Did the same for the rest of busio --- shared-bindings/busio/I2C.c | 184 ++++++++++++++++---------------- shared-bindings/busio/OneWire.c | 87 ++++++++------- shared-bindings/busio/UART.c | 164 ++++++++++++++-------------- 3 files changed, 216 insertions(+), 219 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 8b71be085d..31dd9a7bf6 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -36,33 +36,35 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//|class I2C: -//|""".. currentmodule:: busio +//| class I2C: +//| """.. currentmodule:: busio //| -//|:class:`I2C` --- Two wire serial protocol -//|------------------------------------------""" -//|def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): -//|"""I2C is a two-wire protocol for communicating between devices. At the -//|physical level it consists of 2 wires: SCL and SDA, the clock and data -//|lines respectively. +//| :class:`I2C` --- Two wire serial protocol +//| ------------------------------------------""" //| -//|.. seealso:: Using this class directly requires careful lock management. -//|Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to -//|manage locks. +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): //| -//|.. seealso:: Using this class to directly read registers requires manual -//|bit unpacking. Instead, use an existing driver or make one with -//|:ref:`Register ` data descriptors. +//| """I2C is a two-wire protocol for communicating between devices. At the +//| physical level it consists of 2 wires: SCL and SDA, the clock and data +//| lines respectively. //| -//|:param ~microcontroller.Pin scl: The clock pin -//|:param ~microcontroller.Pin sda: The data pin -//|:param int frequency: The clock frequency in Hertz -//|:param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| manage locks. //| -//|.. note:: On the nRF52840, only one I2C object may be created, -//|except on the Circuit Playground Bluefruit, which allows two, -//|one for the onboard accelerometer, and one for offboard use.""" -//|... +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| +//| :param ~microcontroller.Pin scl: The clock pin +//| :param ~microcontroller.Pin sda: The data pin +//| :param int frequency: The clock frequency in Hertz +//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) +//| +//| .. note:: On the nRF52840, only one I2C object may be created, +//| except on the Circuit Playground Bluefruit, which allows two, +//| one for the onboard accelerometer, and one for offboard use.""" +//| ... STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t); self->base.type = &busio_i2c_type; @@ -83,9 +85,9 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//|def deinit(self, ) -> Any: -//|"""Releases control of the underlying hardware so other classes can use it.""" -//|... +//| def deinit(self, ) -> Any: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_i2c_deinit(self); @@ -99,15 +101,15 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used in Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware on context exit. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_i2c_deinit(args[0]); @@ -122,13 +124,14 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//|def scan(self, ) -> Any: -//|"""Scan all I2C addresses between 0x08 and 0x77 inclusive and return a -//|list of those that respond. +//| def scan(self, ) -> Any: //| -//|:return: List of device ids on the I2C bus -//|:rtype: list""" -//|... +//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a +//| list of those that respond. +//| +//| :return: List of device ids on the I2C bus +//| :rtype: list""" +//| ... STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -145,11 +148,12 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//|def try_lock(self, ) -> Any: -//|"""Attempts to grab the I2C lock. Returns True on success. -//|:return: True when lock has been grabbed -//|:rtype: bool""" -//|... +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the I2C lock. Returns True on success. +//| +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -157,9 +161,9 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//|def unlock(self, ) -> Any: -//|"""Releases the I2C lock.""" -//|... +//| def unlock(self, ) -> Any: +//| """Releases the I2C lock.""" +//| ... STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -168,20 +172,20 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//|def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//|"""Read into ``buffer`` from the slave specified by ``address``. -//|The number of bytes read will be the length of ``buffer``. -//|At least one byte must be read. +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| """Read into ``buffer`` from the slave specified by ``address``. +//| The number of bytes read will be the length of ``buffer``. +//| At least one byte must be read. //| -//|If ``start`` or ``end`` is provided, then the buffer will be sliced -//|as if ``buffer[start:end]``. This will not cause an allocation like -//|``buf[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buf[start:end]`` will so it saves memory. //| -//|:param int address: 7-bit device address -//|:param bytearray buffer: buffer to write into -//|:param int start: Index to start writing at -//|:param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//|... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer to write into +//| :param int start: Index to start writing at +//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { mp_buffer_info_t bufinfo; @@ -219,26 +223,26 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//|def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//|"""Write the bytes from ``buffer`` to the slave specified by ``address``. -//|Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be -//|removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and -//|repeated start before a read. +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be +//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and +//| repeated start before a read. //| -//|If ``start`` or ``end`` is provided, then the buffer will be sliced -//|as if ``buffer[start:end]``. This will not cause an allocation like -//|``buffer[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buffer[start:end]`` will so it saves memory. //| -//|Writing a buffer or slice of length zero is permitted, as it can be used -//|to poll for the existence of a device. +//| Writing a buffer or slice of length zero is permitted, as it can be used +//| to poll for the existence of a device. //| -//|:param int address: 7-bit device address -//|:param bytearray buffer: buffer containing the bytes to write -//|:param int start: Index to start writing from -//|:param int end: Index to read up to but not include. Defaults to ``len(buffer)`` -//|:param bool stop: If true, output an I2C stop condition after the buffer is written. -//|Deprecated. Will be removed in 6.x and act as stop=True.""" -//|... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer containing the bytes to write +//| :param int start: Index to start writing from +//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param bool stop: If true, output an I2C stop condition after the buffer is written. +//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| ... // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { // get the buffer to write the data from @@ -277,23 +281,23 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//|def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//|"""Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop -//|bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//|``in_buffer`` can be the same buffer because they are used sequentially. +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//|If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//|as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//|will so it saves memory. +//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//| will so it saves memory. //| -//|:param int address: 7-bit device address -//|:param bytearray out_buffer: buffer containing the bytes to write -//|:param bytearray in_buffer: buffer to write into -//|:param int out_start: Index to start writing from -//|:param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//|:param int in_start: Index to start writing at -//|:param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//|... +//| :param int address: 7-bit device address +//| :param bytearray out_buffer: buffer containing the bytes to write +//| :param bytearray in_buffer: buffer to write into +//| :param int out_start: Index to start writing from +//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param int in_start: Index to start writing at +//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index d6af32bd95..09a76decc8 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -34,36 +34,35 @@ #include "shared-bindings/busio/OneWire.h" #include "shared-bindings/util.h" -//|class OneWire: -//|""".. currentmodule:: busio +//| class OneWire: +//| """.. currentmodule:: busio //| -//|:class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//|=================================================================""" +//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol +//| =================================================================""" //| -//|__init__(self, pin: microcontroller.Pin): -//|""":class:`~busio.OneWire` implements the timing-sensitive foundation of the Maxim -//|(formerly Dallas Semi) OneWire protocol. +//| def __init__(self, pin: microcontroller.Pin): +//| """(formerly Dallas Semi) OneWire protocol. //| -//|Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 +//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 //| -//|.. class:: OneWire(pin) +//| .. class:: OneWire(pin) //| -//|Create a OneWire object associated with the given pin. The object -//|implements the lowest level timing-sensitive bits of the protocol. +//| Create a OneWire object associated with the given pin. The object +//| implements the lowest level timing-sensitive bits of the protocol. //| -//|:param ~microcontroller.Pin pin: Pin connected to the OneWire bus +//| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus //| -//|Read a short series of pulses:: +//| Read a short series of pulses:: //| -//|import busio -//|import board +//| import busio +//| import board //| -//|onewire = busio.OneWire(board.D7) -//|onewire.reset() -//|onewire.write_bit(True) -//|onewire.write_bit(False) -//|print(onewire.read_bit())""" -//|... +//| onewire = busio.OneWire(board.D7) +//| onewire.reset() +//| onewire.write_bit(True) +//| onewire.write_bit(False) +//| print(onewire.read_bit())""" +//| ... STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; static const mp_arg_t allowed_args[] = { @@ -80,9 +79,9 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialize the OneWire bus and release any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_onewire_deinit(self); @@ -96,15 +95,15 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_onewire_deinit(args[0]); @@ -112,12 +111,12 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//|def reset(self, ) -> Any: -//|"""Reset the OneWire bus and read presence +//| def reset(self, ) -> Any: +//| """Reset the OneWire bus and read presence //| -//|:returns: False when at least one device is present -//|:rtype: bool""" -//|... +//| :returns: False when at least one device is present +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -126,12 +125,12 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//|def read_bit(self, ) -> Any: -//|"""Read in a bit +//| def read_bit(self, ) -> Any: +//| """Read in a bit //| -//|:returns: bit state read -//|:rtype: bool""" -//|... +//| :returns: bit state read +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -140,9 +139,9 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); -//|def write_bit(self, value: Any) -> Any: -//|"""Write out a bit based on value.""" -//|... +//| def write_bit(self, value: Any) -> Any: +//| """Write out a bit based on value.""" +//| ... STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index b89b331af4..e5d123ce71 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -39,31 +39,31 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -//|class UART: -//|""".. currentmodule:: busio +//| class UART: +//| """.. currentmodule:: busio //| -//|:class:`UART` -- a bidirectional serial protocol -//|=================================================""" -//|def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): -//|"""A common bidirectional serial protocol that uses an an agreed upon speed -//|rather than a shared clock line. +//| :class:`UART` -- a bidirectional serial protocol +//| =================================================""" +//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): +//| """A common bidirectional serial protocol that uses an an agreed upon speed +//| rather than a shared clock line. //| -//|:param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. -//|:param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. -//|:param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. -//|:param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. -//|:param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. -//|:param bool rs485_invert: set to invert the sense of the rs485_dir pin. -//|:param int baudrate: the transmit and receive speed. -//|:param int bits: the number of bits per byte, 7, 8 or 9. -//|:param Parity parity: the parity used for error checking. -//|:param int stop: the number of stop bits, 1 or 2. -//|:param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. -//|:param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) +//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only. +//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. +//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. +//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. +//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. +//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. +//| :param int baudrate: the transmit and receive speed. +//| :param int bits: the number of bits per byte, 7, 8 or 9. +//| :param Parity parity: the parity used for error checking. +//| :param int stop: the number of stop bits, 1 or 2. +//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds. +//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) //| -//|*New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. -//|The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" -//|... +//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. +//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" +//| ... typedef struct { mp_obj_base_t base; } busio_uart_parity_obj_t; @@ -141,9 +141,9 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the UART and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the UART and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_uart_obj_deinit(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_uart_deinit(self); @@ -157,15 +157,15 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_uart_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_uart_deinit(args[0]); @@ -175,46 +175,40 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//|def read(self, nbytes: Any = None) -> Any: -//|"""Read characters. If ``nbytes`` is specified then read at most that many -//|bytes. Otherwise, read everything that arrives until the connection -//|times out. Providing the number of bytes expected is highly recommended -//|because it will be faster. +//| def read(self, nbytes: Any = None) -> Any: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. //| -//|:return: Data read -//|:rtype: bytes or None""" -//|... +//| :return: Data read +//| :rtype: bytes or None""" +//| ... -//|def readinto(self, buf: Any) -> Any: -//|""".. method:: readinto(buf) +//| def readinto(self, buf: Any) -> Any: +//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| -//|Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: int or None (on a non-blocking error) //| -//|:return: number of bytes read and stored into ``buf`` -//|:rtype: int or None (on a non-blocking error) -//| -//|*New in CircuitPython 4.0:* No length parameter is permitted.""" -//|... +//| *New in CircuitPython 4.0:* No length parameter is permitted.""" +//| ... -//|def readline(self, ) -> Any: -//|""".. method:: readline() +//| def readline(self, ) -> Any: +//| """Read a line, ending in a newline character. //| -//|Read a line, ending in a newline character. -//| -//|:return: the line read -//|:rtype: int or None""" -//|... +//| :return: the line read +//| :rtype: int or None""" +//| ... -//|def write(self, buf: Any) -> Any: -//|""".. method:: write(buf) +//| def write(self, buf: Any) -> Any: +//| """Write the buffer of bytes to the bus. //| -//|Write the buffer of bytes to the bus. +//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. //| -//|*New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. -//| -//|:return: the number of bytes written -//|:rtype: int or None""" -//|... +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -258,9 +252,9 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//|baudrate: Any = -//|"""The current baudrate.""" -//|... +//| baudrate: Any = ... +//| """The current baudrate.""" +//| STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -284,9 +278,9 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|in_waiting: Any = -//|"""The number of bytes in the input buffer, available to be read""" -//|... +//| in_waiting: Any = ... +//| """The number of bytes in the input buffer, available to be read""" +//| STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -301,9 +295,9 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|timeout: Any = -//|"""The current timeout, in seconds (float).""" -//|... +//| timeout: Any = ... +//| """The current timeout, in seconds (float).""" +//| STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -329,9 +323,9 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|def reset_input_buffer(self, ) -> Any: -//|"""Discard any unread characters in the input buffer.""" -//|... +//| def reset_input_buffer(self, ) -> Any: ... +//| """Discard any unread characters in the input buffer.""" +//| STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -340,16 +334,16 @@ STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer); -//|class busio: -//|def __init__(self, ): -//|"""Enum-like class to define the parity used to verify correct data transfer.""" -//|ODD: Any = -//|"""Total number of ones should be odd.""" -//|... -//|EVEN: Any = -//|"""Total number of ones should be even.""" -//|... -//|... +//| class busio: +//| """Enum-like class to define the parity used to verify correct data transfer.""" +//| +//| def __init__(self, ): +//| ODD: Any = ... +//| """Total number of ones should be odd.""" +//| +//| EVEN: Any = ... +//| """Total number of ones should be even.""" +//| ... const mp_obj_type_t busio_uart_parity_type; const busio_uart_parity_obj_t busio_uart_parity_odd_obj = { From 093461e81670d8ad635d8f893a44426a46b9779c Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 29 Apr 2020 15:45:19 -0400 Subject: [PATCH 359/919] Fixed indentation --- shared-bindings/busio/I2C.c | 136 +++++++++++++++---------------- shared-bindings/busio/OneWire.c | 46 +++++------ shared-bindings/busio/SPI.c | 140 ++++++++++++++++---------------- shared-bindings/busio/UART.c | 88 ++++++++++---------- 4 files changed, 205 insertions(+), 205 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 31dd9a7bf6..98ccbb5127 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -85,9 +85,9 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: -//| """Releases control of the underlying hardware so other classes can use it.""" -//| ... +//| def deinit(self, ) -> Any: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_i2c_deinit(self); @@ -101,15 +101,15 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used in Context Managers.""" -//| ... +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_i2c_deinit(args[0]); @@ -124,14 +124,14 @@ static void check_lock(busio_i2c_obj_t *self) { } } -//| def scan(self, ) -> Any: +//| def scan(self, ) -> Any: //| -//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a -//| list of those that respond. +//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a +//| list of those that respond. //| -//| :return: List of device ids on the I2C bus -//| :rtype: list""" -//| ... +//| :return: List of device ids on the I2C bus +//| :rtype: list""" +//| ... STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -148,12 +148,12 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); -//| def try_lock(self, ) -> Any: -//| """Attempts to grab the I2C lock. Returns True on success. +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the I2C lock. Returns True on success. //| -//| :return: True when lock has been grabbed -//| :rtype: bool""" -//| ... +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -161,9 +161,9 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); -//| def unlock(self, ) -> Any: -//| """Releases the I2C lock.""" -//| ... +//| def unlock(self, ) -> Any: +//| """Releases the I2C lock.""" +//| ... STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -172,20 +172,20 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); -//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. -//| The number of bytes read will be the length of ``buffer``. -//| At least one byte must be read. +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| """Read into ``buffer`` from the slave specified by ``address``. +//| The number of bytes read will be the length of ``buffer``. +//| At least one byte must be read. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buf[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buf[start:end]`` will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into -//| :param int start: Index to start writing at -//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer to write into +//| :param int start: Index to start writing at +//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { mp_buffer_info_t bufinfo; @@ -223,26 +223,26 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address``. -//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be -//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and -//| repeated start before a read. +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be +//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and +//| repeated start before a read. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buffer[start:end]`` will so it saves memory. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buffer[start:end]`` will so it saves memory. //| -//| Writing a buffer or slice of length zero is permitted, as it can be used -//| to poll for the existence of a device. +//| Writing a buffer or slice of length zero is permitted, as it can be used +//| to poll for the existence of a device. //| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write -//| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True.""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer containing the bytes to write +//| :param int start: Index to start writing from +//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param bool stop: If true, output an I2C stop condition after the buffer is written. +//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| ... // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { // get the buffer to write the data from @@ -281,23 +281,23 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); -//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop -//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//| ``in_buffer`` can be the same buffer because they are used sequentially. +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//| will so it saves memory. +//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//| will so it saves memory. //| -//| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into -//| :param int out_start: Index to start writing from -//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param int in_start: Index to start writing at -//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" -//| ... +//| :param int address: 7-bit device address +//| :param bytearray out_buffer: buffer containing the bytes to write +//| :param bytearray in_buffer: buffer to write into +//| :param int out_start: Index to start writing from +//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param int in_start: Index to start writing at +//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" +//| ... STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 09a76decc8..e44c876c57 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -79,9 +79,9 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" -//| ... +//| def deinit(self, ) -> Any: +//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_onewire_deinit(self); @@ -95,15 +95,15 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_onewire_deinit(args[0]); @@ -111,12 +111,12 @@ STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); -//| def reset(self, ) -> Any: -//| """Reset the OneWire bus and read presence +//| def reset(self, ) -> Any: +//| """Reset the OneWire bus and read presence //| -//| :returns: False when at least one device is present -//| :rtype: bool""" -//| ... +//| :returns: False when at least one device is present +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -125,12 +125,12 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); -//| def read_bit(self, ) -> Any: -//| """Read in a bit +//| def read_bit(self, ) -> Any: +//| """Read in a bit //| -//| :returns: bit state read -//| :rtype: bool""" -//| ... +//| :returns: bit state read +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -139,9 +139,9 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); -//| def write_bit(self, value: Any) -> Any: -//| """Write out a bit based on value.""" -//| ... +//| def write_bit(self, value: Any) -> Any: +//| """Write out a bit based on value.""" +//| ... STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 9644f4eb5d..93588d0879 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -101,9 +101,9 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Turn off the SPI bus.""" -//| ... +//| def deinit(self, ) -> Any: +//| """Turn off the SPI bus.""" +//| ... STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -111,15 +111,15 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers. -//| Provided by context manager helper.""" -//| ... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers. +//| Provided by context manager helper.""" +//| ... -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -140,28 +140,28 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { } } -//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: -//| """Configures the SPI bus. The SPI object must be locked. +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| """Configures the SPI bus. The SPI object must be locked. //| -//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower -//| due to the granularity of available clock settings. -//| Check the `frequency` attribute for the actual clock rate. -//| :param int polarity: the base state of the clock line (0 or 1) -//| :param int phase: the edge of the clock that data is captured. First (0) -//| or second (1). Rising or falling depends on clock polarity. -//| :param int bits: the number of bits per word +//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower +//| due to the granularity of available clock settings. +//| Check the `frequency` attribute for the actual clock rate. +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. +//| :param int bits: the number of bits per word //| -//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that -//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is -//| within spec for the SAMD21. +//| .. note:: On the SAMD21, it is possible to set the baudrate to 24 MHz, but that +//| speed is not guaranteed to work. 12 MHz is the next available lower speed, and is +//| within spec for the SAMD21. //| -//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, -//| and 8MHz. -//| If you pick a a baudrate other than one of these, the nearest lower -//| baudrate will be chosen, with a minimum of 125kHz. -//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, -//| which allows only one (to allow for an additional I2C object).""" -//| ... +//| .. note:: On the nRF52840, these baudrates are available: 125kHz, 250kHz, 1MHz, 2MHz, 4MHz, +//| and 8MHz. +//| If you pick a a baudrate other than one of these, the nearest lower +//| baudrate will be chosen, with a minimum of 125kHz. +//| Two SPI objects may be created, except on the Circuit Playground Bluefruit, +//| which allows only one (to allow for an additional I2C object).""" +//| ... STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; @@ -198,12 +198,12 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); -//| def try_lock(self, ) -> Any: -//| """Attempts to grab the SPI lock. Returns True on success. +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the SPI lock. Returns True on success. //| -//| :return: True when lock has been grabbed -//| :rtype: bool""" -//| ... +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -211,9 +211,9 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); -//| def unlock(self, ) -> Any: -//| """Releases the SPI lock.""" -//| ... +//| def unlock(self, ) -> Any: +//| """Releases the SPI lock.""" +//| ... STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -223,14 +223,14 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); -//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: -//| """Write the data contained in ``buffer``. The SPI object must be locked. -//| If the buffer is empty, nothing happens. +//| def write(self, buffer: bytearray, *, start: Any = 0, end: int = None) -> Any: +//| """Write the data contained in ``buffer``. The SPI object must be locked. +//| If the buffer is empty, nothing happens. //| -//| :param bytearray buffer: Write out the data in this buffer -//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" -//| ... +//| :param bytearray buffer: Write out the data in this buffer +//| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| ... STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; @@ -264,16 +264,16 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); -//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: -//| """Read into ``buffer`` while writing ``write_value`` for each byte read. -//| The SPI object must be locked. -//| If the number of bytes to read is 0, nothing happens. +//| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any: +//| """Read into ``buffer`` while writing ``write_value`` for each byte read. +//| The SPI object must be locked. +//| If the number of bytes to read is 0, nothing happens. //| -//| :param bytearray buffer: Read data into this buffer -//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` -//| :param int write_value: Value to write while reading. (Usually ignored.)""" -//| ... +//| :param bytearray buffer: Read data into this buffer +//| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param int write_value: Value to write while reading. (Usually ignored.)""" +//| ... STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; @@ -307,20 +307,20 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); -//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: -//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -//| The SPI object must be locked. -//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -//| must be equal. -//| If buffer slice lengths are both 0, nothing happens. +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//| The SPI object must be locked. +//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//| must be equal. +//| If buffer slice lengths are both 0, nothing happens. //| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer -//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" -//| ... +//| :param bytearray buffer_out: Write out the data in this buffer +//| :param bytearray buffer_in: Read data into this buffer +//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| ... STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; @@ -369,9 +369,9 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args } MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_readinto_obj, 2, busio_spi_write_readinto); -//| frequency: Any = ... -//| """The actual SPI bus frequency. This may not match the frequency requested -//| due to internal limitations.""" +//| frequency: Any = ... +//| """The actual SPI bus frequency. This may not match the frequency requested +//| due to internal limitations.""" //| STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index e5d123ce71..7c5c6ec2bc 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -141,9 +141,9 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co return (mp_obj_t)self; } -//| def deinit(self, ) -> Any: -//| """Deinitialises the UART and releases any hardware resources for reuse.""" -//| ... +//| def deinit(self, ) -> Any: +//| """Deinitialises the UART and releases any hardware resources for reuse.""" +//| ... STATIC mp_obj_t busio_uart_obj_deinit(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_uart_deinit(self); @@ -157,15 +157,15 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { } } -//| def __enter__(self, ) -> Any: -//| """No-op used by Context Managers.""" -//| ... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... // Provided by context manager helper. -//| def __exit__(self, ) -> Any: -//| """Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info.""" -//| ... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t busio_uart_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_uart_deinit(args[0]); @@ -175,40 +175,40 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: -//| """Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//| def read(self, nbytes: Any = None) -> Any: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. //| -//| :return: Data read -//| :rtype: bytes or None""" -//| ... +//| :return: Data read +//| :rtype: bytes or None""" +//| ... -//| def readinto(self, buf: Any) -> Any: -//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. +//| def readinto(self, buf: Any) -> Any: +//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: int or None (on a non-blocking error) +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: int or None (on a non-blocking error) //| -//| *New in CircuitPython 4.0:* No length parameter is permitted.""" -//| ... +//| *New in CircuitPython 4.0:* No length parameter is permitted.""" +//| ... -//| def readline(self, ) -> Any: -//| """Read a line, ending in a newline character. +//| def readline(self, ) -> Any: +//| """Read a line, ending in a newline character. //| -//| :return: the line read -//| :rtype: int or None""" -//| ... +//| :return: the line read +//| :rtype: int or None""" +//| ... -//| def write(self, buf: Any) -> Any: -//| """Write the buffer of bytes to the bus. +//| def write(self, buf: Any) -> Any: +//| """Write the buffer of bytes to the bus. //| -//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. +//| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. //| -//| :return: the number of bytes written -//| :rtype: int or None""" -//| ... +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -252,8 +252,8 @@ STATIC mp_uint_t busio_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t return ret; } -//| baudrate: Any = ... -//| """The current baudrate.""" +//| baudrate: Any = ... +//| """The current baudrate.""" //| STATIC mp_obj_t busio_uart_obj_get_baudrate(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -278,8 +278,8 @@ const mp_obj_property_t busio_uart_baudrate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| in_waiting: Any = ... -//| """The number of bytes in the input buffer, available to be read""" +//| in_waiting: Any = ... +//| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -295,8 +295,8 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| timeout: Any = ... -//| """The current timeout, in seconds (float).""" +//| timeout: Any = ... +//| """The current timeout, in seconds (float).""" //| STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -323,8 +323,8 @@ const mp_obj_property_t busio_uart_timeout_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def reset_input_buffer(self, ) -> Any: ... -//| """Discard any unread characters in the input buffer.""" +//| def reset_input_buffer(self, ) -> Any: ... +//| """Discard any unread characters in the input buffer.""" //| STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -334,7 +334,7 @@ STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer); -//| class busio: +//| class Parity: //| """Enum-like class to define the parity used to verify correct data transfer.""" //| //| def __init__(self, ): From a2a32fea1acc4caefb6c4142b547d8a09b2ba761 Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 29 Apr 2020 15:55:06 -0400 Subject: [PATCH 360/919] Added newlines after every ellipsis --- shared-bindings/busio/I2C.c | 10 ++++++++++ shared-bindings/busio/OneWire.c | 7 +++++++ shared-bindings/busio/SPI.c | 10 ++++++++++ shared-bindings/busio/UART.c | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 98ccbb5127..8ae3658eee 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -65,6 +65,7 @@ //| except on the Circuit Playground Bluefruit, which allows two, //| one for the onboard accelerometer, and one for offboard use.""" //| ... +//| STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t); self->base.type = &busio_i2c_type; @@ -88,6 +89,7 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con //| def deinit(self, ) -> Any: //| """Releases control of the underlying hardware so other classes can use it.""" //| ... +//| STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_i2c_deinit(self); @@ -104,12 +106,14 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) { //| def __enter__(self, ) -> Any: //| """No-op used in Context Managers.""" //| ... +//| // Provided by context manager helper. //| def __exit__(self, ) -> Any: //| """Automatically deinitializes the hardware on context exit. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... +//| STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_i2c_deinit(args[0]); @@ -132,6 +136,7 @@ static void check_lock(busio_i2c_obj_t *self) { //| :return: List of device ids on the I2C bus //| :rtype: list""" //| ... +//| STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -154,6 +159,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan); //| :return: True when lock has been grabbed //| :rtype: bool""" //| ... +//| STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -164,6 +170,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock); //| def unlock(self, ) -> Any: //| """Releases the I2C lock.""" //| ... +//| STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -186,6 +193,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); //| :param int start: Index to start writing at //| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``""" //| ... +//| // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { mp_buffer_info_t bufinfo; @@ -243,6 +251,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in //| :param bool stop: If true, output an I2C stop condition after the buffer is written. //| Deprecated. Will be removed in 6.x and act as stop=True.""" //| ... +//| // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { // get the buffer to write the data from @@ -298,6 +307,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| :param int in_start: Index to start writing at //| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" //| ... +//| STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index e44c876c57..556e567efc 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -63,6 +63,7 @@ //| onewire.write_bit(False) //| print(onewire.read_bit())""" //| ... +//| STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; static const mp_arg_t allowed_args[] = { @@ -82,6 +83,7 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, //| def deinit(self, ) -> Any: //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... +//| STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_onewire_deinit(self); @@ -98,12 +100,14 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { //| def __enter__(self, ) -> Any: //| """No-op used by Context Managers.""" //| ... +//| // Provided by context manager helper. //| def __exit__(self, ) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... +//| STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_onewire_deinit(args[0]); @@ -117,6 +121,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, bus //| :returns: False when at least one device is present //| :rtype: bool""" //| ... +//| STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -131,6 +136,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); //| :returns: bit state read //| :rtype: bool""" //| ... +//| STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -142,6 +148,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit //| def write_bit(self, value: Any) -> Any: //| """Write out a bit based on value.""" //| ... +//| STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 93588d0879..5b1881702c 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -78,6 +78,7 @@ //| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. //| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" //| ... +//| // TODO(tannewt): Support LSB SPI. @@ -104,6 +105,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con //| def deinit(self, ) -> Any: //| """Turn off the SPI bus.""" //| ... +//| STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_spi_deinit(self); @@ -115,11 +117,13 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_deinit_obj, busio_spi_obj_deinit); //| """No-op used by Context Managers. //| Provided by context manager helper.""" //| ... +//| //| def __exit__(self, ) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... +//| STATIC mp_obj_t busio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_spi_deinit(args[0]); @@ -162,6 +166,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { //| Two SPI objects may be created, except on the Circuit Playground Bluefruit, //| which allows only one (to allow for an additional I2C object).""" //| ... +//| STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; @@ -204,6 +209,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_configure_obj, 1, busio_spi_configure); //| :return: True when lock has been grabbed //| :rtype: bool""" //| ... +//| STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -214,6 +220,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_try_lock_obj, busio_spi_obj_try_lock); //| def unlock(self, ) -> Any: //| """Releases the SPI lock.""" //| ... +//| STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) { busio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -231,6 +238,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_unlock_obj, busio_spi_obj_unlock); //| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" //| ... +//| STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end }; @@ -274,6 +282,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 2, busio_spi_write); //| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` //| :param int write_value: Value to write while reading. (Usually ignored.)""" //| ... +//| STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_start, ARG_end, ARG_write_value }; @@ -321,6 +330,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_readinto_obj, 2, busio_spi_readinto); //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` //| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" //| ... +//| STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 7c5c6ec2bc..6a3d542e1c 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -64,6 +64,7 @@ //| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. //| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" //| ... +//| typedef struct { mp_obj_base_t base; } busio_uart_parity_obj_t; @@ -144,6 +145,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co //| def deinit(self, ) -> Any: //| """Deinitialises the UART and releases any hardware resources for reuse.""" //| ... +//| STATIC mp_obj_t busio_uart_obj_deinit(mp_obj_t self_in) { busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_busio_uart_deinit(self); @@ -160,12 +162,14 @@ STATIC void check_for_deinit(busio_uart_obj_t *self) { //| def __enter__(self, ) -> Any: //| """No-op used by Context Managers.""" //| ... +//| // Provided by context manager helper. //| def __exit__(self, ) -> Any: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... +//| STATIC mp_obj_t busio_uart_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_busio_uart_deinit(args[0]); @@ -184,6 +188,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| :return: Data read //| :rtype: bytes or None""" //| ... +//| //| def readinto(self, buf: Any) -> Any: //| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. @@ -193,6 +198,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| //| *New in CircuitPython 4.0:* No length parameter is permitted.""" //| ... +//| //| def readline(self, ) -> Any: //| """Read a line, ending in a newline character. @@ -200,6 +206,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| :return: the line read //| :rtype: int or None""" //| ... +//| //| def write(self, buf: Any) -> Any: //| """Write the buffer of bytes to the bus. @@ -209,6 +216,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| :return: the number of bytes written //| :rtype: int or None""" //| ... +//| // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { @@ -344,6 +352,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_o //| EVEN: Any = ... //| """Total number of ones should be even.""" //| ... +//| const mp_obj_type_t busio_uart_parity_type; const busio_uart_parity_obj_t busio_uart_parity_odd_obj = { From 3799c34564d46c2156f131a974ce55f8c35069f5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 29 Apr 2020 13:57:09 -0700 Subject: [PATCH 361/919] Disable bitbangio on CPX Crickit so we have room for lower_power. Enable pixelbuf in its place because we'll need it soon. --- .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 1516c149b9..c5ef958c9b 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -12,10 +12,11 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE +CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 -CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PIXELBUF = 1 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 From 7ff9b9bc80b3dafd4b263bc8854e4582a21664c2 Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 29 Apr 2020 17:36:28 -0400 Subject: [PATCH 362/919] Did first 3 --- shared-bindings/analogio/AnalogIn.c | 70 ++++++----- shared-bindings/analogio/AnalogOut.c | 63 +++++----- shared-bindings/analogio/__init__.c | 4 +- shared-bindings/audiobusio/I2SOut.c | 161 ++++++++++++++------------ shared-bindings/audiobusio/PDMIn.c | 131 +++++++++++---------- shared-bindings/audiobusio/__init__.c | 4 +- shared-bindings/audiocore/RawSample.c | 104 +++++++++-------- shared-bindings/audiocore/WaveFile.c | 103 ++++++++-------- shared-bindings/audiocore/__init__.c | 4 +- 9 files changed, 341 insertions(+), 303 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 9b6ac086be..2fb5051ebe 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -36,25 +36,28 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/util.h" -//|class AnalogIn: -//|""":class:`AnalogIn` -- read analog voltage -//|============================================ +//| class AnalogIn: +//| """.. currentmodule:: analogio //| -//|Usage:: +//| :class:`AnalogIn` -- read analog voltage +//| ============================================ //| -//|import analogio -//|from board import * +//| Usage:: //| -//|adc = analogio.AnalogIn(A1) -//|val = adc.value""" +//| import analogio +//| from board import * //| -//|def __init__(self, pin: microcontroller.Pin): +//| adc = analogio.AnalogIn(A1) +//| val = adc.value""" //| -//|"""Use the AnalogIn on the given pin. The reference voltage varies by -//|platform so use ``reference_voltage`` to read the configured setting. + +//| def __init__(self, pin: microcontroller.Pin): +//| """Use the AnalogIn on the given pin. The reference voltage varies by +//| platform so use ``reference_voltage`` to read the configured setting. +//| +//| :param ~microcontroller.Pin pin: the pin to read from""" +//| ... //| -//|:param ~microcontroller.Pin pin: the pin to read from""" -//|... STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check number of arguments @@ -70,9 +73,10 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Turn off the AnalogIn and release the pin for other use.""" -//|... +//| def deinit(self, ) -> Any: +//| """Turn off the AnalogIn and release the pin for other use.""" +//| ... +//| STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_analogio_analogin_deinit(self); @@ -85,15 +89,17 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) { raise_deinited_error(); } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogin_deinit(args[0]); @@ -101,12 +107,12 @@ STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__); -//|value: Any = -//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) +//| value: Any = ... +//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only) +//| +//| Even if the underlying analog to digital converter (ADC) is lower +//| resolution, the value is 16-bit.""" //| -//|Even if the underlying analog to digital converter (ADC) is lower -//|resolution, the value is 16-bit.""" -//|... STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -121,10 +127,10 @@ const mp_obj_property_t analogio_analogin_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|reference_voltage: Any = -//|"""The maximum voltage measurable (also known as the reference voltage) as a -//|`float` in Volts.""" -//|... +//| reference_voltage: Any = ... +//| """The maximum voltage measurable (also known as the reference voltage) as a +//| `float` in Volts.""" +//| STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 2316682903..9064bb5dce 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -36,26 +36,28 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class AnalogOut: -//|""".. currentmodule:: analogio +//| class AnalogOut: +//| """.. currentmodule:: analogio //| -//|:class:`AnalogOut` -- output analog voltage -//|============================================ +//| :class:`AnalogOut` -- output analog voltage +//| ============================================ //| -//|The AnalogOut is used to output analog values (a specific voltage). +//| The AnalogOut is used to output analog values (a specific voltage). //| -//|Example usage:: +//| Example usage:: //| -//|import analogio -//|from microcontroller import pin +//| import analogio +//| from microcontroller import pin //| -//|dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 -//|dac.value = 32768 # makes PA02 1.65V""" -//|def __init__(self, pin: microcontroller.Pin): -//|"""Use the AnalogOut on the given pin. +//| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02 +//| dac.value = 32768 # makes PA02 1.65V""" +//| +//| def __init__(self, pin: microcontroller.Pin): +//| """Use the AnalogOut on the given pin. +//| +//| :param ~microcontroller.Pin pin: the pin to output to""" +//| ... //| -//|:param ~microcontroller.Pin pin: the pin to output to""" -//|... STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // check arguments mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -69,9 +71,10 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Turn off the AnalogOut and release the pin for other use.""" -//|... +//| def deinit(self, ) -> Any: +//| """Turn off the AnalogOut and release the pin for other use.""" +//| ... +//| STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { analogio_analogout_obj_t *self = self_in; @@ -81,15 +84,17 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit); -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_analogio_analogout_deinit(args[0]); @@ -97,12 +102,12 @@ STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__); -//|value: Any = -//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) +//| value: Any = ... +//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only) +//| +//| Even if the underlying digital to analog converter (DAC) is lower +//| resolution, the value is 16-bit.""" //| -//|Even if the underlying digital to analog converter (DAC) is lower -//|resolution, the value is 16-bit.""" -//|... STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t value) { analogio_analogout_obj_t *self = MP_OBJ_TO_PTR(self_in); if (common_hal_analogio_analogout_deinited(self)) { diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index b468bcde0c..79627f16aa 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -34,7 +34,7 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogOut.h" -//| :mod:`analogio` --- Analog hardware support +//| """:mod:`analogio` --- Analog hardware support //| ================================================= //| //| .. module:: analogio @@ -70,7 +70,7 @@ //| This example will initialize the the device, read //| :py:data:`~analogio.AnalogIn.value` and then //| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional -//| because CircuitPython will do it automatically after the program finishes. +//| because CircuitPython will do it automatically after the program finishes.""" //| STATIC const mp_rom_map_elem_t analogio_module_globals_table[] = { diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 765e0a12dc..724a65a347 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -35,64 +35,66 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class I2SOut: -//|""".. currentmodule:: audiobusio +//| class I2SOut: +//| """.. currentmodule:: audiobusio //| -//|:class:`I2SOut` -- Output an I2S audio signal -//|======================================================== +//| :class:`I2SOut` -- Output an I2S audio signal +//| ======================================================== //| -//|I2S is used to output an audio signal on an I2S bus.""" -//|def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): -//|"""Create a I2SOut object associated with the given pins. +//| I2S is used to output an audio signal on an I2S bus.""" //| -//|:param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin -//|:param ~microcontroller.Pin word_select: The word select (or left/right clock) pin -//|:param ~microcontroller.Pin data: The data pin -//|:param bool left_justified: True when data bits are aligned with the word select clock. False -//|when they are shifted by one to match classic I2S protocol. +//| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): +//| """Create a I2SOut object associated with the given pins. //| -//|Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ -//|using `UDA1334 Breakout `_:: +//| :param ~microcontroller.Pin bit_clock: The bit clock (or serial clock) pin +//| :param ~microcontroller.Pin word_select: The word select (or left/right clock) pin +//| :param ~microcontroller.Pin data: The data pin +//| :param bool left_justified: True when data bits are aligned with the word select clock. False +//| when they are shifted by one to match classic I2S protocol. //| -//|import audiobusio -//|import audiocore -//|import board -//|import array -//|import time -//|import math +//| Simple 8ksps 440 Hz sine wave on `Metro M0 Express `_ +//| using `UDA1334 Breakout `_:: //| -//|# Generate one period of sine wave. -//|length = 8000 // 440 -//|sine_wave = array.array("H", [0] * length) -//|for i in range(length): -//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| import audiobusio +//| import audiocore +//| import board +//| import array +//| import time +//| import math //| -//|sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//|i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) -//|i2s.play(sine_wave, loop=True) -//|time.sleep(1) -//|i2s.stop() +//| # Generate one period of sine wave. +//| length = 8000 // 440 +//| sine_wave = array.array("H", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//|Playing a wave file from flash:: +//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//| i2s.play(sine_wave, loop=True) +//| time.sleep(1) +//| i2s.stop() //| -//|import board -//|import audioio -//|import audiocore -//|import audiobusio -//|import digitalio +//| Playing a wave file from flash:: +//| +//| import board +//| import audioio +//| import audiocore +//| import audiobusio +//| import digitalio //| //| -//|f = open("cplay-5.1-16bit-16khz.wav", "rb") -//|wav = audiocore.WaveFile(f) +//| f = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(f) //| -//|a = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//| a = audiobusio.I2SOut(board.D1, board.D0, board.D9) +//| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... //| -//|print("playing") -//|a.play(wav) -//|while a.playing: -//|pass -//|print("stopped")""" -//|... STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_bit_clock, ARG_word_select, ARG_data, ARG_left_justified }; static const mp_arg_t allowed_args[] = { @@ -115,9 +117,10 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the I2SOut and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the I2SOut and releases any hardware resources for reuse.""" +//| ... +//| STATIC mp_obj_t audiobusio_i2sout_deinit(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_i2sout_deinit(self); @@ -130,15 +133,17 @@ STATIC void check_for_deinit(audiobusio_i2sout_obj_t *self) { raise_deinited_error(); } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_i2sout_deinit(args[0]); @@ -147,14 +152,15 @@ STATIC mp_obj_t audiobusio_i2sout_obj___exit__(size_t n_args, const mp_obj_t *ar STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_i2sout___exit___obj, 4, 4, audiobusio_i2sout_obj___exit__); -//|def play(self, sample: Any, *, loop: Any = False) -> Any: -//|"""Plays the sample once when loop=False and continuously when loop=True. -//|Does not block. Use `playing` to block. +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| +//| The sample itself should consist of 8 bit or 16 bit samples.""" +//| ... //| -//|The sample itself should consist of 8 bit or 16 bit samples.""" -//|... STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -173,9 +179,10 @@ STATIC mp_obj_t audiobusio_i2sout_obj_play(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(audiobusio_i2sout_play_obj, 1, audiobusio_i2sout_obj_play); -//|def stop(self, ) -> Any: -//|"""Stops playback.""" -//|... +//| def stop(self, ) -> Any: +//| """Stops playback.""" +//| ... +//| STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -184,9 +191,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_stop_obj, audiobusio_i2sout_obj_stop); -//|playing: Any = -//|"""True when the audio sample is being output. (read-only)""" -//|... +//| playing: Any = ... +//| """True when the audio sample is being output. (read-only)""" +//| STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -201,9 +208,10 @@ const mp_obj_property_t audiobusio_i2sout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|def pause(self, ) -> Any: -//|"""Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" -//|... +//| def pause(self, ) -> Any: +//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//| ... +//| STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -216,9 +224,10 @@ STATIC mp_obj_t audiobusio_i2sout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_pause_obj, audiobusio_i2sout_obj_pause); -//|def resume(self, ) -> Any: -//|"""Resumes sample playback after :py:func:`pause`.""" -//|... +//| def resume(self, ) -> Any: +//| """Resumes sample playback after :py:func:`pause`.""" +//| ... +//| STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -231,9 +240,9 @@ STATIC mp_obj_t audiobusio_i2sout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_resume_obj, audiobusio_i2sout_obj_resume); -//|paused: Any = -//|"""True when playback is paused. (read-only)""" -//|... +//| paused: Any = ... +//| """True when playback is paused. (read-only)""" +//| STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { audiobusio_i2sout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 28ff9a4818..6cc834724b 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -36,57 +36,58 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class PDMIn: -//|""".. currentmodule:: audiobusio +//| class PDMIn: +//| """.. currentmodule:: audiobusio //| -//|:class:`PDMIn` -- Record an input PDM audio stream -//|======================================================== +//| :class:`PDMIn` -- Record an input PDM audio stream +//| ======================================================== //| -//|PDMIn can be used to record an input audio signal on a given set of pins.""" +//| PDMIn can be used to record an input audio signal on a given set of pins.""" //| -//|def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): -//|"""Create a PDMIn object associated with the given pins. This allows you to -//|record audio signals from the given pins. Individual ports may put further -//|restrictions on the recording parameters. The overall sample rate is -//|determined by `sample_rate` x ``oversample``, and the total must be 1MHz or -//|higher, so `sample_rate` must be a minimum of 16000. +//| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): +//| """Create a PDMIn object associated with the given pins. This allows you to +//| record audio signals from the given pins. Individual ports may put further +//| restrictions on the recording parameters. The overall sample rate is +//| determined by `sample_rate` x ``oversample``, and the total must be 1MHz or +//| higher, so `sample_rate` must be a minimum of 16000. +//| +//| :param ~microcontroller.Pin clock_pin: The pin to output the clock to +//| :param ~microcontroller.Pin data_pin: The pin to read the data from +//| :param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. +//| Minimum sample_rate is about 16000 Hz. +//| :param int bit_depth: Final number of bits per sample. Must be divisible by 8 +//| :param bool mono: True when capturing a single channel of audio, captures two channels otherwise +//| :param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 +//| :param float startup_delay: seconds to wait after starting microphone clock +//| to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. +//| Must be in range 0.0-1.0 seconds.""" //| -//|:param ~microcontroller.Pin clock_pin: The pin to output the clock to -//|:param ~microcontroller.Pin data_pin: The pin to read the data from -//|:param int sample_rate: Target sample_rate of the resulting samples. Check `sample_rate` for actual value. -//|Minimum sample_rate is about 16000 Hz. -//|:param int bit_depth: Final number of bits per sample. Must be divisible by 8 -//|:param bool mono: True when capturing a single channel of audio, captures two channels otherwise -//|:param int oversample: Number of single bit samples to decimate into a final sample. Must be divisible by 8 -//|:param float startup_delay: seconds to wait after starting microphone clock -//|to allow microphone to turn on. Most require only 0.01s; some require 0.1s. Longer is safer. -//|Must be in range 0.0-1.0 seconds.""" -//|... -//|Record 8-bit unsigned samples to buffer:: +//| """Record 8-bit unsigned samples to buffer:: //| -//|import audiobusio -//|import board +//| import audiobusio +//| import board //| -//|# Prep a buffer to record into -//|b = bytearray(200) -//|with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000) as mic: -//|mic.record(b, len(b)) +//| # Prep a buffer to record into +//| b = bytearray(200) +//| with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000) as mic: +//| mic.record(b, len(b)) //| -//|Record 16-bit unsigned samples to buffer:: +//| Record 16-bit unsigned samples to buffer:: //| -//|import audiobusio -//|import board +//| import audiobusio +//| import board +//| +//| # Prep a buffer to record into. The array interface doesn't allow for +//| # constructing with a set size so we append to it until we have the size +//| # we want. +//| b = array.array("H") +//| for i in range(200): +//| b.append(0) +//| with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16) as mic: +//| mic.record(b, len(b))""" +//| ... //| -//|# Prep a buffer to record into. The array interface doesn't allow for -//|# constructing with a set size so we append to it until we have the size -//|# we want. -//|b = array.array("H") -//|for i in range(200): -//|b.append(0) -//|with audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA, sample_rate=16000, bit_depth=16) as mic: -//|mic.record(b, len(b)) -//| STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_clock_pin, ARG_data_pin, ARG_sample_rate, ARG_bit_depth, ARG_mono, ARG_oversample, ARG_startup_delay }; static const mp_arg_t allowed_args[] = { @@ -138,9 +139,10 @@ STATIC mp_obj_t audiobusio_pdmin_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the PDMIn and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the PDMIn and releases any hardware resources for reuse.""" +//| ... +//| STATIC mp_obj_t audiobusio_pdmin_deinit(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiobusio_pdmin_deinit(self); @@ -153,14 +155,16 @@ STATIC void check_for_deinit(audiobusio_pdmin_obj_t *self) { raise_deinited_error(); } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context.""" +//| ... +//| STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiobusio_pdmin_deinit(args[0]); @@ -169,17 +173,18 @@ STATIC mp_obj_t audiobusio_pdmin_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiobusio_pdmin___exit___obj, 4, 4, audiobusio_pdmin_obj___exit__); -//|def record(self, destination: Any, destination_length: Any) -> Any: -//|"""Records destination_length bytes of samples to destination. This is -//|blocking. +//| def record(self, destination: Any, destination_length: Any) -> Any: +//| """Records destination_length bytes of samples to destination. This is +//| blocking. //| -//|An IOError may be raised when the destination is too slow to record the -//|audio at the given rate. For internal flash, writing all 1s to the file -//|before recording is recommended to speed up writes. +//| An IOError may be raised when the destination is too slow to record the +//| audio at the given rate. For internal flash, writing all 1s to the file +//| before recording is recommended to speed up writes. +//| +//| :return: The number of samples recorded. If this is less than ``destination_length``, +//| some samples were missed due to processing time.""" +//| ... //| -//|:return: The number of samples recorded. If this is less than ``destination_length``, -//|some samples were missed due to processing time.""" -//|... STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destination, mp_obj_t destination_length) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_obj); check_for_deinit(self); @@ -210,10 +215,10 @@ STATIC mp_obj_t audiobusio_pdmin_obj_record(mp_obj_t self_obj, mp_obj_t destinat } MP_DEFINE_CONST_FUN_OBJ_3(audiobusio_pdmin_record_obj, audiobusio_pdmin_obj_record); -//|sample_rate: Any = -//|"""The actual sample_rate of the recording. This may not match the constructed -//|sample rate due to internal clock limitations.""" -//|... +//| sample_rate: Any = ... +//| """The actual sample_rate of the recording. This may not match the constructed +//| sample rate due to internal clock limitations.""" +//| STATIC mp_obj_t audiobusio_pdmin_obj_get_sample_rate(mp_obj_t self_in) { audiobusio_pdmin_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiobusio/__init__.c b/shared-bindings/audiobusio/__init__.c index f7e3a07668..c5c3873619 100644 --- a/shared-bindings/audiobusio/__init__.c +++ b/shared-bindings/audiobusio/__init__.c @@ -34,7 +34,7 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiobusio/PDMIn.h" -//| :mod:`audiobusio` --- Support for audio input and output over digital bus +//| """:mod:`audiobusio` --- Support for audio input and output over digital bus //| ========================================================================= //| //| .. module:: audiobusio @@ -56,7 +56,7 @@ //| //| All libraries change hardware state and should be deinitialized when they //| are no longer needed. To do so, either call :py:meth:`!deinit` or use a -//| context manager. +//| context manager.""" //| STATIC const mp_rom_map_elem_t audiobusio_module_globals_table[] = { diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index fdedfe9598..6091fbfc00 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -35,45 +35,52 @@ #include "shared-bindings/audiocore/RawSample.h" #include "supervisor/shared/translate.h" -//|class RawSample: -//|""".. currentmodule:: audiocore + + + + + + +//| class RawSample: +//| """.. currentmodule:: audiocore //| -//|:class:`RawSample` -- A raw audio sample buffer -//|======================================================== +//| :class:`RawSample` -- A raw audio sample buffer +//| ======================================================== //| -//|An in-memory sound sample""" +//| An in-memory sound sample""" //| -//|def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): -//|"""Create a RawSample based on the given buffer of signed values. If channel_count is more than -//|1 then each channel's samples should alternate. In other words, for a two channel buffer, the -//|first sample will be for channel 1, the second sample will be for channel two, the third for -//|channel 1 and so on. +//| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): +//| """Create a RawSample based on the given buffer of signed values. If channel_count is more than +//| 1 then each channel's samples should alternate. In other words, for a two channel buffer, the +//| first sample will be for channel 1, the second sample will be for channel two, the third for +//| channel 1 and so on. //| -//|:param array.array buffer: An `array.array` with samples -//|:param int channel_count: The number of channels in the buffer -//|:param int sample_rate: The desired playback sample rate +//| :param array.array buffer: An `array.array` with samples +//| :param int channel_count: The number of channels in the buffer +//| :param int sample_rate: The desired playback sample rate //| -//|Simple 8ksps 440 Hz sin wave:: +//| Simple 8ksps 440 Hz sin wave:: //| -//|import audiocore -//|import audioio -//|import board -//|import array -//|import time -//|import math +//| import audiocore +//| import audioio +//| import board +//| import array +//| import time +//| import math //| -//|# Generate one period of sine wav. -//|length = 8000 // 440 -//|sine_wave = array.array("h", [0] * length) -//|for i in range(length): -//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) +//| # Generate one period of sine wav. +//| length = 8000 // 440 +//| sine_wave = array.array("h", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) +//| +//| dac = audioio.AudioOut(board.SPEAKER) +//| sine_wave = audiocore.RawSample(sine_wave) +//| dac.play(sine_wave, loop=True) +//| time.sleep(1) +//| dac.stop()""" +//| ... //| -//|dac = audioio.AudioOut(board.SPEAKER) -//|sine_wave = audiocore.RawSample(sine_wave) -//|dac.play(sine_wave, loop=True) -//|time.sleep(1) -//|dac.stop()""" -//|... STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_channel_count, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -105,9 +112,10 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the AudioOut and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//| ... +//| STATIC mp_obj_t audioio_rawsample_deinit(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_rawsample_deinit(self); @@ -121,15 +129,17 @@ STATIC void check_for_deinit(audioio_rawsample_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_rawsample_deinit(args[0]); @@ -137,12 +147,12 @@ STATIC mp_obj_t audioio_rawsample_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_rawsample___exit___obj, 4, 4, audioio_rawsample_obj___exit__); -//|sample_rate: Any = -//|"""32 bit value that dictates how quickly samples are played in Hertz (cycles per second). -//|When the sample is looped, this can change the pitch output without changing the underlying -//|sample. This will not change the sample rate of any active playback. Call ``play`` again to -//|change it.""" -//|... +//| sample_rate: Any = ... +//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second). +//| When the sample is looped, this can change the pitch output without changing the underlying +//| sample. This will not change the sample rate of any active playback. Call ``play`` again to +//| change it.""" +//| STATIC mp_obj_t audioio_rawsample_obj_get_sample_rate(mp_obj_t self_in) { audioio_rawsample_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 9116e71f0f..65b42fb6c4 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -33,43 +33,45 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class WaveFile: -//|""".. currentmodule:: audiocore +//| class WaveFile: +//| """.. currentmodule:: audiocore //| -//|:class:`WaveFile` -- Load a wave file for audio playback -//|======================================================== +//| :class:`WaveFile` -- Load a wave file for audio playback +//| ======================================================== //| -//|A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must -//|be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating -//|an internal buffer.""" -//|def __init__(self, file: typing.BinaryIO, buffer: bytearray): -//|"""Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must +//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating +//| an internal buffer.""" //| -//|:param typing.BinaryIO file: Already opened wave file -//|:param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. +//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): +//| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//| +//| :param typing.BinaryIO file: Already opened wave file +//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two 512 byte buffers are allocated internally. //| //| -//|Playing a wave file from flash:: +//| Playing a wave file from flash:: //| -//|import board -//|import audiocore -//|import audioio -//|import digitalio +//| import board +//| import audiocore +//| import audioio +//| import digitalio //| -//|# Required for CircuitPlayground Express -//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//|speaker_enable.switch_to_output(value=True) +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//|data = open("cplay-5.1-16bit-16khz.wav", "rb") -//|wav = audiocore.WaveFile(data) -//|a = audioio.AudioOut(board.A0) +//| data = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(data) +//| a = audioio.AudioOut(board.A0) +//| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... //| -//|print("playing") -//|a.play(wav) -//|while a.playing: -//|pass -//|print("stopped")""" -//|... STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -92,9 +94,9 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the WaveFile and releases all memory resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the WaveFile and releases all memory resources for reuse.""" +//| ... STATIC mp_obj_t audioio_wavefile_deinit(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_wavefile_deinit(self); @@ -108,15 +110,17 @@ STATIC void check_for_deinit(audioio_wavefile_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_wavefile_deinit(args[0]); @@ -124,11 +128,11 @@ STATIC mp_obj_t audioio_wavefile_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_wavefile___exit___obj, 4, 4, audioio_wavefile_obj___exit__); -//|sample_rate: Any = -//|"""32 bit value that dictates how quickly samples are loaded into the DAC -//|in Hertz (cycles per second). When the sample is looped, this can change -//|the pitch output without changing the underlying sample.""" -//|... +//| sample_rate: Any = ... +//| """32 bit value that dictates how quickly samples are loaded into the DAC +//| in Hertz (cycles per second). When the sample is looped, this can change +//| the pitch output without changing the underlying sample.""" +//| STATIC mp_obj_t audioio_wavefile_obj_get_sample_rate(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -151,9 +155,9 @@ const mp_obj_property_t audioio_wavefile_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|bits_per_sample: Any = -//|"""Bits per sample. (read only)""" -//|... +//| bits_per_sample: Any = ... +//| """Bits per sample. (read only)""" +//| STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -167,10 +171,9 @@ const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; - -//|channel_count: Any = -//|"""Number of audio channels. (read only)""" -//|... +//| channel_count: Any = ... +//| """Number of audio channels. (read only)""" +//| STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { audioio_wavefile_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiocore/__init__.c b/shared-bindings/audiocore/__init__.c index cf05112cb7..38f91d8eeb 100644 --- a/shared-bindings/audiocore/__init__.c +++ b/shared-bindings/audiocore/__init__.c @@ -35,7 +35,7 @@ #include "shared-bindings/audiocore/WaveFile.h" //#include "shared-bindings/audiomixer/Mixer.h" -//| :mod:`audiocore` --- Support for audio samples and mixer +//| """:mod:`audiocore` --- Support for audio samples and mixer //| ======================================================== //| //| .. module:: audiocore @@ -50,7 +50,7 @@ //| :maxdepth: 3 //| //| RawSample -//| WaveFile +//| WaveFile""" //| STATIC const mp_rom_map_elem_t audiocore_module_globals_table[] = { From 84cee1ab8de48cc5a3dcbbd78a381cfd0306ed49 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Apr 2020 17:44:10 -0400 Subject: [PATCH 363/919] rename and improve PacketBuffer packet length property --- ports/nrf/common-hal/_bleio/Characteristic.c | 2 + ports/nrf/common-hal/_bleio/Connection.c | 18 ++++++ ports/nrf/common-hal/_bleio/Connection.h | 1 + ports/nrf/common-hal/_bleio/PacketBuffer.c | 59 +++++++++++--------- ports/nrf/common-hal/_bleio/PacketBuffer.h | 2 + ports/nrf/common-hal/_bleio/Service.h | 2 + ports/nrf/common-hal/_bleio/__init__.c | 8 +-- shared-bindings/_bleio/Connection.c | 28 +++++++++- shared-bindings/_bleio/Connection.h | 11 ++-- shared-bindings/_bleio/PacketBuffer.c | 38 +++++++------ shared-bindings/_bleio/PacketBuffer.h | 4 +- 11 files changed, 120 insertions(+), 53 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index e311aceb97..d507cecca4 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -127,6 +127,7 @@ size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *sel // self->value is set by evt handler. return common_hal_bleio_gattc_read(self->handle, conn_handle, buf, len); } else { + // conn_handle is ignored for non-system attributes. return common_hal_bleio_gatts_read(self->handle, conn_handle, buf, len); } } @@ -152,6 +153,7 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, (self->props & CHAR_PROP_WRITE_NO_RESPONSE)); } else { // Always write the value locally even if no connections are active. + // conn_handle is ignored for non-system attributes, so we use BLE_CONN_HANDLE_INVALID. common_hal_bleio_gatts_write(self->handle, BLE_CONN_HANDLE_INVALID, bufinfo); // Check to see if we need to notify or indicate any active connections. for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index d4c7308fd1..00c1acd4d4 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -371,6 +371,11 @@ mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_ return 1.25f * self->conn_params.min_conn_interval; } +// Return the current negotiated MTU length, minus overhead. +mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self) { + return (self->mtu == 0 ? BLE_GATT_ATT_MTU_DEFAULT : self->mtu) - 3; +} + void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { self->conn_params_updating = true; uint16_t interval = new_interval / 1.25f; @@ -752,3 +757,16 @@ mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* interna return MP_OBJ_FROM_PTR(connection); } + +// Find the connection that uses the given conn_handle. Return NULL if not found. +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle) { + bleio_connection_internal_t *connection; + for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { + connection = &bleio_connections[i]; + if (connection->conn_handle == conn_handle) { + return connection; + } + } + + return NULL; +} diff --git a/ports/nrf/common-hal/_bleio/Connection.h b/ports/nrf/common-hal/_bleio/Connection.h index 282e0c4b5d..b051e5c511 100644 --- a/ports/nrf/common-hal/_bleio/Connection.h +++ b/ports/nrf/common-hal/_bleio/Connection.h @@ -87,5 +87,6 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in); uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self); mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t* connection); +bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_CONNECTION_H diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 6ed6d14514..ea434780fd 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -107,12 +107,18 @@ STATIC uint32_t queue_next_write(bleio_packet_buffer_obj_t *self) { } STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { - bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; + const uint16_t evt_id = ble_evt->header.evt_id; + // Check if this is a GATTC event so we can make sure the conn_handle is valid. + if (evt_id < BLE_GATTC_EVT_BASE || evt_id > BLE_GATTC_EVT_LAST) { + return false; + } + uint16_t conn_handle = ble_evt->evt.gattc_evt.conn_handle; + bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; if (conn_handle != self->conn_handle) { return false; } - switch (ble_evt->header.evt_id) { + switch (evt_id) { case BLE_GATTC_EVT_HVX: { // A remote service wrote to this characteristic. ble_gattc_evt_hvx_t* evt_hvx = &ble_evt->evt.gattc_evt.params.hvx; @@ -142,9 +148,9 @@ STATIC bool packet_buffer_on_ble_client_evt(ble_evt_t *ble_evt, void *param) { STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { bleio_packet_buffer_obj_t *self = (bleio_packet_buffer_obj_t *) param; - uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; switch (ble_evt->header.evt_id) { case BLE_GATTS_EVT_WRITE: { + uint16_t conn_handle = ble_evt->evt.gatts_evt.conn_handle; // A client wrote to this server characteristic. ble_gatts_evt_write_t *evt_write = &ble_evt->evt.gatts_evt.params.write; @@ -168,7 +174,7 @@ STATIC bool packet_buffer_on_ble_server_evt(ble_evt_t *ble_evt, void *param) { break; } case BLE_GAP_EVT_DISCONNECTED: { - if (self->conn_handle == conn_handle) { + if (self->conn_handle == ble_evt->evt.gap_evt.conn_handle) { self->conn_handle = BLE_CONN_HANDLE_INVALID; } } @@ -202,7 +208,6 @@ void common_hal_bleio_packet_buffer_construct( } if (incoming) { - // This is a macro. ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false); if (self->ringbuf.buf == NULL) { @@ -249,7 +254,7 @@ void common_hal_bleio_packet_buffer_construct( } } -int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { +mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len) { if (ringbuf_count(&self->ringbuf) < 2) { return 0; } @@ -280,7 +285,7 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { return; } - uint16_t packet_size = common_hal_bleio_packet_buffer_get_packet_size(self); + uint16_t packet_size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); uint16_t max_size = packet_size - len; while (max_size < self->pending_size && self->conn_handle != BLE_CONN_HANDLE_INVALID) { RUN_BACKGROUND_TASKS; @@ -308,26 +313,30 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 } } -uint16_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self) { - uint16_t mtu; - if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return 0; - } - bleio_connection_internal_t *connection; - for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { - connection = &bleio_connections[i]; - if (connection->conn_handle == self->conn_handle) { - break; +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self) { + // If this PacketBuffer is being used for NOTIFY or INDICATE from + // a remote service, the maximum size is what can be sent in one + // BLE packet. But we must be connected to know that value. + // + // Otherwise it can be a long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic != NULL && + self->characteristic->service != NULL && + self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY)) && + self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest incoming packet length would be. + return -1; } - if (connection->mtu == 0) { - mtu = BLE_GATT_ATT_MTU_DEFAULT; - } - if (self->characteristic->max_length > mtu) { - mtu = self->characteristic->max_length; - } - uint16_t att_overhead = 3; - return mtu - att_overhead; + return self->characteristic->max_length; } bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.h b/ports/nrf/common-hal/_bleio/PacketBuffer.h index cfccc852ed..1ebe60be5f 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.h +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.h @@ -41,6 +41,8 @@ typedef struct { // the other is waiting to be queued and can be extended. uint8_t* outgoing[2]; uint16_t pending_size; + // We remember the conn_handle so we can do a NOTIFY/INDICATE to a client. + // We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read). uint16_t conn_handle; uint8_t pending_index; uint8_t write_type; diff --git a/ports/nrf/common-hal/_bleio/Service.h b/ports/nrf/common-hal/_bleio/Service.h index f101bc825b..6ee9fe63de 100644 --- a/ports/nrf/common-hal/_bleio/Service.h +++ b/ports/nrf/common-hal/_bleio/Service.h @@ -39,6 +39,8 @@ typedef struct bleio_service_obj { bool is_remote; bool is_secondary; bleio_uuid_obj_t *uuid; + // The connection object is set only when this is a remote service. + // A local service doesn't know the connection. mp_obj_t connection; mp_obj_list_t *characteristic_list; // Range of attribute handles of this remote service. diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 62a3a9299c..83c2af8fac 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -118,8 +118,8 @@ void common_hal_bleio_check_connected(uint16_t conn_handle) { // GATTS read of a Characteristic or Descriptor. size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { - // conn_handle might be BLE_CONN_HANDLE_INVALID if we're not connected, but that's OK, because - // we can still read and write the local value. + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, but that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = buf, @@ -132,8 +132,8 @@ size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_ } void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { - // conn_handle might be BLE_CONN_HANDLE_INVALID if we're not connected, but that's OK, because - // we can still read and write the local value. + // conn_handle is ignored unless this is a system attribute. + // If we're not connected, but that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = bufinfo->buf, diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index c157af3652..f612517bbf 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -214,6 +214,25 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); +//| .. attribute:: max_packet_length +//| +//| The maximum number of data bytes that can be sent in a single transmission, +//| not including overhead bytes. +//| +//| This is the maximum number of bytes that can be sent in a notification, +//| which must be sent in a single packet. +//| But for a regular characteristic read or write, may be sent in multiple packets, +//| so this limit does not apply. +//| +STATIC mp_obj_t bleio_connection_get_max_packet_length(mp_obj_t self_in) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); + + bleio_connection_ensure_connected(self); + return mp_obj_new_int(common_hal_bleio_connection_get_max_packet_length(self->connection)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_max_packet_length_obj, bleio_connection_get_max_packet_length); + + STATIC mp_obj_t bleio_connection_set_connection_interval(mp_obj_t self_in, mp_obj_t interval_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -233,6 +252,13 @@ const mp_obj_property_t bleio_connection_connection_interval_obj = { (mp_obj_t)&mp_const_none_obj }, }; +const mp_obj_property_t bleio_connection_max_packet_length_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_connection_get_max_packet_length_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_pair), MP_ROM_PTR(&bleio_connection_pair_obj) }, @@ -243,7 +269,7 @@ STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_connection_connected_obj) }, { MP_ROM_QSTR(MP_QSTR_paired), MP_ROM_PTR(&bleio_connection_paired_obj) }, { MP_ROM_QSTR(MP_QSTR_connection_interval), MP_ROM_PTR(&bleio_connection_connection_interval_obj) }, - + { MP_ROM_QSTR(MP_QSTR_max_packet_length), MP_ROM_PTR(&bleio_connection_max_packet_length_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_connection_locals_dict, bleio_connection_locals_dict_table); diff --git a/shared-bindings/_bleio/Connection.h b/shared-bindings/_bleio/Connection.h index c6f2601608..a5313a9375 100644 --- a/shared-bindings/_bleio/Connection.h +++ b/shared-bindings/_bleio/Connection.h @@ -34,11 +34,12 @@ extern const mp_obj_type_t bleio_connection_type; -extern void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); -extern void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); -extern bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); -extern bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); -extern mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); +void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); +void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); +bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); +mp_int_t common_hal_bleio_connection_get_max_packet_length(bleio_connection_internal_t *self); +bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); +mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self); void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval); diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 9e3666044a..f8ab2ee2ef 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -42,7 +42,7 @@ //| //| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware //| outgoing writes. A packet's size is either the characteristic length or the maximum transmission -//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a +//| unit (MTU), whichever is smaller. The MTU can change so check `incoming_packet_length` before creating a //| buffer to store data. //| //| When we're the server, we ignore all connections besides the first to subscribe to @@ -71,7 +71,7 @@ STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n const mp_obj_t characteristic = args[ARG_characteristic].u_obj; - const int buffer_size = args[ARG_buffer_size].u_int; + const mp_int_t buffer_size = args[ARG_buffer_size].u_int; if (buffer_size < 1) { mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); } @@ -97,7 +97,7 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) { //| .. method:: readinto(buf) //| //| Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer -//| than the given buffer. Use `packet_size` to read the maximum length of a single packet. +//| than the given buffer. Use `incoming_packet_length` to read the maximum length of a single packet. //| //| :return: number of bytes read and stored into ``buf`` //| :rtype: int @@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o mp_buffer_info_t bufinfo; mp_get_buffer_raise(buffer_obj, &bufinfo, MP_BUFFER_WRITE); - int size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); + mp_int_t size = common_hal_bleio_packet_buffer_readinto(self, bufinfo.buf, bufinfo.len); if (size < 0) { mp_raise_ValueError_varg(translate("Buffer too short by %d bytes"), size * -1); } @@ -166,33 +166,39 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); -//| .. attribute:: packet_size +//| .. attribute:: incoming_packet_length //| -//| Maximum size of each packet in bytes. This is the minimum of the Characteristic length and -//| the negotiated Maximum Transfer Unit (MTU). +//| Maximum size of a packet. +//| If the packet is arriving from a remote service via notify or indicate, +//| the maximum size is `Connection.max_packet_length`. +//| Otherwise it is the ``max_length`` of the `Characteristic`. //| -STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { +STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return MP_OBJ_NEW_SMALL_INT(common_hal_bleio_packet_buffer_get_packet_size(self)); + mp_int_t size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); + if (size < 0) { + mp_raise_ValueError(translate("No connection: size cannot be determined")); + } + return MP_OBJ_NEW_SMALL_INT(size); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_packet_size_obj, bleio_packet_buffer_get_packet_size); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_obj, bleio_packet_buffer_get_incoming_packet_length); -const mp_obj_property_t bleio_packet_buffer_packet_size_obj = { +const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_packet_size_obj, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj }, }; STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, // Standard stream methods. - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_packet_size_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_incoming_packet_length), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_packet_buffer_locals_dict, bleio_packet_buffer_locals_dict_table); diff --git a/shared-bindings/_bleio/PacketBuffer.h b/shared-bindings/_bleio/PacketBuffer.h index 990a2f8bb0..1e21d24e05 100644 --- a/shared-bindings/_bleio/PacketBuffer.h +++ b/shared-bindings/_bleio/PacketBuffer.h @@ -35,8 +35,8 @@ extern void common_hal_bleio_packet_buffer_construct( bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, size_t buffer_size); void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); -int common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); -uint16_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self); bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self); void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self); From 3d62f87e29474a1f9311f0a85d84c4e79a087fbc Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Apr 2020 22:10:56 -0400 Subject: [PATCH 364/919] back to '.packet_size' for compatiblity --- ports/nrf/common-hal/_bleio/PacketBuffer.c | 7 +++---- shared-bindings/_bleio/PacketBuffer.c | 14 +++++++------- shared-bindings/_bleio/PacketBuffer.h | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index ea434780fd..4f3e1e5663 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -285,7 +285,7 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { return; } - uint16_t packet_size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); + uint16_t packet_size = common_hal_bleio_packet_buffer_get_packet_size(self); uint16_t max_size = packet_size - len; while (max_size < self->pending_size && self->conn_handle != BLE_CONN_HANDLE_INVALID) { RUN_BACKGROUND_TASKS; @@ -313,9 +313,9 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 } } -mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self) { +mp_int_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self) { // If this PacketBuffer is being used for NOTIFY or INDICATE from - // a remote service, the maximum size is what can be sent in one + // the maximum size is what can be sent in one // BLE packet. But we must be connected to know that value. // // Otherwise it can be a long as the characteristic @@ -323,7 +323,6 @@ mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_ if (self->characteristic != NULL && self->characteristic->service != NULL && - self->characteristic->service->is_remote && (common_hal_bleio_characteristic_get_properties(self->characteristic) & (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY)) && self->conn_handle != BLE_CONN_HANDLE_INVALID) { diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index f8ab2ee2ef..46671f7673 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -166,27 +166,27 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); -//| .. attribute:: incoming_packet_length +//| .. attribute:: packet_size //| //| Maximum size of a packet. //| If the packet is arriving from a remote service via notify or indicate, //| the maximum size is `Connection.max_packet_length`. //| Otherwise it is the ``max_length`` of the `Characteristic`. //| -STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { +STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); + mp_int_t size = common_hal_bleio_packet_buffer_get_packet_size(self); if (size < 0) { mp_raise_ValueError(translate("No connection: size cannot be determined")); } return MP_OBJ_NEW_SMALL_INT(size); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_obj, bleio_packet_buffer_get_incoming_packet_length); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_packet_size_obj, bleio_packet_buffer_get_packet_size); -const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { +const mp_obj_property_t bleio_packet_buffer_packet_size_obj = { .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_packet_size_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj }, }; @@ -198,7 +198,7 @@ STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_incoming_packet_length), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_packet_size_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_packet_buffer_locals_dict, bleio_packet_buffer_locals_dict_table); diff --git a/shared-bindings/_bleio/PacketBuffer.h b/shared-bindings/_bleio/PacketBuffer.h index 1e21d24e05..eb291eeccf 100644 --- a/shared-bindings/_bleio/PacketBuffer.h +++ b/shared-bindings/_bleio/PacketBuffer.h @@ -36,7 +36,7 @@ extern void common_hal_bleio_packet_buffer_construct( size_t buffer_size); void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); -mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self); bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self); void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self); From 6aac9233db82af9c8f8fb5bc801665402e1f87d5 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 30 Apr 2020 10:43:46 +0800 Subject: [PATCH 365/919] nrf: bluetooth: add s147 v7.0.1 softdevice hexfile This was not added as part of the initial v7.0.1 patchset because .hex files are in this project's .gitignore, and so git ignored it. Signed-off-by: Sean Cross --- .../s140_nrf52_7.0.1_softdevice.hex | 9742 +++++++++++++++++ 1 file changed, 9742 insertions(+) create mode 100644 ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex new file mode 100644 index 0000000000..3c5fc95be1 --- /dev/null +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex @@ -0,0 +1,9742 @@ +:020000040000FA +:1000000000040020810A000015070000610A0000BA +:100010001F07000029070000330700000000000050 +:10002000000000000000000000000000A50A000021 +:100030003D070000000000004707000051070000D6 +:100040005B070000650700006F07000079070000EC +:10005000830700008D07000097070000A10700003C +:10006000AB070000B5070000BF070000C90700008C +:10007000D3070000DD070000E7070000F1070000DC +:10008000FB070000050800000F0800001908000029 +:10009000230800002D080000370800004108000078 +:1000A0004B080000550800005F08000069080000C8 +:1000B000730800007D080000870800009108000018 +:1000C0009B080000A5080000AF080000B908000068 +:1000D000C3080000CD080000D7080000E1080000B8 +:1000E000EB080000F5080000FF0800000909000007 +:1000F000130900001D090000270900003109000054 +:100100003B0900001FB500F003F88DE80F001FBD8C +:1001100000F0ACBC40F6FC7108684FF01022401CA7 +:1001200008D00868401C09D00868401C04D0086842 +:1001300000F037BA9069F5E79069F9E7704770B554 +:100140000B46010B184400F6FF70040B4FF0805073 +:100150000022090303692403406943431D1B104621 +:1001600000F048FA29462046BDE8704000F042BA47 +:10017000F0B54FF6FF734FF4B4751A466E1E11E0DA +:10018000A94201D3344600E00C46091B30F8027B3B +:10019000641E3B441A44F9D19CB204EB134394B25D +:1001A00004EB12420029EBD198B200EB134002EBB2 +:1001B000124140EA0140F0BDF34992B00446D1E952 +:1001C0000001CDE91001FF224021684600F0F4FB58 +:1001D00094E80F008DE80F00684610A902E004C8FB +:1001E00041F8042D8842FAD110216846FFF7C0FF7C +:1001F0001090AA208DF8440000F099F9FFF78AFFCB +:1002000040F6FC7420684FF01025401C0FD0206889 +:1002100010226946803000F078F92068401C08D030 +:100220002068082210A900F070F900F061F9A869AF +:10023000EEE7A869F5E74FF080500369406940F6A2 +:10024000FC71434308684FF01022401C06D0086838 +:1002500000F58050834203D2092070479069F7E788 +:100260000868401C04D00868401C03D00020704778 +:100270009069F9E70420704770B504460068C34DE3 +:10028000072876D2DFE800F033041929631E250021 +:10029000D4E9026564682946304600F062F92A46CE +:1002A0002146304600F031F9AA002146304600F0E0 +:1002B00057FB002800D0032070BD00F009FC4FF46C +:1002C000805007E0201D00F040F90028F4D100F034 +:1002D000FFFB60682860002070BD241D94E80700C3 +:1002E000920000F03DFB0028F6D00E2070BDFFF715 +:1002F000A2FF0028FAD1D4E901034FF0805100EBAE +:10030000830208694D69684382420ED840F6F8704E +:1003100005684FF010226D1C09D0056805EB8305B8 +:100320000B6949694B439D4203D9092070BD55694A +:10033000F4E70168491C03D00068401C02D003E0C8 +:100340005069FAE70F2070BD2046FFF735FFFFF731 +:1003500072FF0028F7D1201D00F0F7F80028F2D135 +:1003600060680028F0D100F0E2F8FFF7D3FE00F05B +:10037000BFF8072070BD10B50C46182802D0012028 +:10038000086010BD2068FFF777FF206010BD41684E +:10039000054609B1012700E0002740F6F8742068FF +:1003A0004FF01026401C2BD02068AA68920000F065 +:1003B000D7FA38B3A86881002068401C27D020688D +:1003C000FFF7BDFED7B12068401C22D026684FF051 +:1003D0008050AC686D68016942695143A9420DD9EA +:1003E000016940694143A14208D92146304600F0E5 +:1003F000B8F822462946304600F087F800F078F831 +:100400007069D2E700F093F8FFF784FEF6E77069B1 +:10041000D6E77669DBE740F6FC7420684FF01026DB +:10042000401C23D02068401C0CD02068401C1FD0EA +:100430002568206805F18005401C1BD027683879A5 +:10044000AA2819D040F6F8700168491C42D001680A +:10045000491C45D00168491C3ED001680968491C07 +:100460003ED00168491C39D000683EE0B069DAE747 +:10047000B569DEE7B769E2E710212846FFF778FEA5 +:100480003968814222D12068401C05D0D4F8001080 +:1004900001F18002C03107E0B169F9E730B108CA63 +:1004A00051F8040D984201D1012000E000208A4259 +:1004B000F4D158B1286810B1042803D0FEE72846CB +:1004C000FFF765FF3149686808600EE0FFF722FE1C +:1004D00000F00EF87169BBE77169BFE7706904E06D +:1004E0004FF480500168491C01D000F0CBFAFEE7C0 +:1004F000BFF34F8F26480168264A01F4E06111439B +:100500000160BFF34F8F00BFFDE72DE9F0411746B3 +:100510000D460646002406E03046296800F054F8EF +:10052000641C2D1D361DBC42F6D3BDE8F08140F69B +:10053000FC700168491C04D0D0F800004FF48051D1 +:10054000FDE54FF010208069F8E74FF080510A690F +:10055000496900684A43824201D810207047002050 +:10056000704770B50C4605464FF4806608E0284693 +:1005700000F017F8B44205D3A4F5806405F5805562 +:10058000002CF4D170BD0000F40A0000000000202F +:100590000CED00E00400FA05144801680029FCD0C5 +:1005A0007047134A0221116010490B68002BFCD0E0 +:1005B0000F4B1B1D186008680028FCD0002010603D +:1005C00008680028FCD07047094B10B501221A605A +:1005D000064A1468002CFCD0016010680028FCD08A +:1005E0000020186010680028FCD010BD00E4014015 +:1005F00004E5014070B50C46054600F073F810B9EB +:1006000000F07EF828B121462846BDE8704000F091 +:1006100007B821462846BDE8704000F037B8000012 +:100620007FB5002200920192029203920A0B000B06 +:100630006946012302440AE0440900F01F0651F80C +:10064000245003FA06F6354341F82450401C8242F8 +:10065000F2D80D490868009A10430860081D016827 +:10066000019A1143016000F03DF800280AD00649C4 +:1006700010310868029A10430860091D0868039A3F +:10068000104308607FBD00000006004030B50F4CED +:10069000002200BF04EB0213D3F800582DB9D3F8A1 +:1006A000045815B9D3F808581DB1521C082AF1D3C3 +:1006B00030BD082AFCD204EB0212C2F80008C3F8CD +:1006C00004180220C3F8080830BD000000E0014013 +:1006D0004FF08050D0F83001082801D0002070473A +:1006E000012070474FF08050D0F83011062905D016 +:1006F000D0F83001401C01D0002070470120704725 +:100700004FF08050D0F830010A2801D00020704707 +:100710000120704708208F490968095808471020B0 +:100720008C4909680958084714208A4909680958FA +:100730000847182087490968095808473020854923 +:100740000968095808473820824909680958084744 +:100750003C20804909680958084740207D490968BC +:100760000958084744207B49096809580847482028 +:1007700078490968095808474C207649096809589A +:10078000084750207349096809580847542071499F +:1007900009680958084758206E49096809580847E8 +:1007A0005C206C4909680958084760206949096854 +:1007B00009580847642067490968095808476820AC +:1007C00064490968095808476C2062490968095852 +:1007D000084770205F4909680958084774205D4937 +:1007E00009680958084778205A490968095808478C +:1007F0007C205849096809580847802055490968EC +:10080000095808478420534909680958084788202F +:1008100050490968095808478C204E490968095809 +:10082000084790204B4909680958084794204949CE +:10083000096809580847982046490968095808472F +:100840009C204449096809580847A0204149096883 +:1008500009580847A4203F49096809580847A820B3 +:100860003C49096809580847AC203A4909680958C1 +:100870000847B0203749096809580847B420354966 +:10088000096809580847B8203249096809580847D3 +:10089000BC203049096809580847C0202D4909681B +:1008A00009580847C4202B49096809580847C82037 +:1008B0002849096809580847CC2026490968095879 +:1008C0000847D0202349096809580847D4202149FE +:1008D000096809580847D8201E4909680958084777 +:1008E000DC201C49096809580847E02019490968B3 +:1008F00009580847E4201749096809580847E820BB +:100900001449096809580847EC2012490968095830 +:100910000847F0200F49096809580847F4200D4995 +:10092000096809580847F8200A490968095808471A +:10093000FC2008490968095808475FF48070054998 +:10094000096809580847000003480449024A034B54 +:100950007047000000000020000B0000000B0000AA +:1009600040EA010310B59B070FD1042A0DD310C82C +:1009700008C9121F9C42F8D020BA19BA884201D97E +:10098000012010BD4FF0FF3010BD1AB1D30703D0C6 +:10099000521C07E0002010BD10F8013B11F8014B7C +:1009A0001B1B07D110F8013B11F8014B1B1B01D198 +:1009B000921EF1D1184610BD02F0FF0343EA032254 +:1009C00042EA024200F005B87047704770474FF0A6 +:1009D00000020429C0F0128010F0030C00F01B800C +:1009E000CCF1040CBCF1020F18BF00F8012BA8BF1A +:1009F00020F8022BA1EB0C0100F00DB85FEAC17CDE +:100A000024BF00F8012B00F8012B48BF00F8012B90 +:100A100070474FF0000200B51346944696462039C1 +:100A200022BFA0E80C50A0E80C50B1F12001BFF4A7 +:100A3000F7AF090728BFA0E80C5048BF0CC05DF80D +:100A400004EB890028BF40F8042B08BF704748BF5B +:100A500020F8022B11F0804F18BF00F8012B7047CF +:100A6000014B1B68DB6818470000002009480A4951 +:100A70007047FFF7FBFFFFF745FB00BD20BFFDE719 +:100A8000064B1847064A1060016881F308884068E1 +:100A900000470000000B0000000B000017040000DE +:100AA000000000201EF0040F0CBFEFF30881EFF3ED +:100AB0000981886902380078182803D100E0000015 +:100AC000074A1047074A12682C3212681047000084 +:100AD00000B5054B1B68054A9B58984700BD0000B0 +:100AE0007703000000000020F00A0000040000006E +:100AF000001000000000000000FFFFFF0090D00386 +:10100000C8130020415F020075C10000A75E020006 +:1010100075C1000075C1000075C10000000000002E +:10102000000000000000000000000000CD5F020092 +:1010300075C100000000000075C1000075C100000E +:10104000356002003B60020075C1000075C1000000 +:1010500075C1000075C1000075C1000075C10000B8 +:101060004160020075C1000075C1000047600200C8 +:1010700075C100004D60020053600200596002001B +:1010800075C1000075C1000075C1000075C1000088 +:1010900075C1000075C1000075C1000075C1000078 +:1010A00075C100005F60020075C1000075C10000DD +:1010B00075C1000075C1000075C1000075C1000058 +:1010C0006560020075C1000075C1000075C10000B7 +:1010D00075C1000075C1000075C1000075C1000038 +:1010E00075C1000075C1000075C1000075C1000028 +:1010F00075C1000075C1000075C1000075C1000018 +:1011000075C1000075C1000000F002F824F007FF6F +:101110000AA090E8000C82448344AAF10107DA4552 +:1011200001D124F0FCFEAFF2090EBAE80F0013F073 +:10113000010F18BFFB1A43F00103184708540200BF +:10114000285402000A444FF0000C10F8013B13F041 +:10115000070408BF10F8014B1D1108BF10F8015B10 +:10116000641E05D010F8016B641E01F8016BF9D103 +:1011700013F0080F1EBF10F8014BAD1C0C1B09D15A +:101180006D1E58BF01F801CBFAD505E014F8016BCC +:1011900001F8016B6D1EF9D59142D6D3704700005E +:1011A0000023002400250026103A28BF78C1FBD870 +:1011B000520728BF30C148BF0B6070471FB500F011 +:1011C00003F88DE80F001FBD24F0A6BE70B51A4CC1 +:1011D00005460A202070A01C00F0D5F85920A080F8 +:1011E00029462046BDE8704008F09AB908F0A3B936 +:1011F00070B50C461149097829B1A0F160015E294A +:1012000008D3012013E0602804D0692802D043F2FB +:1012100001000CE020CC0A4E94E80E0006EB8000A2 +:10122000A0F58050241FD0F8806E2846B04720607B +:1012300070BD012070470000080000201800002049 +:10124000B06002003249884201D20120704700207C +:10125000704770B50446A0F500002E4EB0F1786FCF +:1012600002D23444A4F500042948844201D2012565 +:1012700000E0002500F043F848B125B9B44204D39A +:101280002548006808E0012070BD002070BD002DD9 +:10129000F9D1B442F9D321488442F6D2F3E710B52C +:1012A0000446A0F50000B0F1786F03D21948044459 +:1012B000A4F5000400F023F84FF0804130B1164847 +:1012C000006804E08C4204D2012003E01348844209 +:1012D000F8D2002080F0010010BD10B520B1FFF75A +:1012E000DEFF08B1012010BD002010BD10B520B1F7 +:1012F000FFF7AFFF08B1012010BD002010BD084866 +:1013000008490068884201D10120704700207047D9 +:1013100000700200000000201C00002008000020D7 +:1013200058000020BEBAFECA10B5044600210120B4 +:1013300000F041F800210B2000F03DF800210820CA +:1013400000F039F80421192000F035F804210D20AF +:1013500000F031F804210E2000F02DF804210F20B8 +:1013600000F029F80421C84300F025F806211620D2 +:1013700000F021F80621152000F01DF82046FFF7A7 +:1013800025FF002010BDCA2101807047FFF72EBF46 +:101390001148704710487047104A10B514680F4B39 +:1013A0000F4A08331A60FFF723FF0C48001D046042 +:1013B00010BD704770474907090E002804DB00F193 +:1013C000E02080F80014704700F00F0000F1E020EA +:1013D00080F8141D7047000003F900421005024018 +:1013E00001000001FD48002101604160018170475A +:1013F0002DE9FF4F93B09B46209F160004460DD069 +:101400001046FFF726FF18B1102017B0BDE8F08F87 +:101410003146012001F0D3FE0028F6D101258DF8D8 +:1014200042504FF4C050ADF84000002210A92846A9 +:1014300006F0D8FC0028E8D18DF84250A8464FF4B9 +:1014400028500025ADF840001C2229466846079523 +:101450000DF015F89DF81C000DF11C0A20F00F008E +:10146000401C20F0F00010308DF81C0020788DF822 +:101470001D0061789DF81E000DF1400961F34200E6 +:1014800040F001008DF81E009DF8000008AA40F011 +:1014900002008DF800002089ADF83000ADF8325020 +:1014A0006089ADF83400CDF82CA060680E900AA9D0 +:1014B000CDF82890684606F08AFA0028A5D1606821 +:1014C000FFF70BFF40B16068FFF710FF20B96078AD +:1014D00000F00300022801D0012000E00020BF4CF2 +:1014E00008AA0AA92072BDF8200020808DF8428049 +:1014F00042F60120ADF840009DF81E0020F00600E5 +:10150000801C20F001008DF81E000220ADF8300094 +:10151000ADF8340014A80E90684606F058FA00287A +:1015200089D1BDF82000608036B1211D304600F021 +:101530005FF90028C2D109E0BBF1000F05D00CF023 +:1015400019FDE8BB0CF016FDD0BBA58017B1012F2B +:1015500043D04AE08DF8428042F6A620ADF8400024 +:1015600046461C220021684607950CF088FF9DF82E +:101570001C00ADF8346020F00F00401C20F0F0009B +:1015800010308DF81C009DF81D0020F0FF008DF834 +:101590001D009DF81E0020F0060040F00100801C98 +:1015A0008DF81E009DF800008DF8446040F00200A8 +:1015B0008DF80000CDE90A9AADF8306011A800E07E +:1015C00011E00E9008AA0AA9684606F000FA002861 +:1015D000A6D1BDF82000E08008E00CF0CBFC10B9EB +:1015E0000CF0C8FC08B103200FE7E58000200CE7F1 +:1015F0003EB50446794D0820ADF80000A88828B112 +:101600002046FFF726FE18B110203EBD06203EBD45 +:101610002146012001F0D3FD0028F8D12088ADF843 +:1016200004006088ADF80600A088ADF80800E088E6 +:10163000ADF80A00A88801AB6A46002106F0CEFD8D +:10164000BDF800100829E2D003203EBD7FB5634DF0 +:101650000446A88868B1002002900820ADF8080070 +:10166000CDF80CD02046FFF7F4FD20B1102004B0D7 +:1016700070BD0620FBE7A98802AA4FF6FF7006F0AE +:10168000EFFF0028F3D1BDF80810082901D003208E +:10169000EDE7BDF800102180BDF802106180BDF8B3 +:1016A0000410A180BDF80610E180E0E701B582B02A +:1016B0000220ADF80000494802AB6A46408800218C +:1016C00006F08CFDBDF80010022900D003200EBDED +:1016D0001CB5002100910221ADF800100190FFF728 +:1016E000DEFD08B110201CBD3C486A4641884FF61B +:1016F000FF7006F0B5FFBDF800100229F3D00320FB +:101700001CBDFEB5354C06461546207A0F46C0076F +:1017100005D00846FFF79DFD18B11020FEBD0F2033 +:10172000FEBDF82D01D90C20FEBD3046FFF791FD1E +:1017300018BB208801A905F04CFE0028F4D13078B0 +:101740008DF80500208801A906F026FD0028EBD1C0 +:1017500000909DF800009DF8051040F002008DF803 +:101760000000090703D040F008008DF80000208831 +:10177000694606F0AEFC0028D6D1ADF808502088A6 +:101780003B4602AA002106F029FDBDF80810A94237 +:10179000CAD00320FEBD7CB5054600200090019014 +:1017A0000888ADF800000C4628460195FFF795FD26 +:1017B00018B92046FFF773FD08B110207CBD15B1A4 +:1017C000BDF8000060B105486A4601884FF6FF7019 +:1017D00006F046FFBDF8001021807CBD28020020E5 +:1017E0000C20FAE72F48C088002800D0012070475D +:1017F00030B5044693B000200D46014600901422F7 +:1018000001A80CF03CFE1C22002108A80CF037FEB9 +:101810009DF80000CDF808D020F00F00401C20F00B +:10182000F00010308DF800009DF8010006AA20F0AD +:10183000FF008DF801009DF8200001A940F0020092 +:101840008DF8200001208DF8460042F60420ADF806 +:10185000440011A801902088ADF83C006088ADF8E4 +:101860003E00A088ADF84000E088ADF842009DF849 +:10187000020020F00600801C20F001008DF802001C +:101880000820ADF80C00ADF810000FA8059008A8CE +:1018900006F09DF8002803D1BDF81800288000202C +:1018A00013B030BD28020020F0B5007B059F1E4616 +:1018B00014460D46012800D0FFDF0C2030803A206E +:1018C0003880002C08D0287A032806D0287B0128ED +:1018D00000D0FFDF17206081F0BDA889FBE72DE96C +:1018E000F04786B0144691F80C900E9A0D46B9F167 +:1018F000010F0BD01021007B2E8A8846052807D0C7 +:10190000062833D0FFDF06B0BDE8F0870221F2E7FA +:10191000E8890C2100EB400001EB400018803320E7 +:101920001080002CEFD0E889608100271AE0009633 +:10193000688808F1020301AA696900F086FF06EBD6 +:101940000800801C07EB470186B204EB4102BDF89A +:10195000040090810DF1060140460E3213F096F816 +:101960007F1CBFB26089B842E1D8CCE73420108038 +:10197000E889B9F1010F11D0122148430E301880C7 +:10198000002CC0D0E88960814846B9F1010F00D031 +:101990000220207300270DF1040A1FE00621ECE766 +:1019A0000096688808F1020301AA696900F04DFFFA +:1019B00006EB0800801C86B2B9F1010F12D007EBCC +:1019C000C70004EB4000BDF80410C18110220AF1E9 +:1019D000020110300CF029FD7F1CBFB26089B842B3 +:1019E000DED890E707EB470104EB4102BDF80400A5 +:1019F000D0810AF102014046103213F047F8EBE7BC +:101A00002DE9F0470E4688B090F80CC096F80C808F +:101A1000378AF5890C20109902F10C044FF0000A66 +:101A2000BCF1030F08D0BCF1040F3FD0BCF1070F8D +:101A30007ED0FFDF08B067E705EB850C00EB4C00BC +:101A4000188031200880002AF4D0A8F1060000F0A8 +:101A5000FF09558126E01622002101A80CF00FFD98 +:101A600000977088434601AA716900F0EEFEBDF848 +:101A700004002080BDF80600E080BDF80800208149 +:101A8000A21C0DF10A01484613F000F8B9F1000F4D +:101A900000D018B184F804A0A4F802A007EB080055 +:101AA00087B20A346D1EADB2D5D2C3E705EB850C03 +:101AB00000EB4C00188032200880002ABAD0A8F130 +:101AC000050000F0FF09558137E000977088434614 +:101AD00001AA716900F0B9FE9DF80600BDF8041076 +:101AE000E1802179420860F3000162F3410182083C +:101AF00062F38201C20862F3C301020962F30411B6 +:101B0000420962F34511820962F386112171C0090D +:101B10006071BDF80700208122460DF10901484699 +:101B200012F0B4FF18B184F802A0A4F800A000E0FD +:101B300007E007EB080087B20A346D1EADB2C4D2CD +:101B400078E7A8F1020084B205FB08F000F10E0C62 +:101B5000A3F800C035230B80002AA6D055819481BC +:101B6000009783B270880E32716900F06EFE61E7F3 +:101B70002DE9F84F1E460A9D0C4681462AB1607A2F +:101B800000F58070D080E089108199F80C000C2756 +:101B90004FF000084FF00E0A0D2872D2DFE800F077 +:101BA0009D070E1B272F374554697272720021461C +:101BB00048460095FFF778FEBDE8F88F207B9146F8 +:101BC000082802D0032800D0FFDF3780302009E04A +:101BD000A9F80A80F0E7207B9146042800D0FFDFB7 +:101BE000378031202880B9F1000FF1D1E4E7207B64 +:101BF0009146042800D0FFDF37803220F2E7207BB7 +:101C00009146022800D0FFDF37803320EAE7207BAF +:101C10001746022800D0FFDF3420A6F800A0288055 +:101C2000002FC9D0A7F80A80C6E7207B17460428F2 +:101C300000D0FFDF3520A6F800A02880002FBBD001 +:101C40004046A7F80A8012E0207B1746052802D0FC +:101C5000062800D0FFDF1020308036202880002F9B +:101C6000AAD0E0897881A7F80E80B9F80E00B88173 +:101C7000A2E7207B9146072800D0FFDF378037207E +:101C8000B0E72AE04FF0120018804FF0380017003C +:101C9000288091D0E0897881A7F80E80A7F810807D +:101CA00099F80C000A2805D00B2809D00C280DD073 +:101CB000FFDF81E7207B0A2800D0FFDF01200AE058 +:101CC000207B0B2800D0FFDF042004E0207B0C28C1 +:101CD00000D0FFDF052038736EE7FFDF6CE770B5DB +:101CE0000C46054601F0AFFB20B10078222804D253 +:101CF000082070BD43F2020070BD0521284611F096 +:101D00002DF9206008B1002070BD032070BD30B4F3 +:101D10004880087820F00F00C01C20F0F0009030C0 +:101D200001F8080B1DCA81E81D0030BC07F079BC22 +:101D30002DE9FF4784B00027824602970798904616 +:101D4000894612300AF067FA401D20F00306079812 +:101D500028B907A95046FFF7C2FF002854D1B9F1AE +:101D6000000F05D00798017B19BB052504681BE00F +:101D700098F80000092803D00D2812D0FFDF46E0B4 +:101D8000079903254868B0B3497B42887143914263 +:101D900039D98AB2B3B2011D10F053FF044607804F +:101DA00002E0079C042508340CB1208810B1032DF3 +:101DB00029D02CE00798012112300AF05EFAADF824 +:101DC0000C00024602AB2946504608F0B6FA07005E +:101DD00001D1A01C029007983A461230C8F80400BE +:101DE000A8F802A003A94046029B0AF053FAD8B112 +:101DF0000A2817D200E006E0DFE800F00709141413 +:101E0000100B0D141412132014E6002012E61120FA +:101E100010E608200EE643F203000BE6072009E671 +:101E20000D2007E6032005E6BDF80C002346CDE9AA +:101E300000702A465046079900F017FD57B9032D48 +:101E400008D10798B3B2417B406871438AB2011D43 +:101E500010F00BFFB9F1000FD7D0079981F80C9063 +:101E6000D3E72DE9FE4F91461A881C468A468046E4 +:101E7000FAB102AB494608F060FA050019D04046B5 +:101E8000A61C278811F0AFF93246072629463B46A3 +:101E9000009610F0BCFD20882346CDE900504A464C +:101EA0005146404600F0E1FC002020800120BDE8C2 +:101EB000FE8F0020FBE710B586B01C46AAB10423B4 +:101EC0008DF800301388ADF808305288ADF80A203C +:101ED0008A788DF80E200988ADF80C1000236A4628 +:101EE0002146FFF725FF06B010BD1020FBE770B5B7 +:101EF0000D46052111F032F8040000D1FFDF29461C +:101F000004F11200BDE870400AF0A0B92DE9F843D1 +:101F10000D468046002607F081FB044628781028ED +:101F200078D2DFE800F0773B345331311231313170 +:101F30000831313131312879001FC0B2022801D077 +:101F4000102810D114BBFFDF35E004B9FFDF0521F5 +:101F5000404611F003F8007B032806D004280BD07C +:101F6000072828D0FFDF072655E02879801FC0B258 +:101F7000022820D050B1F6E72879401FC0B20228CD +:101F800019D0102817D0EEE704B9FFDF13E004B929 +:101F9000FFDF287901280ED1172137E005214046BF +:101FA00010F0DCFF070000D1FFDF07F1120140460F +:101FB0000AF029F92CB12A4621464046FFF7A7FE30 +:101FC00029E01321404602F025FD24E004B9FFDF9B +:101FD0000521404610F0C2FF060000D1FFDF694630 +:101FE00006F112000AF019F9060000D0FFDFA988F7 +:101FF000172901D2172200E00A46BDF800008242EC +:1020000002D9014602E005E01729C5D3404600F099 +:102010003CFCD0E7FFDF3046BDE8F883401D20F0F0 +:10202000030219B102FB01F0001D00E00020104482 +:10203000704713B5009848B10024684610F0ABFD16 +:10204000002C02D1F74A009911601CBD0124002028 +:10205000F4E72DE9F0470C461546242200212046DE +:102060000CF00DFA05B9FFDFA87860732888DFF857 +:10207000B4A3401D20F00301AF788946DAF80000D0 +:1020800010F0A7FD060000D1FFDF4FF0000826602A +:10209000A6F8008077B109FB07F1091D0AD0DAF82C +:1020A000000010F096FD060000D1FFDF6660C6F864 +:1020B000008001E0C4F80480298804F11200BDE822 +:1020C000F0470AF091B82DE9F047804601F112007F +:1020D0000D4681460AF09FF8401DD24F20F00302C2 +:1020E0006E7B14462968386810F09EFD3EB104FBF3 +:1020F00006F2121D03D06968386810F095FD0520BE +:1021000010F0D4FE0446052010F0D8FE201A012855 +:1021100002D1386810F052FD49464046BDE8F0470C +:102120000AF078B870B50546052110F017FF0400D5 +:1021300000D1FFDF04F112012846BDE870400AF02B +:1021400062B82DE9F04F91B04FF0000BADF834B00C +:10215000ADF804B047880C4605469246052138463E +:1021600010F0FCFE060000D1FFDF24B1A780A4F828 +:1021700006B0A4F808B0297809220B20B2EB111F91 +:102180007ED12A7A04F1100138274FF00C084FF065 +:1021900001090391102A74D2DFE802F073F3F2F11F +:1021A0008008D3898EA03DDCF4EFB7B7307B0228DE +:1021B00000D0FFDFA88908EBC001ADF80410302182 +:1021C000ADF83410002C25D06081B5F80E900027B2 +:1021D0001DE004EBC708317C88F80E10F189A8F8DF +:1021E0000C10CDF800906888042304AA296900F037 +:1021F0002CFBBDF81010A8F8101009F10400BDF870 +:1022000012107F1C1FFA80F9A8F81210BFB2608963 +:10221000B842DED80EE1307B022800D0FFDFE9892A +:1022200008EBC100ADF804003020ADF83400287B85 +:102230000A90001FC0B20F90002CEBD06181B5F85E +:102240001090002726E000BFCDF8009068886969EB +:1022500003AA0A9B00F0F9FA0A9804EBC70848445D +:102260001FFA80F908F10C0204A90F9812F00EFC75 +:1022700018B188F80EB0A8F80CB0BDF80C1001E049 +:10228000D4E0D1E0A8F81010BDF80E107F1CA8F81B +:102290001210BFB26089B842D6D8CBE00DA800902A +:1022A00001AB224629463046FFF719FBC2E0307BDE +:1022B000082805D0FFDF03E0307B082800D0FFDFCF +:1022C000E8891030ADF804003620ADF83400002C59 +:1022D0003FD0A9896181F189A18127E0307B09285C +:1022E00000D0FFDFA88900F10C01ADF80410372100 +:1022F000ADF83410002C2CD06081E8890090AB89B7 +:10230000688804F10C02296956E0E8893921103007 +:1023100080B2ADF80400ADF83410002C74D0A98957 +:102320006181287A0E280AD002212173E989E1818E +:10233000288A0090EB8968886969039A3CE001214A +:10234000F3E70DA8009001AB224629463046FFF77F +:1023500057FB6FE0307B0A2800D0FFDF1220ADF87A +:102360000400ADF834704CB3A9896181A4F810B0B1 +:10237000A4F80EB084F80C905CE020E002E031E0BC +:1023800039E042E0307B0B2800D0FFDF288AADF82F +:1023900034701230ADF8040084B104212173A9898E +:1023A0006181E989E181298A2182688A00902B8AEA +:1023B000688804F11202696900F047FA3AE0307B5C +:1023C0000C2800D0FFDF1220ADF80400ADF8347007 +:1023D0003CB305212173A4F80AB0A4F80EB0A4F808 +:1023E00010B027E00DA8009001AB224629463046E8 +:1023F000FFF75AFA1EE00DA8009001AB22462946CD +:102400003046FFF7B5FB15E034E03B21ADF80400A2 +:10241000ADF8341074B3A4F80690A4F808B084F8AA +:102420000AB007E010000020FFDF03E0297A01294D +:1024300017D0FFDFBDF80400AAF800006CB1BDF8AA +:1024400034002080BDF804006080BDF834003928D5 +:1024500003D03C2801D086F80CB011B00020BDE8B4 +:10246000F08F3C21ADF80400ADF8341014B1697A56 +:10247000A172DFE7AAF80000EFE72DE9F8435688DC +:102480000F46804615460521304610F067FD0400D2 +:1024900000D1FFDF123400943B46414630466A6863 +:1024A0000AF02CF8B8E570B50D46052110F056FD80 +:1024B000040000D1FFDF294604F11200BDE870409E +:1024C00009F0B6BE70B50D46052110F047FD0400B9 +:1024D00000D1FFDF294604F11200BDE8704009F089 +:1024E000D4BE70B50546052110F038FD040000D1BA +:1024F000FFDF04F1080321462846BDE870400422AE +:10250000AFE470B50546052110F028FD040000D1A8 +:10251000FFDF214628462368BDE870400522A0E47D +:1025200070B50646052110F019FD040000D1FFDF4B +:1025300004F1120009F06FFE401D20F0030511E0C8 +:10254000011D00880322431821463046FFF789FC0D +:1025500000280BD0607BABB2684382B26068011D7B +:1025600010F0B9FB606841880029E9D170BD70B5F1 +:102570000E46054607F052F8040000D1FFDF0120A7 +:10258000207266726580207820F00F00C01C20F059 +:10259000F00030302070BDE8704007F042B82DE9FF +:1025A000F0438BB00D461446814606A9FFF797FB12 +:1025B000002814D14FF6FF7601274FF420588CB134 +:1025C00003208DF800001020ADF8100007A805903A +:1025D00007AA204604A912F078FA78B107200BB0B8 +:1025E000BDE8F0830820ADF808508DF80E708DF826 +:1025F0000000ADF80A60ADF80C800CE00698A178F8 +:1026000001742188C1818DF80E70ADF80850ADF8C5 +:102610000C80ADF80A606A4602214846069BFFF727 +:1026200087FBDCE708B501228DF8022042F60202A2 +:10263000ADF800200A4603236946FFF73CFC08BDBD +:1026400008B501228DF8022042F60302ADF8002001 +:102650000A4604236946FFF72EFC08BD00B587B083 +:1026600079B102228DF800200A88ADF80820498847 +:10267000ADF80A1000236A460521FFF759FB07B0A1 +:1026800000BD1020FBE709B1072314E407207047C1 +:1026900070B588B00D461446064606A9FFF71FFB25 +:1026A00000280ED17CB10620ADF808508DF800004E +:1026B000ADF80A40069B6A460821DC813046FFF7E8 +:1026C00037FB08B070BD05208DF80000ADF808504C +:1026D000F0E700B587B059B107238DF80030ADF8A9 +:1026E0000820039100236A460921FFF721FBC6E772 +:1026F0001020C4E770B588B00C460646002506A930 +:10270000FFF7EDFA0028DCD106980121123009F01C +:10271000B4FD9CB12178062921D2DFE801F0200523 +:1027200005160318801E80B2C01EE28880B20AB16E +:10273000A3681BB1824203D90C20C2E71020C0E776 +:10274000042904D0A08850B901E00620B9E7012986 +:1027500013D0022905D004291CD005292AD007202E +:10276000AFE709208DF800006088ADF80800E08828 +:10277000ADF80A00A068039023E00A208DF800005D +:102780006088ADF80800E088ADF80A00A0680A2566 +:10279000039016E00B208DF800006088ADF808006B +:1027A000A088ADF80A00E088ADF80C00A0680B2501 +:1027B000049006E00C208DF8000060788DF8080089 +:1027C0000C256A4629463046069BFFF7B1FA78E7A2 +:1027D00000B587B00D228DF80020ADF80810002359 +:1027E0006A461946FFF7A4FA49E700B587B071B108 +:1027F00002228DF800200A88ADF808204988ADF83B +:102800000A1000236A460621FFF792FA37E71020E4 +:1028100035E770B586B0064601200D46ADF80810C4 +:102820008DF80000014600236A463046FFF780FA23 +:10283000040008D12946304605F0EAFC0021304664 +:1028400005F004FD204606B070BDF8B51C461546DF +:102850000E46069F10F0B5FC2346FF1DBCB2314664 +:102860002A46009410F09FF8F8BD30B41146DDE917 +:1028700002423CB1032903D0002330BC08F03BBE28 +:102880000123FAE71A8030BC704770B50C46054644 +:10289000FFF72DFB2146284605F0C9FC2846BDE878 +:1028A0007040012105F0D2BC4FF0E0224FF400400F +:1028B0000021C2F88001BFF34F8FBFF36F8F17481D +:1028C000016001601649900208607047134900B525 +:1028D00000220A600A60124B4FF060721A600028F2 +:1028E00008BF00BD0F4A104BDFF840C001280CD0D4 +:1028F00002281CBFFFDF00BD032008601A604FF4F0 +:10290000000000BFCCF8000000BD022008601A6083 +:102910004FF04070F6E700B5FFDF00BD00F5004066 +:1029200008F50140A802002014F5004004F501401C +:1029300070B50B2000F0BDF9082000F0BAF90021B5 +:102940000B2000F0D4F90021082000F0D0F9F44C5D +:1029500001256560A5600020C4F84001C4F8440169 +:10296000C4F848010B2000F0B5F9082000F0B2F9D6 +:102970000B2000F091F9256070BD10B50B2000F020 +:1029800098F9082000F095F9E5480121416081603F +:10299000E4490A68002AFCD10021C0F84011C0F8BF +:1029A0004411C0F848110B2000F094F9BDE8104024 +:1029B000082000F08FB910B50B2000F08BF9BDE8AE +:1029C0001040082000F086B900B530B1012806D0CB +:1029D000022806D0FFDF002000BDD34800BDD34849 +:1029E00000BDD248001D00BD70B5D1494FF0004078 +:1029F0000860D04DC00BC5F80803CF480024046020 +:102A0000C5F840410820C43500F053F9C5F83C41F1 +:102A1000CA48047070BD08B5C14A002128B1012818 +:102A200011D002281CD0FFDF08BD4FF48030C2F85F +:102A30000803C2F84803BB483C300160C2F84011AB +:102A4000BDE80840D0E74FF40030C2F80803C2F8F0 +:102A50004803B44840300160C2F84411B3480CE068 +:102A60004FF48020C2F80803C2F84803AD48443050 +:102A70000160C2F84811AD48001D0068009008BD13 +:102A800070B516460D460446022800D9FFDF002225 +:102A9000A348012304F110018B4000EB8401C1F82D +:102AA000405526B1C1F84021C0F8043303E0C0F816 +:102AB0000833C1F84021C0F8443370BD2DE9F0411E +:102AC0001D46144630B1012833D0022838D0FFDF2C +:102AD000BDE8F081891E002221F07F411046FFF7FA +:102AE000CFFF012D23D00020944D924F0126687016 +:102AF0003E61914900203C3908600220091D0860B0 +:102B00008D490420303908608B483D34046008202A +:102B10006C6000F0DFF83004C7F80403082000F010 +:102B2000BBF88349F007091F08602E70D0E7012029 +:102B3000DAE7012B02D00022012005E00122FBE7A9 +:102B4000012B04D000220220BDE8F04198E70122C9 +:102B5000F9E774480068704770B500F0D8F8704C19 +:102B60000546D4F840010026012809D1D4F808030D +:102B7000C00305D54FF48030C4F80803C4F84061A1 +:102B8000D4F8440101280CD1D4F80803800308D5F7 +:102B90004FF40030C4F80803C4F84461012012F077 +:102BA0005BFFD4F8480101280CD1D4F80803400396 +:102BB00008D54FF48020C4F80803C4F84861022007 +:102BC00012F04AFF5E48056070BD70B500F09FF8D6 +:102BD0005A4D0446287850B1FFF706FF687818B1BF +:102BE0000020687012F038FF5548046070BD032063 +:102BF000F8E74FF0E0214FF40010C1F800027047F1 +:102C0000152000F067B84B4901200861082000F04A +:102C100061B848494FF47C10C1F80803002002460F +:102C200001EB8003C3F84025C3F84021401CC0B22B +:102C30000628F5D37047410A43F609525143C0F3C1 +:102C4000080010FB02F000F5807001EB5020704787 +:102C500010B5430B48F2376463431B0C5C020C60F5 +:102C6000384C03FB0400384B4CF2F72443435B0D14 +:102C700013FB04F404EB402000F580704012107048 +:102C800008681844086010BD2C48406870472949FE +:102C90000120C1F800027047002809DB00F01F0284 +:102CA000012191404009800000F1E020C0F80011AE +:102CB000704700280DDB00F01F0201219140400900 +:102CC000800000F1E020C0F88011BFF34F8FBFF308 +:102CD0006F8F7047002809DB00F01F02012191402F +:102CE0004009800000F1E020C0F8801270474907D9 +:102CF000090E002804DB00F1E02080F80014704782 +:102D000000F00F0000F1E02080F8141D70470C481F +:102D1000001F00680A4A0D49121D1160704700002B +:102D200000B0004004B500404081004044B1004084 +:102D300008F5014000800040408500403800002038 +:102D400014050240F7C2FFFF6F0C010001000001F3 +:102D50000A4810B50468094909480831086012F0AA +:102D60000FFF0648001D046010BD064900200860E2 +:102D70004FF0E0210220C1F88002704710050240A8 +:102D800001000001FC1F0040374901200860704726 +:102D900070B50D2000F049F8344C0020C4F8000153 +:102DA0000125C4F804530D2000F050F825604FF0C1 +:102DB000E0216014C1F8000170BD10B50D2000F0D5 +:102DC00034F82A48012141600021C0F80011BDE813 +:102DD00010400D2000F03AB8254810B50468244989 +:102DE0002448083108602149D1F80001012804D0A5 +:102DF000FFDF1F48001D046010BD1B48001D006858 +:102E00000022C0B2C1F8002113F0E1FBF1E710B5D8 +:102E1000164800BFD0F800110029FBD0FFF7DCFFF7 +:102E2000BDE810400D2000F011B800280DDB00F0C7 +:102E30001F02012191404009800000F1E020C0F80C +:102E40008011BFF34F8FBFF36F8F7047002809DBEE +:102E500000F01F02012191404009800000F1E020B4 +:102E6000C0F880127047000004D5004000D0004038 +:102E700010050240010000014FF0E0214FF000700A +:102E8000C1F8800101F5C071BFF34F8FBFF36F8FA1 +:102E9000C1F80001394B802283F8002441F8800CEE +:102EA000704700B502460420354903E001EBC0033A +:102EB0001B792BB1401EC0B2F8D2FFDFFF2000BD4E +:102EC00041F8302001EBC00100224A718A710122D1 +:102ED0000A7100BD2A4A002102EBC000017170474F +:102EE00010B50446042800D3FFDF254800EBC404D6 +:102EF0002079012800D0FFDF6079A179401CC0B2A1 +:102F0000814200D060714FF0E0214FF00070C1F8B5 +:102F1000000210BD70B50425194E1A4C16E0217838 +:102F200006EBC1000279012A08D1427983799A42DD +:102F300004D04279827156F8310080472078401CD5 +:102F4000C0B22070042801D3002020706D1EEDB2A5 +:102F5000E5D270BD0C4810B504680B490B48083128 +:102F60000860064890F800044009042800D0FFDFFC +:102F7000FFF7D0FF0448001D046010BD19E000E019 +:102F8000E00500205400002010050240010000016F +:102F90000548064A0168914201D1002101600449B7 +:102FA000012008607047000058000020BEBAFECA29 +:102FB00040E5014070B50C46054609F03BFC214652 +:102FC0002846BDE870400AF01CBD70477047704746 +:102FD0001EF0040F0CBFEFF30880EFF30980014AE5 +:102FE000104700009B6C01000FF20C0000F1000084 +:102FF000694641F8080C20BF704700000004050630 +:103000002CFFFFFFDBE5B15100700200CA00FFFF9B +:103010008C000000C1CF6A00FEA0D9111C1006C3AD +:1030200089CCFC7A7B3B49141906A8C030B5F84D11 +:103030000446062CA9780ED2DFE804F0030E0E0E2B +:103040000509FFDF08E0022906D0FFDF04E00329BD +:1030500002D0FFDF00E0FFDFAC7030BD30B50446CA +:103060001038EB4D07280CD2DFE800F0040C060CFA +:103070000C0C0C00FFDF05E0287E112802D0FFDFDA +:1030800000E0FFDF2C7630BD2DE9F04111F088FE25 +:10309000044613F0BBF8201AC5B206200FF006FF55 +:1030A000044606200FF00AFF211AD94C207E122870 +:1030B00018D000200F1807200FF0F8FE0646072052 +:1030C0000FF0FCFE301A3918207E13280CD0002097 +:1030D0000144A078042809D000200844281AC0B26E +:1030E000BDE8F0810120E5E70120F1E70120F4E7E8 +:1030F000C74810B590F825004108C54800F12600E2 +:1031000005D00DF05BFFBDE8104006F0A9B80DF04A +:1031100036FFF8E730B50446A1F120000D460A2835 +:103120004AD2DFE800F005070C1C2328353A3F445B +:10313000FFDF42E0207820283FD1FFDF3DE0B448A8 +:103140008178052939D0007E122836D020782428AD +:1031500033D0252831D023282FD0FFDF2DE0207851 +:1031600022282AD0232828D8FFDF26E0207822280A +:1031700023D0FFDF21E0207822281ED024281CD075 +:1031800026281AD0272818D0292816D0FFDF14E0C7 +:103190002078252811D0FFDF0FE0207825280CD0DB +:1031A000FFDF0AE02078252807D0FFDF05E0207840 +:1031B000282802D0FFDF00E0FFDF257030BD1FB5FB +:1031C00004466A46002001F0A5FEB4B1BDF8022015 +:1031D0004FF6FF700621824201D1ADF80210BDF812 +:1031E0000420824201D1ADF80410BDF808108142DC +:1031F00003D14FF44860ADF8080068460EF048FB74 +:1032000006F02EF804B010BD70B514460D46064603 +:10321000FEF71FF858B90DB1A54201D90C2070BDB9 +:10322000002408E056F82400FEF713F808B1102037 +:1032300070BD641CE4B2AC42F4D3002070BD2DE933 +:10324000F04105461F4690460E4600240068FEF7F2 +:103250004DF830B9A98828680844401EFEF746F8A2 +:1032600008B110203CE728680028A88802D0B8429E +:1032700002D850E00028F5D0092031E72968085D20 +:10328000B8B1671CCA5D152A2ED03CDC152A3AD28B +:10329000DFE802F03912222228282A2A313139396E +:1032A00039393939393939392200085D30BB641C64 +:1032B000A4B2A242F9D833E00228DDD1A01C085CF8 +:1032C00088F80000072801D2400701D40A2007E748 +:1032D000307840F0010015E0C143C90707E001283C +:1032E00007D010E00620FBE60107A1F1805100297C +:1032F000F5D01846F4E63078810701D50B20EFE6CB +:1033000040F0020030702868005D384484B2A8881C +:10331000A04202D2B0E74FF4485382B2A242ADD8E5 +:103320000020DDE610B5027843F2022354080122A2 +:10333000022C12D003DC3CB1012C16D106E0032C88 +:1033400010D07F2C11D112E0002011E080790324ED +:10335000B4EB901F09D10A700BE08079B2EB901F9B +:1033600003D1F8E780798009F5D0184610BDFF2019 +:103370000870002010BD08B500208DF8000024481A +:1033800090F82E1049B190F82F0002280ED0032893 +:103390000ED0FFDF9DF8000008BD1D4869462530AE +:1033A00001F007FE0028F5D0FFDFF3E7032000E07F +:1033B00001208DF80000EDE738B50C46054669465A +:1033C00001F0F7FD00280DD19DF80010207861F381 +:1033D0004700207055F8010FC4F80100A888A4F830 +:1033E0000500002038BD38B51378A8B1022813D0E5 +:1033F000FF281AD007A46D46246800944C7905EB89 +:103400009414247864F347031370032809D00FE061 +:10341000F40100200302FF0123F0FE0313700228D1 +:10342000F3D1D8B240F0010005E043F0FE00107087 +:10343000107820F0010010700868C2F80100888838 +:10344000A2F8050038BD02210FF088BD38B50C4642 +:103450000978222901D2082038BDADF800008DF886 +:10346000022068460DF0ECFD05F0FAFE050003D1E0 +:1034700021212046FFF74EFE284638BD1CB500200E +:103480008DF80000CDF80100ADF80500FB4890F87C +:103490002E00022801D0012000E000208DF8070056 +:1034A00068460DF055FE002800D0FFDF1CBD00224D +:1034B0000A80437892B263F3451222F040020A80F8 +:1034C00000780C282BD2DFE800F02A06090E11162E +:1034D000191C1F220C2742F0110009E042F01D00C8 +:1034E00008800020704742F0110012E042F0100006 +:1034F00040F00200F4E742F01000F1E742F0010072 +:10350000EEE742F0010004E042F00200E8E742F09A +:10351000020040F00400E3E742F00400E0E7072087 +:1035200070472DE9FF478AB00025BDF82C60824620 +:103530001C4691468DF81C50700703D56068FDF756 +:1035400088FE68B9CD4F4FF0010897F82E0058B1AA +:1035500097F82F00022807D16068FDF7C7FE18B161 +:1035600010200EB0BDE8F087300702D5A089802872 +:103570003ED8700705D4B9F1000F02D097F82400A7 +:10358000A0B3E07DC0F300108DF81B00627D072022 +:10359000032162B3012A2DD0022AE2D0042AE0D10D +:1035A0008DF81710F00628D4A27D07202AB3012A2F +:1035B00023D0022A24D0042AD3D18DF8191000BFB9 +:1035C0008DF81590606810B307A9FFF7ABFE0028CF +:1035D000C7D19DF81C00FF2816D0606850F8011F65 +:1035E000CDF80F108088ADF8130014E000E001E082 +:1035F0000720B6E78DF81780D4E78DF81980DFE74C +:1036000002208DF81900DBE743F20220A9E7CDF88C +:103610000F50ADF81350E07B40B9207C30B9607C8E +:1036200020B9A07C10B9E07CC00601D0062098E744 +:103630008DF800A0BDF82C00ADF80200A068019044 +:10364000A068029004F10F0001F0A7FC8DF80C00B7 +:10365000FFF791FE8DF80D009DF81C008DF80E000F +:103660008DF816508DF81850E07D08A900F00F0075 +:103670008DF81A0068460EF047FA05F0F1FD70E784 +:10368000F0B58FB000258DF830508DF814508DF8BE +:10369000345006468DF828500195029503950495FF +:1036A00019B10FC901AC84E80F00744CA07805284B +:1036B00001D004280CD101986168884200D120B95A +:1036C0000398E168884203D110B108200FB0F0BD23 +:1036D000207DC00601D51F2700E0FF273B460DAA2D +:1036E00005A903A8FFF7ABFD0028EFD1A08AC10709 +:1036F00002D0C00600D4EE273B460AAA0CA901A8B6 +:10370000FFF79DFD0028E1D19DF81400C00701D00E +:103710000A20DBE7A08A410708D4A17D31B19DF8DA +:103720002810890702D043F20120CFE79DF8281026 +:10373000C90709D0400707D4208818B144F2506166 +:10374000884201D90720C1E78DF818508DF819601B +:10375000BDF80800ADF81A000198079006A80EF011 +:10376000DFF905F07DFD0028B0D18DF820508DF8EF +:103770002160BDF81000ADF822000398099008A858 +:103780000EF0F0F905F06CFD00289FD101AD241D6D +:1037900095E80F0084E80F00002097E770B586B029 +:1037A0000D46040005D0FDF7A1FD20B1102006B0A4 +:1037B00070BD0820FBE72078C107A98802D0FF2947 +:1037C00002D303E01F2901D20920F0E7800763D468 +:1037D000FFF75AFC38B12178C1F3C100012804D0A9 +:1037E000032802D005E01320E1E7244890F82400E4 +:1037F000C8B1C8074FF001064FF0000502D08DF8A0 +:103800000F6001E08DF80F50FFF7B5FD8DF8000057 +:1038100020786946C0F3C1008DF8010060788DF80A +:103820000250C20801D00720C1E730B3C20701D05F +:103830008DF80260820705D59DF8022042F0020251 +:103840008DF80220400705D59DF8020040F00400E5 +:103850008DF80200002022780B18C2F38002DA7083 +:1038600001EB40026388D380401CA388C0B253811F +:103870000228F0D3207A78B905E001E0F4010020B5 +:103880008DF80260E6E7607A30B9A07A20B9E07A74 +:1038900010B9207BC00601D0062088E704F108009B +:1038A00001F07BFB8DF80E0068460DF05AFD05F027 +:1038B000D7FC002889D18DF810608DF81150E08870 +:1038C000ADF81200ADF8145004A80DF09DFD05F000 +:1038D000C7FC002888D12078C00701D0152000E05F +:1038E0001320FFF7BBFB002061E72DE9FF47022013 +:1038F000FD4E8DF804000027708EADF80600B84626 +:1039000043F202094CE001A80FF08FFA050006D03F +:10391000708EA8B3A6F83280ADF806803EE0039C16 +:10392000A07F01072DD504F124000090A28EBDF8E0 +:103930000800214604F1360301F0CAFC050005D059 +:103940004D452AD0112D3CD0FFDF3AE0A07F20F07A +:103950000801E07F420862F3C711A177810861F393 +:103960000000E07794F8210000F01F0084F82000A8 +:103970002078282826D129212046FFF7CBFB21E0FB +:1039800014E040070AD5BDF8080004F10E0101F06B +:103990001AFB05000DD04D4510D100257F1CFFB24C +:1039A00002200FF083FA401CB842ACD8052D11D08C +:1039B00008E0A07F20F00400A07703E0112D00D0E4 +:1039C000FFDF0025BDF806007086052D04D02846CF +:1039D00004B0C7E5A6F832800020F9E770B50646C6 +:1039E000FFF731FD054605F019FE040000D1FFDFA9 +:1039F0006680207820F00F00801C20F0F00020303E +:103A000020700320207295F83E006072BDE870407F +:103A100005F007BE2DE9F04786B0040000D1FFDFB6 +:103A20002078B14D20F00F00801C20F0F0007030A5 +:103A3000207060680178491F1B2933D2DFE801F04C +:103A4000FE32323255FD320EFDFD42FC323232780A +:103A5000FCFCFBFA32FCFCF9F8FCFC00C6883046A2 +:103A6000FFF7F1FC0546304607F03BFCE0B160682B +:103A7000007A85F83E0021212846FFF74BFB3046AF +:103A8000FEF750FB304603F0E7FE3146012013F00D +:103A900063F8A87F20F01000A877FFF726FF002822 +:103AA00000D0FFDF06B05DE5207820F0F000203088 +:103AB00020700320207266806068007A607205F0D2 +:103AC000B0FDD8E7C5882846FFF7BDFC00B9FFDF89 +:103AD00060680079012800D0FFDF6068017A06B0D5 +:103AE0002846BDE8F04707F0E1BDC6883046FFF73D +:103AF000AAFC050000D1FFDF05F093FD60683146A8 +:103B00000089288160684089688160688089A8810F +:103B1000012013F021F80020A875A87F00F0030011 +:103B20000228BFD1FFF7E1FE0028BBD0FFDFB9E7D5 +:103B3000007928B10228B5D03C28B3D0FFDFB1E727 +:103B400005F06FFD6668B6F806A0307A361D0128CC +:103B500006D0687E814605F0EFFA070003D101E048 +:103B6000E878F7E7FFDF0022022150460FF0EDF979 +:103B7000040000D1FFDF22212046FFF7CBFA307985 +:103B8000012800D00220A17F804668F30101A177BF +:103B9000308B2081708B6081B08BA08184F8229063 +:103BA0008DF80880B8680090F86801906A46032193 +:103BB00050460FF0CAF900B9FFDFB888ADF8100021 +:103BC000B8788DF8120004AA052150460FF0BDF90F +:103BD00000B9FFDFB888ADF80C00F8788DF80E005A +:103BE00003AA042150460FF0B0F900B9FFDF062107 +:103BF00006F1120001F005FA40B37079800700D594 +:103C0000FFDF7179E07D61F34700E075D6F80600CB +:103C1000A0617089A083062106F10C0001F0F1F982 +:103C2000F0B195F825004108607861F3470006E09F +:103C300041E039E071E059E04EE02FE043E0607090 +:103C4000D5F82600C4F80200688D12E0E07D20F06F +:103C5000FE00801CE075D6F81200A061F08AD9E75A +:103C6000607820F0FE00801C6070F068C4F80200EC +:103C7000308AE080B8F1010F04D0B8F1020F05D00E +:103C8000FFDF0FE70320FFF7D1F90BE7287E1228AB +:103C900000D0FFDF1120FFF7E1F903E706B020466F +:103CA000BDE8F04701F0A0BD05F0BBFC15F8300FF2 +:103CB00040F0020005E005F0B4FC15F8300F40F0CC +:103CC00004002870EEE6287E13280AD01528D8D1E3 +:103CD0005FF01600FFF7C2F906B0BDE8F04705F047 +:103CE000A0BC1420F6E70000F4010020A978052903 +:103CF00009D00429C5D105F094FC022006B0BDE826 +:103D0000F047FFF793B900790028BAD0E87801F0BE +:103D10002BF905F086FC0320F0E7287E122802D15B +:103D2000687E01F021F91120D4E72DE9F05F054606 +:103D300000784FF000080009DFF8B4A891460C465F +:103D4000464601286ED002286DD007280BD00A28DD +:103D50006AD0FFDFA9F8006014B1A4F80080668083 +:103D60000020BDE8F09F6968012704F108000B7886 +:103D70004FF0020B5B1F4FF6FF721B2B7ED2DFE86A +:103D800003F0647D7D7D0E7D7D7D7D7D7D217D7D4E +:103D90007D2BFDFCFBFA7D14D2F9E7F8F700C8880B +:103DA0004FF01208102621469AE14FF01C080A260F +:103DB000BCB38888A0806868807920726868C07900 +:103DC0006072C7E74FF01B08142654B3032020721B +:103DD00068688088A080BDE70A793C2ABAD00D1DAA +:103DE0004FF010082C26E4B16988A180298B6182EC +:103DF000298B2182698BA182A98BE1826B79024692 +:103E0000A91D1846FFF7EFFA2979002001290CD0E7 +:103E100084F80FB0FF212176E06120626062A06229 +:103E200098E70FE03BE15EE199E1E77320760AF164 +:103E3000040090E80E00DAF81000C4E90930C4E983 +:103E4000071287E7A9F800608AE72C264FF01D08C3 +:103E5000002CF7D0A28005460F1D897B008861F3F6 +:103E600000002880B97A490861F341002880B97AB6 +:103E7000890861F382002880B97A00E00CE1C90862 +:103E800061F3C3002880B97AAA1C0911491C61F3A7 +:103E9000041000F07F0028807878B91CFFF7A3FA9F +:103EA000387D05F1090207F11501FFF79CFA387B0F +:103EB00001F0B6F82874787B01F0B2F86874F87EE7 +:103EC000A874787AE874387F2875B87B6875388A62 +:103ED000E882DAF81C10A961B97A504697F808A070 +:103EE000C1F34111012904D0008C504503D2824610 +:103EF00009E0FFDF10E0022903D0288820F06000ED +:103F000009E0504504D1288820F06000403002E0EC +:103F1000288840F060002880A4F824A0524607F1C9 +:103F20001D01A8699BE011264FF02008002C89D0C4 +:103F3000A280686804F10A02007920726868007B38 +:103F4000607269688B1D48791946FFF74CFA01E7E2 +:103F50000A264FF02108002CE9D08888A0806868E4 +:103F6000807920726868C07960729AF8301006E033 +:103F700078E06BE052E07FE019E003E03AE021F006 +:103F80000401A6E00B264FF02208002CCFD0C888F1 +:103F9000A0806868007920726868007A01F040F8B3 +:103FA00060726868407A01F03BF8A072D2E61C2685 +:103FB0004FF02608002CBAD0A28068684079607261 +:103FC0006868007AA0720AF1040090E80E00DAF83E +:103FD0001000C4E90530C4E90312686800793C2880 +:103FE00003D0432803D0FFDFB4E62772B2E684F89B +:103FF00008B0AFE610264FF02408002C97D0888830 +:10400000A0806868807920816868807A60816868AB +:104010000089A08168688089E0819BE610264FF0C6 +:104020002308002C98D08888A0806868C0882081E8 +:1040300068680089608168684089A08168688089B3 +:10404000E0819AF8301021F0020142E030264FF072 +:104050002508002C9AD0A2806968282249680AF0B5 +:10406000E4F977E62A264FF02F08002C8ED0A280A4 +:1040700069682222091DF2E714264FF01B08002C64 +:1040800084D0A280686800790128B0D02772DAE96C +:104090000710C4E903105DE64A46214660E0287A2D +:1040A000012803D0022817D0FFDF53E610264FF077 +:1040B0001F08002CA2D06888A080A8892081E889E8 +:1040C0006081288AA081688AE0819AF8301021F006 +:1040D00001018AF830103DE64FF01208102668887A +:1040E00000F07CFF36E6287AC8B3012838D00228D1 +:1040F00036D0032801D0FFDF2CE609264FF0110847 +:10410000002C8FD06F883846FFF79DF990F822A0D9 +:10411000A780687A2072042138460EF031FF05210D +:1041200038460EF02DFF002138460EF029FF012100 +:1041300038460EF025FF032138460EF021FF0221FC +:1041400038460EF01DFF062138460EF019FF0721F4 +:1041500038460EF015FF504600F006FFFAE5FFE77F +:104160002846BDE8F05F01F0C9BC70B5012803D056 +:10417000052800D0FFDF70BD8DB22846FFF763F938 +:10418000040000D1FFDF20782128F4D005F046FAA2 +:1041900080B1017821F00F01891C21F0F00110316C +:1041A00001700221017245800020A075BDE87040B9 +:1041B00005F037BA21462846BDE870401322FFF7C4 +:1041C00045B92DE9F04116460C00804600D1FFDFCD +:1041D000307820F00F00801C20F0F000103030709C +:1041E0002078012804D0022818D0FFDFBDE8F08134 +:1041F0004046FFF728F9050000D1FFDF0320A8752E +:1042000005F00FFA94E80F00083686E80F00F8482A +:1042100010F8301F41F001010170E7E74046FFF759 +:1042200012F9050000D1FFDFA1884FF6FF700027CB +:10423000814202D1E288824203D0814201D1E088EA +:1042400040B105F0EEF994E80F00083686E80F005B +:10425000AF75CBE7A87D0128C8D17823002241465D +:1042600012F0D0FB0220A875C0E738B505460C4611 +:104270000846FCF7EEFF70BB232D4AD006DC202D4C +:104280000DD0212D23D0222D06D13DE0242D46D066 +:10429000252D32D03F2D47D00725284638BD002197 +:1042A000052012F02FFC08B1112038BDA01C0DF024 +:1042B00042FB04F0D5FF0500EFD100220823114690 +:1042C000052012F09FFB0528E7D0FFDFE5E76068D7 +:1042D000FDF703F808B1102038BD618820886A46D0 +:1042E0000DF0D2FD04F0BCFF0500D6D160680028B7 +:1042F000D3D0BDF800100180CFE7A07800F0010115 +:1043000020880DF0F2FD17E0206801F0A3FE0546BD +:10431000C3E7207800F001000CF024FE0CE0618877 +:1043200020880DF02CFD07E0207800F001008DF8CA +:10433000000068460DF04AF904F092FFE7E770B517 +:1043400005460C460846FCF7AAFF08B1102070BDD0 +:10435000202D07D0212D0DD0222D0BD0252D09D0B9 +:10436000072070BD2088A11C0CF0D0FEBDE8704075 +:1043700004F076BF062070BD9D482530704708B513 +:10438000342200219A480AF07AF80120FEF74EFE06 +:104390001120FEF763FE96496846263105F0D4F8F1 +:1043A00093489DF8002010F8251F62F3470121F083 +:1043B00001010170002141724FF46171A0F80710F2 +:1043C00002218172FEF794FE00B1FFDFFDF70AF8CB +:1043D00001F0D3F908BD10B50C464022002120465B +:1043E0000AF04DF8A07F20F00300A0772020207075 +:1043F0000020A07584F8230010BD70472DE9FC4112 +:104400000746FCF726FF10B11020BDE8FC81784E6E +:1044100006F12501D6F825000090B6F82950ADF830 +:10442000045096F82B408DF806403846FEF7C4FF3E +:104430000028EAD1FEF75CFE0028E6D0009946F895 +:10444000251FB580B471E0E710B50446FCF727FFDF +:1044500008B1102010BD66486549224690F8250035 +:1044600026314008FEF7BFFF002010BD3EB50446D0 +:104470000D460846FCF713FF08B110203EBD14B1ED +:1044800043F204003EBD5A488078052803D0042832 +:1044900001D008203EBD694602A80AF019FC2A4650 +:1044A00069469DF80800FEF79EFF00203EBDFEB560 +:1044B0000D4604004FF0000711D00822FEF7A4FEBD +:1044C000002811D1002608E054F826006946FEF7BE +:1044D00029FF002808D1761CF6B2AE42F4D30CF0C6 +:1044E00088FC10B143F20320FEBD414E86F82470D3 +:1044F0000CB300271BE000BF54F8270002A9FEF709 +:1045000011FF00B1FFDF9DF808008DF8000054F89E +:10451000270050F8011FCDF801108088ADF8050084 +:1045200068460CF08BFC00B1FFDF7F1CFFB2AF428E +:10453000E2D386F824500020FEBD2DE9F0478AB072 +:104540001546894604001FD00F4608222946FEF76B +:104550005BFE002811D1002614E000BF54F82600AD +:104560006946103000F025FD002806D147B157F804 +:104570002600FCF76EFE18B110200AB0BDE8F087E7 +:10458000761CF6B2AE42E9D30026A5F101081BE085 +:1045900006F1010A0AF0FF0712E000BF54F82600F6 +:1045A000017C4A0854F827100B7CB2EB530F05D15D +:1045B00006221130113109F00BFF58B17F1CFFB2F8 +:1045C000AF42EBD30AF0FF064645E1DB4E4624B18D +:1045D000012003E043F20520CFE700200CF053FC5C +:1045E00010B90CF05CFC28B143F20420C5E70000D0 +:1045F000F401002064B300270DF1170826E000BF86 +:1046000054F827006946103000F0D3FC00B1FFDFFA +:1046100054F82700102250F8111FCDF8011080889F +:10462000ADF8050054F827100DF1070009F0FDFE64 +:1046300096B156F827101022404609F0F6FE68465B +:104640000CF0E1FB00B1FFDF7F1CFFB2AF42D7D31C +:10465000FEF714FF002090E7404601F0EFFCEEE784 +:1046600030B585B00446FDF7BDF830B906200EF030 +:104670001DFC10B1062005B030BD2046FCF7E9FD59 +:1046800018B96068FCF732FE08B11020F3E76088C3 +:104690004AF2B811884206D82078F94D28B101288D +:1046A00006D0022804D00720E5E7FEF721FD18E038 +:1046B0006078022804D0032802D043F20220DAE70F +:1046C00085F82F00C1B200200090ADF80400022947 +:1046D0002CD0032927D0FFDF68460CF06FFC04F0D4 +:1046E000BFFD0028C7D1606801F09BFC207858B15D +:1046F00001208DF800000DF1010001F09FFC6846DB +:104700000DF059FC00B1FFDF207885F82E00FEF790 +:10471000B5FE608860B1A88580B20CF0ACFB00B13A +:10472000FFDF0020A7E78DF80500D5E74020FAE776 +:104730004FF46170EFE710B50446FCF7B0FD20B907 +:10474000606838B1FCF7C9FD08B1102010BD606881 +:1047500001F074FCCA4830F82C1F6180C178617088 +:1047600080782070002010BD2DE9F843144689465A +:104770000646FCF794FDA0B94846FCF7B7FD80B9A2 +:104780002046FCF7B3FD60B9BD4DA878012800D1E3 +:104790003CB13178FF2906D049B143F20400BDE8AD +:1047A000F8831020FBE7012801D00420F7E7CCB301 +:1047B000052811D004280FD069462046FEF777FE61 +:1047C0000028ECD1217D49B1012909D0022909D065 +:1047D000032909D00720E2E70820E0E7024604E0C9 +:1047E000012202E0022200E003228046234617460F +:1047F00000200099FEF795FE0028D0D1A0892880DE +:10480000A07BE875BDF80000A882AF75BDF8001068 +:10481000090701D5A18931B1A1892980C00704D038 +:10482000032003E006E08021F7E70220FEF7FEFB0D +:1048300086F800804946BDE8F8430020FEF720BF17 +:104840007CB58F4C05460E46A078022803D003287D +:1048500001D008207CBD15B143F204007CBD0720C7 +:104860000EF02CFB10B9A078032806D0FEF70CFC44 +:1048700028B1A078032804D009E012207CBD1320C1 +:104880007CBD304600F053FB0028F9D1E670FEF7FE +:1048900072FD0AF05AF901208DF800008DF8010030 +:1048A0008DF802502088ADF80400E07D8DF80600F8 +:1048B00068460DF027FA04F0D3FC0028E0D1A07878 +:1048C000032805D05FF00400FEF7B0FB00207CBD9C +:1048D000E07800F03CFB0520F6E71CB510B143F290 +:1048E00004001CBD664CA078042803D0052801D024 +:1048F00008201CBD00208DF8000001218DF801105A +:104900008DF8020068460DF0FDF904F0A9FC0028BE +:10491000EFD1A078052805D05FF00200FEF786FBF6 +:1049200000201CBDE07800F01FFB0320F6E72DE916 +:10493000FC4180460E4603250846FCF7D7FC0028BC +:1049400066D14046FEF77FFD040004D0207822287F +:1049500004D2082059E543F2020056E5A07F00F09A +:1049600003073EB1012F0CD000203146FEF727FC93 +:104970000500EFD1012F06D0022F1AD0FFDF284605 +:1049800043E50120F1E7A07D3146022801D011B1B5 +:1049900007E0112039E56846FCF758FE0028D9D118 +:1049A0006946404606F045FE0500E8D10120A075A5 +:1049B000E5E7A07D032804D1314890F83000C00716 +:1049C00001D02EB30EE026B1A07F40071ED40021F7 +:1049D00000E00121404606F04CFE0500CFD1A07555 +:1049E000002ECCD03146404600F0EDFA05461128A5 +:1049F000C5D1A07F4107C2D4316844F80E1F716849 +:104A0000616040F0040020740025B8E71125B6E786 +:104A10001020FAE470B50C460546FEF714FD0100BF +:104A200005D022462846BDE87040FEF70FBD43F290 +:104A3000020070BD10B5012807D1114B9B78012BE6 +:104A400000D011B143F2040010BD0CF046FABDE8ED +:104A5000104004F005BC012300F090BA00231A4670 +:104A6000194600F08BBA70B506460C460846FCF7AE +:104A7000F0FB18B92068FCF712FC18B1102070BDCB +:104A8000F4010020F84D2A7E112A04D0132A00D305 +:104A90003EB10820F3E721463046FEF77FFE60B1C5 +:104AA000EDE70920132A0DD0142A0BD0A188FF2985 +:104AB000E5D31520FEF7D2FA0020D4E90012C5E9AB +:104AC0000712DCE7A1881F29D9D31320F2E71CB510 +:104AD000E548007E132801D208201CBD00208DF877 +:104AE000000068460CF090FC04F0BAFB0028F4D1FA +:104AF0001120FEF7B3FA00201CBD2DE9F04FDFF8BE +:104B000068A3814691B09AF818009B4615460C465A +:104B1000132803D3FFF7DBFF00281FD12046FCF743 +:104B200098FBE8BB2846FCF794FBC8BB20784FF005 +:104B30000107C0074FF0000102D08DF83A7001E084 +:104B40008DF83A1020788846C0F3C1008DF8000037 +:104B500060788DF80910C10803D0072011B0BDE8B6 +:104B6000F08FB0B3C10701D08DF80970810705D56A +:104B70009DF8091041F002018DF80910400705D594 +:104B80009DF8090040F004008DF809009DF8090027 +:104B9000810703D540F001008DF80900002000E0F6 +:104BA00015E06E4606EB400162884A81401CA288EF +:104BB000C0B20A820328F5D32078C0F3C1000128CF +:104BC00025D0032823D04846FCF743FB28B110200A +:104BD000C4E7FFE78DF80970D8E799F800004008AE +:104BE00008D0012809D0022807D0032805D043F2B5 +:104BF0000220B3E78DF8028001E08DF8027048468C +:104C000050F8011FCDF803108088ADF80700FEF7BB +:104C1000B2FB8DF801000021424606EB41002B88D3 +:104C2000C3826B888383AB884384EB880385491CEC +:104C3000C285C9B282860329EFD3E088ADF83C0073 +:104C400068460CF0B9FC002887D19AF81800554640 +:104C5000112801D0082081E706200EF02FF938B185 +:104C60002078C0F3C100012804D0032802D006E058 +:104C7000122073E795F8240000283FF46EAFFEF78A +:104C800003FA022801D2132068E7584600F04FF9D2 +:104C900000289DD185F819B068460CF0D3FD04F0CA +:104CA000DFFA040094D1687E00F051F91220FEF77B +:104CB000D5F9204652E770B56B4D287E122801D0F9 +:104CC0000820DCE60CF0C1FD04F0CAFA040005D1AE +:104CD000687E00F049F91120FEF7C0F92046CEE6C3 +:104CE00070B5064615460C460846FCF7D8FA18B9C2 +:104CF0002846FCF7D4FA08B11020C0E62A4621461F +:104D000030460DF0A1F804F0ABFA0028F5D1217877 +:104D10007F29F2D10520B2E67CB505460C4608464F +:104D2000FCF797FA08B110207CBD2846FEF78BFBF4 +:104D300020B10078222804D208207CBD43F2020072 +:104D40007CBD494890F83000400701D511207CBD5A +:104D50002078C00802D16078C00801D007207CBD4F +:104D6000ADF8005020788DF8020060788DF80300CF +:104D70000220ADF8040068460BF0A1FE04F070FAC2 +:104D80007CBD70B586B014460D460646FEF75BFB4B +:104D900028B10078222805D2082006B06FE643F239 +:104DA0000200FAE72846FCF7A1FA20B944B12046F0 +:104DB000FCF793FA08B11020EFE700202060A080F4 +:104DC000294890F83000800701D51120E5E703A9B4 +:104DD00030460BF0C4FE10B104F042FADDE7ADF846 +:104DE0000060BDF81400ADF80200BDF81600ADF883 +:104DF0000400BDF81000BDF81210ADF80600ADF8C3 +:104E000008107DB1298809B1ADF80610698809B18B +:104E1000ADF80210A98809B1ADF80810E98809B108 +:104E2000ADF80410DCB1BDF80610814201D9081AB2 +:104E30002080BDF80210BDF81400814201D9081A83 +:104E40006080BDF80800BDF80410BDF816200144CC +:104E5000BDF812001044814201D9081AA0806846AA +:104E60000BF03BFFB8E70000F40100201CB57449CB +:104E70000968CDE9001068460CF0A0FB04F0F0F9D9 +:104E80001CBD1CB500200090019068460CF096FBFC +:104E900004F0E6F91CBD70B505460C460846FCF763 +:104EA000FEF908B11020EAE5214628460CF078F911 +:104EB000BDE8704004F0D4B93EB505460C4608463E +:104EC000FCF7EDF908B110203EBD002000900190E4 +:104ED0000290ADF800502089ADF8080020788DF8D8 +:104EE0000200606801902089ADF808006089ADF883 +:104EF0000A0068460CF066F904F0B2F93EBD0EB542 +:104F0000ADF800000020019068460CF05BF904F059 +:104F1000A7F90EBD10800888508048889080C88806 +:104F200010818888D080002050819081704710B512 +:104F3000044604F001F930B1407830B1204604F065 +:104F400014FC002010BD052010BD122010BD10B5AE +:104F500004F0F2F8040000D1FFDF607800B9FFDF51 +:104F60006078401E607010BD10B504F0E5F80400D4 +:104F700000D1FFDF6078401C607010BD1CB5ADF83B +:104F800000008DF802308DF803108DF8042068467B +:104F90000CF01DFF04F064F91CBD0CB529A2D2E988 +:104FA0000012CDE900120079694601EB501000783B +:104FB0000CBD0278520804D0012A02D043F202202C +:104FC0007047FEF7AFB91FB56A46FFF7A3FF684603 +:104FD0000CF06EFC04F044F904B010BD70B50C0088 +:104FE00006460DD0FEF72FFA050000D1FFDFA680A0 +:104FF00028892081288960816889A081A889E08129 +:105000003DE510B500231A4603E0845C2343521C9F +:10501000D2B28A42F9D30BB1002010BD012010BDDD +:1050200000B540B1012805D0022803D0032804D0E0 +:10503000FFDF002000BDFF2000BD042000BD0000F8 +:1050400024620200070605040302010010B50446AD +:10505000FCF7FFF808B1102010BD2078C0F3021053 +:10506000042807D86078072804D3A178102901D82C +:10507000814201D2072010BDE078410706D4217992 +:105080004A0703D4000701D4080701D5062010BD44 +:10509000002010BD10B513785C08837F64F3C7133C +:1050A000837713789C08C37F64F30003C377107879 +:1050B000C309487863F34100487013781C090B78E2 +:1050C00064F347130B701378DB0863F30000487038 +:1050D0005078487110BD10B5C4780B7864F30003A4 +:1050E0000B70C478640864F341030B70C478A4089F +:1050F00064F382030B70C478E40864F3C3030B7099 +:105100000379117863F30001117003795B0863F38D +:105110004101117003799B0863F3820111700079DA +:10512000C00860F3C301117010BD70B514460D4680 +:10513000064604F073FA80B10178182221F00F01BD +:10514000891C21F0F001A03100F8081B214609F06C +:105150006CF9BDE8704004F064BA29463046BDE8F9 +:1051600070401322FEF772B92DE9F047064608A8F1 +:10517000904690E8300489461F46142200212846B4 +:1051800009F07DF90021CAF80010B8F1000F03D032 +:10519000B9F1000F03D114E03878C00711D02068AE +:1051A000FCF77DF8C0BBB8F1000F07D120681230C2 +:1051B00028602068143068602068A8602168CAF8F8 +:1051C00000103878800724D56068FCF786F818BB93 +:1051D000B9F1000F21D0FFF7CFF80168C6F86811C8 +:1051E0008188A6F86C11807986F86E0101F015FDB2 +:1051F000F94FEF60626862B196F8680106F26911D2 +:1052000040081032FEF7EFF810223946606809F0C6 +:105210000CF90020BDE8F08706E0606820B1E86086 +:105220006068C6F86401F4E71020F3E730B505467E +:1052300008780C4620F00F00401C20F0F0011031DF +:1052400021700020607095F8230030B104280FD041 +:10525000052811D0062814D0FFDF20780121B1EBFA +:10526000101F04D295F8200000F01F00607030BDC0 +:1052700021F0F000203002E021F0F000303020700A +:10528000EBE721F0F0004030F9E7F0B591B00227EC +:1052900015460C4606463A46ADF80870092103ABA0 +:1052A00005F04BF80490002810D004208DF804007D +:1052B0008DF80170E034099605948DF818500AA90C +:1052C00068460FF046FB00B1FFDF012011B0F0BDD2 +:1052D00010B588B00C460A99ADF80000CBB118683B +:1052E000CDF80200D3F80400CDF80600ADF80A208E +:1052F000102203A809F099F868460CF049FB03F066 +:10530000AFFF002803D1A17F41F01001A17708B0C1 +:1053100010BD0020CDF80200E6E72DE9F84F064663 +:10532000808A0D4680B28246FEF78DF804463078BA +:10533000DFF8A48200274FF00209A8F120080F2807 +:1053400070D2DFE800F06FF23708387D8CC8F1F0DA +:10535000EFF35FF3F300A07F00F00300022809D011 +:105360005FF0000080F0010150460DF0F7FD0500F0 +:1053700003D101E00120F5E7FFDF98F85C10C907D1 +:1053800002D0D8F860000BE0032105F11D0011F0F8 +:10539000FCF8D5F81D009149B0FBF1F201FB1200B9 +:1053A000C5F81D0070686867B068A8672078252870 +:1053B00000D0FFDFCAE0A07F00F00300022809D080 +:1053C0005FF0000080F0010150460DF0C7FD0600BF +:1053D00003D101E00120F5E7FFDF3078810702D536 +:1053E0002178252904D040F001003070BDE8F88F05 +:1053F00085F80090307F287106F11D002D36C5E933 +:105400000206F3E7A07F00F00300022808D0002086 +:1054100080F0010150460DF0A1FD040004D102E02E +:105420000120F5E7A7E1FFDF2078C10604D50720BA +:1054300028703D346C60D9E740F008002070D5E753 +:10544000E07F000700D5FFDF307CB28800F0010369 +:1054500001B05046BDE8F04F092106F04CB804B940 +:10546000FFDF716821B1102204F1240008F0DDFF94 +:1054700028212046FDF74EFEA07F00F00300022801 +:105480000ED104F12400002300901A462146504614 +:10549000FFF71EFF112807D029212046FDF73AFE0D +:1054A000307A84F82000A1E7A07F000700D5FFDF55 +:1054B00014F81E0F40F008002070E782A761E76132 +:1054C000C109607861F34100014660F382016170B7 +:1054D000307AE0708AE7A07F00F00300022809D04C +:1054E0005FF0000080F0010150460DF037FD040030 +:1054F00003D101E00120F5E7FFDF022104F185007F +:1055000011F043F80420287004F5B4706860B4F812 +:1055100085002882304810387C346C61C5E90280EF +:1055200064E703E024E15BE02DE015E0A07F00F0FC +:105530000300022807D0002080F0010150460DF042 +:105540000DFD18B901E00120F6E7FFDF32462146E4 +:105550005046BDE8F84FE8E504B9FFDF2078212880 +:10556000A1D93079012803D1E07F40F00800E0772D +:10557000324621465046FFF7D8FD2046BDE8F84F99 +:105580002321FDF7C7BD3279AA8005F1080309215F +:10559000504604F0D2FEE86010B10520287025E7DF +:1055A000A07F00F00300022808D0002080F0010155 +:1055B00050460DF0D3FC040003D101E00120F5E7D3 +:1055C000FFDF04F1620102231022081F0DF04DFBE2 +:1055D00007703179417009E75402002040420F0002 +:1055E000A07F00F00300022808D0002080F0010115 +:1055F00050460DF0B3FC050003D101E00120F5E7B2 +:10560000FFDF95F8840000F0030001287AD1A07F25 +:1056100000F00307E07F10F0010602D0022F04D152 +:1056200033E095F8A000C0072BD0D5F8601121B366 +:1056300095F88320087C62F387000874A17FCA096B +:10564000D5F8601162F341000874D5F8601166F373 +:1056500000000874AEB1D5F86001102204F12401F5 +:10566000883508F0E2FE287E40F001002876287890 +:1056700020F0010005F8880900E016B1022F04D0DF +:105680002DE095F88800C00727D0D5F85C1121B32C +:1056900095F88320087C62F387000874A17FCA090B +:1056A000D5F85C1162F341000874D5F85C1166F31B +:1056B000000008748EB1D5F85C01102204F12401B9 +:1056C000883508F0B2FE287840F0010005F8180B84 +:1056D000287820F0010005F8A009022F44D000200E +:1056E00000EB400005EBC00090F88800800709D56A +:1056F00095F87C00D5F86421400805F17D01103251 +:10570000FDF771FE8DF8009095F884006A4600F070 +:1057100003008DF8010095F888108DF8021095F8B7 +:10572000A0008DF803002146504601F05FFA207872 +:10573000252805D0212807D0FFDF2078222803D98B +:1057400022212046FDF7E6FCA07F00F0030002289E +:105750000CD0002080F0010150460DF011FC002813 +:105760003FF44FAEFFDF41E60120B9E70120F1E74A +:10577000706847703AE6FFDF38E670B5FE4C0025EA +:1057800084F85C5025660FF0B0F804F11001204653 +:1057900003F000FF84F8305070BD70B50D46FDF782 +:1057A00052FE040000D1FFDF4FF4B87200212846FA +:1057B00008F065FE04F124002861A07F00F00300DA +:1057C000022809D05FF0010105F1E0000FF08EF82A +:1057D000002800D0FFDF70BD0221F5E70A46014630 +:1057E00002F1E0000FF0A3B870B50546406886B03E +:1057F00001780A2906D00D2933D00E292FD0FFDFDA +:1058000006B070BD86883046FDF71DFE040000D14D +:10581000FFDF20782128F3D028281BD168680221D7 +:105820000E3001F0D8F9A8B168680821801D01F098 +:10583000D2F978B104F1240130460CF065FA03F096 +:105840000FFD00B1FFDF06B02046BDE87040292102 +:10585000FDF760BC06B0BDE8704003F0E2BE012178 +:1058600001726868C6883046FDF7EDFD040000D17E +:10587000FFDFA07F00F00301022902D120F0100019 +:10588000A077207821280AD06868017A09B10079C8 +:1058900080B1A07F00F00300022862D0FFDFA07F6C +:1058A00000F003000228ABD1FEF71FF80028A7D0B4 +:1058B000FFDFA5E703F0B5FEA17F08062BD5E07F4B +:1058C000C00705D094F8200000F01F00102820D059 +:1058D0005FF0050084F82300207829281DD02428B3 +:1058E000DDD13146042011F037F922212046FDF7A1 +:1058F00011FCA07F00F00300022830D05FF0000010 +:1059000080F0010130460DF03BFB0028C7D0FFDFDF +:10591000C5E70620DEE70420DCE701F003000228EB +:1059200008D0002080F0010130460DF017FB050083 +:1059300003D101E00120F5E7FFDF25212046FDF737 +:10594000E9FB03208DF80000694605F1E0000EF048 +:10595000E5FF0228A3D00028A1D0FFDF9FE70120A8 +:10596000CEE703F05EFE9AE72DE9F04387B0994653 +:10597000164688460746FDF766FD04004BD02078A2 +:10598000222848D3232846D0E07F000743D4A07FB5 +:1059900000F00300022809D05FF0000080F0010150 +:1059A00038460DF0DBFA050002D00CE00120F5E7E7 +:1059B000A07F00F00300022805D001210022384614 +:1059C0000DF0C3FA05466946284601F036F90098FD +:1059D00000B9FFDF45B10098E03505612078222845 +:1059E00006D0242804D007E000990020086103E0D5 +:1059F00025212046FDF78EFB00980121417047626A +:105A0000868001A9C0E902890EF0A3FF022802D016 +:105A1000002800D0FFDF07B0BDE8F08370B586B086 +:105A20000546FDF710FD017822291ED9807F00F080 +:105A30000300022808D0002080F0010128460DF064 +:105A40008DFA04002FD101E00120F5E7FFDF2AE005 +:105A5000B4F85E0004F1620630440178427829B15E +:105A600021462846FFF711FCB0B9C9E6ADF804207D +:105A70000921284602AB04F060FC03900028F4D012 +:105A800005208DF80000694604F1E0000EF046FFA5 +:105A9000022801D000B1FFDF02231022314604F1B9 +:105AA0005E000DF018F9B4F860000028D0D1A7E628 +:105AB00010B586B00446FDF7C6FC017822291BD933 +:105AC000807F00F00300022808D0002080F0010150 +:105AD00020460DF043FA040003D101E00120F5E770 +:105AE000FFDF06208DF80000694604F1E0000EF0AB +:105AF00015FF002800D0FFDF06B010BD2DE9F05FD4 +:105B000005460C4600270078904601093E4604F100 +:105B1000080BBA4602297DD0072902D00A2909D1EB +:105B200046E0686801780A2905D00D2930D00E2991 +:105B30002ED0FFDFBBE114271C26002C6BD0808801 +:105B4000A080FDF780FC5FEA000900D1FFDF99F833 +:105B500017005A46400809F11801FDF744FC68682F +:105B6000C0892082696851F8060FC4F8120048689D +:105B7000C4F81600A07E01E03402002020F00600E8 +:105B800040F00100A07699F81E0040F020014DE0A1 +:105B90001A270A26002CD1D0C088A080FDF753FC1C +:105BA000050000D1FFDF59462846FFF73FFB7EE1A5 +:105BB0000CB1A88BA080287A0B287DD006DC0128A8 +:105BC0007BD0022808D0032804D135E00D2875D0F9 +:105BD0000E2874D0FFDF6AE11E270926002CADD005 +:105BE000A088FDF730FC5FEA000900D1FFDF287BC9 +:105BF00000F003000128207A1BD020F00100207261 +:105C0000297B890861F341002072297BC90861F36F +:105C1000820001E041E1F2E02072297B090961F391 +:105C2000C300207299F81E0040F0400189F81E1050 +:105C30003DE140F00100E2E713270D26002CAAD039 +:105C4000A088FDF700FC8146807F00F00300022859 +:105C500008D0002080F00101A0880DF07FF9050038 +:105C600003D101E00120F5E7FFDF99F81E0000F005 +:105C70000302022A50D0686F817801F003010129E4 +:105C8000217A4BD021F00101217283789B0863F3C4 +:105C9000410121728378DB0863F3820121728378EA +:105CA0001B0963F3C3012172037863F306112172A8 +:105CB000437863F3C71103E061E0A9E090E0A1E05D +:105CC000217284F809A0C178A172022A29D0027930 +:105CD000E17A62F30001E1720279520862F3410154 +:105CE000E1720279920862F38201E1720279D208CC +:105CF00062F3C301E1724279217B62F300012173F7 +:105D00004279520862F3410121734279920862F3A9 +:105D100082012173407928E0A86FADE741F00101CD +:105D2000B2E74279E17A62F30001E1724279520806 +:105D300062F34101E1724279920862F38201E172F9 +:105D40004279D20862F3C301E1720279217B62F3E6 +:105D5000000121730279520862F341012173027933 +:105D6000920862F3820121730079C00860F3C301D5 +:105D7000217399F80000232831D9262140E0182703 +:105D80001026E4B3A088FDF75EFB8346807F00F019 +:105D90000300022809D0002080F00101A0880DF046 +:105DA000DDF85FEA000903D101E00120F4E7FFDF3D +:105DB000E868A06099F8000040F0040189F800103C +:105DC00099F80100800708D5012020739BF8000096 +:105DD00023286CD92721584651E084F80CA066E0AE +:105DE00015270F265CB1A088FDF72DFB8146062202 +:105DF0005946E86808F0AFFB0120A073A0E041E03D +:105E000048463CE016270926E4B3287B20724EE082 +:105E1000287B19270E26ACB3C4F808A0A4F80CA060 +:105E2000012807D0022805D0032805D0042803D074 +:105E3000FFDF0DE0207207E0697B042801F00F010D +:105E400041F0800121721ED0607A20F00300607260 +:105E5000A088FDF7F8FA05460078212827D02328E6 +:105E600000D0FFDFA87F00F00300022813D000203D +:105E700080F00101A0880DF083F822212846FDF76B +:105E800049F914E004E0607A20F00300401CDEE7EA +:105E9000A8F8006010E00120EAE70CB16888A08053 +:105EA000287A68B301280AD002284FD0FFDFA8F86B +:105EB00000600CB1278066800020BDE8F09F1527A8 +:105EC0000F26002CE4D0A088FDF7BDFA807F00F0FB +:105ED0000300022808D0002080F00101A0880DF006 +:105EE0003DF8050003D101E00120F5E7FFDFD5F81B +:105EF0001D000622594608F02EFB84F80EA0D6E7B6 +:105F000017270926002CC3D0A088FDF79CFA8146EC +:105F1000807F00F00300022808D0002080F00101FB +:105F2000A0880DF01BF8050003D101E00120F5E782 +:105F3000FFDF6878800701D5022000E00120207291 +:105F400099F800002328B2D9272159E719270E26EE +:105F5000002C9DD0A088FDF776FA5FEA000900D1F9 +:105F6000FFDFC4F808A0A4F80CA084F808A0A07A69 +:105F700040F00300A07299F81E10C90961F3820075 +:105F8000A07299F81F2099F81E1012EAD11F05D0AF +:105F900099F8201001F01F0110292BD020F00800E3 +:105FA000A07299F81F10607A61F3C3006072697A79 +:105FB00001F003010129A2D140F00400607299F8B8 +:105FC0001E0000F003000228E87A16D0217B60F35F +:105FD00000012173AA7A607B62F300006073EA7AA1 +:105FE000520862F341012173A97A490861F3410023 +:105FF00060735CE740F00800D2E7617B60F300016A +:106000006173AA7A207B62F300002073EA7A520857 +:1060100062F341016173A97A490861F34100207379 +:1060200045E710B5F74C30B10146102204F12000CD +:1060300008F0FBF9012084F8300010BD10B50446CB +:1060400000F0EBFDEF4920461022BDE81040203162 +:1060500008F0EBB970B5EB4D06004FF0000413D01B +:10606000FBF7F7F808B110240CE00621304608F0E1 +:1060700059FA411C05D028665FF0010085F85C00E4 +:1060800000E00724204670BD0020F7E7007810F0FC +:106090000F0204D0012A05D0022A0CD110E0000919 +:1060A00009D10AE00009012807D0022805D00328F9 +:1060B00003D0042801D007207047087000207047E3 +:1060C0000620704705282AD2DFE800F003070F17E3 +:1060D0001F00087820F0FF001EE0087820F00F0075 +:1060E000401C20F0F000103016E0087820F00F007F +:1060F000401C20F0F00020300EE0087820F00F0067 +:10610000401C20F0F000303006E0087820F00F004E +:10611000401C20F0F000403008700020704707203D +:1061200070472DE9F041804688B00D4600270846AB +:10613000FBF7DCF8A8B94046FDF785F9040003D069 +:106140002078222815D104E043F2020008B0BDE80F +:10615000F08145B9A07F410603D500F00300022875 +:1061600001D01020F2E7A07FC10601D4010702D5BB +:106170000DB10820EAE7E17F090701D50D20E5E729 +:1061800000F0030002280DD165B12846FEF75EFF3E +:106190000700DBD1FBF726FB20B9E878800701D5A3 +:1061A0000620D3E7A07F00F00300022808D00020DB +:1061B00080F0010140460CF0D1FE060002D00FE055 +:1061C0000120F5E7A07F00F0030002280ED0002098 +:1061D00080F00101002240460CF0B7FE060007D017 +:1061E000A07F00F00300022804D009E00120EFE7BF +:1061F0000420ABE725B12A4631462046FEF74AFF88 +:106200006946304600F019FD009800B9FFDF00999B +:10621000022006F1E0024870C1F824804A610022A1 +:106220000A81A27F02F00302022A1CD00120087119 +:10623000287800F00102087E62F3010008762A78CF +:10624000520862F3820008762A78920862F3C3004B +:1062500008762A78D20862F30410087624212046B2 +:10626000FCF758FF33E035B30871301D8861307892 +:10627000400908777078C0F340004877287800F02C +:106280000102887F62F301008877A27FD20962F35E +:1062900082008877E27F62F3C3008877727862F3C6 +:1062A00004108877A878C87701F1210228462031A8 +:1062B000FEF711FF03E00320087105200876252171 +:1062C0002046FCF727FFA07F20F04000A07701A91F +:1062D00000980EF03EFB022801D000B1FFDF3846E7 +:1062E00034E72DE9FF4F9346474A0D4699B09A4649 +:1062F00007CA0AAB002783E807001998FDF7A3F83F +:10630000060006D03078262806D008201DB0BDE84B +:10631000F08F43F20200F9E7B07F00F00309B9F112 +:10632000020F11D04DB95846FEF790FE0028EDD16E +:10633000B07F00F00300022806D0BBF1000F11D09F +:10634000FBF750FA20B10DE0BBF1000F4FD109E08F +:1063500006200CF0ABFD28B19BF80300800701D5A7 +:106360000620D3E7B07F00F00300022808D0002009 +:1063700080F0010119980CF0F1FD040003D101E057 +:106380000120F5E7FFDF852D27D007DCEDB1812D5A +:106390001DD0822D1DD0832D08D11CE0862D1ED04E +:1063A000882D1ED0892D1ED08A2D1ED00F20207141 +:1063B0000F281CD003F032F9D8B101208DF83C0031 +:1063C000201D10902079B0B156E10020EFE70120A8 +:1063D000EDE70220EBE70320E9E70520E7E70620E9 +:1063E000E5E70820E3E70920E1E70A20DFE70720E7 +:1063F0008CE711208AE7B9F1020F07D0A56F07D10A +:10640000A06F06E0340200202C620200656FF6E700 +:10641000606F80462DD04FF0010001904FF00200D8 +:1064200000905A4621463046FEF734FE9BF80000A5 +:1064300000F00101A87861F30100A870B17FC909DB +:1064400061F38200A870F17F61F3C300A8706178E6 +:1064500061F30410A8702078400928706078C0F3B8 +:10646000400068709BF80200E87000206871287195 +:1064700003E00220019001200090A87898F8021013 +:10648000C0F3C000C1F3C001084003902CD05046B7 +:10649000FAF7DFFEC0BBDAF80C00FAF7DAFE98BBB9 +:1064A000DAF81C00FAF7D5FE70BBDAF80C00A06031 +:1064B000DAF81C00E060607898F8012042EA5001A8 +:1064C00061F34100607098F80210C0B200EA111147 +:1064D00061F30000607000202077009906F117003A +:1064E000022907D0012106E0607898F8012002EA2D +:1064F0005001E5E7002104EB810148610199701C1E +:10650000022902D0012101E028E0002104EB8101F1 +:106510004861A87800F00300012857D198F80200DC +:1065200000F00300012851D1B9F1020F04D02A1D57 +:10653000691D5846FEF7CFFD287998F804100840E9 +:106540008DF83400697998F8052011408DF83810DD +:1065500008433BD05046FAF77CFE08B11020D5E640 +:106560000AF110018B46B9F1020F17D0084600213D +:1065700004F18C03CDE9000304F5AE7202920DAB79 +:106580002046039AFEF7F0FD0028E8D1B9F1020F8A +:1065900008D0504608D14FF0010107E050464FF0B7 +:1065A0000101E5E75846F5E74FF0000104F1A403C7 +:1065B000CDE9000304F5B072029281F001010EAB47 +:1065C0002046039AFEF7D0FD0028C8D160788007E6 +:1065D00033D4A87898F80210C0F38000C1F380018A +:1065E00008432AD0297898F800000AAAB9F1020FC6 +:1065F00006D032F811204300DA4002F003070AE027 +:1066000032F810204B00DA4012F0030705D0012FBA +:106610000AD0022F0AD0032F06D0039A6AB10129AB +:1066200006D0042904D008E00227F6E70127F4E7A2 +:10663000012801D0042800D10427B07F40F0800059 +:10664000B077F17F039860F30001F17760788007FD +:1066500005D50320A071039870B9002029E002201D +:10666000022F18D0012F18D0042F2AD00020A0719B +:10667000B07F20F08000B07725213046FCF74AFD3E +:106680000FA904F1E0000EF049F910B1022800D082 +:10669000FFDF00203AE6A071DFE7A0710D220021A4 +:1066A00004F1200007F0EBFE207840F0020020709B +:1066B00001208DF85C0017AA3146199800F096FA6F +:1066C000DAE70120A071D7E72DE9F04387B09046C3 +:1066D000894604460025FCF7B6FE060006D0307851 +:1066E000272806D0082007B0BDE8F08343F2020057 +:1066F000F9E7B07F00F00300022809D05FF0000046 +:1067000080F0010120460CF029FC040003D101E0D7 +:106710000120F5E7FFDFA7795FEA090005D001282E +:1067200021D0B9F1020F26D110E0B8F1000F22D12B +:10673000012F05D0022F05D0032F05D0FFDF2EE05B +:106740000C252CE001252AE0022528E04046FAF736 +:1067500080FDB0B9032F0ED11022414604F11D0077 +:1067600007F063FE1BE0012F02D0022F03D104E0EB +:10677000B8F1000F13D00720B5E74046FAF769FDDE +:1067800008B11020AFE71022002104F11D0007F02E +:1067900076FE0621404607F0C5FEC4F81D002078AD +:1067A000252140F0020020703046FCF7B3FC207831 +:1067B000C10713D020F00100207002208DF80000E6 +:1067C00004F11D0002908DF804506946C3300EF0AC +:1067D000A5F8022803D010B1FFDF00E025770020E4 +:1067E00081E730B587B00D460446FCF72CFE98B122 +:1067F000807F00F00300022811D0002080F001010A +:1068000020460CF0ABFB04000ED02846FAF721FD21 +:1068100038B1102007B030BD43F20200FAE7012082 +:10682000ECE72078400701D40820F3E7294604F17B +:106830003D002022054607F0F8FD207840F01000CA +:10684000207001070FD520F00800207007208DF878 +:106850000000694604F1E00001950EF05FF802289F +:1068600001D000B1FFDF0020D4E770B50D46064629 +:10687000FCF7E9FD18B10178272921D102E043F2A4 +:10688000020070BD807F00F00300022808D00020C5 +:1068900080F0010130460CF061FB040003D101E0FF +:1068A0000120F5E7FFDFA079022809D16078C00751 +:1068B00006D02A4621463046FEF7E7FC10B10FE02D +:1068C000082070BDB4F860000E280BD204F16201FC +:1068D00002231022081F0CF0C8F901210170457035 +:1068E000002070BD112070BD70B5064614460D46DF +:1068F0000846FAF7AEFC18B92046FAF7D0FC08B102 +:10690000102070BDA6F57F40FF380ED03046FCF752 +:106910009AFD38B1417822464B08811C1846FCF795 +:1069200062FD07E043F2020070BD2046FDF78CFDDA +:106930000028F9D11021E01D0FF027FEE21D2946A5 +:1069400004F1170000F089F9002070BD2DE9F04135 +:1069500004468AB01546884600270846FAF7C6FC62 +:1069600018B92846FAF7C2FC18B110200AB0BDE8E1 +:10697000F0812046FCF767FD060003D03078272819 +:106980001BD102E043F20200F0E7B07F00F0030009 +:10699000022809D05FF0000080F0010120460CF0D1 +:1069A000DDFA040003D101E00120F5E7FFDF2078E4 +:1069B000400702D56078800701D40820D6E7B07F71 +:1069C00000F00300022803D0A06F03D1A16F02E002 +:1069D000606FFAE7616F407800B19DB1487810B1FF +:1069E000B8F1000F0ED0ADB1EA1D06A8E16800F0C5 +:1069F00034F9102206A905F1170007F0E9FC18B1D7 +:106A0000042707E00720B1E71022E91D04F12D005B +:106A100007F00BFDB8F1000F06D0102208F10701B6 +:106A200004F11D0007F001FD2078252140F002004F +:106A300020703046FCF76EFB2078C10715D020F09F +:106A40000100207002208DF8000004F11D0002906A +:106A5000103003908DF804706946B3300DF05EFF7E +:106A6000022803D010B1FFDF00E0277700207DE788 +:106A7000F8B515460E460746FCF7E5FC040004D0C1 +:106A80002078222804D00820F8BD43F20200F8BD87 +:106A9000A07F00F00300022802D043F20500F8BDF9 +:106AA0003046FAF7D6FB18B92846FAF7D2FB08B1F8 +:106AB0001020F8BD00953288B31C21463846FEF7F9 +:106AC00007FC112815D00028F3D1297C4A08A17FA2 +:106AD00062F3C711A177297CE27F61F30002E277BC +:106AE000297C890884F82010A17F21F04001A1773A +:106AF000F8BDA17F0907FBD4D6F80200C4F8360020 +:106B0000D6F80600C4F83A003088A086102229463C +:106B100004F1240007F089FC287C4108E07F61F340 +:106B20004100E077297C61F38200E077287C8008CF +:106B300084F82100A07F40F00800A0770020D3E770 +:106B400070B50D4606460BB1072070BDFCF77BFC07 +:106B5000040007D02078222802D3A07F800604D426 +:106B6000082070BD43F2020070BDADB12946304629 +:106B70000BF0CAF802F074FB297C4A08A17F62F38B +:106B8000C711A177297CE27F61F30002E277297CBB +:106B9000890884F8201004E030460BF0D8F802F0A1 +:106BA0005FFBA17F21F02001A17770BD70B50D467C +:106BB000FCF749FC040005D02846FAF770FB20B129 +:106BC000102070BD43F2020070BD29462046FEF73A +:106BD0002DFB002070BD04E010F8012B0AB100204D +:106BE0007047491E89B2F7D20120704770B515462B +:106BF000064602F013FD040000D1FFDF207820F0EC +:106C00000F00801C20F0F000203020706680286883 +:106C1000A060BDE8704002F004BD10B5134C94F8BC +:106C20003000002808D104F12001A1F110000DF07E +:106C3000B7FE012084F8300010BD10B190F8B920E3 +:106C40002AB10A4890F8350018B1002003E0B830A6 +:106C500001E0064834300860704708B5002300930F +:106C600013460A460CF079FB08BD000034020020F0 +:106C700018B18178012938D101E0102070470188CE +:106C800042F60112881A914231D018DC42F6010214 +:106C9000A1EB020091422AD00CDC41B3B1F5C05FF8 +:106CA00025D06FF4C050081821D0A0F57060FF38CF +:106CB0001BD11CE001281AD002280AD117E0B0F538 +:106CC000807F14D008DC012811D002280FD00328BF +:106CD0000DD0FF2809D10AE0B0F5817F07D0A0F5DB +:106CE0008070033803D0012801D0002070470F20A6 +:106CF00070470A281FD008DC0A2818D2DFE800F005 +:106D0000191B1F1F171F231D1F21102815D008DC5A +:106D10000B2812D00C2810D00D2816D00F2806D121 +:106D20000DE011280BD084280BD087280FD003202A +:106D300070470020704705207047072070470F20DC +:106D4000704704207047062070470C20704743F2BC +:106D50000200704738B50C46050041D06946FFF780 +:106D600095F9002819D19DF80010607861F30200B0 +:106D700060706946681CFFF789F900280DD19DF8FD +:106D80000010607861F3C5006070A978C1F341011B +:106D9000012903D0022905D0072038BD217821F030 +:106DA000200102E0217841F020012170410704D048 +:106DB000A978C90861F386106070607810F0380F08 +:106DC00007D0A978090961F3C710607010F0380F77 +:106DD00002D16078400603D5207840F04000207052 +:106DE000002038BD70B50446002008801546606854 +:106DF000FFF7B0FF002816D12089A189884211D859 +:106E000060688078C0070AD0B1F5007F0AD840F2E8 +:106E10000120B1FBF0F200FB1210288007E0B1F571 +:106E2000FF7F01D90C2070BD01F2012129800020D3 +:106E300070BD10B50478137864F300031370047800 +:106E4000640864F3410313700478A40864F38203B4 +:106E500013700478E40864F3C303137004782409FE +:106E600064F3041313700478640964F34513137016 +:106E70000078800960F38613137031B10878C10778 +:106E800001D1800701D5012000E0002060F3C71385 +:106E9000137010BD4278530702D002F0070306E0DA +:106EA00012F0380F02D0C2F3C20300E001234A7887 +:106EB00063F302024A70407810F0380F02D0C0F33A +:106EC000C20005E0430702D000F0070000E0012007 +:106ED00060F3C5024A7070472DE9F04F95B00D0080 +:106EE000824613D012220021284607F0C8FA4FF636 +:106EF000FF7B05AA0121584607F089F800242646A1 +:106F000037464FF420586FF4205972E0102015B026 +:106F1000BDE8F08F9DF81E0001280AD1BDF81C10B5 +:106F200041450BD011EB09000AD001280CD00228F2 +:106F30000CD0042C0ED0052C0FD10DE0012400E064 +:106F40000224BDF81A6008E0032406E00424BDF81A +:106F50001A7002E0052400E00624BDF81A1051451D +:106F600047D12C74BEB34FF0000810AA4FF0070AA7 +:106F7000CDE90282CDE900A80DF13C091023CDF83E +:106F8000109042463146584607F011F908BBBDF84B +:106F90003C002A46C0B210A90DF078FDC8B9AE81F8 +:106FA000CFB1CDE900A80DF1080C0AAE40468CE83F +:106FB0004102132300223946584607F0F8F840B939 +:106FC000BDF83C00F11CC01EC0B22A1D0DF05EFDD4 +:106FD00010B103209BE70AE0BDF82900E881062CE8 +:106FE00005D19DF81E00A872BDF81C002881002064 +:106FF0008DE705A807F017F800288BD0FFF779FE7A +:1070000085E72DE9F0471C46DDE90978DDF8209099 +:1070100015460E00824600D1FFDF0CB1208818B162 +:10702000D5B11120BDE8F087022D01D0012100E08B +:10703000002106F1140005F0B3FEA8F80000024696 +:107040003B462946504603F078F9C9F8000008B9D4 +:10705000A41C3C600020E5E71320E3E7F0B41446ED +:10706000DDE904528DB1002314B1022C09D101E0F5 +:10707000012306E00D7CEE0703D025F00105012376 +:107080000D742146F0BC04F036BA1A80F0BC70478B +:107090002DE9FE4F91461A881C468A468046FAB171 +:1070A00002AB494603F049F9050019D04046A61C39 +:1070B00027880CF098F83246072629463B4600966A +:1070C0000BF0A5FC20882346CDE900504A465146E6 +:1070D0004046FFF7C3FF002020800120BDE8FE8F5F +:1070E0000020FBE72DE9F04786B082460EA89046C7 +:1070F00090E8B000894604AA05A903A88DE8070016 +:107100001E462A4621465046FFF77BFF039901B1F0 +:1071100001213970002818D1FA4904F1140204AB96 +:107120000860039805998DE8070042464946504695 +:1071300006F0E9F9A8B1092811D2DFE800F0050846 +:107140000510100A0C0C0E00002006B06AE7112092 +:10715000FBE70720F9E70820F7E70D20F5E7032014 +:10716000F3E7BDF810100398CDE9000133462A4635 +:1071700021465046FFF772FFE6E72DE9F04389B05C +:107180001646DDE910870D4681461C461422002173 +:1071900003A807F074F9012002218DF810108DF872 +:1071A0000C008DF81170ADF8146064B1A278D207AC +:1071B00009D08DF81600E088ADF81A00A088ADF867 +:1071C0001800A068079008A80095CDE90110424674 +:1071D00003A948466B68FFF785FF09B0BDE8F08357 +:1071E000F0B58BB000240646069407940727089450 +:1071F00005A80994019400970294CDE903400D4637 +:1072000010232246304606F0D2FF78B90AA806A914 +:10721000019400970294CDE90310BDF814300022C8 +:107220002946304606F061FD002801D0FFF761FDD8 +:107230000BB0F0BD06F0F2BB2DE9FC410C468046D8 +:10724000002602F0EBF9054620780D287ED2DFE813 +:1072500000F0BC0713B325BD49496383AF959B007C +:10726000A848006820B1417841F010014170ADE0BC +:10727000404602F003FAA9E0042140460BF06EFEFE +:10728000070000D1FFDF07F11401404605F01DFDA6 +:10729000A5BB13214046FDF7BDFB97E00421404606 +:1072A0000BF05CFE070000D1FFDFE088ADF80000C6 +:1072B0000020B8819DF80000010704D5C00602D562 +:1072C000A088B88105E09DF8010040067ED5A08821 +:1072D000F88105B9FFDF22462946404601F0C0FC8F +:1072E000022673E0E188ADF800109DF80110090650 +:1072F0000FD5072803D006280AD00AE024E004218D +:1073000040460BF02BFE060000D1FFDFA088F08185 +:107310000226CDB9FFDF17E0042140460BF01EFE28 +:10732000070000D1FFDF07F1140006F0AEFB90F07C +:10733000010F02D1E079000648D5387C022640F0E2 +:107340000200387405B9FFDF224600E03DE029461F +:10735000404601F085FC39E0042140460BF0FEFD7B +:10736000017C002D01F00206C1F340016171017C36 +:1073700021F002010174E7D1FFDFE5E702260121D8 +:10738000404602F0ADF921E0042140460BF0E6FD55 +:107390000546606800902089ADF804000122694626 +:1073A000404602F0BEF9287C20F0020028740DE06F +:1073B000002DC9D1FFDFC7E7022600214046FBF7B9 +:1073C00081F8002DC0D1FFDFBEE7FFDF3046BDE80A +:1073D000FC813EB50C0009D001466B4601AA002095 +:1073E00006F06AFF20B1FFF784FC3EBD10203EBDD1 +:1073F00000202080A0709DF8050002A900F0070081 +:10740000FEF760FE50B99DF8080020709DF8050059 +:1074100002A9C0F3C200FEF755FE08B103203EBD2D +:107420009DF8080060709DF80500C109A07861F31F +:107430000410A0709DF80510890961F3C300A070C5 +:107440009DF80410890601D5022100E0012161F3B5 +:1074500042009DF8001061F30000A07000203EBDC6 +:1074600070B5144606460D4651EA040005D075B1C4 +:107470000846F9F732FF78B901E0072070BD2946C8 +:10748000304606F080FF10B1BDE8704031E454B1E1 +:107490002046F9F722FF08B1102070BD2146304682 +:1074A000BDE8704095E7002070BD2DE9FC5F0C46FB +:1074B00090460546002701780822007A3E46B2EB46 +:1074C000111F7DD104F10A0100910A31821E4FF093 +:1074D000020A04F1080B0191092A72D2DFE802F0D6 +:1074E000EDE005F528287BAACE00688804210BF082 +:1074F00035FD060000D1FFDFB08928B152270726ED +:10750000C3E000009802002051271026002C7DD0F7 +:107510006888A0800120A071A88900220099FFF747 +:107520009FFF002873D1A8892081288AE081D1E0BB +:10753000B5F81290072824D1E87B000621D5512701 +:1075400009F1140086B2002CE1D0A889002200992C +:10755000FFF786FF00285AD16888A08084F806A02B +:10756000A88920810120A073288A2082A4F8129083 +:10757000A88A009068884B46A969019A01F04CFBE3 +:10758000A8E0502709F1120086B2002C3ED0A8894D +:1075900000225946FFF764FF002838D16888A08090 +:1075A000A889E080287A072813D002202073288A2F +:1075B000E081E87BC0096073A4F81090A88A01E01C +:1075C00085E082E0009068884B4604F11202A969C8 +:1075D000D4E70120EAE7B5F81290512709F1140029 +:1075E00086B2002C66D0688804210BF0B7FC834675 +:1075F0006888A080A88900220099FFF731FF002841 +:107600006ED184F806A0A889208101E052E067E0ED +:107610000420A073288A2082A4F81290A88A0090DF +:1076200068884B46A969019A01F0F6FAA989ABF876 +:107630000E104FE06888FBF706FF074668880421B4 +:107640000BF08CFC064607B9FFDF06B9FFDF687B4D +:10765000C00702D05127142601E0502712264CB350 +:107660006888A080502F06D084F806A0287B594651 +:1076700001F0E2FA2EE0287BA11DF9E7FE49A88976 +:107680004989814205D1542706269CB16888A0808B +:1076900020E053270BE06888A080A889E08019E0EB +:1076A000688804210BF05AFC00B9FFDF5527082633 +:1076B000002CF0D1A8F8006011E056270726002C16 +:1076C000F8D06888A080002013E0FFDF02E00128E6 +:1076D00008D0FFDFA8F800600CB12780668000208A +:1076E000BDE8FC9F57270726002CE3D06888A080C0 +:1076F000687AA071EEE7401D20F0030009B1414314 +:10770000091D01EB4000704713B5DB4A00201071E2 +:10771000009848B1002468460BF03DFA002C02D1D5 +:10772000D64A009911601CBD01240020F4E770B511 +:107730000D461446064686B05C220021284606F017 +:107740009EFE04B9FFDFA0786874A27821882846DD +:1077500001F09DFA0020A881E881228805F114013A +:10776000304605F096FA6A460121304606F04FFC95 +:107770001AE000BF9DF80300000715D5BDF80610FC +:107780003046FFF72DFD9DF80300BDF8061040F0D0 +:1077900010008DF80300BDF80300ADF81400FF23BE +:1077A0003046059A06F0B7FD684606F03CFC002816 +:1077B000E0D006B070BD10B50C4601F1140005F024 +:1077C000A0FA0146627C2046BDE8104001F094BA60 +:1077D00030B50446A84891B04FF6FF75C18905AA97 +:1077E000284606F014FC30E09DF81E00A0422AD086 +:1077F00001282AD1BDF81C00B0F5205F03D042F665 +:107800000101884221D1002002AB0AAA0CA90190F3 +:1078100083E8070007200090BDF81A10102300220B +:10782000284606F0C4FC38B9BDF828000BAAC0B23F +:107830000CA90DF02BF910B1032011B030BD9DF84B +:107840002E00A04201D10020F7E705A806F0EBFBCF +:107850000028C9D00520F0E770B5054604210BF0DB +:107860007DFB040000D1FFDF04F114010C46284623 +:1078700005F02BFA21462846BDE8704005F02CBAE9 +:1078800070B58AB00C460646FBF7DDFD050014D046 +:107890002878222827D30CB1A08890B101208DF838 +:1078A0000C0003208DF8100000208DF8110054B159 +:1078B000A088ADF81800206807E043F202000AB083 +:1078C00070BD0920FBE7ADF8180005900421304693 +:1078D0000BF044FB040000D1FFDF04F1140005F0BD +:1078E00026FA000701D40820E9E701F097FE60B10D +:1078F00008A802210094CDE9011095F8232003A9DE +:1079000030466368FFF7EEFBD9E71120D7E72DE992 +:10791000F04FB2F802A0834689B01546894650461A +:10792000FBF791FD0746042150460BF017FB00269C +:10793000044605964FF002080696ADF81C6007B99C +:10794000FFDF04B9FFDF4146504603F03BFF50B96B +:1079500007AA06A905A88DE8070042462146504619 +:107960006368FFF74EFB444807AB0660DDE905128C +:1079700004F11400CDF80090CDE90320CDE90131E8 +:1079800097F82320594650466B6805F019FA06000F +:107990000AD0022E04D0032E14D0042E00D0FFDF14 +:1079A00009B03046BDE8F08FBDF81C000028F7D0C4 +:1079B0000599CDE900104246214650466368FFF71D +:1079C0004DFBEDE7687840F008006870E8E72DE9C6 +:1079D000F04F99B004464FF000082748ADF81C80DE +:1079E000ADF82080ADF82480A0F80880ADF81480B0 +:1079F000ADF81880ADF82C80ADF8288000791646D7 +:107A00000D464746012808D0022806D0032804D096 +:107A1000042802D0082019B0C4E72046F9F719FC61 +:107A200070BB2846F9F715FC50BB6068F9F75EFC9F +:107A300030BB606848B160892189884202D8B1F5BD +:107A4000007F01D90C20E6E780460EAA06A9284649 +:107A5000FFF7C8F90028DED168688078C0F34100DC +:107A6000022808D19DF8190010F0380F03D02869BA +:107A7000F9F733FC20B904E098020020140000203C +:107A800022E005A92069FFF765F90028C3D1206924 +:107A900048B1607880079DF8150000F0380001D5E6 +:107AA000F0B300E0E0BB9DF8140080060ED59DF811 +:107AB000150010F0380F03D06068F9F70EFC18B904 +:107AC0006068F9F713FC08B11020A4E70AA96069FF +:107AD000FFF740F900289ED1606940B19DF8290068 +:107AE00000F0070101293CD110F0380F39D00BA963 +:107AF000A069FFF72FF900288DD19DF82800800696 +:107B00002FD49DF82C0080062BD4A06950B19DF88D +:107B10002D0000F00701012923D110F0380F00E0FB +:107B20001FE01ED0E06818B10078D0B11C2818D230 +:107B30000FAA611C2046FFF77CF90121384661F34A +:107B40000F2082468DF85210B94642F603000F46C8 +:107B5000ADF850000DF13F0218A928680CF0B5FFF0 +:107B600008B1072057E79DF8600015A9CDF80090EF +:107B7000C01CCDE9019100F0FF0B00230BF20122A4 +:107B8000514614A806F06EF9F0BBBDF854000C90F5 +:107B9000FE482A8929690092CDE901106B89BDF858 +:107BA00038202868069906F05DF901007ED120781A +:107BB0004FF0020AC10601D480062BD5CDF80C90F7 +:107BC000606950B90AA906A8FFF764F99DF8290071 +:107BD00020F00700401C8DF829009DF8280008A916 +:107BE00040F0C8008DF828008DF8527042F602105F +:107BF000ADF8500003AACDF800A0CDE90121002383 +:107C000040F2032214A800E01EE00A9906F02AF9C7 +:107C100001004BD1DD484D4608385B460089ADF880 +:107C20003D000FA8CDE90290CDF80490CDF810905A +:107C30004FF007090022CDF80090BDF854104FF620 +:107C4000FF7006F052F810B1FFF753F8E3E69DF825 +:107C50003C00000624D52946012060F30F218DF851 +:107C600052704FF424500395ADF8500062789DF89F +:107C70000C00002362F300008DF80C006278CDF850 +:107C800000A0520862F341008DF80C0003AACDE970 +:107C9000012540F2032214A806F0E4F8010005D102 +:107CA000606888B32069A8B905A900E084E006A847 +:107CB000FFF7F0F86078800706D49DF8150020F0F3 +:107CC00038008DF8150005E09DF8140040F04000E4 +:107CD0008DF814008DF8527042F60110ADF8500086 +:107CE000208940F20121B0FBF1F201FB1202606831 +:107CF00009ABCDF80080CDE90103002314A8059954 +:107D000006F0B0F8010057D12078C00728D00395BD +:107D1000A06950B90BA906A8FFF7BCF89DF82D0083 +:107D200020F00700401C8DF82D009DF82C008DF8E8 +:107D3000527040F040008DF82C0042F60310ADF870 +:107D4000500007A903AACDF800A0CDE90121002326 +:107D500040F2032214A80B9906F084F801002BD1FD +:107D6000E06868B32946012060F30F218DF8527056 +:107D700042F60410ADF85000E068002302788DF858 +:107D8000582040788DF85900E06816AA4088ADF870 +:107D90005A00E06800798DF85C00E068C088ADF8B2 +:107DA0005D00CDF80090CDE901254FF4027214A8D2 +:107DB00006F058F8010003D00C9800F0C9FF2AE63D +:107DC000724803210838017156B100893080BDF82E +:107DD00024007080BDF82000B080BDF81C00F08049 +:107DE000002018E670B501258AB016460B4601281A +:107DF00002D0022816D104E08DF80E504FF4205026 +:107E000003E08DF80E5042F60100ADF80C005BB1B6 +:107E10000024601C60F30F2404AA08A918460CF083 +:107E200054FE18B107204AE5102048E504A99DF842 +:107E300020205648CDE90021801E029000232146D3 +:107E400003A802F2012206F00DF810B1FEF751FF6F +:107E500035E54E4808380EB1C188318005710020E3 +:107E60002DE5F0B593B0074601268DF83E6041F64A +:107E70000100ADF83C0012AA0FA93046FFF7B2FF8F +:107E8000002849D1414C0025083CEFB31C220021B9 +:107E900002A806F0F4FA9DF808008DF83E6040F064 +:107EA00020008DF8080042F60520ADF83C000E9544 +:107EB0009DF83A00119520F00600801C8DF83A00DC +:107EC0009DF838006A4620F0FF008DF838009DF8D4 +:107ED000390009A920F0FF008DF839000420ADF821 +:107EE0002C00ADF830000EA80A9011A80D900FA834 +:107EF0000990ADF82E5002A8FFF769FD00280BD1BC +:107F0000BDF80000608100E008E0BDF80400A08139 +:107F1000401CE0812571002013B0F0BD6581A58172 +:107F2000BDF84800F4E72DE9F74F1849A0B0002448 +:107F3000083917940A79A146012A04D0022A02D0EE +:107F4000082023B02EE5CA88824201D00620F8E737 +:107F500021988A46824201D10720F2E7012021467A +:107F600060F30F21ADF848004FF6FF780691ADF8A9 +:107F70004A808DF86E0042F6020B8DF872401CA903 +:107F8000ADF86CB0ADF87040139101E0A002002094 +:107F9000ADF8508012A806F075F800252E462F4641 +:107FA0000DAB072212A9404606F06FF878B10A28F7 +:107FB0005DD195B38EB3ADF86450ADF866609DF8B1 +:107FC0005E008DF8144019AC012864D06BE09DF878 +:107FD0003A001FB3012859D1BDF8381059451FD1B7 +:107FE00018A809A901940294CDE903100720009074 +:107FF000BDF8361010230022404606F0D8F8B0BB7A +:10800000BDF86000042801D006284AD1BDF824102C +:10801000219881423AD10F2093E73AE0012835D1E7 +:10802000BDF83800B0F5205F03D042F60101884268 +:108030002CD1BAF80600BDF83610884201D10127CC +:1080400000E0002705B19EB1219881421ED118A8F9 +:1080500009AA01940294CDE90320072000900D465F +:1080600010230022404606F0A2F800B902E02DE0FD +:108070004E460BE0BDF86000022801D0102810D158 +:10808000C0B217AA09A90CF001FD50B9BDF836908D +:1080900086E7052055E705A917A8221D0CF015FD58 +:1080A00008B103204DE79DF814000023001DC2B263 +:1080B0008DF8142022980092CDE901401BA8069962 +:1080C00005F0D0FE10B902228AF80420FEF711FE56 +:1080D00037E710B50B46401E88B084B205AA0021D0 +:1080E0001846FEF7A6FE00200DF1080C06AA05A909 +:1080F00001908CE807000720009001230022214610 +:108100004FF6FF7005F0F1FD0446BDF81800012898 +:1081100000D0FFDF2046FEF7ECFD08B010BDF0B543 +:10812000F74F044687B038790E46032804D0042858 +:1081300002D0082007B0F0BD04AA03A92046FEF72C +:1081400051FE0500F6D160688078C0F34100022836 +:108150000AD19DF80D0010F0380F05D02069F9F70D +:10816000BCF808B11020E5E7208905AA21698DE84F +:1081700007006389BDF810202068039905F072FE9E +:1081800010B1FEF7B6FDD5E716B1BDF8140030808A +:10819000042038712846CDE7F8B50C0006460CD00F +:1081A00001464FF6FF7500236A46284606F084F81C +:1081B00028B100BFFEF79DFDF8BD1020F8BD69464F +:1081C0002046FEF7C7FD0028F8D1A078314600F020 +:1081D00001032846009A06F09EF8EBE730B587B019 +:1081E000144600220DF1080C05AD01928CE82C001C +:1081F000072200920A46014623884FF6FF7005F0D9 +:1082000074FDBDF814102180FEF773FD07B030BD7A +:1082100070B50D4604210AF0A1FE040000D1FFDF75 +:10822000294604F11400BDE8704004F079BD70B532 +:108230000D4604210AF092FE040000D1FFDF29461A +:1082400004F11400BDE8704004F08DBD70B50D461A +:1082500004210AF083FE040000D1FFDF294604F167 +:108260001400BDE8704004F0A5BD70B505460421BA +:108270000AF074FE040000D1FFDF2146284623687F +:10828000BDE870400122FEF703BF70B50646042129 +:108290000AF064FE040000D1FFDF04F1140004F0D2 +:1082A00030FD401D20F0030511E0011D0088002273 +:1082B000431821463046FEF7EBFE00280BD0607CC9 +:1082C000ABB2684382B2A068011D0AF004FDA06849 +:1082D00041880029E9D170BD70B5054604210AF036 +:1082E0003DFE040000D1FFDF214628466368BDE85B +:1082F00070400222FEF7CCBE70B50E46054601F076 +:108300008DF9040000D1FFDF0120207266726580C4 +:10831000207820F00F00001D20F0F0004030207089 +:10832000BDE8704001F07DB910B50446012900D0C8 +:10833000FFDF2046BDE810400121FAF7C3B82DE960 +:10834000F04F97B04FF0000A0C008346ADF814A030 +:10835000D04619D0E06830B1A068A8B10188ADF866 +:108360001410A0F800A05846FBF76DF8070043F280 +:10837000020961D0387822285CD3042158460AF0DB +:10838000EDFD050005D103E0102017B0BDE8F08F2A +:10839000FFDF05F1140004F0B4FC401D20F00306DB +:1083A000A078012803D0022801D00720EDE721881A +:1083B00007AA584605F02BFE30BB07A805F033FE90 +:1083C00010BB07A805F02FFE48B99DF8260001282C +:1083D00005D1BDF82400A0F52451023902D04FF494 +:1083E0005050D2E7E068B0B1CDE902A0072000907C +:1083F00005AACDF804A00492A2882188BDF8143003 +:10840000584605F072FC10B1FEF773FCBDE7A16899 +:10841000BDF8140008809DF81F00C00602D543F285 +:108420000140B2E70B9838B1A1780078012905D056 +:1084300080071AD40820A8E74846A6E7C007F9D065 +:1084400002208DF83C00A8684FF00009A0B1697CBB +:108450004288714391420FD98AB2B3B2011D0AF02A +:10846000F0FB8046A0F800A006E003208DF83C0059 +:10847000D5F800804FF001099DF8200010F0380F6A +:1084800000D1FFDF9DF820001E49C0F3C200084460 +:1084900097F8231010F8010C884201D90F2074E7D7 +:1084A0002088ADF8400014A90095CDE9019143461C +:1084B00007220FA95846FEF715FE002891D19DF816 +:1084C000500050B9A078012807D1687CB3B270433E +:1084D00082B2A868011D0AF0C8FB002055E770B5FC +:1084E000064615460C460846FEF7C2FB002805D195 +:1084F0002A4621463046BDE8704073E470BD12E55F +:1085000098020020FC2F000070B51E4614460D0096 +:1085100009D044B1616831B138B1FC49C9888142A0 +:1085200003D0072070BD102070BD2068FEF7A0FBAF +:108530000028F9D1324621462846BDE87040FFF7B1 +:1085400046BA70B515460C0006D038B1EF49098916 +:10855000814203D0072070BD102070BD2068FEF757 +:1085600087FB0028F9D129462046BDE87040D6E5B2 +:1085700070B5064686B00D4614461046F8F78FFED5 +:10858000D0BB6068F8F7B2FEB0BBA6F57F40FF38FD +:1085900003D03046FAF757FF80B128466946FEF708 +:1085A0009BFC00280CD19DF810100F2008293DD20B +:1085B000DFE801F008060606060A0A0843F2020090 +:1085C00006B070BD0320FBE79DF80210012908D119 +:1085D000BDF80010B1F5C05FF2D06FF4C052D142C7 +:1085E000EED09DF8061001290DD1BDF80410A1F5BB +:1085F0002851062907D200E029E0DFE801F0030353 +:1086000004030303DCE79DF80A1001290FD1BDF82C +:108610000810B1F5245FD3D0A1F60211B1F50051D5 +:10862000CED00129CCD0022901D1C9E7FFDF606893 +:1086300078B9002305AA2946304605F03DFE10B161 +:10864000FEF757FBBCE79DF81400800601D410200C +:10865000B6E76188224628466368FFF7BFFDAFE7AB +:108660002DE9F043814687B0884614461046F8F756 +:1086700016FE18B1102007B0BDE8F083002306AA4B +:108680004146484605F018FE18B100BFFEF731FB21 +:10869000F1E79DF81800C00602D543F20140EAE771 +:1086A0000025072705A8019500970295CDE90350FD +:1086B00062884FF6FF734146484605F078FD060094 +:1086C00013D16068F8F7EBFD60B960680195CDE9FA +:1086D000025000970495238862884146484605F079 +:1086E00066FD0646BDF8140020803046CEE739B15D +:1086F000864B0A889B899A4202D843F2030070474E +:108700001DE610B586B0814C0423ADF814306389A2 +:1087100043B1A4898C4201D2914205D943F20300AE +:1087200006B010BD0620FBE7ADF810100021009147 +:108730000191ADF8003002218DF8021005A90291D7 +:1087400004A90391ADF812206946FFF7F8FDE7E7A9 +:108750002DE9FC4781460D460846F8F77AFD88BBAF +:108760004846FAF770FE5FEA00080AD098F8000061 +:10877000222829D3042148460AF0F0FB070005D13E +:1087800003E043F20200BDE8FC87FFDF07F11400BD +:1087900004F0CDFA06462878012803D0022804D038 +:1087A0000720F0E7B0070FD502E016F01C0F0BD042 +:1087B000A8792C1DC00709D0E08838B1A068F8F767 +:1087C00048FD18B11020DEE70820DCE721882A7870 +:1087D0000720B1F5847F35D01EDC40F20315A1F2ED +:1087E0000313A94226D00EDCB1F5807FCBD003DC89 +:1087F000F9B1012926D1C6E7A1F58073013BC2D0AA +:10880000012B1FD113E0012BBDD0022B1AD0032B5B +:10881000B9D0042B16D112E0A1F20912082A11D204 +:10882000DFE802F00B04041010101004ABE7022A7A +:10883000A9D007E0012AA6D004E0320700E0F20642 +:10884000002AA0DACDB200F0E9FE50B198F823007A +:10885000CDE90005FA89234639464846FEF78DFCE6 +:1088600091E711208FE72DE9F04F8BB01F46154699 +:108870000C4683460026FAF7E6FD28B10078222848 +:1088800005D208200BB081E543F20200FAE7B808F0 +:1088900001D00720F6E7032F00D100274FF6FF791C +:1088A000CCB1022D73D32046F8F720FD30B904EB8C +:1088B0000508A8F10100F8F719FD08B11020E1E75B +:1088C000AD1E38F8028CAAB22146484605F055FE86 +:1088D00040455CD1ADB20D49B80702D58889401C2E +:1088E00000E001201FFA80F8F80701D08F8900E02E +:1088F0004F4605AA4146584605F089FB4FF0070A46 +:108900004FF00009DCB320460BE000009802002085 +:10891000408810283BD8361D304486B2AE4236D24D +:10892000A01902884245F3D351E000BF9DF817001B +:1089300002074CD594B304EB0608361DB8F8023094 +:10894000B6B2102B23D89A19AA4220D8B8F8002022 +:1089500091421CD1C0061CD5CDE900A90DF1080C2F +:108960000AAAA11948468CE80700B8F800100022AE +:10897000584605F0BAF920B1FEF7BBF982E726E0C8 +:1089800005E0B8F80200BDF82810884201D00B209D +:1089900078E7B8F80200304486B207E0FFE7C00687 +:1089A00004D55846FEF71CFC002888D19DF8170016 +:1089B000BDF81A1020F010008DF81700BDF8170050 +:1089C000ADF80000FF235846009A05F0A4FC05A866 +:1089D00005F029FB18B9BDF81A10B942A6D904212F +:1089E00058460AF0BBFA040000D1FFDFA2895AB151 +:1089F000CDE900A94D46002321465846FEF7BDFBB0 +:108A00000028BBD1A5813DE700203BE72DE9FF4FC2 +:108A10008BB01E4617000D464FF0000412D0B00870 +:108A200002D007200FB0B1E4032E00D100265DB1C3 +:108A30000846F8F752FC28B93888691E0844F8F748 +:108A40004CFC08B11020EDE7C74AB00701D5D18929 +:108A500000E00121F0074FF6FF7802D0D089401ED8 +:108A600000E0404686B206AA0B9805F0D0FA4FF017 +:108A700000094FF0070B0DF1140A38E09DF81B00B8 +:108A8000000734D5CDF80490CDF800B0CDF80890AB +:108A9000CDE9039A434600220B9805F088FB60BBA2 +:108AA00005B3BDF814103A8821442819091D8A42DB +:108AB00030D3BDF81E2020F8022BBDF8142020F87A +:108AC000022BCDE900B9CDE90290CDF810A0BDF898 +:108AD0001E10BDF8143000220B9805F068FB08B199 +:108AE00003209FE7BDF814002044001D84B206A8AF +:108AF00005F099FA20B10A2806D0FEF7FAF891E7B6 +:108B0000BDF81E10B142B9D934B17DB13888A11C6D +:108B1000884203D20C2085E7052083E722462946B8 +:108B2000404605F02AFD014628190180A41C3C801E +:108B3000002077E710B50446F8F7B1FB08B1102024 +:108B400010BD8948C0892080002010BDF0B58BB0D1 +:108B50000D4606461422002103A805F090FC0120D2 +:108B60008DF80C008DF8100000208DF81100ADF884 +:108B700014503046FAF767FC48B10078222812D327 +:108B8000042130460AF0EAF9040005D103E043F27B +:108B900002000BB0F0BDFFDF04F11400074604F043 +:108BA000C6F8800601D40820F3E7207C022140F0BB +:108BB0000100207409A80094CDE90110072203A93F +:108BC00030466368FEF78EFA20B1217C21F0010166 +:108BD0002174DEE729463046F9F765FC08A93846D6 +:108BE00004F094F800B1FFDFBDF82040172C01D24B +:108BF000172000E02046A84201D92C4602E0172C9D +:108C000000D2172421463046FFF711FB214630469B +:108C1000F9F76DF90020BCE7F8B51C4615460E467D +:108C2000069F0AF0CEFA2346FF1DBCB231462A4603 +:108C3000009409F0B8FEF8BD70B50C4605460E224A +:108C40000021204605F01BFC002020802DB1012DC5 +:108C500001D0FFDF70BD062000E00520A07170BDCF +:108C600010B548800878134620F00F00001D20F052 +:108C7000F00080300C4608701422194604F10800F8 +:108C800005F0D3FB00F0CDFC3748046010BD2DE9A2 +:108C9000F047DFF8D890491D064621F0030117463A +:108CA0000C46D9F8000009F094FF050000D1FFDF61 +:108CB0004FF000083560A5F800802146D9F8000083 +:108CC00009F087FF050000D1FFDF7560A5F800807F +:108CD0007FB104FB07F1091D0BD0D9F8000009F0A2 +:108CE00078FF040000D1FFDFB460C4F80080BDE865 +:108CF000F087C6F80880FAE72DE9F0411746491DCC +:108D000021F00302194D064601681446286809F04F +:108D10008BFF22467168286809F086FF3FB104FB8B +:108D200007F2121D03D0B168286809F07DFF042006 +:108D30000AF0BCF8044604200AF0C0F8201A012802 +:108D400004D12868BDE8F04109F038BFBDE8F081E2 +:108D500010B50C4605F02AF900B1FFDF2046BDE84A +:108D60001040FDF7C6BF000098020020140000204C +:108D700038B50C468288817B19B14189914200D96E +:108D80000A462280C188121D90B26A4609F0E8F8AE +:108D9000BDF80000032800D30320C1B2208801F0F1 +:108DA00027F838BD38B50C468288817B19B1018916 +:108DB000914200D90A462280C188121D90B26A46AB +:108DC00009F0CEF8BDF80000022800D30220C1B29D +:108DD000208801F00DF8401CC0B238BD2DE9FF5FBE +:108DE00082468B46FB4814460BF10302D0E9011082 +:108DF000CDE9021022F0030201A84FF49071019214 +:108E000009F0C9FEF44E002C02D1F449019A8A609F +:108E1000019901440191B57F05F1010504D1E8B242 +:108E20000BF0CCFD00B1FFDF019800EB0510C01C7A +:108E300020F0030101915CB9707AB27A1044C2B299 +:108E400000200870308C80B204F00FFF00B1FFDF0B +:108E50000198316A08440190214601A800F08BFF77 +:108E600080460198C01C20F003000190B37AF27A8A +:108E7000717A04B1002009F084FF0199084401903F +:108E8000214601A800F0BFFFD34800273D4690F8D7 +:108E900001900CE0284600F051FF0646817880885A +:108EA000F9F7BCF871786D1C00FB0177EDB24D4508 +:108EB000F0D10198C01C20F00300019004B1002003 +:108EC0003946F9F7B6F80199002708440190C248DD +:108ED0003D4690F801900CE0284600F02FFF064632 +:108EE000C1788088FEF707FC71786D1C00FB017764 +:108EF000EDB24D45F0D10198C01C20F00300019067 +:108F000004B100203946FEF7FFFB01994FF000093C +:108F100008440190B0484D4647780EE0284600F0DE +:108F20000DFF0646807B30B106F1080002F06EF9B5 +:108F3000727800FB02996D1CEDB2BD42EED1019832 +:108F4000C01C20F00300019004B10020A3494A781E +:108F5000494602F05FF9019908440190214601A8B1 +:108F600000F0BCFE0198C01D20F007000190DAF867 +:108F70000010814204D3A0EB0B01B1F5803F04DB6C +:108F80004FF00408CAF8000004E0CAF80000B8F185 +:108F9000000F03D0404604B0BDE8F09F74BB904979 +:108FA0000020019A0DF06CFEFBF7E9F98A4C207F56 +:108FB0000090607F012823D0002318B30022864848 +:108FC00000211030F8F714FA00B1FFDFE07FFEF760 +:108FD00048FF00B1FFDF80484FF4F67200214030B7 +:108FE00005F04DFA7C480421403080F8E91180F802 +:108FF000EA11062180F8EB11032101710020CAE774 +:109000000123DAE702AADAE770B5734C064640346A +:10901000207804EB4015E078083598B9A01990F84D +:10902000E80100280FD0A0780F2800D3FFDF20220E +:109030000021284605F023FA687866F3020068707C +:109040000120E070284670BD2DE9F04105460C4630 +:1090500000270078052190463E46B1EB101F00D056 +:10906000FFDF287A50B101280ED0FFDFA8F800609A +:109070000CB1278066800020BDE8F0810127092619 +:1090800074B16888A08008E00227142644B168887B +:10909000A0802869E060A88A2082287B2072E5E70A +:1090A000A8F80060E7E730B54B4C012000212070A4 +:1090B0006170207260720322A272E0726177217780 +:1090C00021732174052121831F216183607445A1CF +:1090D00061610A21A177E077404D4FF4B0602062D2 +:1090E0006868C11C21F00301814200D0FFDF68687D +:1090F000606030BD30B5394C1568636810339D42EF +:1091000002D20420136030BD334B5D785A6802EB05 +:109110000512107051700320D0801720908001201C +:10912000D0709070002090735878401C5870606820 +:1091300010306060002030BD70B50646264800241F +:10914000457807E0204600F0F9FD0178B14204D0EF +:10915000641CE4B2AC42F5D1002070BDF7B50746FF +:1091600008780C4610B3FFF7E7FF0546A7F1200685 +:10917000202F06D0052E19D2DFE806F00F3838155B +:109180001A0000F0E6FD0DB1697800E00021401AF8 +:10919000A17880B20844FF2808D8A07830B1A08810 +:1091A000022831D202E0608817282DD20720FEBDA8 +:1091B000207A48B361881729F8D3A1881729F5D3F5 +:1091C000A1790029F2D0E1790029EFD0402811D906 +:1091D000ECE7000038620200B40300201800002011 +:1091E000000000206E52463578000000242F0BD17D +:1091F000207A48B161884FF6FB70814202D8A1887D +:10920000814201D90420FEBD65B9207802AA01215E +:10921000FFF770FF0028F6D12078FFF78DFF0500DB +:1092200000D1FFDF052E18D2DFE806F0030B0E0891 +:109230001100A0786870A088E8800FE06088A8809E +:109240000CE0A078A87009E0A078E87006E054F877 +:10925000020FA8606068E86000E0FFDF0020FEBD4C +:109260001A2835D00DDC132832D2DFE800F01B318C +:10927000203131272723252D313129313131312F2B +:109280000F00302802D003DC1E2821D107207047B0 +:109290003A3809281CD2DFE800F0151B0F1B1B1BF6 +:1092A0001B1B07000020704743F20400704743F285 +:1092B00002007047042070470D2070470F20704750 +:1092C0000820704711207047132070470620704710 +:1092D0000320704710B5007800F0010008F032FE5E +:1092E000BDE81040BCE710B5007800F0010008F0C0 +:1092F00032FEBDE81040B3E70EB5017801F0010180 +:109300008DF80010417801F001018DF8011001780D +:10931000C1F340018DF802104178C1F340018DF88E +:109320000310017889088DF80410417889088DF8B8 +:10933000051081788DF80610C1788DF80710007936 +:109340008DF80800684607F046FEFFF789FF0EBD5E +:109350002DE9F84FDFF8F883FE4C00264FF49077A4 +:109360001FE0012000F092FD0120FFF74DFE0546B1 +:109370003946D8F8080009F02CFC686000B9FFDF16 +:10938000686807F0F3FCB0B12846FAF743FB2846BB +:1093900000F082FD28B93A466968D8F8080009F05B +:1093A00043FC94F9E9010428DBDA022009F07EFD90 +:1093B00007460025A5E03A466968D8F8080009F094 +:1093C00033FCF2E7B8F802104046491C89B2A8F80D +:1093D0000210B94201D3002141800221B8F80200F5 +:1093E00009F0BCFD002864D0B8F80200694608F016 +:1093F00018FDFFF735FF00B1FFDF9DF8000078B1E1 +:10940000B8F8020009F0EFFE5FEA000900D1FFDFC3 +:10941000484609F05CF918B1B8F8020002F0C0F94A +:10942000B8F8020009F0CDFE5FEA000900D1FFDFC5 +:10943000484609F044F9E0BB0321B8F8020009F0FE +:109440008DFD5FEA000B47D1FFDF45E0DBF8100040 +:1094500010B10078FF2849D0022000F017FD02204B +:10946000FFF7D2FD8246484609F035FACAF80400F3 +:1094700000B9FFDFDAF8040009F0FDFA00210090DE +:109480000170B8F802105046AAF8021002F08EF8E7 +:10949000484609F0F2FA00B9FFDF504600F0FCFC44 +:1094A00018B99AF80100000704D50098CBF810000D +:1094B00012E024E0DBF8100038B10178491C11F00B +:1094C000FF01017008D1FFDF06E000221146484687 +:1094D00000F002FC00B9FFDF94F9EA01022805DB85 +:1094E000B8F8020002F029F80028AFD194F9E90198 +:1094F000042804DB484609F024FB00B101266D1C5A +:10950000EDB2BD4204D294F9EA010228BFF65AAF87 +:10951000002E7FF422AFBDE8F84F032000F0B6BC68 +:1095200010B58B4CE06008682061AFF2DB10F9F7F2 +:10953000B8FC607010BD8748002140380170844835 +:10954000017085494160704770B505464FF0805005 +:109550000C46D0F8A410491C05D1D0F8A810C94376 +:109560000904090C0BD050F8A01F01F0010129706B +:10957000416821608068A080287830B970BD0621DC +:1095800020460DF002F801202870607940F0C000FC +:10959000607170BD70B54FF080540D46D4F88010E6 +:1095A000491C0BD1D4F88410491C07D1D4F8881079 +:1095B000491C03D1D4F88C10491C0CD0D4F880106D +:1095C0000160D4F884104160D4F888108160D4F828 +:1095D0008C10C16002E010210CF0D7FFD4F890008D +:1095E000401C0BD1D4F89400401C07D1D4F898004B +:1095F000401C03D1D4F89C00401C09D054F8900FB3 +:10960000286060686860A068A860E068E86070BD75 +:109610002846BDE8704010210CF0B7BF4D480079D6 +:10962000F2E470B54B4CE07830B3207804EB401096 +:10963000407A00F00700204490F9E801002800DC9F +:10964000FFDF2078002504EB4010407A00F007008F +:10965000011991F8E801401E81F8E8012078401CCA +:10966000C0B220700F2800D12570A078401CA070D7 +:109670000CF014FEE57070BDFFDF70BD3EB5054611 +:10968000032109F06BFC0446284609F09AFD0546C3 +:1096900004B9FFDF206918B10078FF2800D1FFDF8F +:1096A00001AA6946284600F017FB60B9FFDF0AE00F +:1096B000002202A9284600F00FFB00B9FFDF9DF849 +:1096C000080000B1FFDF9DF80000411E8DF800107A +:1096D000EED220690199884201D1002020613EBD6F +:1096E00070B50546A0F57F400C46FF3800D1FFDF7E +:1096F000012C01D0FFDF70BDFFF790FF040000D107 +:10970000FFDF207820F00F00401D20F0F0005030E7 +:10971000207065800020207201202073BDE8704019 +:109720007FE72DE9F04116460D460746FFF776FF25 +:10973000040000D1FFDF207820F00F00401D20F052 +:10974000F00050302070678001202072286805E00A +:1097500018000020F4030020481400202061A8888D +:10976000A0822673BDE8F0415BE77FB5FFF7E4FC1C +:10977000040000D1FFDF02A92046FFF7F9FA0546F1 +:1097800003A92046FFF70EFB8DF800508DF801006D +:10979000BDF80800001DADF80200BDF80C00001D6A +:1097A000ADF80400E088ADF80600684608F0B4FBA8 +:1097B000002800D0FFDF7FBD2DE9F05FF84E814625 +:1097C000307810B10820BDE8F09F4846F7F767FDF4 +:1097D00008B11020F7E7F34C207808B9FFF763FCD5 +:1097E000A17A607A4D460844C4B200F0B2FAA042B1 +:1097F00007D2201AC1B22A460020FFF77BFC0028BE +:10980000E1D17168E748C91C002721F003017160AC +:10981000B3463E463D46BA463C4690F801800AE0D3 +:10982000204600F08BFA4178807B0E4410FB0155F6 +:10983000641CE4B27F1C4445F2D10AEB870000EBC4 +:10984000C600D84E00EB85005C46F17A012200EBA1 +:109850008100DBF80410451829464846FFF7BEFA98 +:10986000070012D00020FFF767FC05000BD005F1C0 +:109870001300616820F00300884200D0FFDF707899 +:10988000401E7070656038469DE7002229464846B4 +:10989000FFF7A4FA00B1FFDFD9F8000060604FF6CF +:1098A000FF7060800120207000208CE72DE9F041DE +:1098B0000446BB4817460E46007810B10820BDE8A4 +:1098C000F0810846F7F7C5FC08B11020F7E7B54D61 +:1098D000287808B9FFF7E7FB601E1E2807D8012C7F +:1098E00022D13078FE281FD8A8770020E7E7A4F11E +:1098F00020001F2805D8E0B23A463146BDE8F041C5 +:109900002CE4A4F140001F2805D831462046BDE8CC +:10991000F04100F0E9BAA4F1A0001F2804D800200B +:10992000A02C03D0A12C06D00720C8E7317801F085 +:109930000101E977C3E731680922F82901D38B07D0 +:1099400001D01046BBE76B7C03F00303012B04D16D +:109950006B8BD7339CB28C42F3D82962AFE72DE9E9 +:10996000F04781460E460846F7F799FC48B9484645 +:10997000F7F7B3FC28B909F1030020F003014945CA +:1099800002D01020BDE8F08786484FF0000A403032 +:10999000817869B14178804600EB411408343788FA +:1099A00032460021204600F085FA050004D027E069 +:1099B000A6F800A00520E5E7B9F1000F24D0308813 +:1099C000B84201D90C251FE0607800F00705284651 +:1099D00000F05CFA08EB0507324697F8E8014946C3 +:1099E000401C87F8E801204607F5F47700F062FA9A +:1099F00005463878401E3870032000F047FA2DB134 +:109A00000C2D01D0A6F800A02846BBE76078644E74 +:109A100000F00701012923D002290CD0032934D0FA +:109A2000FFDF98F801104046491CC9B288F80110C0 +:109A30000F2935D036E0616821B1000702D4608873 +:109A4000FFF71CFE98F8EA014746012802D170781A +:109A5000F9F746FA97F9EA010428E2DBFFDFE0E7CD +:109A6000616821B14FF49072B06809F0DDF898F8A0 +:109A7000E9014746032802D17078F9F731FA97F9DE +:109A8000E9010428CDDBFFDFCBE7C00602D5608803 +:109A9000FFF7F4FD98F9EB010628C2DBFFDFC0E712 +:109AA00080F801A08178491E8170617801F007017A +:109AB00001EB080090F8E811491C80F8E811A3E7D1 +:109AC00070B50D460446F7F7C4FB18B92846F7F7FA +:109AD000E6FB08B1102070BD29462046BDE8704065 +:109AE0000AF0A4BF70B505460AF0C3FFC4B2284609 +:109AF000F7F7F3FB08B1102070BD35B128782C7052 +:109B000018B1A04201D0072070BD2046FDF760FECD +:109B1000052805D10AF0B1FF012801D0002070BD51 +:109B20000F2070BD70B5044615460E460846F7F77F +:109B300090FB18B92846F7F7B2FB08B1102070BDAA +:109B4000022C03D0102C01D0092070BD2A463146CA +:109B500020460AF09BFF0028F7D0052070BD70B5A5 +:109B600014460D460646F7F774FB38B92846F7F752 +:109B700096FB18B92046F7F7B0FB08B1102070BD6E +:109B80002246294630460AF0A0FF0028F7D00720D9 +:109B900070BD3EB50446F7F782FB28B110203EBDEC +:109BA00018000020B4030020684607F085F9FFF78D +:109BB00057FB0028F3D19DF806002070BDF808007F +:109BC0006080BDF80A00A0800020E8E770B5054677 +:109BD0000C460846F7F781FB20B93CB12068F7F73F +:109BE0005EFB08B1102070BDA08828B12146284630 +:109BF000BDE87040FDF744BE092070BD70B5054654 +:109C00000C460846F7F725FB30B9681E1E2814D805 +:109C10002046F7F71EFB08B1102070BD032D01D9B7 +:109C2000072070BD05B9FFDFF94800EB850050F84B +:109C3000041C2046BDE870400847A5F120001F28FD +:109C400005D821462846BDE87040FAF70EBBF02D36 +:109C50000CD0F12D13D0BF2DE2D1A078218800F0D7 +:109C6000010001F059FB88B1002070BDA068F7F732 +:109C7000F0FA0028D0D1204608F0B3F902E02078AD +:109C800008F0D2F9BDE87040FFF7EABA082070BDCD +:109C900070B504460D460846F7F701FB30B9601E63 +:109CA0001E280FD82846F7F7D4FA08B1102070BD47 +:109CB000012C03D0022C01D0032C01D1062070BD51 +:109CC000072070BDA4F120001F28F9D8294620469E +:109CD000BDE87040FAF733BB08F0C0BC7CB5044661 +:109CE000CC48007B00F0010511BB04F0EBFB0DB18B +:109CF000226800E00022C8484178C06806F0A9FD4B +:109D0000C5481030C0788DF8000010B1012802D08D +:109D100004E0012000E000208DF80000684607F014 +:109D20003BF9BB4824380068019001A807F0EEFE1B +:109D3000002D02D02068283020607CBD30B5B54DA4 +:109D400004466878A04200D8FFDF686800EB041082 +:109D500030BD70B5AF4800252C46467807E0204658 +:109D6000FFF7ECFF4078641C2844C5B2E4B2B4426B +:109D7000F5D1284670BD2DE9F0410C4607464FF05D +:109D8000000800F0EDF80646FF2801D94FF013084F +:109D90003868C01C20F003023A6054EA080421D15C +:109DA0009C48F3B2072124300CF0FCFD09E0072C9D +:109DB00010D2DFE804F0060408080A0406009748F9 +:109DC00004E0974802E0974800E097480CF00AFE4C +:109DD000054600E0FFDFA54200D0FFDF641CE4B2CF +:109DE000072CE4D3386800EB06103860404666E57F +:109DF000021D5143452900D245210844C01CB0FB37 +:109E0000F2F0C0B270472DE9FC5F064681484FF082 +:109E100000088B464746444690F8019022E02046D1 +:109E2000FFF78CFF050000D1FFDF687869463844F2 +:109E3000C7B22846FEF79CFF824601A92846FEF7D6 +:109E4000B1FF0346BDF804005246001D81B2BDF8C3 +:109E50000000001D80B209F0FFF86A78641C00FB66 +:109E60000288E4B24C45DAD13068C01C20F003000F +:109E70003060BBF1000F00D000204246394609F0A7 +:109E8000F9F8316808443060BDE8FC9F6149403111 +:109E900008710020C87070475E494031CA782AB105 +:109EA0000A7801EB42110831814201D0012070474C +:109EB000002070472DE9F04106460078154600F075 +:109EC0000F0400201080601E0F46052800D3FFDF1E +:109ED0004F482A46183800EB8400394650F8043CB5 +:109EE0003046BDE8F04118472DE9F041494E0C4697 +:109EF000402806D0412823D042282BD0432806D121 +:109F000023E0A07861780D18E178814201D907201B +:109F1000D5E42078012801D91320D0E4FF2D08D8FA +:109F20000AF03EFF07460CF071F9381A801EA8426D +:109F300001DA1220C3E42068B060207930730DE0AC +:109F4000BDE8F041084600F036B808780228DED8AF +:109F5000307703E008780228D9D870770020AEE483 +:109F60002DE9F047DFF8AC900026344699F8090057 +:109F700099F80A2099F801700244D5B299F80B209B +:109F8000104400F0FF0808E02046FFF7D7FE817B71 +:109F9000407811FB0066641CE4B2BC42F4D199F82D +:109FA000091099F80A0029442944414400B10120CC +:109FB00008443044E6E438B50446407800F0030035 +:109FC000012803D002280BD0072038BD606858B1A3 +:109FD000F7F78CF9D0B96068F7F77FF920B915E089 +:109FE0006068F7F736F988B969462046FCF74EF8FD +:109FF0000028EAD1607800F00300022816D19DF80D +:10A00000000098B16068F7F768F978B1102038BDA2 +:10A010005C620200B4030020180000206B410000C5 +:10A0200035B30000B52F0000AF4701006189F82962 +:10A030000DD8208988420AD8607800F003020A48C7 +:10A04000012A06D1D731026A89B28A4201D2092097 +:10A05000DDE794E80E0000F1100585E80E000AB96E +:10A06000002101830020D2E7B40300202DE9F04154 +:10A07000074614468846084601F08AFD064608EB66 +:10A0800088001C22796802EBC0000D18688C58B15A +:10A090004146384601F08BFD014678680078C200E1 +:10A0A000082305F120000CE0E88CA8B141463846B1 +:10A0B00001F084FD0146786808234078C20005F16C +:10A0C000240008F008FE38B1062121726681D0E92B +:10A0D0000010C4E9031009E0287809280BD00520F6 +:10A0E000207266816868E060002028702046BDE824 +:10A0F000F04101F02EBD072020726681F4E72DE9C2 +:10A10000F04116460D460746406801EB85011C22CA +:10A1100002EBC1014418204601F072FD40B100215C +:10A12000708865F30F2160F31F4106200CF014FDC9 +:10A1300009202070324629463846BDE8F04195E7AF +:10A140002DE9F0410E46074600241C21F07816E068 +:10A1500004EB8403726801EBC303D25C6AB1FFF7BE +:10A160005DFA050000D1FFDF6F802A4621463046A8 +:10A17000FFF7C5FF0120BDE8F081641CE4B2A042F6 +:10A18000E6D80020F7E770B5064600241C21C07809 +:10A190000AE000BF04EB8403726801EBC303D51827 +:10A1A0002A782AB1641CE4B2A042F3D8402070BDE2 +:10A1B00028220021284604F062F9706880892881ED +:10A1C000204670BD70B5034600201C25DC780CE0ED +:10A1D00000EB80065A6805EBC6063244167816B1C5 +:10A1E000128A8A4204D0401CC0B28442F0D8402077 +:10A1F00070BDF0B5044600201C26E5780EE000BFD7 +:10A2000000EB8007636806EBC7073B441F788F426B +:10A2100002D15B78934204D0401CC0B28542EFD893 +:10A220004020F0BD0078032801D0002070470120B5 +:10A2300070470078022801D0002070470120704745 +:10A240000078072801D000207047012070472DE9D1 +:10A25000F041064688461078F1781546884200D3CA +:10A26000FFDF2C781C27641CF078E4B2A04201D8F0 +:10A27000201AC4B204EB8401706807EBC1010844E2 +:10A28000017821B14146884708B12C7073E72878DE +:10A29000A042E8D1402028706DE770B514460B88C5 +:10A2A0000122A240134207D113430B8001230A224B +:10A2B000011D08F0DAFC047070BD2DE9FF4F81B07C +:10A2C0000878DDE90E7B9A4691460E4640072CD46D +:10A2D000019808F088FF040000D1FFDF07F10408AF +:10A2E00020461FFA88F108F0C5F8050000D1FFDF0D +:10A2F000204629466A4608F010FB0098A0F8037033 +:10A30000A0F805A0284608F0B6FB017869F306011D +:10A310006BF3C711017020461FFA88F108F0EDF8C1 +:10A3200000B9FFDF019806F002FA06EB0900017F91 +:10A33000491C017705B0BDE8F08F2DE9F84F0E46B6 +:10A340009A4691460746032108F008FE0446008D10 +:10A35000DFF8B885002518B198F80000B0421ED18A +:10A36000384608F040FF070000D1FFDF09F1040183 +:10A37000384689B208F07EF8050010D038462946E4 +:10A380006A4608F0CAFA009800210A4601808170E6 +:10A3900006F08AFA0098C01DCAF8000021E098F87B +:10A3A0000000B04216D104F1260734F8341F012012 +:10A3B00000FA06F911EA090F00D0FFDF2088012317 +:10A3C00040EA090020800A22391D384608F068FC5E +:10A3D000067006E0324604F1340104F12600FFF76E +:10A3E0005CFF0A2188F800102846BDE8F88FFEB50A +:10A3F00015460C46064602AB0C220621FFF79DFFD0 +:10A40000002827D00299607812220A70801C4870B8 +:10A4100008224A80A07002982988052381806988D3 +:10A42000C180A9880181E988418100250C20CDE9FE +:10A430000005062221463046FFF73FFF294600224D +:10A4400066F31F41F02310460CF0DCFA6078801CA4 +:10A4500060700120FEBDFEB514460D46062206467C +:10A4600002AB1146FFF769FF002812D0029B1320B0 +:10A4700000211870A8785870022058809C8006200F +:10A48000CDE900010246052329463046FFF715FFB6 +:10A490000120FEBD2DE9FE430C46804644E002ABA0 +:10A4A0000E2207214046FFF748FF002841D0606890 +:10A4B0001C2267788678BF1C06EB860102EBC1017F +:10A4C000451802981421017047700A214180698A59 +:10A4D0000181E98A4181A9888180A98981813046E9 +:10A4E00001F056FB029905230722C8806F700420F3 +:10A4F000287000250E20CDE9000521464046FFF7D3 +:10A50000DCFE294666F30F2168F31F41F023002289 +:10A5100006200CF077FA6078FD49801C6070626854 +:10A520002046921CFFF793FE606880784028B6D1E1 +:10A530000120BDE8FE83FEB50D46064638E002ABBD +:10A540000E2207213046FFF7F8FE002835D0686854 +:10A550001C23C17801EB810203EBC202841802982C +:10A5600015220270627842700A224280A2894281DA +:10A57000A2888281084601F00BFB01460298818087 +:10A58000618AC180E18A0181A088B8B10020207071 +:10A5900000210E20CDE9000105230722294630467F +:10A5A000FFF78BFE6A68DB492846D21CFFF74FFE97 +:10A5B0006868C0784028C2D10120FEBD0620E6E7C9 +:10A5C0002DE9FE430C46814644E0204601F002FBA3 +:10A5D000D0B302AB082207214846FFF7AEFE0028A1 +:10A5E000A7D060681C2265780679AD1C06EB860151 +:10A5F00002EBC10147180298B7F8108006210170DC +:10A60000457004214180304601F0C2FA01460298AB +:10A6100005230722C180A0F804807D7008203870CF +:10A620000025CDE9000521464846FFF746FE2946AC +:10A6300066F30F2169F31F41F023002206200CF07E +:10A64000E1F96078801C60706268B3492046121D91 +:10A65000FFF7FDFD606801794029B6D1012068E768 +:10A660002DE9F34F83B00D4691E0284601F0B2FA90 +:10A6700000287DD068681C2290F806A00AEB8A01A9 +:10A6800002EBC10144185146284601F097FAA1781F +:10A69000CB0069684978CA00014604F1240008F03B +:10A6A00036FB07468188E08B4FF00009091A8EB20D +:10A6B00008B1C84607E04FF00108504601F053FAD0 +:10A6C00008B9B61CB6B2208BB04200D80646B346D5 +:10A6D00002AB324607210398FFF72FFE060007D092 +:10A6E000B8F1000F0BD0504601F03DFA10B106E072 +:10A6F00000201FE60299B8884FF0020908800196F1 +:10A70000E28B3968ABEB09001FFA80F80A44039822 +:10A710004E46009208F067FDDDE90021F61D434634 +:10A72000009608F074F9E08B404480B2E083B98869 +:10A73000884201D1012600E00026CDE900B6238A37 +:10A74000072229460398FFF7B8FD504601F00BFA9F +:10A7500010B9E089401EE08156B1A078401CA0707D +:10A760006868E978427811FB02F1CAB2012300E07F +:10A7700007E081690E3008F078FA80F800A0002028 +:10A78000E0836A6865492846921DFFF760FD6868A6 +:10A79000817940297FF469AF0120CBE570B5064689 +:10A7A00048680D4614468179402910D104EB840194 +:10A7B0001C2202EBC101084401F043FA002806D034 +:10A7C0006868294684713046BDE8704048E770BD2E +:10A7D000FEB50C460746002645E0204601F0FAF992 +:10A7E000D8B360681C22417901EB810102EBC10101 +:10A7F0004518688900B9FFDF02AB082207213846F7 +:10A80000FFF79BFD002833D00299607816220A706A +:10A81000801C4870042048806068407901F0B8F9D5 +:10A82000014602980523072281806989C18008209A +:10A83000CDE9000621463846FFF73FFD6078801CD1 +:10A840006070A88969890844B0F5803F00D3FFDFB4 +:10A85000A88969890844A8816E81626830492046C8 +:10A86000521DFFF7F4FC606841794029B5D1012001 +:10A87000FEBD30B5438C458BC3F3C704002345B1FF +:10A88000838B641EED1AC38A6D1E1D4495FBF3F382 +:10A89000E4B22CB1008918B1A04200D8204603448C +:10A8A0004FF6FF70834200D3034613800C7030BD17 +:10A8B0002DE9FC41074616460D46486802EB860125 +:10A8C0001C2202EBC10144186A4601A92046FFF789 +:10A8D000D0FFA089618901448AB2BDF8001091427D +:10A8E00012D0081A00D5002060816868407940289D +:10A8F0000AD1204601F09BF9002805D06868294656 +:10A9000046713846FFF764FFBDE8FC812C0000204B +:10A9100025A2000033A2000041A2000043BC0000B9 +:10A920002FBC00002DE9FE4F0F468146154650888A +:10A93000032108F013FB0190B9F8020001F01BF9A4 +:10A9400082460146019801F045F9002824D001987B +:10A950001C2241680AEB8A0002EBC0000C1820465A +:10A9600001F04EF9002817D1B9F80000E18A8842B9 +:10A970000ED8A18961B1B8420ED100265146019886 +:10A9800001F015F9218C01EB0008608B30B114E067 +:10A99000504601F0E8F8A0B3BDE8FE8F504601F044 +:10A9A000E2F808B1678308E0022FF5D3B9F8040094 +:10A9B0006083618A884224D80226B81B87B2B8F81F +:10A9C0000400A28B801A002814DD874200DA384682 +:10A9D0001FFA80FB688869680291D8F800100A4461 +:10A9E000009208F0EEFBF61D009A5B460299009675 +:10A9F00007F0D9FFA08B384480B2A083618B8842D6 +:10AA000007D96888019903B05246BDE8F04F01F0BC +:10AA100035B91FD14FF009002872B9F802006881DA +:10AA2000D8E90010C5E90410608BA881284601F020 +:10AA300090F85146019801F0BAF8014601980823B0 +:10AA400040680078C20004F1200008F044F90020BA +:10AA5000A0836083504601F086F810B9A089401E9B +:10AA6000A0816888019903B00AF0FF02BDE8F04FA9 +:10AA70001EE72DE9F041064615460F461C461846CE +:10AA8000F6F7E7FB18B92068F6F709FC10B11020BB +:10AA9000BDE8F0817168688C0978B0EBC10F01D313 +:10AAA0001320F5E73946304601F081F80146706819 +:10AAB00008230078C20005F1200008F0D6F8D4E998 +:10AAC0000012C0E900120020E2E710B5044603219D +:10AAD00008F044FA0146007800F00300022805D08F +:10AAE0002046BDE8104001F1140280E48A8A204625 +:10AAF000BDE81040AFE470B50446032108F02EFA1B +:10AB0000054601462046FFF75BFD002816D0294682 +:10AB10002046FFF75DFE002810D029462046FFF7AB +:10AB20000AFD00280AD029462046FFF7B3FC00287A +:10AB300004D029462046BDE8704091E570BD2DE95E +:10AB4000F0410C4680461EE0E178427811FB02F1AC +:10AB5000CAB2816901230E3008F0BDF80778606839 +:10AB60001C22C179491EC17107EB8701606802EBA5 +:10AB7000C10146183946204601F02CF818B130467C +:10AB800001F037F820B16068C1790029DCD17FE796 +:10AB9000FEF744FD050000D1FFDF0A202872384689 +:10ABA00000F0F6FF68813946204601F007F80146BB +:10ABB000606808234078C20006F1240008F08BF892 +:10ABC000D0E90010C5E90310A5F80280284600F07E +:10ABD000C0FFB07800B9FFDFB078401EB07057E713 +:10ABE00070B50C460546032108F0B8F901464068E7 +:10ABF000C2792244C2712846BDE870409FE72DE922 +:10AC0000FE4F8246507814460F464FF00008002849 +:10AC10004FD0012807D0022822D0FFDF2068B8607B +:10AC20006068F860B8E602AB0E2208215046FFF7D4 +:10AC300084FB0028F2D002981521052301702178A9 +:10AC400041700A214180C0F80480C0F80880A0F853 +:10AC50000C80628882810E20CDE90008082221E064 +:10AC6000A678304600F094FF054606EB86012C22BC +:10AC7000786802EBC1010822465A02AB11465046E1 +:10AC8000FFF75BFB0028C9D00298072101702178EB +:10AC900041700421418008218580C680CDE90018DB +:10ACA00005230A4639465046FFF707FB87F8088018 +:10ACB00072E6A678022516B1022E13D0FFDF2A1DF8 +:10ACC000914602AB08215046FFF737FB0028A5D07C +:10ACD00002980121022E0170217841704580868002 +:10ACE00002D005E00625EAE7A188C180E18801815C +:10ACF000CDE900980523082239465046D4E710B51F +:10AD00000446032108F02AF9014600F10802204612 +:10AD1000BDE8104073E72DE9F04F0F4605468DB0B2 +:10AD200014465088032108F019F94FF000088DF8F7 +:10AD300014800646ADF81680042F7BD36A78002A6B +:10AD400078D028784FF6FF794FF01C0A132834D0BA +:10AD500008DC012871D006284AD007286ED01228B6 +:10AD60000ED106E014286AD0152869D0162807D11C +:10AD7000AAE10C2F04D1307800F00301022907D09A +:10AD8000CDF80880CDF80C8068788DF808004CE08C +:10AD900040F0080030706878B07001208DF8140021 +:10ADA000A888ADF81800E888ADF81A002889ADF831 +:10ADB0001C006889ADF81E0011E1B078904239D1CD +:10ADC0003078010736D5062F34D120F008003070D6 +:10ADD0006088414660F31F4100200BF0BDFE022059 +:10ADE0008DF81400ADF81890A888ADF81A00F6E0B8 +:10ADF000082F1FD1A888EF88814600F0BCFE80464E +:10AE00000146304600F0E6FE18B1404600F0ABFEC9 +:10AE1000B8B1FC48D0E90010CDE902106878ADF86F +:10AE20000C908DF80800ADF80E70608802AA3146CB +:10AE3000FFF7E5FE0DB0BDE8F08FB6E01EE041E0A3 +:10AE4000ECE0716808EB88002C2202EBC000085A85 +:10AE5000B842EFD1EB4802AAD0E90210CDE90210C6 +:10AE600068788DF8080008F0FF058DF80A506088B2 +:10AE70003146FFF7C4FE224629461FE0082FD9D1EC +:10AE8000B5F80480E88800F076FE074601463046B3 +:10AE900000F0A0FE0028CDD007EB870271680AEB16 +:10AEA000C2000844028A4245C4D101780829C1D1B0 +:10AEB000407869788842BDD1F9B222463046FFF722 +:10AEC0001EF9B7E70E2F7FF45BAFE9886F898B46D9 +:10AED000B5F808903046FFF775F9ABF1400140290D +:10AEE00001D309204AE0B9F1170F01D3172F01D27E +:10AEF0000B2043E040280ED000EB800271680AEB83 +:10AF0000C20008440178012903D140786978884259 +:10AF100090D00A2032E03046FFF735F9014640284C +:10AF20002BD001EB810372680AEBC30002EB00082F +:10AF3000012288F800206A7888F801207068AA88C1 +:10AF40004089B84200D93846AD8903232372A282D2 +:10AF5000E7812082A4F80C906582084600F018FE74 +:10AF60006081A8F81490A8F81870A8F80E50A8F8F6 +:10AF700010B0204600F0EDFD5CE7042005212172B1 +:10AF8000A4F80A80E081012121739E49D1E90421BE +:10AF9000CDE9022169788DF80810ADF80A006088C3 +:10AFA00002AA3146FFF72BFEE3E7062F89D3B078DC +:10AFB00090421AD13078010717D520F00800307080 +:10AFC0006088414660F31F4100200BF0C5FD022060 +:10AFD0008DF81400A888ADF81800ADF81A906088B4 +:10AFE000224605A9F9F7EDF824E704213046FFF7DA +:10AFF00000F905464028BFD0022083030090224676 +:10B000002946304600F003FE4146608865F30F2173 +:10B0100060F31F4106200BF09FFD0BE70E2FABD115 +:10B0200004213046FFF7E5F881464028A4D0414688 +:10B03000608869F30F2160F31F4106200BF08CFD3F +:10B04000A8890B906889099070682F894089B84257 +:10B0500000D938468346B5F80680A8880A90484645 +:10B0600000F096FD60810B9818B1022000900B9BB8 +:10B0700024E0B8F1170F1ED3172F1CD30420207221 +:10B0800009986082E781A4F810B0A4F80C8009EB5D +:10B09000890271680AEBC2000D18DDE90913A5F8F1 +:10B0A0001480A5F818B0E9812B82204600F051FDEC +:10B0B00006202870BEE601200B2300902246494658 +:10B0C000304600F0A4FDB5E6082F8DD1A9883046A2 +:10B0D000FFF778F80746402886D000F044FD0028A6 +:10B0E0009BD107EB870271680AEBC20008448046D7 +:10B0F00000F086FD002890D1ED88B8F80E002844B5 +:10B10000B0F5803F05D360883A46314600F0B6FD81 +:10B1100090E6002DCED0A8F80E0060883A46314661 +:10B12000FFF73CFB08202072384600F031FD6081BB +:10B13000A5811EE72DE9F05F0C4601281FD0957907 +:10B1400092F8048092F8056005EB85011F2202EB5E +:10B15000C10121F0030B08EB060111FB05F14FF6CD +:10B16000FF7202EAC10909F1030115FB0611264F1E +:10B1700021F0031ABB6840B101283ED125E0616887 +:10B18000E57891F800804E78DEE75946184607F0DA +:10B1900020FD606000B9FFDF5A460021606803F0BF +:10B1A0006EF9E5705146B86807F013FD61684861B3 +:10B1B00000B9FFDF6068426902EB090181616068E4 +:10B1C00080F800806068467017E060685246416908 +:10B1D000184607F029FD5A466168B86807F024FD53 +:10B1E000032007F063FE0446032007F067FE201AE1 +:10B1F000012802D1B86807F0E1FC0BEB0A00BDE8BA +:10B20000F09F0000686202002C000020024600212E +:10B2100002208FE7F7B5FF4C0A20164620700098F1 +:10B2200060B100254FEA0D0007F0B5FC0021A170C8 +:10B230006670002D01D10099A160FEBD012500209E +:10B24000F2E770B50C46154638220021204603F07F +:10B2500016F9012666700A22002104F11C0003F091 +:10B260000EF905B9FFDF297A207861F3010020701B +:10B27000A87900282DD02A4621460020FFF75AFF42 +:10B2800061684020E34A88706168C870616808712D +:10B29000616848716168887161682888088161689F +:10B2A00068884881606886819078002811D061683C +:10B2B0000620087761682888C885616828884886DC +:10B2C00060680685606869889288018681864685FF +:10B2D000828570BDC878002802D00022012029E7AD +:10B2E000704770B50546002165F31F4100200BF043 +:10B2F00033FC0321284607F031FE040000D1FFDFB4 +:10B3000021462846FEF71CFF002804D0207840F094 +:10B3100010002070012070BD70B505460C4603205A +:10B3200007F0B6FD08B1002070BDBA488570848072 +:10B33000012070BD2DE9FF4180460E460F0CFEF73F +:10B340006DF9050007D06F800321384607F006FE2F +:10B35000040008D106E004B03846BDE8F0411321EE +:10B36000F9F758BBFFDF5FEA080005D0B8F1060F18 +:10B3700018D0FFDFBDE8FF8120782A4620F00800C2 +:10B3800020700020ADF8020002208DF800004FF67A +:10B39000FF70ADF80400ADF8060069463846F8F7CE +:10B3A00010FFE7E7C6F3072101EB81021C23606869 +:10B3B00003EBC202805C042803D008280AD0FFDF18 +:10B3C000D8E7012000904FF440432A46204600F081 +:10B3D0001EFCCFE704B02A462046BDE8F041FEF748 +:10B3E0008EBE2DE9F05F05464089002790460C4649 +:10B3F0003E46824600F0BFFB8146287AC01E0828E0 +:10B400006BD2DFE800F00D04192058363C47722754 +:10B410001026002C6CD0D5E90301C4E902015CE0E0 +:10B4200070271226002C63D00A2205F10C0104F1CA +:10B43000080002F0FAFF50E071270C26002C57D0CC +:10B44000E868A06049E0742710269CB3D5E90301A1 +:10B45000C4E902016888032107F080FD8346FEF7F6 +:10B46000DDF802466888508049465846FEF7FEFDE2 +:10B4700033E075270A26ECB1A88920812DE07627D4 +:10B480001426BCB105F10C0004F1080307C883E8D9 +:10B49000070022E07727102664B1D5E90301C4E94B +:10B4A00002016888032107F059FD01466888FFF70B +:10B4B00046FB12E01CE073270826CCB16888032104 +:10B4C00007F04CFD01460078C00606D56888FEF7F7 +:10B4D00037FE10B96888F8F781FAA8F800602CB137 +:10B4E0002780A4F806A066806888A080002086E6F1 +:10B4F000A8F80060FAE72DE9FC410C461E46174605 +:10B500008046032107F02AFD05460A2C0AD2DFE80F +:10B5100004F005050505050509090907042303E0ED +:10B52000062301E0FFDF0023CDE90076224629460D +:10B530004046FEF7C2FEBDE8FC81F8B50546A0F521 +:10B540007F40FF382BD0284607F03BFE040000D197 +:10B55000FFDF204607F0BFF9002821D001466A46E8 +:10B56000204607F0DAF900980321B0F80560284674 +:10B5700007F0F4FC0446052E13D0304600F0FBFA29 +:10B5800005460146204600F025FB40B1606805EB0A +:10B5900085013E2202EBC101405A002800D0012063 +:10B5A000F8BD007A0028FAD00020F8BDF8B50446AE +:10B5B000408807F006FE050000D1FFDF6A462846F6 +:10B5C000616800F0C4FA01460098091F8BB230F898 +:10B5D000032F0280428842800188994205D1042AC3 +:10B5E00008D0052A20D0062A16D022461946FFF791 +:10B5F00099F9F8BD001D0E46054601462246304623 +:10B60000F6F73BFF0828F4D1224629463046FCF7DE +:10B610007EF9F8BD2C000020636864880A46011D8D +:10B620002046FAF7A1F9F4E72246001DFFF773FB65 +:10B63000EFE770B50D460646032107F08FFC0400C6 +:10B6400004D02078000704D5112070BD43F2020019 +:10B6500070BD2A4621463046FEF7C9FE18B9286853 +:10B6600060616868A061207840F0080020700020C8 +:10B6700070BD70B50D460646032107F06FFC04004F +:10B6800004D02078000704D4082070BD43F20200E3 +:10B6900070BD2A4621463046FEF7DDFE00B9A58280 +:10B6A000207820F008002070002070BD2DE9F04FB8 +:10B6B0000E4691B08046032107F050FC04464046F8 +:10B6C00007F091FD07460020079008900990ADF81B +:10B6D00030000A9002900390049004B9FFDF0DF14E +:10B6E0000809FFB9FFDF1DE038460BA9002206F06C +:10B6F000B5FF9DF82C0000F07F050A2D00D3FFDF79 +:10B700006019017F491E01779DF82C00000609D5BC +:10B710002A460CA907A8FEF7C0FD19F80510491C18 +:10B7200009F80510761EF6B2DED204F13400F84DA9 +:10B7300004F1260BDFF8DCA304F12A07069010E0E1 +:10B740005846069900F08CFA064628700A2800D35D +:10B75000FFDF5AF8261040468847E08CC05DB042B3 +:10B7600002D0208D0028EBD10A202870E94D4E46EA +:10B7700028350EE00CA907A800F072FA0446375DE0 +:10B7800055F8240000B9FFDF55F82420394640461B +:10B790009047BDF81E000028ECD111B0BDE8F08F35 +:10B7A00010B5032107F0DAFB040000D1FFDF0A2205 +:10B7B000002104F11C0002F062FE207840F0040039 +:10B7C000207010BD10B50C46032107F0C7FB2044C4 +:10B7D000007F002800D0012010BD2DE9F84F8946D8 +:10B7E00015468246032107F0B9FB070004D028461E +:10B7F000F5F72FFD40B903E043F20200BDE8F88FF2 +:10B800004846F5F74CFD08B11020F7E7786828B1F5 +:10B8100069880089814201D90920EFE7B9F8000061 +:10B820001C2488B100F0A7F980460146384600F094 +:10B83000D1F988B108EB8800796804EBC000085C96 +:10B8400001280BD00820D9E73846FEF79CFC80463B +:10B85000402807D11320D1E70520CFE7FDF7DEFE12 +:10B8600006000BD008EB8800796804EBC0000C18C8 +:10B87000B9F8000020B1E88910B113E01120BDE74C +:10B880002888172802D36888172801D20720B5E72F +:10B89000686838B12B1D224641463846FFF7E9F863 +:10B8A0000028ABD104F10C0269462046FEF7E1FF07 +:10B8B000288860826888E082B9F8000030B10220F0 +:10B8C0002070E889A080E889A0B12BE003202070D7 +:10B8D000A889A08078688178402905D180F8028005 +:10B8E00039465046FEF7D6FD404600F051F9A9F81A +:10B8F000000021E07868218B4089884200D9084601 +:10B900002083A6F802A004203072B9F800007081EC +:10B91000E0897082F181208B3082A08AB08130462C +:10B9200000F017F97868C178402905D180F80380C4 +:10B9300039465046FEF7FFFD00205FE770B50D4623 +:10B940000646032107F00AFB04000ED0284600F04B +:10B9500012F905460146204600F03CF918B1284688 +:10B9600000F001F920B1052070BD43F2020070BD66 +:10B9700005EB85011C22606802EBC101084400F060 +:10B980003FF908B1082070BD2A462146304600F034 +:10B9900075F9002070BD2DE9F0410C461746804630 +:10B9A000032107F0DBFA0546204600F0E4F80446E0 +:10B9B00095B10146284600F00DF980B104EB8401F1 +:10B9C0001C22686802EBC1014618304600F018F9E5 +:10B9D00038B10820BDE8F08143F20200FAE7052003 +:10B9E000F8E73B46324621462846FFF742F8002852 +:10B9F000F0D1E2B229464046FEF75AFF708C083873 +:10BA0000082803D242484078F7F76AFA0020E1E7B5 +:10BA10002DE9F0410D4617468046032107F09EFAB6 +:10BA20000446284600F0A7F8064624B13846F5F744 +:10BA300010FC38B902E043F20200CBE73868F5F7B2 +:10BA400008FC08B11020C5E73146204600F0C2F8D6 +:10BA500060B106EB86011C22606802EBC10145184B +:10BA6000284600F0CDF818B10820B3E70520B1E76B +:10BA7000B888A98A884201D90C20ABE76168E88CB4 +:10BA80004978B0EBC10F01D31320A3E7314620461C +:10BA900000F094F80146606808234078C20005F180 +:10BAA000240007F0E2F8D7E90012C0E90012F2B270 +:10BAB00021464046FEF772FE00208BE72DE9F04755 +:10BAC0000D461F4690468146032107F047FA04467B +:10BAD000284600F050F806463CB14DB13846F5F71F +:10BAE000FCFB50B11020BDE8F08743F20200FAE7FA +:10BAF000606858B1A0F80C8027E03146204600F07D +:10BB000069F818B1304600F02EF828B10520EAE7B0 +:10BB10002C0000208062020006EB86011C22606877 +:10BB200002EBC1014518284600F06AF808B1082068 +:10BB3000D9E7A5F80880F2B221464846FEF7B8FEDC +:10BB40001FB1A8896989084438800020CBE706F036 +:10BB5000E4BE017821F00F01491C21F0F001103101 +:10BB60000170FDF75EBD20B94E48807808B1012014 +:10BB70007047002070474B498988884201D10020D6 +:10BB80007047402801D2402000E0403880B2704722 +:10BB900010B50446402800D9FFDF2046FFF7E3FF39 +:10BBA00010B14048808810BD4034A0B210BD40683C +:10BBB00042690078484302EBC0007047C278406891 +:10BBC000037812FB03F24378406901FB032100EB89 +:10BBD000C1007047C2788A4209D9406801EB8101EF +:10BBE0001C2202EBC101405C08B10120704700201B +:10BBF00070470078062801D901207047002070475F +:10BC00000078062801D00120704700207047F0B46A +:10BC100001EB81061C27446807EBC6063444049DEB +:10BC200005262670E3802571F0BCFEF71FBA10B51B +:10BC3000418911B1FFF7DDFF08B1002010BD0120DF +:10BC400010BD10B5C18C8278B1EBC20F04D9C18987 +:10BC500011B1FFF7CEFF08B1002010BD012010BDCB +:10BC600010B50C4601230A22011D07F034F80078B4 +:10BC70002188012282409143218010BDF0B402EB63 +:10BC800082051C264C6806EBC505072363554B68E7 +:10BC90001C79402C03D11A71F0BCFEF791BCF0BCAA +:10BCA000704700002C00002010B5EFF3108000F06A +:10BCB000010472B6FC484178491C41704078012863 +:10BCC00001D10AF013FB002C00D162B610BD70B593 +:10BCD000F54CA07848B90125A570FFF7E5FF0AF0FB +:10BCE00016FB20B100200AF0E0FA002070BD4FF0F2 +:10BCF0008040E570C0F80453F7E770B5EFF31080AB +:10BD000000F0010572B6E84C607800B9FFDF60789A +:10BD1000401E6070607808B90AF0ECFA002D00D17E +:10BD200062B670BDE04810B5817821B10021C170C4 +:10BD30008170FFF7E2FF002010BD10B504460AF045 +:10BD4000E6FAD9498978084000D001202060002017 +:10BD500010BD10B5FFF7A8FF0AF0D9FA022201239F +:10BD6000D149540728B1D1480260236103200872E9 +:10BD700002E00A72C4F804330020887110BD2DE976 +:10BD8000F84FDFF824934278817889F80420002660 +:10BD900089F80510074689F806600078DFF810B3C7 +:10BDA000354620B1012811D0022811D0FFDF0AF05A +:10BDB000C0FA4FF0804498B10AF0C2FAB0420FD1F5 +:10BDC00030460AF0C1FA0028FAD042E00126EEE738 +:10BDD000FFF76AFF58460168C907FCD00226E6E76C +:10BDE0000120E060C4F80451B2490E600107D1F8A7 +:10BDF0004412B04AC1F3423124321160AD493431AA +:10BE000008604FF0020AC4F804A3A060AA480168C1 +:10BE1000C94341F3001101F10108016841F010012B +:10BE2000016001E0F7F7E0F8D4F804010028F9D048 +:10BE300030460AF089FA0028FAD0B8F1000F04D190 +:10BE40009D48016821F010010160C4F808A3C4F8FE +:10BE5000045199F805004E4680B1387870B90AF05F +:10BE600056FA80460AF05CFC6FF00042B8F1000F11 +:10BE700002D0C6E9032001E0C6E90302DBF80000B6 +:10BE8000C00701D00AF03FFA387810B13572BDE82A +:10BE9000F88F4FF01808C4F808830127A7614FF402 +:10BEA0002070ADF8000000BFBDF80000411EADF8E5 +:10BEB0000010F9D2C4F80C51C4F810517A48C01DD2 +:10BEC0000AF0C2FA3570FFF744FF676179493079AB +:10BED00020310860C4F80483D9E770B5050000D1AB +:10BEE000FFDF4FF080424FF0FF30C2F8080300211F +:10BEF000C2F80011C2F80411C2F80C11C2F81011F6 +:10BF0000694C61700AF00FFA10B10120A0706070E6 +:10BF100067480068C00701D00AF0F5F92846BDE877 +:10BF200070402CE76048007A002800D0012070475C +:10BF30002DE9F04F61484FF0000A85B0D0F800B00D +:10BF4000D14657465D4A5E49083211608406D4F8EE +:10BF5000080110B14FF0010801E04FF000080AF0AD +:10BF600046FA78B1D4F8240100B101208246D4F811 +:10BF70001C0100B101208146D4F8200108B101273D +:10BF800000E00027D4F8000100B101200490D4F8AB +:10BF9000040100B101200390D4F80C0100B101208C +:10BFA0000290D4F8100100B101203F4D0190287893 +:10BFB00000260090B8F1000F04D0C4F808610120F9 +:10BFC0000AF073F9BAF1000F04D0C4F82461092013 +:10BFD0000AF06BF9B9F1000F04D0C4F81C610A2013 +:10BFE0000AF063F927B1C4F820610B200AF05DF96B +:10BFF0002D48C01D0AF030FA00B1FFDFDFF8AC8039 +:10C000000498012780B1C4F80873E87818B1EE707D +:10C0100000200AF04AF9287A022805D10320287264 +:10C020000221C8F800102761039808B1C4F8046120 +:10C03000029850B1C4F80C61287A032800D0FFDFC1 +:10C04000C8F800602F72FFF758FE019838B1C4F8A5 +:10C050001061287A012801D100F05CF8676100982E +:10C0600038B12E70287A012801D1FFF772FEFFF750 +:10C0700044FE0D48C01D0AF005FA1049091DC1F81B +:10C0800000B005B0BDE8F08F074810B5C01D0AF03C +:10C09000E3F90549B0B1012008704FF0E021C1F883 +:10C0A0000002BDE81040FFE540000020340C0040D5 +:10C0B0000C0400401805004010ED00E0100502409F +:10C0C00001000001087A012801D1FFF742FEBDE816 +:10C0D000104024480AF0D6B970B5224CE41FA0786D +:10C0E00008B90AF007F901208507A861207A00261F +:10C0F000032809D1D5F80C0120B900200AF024F951 +:10C100000028F7D1C5F80C6126724FF0FF30C5F852 +:10C11000080370BD70B5134CE41F6079F0B10128BD +:10C1200003D0A179401E814218DA0AF0F0F80546E2 +:10C130000AF0F6FA6179012902D9A179491CA171A5 +:10C140000DB1216900E0E168411A022902DA11F11A +:10C15000020F06DC0DB1206100E0E060BDE8704038 +:10C16000F7E570BD470000200F4A12680D498A426A +:10C170000CD118470C4A12680A4B9A4206D101B5F5 +:10C180000AF0A0FA0AF073FDBDE80140074909680A +:10C190000958084706480749054A064B70470000FA +:10C1A00000000000BEBAFECA5800002004000020B3 +:10C1B000C8130020C8130020F8B51D46DDE9064766 +:10C1C0000E000AD007F00FF82346FF1DBCB231461F +:10C1D0002A46009406F01BFCF8BDD01922461946E9 +:10C1E00002F023F92046F8BD70B50D460446102232 +:10C1F000002102F044F9258117206081A07B40F0E6 +:10C200000A00A07370BD4FF6FF720A80014602203B +:10C210000AF0A2BC704700897047827BD30701D126 +:10C22000920703D48089088000207047052070475A +:10C23000827B920700D581817047014600200988E2 +:10C2400041F6FE52114200D00120704700B503466E +:10C25000807BC00701D0052000BD59811846FFF73B +:10C26000ECFFC00703D0987B40F004009873987BE4 +:10C2700040F001009873002000BD827B520700D57A +:10C2800009B14089704717207047827B61F3C30270 +:10C29000827370472DE9FC5F0E460446017896468E +:10C2A000012000FA01F14DF6FF5201EA020962682D +:10C2B0004FF6FF7B1188594502D10920BDE8FC9F4C +:10C2C000B9F1000F05D041F6FE55294201D00120F9 +:10C2D000F4E741EA090111801D0014D000232B70FE +:10C2E00094F800C0052103221F464FF0020ABCF15A +:10C2F0000E0F76D2DFE80CF0F909252F47646B7733 +:10C30000479193B4D1D80420D8E7616820898B7B0A +:10C310009B0767D517284AD30B89834247D389895E +:10C32000172901D3814242D185F800A0A5F8010068 +:10C330003280616888816068817B21F002018173AD +:10C34000C6E0042028702089A5F801006089A5F8BE +:10C3500003003180BCE0208A3188C01D1FFA80F8BC +:10C36000414524D3062028702089A5F80100608962 +:10C37000A5F80300A089A5F805000721208ACDE9CA +:10C380000001636941E00CF0FF00082810D008208C +:10C3900028702089A5F801006089A5F80300318084 +:10C3A0006A1D694604F10C0008F08FFB10B15EE0D5 +:10C3B0001020EDE730889DF800100844308087E0B9 +:10C3C0000A2028702089A5F80100328044E00C2062 +:10C3D00028702089A5F801006089A5F80300318044 +:10C3E0003AE082E064E02189338800EB41021FFAE1 +:10C3F00082F843453BD3B8F1050F38D30E222A709B +:10C400000BEA4101CDE90010E36860882A467146D5 +:10C41000FFF7D2FEA6F800805AE04020287060891D +:10C420003188C01C1FFA80F8414520D32878714616 +:10C4300020F03F00123028702089A5F801006089A3 +:10C44000CDE9000260882A46E368FFF7B5FEA6F84A +:10C450000080287840063BD461682089888037E0D6 +:10C46000A0893288401D1FFA80F8424501D2042776 +:10C470003DE0162028702089A5F801006089A5F804 +:10C480000300A089CDE9000160882A46714623692E +:10C49000FFF792FEA6F80080DEE718202870207AC9 +:10C4A0006870A6F800A013E061680A88920401D4BD +:10C4B00005271CE0C9882289914201D0062716E091 +:10C4C0001E21297030806068018821F400510180AC +:10C4D000B9F1000F0BD061887823002202200AF006 +:10C4E00091FA61682078887006E0338003276068DD +:10C4F000018821EA090101803846DFE62DE9FF4F76 +:10C5000085B01746129C0D001E461CD03078C1071E +:10C5100003D000F03F00192801D9012100E00021DB +:10C520002046FFF7AAFEA8420DD32088A0F57F4140 +:10C53000FF3908D03078410601D4000605D508201F +:10C5400009B0BDE8F08F0720FAE700208DF8000061 +:10C550008DF8010030786B1E00F03F0C0121A81E01 +:10C560004FF0050A4FF002094FF0030B9AB2BCF1ED +:10C57000200F75D2DFE80CF08B10745E7468748C39 +:10C58000749C74B574BA74C874D474E1747474F11E +:10C5900074EF74EE74ED748B052D78D18DF80090E6 +:10C5A000A0788DF804007088ADF8060030798DF819 +:10C5B0000100707800F03F000C2829D00ADCA0F1BF +:10C5C0000200092863D2DFE800F0126215621A62E5 +:10C5D0001D622000122824D004DC0E281BD0102855 +:10C5E000DBD11BE016281FD01828D6D11FE02078F9 +:10C5F000800701E020784007002848DAEEE0207844 +:10C600000007F9E72078C006F6E720788006F3E710 +:10C6100020784006F0E720780006EDE72088C00586 +:10C62000EAE720884005E7E720880005E4E720885E +:10C63000C004E1E72078800729D5032D27D18DF8A4 +:10C6400000B0B6F8010081E0217849071FD5062D1A +:10C650001DD381B27078012803D0022817D102E0DF +:10C66000C9E0022000E0102004228DF8002072783A +:10C670008DF80420801CB1FBF0F2ADF8062092B2D8 +:10C6800042438A4203D10397ADF80890A6E079E0CF +:10C690002078000776D598B282088DF800A0ADF812 +:10C6A0000420B0EB820F6DD10297ADF8061095E033 +:10C6B0002178C90666D5022D64D381B206208DF893 +:10C6C0000000707802285DD3B1FBF0F28DF8040011 +:10C6D000ADF8062092B242438A4253D1ADF8089099 +:10C6E0007BE0207880064DD5072003E020784006C7 +:10C6F0007FD508208DF80000A088ADF80400ADF8C3 +:10C700000620ADF8081068E02078000671D50920F1 +:10C71000ADF804208DF80000ADF8061002975DE03A +:10C720002188C90565D5022D63D381B20A208DF811 +:10C730000000707804285CD3C6E72088400558D5EF +:10C74000012D56D10B208DF80000A088ADF8040013 +:10C7500044E021E026E016E0FFE72088000548D508 +:10C76000052D46D30C208DF80000A088ADF80400FC +:10C77000B6F803006D1FADF80850ADF80600ADF82F +:10C780000AA02AE035E02088C00432D5012D30D13E +:10C790000D208DF8000021E02088800429D4B6F80F +:10C7A0000100E080A07B000723D5032D21D3307842 +:10C7B00000F03F001B2818D00F208DF800002088C3 +:10C7C00040F40050A4F80000B6F80100ADF80400F1 +:10C7D000ED1EADF80650ADF808B003976946059810 +:10C7E000F5F794FB050008D016E00E208DF8000048 +:10C7F000EAE7072510E008250EE0307800F03F005A +:10C800001B2809D01D2807D0022005990AF0A4F999 +:10C81000208800F400502080A07B400708D52046E7 +:10C82000FFF70BFDC00703D1A07B20F00400A0732D +:10C83000284685E61FB5022806D101208DF80000A4 +:10C8400088B26946F5F762FB1FBD0000F8B51D46CA +:10C85000DDE906470E000AD006F0C5FC2346FF1DA1 +:10C86000BCB231462A46009406F0D1F8F8BDD01982 +:10C870002246194601F0D9FD2046F8BD2DE9FF4FAB +:10C880008DB09B46DDE91B57DDF87CA00C46082BDC +:10C8900005D0E06901F0FEF850B11020D2E0288800 +:10C8A000092140F0100028808AF80010022617E0C5 +:10C8B000E16901208871E2694FF420519180E169BA +:10C8C0008872E06942F601010181E069002181730B +:10C8D0002888112140F0200028808AF800100426C2 +:10C8E00038780A900A2038704FF0020904F11800D5 +:10C8F0004D460C9001F0C6FBB04681E0BBF1100F35 +:10C900000ED1022D0CD0A9EB0800801C80B20221B0 +:10C91000CDE9001005AB52461E990D98FFF796FF22 +:10C92000BDF816101A98814203D9F74800790F9084 +:10C9300004E003D10A9808B138702FE04FF00201EB +:10C94000CDE900190DF1160352461E990D98FFF717 +:10C950007DFF1D980088401B801B83B2C6F1FF003D +:10C96000984200D203461E990BA8D9B15FF000028D +:10C97000DDF878C0CDE9032009EB060189B2CDE9E5 +:10C9800001C10F980090BDF8161000220D9801F01B +:10C990000EFC387070B1C0B2832807D0BDF8160005 +:10C9A00020833AE00AEB09018A19E1E7022011B07D +:10C9B000BDE8F08FBDF82C00811901F0FF08022DB1 +:10C9C0000DD09AF80120424506D1BDF820108142D1 +:10C9D00007D0B8F1FF0F04D09AF801801FE08AF861 +:10C9E0000180C94800680178052902D1BDF81610F8 +:10C9F000818009EB08001FFA80F905EB080085B279 +:10CA0000DDE90C1005AB0F9A01F03FFB28B91D982A +:10CA10000088411B4145BFF671AF022D13D0BBF119 +:10CA2000100F0CD1A9EB0800801C81B20220CDE9C7 +:10CA3000000105AB52461E990D98FFF707FF1D98A0 +:10CA40000580002038700020B1E72DE9F8439C46AE +:10CA5000089E13460027B26B9AB3491F8CB2F18F20 +:10CA6000A1F57F45FF3D05D05518AD882944891DA6 +:10CA70008DB200E000252919B6F83C800831414507 +:10CA800020D82A44BCF8011022F8021BBCF803107D +:10CA900022F8021B984622F8024B914606F091FBC1 +:10CAA0004FF00C0C41464A462346CDF800C005F035 +:10CAB0007AFFF587B16B00202944A41D214408802A +:10CAC00003E001E0092700E083273846BDE8F8834A +:10CAD00010B50B88848F9C420CD9846BE0180488B5 +:10CAE00044B1848824F40044A41D23440B801060C6 +:10CAF000002010BD0A2010BD2DE9F0478AB00025A6 +:10CB0000904689468246ADF8185007274BE00598B5 +:10CB100006888088000446D4A8F8006007A801951C +:10CB200000970295CDE903504FF40073002231467F +:10CB3000504601F03CFB04003CD1BDF81800ADF8B4 +:10CB40002000059804888188B44216D10A0414D4C0 +:10CB500001950295039521F400410097049541F455 +:10CB6000804342882146504601F0BFF804000BD1B3 +:10CB70000598818841F40041818005AA08A94846AA +:10CB8000FFF7A6FF0400DCD00097059802950195F9 +:10CB9000039504950188BDF81C300022504601F031 +:10CBA000A4F80A2C06D105AA06A94846FFF790FF6B +:10CBB0000400ACD0ADF8185004E00598818821F449 +:10CBC0000041818005AA06A94846FFF781FF002899 +:10CBD000F3D00A2C03D020460AB0BDE8F08700202D +:10CBE000FAE710B50C46896B86B051B10C218DF86F +:10CBF0000010A18FADF80810A16B01916946FAF7FA +:10CC00001BFB00204FF6FF71A063E187A08706B0F1 +:10CC100010BD2DE9F0410D460746896B0020069EA8 +:10CC20001446002911D0012B0FD13246294638462F +:10CC3000FFF762FF002808D1002C06D032462946B3 +:10CC40003846BDE8F04100F034BFBDE8F0812DE981 +:10CC5000FC411446DDE9087C0E46DDE90A15521D4B +:10CC6000BCF800E092B2964502D20720BDE8FC81F4 +:10CC7000ACF8002017222A70A5F80160A5F803304F +:10CC80000522CDE900423B462A46FFF7DFFD0020A2 +:10CC9000ECE770B50C46154648220021204601F00D +:10CCA000EEFB04F1080044F81C0F00204FF6FF7162 +:10CCB000E06161842084A5841720E08494F82A0030 +:10CCC00040F00A0084F82A0070BD4FF6FF720A8017 +:10CCD0000146032009F040BF30B585B00C4605463B +:10CCE000FFF77FFFA18E284629B101218DF80010A2 +:10CCF0006946FAF7A1FA0020E0622063606305B09C +:10CD000030BDB0F8400070475C00002090F846202D +:10CD1000920703D4408808800020F4E70620F2E759 +:10CD200090F846209207EED5A0F84410EBE70146B4 +:10CD3000002009880A0700D5012011F0F00F01D06A +:10CD400040F00200CA0501D540F004008A0501D573 +:10CD500040F008004A0501D540F010000905D2D581 +:10CD600040F02000CFE700B5034690F84600C0072A +:10CD700001D0062000BDA3F842101846FFF7D7FFE8 +:10CD800010F03E0F05D093F8460040F0040083F801 +:10CD9000460013F8460F40F001001870002000BD57 +:10CDA00090F84620520700D511B1B0F84200AAE72A +:10CDB0001720A8E710F8462F61F3C3020270A2E71C +:10CDC0002DE9FF4F9BB00E00DDE92B34DDE929781A +:10CDD000289D24D02878C10703D000F03F001928EF +:10CDE00001D9012100E000212046FFF7D9FFB04220 +:10CDF00015D32878410600F03F010CD41E290CD031 +:10CE0000218811F47F6F0AD13A8842B1A1F57F429F +:10CE1000FF3A04D001E0122901D1000602D5042016 +:10CE20001FB0C5E5FA491D984FF0000A08718DF84A +:10CE300018A08DF83CA00FAA0A60ADF81CA0ADF8B0 +:10CE400050A02978994601F03F02701F5B1C04F145 +:10CE5000180C4FF0060E4FF0040BCDF858C01F2AE7 +:10CE60007ED2DFE802F07D7D107D267DAC7DF47DF5 +:10CE7000F37DF27DF17DF47DF07D7D7DEF7DEE7DB6 +:10CE80007D7D7D7DED0094F84610B5F801008907A1 +:10CE900001D5032E02D08DF818B01EE34FF40061C7 +:10CEA000ADF85010608003218DF83C10ADF84000C3 +:10CEB000D4E2052EEFD1B5F801002083ADF81C00B7 +:10CEC000B5F80310618308B1884201D9012079E1E6 +:10CED0000020A07220814FF6FF702084169801F088 +:10CEE000D1F8052089F800000220029083460AABA1 +:10CEF0001D9A16991B9801F0C8F890BB9DF82E005A +:10CF0000012804D0022089F80100102003E001204C +:10CF100089F8010002200590002203A90BA807F060 +:10CF2000D4FDE8BB9DF80C00059981423DD13988BC +:10CF3000801CA1EB0B01814237DB02990220CDE975 +:10CF400000010DF12A034A4641461B98FFF77EFC7B +:10CF500002980BF1020B801C81B217AA029101E02A +:10CF60009CE228E003A90BA807F0AFFD02999DF809 +:10CF70000C00CDE9000117AB4A4641461B98FFF76C +:10CF800065FC9DF80C000AAB0BEB00011FFA81FB5E +:10CF900002991D9A084480B2029016991B9800E0ED +:10CFA00003E001F072F80028B6D0BBF1020F02D006 +:10CFB000A7F800B04FE20A208DF818004BE20021DC +:10CFC0000391072EFFF467AFB5F801002083ADF899 +:10CFD0001C00B5F80320628300283FF477AF90422D +:10CFE0003FF674AF0120A072B5F805002081002043 +:10CFF000A073E06900F04EFD78B9E1690120887105 +:10D00000E2694FF420519180E1698872E16942F64A +:10D0100001000881E06900218173F01F20841E98BF +:10D02000606207206084169801F02CF8072089F8C8 +:10D0300000000120049002900020ADF82A0028E0B2 +:10D0400019E29FE135E1E5E012E2A8E080E043E08B +:10D050000298012814D0E0698079012803D1BDF835 +:10D060002800ADF80E00049803ABCDE900B04A46A5 +:10D0700041461B98FFF7EAFB0498001D80B204901C +:10D08000BDF82A00ADF80C00ADF80E00059880B28E +:10D0900002900AAB1D9A16991B9800F0F6FF28B96A +:10D0A00002983988001D05908142D1D2029801284A +:10D0B00081D0E0698079012803D1BDF82800ADF85E +:10D0C0000E00049803ABCDE900B04A4641461B98D8 +:10D0D000FFF7BCFB0298BDE1072E02D0152E7FF4AE +:10D0E000DAAEB5F801102183ADF81C10B5F80320B5 +:10D0F000628300293FF4EAAE91423FF6E7AE012198 +:10D10000A1724FF0000BA4F808B084F80EB0052E01 +:10D1100007D0C0B2691DE26907F0B8FC00287FF4AF +:10D120004AAF4FF6FF70208401A906AA14A8CDF8D3 +:10D1300000B081E885032878214600F03F031D9A5E +:10D140001B98FFF79BFB8246208BADF81C0082E109 +:10D150000120032EC3D14021ADF85010B5F80110C5 +:10D160002183ADF81C100AAAB8F1000F00D00023EB +:10D17000CDE9020304921D98CDF804800090388810 +:10D180000022401E83B21B9801F011F88DF81800A0 +:10D1900090BB0B2089F80000BDF8280035E04FF067 +:10D1A000010C052E9BD18020ADF85000B5F8011080 +:10D1B0002183B5F803002084ADF81C10B0F5007F82 +:10D1C00003D907208DF8180087E140F47C422284BF +:10D1D0000CA8B8F1000F00D00023CDE90330CDE951 +:10D1E000018C1D9800903888401E83B21B9800F077 +:10D1F000DEFF8DF8180018B18328A8D10220BFE007 +:10D200000D2189F80010BDF83000401C22E100001B +:10D210005C000020032E04D248067FF53CAE0020BF +:10D2200018E1B5F80110ADF81C102878400602D5B9 +:10D230008DF83CE002E007208DF83C004FF000083C +:10D240000320CDE902081E9BCDF810801D980193A4 +:10D25000A6F1030B00901FFA8BF342461B9800F0D7 +:10D2600044FD8DF818008DF83C80297849060DD5CD +:10D270002088C00506D5208BBDF81C10884201D13E +:10D28000C4F8248040468DF81880E3E0832801D15B +:10D290004FF0020A4FF48070ADF85000BDF81C004A +:10D2A0002083A4F820B01E986062032060841321BC +:10D2B000CDE0052EFFF4EFADB5F80110ADF81C1070 +:10D2C000A28F6AB3A2F57F43FE3B29D008228DF8D6 +:10D2D0003C2000BF4FF0000B0523CDE9023BDDF8F9 +:10D2E00078C0CDF810B01D9A80B2CDF804C040F4DB +:10D2F00000430092B5F803201B9800F0F6FC8DF86F +:10D300003CB04FF400718DF81800ADF85010832830 +:10D3100010D0F8B1A18FA1F57F40FE3807D0DCE036 +:10D320000B228DF83C204FF6FE72A287D2E7A4F8BC +:10D330003CB0D2E000942B4631461E9A1B98FFF772 +:10D3400084FB8DF8180008B183284BD1BDF81C0070 +:10D35000208353E700942B4631461E9A1B98FFF713 +:10D3600074FB8DF81800E8BBE18FA06B0844831DA7 +:10D370008DE888034388828801881B98FFF767FC43 +:10D38000824668E095F80180022E70D15FEA0800BD +:10D3900002D0B8F1010F6AD109208DF83C0007A82E +:10D3A00000908DF840804346002221461B98FFF7ED +:10D3B00030FC8DF842004FF0000B8DF843B050B9AF +:10D3C000B8F1010F12D0B8F1000F04D1A18FA1F56F +:10D3D0007F40FF380AD0A08F40B18DF83CB04FF4A9 +:10D3E000806000E037E0ADF850000DE00FA91B9819 +:10D3F000F9F722FF82468DF83CB04FF48060ADF81B +:10D400005000BAF1020F06D0FC480068C07928B17C +:10D410008DF8180027E0A4F8188044E0BAF1000F56 +:10D4200003D081208DF818003DE007A80090434606 +:10D43000012221461B98FFF7ECFB8DF818002146CE +:10D440001B98FFF7CEFB9DF8180020B9192189F829 +:10D450000010012038809DF83C0020B10FA91B98D6 +:10D46000F9F7EAFE8246BAF1000F33D01BE018E06C +:10D470008DF818E031E02078000712D5012E10D188 +:10D480000A208DF83C00E088ADF8400003201B998D +:10D4900009F062FB0820ADF85000C0E648067FF5B1 +:10D4A000FAAC4FF0040A2088BDF8501008432080E1 +:10D4B000BDF8500080050BD5A18FA1F57F40FE3847 +:10D4C00006D11E98E06228982063A6864FF0030AD2 +:10D4D0005046A5E49DF8180078B1012089F80000B5 +:10D4E000297889F80110BDF81C10A9F802109DF8E0 +:10D4F000181089F80410052038802088BDF85010D5 +:10D5000088432080E4E72DE9FF4F8846087895B0EE +:10D51000012181404FF20900249C0140ADF8201008 +:10D520002088DDF88890A0F57F424FF0000AFF3A8E +:10D5300006D039B1000705D5012019B0BDE8F08F3C +:10D540000820FAE7239E4FF0000B0EA886F800B0E3 +:10D5500018995D460988ADF83410A8498DF81CB0BB +:10D56000179A0A718DF838B0086098F80000012801 +:10D570003BD0022809D003286FD1307820F03F003B +:10D580001D303070B8F80400E08098F800100320D7 +:10D59000022904D1317821F03F011B31317094F818 +:10D5A0004610090759D505ABB9F1000F13D000217A +:10D5B00002AA82E80B000720CDE90009BDF834007B +:10D5C000B8F80410C01E83B20022159800F0EFFDD9 +:10D5D0000028D1D101E0F11CEAE7B8F80400A6F870 +:10D5E0000100BDF81400C01C04E198F805108DF886 +:10D5F0001C1098F80400012806D04FF4007A022885 +:10D600002CD00328B8D16CE12188B8F8080011F4B7 +:10D610000061ADF8201020D017281CD3B4F84010BA +:10D62000814218D3B4F84410172901D3814212D192 +:10D63000317821F03F01C91C3170A6F801000321A7 +:10D64000ADF83410A4F8440094F8460020F002002D +:10D6500084F8460065E105257EE177E1208808F140 +:10D66000080700F4FE60ADF8200010F0F00F1BD0AA +:10D6700010F0C00F03D03888228B9042EBD199B9BB +:10D68000B878C00710D0B9680720CDE902B1CDF84D +:10D6900004B00090CDF810B0FB88BA88398815988E +:10D6A00000F023FB0028D6D12398BDF82010401CA1 +:10D6B00080294ED006DC10290DD020290BD040291E +:10D6C00087D124E0B1F5807F6ED051457ED0B1F591 +:10D6D000806F97D1DEE0C80601D5082000E0102059 +:10D6E00082460DA907AA0520CDE902218DF8380050 +:10D6F000ADF83CB0CDE9049608A93888CDE9000121 +:10D700005346072221461598FFF7B8F8A8E09DF880 +:10D710001C2001214FF00A0A002A9BD105ABB9F168 +:10D72000000F00D00020CDE902100720CDE900094C +:10D73000BDF834000493401E83B2218B002215985B +:10D7400000F035FD8DF81C000B203070BDF8140082 +:10D7500020E09DF81C2001214FF00C0A002A22D164 +:10D7600013ABB9F1000F00D00020CDE90210072063 +:10D77000CDE900090493BDF83400228C401E83B229 +:10D78000218B159800F013FD8DF81C000D203070D2 +:10D79000BDF84C00401CADF8340005208DF8380071 +:10D7A000208BADF83C00BCE03888218B88427FF4A8 +:10D7B00052AF9DF81C004FF0120A00281CD1606A7D +:10D7C000A8B1B878C0073FF446AF00E018E0BA68E7 +:10D7D0000720CDE902B2CDF804B00090CDF810B02A +:10D7E000FB88BA88159800F080FA8DF81C00132089 +:10D7F00030700120ADF8340093E000005C000020A0 +:10D800003988208B8142D2D19DF81C004FF0160A36 +:10D810000028A06B08D0E0B34FF6FF7000215F46F0 +:10D82000ADF808B0019027E068B1B978C907BED15A +:10D83000E18F0DAB0844821D03968DE80C024388EE +:10D840008288018809E0B878C007BCD0BA680DABFF +:10D8500003968DE80C02BB88FA881598FFF7F7F954 +:10D8600005005ED0072D72D076E0019005AA02A9CE +:10D870002046FFF72DF90146E28FBDF808008242ED +:10D8800001D00029F1D0E08FA16B084407800198F6 +:10D89000E08746E09DF81C004FF0180A40B1208B4D +:10D8A000C8B13888208321461598FFF79AF938E0E7 +:10D8B00004F118000090237E012221461598FFF7FD +:10D8C000A8F98DF81C000028EDD119203070012036 +:10D8D000ADF83400E7E7052521461598FFF781F9F3 +:10D8E0003AE0208800F40070ADF8200050452DD1BA +:10D8F000A08FA0F57F41FE3901D006252CE0D8F895 +:10D9000008004FF0160A48B1A063B8F80C10A187C0 +:10D910004FF6FF71E187A0F800B002E04FF6FF700C +:10D92000A087BDF8200030F47F611AD07823002250 +:10D930000320159909F066F898F8000020712088F6 +:10D94000BDF82010084320800EE000E00725208865 +:10D95000BDF8201088432080208810F47F6F1CD0F1 +:10D960003AE02188814321809DF8380020B10EA93A +:10D970001598F9F761FC05469DF81C000028EBD0CE +:10D9800086F801A001203070208B70809DF81C006B +:10D9900030710520ADF83400DEE7A18EE1B11898B2 +:10D9A0000DAB0088ADF834002398CDE90304CDE930 +:10D9B0000139206B0090E36A179A1598FFF700FA77 +:10D9C000054601208DF838000EA91598F9F734FCAA +:10D9D00000B10546A4F834B094F8460040070AD5D3 +:10D9E0002046FFF7A4F910F03E0F04D114F8460FBB +:10D9F00020F0040020701898BDF8341001802846EB +:10DA00009BE500B585B0032806D102208DF8000003 +:10DA100088B26946F9F710FC05B000BD10B5384C66 +:10DA20000B782268012B02D0022B2AD111E0137847 +:10DA30000BB1052B01D10423137023688A889A80C7 +:10DA40002268CB88D38022680B8913814989518150 +:10DA50000DE08B8893802268CB88D38022680B8965 +:10DA600013814B8953818B899381096911612168E5 +:10DA7000F9F7E2FB226800210228117003D0002888 +:10DA800000D0812010BD832010BD806B002800D005 +:10DA9000012070478178012909D10088B0F5205F05 +:10DAA00003D042F60101884201D1002070470720CF +:10DAB0007047F0B587B0002415460E460746ADF80E +:10DAC000184011E005980088288005980194811D70 +:10DAD000CDE902410721049400918388428801889E +:10DAE000384600F002F930B905AA06A93046FEF71B +:10DAF000EFFF0028E6D00A2800D1002007B0F0BDD3 +:10DB00005C00002010B58B7883B102789A4205D171 +:10DB10000B885BB102E08B79091D4BB18B789A427F +:10DB2000F9D1B0F801300C88A342F4D1002010BD27 +:10DB3000812010BD072826D012B1012A27D103E089 +:10DB4000497801F0070102E04978C1F3C2010529D3 +:10DB50001DD2DFE801F00318080C12000AB10320FF +:10DB600070470220704704280DD250B10DE00528FF +:10DB700009D2801E022808D303E0062803D0032818 +:10DB800003D005207047002070470F207047812088 +:10DB90007047C0B282060BD4000607D5FA48807AD7 +:10DBA0004143C01D01EBD00080B27047084670476A +:10DBB0000020704770B513880B800B781C0625D5A4 +:10DBC000F14CA47A844204D843F01000087000207D +:10DBD00070BD956800F0070605EBD0052D78F5407F +:10DBE00065F304130B701378D17803F0030341EA53 +:10DBF000032140F20123B1FBF3F503FB15119268F9 +:10DC0000E41D00FB012000EBD40070BD906870BDE6 +:10DC100037B51446BDF804101180117841F00401A5 +:10DC200011709DF804100A061ED5D74AA368C1F3E7 +:10DC30000011927A824208D8FE2811D1D21DD20852 +:10DC40004942184600F01BFC0AE003EBD00200F04A +:10DC50000703012510789D40A843994008431070A0 +:10DC6000207820F0100020703EBD2DE9F0410746DD +:10DC7000C81C0E4620F00300B04202D08620BDE84A +:10DC8000F081C14D002034462E60AF802881AA72F9 +:10DC9000E8801AE0E988491CE980810614D4E1781B +:10DCA00000F0030041EA002040F20121B0FBF1F254 +:10DCB00001FB12012068FFF76CFF2989084480B23C +:10DCC0002881381A3044A0600C3420784107E1D410 +:10DCD0000020D4E7AC4801220189C08800EB400055 +:10DCE00002EB8000084480B270472DE9FF4F89B0F5 +:10DCF0001646DDE9168A0F46994623F44045084644 +:10DD000000F054FB040002D02078400703D4012027 +:10DD10000DB0BDE8F08F099805F0E6F80290207884 +:10DD2000000606D59848817A0298814201D887205A +:10DD3000EEE7224601A90298FFF73CFF8346002048 +:10DD40008DF80C004046B8F1070F1AD00122214689 +:10DD5000FFF7F0FE0028DBD12078400611D5022025 +:10DD60008DF80C00ADF81070BDF80400ADF812008D +:10DD7000ADF814601898ADF81650CDF81CA0ADF8A9 +:10DD800018005FEA094004D500252E46A846012761 +:10DD90000CE02178E07801F0030140EA012040F234 +:10DDA0000121B0FBF1F2804601FB12875FEA494096 +:10DDB00009D5B84507D1A178207901F0030140EADF +:10DDC0000120B04201D3BE4201D90720A0E7A81923 +:10DDD0001FFA80F9B94501D90D2099E79DF80C008B +:10DDE00028B103A90998F9F725FA002890D1B84578 +:10DDF00007D1A0784FEA192161F30100A07084F8DF +:10DE000004901A9800B10580199850EA0A0027D0AA +:10DE1000199830B10BEB06002A46199900F005FB62 +:10DE20000EE00BEB06085746189E099805F0C9F955 +:10DE30002B46F61DB5B239464246009504F0B3FDB7 +:10DE4000224601A90298FFF7B5FE9DF8040022467C +:10DE500020F010008DF80400DDE90110FFF7D8FE76 +:10DE6000002055E72DE9FF4FDFF81C91824685B071 +:10DE7000B9F80610D9F8000001EB410100EB81046C +:10DE800040F20120B2FBF0F1174600FB1175DDE90D +:10DE9000138B4E4629460698FFF77BFE0346FFF795 +:10DEA00019FF1844B1880C30884202D9842009B087 +:10DEB0002FE70698C6B2300603D5B00601D5062076 +:10DEC000F5E7B9F80620521C92B2A9F80620BBF17A +:10DED000000F01D0ABF80020B00602D5C4F80880CE +:10DEE0000AE0B9F808201A4492B2A9F80820D9F833 +:10DEF0000000891A0844A0602246FE200699FFF718 +:10DF000087FEE77025712078390A61F301002A0A3B +:10DF1000A17840F0040062F30101A17020709AF82A +:10DF200002006071BAF80000E08000252573300619 +:10DF300002D599F80A7000E00127B00601D54FF02C +:10DF400000084E4600244FF007090FE0CDE90258C3 +:10DF50000195CDF800900495F1882046129B089A0F +:10DF6000FFF7C3FE0028A2D1641CE4B2BC42EDD38B +:10DF700000209CE700B5FFF7ADFE03490C308A880E +:10DF8000904203D9842000BD00060020CA8808689A +:10DF900002EB420300EB8300521C037823F00403DE +:10DFA0000370CA80002101730846ECE72DE9F047B1 +:10DFB000804600F0FBF9070005D000264446F74DE7 +:10DFC00040F2012916E00120BDE8F087204600F06C +:10DFD000EDF90278C17802F0030241EA0222B2FBB5 +:10DFE000F9F309FB13210068FFF7D3FD3044641CEB +:10DFF00086B2A4B2E988601E8142E7DCA8F1010084 +:10E00000E8802889801B288100203870DCE710B563 +:10E01000144631B1491E218004F066FFA070002033 +:10E0200010BD012010BD70B50446DC48C1880368EE +:10E0300001E0401C20802088884207D200EB40028B +:10E0400013EB820202D015786D07F2D580B28842B8 +:10E0500016D2AAB15079A072D08820819178107917 +:10E0600001F0030140EA0120A081A078E11CFFF744 +:10E07000A1FD20612088401C2080E080002070BD30 +:10E080000A2070BD0121018270472DE9FF4F85B044 +:10E090004FF6FF798246A3F8009048681E460D4669 +:10E0A00080788DF8060048680088ADF804000020EC +:10E0B0008DF80A00088A0C88A04200D304462C82FE +:10E0C00051E03878400708D4641C288AA4B2401C68 +:10E0D000288208F10100C0B246E0288A401C28824C +:10E0E000781D6968FFF70EFDD8BB3188494501D11D +:10E0F000601E30803188A1EB080030806888A04223 +:10E1000038D3B878397900F0030041EA002801A932 +:10E11000781DFFF7F7FC20BB298949452ED0002246 +:10E1200039460798FFF706FDD8B92989414518D126 +:10E13000E9680391B5F80AC0D7F808B05046CDF8A1 +:10E1400000C005F03EF8DDF800C05A460CF1070C9F +:10E150001FFA8CFC43460399CDF800C004F0EDFB98 +:10E1600060B1641CA4B200208046204600F01EF975 +:10E170000700A6D1641E2C820A2098E67480787964 +:10E18000B071F888B0803978F87801F0030140EA7E +:10E1900001207081A6F80C80504604F0A5FE3A4696 +:10E1A00006F10801FFF706FD306100207FE62DE94A +:10E1B000FF4F87B081461C469246DDF860B0DDF81F +:10E1C0005480089800F0F2F8050002D02878400743 +:10E1D00002D401200BB09CE5484604F085FE297866 +:10E1E000090605D56D49897A814201D88720F1E772 +:10E1F000CAF309062A4601A9FFF7DCFC0746149872 +:10E2000007281CD000222946FFF794FC0028E1D102 +:10E210002878400613D501208DF808000898ADF83D +:10E220000C00BDF80400ADF80E00ADF81060ADF8BC +:10E23000124002A94846F8F7FDFF0028CAD1297804 +:10E24000E87801F0030140EA0121AA78287902F078 +:10E25000030240EA0220564507D0B1F5007F04D9F9 +:10E26000611E814201DD0B20B4E7864201D90720FF +:10E27000B0E7801B85B2A54200D92546BBF1000F4F +:10E2800001D0ABF80050179818B1B9192A4600F020 +:10E29000CCF8B8F1000F0DD03E4448464446169FD6 +:10E2A00004F0A1FF2146FF1DBCB232462B4600946C +:10E2B00004F0ADFB00208DE72DE9F04107461D4637 +:10E2C0001646084600F072F8040002D02078400795 +:10E2D00001D40120D3E4384604F006FE2178090673 +:10E2E00005D52E49897A814201D88720C7E4224684 +:10E2F0003146FFF75FFC65B12178E07801F003015A +:10E3000040EA0120B0F5007F01D8012000E00020A4 +:10E3100028700020B3E42DE9F04107461D4616465B +:10E32000084600F043F8040002D02078400701D4EA +:10E330000120A4E4384604F0D7FD2178090605D56C +:10E340001649897A814201D8872098E422463146CD +:10E35000FFF75EFCFF2D14D02178E07801F0030276 +:10E3600040EA022040F20122B0FBF2F302FB13006C +:10E3700015B900F2012080B2E070000A60F30101DB +:10E38000217000207BE410B50C4600F00FF810B1AE +:10E390000178490704D4012010BD000000060020C8 +:10E3A000C18821804079A0700020F5E70749CA881C +:10E3B000824209D340B1096800EB40006FF00B02C4 +:10E3C00002EB8000084470470020704700060020E0 +:10E3D00070B504460D4621462B460AB9002070BD93 +:10E3E00001E0491C5B1C501E021E03D008781E78F9 +:10E3F000B042F6D008781E78801BF0E730B50C46A6 +:10E4000001462346051B954206D202E0521E9D5C42 +:10E410008D54002AFAD107E004E01D780D70491CE4 +:10E420005B1C521E002AF8D130BDF0B50E460146E5 +:10E43000334680EA030404F00304B4B906E002B9E9 +:10E44000F0BD13F8017B01F8017B521E01F00307B8 +:10E45000002FF4D10C461D4602E080CD80C4121F6F +:10E46000042AFAD221462B4600BF04E013F8014BE0 +:10E4700001F8014B521E002AF8D100BFE0E7F0B5C9 +:10E480000C460146E6B204E002B9F0BD01F8016BAA +:10E49000521E01F00307002FF6D10B46E5B245EA04 +:10E4A000052545EA054501E020C3121F042AFBD2D9 +:10E4B000194602E001F8016B521E002AFAD100BF92 +:10E4C000E3E7000010B508F0F6FDF4F7EDF908F009 +:10E4D0003DFCBDE8104008F005BD302834BF0120E8 +:10E4E00000207047202834BF4FF0A0420C4A01237F +:10E4F00000F01F0003FA00F0002914BFC2F80C0559 +:10E50000C2F808057047202834BF4FF0A0410449E5 +:10E5100000F01F00012202FA00F0C1F81805704750 +:10E520000003005070B50346002002466FF02F052F +:10E530000EE09C5CA4F130060A2E02D34FF0FF30AF +:10E5400070BD00EB800005EB4000521C2044D2B2AD +:10E550008A42EED370BD30B50A230BE0B0FBF3F472 +:10E5600003FB1404B0FBF3F08D183034521E05F891 +:10E57000014CD2B2002AF1D130BD30B500234FF6A4 +:10E58000FF7510E0040A44EA002084B2C85C6040D1 +:10E59000C0F30314604005EA00344440E0B25B1C61 +:10E5A00084EA40109BB29342ECD330BD2DE9F04198 +:10E5B000FE4B0026012793F864501C7893F868C03E +:10E5C000B8B183F89140A3F8921083F8902083F8B3 +:10E5D0008E70BCF1000F0CBF83F8946083F89450E8 +:10E5E000F3488068008804F0ECFDBDE8F04104F0D9 +:10E5F00081BA4FF6FF7083F89140A3F8920083F838 +:10E60000902083F88E70BCF1000F14BF83F89450F3 +:10E6100083F89460BDE8F0812DE9F041E44D29686C +:10E6200091F89C200024012A23D091F89620012AF9 +:10E6300030D091F86C301422DC4E0127012B32D0FF +:10E6400091F88E30012B4FD091F8A620012A1CBFE3 +:10E650000020BDE8F08144701F2200F8042B222224 +:10E66000A731FFF7E2FE286880F8A6400120BDE848 +:10E67000F08144701B220270D1F89D204260D1F8D5 +:10E68000A120826091F8A520027381F89C400120AE +:10E69000BDE8F081447007220270D1F898204260F2 +:10E6A00081F89640E2E78046447000F8042B20226F +:10E6B0006E31FFF7BAFE88F80870286880F86C4061 +:10E6C00090F86E000028D1D1B6F87000A6F8980036 +:10E6D000A868417B86F89A1086F89670008804F046 +:10E6E00070FD04F016FAC1E791F86C30012B0BD0E5 +:10E6F000447017220270D1F890204260B1F8942043 +:10E70000028181F88E40B1E78046447000F8042B06 +:10E7100020226E31FFF789FE88F80870286880F89B +:10E720006C4090F86E000028A0D1CDE7A0480068AA +:10E7300090F86C10002914BFB0F870004FF6FF700D +:10E74000704770B59A4C06462068002808BFFFDF66 +:10E750000025206845706660002808BFFFDF20683C +:10E76000417800291CBFFFDF70BDCC220021FFF7DC +:10E7700086FE2068FF2101707F2180F83810132168 +:10E780004184282180F86910012180F85C1080F80C +:10E79000615009F0F7F9BDE8704008F004BB844906 +:10E7A0000968097881420CBF012000207047804829 +:10E7B000006890F82200C0F3400070477C48006871 +:10E7C00090F8220000F0010070477948006890F846 +:10E7D0002200C0F3001070472DE9F043744803682D +:10E7E00093F82400B3F822C0C0F38001C0F34002C4 +:10E7F000114400F001000A18CCF30010002460B3AB +:10E80000BCF1130F21D00BDCBCF1100F02BF694823 +:10E8100030F81200BDE8F083BCF1120F15D008E00B +:10E82000BCF1150F09D0BCF11D0F04BF6248BDE853 +:10E83000F083FFDF2046BDE8F0836049002031F817 +:10E84000121012FB0010BDE8F0835D49002031F882 +:10E85000121012FB0010BDE8F08393F85E1093F8DD +:10E860005F002E264FF47A774FF014084FF04009DE +:10E87000022904BF4AF2D745B5FBF7F510D00129AC +:10E8800004BF4AF22F75B5FBF7F510D04AF62315F1 +:10E89000B5FBF7F5082908BF4E4613D0042918D058 +:10E8A000264608290ED0042913D0022949D004F1A4 +:10E8B000280604290FD008291CBF4FF01908082189 +:10E8C00004D00AE04FF0140806F5A8764FF0400196 +:10E8D00003E006F5A8764FF0100118FB016111FB6B +:10E8E0000251C2EB0212374D02EB820205EB8202AB +:10E8F00011441CF0010F4FF4C8724FF4BF7504BFF0 +:10E90000CCF34006002E7DD0CCF3400601F5A57176 +:10E91000EEB1082804BF164640270CD0042804BFD7 +:10E920002E46102707D0022807BF04F11806042737 +:10E9300004F12806082707EB870808EB87173E44F1 +:10E940001BE004F118064FF019080421C5E7082858 +:10E9500004BF174640260CD0042804BF2F461026BB +:10E9600007D0022807BF04F11807042604F128077E +:10E97000082606EB861607EB8606314401F19C0655 +:10E9800093F8691000F00C07002F08BF00213144F4 +:10E9900018BF01F5416127D1082804BF164640275A +:10E9A0001BD0042804BF2E4610270DE00C060020C3 +:10E9B00064000020E46202008F891300EC62020010 +:10E9C000DC620200D4FEFFFF07D0022807BF04F17B +:10E9D0001806042704F128060827C7EBC70707EB2A +:10E9E000470706EB4706314498311CF0010F19D058 +:10E9F000082808BF40200ED0042804BF2A46102053 +:10EA000009D000E04EE0022807BF04F118020420FC +:10EA100004F12802082000EB400303EB001010442F +:10EA200001443BE0082804BF944640260CD004284B +:10EA300004BFAC46102607D0022807BF04F1180C0B +:10EA4000042604F1280C082606EB8616B3F840309D +:10EA50000CEB860C6144EB2B20D944F2552C0B3384 +:10EA600003FB0CF39B0D082807D0042802D00228D2 +:10EA700005D008E02A46102008E0402006E004F116 +:10EA80001802042002E004F12802082000EB8010A4 +:10EA900002EB800000F5A57003FB001101F5B370D7 +:10EAA000BDE8F08301F5A571082804BF944640260F +:10EAB0000CD0042804BFAC46102607D0022807BF9C +:10EAC00004F1180C042604F1280C082606EB86161F +:10EAD000B3F848300CEB860C6144EB2BDED944F2E2 +:10EAE000552C0B3303FB0CF39B0D0828C5D00428D1 +:10EAF000C0D00228C7D1C2E7FE4840F271210068A9 +:10EB0000806A48437047FB48006890F83700002847 +:10EB100018BF0120704710B5F74C207B022818BFA2 +:10EB2000032808D1207D04F115010DF0A2FF08286B +:10EB30001CBF012010BD207B002816BF022800202A +:10EB40000120BDE8104009F037BDEB49087370475C +:10EB5000E849096881F8300070472DE9F047E54C35 +:10EB60002168087B002816BF022800200120487376 +:10EB700001F10E0109F00AFD2168087B022816BF89 +:10EB800003280122002281F82F204FF0080081F88D +:10EB90002D00487B01F10E034FF001064FF00007F6 +:10EBA000012804BF5B7913F0C00F0AD001F10E03F6 +:10EBB000012804D1587900F0C000402801D000207D +:10EBC00000E0012081F82E00002A04BF91F8220005 +:10EBD00010F0040F07D0087D01F115010DF049FF79 +:10EBE000216881F82D002068476006F01FFB21682E +:10EBF000C14D4FF00009886095F82D000DF055FFCC +:10EC0000804695F82F00002818BFB8F1000F04D0F7 +:10EC100095F82D000DF00EFD68B195F83000002834 +:10EC20001CBF95F82E0000281DD0697B05F10E0051 +:10EC300001290ED012E06E734A4605F10E014046DE +:10EC400009F0FAFC95F82D1005F10E000EF024F8ED +:10EC500009E0407900F0C000402831D0394605F184 +:10EC60000E0009F021FD2068C77690F8220010F010 +:10EC7000040F08BFBDE8F087002795F82D000DF0C0 +:10EC80008FFD050008BFBDE8F08710210EF03BFDA9 +:10EC9000002818BFBDE8F08720683A4600F11C0143 +:10ECA000C676284609F0C8FC206800F11C0160689F +:10ECB0000FF0E2F86068BDE8F04701210FF0F7B807 +:10ECC0000EF027F84A4605F10E0109F0B5FCCAE737 +:10ECD000884A1268137B0370D2F80E000860508ACD +:10ECE0008880704778B584490446824E407B08731B +:10ECF0003268207810706088ADF8000080B200F0B3 +:10ED00000101C0F3400341EA4301C0F3800341EA3B +:10ED10008301C0F3C00341EAC301C0F3001341EA19 +:10ED20000311C0F3401341EA4311C0F3801041EADC +:10ED300080105084E07D012808BF012507D00228FB +:10ED400008BF022503D0032814BFFFDF0825306861 +:10ED500080F85E50607E012808BF012507D0022898 +:10ED600008BF022503D0032814BFFFDF0825316840 +:10ED700081F85F5091F83500012829D0207B81F877 +:10ED80002400488C1D280CBF002060688862607DCC +:10ED900081F83700A07B002816BF02280020012040 +:10EDA0000875D4F80F00C1F81500B4F81300A1F8E5 +:10EDB0001900A07E91F86B2060F3071281F86B2098 +:10EDC000E07E012818BF002081F83400002078BDC3 +:10EDD00091F85E200420082A08BF81F85E00082D03 +:10EDE00008BF81F85F00C9E742480068408CC0F363 +:10EDF000001131B1C0F38000002804BF1F2070470C +:10EE000002E0C0F3400109B10020704710F0010F8B +:10EE100014BFEE20FF20704736480068408CC0F3D6 +:10EE2000001119B1C0F3800028B102E0C0F3400026 +:10EE300008B100207047012070472E490022096860 +:10EE40004A664B8C1D2B0CBF81F8682081F8680046 +:10EE500070470023274A126882F85D30D164A2F817 +:10EE60005000012082F85D007047224A002312689A +:10EE700082F85C30A2F858000120516582F85C00ED +:10EE800070471C49096881F83600704719490968BC +:10EE900081F8610070471748006890F96100704779 +:10EEA0001448006890F82200C0F3401070471148E1 +:10EEB000006890F82200C0F3C0007047012070473E +:10EEC0000C48006890F85F00704770B508F044FE89 +:10EED00008F023FE08F0EAFC08F098FD054C2068D5 +:10EEE000416E491C416690F83300002558B108F086 +:10EEF00049FE03E0640000200C06002007F053FFE9 +:10EF0000206880F833502068457090F8391021B19E +:10EF1000BDE87040042009F0EEBF90F86810D9B148 +:10EF2000406E814218D8042009F0E5FF206890F86F +:10EF3000220010F0010F07D0A06843220188BDE82D +:10EF400070400120FFF732BBBDE8704043224FF60E +:10EF5000FF710020FFF72ABBBDE87040002009F0D8 +:10EF6000CABF2DE9F04782B00F468146FE4E4FF0F2 +:10EF700000083068458C15F0030F10D015F0010F14 +:10EF800005F0020005D0002808BF4FF0010806D0A8 +:10EF900004E0002818BF4FF0020800D1FFDF4FF057 +:10EFA000000A544615F0010F05F002000DD080B99B +:10EFB00015F0040F0DD04AF00800002F1CBF40F0E0 +:10EFC000010040F002044DD09EE010B115F0040F96 +:10EFD0000DD015F0070F10D015F0010F05F002004D +:10EFE00043D0002808BF15F0040F34D04AE0002FAA +:10EFF00018BF4AF0090444D141E037B14AF0080093 +:10F00000044615F0200F1BD07EE0316805F0200289 +:10F01000B1F84800104308BF4AF0010474D04AF028 +:10F020001800044615F0200F6ED191F85E1011F013 +:10F030000C0118BF0121C94361F30000044663E0DD +:10F04000316891F85E1011F00C0118BF012161F3D5 +:10F050000000044658E04AF00800002F18BF40F0B6 +:10F06000010451D140F010044EE0002818BF15F003 +:10F07000040F07D0002F18BF4AF00B0444D14AF008 +:10F08000180441E015F0030F3DD115F0040F3AD0FC +:10F0900077B130684AF0080490F85E0010F00C0177 +:10F0A00018BF012161F3410415F0200F24D02BE09B +:10F0B000306805F02002B0F84810114308BF4AF04C +:10F0C000030421D04AF0180415F0200F0AD000BF25 +:10F0D00090F85E0010F00C0018BF0120C04360F3F0 +:10F0E000410411E090F85E1011F00C0118BF0121ED +:10F0F000C94361F30004EBE710F00C0018BF0120D6 +:10F1000060F3000400E0FFDF15F0400F1CD0CFB922 +:10F110003168B1F84800002804BF488C10F0010F96 +:10F120000BD110F0020F08BF10F0200F05D115F021 +:10F13000010F08BF15F0020F04D091F85E0010F027 +:10F140000C0F01D144F040047068A0F800A00178D1 +:10F1500021F0200101704FF007010EF059FE4146E9 +:10F1600070680FF04CF8214670680FF054F814F0F6 +:10F17000010F0CD04FF006034FF000027B4970687E +:10F180000FF023F83068417B70680EF083FE14F0B6 +:10F19000020F18D0D6E90010B9F1000F4FF00603A6 +:10F1A0004FF0010207D01C310FF00FF801217068F9 +:10F1B0000EF07DFE07E015310FF007F83068017D95 +:10F1C00070680EF074FE14F0040F18BFFFDF14F027 +:10F1D000080F19D0CDF800A03068BDF80020022338 +:10F1E000B0F86A1061F30B02ADF8002090F86B00E4 +:10F1F000032201099DF8010061F307108DF8010059 +:10F20000694670680EF0E1FF012F62D13068B0F8F6 +:10F210004810E1B390F82200C0F34000B8BB70681A +:10F220000EF0E9FF401CC7B23068C7F1FF05B0F827 +:10F230004820B0F85A10511AA942B8BF0D46AA4248 +:10F240003BD990F8220010F0010F36D144F01004A1 +:10F25000214670680EF0DFFFF81CC0B2ED1E284496 +:10F2600082B23068B0F86A10436EC1F30B0151FAF4 +:10F2700083F190F860303E4F1944BC460023E1FB17 +:10F2800007C31B096FF0240C03FB0C1100E020E006 +:10F2900080F8601090F85F00012101F01EF90090E5 +:10F2A000BDF800009DF80210032340EA01400190E0 +:10F2B000042201A970680EF088FF3068AAB2416C80 +:10F2C00070680EF0D6FF3068B0F85A102944A0F8E4 +:10F2D0005A1014F0400F06D0D6E900100123062280 +:10F2E00061310EF072FF14F0200F18BFFFDF002015 +:10F2F000002818BFFFDF02B0BDE8F0872DE9F0431A +:10F30000194C89B02068002808BFFFDF20684178C9 +:10F31000002944D10178FF2941D0002680F83160CE +:10F32000A0F85A60867080F83960304608F08EFB8D +:10F33000104802AD00F1240191E80E1085E80E108E +:10F34000D0E90D10CDE9061002A808F06DFB08F019 +:10F3500005F8206890F9610008F0D0F8064808F038 +:10F36000D3F806480CE00000640000201A060020D4 +:10F3700053E4B36ED0620200D8620200D56202008C +:10F3800008F03EFB606808F064FB206890F82400F9 +:10F3900010F0010F07D0252008F0BEF80AE009B0F0 +:10F3A0000C20BDE8F08310F0020F18BF262069D0B2 +:10F3B00008F0B2F8206890F85E10252007F08CFF66 +:10F3C000206880F82C6008F03BFB206890F85E1005 +:10F3D000002008F068F90F21052008F03AF82068AD +:10F3E00090F82E10002901BF90F82F10002990F8F6 +:10F3F000220010F0040F74D005F018FF05462068B5 +:10F400002946806806F001FCDFF82884074690FB57 +:10F41000F8F008FB10704142284605F0EEFB216829 +:10F42000886097FBF8F04A68104448600DF01EFBB6 +:10F4300001462068426891426ED8C0E90165FE4DE0 +:10F440004FF0010895F82D000DF02FFB814695F83F +:10F450002F000127002818BFB9F1000F04D095F83C +:10F460002D000DF0E7F8A0B195F8300000281CBF82 +:10F4700095F82E00002824D0687B05F10E010128A4 +:10F4800015D019E010F0040F14BF2720FFDF8FD133 +:10F4900090E73A466F7305F10E01484609F0CCF843 +:10F4A00095F82D1005F10E000DF0F6FB09E04879F6 +:10F4B00000F0C000402815D0414605F10E0009F0CB +:10F4C000F3F8206890F8220010F0040F24D095F88B +:10F4D0002D000DF065F905001ED010210EF013F976 +:10F4E00040B119E00DF015FC3A4605F10E0109F0A6 +:10F4F000A3F8E6E720683A4600F11C01C7762846E3 +:10F5000009F09AF8206800F11C0160680EF0B4FC64 +:10F51000012160680EF0CBFC2068417B0E3007F0C3 +:10F520007AFF206890F85C1061B3B0F85810A0F82A +:10F530004810416D416490F82210C1F30011F1B9F7 +:10F54000B0F86A000221C0F30B05ADF80050684620 +:10F5500006F0FCFF28B1BDF80000C0F30B00A84284 +:10F5600004D1BDF80000401CADF800002168BDF8D2 +:10F570000000B1F86A2060F30B02A1F86A2020684D +:10F5800080F85C60206890F85D1039B1B0F85010D8 +:10F59000A0F84010C16CC16380F85D60B0F86A10DB +:10F5A000426EC1F30B0151FA82F190F86020DFF84E +:10F5B0008CC2114463460022E1FB0C3212096FF049 +:10F5C000240302FB031180F860100DF0D2FA03212E +:10F5D00060680DF051FB216881F8330009B000200C +:10F5E000BDE8F0839649886070472DE9F043944C5C +:10F5F00083B0226892F831303BB1508C1D2808BF8F +:10F60000FFDF03B0BDE8F0435FE401260027F1B15E +:10F61000054692F8600007F07FFF206890F85F10C1 +:10F62000FF2007F059FE20684FF4A57190F85F2085 +:10F63000002008F0FEF8206890F8221011F0030F67 +:10F6400000F02C81002D00F0238100F027B992F802 +:10F6500022108046D07EC1F30011002956D0054605 +:10F6600060680780017821F020010170518C132916 +:10F6700037D01FDC102908BF022144D0122908BF4F +:10F68000062140D0FFDF6C4D606805F10E010EF0E1 +:10F69000E5FB697B60680EF0FDFB2068418C1D294D +:10F6A00018BF152963D0B0F84820416C60680EF08F +:10F6B0000AFC5CE0152918BF1D29E3D14FF00101B8 +:10F6C0000EF0A6FB6068017841F02001017021680E +:10F6D00085B11C310EF0D0FB012160680EF0E7FB14 +:10F6E000D1E700210EF094FB6068017841F0200121 +:10F6F0000170C8E715310EF0BFFB2068017D60681E +:10F700000EF0D5FBBFE70EF083FBBCE70021FFF74F +:10F7100028FC6068C17811F03F0F28D0017911F002 +:10F72000100F24D00EF072FB2368024693F82410C9 +:10F73000C1F38000C1F3400C604401F001010844B2 +:10F7400093F82C10C1F3800CC1F34005AC4401F0D8 +:10F7500001016144401AC1B293F85E0000F0BDFEA1 +:10F76000009003230422694660680EF02EFD206895 +:10F77000002590F8241090F82C0021EA000212F0E5 +:10F78000010F18BF01250ED111F0020F04D010F0A7 +:10F79000020F08BF022506D011F0040F03D010F0AD +:10F7A000040F08BF0425B8F1000F2BD0012D1BD08A +:10F7B000022D08BF26201BD0042D14BFFFDF2720F9 +:10F7C00016D0206890F85E10252007F085FD20688F +:10F7D00090F82210C1F3001169B101224FF4967123 +:10F7E000002008F026F80DE0252007F095FEE8E758 +:10F7F00007F092FEE5E790F85E204FF49671002046 +:10F8000008F017F8206890F82C10294380F82C1085 +:10F8100090F8242032EA01011CD04670418C132953 +:10F820002BD026DC102904BF03B0BDE8F0831229D9 +:10F8300023D007E040420F000C06002053E4B36ED3 +:10F8400064000020C1F30010002818BFFFDF03B0E0 +:10F85000BDE8F083418C1D2908BF80F82C70DCD0F6 +:10F86000C1F30011002914BF80F8316080F83170B5 +:10F87000D3E7152918BF1D29DBD190F85E2003B00E +:10F880004FF00101BDE8F043084608F0C0B900BFE1 +:10F8900090F85F200121084608F0B9F92168002D91 +:10F8A000C87E7CD04A8C3D46C2F34000002808BF89 +:10F8B00047F0080512F0400F18BF45F0400500283A +:10F8C00019BFD1F83C90B1F84080D1F84490B1F81C +:10F8D00048806068072107800EF09AFA002160686E +:10F8E0000EF08DFC294660680EF095FC15F0080FAF +:10F8F00017D02068BDF800100223B0F86A2062F328 +:10F900000B01ADF8001090F86B00032201099DF87F +:10F91000010061F307108DF80100694660680EF080 +:10F9200054FC60680EF030FB2168C0F1FE00B1F8B5 +:10F930005A20A8EB02018142A8BF0146CFB2D019DC +:10F94000404544D245F0100160680EF064FC6068E8 +:10F950000EF01AFB2168C0F1FE00B1F85A10A8EBB6 +:10F9600001018142A8BF0146CFB260680EF043FC9E +:10F970003844421C2068B0F86A10436EC1F30B0192 +:10F9800051FA83F190F86030FE4D1944AC460023E3 +:10F99000E1FB05C34FEA131C6FF0240300E03CE0D9 +:10F9A0000CFB031180F8601090F85F00012100F05B +:10F9B00094FD0090BDF800009DF80210032340EA7A +:10F9C00001400190042201A960680EF0FEFB21684D +:10F9D00091F8220010F0400F05D00123062261317A +:10F9E00060680EF0F2FB20683A46B0F85A0000EB6F +:10F9F000090160680EF03DFC2068B0F85A103944E7 +:10FA0000A0F85A1008F0D5FC002818BFFFDF2068C6 +:10FA10004670867003B0BDE8F0830121FFF7A1FABC +:10FA2000F0E7D94810B50068417841B90078FF285F +:10FA300005D000210846FFF7D8FD002010BD08F0D2 +:10FA40008BF808F06AF807F031FF07F0DFFF0C20B1 +:10FA500010BD2DE9F041CC4D0446174628680E46EE +:10FA600090F86C00002818BFFFDF2868002F80F88E +:10FA70006E7018BFBDE8F0812188A0F87010618811 +:10FA8000A0F88610A188A0F88810E188A0F88A1054 +:10FA900094F88C1180F88C1090F82F10002749B141 +:10FAA000427B00F10E01012A04D1497901F0C00125 +:10FAB000402935D090F8301041B1427B00F10E0161 +:10FAC000012A04BF497911F0C00F29D000F17A0052 +:10FAD00016F0E0FA6868FF2E0178C1F380116176B4 +:10FAE000D0F80310C4F81A10B0F80700E0832868B3 +:10FAF0001ED0C0F88010E18BA0F8841000F17402D1 +:10FB0000511E30460CF0DAFF002808BFFFDF2868DE +:10FB100090F8731041F0020180F87310BDE8F08195 +:10FB2000D0F80E10C0F87A10418AA0F87E10D1E704 +:10FB3000C0F88070A0F88470617E80F87310D4F8EB +:10FB40001A104167E18BA0F87810BDE8F08170B51C +:10FB50008D4C0125206890F82200C0F3C00038B118 +:10FB60003C22FF21A068FFF774FF206880F86C50EA +:10FB7000206890F8220010F0010F1CBFA0680188D7 +:10FB80004FF03C0212BF01204FF6FF710020FEF73C +:10FB90000DFD206880F8395070BD7B49096881F8F7 +:10FBA000320070472DE9F041002509F070F9002876 +:10FBB00000F00A81744C2068417801270026012951 +:10FBC00006D0022901D003297ED0FFDFBDE8F081F5 +:10FBD000817802260029418C46D0C1F34002002AD8 +:10FBE00008BF11F0010F70D090F85F204FF00101B5 +:10FBF0004FF0000008F00BF8216891F82200C0F3E4 +:10FC00004000002814BF0C20222091F85F1007F05C +:10FC100063FB2068467090F8330058B107F0AFF8E6 +:10FC2000206890F85F0010F00C0F0CBF40204520BA +:10FC300007F09EFF206890F83400002818BF07F0F6 +:10FC4000B6FF216891F85F0091F8691010F00C0F71 +:10FC500008BF0021962007F01DFF08F0A1FB002837 +:10FC600018BFFFDFBDE8F081C1F3001282B1102997 +:10FC70003FD090F8330020B107F081F8402007F022 +:10FC800077FF206890F8221011F0040F36D043E07F +:10FC900090F8242090F82C309A422AD1B0F84800ED +:10FCA000002808BF11F0010F05D111F0020F08BFA5 +:10FCB00011F0200F65D04FF001014FF00000FFF769 +:10FCC00094FC2068418C01E040E034E011F0010F29 +:10FCD00004BFC1F34001002907D1B0F85A10B0F8B1 +:10FCE0004820914218BFBDE8F08180F83170BDE82E +:10FCF000F081BDE8F0410021012076E490F8371052 +:10FD0000012914BF0329102545F00E0190F85E204B +:10FD10004FF0000007F07BFF206890F834000028C7 +:10FD200018BF07F044FF0021962007F0B3FE2068BB +:10FD30004670BDE8F081B0F85A10B0F84800814232 +:10FD400042D0BDE8F041012108464EE4817809B374 +:10FD5000418C11F0010F22D080F86C7090F86E2069 +:10FD6000B0F870100120FEF721FC2068467007F003 +:10FD7000F3FE07F0D2FE07F099FD07F047FE0320DF +:10FD800004E021E053E4B36E64000020BDE8F041DC +:10FD900009F0B1B88178BDE8F041012025E411F007 +:10FDA000020F04BFFFDFBDE8F081B0F85A10B0F8D1 +:10FDB0004000814208D001210846FFF716FC216867 +:10FDC00003204870BDE8F081BDE8F041FFF77DB841 +:10FDD000FFF77BB810B5FE4C206890F8341049B19D +:10FDE000383007F0F3FE18B921687F2081F8380019 +:10FDF00007F0D3FE206890F8330018B107F0C2FE78 +:10FE000006F0D1FF09F043F8A8B1206890F822105D +:10FE1000C1F3001179B14078022818BFFFDF00213B +:10FE20000120FFF7E2FB2068417800291EBF4078DF +:10FE30000128FFDF10BDBDE81040FFF746B82DE9EF +:10FE4000F047E34C0F4680462168B8F1030F488C19 +:10FE500008BFC0F3400508D000F0010591F832005A +:10FE6000002818BF4FF0010901D14FF0000907F039 +:10FE700047FB0646B8F1030F0CBF4FF002084FF0E6 +:10FE8000010835EA090008BFBDE8F087206890F84E +:10FE9000330068B10CF050FE38700146FF2807D0DF +:10FEA0006068C01C0CF021FE38780CF052FE06434E +:10FEB00060680178C1F3801221680B7D9A4208D1F5 +:10FEC0000622C01C1531FEF783FA002808BF012066 +:10FED00000D000203978FF2906D0C8B9206890F8F2 +:10FEE0002D00884216D113E0A0B1616811F8030B10 +:10FEF000C0F380100CF0BDFD05460CF01DFF38B1BD +:10FF000028460CF04DFC18B110210DF0FCFB08B197 +:10FF1000012000E00020216891F8221011F0040F68 +:10FF200001D0F0B11AE0CEB9AA4890F83700002805 +:10FF300018BF404515D1616811F8030BC0F380105C +:10FF40000CF097FD04460CF0F7FE38B120460CF09B +:10FF500027FC18B110210DF0D6FB10B10120BDE82F +:10FF6000F0870020BDE8F0872DE9F04F984D04465A +:10FF700083B0286800264078022818BFFFDF286871 +:10FF80004FF07F0B90F8341049B1383007F01EFE67 +:10FF9000002804BF286880F838B007F0FEFD6868C4 +:10FFA0000DF058FF8046002C00F0458207F04DFA16 +:10FFB000002800F04082012400274FF0FF09B8F12B +:10FFC000050F1ED1686890F8240000F01F0010286B +:10FFD00017D9286890F8360098B18DF800906946D6 +:10FFE0000520FFF72CFF002800F02582286880F804 +:10FFF000A64069682222A730C91CFEF716FA00F055 +:020000040001F9 +:100000001ABA68680EF0B1F8002800F01482404671 +:10001000DFF8C0814FF0030A062880F01E82DFE877 +:1000200000F0FCFCFC03FCFB8DF80090694603200B +:10003000FFF705FF002800F0F180296891F83400EF +:1000400010B191F89C00D8B12868817801294DD071 +:100050006868042107800DF0DBFE08F10E01686876 +:100060000DF0FCFE98F80D1068680DF013FF28687D +:10007000B0F84020C16B68680DF049FF00F063B92B +:100080009DF8000081F89C400A7881F89D20FF28A7 +:100090000FD001F19F029E310CF010FD002808BF27 +:1000A000FFDF286890F89E1041F0020180F89E1052 +:1000B0000DE068680278C2F3801281F89E20D0F8C3 +:1000C0000320C1F89F20B0F80700A1F8A30028681A +:1000D00000F1A50490F838007F2808BFFFDF2868EA +:1000E00090F83810217080F838B0ADE790F8220011 +:1000F0000721C0F3801938480479686869F38614C9 +:1001000007800DF085FE002168680EF078F8214622 +:1001100068680EF080F80623002208F10E01686876 +:100120000EF053F82868417B68680DF0B3FE6868EC +:100130000DF02AFF2968B1F84020C0F1FE018A4283 +:10014000B8BF1146CFB2BA423CD9F81EC7B244F08C +:10015000100B594668680EF05EF868680EF04BF8B0 +:10016000384400F101082868B0F86A10426EC1F303 +:100170000B0151FA82F190F86020184C0A44A44611 +:100180000023E2FB04C319096FF0240301FB0321E0 +:1001900080F8601090F85F004246012100F09DF960 +:1001A0000190BDF804009DF80610032340EA0140C9 +:1001B0000290042202A968680EF007F859466868A0 +:1001C0000EF029F8B9F1000F0FD0D5E9001007E0C3 +:1001D000640000200C060020D062020053E4B36EDD +:1001E0000123062261310DF0F0FF28683A46C16B09 +:1001F00068680EF03EF82868A0F85A70B0F8401011 +:100200008F420CBF0121002180F8311008F0D1F895 +:10021000002818BFFFDF96E007E01EE1286880781D +:10022000002840F00A8100F006B98DF80090686857 +:100230000178C1F38019D0F803100191B0F80700DC +:10024000ADF8080069460520FFF7F9FD0028286889 +:100250007DD0817800297CD090F85FB0D5E9010489 +:10026000D0F80F10C4F80E10B0F813106182417D61 +:100270002175817D6175B0F81710E182B0F8191011 +:100280006180B0F81B10A180B0F81D10E18000F172 +:100290001F0104F1080015F006FF686890F82410AB +:1002A00001F01F01217690F82400400984F88C01A8 +:1002B00084F864B084F865B01BF00C0F0CBF00210B +:1002C000012104F130000EF004FA2868002290F8B1 +:1002D000691084F8661090F8610084F867009DF852 +:1002E0000010A868FFF7B5FB022008F004FEB04834 +:1002F0000DF1040B08210468686807800DF088FD83 +:10030000002168680DF07BFF214668680DF083FFCF +:100310000623002208F10E0168680DF056FF2868D8 +:10032000417B68680DF0B6FD494668680DF0BFFD79 +:1003300006230122594668680DF047FF08F039F896 +:10034000002818BFFFDF286880F801A077E06DE083 +:10035000FFE76868D5F808804FF00109027898F83F +:100360000D10C2F34012114088F80D10D0F80F1094 +:10037000C8F80E10B0F81310A8F81210417D88F8D4 +:100380001410817D88F81510B0F81710A8F8161011 +:10039000B0F81910A8F80210B0F81B10A8F8041053 +:1003A000B0F81D10A8F8061000F11F0108F10800B0 +:1003B00015F079FE686890F8241001F01F0188F8A4 +:1003C000181090F824000021400988F88C0188F862 +:1003D000649088F8659008F130000EF07AF928688A +:1003E000002290F8691088F8661090F8610088F88B +:1003F00067009DF80010A868FFF72BFB286880F8BD +:100400006C4090F86E20B0F870100120FEF7CEF826 +:100410002868477007F0A0FB07F07FFB07F046FA5B +:1004200007F0F4FA012008F066FD08E090F82200D9 +:10043000C0F3001008B1012601E0FEF746FD286870 +:1004400090F8330018B107F09DFB06F0ACFC66B1E4 +:1004500000210120FFF7C9F810E0286890F8220079 +:10046000C0F300100028E8D0E5E72868817801296A +:1004700004D190F85F10FF2006F02EFF2868417825 +:10048000002919BF4178012903B0BDE8F08F4078F9 +:10049000032818BFFFDF03B0BDE8F08F70B5454CEF +:1004A00006460D462068807858B106F03CFE21686B +:1004B0000346304691F85F202946BDE8704009F0B8 +:1004C000D1BA06F030FE21680346304691F85E202E +:1004D0002946BDE8704009F0C5BA78B50C46002140 +:1004E0000091082804BF4FF4C87040210DD00428A3 +:1004F00004BF4FF4BF70102107D0022807BF01F1DD +:100500001800042101F128000821521D02FB0106F8 +:1005100028489DF80010006890F8602062F30501FB +:1005200041F040058DF8005090F85F0001282AD076 +:1005300002282FD004281CBF0828FFDF30D000BFBE +:1005400025F080008DF80000C4EB041000EB800063 +:100550004FF01E0101EB800006FB040416488442A4 +:1005600028BFFFDF1548A0FB0410BDF801100009EB +:1005700060F30C01ADF80110BDF800009DF8021009 +:1005800040EA014078BD9DF8020020F0E0008DF8BF +:100590000200D5E79DF8020020F0E000203004E0E2 +:1005A0009DF8020020F0E00040308DF80200C7E71F +:1005B000D062020064000020C4BF030089888888DC +:1005C0000178406829B190F82C1190F88C0038B966 +:1005D00001E001F0ADBD19B1042901D0012070473F +:1005E0000020704770B50C460546062102F0B6FCA7 +:1005F000606008B1002006E00721284602F0AEFC4A +:10060000606018B101202070002070BD022070BD14 +:100610002DE9FC470C4606466946FFF7E3FF002834 +:100620007DD19DF8000050B1FEF780F8B0427CD03B +:10063000214630460AF0C8FB002873D12DE00EF0A9 +:1006400091F9B04271D02146304613F0B0FA00283B +:1006500068D1019D95F8F00022E0012000E0002023 +:10066000804695F839004FF0010A4FF00009F0B1CB +:1006700095F83A0080071AD584F8019084F800A014 +:1006800084F80490E68095F83B102172A98F61816F +:10069000E98FA18185F8399044E0019D95F82C01FE +:1006A00070350028DBD1287F0028D8D0D5E7304628 +:1006B00002F099FD070000D1FFDF384601F0A7FFE7 +:1006C00040B184F801900F212170E680208184F8E8 +:1006D00004A027E0304602F074FD070000D1FFDFE0 +:1006E000B8F1000F21D0384601F0E9FFB8B19DF80C +:1006F000000038B90198D0F818014188B14201D101 +:1007000080F80090304607F0BFFE84F801900C217D +:10071000217084F80490E680697F217200E004E093 +:1007200085F81C900120BDE8FC870020FBE71CB584 +:100730006946FFF757FF00B1FFDF684601F004FD8F +:10074000FE4900208968A1F8F2001CBD2DE9FC419A +:1007500004460E46062002F0A9FB0546072002F0DB +:10076000A5FB2844C7B20025A8463E4417E02088D0 +:10077000401C80B22080B04202D34046A4F80080E2 +:1007800080B2B84204D3B04202D20020BDE8FC815E +:100790006946FFF727FF0028F8D06D1CEDB2AE4286 +:1007A000E5D84FF6FF7020801220EFE738B54FF6FE +:1007B000FF70ADF800000DE00621BDF8000002F06A +:1007C000DFFB04460721BDF8000002F0D9FB0CB1A5 +:1007D00000B1FFDF00216846FFF7B8FF0028EBD02B +:1007E00038BD70B507F0BEFE0BF02DFFD44C4FF6B0 +:1007F000FF76002526836683D2A0257001680079E4 +:10080000A4F14002657042F8421FA11C1071601CE7 +:1008100013F0E9FA1B2020814FF4A4716181A081BB +:10082000E181072121776177032121740422627419 +:100830006082A082A4F13E00E18205704680BF483C +:100840000C300570A4F110000570468084F820502B +:1008500070BD70B5B94C16460D466060217007F04A +:10086000F9FDFFF7A3FFFFF7BCFF207810F0B5FFFD +:10087000B6480EF0CAF92178606813F059FA20786A +:100880000BF00AF9284608F0B9FEB048FDF759FF09 +:10089000217860680AF072FB3146207813F01EFD63 +:1008A000BDE870400BF0CFBE10B501240AB10020A6 +:1008B00010BD21B1012903D00024204610BD022122 +:1008C0000DF014FDF9E710B503780446002B4068DD +:1008D00013460A46014609D05FF001000DF0B3F857 +:1008E0006168496A884203D9012010BD0020F5E7FC +:1008F000002010BD2DE9F04117468A781E4680463B +:1009000042B11546C87838B10446690706D52AB100 +:10091000012104E00725F5E70724F6E70021620737 +:1009200002D508B1012000E00020014206D00122DA +:1009300011464046FFF7C7FF98B93DE051B100228C +:1009400001214046FFF7BFFF58B9600734D50122A7 +:10095000114620E060B1012200214046FFF7B3FFBD +:1009600010B10920BDE8F081680725D5012206E015 +:1009700068074FEA44700AD5002814DB00220121E1 +:100980004046FFF7A0FFB8B125F0040514E00028A9 +:1009900012DA012200214046FFF795FF60B100BF47 +:1009A00024F0040408E0012211464046FFF78BFFC3 +:1009B00010B125F00405F3E73D7034700020D1E755 +:1009C00070B58AB0044600886946FFF70BFE002820 +:1009D00006D1A08830B1012804D0022802D012200C +:1009E0000AB070BD04AB03AA21466846FFF782FF38 +:1009F0000500F5D19DF8001001200026002901997D +:100A000006D081F8C501019991F81012B1BB2DE013 +:100A100081F82F01019991F8561139B9019991F88E +:100A20002E1119B9019991F8971009B13A2519E0D9 +:100A30000199059681F82E01019A9DF80C0082F823 +:100A40003001019B9DF8102083F83121A388019C7F +:100A5000A4F832318DF814008DF8152005AA002075 +:100A60000DF033F8019880F82F6126E0019991F894 +:100A7000C41119B9019991F8971009B13A2519E0F3 +:100A80000199059681F8C40101989DF80C2080F821 +:100A9000C621019B9DF8100083F8C701A388019C23 +:100AA000A4F8C8318DF814208DF8150005AA01208E +:100AB0000DF00BF8019880F8C561284690E710B555 +:100AC00004460020A17801B90120E2780AB940F07B +:100AD000020001F048FB002803D12046BDE8104089 +:100AE0006EE710BD70B5044691F8650091F8663068 +:100AF0000D4610F00C0F00D100232189A0880CF0C6 +:100B000099FF696A814229D2401A401CA188400895 +:100B1000091A8AB2A2802189081A2081668895F86C +:100B2000641010460CF064FF864200D230466080AC +:100B3000E68895F8651020890AE000007000002022 +:100B400018080020FFFFFFFF1F000000D80600204C +:100B50000CF04EFF864200D23046E08070BDF0B50A +:100B600085B00D46064603A9FFF73CFD00282DD1B0 +:100B70009DF80C0060B300220499FB20B1F84E30C0 +:100B8000FB2B00D30346B1F85040FB20FB2C00D3D5 +:100B90000446DFF85CC59CE8811000900197CDF811 +:100BA00008C0ADF80230ADF806406846FFF79AFF7E +:100BB0006E80BDF80400E880BDF808006881BDF8CB +:100BC0000200A880BDF806002881002005B0F0BD15 +:100BD0000122D1E72DE9F04186B00446008869463C +:100BE000FFF700FD002876D12189E08801F0D4FAD2 +:100BF000002870D1A188608801F0CEFA00286AD15F +:100C00002189E08801F0BFFA002864D1A1886088BA +:100C100001F0B9FA07005ED1208802A9FFF79FFF13 +:100C200000B1FFDFBDF8101062880920914252D355 +:100C3000BDF80C10E28891424DD3BDF81210BDF8FA +:100C40000E2023891144A2881A44914243D39DF86F +:100C50000010019D4FF00008012640F6480041B108 +:100C600085F8BB61019991F8FC1105F5DD7541B975 +:100C70001AE085F82561019991F84A1105F59275F8 +:100C800009B13A2724E0E18869806188E9802189F7 +:100C9000814200D30146A980A188814200D2084642 +:100CA0002881012201990FE0E18869806188E9804B +:100CB0002189814200D30146A980A188814200D2C6 +:100CC00008462881019900222846FFF70BFF2E7065 +:100CD00085F80180384606B044E67BE770B50446E7 +:100CE0000DF0F6FDB0B12078182811D12079012837 +:100CF0000ED1E088062102F031F9040008D02088E6 +:100D000007F0C2FB2088062102F03AF900B1FFDFAC +:100D1000012070BDF74D28780028FAD000266670B3 +:100D20001420207020223146201DFDF7A8FB022050 +:100D300020712E70ECE710B50446FDF76DFC00281D +:100D400013D0207817280FD1207968B1E0880721C7 +:100D500002F004F940B1008807F096FBE088072113 +:100D600002F00EF900B1FFDF012010BD2DE9F047C0 +:100D70005FEA000800D1FFDFDE4802211A30814619 +:100D8000FFF7E4FC00B1FFDFDA4C0620678B02F0CE +:100D90008DF80546072002F089F82844C5B2681C82 +:100DA000C6B2608BB04203D14046FFF7C4FF58B9CA +:100DB000608BA84203D14046FFF790FF20B9608BBB +:100DC0004146FFF725FC38B1404601F0F3F9002811 +:100DD000E7D10120BDE8F08702214846FFF7B6FCC5 +:100DE00010B9608BB842DCD14046BDE8F04713F043 +:100DF000BABA10B501F043F908B10C2010BD0BF0E0 +:100E000076FC002010BD10B50446007818B101280A +:100E100001D0122010BD01F043F920B10BF018FEF3 +:100E200008B10C2010BD207801F003F9E21D04F197 +:100E30001703611CBDE810400BF0FFBC10B5044661 +:100E400001F01DF908B10C2010BD207828B101284F +:100E500003D0FF280BD0122010BD01F0EAF8611C6E +:100E60000BF005FC08B1002010BD072010BD0120CB +:100E70000BF037FCF7E710B50BF0EDFD08B10020E3 +:100E800010BD302010BD10B5044601F009F908B1BD +:100E90000C2010BD20460BF0D8FD002010BD10B571 +:100EA00001F0FEF820B10BF0D3FD08B10C2010BD0D +:100EB0000BF028FD002010BDFF2181704FF6FF715F +:100EC00081808D4949680A7882718A8802814988BF +:100ED000418101214170002070477CB50025022A24 +:100EE00019D015DC12F10C0F15D009DC12F1280F06 +:100EF00011D012F1140F0ED012F1100F11D10AE01F +:100F000012F1080F07D012F1040F04D04AB902E021 +:100F1000D31E052B05D8012806D0022808D00328A7 +:100F20000AD0122528467CBD1046FDF7AFFFF9E731 +:100F300010460DF065FEF5E7084614466946FFF7D2 +:100F400051FB08B10225EDE79DF80000019800254E +:100F500080F86740E6E710B5134601220CF010FC5C +:100F6000002010BD10B5044611F029FA052804D060 +:100F7000204610F021FC002010BD0C2010BD10B543 +:100F8000044601F08DF808B10C2010BD2146002068 +:100F900007F0E9FA002010BD10B5044610F09BFCE4 +:100FA00050B108F08DFD38B1207808F033FB20787F +:100FB0000EF047F9002010BD0C2010BD10B50446FE +:100FC00001F06EF808B10C2010BD2146012007F099 +:100FD000CAFA002010BD38B504464FF6FF70ADF8D0 +:100FE0000000A079E179884216D02079FDF775FAE2 +:100FF00090B16079FDF771FA70B10022A0791146C5 +:1010000013F098FD40B90022E079114613F092FDEB +:1010100010B9207A072801D9122038BD08F05DFDEB +:1010200060B911F0CCF948B900216846FFF78EFB92 +:1010300020B1204606F029F9002038BD0C2038BD2B +:101040002DE9FC41817805461A2925D00EDC1629A8 +:101050002ED2DFE801F02D2D2D2D2D212D2D2D2D22 +:101060002D2D2D2D2D2D2D2D2D2121212A291FD046 +:101070000BDCA1F11E010C291AD2DFE801F01919CD +:101080001919191919191919190D3A3904290FD2F1 +:10109000DFE801F00E020E022888B0F5706F07D26B +:1010A00001276946FFF79EFA20B10220BDE8FC81C6 +:1010B0001220FBE79DF8000000F0C2FF019C10B178 +:1010C00004F58A7401E004F5C8749DF8000000F08E +:1010D000B7FF019E10B106F2151601E006F2911657 +:1010E0006846FFF76DFA08B1207838B10C20DDE7CB +:1010F0000C63020018080020700000202770A878F8 +:101100003070684601F020F80020CFE77CB50D462E +:101110006946FFF767FA002618B12E602E7102208B +:101120007CBD9DF8000000F08BFF019C9DF8000045 +:10113000703400F085FF019884F84260816829606E +:10114000017B297194F842100029F5D100207CBD63 +:1011500010B5044600F0A4FF20B10BF079FC08B1F3 +:101160000C2010BD207800F064FFE279611C0BF0C8 +:10117000F0FD08B1002010BD022010BD10B5886E32 +:1011800060B1002241F8682F0120CA718979884036 +:1011900013F0C4FC002800D01F2010BD0C2010BD8F +:1011A0001CB50C466946FFF71DFA002809D19DF8C9 +:1011B000000000280198B0F8700000D0401C20808A +:1011C00000201CBD1CB5044600886946FFF70AFADA +:1011D00008B102201CBD606828B1DDE9000122468B +:1011E00001F03CF81CBDDDE90001FFF7C7FF1CBDA5 +:1011F00070B51C460D4618B1012801D0122070BDF3 +:101200001946104601F068F830B12146284601F031 +:101210006DF808B1002070BD302070BD70B5044677 +:1012200000780E46012804D018B1022801D0032806 +:1012300040D1607828B1012803D0022801D00328CA +:1012400038D1E07B10B9A078012833D1A07830F0F4 +:1012500005012FD110F0050F2CD06289E188E078CC +:101260003346FFF7C5FF002825D1A07805281DD1FA +:101270006589A289218920793346FFF7B9FF0028C3 +:1012800019D1012004EB40014A8915442218D37872 +:10129000927893420ED1CA8889888A420AD1401C2A +:1012A000C0B20228EED3E088A84203D3A07B08B1E5 +:1012B000072801D9122070BD002070BD10B586B07E +:1012C000044600F0D1FE10B10C2006B010BD022182 +:1012D00004F10A0001F020F8A0788DF80800A07849 +:1012E0008DF8000060788DF8040020788DF80300F8 +:1012F000A07B8DF80500E07B00B101208DF8060091 +:10130000A078C10717D0E07800F0FAFF8DF801004F +:10131000E088ADF80A006089ADF80C00A0784007BD +:1013200016D5207900F0ECFF8DF802002089ADF889 +:101330000E00A0890AE040070AD5E07800F0E0FF3F +:101340008DF80200E088ADF80E006089ADF810005D +:1013500002A810F0CCFA0028B7D168460DF076FF4D +:10136000B3E710B504460121FFF758FF002803D169 +:101370002046BDE81040A1E710BD0278012A01D047 +:10138000BAB118E042783AB1012A05D0022A12D146 +:1013900089B1818879B100E059B1418849B180882B +:1013A00038B101EB8101490000EB8000B1EB002F67 +:1013B00001D2002070471220704770B504460078B3 +:1013C0000D46012809D010F0FAFF052803D010F0CF +:1013D0009EF9002800D00C2070BD0DF004FE88B1ED +:1013E0000DF016FE0DF012FF0028F5D125B1607842 +:1013F0000DF0A6FE0028EFD1A1886088BDE87040FE +:1014000010F09BBA122070BD10B504460121FFF701 +:10141000B4FF002804D12046BDE810400121CCE7EC +:1014200010BDF0B5871FDDE9056540F67B44A74296 +:1014300013D28F1FA74210D288420ED8B2F5FA7F7E +:101440000BD2A3F10A00241FA04206D2521C4A4329 +:10145000B2EB830F01DAAE4201D90020F0BD0120CA +:10146000F0BD2DE9FC47477A8946044617F0050F81 +:101470007ED0F8087CD194F83A0008B9012F77D1D2 +:101480000025A8462E46F90789F0010A19D0208ABE +:10149000514600F021FFE8B36089514600F026FF75 +:1014A000C0B3208A6189884262D8A18EE08DCDE9DF +:1014B0000001238D628CA18BE08AFFF7B2FF48B355 +:1014C0000125B8070ED504EB4500828EC18DCDE90C +:1014D0000012038D428C818BC08AFFF7A2FFC8B136 +:1014E000A8466D1C78071ED504EB45065146308A88 +:1014F00000F0F2FE70B17089514600F0F7FE48B17D +:10150000308A7189884253D8B18EF08DCDE90001BF +:10151000338D00E00BE0728CB18BF08AFFF781FF16 +:1015200028B12E466D1CB9F1000F03D030E03020F9 +:10153000BDE8FC87F80707D0780705D504EB46011E +:1015400060894989884233D1228A01211BE04145C3 +:1015500003D004EB4100008A024404EB4100C38A3B +:10156000868AB34224D1838B468BB34220D100E0DC +:101570001EE0438C068CB3421AD1038DC08C83428B +:1015800016D1491CC9B2A942E1D3608990420FD358 +:10159000207810B101280BD102E0A0780028F9D101 +:1015A000607838B1012805D0022803D0032801D083 +:1015B0001220BDE70020BBE7002152E70178C907F0 +:1015C00002D0406812F0A3BE12F070BE10B50078D1 +:1015D000012800D00020FDF754FC002010BD2DE9AB +:1015E000F0478EB00D46AFF6A422D2E90092014634 +:1015F00090462846FFF735FF06000CD100F034FD79 +:1016000040B9FE4F387828B90DF0ACF9A0F57F410C +:10161000FF3903D00C200EB0BDE8F087032105F19F +:10162000100000F079FEF54809AA3E380990F44808 +:101630000A90F248062110380B900CA801F05CFCCF +:10164000040037D000210BF005FE04F130017B8A45 +:10165000BA8ACB830A84797C0091BA463B7CBA8AE9 +:10166000798A208801F036FD00B1FFDF208806F07E +:101670000AFF218804F10E0000F01CFDE1A004F136 +:10168000120700680590032105A804F055FF00200B +:1016900005A90A5C3A54401CC0B20328F9D3A88BB0 +:1016A0006080688CA080288DE080687A410703D52F +:1016B00008270AE00920AEE7C10701D0012704E0AE +:1016C000800701D5022700E000273A46BAF8160045 +:1016D000114610F0C7F90146A062204610F0D0F97B +:1016E0003A46214600200CF0D3F900B90926C34A36 +:1016F00021461C3200200CF0E8F9002784F87670AF +:1017000084F87770A87800F094FC6076D5F8030030 +:10171000C4F81A00B5F80700E083C4F8089084F80C +:101720000C80012084F8200101468DF80070684685 +:1017300004F002FF9DF8000000F00701C0F3C102B1 +:101740001144C0F3401008448DF80000401D20767D +:10175000092801D208302076012120460BF07AFDBD +:1017600068780DF04BFCEEBBA9782878EA1C0DF0E8 +:1017700018FC48B10DF04CFCA9782878EA1C0DF053 +:10178000B9FC060002D052E0122650E0687A00F060 +:1017900005010020CA0700D001208A0701D540F0CA +:1017A0000200490701D540F008000DF0E3FB0600F8 +:1017B0003DD1214603200DF0C7FC060037D10DF0C6 +:1017C000CCFC060033D1697A01F005018DF80810D0 +:1017D000697AC90708D06889ADF80A00288AADF887 +:1017E0000C0000E023E00120697A8A0700D5401C44 +:1017F000490707D505EB40004189ADF80E10008A76 +:10180000ADF8100002A810F072F8064695F83A00FC +:1018100000B101200DF0C0FB4EB90DF0F7FC060041 +:1018200005D1A98F204610F003F8060008D02088C3 +:1018300006F02AFE2088062101F0A2FB00B1FFDF9E +:101840003046E8E601460020C9E638B56B48007826 +:1018500078B910F0B4FD052805D00DF083F8A0F597 +:101860007F41FF3905D0684610F0ABF8040002D084 +:101870000CE00C2038BD0098008806F005FE0098AA +:101880000621008801F07CFB00B1FFDF204638BD57 +:101890001CB582894189CDE900120389C2888188FB +:1018A0004088FFF7BEFD08B100201CBD30201CBDE4 +:1018B00070B50546FFF7ECFF00280ED128880621F9 +:1018C00001F04CFB040007D000F032FC20B1D4F84A +:1018D0001801017831B901E0022070BDD4F864111B +:1018E000097809B13A2070BD05218171D4F8181129 +:1018F00000200881D4F81811A8884881D4F818115C +:10190000E8888881D4F818112889C881D4F818018A +:10191000028941898A4204D88279082A01D88A42F8 +:1019200001D3122070BD29884180D4F818110220FB +:101930000870002070BD3EB504460BF0B3FEB0B198 +:101940002E480125A0F140024570236842F8423F2D +:1019500023790021137141706946062001F087FA4E +:1019600000B1FFDF684601F060FA10B10EE012200E +:101970003EBDBDF80440029880F82051684601F051 +:1019800054FA18B9BDF80400A042F4D100203EBDBD +:1019900070B505460088062101F0E0FA040007D082 +:1019A00000F0C6FB20B1D4F81811087830B901E076 +:1019B000022070BDD4F86401007808B13A2070BDEF +:1019C000B020005D10F0010F22D0D5F80200486071 +:1019D000D5F806008860D4F8180169891022818141 +:1019E000D4F8180105F10C010E3004F58C74FCF7E5 +:1019F0001CFD216803200870288805E018080020D5 +:101A00007C0000201122330021684880002070BD36 +:101A10000C2070BD38B504460078EF284DD860889A +:101A2000ADF80000009800F089FC88B361880807D1 +:101A300008D4D4E9012082423FD8202A3DD3B0F512 +:101A4000804F3AD8207B18B3072836D8607B28B15E +:101A5000012803D0022801D003282ED14A0703D43D +:101A6000022801D0032805D1A07B08B1012824D188 +:101A7000480707D4607D28B1012803D0022801D08F +:101A800003281AD1C806E07D03D5012815D110E03E +:101A900013E0012801D003280FD1C80609D4607EC5 +:101AA000012803D0022801D0032806D1A07E0F28E8 +:101AB00003D8E07E18B1012801D0122038BD0020E3 +:101AC00038BDF8B514460D46064608F006F808B1CC +:101AD0000C20F8BD3046FFF79DFF0028F9D1FDF737 +:101AE000DAF92870B07554B9FF208DF80000694606 +:101AF0000020FDF7BAF969460020FDF7AAF9304643 +:101B0000BDE8F840FDF7EEB80022DAE70078C1083A +:101B100001D012207047FD4981F820000020704755 +:101B200010B504460078C00704D1608810B1FDF7F5 +:101B300073F980B12078618800F00102607800F0CC +:101B400021FC002806D1FDF74FF901466088884244 +:101B500003D9072010BD122010BD6168FDF785F97B +:101B6000002010BD10B504460078C00704D160887D +:101B700010B1FCF71CFE70B12078618800F0010202 +:101B8000607800F0FFFB002804D160886168FDF7F1 +:101B900060F9002010BD122010BD7CB504464078CD +:101BA0004225012808D8A078FCF7F9FD20B120785B +:101BB0001225012802D090B128467CBDFDF777F9A7 +:101BC00020B1A0880028F7D08028F5D8FDF776F955 +:101BD00060B160780028EFD02078012808D006F0A6 +:101BE00075FD044607F067FC00287FD00C207CBD03 +:101BF000FCF791FF10B9FDF753F990B307F06DFFB3 +:101C00000028F3D1FCF792FDA0F57F41FF39EDD11B +:101C1000FCF7A3FFA68842F210704643A079FDF7B7 +:101C20000CF9FCF7CBFDF8B10022072101A801F067 +:101C300063F9040058D0B6480021846020460BF0B8 +:101C400016FA2046FDF7CEFCB04D04F130006A8A4A +:101C5000A98AC2830184FCF7B8FD60B1E88A01213A +:101C60000DE0FFE712207CBD3146002007F0D5FCD7 +:101C700088B3FFDF44E0FDF723F90146E88A07F067 +:101C800077FD0146A0620022204606F022FDFCF707 +:101C90009CFD38B9FDF714F90246214601200BF0EE +:101CA000F7FED0B1994A21461C3201200BF00DFFFE +:101CB000687C00902B7CAA8A698A208801F00AFA45 +:101CC00000B1FFDF208806F0DEFB3146204607F03A +:101CD000A4FC00B1FFDF13E008E00721BDF8040019 +:101CE00001F04EF900B1FFDF09207CBD44B120882E +:101CF00006F0CAFB2088072101F042F900B1FFDF9E +:101D000000207CBD002148E770B50D46072101F099 +:101D100025F9040003D094F8930110B10AE00220E1 +:101D200070BD94F87D00142801D0152802D194F8D4 +:101D3000E00108B10C2070BD1022294604F5CA70DC +:101D4000FCF773FB012084F89301002070BD10B5EF +:101D5000072101F003F918B190F8931111B107E0D0 +:101D6000022010BD90F87D10142903D0152901D050 +:101D70000C2010BD022180F89311002010BD2DE928 +:101D8000FC410C464BF68032122194421DD8E4B13E +:101D90006946FEF727FC002815D19DF8000000F0E9 +:101DA0004FF9019E9DF80000703600F049F9019D41 +:101DB000AD1C2F882246394630460BF04EF9288854 +:101DC000B842F6D10020BDE8FC810846FBE77CB5AF +:101DD000044600886946FEF705FC002810D19DF8EE +:101DE000000000F02DF9019D9DF80000703500F015 +:101DF00027F90198A27890F82C10914201D10C207B +:101E00007CBD7F212972A9720021E972E17880F8F6 +:101E10002D10217980F82E10A17880F82C10002048 +:101E20007CBD1CB50C466946FEF7DCFB00280AD1D8 +:101E30009DF8000000F004F9019890F88C0000B1C2 +:101E40000120207000201CBD7CB50D46144669465B +:101E5000FEF7C8FB002809D19DF8000000F0F0F85B +:101E6000019890F82C00012801D00C207CBD9DF831 +:101E7000000000F0E5F8019890F87810297090F8CB +:101E80007900207000207CBD70B50D4616460721F4 +:101E900001F064F818B381880124C388428804EBF8 +:101EA0004104AC4217D842F210746343A410624359 +:101EB000B3FBF2F2521E94B24FF4FA72944200D97C +:101EC0001446A54200D22C46491C641CB4FBF1F216 +:101ED0004A43521E91B290F8CC211AB901E0022077 +:101EE00070BD01843180002070BD10B50C46072103 +:101EF00001F034F870B180F8FF4024B190F8FD1083 +:101F000009B107F04BFC002010BD000018080020AC +:101F1000700000200220F7E7017889B1417879B19B +:101F200041881B290CD381881B2909D3C188022928 +:101F300006D3F74902680A65406848650020704783 +:101F40001220704710B504460FF088FD204607F0B8 +:101F5000DEFB0020D8E710B507F0DCFB0020D3E75C +:101F60002DE9F04115460F46064601221146384636 +:101F70000FF078FD04460121384607F0F9FB844252 +:101F800000D204460121304600F05FF806460121E8 +:101F9000002000F05AF83118012096318C4206D901 +:101FA00001F19600611AB1FBF0F0401C80B228806C +:101FB0000020BDE8F08110B5044600F071F808B1CA +:101FC0000C20A1E7601C0AF09FFE207800F00100C1 +:101FD000FCF7BEFD207800F001000DF014F80020A1 +:101FE00092E710B50446072000F052FF08B10C201C +:101FF0008AE72078C00711D000226078114612F0DD +:1020000099FD08B112207FE7A06809F028FB6078ED +:10201000D4F8041009F02CFB002075E7002009F02B +:102020001EFB00210846F5E710B505F008FE00206C +:102030006AE718B1022801D00120704700207047DC +:1020400008B1002070470120704710B5012904D065 +:10205000022905D0FFDF204656E7C000503001E0DE +:1020600080002C3084B2F6E710B510F0A8F90428EF +:1020700003D0052801D0002046E7012044E710B531 +:10208000FFF7F2FF10B10DF085F828B907F025FD34 +:1020900020B1FCF738FD08B1012035E7002033E717 +:1020A00010B5FFF7E1FF18B907F017FD002800D0C1 +:1020B000012029E72DE9FE4300250F4680460A2628 +:1020C0000421404604F061FA40460BF08CFA0620E9 +:1020D00000F0ECFE044616E06946062000F0C7FE5C +:1020E0000BE000BFBDF80400B84206D002980422FD +:1020F00041460E30FCF76CF950B1684600F095FE91 +:102100000500EFD0641E002C06DD002DE4D005E0B4 +:1021100040460BF071FAF5E705B9FFDFD8F800008B +:102120000BF085FA761E01D00028C9D0BDE8FE83E9 +:1021300090F8F01090F88C0020B919B1042901D062 +:102140000120704700207047017800290AD04168BB +:1021500091F8FD20002A05D0002281F8FD2040687A +:1021600007F01CBB704770B514460546012200F00D +:102170001DF9002806D121462846BDE870400022FE +:1021800000F014B970BDFB2802D8B1F5296F01D950 +:1021900011207047002070471B38E12806D2B1F5A6 +:1021A000A47F03D344F29020814201D912207047CA +:1021B000002070471FB55649403191F82010CA07DA +:1021C00002D102781D2A0AD08A0702D402781C2A7A +:1021D00028D049073DD40178152937D039E08088C7 +:1021E000ADF8000002A9FEF7FDF900B1FFDF9DF890 +:1021F0000800FFF725FF039810F8601F8DF8021004 +:1022000040788DF803000020ADF8040001B9FFDF2D +:102210009DF8030000B9FFDF6846FEF750FCD8B117 +:10222000FFDF19E08088ADF800004FF42961FB2042 +:10223000ADF80410ADF80200ADF80600ADF80810D6 +:102240006846FEF74AFD38B1FFDF05E0807BC00736 +:1022500002D0002004B057E60120FBE7F8B507469E +:10226000508915460C4640B1B0F5004F05D200220A +:10227000A878114612F05EFC08B11220F8BDA06EDD +:1022800004F1700630B1A97894F86E00814201D053 +:102290000C20F8BD012184F86F10A97884F86E1025 +:1022A0006968A1666989A4F86C102889B084002146 +:1022B00084F86F1028886946FEF772FFB08CBDF86D +:1022C0000010081A00B2002804DD21463846FEF747 +:1022D00055FFDDE70020F8BD042803D321B9B0F590 +:1022E000804F01D90020704701207047042803D394 +:1022F00021B9B0F5804F01D9002070470120704707 +:10230000012802D030B10020704702207047000041 +:10231000D80700200120F9E710B500224FF4C84487 +:1023200009E000BF30F81230A34200D9234620F85C +:102330001230521CD2B28A42F4D3E5E580B2C10613 +:102340000BD401071CD481064FEAC07101D5B9B97D +:1023500000E099B1800713D410E0410610D4810643 +:102360000ED4C1074FEA807104D0002902DB400778 +:1023700004D405E0010703D4400701D40120C5E7D8 +:102380000020C3E770B50C460546FF2904D8FCF7CA +:102390001CFA18B11F2C01D9122070BD2846FCF779 +:1023A000FEF908B1002070BD422070BD0AB10122C3 +:1023B00000E00222024202D1C80802D109B1002085 +:1023C000A4E71120A2E7000030B5058825F40044F9 +:1023D00021448CB24FF4004194420AD2121B92B2B3 +:1023E0001B339A4201D2A94307E005F4004121437F +:1023F00003E0A21A92B2A9431143018030BD084400 +:10240000083050434A31084480B2704770B51D46C9 +:1024100016460B46044629463046049AFFF7EFFF5E +:102420000646B34200D2FFDF282200212046FCF7F7 +:1024300026F84FF6FF70A082283EB0B26577608024 +:10244000B0F5004F00D9FFDF618805F13C00814203 +:1024500000D2FFDF60880835401B343880B220800E +:102460001B2800D21B2020800020A07770BD816136 +:10247000886170472DE9F05F0D46C188044600F180 +:102480002809008921F4004620F4004800F063FB8D +:1024900010B10020BDE8F09F4FF0000A4FF0010B93 +:1024A000B0450CD9617FA8EB0600401A0838854278 +:1024B00019DC09EB06000021058041801AE06088E4 +:1024C000617F801B471A083F0DD41B2F00DAFFDF06 +:1024D000BD4201DC294600E0B9B2681A0204120CC0 +:1024E00004D0424502DD84F817A0D2E709EB0600CC +:1024F0000180428084F817B0CCE770B5044600F143 +:102500002802C088E37D20F400402BB110440288EB +:10251000438813448B4201D2002070BD00258A42BB +:1025200002D30180458008E0891A0904090C418022 +:1025300003D0A01D00F01FFB08E0637F0088083374 +:10254000184481B26288A01DFFF73EFFE5750120A7 +:1025500070BD70B5034600F12804C588808820F45A +:1025600000462644A84202D10020188270BD9889F6 +:102570003588A84206D3401B75882D1A2044ADB279 +:10258000C01E05E02C1AA5B25C7F20443044401DDB +:102590000C88AC4200D90D809C8924B100241470B1 +:1025A0000988198270BD0124F9E770B5044600F16D +:1025B0002801808820F400404518208A002825D072 +:1025C000A189084480B2A08129886A881144814287 +:1025D00000D2FFDF2888698800260844A189884244 +:1025E00012D1A069807F2871698819B1201D00F07F +:1025F000C2FA08E0637F28880833184481B26288F1 +:10260000201DFFF7E1FEA6812682012070BD2DE985 +:10261000F041418987880026044600F12805B94227 +:1026200019D004F10A0800BF21F400402844418871 +:1026300019B1404600F09FFA08E0637F0088083334 +:10264000184481B262884046FFF7BEFE761C61895D +:10265000B6B2B942E8D13046BDE8F0812DE9F0418B +:1026600004460B4627892830A68827F40041B4F891 +:102670000A8001440D46B74201D10020ECE70AB1BF +:10268000481D106023B1627F691D1846FBF7CDFE1F +:102690002E88698804F1080021B18A1996B200F0E9 +:1026A0006AFA06E0637F62880833991989B2FFF7F6 +:1026B0008BFE474501D1208960813046CCE7818877 +:1026C000C088814201D101207047002070470189F4 +:1026D0008088814201D1012070470020704770B589 +:1026E0008588C38800F1280425F4004223F40041C2 +:1026F00014449D421AD08389058A5E19258863880F +:10270000EC18A64214D313B18B4211D30EE0437FD1 +:1027100008325C192244408892B2801A80B2233376 +:10272000984201D211B103E08A4201D1002070BD6C +:10273000012070BD2DE9F0478846C1880446008914 +:1027400021F4004604F1280720F4004507EB0609B0 +:1027500000F001FA002178BBB54204D9627FA81BC2 +:10276000801A002503E06088627F801B801A083889 +:1027700023D4E28962B1B9F80020B9F802303BB144 +:10278000E81A2177404518DBE0893844801A09E0CF +:10279000801A217740450ADB607FE18908303044A8 +:1027A00039440844C01EA4F81280BDE8F0874545AE +:1027B00003DB01202077E7E7FFE761820020F4E7F1 +:1027C0002DE9F74F044600F12805C088884620F41B +:1027D000004A608A05EB0A0608B1404502D2002093 +:1027E000BDE8FE8FE08978B13788B6F8029007EB34 +:1027F0000901884200D0FFDF207F4FF0000B50EA34 +:10280000090106D088B33BE00027A07FB9463071AC +:10281000F2E7E18959B1607F294408305044084407 +:10282000B4F81F1020F8031D94F821108170E2897C +:1028300007EB080002EB0801E1813080A6F802B046 +:1028400002985F4650B1637F30880833184481B2E4 +:102850006288A01DFFF7B8FDE78121E0607FE18974 +:1028600008305044294408442DE0FFE7E089B4F8DB +:102870001F102844C01B20F8031D94F821108170FC +:1028800009EB0800E28981B202EB0800E0813780A1 +:1028900071800298A0B1A01D00F06DF9A4F80EB0EF +:1028A000A07F401CA077A07D08B1E088A08284F8BA +:1028B00016B000BFA4F812B084F817B001208FE75B +:1028C000E0892844C01B30F8031DA4F81F1080784D +:1028D00084F82100EEE710B5818800F1280321F487 +:1028E00000442344848AC288A14212D0914210D06D +:1028F000818971B9826972B11046FFF7E8FE50B95B +:102900001089283220F40040104419790079884257 +:1029100001D1002010BD184610BD00F12803407FF2 +:1029200008300844C01E1060088808B9DB1E136018 +:1029300008884988084480B270472DE9F04100F1C9 +:102940002806407F1C4608309046431808884D886A +:10295000069ADB1EA0B1C01C80B2904214D9801A26 +:10296000A04200DB204687B298183A464146FBF762 +:102970002FFD002816D1E01B84B2B844002005E0EA +:10298000ED1CADB2F61EE8E7101A80B20119A9429B +:1029900006D8304422464146BDE8F041FBF718BD59 +:1029A0004FF0FF3058E62DE9F04100F12804407F58 +:1029B0001E46083090464318002508884F88069A1E +:1029C000DB1E90B1C01C80B2904212D9801AB04276 +:1029D00000DB304685B299182A464046FBF725FDB4 +:1029E000701B86B2A844002005E0FF1CBFB2E41EA5 +:1029F000EAE7101A80B28119B94206D82118324686 +:102A00004046FBF712FDA81985B2284624E62DE9B9 +:102A1000F04100F12804407F1E46083090464318DC +:102A2000002508884F88069ADB1E90B1C01C80B232 +:102A3000904212D9801AB04200DB304685B2981815 +:102A40002A464146FBF7F1FC701B86B2A8440020E1 +:102A500005E0FF1CBFB2E41EEAE7101A80B281193C +:102A6000B94206D8204432464146FBF7DEFCA8199D +:102A700085B22846F0E5401D704710B5044600F1C8 +:102A80002801C288808820F400431944904206D06F +:102A9000A28922B9228A12B9A28A904201D10020C9 +:102AA00010BD0888498831B1201D00F064F800206D +:102AB0002082012010BD637F62880833184481B2F0 +:102AC000201DFFF781FCF2E70021C18101774182DF +:102AD000C1758175704703881380C28942B1C2886D +:102AE00022F4004300F128021A440A60C0897047AA +:102AF0000020704710B50446808AA0F57F41FF3959 +:102B000000D0FFDFE088A082E08900B10120A0753D +:102B100010BD4FF6FF71818200218175704710B59D +:102B20000446808AA0F57F41FF3900D1FFDFA07DF8 +:102B300028B9A088A18A884201D1002010BD0120B7 +:102B400010BD8188828A914201D1807D08B1002028 +:102B500070470120704720F4004221F400439A425C +:102B600007D100F4004001F40041884201D0012067 +:102B700070470020704730B5044600880D4620F4A9 +:102B80000040A84200D2FFDF21884FF40040884374 +:102B90002843208030BD70B50C00054609D0082CB4 +:102BA00000D2FFDF1DB1A1B2286800F044F8201D5B +:102BB00070BD0DB100202860002070BD00210268AA +:102BC00003E093881268194489B2002AF9D100F011 +:102BD00032B870B500260D460446082900D2FFDF42 +:102BE000206808B91EE0044620688188A94202D006 +:102BF00001680029F7D181880646A94201D1006801 +:102C00000DE005F1080293B20022994209D328444D +:102C1000491B026081802168096821600160206091 +:102C200000E00026304670BD00230B608A800268F9 +:102C30000A600160704700234360021D0181026049 +:102C40007047F0B50F460188408815460C181E469F +:102C5000AC4200D3641B3044A84200D9FFDFA01966 +:102C6000A84200D9FFDF3819F0BD2DE9F0418846B0 +:102C700006460188408815460C181F46AC4200D312 +:102C8000641B3844A84200D9FFDFE019A84200D9EC +:102C9000FFDF70883844708008EB0400BDE8F081E5 +:102CA0002DE9F041054600881E461746841B8846DC +:102CB000BC4200D33C442C8068883044B84200D9E0 +:102CC000FFDFA019B84200D9FFDF68883044688070 +:102CD00008EB0400E2E72DE9F04106881D460446B2 +:102CE000701980B2174688462080B84201D3C01BB5 +:102CF00020806088A84200D2FFDF7019B84200D956 +:102D0000FFDF6088401B608008EB0600C6E730B537 +:102D10000D460188CC18944200D3A41A40889842EA +:102D200000D8FFDF281930BD2DE9F041C84D044619 +:102D30009046A8780E46A04200D8FFDF05EB860734 +:102D4000B86A50F8240000B1FFDFB868002816D038 +:102D5000304600F044F90146B868FFF73AFF050035 +:102D60000CD0B86A082E40F8245000D3FFDFB948D1 +:102D70004246294650F82630204698472846BDE866 +:102D8000F0812DE9F8431E468C1991460F46054601 +:102D9000FF2C00D9FFDFB14500D9FFDFE4B2009579 +:102DA0004DB300208046E81C20F00300A84200D06C +:102DB000FFDF4946DFF89892684689F8001089F8E5 +:102DC000017089F8024089F8034089F8044089F8C5 +:102DD000054089F8066089F80770414600F008F957 +:102DE000002142460F464B460098C01C20F00300CD +:102DF000009012B10EE00120D4E703EB8106B0622F +:102E0000002005E0D6F828C04CF82070401CC0B265 +:102E1000A042F7D30098491C00EB8400C9B200908F +:102E20000829E1D3401BBDE8F88310B50446EEF74E +:102E300036FA08B1102010BD2078854A618802EB6F +:102E4000800092780EE0836A53F8213043B14A1C27 +:102E50006280A180806A50F82100A060002010BD2F +:102E6000491C89B28A42EED86180052010BD70B538 +:102E700005460C460846EEF712FA08B1102070BD60 +:102E8000082D01D3072070BD25700020608070BD23 +:102E90000EB56946FFF7EBFF00B1FFDF6846FFF7AD +:102EA000C4FF08B100200EBD01200EBD10B50446C0 +:102EB000082800D3FFDF6648005D10BD3EB505461B +:102EC00000246946FFF7D3FF18B1FFDF01E0641C5F +:102ED000E4B26846FFF7A9FF0028F8D02846FFF7BC +:102EE000E5FF001BC0B23EBD59498978814201D936 +:102EF000C0B27047FF2070472DE9F041544B0629BE +:102F000003D007291CD19D7900E0002500244FF64D +:102F1000FF7603EB810713F801C00AE06319D7F8C5 +:102F200028E09BB25EF823E0BEF1000F04D0641CE1 +:102F3000A4B2A445F2D8334603801846B34201D167 +:102F400000201CE7BDE8F041EEE6A0F57F43FF3B23 +:102F500001D0082901D300207047E5E6A0F57F42A3 +:102F6000FF3A0BD0082909D2394A9378834205D910 +:102F700002EB8101896A51F82000704700207047F8 +:102F80002DE9F04104460D46A4F57F4143F20200CD +:102F9000FF3902D0082D01D30720F0E62C494FF06D +:102FA00000088A78A242F8D901EB8506B26A52F885 +:102FB0002470002FF1D027483946203050F82520C2 +:102FC00020469047B16A284641F8248000F007F86F +:102FD00002463946B068FFF727FE0020CFE61D49BC +:102FE000403131F810004FF6FC71C01C08407047AA +:102FF0002DE9F843164E8846054600242868C01C73 +:1030000020F0030028602046FFF7E9FF315D4843C8 +:10301000B8F1000F01D0002200E02A6801460092BA +:1030200032B100274FEA0D00FFF7B5FD1FB106E0F2 +:1030300001270020F8E706EB8401009A8A602968DE +:10304000641C0844E4B22860082CD7D3EBE60000E7 +:103050003C0800201863020070B50E461D4611465C +:1030600000F0D5F804462946304600F0D9F820444F +:10307000001D70BD2DE9F04190460D4604004FF053 +:10308000000610D00027E01C20F00300A04200D072 +:10309000FFDFE5B141460020FFF77DFD0C3000EB7E +:1030A000850617B113E00127EDE7624F04F10C002C +:1030B000AA003C602572606000EB85002060002162 +:1030C0006068FBF7DCF941463868FFF764FD30467D +:1030D000BDE8F0812DE9FF4F564C804681B0206855 +:1030E0009A46934600B9FFDF2068027A424503D929 +:1030F000416851F8280020B143F2020005B0BDE854 +:10310000F08F5146029800F082F886B258460E9928 +:1031100000F086F885B27019001D87B22068A146BC +:1031200039460068FFF755FD04001FD067802580F1 +:103130002946201D0E9D07465A4601230095FFF79C +:1031400065F92088314638440123029ACDF800A061 +:10315000FFF75CF92088C1193846FFF788F9D9F8DC +:1031600000004168002041F82840C7E70420C5E777 +:1031700070B5304C0546206800B9FFDF2068017A41 +:10318000A9420ED9426852F8251051B1002342F8E5 +:1031900025304A880068FFF747FD216800200A7A39 +:1031A00008E043F2020070BD4B6853F8203033B999 +:1031B000401CC0B28242F7D80868FFF7FFFC00202D +:1031C00070BD70B51B4E05460024306800B9FFDFA6 +:1031D0003068017AA94204D9406850F8250000B14E +:1031E000041D204670BD70B5124E0546002430689F +:1031F00000B9FFDF3068017AA94206D9406850F86B +:10320000251011B131F8040B4418204670BD10B5DB +:103210000A460121FFF7F3F8C01C20F0030010BD9F +:1032200010B50A460121FFF7EAF8C01C20F00300A0 +:1032300010BD00008400002070B50446C2F11005E6 +:103240002819FBF7F2F815F0FF0109D0491ECAB2A0 +:103250008020A0542046BDE870400021FBF70FB944 +:1032600070BD30B505E05B1EDBB2CC5CD55C6C405C +:10327000C454002BF7D130BD10B5002409E00B7801 +:10328000521E44EA430300F8013B11F8013BD2B25D +:10329000DC09002AF3D110BD2DE9F04389B01E46A8 +:1032A000DDE9107990460D00044622D0024608461A +:1032B000F949FDF750FE102221463846FFF7DCFFA2 +:1032C000E07B000606D5F44A394610231032084642 +:1032D000FFF7C7FF102239464846FFF7CDFFF87BBE +:1032E000000606D5EC4A4946102310320846FFF77F +:1032F000B8FF102200212046FBF7C1F80DE0103E78 +:10330000B6B208EB0601102322466846FFF7A9FF74 +:10331000224628466946FDF71EFE102EEFD818D02B +:10332000F2B241466846FFF787FF10234A466946D6 +:1033300004A8FFF796FF1023224604A96846FFF76A +:1033400090FF224628466946FDF705FE09B0BDE814 +:10335000F08310233A464146EAE770B59CB01E461A +:103360000546134620980C468DF808002022194681 +:103370000DF10900FBF759F8202221460DF1290033 +:10338000FBF753F817A913A8CDE90001412302AABE +:1033900031462846FFF780FF1CB070BD2DE9FF4F76 +:1033A0009FB014AEDDE92D5410AFBB49CDE90076D6 +:1033B000202320311AA8FFF76FFF4FF000088DF887 +:1033C00008804FF001098DF8099054F8010FCDF8ED +:1033D0000A00A088ADF80E0014F8010C1022C0F30A +:1033E00040008DF8100055F8010FCDF81100A888A5 +:1033F000ADF8150015F8010C2C99C0F340008DF8BC +:10340000170006A88246FBF710F80AA88346102288 +:103410002299FBF70AF8A0483523083802AA406829 +:103420008DF83C80CDE900760E901AA91F98FFF721 +:1034300033FF8DF808808DF809902068CDF80A00D8 +:10344000A088ADF80E0014F8010C1022C0F3400063 +:103450008DF810002868CDF81100A888ADF8150087 +:1034600015F8010C2C99C0F340008DF81700504658 +:10347000FAF7DBFF584610222299FAF7D6FF864862 +:103480003523083802AA40688DF83C90CDE90076D3 +:103490000E901AA92098FFF7FFFE23B0BDE8F08F29 +:1034A000F0B59BB00C460546DDE922101E461746D6 +:1034B000DDE92032D0F801C0CDF808C0B0F805C071 +:1034C000ADF80CC00078C0F340008DF80E00D1F8C4 +:1034D0000100CDF80F00B1F80500ADF81300087831 +:1034E0001946C0F340008DF815001088ADF816009D +:1034F00090788DF818000DF119001022FAF795FF59 +:103500000DF1290010223146FAF78FFF0DF1390035 +:1035100010223946FAF789FF17A913A8CDE900014F +:10352000412302AA21462846FFF7B6FE1BB0F0BD94 +:10353000F0B5A3B017460D4604461E46102202A859 +:103540002899FAF772FF06A820223946FAF76DFF8C +:103550000EA820222946FAF768FF1EA91AA8CDE96D +:103560000001502302AA314616A8FFF795FE1698CF +:10357000206023B0F0BDF0B589B00446DDE90E0748 +:103580000D463978109EC1F340018DF80010317856 +:103590009446C1F340018DF801101968CDF802106E +:1035A0009988ADF8061099798DF808100168CDF862 +:1035B00009108188ADF80D1080798DF80F00102367 +:1035C0006A46614604A8FFF74CFE2246284604A935 +:1035D000FDF7C1FCD6F801000090B6F80500ADF883 +:1035E0000400D7F80100CDF80600B7F80500ADF8E3 +:1035F0000A000020039010236A46214604A8FFF722 +:1036000030FE2246284604A9FDF7A5FC09B0F0BD0E +:103610001FB51C6800945B6801931368029352689D +:103620000392024608466946FDF795FC1FBD10B59A +:1036300088B00446106804905068059000200690F9 +:10364000079008466A4604A9FDF785FCBDF800000E +:10365000208008B010BD1FB51288ADF800201A8870 +:10366000ADF802200022019202920392024608461F +:103670006946FDF770FC1FBD7FB5074B1446054634 +:10368000083B9A1C6846FFF7E6FF22466946284633 +:10369000FFF7CDFF7FBD00007063020070B50446E8 +:1036A00000780E46012813D0052802D0092813D12E +:1036B0000EE0A06861690578042003F04DFA052D3D +:1036C0000AD0782300220420616903F09BF903E00B +:1036D0000420616903F040FA31462046BDE870409D +:1036E00001F08AB810B500F12D03C2799C78411D14 +:1036F000144064F30102C271D2070DD04A795C799B +:1037000022404A710A791B791A400A718278C97875 +:103710008A4200D9817010BD00224A71F5E74178D4 +:10372000012900D00C21017070472DE9F04F93B0B2 +:103730004FF0000B0C690D468DF820B0097801267A +:103740000C2017464FF00D084FF0110A4FF00809F2 +:103750001B2975D2DFE811F01B00C40207031F0309 +:103760005E037103A303B803F9031A04620495040A +:10377000A204EF042D05370555056005F30536064F +:10378000390668068406FE062207EB06F00614B129 +:1037900020781D282AD0D5F808805FEA08004FD08D +:1037A00001208DF82000686A02220D908DF82420F7 +:1037B0000A208DF82500A8690A90A8880028EED074 +:1037C00098F8001091B10F2910D27DD2DFE801F0F6 +:1037D0007C1349DEFCFBFAF9F8F738089CF6F50093 +:1037E00002282DD124B120780C2801D00026F0E346 +:1037F0008DF82020CBE10420696A03F0ADF9A88898 +:103800000728EED1204600F0F2FF022809D020461A +:1038100000F0EDFF032807D9204600F0E8FF072855 +:1038200002D20120207004E0002CB8D020780128BA +:10383000D7D198F80400C11F0A2902D30A2061E0F9 +:10384000C4E1A070D8F80010E162B8F80410218635 +:1038500098F8060084F832000120287003202070B8 +:1038600044E00728BDD1002C99D020780D28B8D18C +:1038700098F8031094F82F20C1F3C000C2F3C002DF +:10388000104201D0062000E00720890707D198F8F0 +:1038900005100142D2D198F806100142CED194F819 +:1038A000312098F8051020EA02021142C6D194F89E +:1038B000322098F8061090430142BFD198F80400D6 +:1038C000C11F0A29BAD200E008E2617D81427CD89A +:1038D000D8F800106160B8F80410218198F806004B +:1038E000A072012028700E20207003208DF8200087 +:1038F000686A0D9004F12D000990601D0A900F3048 +:103900000B9022E12875FCE3412891D1204600F07C +:103910006EFF042802D1E078C00704D1204600F0F1 +:1039200066FF0F2884D1A88CD5F80C8080B24FF0A8 +:10393000400BE669FFF745FC324641465B464E4682 +:10394000CDF80090FFF72FF80B208DF82000686A63 +:103950000D90E0690990002108A8FFF79FFE2078EC +:10396000042806D0A07D58B1012809D003280AD028 +:103970004AE305202070032028708DF82060CEE1F6 +:1039800084F800A032E712202070EAE11128BCD1AF +:10399000204600F02CFF042802D1E078C00719D09F +:1039A000204600F024FF062805D1E078C00711D199 +:1039B000A07D02280ED0204608E0CCE084E072E131 +:1039C00051E124E103E1E9E019E0B0E100F00FFF8B +:1039D00011289AD1102208F1010104F13C00FAF7F4 +:1039E00024FD607801286ED012202070E078C00796 +:1039F00060D0A07D0028C8D00128C6D05AE0112888 +:103A000090D1204600F0F3FE082804D0204600F0B4 +:103A1000EEFE132886D104F16C00102208F101019A +:103A20000646FAF702FD207808280DD014202070F1 +:103A3000E178C8070DD0A07D02280AD06278022A5A +:103A400004D00328A1D035E00920F0E708B101280F +:103A500037D1C80713D0A07D02281DD000200090C8 +:103A6000D4E9062133460EA8FFF777FC10220EA9F1 +:103A700004F13C00FAF7ACFCC8B1042042E7D4E9F9 +:103A80000912201D8DE8070004F12C0332460EA810 +:103A9000616BFFF770FDE9E7606BC1F34401491EFC +:103AA0000068C84000F0010040F08000D7E72078AF +:103AB000092806D185F800908DF8209036E328700B +:103AC000EFE30920FBE79EE1112899D1204600F0A1 +:103AD0008EFE0A2802D1E078C00704D1204600F00B +:103AE00086FE15288CD104F13C00102208F101015A +:103AF0000646FAF79AFC20780A2816D0162020707D +:103B0000D4E90932606B611D8DE80F0004F15C039C +:103B100004F16C0247310EA8FFF7C2FC10220EA977 +:103B20003046FAF755FC18B1F9E20B20207073E229 +:103B30002046FFF7D7FDA078216AC0F110020B18CC +:103B400000211846FAF79BFC26E3394608A8FFF740 +:103B5000A5FD06463CE20228B7D1204600F047FE0C +:103B6000042804D3204600F042FE082809D320464A +:103B700000F03DFE0E2829D3204600F038FE122822 +:103B800024D2A07D0228A0D10E208DF82000686AE2 +:103B90000D9098F801008DF82400F5E3022894D1E7 +:103BA000204600F024FE002810D0204600F01FFE22 +:103BB0000128F9D0204600F01AFE0C28F4D0042089 +:103BC0008DF8240098F801008DF8250060E2112896 +:103BD000FCD1002CFAD020781728F7D16178606AE0 +:103BE000022912D05FF0000101EB4101182606EB1B +:103BF000C1011022405808F10101FAF716FC042017 +:103C0000696A00F0E7FD2670F0E50121ECE70B287A +:103C1000DCD1002CDAD020781828D7D16078616AFE +:103C200002281CD05FF0000000EB4002102000EBE7 +:103C3000C2000958B8F8010008806078616A02285B +:103C40000FD0002000EB4002142000EBC200095806 +:103C5000404650F8032F0A604068486039E0012070 +:103C6000E2E70120EEE71128B0D1002CAED0207899 +:103C70001928ABD16178606A022912D05FF0000187 +:103C800001EB41011C2202EBC1011022405808F156 +:103C90000101FAF7CAFB0420696A00F09BFD1A20B3 +:103CA000B6E00121ECE7082890D1002C8ED02078D6 +:103CB0001A288BD1606A98F80120017862F34701D5 +:103CC0000170616AD8F8022041F8012FB8F80600A7 +:103CD00088800420696A00F07DFD90E2072011E6EB +:103CE0003878012894D1182204F114007968FAF781 +:103CF0009CFBE079C10894F82F0001EAD001E0783C +:103D000061F30000E070217D002974D1217803293E +:103D100009D0C00725D0032028708DF82090686A4C +:103D20000D90412008E3607DA178884201D90620EA +:103D3000E8E502262671E179204621F0E001E171F3 +:103D4000617A21F0F0016172A17A21F0F001A17293 +:103D5000FFF7C8FC2E708DF82090686A0D90072040 +:103D6000EAE20420ABE6387805289DD18DF82000E2 +:103D7000686A0D90B8680A900720ADF824000A9888 +:103D80008DF830B06168016021898180A17A8171EC +:103D900004202070F8E23978052985D18DF82010AB +:103DA000696A0D91391D09AE0EC986E80E004121E0 +:103DB000ADF824108DF830B01070A88CD7F80C80B6 +:103DC00080B24026A769FFF70EFA41463A463346CD +:103DD000C846CDF80090FEF71AFE002108A8FFF7AC +:103DE0005DFCE07820F03E00801CE0702078052823 +:103DF00002D00F200CE04AE1A07D20B1012802D0C2 +:103E0000032802D002E10720BEE584F80080EDE43B +:103E10002070EBE4102104F15C0002F0B6FB606B53 +:103E2000B0BBA07D18B1012801D00520FDE006201F +:103E30002870F8486063A063C2E23878022894D101 +:103E4000387908B12875B7E3A07D022802D003288D +:103E500005D022E0B8680028F5D060631CE06078E7 +:103E6000012806D0A07994F82E10012805D0E94841 +:103E700006E0A17994F82E00F7E7B8680028E2D0B0 +:103E80006063E078C00701D0012902D0E14803E077 +:103E900003E0F8680028D6D0A06306200FE68DF86E +:103EA0002090696A0D91E1784846C90709D0617888 +:103EB000022903D1A17D29B1012903D0A17D0329C4 +:103EC00000D00720287033E138780528BBD120784E +:103ED00007281ED084F800A005208DF82000686A0D +:103EE0000D90B8680A90ADF824A08DF830B0032189 +:103EF0000170E178CA070FD0A27D022A1AD00021F2 +:103F00000091D4E9061204F15C03401CFFF725FA86 +:103F10006BE384F80090DFE7D4E90923211D8DE8E5 +:103F20000E0004F12C0304F15C02401C616BFFF7EE +:103F300022FB5AE3626BC1F34401491E1268CA4076 +:103F400002F0010141F08001DAE738780528BDD19F +:103F50008DF82000686A0D90B8680A90ADF824A02A +:103F60008DF830B0042100F8011B102204F15C012F +:103F7000FAF75BFA002108A8FFF790FB20780928E0 +:103F800001D0132044E70A2020709AE5E078C107A9 +:103F900042D0A17D012902D0022927D038E06178E2 +:103FA00008A8012916D004F16C010091D4E9061289 +:103FB00004F15C03001DFFF7BBFA0A2028700326FA +:103FC0008DF82080686A0D90002108A8FFF766FB35 +:103FD000E1E2C7E204F15C010091D4E9062104F1B9 +:103FE0006C03001DFFF7A4FA0026E9E7C0F34401C3 +:103FF00014290DD24FF0006101EBB0104FEAB06010 +:10400000E0706078012801D01020BDE40620FFE6B2 +:10401000607801283FF4B6AC0A2050E5E178C90782 +:1040200008D0A17D012903D10B202870042030E0A5 +:1040300028702EE00E2028706078616B012818D05F +:1040400004F15C0304F16C020EA8FFF7E1FA2046CC +:10405000FFF748FBA0780EAEC0F1100230440021FB +:10406000FAF70DFA06208DF82000686A09960D907F +:104070009BE004F16C0304F15C020EA8FFF7C8FAA0 +:10408000E8E73978022903D139790029D0D0297598 +:1040900092E28DF82000686A0D9056E5387807287E +:1040A000F6D1D4E909216078012808D004F16C0028 +:1040B000CDE90002029105D104F16C0304E004F1A2 +:1040C0005C00F5E704F15C0304F14C007A680646F5 +:1040D000216AFFF763F96078012822D1A078216A6C +:1040E000C0F110020B1800211846FAF7C8F9D4E9FC +:1040F0000923606B04F12D018DE80F0004F15C03CE +:1041000000E05BE204F16C0231460EA8FFF7C8F94B +:1041100010220EA904F13C00FAF75AF908B10B205D +:10412000ACE485F8008000BF8DF82090686A0D909F +:104130008DF824A009E538780528A9D18DF820004C +:10414000686A0D90B8680A90ADF824A08DF830B078 +:1041500080F80080617801291AD0D4E9092104F19E +:104160002D03A66B03910096CDE9013204F16C0397 +:1041700004F15C0204F14C01401CFFF791F90021AD +:1041800008A8FFF78BFA6078012805D015203FE6D4 +:10419000D4E90912631DE4E70E20287006208DF88B +:1041A0002000686ACDF824B00D90A0788DF8280022 +:1041B000CBE438780328C0D1E079C00770D00F2055 +:1041C0002870072065E7387804286BD11422391D40 +:1041D00004F11400FAF729F9616A208CA1F80900AA +:1041E000616AA078C871E179626A01F00301117215 +:1041F000616A627A0A73616AA07A81F824001620E3 +:104200005DE485F800A08DF82090696A50460D9114 +:1042100092E00000706302003878052842D1B86847 +:10422000A8616178606A022901D0012100E00021C3 +:1042300001EB4101142606EBC1014058082102F0B0 +:10424000A4F96178606A022901D0012100E000210F +:1042500001EB410106EBC101425802A8E169FFF7F9 +:104260000BFA6078626A022801D0012000E0002089 +:1042700000EB4001102000EBC1000223105802A9FE +:104280000932FEF7EEFF626AFD4B0EA80932A16902 +:10429000FFF7E1F96178606A022904D0012103E0A7 +:1042A00044E18DE0BFE0002101EB4101182606EB5F +:1042B000C101A27840580EA9FAF7B7F86178606A90 +:1042C000022901D0012100E0002101EB410106EBB0 +:1042D000C1014158A0780B18C0F110020021184606 +:1042E000FAF7CDF805208DF82000686A0D90A869CE +:1042F0000A90ADF824A08DF830B0062101706278E4 +:10430000616A022A01D0012200E0002202EB42028F +:1043100006EBC202401C89581022FAF786F80021E9 +:1043200008A8FFF7BBF91220C5F818B028708DF85F +:104330002090686A0D900B208DF8240005E43878F1 +:10434000052870D18DF82000686A0D90B8680A9031 +:104350000B20ADF824000A98072101706178626A89 +:10436000022901D0012100E0002101EB41031021CD +:1043700001EBC30151580988A0F801106178626A05 +:10438000022902D0012101E02FE1002101EB4103CC +:10439000142101EBC30151580A6840F8032F496802 +:1043A000416059E01920287001208DF8300074E632 +:1043B000162028708DF830B0002108A8FFF76EF99C +:1043C000032617E114202870AEE6387805282AD194 +:1043D0008DF82000686A0D90B8680A90ADF824A0A6 +:1043E0008DF830B080F800906278616A4E46022AFB +:1043F00001D0012200E0002202EB42021C2303EB69 +:10440000C202401C89581022FAF70FF8002108A8B0 +:10441000FFF744F9152028708DF82060686A0D9028 +:104420008DF8246039E680E0387805287DD18DF854 +:104430002000686A0D90B8680A90ADF824900921B0 +:1044400001706169097849084170616951F8012F6B +:10445000C0F802208988C18020781C28A8D1A1E753 +:10446000E078C00702D04FF0060C01E04FF0070CD7 +:10447000607802280AD000BF4FF0000000EB040172 +:1044800001F1090105D04FF0010004E04FF00100F7 +:10449000F4E74FF000000B78204413EA0C030B7094 +:1044A00010F8092F02EA0C02027004D14FF01B0C25 +:1044B00084F800C0D2B394F801C0BCF1010F00D061 +:1044C0009BB990F800C0E0465FEACC7C04D028F0AD +:1044D00001060670102606E05FEA887C05D528F004 +:1044E0000206067013262E70032694F801C0BCF154 +:1044F000020F00D092B991F800C05FEACC7804D0E6 +:104500002CF001060E70172106E05FEA8C7805D5C5 +:104510002CF002060E701921217000260078D0BB05 +:10452000CAB3C3BB1C20207035E012E002E038782B +:10453000062841D11A2015E4207801283CD00C2807 +:104540003AD02046FFF7EBF809208DF82000686A82 +:104550000D9031E03878052805D006203870032604 +:104560001820287046E005208DF82000696A0D911A +:10457000B9680A910221ADF8241001218DF830109C +:104580000A990870287D4870394608A8FFF786F810 +:10459000064618202870012E0ED02BE001208DF841 +:1045A0002000686A0D9003208DF82400287D8DF886 +:1045B000250085F814B012E0287D80B11D20207000 +:1045C000172028708DF82090686A0D9002208DF8D1 +:1045D0002400394608A8FFF761F806460AE00CB146 +:1045E000FE2020709DF8200020B1002108A8FFF7D0 +:1045F00055F80CE413B03046BDE8F08F2DE9F043D8 +:1046000087B00C464E6900218DF8041001202578F2 +:10461000034602274FF007094FF0050C85B1012D25 +:1046200053D0022D39D1FE2030708DF80030606AF1 +:10463000059003208DF80400207E8DF8050063E0CE +:104640002179012925D002292DD0032928D0042938 +:1046500023D1B17D022920D131780D1F042D04D33F +:104660000A3D032D01D31D2917D12189022914D315 +:104670008DF80470237020899DF80410884201E0B1 +:104680006863020018D208208DF80000606A059067 +:1046900057E070780128EBD0052007B0BDE8F08323 +:1046A0001D203070E4E771780229F5D131780C29AA +:1046B000F3D18DF80490DDE7083402F804CB94E8D8 +:1046C0000B0082E80B000320E7E71578052DE4D105 +:1046D0008DF800C0656A0595956802958DF81010F3 +:1046E00094F80480B8F1010F13D0B8F1020F2DD067 +:1046F000B8F1030F1CD0B8F1040FCED1ADF804709F +:104700000E202870207E687000216846FEF7C6FFE4 +:104710000CE0ADF804700B202870207E002100F022 +:104720001F0068706846FEF7B9FF37700020B4E7D5 +:10473000ADF804708DF8103085F800C0207E6870E8 +:10474000277011466846FEF7A9FFA6E7ADF804906A +:104750002B70207F6870607F00F00100A870A07F40 +:1047600000F01F00E870E27F2A71C0071CD094F8A7 +:10477000200000F00700687194F8210000F00700A5 +:10478000A87100216846FEF789FF2868F062A888B2 +:104790003086A87986F83200A0694078707528794B +:1047A000B0700D203070C1E7A9716971E9E700B5FB +:1047B00087B004280CD101208DF800008DF804008A +:1047C000002005918DF8050001466846FEF766FF5A +:1047D00007B000BD70B50C46054602F0BDF9214694 +:1047E0002846BDE870407823002202F00BB908B1DA +:1047F000007870470C20704770B50C0005784FF0BA +:1048000000010CD021702146F0F787FD694821781E +:10481000405D884201D1032070BD022070BDF0F7D9 +:104820007CFD002070BD0279012A05D000220A70AB +:104830004B78012B02D003E0042070470A758A618F +:1048400002799300521C0271C15003207047F0B5E9 +:1048500087B00F4605460124287905EB800050F803 +:10486000046C7078411E02290AD252493A4608392E +:1048700001EB8000314650F8043C28469847044636 +:104880000CB1012C11D12879401E10F0FF002871C5 +:1048900001D00324E0E70A208DF80000706A05903B +:1048A000002101966846FFF7A7FF032CD4D007B07C +:1048B0002046F0BD70B515460A4604462946104606 +:1048C000FFF7C5FF064674B12078FE280BD1207C87 +:1048D00030B100202870294604F10C00FFF7B7FF23 +:1048E0002046FEF71CFF304670BD704770B50E467F +:1048F00004467C220021F9F7C2FD0225012E03D0D7 +:10490000022E04D0052070BD0120607000E06570AB +:104910002046FEF704FFA575002070BD28B1027C7B +:104920001AB10A4600F10C01C4E70120704710B526 +:10493000044686B0042002F00FF92078FE2806D045 +:1049400000208DF8000069462046FFF7E7FF06B01B +:1049500010BD7CB50E4600218DF804104178012968 +:1049600003D0022903D0002405E0046900E0446973 +:104970000CB1217C89B16D4601462846FFF753FFF3 +:10498000032809D1324629462046FFF793FF9DF8B8 +:104990000410002900D004207CBD04F10C05EBE7D5 +:1049A00030B40C460146034A204630BC024B0C3A58 +:1049B000FEF751BEAC6302006863020070B50D469D +:1049C000040012D08DB1220100212846F9F757FDCD +:1049D000102255492846F9F728FD53480121083887 +:1049E000018044804560002070BD012070BD70B51D +:1049F0004D4E00240546083E10E07068AA7B00EB8F +:104A00000410817B914208D1C17BEA7B914204D1A1 +:104A10000C222946F9F7DCFC30B1641C3088844252 +:104A2000EBDB4FF0FF3070BD204670BD70B50D461A +:104A3000060006D02DB1FFF7DAFF002803DB401C8B +:104A400014E0102070BD384C083C20886288411C5E +:104A5000914201D9042070BD6168102201EB001061 +:104A60003146F9F7E2FC2088401C208028700020A5 +:104A700070BD2D480838008870472B4908390888D0 +:104A8000012802D0401E08800020704770B51446EF +:104A90000D0018D0BCB10021A170022802D010284E +:104AA00011D105E0288870B10121A170108008E0C3 +:104AB0002846FFF79CFF002805DB401CA070A88952 +:104AC0002080002070BD012070BD70B505461446E1 +:104AD0000E000BD000203070A878012808D005D92E +:104AE0001149A1F108010A8890420AD9012070BD3C +:104AF00024B1287820702888000A5070022008709D +:104B00000FE064B14968102201EB00112046103912 +:104B1000F9F78BFC287820732888000A607310202E +:104B20003070002070BD0000900000202DE9F041A1 +:104B300090460C4607460025FE48072F00EB8816D6 +:104B400007D2DFE807F00707070704040400012580 +:104B500000E0FFDF06F81470002D13D0F548803018 +:104B600000EB880191F82700202803D006EB4000D5 +:104B7000447001E081F8264006EB4402202050708A +:104B800081F82740BDE8F081F0B51F4614460E4677 +:104B90000546202A00D1FFDFE649E648803100EBD8 +:104BA000871C0CEB440001EB8702202E07D00CEB96 +:104BB000460140784B784870184620210AE092F868 +:104BC0002530407882F82500F6E701460CEB4100DD +:104BD00005704078A142F8D192F82740202C03D0EC +:104BE0000CEB4404637001E082F826300CEB4104C6 +:104BF0002023637082F82710F0BD30B50D46CE4BF0 +:104C000044190022181A72EB020100D2FFDFCB48D0 +:104C1000854200DDFFDFC9484042854200DAFFDF00 +:104C2000C548401C844207DA002C01DB204630BD19 +:104C3000C148401C201830BDBF48C043FAE710B53A +:104C400004460168407ABE4A52F82020114450B10F +:104C50000220084420F07F40EDF7EDFF94F90810A2 +:104C6000BDE81040C9E70420F3E72DE9F047B14E55 +:104C7000803696F82D50DFF8BC9206EB850090F850 +:104C8000264034E009EB85174FF0070817F81400A9 +:104C9000012806D004282ED005282ED0062800D0C2 +:104CA000FFDF01F01BF9014607EB4400427806EBF9 +:104CB000850080F8262090F82720A24202D12022E9 +:104CC00080F82720084601F014F92A4621460120E1 +:104CD000FFF72CFF9B48414600EB0410026820467A +:104CE000904796F82D5006EB850090F82640202C32 +:104CF000C8D1BDE8F087022000E003208046D0E75D +:104D000010B58C4C2021803484F8251084F82610AE +:104D100084F82710002084F8280084F82D0084F8F7 +:104D20002E10411EA16044F8100B20746074207393 +:104D30006073A0738449E077207508704870002183 +:104D40007C4A103C02F81100491CC9B22029F9D351 +:104D50000120EDF760FE0020EDF75DFE012084F8F4 +:104D60002200EEF789F87948EEF79BF8764CA41EFE +:104D700020707748EEF795F86070BDE81040EDF7C9 +:104D8000D7BD10B5EDF7F9FD6F4CA41E2078EEF7F6 +:104D9000A1F86078EEF79EF8BDE8104001F0D6B8B3 +:104DA000202070470020EDF70FBE70B505460124A6 +:104DB0000E46AC405AB1FFF7F5FF0146654800EBDF +:104DC000C500C0F81015C0F81465634801E06248DA +:104DD000001D046070BD2DE9F34F564C0025803452 +:104DE00004EB810A89B09AF82500202821D0691E99 +:104DF00002915449009501EB0017391D03AB07C917 +:104E000083E80700A18BADF81C10A07F8DF81E0071 +:104E10009DF81500A046C8B10226494951F8204026 +:104E20000399A219114421F07F41019184B102211B +:104E30000FE00120EDF7EFFD0020EDF7ECFDEDF7C1 +:104E4000BAFD01F083F884F82F50A9E00426E4E7C6 +:104E500000218DF81810022801D0012820D10398D4 +:104E600001190998081A801C9DF81C1020F07F4039 +:104E700001B10221353181420BD203208DF815009A +:104E80000398C4F13201401A20F07F40322403908D +:104E90000CE098F8240018B901F039FA002863D022 +:104EA000322C03D214B101F045F801E001F04EF8C4 +:104EB000254A107818B393465278039B121B0021A1 +:104EC0009DF81840994601281AD0032818D00020D0 +:104ED0008DF81E00002A04DD981A039001208DF839 +:104EE00018009DF81C0000B1022103981B4A20F015 +:104EF0007F40039003AB099801F034F810B110E043 +:104F00000120E5E79DF81D0018B99BF80000032873 +:104F100029D08DF81C50CDF80C908DF818408DF8E4 +:104F20001E509DF8180010B3039801238119002228 +:104F3000184615E0840A0020FF7F841E0020A10788 +:104F4000BC63020084080020A2000020B3680100B6 +:104F50006B4C010000F0014004F50140FFFF3F00F1 +:104F6000EDF7ACFD06E000200BB0BDE8F08F0120AE +:104F7000EDF751FD97F90C20012300200199EDF781 +:104F80009DFDF87BC00701D0EDF781FE012188F877 +:104F90002F108AF8285020226946FE48F9F745FA72 +:104FA0000120E1E72DE9F05FDFF8E883064608EB32 +:104FB000860090F82550202D1FD0A8F180002C46A7 +:104FC00000EB8617A0F50079DFF8CCB305E0A24628 +:104FD00007EB4A004478202C0AD0EDF7BAFD09EB24 +:104FE00004135A4601211B1D00F0BCFF0028EED01F +:104FF000AC4202D0334652461EE0E84808B1AFF357 +:105000000080EDF7A6FD98F82F206AB1D8F80C20A3 +:10501000411C891A0902CA1701EB12610912002901 +:1050200002DD0020BDE8F09F3146FFF7D4FE08B155 +:105030000120F7E733462A4620210420FFF7A4FD8C +:10504000EFE72DE9F041D34C2569EDF782FD401BD8 +:105050000002C11700EB1160001200D4FFDF94F8CA +:10506000220000B1FFDF012784F8227094F82E009F +:10507000202800D1FFDF94F82E60202084F82E0035 +:10508000002584F82F5084F8205084F82150C4481B +:1050900025600078022833D0032831D00020207703 +:1050A000A068401C05D04FF0FF30A0600120EDF754 +:1050B000B2FC0020EDF7AFFCEDF7ABFDEDF7A3FD83 +:1050C000EDF779FC0FF0D2FDB648056005604FF0B2 +:1050D000E0214FF40040B846C1F88002EDF745FEEC +:1050E00094F82D703846FFF75DFF0028FAD0A948E4 +:1050F000803800EB871010F81600022802D006E076 +:105100000120CCE73A4631460620FFF70FFD84F830 +:10511000238004EB870090F82600202804D0A048C4 +:10512000801E4078EDF7DCFE207F002803D0EDF7ED +:1051300060FD2577657725E5964910B591F82D2016 +:105140000024803901EB821111F814302BB1641C5A +:10515000E4B2202CF8D3202010BD934901EB0411B8 +:1051600008600020C87321460120FFF7DFFC2046BD +:1051700010BD10B5012801D0032800D171B3854AB4 +:1051800092F82D30834C0022803C04EB831300BF47 +:1051900013F812400CB1082010BD521CD2B2202AC4 +:1051A000F6D37F4A48B1022807D0072916D2DFE894 +:1051B00001F01506080A0C0E100000210AE01B2160 +:1051C00008E03A2106E0582104E0772102E0962128 +:1051D00000E0B52151701070002010BD072010BDF7 +:1051E0006F4810B54078EDF726FD80B210BD10B5C0 +:1051F000202811D2674991F82D30A1F1800202EBED +:10520000831414F810303BB191F82D3002EB831267 +:1052100012F81020012A01D0002010BD91F82D2095 +:1052200001460020FFF782FC012010BD10B5EDF70C +:1052300090FCBDE81040EDF7FEBC2DE9F0410E46B4 +:10524000544F01782025803F0C4607EB831303E081 +:10525000254603EB45046478944202D0202CF7D114 +:1052600008E0202C06D0A14206D103EB4101497889 +:10527000017007E0002085E403EB440003EB4501E7 +:1052800040784870494F7EB127B1002140F22D404F +:10529000AFF300803078A04206D127B100214FF44F +:1052A0008660AFF30080357027B1002140F23540B1 +:1052B000AFF30080012065E410B542680B689A1ACC +:1052C0001202D41702EB1462121216D4497A91B169 +:1052D000427A82B9364A006852F82110126819449D +:1052E0001044001D891C081A0002C11700EB116050 +:1052F0000012322801DB012010BD002010BD2DE975 +:10530000F047294E814606F500709846144600EB9A +:10531000811712E006EB0415291D4846FFF7CCFF64 +:1053200068B988F80040A97B99F80A00814201D841 +:105330000020DEE407EB44004478202CEAD1012071 +:10534000D7E42DE9F047824612480E4600EB86006E +:10535000DFF8548090F825402020107008F5007088 +:105360009946154600EB86170BE000BF08EB0410CA +:105370005146001DFFF7A0FF28B107EB44002C7039 +:105380004478202CF2D1297889F800104B46224627 +:1053900031460FE0040B0020FFFF3F00000000003B +:1053A000A200002000F5004084080020000000005A +:1053B000BC6302005046BDE8F047A0E72DE9FC4180 +:1053C0000E4607460024FE4D09E000BF9DF8000090 +:1053D00005EB00108168384600F0D8FD01246B46CB +:1053E00001AA31463846FFF7ACFF0028EED0204630 +:1053F000BDE8FC8170B50446F2480125A54300EBE9 +:10540000841100EB85104022F9F70FF8EE4E26B11B +:1054100000214FF49360AFF30080EA48803000EB46 +:10542000850100EB8400D0F82500C1F8250026B1E5 +:10543000002140F29C40AFF30080284670BD8A42B4 +:1054400003D003460520FFF79FBB202906D0DD4A85 +:1054500002EB801000EB410040787047D949803161 +:1054600001EB800090F825007047D54901EB001052 +:10547000001DFFF7E4BB7CB51D46134604460E46EF +:1054800000F1080221461846EDF7E2FB94F9080006 +:105490000F2804DD1F3820722068401C206096B160 +:1054A0000220CA4951F82610461820686946801B18 +:1054B00020F07F40206094F908002844C01C1F2879 +:1054C00003DA012009E00420EBE701AAEDF7C0FBB5 +:1054D0009DF8040010B10098401C009000992068CD +:1054E00031440844C01C20F07F4060607CBDFEB5A4 +:1054F0000C46064609786079907220791F46154659 +:10550000507279B1217900222846A368FFF7B3FFD2 +:10551000AC492846803191F82E20202A0AD009690A +:10552000491D0DE0D4E90223217903B02846BDE8E6 +:10553000F040A0E7A6494978052900D20521314469 +:1055400021F07F4100F022FD39462846FFF736FF63 +:10555000D4E9023221796846FFF78DFF2B460021FE +:105560003046019A00F0FEFC002806D103B0314617 +:105570002846BDE8F04000F009BDFEBD2DE9FE4F14 +:10558000814600F0BFFC38B15FF0000799F80000D9 +:1055900020B10020BDE8FE8F0127F7E7894D8A4C36 +:1055A0004FF0000A803524B1002140F2FF40AFF3F4 +:1055B000008095F82D8085F823A0002624B10021D5 +:1055C00040F20450AFF300801FB94046FFF712FFCE +:1055D000804624B1002140F20C50AFF30080EDF77B +:1055E000B8FA43466A464946FFF781FF24B10021D5 +:1055F00040F21250AFF3008095F82E0020280CD016 +:1056000029690098401A0002C21700EB12600012CC +:1056100003D5684600F0BAFC012624B1002140F20F +:105620001C50AFF3008095F823000028BBD124B1B3 +:10563000002140F22250AFF30080EDF78AFA6B466A +:10564000644A002100F08EFC0028A3D027B941460F +:105650006846FFF7B3FE064326B16846FFF7EFFA48 +:10566000C9F8080024B1002140F23550AFF30080A2 +:1056700001208FE72DE9F04F89B08B46824600F07C +:1056800041FC504C803428B39BF80000002710B137 +:10569000012800D0FFDF4C4D25B1002140F2F7502A +:1056A000AFF300804649012001EB0A18A946079094 +:1056B0005FEA090604D0002140F2FF50AFF30080FA +:1056C000079800F016FC94F82D50002084F8230071 +:1056D00067B119E094F82E000127202800D1FFDFE0 +:1056E0009BF800000028D6D0FFDFD4E72846FFF75C +:1056F00081FE054626B1002140F20960AFF300802B +:1057000094F823000028D3D126B1002140F2136081 +:10571000AFF30080EDF71DFA2B4602AA5946079019 +:10572000FFF7E5FE98F80F005FEA060900F00100B8 +:105730008DF8130004D0002140F21D60AFF300800B +:105740003B462A4602A9CDF800A0079800F029FCA4 +:10575000064604EB850090F828000090B9F1000F90 +:1057600004D0002140F22460AFF3008000F0B6FBCB +:105770000790B9F1000F04D0002140F22A60AFF386 +:10578000008094F82300002892D1B9F1000F04D0D2 +:10579000002140F23260AFF300800DF1080C9CE86C +:1057A0000E00C8E90112C8F80C30B6B35FEA09066A +:1057B00004D0002140F23F60AFF3008000980BE07E +:1057C00084080020840A002000000000BC6302005E +:1057D000A2000020FFFF3F00B84312D094F82E0033 +:1057E00020280ED126B1002140F24460AFF30080A2 +:1057F0002846FFF7D7FB20B99BF80000D8B3012853 +:1058000049D0B9F1000F04D0002140F26160AFF33C +:105810000080284600F05BFB01265FEA090504D002 +:10582000002140F26A60AFF30080079800F061FB4E +:1058300025B1002140F26E60AFF300808EB194F884 +:105840002D0004EB800090F82600202809D025B117 +:10585000002140F27560AFF30080F8484078EDF722 +:105860003FFB25B1002140F27A60AFF3008009B020 +:105870003046BDE8F08FFFE7B9F1000F04D00021FA +:1058800040F24C60AFF3008094F82D205146042084 +:10589000FFF74CF9C0E7002E3FF40AAF002140F2B9 +:1058A0005760AFF3008003E72DE9F84FE44D8146E0 +:1058B00095F82D004FF00008E24C4FF0010B4746E1 +:1058C00024B100214FF4D160AFF30080584600F0BE +:1058D00010FB85F8237024B1002140F28D60AFF3F6 +:1058E000008095F82D00FFF785FD064695F823000A +:1058F00028B1002CE4D0002140F293604BE024B1A9 +:10590000002140F29760AFF30080CD48803800EB73 +:10591000861111F81900032856D1334605EB830A86 +:105920004A469AF82500904201D1012000E000206B +:1059300000900AF125000021FFF77FFC0146009846 +:10594000014203D001228AF82820AF77E1B324B1C5 +:10595000002140F29C60AFF30080324649460120AE +:10596000FFF7E4F89AF828A024B1002140F2A760DC +:10597000AFF3008000F0B2FA834624B1002140F278 +:10598000AC60AFF3008095F8230038B1002C97D0BD +:1059900000214FF4D660AFF3008091E7BAF1000F19 +:1059A00007D095F82E00202803D13046FFF7FAFAE9 +:1059B000E0B124B1002140F2C460AFF30080304672 +:1059C00000F085FA4FF0010824B1002140F2CD60CB +:1059D000AFF30080584600F08CFA24B1002140F269 +:1059E000D160AFF300804046BDE8F88F002CF1D0C5 +:1059F000002140F2BF60AFF30080E6E70120ECF742 +:105A0000E3BF8E48007870472DE9F0418C4C94F844 +:105A10002E0020281FD194F82D6004EB860797F8FC +:105A20002550202D00D1FFDF8549803901EB8610FC +:105A300000EB4500407807F8250F0120F87084F846 +:105A40002300294684F82E50324602202234FFF7E4 +:105A50006DF8002020700EE42DE9F0417A4E784C6C +:105A6000012538B1012821D0022879D003287DD022 +:105A7000FFDF20E400F05EFAFFF7C6FF207E00B1F2 +:105A8000FFDF84F821500020ECF7C5FFA168481C17 +:105A900004D0012300221846EDF710F814F82E0F59 +:105AA000217806EB01110A68012154E0FFF7ACFFF1 +:105AB0000120ECF7B0FF94F8210050B1A068401C21 +:105AC00007D014F82E0F217806EB01110A68062181 +:105AD00041E0207EDFF86481002708F102080128F8 +:105AE00003D002281ED0FFDFB5E7A777EDF781F8D6 +:105AF00098F80000032801D165772577607D534928 +:105B000051F8200094F8201051B948B16168012380 +:105B1000091A00221846ECF7D1FF022020769AE7F6 +:105B2000277698E784F8205000F004FAA07F50B15F +:105B300098F8010061680123091A00221846ECF761 +:105B4000BDFF257600E0277614F82E0F217806EBAE +:105B500001110A680021BDE8F041104700E005E0AE +:105B600036480078BDE8F041EDF7BAB9FFF74CFFD1 +:105B700014F82E0F217806EB01110A680521EAE7D7 +:105B800010B52F4C94F82E00202800D1FFDF14F818 +:105B90002E0F21782C4A02EB01110A68BDE8104053 +:105BA000042110477CB5264C054694F82E00202889 +:105BB00000D1FFDFA068401C00D0FFDF94F82E006A +:105BC000214901AA01EB0010694690F90C00284414 +:105BD000EDF73EF89DF904000F2801DD012000E0FB +:105BE0000020009908446168084420F07F41A160CA +:105BF00094F82100002807D002B00123BDE87040CE +:105C000000221846ECF75ABF7CBD30B5104A0B1A7B +:105C1000541CB3EB940F1FD3451AB5EB940F1BD351 +:105C2000934203D9101A43185B1C15E0954211D911 +:105C3000511A0844401C43420EE00000A00000201E +:105C4000040B00200000000084080020BC63020058 +:105C5000FF7F841EFFDF0023184630BD0123002292 +:105C600001460220ECF72ABF0220ECF7D4BEECF785 +:105C700070BF2DE9FE4FED4C05468A4694F82E0084 +:105C8000202800D1FFDFE94E94F82E10A0462046D0 +:105C9000A6F5207202EB011420218DF8001090F877 +:105CA0002D10376900EB8101D8F8000091F825909C +:105CB000284402AA01A90C36ECF7CAFF9DF9080096 +:105CC000002802DD0198401C0190A0680199642D14 +:105CD000084451D3D64B00225B1B72EB02014BD31D +:105CE0006168411A21F07F41B1F5800F44D220F064 +:105CF0007F40706086F80AA098F82D1044466B46E5 +:105D00004A463046FFF7FBFAA8B3A068401C10D003 +:105D1000ECF71FFFA168081A0002C11700EB116021 +:105D2000001202282ADD0120ECF775FE4FF0FF304B +:105D3000A06094F82D009DF8002020210F34FFF77B +:105D40007EFBA17FB94A803A02EB8111E27F01EB31 +:105D50004201487054F80F0C284444F80F0C0120FD +:105D600020759DF80000202803D0B2484078EDF758 +:105D7000B7F801200EE401E000200BE47760FBE7B8 +:105D80002DE9F047A94C074694F82D00A4F18006B0 +:105D900006EB801010F8170000B9FFDF94F82D50C3 +:105DA000A046A54C24B1002140F6E800AFF30080E6 +:105DB00040F6F40940F6FD0A06EB851616F81700C2 +:105DC000012819D0042811D005280FD006280DD09D +:105DD0001CB100214846AFF30080EDF705F9002C17 +:105DE000ECD000215046AFF30080E7E72A46394661 +:105DF0000120FEF79BFEF2E74FF0010A4FF0000989 +:105E0000454624B1002140F60410AFF3008050460F +:105E100000F06FF885F8239024B1002140F60910B6 +:105E2000AFF3008095F82D00FFF7E4FA064695F8E9 +:105E3000230028B1002CE4D0002140F60F101FE011 +:105E400024B1002140F61310AFF3008005EB86006B +:105E500000F1270133463A462630FFF7EEF924B128 +:105E6000002140F61710AFF3008000F037F88246AB +:105E700095F8230038B1002CC3D0002140F61D1046 +:105E8000AFF30080BDE785F82D60012085F8230081 +:105E9000504600F02EF8002C04D0002140F62A10C5 +:105EA000AFF30080BDE8F08730B504465F480D468B +:105EB00090F82D005D49803901EB801010F8140036 +:105EC00000B9FFDF5D4800EB0410C57330BD5749D2 +:105ED00081F82D00012081F82300704710B5584843 +:105EE00008B1AFF30080EFF3108000F0010072B64C +:105EF00010BD10B5002804D1524808B1AFF300809E +:105F000062B610BD50480068C005C00D10D01038F2 +:105F100040B2002804DB00F1E02090F8000405E026 +:105F200000F00F0000F1E02090F8140D40097047D8 +:105F30000820704710B53D4C94F82400002804D187 +:105F4000F5F7B2FE012084F8240010BD10B5374CDF +:105F500094F82400002804D0F5F7CFFE002084F840 +:105F6000240010BD10B51C685B68241A181A24F0B0 +:105F70007F4420F07F40A14206D8B4F5800F03D2C1 +:105F8000904201D8012010BD002010BDD0E90032A0 +:105F9000D21A21F07F43114421F07F41C0E9003142 +:105FA00070472DE9FC418446204815468038089CFE +:105FB00000EB85160F4616F81400012804D00228BD +:105FC00002D00020BDE8FC810B46204A012160463A +:105FD000FFF7C8FFF0B101AB6A4629463846FFF724 +:105FE000B0F9B8B19DF804209DF800102846FFF7DD +:105FF00026FA06EB440148709DF8000020280DD0D9 +:1060000006EB400044702A4621460320FEF78EFD31 +:106010000120D7E72A4621460420F7E7034801215B +:1060200000EB850000F8254FC170ECE7040B002061 +:10603000FF1FA107A000002000000000840800202E +:10604000000000000000000004ED00E0FFFF3F0042 +:106050002DE9F041044680074FF000054FF001069E +:106060000CD56B480560066000F0DEF920B1694888 +:10607000016841F48061016024F00204E0044FF003 +:10608000FF3705D564484660C0F8087324F480548F +:10609000600003D56148056024F08044E0050FD519 +:1060A0005F48C0F80052C0F808735E490D60091DD2 +:1060B0000D605C4A04210C321160066124F4807486 +:1060C000A00409D558484660C0F80052C0F80873CB +:1060D0005648056024F40054C4F38030C4F3C03142 +:1060E000884200D0FFDF14F4404F14D0504846607F +:1060F000C0F808734F488660C0F80052C0F80873B3 +:106100004D490D600A1D16608660C0F808730D6069 +:10611000166024F4404420050AD54848466086604D +:10612000C0F80873C0F848734548056024F400645B +:106130000EF076FD4348044200D0FFDFBDE8F08159 +:10614000F0B50022202501234FEA020420FA02F1D3 +:10615000C9072DD051B2002910DB00BF4FEA5117FB +:106160004FEA870701F01F0607F1E02703FA06F65A +:10617000C7F88061BFF34F8FBFF36F8F0CDB00BF99 +:106180004FEA51174FEA870701F01F0607F1E02792 +:1061900003FA06F6C7F8806204DB01F1E02181F81A +:1061A000004405E001F00F0101F1E02181F8144DF8 +:1061B00002F10102AA42C9D3F0BD10B5224C206001 +:1061C0000846F5F78AFE2068FFF742FF2068FFF7D0 +:1061D000B7FF0EF04BF900F088F90EF021FD0EF03C +:1061E0005EFCECF749FEBDE810400EF0F3B910B5C7 +:1061F000154C2068FFF72CFF2068FFF7A1FF0EF079 +:106200000FFDF5F769FF0020206010BD0A207047E0 +:10621000FC1F00403C17004000C0004004E5014066 +:10622000008000400485004000D0004004D50040BC +:1062300000E0004000F0004000F5004000B00040E9 +:1062400008B50040FEFF0FFDA400002070B52649F0 +:106250000A680AB30022154601244B685B1C4B6098 +:106260000C2B00D34D600E7904FA06F30E681E4223 +:106270000FD0EFF3108212F0010272B600D00122AB +:106280000C689C430C6002B962B64968016000204A +:1062900070BD521C0C2AE0D3052070BD4FF0E021E8 +:1062A0004FF48000C1F800027047EFF3108111F045 +:1062B000010F72B64FF0010202FA00F20A480368B9 +:1062C00042EA0302026000D162B6E7E70648002115 +:1062D0000160416070470121814003480068084027 +:1062E00000D0012070470000A80000200120810795 +:1062F000086070470121880741600021C0F8001143 +:1063000018480170704717490120087070474FF016 +:106310008040D0F80001012803D0124800780028FE +:1063200000D00120704710480068C00700D001204D +:1063300070470D480C300068C00700D0012070473E +:106340000948143000687047074910310A68D203C1 +:1063500006D5096801F00301814201D1012070478F +:1063600000207047B0000020080400404FF080502B +:10637000D0F830010A2801D0002070470120704772 +:1063800000B5FFF7F3FF20B14FF08050D0F8340193 +:1063900008B1002000BD012000BD4FF08050D0F8B2 +:1063A0003001062803D0401C01D000207047012096 +:1063B00070474FF08050D0F830010D2801D00020F8 +:1063C0007047012070474FF08050D0F83001082806 +:1063D00001D000207047012070474FF08050D0F866 +:1063E0003001102801D0002070470120704700B50F +:1063F000FFF7F3FF30B9FFF7DCFF18B9FFF7E3FF52 +:10640000002800D0012000BD00B5FFF7C6FF38B15D +:106410004FF08050D0F83401062803D3401C01D03F +:10642000002000BD012000BD00B5FFF7B6FF48B158 +:106430004FF08050D0F83401062803D3401C01D01F +:10644000012000BD002000BD0021017008467047FA +:106450000146002008707047EFF3108101F0010140 +:1064600072B60278012A01D0012200E00022012345 +:10647000037001B962B60AB1002070474FF40050B2 +:106480007047E9E7EFF3108111F0010F72B64FF09A +:106490000002027000D162B600207047F2E70000EF +:1064A0002DE9F04115460E460446002700F0EBF8B2 +:1064B000A84215D3002341200FE000BF94F84220EA +:1064C000A25CF25494F84210491CB1FBF0F200FBBC +:1064D00012115B1C84F84210DBB2AB42EED30127F1 +:1064E00000F0DDF83846BDE8F081724910B5802033 +:1064F00081F800047049002081F8420081F84100D1 +:10650000433181F8420081F84100433181F8420073 +:1065100081F841006948FFF797FF6848401CFFF782 +:1065200093FFECF731FCBDE8104000F0B8B8402014 +:106530007047614800F0A7B80A4601465E48AFE7D9 +:10654000402070475C48433000F09DB80A46014641 +:1065500059484330A4E7402101700020704710B52E +:1065600004465548863000F08EF82070002010BD9B +:106570000A460146504810B58630FFF791FF08B132 +:10658000002010BD42F2070010BD70B50C46064653 +:10659000412900D9FFDF4A480068103840B200F0B6 +:1065A00054F8C5B20D2000F050F8C0B2854201D3B6 +:1065B000012504E0002502E00DB1ECF728FC22469D +:1065C00031463D48FFF76CFF0028F5D070BD2DE93E +:1065D000F0413A4F0025064617F1040757F82540C9 +:1065E000204600F041F810B36D1CEDB2032DF5D339 +:1065F0003148433000F038F8002825D02E4800F00C +:1066000033F8002820D02C48863000F02DF80028E0 +:106610001AD0ECF7D2FB2948FFF71EFFB0F5005F58 +:1066200000D0FFDFBDE8F0412448FFF72BBF94F80E +:1066300041004121265414F8410F401CB0FBF1F2F7 +:1066400001FB12002070D3E74DE7002804DB00F1C6 +:10665000E02090F8000405E000F00F0000F1E020D9 +:1066600090F8140D4009704710F8411F4122491C51 +:10667000B1FBF2F302FB13114078814201D10120FA +:1066800070470020704710F8411F4078814201D3C5 +:10669000081A02E0C0F141000844C0B2704710B5CA +:1066A0000648FFF7D9FE002803D1BDE81040ECF7FB +:1066B0006FBB10BD0DE000E0340B0020B4000020E3 +:1066C00004ED00E070B5154D2878401CC4B2687820 +:1066D000844202D000F0DBFA2C7070BD2DE9F0414D +:1066E0000E4C4FF0E02600BF00F0C6FAECF77CFC41 +:1066F00040BF20BF677820786070D6F80052EAF774 +:1067000049FE854305D1D6F8040210B92078B84275 +:10671000EAD000F0ACFA0020BDE8F081C40000200F +:106720002DE9F04101264FF0E02231034FF000083F +:106730004046C2F88011BFF34F8FBFF36F8F204CDC +:10674000C4F800010C2000F02EF81E4D2868C0434C +:1067500040F30017286840F010002860C4F8046374 +:1067600026607F1C02E000BFECF73EFCD4F800017D +:106770000028F9D01FB9286820F0100028601248BE +:1067800005686660C4F80863C4F800810C2000F056 +:106790000AF82846BDE8F08110B50446FFF7C0FFAF +:1067A0002060002010BD002809DB00F01F0201213D +:1067B00091404009800000F1E020C0F8801270474D +:1067C00000C0004010ED00E008C500402DE9F04792 +:1067D000FF4C0646FF21A06800EB061211702178DD +:1067E000FF2910D04FF0080909EB011109EB06173A +:1067F0004158C05900F0F4F9002807DDA16820785D +:1068000001EB061108702670BDE8F08794F800804F +:1068100045460DE0A06809EB05114158C05900F04C +:10682000DFF9002806DCA068A84600EB0810057810 +:10683000FF2DEFD1A06800EB061100EB08100D70E2 +:106840000670E1E7F0B5E24B0446002001259A68A6 +:106850000C269B780CE000BF05EB0017D75DA74224 +:1068600004D106EB0017D7598F4204D0401CC0B2A8 +:106870008342F1D8FF20F0BD70B5FFF7F8F9D44C92 +:1068800008252278A16805EB0212895800F0A8F9C2 +:10689000012808DD2178A06805EB01114058BDE80A +:1068A0007040FFF7DBB9FFF7ACF8BDE87040ECF7DC +:1068B00017BB2DE9F041C64C2578FFF7D8F9FF2D1D +:1068C0006ED04FF00808A26808EB0516915900F049 +:1068D00087F90228A06801DD80595DE000EB051111 +:1068E00009782170022101EB0511425C5AB1521E58 +:1068F0004254815901F5800121F07F4181512846A0 +:10690000FFF764FF34E00423012203EB051302EBDD +:10691000051250F803C0875CBCF1000F10D0BCF525 +:10692000007F10D9CCF3080250F806C00CEB423CB3 +:106930002CF07F4C40F806C0C3589A1A520A09E05E +:10694000FF2181540AE0825902EB4C3222F07F424F +:106950008251002242542846FFF738FF0C21A068DC +:1069600001EB05114158E06850F827203846904760 +:106970002078FF2814D0FFF77AF92278A16808EB75 +:1069800002124546895800F02BF9012893DD217841 +:10699000A06805EB01114058BDE8F041FFF75EB972 +:1069A000BDE8F081F0B51D4614460E460746FF2BA4 +:1069B00000D3FFDFA00700D0FFDF8548FF210022C2 +:1069C000C0E90247C57006710170427082701046BE +:1069D000012204E002EB0013401CE154C0B2A842C3 +:1069E000F8D3F0BD70B57A4C0646657820798542BB +:1069F00000D3FFDFE06840F825606078401C6070DD +:106A0000284670BD2DE9FF5F1D468B460746FF24D3 +:106A1000FFF72DF9DFF8B891064699F80100B84262 +:106A200000D8FFDF00214FF001084FF00C0A99F861 +:106A30000220D9F808000EE008EB0113C35CFF2B1D +:106A40000ED0BB4205D10AEB011350F803C0DC4560 +:106A50000CD0491CC9B28A42EED8FF2C02D00DE0FE +:106A60000C46F6E799F803108A4203D1FF2004B0E0 +:106A7000BDE8F09F1446521C89F8022008EB04116F +:106A80000AEB0412475440F802B00421029B002292 +:106A9000012B01EB04110CD040F801204FF40078D9 +:106AA00008234FF0020C454513D9E905C90D02D062 +:106AB00002E04550F2E7414606EB413203EB041396 +:106AC00022F07F42C250691A0CEB0412490A815429 +:106AD0000BE005B9012506EB453103EB041321F06A +:106AE0007F41C1500CEB0411425499F800502046EC +:106AF000FFF76CFE99F80000A84201D0FFF7BCFE3A +:106B00003846B4E770B50C460546FFF7B0F80646C0 +:106B100021462846FFF796FE0446FF281AD02C4D42 +:106B2000082101EB0411A8684158304600F058F8DC +:106B300000F58050C11700EBD14040130221AA6834 +:106B400001EB0411515C09B100EB4120002800DC8D +:106B5000012070BD002070BD2DE9F04788468146B8 +:106B6000FFF770FE0746FF281BD0194D2E78A86846 +:106B70003146344605E0BC4206D0264600EB0612FC +:106B80001478FF2CF7D10CE0FF2C0AD0A6420CD1D0 +:106B900000EB011000782870FF2804D0FFF76CFE8E +:106BA00003E0002030E6FFF75FF841464846FFF774 +:106BB000A9FF0123A968024603EB0413FF20C85470 +:106BC000A878401EB84200D1A87001EB041001E083 +:106BD000000C002001EB061100780870104613E647 +:106BE000081A0002C11700EB116000127047000084 +:106BF00010B5202000F07FF8202000F08DF84D49DE +:106C0000202081F80004EAF7C3FB4B4908604B4899 +:106C1000D0F8041341F00101C0F80413D0F80413B4 +:106C200041F08071C0F80413424901201C39C1F8B9 +:106C3000000110BD10B5202000F05DF83E48002195 +:106C4000C8380160001D01603D4A481E10603B4A83 +:106C5000C2F80803384B1960C2F80001C2F860019D +:106C600038490860BDE81040202000F055B834498C +:106C70003548091F0860704731493348086070473C +:106C80002D48C8380160001D521E026070472C4913 +:106C900001200860BFF34F8F70472DE9F04128496C +:106CA000D0F8188028480860244CD4F8000100254A +:106CB000244E6F1E28B14046EAF7C4FA40B90021BD +:106CC00011E0D4F8600198B14046EAF7BBFA48B148 +:106CD000C4F80051C4F860513760BDE8F04120208D +:106CE00000F01AB831684046BDE8F0410FF0DAB85C +:106CF000FFDFBDE8F08100280DDB00F01F0201215D +:106D000091404009800000F1E020C0F88011BFF3FD +:106D10004F8FBFF36F8F7047002809DB00F01F0211 +:106D2000012191404009800000F1E020C0F880126C +:106D30007047000020E000E0C8060240000002406A +:106D40001805024000040240010000015E480021D5 +:106D50000170417010218170704770B5054616466C +:106D60000C460220EBF7B2FD574901200870574945 +:106D7000F01E086056480560001F046070BD10B525 +:106D80000220EBF7A3FD5049012008705148002173 +:106D9000C0F80011C0F80411C0F808114E494FF4B2 +:106DA0000000086010BD48480178D9B14B4A4FF443 +:106DB000000111604749D1F800310022002B1CBFAF +:106DC000D1F80431002B02D0D1F8081119B142706A +:106DD0004FF0100104E04FF0010141704049096893 +:106DE000817002704FF00000EBF770BD10B502200B +:106DF000EBF76CFD34480122002102703548C0F8E1 +:106E00000011C0F80411C0F80811026010BD2E482E +:106E10000178002904BF407870472E48D0F800114F +:106E2000002904BF02207047D0F8001100291CBFC0 +:106E3000D0F80411002905D0D0F80801002804BFBB +:106E400001207047002070471F4800B50278214B91 +:106E50004078C821491EC9B282B1D3F800C1BCF143 +:106E6000000F10D0D3F8000100281CBFD3F8040194 +:106E700000280BD0D3F8080150B107E0022802D057 +:106E8000012805D002E00029E4D1FFDF002000BD89 +:106E9000012000BD0C480178002904BF80787047AC +:106EA0000C48D0F8001100291CBFD0F804110029AB +:106EB00002D0D0F8080110B14FF010007047084818 +:106EC0000068C0B270470000C600002010F5004006 +:106ED00008F5004000F0004004F5014008F50140CD +:106EE00000F400405748002101704170704770B5B0 +:106EF000064614460D460120EBF7E8FC52480660B2 +:106F0000001D0460001D056050490020C1F85001BB +:106F10004F490320086050494E480860091D4F48FA +:106F2000086070BD2DE9F041054646480C46012633 +:106F300006704B4945EA024040F080700860FFF758 +:106F40002CFA002804BF474804600027464CC4F8C8 +:106F50000471474945480860002D02BFC4F800622B +:106F60002660BDE8F081012D18BFFFDFC4F8007274 +:106F7000266041493F480860BDE8F081314801780A +:106F800071B13B4A394911603749D1F804210021D8 +:106F9000002A08BF417002D0384A1268427001705E +:106FA0000020EBF793BC27480178002904BF407804 +:106FB00070472D48D0F80401002808BF70472F48BB +:106FC0000068C0B27047002808BF70472DE9F0473D +:106FD0001C480078002808BFFFDF234CD4F80401C8 +:106FE000002818BFBDE8F0874FF00209C4F80493E9 +:106FF000234F3868C0F30018386840F0100038603C +:10700000D4F80401002804BF4FF400454FF0E026F7 +:1070100008D100BFC6F88052EBF7E6FFD4F80401B0 +:107020000028F7D0B8F1000F03D1386820F0100025 +:107030003860C4F80893BDE8F0870B4901208860E8 +:1070400070470000C900002008F500400010004013 +:107050001CF500405011004098F501400CF0004034 +:1070600004F5004018F5004000F000400000020365 +:1070700008F501400000020204F5014000F4004060 +:1070800010ED00E0012804BF41F6A470704702280B +:1070900004BF41F288307047042804BF46F218004C +:1070A0007047082804BF47F2A030704700B5FFDFE3 +:1070B00041F6A47000BD10B5FC48002401214470C5 +:1070C000047044728472C17280F82540C462846383 +:1070D00080F83C4080F83D40FF2180F83E105F2161 +:1070E00080F83F1018300EF0D9FFF149601E08609B +:1070F000091D0860091D0C60091D0860091D0C6050 +:10710000091D0860091D0860091D0860091D086047 +:10711000091D0860091D0860091D0860091D086037 +:10712000091D086010BDE348016801F00F01032943 +:1071300004BF01207047016801F00F01042904BF5A +:1071400002207047016801F00F01052904D0006892 +:1071500000F00F00062807D1D748006810F0060F8E +:107160000CBF08200420704700B5FFDF012000BDE0 +:10717000012812BF022800207047042812BF0828E7 +:107180004FF4C870704700B5FFDF002000BD012834 +:1071900004BF28207047022804BF18207047042825 +:1071A00012BF08284FF4A870704700B5FFDF2820F1 +:1071B00000BD70B5BF48016801F00F01032908BF89 +:1071C000012414D0016801F00F01042904BF022436 +:1071D00018210DD0016801F00F0105294BD000687E +:1071E00000F00F0006281CBFFFDF012443D0282138 +:1071F000AE48C26A806A101A0E18082C04BF4EF6F8 +:10720000981547F2A0302DD02046042C08BF4EF62A +:1072100028350BD0012808BF41F6A47506D0022CF2 +:107220001ABFFFDF41F6A47541F28835012C08BF73 +:1072300041F6A47016D0022C08BF002005D0042C03 +:107240001ABFFFDF00204FF4C8702D1A022C08BFB0 +:1072500041F2883006D0042C1ABFFFDF41F6A4703B +:1072600046F21800281A4FF47A7100F2E730B0FBAA +:10727000F1F0304470BD9048006810F0060F0CBF6C +:10728000082404244FF4A871B2E710B58B490268B2 +:1072900001F118040A6342684A63007A81F83800F1 +:1072A000207E48B1207FF7F72EF9A07E011C18BF81 +:1072B0000121207FF7F716F9607E002808BF10BD76 +:1072C000607FF7F720F9E07E011C18BF0121607F85 +:1072D000BDE81040F7F706B930B50024054601298E +:1072E0000AD0022908BF4FF0807405D0042916BFC8 +:1072F00008294FF0C744FFDF44F4847040F4801045 +:107300006F49086045F4403001F1040140F000701D +:10731000086030BD30B50024054601290AD0022995 +:1073200008BF4FF0807405D0042916BF08294FF01C +:10733000C744FFDF44F4847040F480106049086063 +:1073400045F4403001F1040140F0007008605D48F0 +:10735000D0F80001002818BFFFDF30BD2DE9F04153 +:1073600002274FF0E02801250024C8F88071BFF300 +:107370004F8FBFF36F8F544804600560FFF754F8D8 +:10738000524E18B1306840F480603060FFF705F865 +:1073900038B1306820F0770040F0880040F00040BD +:1073A00030604C494A4808604FF01020806CB0F1C2 +:1073B000FF3F04D048490A6860F317420A60474912 +:1073C00040F25B600860091F40F203100860081F6C +:1073D000056038490320086041480560424A414938 +:1073E0001160434A41491160121F4249116001680E +:1073F00021F440710160016841F480710160C8F8B6 +:10740000807230491020C1F80403284880F83140C8 +:10741000C462BDE8F081294A0368C2F81A30808846 +:10742000D08302F1180001727047204B10B51A7A10 +:107430008A4208D101460622981CF6F7C9FF0028A7 +:1074400004BF012010BD002010BD184890F8250091 +:107450007047164A517010707047F0B505468000AD +:1074600000F1804000F580508B88C0F820360B7802 +:10747000D1F8011043EA0121C0F8001605F1080017 +:10748000012707FA00F61C4C002A04BF2068B0430D +:1074900004D0012A18BFFFDF206830432060206835 +:1074A00007FA05F108432060F0BD0000280C002019 +:1074B000000E00401015004014140040100C002075 +:1074C0001415004000100040FC1F00403C17004015 +:1074D0002C000089781700408C15004038150040BA +:1074E0005016004000000E0408F5014040800040A6 +:1074F000A4F5014010110040401600400DF0E0BC22 +:10750000F94890F832007047F84AC1781160006875 +:10751000F749000208607047252808BF02210ED0F5 +:10752000262808BF1A210AD0272808BF502106D0D4 +:107530000A2894BF0422062202EB4001C9B2ED4A98 +:107540001160ED49086070472DE9F047E64CA17ADB +:10755000012956D0022918BFBDE8F087627E002AB3 +:1075600008BFBDE8F087012950D0E17E667F0D1C81 +:1075700018BF01255FF02401DFF880934FF0010868 +:10758000C9F84C80DFF878A34718DAF80000B84251 +:1075900028BFFFDF0020C9F84C01CAF80070300294 +:1075A00085F0010140EA015040F0031194F82000F9 +:1075B000820002F1804202F5C042C2F81015D149A2 +:1075C00001EB8001A07FC20002F1804202F5F83297 +:1075D000C2F81415CC4BC2F81035E27FD30003F18A +:1075E000804303F5F833C3F81415C849C3F81015E0 +:1075F00008FA00F008FA02F10843C5490860BDE83E +:10760000F087227E002AAED1BDE8F087A17E267FDA +:10761000002914BF012500251121ADE72DE9F04116 +:10762000BC4E804603200D46C6F80002B849BA4851 +:10763000086028460DF083FCAB4F0124B8F1000F21 +:1076400004BFBC72346026D0B8F1010F23D1B34817 +:10765000006860B915F00C0F09D0C6F8044301208A +:1076600000F0B0FEF463346487F83C4002E0002090 +:1076700000F0A8FE28460DF04AFD0220B872FEF781 +:10768000C3FE38B9FEF7D0FE20B9A548016841F421 +:10769000C021016074609948C46499480068294613 +:1076A000BDE8F04150E72DE9F0479A4E81460320AE +:1076B0000D46C6F80002DFF858829748C8F8000067 +:1076C00008460DF03CFC28460DF021FD0124864FB4 +:1076D000B9F1000F03D0B9F1010F0AD026E0BC7256 +:1076E000B86B40F48010B8634FF48010C8F8000005 +:1076F0001CE00220B872B86B40F40010B8634FF47D +:107700000010C8F800008548006860B915F00C0F3B +:1077100009D0C6F80443012000F054FEF463346439 +:1077200087F83C4002E0002000F04CFEEBF7ACFA9A +:107730002946BDE8F04707E72DE9F84F754C82462A +:10774000032088461746C4F80002DFF8C491724847 +:10775000C9F8000010460DF0F2FBDFF8C8B1624E28 +:107760000125BAF1000F04BFCBF80040B57204D078 +:10777000BAF1010F18BFFFDF2FD06B48C0F80080AF +:107780006B496A480860B06B40F40020B063D4F8DD +:1077900000321021C4F808130020C4F80002DFF8FA +:1077A00094C18A03CCF80020C4F80001C4F80C018D +:1077B000C4F81001C4F80401C4F81401C4F8180195 +:1077C0005D4800680090C4F80032C9F80020C4F891 +:1077D0000413BAF1010F09D01BE038460DF097FCF5 +:1077E0005648CBF800000220B072C6E74B4800684C +:1077F00060B917F00C0F09D0C4F80453012000F051 +:10780000E1FDE563256486F83C5002E0002000F0CD +:10781000D9FD4FF40020C9F800003848C564384845 +:107820000068404528BFFFDF39464046BDE8F84FB5 +:107830008AE62DE9F0412C4C0646002594F83100EB +:1078400017468846002808BFFFDF16B1012E16D064 +:1078500021E094F83100012808D094F8302039460E +:1078600040460DF081FBE16A451814E094F83010B1 +:107870003A4640460DF0B6FBE16A45180BE094F835 +:10788000310094F8301001283A46404609D00DF0F6 +:10789000D1FBE16A45183A4629463046BDE8F04139 +:1078A0004AE70DF081FBE16A4518F4E72DE9F84F4E +:1078B000184CD4F8000220F00309D4F804034FF068 +:1078C000100AC0F30018C4F808A30026C4F8006228 +:1078D00018481B490160044D0127A97A012931D0BC +:1078E000022932D044E00000280C0020241500407A +:1078F0001C15004008150040541500400080004051 +:107900004C850040006000404C8100401011004058 +:1079100004F50140001000400000040488170040F6 +:1079200068150040ACF501404885004048810040A2 +:10793000A8F5014008F5014018110040041000406E +:1079400000000E04297E11B912E0697E81B1A97F81 +:10795000EA7F07FA01F107FA02F21143016095F894 +:107960002000800000F1804000F5C040C0F81065A4 +:10797000FF208DF80000C4F81061276105E000BF0A +:107980009DF80000401E8DF800009DF8000018B121 +:10799000D4F810010028F3D09DF80000002808BF9B +:1079A000FFDFC4F81061002000F00CFD6E72AE72B3 +:1079B000EF72C4F80092B8F1000F18BFC4F804A326 +:1079C000BDE8F88FFF2008B58DF80000FE480021C3 +:1079D000C0F810110121016105E000BF9DF8001001 +:1079E000491E8DF800109DF8001019B1D0F8101143 +:1079F0000029F3D09DF80000002808BFFFDF08BD74 +:107A00000068F24920F07F40086070474FF0E020A6 +:107A10000221C0F8801100F5C070BFF34F8FBFF393 +:107A20006F8FC0F80011704710B490E81C10E8493F +:107A300081E81C10D0E90420C1E9042010BC704783 +:107A40004FF0E0210220C1F800017047E1490870C1 +:107A50007047E1490860704770B50546EBF714F9C7 +:107A6000DE4C2844E16A884298BFFFDF0120207481 +:107A7000EBF70AF9DA4A284400216061C2F84411A0 +:107A8000D8490860A06BD84940F48000A063D001B9 +:107A9000086070BD70B5D14C0546D44A02202074F0 +:107AA00010680E4600F00F00032808BF012213D013 +:107AB000106800F00F00042808BF02220CD01068E4 +:107AC00000F00F0005281BD0106800F00F000628FA +:107AD0001CBFFFDF012213D094F8310094F830105E +:107AE000012815D028460DF0ECFABD496061002050 +:107AF000C1F844016169E06A0844BA49086070BD90 +:107B0000BB48006810F0060F0CBF08220422E3E710 +:107B1000334628460DF0A3FAE7E7B6494FF4800054 +:107B20000860AE48816B21F48001816300210174FB +:107B30007047C20002F1804202F5F832AE4BC2F843 +:107B40001035C2F8141501218140A7480160A348EF +:107B5000826B114381637047A14801214160C1607C +:107B60000021C0F844119F4801609C48C1627047E1 +:107B7000A24908609448D0F8001241F04001C0F8D2 +:107B8000001270479048D0F8001221F04001C0F870 +:107B900000129A490020086070478B48D0F8001204 +:107BA00021F01001C0F800120121816170478B495A +:107BB000FF2081F83E0084480021C0F81C11D0F855 +:107BC000001241F01001C0F8001270477E4981B0E8 +:107BD000D1F81C21012A0DD0804991F83E10FF29CF +:107BE0000DBF00204942017001B008BF704701205D +:107BF00001B07047824A126802F07F02524202705E +:107C00000020C1F81C017F4800680090EFE7F0B544 +:107C100017460C00064608BFFFDF704D14F0010F39 +:107C20002F731CBF012CFFDF002E0CBF0120022090 +:107C30006872EC7201281CBF0228FFDFF0BD6749A3 +:107C400081F83F0070472DE9F84F6248007804281A +:107C500028BFFFDF614CDFF89C815B4D94F83C004E +:107C600000260127E0B1D5F8040110F1000918BF82 +:107C70004FF00109D5F81001002818BF012050EA83 +:107C800009014FF4002B17D08021C5F80813C8F85C +:107C900000B084F83C6090F0010F18BFBDE8F88F89 +:107CA000DFF83C91D9F84C0100287DD0A07A01285A +:107CB0007BD002287AD0D8E0D5F80001DFF840A1C7 +:107CC00030B3C5F800616F61FF20009002E0401EF4 +:107CD000009005D0D5F81C0100280098F7D000B915 +:107CE000FFDFDAF8000000F07F0A94F83F0050450B +:107CF0003CBF002000F066FB84F83EA0C5F81C6184 +:107D0000C5F808733F48006800902F64AF6302E035 +:107D1000B9F1000F03D0B9F1000F2BD087E0DAF8EA +:107D2000000000F07F0184F83E10C5F81C6194F853 +:107D30003D0048B194F83F00884218D2002000F07E +:107D400041FB2F64AF6312E02F48006894F83F3086 +:107D500082B2000C994203D30F2A06D9022804D21A +:107D6000012000F02FFB2F6401E02F64AF63254852 +:107D7000006800908022C5F80423194887642349CD +:107D80000B68A1F1040CDCF800C043F698273B44D3 +:107D9000634543D20A6842F210731A440A60C0F87D +:107DA00048611B481B4902E05FE047E049E008608A +:107DB000091F194808600C48C0F800B0A06B40F4D7 +:107DC0000020A063BDE8F88F001000403C15004083 +:107DD000100C0020CB00002004150040280C0020CF +:107DE000008000404485004004F50140101500402B +:107DF0001414004008F501400411004060150040D3 +:107E0000481500401C110040741500404885004092 +:107E100014100040ACF50140488100400E60C0F8ED +:107E20004861C5F80823C8F800B0C0F84861802050 +:107E3000C5F80803C8F800B0BDE8F88F207E10B977 +:107E400013E0607E88B1A07FE17F07FA00F007FAB7 +:107E500001F10843C8F8000094F82000800000F108 +:107E6000804000F5C040C0F81065F748A16B016084 +:107E7000A663217C002019B1D9F84411012900D052 +:107E80000021A27A012A6DD0022A73D0D5F81011F0 +:107E900001290CBF1021002141EA0008EB480168CC +:107EA00011F0FF0F03D0D5F81411012900D00021E3 +:107EB00084F83210006810F0FF0F03D0D5F81801D5 +:107EC000012800D0002084F83300E148006884F8DD +:107ED0003400FEF79CFF012818BF002084F835000D +:107EE000C5F80061C5F80C61C5F81061C5F80461FA +:107EF000C5F81461C5F81861D64800680090D648E6 +:107F0000C0F84461D5480068DFF854930090D9F870 +:107F10000000A062A9F104000068E062D148016895 +:107F200001F00F01032908BF012013D0016801F0FF +:107F30000F01042908BF02200CD0016801F00F01D5 +:107F4000052926D0006800F00F0006281CBFFFDFBF +:107F500001201ED084F83000A07A84F83100022875 +:107F60002CD11EE0D5F80C01012814BF00200820F8 +:107F70008CE7FFE7D5F80C01012814BF0020022090 +:107F8000B94A1268012A14BF042200221043084390 +:107F90007CE7B648006810F0060F0CBF08200420EC +:107FA000D8E7607850B1B24909680978084021786B +:107FB00031EA000008BF84F8247001D084F82460FE +:107FC000DFF8B0A218F0020F06D0EAF75DFEA16A52 +:107FD000081ADAF81010884718F0010F18BF4FF090 +:107FE000000B0DD0EAF750FEE16ADAF81420081A07 +:107FF00059469047A048007810F0010F2FD10CE0AF +:1080000018F0020F18BF4FF0010BEBD118F0080F5A +:1080100018BF4FF0020BE5D1ECE7DFF854B2DBF804 +:108020000000007800F00F00072828BF84F82560C2 +:1080300015D2DBF80000062200F10901A01CF6F7BA +:10804000C7F940B9207ADBF800100978B0EBD11FEE +:1080500008BF012001D04FF0000084F82500E17A2C +:108060004FF0000011F0020F1CBF18F0020F18F0C3 +:10807000040F19D111F0100F1CBF94F83320002AFF +:1080800002D094F835207AB111F0080F1CBF94F893 +:108090002420002A08D111F0040F02D094F82510F2 +:1080A00011B118F0010F01D04FF00100617A19B140 +:1080B00068B1FFF7FBFB10E0634870490160D5F839 +:1080C000000220F00300C5F80002E77205E0012974 +:1080D0000AD0022918BFFFDF0DD018F0010F14D00D +:1080E000DAF80000804745E06672E772A7729621D1 +:1080F000227B002006E06672E7720220A072227BDB +:1081000096210120FFF795FBE7E718F0020F2AD030 +:1081100018F0040F21D1FEF777F9F0B9FEF784F9D2 +:10812000D8B957480168001F0068C0F3006CC0F35D +:10813000425500F00F03C0F30312C0F30320BCF15B +:10814000000F0AD0002B1CBF002A002805D10029EF +:1081500018BF032D38BF48F0040827EA9800DAF862 +:108160000410884706E018F0080F18BFDAF8080076 +:1081700024D08047A07A022818BFBDE8F88F207C61 +:10818000002808BFBDE8F88F3349C1F844610228D0 +:108190001CD0012818BFFFDFE16A6069884298BFE0 +:1081A000FFDF6069C9F80000A06B4FF4800140F464 +:1081B0008000A06333480160BDE8F88F18F0100F0D +:1081C00014BFDAF80C00FFDFD3D1D3E76169E06AAE +:1081D0000844E7E738B52C4904460220887201219B +:1081E0002046FFF7B1F91E4A04F13D0010601A4B1A +:1081F0000020C3F844012549C1F80001C1F80C0171 +:10820000C1F81001C1F80401C1F81401C1F8180146 +:1082100010480068009001209864101D00681168E3 +:10822000884228BFFFDF38BD2DE9F843164A88464B +:108230000024917A0125044F012902D0022927D078 +:1082400039E0117E31BB36E008F5014040160040B0 +:10825000101400401811004000800040448100408C +:1082600044850040101500400014004014140040E4 +:1082700004150040100C0020CB0000200000040476 +:108280005414004004F50140280C00200010004068 +:10829000517E81B1917FD37F05FA01F105FA03F395 +:1082A0001943396092F82010890001F1804101F5ED +:1082B000C041C1F8104506460220907201213046A7 +:1082C000FFF742F9504906F13D0008604F4AC2F8F5 +:1082D00044414F48C0F80041C0F80C41C0F810417B +:1082E000C0F80441C0F81441C0F81841494800687A +:1082F00000909564081D00680968884228BFFFDF68 +:10830000B8F1000F1CBF4FF400303860BDE8F883AF +:10831000022810B50DD0012804BF42F6CE3010BDA2 +:10832000042817BF082843F6A440FFDF41F66A007F +:1083300010BDFEF725F830B9FEF72FF8002808BF6A +:1083400041F6583001D041F2643041F29A010844BC +:1083500010BD2F4910B50020C1F800022F492E484A +:10836000086030492E480860091D2F480860091D23 +:108370002E480860091D2E480860091D2D48086018 +:10838000091D2D48086001200CF0D9FD2B494FF440 +:108390003810086010BD21494FF43810086070474C +:1083A0002748016803291BBF00680228012000201C +:1083B0007047234801680B291BBF00680A28012069 +:1083C000002070471F490968C9B91F4A1F4913682F +:1083D00070B123F0820343F07D0343F00043136048 +:1083E0000A6822F0100242F0600242F0004205E00A +:1083F00023F0004313600A6822F000420A60144927 +:1084000081F83D0070470000448500400080004036 +:1084100000100040181100400000040408F501405D +:108420001011004098F501400410004044810040C4 +:10843000141000401C1100401010004004F50140D1 +:1084400050150040881700403C1700407C17004042 +:10845000280C002010B5404822220021F6F70FF822 +:108460003D480024017821F010010170012105F040 +:108470003DFF3A494FF6FF7081F822408884384921 +:108480000880488010BD704734498A8C824218BFEA +:108490007047002081F822004FF6FF7088847047F3 +:1084A0002D49016070472E49088070472B498A8CFE +:1084B000A2F57F43FF3B03D00021016008467047CF +:1084C00091F822202549012A1ABF016001200020CD +:1084D0007047224901F1220091F82220012A04BFAD +:1084E00000207047012202701D48008888841046D1 +:1084F00070471B49488070471849194B8A8C5B8824 +:108500009A4206D191F82220002A1EBF0160012064 +:108510007047002070471148114A818C528891425F +:1085200009D14FF6FF71818410F8221F19B1002183 +:10853000017001207047002070470848084A818C6C +:108540005288914205D190F8220000281CBF0020DB +:1085500070470120704700008E0C0020680C00203E +:10856000CC0000207047584A012340B1012818BFB1 +:1085700070471370086890608888908170475370C6 +:108580000868C2F802008888D08070474E4A10B14F +:10859000012807D00EE0507860B1D2F802000860E0 +:1085A000D08804E0107828B19068086090898880AD +:1085B0000120704700207047434910B1012803D0C3 +:1085C00006E0487810B903E0087808B10120704748 +:1085D0000020704730B58DB00C4605460D220021B5 +:1085E00004A8F5F74CFFE0788DF81F0020798DF88E +:1085F0001E0060798DF81D00286800906868019061 +:10860000A8680290E868039068460BF0CDFF2078D8 +:108610009DF82F1088420CD160789DF82E1088426A +:1086200007D1A0789DF82D10884202BF01200DB01F +:1086300030BD00200DB030BD30B50C4605468DB0C4 +:108640004FF0030104F1030012B1FDF77FFF01E0D9 +:10865000FDF79BFF60790D2220F0C00040F0400044 +:108660006071002104A8F5F70AFFE0788DF81F007B +:1086700020798DF81E0060798DF81D002868009023 +:1086800068680190A8680290E868039068460BF05B +:108690008BFF9DF82F0020709DF82E0060709DF8D4 +:1086A0002D00A0700DB030BD10B5002904464FF06C +:1086B000060102D0FDF74AFF01E0FDF766FF607991 +:1086C00020F0C000607110BDD0000020FE4840685E +:1086D00070472DE9F0410F46064601461446012039 +:1086E00006F0B7F8054696F86500FEF7CBFC4AF2AF +:1086F000B12108444FF47A71B0FBF1F0718840F277 +:1087000071225143C0EB4100001BA0F2663402F01D +:10871000A9FF002818BF1E3CAF4234BF2846384688 +:10872000A04203D2AF422CBF3C462C467462BDE847 +:10873000F0812DE9FF4F93B0044690F8650088461C +:108740000F90DDE9151008431190E04800270578E7 +:108750000C2D28BFFFDFDE4E36F8159094F88C51B3 +:108760000C2D28BFFFDFDA4830F81500484480B2EE +:10877000009094F87D000D280CBF012000200A9085 +:108780001598002804BF94F82C0103282BD10A98CF +:1087900048B3B4F8AE01404525D1D4F83401C4F84B +:1087A0002001608840F2E2414843C4F82401B4F853 +:1087B0007A01B4F806110844C4F82801204602F0F2 +:1087C0005BFFB4F8B201E08294F8B0016075B4F8D0 +:1087D000B4016080B4F8B601A080B4F8B801E080BC +:1087E000022084F82C01D4F884010E90D4F8800182 +:1087F0000D90B4F80661B4F87801D4F874110591BD +:10880000159921B194F8401151B100F0D6B804F592 +:108810008071069174310B9104F5B075091D07E064 +:1088200004F5AA710691091D0B9104F5A275091DA5 +:108830000C91B4F87010A8EB0000A8EB01010FFA3E +:1088400080F90FFA81FBB9F1000F05DAD4F8700155 +:1088500005900120D94611909C484FF0000A0079FC +:10886000A8B3F3F75FFB90B3B4F8180102282ED336 +:1088700094F82C0102282AD094F8430138BB94F8CC +:108880008C0100900C2828BFFFDF9148009930F838 +:10889000110000F5C86080B2009094F82C01012806 +:1088A0007ED0608840F2E2414843009901F01BF914 +:1088B000D4F8342180B206EB0B01A1EB0901821A36 +:1088C00001FB02AAC4F83401012084F8430194F8A2 +:1088D0002C01002865D0012800F00B82022800F04E +:1088E0006A81032818BFFFDF00F03D82A7EB0A0171 +:1088F0000598FCF782F90B99012640F27122086075 +:108900000C98A0F80080002028702E710B98006849 +:10891000A8606188D4F834015143C0EB41006B4931 +:10892000A0F23630C8618969814287BF0699086024 +:10893000069801600698616A0068084400F5D370E3 +:10894000E86002F08FFE10B1E8681E30E8606E71DA +:10895000B4F8F000A0EB080000B20028C4BF032068 +:1089600068710A980028169800F05F82E0B100BF95 +:10897000B4F8181100290CBF0020B4F81A01A4F8AB +:108980001A0194F81C21401C504388420CD268798B +:10899000401E002808DD6E71B4F81A01401C01E089 +:1089A0000FE05AE0A4F81A011598002800F0608240 +:1089B00094F84001002800F0578217B00220BDE86B +:1089C000F08F94F8800003283DD03F4894F865105C +:1089D00090F8300005F001FAE28A40F2712151432B +:1089E00000EB4100CDF81000D4F82401009901F00B +:1089F0007AF8D4F82021D4F82811821A01FB02AAAF +:108A0000C4F820010099049801F06DF8D4F83011F1 +:108A1000C4F83001411A8A44608840F2E241484378 +:108A2000009901F060F806EB0B01D4F82821A1EBC6 +:108A30000901891AD4F83421C4F83401821A491E74 +:108A400001FB02AA40E7E18A40F27122D4F8240136 +:108A5000514300EB41000490C6E70D98002808BF81 +:108A6000FFDF94F86510184890F8300005F0B5F96C +:108A70000890E08A40F271214143089800EB4100E0 +:108A8000009901F030F8C4F83001608840F2E2410A +:108A90004843009901F027F8C4F8340186B2214612 +:108AA0000120D4F8289005F0D4FE074694F865001C +:108AB000FEF7E8FA4AF2B12108444FF47A7BB0FBA2 +:108AC000FBF0618806E00000B00C0020E000002010 +:108AD000D463020040F271225143C0EB4100801B7D +:108AE000A0F2663602F0BEFD002818BF1E3EB94552 +:108AF00034BF38464846B04203D2B9452CBF4E4633 +:108B00003E46666294F86500FEF732FB00F2E140F3 +:108B1000B0FBFBF10D980F1894F86500FEF728FBE9 +:108B2000064694F86500FEF7ADFA30444AF2AB31E0 +:108B30000844B0FBFBF1E08A40F2712242430898FE +:108B4000D4F8306100EB4200401A801B3844A0F199 +:108B50002007607D40F2E24110FB01F994F86500C6 +:108B6000009010F00C0F0ABF00984EF62830FEF768 +:108B700089FA4AF2B1210844B0FBFBF000EB460051 +:108B800000EB09060098FEF702FB304400F1620199 +:108B9000FB48816194F86500FEF7EAFA00F2E140D3 +:108BA000B0FBFBF10D980844381A40F2F6218842D8 +:108BB00038BFFFDF9AE6E18A40F27122D4F824013F +:108BC000514300EB4100009900F08DFFC4F83001E3 +:108BD000618840F2E2404843009900F084FFC4F805 +:108BE000340187B221460120D4F828B005F031FEC7 +:108BF000814694F86500FEF745FA4AF2B121014436 +:108C00004FF47A70B1FBF0F0618840F27122514369 +:108C1000C0EB4100C01BA0F2663702F023FD002824 +:108C200018BF1E3FCB4534BF48465846B84203D212 +:108C3000CB452CBF5F464F46676216BB169800B304 +:108C400094F865603046FEF71DFA4AF2B1210144FE +:108C50004FF47A70B1FBF0F0D4F8301140F2712388 +:108C60000844E18AD4F82421594302EB41010F1A48 +:108C70003046FEF78CFA0E99081A3844A0F1200706 +:108C80000AE0E18A40F27122D4F82401514300EB5A +:108C90004100D4F83011471AD4F82821D4F8201113 +:108CA000D4F8300101FB020B607D40F2E24110FB81 +:108CB00001F994F8656016F00C0F0ABF30464EF6C5 +:108CC0002830FEF7DFF94AF2B12101444FF47A70FF +:108CD000B1FBF0F000EB4B0081443046FEF757FA51 +:108CE000484400F16001A6488161012084F82C010C +:108CF000FCE5608840F271225043D4F83411D4F876 +:108D00002821C1EB400000FB09F706EB0B00801A9D +:108D1000D4F820C1D4F83031401E0CFB023200FBE5 +:108D2000012B607D40F2E24110FB01F994F865608F +:108D300016F00C0F0ABF30464EF62830FEF7A2F9A7 +:108D40004AF2B12101444FF47A70B1FBF0F000EB2C +:108D50004B0081443046FEF71AFA484400F16001A6 +:108D600087488161C2E5618840F27122D4F83401FC +:108D70005143C0EB410000FB09F794F87C00242824 +:108D80001CBF94F87D0024280BD1B4F8AE01A8EBE9 +:108D9000000000B2002804DB94F8B101002818BFDD +:108DA0000F90119800B3FEB90E9800281ABF0D98C5 +:108DB0000028FFDF94F8650010F00C0F14BF4EF68A +:108DC0002830FEF75FF94AF2B12101444FF47A707E +:108DD000B1FBF0F03F1A94F86500FEF7D8F90E9950 +:108DE000081A3844A0F12007D4F8341106EB0B0020 +:108DF00000FB01F60F9810F00C0F0ABF0F984EF60B +:108E00002830FEF73FF94AF2B12101444FF47A705D +:108E1000B1FBF0F000EB46060F98FEF7B8F93044CE +:108E200000F160015648816160E500287FF4A0AD43 +:108E300094F82C0100283FF4B7AD618840F271220C +:108E4000D4F834015143C0EB4101284604F088FDB9 +:108E50000004000C3FF4A8AD2099002918BF088039 +:108E6000012017B0BDE8F08F94F87C01FCF71CFDE1 +:108E700094F87C012946FCF7FDFB20B1159880F0A1 +:108E8000010084F8410117B00020BDE8F08F70B5F3 +:108E90003C4C607A00281CBF002070BD94F8340060 +:108EA00038B1A16B606A884203D9F6F750FE002002 +:108EB00070BDA06AE8B1F5F71FFE0546F5F78CFC1A +:108EC000284442F210714618FCF7B0F905462946CD +:108ED000E06AFCF79AFEE562A16A8219914224BF1A +:108EE000081AA06205D20120A062F6F730FE002029 +:108EF00070BD012070BDF8B5224C0246204F002500 +:108F00006168606A052A4FD2DFE802F00331363E1D +:108F10004500A07A002660B101216846FDF716FBE6 +:108F20009DF8000042F210710002B0FBF1F201FB6B +:108F30001206F5F7E1FD8119A069FBF75EFEA0615D +:108F400025740320607501202075607A38B9207B74 +:108F500004F11001FCF78EFB002808BFFFDF258419 +:108F6000FCF76FF87879BDE8F840E9F7B9BFBDE8DC +:108F7000F840002100F0D4BDC1F88001F8BD000028 +:108F8000E0000020B00C0020D1F88001BDE8F840DE +:108F9000012100F0C5BD84F83450FCF752F878790F +:108FA000BDE8F840E9F79CBFFFDFE7E72DE9F04FA8 +:108FB000DFF80494044683B099F800008B4601273B +:108FC0000025FE4E4FF00208032804BF99F80C005C +:108FD000A0427DD1D9F80400706199F800000328FF +:108FE00018BFFFDF0324BBF1080F72D2DFE80BF0DC +:108FF000040F32322DD2D2C9C9F82450F6F77EF9C7 +:10900000002818BFFFDFB47003B0BDE8F08FF5F79C +:10901000E3FB0446D9F81C00A04228BFC9F81C4055 +:1090200006D2201A0421FCF724FEC9F81C4038B1EE +:10903000F6F7F7FC002818BFFFDF03B0BDE8F08F9C +:1090400003B00020BDE8F04F55E703B0BDE8F04F96 +:10905000FEF7F9BD89F8147089F8105099F83400BA +:109060004FF0010A42F2107B68B14FF47A71D9F8DF +:109070001800FBF7C2FDC9F81800002109F1100023 +:1090800004F06EFC1BE001216846FDF755FA9DF8DF +:1090900000000002B0FBFBF10BFB110AF5F72CFD01 +:1090A00082445146D9F81800FBF7A7FDC9F818000B +:1090B000514609F1100004F053FC00F1010AB9F81F +:1090C0002000411C0A293CBF5044A9F8200001E0BF +:1090D00064E05FE0D9F8040038B1B9F82000401C22 +:1090E0000A2828BF89F8158001D289F8154099F817 +:1090F000090070BB99F8340040B1D9F83810D9F89C +:109100002400884202D9F6F722FD22E0D9F828008F +:1091100058B3F5F7F1FC0446F5F75EFB204400EB8D +:109120000B08FCF783F804462146D9F82C00FCF71D +:109130006CFDC9F82C40D9F8281000EB08029142C8 +:1091400024BF081AC9F828000FD2C9F82870F6F70A +:10915000FEFC99F80C00FCF74AF889F80050707989 +:1091600003B0BDE8F04FE9F7BBBE99F80C0009F178 +:109170001001FCF77FFA002808BFFFDF03B0BDE84D +:10918000F08F99F80C00FCF732F889F8005003B022 +:10919000BDE8F08FFFDF03B0BDE8F08F202C28BFC3 +:1091A000FFDFDFF81C92072139F81400F9F7D6FE2B +:1091B0005FEA000A08BFFFDF202C28BFFFDF39F875 +:1091C0001400BAF80010884218BFFFDF5446C6F8F2 +:1091D00014A04FF0200ABBF1080F80F06881DFE88F +:1091E0000BF00498A2A29BF3F2F1C4F88051F58031 +:1091F000C4F8845194F8410138B9FCF717F8D4F851 +:109200004C11FCF702FD00281DDCB4F83E01B4F857 +:109210007010884208D1B4F8F400401AA4F8F6009F +:109220002046B4F8F41005E0401AA4F8F600B4F8AB +:109230003E112046A4F87010D4F86811C4F84C11FF +:10924000C0F870111DE0B4F83C11B4F87000081AB1 +:10925000A4F8F600B4F83C112046A4F87010D4F835 +:109260004C11C4F86811C4F87011D4F85411C4F842 +:109270000011D4F85811C4F87411B4F85C11A4F8B2 +:10928000781102F0D4F8FBF7ABFF814694F8650043 +:10929000FDF7F8FE4AF2B12108444FF47A71B0FBB1 +:1092A000F1F0D4F8341140F271220844618851433E +:1092B000C0EB4100A0F1300AB9F1B70F98BF4FF0F1 +:1092C000B7092146012005F0C4FA4844AAEB000082 +:1092D000A0F21B39A2462146012005F0BAFADAF8BD +:1092E00024109C30814288BF0D1AC6F80C904D4561 +:1092F00028BF4D46B560D4F86C01A0F5D37030613D +:10930000FCF750FC84F8407186F8028003B0BDE899 +:10931000F08F02F0A2F901E0FEF795FC84F84071AD +:1093200003B0BDE8F08FFBF781FFD4F87021014650 +:109330001046FCF76AFC48B1628840F27123D4F809 +:1093400034115A43C1EB4201B0FBF1F094F87D10A7 +:109350000D290FD0B4F87010B4F83E210B189A42C2 +:10936000AEBF501C401C0844A4F83E0194F84201D2 +:1093700078B905E0B4F83E01401CA4F83E0108E0CD +:10938000B4F83E01B4F8F410884204BF401CA4F8BD +:109390003E01B4F87A010DF1040B401CA4F87A01E7 +:1093A000B4F89A00B4F89810401AB4F87010401E3F +:1093B00008441FFA80F814E0B00C0020E000002000 +:1093C000EC0C002065E059E071E000231A462046CD +:1093D000CDF800B0FFF7ADF948B3012818BFFFDFA3 +:1093E00044D0B4F83E11A8EB010000B20028ECDA3A +:1093F000082084F88D0084F88C70204601F0C8FDA8 +:1094000084F82C5194F87C514FF6FF77202D00D32F +:10941000FFDF29F8157094F87C01FBF7E8FE84F86B +:109420007CA1707903B0BDE8F04FE9F759BDA06E9B +:10943000002804BF03B0BDE8F08FB4F83E01B4F8D3 +:109440009420801A01B20029DCBF03B0BDE8F08F80 +:10945000B4F86C000144491E91FBF0F189B201FBA4 +:109460000020A4F8940003B0BDE8F08FB4F83E01EA +:10947000BDF804100844A4F83E01B2E7FEF7A2FAD2 +:10948000FEF7E1FB4FF0E020C0F8808203B0BDE8BA +:10949000F08F94F82C01042818BFFFDF84F82C51BA +:1094A00094F87C514FF6FF77202DB2D3B0E7FFDF61 +:1094B00003B0BDE8F08F10B5FC4C207850B101200E +:1094C0006072F6F76AFB2078032805D0207A00281E +:1094D00008BF10BD0C2010BD207BFCF7E5F9207BF8 +:1094E000FCF74EFC207BFBF782FE002808BFFFDF65 +:1094F0000020207010BD2DE9F04FEC4F83B038787C +:1095000001244FF0000840B17C720120F6F745FBC2 +:109510003878032818BF387A0DD0DFF8949389F88B +:10952000034069460720F9F7A2FC002818BFFFDFB7 +:109530004FF6FF7440E0387BFCF7B6F9387BFCF758 +:109540001FFC387BFBF753FE002808BFFFDF87F8BE +:109550000080E2E7029800281CBF90F82C11002937 +:109560002AD00088A0421CBFDFF848A34FF0200B90 +:109570003AD00721F9F7F2FC040008BFFFDF94F8A6 +:109580007C01FCF7FDFB84F82C8194F87C514FF6AC +:10959000FF76202D28BFFFDF2AF8156094F87C01A4 +:1095A000FBF725FE84F87CB169460720F9F75FFCDC +:1095B000002818BFFFDF12E06846F9F736FC0028E4 +:1095C000C8D011E0029800281CBF90F82C11002987 +:1095D00005D00088A0F57F41FF39CAD104E0684674 +:1095E000F9F723FC0028EDD089F8038087F8348050 +:1095F00087F80B8003B00020BDE8F08FAC494871BC +:109600000020887001220A7048700A71C870A7494A +:10961000087070E7A649087070472DE9F84FA34C11 +:10962000064688462078002860D1A348FBF784FDD1 +:10963000207320285AD003276660277000256572A2 +:109640002572AEB1012106F58E70FCF79EFF062053 +:10965000F9F72CFC81460720F9F728FC96F81C1135 +:109660004844B1FBF0F200FB1210401C86F81C01CC +:10967000FBF7B6FD40F2F651884238BF40F2F65093 +:1096800000F23F101FFA80F9F5F7A6F8E061F5F750 +:1096900033FA012668B3A672FBF7C8FD82460121A2 +:1096A0006846FCF749FF9DF8000042F21071000285 +:1096B000B0FBF1F201FB120000EB09015046FBF791 +:1096C0009CFAA061C4E90A8A267567752574207B17 +:1096D00004F11001FBF7CEFF002808BFFFDF25844F +:1096E0000020F6F75AFA0020BDE8F88F0C20BDE8FC +:1096F000F88FFBF79BFD4946FBF77FFAA061A57247 +:1097000084F83460A8F28B50A562A063DCE7684956 +:10971000487070476649087170472DE9F041644C04 +:109720000646E088401CE080D4E902516078D6F813 +:10973000807120B13A46284604F03DF90546A068FC +:10974000854205D02169281A08442061FCF72AFACD +:10975000A560AF4209D896F82C01012805D0E07821 +:10976000002804BF0120BDE8F0810020BDE8F081A1 +:1097700010B504460846FDF785FC4AF2B1210844BD +:109780004FF47A71B0FBF1F040F2E241614300F234 +:10979000363081428CBF081A002010BD70B50446D7 +:1097A00082B0002084F8400194F8FE00002807BF32 +:1097B00094F82C01032802B070BDFBF737FDD4F8F4 +:1097C000702101461046FCF720FA0028DCBF02B0E9 +:1097D00070BD628840F27123D4F834115A43C1EB52 +:1097E0004201B0FBF1F0B4F87010401C0844A4F83A +:1097F0003C01B4F8F400B4F83C21801A00B200280F +:10980000DCBF02B070BD012084F84201B4F89A00B8 +:10981000B4F8982001AE801A401E084485B212E0C8 +:109820000096B4F83C11002301222046FEF781FF88 +:10983000002804BF02B070BD01280DD0022812BF5D +:10984000FFDF02B070BDB4F83C01281A00B2002856 +:10985000BCBF02B070BDE3E7B4F83C01BDF8041032 +:109860000844A4F83C01EEE7F8B5042200250629D7 +:1098700064D2DFE801F0072F03191933044680F89A +:109880002C2107E004460A48C078002818BF84F855 +:109890002C2113D0FBF7D5FBA4F87A51B4F8700053 +:1098A000A4F83E0184F84251F8BD0000B00C00203D +:1098B000E0000020EC0C0020AD8F01000095B4F812 +:1098C000F410012300222046FEF733FF002818BFC2 +:1098D000FFDFDFE7032180F82C11E5E70646876A02 +:1098E000B0F83401314685B2012004F0B2FF0446DD +:1098F00096F86500FDF7C6FB4AF2B12108444FF423 +:109900007A71B0FBF1F0718840F271225143C0EBE3 +:109910004100401BA0F2663501F0A4FE002818BFEC +:109920001E3DA74234BF20463846A84228BF2C46D9 +:1099300002D2A74228BF3C467462B5E7FFDFB3E717 +:109940002DE9F05F9E4EB178022906BFF18800290B +:10995000BDE8F09F7469C4F8840194F86500FDF7D0 +:1099600016FCD4F88411081AB1680144B160F1689A +:109970000844F060746994F84301002808BFBDE80A +:10998000F09F94F82C01032818BFBDE8F09F94F8CD +:10999000655037780C2F28BFFFDF8A4E36F81780C6 +:1099A00094F88C710C2F28BFFFDF36F81700404465 +:1099B00094F88C8187B2B8F10C0F28BFFFDF36F81E +:1099C000180000F5C8601FFA80F82846FDF7DFFB95 +:1099D000D4F884114FF0000A0E1A15F00C0F0ABFCC +:1099E00028464EF62830FDF74DFB4FF47A7900F209 +:1099F000E730B0FBF9F0361A2846FDF7C8FBD4F87B +:109A0000001115F00C0FA1EB000B0ABF28464EF613 +:109A10002830FDF737FB4AF2B1210844B0FBF9F0DA +:109A2000ABEB0000A0F160017943B1FBF8F1292212 +:109A300002EB50006031A0EB510200EB5100B2424A +:109A400001D8B04201D8F2F71FFB608840F2E24132 +:109A50004843394600F047F8C4F8340184F843A17C +:109A6000BDE8F09F70B50546554890F802C0BCF1BE +:109A7000020F07BF406900F5C074534800F1240489 +:109A8000002904BF256070BD4FF47A7601290DD0FE +:109A900002291CBFFFDF70BD1046FEF739FC00F243 +:109AA000E140B0FBF6F0281A206070BD1846FDF7C3 +:109AB0005FFB00F2E140B0FBF6F0281A206070BDB9 +:109AC0004148007800281CBF0020704710B50720CF +:109AD000F9F7DEF980F0010010BD3B48007800285E +:109AE00018BF0120704730B502460020002908BF8A +:109AF00030BDA2FB0110490A41EAC051400A4C1C8A +:109B000040F100000022D4F1FF3140F2A17572EB68 +:109B1000000038BFFFDF04F5F460B0FBF5F030BDA6 +:109B20002DE9F843284C0025814684F83450D4F8B8 +:109B3000188084F83010E5722570012727723946A5 +:109B4000606803F094FA6168C1F87081267B81F83F +:109B50007C61C1F88091C1F87481B1F80080202E39 +:109B600028BFFFDF194820F81680646884F82C515C +:109B70000023A4F878511A46194620460095FEF7AE +:109B8000D8FD002818BFFFDFC4F82851C4F82051C1 +:109B900084F82C71A4F83E51A4F83C5184F8425149 +:109BA000B4F87000401EA4F87000A4F87A51FBF7D6 +:109BB00048FA03484079BDE8F843E9F791B9000055 +:109BC000E0000020D4630200B00C0020EC0C002068 +:109BD000012804D0022805D0032808D105E0012976 +:109BE00007D004E0022904D001E0042901D00020BC +:109BF0007047012070472DE9F0410E46044604F0FD +:109C000092FC0546204604F092FC044603F0ADFFAA +:109C1000FB4F010015D0386990F864208A4210D0BB +:109C200090F8C4311BB190F8C63123421FD02EB931 +:109C300090F85D30234201D18A4218D890F8C401CF +:109C4000A8B1284603F091FF70B1396991F86520F9 +:109C5000824209D091F8C40118B191F8C701284295 +:109C600005D091F8C40110B10120BDE8F0810020B9 +:109C7000FBE730B5E24C85B0E06900285FD01422E4 +:109C800000216846F4F7FBFB206990F86500FDF7BA +:109C9000F9F94FF47A7100F5FA70B0FBF1F520692B +:109CA00090F86500FDF773FA2844ADF806002069C6 +:109CB0000188ADF80010B0F87010ADF804104188BC +:109CC000ADF8021090F8A60130B1A069C11C039153 +:109CD00004F00AFB8DF81000206990F8A5018DF8BA +:109CE0000800E169684688472069002180F8A611CC +:109CF00080F8A5110399002921D090F8A41100291A +:109D00001DD190F87C10272919D09DF81010039AC6 +:109D1000002914D013780124FF2B12D0072B0ED169 +:109D200002290CD15178FF2909D100BF80F8A44144 +:109D30000399C0F8A8119DF8101080F8A71105B07C +:109D400030BD1B29F2D9FAE770B5AD4C206990F807 +:109D50007D001B2800D0FFDF2069002580F8A75078 +:109D600090F8D80100B1FFDF206990F8A81041B148 +:109D700080F8A8500188A0F8DC1180F8DA510E2193 +:109D800008E00188A0F8DC1180F8DA51012180F8A0 +:109D9000DE110D2180F8D8110088F9F712FAF8F7D2 +:109DA000A9FE2079E9F79CF8206980F87D5070BD04 +:109DB00070B5934CA07980072CD5A078002829D1C4 +:109DC00062692046D37801690D2B01F170005FD0E4 +:109DD0000DDCA3F102034FF001050B2B19D2DFE8D4 +:109DE00003F01A1844506127182C183A6400152BF8 +:109DF0006FD008DC112B4BD0122B5AD0132B62D012 +:109E0000142B06D166E0162B71D0172B70D0FF2BC8 +:109E10006FD0FFDF70BD91F87F200123194603F05A +:109E200035FD0028F6D12169082081F87F0070BD3A +:109E30001079BDE8704001F0B2BC91F87E00C00717 +:109E400000D1FFDF01F06AFC206910F87E1F21F0CD +:109E50000101017070BD91F87D00102800D0FFDF76 +:109E60002069112180F8A75008E091F87D0014289E +:109E700000D0FFDF2069152180F8A75080F87D1001 +:109E800070BD91F87D00152800D0FFDF172005E098 +:109E900091F87D00152800D0FFDF1920216981F895 +:109EA0007D0070BDBDE870404EE7BDE8704001F038 +:109EB0004ABC91F87C200123002103F0E7FC00B9A3 +:109EC000FFDF0E200FE011F87E0F20F00400087075 +:109ED0001DE00FE091F87C200123002103F0D6FC67 +:109EE00000B9FFDF1C20216981F87C0070BD12E001 +:109EF0001BE022E091F87E00C0F30110012800D0A1 +:109F0000FFDF206910F87E1F21F010010170BDE80D +:109F1000704001F003BC91F87C200123002103F084 +:109F2000B5FC00B9FFDF1F20DDE791F87D00212897 +:109F300001D000B1FFDF2220B0E7BDE8704001F0A2 +:109F4000F9BB2F48016991F87E20130702D5012142 +:109F50008170704742F0080281F87E208069C078E5 +:109F600081F8E10001F0D1BB10B5254C21690A88C8 +:109F7000A1F81A2281F8180291F8640001F0B3FBED +:109F8000216981F81C0291F8650001F0ACFB2169A0 +:109F900081F81D02012081F81602002081F8C40119 +:109FA0002079BDE81040E8F79BBF10B5144C05219F +:109FB0002069FFF759FC206990F85A10012908D050 +:109FC00000F5F77104F013FC2079BDE81040E8F7C4 +:109FD00087BF022180F85A1010BD10B5084C01232C +:109FE0000921206990F87C20703003F04FFC48B1C3 +:109FF0002169002001F8960F087301F81A0C10BDB2 +:10A00000000100200120A070F9E770B5FE4D01238A +:10A0100029462869896990F87C2009790E2A01D19E +:10A02000122903D000241C2A03D004E0BDE87040AC +:10A03000D3E7142902D0202A07D008E080F87C401A +:10A0400080F8A240BDE87040AFE7162906D0262A66 +:10A0500001D1162902D0172909D00CE000F87C4F55 +:10A0600080F82640407821280CD01A2017E090F87C +:10A070007D20222A07D0EA69002A03D0FF2901D1D6 +:10A0800080F8A63132E780F87D4001F047FB28696F +:10A0900080F8974090F8C4010028F3D00020BDE874 +:10A0A000704061E72DE9F843D74C206990F87C10A7 +:10A0B000202909D05FF0000790F87D10222905D0F3 +:10A0C0007FB300F17C0503E00127F5E700F17D0592 +:10A0D00010F8B01F41F004010170A06904F02FFADC +:10A0E0004FF00108002608B33946A069FFF783FD49 +:10A0F000E0B16A46A169206903F046FD90B3A0690A +:10A1000004F01BFA2169A1F8AE01B1F8701001F05A +:10A11000DEFA40B32069282180F88D1080F88C8009 +:10A1200058E0FFE70220A070BDE8F883206990F8AE +:10A13000C40110B11E20FFF717FFAFB1A06921695C +:10A14000C07881F8E20008FA00F1C1F3006000B9BC +:10A15000FFDF20690A2180F87C1090F8A20040B946 +:10A16000FFDF06E009E02AE02E7001F0D7FAFFF7E2 +:10A17000E8FE206980F89760D6E7226992F8C4016A +:10A1800070B1B2F8703092F86410B2F8C80102F5FC +:10A19000D77203F0EBFD68B12169252081F87C00BE +:10A1A000206900F17D0180F897608D4212D180F81E +:10A1B0007D600FE00020FFF7D7FE2E70F0E72069EA +:10A1C0009DF8001080F8B0119DF8011080F8B111D1 +:10A1D00024202870206900F17D018D4203D1BDE863 +:10A1E000F84301F09BBA80F8A2609DE770B5864CF9 +:10A1F00001230B21206990F87D20703003F046FB8D +:10A20000202650BB20690123002190F87D2070306A +:10A2100003F03CFB0125F0B1206990F87C00242874 +:10A220001BD0A06904F069F9C8B1206990F8B0109A +:10A2300041F0040180F8B010A1694A7902F00702E8 +:10A2400080F85D20097901F0070180F85C1090F832 +:10A25000C5311BBB06E0A57048E6A67046E6BDE822 +:10A2600070406EE690F8C431C3B900F164035E78C3 +:10A270008E4205D11978914202D180F897500DE0B5 +:10A2800000F504710D7002884A8090F85C200A7114 +:10A2900090F85D0048712079E8F722FE21692120BD +:10A2A00081F87D00BDE8704001F02FBAF8B5564C3A +:10A2B000206990F87E0010F0300F04D0A07840F0B4 +:10A2C0000100A070F8BDA06904F0FCF850B3A069CB +:10A2D00004F0F2F80746A06904F0F2F80646A06917 +:10A2E00004F0E8F80546A06904F0E8F80146009794 +:10A2F000206933462A46303004F0E3F9A07980071C +:10A3000003D56069C07814280FD0216991F87C00CA +:10A310001C280AD091F85A0001280ED091F8BB01F0 +:10A3200058B907E0BDE8F8400BE62169012081F843 +:10A330005A0002E091F8BA0130B1206910F87E1F8E +:10A3400041F0100101700EE091F87E0001F5FE72FF +:10A3500040F0200081F87E0031F8300B04F03BFA29 +:10A360002079E8F7BDFDBDE8F84001F0CEB970B541 +:10A37000254C206990F87E10890707D590F87C203D +:10A3800001230821703003F081FAE8B1206990F8C8 +:10A39000AA00800712D4A06904F070F8216981F83E +:10A3A000AB00A06930F8052FA1F8AC204088A1F8D7 +:10A3B000AE0011F8AA0F40F002000870206990F872 +:10A3C000AA10C90703D00FE00120A0708EE590F815 +:10A3D0007E00800700D5FFDF206910F87E1F41F066 +:10A3E0000201017001F091F92069002590F87C10BC +:10A3F000062906D180F87C5080F8A2502079E8F731 +:10A400006FFD206902E000000001002090F8AC110F +:10A410000429DBD180F8AC512079E8F761FD20698F +:10A4200090F87C100029D1D180F8A2505EE570B57B +:10A43000FE4C01230021206990F87D20703003F04C +:10A4400025FA012578B9206990F87D20122A0AD0D2 +:10A4500001230521703003F019FA10B10820A07013 +:10A4600044E5A57042E5206990F8A80008B901F01C +:10A470004CF92169A06901F5847103F0E0FF2169BD +:10A48000A069D83103F0E6FF206990F8E00100B13F +:10A49000FFDF21690888A1F8E20101F5F271A069E6 +:10A4A00003F0BBFF2169A06901F5F67103F0BDFF60 +:10A4B000206980F8E051142180F87D102079BDE8F2 +:10A4C0007040E8F70DBD70B5D84C0123002120691C +:10A4D00090F87D20703003F0D9F90125A8B1A0696A +:10A4E00003F067FF98B1A0692169B0F80D00A1F8E9 +:10A4F000AE01B1F8701001F0EAF858B120692821D6 +:10A5000080F88D1080F88C50F0E4A570EEE4BDE882 +:10A51000704016E5A0692169027981F8B021B0F890 +:10A520000520A1F8B22103F037FF2169A1F8B40199 +:10A53000A06903F034FF2169A1F8B601A06903F016 +:10A5400035FF2169A1F8B8010D2081F87D00CDE427 +:10A550007CB5B64CA079C00738D0A069012305218D +:10A56000C578206990F87D20703003F08FF968B1CC +:10A57000AD1E0A2D06D2DFE805F009090505090917 +:10A5800005050909A07840F00800A070A07800280F +:10A590001CD1A06903F0D6FE00286ED0A069022667 +:10A5A000C5781DB1012D01D0162D18D1206990F864 +:10A5B0007C0003F053F990B1206990F87C101F29BA +:10A5C0000DD0202903D0162D16D0A6707CBD2621D3 +:10A5D00080F87C10162D02D02A20FFF7C5FC0C2D28 +:10A5E00058D00CDC0C2D48D2DFE805F033301D4488 +:10A5F000A8A8489F57A836392020A0707CBD01200C +:10A60000152D6ED008DC112D6CD0122D6CD0132DB1 +:10A6100064D0142D31D179E0162D7DD0182D7ED047 +:10A62000FF2D2AD184E020690123194690F87F206C +:10A63000703003F02BF9F8B9A06903F0E7FE216947 +:10A6400081F89201072081F87F0079E001F043F959 +:10A6500076E0FFF738FF73E001F01DF970E0206944 +:10A6600090F87D10112901D0A67069E0122180F8C0 +:10A670007D1065E0FFF7DBFE62E05FE0206990F8A7 +:10A680007D001728F0D101F049F821691B2081F8DD +:10A690007D0055E0FFF76BFE52E0206990F87E00E8 +:10A6A000C00703D0A07840F0010022E06946A0690D +:10A6B00003F0EBFE9DF8000000F02501206900F892 +:10A6C000B01F9DF8011001F04901417001F01DF823 +:10A6D000206910F87E1F41F0010113E0FFF77DFCB7 +:10A6E0002EE016E01EE0FFE7216991F87E10490791 +:10A6F00001D5A07024E001F008F8206910F87E1F51 +:10A7000041F0040101701BE006E008E0FFF7CEFD18 +:10A7100016E001F088F813E0FFF768FD10E0FFF79E +:10A72000C1FC0DE001F05EF80AE0FFF76EFC07E007 +:10A73000E16919B1216981F8A60101E0FFF701FC87 +:10A740002069F0E93012491C42F10002C0E9001210 +:10A750007CBD70B5354CA07900074AD5A07800289B +:10A7600047D1206990F8E400FE2800D1FFDF20697E +:10A77000FE21002580F8E41090F87D10192906D1FB +:10A7800080F8A75000F0CAFF206980F87D5020694A +:10A7900090F87C101F2902D0272921D119E090F8C8 +:10A7A0007D0003F05BF878B120692621012380F851 +:10A7B0007C1090F87D200B21703003F067F878B999 +:10A7C0002A20FFF7D1FB0BE02169202081F87C00D3 +:10A7D00006E0012180F8A51180F87C5080F8A25095 +:10A7E000206990F87F10082903D10221217080F898 +:10A7F000E41047E410B50D4C216991F8B0210AB975 +:10A8000091F8642081F8642091F8B1210AB991F897 +:10A81000652081F8652010B10020FFF7A5FB2069B5 +:10A8200003F07BFF002809D0206901E0000100202F +:10A83000BDE8104000F5F77103F0D9BF10BD70B549 +:10A84000F84C06460D46206990F8E400FE2800D03A +:10A85000FFDF2269002082F8E46015B1A2F8A400AD +:10A8600010E422F89E0F012010710BE470B5ED4C3E +:10A8700001230021206990F87C20703003F006F855 +:10A8800000287AD0206990F8BA1111B190F8BB1164 +:10A8900039B190F8C41100296ED090F8C51111B3E8 +:10A8A0006AE090F87D1024291BD090F87C102429B0 +:10A8B00017D0002300F5D87200F5DD7103F0CEFE4D +:10A8C0002169002081F8BA0101461420FFF7B7FF83 +:10A8D000216901F13000C28A21F8E62F408B4880BF +:10A8E00050E00123E6E790F87D2001230B21703032 +:10A8F00002F0CCFF68BB206990F8640000F0F3FE22 +:10A900000646206990F8650000F0EDFE05462069D6 +:10A9100090F8C6113046FFF75BF9D8B1206990F87E +:10A92000C7112846FFF754F9A0B12269B2F8703078 +:10A9300092F86410B2F8C80102F5D77203F016FA63 +:10A9400020B12169252081F87C001BE00020FFF761 +:10A950000BFB11E020690123032190F87D2070306A +:10A9600002F094FF40B920690123022190F87D2074 +:10A97000703002F08BFF08B100206DE4002116203A +:10A98000FFF75DFF012067E410B5E8BBA54C206927 +:10A9900090F87E10CA0702D00121092052E08A07F0 +:10A9A0000AD501210C20FFF74AFF206910F8AA1FE1 +:10A9B00041F00101017047E04A0702D5012113204F +:10A9C00040E00A0705D510F8E11F41710121072079 +:10A9D00038E011F0300F3BD090F8BB11A1B990F8DE +:10A9E000BA11E1B190F87D1024292FD090F87C1095 +:10A9F00024292BD05FF0000300F5D87200F5DD713B +:10AA000003F02CFE216900E022E011F87E0F20F017 +:10AA1000200040F010000870002081F83C012069FF +:10AA200090F87E10C90613D503F077FEFFF7BDFA44 +:10AA3000216901F13000C28A21F8E62F408B48805D +:10AA400001211520FFF7FBFE012010BD0123D3E7F4 +:10AA5000002010BD70B5734C206990F8E410FE29F9 +:10AA600078D1A178002975D190F87F20012319466B +:10AA7000703002F00BFF00286CD1206990F8901123 +:10AA800049B10021A0F89C1090F8911180F8E610CF +:10AA9000002102205BE090F87D200123042170302A +:10AAA00002F0F4FE0546FFF76FFF002852D128465A +:10AAB00000F075FF00284DD120690123002190F896 +:10AAC0007C20703002F0E2FE78B12069012304217D +:10AAD00090F87D20703002F0D9FE30B9206990F8EE +:10AAE000960010B10021122031E0206990F87C20FE +:10AAF0000A2A0DD0002D2DD101230021703002F043 +:10AB0000C5FE78B1206990F8AC1104290AD105E09E +:10AB100010F8E21F01710021072018E090F8AA0048 +:10AB2000800718D0FFF7A2FE002813D12069012367 +:10AB3000002190F87C20703002F0A8FE002809D097 +:10AB4000206990F8A401002804D00021FF20BDE86E +:10AB5000704074E609E000210C20FFF770FE2069C8 +:10AB600010F8AA1F41F0010101702FE43EB505461F +:10AB70006846FDF79BFC00B9FFDF22220021009808 +:10AB8000F3F77DFC0321009803F0C4FB00980178E3 +:10AB900021F010010170294603F0E1FB214C0D2D3D +:10ABA00042D00BDCA5F102050B2D19D2DFE805F030 +:10ABB0001F184919191F185518192400152D5DD093 +:10ABC00008DC112D25D0122D0BD0132D09D0142DFA +:10ABD00006D153E0162D2BD0172D68D0FF2D72D043 +:10ABE000FFDFFDF776FC002800D1FFDF3EBD2169C5 +:10ABF000009891F8E61019E0E26800981178017168 +:10AC000091884171090A81715188C171090A0172E3 +:10AC1000E7E70321009803F0ACFC0621009803F05D +:10AC2000ACFCDEE700010020009806210171D8E7A6 +:10AC30000098216991F8C621027191F8C7114171FC +:10AC4000CFE72169009801F5887103F007FC2169BD +:10AC50000098DC3103F00CFCC3E7FA49D1E90001AC +:10AC6000CDE90101206901A990F8B00000F02500AC +:10AC70008DF80400009803F036FCB2E72069B0F8C4 +:10AC80004810009803F006FC2069B0F8E81000981E +:10AC900003F004FC2069B0F84410009803F002FCB3 +:10ACA0002069B0F8E610009803F000FC99E72169EC +:10ACB00091F8C40100280098BCD111F8642F0271EA +:10ACC0004978BCE7FFE7206990F8A721D0F8A811E0 +:10ACD000009803F052FB84E7DB4810B5006990F858 +:10ACE000821041B990F87D2001230621703002F0D6 +:10ACF000CDFD002800D0012010BD70B5D24D2869CF +:10AD000090F8801039B1012905D0022906D0032915 +:10AD100004D0FFDF1BE4B0F8F41037E090F87F10A8 +:10AD2000082936D0B0F89810B0F89A2000248B1C6F +:10AD30009A4206D3511A891E0C04240C01D0641EB9 +:10AD4000A4B290F8961039B190F87C200123092123 +:10AD5000703002F09BFD40B3FFF7BEFF78B1296968 +:10AD60000020B1F89020B1F88E108B1C9A4203D3CA +:10AD7000501A801E00D0401EA04200D284B20CB1F6 +:10AD8000641EA4B22869B0F8F4102144A0F8F010B1 +:10AD90002FE5B0F898100329BDD330F8701F428D0D +:10ADA0001144491CA0F8801023E50024EAE770B59F +:10ADB0000C4605464FF4087200212046F3F75FFB6E +:10ADC000258016E5F8F7D4B92DE9F0410D46074680 +:10ADD0000721F8F7C3F8041E3CD094F8CC010026F4 +:10ADE000A8B16E70092028700BE0268484F8CC612D +:10ADF000D4F8CE016860D4F8D201A860B4F8D601C6 +:10AE0000A88194F8CC010028EFD12E71AEE094F81F +:10AE1000D80190B394F8D8010D2813D00E2801D092 +:10AE2000FFDFA3E02088F8F7CCF90746F7F777FEB5 +:10AE300078B96E700E20287094F8DA012871208895 +:10AE4000E88014E02088F8F7BCF90746F7F767FEBA +:10AE500010B10020BDE8F0816E700D20287094F8CC +:10AE6000DA0128712088E88094F8DE01287284F8DD +:10AE7000D8613846F7F74DFE78E0FFE794F80E0208 +:10AE800030B16E701020287084F80E62AF806DE0D3 +:10AE900094F8E00190B16E700A2028702088A88094 +:10AEA000D4F8E411C5F80610D4F8E811C5F80A1072 +:10AEB000B4F8EC01E88184F8E06157E094F8080206 +:10AEC00070B16E701A20287005E000BF84F8086227 +:10AED000D4F80A02686094F808020028F6D145E028 +:10AEE00094F8EE0188B16E701520287008E000BF5C +:10AEF00084F8EE6104F5F8702B1D07C883E807009D +:10AF000094F8EE010028F3D130E094F8FC0170B120 +:10AF10006E701C20287084F8FC61D4F8FE01686013 +:10AF2000D4F80202A860B4F80602A8811EE094F8E2 +:10AF3000100238B11D20287084F81062D4F8120273 +:10AF4000686013E094F81602002883D06E70162013 +:10AF5000287007E084F81662D4F818026860B4F824 +:10AF60001C02288194F816020028F3D1012071E711 +:10AF700035480021C16101620846704730B5324D45 +:10AF80000C46E860FFF7F4FF00B1FFDF2C7130BD25 +:10AF9000002180F87C1080F87D1080F8801090F8F7 +:10AFA000FE1009B1022100E00321FEF75DBC2DE98E +:10AFB000F041254C0546206909B1002104E0B0F8B4 +:10AFC0000611B0F8F6201144A0F8061190F890117F +:10AFD00039B990F87F2001231946703002F056FCF1 +:10AFE00030B1206930F89C1FB0F85A20114401801C +:10AFF000206990F8A23033B1B0F89E10B0F8F62076 +:10B000001144A0F89E1090F9A670002F06DDB0F84C +:10B01000A410B0F8F6201144A0F8A41001213D2698 +:10B0200015B180F88D6017E02278022A0ED0012A2F +:10B0300015D0A2784AB380F88C1012F0140F11D0FA +:10B040001E2117E0EC6302000001002090F8E620CA +:10B05000062A3CD016223AE080F88C1044E090F8A2 +:10B06000922134E0110702D580F88D603CE0910612 +:10B0700003D5232180F88D1036E0900700D1FFDF43 +:10B0800021692A2081F88D002AE02BB1B0F89E209A +:10B09000B0F8A0309A4210D2002F05DDB0F8A420FD +:10B0A000B0F8A0309A4208D2B0F89C30B0F89A209C +:10B0B000934204D390F890310BB1222207E090F82C +:10B0C00080303BB1B0F89830934209D3082280F821 +:10B0D0008D20C1E7B0F89820062A01D33E22F6E77A +:10B0E000206990F88C1019B12069BDE8F0414FE754 +:10B0F000BDE8F0410021FEF7B7BB2DE9F047FF4C5A +:10B1000081460D4620690088F8F76DF8060000D1E9 +:10B11000FFDFA0782843A070A0794FF000058006DB +:10B12000206904D5A0F8985080F8045103E030F865 +:10B13000981F491C0180FFF7CFFD012740B3E0882D +:10B14000000506D5206990F8821011B1A0F88E5044 +:10B150001EE02069B0F88E10491C89B2A0F88E104C +:10B16000B0F890208A4201D3531A00E00023B4F8CB +:10B1700008C00CF1050C634501D880F89670914227 +:10B1800006D3A0F88E5080F80E722079E7F7A8FE5B +:10B19000A0794FF0020810F0600F0ED0206990F8EF +:10B1A000801011B1032908D102E080F8807001E01D +:10B1B00080F880800121FEF757FB206990F880100D +:10B1C000012904D1E188C90501D580F88080B9F151 +:10B1D000000F71D1E188890502D5A0F8185104E06B +:10B1E000B0F81811491CA0F8181100F09FFBFEF7E9 +:10B1F00040FDFFF72FFC00F073FF0028206902D00C +:10B20000A0F8F85003E030F8F81F491C018000F066 +:10B210006AFF38B1206990F80411022907D8491C47 +:10B2200080F80411206990F80401022804D92069EB +:10B2300020F8F85F4580057320690123002190F80C +:10B240007D20703002F022FB20B9206990F87D004B +:10B250000C286AD120690123002190F87C207030ED +:10B2600002F014FB48B320690123002190F87F20ED +:10B27000703002F00BFB00B3206990F880100229B7 +:10B2800053D190F80401C0B93046F7F718FAA0B1CD +:10B29000216991F8E400FE2847D1B1F8F2000128B5 +:10B2A00043D981F8FD70B1F89A20B1F89800931E47 +:10B2B000984203DB012004E043E036E0101A401E10 +:10B2C00080B2B1F8F82023899A4201D3012202E02A +:10B2D0009A1A521C92B2904200D91046012801D10C +:10B2E00081F8FD5091F86F206AB98A6E5AB1B1F8B1 +:10B2F0009420B1F87030D21A12B2002A03DD9042C5 +:10B3000000DB104680B291F8882192B1B1F8FA20A2 +:10B31000B1F88A118A4201D3012102E0891A491C3D +:10B3200089B2884205D9084603E02169012081F8E5 +:10B33000FD502169B1F870201044A1F8F400FFF726 +:10B34000DCFCE088C0F340214846FFF730FE20696E +:10B3500080F8FE50BDE8F047FDF7DDB867490246CA +:10B360008878CB78184312D10846006942B18979B0 +:10B37000090703D590F87F00082808D001207047FE +:10B38000B0F84C10028E914201D8FEF7C6B90020E9 +:10B39000704770B5594C05460E46E0882843E0805A +:10B3A000A80703D5E80700D0FFDF6661EA074FF082 +:10B3B00000014FF001001AD0A661F278062A02D0EF +:10B3C0000B2A14D10AE0226992F87D30172B0ED196 +:10B3D0000023E2E92E3302F8370C08E0226992F8E4 +:10B3E0007D30112B03D182F8811082F8A800AA07C2 +:10B3F00018D56269D278052A02D00B2A12D10AE048 +:10B40000216991F87D20152A0CD10022E1E9302232 +:10B4100001F83E0C06E0206990F87D20102A01D149 +:10B4200080F88210280601D50820E07072E42DE92A +:10B43000F84F324C00254FF00108E580A570E5700B +:10B440004146257061F3070220619246814680F8EB +:10B45000FE800088F7F7C7FE070000D1FFDF2069F4 +:10B460000088FDF720F820690088FDF742F8206980 +:10B47000B0F8F21071B190F8E410FE290FD190F8F5 +:10B48000901189B190F87F2001231946703002F0A5 +:10B49000FDF978B1206990F8E400FE2804D0206915 +:10B4A00090F8E400FFF762FB206990F8FF1089B183 +:10B4B000258118E02069A0F89C5090F8911180F83F +:10B4C000E61000210220FFF7BAF9206980F8FD504C +:10B4D0000220E7E790F8CC1119B9018C82889142DB +:10B4E00000D881882181B0F8F610491E8EB2B0F8DC +:10B4F000F8103144A0F8F81002E00000000100202C +:10B5000090F8FC1021B1A0F8FA5080F8FC5004E04B +:10B51000B0F8FA103144A0F8FA1030F8981F31440E +:10B520000180FFF7D9FB20B1206930F88E1F31442C +:10B5300001802069B0F8F210012902D8491CA0F856 +:10B54000F2100EB180F8045190F8FD10A1B1B0F8DE +:10B55000F800218988420FD23846F7F7B0F858B181 +:10B56000206990F8881139B1B0F8FA10B0F88A0162 +:10B57000814201D300F0BAFD206980F8FD5090F8B7 +:10B580007D100B2901D00C2916D1B0F87020B0F82D +:10B59000AE31D21A12B2002A0EDBD0F8B01181609F +:10B5A00090F8B4110173032101F061FD206980F866 +:10B5B0007D5080F8B28026E0242910D1B0F87010B8 +:10B5C000B0F8AE21891A09B2002908DB90F8C4014D +:10B5D000FFF710F9206900F87D5F857613E090F899 +:10B5E0007C10242901D025290DD1B0F87010B0F8B5 +:10B5F000AE01081A00B2002805DB0120FFF7FAF8B7 +:10B60000206980F87C5020690146B0F8F62070303F +:10B6100001F0F5FE206990F8881109B1A0F8FA5000 +:10B62000F7480090F74BF84A4946504600F096FC20 +:10B63000216A11B16078FCF77CFA206901230521A9 +:10B6400090F87D20703002F021F9002803D0BDE889 +:10B65000F84F00F02ABABDE8F88F00F027BDEB499B +:10B66000C8617047E948C069002800D001207047D0 +:10B67000E64A50701162704710B50446B0F8B42124 +:10B680004388B0F8B611B0F8B8019A4205D1A38842 +:10B69000994202D1E38898420FD02388A4F8D03190 +:10B6A000A4F8D221A4F8D411A4F8D601012084F87A +:10B6B000CC01D6480079E7F713FC0221204601F0BF +:10B6C000D6FC002004F87D0F0320E07010BD401A66 +:10B6D00000B247F6FE71884201DC002801DC01203F +:10B6E00070470020704710B5012808D0022808D004 +:10B6F000042808D0082806D0FFDF204610BD01240A +:10B70000FBE70224F9E70324F7E7C04800210069BA +:10B7100020F8A41F8178491C81707047BB4800B590 +:10B72000016911F8A60F401E40B20870002800DA27 +:10B73000FFDF00BDB5482721006980F87C1000219B +:10B7400080F8A411704710B5B04C206990F8AC1186 +:10B75000042916D190F87C2001230021703002F0DA +:10B7600095F800B9FFDF206990F8AA10890703D483 +:10B77000062180F87C1004E0002180F8A21080F8F7 +:10B78000AC11206990F87E00800707D5FFF7C6FF4F +:10B79000206910F87E1F21F00201017010BD9B4945 +:10B7A00010B5096991F87C200A2A09D191F8E220A4 +:10B7B000824205D1002081F87C0081F8A20010BDF2 +:10B7C00091F87E20130706D522F0080081F87E004C +:10B7D000BDE81040A2E7FF2801D0FFDF10BDBDE8A3 +:10B7E0001040A7E710B5894C206910F8B01F41F050 +:10B7F00004010170A06902F0BEFE162806D120697E +:10B8000090F87C00202802D0262805D010BDA06921 +:10B8100002F0B5FEFEF7A8FB2169002081F87C004C +:10B8200081F8A20010BDF8B5784C01230A212069E7 +:10B8300090F87C20703002F029F838B3A06902F04B +:10B8400041FEC8B1A06902F037FE0746A06902F0C8 +:10B8500037FE0646A06902F02DFE0546A06902F0FB +:10B860002DFE01460097206933462A46303002F00B +:10B8700028FF206902F051FF2169002081F8A20011 +:10B8800081F87C00BDE8F840FEF78FBBA07840F05F +:10B890000100A070F8BD10B55C4C012300212069A7 +:10B8A00090F87D20703001F0F1FF30B1FFF72DFFEF +:10B8B0002169102081F87D0010BD20690123052138 +:10B8C00090F87D20703001F0E1FF08B1082000E021 +:10B8D0000120A07010BD70B54C4C012300212069DF +:10B8E00090F87D20703001F0D1FF012588B1A0696A +:10B8F00002F089FD2169A1F8AE01B1F87010FFF7DF +:10B90000E6FE40B12069282180F88D1080F88C5027 +:10B910008CE5A5708AE52169A06901F5D87102F06E +:10B920006DFD21690B2081F87D007FE510B5FEF7E4 +:10B9300010FFFEF70DFE354CA079400708D5A07822 +:10B9400030B9206990F87F00072801D101202070CC +:10B95000FEF72EFAA079C00609D5A07838B920697B +:10B9600090F87D100B2902D10C2180F87D10E07831 +:10B9700000070ED520690123052190F87D20703045 +:10B9800001F084FF30B10820A0702169002081F807 +:10B99000D80110BDBDE81040002000F0ABBB10B5D1 +:10B9A0001A4C216991F87D2048B3102A06D0142A38 +:10B9B00007D0152A1AD01B2A35D11AE001210B20F5 +:10B9C00019E0FAF7BFFD0C2817D32069082100F50C +:10B9D0008870FAF7BBFD28B120690421DC30FAF742 +:10B9E000B5FD00B9FFDF0121042004E000F020F8DC +:10B9F00003E001210620FEF722FF012010BD07E031 +:10BA0000FBB001005DB3010093B301000001002011 +:10BA1000212A08D191F8970038B991F8C40110B1E2 +:10BA200091F8C50108B10020E8E701211720E2E7FD +:10BA300070B5184C0025206990F8931101290AD09F +:10BA4000022925D190F8A810A9B1062180F8E610A6 +:10BA50000121022017E090F8D811002918D100F137 +:10BA6000C80300F58471002200F5CA7001F088FE59 +:10BA70000121052007E090F8B000400701D5112012 +:10BA800000E00D200121FEF7DAFE206980F89351D5 +:10BA9000CCE400000001002030B5F94C05462078C8 +:10BAA000002818BFFFDF257230BDF5490120C8719D +:10BAB00070472DE9F14FF34E3046446804F17009A8 +:10BAC00094F86510608F258F082967D001F090FFEA +:10BAD000854238BF284600F0FF08DFF8A4A3EA48F3 +:10BAE000CAF82400776897F8651097F882B03D8F00 +:10BAF000788F082956D001F07BFF854238BF284651 +:10BB0000BBF1000F1CBF001D80B2C0B297F86510DA +:10BB1000FBF700FC99F81200002847D009F1580102 +:10BB2000D94891E80E1000F5027585E80E10D9F895 +:10BB30006810C0F82112D9F86C10C0F8251200F571 +:10BB40008170FBF786FF307800280CBF01200020B1 +:10BB500080F00101CD480176D9E91412C0E9041240 +:10BB6000A0F58372DAF82410FBF7C1F994F86500A8 +:10BB7000012808BF00220CD0022808BF012208D0EB +:10BB8000042808BF032204D008281ABFFFDF0022C0 +:10BB9000022241460120FBF7C5F90DE0042101F026 +:10BBA00027FF95E7042101F023FFA6E7DAF8240038 +:10BBB000FBF74FFFFBF7E2F9009850B994F86500E6 +:10BBC00094F8661010F00C0F08BF00219620FBF7C8 +:10BBD00061FF94F8642001210020FCF718F894F824 +:10BBE0002C00012808BFFBF7E2FF02208AF80000C2 +:10BBF000FCF7D6FB002818BFFFDFBDE8F88F2DE962 +:10BC0000F04FDFF880A28BB050469AF800204068D1 +:10BC1000AAF11401059190F8751000F17005044621 +:10BC20004FF008080127AAF13406A1B3012900F05A +:10BC30000581022900F00681032918BFFFDF00F00B +:10BC40000F81306A0423017821F008010170AA797C +:10BC500008EAC202114321F004010170EA7903EA03 +:10BC60008202114321F01001017095F80590F06AED +:10BC7000F6F735FD8046FCF760FCB9F1020F00F0E5 +:10BC8000F780B9F1010F00F0F780B9F1030F00F070 +:10BC9000FF8000F002B9FFE795F80CC04FF00209F1 +:10BCA0004FF0000BBCF1240F1CBF6B7B242B08D082 +:10BCB000BCF11F0F18BFBCF1200F29D0222B4CD094 +:10BCC00076E094F8641092B190F8B001002873D037 +:10BCD000082918BF042968D0082818BF042864D090 +:10BCE000012918BF012852D04FF0020164E090F8FA +:10BCF0001201002860D0082918BF042955D008284F +:10BD000018BF042851D0012918BF01283FD0EBE704 +:10BD1000222B22D0002A4BD090F8C60194F8641050 +:10BD200010F0040F18BF40460CD0082918BF042992 +:10BD30003BD0082818BF042837D0012918BF012894 +:10BD400025D0D1E710F0010F18BF3846EDD110F023 +:10BD5000020F18BF4846E8D12EE04AB390F8C6213A +:10BD600090F85D0094F8641002EA000010F0040FEF +:10BD700018BF40460ED0082918BF042915D008283E +:10BD800018BF042811D0012918BF0128ACD14FF0E9 +:10BD9000010111E010F0010F18BF3846EBD110F08F +:10BDA000020F18BF4846E6D106E04FF0080103E055 +:10BDB00094F864100429F8D0A08E11F00C0F18BF6D +:10BDC0004FF4296001F014FE218E814238BF0846ED +:10BDD000ADF80400A4F84C000598FCF78DFB60B1A9 +:10BDE000B289316A42F48062B28172694FF4806034 +:10BDF000904703206871EF7023E709AA01A9F06A50 +:10BE0000F6F7A7FB306210B195F8371021B105980D +:10BE1000FCF746FB6F7114E79DF8241031B9A0F8C8 +:10BE200000B080F802B0012102F074FABDF80410ED +:10BE3000306A02F0A6FB85F8059002E70598FCF74A +:10BE40002FFBFEE6B4F84C00ADF8040009AA01A9E6 +:10BE5000F06AF6F77EFB3062002808BFFFDFF0E6ED +:10BE60000598FCF749FB002808BFFFDFE9E600BFA3 +:10BE700030EA080011D10EE030EA08000DD10AE0E6 +:10BE80002401002058010020300D0020380F002030 +:10BE9000B8F1000F01D0012100E00021306A0278E2 +:10BEA00042EA01110170697C00291CBF69790129EE +:10BEB0003BD005F15801FD4891E80E1000F50278DD +:10BEC00088E80E10A96EC0F82112E96EC0F825129C +:10BED00000F58170FBF7BDFD9AF8000000280CBF4B +:10BEE00001210021F2480176D5E91212C0E90412BD +:10BEF000A0F58371326AFAF7FAFF94F8640001281A +:10BF000008BF00220CD0022808BF012208D0042854 +:10BF100008BF032204D008281ABFFFDF0022022234 +:10BF2000FB210020FAF7FEFF03E0FBF792FDFBF791 +:10BF300025F8012194F865200846FBF768FE377163 +:10BF4000306A018831828078B0743770FCF731FA3A +:10BF5000002818BFFFDF0BB0BDE8F08F2DE9F043DC +:10BF6000D44D87B081462878DDF838801E461746C4 +:10BF70000C4628B9002F1CBF002EB8F1000F00D1CD +:10BF8000FFDFC5F81C80C5E90D94C5E905764FF0C3 +:10BF90000000E871A871E870A87028716871C64E39 +:10BFA000A881E881307804F170072088F7F71BF941 +:10BFB000E8622088F7F705F92863FBF7CFF994F9D1 +:10BFC0006700FBF79BFA04F11200FBF719FD04F17F +:10BFD0000E00FBF799FA307800280CBF03200120EF +:10BFE000FBF734FDB54890E80E108DE80E10D0E94F +:10BFF0000410CDE90410307800280CBFB048B148D7 +:10C0000004906846FBF710FDF87EFBF785FAFBF716 +:10C0100017FD94F86F0078B9A06E68B1B88C3988B4 +:10C02000884209D1B4F86C1001220844B88494F80D +:10C030006E00A16EF8F7B9FE3078002804BFFF202B +:10C0400094F8644012D094F86510BF7C258F608FFF +:10C0500008291FD001F0CCFC854238BF2846002FAC +:10C060001CBF001D80B2C0B294F865402146FBF7AA +:10C0700051F93078214688B10120FBF714FB706834 +:10C08000D0F80001FBF7E8FC0120FFF712FD07B034 +:10C09000BDE8F083042101F0ABFCDDE70020FBF7F5 +:10C0A00002FBFFF7ACFD07B0BDE8F083824800B5A6 +:10C0B00001783438007819B1022818BFFFDF00BDBD +:10C0C000012818BFFFDF00BD7A4810B500780228AC +:10C0D00018BFFFDFBDE8104000F03ABA00F038BAF0 +:10C0E0007448007970477348C078704771490120DF +:10C0F000487170472DE9F04706006F486D4D406864 +:10C1000000F17004686A90F8019018BF012E03D105 +:10C11000296B09F013F86870687800274FF0010860 +:10C12000A0B101283CD0022860D003281CBFFFDF4B +:10C13000BDE8F087012E08BFBDE8F087286BF6F751 +:10C14000C3FC287ABDE8F047E6F7CABE012E14D03A +:10C15000A86A002808BFFFDF6889C21CD5E909105A +:10C16000F2F763F9A86A686201224946286BF6F77C +:10C1700027FB022E08BFBDE8F087D4E91401401C5C +:10C1800041F10001C4E91401E079012801D1E7710E +:10C1900001E084F80780287ABDE8F047E6F7A0BE02 +:10C1A000012E14D0A86A002808BFFFDF6889C21CCE +:10C1B000D5E90910F2F739F9A86A68620022494600 +:10C1C000286BF6F7FDFA022E08BFBDE8F087D4E928 +:10C1D0001410491C40F10000C4E91410E079012852 +:10C1E0000CBFE77184F80780BDE8F087012E06D008 +:10C1F000286BF6F769FC022E08BFBDE8F087D4E98A +:10C200001410491C40F10000C4E91410E079012821 +:10C21000BFD1BCE770B5284E3046A6F13404406863 +:10C2200000F170052078012818BFFFDFA87868B1F9 +:10C230000021A970A289042042F00402A28162694F +:10C240009047307800281CBF01202871216A032202 +:10C25000087832EA000009D1A28912F4806F05D073 +:10C2600042F00202A281626902209047012100206F +:10C2700000F098F918B1BDE8704000F069B9BDE868 +:10C280007040002015E42DE9F14F0B4E0027304699 +:10C29000A6F134054068317800F1700A2878B84674 +:10C2A000022818BFFFDFE8890EE00000300D0020F3 +:10C2B000380F00202401002058010020F463020000 +:10C2C0007B2302004199010040F40070E88171680D +:10C2D0003078FF2091F86410FBF71CF800980028D4 +:10C2E0009AF8120000F0FC80FAF76DFEFAF75BFE98 +:10C2F0004FF0010990B99AF8120078B1686A417854 +:10C3000061B100789AF80710C0F3C000884205D1E7 +:10C3100085F80290BDE8F84F00F01AB9686A4178D4 +:10C320006981002908BFAF6203D0286BF6F702FAD3 +:10C33000A862E88940F02000E881EF7030787068EA +:10C3400000F17004834690F82C0001281AD1FBF705 +:10C3500024FC2146584601F054FA98B13078002860 +:10C3600070680CBF00F59A7000F50270BBF8001001 +:10C370004180217A0171617A417180F80090287AB8 +:10C38000E6F7AEFD686A9AF806100078C0F3800000 +:10C3900088423BD03078706800F1700490F87500E6 +:10C3A00000282FD002284BD06771307800281CBF9E +:10C3B0002079002809D02771AA89394642F0100255 +:10C3C000AA816A694FF010009047E078A0B1E77049 +:10C3D000FCF7A1F8002808BFFFDF0820AA89002188 +:10C3E00042F00802AA816A699047D4E91202411C0E +:10C3F00042F10000C4E91210A07901280CBFA77116 +:10C4000084F80690E88940F48070E881696A9AF8B7 +:10C4100007300878C0F3C0029A424ED13278726871 +:10C4200000F0030002F17004012818BF02282DD08B +:10C4300003281CBFA87940F0040012D0A8713CE08A +:10C44000E86AF6F7B2F8002808BFFFDFD4E9120265 +:10C45000411C42F10000C4E91210287AE6F740FDC1 +:10C46000A2E784F80290EA89484642F40062EA8131 +:10C47000AA8942F00102AA816A699047E0790128FD +:10C4800001D1E77119E084F8079016E0487818B3F5 +:10C49000E98941F40061E981A96A71B1FB2884BF8F +:10C4A000A87940F01000C9D8E879002808BFC8462C +:10C4B00003D080206A69002190470120009900F094 +:10C4C00071F8B0B1B8F1000F1CBF0020FFF712FEE9 +:10C4D000BDE8F84F00F03CB8E0790128D3D1D0E7AF +:10C4E000002818BFFAF7A9FDE88940F04000E8816C +:10C4F000E3E7B8F1000F1CBF0120FFF7FBFDFFF7DA +:10C500007EFBB8F1000F08BFBDE8F88F0220BDE840 +:10C51000F84FEFE570B50D460646424841490078B0 +:10C520004C6850B1FAF7FFFD034694F864202946A1 +:10C530003046BDE87040FDF795BAFAF7F4FD0346C2 +:10C5400094F8642029463046BDE8704005F019BFD4 +:10C55000344910B54C68FBF7FFFAFBF7DEFAFBF73E +:10C56000A5F9FBF753FAFAF709FD94F82C00012816 +:10C5700008BFFBF712FB94F86F0038B9A06E28B122 +:10C58000002294F86E001146F8F70FFC264C0021AB +:10C590006269E0899047E269A179A078904700201C +:10C5A000207010BD70B5204C0546002908BF012D34 +:10C5B00006D1E07800F10100C0B2E07001282ED869 +:10C5C000A16928468847002829D06179174839B1E0 +:10C5D000012D01BF41780029017811F0100F1ED004 +:10C5E000A179E1B90F490978002908BF012D01D0CF +:10C5F00091B18DB90E49097811F0100F04BF007880 +:10C6000010F0100F0BD0A08948B9A06A20B960893A +:10C6100010B111F0100F02D04FF0000070BD4FF0BC +:10C62000010070BD5801002024010020300D0020C1 +:10C6300034010020FE498A78824286BF084490F87F +:10C6400043010020704710B540F2D3120021F84892 +:10C65000F1F715FF0822FF21F648F1F710FFF64821 +:10C660000021417081704FF46171818010BD2DE90E +:10C67000F0410E46054600F0AEFBED4C102816D0FA +:10C6800004EBC00191F85A0110F0010F1CBF01200A +:10C69000BDE8F081607808283CBF012081F85A018C +:10C6A0001CD26078401C60700120BDE8F081607889 +:10C6B000082813D222780127501C207004EBC208EE +:10C6C0003068C8F85401B088A8F85801102A28BF6B +:10C6D000FFDF88F8535188F85A71E2E70020BDE87F +:10C6E000F081D54988707047D3488078704770B41E +:10C6F000CF4800250178491E4BB2002B47DB00BF15 +:10C7000000EBC30191F85A1111F0010F3BD04278B0 +:10C71000D9B2521E427000EBC10282F85A5190F811 +:10C7200002C00022BCF1000F0BD9841894F80361F9 +:10C730008E4202D1102A26D103E0521CD2B2944577 +:10C74000F3D80278521ED2B202708A421BD000EB9C +:10C75000C20200EBC10CD2F85341CCF85341D2F8DD +:10C760005721CCF85721847890F800C00022002C83 +:10C7700009D9861896F8036166450CD1102A1CBFAA +:10C78000024482F80311591E4BB2002BB8DAAA48B2 +:10C79000857070BC7047521CD2B29442E9D8F2E75F +:10C7A000A3498A78824286BF01EB0010C01C00209A +:10C7B00070472DE9F04101261F469046344600257A +:10C7C00000F009FB10282AD099494FF0000C01EB2A +:10C7D000C00292F85A2102F001058A78002A1ED977 +:10C7E00001EB0C0393F8033183421FD1BCF1100F0E +:10C7F00015D0002F18BF87F800C0887860450ED983 +:10C8000001EB0C1010F1030F09D001EB0C0090F8B4 +:10C810004B4190F83B0101280CBF0126002648EA55 +:10C82000050046EA04010840BDE8F0810CF101036F +:10C8300003F0FF0C6245D3D8F1E72DE9F05F1F4606 +:10C8400090460E46814600F0C6FA794D04461028FF +:10C850003CD00146AB780020002B0ED92A1892F864 +:10C8600003218A4205D110281CBF1220BDE8F09F89 +:10C8700003E0401CC0B28342F0D8082B3FD2102CFA +:10C8800027D0AE781022701CA87005EB061909F1AC +:10C890000300414600F05AFF09F183001022394697 +:10C8A00000F054FF1021384600F02DFF35441021D0 +:10C8B00085F84301404600F026FF85F84B0185F8D6 +:10C8C0000341002085F83B01BDE8F09FAB78082BC1 +:10C8D00015D22C78CA46601C287005EBC409306854 +:10C8E000C9F85401B0884FF0000BA9F85801102C7A +:10C8F00028BFFFDF89F853A189F85AB1C1E70720A3 +:10C90000BDE8F09F70B44A488178491E4BB2002BB5 +:10C91000BCBF70BC704700BF817803F0FF0C491E9C +:10C92000CAB2827050FA83F191F8031194453ED057 +:10C9300000EB021500EB0C14D5F80360C4F803609B +:10C94000D5F80760C4F80760D5F80B60C4F80B6031 +:10C95000D5F80F60C4F80F60D5F88360C4F8836021 +:10C96000D5F88760C4F88760D5F88B60C4F88B6011 +:10C97000D5F88F50C4F88F50851800EB0C0402EBEB +:10C98000420295F803610CEB4C0C00EB420284F878 +:10C99000036100EB4C0CD2F80B61CCF80B61B2F8E0 +:10C9A0000F21ACF80F2195F83B2184F83B2100EBD7 +:10C9B000C10292F85A2112F0010F33D190F802C04F +:10C9C0000022BCF1000F0BD9841894F803518D425A +:10C9D00002D1102A26D103E0521CD2B29445F3D8DA +:10C9E0000278521ED2B202708A421BD000EBC20201 +:10C9F00000EBC10CD2F85341CCF85341D2F8572187 +:10CA0000CCF85721847890F800C00022002C09D976 +:10CA1000851895F80351654512D1102A1CBF0244B0 +:10CA200082F80311591E4BB2002BBFF675AF05E01B +:10CA3000600F00206C0100206001002070BC704776 +:10CA4000521CD2B29442E3D8ECE7FE4948707047DA +:10CA5000FC484078704738B14AF2B811884203D890 +:10CA6000F84988800120704700207047F548808889 +:10CA7000704710B500F0AFF9102814D0F24A014603 +:10CA8000002092F802C0BCF1000F0CD9131893F8E3 +:10CA900003318B4203D1102818BF10BD03E0401CA6 +:10CAA000C0B28445F2D8082010BDE7498A78824296 +:10CAB00086BF01EB0010833000207047E24B93F8F3 +:10CAC00002C084459CBF00207047184490F80301C1 +:10CAD00003EBC00090F853310B70D0F85411116083 +:10CAE000B0F85801908001207047D74A114491F85E +:10CAF0000321D4490A700268C1F806208088488161 +:10CB0000704770B516460C460546FBF73BF8FAF73A +:10CB10004AF9CC48407868B1CB48817851B12A199C +:10CB2000002E0CBF8330C01CFAF717F9FAF75EF934 +:10CB3000012070BD002070BD10B5FAF785F90028FE +:10CB400004BFFF2010BDBDE81040FAF7A3B9FAF703 +:10CB50007BB9BD498A7882429CBF00207047084457 +:10CB600090F8030101EBC00090F85A0100F00100B9 +:10CB700070472DE9F047B44E00273D463078002835 +:10CB80008CBFDFF8C882BDE8F0870024B0780028A9 +:10CB900008D9311991F80321AA4204D0611CCCB202 +:10CBA000A042F6D81024A04286BF06EB0410C01C99 +:10CBB000002006EBC50999F85A1111F0010F16D0A3 +:10CBC00050B1102C04D0311991F83B11012903D038 +:10CBD000102100F098FD50B108F8074038467B1C42 +:10CBE00099F8532109F5AA71DFB2FAF736FC681CEF +:10CBF000C5B23078A842C8D8BDE8F0872DE9F04129 +:10CC0000914C00263546A07800288CBF8F4FBDE898 +:10CC1000F0816119C0B291F80381A84286BF04EB8C +:10CC20000510C01C002091F83B11012903D01021F0 +:10CC300000F069FD58B104EBC800BD5590F85321D0 +:10CC400000F5AA713046731CDEB2FAF706FC681CC8 +:10CC5000C5B2A078A842DCD8BDE8F08101447A488A +:10CC600010B500EB02100A4601218330FAF775F87F +:10CC7000BDE81040FAF7BAB80A46724910B54978CB +:10CC800041B1714B997829B10244D81CFAF765F883 +:10CC9000012010BD002010BD6B4A01EB410102EBE9 +:10CCA00041010268C1F80B218088A1F80F0170478B +:10CCB0002DE9F041644D07460024A878002898BF6C +:10CCC000BDE8F081C0B2A04217D905EB041010F105 +:10CCD000830612D01021304600F015FD68B904EB30 +:10CCE000440005EB400808F20B113A463046FBF7CA +:10CCF000A3FCB8F80F01A8F80F01601CC4B2A87813 +:10CD0000A042DFD8BDE8F08101461022504800F073 +:10CD10001DBD4F4870474C498A78824203D90A1892 +:10CD200092F843210AB10020704700EB400001EB6C +:10CD3000400000F20B10704743498A78824206D9BE +:10CD4000084490F83B01002804BF012070470020F0 +:10CD500070472DE9F0410E4607461546062130463C +:10CD600000F0D1FC384C98B1A17871B104F59D70F8 +:10CD700011F0010F18BF00F8015FA178490804D035 +:10CD8000457000F8025F491EFAD10120BDE8F0812C +:10CD90003846314600F01FF8102819D0A37800213A +:10CDA000002B15D9621892F8032182420BD1102969 +:10CDB00018BF08290CD004EB010080F83B514FF05C +:10CDC0000100BDE8F08101F10101C9B28B42E9D84F +:10CDD0000020BDE8F0812DE9F0411B4D06460024FE +:10CDE00028780F46002811D905EBC40090F853119C +:10CDF000B14206D10622394600F5AA70F1F7E8FAE9 +:10CE000038B1601CC4B22878A042EDD81020BDE82B +:10CE1000F0812046BDE8F0810B4910B44A7801EB5F +:10CE2000C003521E4A70002283F85A2191F802C0B2 +:10CE3000BCF1000F16D98B1893F8034184420DD131 +:10CE4000102A07E060010020600F00206C01002024 +:10CE5000331100201CBF10BC704703E0521CD2B23B +:10CE60009445E8D80A78521ED2B20A7082421BD08A +:10CE700001EBC20201EBC003D2F853C1C3F853C1A6 +:10CE8000D2F85721C3F857218C7891F800C00022BE +:10CE9000002C09D98B1893F80331634506D1102A69 +:10CEA0001CBF114481F8030110BC7047521CD2B260 +:10CEB0009442EFD810BC704770B449490D188A7875 +:10CEC000521ED3B28B7095F8032198423DD001EBEE +:10CED000001401EB031C00EB4000DCF80360C4F815 +:10CEE0000360DCF80760C4F80760DCF80B60C4F886 +:10CEF0000B60DCF80F60C4F80F60DCF88360C4F8E6 +:10CF00008360DCF88760C4F88760DCF88B60C4F865 +:10CF10008B60DCF88FC0C4F88FC001EB030C03EB0F +:10CF200043039CF8034101EB430385F8034101EB04 +:10CF30004000D3F80B41C0F80B41B3F80F31A0F813 +:10CF40000F319CF83B0185F83B0101EBC20090F8E2 +:10CF50005A0110F0010F1CBF70BC704700208C7884 +:10CF6000002C0DD90B1893F803C1944504D1102857 +:10CF70001CBF70BC704703E0401CC0B28442F1D8B3 +:10CF80000878401EC0B20870904204BF70BC704761 +:10CF900001EBC20301EBC000D0F853C1C3F853C189 +:10CFA000D0F85701C3F857018C780B780020002C7B +:10CFB0009CBF70BC704700BF01EB000C9CF803C124 +:10CFC0009C4506D110281CBF084480F8032170BC82 +:10CFD0007047401CC0B28442EED870BC704700005D +:10CFE000600F002010B50A7B02F01F020A730022B6 +:10CFF00042768B1893F808C00CF001034FEA5C0CE2 +:10D000000CF0010423444FEA5C0C0CF001042344AF +:10D010004FEA5C0C0CF001041C444FEA5C0303F083 +:10D02000010CA4445B0803F00104A4445B0803F072 +:10D030000104A4440CEB530300EB020C521C8CF8CB +:10D04000143090F819C0D2B263444376052AD0D385 +:10D05000D8B2252888BFFFDF10BD0023C3834284D8 +:10D0600001EBC202521EB2FBF1F10184704770B5B0 +:10D070000446002569B14FF4FA42012978D002290B +:10D0800075D0032918BF70BD0146BDE870407030EF +:10D09000A8E704F17006802200213046F1F7EFF98D +:10D0A000B571F57135737573F57335747571B57642 +:10D0B000F576212086F84000492086F84100FE20C0 +:10D0C00086F874002688702200212046F1F7D7F9EF +:10D0D0002680012684F8646084F86560282084F83E +:10D0E0006600002104F1300001F0F3FA1B22A4F8DD +:10D0F0004E20A4F85020A4F85220A4F854204FF455 +:10D10000A470A4F85600A4F8580066734FF4486061 +:10D110006080A4F8F050A4F8F250A4F8F450A4F8F9 +:10D12000F650A4F8F850A4F8FA5084F8FD5084F8AA +:10D13000FF50A4F8065184F80451A4F81851A4F83B +:10D140001A5184F8BA5184F8BB5184F8C45184F858 +:10D15000C55184F8885184F8905184F8935184F82B +:10D16000AC51C4F8A451C4F8A85170BD00E041E02E +:10D17000A4F8065184F8FE506088FE490144B1FBD2 +:10D18000F0F1A4F890104BF68031A4F89210E388E7 +:10D19000A4F89850B4F89CC0DB000CFB00FCB3FB77 +:10D1A000F0F39CFBF0FC5B1CA4F89CC09BB203FB5F +:10D1B00000FC04F17001A4F89A30BCF5C84FC4BF5C +:10D1C0005B1E4B85B2FBF0F2521C0A8600F58022F2 +:10D1D00002F5EE32531EB3FBF0F20A84CB8B03FB55 +:10D1E00000F2B2FBF0F0C883214604F17000BDE804 +:10D1F0007040F7E6B4F8B411B4F8B831B4F802C02E +:10D2000004F17000A4F89850B4F89C40DB0004FBD3 +:10D210000CF4B3FBF1F394FBF1F45B1C84859BB23B +:10D2200003FB01F44385B4F5C84FC4BF5B1E4385BF +:10D23000B2FBF1F2521C0286428C01EBC202521E7A +:10D24000B2FBF1F20284C28B02FB0CF2B2FBF1F1F1 +:10D25000C18370BD70B50446002569B14FF4FA4230 +:10D2600001295CD002297CD0032918BF70BD01467A +:10D27000BDE870407030B5E604F1700680220021F0 +:10D280003046F1F7FCF8B571F57135737573F573C8 +:10D2900035747571B576F576212086F84000492001 +:10D2A00086F84100FE2086F874002688702200214E +:10D2B0002046F1F7E4F82680012684F8646084F8BB +:10D2C0006560282084F86600002104F1300001F038 +:10D2D00000FA1B22A4F84E20A4F85020A4F85220F3 +:10D2E000A4F854204FF4A470A4F85600A4F85800F1 +:10D2F0006673A4F8F850202084F8FA0084F8F050FF +:10D30000C4F8F45084F8245184F8255184F82E513F +:10D3100084F82F5184F8145184F8205170BD60882E +:10D3200094490144B1FBF0F1A4F890104BF6803120 +:10D33000A4F89210E388A4F89850B4F89CC0DB00DD +:10D340000CFB00FCB3FBF0F39CFBF0FC5B1CA4F8B3 +:10D350009CC09BB204F17001A4F89A3003FB00FC5E +:10D3600000E01CE0BCF5C84FC4BF5B1E4B85B2FBA0 +:10D37000F0F2521C0A8600F5802202F5EE32531EAE +:10D38000B3FBF0F20A84CB8B03FB00F2B2FBF0F0AC +:10D39000C883214604F17000BDE8704022E6D4F84D +:10D3A0001831B4F802C004F170005989DB89A4F87F +:10D3B0009850B4F89C40DB0004FB0CF4B3FBF1F391 +:10D3C00094FBF1F45B1C84859BB203FB01F4438561 +:10D3D000B4F5C84FC4BF5B1E4385B2FBF1F2521CCB +:10D3E0000286428C01EBC202521EB2FBF1F20284B1 +:10D3F000C28B02FB0CF2B2FBF1F1C18370BD2DE9CF +:10D40000F003447E0CB1252C03D9BDE8F0031220B3 +:10D410007047002A02BF0020BDE8F003704791F872 +:10D420000DC01F260123544D4FF00008BCF1000F22 +:10D4300074D0BCF1010F1EBF1F20BDE8F003704780 +:10D44000B0F800C00A7C8F7B91F80F907A404F7C37 +:10D4500087EA090742EA072282EA0C0C5FF000071C +:10D460000CF0FF094FEA1C2C99FAA9F99CFAACFCC4 +:10D470004FEA19694FEA1C6C49EA0C2C0CEB0C1CA6 +:10D480007F1C9444FFB21FFA8CFC032FE8D38CEA74 +:10D49000020C394F0022ECFB057212096FF02405D3 +:10D4A00002FB05C2D2B201EBD207827602F0070579 +:10D4B0003F7A03FA05F52F4218BFC2767ED104FBEE +:10D4C0000CF2120C521CD2B25FF0000400EB040C00 +:10D4D0009CF814C094453CBFA2EB0C02D2B212D30C +:10D4E0000D194FF0000C2D7A03FA0CF73D421CBFCA +:10D4F000521ED2B2002A6FD00CF1010C0CF0FF0CBE +:10D50000BCF1080FF0D304F1010C0CF0FF04052C62 +:10D51000DCD33046BDE8F0037047FFE790F81AC04F +:10D520000C7E474604FB02C2134C4FF0000CE2FB9A +:10D53000054C4FEA1C1C6FF024040CFB0422D2B2F1 +:10D5400001EBD204827602F0070C247A03FA0CFC79 +:10D5500014EA0C0F1FBFC2764046BDE8F0037047C7 +:10D5600090F819C0B2FBFCF40CFB1422521CD2B28E +:10D57000002403E0FFDB050053E4B36E00EB040C72 +:10D580009CF814C094453CBFA2EB0C02D2B212D35B +:10D590000D194FF0000C2D7A03FA0CF815EA080F5C +:10D5A0001CBF521ED2B27AB10CF1010C0CF0FF0C70 +:10D5B000BCF1080FF0D304F1010C00E00FE00CF017 +:10D5C000FF04052CD5D3A4E70CEBC401C176384683 +:10D5D000BDE8F0037047FFE70CEBC401C17640469D +:10D5E000BDE8F0037047FE4A016812681140FD4A29 +:10D5F000126811430160704730B4FB49F84B0024B6 +:10D600004FF0010C0A78521CD2B20A70202A08BFCF +:10D610000C700D781A680CFA05F52A42F2D00978D8 +:10D6200002680CFA01F15140016030BC704770B4DF +:10D630006FF01F02010C02EA90251F23A1F5AA40FA +:10D6400054381CBFA1F5AA40B0F1550009D0A1F58E +:10D650002850AA381EBFA1F52A40B0F1AA00012027 +:10D6600000D100204FF0000C624664468CEA0106AF +:10D67000F6431643B6F1FF3F11D005F001064FEA1D +:10D680005C0C4CEAC63C03F0010652086D085B08CE +:10D69000641C42EAC632162CE8D370BC704770BCDA +:10D6A00000207047017931F01F0113BF00200022D4 +:10D6B0001146704710B4435C491C03F0010C5B0831 +:10D6C00003F00104A4445B0803F00104A4445B08D4 +:10D6D00003F00104A4445B0803F00104A4445B08C4 +:10D6E00003F001045B08A44403F00104A4440CEB20 +:10D6F00053031A44D2B20529DDDB012A8CBF012075 +:10D70000002010BC704730B40022A1F1010CBCF124 +:10D71000000F11DD431E11F0010F08BF13F8012F98 +:10D720005C785FEA6C0C07D013F8025F22435C78E8 +:10D730002A43BCF1010CF7D1491E5CBF405C024397 +:10D74000002A0CBF0120002030BC7047002A08BF0F +:10D7500070471144401E12F0010F03D011F8013D33 +:10D7600000F8013F520808BF704700BF11F8013CA4 +:10D77000437011F8023D00F8023F521EF6D1704787 +:10D7800070B58CB000F110041D4616460DF1FF3C3B +:10D790005FF0080014F8012C8CF8012014F8022D19 +:10D7A0000CF8022F401EF5D101F1100C6C460DF162 +:10D7B0000F0108201CF8012C4A701CF8022D01F8FA +:10D7C000022F401EF6D1204606F0EEFE7EB16A1E04 +:10D7D00004F130005FF0080110F8013C537010F8BC +:10D7E000023D02F8023F491EF6D10CB070BD089808 +:10D7F0002860099868600A98A8600B98E8600CB0E7 +:10D8000070BD38B505460C466846FAF7DFF90028C2 +:10D8100008BF38BD9DF900202272E07E607294F945 +:10D820000A100020511A48BF494295F82D308B420A +:10D83000C8BF38BDFF2B08BF38BDE17A491CC9B24B +:10D84000E17295F82E30994203D8A17A7F2918BF4A +:10D8500038BDA2720020E072012038BD0C2818BF2C +:10D860000B2810D00D2818BF1F280CD0202818BF57 +:10D87000212808D0222818BF232804D024281EBF1E +:10D880002628002070474FF0010070470C2963D212 +:10D89000DFE801F006090E13161B323C415C484ECE +:10D8A000002A5BD058E0072A18BF082A56D053E058 +:10D8B0000C2A18BF0B2A51D04EE00D2A4ED04BE057 +:10D8C000A2F10F000C2849D946E023B1A2F11000C3 +:10D8D0000B2843D940E0122A18BF112A3ED090F8F5 +:10D8E000380020B1122A37D31A2A37D934E0162A41 +:10D8F00032D31A2A32D92FE0A2F10F0103292DD9F0 +:10D9000090F8380008B31B2A28D925E0002B08BF5F +:10D91000042A21D122E013B1062A1FD01CE0012ADB +:10D920001AD11BE01C2A1CBF1D2A1E2A16D013E088 +:10D930001F2A18BF202A11D0212A18BF222A0DD051 +:10D94000232A1CBF242A262A08D005E013B10E2A58 +:10D9500004D001E0052A01D0002070470120704763 +:10D960002DE9F0410D4604468668F7F707FE58B9E1 +:10D97000F7F75CFC40F23571F7F73FF9A0602046FD +:10D98000F7F7FCFD0028F3D095B13046A168F8F711 +:10D990003CF900280CDD2844401EB0FBF5F707FBDE +:10D9A00005F13046F7F729F9A0603846BDE8F08167 +:10D9B0000020BDE8F08170B50446904228BF70BDDC +:10D9C000101B642812D325188D4206D80421F8F7BD +:10D9D00050F900281CBF284670BD204670BD0000CD +:10D9E0000C64020010640200740100206420EAE765 +:10D9F00011F00C0F13D001F0040100290DBF4022DB +:10DA0000102296214FF4167101F5BC71A0EB0103B1 +:10DA100088428CBF93FBF2F0002080B2704702294D +:10DA200019BF6FF00D0101EBD0006FF00E0101EB9B +:10DA30009000F2E7084418449830002A14BF0421EB +:10DA400000210844704710B4002A14BF4FF4296223 +:10DA50004FF4A472002B19BF4FF429634FF0080C48 +:10DA60004FF4A4734FF0010C00280CBF01240024D4 +:10DA700091F866001CF00C0F08BF0020D118084474 +:10DA80009830002C14BF04210021084410BC7047BA +:10DA900000280CBF0123002391F86600002BA0F69C +:10DAA000482000F5005018BF04231844496A8142F9 +:10DAB0002CBF0120002012F00C0118BF012131EA17 +:10DAC000000014BF00200120704710B413680B66DB +:10DAD000137813F00C0318BF0123527812F00C02D4 +:10DAE00018BF012253EA020C04BF10BC7047002B80 +:10DAF0000CBF4FF4A4734FF42963002A19BF4FF4ED +:10DB000029624FF0080C4FF4A4724FF0010C00286A +:10DB10000CBF0124002491F866001CF00C0F08BF14 +:10DB200000201A4410449830002C14BF0422002214 +:10DB300010444A6A824224BF10BC704791F86000CA +:10DB40004FF0030230F00C0381F8603091F861006F +:10DB500020F00C0081F8610008BF81F860200028E7 +:10DB600008BF81F8612010BC704710F0010F1CBF86 +:10DB70000120704710F0020F1CBF0220704710F008 +:10DB8000040018BF082070472DE9F04704461746E7 +:10DB900089464FF00108084600F0C5FC0546484696 +:10DBA00000F0C5FC10F0010F18BF012625D000BF02 +:10DBB00015F0010F18BF01232AD000BF56EA030158 +:10DBC00008BF4FF0000810F0070F08BF002615F03F +:10DBD000070F08BF002394F86400B0420CBF002078 +:10DBE0003046387094F86510994208BF00237B7066 +:10DBF000002808BF002B25D115E010F0020F18BF38 +:10DC00000226D5D110F0040F14BF08260026CFE756 +:10DC100015F0020F18BF0223D0D115F0040F14BF66 +:10DC200008230023CAE7484600F087FCB4F87010C8 +:10DC3000401A00B247F6FE71884201DC002801DC80 +:10DC40004FF0000816B1082E0CD018E094F86400CC +:10DC5000012818BF022812D004281EBF0828FFDFA1 +:10DC6000032D0CD194F8C40148B1B4F8C8010128BF +:10DC700094F8640006D0082801D008203870404687 +:10DC8000BDE8F087042818BF0420F7D1F5E7012884 +:10DC900014BF0228704710F00C0018BF0420704712 +:10DCA00038B4CBB2C1F3072CC1B2C0F30724012BA7 +:10DCB00007D0022B09D0042B08BFBCF1040F2DD0D4 +:10DCC00006E0BCF1010F03D128E0BCF1020F25D022 +:10DCD000012906D0022907D0042908BF042C1DD031 +:10DCE00004E0012C02D119E0022C17D001EA0C014A +:10DCF00061F3070204EA030161F30F22D1B211F0CC +:10DD0000020F18BF022310D0C2F307218DF8003094 +:10DD100011F0020F18BF02211BD111E0214003EACC +:10DD20000C03194061F30702E6E711F0010F18BF79 +:10DD30000123E9D111F0040F14BF08230023E3E706 +:10DD400011F0010F18BF012103D111F0040118BF18 +:10DD500008218DF80110082B01BF000C01280420B8 +:10DD60008DF80000BDF8000038BC70474FF0000C83 +:10DD7000082902D0042909D011E001280FD104207C +:10DD8000907082F803C0138001207047012806D0EC +:10DD90000820907082F803C0138001207047002093 +:10DDA0007047162A10D12A220C2818BF0D280FD030 +:10DDB0004FF0230C1F280DD031B10878012818BF6F +:10DDC000002805D0162805D0002070470120704794 +:10DDD0001A70FBE783F800C0F8E7012908D0022990 +:10DDE0000BD0042912BF082940F6A660704707E04F +:10DDF000002804BF40F2E240704740F6C41070476C +:10DE000000B5FFDF40F2E24000BD000040787047FF +:10DE100030B50546007801F00F0220F00F001043E6 +:10DE20002870092912D2DFE801F005070507050966 +:10DE3000050B0F0006240BE00C2409E0222407E068 +:10DE400001240020E87003E00E2401E00024FFDF3D +:10DE50006C7030BD007800F00F0070470A68C0F8A1 +:10DE600003208988A0F807107047D0F803200A60C3 +:10DE7000B0F80700888070470A68C0F809208988D0 +:10DE8000A0F80D107047D0F809200A60B0F80D0016 +:10DE9000888070470278402322F0400203EA811113 +:10DEA0001143017070470078C0F38010704702780A +:10DEB000802322F0800203EAC111114301707047F0 +:10DEC0000078C009704770B514460E4605461F2AF3 +:10DED00088BFFFDF2246314605F10900F0F7A5FAB9 +:10DEE000A01D687070BD70B544780E460546062CBE +:10DEF00038BFFFDFA01F84B21F2C88BF1F2422461B +:10DF000005F109013046F0F790FA204670BD70B572 +:10DF100014460E4605461F2A88BFFFDF22463146BB +:10DF200005F10900F0F781FAA01D687070BD09685D +:10DF3000C0F80F1070470A88A0F81320897841753F +:10DF4000704790F8242001F01F0122F01F021143B6 +:10DF500080F824107047072988BF072190F82420F3 +:10DF6000E02322F0E00203EA4111114380F824107B +:10DF700070471F3008F097B810B5044600F009FB51 +:10DF8000002818BF204410BDC17811F03F0F1BBFFF +:10DF9000027912F0010F0022012211F03F0F1BBF86 +:10DFA000037913F0020F002301231A4402EB42020B +:10DFB000530011F03F0F1BBF027912F0080F00222F +:10DFC000012203EB420311F03F0F1BBF027912F055 +:10DFD000040F00220122134411F03F0F1BBF0279EE +:10DFE00012F0200F0022012202EBC20203EB4203D7 +:10DFF00011F03F0F1BBF027912F0100F0022012217 +:10E0000002EB42021A4411F03F0F1BBF007910F0DF +:10E01000400F00200120104410F0FF0014BF012128 +:10E0200000210844C0B2704770B50278417802F010 +:10E030000F02082A4DD2DFE802F004080B4C4C4CCA +:10E040000F14881F1F280AD943E00C2907D040E08D +:10E05000881F1F2803D93CE0881F1F2839D80120BA +:10E0600070BD4A1EFE2A34D88446C0780025820935 +:10E07000032A09D000F03F04601C884204D860469F +:10E08000FFF782FFA04201D9284670BD9CF803002B +:10E090004FF0010610F03F0F1EBF1CF10400007886 +:10E0A00010F0100F13D064460421604600F071FA9E +:10E0B000002818BF14EB0000E6D0017801F03F0102 +:10E0C0002529E1D280780221B1EB501FDCD3304604 +:10E0D00070BD002070BD70B50178012501F00F0101 +:10E0E000002404290AD007290DD008291CBF0020CC +:10E0F00070BD40780E2836D0204670BD4078801F15 +:10E100001F2830D9F8E7844640789CF803108A0924 +:10E11000032AF1D001F03F06711C8142ECD8604621 +:10E12000FFF732FFB042E7D89CF8030010F03F0F32 +:10E130001EBF1CF10400007810F0100F13D06646CB +:10E140000421604600F025FA002818BF16EB0000F5 +:10E15000D2D0017801F03F012529CDD2807802216B +:10E16000B1EB501FC8D3284670BD10B4017801F040 +:10E170000F01032920D0052921D14478B0F81910C6 +:10E18000B0F81BC0B0F81730827D222C17D10629B9 +:10E1900015D3B1F5486F98BFBCF5FA7F0FD272B1B5 +:10E1A000082A98BF8A420AD28B429CBFB0F81D0051 +:10E1B000B0F5486F03D805E040780C2802D010BCB9 +:10E1C0000020704710BC012070472DE9F0411F4628 +:10E1D00014460D00064608BFFFDF2146304600F01A +:10E1E000D8F9040008BFFFDF30193A462946BDE8D8 +:10E1F000F041F0F71AB9C07800F03F007047C02234 +:10E2000002EA8111C27802F03F021143C1707047E7 +:10E21000C07880097047C9B201F00102C1F3400320 +:10E220001A4402EB4202C1F3800303EB4202C1F342 +:10E23000C00302EB4302C1F3001303EB43031A4490 +:10E24000C1F3401303EBC30302EB4302C1F380139A +:10E250001A4412F0FF0202D0521CD2B20171C378EC +:10E2600002F03F0103F0C0031943C170511C41701B +:10E2700070472DE9F0410546C078164600F03F048E +:10E280001019401C0F46FF2888BFFFDF28193246AF +:10E290003946001DF0F7C9F8A019401C6870BDE8A8 +:10E2A000F081C178407801F03F01401A401E80B2F1 +:10E2B000704710B590F803C00B460CF03F0144784E +:10E2C0000CF03F0CA4EB0C0CACF1010C1FFA8CF41D +:10E2D000944288BF14462BB10844011D22461846BB +:10E2E000F0F7A3F8204610BD4078704700B50278DB +:10E2F00001F0030322F003021A430270012914BF44 +:10E300000229002104D0032916BFFFDF012100BD2F +:10E31000417000BD00B5027801F0030322F0030252 +:10E320001A430270012914BF0229002104D00329D5 +:10E3300016BFFFDF012100BD417000BD007800F075 +:10E3400003007047417841B1C078192803D2C04A10 +:10E35000105C884201D1012070470020704730B521 +:10E3600001240546C17019293CBFB948445C02D359 +:10E37000FF2918BFFFDF6C7030BD70B515460E4623 +:10E3800004461B2A88BFFFDF65702A463146E01C21 +:10E39000BDE87040F0F749B8B0F807007047B0F832 +:10E3A00009007047C172090A01737047B0F80B0089 +:10E3B000704730B4B0F80720B0F809C0B0F80530A5 +:10E3C0000179941F40F67A45AC4298BFBCF5FA7FBC +:10E3D0000ED269B1082998BF914209D293429FBFDA +:10E3E000B0F80B00B0F5486F012030BC98BF704703 +:10E3F000002030BC7047001D07F055BE021D0846C6 +:10E40000114607F050BEB0F8090070470079704718 +:10E410000A68426049688160704742680A608068A3 +:10E4200048607047098881817047808908807047FB +:10E430000A68C0F80E204968C0F812107047D0F87A +:10E440000E200A60D0F81200486070470968C0F8D2 +:10E4500016107047D0F81600086070470A684260CE +:10E4600049688160704742680A6080684860704708 +:10E470000968C1607047C0680860704700797047DC +:10E480000A68426049688160704742680A60806833 +:10E49000486070470171090A417170478171090A2A +:10E4A000C17170470172090A417270478172090A8D +:10E4B000C172704780887047C08870470089704774 +:10E4C0004089704701891B2924BF4189B1F5A47F88 +:10E4D00007D381881B2921BFC088B0F5A47F012004 +:10E4E0007047002070470A68426049688160704741 +:10E4F00042680A60806848607047017911F0070F30 +:10E500001BBF407910F0070F0020012070470179F0 +:10E5100011F0070F1BBF407910F0070F00200120FA +:10E5200070470171704700797047417170474079B9 +:10E5300070478171090AC1717047C088704745A250 +:10E5400082B0D2E90012CDE900120179407901F0E0 +:10E55000070269461DF80220012A07D800F00700CB +:10E56000085C01289EBF012002B07047002002B065 +:10E570007047017170470079704741717047407969 +:10E58000704730B50C460546FB2988BFFFDF6C702D +:10E5900030BDC378024613F03F0008BF7047052026 +:10E5A000127903F03F0312F0010F36D0002914BF97 +:10E5B0000B20704712F0020F32D0012914BF801DCA +:10E5C000704700BF12F0040F2DD0022914BF401C69 +:10E5D000704700BF12F0080F28D0032914BF801C19 +:10E5E000704700BF12F0100F23D0042914BFC01CC5 +:10E5F000704700BF12F0200F1ED005291ABF12303D +:10E60000C0B2704712F0400F19D006291ABF401C43 +:10E61000C0B27047072918D114E00029CAD114E00C +:10E620000129CFD111E00229D4D10EE00329D9D19B +:10E630000BE00429DED108E00529E3D105E0062935 +:10E64000E8D102E0834288BF704700207047000095 +:10E6500014640200000101020102020330B490F8C8 +:10E6600064508C88B1F808C015F00C0F1BD000BFA7 +:10E67000B4F5296F98BF4FF4296490F8655015F0F0 +:10E680000C0F17D0BCF5296F98BF4FF4296C4A883E +:10E69000C988A0F84420A0F84810A0F84640A0F887 +:10E6A0004AC030BC7047002B1CBF157815F00C0F0A +:10E6B000DED1E2E7002B1CBF527812F00C0FE1D143 +:10E6C000E5E7DDF800C08181C2810382A0F812C0B5 +:10E6D00070471B2202838282C28182814280028132 +:10E6E000028042848284828359B14FF4296141833C +:10E6F000C18241820182C18041818180C1840185C2 +:10E7000070474FF4A4714183C18241820182C1806C +:10E7100041818180C18401857047F0B4B0F8482000 +:10E72000818F468EC58E8A4228BF0A4690F86510B2 +:10E730004FF0000311F00C0F18BF4FF4296106D100 +:10E74000B0F84AC0B0F840108C4538BF61464286E8 +:10E75000C186048FB0F83AC0944238BF14468C4545 +:10E7600038BF8C460487A0F83AC0B2420ABFA9421B +:10E770004FF0010C4FF0000C058EB0F84410C28F22 +:10E78000848E914228BF114690F8642012F00C0F3D +:10E7900018BF4FF4296206D1B0F84660B0F84220A5 +:10E7A000964238BF324690F85A60022E0AD001864F +:10E7B0008286A9420ABFA2420120002040EA0C0042 +:10E7C000F0BC70478D4238BF2946944238BF22467C +:10E7D00080F85A30EBE7508088899080C889D080D3 +:10E7E000088A1081488A508101201070704730B427 +:10E7F00002884A80B0F830C0A1F804C0838ECB8074 +:10E80000428E0A81C48E4C81B0F85650A54204BF96 +:10E81000B0F85240944208D1B0F858409C4202BF30 +:10E82000B0F854306345002301D04FF001030B735F +:10E8300000F13003A0F852201A464B89D3848B880C +:10E840009384CA88A0F858204FF00100087030BCAB +:10E85000704730B404460A46088E91F864104FF4AD +:10E86000747311F00C0F1CBF03EB801080B21ED02C +:10E87000918E814238BF0846118F92F865C01CF016 +:10E880000C0F1CBF03EB811189B218D0538F8B4240 +:10E8900038BF194692F866301CF00C0F08BF0023F1 +:10E8A000002C0CBF0122002230BCFFF7C3B80229A4 +:10E8B00007BF80003C30C000703080B2D8E7BCF1A8 +:10E8C000020F07BF89003C31C900703189B2DDE712 +:10E8D0002DE9F041044606F0D3FCC8B9FE4F786834 +:10E8E00090F8221001260025012914D00178012971 +:10E8F0001BD090F8281001291CBF0020BDE8F08132 +:10E90000657018212170D0F82A10616080F82850B5 +:10E910000120BDE8F081657007212170416A6160C6 +:10E9200080F822500120BDE8F0816570142121702B +:10E93000811C2022201DEFF778FD257279680D706B +:10E9400081F82850E54882888284C26B527B80F827 +:10E95000262080F82260C86B0088F4F732FCF4F7B8 +:10E96000D8F8D5E7DC4840680178002914BF8088D2 +:10E970004FF6FF70704730B5D74C83B00D46207806 +:10E980007F2808BFFFDF94F900307F202070D4F883 +:10E9900004C09CF85000062808BF002205D09CF84F +:10E9A000500008280CBF022201229CF85400CDE937 +:10E9B000000302929CF873309CF880200CF1320125 +:10E9C000284606F0C9FC03B0BDE8304006F059BE49 +:10E9D0002DE9F04106F099FC002818BF06F01EFC56 +:10E9E000BD4C606800F1840290F87610895C80F874 +:10E9F0008010002003F07CF828B3F9F721F8606854 +:10EA0000B74990F855000D5C2846F8F785FD606819 +:10EA10004FF0000680F8735090F8801011F00C0F42 +:10EA20000CBF25200F20F8F757FC606890F8801085 +:10EA30000120F8F7F3FD606890F84010032918BF33 +:10EA400002290FD103E0BDE8F04101F02FB990F8A1 +:10EA500076108430085C012804D101221146002080 +:10EA6000F9F7D5F8F9F7A3F8606890F88050012D10 +:10EA700007BF0127032100270521A068FEF7FCF846 +:10EA8000616881F8520040B1002F18BF402521D0A5 +:10EA9000F8F775F92846F9F76BF86068806DF8F7B4 +:10EAA000DBFF606890F85410FF291CBF6D30FEF743 +:10EAB0001CF8FF21606880F8531080F8541080F82B +:10EAC000626080F8616080F87D60062180F85010F7 +:10EAD000BDE8F08115F00C0F14BF55255025D7E780 +:10EAE00070B57D4C0646606800F150052046806890 +:10EAF00041B1D0F80510C5F81D10B0F80900A5F80F +:10EB0000210003E005F11D01FFF7AFF9A068FFF751 +:10EB1000CAF985F82400A0680021032E018002D0E4 +:10EB2000052E04D03DE00321FFF772F939E00521FD +:10EB3000FFF76EF96068C06B00F10E01A068FFF787 +:10EB4000F6F96068C06B00F11201A068FFF7F3F9F5 +:10EB5000D4E90110CA6B527D8275CA6BD28AC27524 +:10EB6000120A0276CA6B52884276120A8276CA6B01 +:10EB70009288C276120A0277CA6BD2884277120A4A +:10EB80008277C96B0831FFF7F4F96068C06B017ECA +:10EB9000A068FFF7D6F9606890F88610A068FFF7C4 +:10EBA000DAF905F11D01A068FFF766F995F8241060 +:10EBB000A068FFF77CF9606800F1320590F83160D9 +:10EBC00090F8511091B190F84010032906D190F8B7 +:10EBD0003910002918BF90F8560001D190F8530061 +:10EBE000FEF799F800281CBF012605462946A068B3 +:10EBF000FFF734F93146A068BDE87040FFF74AB925 +:10EC00003549496881F84B00704770B5324D002492 +:10EC10000126A8606968A1F8814081F8834081F8E5 +:10EC2000506091F85020022A1FBF91F8501001291E +:10EC3000FFDF70BD06F007FB6868047080F82240B3 +:10EC400080F8284090F8520030B1F8F79BFFF8F7B1 +:10EC5000AAF8686880F852406868072180F84A403E +:10EC600080F8396080F8404080F8554080F84B408B +:10EC700080F87D4080F8381070BD2DE9F041164CC9 +:10EC8000054686B0606890F85000012818BF022839 +:10EC900005D003281EBF0C2006B0BDE8F081687ABD +:10ECA000022839D0F8F75AFB0220F8F7CFFE0D49B9 +:10ECB00001F10C0090E80D108DE80D10D1E907016D +:10ECC000CDE904016846F8F7AFFE606890F94B00A3 +:10ECD000F8F714FCA06807E0780100204411002038 +:10ECE0003364020030640200F8F7B3FEFC48F8F722 +:10ECF00087FEFC48F8F708FC606890F83110323065 +:10ED0000F8F789FB0F210720F8F7A3FB606890F85C +:10ED10003900E0B1FDF772FF6168287A01F18402E1 +:10ED200081F87600287A805C81F8800068688865C0 +:10ED30002A68CA65687A68B1012824D005250228A6 +:10ED400008BF81F850506FD0032878D080E0FDF7DD +:10ED500010FFE1E7E44B91F83850002291F855009C +:10ED6000401CA3FB006C4FEA5C0CACEB8C0C6044C9 +:10ED700081F8550025FA00F010F0010F03D1501C66 +:10ED8000C2B2032AEAD3002681F87D6091F84900D7 +:10ED9000002804BF91F85100002841D0F6F746FA48 +:10EDA000074660683946406CF6F72FFFDFF83C8372 +:10EDB000054690FBF8F008FB105041423846F5F745 +:10EDC0001CFF6168486495FBF8F08A6F10448867FF +:10EDD000FDF74CFE01466068826F914220D847647F +:10EDE000866790F8510000281CBF0120FDF760FFE6 +:10EDF0000121606890F84A20002A1CBF90F8492041 +:10EE0000002A0DD090F8313000F13202012B04D1EC +:10EE1000527902F0C002402A08D03230F9F744FC9F +:10EE20006168042081F8500012E008E00125FDF738 +:10EE300070FF61682A463231F9F7FEFBF0E7002ADD +:10EE400018BFFFDF012000F089FF606880F8505094 +:10EE500006B00020BDE8F08170B5A54D686890F857 +:10EE6000501004292ED005291CBF0C2070BD90F82D +:10EE70007D100026002990F883104FEA511124D00C +:10EE8000002908BF012407D0012908BF022403D0AC +:10EE9000022914BF00240824C06D00281CBF0020D4 +:10EEA00000F05CFF6868806DF8F7D6FD686890F840 +:10EEB0004010022943D0032904BF90F86C100129A7 +:10EEC00041D04DE0FFF784FD52E0002908BF012446 +:10EED00007D0012908BF022403D0022914BF00244F +:10EEE0000824C06D00281CBF002000F037FF6868B0 +:10EEF000806DF8F7B1FD686890F84010022906D0DF +:10EF0000032904BF90F86C10012904D010E090F898 +:10EF10006C1002290CD1224614F00C0F04D090F88A +:10EF20004C00012808BF042201210020F8F76FFEE1 +:10EF30006868072180F8804080F8616016E090F8EA +:10EF40006C1002290CD1224614F00C0F04D090F85A +:10EF50004C00012808BF042201210020F8F757FEC9 +:10EF60006868082180F8804080F8616080F850105F +:10EF7000002070BD5E49002210F0010F496802D0E8 +:10EF8000012281F8842010F0080F03D011440820DA +:10EF900081F88400002070475549496881F848008D +:10EFA000704710B5524C636893F83030022B14BF91 +:10EFB000032B00280BD100291ABF022901200020B1 +:10EFC0001146FDF756FD08281CBF012010BD6068E2 +:10EFD00090F83000002816BF022800200120BDE86C +:10EFE0001040F9F7E9BA4248406890F8300000282C +:10EFF00016BF022800200120F9F7DEBA3C49496813 +:10F0000081F8300070473A49496881F84A007047F2 +:10F0100070B5374C616891F83000002816BF02289F +:10F020000020012081F8310001F13201F9F7AEFA38 +:10F03000606890F83010022916BF032901210021D1 +:10F0400080F8511090F8312000F132034FF00005A4 +:10F05000012A04BF5B7913F0C00F0AD000F132031C +:10F06000012A04D15A7902F0C002402A01D00022BC +:10F0700000E0012280F84920002A04BF002970BD69 +:10F080008567F6F7D3F86168486491F85100002865 +:10F090001CBF0020FDF70CFE0026606890F84A10A7 +:10F0A00000291ABF90F84910002970BD90F831204E +:10F0B00000F13201012A04D1497901F0C00140294F +:10F0C00005D02946BDE870403230F9F7EDBAFDF7BA +:10F0D00020FE61683246BDE870403231F9F7ACBAC3 +:10F0E0003064020036640200ABAAAAAA40420F00B4 +:10F0F0007801002070B5FF4D0C4600280CBF01239D +:10F100000023696881F8393081F842004FF0080027 +:10F1100081F856000CD1002C1ABF022C01200020CF +:10F120001146FDF7A6FC6968082881F8560001D051 +:10F13000002070BD022C14BF032C1220F8D170BD2A +:10F14000002818BF112070470328EA4A526808BFF8 +:10F15000D16382F840000020704710B5E54C60682C +:10F1600090F8401003291CBF002180F8601001D0E6 +:10F17000002010BD0123C16B1A460020FEF763FC7E +:10F180006168CA6B526A904294BF0120002081F8E6 +:10F190006000EDE7D748416891F84000032804D0AB +:10F1A000012818BF022807D004E091F84200012886 +:10F1B00008BF70470020704791F84100012814BF34 +:10F1C00003280120F6D1704770B5F8F7C5FCF8F7B1 +:10F1D000A4FCF8F76BFBF8F719FCC64C0025606837 +:10F1E00090F8520030B1F8F7CDFCF7F7DCFD60681D +:10F1F00080F8525060680121A0F8815080F8835057 +:10F2000080F8501080F82850002070BDB94810B523 +:10F210004068643006F0EBFB002010BDB5480121CA +:10F22000406890F84020032A03BF80F82A10C26B80 +:10F230001288002218BF80F82A20828580F82810C2 +:10F240007047AC49496881F886007047017800230F +:10F2500011F0010FA749496809D04278032A08BF75 +:10F26000CB6381F84020012281F884201346027884 +:10F2700012F0040F0CD082784FF0000C032A08BF64 +:10F28000C1F83CC081F840200B44082283F8842058 +:10F29000C27881F830200279002A16BF022A0123A1 +:10F2A000002381F8393081F84120427981F83820F3 +:10F2B000807981F848004FF0000070478D48406821 +:10F2C0008030704770B58B4C06460D46606890F8EC +:10F2D0005000032818BFFFDF022E1EBF032EFFDFE2 +:10F2E00070BD002D18BF06F0DBF900216068A0F8A2 +:10F2F000811080F88310012180F8501070BD00F05B +:10F30000D5BC2DE9F0477B4C0646894660684FF036 +:10F310000108072E90F8397038BF032540D3082E16 +:10F3200084BF0020BDE8F08790F85010062908BF80 +:10F33000002105D090F8501008290CBF02210121AE +:10F3400090F8800005F0E8FF002873D1A068C1782C +:10F3500011F03F0F12D0027912F0010F0ED0616848 +:10F360004FF0050591F85220002A18BFB9F1000F9F +:10F3700016D091F88010012909D011E011F03F0F4B +:10F380001ABF007910F0100F002F53D14CE04FF04E +:10F3900001024FF00501FDF7B4FB616881F85200EE +:10F3A000A16808782944C0F3801030B1487900F092 +:10F3B000C000402808BF012000D00020616891F8FB +:10F3C0005210002918BF002807D0FDF7B5FB0146F1 +:10F3D000606880F8531080F86180606890F853107E +:10F3E000FF292AD080F854100846FDF7B2FB40EA06 +:10F3F0000705606890F85320FF2A18BF002D10D031 +:10F40000072E0ED3A068C17811F03F0F09D0017903 +:10F4100011F0020F05D00B21FDF720FC606880F889 +:10F4200062802846BDE8F087FDF75EF9002808BF36 +:10F43000BDE8F0870120BDE8F087A36890F8392087 +:10F4400059191B78C3F3801C00F153036046FDF784 +:10F45000B0F90546CDE72DE9F043264C87B0A0680A +:10F46000FEF7D6FE7F264FF00108002558B102278F +:10F4700001287DD0022800F0EF80F8F717FA07B0D6 +:10F480000620BDE8F083F8F711FA616891F84000B2 +:10F49000032800F01581A068C27812F03F0F05D054 +:10F4A000037913F0100F18BF012700D10027002F98 +:10F4B00014BF0823012312F03F0F00F001810079EF +:10F4C00033EA000240F0FC8010F0020F08D091F8FF +:10F4D0008000002105F09EFE002808BF012000D01A +:10F4E00000208DF80C508DF810508DF814504FF00E +:10F4F000FF0801E078010020D0B105AA03A904A803 +:10F5000000F07AFC606890F831809DF80C000028CB +:10F5100018BF48F002080BD1A068FEF7D1FC814665 +:10F520000121A068FEF728FD4946F7F77EFF28B3C2 +:10F53000FFB1012000F0DDFB002852D020787F28A9 +:10F5400008BFFFDF94F900102670606890F854201F +:10F55000CDE90021029590F8733090F8802000F1F9 +:10F560003201404605F0F8FE606880F86C50A3E078 +:10F5700038E041460020FFF7FEF9A1E0606890F80E +:10F580004100032818BF02282BD19DF81000002845 +:10F5900027D09DF80C00002823D1F7B1012000F0FE +:10F5A000A8FB00281DD020787F2808BFFFDF94F932 +:10F5B00000102670606890F85420CDE90021029573 +:10F5C00090F8733090F8802000F13201FE2005F0B1 +:10F5D000C3FE606880F86C506EE0FE210020FFF7EB +:10F5E000CAF96DE0F8F762F9A0681821C27812F044 +:10F5F0003F0F65D00279914362D10421FEF7BCFC34 +:10F60000616891F84020032A01BF8078B7EB501F52 +:10F6100091F86000002853D04FF0010000F069FB22 +:10F62000E8B320787F2808BFFFDF94F90010267028 +:10F63000606890F85420CDE90021029590F873306D +:10F6400090F8802000F13201FF2005F085FE60680F +:10F6500080F86C8030E000BFF8F728F9606890F817 +:10F66000400003282CD0A0681821C27812F03F0F68 +:10F6700026D0007931EA000022D1012000F039FBC8 +:10F6800068B120787F2808BFFFDF94F9001026704A +:10F69000606890F85420CDE90021029500E00FE069 +:10F6A00090F8733090F8802000F13201FF2005F0CF +:10F6B00053FE606880F86C7007B00320BDE8F083EB +:10F6C00007B00620BDE8F083F0B5FE4C074683B0D6 +:10F6D00060686D460078002818BFFFDF002661686B +:10F6E0008E70C86B02888A8042884A8382888A83A7 +:10F6F000C088C88381F8206047B10121A068FEF767 +:10F700003BFC0546A0680078C10907E06946A0688F +:10F71000FEF7ABFBA0680078C0F38011606801279A +:10F7200090F85120002A18BF002904D06A7902F00D +:10F73000C002402A26D090F84A20002A18BF00298B +:10F7400003D0697911F0C00F1CD000F10E0006F053 +:10F75000A1FC616891F85400FF2819D001F108025A +:10F76000C91DFDF7ABF9002808BFFFDF6068C1794C +:10F7700041F00201C171D0F86D104161B0F8711013 +:10F7800001830FE02968C0F80E10A9884182E0E7E4 +:10F79000C86B427ECA71D0F81A208A60C08B8881FB +:10F7A0004E610E8360680770C26B90F84B1082F850 +:10F7B0006710C06B0088F3F704FDF3F79BF903B003 +:10F7C000F0BD2DE9F041BF4C0546002760684FF0C1 +:10F7D00001083E4690F84000012818BF022802D0D8 +:10F7E000032818BFFFDF5DB1A068FEF71DFC18B944 +:10F7F000A068FEF770FC18B100F08FFB074645E0EB +:10F80000606890F850007F25801F06283ED2DFE810 +:10F8100000F003191924352FAA48F8F7D7F9002862 +:10F8200008BF2570F8F7B9F9606890F8520030B158 +:10F83000F8F7A8F9F7F7B7FA606880F85260F8F7B8 +:10F8400035F830E09F48F8F7C1F9002808BF257067 +:10F85000F8F7A3F905F024FFC3E09A48F8F7B6F9E2 +:10F86000002808BF2570F8F798F9F8F71FF81AE094 +:10F870009448F8F7ABF930B9257004E09148F8F7EF +:10F88000A5F90028F8D0F8F788F9AAE0102F80F041 +:10F890003881DFE807F01E9DA6AAF1F108B3F2F166 +:10F8A000F1F10C832051BDE8F041FFF791B803203E +:10F8B00002F01EF9002870D000210320FFF710F994 +:10F8C000012211461046F8F7A2F961680C2081F870 +:10F8D0005000BDE8F081606800F15005042002F09E +:10F8E00007F900287DD00E202870012002F0FDFCD1 +:10F8F000A06861680078C0F3401081F875000021AD +:10F900000520FFF7EDF87048A1684FF0200CC26B9E +:10F910000B78527B23F020030CEA42121A430A7040 +:10F92000C16B95F825304A7B1A404A73C06B282179 +:10F9300080F86610BDE8F081062002F0D9F80028B2 +:10F940004FD0614D0F2085F85000022002F0CDFC11 +:10F950006068012190F880200846F8F758F9A068FF +:10F9600061680078C0F3401081F87500012105201E +:10F97000FFF7B6F8E86B80F80D80A068017821F0F9 +:10F9800020010170F8F715FD002818BFFFDF2820BF +:10F99000E96B81F86600BDE8F08122E0052002F005 +:10F9A000A7F8F0B101210320FFF79AF8F8F701FD5D +:10F9B000002818BFFFDF6068012190F8802008460A +:10F9C000F8F725F961680D2081F85000BDE8F08155 +:10F9D0006068A0F8816080F8836080F85080BDE89E +:10F9E000F081BDE8F04100F061B96168032081F861 +:10F9F0005000BDE8F041082002F077BC606890F844 +:10FA00008310490908BF012507D0012908BF022535 +:10FA100003D0022914BF00250825C06D00281CBF93 +:10FA2000002000F09BF96068806DF8F715F86068B9 +:10FA300090F84010022906D0032904BF90F86C10FA +:10FA4000012904D010E090F86C1002290CD12A464C +:10FA500015F00C0F04D090F84C00012808BF0422C8 +:10FA600001210020F8F7D3F86068072180F8805062 +:10FA700080F8616041E000E043E0606890F8831046 +:10FA8000490908BF012507D0012908BF022503D075 +:10FA9000022914BF00250825C06D00281CBF0020C6 +:10FAA00000F05CF96068806DF7F7D6FF606890F849 +:10FAB000401002290AD0032904BF90F86C100129D4 +:10FAC00008D014E0780100204411002090F86C1058 +:10FAD00002290CD12A4615F00C0F04D090F84C00E6 +:10FAE000012808BF042201210020F8F790F860687F +:10FAF000082180F8805080F8616080F85010BDE8DF +:10FB0000F081FFDFBDE8F08170B5FE4C606890F8D1 +:10FB1000503000210C2B38D001220D2B40D00E2B61 +:10FB200055D00F2B1CBFFFDF70BD042002F0DDFBA2 +:10FB3000606890F880100E20F7F7CEFB606890F8B0 +:10FB4000800010F00C0F14BF282100219620F7F739 +:10FB5000A1FFF8F72CF86068052190F88050A068A4 +:10FB6000FDF78AF8616881F8520048B115F00C0F72 +:10FB70000CBF50255525F7F702F92846F7F7F8FF8F +:10FB800061680B2081F8500070BDF8F710F8002173 +:10FB90009620F7F77FFF6168092081F8500070BD5B +:10FBA00090F88010FF20F7F797FB606890F88000CE +:10FBB00010F00C0F14BF282100219620F7F76AFFE0 +:10FBC000F7F7F5FF61680A2081F8500070BDA0F8D2 +:10FBD000811080F8831080F850200020FFF774FD1A +:10FBE000BDE87040032002F080BB70B5C54C606872 +:10FBF00090F850007F25801F062828BF70BDDFE8E1 +:10FC000000F0171F1D032A11BE48F7F7DFFF002879 +:10FC100008BF2570F7F7C1FFF7F748FEBDE8704051 +:10FC2000FEF7D6BEB748F7F7D1FFC8B9257017E081 +:10FC3000B448F7F7CBFF40B9257006E005F030FD7A +:10FC4000B048F7F7C3FF0028F6D0F7F7A6FFBDE8E6 +:10FC5000704000F02BB8AB48F7F7B8FF0028E5D0AC +:10FC6000F7F79BFF60680021643005F071FEBDE886 +:10FC7000704000F01BB870B5A24C06460D46012935 +:10FC800008D0606890F880203046BDE87040134688 +:10FC900002F077BBF7F747FA61680346304691F800 +:10FCA00080202946BDE8704002F06BBB70B5F7F7C5 +:10FCB00053FFF7F732FFF7F7F9FDF7F7A7FE914C7F +:10FCC0000025606890F8520030B1F7F75BFFF7F756 +:10FCD0006AF8606880F852506068022180F850101D +:10FCE000A0F8815080F88350BDE87040002002F0F9 +:10FCF000FCBA70B5834D06460421A868FEF73CF9AE +:10FD0000044605F002FB002808BF70BD207800F013 +:10FD10003F00252814D2F7F74CFA217811F0800F14 +:10FD20000CBF1E214FF49671B4F80120C2F30C02EF +:10FD300012FB01F10A1AB2F5877F28BF814201D276 +:10FD4000002070BD68682188A0F88110A17880F833 +:10FD500083103046BDE8704001F0CABE2DE9F04185 +:10FD6000684C0746606800F1810690F883004009FE +:10FD700008BF012507D0012808BF022503D00228AB +:10FD800014BF00250825F7F75BFE307800F03F062A +:10FD90003046F7F7C1FB606880F8736090F86C003C +:10FDA00002280CBF4020FF202946F7F795FA27B11B +:10FDB00029460120F7F777FC05E060682A46C16D07 +:10FDC0000120F7F7B9FCF7F7F2FE0521A068FCF770 +:10FDD00053FF6168002881F8520008BFBDE8F08138 +:10FDE00015F00C0F0CBF50245524F6F7C8FF204621 +:10FDF000BDE8F041F7F7BCBE2DE9F74F414C0025B7 +:10FE0000914660688A4690F8510000280CBF4FF078 +:10FE100001084FF00008A0680178CE090121FEF723 +:10FE2000ABF836B1407900F0C000402808BF012689 +:10FE300000D00026606890F85210002961D090F838 +:10FE400040104FF0000B032906D190F8391000291B +:10FE500018BF90F856700ED1A068C17811F03F0F0E +:10FE60001CBF007910F0010F02D105F09BF940B3DF +:10FE7000606890F85370FF2F18BF082F21D03846C4 +:10FE8000FCF7D8FB002818BF4FF00108002E38D02F +:10FE9000606890F8620030B1FCF759FE0546606872 +:10FEA00080F862B02DE03846FCF7FFFD05460121E1 +:10FEB000A068FEF761F801462846F8F78BFB054677 +:10FEC0001FE0F6B1606890F86100D0B9A068C17811 +:10FED00011F03F0F05D0017911F0010F18BF0B2170 +:10FEE00000D105210022FCF70CFE616881F8520068 +:10FEF00038B1FCF721FEFF2803D06168012581F8A5 +:10FF0000530001E0780100208AF800500098067044 +:10FF100089F8008003B0BDE8F08F2DE9F04FFF4C69 +:10FF200087B00025606890F850002E46801F4FF083 +:10FF30007F08062880F0D581DFE800F00308088BF1 +:10FF4000FDDB00F0F8FB054600F0CCB9F348F7F70D +:10FF50003DFE002808BF84F80080F7F71EFEA06869 +:10FF6000FDF778FF0546072861D1A068FEF750F934 +:10FF70000146606890F86C208A4258D190F8501081 +:10FF8000062908BF002005D090F8500008280CBFB3 +:10FF90000220012005F0C4F970B90321A068FDF723 +:10FFA000EBFF002843D001884078C1F30B01000922 +:10FFB00005F0B5FC00283AD000212846FFF7A1F94A +:10FFC000A0B38DF80C608DF808608DF8046062684D +:10FFD000FF2592F8500008280CBF02210121A068DB +:10FFE000C37813F03F0F1CBF007910F0020F12D03E +:10FFF00092F8800005F00EF968B901AA03A902A8D9 +:020000040002F8 +:10000000FFF7FAFE606890F831509DF80C00002868 +:1000100018BF45F002052B469DF804209DF80810F6 +:100020009DF80C0000F0D5F9054603E0FFE705F068 +:1000300037FB0225606890F85200002800F05281DA +:10004000F7F7A0FDF6F7AFFE606880F8526000F0A9 +:1000500049B9A068FDF7FEFE0646A1686068CA7847 +:1000600090F86D309A4221D10A7990F86E309A4218 +:100070001CD14A7990F86F309A4217D18A7990F85A +:1000800070309A4212D1CA7990F871309A420DD1EB +:100090000A7A90F872309A4208D1097890F8740080 +:1000A000C1F38011814208BF012500D00025F7F778 +:1000B000FDFB9A48F7F78AFD002808BF84F8008006 +:1000C000F7F76BFD042E11D185B120787F2808BF8A +:1000D000FFDF94F9003084F80080606890F87320A6 +:1000E00090F87D1090F8540005F0A8FB062500F06C +:1000F000F9B802278948F7F769FD002808BF84F896 +:100100000080F7F74AFDA068FDF7A4FE0546A06849 +:10011000FEF77EF8082D08BF00287CD1A0684FF0BC +:100120000301C27812F03F0F75D0007931EA000068 +:1001300071D1606800E095E000F1500890F8390056 +:10014000002814BF98F8066098F803604FF0000983 +:1001500098F8020078B1FCF7EFFC0546FF280AD0BA +:100160000146A068401DFCF7C0FCB5420CBF4FF033 +:1001700001094FF000090021A068FDF7FDFE0622ED +:1001800008F11D01EEF724F940B9A068FDF78BFED8 +:1001900098F82410884208BF012000D0002059EAB6 +:1001A00000095DD0606800F1320590F831A098F840 +:1001B000010038B13046FCF7AEFD00281CBF0546F3 +:1001C0004FF0010A4FF00008A06801784FEAD11BF8 +:1001D0000121FDF7D1FEBBF1000F07D0407900F0FF +:1001E000C000402808BF4FF0010B01D04FF0000BBA +:1001F0000121A068FDF7C0FE06222946EEF7E8F8C7 +:1002000030B9A068FDF75CFE504508BF012501D05C +:100210004FF0000500E023E03BEA050018BFFF2E89 +:100220000DD03046FCF741FC060008D00121A06843 +:10023000FDF7A2FE01463046F8F7CCF9804645EAC4 +:10024000080019EA000F0BD060680121643005F046 +:100250007FFB01273846FFF737FA052002F045F803 +:100260003D463FE002252D48F7F7B0FC002808BFC7 +:1002700084F80080F7F791FCA068FDF7EBFD0646D7 +:10028000A068FDF7C5FF072E08BF00282AD1A06887 +:100290004FF00101C27812F03F0F23D00279914351 +:1002A00020D1616801F150060021FDF765FE0622AC +:1002B00006F11D01EEF78CF8A0B9A068FDF7F3FD7B +:1002C00096F8241088420DD160680121643005F051 +:1002D0003FFBFF21022000F009F8002818BF03258A +:1002E00000E0FFDF07B02846BDE8F08F2DE9F043BE +:1002F0000A4C0F4601466068002683B090F87D20C6 +:10030000002A35D090F8500008280CBF022501259E +:10031000A168C87810F03F0F02E0000078010020CB +:10032000FD484FF000084FF07F0990F900001CBF16 +:10033000097911F0100F22D07F2808BFFFDF94F950 +:10034000001084F80090606890F85420CDE90021F6 +:10035000029590F8733090F8802000F13201384611 +:1003600004F0FAFF05F0E4FA10B305F08AF92CE086 +:10037000002914BF0221012180F87D10C2E77F28E7 +:1003800008BFFFDF94F9001084F80090606890F8CF +:100390005420CDE90021029590F8733090F8802028 +:1003A00000F13201384604F0D7FF05F06AF90CE09D +:1003B0000220FFF79EFC30B16068012680F86C8057 +:1003C000F7F774FA01E005F06BF903B03046BDE8C9 +:1003D000F0832DE9F047D04C054684B09A46174685 +:1003E0000E46A068FDF714FF4FF00109002800F049 +:1003F000CF804FF00208012808D0022800F00E81BB +:1004000005F04EF904B04046BDE8F087A068092128 +:10041000C27812F03F0F00F059810279914340F009 +:100420005581616891F84010032906D012F0020F3F +:1004300008BFFF2118D05DB115E00021FDF79CFD3C +:1004400061680622C96B1A31EDF7C2FF48BB1EE096 +:10045000FDF736FD05460121A068FDF78DFD294613 +:10046000F6F7E3FF18B15146012000F051B960687A +:1004700090F84100032818BF022840F02781002E81 +:100480001CBFFE21012040F0438100F01FB9A0688D +:10049000FDF709FD6168C96B497E884208BF0126E6 +:1004A00000D00026A068C17811F03F0F05D0017977 +:1004B00011F0020F01D06DB338E0616891F842206D +:1004C000012A01D096B11BE0D6B90021FDF754FDF9 +:1004D00061680268C96BC1F81A208088C883A06867 +:1004E000FDF7E1FC6168C96B487609E091F85300BB +:1004F00091F85610884203D004B04046BDE8F0871A +:100500006068643005F068FA002840D004B00F201D +:10051000BDE8F08767B1FDF7D3FC05460121A0686F +:10052000FDF72AFD2946F6F780FF08B1012200E019 +:100530000022616891F84200012807D040B92EB925 +:1005400091F8533091F856108B4201D1012100E00F +:1005500000210A421BD0012808BF002E11D14FF004 +:100560000001A068FDF708FD61680268C96BC1F869 +:100570001A208088C883A068FDF795FC6168C96B64 +:1005800048766068643005F027FA0028BED19DE007 +:1005900060682F46554690F840104FF00208032936 +:1005A000AAD0A168CA7812F03F0F1BBF097911F0D9 +:1005B000020F002201224FF0FF0A90F85010082984 +:1005C0000CBF0221012192B190F8800004F022FEBC +:1005D00068B95FB9A068FDF773FC07460121A06800 +:1005E000FDF7CAFC3946F6F720FF48B1AA46514646 +:1005F0000020FFF77BFE002818BF4FF003087BE7C1 +:10060000606890F84100032818BF02287FF474AF97 +:10061000002E18BF4FF0FE0AE9D16DE7616891F82E +:100620004030032B52D0A0684FF0090CC27812F072 +:100630003F0F4BD002793CEA020C47D1022B06D087 +:1006400012F0020F08BFFF2161D0E5B35EE012F0A7 +:10065000020F4FF07F0801D04DB114E001F16400AA +:1006600005F0BAF980B320787F2842D013E067B351 +:10067000FDF726FC05460121A068FDF77DFC294613 +:10068000F6F7D3FE08B36068643005F0A5F9D8B179 +:1006900020787F282DD094F9001084F800806068BD +:1006A00090F85420CDE90021CDF8089090F87330EF +:1006B00090F8802000F13201504604F04DFE0D20EC +:1006C00004B0BDE8F08716E000E001E00220F7E7A3 +:1006D000606890F84100032818BF0228F6D1002E68 +:1006E000F4D04FF0FE014FF00200FEF744F9022073 +:1006F000E6E7FFDFCFE7FDF7E3FB05460121A06852 +:10070000FDF73AFC2946F6F790FE38B15146022033 +:10071000FEF731F9DAE7000078010020606890F810 +:100720004100032818BF0228D0D1002E1CBFFE2193 +:100730000220EDD1CAE72DE9F84F4FF00008F74845 +:10074000F7F744FA7F27F54C002808BF2770F7F722 +:1007500024FAA068FDF77EFB81460121FEF7D1FD5A +:10076000616891F88020012A14D0042A1CBF082A4D +:10077000FFDF00F0D781606890F8520038B1F7F7DA +:1007800001FAF6F710FB6168002081F8520040463C +:10079000BDE8F88F0125E24EB9F1080F3AD2DFE843 +:1007A00009F03EC00439393914FC0546F7F77EF8E4 +:1007B000002D72D0606890F84000012818BF022810 +:1007C0006BD120787F2869D122E018B391F84000DE +:1007D000022802D0012818D01CE020787F2808BF0A +:1007E000FFDF94F90000277000906068FF2190F807 +:1007F000733090F85420323004F069FF61680020B3 +:100800004FF00C0881F87D00B5E720787F2860D193 +:10081000FFDF5EE0F7F74AF84FF00608ABE74FF06E +:100820000008002800F0508191F84000022836D0DE +:1008300001284BD003289ED1A068CA6BC37892F8D8 +:100840001AC0634521D1037992F81BC063451CD1BE +:10085000437992F81CC0634517D1837992F81DC083 +:10086000634512D1C37992F81EC063450DD1037A56 +:1008700092F81FC0634508D1037892F819C0C3F3FA +:100880008013634508BF012300D0002391F8421074 +:1008900001292CD0C3B300F013B93FE019E0207850 +:1008A0007F2808BFFFDF94F9000027700090606880 +:1008B000FF2190F8733090F85420323004F007FF95 +:1008C00060684FF00C0880F87D5054E720787F284E +:1008D0009ED094F90000277000906068FF2190F886 +:1008E000733090F85420323004F0F1FE16E0002B03 +:1008F0007ED102F11A01FDF7B8FAA068FDF7D3FA2C +:100900006168C96B4876DBE0FFE796F85600082877 +:1009100070D096F8531081426AD0D5E04FF00608A7 +:1009200029E7054691F8510000280CBF4FF0010B54 +:100930004FF0000B4FF00008A06810F8092BD20907 +:1009400007D0407900F0C000402808BF4FF0010AEE +:1009500001D04FF0000A91F84000032806D191F829 +:100960003900002818BF91F8569001D191F85390A2 +:100970004846FCF79AF80090D8B34846FBF75AFE71 +:10098000002818BF4FF0010BBAF1000F37D0A06854 +:10099000A14600F10901009800E0B6E0F7F71AFE61 +:1009A0005FEA0008D9F8040090F8319018BF49F0C8 +:1009B0000209606890F84010032924D0F6F776FF0A +:1009C000002DABD0F6F741FD002808BFB8F1000FAD +:1009D0007DD020787F2808BFFFDF94F900002770C2 +:1009E00000906068494690F8733090F8542002E017 +:1009F00066E004E068E0323004F069FE8EE760688B +:100A000090F83190D5E7A168C06BCA78837E9A428E +:100A10001BD10A79C37E9A4217D14A79037F9A4241 +:100A200013D18A79437F9A420FD1CA79837F9A4240 +:100A30000BD10A7AC37F9A4207D10978407EC1F36D +:100A40008011814208BF012700D0002796F853008B +:100A5000082806D096F85610884208BF4FF00109C2 +:100A600001D04FF00009B8F1000F05D1BBF1000F24 +:100A700004D0F6F7EAFC08B1012000E000204DB1F7 +:100A800096F84210012903D021B957EA090101D093 +:100A9000012100E00021084216D0606890F8421061 +:100AA000012908BF002F0BD1C06B00F11A01A0680B +:100AB000FDF7DBF9A068FDF7F6F96168C96B4876C8 +:100AC0004FF00E0857E602E0F6F7F0FE26E7606802 +:100AD00090F84100032818BF02287FF41FAFBAF135 +:100AE000000F3FF41BAF20787F2808BFFFDF94F989 +:100AF0000000277000906068FE2190F8733090F835 +:100B00005420323004F0E3FD08E791F84810002942 +:100B100018BF00283FF47EAE0BE0000078010020F3 +:100B200044110020B9F1070F7FF474AE00283FF4A0 +:100B300071AEFEF790FC80461DE60000D0F8001173 +:100B400049B1D0E941231A448B691A448A61D0E93A +:100B50003F12D16003E0FE4AD0F8FC101162D0E9E8 +:100B60003F1009B1086170470028FCD00021816165 +:100B700070472DE9FF4F06460C46488883B040F287 +:100B8000E24148430190E08A002500FB01FA94F815 +:100B90007C0090460D2822D00C2820D024281ED07E +:100BA00094F87D0024281AD000208346069818B1B6 +:100BB0000121204603F0C0F894F8641094F8650011 +:100BC000009094F8F0200F464FF47A794AB1012A48 +:100BD00061D0022A44D0032A5DD0FFDFB5E00120B6 +:100BE000E3E7B8F1000F00D1FFDFD94814F8641F24 +:100BF000243090F83400FDF7F0F801902078F7F7F2 +:100C000087FB4D4600F2E730B0FBF5F1DFF840938B +:100C1000D9F80C0001EB00082078F7F779FB0146C2 +:100C200014F86409022816D0012816D040F63400C2 +:100C300008444AF2EF010844B0FBF5F10198D9F8F5 +:100C40001C20411A514402EB08000D18012084F8C1 +:100C5000F0002D1D78E02846EAE74FF4C860E7E78A +:100C6000DFF8EC92A8F10100D9F80810014300D197 +:100C7000FFDFB848B8F1000F016801EB0A0506D0A4 +:100C8000D9F8080000F54970A84200D9FFDF032019 +:100C900084F8F00058E094F87C20019D242A05D0C7 +:100CA00094F87D30242B01D0252A3AD1B4F8702055 +:100CB000B4F81031D21A521C12B2002A31DB94F867 +:100CC000122172B3174694F8132102B11046009016 +:100CD000022916D0012916D040F6340049F60852F0 +:100CE0008118022F12D0012F12D040F63400104488 +:100CF000814210D9081A00F5FA70B0FBF9F00544EA +:100D00000FE04846EAE74FF4C860E7E74846EEE7F9 +:100D10004FF4C860EBE7401A00F5FA70B0FBF9F049 +:100D20002D1AB8F1000F0FD0DFF82482D8F8080090 +:100D300018B9B8F8020000B1FFDFD8F8080000F5D4 +:100D40004970A84200D9FFDF05B9FFDF2946D4F872 +:100D5000F400F3F752FFC4F8F400B06000203070E4 +:100D60004FF0010886F80480204603F040F8ABF10C +:100D70000101084202D186F8058005E094F8F000F0 +:100D8000012844D003207071606A3946009A01F04E +:100D900042FBF060069830EA0B0035D02946304619 +:100DA000FCF7DEFD87B2204603F021F8B8420FD8E9 +:100DB000074686F8058005FB07F1D4F8F400F3F741 +:100DC0001CFFB06029463046FCF7CAFD384487B2A4 +:100DD0003946204602F0B0FFB068C4F8F400A06EB7 +:100DE000002811D0B4F87000B4F89420801A01B231 +:100DF000002909DD34F86C0F0144491E91FBF0F124 +:100E000089B201FB0020208507B0BDE8F08F0220E9 +:100E1000B9E72DE9F04106460C46012001F0DBFA66 +:100E2000C5B20B2001F0D7FAC0B2854200D0FFDF77 +:100E30000025082C7ED2DFE804F00461696965C6EC +:100E40008293304601F0DDFA0621F2F787F80400BC +:100E500000D1FFDF304601F0D4FA2188884200D06B +:100E6000FFDF94F8F00000B9FFDF204602F00FFE2C +:100E7000374E21460020B5607580F561FDF7E9FC2D +:100E800000F19807606AB84217D994F86500F6F740 +:100E9000F9F8014694F864004FF47A72022828D0D9 +:100EA000012828D040F6340008444AF2473108446B +:100EB000B0FBF2F1606A0844C51B21460020356191 +:100EC000FDF7C7FC618840F2E24251439830081AAE +:100ED000A0F54970706194F8652094F86410606A18 +:100EE00001F099FAA0F5CA70B061BDE8F041F4F7DD +:100EF00059BE1046D8E74FF4C860D5E7BDE8F041C9 +:100F000002F02FBEBDE8F041F6F79DBE304601F07D +:100F100078FA0621F2F722F8040000D1FFDF30460C +:100F200001F06FFA2188884200D0FFDF0122002102 +:100F3000204600E047E0BDE8F04101F089BAF6F74D +:100F400041FDF6F780FE02204FF0E02104E00000B2 +:100F5000CC11002088010020C1F88002BDE8F0819A +:100F6000304601F04EFA0621F1F7F8FF040000D1F7 +:100F7000FFDF304601F045FA2188884200D0FFDFCC +:100F800094F8F000042800D0FFDF84F8F05094F8C3 +:100F9000FA504FF6FF76202D00D3FFDFF94820F8F6 +:100FA000156094F8FA00F4F722F900B9FFDF202069 +:100FB00084F8FA002046FFF7C1FDF3480078BDE849 +:100FC000F041E1F78DBFFFDFC8E770B5ED4C0025BC +:100FD000443C84F82850E07868B1E570FEF71EF9CB +:100FE0002078042803D0606AFFF7A8FD6562E64810 +:100FF0000078E1F775FFBDE8704001F03ABA70B5CE +:10100000E04C0146443CE069F4F7FFFD6568A278D6 +:1010100090FBF5F172B140F27122B5FBF2F292B29F +:10102000A36B01FB02F6B34202D901FB123200E0CE +:101030000022A2634D43002800DAFFDF2946E06961 +:10104000F3F7DBFDE06170BD2DE9F05FFEF736F9E7 +:101050008246CC48683800F1240881684646D8F8B2 +:101060001800F3F7CAFD0146F069F4F7CEFD4FF022 +:101070000009074686F835903C4640F28D254E46DD +:101080001DE000BF0AEB06000079F5F7FBFF4AF20E +:10109000B12101444FF47A70B1FBF0F108EB860204 +:1010A0004046926811448C4207D3641A90F8351078 +:1010B000A4F28D24491C88F83510761CF6B298F8F5 +:1010C0003600B042DED8002C0FDD98F835104046CF +:1010D00008EB81018968A14207D24168C91BA94276 +:1010E00000D90D466C4288F8359098F83560C346B3 +:1010F0000AEB060898F80400F5F7C4FF01464AF227 +:10110000B12001444FF47A7AB1FBFAF298F8041056 +:10111000082909D0042909D00020131804290AD06D +:10112000082908D0252207E0082000E0022000EB73 +:1011300040002830F1E70F22521D4FF4A870082913 +:1011400013D0042914D0022915D04FF0080C282000 +:1011500012FB0C00184462190BEB860302449868DA +:10116000D84682420BD8791925E04FF0400CEFE7C2 +:101170004FF0100CECE74FF0040C1820E8E798F85B +:10118000352098F836604046B24210D2521C88F89A +:1011900035203C1B9868621984180846F5F772FFE1 +:1011A0004AF2B1210144B1FBFAF0011903E080F8E1 +:1011B0003590D8F80410D8F81C00BDE8F05FF3F7BC +:1011C0001CBD2DE9FE4F14460546FEF777F8DFF803 +:1011D000B4A10290AAF1440A50469AF835604FF043 +:1011E000000B0AEB86018968CAF83C10F4B3044688 +:1011F00000780027042825D005283ED0FFDFA04630 +:1012000039466069F3F7F9FC0746F4F70FF88146B1 +:101210003946D8F80440F4F7F8FC401E90FBF4F08F +:10122000C14361433846F3F7E8FC0146C8F81C00A7 +:101230004846F4F7EAFC002800DDFFDF012188F8CA +:1012400013108DE0D4F81490D4F8048001F07CF9E8 +:10125000070010D0387800B9FFDF796978684A460E +:101260000844414601F05CF9074600E00BE04045C8 +:10127000C5D9FFDFC3E75F46C1E7606A01F006F941 +:1012800040F6B837BBE7C1690AEB46000191408DD3 +:1012900010B35446DAF81400FFF7B1FE6168E06954 +:1012A000F3F7ABFC074684F835B0019CD0462046E6 +:1012B000DAF81410F4F7A9FC814639462046F4F711 +:1012C000A4FCD8F804200146B9FBF2F0B1FBF2F11E +:1012D000884242D0012041E0F3F7A8FFFFF78FFEDC +:1012E000FFF7B2FE9AF83510DAF804900AEB8101A4 +:1012F0000746896800913946DAF81C00F4F785FC46 +:1013000000248046484504DB98FBF9F404FB09F40B +:101310001AE0002052469AF8351007E002EB8003ED +:1013200004F28D249B68401C1C44C0B28142F5D855 +:1013300051B10120F5F7A6FE4AF2B12101444FF464 +:101340007A70B1FBF0F004440099A8EB04000C1A89 +:1013500000D5FFDFCAF83C40A7E7002088F813005B +:101360009AF802005446B8B13946E069F4F74DFCEA +:101370000146A26B40F2712042438A4206D2C4F871 +:101380003CB009E03412002084010020E06B511AC7 +:10139000884200D30846E063AF6085F800B00120C2 +:1013A0002871029F94F835003F1DC05DF5F76AFE75 +:1013B0004AF23B5101444FF47A70B1FBF0F0E16B1B +:1013C000FC300844E8602078042808D194F83500FF +:1013D00004EB4000408D0A2801D2032000E00220E7 +:1013E000687104EB4600408DC0B128466168FCF787 +:1013F000B7FA82B20020761C0CE000BF04EB40017B +:10140000B0424B8D13449BB24B8501D35B1C4B8583 +:10141000401CC0B294F836108142EFD2A8686061D7 +:10142000A06194F8350004EB4001488D401C4885CC +:1014300094F83500C05D082803D0042803D00021AB +:101440000BE0082100E0022101EB410128314FF4BB +:10145000A872082804D0042802D0022807D0282225 +:101460000A44042805D0082803D0252102E01822C8 +:10147000F6E70F21491D08280CD004280CD00228BB +:101480000CD0082011FB0020E16B884208D201201B +:10149000BDE8FE8F4020F5E71020F3E70420F1E7D8 +:1014A0000020F5E770B5FE4C061D14F8352F905D51 +:1014B000F5F7E8FD4FF47A7100F2E730B0FBF1F098 +:1014C000D4F8071045182078805DF5F760FE217884 +:1014D000895D082903D0042903D000220BE00822EB +:1014E00000E0022202EB420228324FF4A8730829DE +:1014F00004D0042902D0022907D028231344042948 +:1015000005D0082903D0252202E01823F6E70F2290 +:10151000521D08290AD004290AD002290AD008211C +:1015200012FB0131081A281A293070BD4021F7E753 +:101530001021F5E70421F3E72DE9FF4107460C46AA +:10154000012000F048FFC5B20B2000F044FFC0B2FC +:10155000854200D0FFDF204601260025D04C082818 +:1015600069D2DFE800F00430464642686865667478 +:1015700026746078002819D1FDF7A0FE009594F834 +:1015800035108DF808104188C90411D0206C0190E5 +:1015900003208DF80900C24824388560C561257490 +:1015A0006846FDF76AFB002800D0FFDFBDE8FF8139 +:1015B000FFF778FF0190E07C10B18DF80950EAE761 +:1015C0008DF80960E7E7607840B1207C08B9FDF745 +:1015D000FBFD6574BDE8FF41F3F733BDA674FDF76D +:1015E0003BFC0028E2D0FFDFE0E7BDE8FF41F6F773 +:1015F0002ABBFDF763FE4088C00407D00121032009 +:10160000FDF760FEA7480078E1F76AFC0022394642 +:101610006846FFF7D6FD38B16946384600F0EFFE60 +:101620000028C3D1FFDFC1E7E670FFF7CEFCBDE7BE +:10163000BDE8FF41C9E4FFDFB8E7994950B1012295 +:101640008A704A6840F27123B2FBF3F202EB001099 +:10165000886370470020887070472DE9F05F8946E5 +:1016600040F271218E4E484300250446706090463A +:101670002F46D0074AF2B12A4FF47A7B0FD0B9F83F +:1016800000004843B0600120F5F7FCFC00EB0A01C4 +:10169000B1FBFBF0241AB7680125A4F28D245FEAA0 +:1016A000087016D539F8151040F27120414306EB49 +:1016B00085080820C8F80810F5F7E4FC00EB0A01DB +:1016C000B1FBFBF0241AD8F80800A4F28D240744DB +:1016D0006D1CA74219D9002D17D0391BB1FBF5F0AD +:1016E000B268101AB1FBF5F205FB1212801AB06055 +:1016F000012008E0B1FBF5F306EB80029468E31AE1 +:10170000401CC0B29360A842F4D3BDE8F09F2DE91D +:10171000F041634C00262078042804D02078052866 +:1017200001D00C201AE401206070607C002538B1E3 +:10173000EFF3108010F0010F72B610D001270FE008 +:10174000FDF7BCFD074694F82000F4F7ADF8788863 +:10175000C00411D000210320FDF7B4FD0CE00027E8 +:10176000607C38B1A07C28B1FDF72EFD6574A574AE +:10177000F3F767FC07B962B694F82000F4F700FBB2 +:1017800094F8280030B184F828502078052800D03B +:10179000FFDF0C26657000F06CFE304614E4404814 +:1017A00010B5007808B1FFF7B2FF00F0D6FE3C4953 +:1017B00000202439086210BD10B53A4C58B10128F8 +:1017C00007D0FFDFA06841F66A01884200D3FFDF3F +:1017D00010BD40F6C410A060F4E7324908B50870A7 +:1017E0002F4900200870487081F82800C8700874DC +:1017F000487488742022486281F820202439487077 +:101800004FF6FF7211F1680121F81020401CC0B2A0 +:101810002028F9D30020FFF7CFFFFFF7C0FF1020EB +:10182000ADF80000012269460420FFF716FF08BD4D +:101830007FB51B4C05460E46207810B10C2004B035 +:1018400070BD95F8652095F86410686A00F0C7FED1 +:10185000C5F80401656295F8F00000B1FFDF10499A +:1018600000202439C86105212170607084F82800A7 +:10187000014604E004EB4102491C5085C9B294F8CA +:1018800036208A42F6D284F835003046FFF7D5FE7E +:101890000548F3F751FC84F82000202807D105E023 +:1018A000F01100208401002039150200FFDFF3F75A +:1018B000BDFC606194F8201001226846FFF781FCAE +:1018C00000B9FFDF94F82000694600F098FD00B9E8 +:1018D000FFDF0020B3E7F94810B5007808B1002019 +:1018E00010BD0620F1F7D4FA80F0010010BDF8B564 +:1018F000F24D0446287800B1FFDF002000902378E5 +:101900000246DE0701466B4605D06088A188ADF827 +:101910000010012211462678760706D5E088248932 +:1019200023F8114042F00802491C491E85F8361080 +:101930001946FFF792FE0020F8BD1FB511B1112026 +:1019400004B010BDDD4C217809B10C20F8E700226D +:10195000627004212170114605E000BF04EB4103D1 +:10196000491C5A85C9B294F836308B42F6D284F8B5 +:101970003520FFF762FED248F3F7DEFB84F8200043 +:10198000202800D1FFDF00F0DFFD10B1F3F74EFC9F +:1019900005E0F3F74BFC40F6B831F3F72EF9606140 +:1019A00094F8201001226846FFF70BFC00B9FFDF16 +:1019B00094F82000694600F022FD00B9FFDF002006 +:1019C000BEE770B5BD4C616A0160FFF7A0FE05007F +:1019D00002D1606AFFF7B2F800206062284670BD4D +:1019E0007FB5B64C2178052901D00C2027E7B349F3 +:1019F0002439C860606A00B9FFDF606A90F8F000BF +:101A000000B1FFDF606A90F8FA00202800D0FFDF05 +:101A1000AC48F3F791FB616A0546202881F8FA008B +:101A20000E8800D3FFDFA548443020F81560606AB7 +:101A300090F8FA00202800D1FFDF00230122684639 +:101A4000616AFFF796F8606A694690F8FA0000F05C +:101A5000D6FC00B9FFDF00206062F0E69749243928 +:101A60004870704710B540F2E24300FB03F40020D9 +:101A700000F0B5FD844201D9201A10BD002010BD30 +:101A800070B50D46064601460020FCF7E2FE04460E +:101A900096F86500F5F7F6FA014696F864004FF4FB +:101AA0007A72022815D0012815D040F63400084477 +:101AB0004AF247310844B0FBF2F1708840F27122DB +:101AC0005043C1EB4000A0F54970A54206D2214623 +:101AD00005E01046EBE74FF4C860E8E7294681428D +:101AE00004D2A54201D2204600E02846706270BDB3 +:101AF00070B50546FDF7E2FB7049007824398C6823 +:101B00009834072D30D2DFE805F0043434252C3426 +:101B1000340014214FF4A873042810D00822082898 +:101B200009D02A2102280FD011FB024000222823CD +:101B3000D118441819E0402211FB0240F8E71022A6 +:101B400011FB02402E22F3E7042211FB0240002287 +:101B50001823EDE7282100F04DFC044404F531740E +:101B600003E004F5B07400E0FFDF5448C06BA0420E +:101B700001D9012070BD002070BD70B54F4C243CD0 +:101B8000607870B1D4E904512846A268FBF713FFCE +:101B90002061A84205D0A169401B0844A061F4F768 +:101BA00001F82169A068884201D8207808B1002096 +:101BB00070BD012070BD2DE9F04F054685B0164679 +:101BC0000F461C461846F5F7E2FA05EB47014718A1 +:101BD000204600F0F7FB4AF2C5714FF47A790844C9 +:101BE0004D46B0FBF5F0384400F160083348761CF0 +:101BF00024388068304404902046F5F7C8FAA8EBF2 +:101C00000007204600F0DEFB06462046F5F73AFACC +:101C1000301AB0FBF5F03A1A182528204FF4C87690 +:101C20004FF4BF774FF0020B082C30D0042C2BD090 +:101C30000021022C2ED0082311F1280103EB830C84 +:101C40000CEB831319440A444FF0000A082C29D0E6 +:101C5000042C22D00021022C29D00546082001F5B1 +:101C6000B07100BF00EB00102844814232D2082C32 +:101C70002AD0042C1ED00020022C28D00821283085 +:101C800001EB0111084434E039461023D6E7314610 +:101C90004023D3E704231831D0E73D4640F2EE312C +:101CA0001020DFE735464FF435614020DAE70420A5 +:101CB000B431D7E738461021E2E70000F0110020E8 +:101CC00039150200130E020030464021D8E70421E6 +:101CD0001830D5E7082C4FD0042C4AD00021022C14 +:101CE0004DD0082311F12801C3EBC30000EB4310D2 +:101CF000084415182821204600F07CFB05EB400124 +:101D0000082C42D0042C3DD00026022C3FD00820C5 +:101D100016F1280600EB801006EB80000E1801205B +:101D2000FB4D8DF804008DF800A08DF805B0A86972 +:101D300006F50A760499F2F760FFCDE9020620461F +:101D4000F5F7A0F94AF23B510144B1FBF9F0301A22 +:101D5000FC38E8630298C5F84080A86195F8200037 +:101D6000694600F04CFB002800D1FFDF05B0BDE85C +:101D7000F08F39461023B7E731464023B4E70423F8 +:101D80001831B1E73E461020C4E74020C2E70420E6 +:101D90001836BFE72DE9FE4F06461C461746884613 +:101DA0004FF0010A1846F5F7F2F9D94D243DA9681C +:101DB0008A1907EB480111444718204600F002FB3E +:101DC0004FF47A7BD84600F6FB00B0FBF8F03844BD +:101DD00000F120092046F5F7DAF9A9680246A9EBD7 +:101DE0000100801B871A204600F0ECFA05462046C9 +:101DF000F5F748F9281AB0FBF8F03A1A1825282008 +:101E00004FF4C8774FF4BF78082C2DD0042C28D07D +:101E10000021022C2BD0082311F1280103EB830CA5 +:101E20000CEB831319440A44082C28D0042C21D02D +:101E30000021022C28D00546082001F5B07100BF12 +:101E400000EB0010284481422AD2082C22D0042C16 +:101E50001DD00020022C20D00821283001EB0111D8 +:101E60002CE041461023D9E739464023D6E7042326 +:101E70001831D3E7454640F2EE311020E0E73D4609 +:101E80004FF435614020DBE70420B431D8E7404609 +:101E90001021E3E738464021E0E704211830DDE770 +:101EA000082C48D0042C43D00020022C46D0082116 +:101EB00010F12800C1EBC10303EB411108441518D0 +:101EC0002821204600F096FA05EB4001082C3BD073 +:101ED000042C36D00027022C38D0082017F1280710 +:101EE00000EB801007EB80000C1804F596740C983A +:101EF000F5F7C8F84AF23B510144B1FBFBF0844DC1 +:101F0000FC30A5F12407E96B06F1FC020844B9682E +:101F10000B191A44824224D9321911440C1AFC3488 +:101F20002044B0F1807F37D2642C12D2642011E0BB +:101F300040461021BEE738464021BBE70421183057 +:101F4000B8E747461020CBE74020C9E70420183700 +:101F5000C6E720460421F3F78CFEE8B1E86B204485 +:101F6000E863E0F791FEB968293831440844CDE9C7 +:101F7000000995F835008DF8080002208DF8090059 +:101F80006846FCF77AFE00B1FFDFFCF765FF00B1A1 +:101F9000FFDF5046BDE8FE8F4FF0000AF9E71FB59E +:101FA00000F023FB5A4C607880B994F8201000228E +:101FB0006846FFF706F938B194F82000694600F04A +:101FC0001EFA18B9FFDF01E00120E070F3F739F8DD +:101FD00000206074A0741FBD2DE9F84FFDF76EF965 +:101FE0000646441CC07840090CD001280CD00228B9 +:101FF0000CD000202178824608064FF4967507D44D +:102000001E2006E00120F5E70220F3E70820F1E7B3 +:102010002846B4F80120C2F30C0212FB00F7C809ED +:1020200001D010B103E01E2501E0FFDF0025F5F728 +:10203000C0F8A7EB00092078B77909EB0508C0F3D1 +:10204000801010B120B1322404E04FF4FA7401E0A2 +:10205000FFDF00240C2F00D3FFDF2E482E4A30F87C +:102060001700211801FB0821501CB1FBF0F4F5F713 +:102070005AF8F5F707F84FF47A7100F27160B0FB87 +:10208000F1F1A9EB0100071BA7F1590040F28D21E6 +:10209000103F884211D91E4E717829B90246534625 +:1020A00021462846FFF787FD00F09FFAF2F7C9FFA7 +:1020B00000207074B074BDE8F88F307800905346FB +:1020C0002A4621463846FFF765FE0028F3D1012154 +:1020D0000220FDF7F7F8BDE8F84F60E710B50446B9 +:1020E000012903D10A482438007830B1042084F84B +:1020F000F000BDE81040F2F7A4BF00220121204605 +:1021000000F0A6F934F8700F401C2080F1E70000C1 +:10211000F0110020546402003F420F002DE9F0410D +:102120000746FDF7CBF8050000D1FFDF287810F057 +:102130000C0F01D0012100E00021F74C606A303023 +:10214000FCF7C7FA29783846FBF747FEA4F12406C6 +:102150000146A069B26802446FB32878082803D00A +:10216000042803D000230BE0082300E0022303EB44 +:10217000430328334FF4A877082804D0042802D05A +:10218000022810D028273B4408280ED004280ED05F +:1021900002280ED05FF00800C0EBC00707EB40102C +:1021A0001844983009E01827EDE74020F4E71020A4 +:1021B000F2E70420F0E74FF4FC7010444718287849 +:1021C0003F1DF4F75FFF014628784FF47A7202282A +:1021D0001DD001281DD040F6340008444AF2EF011A +:1021E0000844B0FBF2F03A1A606A40F2E241B046AD +:1021F0004788F0304F43316A81420DD03946206B19 +:1022000000F08EF90646B84207D9FFDF05E0104618 +:10221000E3E74FF4C860E0E70026C04880688642E4 +:1022200007D2616A40F271224888424306EB4206B7 +:1022300004E040F2E240B6FBF0F0616AC882606AF6 +:10224000297880F86410297880F865100521417597 +:10225000C08A6FF41C71484306EB400040F63541DC +:10226000C8F81C00B0EB410F00D3FFDFBDE8F081E0 +:1022700010B5052937D2DFE801F00509030D31005B +:10228000002100E00121BDE8104027E7032180F88C +:10229000F01010BD0446408840F2E24148439F4997 +:1022A000091D0860D4F818010089E082D4F81801EB +:1022B00080796075D4F8180140896080D4F81801DD +:1022C0008089A080D4F81801C089E0802046A16AE6 +:1022D000FFF7D6FB022084F8F00010BD816ABDE84C +:1022E0001040FFF7CDBBFFDF10BD70B58A4C243C1A +:1022F0000928A1683FD2DFE800F0050B0B15131584 +:1023000038380800BDE8704049E6BDE8704063E633 +:10231000022803D00020BDE87040FFE60120FAE764 +:10232000E16070BD032802D005281CD000E0E16008 +:102330005FF0000600F059F9774D012085F828007C +:1023400085F83460686AA9690026C0F8F41080F83E +:10235000F060E068FFF744FB00B1FFDFF2F771FEC9 +:102360006E74AE7470BD0126E4E76C480078BDE879 +:102370007040E0F7B5BDFFDF70BD674924394860A4 +:10238000704770B5644D0446243DB1B14FF47A7680 +:10239000012903D0022905D0FFDF70BD1846F4F7EC +:1023A000E7FE05E06888401C68801046F5F7B0FF3E +:1023B00000F2E730B0FBF6F0201AA86070BD564876 +:1023C00000787047082803D0042801D0F4F75ABEDB +:1023D0004EF628307047002804DB00F1E02090F82A +:1023E000000405E000F00F0000F1E02090F8140D6B +:1023F0004009704710F00C0000D008467047F3F712 +:1024000039B910B50446202800D3FFDF42484430D4 +:1024100030F8140010BD70B505460C461046F4F7B0 +:1024200031FE4FF47A71022C0DD0012C0DD040F604 +:10243000340210444AF247321044B0FBF1F0284411 +:1024400000F5CA7070BD0A46F3E74FF4C862F0E7C2 +:102450001FB513460A46044601466846FEF789FB47 +:1024600094F8FA006946FFF7CAFF002800D1FFDFA1 +:102470001FBD70B5284C0025257094F82000F2F798 +:10248000B6FE00B9FFDF84F8205070BD2DE9F041A1 +:10249000050000D1FFDF204A0024243AD5F804616A +:1024A0002046631E116A08E08869B04203D398424F +:1024B00001D203460C460846C9680029F4D104B984 +:1024C00004460021C5F80041F035C4B1E068E5607C +:1024D000E86000B105612E698846A96156B1B0690E +:1024E00030B16F69B84200D2FFDFB069C01BA8618C +:1024F000C6F81880084D5CB1207820B902E0E96088 +:102500001562E8E7FFDF6169606808442863ADE6AB +:10251000C5F83080AAE60000F011002084010020F8 +:1025200010B50C4601461046F3F76FFB002806DA9B +:10253000211A491EB1FBF4F101FB040010BD90FB10 +:10254000F4F101FB140010BD2E48016A002001E0E7 +:102550000846C9680029FBD170472DE9FE43294D83 +:102560000120287000264FF6FF7420E00621F0F7C6 +:10257000F5FC070000D1FFDF97F8FA00F037F3F71A +:10258000FFFB07F80A6BA14617F8FA89B8F1200F8C +:1025900000D3FFDF1B4A683222F8189097F8FA0040 +:1025A000F2F725FE00B9FFDF202087F8FA00694620 +:1025B0000620F0F75CFC50B1FFDF08E0029830B174 +:1025C00090F8F01019B10088A042CFD104E068461D +:1025D000F0F72BFC0028F1D02E70BDE8FE8310B57B +:1025E000FFF719FF00F5C87010BD06480021243020 +:1025F00090F8352000EB4200418503480078E0F771 +:102600006FBC0000CC11002084010020012804D000 +:10261000022805D0032808D105E0012907D004E0ED +:10262000022904D001E0042901D0002070470120D4 +:102630007047F748806890F8A21029B1B0F89E1052 +:10264000B0F8A020914215D290F8A61029B1B0F8A8 +:10265000A410B0F8A02091420CD2B0F89C20B0F8A1 +:102660009A108A4206D290F88020B0F898001AB1E9 +:10267000884203D3012070470628FBD20020704710 +:102680002DE9F041E24D0746A86800F1700490F88A +:10269000140130B9E27B002301212046FBF7F6F854 +:1026A00010B1A08D401CA08501263D21AFB928782E +:1026B000022808D001280AD06878C8B110F0140F99 +:1026C00009D01E2039E0162037E026773EE0A868C2 +:1026D00090F8160131E0020701D56177F5E781072F +:1026E00001D02A2029E0800600D4FFDF232024E047 +:1026F00094F8320028B1E08D411CE185218E88429A +:1027000013D294F8360028B1A08E411CA186218EE8 +:1027100088420AD2A18D608D814203D3AA6892F8C3 +:10272000142112B9228E914201D3222005E0217C8E +:1027300029B1218D814207D308206077C5E7208D1C +:10274000062801D33E20F8E7207FB0B10020207397 +:10275000607320740221A868FFF78AFDA86890F8CA +:10276000E410012904D1D0F81C110878401E08702B +:10277000E878BDE8F041E0F7B3BBA868BDE8F041F8 +:102780000021FFF775BDA2490C28896881F8E40093 +:1027900014D0132812D0182810D0002211280ED0DF +:1027A00007280BD015280AD0012807D0002805D00B +:1027B000022803D021F89E2F012008717047A1F84C +:1027C000A420704710B5924CA1680A88A1F8602136 +:1027D00081F85E0191F8640001F046FBA16881F880 +:1027E000620191F8650001F03FFBA16881F8630187 +:1027F000012081F85C01002081F82E01E078BDE81D +:102800001040E0F76DBB70B5814C00231946A068FD +:1028100090F87C207030FBF739F800283DD0A06894 +:1028200090F820110025C9B3A1690978B1BB90F8CF +:102830007D00FBF713F888BBA168B1F870000A2887 +:102840002DD905220831E069EBF7C2FD10B3A0686D +:10285000D0F81C11087858B10522491CE069EBF743 +:10286000B7FD002819D1A068D0F81C01007840B944 +:10287000A068E169D0F81C010A68C0F80120097954 +:102880004171A068D0F81C110878401C0870012024 +:10289000FFF779FFA06880F8205170BDFFE7A068BE +:1028A00090F8241111B190F82511C1B390F82E11B0 +:1028B0000029F2D090F82F110029EED190F87D0078 +:1028C000FAF7CCFF0028E8D1A06890F8640001F086 +:1028D000CBFA0646A06890F8650001F0C5FA0546F7 +:1028E000A06890F830113046FFF790FEA0B3A068C2 +:1028F00090F831112846FFF789FE68B3A268B2F854 +:10290000703092F86410B2F8320102F58872FBF769 +:102910002DFA20B3A168252081F87C00BDE7FFE7F0 +:1029200090F87D10242918D090F87C10242914D018 +:102930005FF0000300F5897200F59271FBF78EFEDF +:10294000A16881F8245101F13000C28A21F8E62FF4 +:10295000408B4880142007E005E00123EAE7BDE84A +:10296000704000202EE71620BDE870400BE710B540 +:10297000F3F7E8FD0C2813D3254C0821A068D0F804 +:1029800018011E30F3F7E2FD28B1A0680421D83009 +:10299000F3F7DCFD00B9FFDFBDE810400320F2E6ED +:1029A00010BD10B51A4CA068D0F818110A78002A8A +:1029B0001FD04988028891421BD190F87C200023C7 +:1029C00019467030FAF762FF002812D0A068D0F8DC +:1029D00018110978022907D003290BD0042919D02E +:1029E000052906D108200DE090F87D00FAF736FFA2 +:1029F00040B110BD90F8811039B190F8820000B953 +:102A0000FFDF0A20BDE81040BDE6BDE81040AEE79C +:102A10009001002090F8AA008007EAD10C20FFF76F +:102A2000B2FEA068002120F89E1F01210171017BE8 +:102A300041F00101017310BD70B5F74CA268556EED +:102A4000FBF72EF9EBB2C1B200228B4203D0A36890 +:102A500083F8121102E0A16881F81221C5F3072161 +:102A6000C0F30720814203D0A16881F8130114E765 +:102A7000A06880F8132110E710B5E74C0421A06886 +:102A8000FFF7F6FBA06890F85A10012908D000F56E +:102A90009E71FBF7ACFEE078BDE81040E0F720BA8D +:102AA000022180F85A1010BD70B5DB4CA06890F878 +:102AB000E410FE2955D16178002952D190F87F2089 +:102AC000002301217030FAF7E1FE002849D1A06807 +:102AD00090F8141109B1022037E090F87C2000230F +:102AE00019467030FAF7D2FE28B1A06890F8960027 +:102AF00008B1122029E0A068002590F87C20122A55 +:102B00001DD004DC032A23D0112A04D119E0182A8D +:102B10001AD0232A26D0002304217030FAF7B6FEFB +:102B200000281ED1A06890F87D10192971D020DCF2 +:102B300001292AD0022935D0032932D120E00B20E7 +:102B400003E0BDE8704012E70620BDE870401AE6D9 +:102B500010F8E21F01710720FFF715FEA06880F84A +:102B60007C509AE61820FFF70EFEA068A0F89E5051 +:102B700093E61D2918D01E2916D0212966D149E0D7 +:102B800010F8E11F4171072070E00C20FFF7FBFDFA +:102B9000A06820F8A45F817941F00101817100F8FB +:102BA000275C53E013202CE090F8252182BB90F89D +:102BB0002421B2B1242912D090F87C1024290ED0FF +:102BC0005FF0000300F5897200F59271FBF746FD96 +:102BD000A0681E2180F87D1080F8245103E00123B5 +:102BE000F0E71E2932D1A068FBF797FDFFF744FFFD +:102BF000A16801F13000C28A21F8E62F408B48809D +:102C00001520FFF7C0FDA068A0F8A45080F87D5003 +:102C10001CE02AE090F8971051B180F8125180F82A +:102C200013511820FFF7AFFDA068A0F8A4500DE0E5 +:102C300090F82F1151B990F82E1139B1C16DD0F81B +:102C40003001FFF7F9FE1820FFF79DFDA06890F80E +:102C5000E400FE2885D1FFF7A4FEA06890F8E40008 +:102C6000FE2885D1BDE87040CDE51120FFF78BFD32 +:102C7000A068CBE7684A0129926819D0002302298D +:102C80000FD003291ED010B301282BD0032807D161 +:102C900092F87C00132803D0162801D0182804D1FC +:102CA000704792F8E4000028FAD0D2F8180117E033 +:102CB00092F8E4000128F3D0D2F81C110878401EE5 +:102CC0000870704792F8E4000328EED17047D2F8FC +:102CD0001801B2F870108288891A09B20029F5DB50 +:102CE00003707047B2F87000B2F82211401A00B2B7 +:102CF0000028F6DBD2F81C010178491E01707047EC +:102D000070B5044690F87C0000250C2810D00D28E2 +:102D10002ED1D4F81811B4F870008988401C88426C +:102D200026D1D4F864013C4E017811B3FFDF42E0B4 +:102D3000B4F87000B4F82211401C884218D1D4F8BD +:102D40001C01D0F80110A1604079207303212046B6 +:102D5000FAF780FAD4F81C01007800B9FFDF0121EE +:102D6000FE20FFF787FF84F87C50012084F8B20032 +:102D700093E52188C180D4F81801D4F86411408902 +:102D80000881D4F81801D4F8641180894881D4F8F6 +:102D90001801D4F86411C0898881D4F864010571E0 +:102DA000D4F8641109200870D4F864112088488090 +:102DB000F078E0F795F802212046FAF74BFA032164 +:102DC0002046FFF755FAB068D0F8180100780228BD +:102DD00000D0FFDF0221FE20FFF74CFF84F87C507B +:102DE0005BE52DE9F0410C4C00260327D4F808C020 +:102DF000012598B12069C0788CF8E20005FA00F04E +:102E0000C0F3C05000B9FFDFA06800F87C7F4684A3 +:102E100080F82650BDE8F0819001002000239CF846 +:102E20007D2019460CF17000FAF730FD70B1607822 +:102E30000028EFD12069C178A06880F8E11080F8FF +:102E40007D70A0F8A46080F8A650E3E76570E1E724 +:102E5000F0B5F74C002385B0A068194690F87D20A6 +:102E60007030FAF713FD012580B1A06890F87C005E +:102E700023280ED024280CD06846F5F73DFB68B116 +:102E8000009801A9C0788DF8040008E0657005B0CD +:102E9000F0BD607840F020006070F8E70021A06885 +:102EA00003AB162290F87C00FAF77BFF002648B1AE +:102EB000A0689DF80C20162180F80C2180F80D11D7 +:102EC000192136E02069FBF718FB78B121690879F0 +:102ED00000F00702A06880F85C20497901F0070142 +:102EE00080F85D1090F82F310BBB03E00020FFF756 +:102EF00078FFCCE790F82E31CBB900F164035F780E +:102F0000974205D11A788A4202D180F897500EE094 +:102F100000F5AC71028821F8022990F85C200A7152 +:102F200090F85D0048710D70E078DFF7D9FFA06878 +:102F3000212180F87D1080F8A650A0F8A460A6E7B3 +:102F4000F8B5BB4C00231946A06890F87D2070307E +:102F5000FAF79CFC40B32069FBF7B4FA48B3206948 +:102F6000FBF7AAFA07462069FBF7AAFA064620698A +:102F7000FBF7A0FA05462069FBF7A0FA0146009787 +:102F8000A06833462A463030FBF79BFBA168012539 +:102F900091F87C001C2810D091F85A00012812D01A +:102FA00091F8250178B90BE0607840F0010060707D +:102FB000F8BDBDE8F840002013E781F85A5002E060 +:102FC00091F8240118B11E2081F87D000BE01D202E +:102FD00081F87D0001F5A57231F8300BFBF7FBFBA2 +:102FE000E078DFF77DFFA068002120F8A41F85703E +:102FF000F8BD10B58E4C00230921A06890F87C2004 +:103000007030FAF743FC48B16078002805D1A16818 +:1030100001F8960F087301F81A0C10BD01206070BA +:1030200010BD7CB5824C00230721A06890F87C205D +:103030007030FAF72BFC38B36078002826D1694647 +:103040002069FBF755FA9DF80000002500F02501E6 +:10305000A06880F8B0109DF8011001F0490180F8D7 +:10306000B11080F8A250D0F8181100884988814228 +:1030700000D0FFDFA068D0F818110D70D0F86411EF +:103080000A7822B1FFDF16E0012060707CBD30F8C5 +:10309000E82BCA80C16F0D71C16F009A8A60019AD6 +:1030A000CA60C26F0821117030F8E81CC06F4180FF +:1030B000E078DFF715FFA06880F87C507CBD70B524 +:1030C0005B4C00231946A06890F87D207030FAF719 +:1030D000DDFB012540B9A0680023082190F87C2081 +:1030E0007030FAF7D3FB10B36078002820D1A068C5 +:1030F00090F8AA00800712D42069FBF7BFF9A168F5 +:1031000081F8AB00206930F8052FA1F8AC20408889 +:10311000A1F8AE0011F8AA0F40F002000870A068F4 +:103120004FF0000690F8AA10C90702D011E06570B0 +:103130009DE490F87D20002319467030FAF7A6FB35 +:1031400000B9FFDFA06880F87D5080F8A650A0F895 +:10315000A460A06890F87C10012906D180F87C60FA +:1031600080F8A260E078DFF7BBFEA168D1F8180113 +:10317000098842888A42DBD101780429D8D10670B7 +:10318000E078DFF7ADFEA06890F87C100029CFD181 +:1031900080F8A2606BE470B5254DA86890F87C10AB +:1031A0001A2902D00220687061E469780029FBD1F5 +:1031B000002480F8A74080F8A240D0F818110088B9 +:1031C0004988814200D0FFDFA868D0F818110C7040 +:1031D000D0F864110A780AB1FFDF25E090F8A82042 +:1031E00072B180F8A8400288CA80D0F864110C71CE +:1031F000D0F864210E2111700188D0F864010DE02F +:1032000030F8E82BCA80C16F0C71C26F01211172B6 +:10321000C26F0D21117030F8E81CC06F418000F0C2 +:10322000A1FEE878DFF75CFEA86880F87C401EE429 +:103230009001002070B5FA4CA16891F87C20162A04 +:1032400001D0132A02D191F8A82012B10220607097 +:103250000DE46278002AFBD181F8E000002581F8B6 +:10326000A75081F8A250D1F81801098840888842F7 +:1032700000D0FFDFA068D0F818010078032800D044 +:10328000FFDF0321FE20FFF7F5FCA068D0F86411F2 +:103290000A780AB1FFDF14E030F8E02BCA8010F89A +:1032A000081BC26F1171C16F0D72C26F0D211170B9 +:1032B00030F8E81CC06F418000F054FEE078DFF782 +:1032C0000FFEA06880F87C504BE470B5D44C092107 +:1032D0000023A06890F87C207030FAF7D7FA002518 +:1032E00018B12069007912281ED0A0680A21002395 +:1032F00090F87C207030FAF7C9FA18B1206900798B +:10330000142814D02069007916281AD1A06890F8E2 +:103310007C101F2915D180F87C5080F8A250BDE8A0 +:1033200070401A20FFF74EBABDE8704061E6A06811 +:1033300000F87C5F458480F82650BDE87040FFF7B8 +:103340009BBB0EE470B5B64C2079C00773D02069E2 +:1033500000230521C578A06890F87C207030FAF72A +:1033600095FA98B1062D11D006DC022D0ED0042D51 +:103370000CD0052D06D109E00B2D07D00D2D05D061 +:10338000112D03D0607840F008006070607800284C +:1033900051D12069FAF7D6FF00287ED02069002598 +:1033A0000226C178891E162977D2DFE801F00B7654 +:1033B00034374722764D76254A457676763A53500D +:1033C0006A6D7073A0680023012190F87F2070302F +:1033D000FAF75CFA08BB2069FBF718F8A16881F8D6 +:1033E0001601072081F87F0081F8A65081F8A250CD +:1033F00056E0FFF76AFF53E0A06890F87C100F29B1 +:1034000001D066704CE0617839B980F881501221A2 +:1034100080F87C1044E000F0D0FD41E000F0ACFD0D +:103420003EE0FBF7A8F803283AD12069FBF7A7F89C +:10343000FFF700FF34E03BE00079F9E7FFF7ABFE70 +:103440002EE0FFF73CFE2BE0FFF7EBFD28E0FFF757 +:10345000D0FD25E0A0680023194690F87D2070304B +:10346000FAF714FA012110B16078C8B901E061706F +:1034700016E0A06820F8A45F817000F8276C0FE0C8 +:103480000BE0FFF75DFD0BE000F034FD08E0FFF717 +:10349000DFFC05E000F0FAFC02E00020FFF7A1FCF1 +:1034A000A268F2E93001401C41F10001C2E90001CB +:1034B0005EE42DE9F0415A4C2079800741D56078CF +:1034C00000283ED1E06801270026C178204619294E +:1034D000856805F170006FD2DFE801F04B3E0D6F9B +:1034E000C1C1801C34C1556287C1C1C1C1BE8B95A9 +:1034F00098A4B0C1BA0095F87F2000230121FAF703 +:10350000C5F900281DD1A068082180F87F1080F837 +:10351000A26090E0002395F87D201946FAF7B6F9ED +:1035200010B1A06880F8A660A0680023194690F842 +:103530007C207030FAF7AAF9002802D0A06880F841 +:10354000A26067E4002395F87C201946FAF79EF9FB +:1035500000B9FFDF042008E0002395F87C2019461D +:10356000FAF794F900B9FFDF0C20A16881F87C001C +:1035700050E4002395F87C201946FAF787F900B942 +:10358000FFDF0D20F1E7002395F87C201946FAF7BC +:103590007DF900B9FFDFA0680F2180F8A77008E06F +:1035A00095F87C00122800D0FFDFA068112180F878 +:1035B000A87080F87C102DE451E0002395F87C2061 +:1035C0001946FAF763F920B9A06890F8A80000B985 +:1035D000FFDFA068132180F8A770EAE795F87C0068 +:1035E000182800D0FFDF1A20BFE7BDE8F04100F047 +:1035F00063BD002395F87C201946FAF747F900B916 +:10360000FFDF0520B1E785F8A66003E4002395F805 +:103610007C201946FAF73AF900B9FFDF1C20A4E72D +:1036200090010020002395F87D201946FAF72EF925 +:1036300000B9FFDFA06880F8A66006E4002395F8D3 +:103640007C201946FAF722F900B9FFDF1F208CE72A +:10365000BDE8F04100F0F8BC85F87D60D3E7FFDFFE +:103660006FE710B5F74C6078002837D12079400714 +:103670000FD5A06890F87C00032800D1FFDFA06878 +:1036800090F87F10072904D101212170002180F8D2 +:103690007F10FFF70EFF00F0B5FCFFF753FEA07898 +:1036A000000716D5A0680023052190F87C20703013 +:1036B000FAF7ECF850B108206070A068D0F86411F7 +:1036C00008780D2800D10020087002E00020F8F7EB +:1036D00011FDA068BDE81040FFF712BB10BD2DE939 +:1036E000F041D84C07464FF0000560780843607001 +:1036F000207981062046806802D5A0F8985004E021 +:10370000B0F89810491CA0F8981000F018FD012698 +:10371000F8B1A088000506D5A06890F8821011B114 +:10372000A0F88E5015E0A068B0F88E10491CA0F8E3 +:103730008E1000F0F3FCA068B0F88E10B0F8902066 +:10374000914206D3A0F88E5080F83A61E078DFF716 +:10375000C7FB207910F0600F08D0A06890F88010A7 +:1037600021B980F880600121FEF782FD1FB9FFF7C3 +:1037700078FFFFF799F93846FEF782FFBDE8F04180 +:10378000F4F7C9BEAF4A51789378194313D1114663 +:103790000128896808D01079400703D591F87F0087 +:1037A000072808D001207047B1F84C00098E8842E4 +:1037B00001D8FEF7E2B900207047A249C2788968B3 +:1037C000012A06D05AB1182A08D1B1F81011FAF717 +:1037D000B0BEB1F822114172090A81727047D1F866 +:1037E000181189884173090A8173704770B5954C27 +:1037F00005460E46A0882843A080A80703D5E80701 +:1038000000D0FFDFE660E80700D02661A80719D5E1 +:10381000F078062802D00B2814D10BE0A06890F8AD +:103820007C1018290ED10021E0E93011012100F8A7 +:103830003E1C07E0A06890F87C10122902D10021FC +:1038400080F88210280601D50820A07068050AD5E6 +:10385000A0688288B0F87010304600F07FFC3046D7 +:10386000BDE87040A9E763E43EB505466846F4F755 +:103870001DFE00B9FFDF222200210098EAF7FFFDBC +:1038800003210098FAF746FD0098017821F0100115 +:1038900001702946FAF763FD6A4C192D71D2DFE8F1 +:1038A00005F020180D3EC8C8C91266C8C9C959C854 +:1038B000C8C8C8BBC9C971718AC89300A1680098FB +:1038C00091F8151103E0A168009891F8E6100171D4 +:1038D000B0E0A068D0F81C110098491CFAF78BFDE5 +:1038E000A8E0A1680098D1F8182192790271D1F866 +:1038F000182112894271120A8271D1F81821528955 +:10390000C271120A0272D1F8182192894272120A07 +:103910008272D1F81811C989FAF744FD8AE0A068CB +:10392000D0F818110098091DFAF772FDA068D0F8B8 +:10393000181100980C31FAF775FDA068D0F818112D +:1039400000981E31FAF774FDA1680098D831FAF793 +:103950007DFD6FE062690098117801719188417175 +:10396000090A81715188C171090A017262E0364900 +:10397000D1E90001CDE9010101A90098FAF780FD24 +:1039800058E056E0A068B0F844100098FAF78AFDB5 +:10399000A068B0F8E6100098FAF788FDA068B0F8C3 +:1039A00048100098FAF776FDA068B0F8E810009883 +:1039B000FAF774FD3EE0A168009891F83021027199 +:1039C00091F83111417135E0A06890F81301FAF7D0 +:1039D0005EF901460098FAF7A8FDA06890F8120178 +:1039E00000F03DFA70B1A06890F8640000F037FA7A +:1039F00040B1A06890F8121190F86400814201D0A3 +:103A0000002002E0A06890F81201FAF740F90146A0 +:103A10000098FAF786FD0DE0A06890F80D11009867 +:103A2000FAF7A7FDA06890F80C110098FAF7A5FD29 +:103A300000E0FFDFF4F74DFD00B9FFDF0098FFF76E +:103A4000BCFE3EBD900100206C64020010B5F94C34 +:103A5000A06890F8121109B990F8641080F8641009 +:103A600090F8131109B990F8651080F865100020DE +:103A7000FEF7A8FEA068FAF750FE002806D0A0685E +:103A8000BDE8104000F59E71FAF7B1BE10BDF8B563 +:103A9000E84E00250446B060B5807570B57035708D +:103AA0000088F4F700FDB0680088F4F722FDB4F850 +:103AB000F800B168401C82B201F17000F9F79FFC78 +:103AC00000B1FFDF94F87D00242809D1B4F870100C +:103AD000B4F81001081A00B2002801DB707830B188 +:103AE00094F87C0024280AD0252808D015E0FFF798 +:103AF000ADFF84F87D50B16881F897500DE0B4F8BF +:103B00007010B4F81001081A00B2002805DB7078B4 +:103B100018B9FFF79BFF84F87C50A4F8F850FEF723 +:103B200088FD00281CD1B06890F8E400FE2801D080 +:103B3000FFF79AFEC0480090C04BC14A2146284674 +:103B4000F8F70CFAB0680023052190F87C2070305B +:103B5000F9F79CFE002803D0BDE8F840F7F7A5BFB1 +:103B6000F8BD10B5FEF765FD20B10020BDE810409E +:103B70000146B4E5BDE81040F8F798BA70B50C46B8 +:103B8000154606464FF4B47200212046EAF777FC4A +:103B9000268005B9FFDF2868C4F818016868C4F8F2 +:103BA0001C01A868C4F8640182E4EFF7E1BA2DE9CA +:103BB000F0410D4607460621EFF7D0F9041E3DD02F +:103BC000D4F864110026087858B14A8821888A42BE +:103BD00007D109280FD00E2819D00D2826D0082883 +:103BE0003ED094F83A01D0B36E701020287084F85B +:103BF0003A61AF809AE06E7009202870D4F86401B1 +:103C0000416869608168A9608089A88133E00846BD +:103C1000EFF7D7FA0746EEF782FF70B96E700E2005 +:103C20002870D4F864014068686011E00846EFF736 +:103C3000C8FA0746EEF773FF08B1002081E46E7002 +:103C40000D202870D4F864014168696000892881DA +:103C5000D4F8640106703846EEF75BFF66E00EE0CC +:103C60006E7008202870D4F864014168696081682A +:103C7000A960C068E860D4F86401067056E094F862 +:103C80003C0198B16E70152028700AE084F83C6100 +:103C9000D4F83E016860D4F84201A860D4F8460127 +:103CA000E86094F83C010028F0D13FE094F84A0124 +:103CB00058B16E701C20287084F84A610A2204F5FD +:103CC000A671281DEAF7B1FB30E094F8560140B127 +:103CD0006E701D20287084F85661D4F85801686011 +:103CE00024E094F8340168B16E701A20287004E062 +:103CF00084F83461D4F83601686094F834010028FF +:103D0000F6D113E094F85C01002897D06E7016206D +:103D1000287007E084F85C61D4F85E016860B4F84C +:103D20006201288194F85C010028F3D1012008E4A5 +:103D3000404A5061D170704770B50D4604464EE060 +:103D4000B4F8F800401CA4F8F800B4F89800401C3F +:103D5000A4F89800204600F0F2F9B8B1B4F88E004B +:103D6000401CA4F88E00204600F0D8F9B4F88E006C +:103D7000B4F89010884209D30020A4F88E000120E6 +:103D800084F83A012B48C078DFF7AAF894F8A2002B +:103D900020B1B4F89E00401CA4F89E0094F8A60040 +:103DA00020B1B4F8A400401CA4F8A40094F81401B5 +:103DB00040B994F87F200023012104F17000F9F745 +:103DC00065FD20B1B4F89C00401CA4F89C0020467E +:103DD000FEF796FFB4F87000401CA4F870006D1E4A +:103DE000ADB2ADD23FE5134AC2E90601704770B5E6 +:103DF0000446B0F8980094F88010D1B1B4F89A1045 +:103E00000D1A2D1F94F8960040B194F87C200023E1 +:103E1000092104F17000F9F739FDB8B1B4F88E60EA +:103E2000204600F08CF980B1B4F89000801B001F90 +:103E30000CE007E090010020DF3602008537020029 +:103E4000ED370200C0F10205DCE72846A84200DA9F +:103E50000546002D01DC002005E5A8B203E510F0C1 +:103E60000C0000D00120704710B5012808D00228AE +:103E700008D0042808D0082806D0FFDF204610BD4F +:103E80000124FBE70224F9E70324F7E770B5CC4CE3 +:103E9000A06890F87C001F2804D0607840F00100F2 +:103EA0006070E0E42069FAF732FBD8B120690122A2 +:103EB0000179407901F0070161F30705294600F017 +:103EC000070060F30F21A06880F8A2200022A0F86C +:103ED0009E20232200F87C2FD0F8B400BDE870406B +:103EE000FEF7AABD0120FEF77CFFBDE870401E2052 +:103EF000FEF768BCF8B5B24C00230A21A06890F820 +:103F00007C207030F9F7C2FC38B32069FAF7DAFA8E +:103F1000C8B12069FAF7D0FA07462069FAF7D0FA53 +:103F200006462069FAF7C6FA05462069FAF7C6FA86 +:103F300001460097A06833462A463030FAF7C1FBA5 +:103F4000A068FAF7EAFBA168002081F8A20081F8D6 +:103F50007C00BDE8F840FEF78FBD607840F00100BE +:103F60006070F8BD964810B580680088EFF729F9B1 +:103F7000BDE81040EEF7BEBD10B5914CA36893F8B4 +:103F80007C00162802D00220607010BD60780028E6 +:103F9000FBD1D3F81801002200F11E010E30C83306 +:103FA000F9F7EEFBA0680021C0E92E11012180F88D +:103FB0008110182180F87C1010BD10B5804CA068CD +:103FC00090F87C10132902D00220607010BD617837 +:103FD0000029FBD1D0F8181100884988814200D00F +:103FE000FFDFA068D0F8181120692631FAF73BFAF4 +:103FF000A1682069DC31FAF73EFAA168162081F841 +:104000007C0010BD10B56E4C207900071BD5607880 +:10401000002818D1A068002190F8E400FEF72AFEDD +:10402000A06890F8E400FE2800D1FFDFA068FE2120 +:1040300080F8E41090F87F10082904D10221217043 +:10404000002180F87F1010BD70B55D4D2421002443 +:10405000A86890F87D20212A05D090F87C20232A9A +:1040600018D0FFDFA0E590F8122112B990F81321C3 +:104070002AB180F87D10A86880F8A64094E500F881 +:104080007D4F847690F8B1000028F4D00020FEF730 +:1040900099FBF0E790F8122112B990F813212AB198 +:1040A00080F87C10A86880F8A2407DE580F87C400C +:1040B0000020FEF787FBF5E770B5414C0025A068AE +:1040C000D0F8181103884A889A4219D1097804292E +:1040D00016D190F87C20002319467030F9F7D6FBF2 +:1040E00000B9FFDFA06890F8AA10890703D4012166 +:1040F00080F87C1004E080F8A250D0F81801057018 +:10410000A0680023194690F87D207030F9F7BEFBB7 +:10411000002802D0A06880F8A65045E5B0F89020AD +:10412000B0F88E108A4201D3511A00E00021828833 +:10413000521D8A4202D3012180F89610704710B5B3 +:1041400090F8821041B990F87C200023062170304D +:10415000F9F79CFB002800D0012010BD70B5114478 +:10416000174D891D8CB2C078A968012806D040B1CE +:10417000182805D191F8120138B109E0A1F82241BF +:1041800012E5D1F8180184800EE591F8131191B170 +:10419000FFF765FE80B1A86890F86400FFF75FFE46 +:1041A00050B1A86890F8121190F86420914203D0A1 +:1041B00090F8130100B90024A868A0F81041F3E4B6 +:1041C0009001002070B58E4C0829207A6CD2DFE86F +:1041D00001F004176464276B6B6458B1F3F7BEF801 +:1041E000F4F7B7F80020A072F3F796F9BDE8704035 +:1041F000F3F726BCF4F7CFF8BDE87040F0F721BF25 +:10420000DEF742FDF3F7E6FFD4E90001F0F7F5FC35 +:104210002060A07A401CC0B2A072282824D370BDB0 +:10422000A07A0025401EC6B2E0683044F3F7CEFC09 +:1042300010B9E1687F208855A07A272828BF01257A +:10424000DEF722FDA17A01EB4102C2EB81110844A5 +:104250002946F3F7E9FFA07A282809D2401CC0B20A +:10426000A072282828BF70BDBDE87040F3F754B98C +:10427000207A002818BF00F085F8F3F717FBF3F752 +:10428000C5FBF4F788F80120E0725E480078DEF79D +:1042900027FEBDE87040F0F7D4BE002808BF70BD0F +:1042A000BDE8704000F06EB8FFDF70BD10B5544C33 +:1042B000207A002804BF0C2010BD00202072E0727C +:1042C000607AF1F7F1FA607AF1F75AFD607AF0F767 +:1042D0008EFF00280CBF1F20002010BD002270B5EB +:1042E000474C06460D46207A68B12272E272607A27 +:1042F000F1F7DAFA607AF1F743FD607AF0F777FFC9 +:10430000002808BFFFDF3F48E560067070BD70B54C +:10431000050007D0A5F5E8503B494C3881429CBFC9 +:10432000122070BD364CE068002804BF092070BD23 +:10433000207A00281CBF0C2070BD3448F0F7FCFE2A +:104340006072202804BF1F2070BDF0F76FFF20604F +:10435000002D1CBF2844206001206560207200F001 +:1043600011F8002070BD2649CA7A002A04BF002037 +:1043700070471E22027000224270CB684360CA72EE +:1043800001207047F0B585B0F0F750FF1C4D07468F +:10439000394668682C6800EB800046002046F1F73B +:1043A00034FCB04206DB6868811B3846F0F725FC18 +:1043B0000446286040F2357621463846F1F725FC60 +:1043C000B04204DA31463846F0F717FC04460020C4 +:1043D0008DF8000040F6E110039004208DF80500F0 +:1043E00001208DF8040068460294F1F7C7F8687A56 +:1043F0006946F1F73FF9002808BFFFDF05B0F0BDBF +:1044000074120020B0010020B5EB3C00C541020051 +:104410002DE9F0410C4612490D68114A1149083244 +:104420001160A0F12001312901D301200CE04128C5 +:1044300010D040CC0C4F94E80E0007EB8000241FF6 +:1044400050F8807C3046B84720600548001D056064 +:10445000BDE8F081204601F01BFDF5E7062070471E +:1044600010050240010000017464020010B55548B7 +:10447000F1F7EAFF00B1FFDF5248401CF1F7E4FF1B +:10448000002800D0FFDF10BD2DE9F14F4E4E82B065 +:10449000D6F800B001274B48F1F7DEFFDFF82481A2 +:1044A00020B9002708F10100F1F7ECFF474C002587 +:1044B0004FF0030901206060C4F80051C4F80451B2 +:1044C000029931602060DFF808A11BE0DAF80000F3 +:1044D000C00617D50E2000F068F8EFF3108010F03A +:1044E000010072B600D001200090C4F80493D4F803 +:1044F000000120B9D4F8040108B9DEF775FD009871 +:1045000000B962B6D4F8000118B9D4F80401002843 +:10451000DCD0D4F804010028CCD137B1C6F800B003 +:1045200008F10100F1F798FF11E008F10100F1F73F +:1045300093FF0028B6D1C4F80893C4F80451C4F816 +:1045400000510E2000F031F81E48F1F79BFF0020CB +:10455000BDE8FE8F2DE9F0438DB00D4606460024E0 +:104560000DF110090DF1200818E000BF04EB44071D +:10457000102255F827106846E9F757FF05EB870723 +:10458000102248467968E9F750FF6846FFF77CFF3C +:1045900010224146B868E9F748FF641CB442E5DBE5 +:1045A0000DB00020BDE8F0836EE7002809DB00F0C5 +:1045B0001F02012191404009800000F1E020C0F875 +:1045C00080127047B101002004E5004000E0004087 +:1045D00010ED00E0B54900200870704770B5B44D8B +:1045E00001232B60B34B1C68002CFCD0002407E097 +:1045F0000E6806601E68002EFCD0001D091D641C9C +:104600009442F5D30020286018680028FCD070BDC3 +:1046100070B5A64E0446A84D3078022800D0FFDFC2 +:10462000AC4200D3FFDF7169A448012903D847F2E7 +:104630003052944201DD03224271491C7161291BF1 +:10464000C1609E49707800F02EF9002800D1FFDF8C +:1046500070BD70B5954C0D466178884200D0FFDF83 +:10466000954E082D4BD2DFE805F04A041E2D4A4A2C +:104670004A382078022800D0FFDF03202070A0787D +:10468000012801D020B108E0A06801F0C1F904E0E0 +:1046900004F1080007C8FFF7A1FF05202070BDE85E +:1046A0007040F0F7CEBCF0F7C1FD01466068F1F74D +:1046B000ACFAB04202D2616902290BD30320F1F7B0 +:1046C000F4FD12E0F0F7B2FD01466068F1F79DFAE3 +:1046D000B042F3D2BDE870409AE7207802280AD0B1 +:1046E000052806D0FFDF04202070BDE8704000F0F0 +:1046F000D0B8022000E00320F1F7D7FDF3E7FFDF99 +:1047000070BD70B50546F0F791FD684C606020788B +:10471000012800D0FFDF69490120087000200871DE +:1047200004208D6048716448C86002202070607861 +:1047300000F0B9F8002800D1FFDF70BD10B55B4C68 +:10474000207838B90220F1F7C6FD18B90320F1F737 +:10475000C2FD08B1112010BD5948F0F7EDFC6070A2 +:10476000202804D0012020700020606110BD0320AB +:1047700010BD2DE9F0471446054600EB84000E46B7 +:10478000A0F1040801F057F907464FF08050016985 +:104790004F4306EB8401091FB14201D2012100E021 +:1047A000002189461CB10069B4EB900F02D90920A1 +:1047B000BDE8F0872846DCF745FD90B9A84510D341 +:1047C000BD4205D2B84503D245EA0600800701D0B4 +:1047D0001020EDE73046DCF735FD10B9B9F1000FD8 +:1047E00001D00F20E4E7374837490068884205D0F8 +:1047F000224631462846FFF7F1FE1AE0FFF79EFFFA +:104800000028D5D1294800218560C0E90364817062 +:10481000F1F7C3FD08B12D4801E04AF2F87060439A +:104820004FF47A7100F2E730B0FBF1F01830FFF787 +:1048300068FF0020BCE770B505464FF08050046962 +:104840006C432046DCF7FEFC08B10F2070BD01F080 +:10485000F2F8A84201D8102070BD1A481A49006821 +:10486000884203D0204601F0D3F810E0FFF766FF3E +:104870000028F1D10D48012184608170F1F78DFD90 +:1048800008B1134800E013481830FFF73AFF002042 +:1048900070BD10B5054C6078F0F7A9FC00B9FFDFDA +:1048A0000020207010BDF0F7E5BE0000B40100202C +:1048B00004E5014000E40140105C0C00841200207B +:1048C0005346020058000020BEBAFECA5028050018 +:1048D000645E0100A85B01007E4909680160002058 +:1048E00070477C4908600020704701218A0720B189 +:1048F000012804D042F204007047916700E0D167BC +:104900000020704774490120086042F20600704799 +:1049100008B50423704A1907103230B1C1F80433C6 +:10492000106840F0010010600BE0106820F00100FA +:104930001060C1F808330020C1F80801674800681A +:104940000090002008BD011F0B2909D862491031D1 +:104950000A6822F01E0242EA400008600020704708 +:1049600042F2050070470F2809D85B4910310A68E8 +:1049700022F4706242EA002008600020704742F290 +:1049800005007047000100F18040C0F804190020C4 +:104990007047000100F18040C0F8081900207047FE +:1049A000000100F18040D0F8000908600020704745 +:1049B000012801D907207047494A52F820000268AF +:1049C0000A43026000207047012801D90720704780 +:1049D000434A52F8200002688A4302600020704770 +:1049E000012801D9072070473D4A52F8200000688D +:1049F00008600020704702003A494FF0000003D0E1 +:104A0000012A01D0072070470A607047020036492A +:104A10004FF0000003D0012A01D0072070470A6040 +:104A2000704708B54FF40072510510B1C1F8042366 +:104A300008E0C1F808230020C1F8240127481C30F1 +:104A400000680090002008BD08B58022D10510B193 +:104A5000C1F8042308E0C1F808230020C1F81C01B4 +:104A60001E48143000680090002008BD08B54FF4BF +:104A70008072910510B1C1F8042308E0C1F8082341 +:104A80000020C1F82001154818300068009000206F +:104A900008BD10493831096801600020704770B5C1 +:104AA0004FF080450024C5F80841F1F782FC10B9A9 +:104AB000F1F789FC28B1C5F82441C5F81C41C5F8B7 +:104AC00020414FF0E020802180F800140121C0F83F +:104AD000001170BD000400400005004008010040C6 +:104AE0003865020078050040800500406249634B4C +:104AF0000A6863499A42096801D1C1F31001016053 +:104B0000002070475C495D4B0A685D49091D9A4267 +:104B100001D1C0F310000860002070475649574B80 +:104B20000A68574908319A4201D1C0F31000086061 +:104B30000020704730B5504B504D1C6842F20803BE +:104B4000AC4202D0142802D203E0112801D3184647 +:104B500030BDC3004B481844C0F81015C0F81425E8 +:104B6000002030BD4449454B0A6842F209019A428F +:104B700002D0062802D203E0042801D30846704779 +:104B8000404A012142F83010002070473A493B4B1F +:104B90000A6842F209019A4202D0062802D203E0D2 +:104BA000042801D308467047364A012102EBC000B1 +:104BB00041600020704770B52F4A304E314C156867 +:104BC00042F2090304EB8002B54204D0062804D265 +:104BD000C2F8001807E0042801D3184670BDC1F3DD +:104BE0001000C2F80008002070BD70B5224A234EA4 +:104BF000244C156842F2090304EB8002B54204D04C +:104C0000062804D2D2F8000807E0042801D3184689 +:104C100070BDD2F80008C0F310000860002070BD1D +:104C2000174910B50831184808601120154A0021AD +:104C300002EBC003C3F81015C3F81415401C142868 +:104C4000F6D3002006E0042804D302EB8003C3F867 +:104C5000001807E002EB8003D3F80048C4F3100407 +:104C6000C3F80048401C0628EDD310BD044906488F +:104C7000083108607047000058000020BEBAFECA24 +:104C800000F5014000F001400000FEFF814B1B6871 +:104C900003B19847BFF34F8F7F4801687F4A01F403 +:104CA000E06111430160BFF34F8F00BFFDE710B516 +:104CB000EFF3108010F0010F72B601D0012400E074 +:104CC000002400F0DDF850B1DCF760FBF0F759F894 +:104CD000F1F78DFAF1F7AEFF71490020086004B9D1 +:104CE00062B6002010BD2DE9F0410C460546EFF3F9 +:104CF000108010F0010F72B601D0012600E00026EE +:104D000000F0BEF820B106B962B60820BDE8F08117 +:104D100001F044F9DCF73EFB02460020012347097D +:104D2000BF0007F1E02700F01F01D7F80071CF4066 +:104D3000F9071BD0202803D222FA00F1C90727D196 +:104D400041B2002904DB01F1E02191F8001405E0F3 +:104D500001F00F0101F1E02191F8141D4909082922 +:104D600016D203FA01F717F0EC0F11D0401C64289B +:104D7000D5D3F1F73DFF4B4A4B490020F1F780FFB7 +:104D800047494A4808602046DCF763FA60B904E006 +:104D900006B962B641F20100B8E73E4804602DB1A1 +:104DA0002846DCF7A3FA18B1102428E0404D19E09A +:104DB0002878022802D94FF4805420E007240028E4 +:104DC000687801D0D8B908E0C8B1202817D8A878E9 +:104DD000212814D8012812D001E0A87878B9E87801 +:104DE0000B280CD8DCF7D6FA2946F1F7E6F9EFF7ED +:104DF00087FF00F053FE2846DCF796FA044606B912 +:104E000062B61CB1FFF753FF20467FE700207DE725 +:104E100010B5044600F034F800B1012020700020E5 +:104E200010BD244908600020704770B50C46224927 +:104E30000D682149214E08310E60102807D0112835 +:104E40000CD012280FD0132811D0012013E0D4E980 +:104E50000001FFF748FF354620600DE0FFF727FF10 +:104E60000025206008E02068FFF7D2FF03E0114929 +:104E700020680860002020600F48001D056070BD9C +:104E800007480A490068884201D101207047002084 +:104E900070470000CC0100200CED00E00400FA0592 +:104EA000580000204814002000000020BEBAFECAAE +:104EB00040650200040000201005024001000001CE +:104EC00000B59B4902282ED021DC10F10C0F08BF41 +:104ED000F42028D00FDC10F1280F08BFD82022D0F2 +:104EE00010F1140F08BFEC201DD010F1100F08BFF7 +:104EF000F02018D021E010F1080F08BFF82012D0E0 +:104F000010F1040F0CBFFC2000280CD015E0A0F11C +:104F10000300062811D2DFE800F00E0C0A08050392 +:104F2000082000E00720086000BD0620FBE7052000 +:104F3000F9E70420F7E70320F5E7FFDF00BD00B540 +:104F40007C49012808BF03200CD0022808BF042098 +:104F500008D0042808BF062004D0082816BFFFDFA9 +:104F6000052000BD086000BD70B505460C4616461C +:104F70001046F2F787F8022C08BF4FF47A7105D07B +:104F8000012C0CBF4FF4C86140F634014418304680 +:104F9000F2F7EEF8204449F6797108444FF47A713B +:104FA000B0FBF1F0281A70BD70B505460C460846F6 +:104FB000F3F7AEF9022C08BF40F24C4105D0012CAA +:104FC0000CBF40F634014FF4AF5149F6CA62511A92 +:104FD00008444FF47A7100F2E140B0FBF1F0281A76 +:104FE000801E70BD70B5064615460C460846F3F7A0 +:104FF0008FF9022D08BF4FF47A7105D0012D0CBF37 +:105000004FF4C86140F63401022C08BF40F24C4214 +:1050100005D0012C0CBF40F634024FF4AF52891A70 +:10502000084449F6FC6108444FF47A71B0FBF1F092 +:10503000301A70BD70B504460E460846F2F722F8E5 +:1050400005463046F2F794F828444AF2AB3108445A +:105050004FF47A71B0FBF1F0201A801E70BD2DE97B +:10506000F04107461E460D4614461046082A16BF54 +:1050700004284EF62830F2F705F807EB4701C1EB9C +:10508000C71100EBC100022D08BF40F24C4105D012 +:10509000012D0CBF40F634014FF4AF51471828469C +:1050A000F3F736F9381A4FF47A7100F6B730B0FBDF +:1050B000F1F52046F2F76BF828443044401DBDE876 +:1050C000F08170B5054614460E460846F1F7DAFF42 +:1050D00005EB4502C2EBC512C0EBC2053046F2F744 +:1050E00047F82D1A2046082C16BF04284EF6283003 +:1050F000F1F7C8FF28444FF47A7100F6B730B0FBDF +:10510000F1F52046F2F743F82844401D70BD0A49E6 +:10511000082818BF0428086803BF20F46C5040F426 +:10512000444040F0004020F000400860704700001C +:105130000C1500401015004040170040F0B585B038 +:105140000C460546F9F7FAF807466E78204603A99B +:105150006A46EDF7C0FC81198EB258B1012F02D01A +:10516000032005B0F0BD204604AA0399EDF7D5FB56 +:10517000049D01E0022F0FD1ED1C042E0FD32888CF +:10518000BDF80010001D80B2884201D8864202D1CD +:105190004FF00000E5E702D34FF00200E1E74FF0E7 +:1051A0000100DEE7FA48C078FF2814BF0120002084 +:1051B00070472DE9F041F74C0746160060680D4630 +:1051C00003D0F9F725F8A0B121E0F9F721F8D8B913 +:1051D0006068F9F71DF8D0B915F00C0F17D06068AA +:1051E000C17811F03F0F1CBF007910F0100F0ED0E6 +:1051F0000AE0022E08D0E6481FB1807DFF2806D0C5 +:1052000002E0C078FF2802D00120BDE8F081002034 +:10521000BDE8F0810A4601460120CAE710B5DC4C22 +:105220001D220021A01CE9F72AF97F206077FF20CA +:105230002074E070A075A08920F060002030A0816B +:105240000020207010BD70B5D24948600120087060 +:10525000D248D149002541600570CD4C1D22294618 +:10526000A01CE9F70CF97F206077FF202074E07024 +:10527000A075A08920F060002030A081257070BD4D +:105280002DE9F047C24C06462078C24F4FF0010985 +:1052900007F10808002520B13878D0B998F8000047 +:1052A000B8B198F8000068B387F80090D8F80410F7 +:1052B0003C2239B37570301DE9F7B7F8052030701E +:1052C00086F804903878002818BF88F8005005D078 +:1052D00015E03D70A11C4FF48E72EAE71D220021FB +:1052E000A01CE9F7CCF87F206077FF202074E070E5 +:1052F000A075A08920F060002030A08125700120D9 +:10530000BDE8F0870020BDE8F087A14800780028BC +:105310000CBF0120002070470A460146002048E7E4 +:1053200010B510B1022810D014E09A4C6068F8F75C +:105330006FFF78B96068C17811F03F0F1CBF00792A +:1053400010F0100F06D1012010BD9148007B10F025 +:10535000080FF8D1002010BD2DE9FF4F81B08C4D12 +:105360008346DDE90F042978DDF838A09846164613 +:1053700000291CBF05B0BDE8F08F884909780029D5 +:105380001CBF05B0BDE8F08FE872B4B1012E08BFB4 +:10539000012708D0022E08BF022704D0042E16BF12 +:1053A000082E0327FFDFEF7385F81E804FF00008FB +:1053B000784F8CB1022C1DD020E0012E08BF0127B0 +:1053C00008D0022E08BF022704D0042E16BF082ED4 +:1053D0000327FFDFAF73E7E77868F8F719FF68B9CD +:1053E0007868C17811F03F0F1CBF007910F0100FE2 +:1053F00004D110E0287B10F0080F0CD14FF003010E +:105400007868F8F7B9FD30B1417809092974008846 +:10541000C0F30B006882CDF800807868F8F7F8FEDA +:1054200001460128BDF8000005F102090CBF40F05B +:10543000010020F00100ADF8000099F80A2012F0F8 +:10544000020F4ED1022918BF20F0020049D000BF40 +:10545000ADF8000010F0020F04D0002908BF40F0A2 +:10546000080801D020F00808ADF800807868C178FD +:1054700011F03F0F1CBF007910F0020F0CD0314625 +:1054800022464FF00100FFF794FE002804BF48F0C9 +:105490000400ADF8000006D099F80A00800860F317 +:1054A0008208ADF8008099F80A004109BDF80000B3 +:1054B00061F34610ADF8000080B20090BDF8000026 +:1054C000A88104217868F8F757FD002804BFA8894F +:1054D00020F060000CD0B0F80100C004C00C03D074 +:1054E00007E040F00200B3E7A88920F060004030F8 +:1054F000A8815CB916F00C0F08D07868C17811F05B +:105500003F0F1CBF007910F0100F0DD17868C178E3 +:1055100011F03F0F08D0017911F0400F04D006219F +:10552000F8F72AFD00786877314622460020FFF719 +:1055300040FE60BB7968C87810F03F0F3FD0087913 +:1055400010F0010F3BD0504605F1040905F10308A6 +:10555000BAF1FF0F0DD04A464146F7F7AFFA0028DF +:1055600008BFFFDF98F8000040F0020088F8000054 +:1055700025E00846F8F797FC88F800007868F8F707 +:1055800069FC07280CD249467868F8F76EFC16E0EB +:1055900094120020D0010020D2120020D801002057 +:1055A0007868F8F757FC072809D100217868F8F7E0 +:1055B000E3FC0168C9F800108088A9F804003146AE +:1055C00022460120FFF7F5FD80BB7868C17811F015 +:1055D0003F0F2BD0017911F0020F27D005F11706EC +:1055E00005F11608BBF1020F18BFBBF1030F08D07D +:1055F000F8F730FC07280AD231467868F8F743FC00 +:1056000012E00298016831608088B0800CE0786810 +:10561000F8F720FC072807D101217868F8F7ACFCDF +:10562000016831608088B08088F800B0002C04BF29 +:1056300005B0BDE8F08F7868F8F7EAFD022804BFEE +:1056400005B0BDE8F08F05F11F047868F8F729FE72 +:10565000AB7AC3F1FF01884228BF084605D9A98962 +:1056600021F0600101F14001A981C2B203EB040104 +:105670007868F8F71EFEA97A0844A87205B0BDE85C +:10568000F08FB0480178002918BF704701220270DE +:10569000007B10F0080F14BF07200620FCF725BE82 +:1056A000A848C17B002908BF70470122818921F0E9 +:1056B0006001403181810378002B18BF7047027070 +:1056C00011F0080F14BF07200620FCF70EBE2DE9CD +:1056D000FF5F9C4FDDF838B0914638780E460028C1 +:1056E0001CBF04B0BDE8F09FBC1C1D220021204659 +:1056F000E8F7C5FE944D4FF0010A84F800A06868F1 +:10570000F8F7A8FB18B3012826D0022829D00628CC +:1057100018BFFFDF2AD000BF04F11D016868F8F749 +:10572000E2FB2072484604F1020904F10108FF2857 +:1057300021D04A464146F7F7C1F9002808BFFFDFEC +:1057400098F8000040F0020088F8000031E060891D +:1057500040F013006081DFE7608940F01500608150 +:10576000E0E7608940F010006081D5E7608940F093 +:1057700012006081D0E76868F8F795FB88F80000B0 +:105780006868F8F767FB072804D249466868F8F7A5 +:105790006CFB0EE06868F8F75DFB072809D1002173 +:1057A0006868F8F7E9FB0168C9F800108088A9F873 +:1057B000040084F809B084F80CA000206073FF2076 +:1057C000A073A17A11F0040F08BF20752AD004F14C +:1057D000150804F11409022E18BF032E09D06868B9 +:1057E000F8F738FB07280CD241466868F8F74BFBFE +:1057F00016E000980168C8F800108088A8F8040036 +:105800000EE06868F8F726FB072809D101216868CF +:10581000F8F7B2FB0168C8F800108088A8F8040007 +:1058200089F800607F20E0760398207787F800A051 +:1058300004B00620BDE8F05FFCF757BD2DE9FF5F1F +:10584000424F81469A4638788B4600281CBF04B0E8 +:10585000BDE8F09F3B48017831B1007B10F0100F9C +:1058600004BF04B0BDE8F09F1D227C6800212046E3 +:10587000E8F705FE48464FF00108661C324D84F8F3 +:10588000008004F10209FF280BD04A463146F7F7A1 +:1058900015F9002808BFFFDF307840F002003070B3 +:1058A0001CE06868F8F7FFFA30706868F8F7D2FA19 +:1058B000072804D249466868F8F7D7FA0EE0686806 +:1058C000F8F7C8FA072809D100216868F8F754FBEF +:1058D0000168C9F800108088A9F8040004F11D01CE +:1058E0006868F8F700FB207284F809A060896BF300 +:1058F000000040F01A00608184F80C800020607382 +:10590000FF20A07320757F20E0760298207787F82B +:10591000008004B00720BDE8F05FFCF7E6BC094A50 +:10592000137C834205BF508A8842002001207047C3 +:105930000448007BC0F3411002280CBF0120002066 +:105940007047000094120020D0010020D8010020F0 +:10595000C2790D2341B342BB8188012904D949088A +:10596000818004BF012282800168012918BF0029BB +:1059700030D001686FEA0101C1EBC10202EB0112F4 +:1059800081796FEA010101EB8103C3EB81111144BD +:105990004FEA914201608188B2FBF1F301FB1321D0 +:1059A00081714FF0010102E01AB14FF00001C171A5 +:1059B00070478188FF2908D24FF6FF7202EA410141 +:1059C0008180FF2984BFFF2282800168012918BFDE +:1059D0000029CED10360CCE7817931B1491E11F0A5 +:1059E000FF0181711CBF002070470120704710B576 +:1059F0000121C1718171818004460421F0F7A6FD67 +:105A0000002818BF10BD2068401C206010BD000099 +:105A10000B4A022111600B490B68002BFCD0084B8C +:105A20001B1D186008680028FCD000201060086862 +:105A30000028FCD070474FF080504069704700004C +:105A400004E5014000E4014002000B464FF0000075 +:105A5000014620D0012A04D0022A04D0032A0DD105 +:105A600003E0012002E0022015E00320072B05D20D +:105A7000DFE803F00406080A0C0E10000720704748 +:105A8000012108E0022106E0032104E0042102E0F4 +:105A9000052100E00621EFF76CBB0000E24805217C +:105AA00081700021017041707047E0490A78012A35 +:105AB00005D0CA681044C8604038F0F773B88A68E7 +:105AC00010448860F8E7002819D00378D849D94AEB +:105AD00013B1012B0ED011E00379012B00D06BB96B +:105AE00043790BB1012B09D18368643B8B4205D20A +:105AF000C0680EE00379012B02D00BB10020704783 +:105B000043790BB1012BF9D1C368643B8B42F5D2C9 +:105B100080689042F2D801207047C44901220A707F +:105B2000027972B100220A71427962B104224A718B +:105B3000826852328A60C068C860BB49022088709F +:105B400070470322EFE70322F1E770B5B74D044633 +:105B500000202870207988B100202871607978B100 +:105B60000420B14E6871A168F068EFF746F8A860AC +:105B7000E0685230E8600320B07070BD0120ECE7AF +:105B80000320EEE72DE9F04105460226EFF736FF48 +:105B9000006800B1FFDFA44C01273DB12878B8B1FF +:105BA000012805D0022811D0032814D027710DE058 +:105BB0006868C82808D30421F0F75BF820B168684A +:105BC000FFF773FF012603E0002601E000F014F95F +:105BD0003046BDE8F08120780028F7D16868FFF7EB +:105BE00072FF0028E2D06868017879B1A0780428B3 +:105BF00000D0FFDF01216868FFF7A7FF8B49E0783D +:105C000000F003F90028E1D1FFDFDFE7FFF785FFB0 +:105C10006770DBE72DE9F041834C0F46E17888425D +:105C200000D0FFDF00250126082F7DD2DFE807F036 +:105C3000040B28283D434F57A0780328C9D00228D9 +:105C4000C7D0FFDFC5E7A078032802D0022800D024 +:105C5000FFDF0420A07025712078B8BB0020FFF77B +:105C600024FF72480178012906D08068E06000F0C6 +:105C7000EDF82061002023E0E078EFF7F6FBF5E790 +:105C8000A078032802D0022800D0FFDF207880BB54 +:105C9000022F08D05FF00500F0F707FBA07803287B +:105CA00040D0A57095E70420F6E7A078042800D03E +:105CB000FFDF022004E0A078042800D0FFDF0120ED +:105CC000A1688847FFF75EFF054633E003E0A07850 +:105CD000042800D0FFDFBDE8F04100F08DB8A078C7 +:105CE000042804D0617809B1022800D0FFDF2078B1 +:105CF00018B1BDE8F04100F08AB8207920B1062043 +:105D0000F0F7D3FA25710DE0607840B14749E078AB +:105D100000F07BF800B9FFDF65705AE704E0072068 +:105D2000F0F7C3FAA67054E7FFDF52E73DB1012D4B +:105D300003D0FFDF022DF9D14BE70420C0E7032099 +:105D4000BEE770B5050004D0374CA078052806D111 +:105D500001E0102070BD0820F0F7BDFA08B1112055 +:105D600070BD3548EFF7E8F9E070202806D0012132 +:105D7000F0F79AF80020A560A07070BD032070BDF8 +:105D8000294810B5017809B1112010BD8178052985 +:105D900006D0012906D029B101210170002010BDD3 +:105DA0000F2010BD00F033F8F8E770B51E4C054623 +:105DB000A07808B1012809D155B12846FFF783FE24 +:105DC00040B1287840B1A078012809D00F2070BDDB +:105DD000102070BD072070BD2846FFF79EFE03E02F +:105DE00000212846FFF7B1FE1049E07800F00DF8D9 +:105DF00000B9FFDF002070BD0B4810B5006900F04E +:105E00001DF8BDE81040EFF71CB9EFF733BC0648AA +:105E100010B5C078EFF7EBF900B9FFDF0820F0F715 +:105E200044FABDE8104039E6E0010020B413002038 +:105E30003D860100FF1FA107155C02000C490A689E +:105E400048F202139A4302430A607047084A1168F5 +:105E500048F2021301EA03009943116070470246B9 +:105E6000044B10201344FC2B01D811600020704714 +:105E7000C80602400018FEBF01B41EB400B5F0F71A +:105E80002DFC01B40198864601BC01B01EBD000086 +:105E90008269034981614FF001001044704700009E +:105EA000795E0200FEDF18490978F9B904207146CD +:105EB00008421BD10699154A914217DC069902291E +:105EC00014DB02394878DF2810D10878FE2807D083 +:105ED000FF280BD14FF001004FF000020C4B184788 +:105EE00041F201000099019A094B1847094B002B18 +:105EF00002D01B68DB6818474FF0FF3071464FF047 +:105F00000002034B1847000028ED00E0007002007B +:105F10008D4C020004000020174818497047FFF715 +:105F2000FBFFDBF74BF900BD1548164909688842AD +:105F300003D1154A13605B68184700BD20BFFDE719 +:105F40000F4810490968884210D1104B18684FF06B +:105F5000FF318842F2D080F308884FF02021884238 +:105F600004DD0B48026803210A43026009488047A8 +:105F700009488047FFDF0000C8130020C813002035 +:105F8000001000000000002004000020007002004B +:105F900014090040912F0000295F0200F0B4404630 +:105FA000494652465B460FB402A0013001B506488F +:105FB000004700BF01BC86460FBC8046894692461A +:105FC0009B46F0BC70470000091100000420714698 +:105FD000084202D0EFF3098101E0EFF308818869FC +:105FE00002380078102813DB20280FDB2C280BDB6D +:105FF0000A4A12680A4B9A4203D1602804DB094A14 +:106000001047022008607047074A1047074A1047A8 +:10601000074A12682C32126810470000580000200E +:10602000BEBAFECA99130000114402002B4E0200B2 +:10603000040000200D4B0E4908470E4B0C49084741 +:106040000D4B0B4908470D4B094908470C4B0849B4 +:1060500008470C4B064908470B4B054908470B4BB3 +:10606000034908470A4B02490847000031BF0000B6 +:1060700069C10000512D0000CB2B0000592B0000FE +:10608000D92D0000B513000017290000552F00007E +:10609000D12F000000210160818070470021016044 +:1060A0004160017270470A6802600B7903717047A2 +:1060B000B99700005F990000C19A0000259B00007D +:1060C0005F9B0000939B0000CD9B0000FD9B0000A8 +:1060D000919C0000AD980000E59A0000331200008A +:1060E000FD43000049440000AF4400003B45000070 +:1060F0006146000037470000694700004148000042 +:10610000DB4800002F490000154A0000354A000016 +:10611000AD160000D1160000F11500004D1600006C +:10612000031700009717000023610000E3620000DE +:10613000C9660000E36700006B680000E9680000C2 +:106140004D690000716A0000416B0000AD6B0000FA +:10615000574A00005D4A0000674A0000CF4A00002D +:10616000FB4A0000B74C0000E14C0000194D000054 +:10617000834D00006D4E0000834E00006D44000012 +:10618000974E0000B94E0000FF4E00003312000091 +:106190003312000033120000331200009F2500006C +:1061A00025260000412600005D260000EB270000A8 +:1061B0008726000091260000D3260000F526000067 +:1061C000D127000013280000331200003312000012 +:1061D000DF840000FF840000098500004385000083 +:1061E0007185000061860000EF86000003870000D3 +:1061F00051870000678800000D8A0000358B000081 +:10620000617400004D8B0000331200003312000057 +:10621000DBB700003DB9000097B9000011BA0000DB +:10622000BDBA0000010000000000000010011001D4 +:106230003A0200001A02000007000000FFFFFFFF03 +:106240000000FFFFE3B300002B3D000043210000EE +:10625000AB7400004990000000000000F9920000BB +:10626000D5920000E792000000000200000000004C +:10627000000200000000000000010000000000001B +:106280008B8200006B820000D98200002125000073 +:10629000E324000003250000CBAA0000F7AA0000B9 +:1062A000FFAC00001D5A0000F98200000000000051 +:1062B000298300006F25000000000000000000009E +:1062C00000000000E1AB000000000000B15A000037 +:1062D0000300000001555555D6BE898E00006406A6 +:1062E000640C641200000803AC055008000054045C +:1062F0004408340CD5FD000069FF0000A5FB000038 +:10630000D1FD0000419901009D0401000000000042 +:10631000900A0000900A00009B5700009B57000065 +:10632000D743000043B200002F7700005320000045 +:106330007D3B0200AFAD0100DD570000DD570000DE +:10634000FB430000D5B20000B7770000C720000073 +:10635000AB3B0200C5AD0100700170014000380088 +:106360005C0024006801200200000300656C746278 +:10637000000000000000000000000000000000001D +:106380008700000000000000000000000000000086 +:10639000BE83605ADB0B376038A5F5AA9183886C01 +:1063A000010000002B370100FD4501000000000145 +:1063B00002060304050000000700000000000000C2 +:1063C000060000000A000000320000007300000018 +:1063D000B4000000F401FA00960064004B003200A3 +:1063E0001E0014000A000500020001000049000020 +:1063F00000000000C9C0010087C2010015C20100F1 +:10640000DDC001000000000015C50100AAAED7AB39 +:10641000154120100C0802170D01010209090101A4 +:106420000602091818030101090903030500000009 +:10643000555555252627D6BE898E0000EBFB010059 +:10644000C3F7010009FB0100FFF201007B230200FA +:1064500077FC0100F401FA00960064004B00320062 +:106460001E0014000A00050002000100254900007A +:1064700000000000ED4A0200054B02001D4B020027 +:10648000354B0200654B02008D4B0200B74B0200FA +:10649000EB4B020037480200734702005D440200E4 +:1064A0005F5E0200496401005964010085640100D7 +:1064B000576501005F65010071650100EB4802004E +:1064C00005490200D9480200E348020011490200D0 +:1064D00047490200674902008549020093490200CA +:1064E000A1490200B1490200C9490200E149020084 +:1064F000F74902000D4A020000000000CFBC000076 +:1065000025BD00003BBD0000495A0200894402003D +:1065100055450200435D0200815D0200AB5D020053 +:106520004D62010099670100234A0200494A0200B6 +:106530006D4A0200934A02001C05004020050040FD +:10654000001002006465020008000020EC01000059 +:106550004411000098650200F4010020D4110000ED +:10656000A011000001141348140244200B200C0653 +:10657000481A010222902720FB349B5F8012800280 +:106580001E1013770B1B2034041ABA04019C091641 +:08659000C7327F0B744411BCFB +:00000001FF From 241d7e2ae69100c972b7e843050e0808de83358c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Apr 2020 23:31:34 -0400 Subject: [PATCH 366/919] change many ifndefs to ?= --- ports/nrf/mpconfigport.mk | 36 ++----- py/circuitpy_mpconfig.mk | 210 ++++++++++---------------------------- 2 files changed, 61 insertions(+), 185 deletions(-) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 04110ffd2c..58ab442823 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -14,39 +14,21 @@ USB_SERIAL_NUMBER_LENGTH = 16 # All nRF ports have longints. LONGINT_IMPL = MPZ +# The ?='s allow overriding in mpconfigboard.mk. + # Audio via PWM -ifndef CIRCUITPY_AUDIOCORE -CIRCUITPY_AUDIOCORE = 1 -endif - CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOBUSIO ?= 1 +CIRCUITPY_AUDIOCORE ?= 1 +CIRCUITPY_AUDIOMIXER ?= 1 +CIRCUITPY_AUDIOPWMIO ?= 1 - -# The ifndef's allow overriding in mpconfigboard.mk. - -ifndef CIRCUITPY_BLEIO -CIRCUITPY_BLEIO = 1 -endif - -ifndef CIRCUITPY_AUDIOMIXER -CIRCUITPY_AUDIOMIXER = 1 -endif - -ifndef CIRCUITPY_AUDIOPWMIO -CIRCUITPY_AUDIOPWMIO = 1 -endif - -ifndef CIRCUITPY_AUDIOBUSIO -CIRCUITPY_AUDIOBUSIO = 1 -endif +CIRCUITPY_BLEIO ?= 1 # No I2CSlave implementation CIRCUITPY_I2CSLAVE = 0 -# enable RTC -ifndef CIRCUITPY_RTC -CIRCUITPY_RTC = 1 -endif +CIRCUITPY_RTC ?= 1 # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 @@ -72,8 +54,6 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS -CIRCUITPY_ULAB = 1 - else ifeq ($(MCU_CHIP),nrf52833) MCU_SERIES = m4 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 30ab720d70..c0943230c6 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -27,37 +27,25 @@ # Manually disable by overriding in #mpconfigboard.mk # Smaller builds can be forced for resource constrained chips (typically SAMD21s -# without external flash) by setting CIRCUITPY_FULL_BUILD=0. Avoid using this +# without external flash) by setting CIRCUITPY_FULL_BUILD=0. Avoid using this # for merely incomplete ports, as it changes settings in other files. -ifndef CIRCUITPY_FULL_BUILD - CIRCUITPY_FULL_BUILD = 1 -endif +CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) -ifndef CIRCUITPY_ANALOGIO -CIRCUITPY_ANALOGIO = 1 -endif +CIRCUITPY_ANALOGIO ?= 1 CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) -ifndef CIRCUITPY_AUDIOBUSIO -CIRCUITPY_AUDIOBUSIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_AUDIOBUSIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO) -ifndef CIRCUITPY_AUDIOIO -CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_AUDIOIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO) -ifndef CIRCUITPY_AUDIOIO_COMPAT -CIRCUITPY_AUDIOIO_COMPAT = $(CIRCUITPY_AUDIOIO) -endif +CIRCUITPY_AUDIOIO_COMPAT ?= $(CIRCUITPY_AUDIOIO) CFLAGS += -DCIRCUITPY_AUDIOIO_COMPAT=$(CIRCUITPY_AUDIOIO_COMPAT) -ifndef CIRCUITPY_AUDIOPWMIO -CIRCUITPY_AUDIOPWMIO = 0 -endif +CIRCUITPY_AUDIOPWMIO ?= 0 CFLAGS += -DCIRCUITPY_AUDIOPWMIO=$(CIRCUITPY_AUDIOPWMIO) ifndef CIRCUITPY_AUDIOCORE @@ -69,9 +57,7 @@ endif endif CFLAGS += -DCIRCUITPY_AUDIOCORE=$(CIRCUITPY_AUDIOCORE) -ifndef CIRCUITPY_AUDIOMIXER -CIRCUITPY_AUDIOMIXER = $(CIRCUITPY_AUDIOIO) -endif +CIRCUITPY_AUDIOMIXER ?= $(CIRCUITPY_AUDIOIO) CFLAGS += -DCIRCUITPY_AUDIOMIXER=$(CIRCUITPY_AUDIOMIXER) ifndef CIRCUITPY_AUDIOMP3 @@ -83,246 +69,156 @@ endif endif CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) -ifndef CIRCUITPY_BITBANGIO -CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO) # Explicitly enabled for boards that support _bleio. -ifndef CIRCUITPY_BLEIO -CIRCUITPY_BLEIO = 0 -endif +CIRCUITPY_BLEIO ?= 0 CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) -ifndef CIRCUITPY_BOARD -CIRCUITPY_BOARD = 1 -endif +CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) -ifndef CIRCUITPY_BUSIO -CIRCUITPY_BUSIO = 1 -endif +CIRCUITPY_BUSIO ?= 1 CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) -ifndef CIRCUITPY_DIGITALIO -CIRCUITPY_DIGITALIO = 1 -endif +CIRCUITPY_DIGITALIO ?= 1 CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) -ifndef CIRCUITPY_DISPLAYIO -CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) -ifndef CIRCUITPY_FRAMEBUFFERIO -CIRCUITPY_FRAMEBUFFERIO = 0 -endif +CIRCUITPY_FRAMEBUFFERIO ?= 0 CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) -ifndef CIRCUITPY_FREQUENCYIO -CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) -ifndef CIRCUITPY_GAMEPAD -CIRCUITPY_GAMEPAD = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_GAMEPAD ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) -ifndef CIRCUITPY_GAMEPADSHIFT -CIRCUITPY_GAMEPADSHIFT = 0 -endif +CIRCUITPY_GAMEPADSHIFT ?= 0 CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) -ifndef CIRCUITPY_I2CSLAVE -CIRCUITPY_I2CSLAVE = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) -ifndef CIRCUITPY_MATH -CIRCUITPY_MATH = 1 -endif +CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) -ifndef CIRCUITPY__EVE -CIRCUITPY__EVE = 0 -endif +CIRCUITPY__EVE ?= 0 CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) -ifndef CIRCUITPY_MICROCONTROLLER -CIRCUITPY_MICROCONTROLLER = 1 -endif +CIRCUITPY_MICROCONTROLLER ?= 1 CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER) -ifndef CIRCUITPY_NEOPIXEL_WRITE -CIRCUITPY_NEOPIXEL_WRITE = 1 -endif +CIRCUITPY_NEOPIXEL_WRITE ?= 1 CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE) # Enabled on SAMD51. Won't fit on SAMD21 builds. Not tested on nRF or STM32F4 builds. -ifndef CIRCUITPY_NETWORK -CIRCUITPY_NETWORK = 0 -endif +CIRCUITPY_NETWORK ?= 0 CFLAGS += -DCIRCUITPY_NETWORK=$(CIRCUITPY_NETWORK) -ifndef CIRCUITPY_NVM -CIRCUITPY_NVM = 1 -endif +CIRCUITPY_NVM ?= 1 CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM) -ifndef CIRCUITPY_OS -CIRCUITPY_OS = 1 -endif +CIRCUITPY_OS ?= 1 CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) -ifndef CIRCUITPY_PIXELBUF -CIRCUITPY_PIXELBUF = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF) # Only for SAMD boards for the moment -ifndef CIRCUITPY_RGBMATRIX -CIRCUITPY_RGBMATRIX = 0 -endif +CIRCUITPY_RGBMATRIX ?= 0 CFLAGS += -DCIRCUITPY_RGBMATRIX=$(CIRCUITPY_RGBMATRIX) -ifndef CIRCUITPY_PULSEIO -CIRCUITPY_PULSEIO = 1 -endif +CIRCUITPY_PULSEIO ?= 1 CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) # Only for SAMD boards for the moment -ifndef CIRCUITPY_PS2IO -CIRCUITPY_PS2IO = 0 -endif +CIRCUITPY_PS2IO ?= 0 CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) -ifndef CIRCUITPY_RANDOM -CIRCUITPY_RANDOM = 1 -endif +CIRCUITPY_RANDOM ?= 1 CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM) -ifndef CIRCUITPY_ROTARYIO -CIRCUITPY_ROTARYIO = 1 -endif +CIRCUITPY_ROTARYIO ?= 1 CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) -ifndef CIRCUITPY_RTC -CIRCUITPY_RTC = 1 -endif +CIRCUITPY_RTC ?= 1 CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC) # CIRCUITPY_SAMD is handled in the atmel-samd tree. # Only for SAMD chips. # Assume not a SAMD build. -ifndef CIRCUITPY_SAMD -CIRCUITPY_SAMD = 0 -endif +CIRCUITPY_SAMD ?= 0 CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) # Currently always off. -ifndef CIRCUITPY_STAGE -CIRCUITPY_STAGE = 0 -endif +CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) -ifndef CIRCUITPY_STORAGE -CIRCUITPY_STORAGE = 1 -endif +CIRCUITPY_STORAGE ?= 1 CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE) -ifndef CIRCUITPY_STRUCT -CIRCUITPY_STRUCT = 1 -endif +CIRCUITPY_STRUCT ?= 1 CFLAGS += -DCIRCUITPY_STRUCT=$(CIRCUITPY_STRUCT) -ifndef CIRCUITPY_SUPERVISOR -CIRCUITPY_SUPERVISOR = 1 -endif +CIRCUITPY_SUPERVISOR ?= 1 CFLAGS += -DCIRCUITPY_SUPERVISOR=$(CIRCUITPY_SUPERVISOR) -ifndef CIRCUITPY_TIME -CIRCUITPY_TIME = 1 -endif +CIRCUITPY_TIME ?= 1 CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME) # touchio might be native or generic. See circuitpy_defns.mk. -ifndef CIRCUITPY_TOUCHIO_USE_NATIVE -CIRCUITPY_TOUCHIO_USE_NATIVE = 0 -endif +CIRCUITPY_TOUCHIO_USE_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_TOUCHIO_USE_NATIVE=$(CIRCUITPY_TOUCHIO_USE_NATIVE) -ifndef CIRCUITPY_TOUCHIO -CIRCUITPY_TOUCHIO = 1 -endif +CIRCUITPY_TOUCHIO ?= 1 CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO) # For debugging. -ifndef CIRCUITPY_UHEAP -CIRCUITPY_UHEAP = 0 -endif +CIRCUITPY_UHEAP ?= 0 CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) -ifndef CIRCUITPY_USB_HID -CIRCUITPY_USB_HID = 1 -endif +CIRCUITPY_USB_HID ?= 1 CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID) -ifndef CIRCUITPY_USB_MIDI -CIRCUITPY_USB_MIDI = 1 -endif +CIRCUITPY_USB_MIDI ?= 1 CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI) -ifndef CIRCUITPY_PEW -CIRCUITPY_PEW = 0 -endif +CIRCUITPY_PEW ?= 0 CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) # For debugging. -ifndef CIRCUITPY_USTACK -CIRCUITPY_USTACK = 0 -endif +CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) # Non-module conditionals -ifndef CIRCUITPY_BITBANG_APA102 -CIRCUITPY_BITBANG_APA102 = 0 -endif +CIRCUITPY_BITBANG_APA102 ?= 0 CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) # Should busio.I2C() check for pullups? # Some boards in combination with certain peripherals may not want this. -ifndef CIRCUITPY_REQUIRE_I2C_PULLUPS -CIRCUITPY_REQUIRE_I2C_PULLUPS = 1 -endif +CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1 CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS) # REPL over BLE -ifndef CIRCUITPY_SERIAL_BLE -CIRCUITPY_SERIAL_BLE = 0 -endif +CIRCUITPY_SERIAL_BLE ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) -ifndef CIRCUITPY_BLE_FILE_SERVICE -CIRCUITPY_BLE_FILE_SERVICE = 0 -endif +CIRCUITPY_BLE_FILE_SERVICE ?= 0 CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE) # REPL over UART -ifndef CIRCUITPY_SERIAL_UART -CIRCUITPY_SERIAL_UART = 0 -endif +CIRCUITPY_SERIAL_UART ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) # ulab numerics library -ifndef CIRCUITPY_ULAB -CIRCUITPY_ULAB = $(CIRCUITPY_FULL_BUILD) -endif +CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) # Enabled micropython.native decorator (experimental) -ifndef CIRCUITPY_ENABLE_MPY_NATIVE -CIRCUITPY_ENABLE_MPY_NATIVE = 0 -endif +CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) From 46298ddcb4c96f7d8a6911bda46eabbe935e5670 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 30 Apr 2020 00:36:01 -0400 Subject: [PATCH 367/919] PacketBuffer doc fixes --- shared-bindings/_bleio/PacketBuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 46671f7673..145eec2ea5 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -42,7 +42,7 @@ //| //| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware //| outgoing writes. A packet's size is either the characteristic length or the maximum transmission -//| unit (MTU), whichever is smaller. The MTU can change so check `incoming_packet_length` before creating a +//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a //| buffer to store data. //| //| When we're the server, we ignore all connections besides the first to subscribe to @@ -97,7 +97,7 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) { //| .. method:: readinto(buf) //| //| Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer -//| than the given buffer. Use `incoming_packet_length` to read the maximum length of a single packet. +//| than the given buffer. Use `packet_size` to read the maximum length of a single packet. //| //| :return: number of bytes read and stored into ``buf`` //| :rtype: int @@ -171,7 +171,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu //| Maximum size of a packet. //| If the packet is arriving from a remote service via notify or indicate, //| the maximum size is `Connection.max_packet_length`. -//| Otherwise it is the ``max_length`` of the `Characteristic`. +//| Otherwise it is the ``max_length`` of the :py:class:`~_bleio.Characteristic`. //| STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); From 7337ea4955132db7006727b2da3f0e8fe834b475 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 30 Apr 2020 00:54:46 -0400 Subject: [PATCH 368/919] fix support_matrix.py to handle ?= --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index d5f838f75b..aa5ef02e28 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -98,7 +98,7 @@ def build_module_map(): for module in modules: full_name = module search_name = module.lstrip("_") - re_pattern = "CIRCUITPY_{}\s=\s(.+)".format(search_name.upper()) + re_pattern = "CIRCUITPY_{}\s*\??=\s*(.+)".format(search_name.upper()) find_config = re.findall(re_pattern, configs) if not find_config: continue From 4393a88fb6e577fb9ea86d0ad0096f377e12e4cd Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 30 Apr 2020 07:38:20 +0000 Subject: [PATCH 369/919] add nRF52840 based Makerdiary Pitaya Go --- ports/nrf/boards/pitaya_go/README.md | 40 +++++++++++++ ports/nrf/boards/pitaya_go/board.c | 38 ++++++++++++ ports/nrf/boards/pitaya_go/mpconfigboard.h | 43 ++++++++++++++ ports/nrf/boards/pitaya_go/mpconfigboard.mk | 10 ++++ ports/nrf/boards/pitaya_go/pins.c | 64 +++++++++++++++++++++ 5 files changed, 195 insertions(+) create mode 100644 ports/nrf/boards/pitaya_go/README.md create mode 100644 ports/nrf/boards/pitaya_go/board.c create mode 100644 ports/nrf/boards/pitaya_go/mpconfigboard.h create mode 100644 ports/nrf/boards/pitaya_go/mpconfigboard.mk create mode 100644 ports/nrf/boards/pitaya_go/pins.c diff --git a/ports/nrf/boards/pitaya_go/README.md b/ports/nrf/boards/pitaya_go/README.md new file mode 100644 index 0000000000..a58b752892 --- /dev/null +++ b/ports/nrf/boards/pitaya_go/README.md @@ -0,0 +1,40 @@ +# Makerdiary Pitaya Go + +>Pitaya Go is a compact and versatile development platform for IoT solutions, +combining the Nordic's high-end multiprotocol SoC nRF52840 and the Microchip's +extreme low power Wi-Fi® network controller ATWINC1500B. It offers a complete +solution for wireless connectivity with IEEE 802.11 b/g/n, Bluetooth 5, Thread +and Zigbee, that is specifically designed for the IoT. +Pitaya Go features a Battery Charger with power path management, 64Mbit ultra +low power QSPI Flash memory, additional NFC-A Tag PCB Antenna, user +programmable RGB LED and Buttons, reversible USB-C Connector and easily +expandable Header Sockets. All these features above make this board an ideal +choice for the next IoT project. + +from [Makerdiary](https://store.makerdiary.com/products/pitaya-go) + + +## Installing CircuitPython submodules + +Before you can build, you will need to run the following commands once, which +will install the submodules that are part of the CircuitPython ecosystem, and +build the `mpy-cross` tool: + +``` +$ cd circuitpython +$ git submodule update --init +$ make -C mpy-cross +``` + + +## Building +```sh +$ cd ports/nrf +$ make BOARD=pitaya_go SD=s140 -V=1 -j4 +``` + +# Flashing CircuitPython + +The Pitaya Go has a pre-programmed bootloader which can be used to program the +Pitaya Go. Follow [the guide - How to Program Pitaya Go](https://wiki.makerdiary.com/pitaya-go/programming/) +to flash the CircuitPython firmware. diff --git a/ports/nrf/boards/pitaya_go/board.c b/ports/nrf/boards/pitaya_go/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/pitaya_go/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/pitaya_go/mpconfigboard.h b/ports/nrf/boards/pitaya_go/mpconfigboard.h new file mode 100644 index 0000000000..7f9eff7164 --- /dev/null +++ b/ports/nrf/boards/pitaya_go/mpconfigboard.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2020 Yihui Xiong + * + * 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 "nrfx/hal/nrf_gpio.h" + +#define MAKERDIARYPITAYAGO + +#define MICROPY_HW_BOARD_NAME "Makerdiary Pitaya Go" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 6) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 1) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 5) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 2) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 4) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 3) + +#define BOARD_HAS_CRYSTAL 1 diff --git a/ports/nrf/boards/pitaya_go/mpconfigboard.mk b/ports/nrf/boards/pitaya_go/mpconfigboard.mk new file mode 100644 index 0000000000..e3b273f966 --- /dev/null +++ b/ports/nrf/boards/pitaya_go/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "Pitaya Go" +USB_MANUFACTURER = "Makerdiary" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/pitaya_go/pins.c b/ports/nrf/boards/pitaya_go/pins.c new file mode 100644 index 0000000000..92411581bc --- /dev/null +++ b/ports/nrf/boards/pitaya_go/pins.c @@ -0,0 +1,64 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN3), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_AIN4), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN6), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_VDIV), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P23), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_P24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_P28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P31), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_CSN), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_P1_02) }, + + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_USR_BTN), MP_ROM_PTR(&pin_P1_00) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b0383f4aff0259b9d3fdcf23aa736fc973b1eff6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 30 Apr 2020 09:18:48 -0400 Subject: [PATCH 370/919] make translate; remove PO-Revision-Date to reduce merge changes in .po files --- locale/ID.po | 7 +++++-- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 7 +++++-- locale/en_US.po | 7 +++++-- locale/en_x_pirate.po | 7 +++++-- locale/es.po | 7 +++++-- locale/fil.po | 7 +++++-- locale/fr.po | 7 +++++-- locale/it_IT.po | 7 +++++-- locale/ko.po | 7 +++++-- locale/pl.po | 7 +++++-- locale/pt_BR.po | 7 +++++-- locale/zh_Latn_pinyin.po | 7 +++++-- 13 files changed, 65 insertions(+), 25 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ef6ea91684..bf21fbc9a3 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1095,6 +1094,10 @@ msgstr "Tidak ada pin TX" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Tidak ada standar bus %q" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 19e26b16f7..3111308213 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" +"POT-Creation-Date: 2020-04-30 09:13-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1084,6 +1084,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 519ce09e91..6eac26936c 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" "Language: de_DE\n" @@ -1093,6 +1092,10 @@ msgstr "Kein TX Pin" msgid "No available clocks" msgstr "Keine Taktgeber verfügbar" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Kein Standard %q Bus" diff --git a/locale/en_US.po b/locale/en_US.po index 936642cc16..6ee9a6c3a0 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -1084,6 +1083,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 6e0b2b99e7..a68218dc34 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" "Language: en_x_pirate\n" @@ -1088,6 +1087,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" diff --git a/locale/es.po b/locale/es.po index 33479e790e..0290665b26 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-08-24 22:56-0500\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -1092,6 +1091,10 @@ msgstr "Sin pin TX" msgid "No available clocks" msgstr "Relojes no disponibles" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Sin bus %q por defecto" diff --git a/locale/fil.po b/locale/fil.po index be471704b6..092fbc6501 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-12-20 22:15-0800\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" "Language: fil\n" @@ -1100,6 +1099,10 @@ msgstr "Walang TX pin" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Walang default na %q bus" diff --git a/locale/fr.po b/locale/fr.po index 2a6bda3203..ea5b5ad92c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2019-04-14 20:05+0100\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" "Language: fr\n" @@ -1107,6 +1106,10 @@ msgstr "Pas de broche TX" msgid "No available clocks" msgstr "Pas d'horloge disponible" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Pas de bus %q par défaut" diff --git a/locale/it_IT.po b/locale/it_IT.po index 5a3d678b84..40fb074bef 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-10-02 16:27+0200\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" "Language: it_IT\n" @@ -1104,6 +1103,10 @@ msgstr "Nessun pin TX" msgid "No available clocks" msgstr "Nessun orologio a disposizione" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nessun bus %q predefinito" diff --git a/locale/ko.po b/locale/ko.po index 786e29ecc0..e2df3625fc 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2019-05-06 14:22-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" "Language: ko\n" @@ -1088,6 +1087,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index c8ffc4af88..6387de0fe9 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2019-03-19 18:37-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" "Language: pl\n" @@ -1089,6 +1088,10 @@ msgstr "Brak nóżki TX" msgid "No available clocks" msgstr "Brak wolnych zegarów" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nie ma domyślnej magistrali %q" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a6fc3f3720..badeb54d0c 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,8 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2018-10-02 21:14-0000\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1096,6 +1095,10 @@ msgstr "Nenhum pino TX" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "Nenhum barramento %q padrão" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index fd5be84e28..7b4d56ddab 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,8 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" -"PO-Revision-Date: 2019-04-13 10:10-0700\n" +"POT-Creation-Date: 2020-04-30 09:11-0400\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh\n" @@ -1097,6 +1096,10 @@ msgstr "Wèi zhǎodào TX yǐn jiǎo" msgid "No available clocks" msgstr "Méiyǒu kěyòng de shízhōng" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: size cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "wú mòrèn %q zǒngxiàn" From 36a71560c2fc7b2c79b0848c72dc9bf61e7f9ee1 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Thu, 30 Apr 2020 09:58:27 -0400 Subject: [PATCH 371/919] update teknikio bluebird pin assignments --- ports/nrf/boards/teknikio_bluebird/mpconfigboard.h | 2 +- ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk | 6 ++++++ ports/nrf/boards/teknikio_bluebird/pins.c | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h index 76e772ca9b..c130cd8c06 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h @@ -33,7 +33,7 @@ #define MICROPY_HW_BOARD_NAME "Teknikio Bluebird" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_NEOPIXEL (&pin_P0_26) +#define MICROPY_HW_NEOPIXEL (&pin_P1_15) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) #define DEFAULT_I2C_BUS_SDA (&pin_P0_26) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index e178a82051..2339a950fe 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -6,3 +6,9 @@ USB_MANUFACTURER = "Teknikio" MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_ANALOGIO = 1 +CIRCUITPY_AUDIOCORE = 1 +CIRCUITPY_AUDIOPWMIO = 1 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_NEOPIXEL_WRITE = 1 +CIRCUITPY_TIME = 1 diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c index a90dc7daa2..1ff1198a15 100644 --- a/ports/nrf/boards/teknikio_bluebird/pins.c +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -47,16 +47,16 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_03) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_LIGHT_ENABLE), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_14) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SCL), MP_ROM_PTR(&pin_P1_11) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From e5be728c1c8a3a455b7095c9dab9e758c5016191 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 29 Apr 2020 11:27:43 -0500 Subject: [PATCH 372/919] stm: enable protomatter Testing performed: on stm32f405 feather, all pins change in plausible ways on a logic probe. Didn't actually drive a display yet. --- lib/protomatter | 2 +- ports/stm/common-hal/microcontroller/Pin.c | 12 +++++ ports/stm/common-hal/rgbmatrix/RGBMatrix.c | 54 ++++++++++++++++++++++ ports/stm/common-hal/rgbmatrix/RGBMatrix.h | 35 ++++++++++++++ ports/stm/common-hal/rgbmatrix/__init__.c | 0 ports/stm/common-hal/rgbmatrix/__init__.h | 0 ports/stm/mpconfigport.mk | 2 + 7 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 ports/stm/common-hal/rgbmatrix/RGBMatrix.c create mode 100644 ports/stm/common-hal/rgbmatrix/RGBMatrix.h create mode 100644 ports/stm/common-hal/rgbmatrix/__init__.c create mode 100644 ports/stm/common-hal/rgbmatrix/__init__.h diff --git a/lib/protomatter b/lib/protomatter index c411714cbd..1b8f461f64 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit c411714cbdc05725e80398acb18c3c1fb6fa68a4 +Subproject commit 1b8f461f6401d6418bba5c6ec0108375c2c1b62f diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 5e131c310f..6102134978 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -134,3 +134,15 @@ GPIO_TypeDef * pin_port(uint8_t pin_port) { uint16_t pin_mask(uint8_t pin_number) { return 1<port * 16 + pin->number; +} + +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); +} + +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { + reset_pin_number(pin_no / 16, pin_no % 16); +} diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.c b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c new file mode 100644 index 0000000000..9e60cc3e6f --- /dev/null +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.c @@ -0,0 +1,54 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "common-hal/rgbmatrix/RGBMatrix.h" + +#include STM32_HAL_H + +extern void _PM_IRQ_HANDLER(void); + +void *common_hal_rgbmatrix_timer_allocate() { + // TODO(jepler) properly handle resource allocation including never-reset + return TIM6; +} + + +void common_hal_rgbmatrix_timer_enable(void* ptr) { + HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); +} + +void common_hal_rgbmatrix_timer_disable(void* ptr) { + TIM_TypeDef *tim = (TIM_TypeDef*)ptr; + tim->DIER &= ~TIM_DIER_UIE; + HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); +} + +void common_hal_rgbmatrix_timer_free(void* ptr) { + common_hal_rgbmatrix_timer_disable(ptr); + // TODO(jepler) properly handle resource allocation including never-reset +} diff --git a/ports/stm/common-hal/rgbmatrix/RGBMatrix.h b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h new file mode 100644 index 0000000000..48de4dcb21 --- /dev/null +++ b/ports/stm/common-hal/rgbmatrix/RGBMatrix.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_RGBMATRIX_RGBMATRIX_H + +void *common_hal_rgbmatrix_timer_allocate(void); +void common_hal_rgbmatrix_timer_enable(void*); +void common_hal_rgbmatrix_timer_disable(void*); +void common_hal_rgbmatrix_timer_free(void*); + +#endif diff --git a/ports/stm/common-hal/rgbmatrix/__init__.c b/ports/stm/common-hal/rgbmatrix/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/common-hal/rgbmatrix/__init__.h b/ports/stm/common-hal/rgbmatrix/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 5ef1e8e7b7..2a36f0bbd2 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -7,6 +7,8 @@ ifeq ($(MCU_SERIES),F4) # Not yet implemented common-hal modules: CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_FRAMEBUFFERIO = 1 + CIRCUITPY_RGBMATRIX = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 From 14f6f082ad8b4c2b83b789b5b77f74e99f72b69b Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Thu, 30 Apr 2020 14:31:06 +0000 Subject: [PATCH 373/919] add pitaya_go --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b1211cda1..3fc0ea411d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,6 +214,7 @@ jobs: - "pewpew10" - "pewpew_m4" - "pirkey_m0" + - "pitaya_go" - "pyb_nano_v2" - "pybadge" - "pybadge_airlift" From 89ff5589c43a50737c7733e54599443fc9aa0cf7 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 29 Apr 2020 15:14:02 -0400 Subject: [PATCH 374/919] Add the OpenMV-H7 R1 board --- .github/workflows/build.yml | 1 + ports/stm/boards/openmv_h7/board.c | 38 ++ ports/stm/boards/openmv_h7/mpconfigboard.h | 34 ++ ports/stm/boards/openmv_h7/mpconfigboard.mk | 15 + ports/stm/boards/openmv_h7/openmv.csv | 26 + ports/stm/boards/openmv_h7/pins.c | 35 ++ .../stm/boards/openmv_h7/stm32h7xx_hal_conf.h | 493 ++++++++++++++++++ 7 files changed, 642 insertions(+) create mode 100644 ports/stm/boards/openmv_h7/board.c create mode 100644 ports/stm/boards/openmv_h7/mpconfigboard.h create mode 100644 ports/stm/boards/openmv_h7/mpconfigboard.mk create mode 100644 ports/stm/boards/openmv_h7/openmv.csv create mode 100644 ports/stm/boards/openmv_h7/pins.c create mode 100644 ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b1211cda1..6c212e66dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,6 +206,7 @@ jobs: - "nucleo_h743zi_2" - "ohs2020_badge" - "openbook_m4" + - "openmv_h7" - "particle_argon" - "particle_boron" - "particle_xenon" diff --git a/ports/stm/boards/openmv_h7/board.c b/ports/stm/boards/openmv_h7/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/stm/boards/openmv_h7/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h new file mode 100644 index 0000000000..c23064f750 --- /dev/null +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "OPENMV-H7 R1" +#define MICROPY_HW_MCU_NAME "STM32H743" + +#define FLASH_PAGE_SIZE (0x4000) + +#define BOARD_OSC_DIV (12) diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk new file mode 100644 index 0000000000..f28500a932 --- /dev/null +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -0,0 +1,15 @@ +USB_VID = 0x239A +USB_PID = 0x8098 +USB_PRODUCT = "OpenMV-H7 R1" +USB_MANUFACTURER = "OpenMV, LLC" +USB_DEVICES = "CDC,MSC" + +INTERNAL_FLASH_FILESYSTEM = 1 + +MCU_SERIES = H7 +MCU_VARIANT = STM32H743xx +MCU_PACKAGE = LQFP100_x7 + +LD_COMMON = boards/common_tcm.ld +LD_FILE = boards/STM32H743_fs.ld + diff --git a/ports/stm/boards/openmv_h7/openmv.csv b/ports/stm/boards/openmv_h7/openmv.csv new file mode 100644 index 0000000000..9045e1ea2d --- /dev/null +++ b/ports/stm/boards/openmv_h7/openmv.csv @@ -0,0 +1,26 @@ +P0,PB15 +P1,PB14 +P2,PB13 +P3,PB12 +P4,PB10 +P5,PB11 +P6,PA05 +P7,PD12 +P8,PD13 +P9,PD14 +LED1,PC00 +LED2,PC01 +LED3,PC02 +LED4,PE02 +UART1_TX,PB14 +UART1_RX,PB15 +UART3_TX,PB10 +UART3_RX,PB11 +I2C2_SCL,PB10 +I2C2_SDA,PB11 +I2C4_SCL,PD12 +I2C4_SDA,PD13 +SPI2_NSS,PB12 +SPI2_SCK,PB13 +SPI2_MISO,PB14 +SPI2_MOSI,PB15 \ No newline at end of file diff --git a/ports/stm/boards/openmv_h7/pins.c b/ports/stm/boards/openmv_h7/pins.c new file mode 100644 index 0000000000..2f7fa93c1d --- /dev/null +++ b/ports/stm/boards/openmv_h7/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_PD14) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_LED_IR), MP_ROM_PTR(&pin_PE02) }, + { MP_ROM_QSTR(MP_QSTR_UART1_TX), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_UART1_RX), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_UART3_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_UART3_RX), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SCL), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_I2C2_SDA), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SCL), MP_ROM_PTR(&pin_PD12) }, + { MP_ROM_QSTR(MP_QSTR_I2C4_SDA), MP_ROM_PTR(&pin_PD13) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_NSS), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_PB15) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h b/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h new file mode 100644 index 0000000000..8fb01aceaf --- /dev/null +++ b/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h @@ -0,0 +1,493 @@ +/** + ****************************************************************************** + * @file stm32h7xx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32H7xx_HAL_CONF_H +#define __STM32H7xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_FDCAN_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_COMP_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +#define HAL_ETH_MODULE_ENABLED +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_OTFDEC_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_HRTIM_MODULE_ENABLED */ +/* #define HAL_HSEM_MODULE_ENABLED */ +/* #define HAL_GFXMMU_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_OPAMP_MODULE_ENABLED */ +/* #define HAL_OSPI_MODULE_ENABLED */ +/* #define HAL_OSPI_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +/* #define HAL_SWPMI_MODULE_ENABLED */ +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_JPEG_MODULE_ENABLED */ +/* #define HAL_MDIOS_MODULE_ENABLED */ +/* #define HAL_PSSI_MODULE_ENABLED */ +/* #define HAL_DTS_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_MDMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal oscillator (CSI) default value. + * This value is the default CSI value after Reset. + */ +#if !defined (CSI_VALUE) + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* CSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */ + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################### Ethernet Configuration ######################### */ +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ + +#define ETH_MAC_ADDR0 ((uint8_t)0x02) +#define ETH_MAC_ADDR1 ((uint8_t)0x00) +#define ETH_MAC_ADDR2 ((uint8_t)0x00) +#define ETH_MAC_ADDR3 ((uint8_t)0x00) +#define ETH_MAC_ADDR4 ((uint8_t)0x00) +#define ETH_MAC_ADDR5 ((uint8_t)0x00) + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32h7xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32h7xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32h7xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_MDMA_MODULE_ENABLED + #include "stm32h7xx_hal_mdma.h" +#endif /* HAL_MDMA_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32h7xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32h7xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32h7xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32h7xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32h7xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32h7xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32h7xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32h7xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32h7xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_FDCAN_MODULE_ENABLED + #include "stm32h7xx_hal_fdcan.h" +#endif /* HAL_FDCAN_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32h7xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32h7xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32h7xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32h7xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32h7xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32h7xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GFXMMU_MODULE_ENABLED + #include "stm32h7xx_hal_gfxmmu.h" +#endif /* HAL_GFXMMU_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32h7xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32h7xx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32h7xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32h7xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32h7xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32h7xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32h7xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_JPEG_MODULE_ENABLED + #include "stm32h7xx_hal_jpeg.h" +#endif /* HAL_JPEG_MODULE_ENABLED */ + +#ifdef HAL_MDIOS_MODULE_ENABLED + #include "stm32h7xx_hal_mdios.h" +#endif /* HAL_MDIOS_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32h7xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32h7xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED +#include "stm32h7xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED +#include "stm32h7xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_OSPI_MODULE_ENABLED + #include "stm32h7xx_hal_ospi.h" +#endif /* HAL_OSPI_MODULE_ENABLED */ + +#ifdef HAL_OTFDEC_MODULE_ENABLED +#include "stm32h7xx_hal_otfdec.h" +#endif /* HAL_OTFDEC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32h7xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32h7xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RAMECC_MODULE_ENABLED + #include "stm32h7xx_hal_ramecc.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32h7xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32h7xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32h7xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32h7xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32h7xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32h7xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32h7xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_SWPMI_MODULE_ENABLED + #include "stm32h7xx_hal_swpmi.h" +#endif /* HAL_SWPMI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32h7xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32h7xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32h7xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32h7xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32h7xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32h7xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32h7xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32h7xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32h7xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_PSSI_MODULE_ENABLED + #include "stm32h7xx_hal_pssi.h" +#endif /* HAL_PSSI_MODULE_ENABLED */ + +#ifdef HAL_DTS_MODULE_ENABLED + #include "stm32h7xx_hal_dts.h" +#endif /* HAL_DTS_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32H7xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From d65e85104431b354737d11b5ec9a29387d390cfd Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 30 Apr 2020 13:06:09 -0400 Subject: [PATCH 375/919] Did audioio, audiomixer, audiomp3 --- shared-bindings/audioio/AudioOut.c | 164 +++++++++++++----------- shared-bindings/audioio/__init__.c | 4 +- shared-bindings/audiomixer/Mixer.c | 139 ++++++++++---------- shared-bindings/audiomixer/MixerVoice.c | 48 +++---- shared-bindings/audiomixer/__init__.c | 4 +- shared-bindings/audiomp3/MP3Decoder.c | 111 ++++++++-------- shared-bindings/audiomp3/__init__.c | 4 +- 7 files changed, 247 insertions(+), 227 deletions(-) diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 28c345d168..84e5e44227 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -36,64 +36,65 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class AudioOut: -//|""".. currentmodule:: audioio +//| class AudioOut: +//| """.. currentmodule:: audioio //| -//|:class:`AudioOut` -- Output an analog audio signal -//|======================================================== +//| :class:`AudioOut` -- Output an analog audio signal +//| ======================================================== //| -//|AudioOut can be used to output an analog audio signal on a given pin.""" +//| AudioOut can be used to output an analog audio signal on a given pin.""" //| -//|def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): -//|"""Create a AudioOut object associated with the given pin(s). This allows you to -//|play audio signals out on the given pin(s). +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| """Create a AudioOut object associated with the given pin(s). This allows you to +//| play audio signals out on the given pin(s). //| -//|:param ~microcontroller.Pin left_channel: The pin to output the left channel to -//|:param ~microcontroller.Pin right_channel: The pin to output the right channel to -//|:param int quiescent_value: The output value when no signal is present. Samples should start -//|and end with this value to prevent audible popping. +//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to +//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to +//| :param int quiescent_value: The output value when no signal is present. Samples should start +//| and end with this value to prevent audible popping. //| -//|Simple 8ksps 440 Hz sin wave:: +//| Simple 8ksps 440 Hz sin wave:: //| -//|import audiocore -//|import audioio -//|import board -//|import array -//|import time -//|import math +//| import audiocore +//| import audioio +//| import board +//| import array +//| import time +//| import math //| -//|# Generate one period of sine wav. -//|length = 8000 // 440 -//|sine_wave = array.array("H", [0] * length) -//|for i in range(length): -//|sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| # Generate one period of sine wav. +//| length = 8000 // 440 +//| sine_wave = array.array("H", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//|dac = audioio.AudioOut(board.SPEAKER) -//|sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//|dac.play(sine_wave, loop=True) -//|time.sleep(1) -//|dac.stop() +//| dac = audioio.AudioOut(board.SPEAKER) +//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//| dac.play(sine_wave, loop=True) +//| time.sleep(1) +//| dac.stop() //| -//|Playing a wave file from flash:: +//| Playing a wave file from flash:: //| -//|import board -//|import audioio -//|import digitalio +//| import board +//| import audioio +//| import digitalio //| -//|# Required for CircuitPlayground Express -//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//|speaker_enable.switch_to_output(value=True) +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//|data = open("cplay-5.1-16bit-16khz.wav", "rb") -//|wav = audiocore.WaveFile(data) -//|a = audioio.AudioOut(board.A0) +//| data = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(data) +//| a = audioio.AudioOut(board.A0) +//| +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... //| -//|print("playing") -//|a.play(wav) -//|while a.playing: -//|pass -//|print("stopped")""" -//|... STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_left_channel, ARG_right_channel, ARG_quiescent_value }; static const mp_arg_t allowed_args[] = { @@ -115,9 +116,10 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the AudioOut and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the AudioOut and releases any hardware resources for reuse.""" +//| ... +//| STATIC mp_obj_t audioio_audioout_deinit(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audioio_audioout_deinit(self); @@ -130,15 +132,17 @@ STATIC void check_for_deinit(audioio_audioout_obj_t *self) { raise_deinited_error(); } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audioio_audioout_deinit(args[0]); @@ -147,16 +151,17 @@ STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *arg STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audioio_audioout___exit___obj, 4, 4, audioio_audioout_obj___exit__); -//|def play(self, sample: Any, *, loop: Any = False) -> Any: -//|"""Plays the sample once when loop=False and continuously when loop=True. -//|Does not block. Use `playing` to block. +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| +//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output +//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit +//| DAC that ignores the lowest 6 bits when playing 16 bit samples.""" +//| ... //| -//|The sample itself should consist of 16 bit samples. Microcontrollers with a lower output -//|resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit -//|DAC that ignores the lowest 6 bits when playing 16 bit samples.""" -//|... STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -175,9 +180,10 @@ STATIC mp_obj_t audioio_audioout_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audioio_audioout_play_obj, 1, audioio_audioout_obj_play); -//|def stop(self, ) -> Any: -//|"""Stops playback and resets to the start of the sample.""" -//|... +//| def stop(self, ) -> Any: +//| """Stops playback and resets to the start of the sample.""" +//| ... +//| STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -186,9 +192,9 @@ STATIC mp_obj_t audioio_audioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_stop_obj, audioio_audioout_obj_stop); -//|playing: Any = -//|"""True when an audio sample is being output even if `paused`. (read-only)""" -//|... +//| playing: Any = ... +//| """True when an audio sample is being output even if `paused`. (read-only)""" +//| STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -203,9 +209,10 @@ const mp_obj_property_t audioio_audioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|def pause(self, ) -> Any: -//|"""Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" -//|... +//| def pause(self, ) -> Any: +//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//| ... +//| STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -218,9 +225,10 @@ STATIC mp_obj_t audioio_audioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_pause_obj, audioio_audioout_obj_pause); -//|def resume(self, ) -> Any: -//|"""Resumes sample playback after :py:func:`pause`.""" -//|... +//| def resume(self, ) -> Any: +//| """Resumes sample playback after :py:func:`pause`.""" +//| ... +//| STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -233,9 +241,9 @@ STATIC mp_obj_t audioio_audioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_resume_obj, audioio_audioout_obj_resume); -//|paused: Any = -//|"""True when playback is paused. (read-only)""" -//|... +//| paused: Any = ... +//| """True when playback is paused. (read-only)""" +//| STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { audioio_audioout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index 02a5fe1eee..bc2e26cfce 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -42,7 +42,7 @@ #include "shared-bindings/audiomixer/Mixer.h" #endif -//| :mod:`audioio` --- Support for audio input and output +//| """:mod:`audioio` --- Support for audio input and output //| ====================================================== //| //| .. module:: audioio @@ -68,7 +68,7 @@ //| //| For compatibility with CircuitPython 4.x, some builds allow the items in //| `audiocore` to be imported from `audioio`. This will be removed for all -//| boards in a future build of CircuitPython. +//| boards in a future build of CircuitPython.""" //| STATIC const mp_rom_map_elem_t audioio_module_globals_table[] = { diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 93b1d3635f..966581d454 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -38,50 +38,51 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class Mixer: -//|""".. currentmodule:: audiomixer +//| class Mixer: +//| """.. currentmodule:: audiomixer //| -//|:class:`Mixer` -- Mixes one or more audio samples together -//|=========================================================== +//| :class:`Mixer` -- Mixes one or more audio samples together +//| =========================================================== //| -//|Mixer mixes multiple samples into one sample.""" +//| Mixer mixes multiple samples into one sample.""" //| -//|def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): -//|"""Create a Mixer object that can mix multiple channels with the same sample rate. -//|Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. +//| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): +//| """Create a Mixer object that can mix multiple channels with the same sample rate. +//| Samples are accessed and controlled with the mixer's `audiomixer.MixerVoice` objects. //| -//|:param int voice_count: The maximum number of voices to mix -//|:param int buffer_size: The total size in bytes of the buffers to mix into -//|:param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. -//|:param int bits_per_sample: The bits per sample of the samples being played -//|:param bool samples_signed: Samples are signed (True) or unsigned (False) -//|:param int sample_rate: The sample rate to be used for all samples +//| :param int voice_count: The maximum number of voices to mix +//| :param int buffer_size: The total size in bytes of the buffers to mix into +//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo. +//| :param int bits_per_sample: The bits per sample of the samples being played +//| :param bool samples_signed: Samples are signed (True) or unsigned (False) +//| :param int sample_rate: The sample rate to be used for all samples //| -//|Playing a wave file from flash:: +//| Playing a wave file from flash:: //| -//|import board -//|import audioio -//|import audiocore -//|import audiomixer -//|import digitalio +//| import board +//| import audioio +//| import audiocore +//| import audiomixer +//| import digitalio //| -//|a = audioio.AudioOut(board.A0) -//|music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) -//|drum = audiocore.WaveFile(open("drum.wav", "rb")) -//|mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, -//|bits_per_sample=16, samples_signed=True) +//| a = audioio.AudioOut(board.A0) +//| music = audiocore.WaveFile(open("cplay-5.1-16bit-16khz.wav", "rb")) +//| drum = audiocore.WaveFile(open("drum.wav", "rb")) +//| mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1, +//| bits_per_sample=16, samples_signed=True) +//| +//| print("playing") +//| # Have AudioOut play our Mixer source +//| a.play(mixer) +//| # Play the first sample voice +//| mixer.voice[0].play(music) +//| while mixer.playing: +//| # Play the second sample voice +//| mixer.voice[1].play(drum) +//| time.sleep(1) +//| print("stopped")""" +//| ... //| -//|print("playing") -//|# Have AudioOut play our Mixer source -//|a.play(mixer) -//|# Play the first sample voice -//|mixer.voice[0].play(music) -//|while mixer.playing: -//|# Play the second sample voice -//|mixer.voice[1].play(drum) -//|time.sleep(1) -//|print("stopped")""" -//|... STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice_count, ARG_buffer_size, ARG_channel_count, ARG_bits_per_sample, ARG_samples_signed, ARG_sample_rate }; static const mp_arg_t allowed_args[] = { @@ -125,9 +126,10 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the Mixer and releases any hardware resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the Mixer and releases any hardware resources for reuse.""" +//| ... +//| STATIC mp_obj_t audiomixer_mixer_deinit(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomixer_mixer_deinit(self); @@ -141,15 +143,17 @@ STATIC void check_for_deinit(audiomixer_mixer_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomixer_mixer_deinit(args[0]); @@ -157,9 +161,9 @@ STATIC mp_obj_t audiomixer_mixer_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomixer_mixer___exit___obj, 4, 4, audiomixer_mixer_obj___exit__); -//|playing: Any = -//|"""True when any voice is being output. (read-only)""" -//|... +//| playing: Any = ... +//| """True when any voice is being output. (read-only)""" +//| STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -174,9 +178,9 @@ const mp_obj_property_t audiomixer_mixer_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|sample_rate: Any = -//|"""32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" -//|... +//| sample_rate: Any = ... +//| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" +//| STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -191,14 +195,13 @@ const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|voice: Any = -//|"""A tuple of the mixer's `audiomixer.MixerVoice` object(s). +//| voice: Any = ... +//| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). //| -//|.. code-block:: python +//| .. code-block:: python //| -//|>>> mixer.voice -//|(,)""" -//|... +//| >>> mixer.voice +//| (,)""" STATIC mp_obj_t audiomixer_mixer_obj_get_voice(mp_obj_t self_in) { audiomixer_mixer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -213,14 +216,15 @@ const mp_obj_property_t audiomixer_mixer_voice_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: -//|"""Plays the sample once when loop=False and continuously when loop=True. -//|Does not block. Use `playing` to block. +//| def play(self, sample: Any, *, voice: Any = 0, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//|Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. +//| +//| The sample must match the Mixer's encoding settings given in the constructor.""" +//| ... //| -//|The sample must match the Mixer's encoding settings given in the constructor.""" -//|... STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_voice, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -245,9 +249,10 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixer_play_obj, 1, audiomixer_mixer_obj_play); -//|def stop_voice(self, voice: Any = 0) -> Any: -//|"""Stops playback of the sample on the given voice.""" -//|... +//| def stop_voice(self, voice: Any = 0) -> Any: +//| """Stops playback of the sample on the given voice.""" +//| ... +//| STATIC mp_obj_t audiomixer_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 299600dd14..257d9507b9 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -37,18 +37,18 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class MixerVoice: -//|""".. currentmodule:: audiomixer +//| class MixerVoice: +//| """.. currentmodule:: audiomixer //| -//|:class:`MixerVoice` -- Voice objects used with Mixer -//|===================================================== +//| :class:`MixerVoice` -- Voice objects used with Mixer +//| ===================================================== //| -//|Used to access and control samples with `audiomixer.Mixer`.""" +//| Used to access and control samples with `audiomixer.Mixer`.""" //| -//|def __init__(self, ): +//| def __init__(self, ): +//| """MixerVoice instance object(s) created by `audiomixer.Mixer`.""" +//| ... //| -//|"""MixerVoice instance object(s) created by `audiomixer.Mixer`.""" -//|... // TODO: support mono or stereo voices STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { audiomixer_mixervoice_obj_t *self = m_new_obj(audiomixer_mixervoice_obj_t); @@ -59,14 +59,15 @@ STATIC mp_obj_t audiomixer_mixervoice_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } -//|def play(self, sample: Any, *, loop: Any = False) -> Any: -//|"""Plays the sample once when ``loop=False``, and continuously when ``loop=True``. -//|Does not block. Use `playing` to block. +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when ``loop=False``, and continuously when ``loop=True``. +//| Does not block. Use `playing` to block. //| -//|Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. +//| Sample must be an `audiocore.WaveFile`, `audiomixer.Mixer` or `audiocore.RawSample`. +//| +//| The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" +//| ... //| -//|The sample must match the `audiomixer.Mixer`'s encoding settings given in the constructor.""" -//|... STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; static const mp_arg_t allowed_args[] = { @@ -83,9 +84,10 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_play(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_play_obj, 1, audiomixer_mixervoice_obj_play); -//|def stop(self, ) -> Any: -//|"""Stops playback of the sample on this voice.""" -//|... +//| def stop(self, ) -> Any: +//| """Stops playback of the sample on this voice.""" +//| ... +//| STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_voice }; static const mp_arg_t allowed_args[] = { @@ -101,9 +103,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_stop_obj, 1, audiomixer_mixervoice_obj_stop); -//|level(): Any = -//|"""The volume level of a voice, as a floating point number between 0 and 1.""" -//|... +//| level: Any = ... +//| """The volume level of a voice, as a floating point number between 0 and 1.""" +//| STATIC mp_obj_t audiomixer_mixervoice_obj_get_level(mp_obj_t self_in) { return mp_obj_new_float(common_hal_audiomixer_mixervoice_get_level(self_in)); } @@ -137,9 +139,9 @@ const mp_obj_property_t audiomixer_mixervoice_level_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|playing: Any = -//|"""True when this voice is being output. (read-only)""" -//|... +//| playing: Any = ... +//| """True when this voice is being output. (read-only)""" +//| STATIC mp_obj_t audiomixer_mixervoice_obj_get_playing(mp_obj_t self_in) { audiomixer_mixervoice_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/audiomixer/__init__.c b/shared-bindings/audiomixer/__init__.c index 79bab440e5..c90a4a0e65 100644 --- a/shared-bindings/audiomixer/__init__.c +++ b/shared-bindings/audiomixer/__init__.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiomixer/Mixer.h" -//| :mod:`audiomixer` --- Support for audio mixer +//| """:mod:`audiomixer` --- Support for audio mixer //| ======================================================== //| //| .. module:: audiomixer @@ -46,7 +46,7 @@ //| :maxdepth: 3 //| //| Mixer -//| MixerVoice +//| MixerVoice""" //| STATIC const mp_rom_map_elem_t audiomixer_module_globals_table[] = { diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 7c011b65f3..d9c85bbf63 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -34,42 +34,44 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//|class MP3: -//|""".. currentmodule:: audiomp3 +//| class MP3: +//| """.. currentmodule:: audiomp3 //| -//|:class:`MP3Decoder` -- Load a mp3 file for audio playback -//|========================================================= +//| :class:`MP3Decoder` -- Load a mp3 file for audio playback +//| ========================================================= //| -//|An object that decodes MP3 files for playback on an audio device.""" +//| An object that decodes MP3 files for playback on an audio device.""" //| -//|def __init__(self, file: typing.BinaryIO, buffer: bytearray): -//|"""Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//| def __init__(self, file: typing.BinaryIO, buffer: bytearray): //| -//|:param typing.BinaryIO file: Already opened mp3 file -//|:param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//| """Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//| +//| :param typing.BinaryIO file: Already opened mp3 file +//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| //| -//|Playing a mp3 file from flash:: +//| Playing a mp3 file from flash:: //| -//|import board -//|import audiomp3 -//|import audioio -//|import digitalio +//| import board +//| import audiomp3 +//| import audioio +//| import digitalio //| -//|# Required for CircuitPlayground Express -//|speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//|speaker_enable.switch_to_output(value=True) +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//|data = open("cplay-16bit-16khz-64kbps.mp3", "rb") -//|mp3 = audiomp3.MP3Decoder(data) -//|a = audioio.AudioOut(board.A0) +//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb") +//| mp3 = audiomp3.MP3Decoder(data) +//| a = audioio.AudioOut(board.A0) +//| +//| print("playing") +//| a.play(mp3) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... //| -//|print("playing") -//|a.play(mp3) -//|while a.playing: -//|pass -//|print("stopped")""" -//|... STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 2, false); @@ -92,9 +94,10 @@ STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//|def deinit(self, ) -> Any: -//|"""Deinitialises the MP3 and releases all memory resources for reuse.""" -//|... +//| def deinit(self, ) -> Any: +//| """Deinitialises the MP3 and releases all memory resources for reuse.""" +//| ... +//| STATIC mp_obj_t audiomp3_mp3file_deinit(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_audiomp3_mp3file_deinit(self); @@ -108,15 +111,17 @@ STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { } } -//|def __enter__(self, ) -> Any: -//|"""No-op used by Context Managers.""" -//|... +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... +//| // Provided by context manager helper. -//|def __exit__(self, ) -> Any: -//|"""Automatically deinitializes the hardware when exiting a context. See -//|:ref:`lifetime-and-contextmanagers` for more info.""" -//|... +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiomp3_mp3file_deinit(args[0]); @@ -124,9 +129,9 @@ STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); -//|file: Any = -//|"""File to play back.""" -//|... +//| file: Any = ... +//| """File to play back.""" +//| STATIC mp_obj_t audiomp3_mp3file_obj_get_file(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -154,11 +159,11 @@ const mp_obj_property_t audiomp3_mp3file_file_obj = { -//|sample_rate: Any = -//|"""32 bit value that dictates how quickly samples are loaded into the DAC -//|in Hertz (cycles per second). When the sample is looped, this can change -//|the pitch output without changing the underlying sample.""" -//|... +//| sample_rate: Any = ... +//| """32 bit value that dictates how quickly samples are loaded into the DAC +//| in Hertz (cycles per second). When the sample is looped, this can change +//| the pitch output without changing the underlying sample.""" +//| STATIC mp_obj_t audiomp3_mp3file_obj_get_sample_rate(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -181,9 +186,9 @@ const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|bits_per_sample: Any = -//|"""Bits per sample. (read only)""" -//|... +//| bits_per_sample: Any = ... +//| """Bits per sample. (read only)""" +//| STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -198,9 +203,9 @@ const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|channel_count: Any = -//|"""Number of audio channels. (read only)""" -//|... +//| channel_count: Any = ... +//| """Number of audio channels. (read only)""" +//| STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -215,9 +220,9 @@ const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//|rms_level: Any = -//|"""The RMS audio level of a recently played moment of audio. (read only)""" -//|... +//| rms_level: Any = ... +//| """The RMS audio level of a recently played moment of audio. (read only)""" +//| STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index fb2187669c..50b29da529 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -31,7 +31,7 @@ #include "shared-bindings/audiomp3/MP3Decoder.h" -//| :mod:`audiomp3` --- Support for MP3-compressed audio files +//| """:mod:`audiomp3` --- Support for MP3-compressed audio files //| ========================================================== //| //| .. module:: audiomp3 @@ -44,7 +44,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| MP3Decoder +//| MP3Decoder""" //| STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { From 4f71bd295d65335b540e50c2066fe8eed1ffda35 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 30 Apr 2020 14:46:51 -0400 Subject: [PATCH 376/919] Make PulseIO optional within DisplayIO --- ports/stm/mpconfigport.mk | 10 ---------- shared-module/displayio/Display.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 5ef1e8e7b7..8298a5e2dc 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -22,7 +22,6 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PULSEIO = 0 - CIRCUITPY_OS = 1 CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 @@ -30,18 +29,12 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - # shared-module modules that still need prerequisites filled - CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) - CIRCUITPY_RANDOM = 0 # Requires OS - CIRCUITPY_STORAGE = 0 # Requires OS, filesystem endif ifeq ($(MCU_SERIES),F7) # Not yet implemented common-hal modules: CIRCUITPY_ANALOGIO = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_PULSEIO = 1 - CIRCUITPY_OS = 1 CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 @@ -50,7 +43,4 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 # shared-module modules that still need prerequisites filled - CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO, and common-hal module (stub ok) - CIRCUITPY_RANDOM = 0 # Requires OS - CIRCUITPY_STORAGE = 0 # Requires OS, filesystem endif diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index aaddbb4714..60058d226b 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -111,6 +111,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, // Always set the backlight type in case we're reusing memory. self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { + // Avoid PWM types and functions when the module isn't enabled + #if (CIRCUITPY_PULSIO) pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; @@ -120,6 +122,12 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->backlight_pwm.base.type = &pulseio_pwmout_type; common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); } + #else + // Otherwise default to digital + self->backlight_inout.base.type = &digitalio_digitalinout_type; + common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); + common_hal_never_reset_pin(backlight_pin); + #endif } if (!self->auto_brightness && (self->backlight_inout.base.type != &mp_type_NoneType || brightness_command != NO_BRIGHTNESS_COMMAND)) { @@ -164,9 +172,21 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, brightness = 1.0-brightness; } bool ok = false; - if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { + + // Avoid PWM types and functions when the module isn't enabled + #if (CIRCUITPY_PULSIO) + bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; + #else + bool ispwm = false; + #endif + + if (ispwm) { + #if (CIRCUITPY_PULSIO) common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); ok = true; + #else + ok = false; + #endif } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_set_value(&self->backlight_inout, brightness > 0.99); ok = true; @@ -392,12 +412,16 @@ void displayio_display_background(displayio_display_obj_t* self) { void release_display(displayio_display_obj_t* self) { release_display_core(&self->core); + #if (CIRCUITPY_PULSIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); } + #else + common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); + #endif } void reset_display(displayio_display_obj_t* self) { From 435aa3d055644c130ca392d62972003c1f96be72 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 30 Apr 2020 14:49:47 -0400 Subject: [PATCH 377/919] Add correct PID for the OpenMV --- ports/stm/boards/openmv_h7/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index f28500a932..242dac52cd 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8098 +USB_PID = 0x80A4 USB_PRODUCT = "OpenMV-H7 R1" USB_MANUFACTURER = "OpenMV, LLC" USB_DEVICES = "CDC,MSC" From 06b62721b30e517be078b1e94ef0fd6a429af93f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 30 Apr 2020 15:49:17 -0400 Subject: [PATCH 378/919] Increase H7 filesystem size --- ports/stm/boards/STM32H743_fs.ld | 4 ++-- ports/stm/supervisor/internal_flash.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 251c6cc270..686f93ea36 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -12,8 +12,8 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* sector 0, 128K */ - FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* sector 1, 128K */ - FLASH_FIRMWARE (rx) : ORIGIN = 0x08040000, LENGTH = 1792K /* sectors 6*128 + 8*128 */ + FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 384K /* sector 1-3, 128K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08080000, LENGTH = 1536K /* sectors 4*128 + 8*128 */ DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */ SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */ diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 97626f9f4e..b4d07ff482 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -83,7 +83,7 @@ #ifdef STM32H743xx #define STM32_FLASH_SIZE 0x200000 //2MB -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 //128KiB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x60000 //384KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08020000 #endif From a863b0a3490c55b0e7e1321d9ac9cf249a6addd5 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 30 Apr 2020 13:46:12 -0700 Subject: [PATCH 379/919] Fix openmv_h7 build --- ports/stm/boards/openmv_h7/mpconfigboard.h | 3 + .../stm/boards/openmv_h7/stm32h7xx_hal_conf.h | 493 ------------------ 2 files changed, 3 insertions(+), 493 deletions(-) delete mode 100644 ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index c23064f750..9a049ed2cf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -32,3 +32,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) + diff --git a/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h b/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h deleted file mode 100644 index 8fb01aceaf..0000000000 --- a/ports/stm/boards/openmv_h7/stm32h7xx_hal_conf.h +++ /dev/null @@ -1,493 +0,0 @@ -/** - ****************************************************************************** - * @file stm32h7xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32H7xx_HAL_CONF_H -#define __STM32H7xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_FDCAN_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_COMP_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -#define HAL_ETH_MODULE_ENABLED -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_OTFDEC_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_HSEM_MODULE_ENABLED */ -/* #define HAL_GFXMMU_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_OPAMP_MODULE_ENABLED */ -/* #define HAL_OSPI_MODULE_ENABLED */ -/* #define HAL_OSPI_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -/* #define HAL_SWPMI_MODULE_ENABLED */ -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_PSSI_MODULE_ENABLED */ -/* #define HAL_DTS_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_MDMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_HSEM_MODULE_ENABLED - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal oscillator (CSI) default value. - * This value is the default CSI value after Reset. - */ -#if !defined (CSI_VALUE) - #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* CSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */ - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ -#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ -#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ -#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################### Ethernet Configuration ######################### */ -#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ -#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ - -#define ETH_MAC_ADDR0 ((uint8_t)0x02) -#define ETH_MAC_ADDR1 ((uint8_t)0x00) -#define ETH_MAC_ADDR2 ((uint8_t)0x00) -#define ETH_MAC_ADDR3 ((uint8_t)0x00) -#define ETH_MAC_ADDR4 ((uint8_t)0x00) -#define ETH_MAC_ADDR5 ((uint8_t)0x00) - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32h7xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32h7xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32h7xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_MDMA_MODULE_ENABLED - #include "stm32h7xx_hal_mdma.h" -#endif /* HAL_MDMA_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32h7xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32h7xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32h7xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32h7xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32h7xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32h7xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32h7xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32h7xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32h7xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_FDCAN_MODULE_ENABLED - #include "stm32h7xx_hal_fdcan.h" -#endif /* HAL_FDCAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32h7xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32h7xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32h7xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32h7xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32h7xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32h7xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_GFXMMU_MODULE_ENABLED - #include "stm32h7xx_hal_gfxmmu.h" -#endif /* HAL_GFXMMU_MODULE_ENABLED */ - -#ifdef HAL_HRTIM_MODULE_ENABLED - #include "stm32h7xx_hal_hrtim.h" -#endif /* HAL_HRTIM_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32h7xx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32h7xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32h7xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32h7xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32h7xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32h7xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32h7xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_JPEG_MODULE_ENABLED - #include "stm32h7xx_hal_jpeg.h" -#endif /* HAL_JPEG_MODULE_ENABLED */ - -#ifdef HAL_MDIOS_MODULE_ENABLED - #include "stm32h7xx_hal_mdios.h" -#endif /* HAL_MDIOS_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32h7xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32h7xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32h7xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_OPAMP_MODULE_ENABLED -#include "stm32h7xx_hal_opamp.h" -#endif /* HAL_OPAMP_MODULE_ENABLED */ - -#ifdef HAL_OSPI_MODULE_ENABLED - #include "stm32h7xx_hal_ospi.h" -#endif /* HAL_OSPI_MODULE_ENABLED */ - -#ifdef HAL_OTFDEC_MODULE_ENABLED -#include "stm32h7xx_hal_otfdec.h" -#endif /* HAL_OTFDEC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32h7xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32h7xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RAMECC_MODULE_ENABLED - #include "stm32h7xx_hal_ramecc.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32h7xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32h7xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32h7xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32h7xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32h7xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32h7xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32h7xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_SWPMI_MODULE_ENABLED - #include "stm32h7xx_hal_swpmi.h" -#endif /* HAL_SWPMI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32h7xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32h7xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32h7xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32h7xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32h7xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32h7xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32h7xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32h7xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32h7xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_PSSI_MODULE_ENABLED - #include "stm32h7xx_hal_pssi.h" -#endif /* HAL_PSSI_MODULE_ENABLED */ - -#ifdef HAL_DTS_MODULE_ENABLED - #include "stm32h7xx_hal_dts.h" -#endif /* HAL_DTS_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32H7xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From a3a2dd0f70928885974e984ebe34fe67490fc2b0 Mon Sep 17 00:00:00 2001 From: spkuehl Date: Thu, 30 Apr 2020 19:14:51 -0500 Subject: [PATCH 380/919] Corrected UART output. --- shared-bindings/board/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 3dda59fb8e..28d3f7c91b 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -113,7 +113,7 @@ mp_obj_t board_uart(void) { } #else mp_obj_t board_uart(void) { - mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); + mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_UART); return NULL; } #endif From 7dd3ddc06b428a10ada5700bb68002c325ed79c2 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Fri, 1 May 2020 06:03:19 +0000 Subject: [PATCH 381/919] use Nordic's VID which seems to be allowed https://devzone.nordicsemi.com/f/nordic-q-a/50638/usb-pid-for-nrf52840 --- ports/nrf/boards/pitaya_go/mpconfigboard.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/pitaya_go/mpconfigboard.mk b/ports/nrf/boards/pitaya_go/mpconfigboard.mk index e3b273f966..247ddd8ac5 100644 --- a/ports/nrf/boards/pitaya_go/mpconfigboard.mk +++ b/ports/nrf/boards/pitaya_go/mpconfigboard.mk @@ -1,5 +1,6 @@ -USB_VID = 0x239A -USB_PID = 0x802A +# Using Nordic's VID - https://devzone.nordicsemi.com/f/nordic-q-a/50638/usb-pid-for-nrf52840 +USB_VID = 0x1915 +USB_PID = 0xb001 USB_PRODUCT = "Pitaya Go" USB_MANUFACTURER = "Makerdiary" From bc581fbdfb10f9cf89f2e7572cd67e1dc10b8451 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 1 May 2020 10:06:40 -0400 Subject: [PATCH 382/919] Add-unidirectional-SPI --- ports/mimxrt10xx/Makefile | 3 + ports/mimxrt10xx/common-hal/busio/SPI.c | 255 ++++++++++++++---------- ports/mimxrt10xx/common-hal/busio/SPI.h | 8 +- ports/mimxrt10xx/supervisor/port.c | 3 +- 4 files changed, 156 insertions(+), 113 deletions(-) diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 80d1da1aac..cc2ec8f2b2 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -93,6 +93,9 @@ endif CFLAGS += $(INC) -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +# Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align +CFLAGS += -Wno-undef -Wno-cast-align + CFLAGS += \ -mthumb \ -mapcs \ diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 24a6dbff6d..be5f1a6fc8 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -25,7 +25,6 @@ * THE SOFTWARE. */ -//TODO #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -35,46 +34,10 @@ #include -//bool never_reset_sercoms[SERCOM_INST_NUM]; -// -//void never_reset_sercom(Sercom* sercom) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (sercom_instances[i] == sercom) { -// never_reset_sercoms[i] = true; -// break; -// } -// } -//} -// -//void allow_reset_sercom(Sercom* sercom) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (sercom_instances[i] == sercom) { -// never_reset_sercoms[i] = false; -// break; -// } -// } -//} -// -//void reset_sercoms(void) { -// // Reset all SERCOMs except the ones being used by on-board devices. -// Sercom *sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS; -// for (int i = 0; i < SERCOM_INST_NUM; i++) { -// if (never_reset_sercoms[i]) { -// continue; -// } -// #ifdef MICROPY_HW_APA102_SERCOM -// if (sercom_instances[i] == MICROPY_HW_APA102_SERCOM) { -// continue; -// } -// #endif -// // SWRST is same for all modes of SERCOMs. -// sercom_instances[i]->SPI.CTRLA.bit.SWRST = 1; -// } -//} +//arrays use 0 based numbering: SPI1 is stored at index 0 +#define MAX_SPI 4 +STATIC bool reserved_spi[MAX_SPI]; +STATIC bool never_reset_spi[MAX_SPI]; static void config_periph_pin(const mcu_periph_obj_t *periph) { IOMUXC_SetPinMux( @@ -97,52 +60,144 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) { #define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv))) +void spi_reset(void) { + for (int i = 0; i < MAX_SPI; i++) { + reserved_spi[i] = false; + } +} + void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) { - // TODO: Allow none mosi or miso + const uint32_t sck_count = MP_ARRAY_SIZE(mcu_spi_sck_list); + const uint32_t miso_count = MP_ARRAY_SIZE(mcu_spi_miso_list); + const uint32_t mosi_count = MP_ARRAY_SIZE(mcu_spi_mosi_list); + bool spi_taken = false; - const uint32_t sck_count = sizeof(mcu_spi_sck_list) / sizeof(mcu_periph_obj_t); - const uint32_t miso_count = sizeof(mcu_spi_miso_list) / sizeof(mcu_periph_obj_t); - const uint32_t mosi_count = sizeof(mcu_spi_mosi_list) / sizeof(mcu_periph_obj_t); - - for (uint32_t i = 0; i < sck_count; ++i) { - if (mcu_spi_sck_list[i].pin != clock) + for (uint i = 0; i < sck_count; i++) { + if (mcu_spi_sck_list[i].pin != clock) { continue; - - for (uint32_t j = 0; j < miso_count; ++j) { - if (mcu_spi_miso_list[j].pin != miso) - continue; - - if (mcu_spi_miso_list[j].bank_idx != mcu_spi_sck_list[i].bank_idx) - continue; - - for (uint32_t k = 0; k < mosi_count; ++k) { - if (mcu_spi_mosi_list[k].pin != mosi) + } + //if both MOSI and MISO exist, loop search normally + if ((mosi != NULL) && (miso != NULL)) { + for (uint j = 0; j < mosi_count; j++) { + if ((mcu_spi_mosi_list[i].pin != mosi) + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)){ continue; - - if (mcu_spi_mosi_list[k].bank_idx != mcu_spi_miso_list[j].bank_idx) - continue; - - self->clock_pin = &mcu_spi_sck_list[i]; - self->miso_pin = &mcu_spi_miso_list[j]; - self->mosi_pin = &mcu_spi_mosi_list[k]; - + } + for (uint k = 0; k < miso_count; k++) { + if ((mcu_spi_miso_list[k].pin != miso) //everything needs the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[k].bank_idx)) { + continue; + } + //keep looking if the SPI is taken, edge case + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + //store pins if not + self->clock = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = &mcu_spi_miso_list[k]; + break; + } + if (self->clock != NULL) { + break; // Multi-level break to pick lowest peripheral + } + } + if (self->clock != NULL) { break; } + // if just MISO, reduce search + } else if (miso != NULL) { + for (uint j = 0; j < miso_count; j++) { + if ((mcu_spi_miso_list[j].pin != miso) //only SCK and MISO need the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[j].bank_idx)) { + continue; + } + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + self->clock = &mcu_spi_sck_list[i]; + self->mosi = NULL; + self->miso = &mcu_spi_miso_list[j]; + break; + } + if (self->clock != NULL) { + break; + } + // if just MOSI, reduce search + } else if (mosi != NULL) { + for (uint j = 0; j < mosi_count; j++) { + if ((mcu_spi_mosi_list[j].pin != mosi) //only SCK and MOSI need the same index + || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)) { + continue; + } + if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { + spi_taken = true; + continue; + } + self->clock = &mcu_spi_sck_list[i]; + self->mosi = &mcu_spi_mosi_list[j]; + self->miso = NULL; + break; + } + if (self->clock != NULL) { + break; + } + } else { + //throw an error immediately + mp_raise_ValueError(translate("Must provide MISO or MOSI pin")); } } - if(self->clock_pin == NULL || self->mosi_pin == NULL || self->miso_pin == NULL) { - mp_raise_RuntimeError(translate("Invalid SPI pin selection")); + // for (uint32_t i = 0; i < sck_count; ++i) { + // if (mcu_spi_sck_list[i].pin != clock) + // continue; + + // for (uint32_t j = 0; j < miso_count; ++j) { + // if (mcu_spi_miso_list[j].pin != miso) + // continue; + + // if (mcu_spi_miso_list[j].bank_idx != mcu_spi_sck_list[i].bank_idx) + // continue; + + // for (uint32_t k = 0; k < mosi_count; ++k) { + // if (mcu_spi_mosi_list[k].pin != mosi) + // continue; + + // if (mcu_spi_mosi_list[k].bank_idx != mcu_spi_miso_list[j].bank_idx) + // continue; + + // self->clock = &mcu_spi_sck_list[i]; + // self->miso_pin = &mcu_spi_miso_list[j]; + // self->mosi_pin = &mcu_spi_mosi_list[k]; + + // break; + // } + // } + // } + + if (self->clock != NULL && (self->mosi != NULL || self->miso != NULL)) { + self->spi = mcu_spi_banks[self->clock->bank_idx - 1]; } else { - self->spi = mcu_spi_banks[self->clock_pin->bank_idx - 1]; + if (spi_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid SPI pin selection")); + } } - config_periph_pin(self->mosi_pin); - config_periph_pin(self->miso_pin); - config_periph_pin(self->clock_pin); + config_periph_pin(self->clock); + if (self->mosi != NULL) { + config_periph_pin(self->mosi); + } + if (self->miso != NULL) { + config_periph_pin(self->miso); + } + reserved_spi[self->clock->bank_idx - 1] = true; lpspi_master_config_t config = { 0 }; LPSPI_MasterGetDefaultConfig(&config); @@ -150,47 +205,27 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // Always start at 250khz which is what SD cards need. They are sensitive to // SPI bus noise before they are put into SPI mode. config.baudRate = 250000; - LPSPI_MasterInit(self->spi, &config, LPSPI_MASTER_CLK_FREQ); - LPSPI_Enable(self->spi, false); uint32_t tcrPrescaleValue; self->baudrate = LPSPI_MasterSetBaudRate(self->spi, config.baudRate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue); LPSPI_Enable(self->spi, true); - claim_pin(self->clock_pin->pin); - -// if (mosi_none) { -// self->MOSI_pin = NO_PIN; -// } else { -// gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); -// gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); -// gpio_set_pin_function(mosi->number, mosi_pinmux); -// self->MOSI_pin = mosi->number; - claim_pin(self->mosi_pin->pin); -// } - -// if (miso_none) { -// self->MISO_pin = NO_PIN; -// } else { -// gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); -// gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); -// gpio_set_pin_function(miso->number, miso_pinmux); -// self->MISO_pin = miso->number; - claim_pin(self->miso_pin->pin); -// } + claim_pin(self->clock->pin); + if (self->mosi != NULL) { + claim_pin(self->mosi->pin); + } + if (self->miso != NULL) { + claim_pin(self->miso->pin); + } } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { -// never_reset_sercom(self->spi_desc.dev.prvt); - -// never_reset_pin_number(self->clock_pin); -// never_reset_pin_number(self->MOSI_pin); -// never_reset_pin_number(self->MISO_pin); + // TODO } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { - return self->clock_pin == NULL; + return self->clock == NULL; } void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { @@ -198,14 +233,7 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { return; } -// allow_reset_sercom(self->spi_desc.dev.prvt); - -// spi_m_sync_disable(&self->spi_desc); -// spi_m_sync_deinit(&self->spi_desc); -// reset_pin_number(self->clock_pin); -// reset_pin_number(self->MOSI_pin); -// reset_pin_number(self->MISO_pin); - self->clock_pin = NULL; + self->clock = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, @@ -260,6 +288,9 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, if (len == 0) { return true; } + if (self->mosi == NULL) { + mp_raise_ValueError(translate("No MOSI Pin")); + } lpspi_transfer_t xfer = { 0 }; xfer.txData = (uint8_t*)data; @@ -278,6 +309,9 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, if (len == 0) { return true; } + if (self->miso == NULL) { + mp_raise_ValueError(translate("No MISO Pin")); + } LPSPI_SetDummyData(self->spi, write_value); @@ -296,6 +330,9 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin if (len == 0) { return true; } + if (self->miso == NULL || self->mosi == NULL) { + mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); + } LPSPI_SetDummyData(self->spi, 0xFF); diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.h b/ports/mimxrt10xx/common-hal/busio/SPI.h index 0895e1ddbc..f699cd7adf 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.h +++ b/ports/mimxrt10xx/common-hal/busio/SPI.h @@ -38,9 +38,11 @@ typedef struct { LPSPI_Type *spi; bool has_lock; uint32_t baudrate; - const mcu_periph_obj_t *clock_pin; - const mcu_periph_obj_t *mosi_pin; - const mcu_periph_obj_t *miso_pin; + const mcu_periph_obj_t *clock; + const mcu_periph_obj_t *mosi; + const mcu_periph_obj_t *miso; } busio_spi_obj_t; +void spi_reset(void); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 7ba7a77011..527029951e 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -41,6 +41,7 @@ #include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PWMOut.h" #include "common-hal/rtc/RTC.h" +#include "common-hal/busio/SPI.h" #include "reset.h" #include "tick.h" @@ -264,7 +265,7 @@ safe_mode_t port_init(void) { } void reset_port(void) { - //reset_sercoms(); + spi_reset(); #if CIRCUITPY_AUDIOIO audio_dma_reset(); From 61b0994631672076f6ca64e02572cb501e6bf932 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 1 May 2020 14:46:06 -0400 Subject: [PATCH 383/919] Fix flag typo --- ports/stm/mpconfigport.mk | 1 - shared-module/displayio/Display.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 8298a5e2dc..e6d6e5f2ea 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -42,5 +42,4 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 - # shared-module modules that still need prerequisites filled endif diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 60058d226b..8129c4df65 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -112,7 +112,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, self->backlight_inout.base.type = &mp_type_NoneType; if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { // Avoid PWM types and functions when the module isn't enabled - #if (CIRCUITPY_PULSIO) + #if (CIRCUITPY_PULSEIO) pwmout_result_t result = common_hal_pulseio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; @@ -174,14 +174,14 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, bool ok = false; // Avoid PWM types and functions when the module isn't enabled - #if (CIRCUITPY_PULSIO) + #if (CIRCUITPY_PULSEIO) bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; #else bool ispwm = false; #endif if (ispwm) { - #if (CIRCUITPY_PULSIO) + #if (CIRCUITPY_PULSEIO) common_hal_pulseio_pwmout_set_duty_cycle(&self->backlight_pwm, (uint16_t) (0xffff * brightness)); ok = true; #else @@ -412,7 +412,7 @@ void displayio_display_background(displayio_display_obj_t* self) { void release_display(displayio_display_obj_t* self) { release_display_core(&self->core); - #if (CIRCUITPY_PULSIO) + #if (CIRCUITPY_PULSEIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); From 0e465e63b98c3825298219e2144a145208aaff7f Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 1 May 2020 18:23:27 -0400 Subject: [PATCH 384/919] Did audiopwmio, bitbangio, and _bleio --- shared-bindings/_bleio/Adapter.c | 151 ++++++++--------- shared-bindings/_bleio/Address.c | 71 ++++---- shared-bindings/_bleio/Attribute.c | 58 +++---- shared-bindings/_bleio/Characteristic.c | 134 +++++++-------- shared-bindings/_bleio/CharacteristicBuffer.c | 81 ++++----- shared-bindings/_bleio/Connection.c | 105 ++++++------ shared-bindings/_bleio/Descriptor.c | 72 ++++---- shared-bindings/_bleio/PacketBuffer.c | 73 ++++---- shared-bindings/_bleio/ScanEntry.c | 54 +++--- shared-bindings/_bleio/ScanResults.c | 31 ++-- shared-bindings/_bleio/Service.c | 51 +++--- shared-bindings/_bleio/UUID.c | 67 ++++---- shared-bindings/_bleio/__init__.c | 38 +++-- shared-bindings/audiopwmio/PWMAudioOut.c | 160 +++++++++--------- shared-bindings/audiopwmio/__init__.c | 4 +- shared-bindings/bitbangio/I2C.c | 152 ++++++++--------- shared-bindings/bitbangio/OneWire.c | 80 ++++----- shared-bindings/bitbangio/SPI.c | 127 +++++++------- shared-bindings/bitbangio/__init__.c | 4 +- 19 files changed, 738 insertions(+), 775 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 921667f0fb..6fb5c323d7 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -47,35 +47,35 @@ #define INTERVAL_MAX_STRING "40.959375" #define WINDOW_DEFAULT (0.1f) -//| .. currentmodule:: _bleio +//| class Adapter: +//| """.. currentmodule:: _bleio //| -//| :class:`Adapter` --- BLE adapter -//| ---------------------------------------------------- +//| :class:`Adapter` --- BLE adapter +//| ---------------------------------------------------- //| -//| The Adapter manages the discovery and connection to other nearby Bluetooth Low Energy devices. -//| This part of the Bluetooth Low Energy Specification is known as Generic Access Profile (GAP). +//| The Adapter manages the discovery and connection to other nearby Bluetooth Low Energy devices. +//| This part of the Bluetooth Low Energy Specification is known as Generic Access Profile (GAP). //| -//| Discovery of other devices happens during a scanning process that listens for small packets of -//| information, known as advertisements, that are broadcast unencrypted. The advertising packets -//| have two different uses. The first is to broadcast a small piece of data to anyone who cares and -//| and nothing more. These are known as Beacons. The second class of advertisement is to promote -//| additional functionality available after the devices establish a connection. For example, a -//| BLE keyboard may advertise that it can provide key information, but not what the key info is. +//| Discovery of other devices happens during a scanning process that listens for small packets of +//| information, known as advertisements, that are broadcast unencrypted. The advertising packets +//| have two different uses. The first is to broadcast a small piece of data to anyone who cares and +//| and nothing more. These are known as Beacons. The second class of advertisement is to promote +//| additional functionality available after the devices establish a connection. For example, a +//| BLE keyboard may advertise that it can provide key information, but not what the key info is. //| -//| The built-in BLE adapter can do both parts of this process: it can scan for other device -//| advertisements and it can advertise its own data. Furthermore, Adapters can accept incoming -//| connections and also initiate connections. +//| The built-in BLE adapter can do both parts of this process: it can scan for other device +//| advertisements and it can advertise its own data. Furthermore, Adapters can accept incoming +//| connections and also initiate connections.""" //| -//| .. class:: Adapter() -//| -//| You cannot create an instance of `_bleio.Adapter`. -//| Use `_bleio.adapter` to access the sole instance available. +//| def __init__(self, ): +//| """You cannot create an instance of `_bleio.Adapter`. +//| Use `_bleio.adapter` to access the sole instance available.""" +//| ... //| -//| .. attribute:: enabled -//| -//| State of the BLE adapter. +//| enabled: Any = ... +//| """State of the BLE adapter.""" //| STATIC mp_obj_t bleio_adapter_get_enabled(mp_obj_t self) { return mp_obj_new_bool(common_hal_bleio_adapter_get_enabled(self)); @@ -98,9 +98,8 @@ const mp_obj_property_t bleio_adapter_enabled_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: address -//| -//| MAC address of the BLE adapter. (read-only) +//| address: Any = ... +//| """MAC address of the BLE adapter. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) { return MP_OBJ_FROM_PTR(common_hal_bleio_adapter_get_address(self)); @@ -115,11 +114,10 @@ const mp_obj_property_t bleio_adapter_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: name -//| -//| name of the BLE adapter used once connected. -//| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``, -//| to make it easy to distinguish multiple CircuitPython boards. +//| name: Any = ... +//| """name of the BLE adapter used once connected. +//| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``, +//| to make it easy to distinguish multiple CircuitPython boards.""" //| STATIC mp_obj_t bleio_adapter_get_name(mp_obj_t self) { return MP_OBJ_FROM_PTR(common_hal_bleio_adapter_get_name(self)); @@ -140,18 +138,18 @@ const mp_obj_property_t bleio_adapter_name_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. method:: start_advertising(data, *, scan_response=None, connectable=True, interval=0.1) +//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, interval: float = 0.1) -> Any: +//| """Starts advertising until `stop_advertising` is called or if connectable, another device +//| connects to us. //| -//| Starts advertising until `stop_advertising` is called or if connectable, another device -//| connects to us. +//| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an +//| extended advertisement that older BLE 4.x clients won't be able to scan for. //| -//| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an -//| extended advertisement that older BLE 4.x clients won't be able to scan for. -//| -//| :param buf data: advertising data packet bytes -//| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. -//| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. -//| :param float interval: advertising interval, in seconds +//| :param buf data: advertising data packet bytes +//| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. +//| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. +//| :param float interval: advertising interval, in seconds""" +//| ... //| STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -198,9 +196,10 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_advertising_obj, 2, bleio_adapter_start_advertising); -//| .. method:: stop_advertising() +//| def stop_advertising(self, ) -> Any: +//| """Stop sending advertising packets.""" +//| ... //| -//| Stop sending advertising packets. STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -210,25 +209,25 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| .. method:: start_scan(prefixes=b"", \*, buffer_size=512, extended=False, timeout=None, interval=0.1, window=0.1, minimum_rssi=-80, active=True) +//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any: +//| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are +//| filtered and returned separately. //| -//| Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are -//| filtered and returned separately. -//| -//| :param sequence prefixes: Sequence of byte string prefixes to filter advertising packets -//| with. A packet without an advertising structure that matches one of the prefixes is -//| ignored. Format is one byte for length (n) and n bytes of prefix and can be repeated. -//| :param int buffer_size: the maximum number of advertising bytes to buffer. -//| :param bool extended: When True, support extended advertising packets. Increasing buffer_size is recommended when this is set. -//| :param float timeout: the scan timeout in seconds. If None, will scan until `stop_scan` is called. -//| :param float interval: the interval (in seconds) between the start of two consecutive scan windows -//| Must be in the range 0.0025 - 40.959375 seconds. -//| :param float window: the duration (in seconds) to scan a single BLE channel. -//| window must be <= interval. -//| :param int minimum_rssi: the minimum rssi of entries to return. -//| :param bool active: retrieve scan responses for scannable advertisements. -//| :returns: an iterable of `_bleio.ScanEntry` objects -//| :rtype: iterable +//| :param sequence prefixes: Sequence of byte string prefixes to filter advertising packets +//| with. A packet without an advertising structure that matches one of the prefixes is +//| ignored. Format is one byte for length (n) and n bytes of prefix and can be repeated. +//| :param int buffer_size: the maximum number of advertising bytes to buffer. +//| :param bool extended: When True, support extended advertising packets. Increasing buffer_size is recommended when this is set. +//| :param float timeout: the scan timeout in seconds. If None, will scan until `stop_scan` is called. +//| :param float interval: the interval (in seconds) between the start of two consecutive scan windows +//| Must be in the range 0.0025 - 40.959375 seconds. +//| :param float window: the duration (in seconds) to scan a single BLE channel. +//| window must be <= interval. +//| :param int minimum_rssi: the minimum rssi of entries to return. +//| :param bool active: retrieve scan responses for scannable advertisements. +//| :returns: an iterable of `_bleio.ScanEntry` objects +//| :rtype: iterable""" +//| ... //| STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_prefixes, ARG_buffer_size, ARG_extended, ARG_timeout, ARG_interval, ARG_window, ARG_minimum_rssi, ARG_active }; @@ -283,9 +282,10 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter_start_scan); -//| .. method:: stop_scan() +//| def stop_scan(self, ) -> Any: +//| """Stop the current scan.""" +//| ... //| -//| Stop the current scan. STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -295,10 +295,9 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_scan_obj, bleio_adapter_stop_scan); -//| .. attribute:: connected -//| -//| True when the adapter is connected to another device regardless of who initiated the -//| connection. (read-only) +//| connected: Any = ... +//| """True when the adapter is connected to another device regardless of who initiated the +//| connection. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_connected(mp_obj_t self) { return mp_obj_new_bool(common_hal_bleio_adapter_get_connected(self)); @@ -313,10 +312,9 @@ const mp_obj_property_t bleio_adapter_connected_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: connections -//| -//| Tuple of active connections including those initiated through -//| :py:meth:`_bleio.Adapter.connect`. (read-only) +//| connections: Any = ... +//| """Tuple of active connections including those initiated through +//| :py:meth:`_bleio.Adapter.connect`. (read-only)""" //| STATIC mp_obj_t bleio_adapter_get_connections(mp_obj_t self) { return common_hal_bleio_adapter_get_connections(self); @@ -330,12 +328,12 @@ const mp_obj_property_t bleio_adapter_connections_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. method:: connect(address, *, timeout) +//| def connect(self, address: Address, *, timeout: float/int) -> Any: +//| """Attempts a connection to the device with the given address. //| -//| Attempts a connection to the device with the given address. -//| -//| :param Address address: The address of the peripheral to connect to -//| :param float/int timeout: Try to connect for timeout seconds. +//| :param Address address: The address of the peripheral to connect to +//| :param float/int timeout: Try to connect for timeout seconds.""" +//| ... //| STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -360,9 +358,10 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 2, bleio_adapter_connect); -//| .. method:: erase_bonding() +//| def erase_bonding(self, ) -> Any: +//| """Erase all bonding information stored in flash memory.""" +//| ... //| -//| Erase all bonding information stored in flash memory. STATIC mp_obj_t bleio_adapter_erase_bonding(mp_obj_t self_in) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index c31eb604b1..2071bd3b24 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -34,22 +34,23 @@ #include "shared-bindings/_bleio/Address.h" #include "shared-module/_bleio/Address.h" -//| .. currentmodule:: _bleio +//| class Address: +//| """.. currentmodule:: _bleio //| -//| :class:`Address` -- BLE address -//| ========================================================= +//| :class:`Address` -- BLE address +//| ========================================================= //| -//| Encapsulates the address of a BLE device. +//| Encapsulates the address of a BLE device.""" //| -//| .. class:: Address(address, address_type) +//| def __init__(self, address: buf, address_type: Any): +//| """Create a new Address object encapsulating the address value. +//| The value itself can be one of: //| -//| Create a new Address object encapsulating the address value. -//| The value itself can be one of: -//| -//| :param buf address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. -//| :param int address_type: one of the integer values: `PUBLIC`, `RANDOM_STATIC`, -//| `RANDOM_PRIVATE_RESOLVABLE`, or `RANDOM_PRIVATE_NON_RESOLVABLE`. +//| :param buf address: The address value to encapsulate. A buffer object (bytearray, bytes) of 6 bytes. +//| :param int address_type: one of the integer values: `PUBLIC`, `RANDOM_STATIC`, +//| `RANDOM_PRIVATE_RESOLVABLE`, or `RANDOM_PRIVATE_NON_RESOLVABLE`.""" +//| ... //| STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_address_type }; @@ -81,9 +82,8 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| .. attribute:: address_bytes -//| -//| The bytes that make up the device address (read-only). +//| address_bytes: Any = ... +//| """The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will @@ -97,7 +97,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, //| >>> _bleio.adapter.address //|
//| >>> _bleio.adapter.address.address_bytes -//| b'5\xa8\xed\xf5\x1d\xc8' +//| b'5\xa8\xed\xf5\x1d\xc8'""" //| STATIC mp_obj_t bleio_address_get_address_bytes(mp_obj_t self_in) { bleio_address_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -113,12 +113,11 @@ const mp_obj_property_t bleio_address_address_bytes_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: type -//| -//| The address type (read-only). +//| type: Any = ... +//| """The address type (read-only). //| //| One of the integer values: `PUBLIC`, `RANDOM_STATIC`, `RANDOM_PRIVATE_RESOLVABLE`, -//| or `RANDOM_PRIVATE_NON_RESOLVABLE`. +//| or `RANDOM_PRIVATE_NON_RESOLVABLE`.""" //| STATIC mp_obj_t bleio_address_get_type(mp_obj_t self_in) { bleio_address_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -134,9 +133,9 @@ const mp_obj_property_t bleio_address_type_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: __eq__(other) -//| -//| Two Address objects are equal if their addresses and address types are equal. +//| def __eq__(self, other: Any) -> Any: +//| """Two Address objects are equal if their addresses and address types are equal.""" +//| ... //| STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { switch (op) { @@ -160,9 +159,9 @@ STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_o } } -//| .. method:: __hash__() -//| -//| Returns a hash for the Address data. +//| def __hash__(self, ) -> Any: +//| """Returns a hash for the Address data.""" +//| ... //| STATIC mp_obj_t bleio_address_unary_op(mp_unary_op_t op, mp_obj_t self_in) { switch (op) { @@ -193,22 +192,18 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]); } -//| .. data:: PUBLIC +//| PUBLIC: Any = ... +//| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits).""" //| -//| A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits). +//| RANDOM_STATIC: Any = ... +//| """A randomly generated address that does not change often. It may never change or may change after +//| a power cycle.""" //| -//| .. data:: RANDOM_STATIC +//| RANDOM_PRIVATE_RESOLVABLE: Any = ... +//| """An address that is usable when the peer knows the other device's secret Identity Resolving Key (IRK).""" //| -//| A randomly generated address that does not change often. It may never change or may change after -//| a power cycle. -//| -//| .. data:: RANDOM_PRIVATE_RESOLVABLE -//| -//| An address that is usable when the peer knows the other device's secret Identity Resolving Key (IRK). -//| -//| .. data:: RANDOM_PRIVATE_NON_RESOLVABLE -//| -//| A randomly generated address that changes on every connection. +//| RANDOM_PRIVATE_NON_RESOLVABLE: Any = ... +//| """A randomly generated address that changes on every connection.""" //| STATIC const mp_rom_map_elem_t bleio_address_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_address_bytes), MP_ROM_PTR(&bleio_address_address_bytes_obj) }, diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 2d8b15b9f4..72fd13d1cc 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -29,52 +29,44 @@ #include "shared-bindings/_bleio/Characteristic.h" #include "shared-bindings/_bleio/UUID.h" -// - -//| .. currentmodule:: _bleio +//| class Attribute: +//| """.. currentmodule:: _bleio //| -//| :class:`Attribute` -- BLE Attribute -//| ========================================================= +//| :class:`Attribute` -- BLE Attribute +//| ========================================================= //| -//| Definitions associated with all BLE attributes: characteristics, descriptors, etc. -//| :py:class:`~_bleio.Attribute` is, notionally, a superclass of -//| :py:class:`~Characteristic` and :py:class:`~Descriptor`, -//| but is not defined as a Python superclass of those classes. +//| Definitions associated with all BLE attributes: characteristics, descriptors, etc. +//| :py:class:`~_bleio.Attribute` is, notionally, a superclass of +//| :py:class:`~Characteristic` and :py:class:`~Descriptor`, +//| but is not defined as a Python superclass of those classes.""" //| -//| .. class:: Attribute() -//| -//| You cannot create an instance of :py:class:`~_bleio.Attribute`. +//| def __init__(self, ): +//| """You cannot create an instance of :py:class:`~_bleio.Attribute`.""" +//| ... //| STATIC const mp_rom_map_elem_t bleio_attribute_locals_dict_table[] = { -//| .. data:: NO_ACCESS +//| NO_ACCESS: Any = ... +//| """security mode: access not allowed""" //| -//| security mode: access not allowed +//| OPEN: Any = ... +//| """security_mode: no security (link is not encrypted)""" //| -//| .. data:: OPEN +//| ENCRYPT_NO_MITM: Any = ... +//| """security_mode: unauthenticated encryption, without man-in-the-middle protection""" //| -//| security_mode: no security (link is not encrypted) +//| ENCRYPT_WITH_MITM: Any = ... +//| """security_mode: authenticated encryption, with man-in-the-middle protection""" //| -//| .. data:: ENCRYPT_NO_MITM +//| LESC_ENCRYPT_WITH_MITM: Any = ... +//| """security_mode: LESC encryption, with man-in-the-middle protection""" //| -//| security_mode: unauthenticated encryption, without man-in-the-middle protection +//| SIGNED_NO_MITM: Any = ... +//| """security_mode: unauthenticated data signing, without man-in-the-middle protection""" //| -//| .. data:: ENCRYPT_WITH_MITM -//| -//| security_mode: authenticated encryption, with man-in-the-middle protection -//| -//| .. data:: LESC_ENCRYPT_WITH_MITM -//| -//| security_mode: LESC encryption, with man-in-the-middle protection -//| -//| .. data:: SIGNED_NO_MITM -//| -//| security_mode: unauthenticated data signing, without man-in-the-middle protection -//| -//| .. data:: SIGNED_WITH_MITM -//| -//| security_mode: authenticated data signing, without man-in-the-middle protection +//| SIGNED_WITH_MITM: Any = ... +//| """security_mode: authenticated data signing, without man-in-the-middle protection""" //| { MP_ROM_QSTR(MP_QSTR_NO_ACCESS), MP_ROM_INT(SECURITY_MODE_NO_ACCESS) }, { MP_ROM_QSTR(MP_QSTR_OPEN), MP_ROM_INT(SECURITY_MODE_OPEN) }, diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index e55191f7ce..f8f18d0bd6 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -33,45 +33,46 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -//| .. currentmodule:: _bleio +//| class Characteristic: +//| """.. currentmodule:: _bleio //| -//| :class:`Characteristic` -- BLE service characteristic -//| ========================================================= +//| :class:`Characteristic` -- BLE service characteristic +//| ========================================================= //| -//| Stores information about a BLE service characteristic and allows reading -//| and writing of the characteristic's value. +//| Stores information about a BLE service characteristic and allows reading +//| and writing of the characteristic's value.""" //| -//| .. class:: Characteristic -//| -//| There is no regular constructor for a Characteristic. A new local Characteristic can be created -//| and attached to a Service by calling `add_to_service()`. -//| Remote Characteristic objects are created by `Connection.discover_remote_services()` -//| as part of remote Services. +//| def __init__(self, ): +//| """There is no regular constructor for a Characteristic. A new local Characteristic can be created +//| and attached to a Service by calling `add_to_service()`. +//| Remote Characteristic objects are created by `Connection.discover_remote_services()` +//| as part of remote Services.""" +//| ... //| -//| .. method:: add_to_service(service, uuid, *, properties=0, read_perm=Attribute.OPEN, write_perm=Attribute.OPEN, max_length=20, fixed_length=False, initial_value=None) +//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Any: +//| """Create a new Characteristic object, and add it to this Service. //| -//| Create a new Characteristic object, and add it to this Service. +//| :param Service service: The service that will provide this characteristic +//| :param UUID uuid: The uuid of the characteristic +//| :param int properties: The properties of the characteristic, +//| specified as a bitmask of these values bitwise-or'd together: +//| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`. +//| :param int read_perm: Specifies whether the characteristic can be read by a client, and if so, which +//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, +//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, +//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. +//| :param int write_perm: Specifies whether the characteristic can be written by a client, and if so, which +//| security mode is required. Values allowed are the same as ``read_perm``. +//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is +//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum +//| number of data bytes that fit in a single BLE 4.x ATT packet. +//| :param bool fixed_length: True if the characteristic value is of fixed length. +//| :param buf initial_value: The initial value for this characteristic. If not given, will be +//| filled with zeros. //| -//| :param Service service: The service that will provide this characteristic -//| :param UUID uuid: The uuid of the characteristic -//| :param int properties: The properties of the characteristic, -//| specified as a bitmask of these values bitwise-or'd together: -//| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`. -//| :param int read_perm: Specifies whether the characteristic can be read by a client, and if so, which -//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, -//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, -//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. -//| :param int write_perm: Specifies whether the characteristic can be written by a client, and if so, which -//| security mode is required. Values allowed are the same as ``read_perm``. -//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is -//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum -//| number of data bytes that fit in a single BLE 4.x ATT packet. -//| :param bool fixed_length: True if the characteristic value is of fixed length. -//| :param buf initial_value: The initial value for this characteristic. If not given, will be -//| filled with zeros. -//| -//| :return: the new Characteristic. +//| :return: the new Characteristic.""" +//| ... //| STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // class is arg[0], which we can ignore. @@ -145,11 +146,10 @@ STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_characteristic_add_to_service_obj, -//| .. attribute:: properties -//| -//| An int bitmask representing which properties are set, specified as bitwise or'ing of +//| properties: Any = ... +//| """An int bitmask representing which properties are set, specified as bitwise or'ing of //| of these possible values. -//| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`. +//| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`.""" //| STATIC mp_obj_t bleio_characteristic_get_properties(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -165,11 +165,10 @@ const mp_obj_property_t bleio_characteristic_properties_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: uuid +//| uuid: Any = ... +//| """The UUID of this characteristic. (read-only) //| -//| The UUID of this characteristic. (read-only) -//| -//| Will be ``None`` if the 128-bit UUID for this characteristic is not known. +//| Will be ``None`` if the 128-bit UUID for this characteristic is not known.""" //| STATIC mp_obj_t bleio_characteristic_get_uuid(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -186,9 +185,8 @@ const mp_obj_property_t bleio_characteristic_uuid_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: value -//| -//| The value of this characteristic. +//| value: Any = ... +//| """The value of this characteristic.""" //| STATIC mp_obj_t bleio_characteristic_get_value(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -218,9 +216,8 @@ const mp_obj_property_t bleio_characteristic_value_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: descriptors -//| -//| A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only) +//| descriptors: Any = ... +//| """A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only)""" //| STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -249,9 +246,8 @@ const mp_obj_property_t bleio_characteristic_descriptors_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: service (read-only) -//| -//| The Service this Characteristic is a part of. +//| service: Any = ... +//| """The Service this Characteristic is a part of.""" //| STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -267,12 +263,12 @@ const mp_obj_property_t bleio_characteristic_service_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. method:: set_cccd(*, notify=False, indicate=False) +//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> Any: +//| """Set the remote characteristic's CCCD to enable or disable notification and indication. //| -//| Set the remote characteristic's CCCD to enable or disable notification and indication. -//| -//| :param bool notify: True if Characteristic should receive notifications of remote writes -//| :param float indicate: True if Characteristic should receive indications of remote writes +//| :param bool notify: True if Characteristic should receive notifications of remote writes +//| :param float indicate: True if Characteristic should receive indications of remote writes""" +//| ... //| STATIC mp_obj_t bleio_characteristic_set_cccd(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -300,29 +296,23 @@ STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) }, // Bitmask constants to represent properties -//| .. data:: BROADCAST +//| BROADCAST: Any = ... +//| """property: allowed in advertising packets""" //| -//| property: allowed in advertising packets +//| INDICATE: Any = ... +//| """property: server will indicate to the client when the value is set and wait for a response""" //| -//| .. data:: INDICATE +//| NOTIFY: Any = ... +//| """property: server will notify the client when the value is set""" //| -//| property: server will indicate to the client when the value is set and wait for a response +//| READ: Any = ... +//| """property: clients may read this characteristic""" //| -//| .. data:: NOTIFY +//| WRITE: Any = ... +//| """property: clients may write this characteristic; a response will be sent back""" //| -//| property: server will notify the client when the value is set -//| -//| .. data:: READ -//| -//| property: clients may read this characteristic -//| -//| .. data:: WRITE -//| -//| property: clients may write this characteristic; a response will be sent back -//| -//| .. data:: WRITE_NO_RESPONSE -//| -//| property: clients may write this characteristic; no response will be sent back +//| WRITE_NO_RESPONSE: Any = ... +//| """property: clients may write this characteristic; no response will be sent back""" //| { MP_ROM_QSTR(MP_QSTR_BROADCAST), MP_ROM_INT(CHAR_PROP_BROADCAST) }, { MP_ROM_QSTR(MP_QSTR_INDICATE), MP_ROM_INT(CHAR_PROP_INDICATE) }, diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index fc95d0d503..f38f650d91 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -41,24 +41,26 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self } } -//| .. currentmodule:: _bleio +//| class CharacteristicBuffer: +//| """.. currentmodule:: _bleio //| -//| :class:`CharacteristicBuffer` -- BLE Service incoming values buffer. -//| ===================================================================== +//| :class:`CharacteristicBuffer` -- BLE Service incoming values buffer. +//| ===================================================================== //| -//| Accumulates a Characteristic's incoming values in a FIFO buffer. +//| Accumulates a Characteristic's incoming values in a FIFO buffer.""" //| -//| .. class:: CharacteristicBuffer(characteristic, *, timeout=1, buffer_size=64) +//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64): //| -//| Monitor the given Characteristic. Each time a new value is written to the Characteristic -//| add the newly-written bytes to a FIFO buffer. +//| """Monitor the given Characteristic. Each time a new value is written to the Characteristic +//| add the newly-written bytes to a FIFO buffer. //| -//| :param Characteristic characteristic: The Characteristic to monitor. -//| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic -//| in a remote Service that a Central has connected to. -//| :param int timeout: the timeout in seconds to wait for the first character and between subsequent characters. -//| :param int buffer_size: Size of ring buffer that stores incoming data coming from client. -//| Must be >= 1. +//| :param Characteristic characteristic: The Characteristic to monitor. +//| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic +//| in a remote Service that a Central has connected to. +//| :param int timeout: the timeout in seconds to wait for the first character and between subsequent characters. +//| :param int buffer_size: Size of ring buffer that stores incoming data coming from client. +//| Must be >= 1.""" +//| ... //| STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_characteristic, ARG_timeout, ARG_buffer_size, }; @@ -103,29 +105,29 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) { // These are standard stream methods. Code is in py/stream.c. // -//| .. method:: read(nbytes=None) +//| def read(self, nbytes: Any = None) -> Any: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. //| -//| Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//| :return: Data read +//| :rtype: bytes or None""" +//| ... //| -//| :return: Data read -//| :rtype: bytes or None +//| def readinto(self, buf: Any) -> Any: +//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. //| -//| .. method:: readinto(buf) +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: int or None (on a non-blocking error)""" +//| ... //| -//| Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. +//| def readline(self, ) -> Any: +//| """Read a line, ending in a newline character. //| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: int or None (on a non-blocking error) -//| -//| .. method:: readline() -//| -//| Read a line, ending in a newline character. -//| -//| :return: the line read -//| :rtype: int or None +//| :return: the line read +//| :rtype: int or None""" +//| ... //| // These three methods are used by the shared stream methods. @@ -170,9 +172,8 @@ STATIC mp_uint_t bleio_characteristic_buffer_ioctl(mp_obj_t self_in, mp_uint_t r return ret; } -//| .. attribute:: in_waiting -//| -//| The number of bytes in the input buffer, available to be read +//| in_waiting: Any = ... +//| """The number of bytes in the input buffer, available to be read""" //| STATIC mp_obj_t bleio_characteristic_buffer_obj_get_in_waiting(mp_obj_t self_in) { bleio_characteristic_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -188,9 +189,9 @@ const mp_obj_property_t bleio_characteristic_buffer_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: reset_input_buffer() -//| -//| Discard any unread characters in the input buffer. +//| def reset_input_buffer(self, ) -> Any: +//| """Discard any unread characters in the input buffer.""" +//| ... //| STATIC mp_obj_t bleio_characteristic_buffer_obj_reset_input_buffer(mp_obj_t self_in) { bleio_characteristic_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -200,9 +201,9 @@ STATIC mp_obj_t bleio_characteristic_buffer_obj_reset_input_buffer(mp_obj_t self } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_buffer_reset_input_buffer_obj, bleio_characteristic_buffer_obj_reset_input_buffer); -//| .. method:: deinit() -//| -//| Disable permanently. +//| def deinit(self, ) -> Any: +//| """Disable permanently.""" +//| ... //| STATIC mp_obj_t bleio_characteristic_buffer_deinit(mp_obj_t self_in) { bleio_characteristic_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index c157af3652..2165f12b8e 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -42,28 +42,29 @@ #include "shared-bindings/_bleio/Characteristic.h" #include "shared-bindings/_bleio/Service.h" -//| .. currentmodule:: _bleio +//| class Connection: +//| """.. currentmodule:: _bleio //| -//| :class:`Connection` -- A BLE connection -//| ========================================================= +//| :class:`Connection` -- A BLE connection +//| ========================================================= //| -//| A BLE connection to another device. Used to discover and interact with services on the other -//| device. +//| A BLE connection to another device. Used to discover and interact with services on the other +//| device. //| -//| Usage:: +//| Usage:: //| -//| import _bleio +//| import _bleio //| -//| my_entry = None -//| for entry in _bleio.adapter.scan(2.5): -//| if entry.name is not None and entry.name == 'InterestingPeripheral': -//| my_entry = entry -//| break +//| my_entry = None +//| for entry in _bleio.adapter.scan(2.5): +//| if entry.name is not None and entry.name == 'InterestingPeripheral': +//| my_entry = entry +//| break //| -//| if not my_entry: -//| raise Exception("'InterestingPeripheral' not found") +//| if not my_entry: +//| raise Exception("'InterestingPeripheral' not found") //| -//| connection = _bleio.adapter.connect(my_entry.address, timeout=10) +//| connection = _bleio.adapter.connect(my_entry.address, timeout=10)""" //| void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { @@ -72,15 +73,15 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { } } -//| .. class:: Connection() +//| def __init__(self, ): +//| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. +//| Connections may also be made when another device initiates a connection. To use a Connection +//| created by a peer, read the `Adapter.connections` property. +//| ... //| -//| Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`. -//| Connections may also be made when another device initiates a connection. To use a Connection -//| created by a peer, read the `Adapter.connections` property. -//| -//| .. method:: disconnect() -//| -//| Disconnects from the remote peripheral. Does nothing if already disconnected. +//| def disconnect(self, ) -> Any: +//| ""Disconnects from the remote peripheral. Does nothing if already disconnected.""" +//| ... //| STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -91,9 +92,9 @@ STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect); -//| .. method:: pair(*, bond=True) -//| -//| Pair to the peer to improve security. +//| def pair(self, *, bond: Any = True) -> Any: +//| """Pair to the peer to improve security.""" +//| ... //| STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -113,29 +114,29 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); -//| .. method:: discover_remote_services(service_uuids_whitelist=None) +//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Any: +//| """Do BLE discovery for all services or for the given service UUIDS, +//| to find their handles and characteristics, and return the discovered services. +//| `Connection.connected` must be True. //| -//| Do BLE discovery for all services or for the given service UUIDS, -//| to find their handles and characteristics, and return the discovered services. -//| `Connection.connected` must be True. +//| :param iterable service_uuids_whitelist: //| -//| :param iterable service_uuids_whitelist: +//| an iterable of :py:class:~`UUID` objects for the services provided by the peripheral +//| that you want to use. //| -//| an iterable of :py:class:~`UUID` objects for the services provided by the peripheral -//| that you want to use. +//| The peripheral may provide more services, but services not listed are ignored +//| and will not be returned. //| -//| The peripheral may provide more services, but services not listed are ignored -//| and will not be returned. +//| If service_uuids_whitelist is None, then all services will undergo discovery, which can be +//| slow. //| -//| If service_uuids_whitelist is None, then all services will undergo discovery, which can be -//| slow. +//| If the service UUID is 128-bit, or its characteristic UUID's are 128-bit, you +//| you must have already created a :py:class:~`UUID` object for that UUID in order for the +//| service or characteristic to be discovered. Creating the UUID causes the UUID to be +//| registered for use. (This restriction may be lifted in the future.) //| -//| If the service UUID is 128-bit, or its characteristic UUID's are 128-bit, you -//| you must have already created a :py:class:~`UUID` object for that UUID in order for the -//| service or characteristic to be discovered. Creating the UUID causes the UUID to be -//| registered for use. (This restriction may be lifted in the future.) -//| -//| :return: A tuple of `_bleio.Service` objects provided by the remote peripheral. +//| :return: A tuple of `_bleio.Service` objects provided by the remote peripheral.""" +//| ... //| STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -156,9 +157,8 @@ STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, cons } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_discover_remote_services_obj, 1, bleio_connection_discover_remote_services); -//| .. attribute:: connected -//| -//| True if connected to the remote peer. +//| connected: Any = ... +//| """True if connected to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -175,9 +175,8 @@ const mp_obj_property_t bleio_connection_connected_obj = { }; -//| .. attribute:: paired -//| -//| True if paired to the remote peer. +//| paired: Any = ... +//| """True if paired to the remote peer.""" //| STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -194,17 +193,15 @@ const mp_obj_property_t bleio_connection_paired_obj = { }; -//| .. attribute:: connection_interval -//| -//| Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers +//| connection_interval: Any = ... +//| """Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers //| increase speed and decrease latency but increase power consumption. //| //| When setting connection_interval, the peer may reject the new interval and //| `connection_interval` will then remain the same. //| //| Apple has additional guidelines that dictate should be a multiple of 15ms except if HID is -//| available. When HID is available Apple devices may accept 11.25ms intervals. -//| +//| available. When HID is available Apple devices may accept 11.25ms intervals.""" //| STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index f7b6b5bbf1..00b3bacf51 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -33,41 +33,42 @@ #include "shared-bindings/_bleio/Descriptor.h" #include "shared-bindings/_bleio/UUID.h" -//| .. currentmodule:: _bleio +//| class Descriptor: +//| """.. currentmodule:: _bleio //| -//| :class:`Descriptor` -- BLE descriptor -//| ========================================================= +//| :class:`Descriptor` -- BLE descriptor +//| ========================================================= //| -//| Stores information about a BLE descriptor. -//| Descriptors are attached to BLE characteristics and provide contextual -//| information about the characteristic. +//| Stores information about a BLE descriptor. +//| Descriptors are attached to BLE characteristics and provide contextual +//| information about the characteristic.""" //| -//| .. class:: Descriptor +//| def __init__(self, ): +//| """There is no regular constructor for a Descriptor. A new local Descriptor can be created +//| and attached to a Characteristic by calling `add_to_characteristic()`. +//| Remote Descriptor objects are created by `Connection.discover_remote_services()` +//| as part of remote Characteristics in the remote Services that are discovered. //| -//| There is no regular constructor for a Descriptor. A new local Descriptor can be created -//| and attached to a Characteristic by calling `add_to_characteristic()`. -//| Remote Descriptor objects are created by `Connection.discover_remote_services()` -//| as part of remote Characteristics in the remote Services that are discovered. +//| .. classmethod:: add_to_characteristic(characteristic, uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'') //| -//| .. classmethod:: add_to_characteristic(characteristic, uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'') +//| Create a new Descriptor object, and add it to this Service. //| -//| Create a new Descriptor object, and add it to this Service. +//| :param Characteristic characteristic: The characteristic that will hold this descriptor +//| :param UUID uuid: The uuid of the descriptor +//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which +//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, +//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, +//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. +//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which +//| security mode is required. Values allowed are the same as ``read_perm``. +//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is +//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum +//| number of data bytes that fit in a single BLE 4.x ATT packet. +//| :param bool fixed_length: True if the descriptor value is of fixed length. +//| :param buf initial_value: The initial value for this descriptor. //| -//| :param Characteristic characteristic: The characteristic that will hold this descriptor -//| :param UUID uuid: The uuid of the descriptor -//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which -//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`, -//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`, -//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`. -//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which -//| security mode is required. Values allowed are the same as ``read_perm``. -//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is -//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum -//| number of data bytes that fit in a single BLE 4.x ATT packet. -//| :param bool fixed_length: True if the descriptor value is of fixed length. -//| :param buf initial_value: The initial value for this descriptor. -//| -//| :return: the new Descriptor. +//| :return: the new Descriptor.""" +//| ... //| STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // class is arg[0], which we can ignore. @@ -135,9 +136,8 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_descriptor_add_to_characteristic_fun_obj, 3, bleio_descriptor_add_to_characteristic); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_descriptor_add_to_characteristic_obj, MP_ROM_PTR(&bleio_descriptor_add_to_characteristic_fun_obj)); -//| .. attribute:: uuid -//| -//| The descriptor uuid. (read-only) +//| uuid: Any = ... +//| """The descriptor uuid. (read-only)""" //| STATIC mp_obj_t bleio_descriptor_get_uuid(mp_obj_t self_in) { bleio_descriptor_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -154,9 +154,8 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: characteristic (read-only) -//| -//| The Characteristic this Descriptor is a part of. +//| characteristic: Any = ... +//| """The Characteristic this Descriptor is a part of.""" //| STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) { bleio_descriptor_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -172,9 +171,8 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: value -//| -//| The value of this descriptor. +//| value: Any = ... +//| """The value of this descriptor.""" //| STATIC mp_obj_t bleio_descriptor_get_value(mp_obj_t self_in) { bleio_descriptor_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 9e3666044a..14efa022b3 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -35,29 +35,30 @@ #include "shared-bindings/_bleio/UUID.h" #include "shared-bindings/util.h" -//| .. currentmodule:: _bleio +//| class PacketBuffer: +//| """.. currentmodule:: _bleio //| -//| :class:`PacketBuffer` -- Packet-oriented characteristic usage. -//| ===================================================================== +//| :class:`PacketBuffer` -- Packet-oriented characteristic usage. +//| ===================================================================== //| -//| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware -//| outgoing writes. A packet's size is either the characteristic length or the maximum transmission -//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a -//| buffer to store data. +//| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware +//| outgoing writes. A packet's size is either the characteristic length or the maximum transmission +//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a +//| buffer to store data. //| -//| When we're the server, we ignore all connections besides the first to subscribe to -//| notifications. +//| When we're the server, we ignore all connections besides the first to subscribe to +//| notifications.""" //| -//| .. class:: PacketBuffer(characteristic, *, buffer_size) +//| def __init__(self, characteristic: Characteristic, *, buffer_size: int): +//| """Monitor the given Characteristic. Each time a new value is written to the Characteristic +//| add the newly-written bytes to a FIFO buffer. //| -//| Monitor the given Characteristic. Each time a new value is written to the Characteristic -//| add the newly-written bytes to a FIFO buffer. -//| -//| :param Characteristic characteristic: The Characteristic to monitor. -//| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic -//| in a remote Service that a Central has connected to. -//| :param int buffer_size: Size of ring buffer (in packets of the Characteristic's maximum -//| length) that stores incoming packets coming from the peer. +//| :param Characteristic characteristic: The Characteristic to monitor. +//| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic +//| in a remote Service that a Central has connected to. +//| :param int buffer_size: Size of ring buffer (in packets of the Characteristic's maximum +//| length) that stores incoming packets coming from the peer.""" +//| ... //| STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_characteristic, ARG_buffer_size }; @@ -94,13 +95,13 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) { } } -//| .. method:: readinto(buf) +//| def readinto(self, buf: Any) -> Any: +//| """Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer +//| than the given buffer. Use `packet_size` to read the maximum length of a single packet. //| -//| Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer -//| than the given buffer. Use `packet_size` to read the maximum length of a single packet. -//| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: int +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: int""" +//| ... //| STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_obj) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -118,12 +119,12 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto); -//| .. method:: write(data, *, header=None) +//| def write(self, data: Any, *, header: Any = None) -> Any: +//| """Writes all bytes from data into the same outgoing packet. The bytes from header are included +//| before data when the pending packet is currently empty. //| -//| Writes all bytes from data into the same outgoing packet. The bytes from header are included -//| before data when the pending packet is currently empty. -//| -//| This does not block until the data is sent. It only blocks until the data is pending. +//| This does not block until the data is sent. It only blocks until the data is pending.""" +//| ... //| // TODO: Add a kwarg `merge=False` to dictate whether subsequent writes are merged into a pending // one. @@ -155,10 +156,9 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write); -//| .. method:: deinit() -//| -//| Disable permanently. -//| +//| def deinit(self, ) -> Any: +//| """Disable permanently.""" +//| ... STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_bleio_packet_buffer_deinit(self); @@ -166,10 +166,9 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); -//| .. attribute:: packet_size -//| -//| Maximum size of each packet in bytes. This is the minimum of the Characteristic length and -//| the negotiated Maximum Transfer Unit (MTU). +//| packet_size: Any = ... +//| """Maximum size of each packet in bytes. This is the minimum of the Characteristic length and +//| the negotiated Maximum Transfer Unit (MTU).""" //| STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index d03cd6fb55..a92b247be3 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -35,25 +35,26 @@ #include "shared-bindings/_bleio/UUID.h" #include "shared-module/_bleio/ScanEntry.h" -//| .. currentmodule:: _bleio +//| class ScanEntry: +//| """.. currentmodule:: _bleio //| -//| :class:`ScanEntry` -- BLE scan data -//| ========================================================= +//| :class:`ScanEntry` -- BLE scan data +//| ========================================================= //| -//| Encapsulates information about a device that was received during scanning. It can be -//| advertisement or scan response data. This object may only be created by a `_bleio.ScanResults`: -//| it has no user-visible constructor. +//| Encapsulates information about a device that was received during scanning. It can be +//| advertisement or scan response data. This object may only be created by a `_bleio.ScanResults`: +//| it has no user-visible constructor.""" //| -//| .. class:: ScanEntry() +//| def __init__(self, ): +//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" +//| ... //| -//| Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`. -//| -//| .. method:: matches(prefixes, *, all=True) -//| -//| Returns True if the ScanEntry matches all prefixes when ``all`` is True. This is stricter -//| than the scan filtering which accepts any advertisements that match any of the prefixes -//| where all is False. +//| def matches(self, prefixes: Any, *, all: Any = True) -> Any: +//| """Returns True if the ScanEntry matches all prefixes when ``all`` is True. This is stricter +//| than the scan filtering which accepts any advertisements that match any of the prefixes +//| where all is False.""" +//| ... //| STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -74,9 +75,8 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches); -//| .. attribute:: address -//| -//| The address of the device (read-only), of type `_bleio.Address`. +//| address: Any = ... +//| """The address of the device (read-only), of type `_bleio.Address`.""" //| STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -91,9 +91,8 @@ const mp_obj_property_t bleio_scanentry_address_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: advertisement_bytes -//| -//| All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only) +//| advertisement_bytes: Any = ... +//| """All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only)""" //| STATIC mp_obj_t scanentry_get_advertisement_bytes(mp_obj_t self_in) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -108,9 +107,8 @@ const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: rssi -//| -//| The signal strength of the device at the time of the scan, in integer dBm. (read-only) +//| rssi: Any = ... +//| """The signal strength of the device at the time of the scan, in integer dBm. (read-only)""" //| STATIC mp_obj_t scanentry_get_rssi(mp_obj_t self_in) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -125,9 +123,8 @@ const mp_obj_property_t bleio_scanentry_rssi_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: connectable -//| -//| True if the device can be connected to. (read-only) +//| connectable: Any = ... +//| """True if the device can be connected to. (read-only)""" //| STATIC mp_obj_t scanentry_get_connectable(mp_obj_t self_in) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -142,9 +139,8 @@ const mp_obj_property_t bleio_scanentry_connectable_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: scan_response -//| -//| True if the entry was a scan response. (read-only) +//| scan_response: Any = ... +//| """True if the entry was a scan response. (read-only)""" //| STATIC mp_obj_t scanentry_get_scan_response(mp_obj_t self_in) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index dcece3d5d4..4b274fc682 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -32,13 +32,14 @@ #include "py/runtime.h" #include "shared-bindings/_bleio/ScanResults.h" -//| .. currentmodule:: _bleio +//| class ScanResults: +//| """.. currentmodule:: _bleio //| -//| :class:`ScanResults` -- An Iterator over BLE scanning results -//| =============================================================== +//| :class:`ScanResults` -- An Iterator over BLE scanning results +//| =============================================================== //| -//| Iterates over advertising data received while scanning. This object is always created -//| by a `_bleio.Adapter`: it has no user-visible constructor. +//| Iterates over advertising data received while scanning. This object is always created +//| by a `_bleio.Adapter`: it has no user-visible constructor.""" //| STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &bleio_scanresults_type)); @@ -50,18 +51,18 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { return MP_OBJ_STOP_ITERATION; } -//| .. class:: ScanResults() +//| def __init__(self, ): +//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`.""" +//| ... //| -//| Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`. +//| def __iter__(self, ) -> Any: +//| """Returns itself since it is the iterator.""" +//| ... //| -//| .. method:: __iter__() -//| -//| Returns itself since it is the iterator. -//| -//| .. method:: __next__() -//| -//| Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still -//| active. Raises `StopIteration` if scanning is finished and no other results are available. +//| def __next__(self, ) -> Any: +//| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still +//| active. Raises `StopIteration` if scanning is finished and no other results are available.""" +//| ... //| const mp_obj_type_t bleio_scanresults_type = { diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index bc242bc364..3526ce1899 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -32,25 +32,26 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -//| .. currentmodule:: _bleio +//| class Service: +//| """.. currentmodule:: _bleio //| -//| :class:`Service` -- BLE GATT Service -//| ========================================================= +//| :class:`Service` -- BLE GATT Service +//| ========================================================= //| -//| Stores information about a BLE service and its characteristics. +//| Stores information about a BLE service and its characteristics.""" //| -//| .. class:: Service(uuid, *, secondary=False) +//| def __init__(self, uuid: UUID, *, secondary: bool = False): +//| """Create a new Service identified by the specified UUID. It can be accessed by all +//| connections. This is known as a Service server. Client Service objects are created via +//| `Connection.discover_remote_services`. //| -//| Create a new Service identified by the specified UUID. It can be accessed by all -//| connections. This is known as a Service server. Client Service objects are created via -//| `Connection.discover_remote_services`. +//| To mark the Service as secondary, pass `True` as :py:data:`secondary`. //| -//| To mark the Service as secondary, pass `True` as :py:data:`secondary`. +//| :param UUID uuid: The uuid of the service +//| :param bool secondary: If the service is a secondary one //| -//| :param UUID uuid: The uuid of the service -//| :param bool secondary: If the service is a secondary one -// -//| :return: the new Service +//| :return: the new Service""" +//| ... //| STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_uuid, ARG_secondary }; @@ -77,10 +78,9 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(service); } -//| .. attribute:: characteristics -//| -//| A tuple of :py:class:`Characteristic` designating the characteristics that are offered by -//| this service. (read-only) +//| characteristics: Any = ... +//| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by +//| this service. (read-only)""" //| STATIC mp_obj_t bleio_service_get_characteristics(mp_obj_t self_in) { bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -97,9 +97,8 @@ const mp_obj_property_t bleio_service_characteristics_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: remote -//| -//| True if this is a service provided by a remote device. (read-only) +//| remote: Any = ... +//| """True if this is a service provided by a remote device. (read-only)""" //| STATIC mp_obj_t bleio_service_get_remote(mp_obj_t self_in) { bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -115,9 +114,8 @@ const mp_obj_property_t bleio_service_remote_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: secondary -//| -//| True if this is a secondary service. (read-only) +//| secondary: Any = ... +//| """True if this is a secondary service. (read-only)""" //| STATIC mp_obj_t bleio_service_get_secondary(mp_obj_t self_in) { bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -133,11 +131,10 @@ const mp_obj_property_t bleio_service_secondary_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: uuid +//| uuid: Any = ... +//| """The UUID of this service. (read-only) //| -//| The UUID of this service. (read-only) -//| -//| Will be ``None`` if the 128-bit UUID for this service is not known. +//| Will be ``None`` if the 128-bit UUID for this service is not known.""" //| STATIC mp_obj_t bleio_service_get_uuid(mp_obj_t self_in) { bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index dd34159022..d4b0f84cad 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -33,28 +33,28 @@ #include "py/runtime.h" #include "shared-bindings/_bleio/UUID.h" -//| .. currentmodule:: _bleio +//| class UUID: +//| """.. currentmodule:: _bleio //| -//| :class:`UUID` -- BLE UUID -//| ========================================================= +//| :class:`UUID` -- BLE UUID +//| ========================================================= //| -//| A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more. +//| A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" //| - -//| .. class:: UUID(value) +//| def __init__(self, value: Any): +//| """Create a new UUID or UUID object encapsulating the uuid value. +//| The value can be one of: //| -//| Create a new UUID or UUID object encapsulating the uuid value. -//| The value can be one of: +//| - an `int` value in range 0 to 0xFFFF (Bluetooth SIG 16-bit UUID) +//| - a buffer object (bytearray, bytes) of 16 bytes in little-endian order (128-bit UUID) +//| - a string of hex digits of the form 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' //| -//| - an `int` value in range 0 to 0xFFFF (Bluetooth SIG 16-bit UUID) -//| - a buffer object (bytearray, bytes) of 16 bytes in little-endian order (128-bit UUID) -//| - a string of hex digits of the form 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' +//| Creating a 128-bit UUID registers the UUID with the onboard BLE software, and provides a +//| temporary 16-bit UUID that can be used in place of the full 128-bit UUID. //| -//| Creating a 128-bit UUID registers the UUID with the onboard BLE software, and provides a -//| temporary 16-bit UUID that can be used in place of the full 128-bit UUID. -//| -//| :param value: The uuid value to encapsulate -//| :type value: int or typing.ByteString +//| :param value: The uuid value to encapsulate +//| :type value: int or typing.ByteString""" +//| ... //| STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -125,11 +125,10 @@ STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, co return MP_OBJ_FROM_PTR(self); } -//| .. attribute:: uuid16 +//| uuid16: Any = ... +//| """The 16-bit part of the UUID. (read-only) //| -//| The 16-bit part of the UUID. (read-only) -//| -//| :type: int +//| :type: int""" //| STATIC mp_obj_t bleio_uuid_get_uuid16(mp_obj_t self_in) { bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -145,12 +144,11 @@ const mp_obj_property_t bleio_uuid_uuid16_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: uuid128 -//| -//| The 128-bit value of the UUID +//| uuid128: Any = ... +//| """The 128-bit value of the UUID //| Raises AttributeError if this is a 16-bit UUID. (read-only) //| -//| :type: bytes +//| :type: bytes""" //| STATIC mp_obj_t bleio_uuid_get_uuid128(mp_obj_t self_in) { bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -172,12 +170,11 @@ const mp_obj_property_t bleio_uuid_uuid128_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: size -//| -//| 128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a +//| size: Any = ... +//| """128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a //| 16-bit Bluetooth SIG assigned UUID. (read-only) 32-bit UUIDs are not currently supported. //| -//| :type: int +//| :type: int""" //| STATIC mp_obj_t bleio_uuid_get_size(mp_obj_t self_in) { bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -194,9 +191,9 @@ const mp_obj_property_t bleio_uuid_size_obj = { }; -//| .. method:: pack_into(buffer, offset=0) -//| -//| Packs the UUID into the given buffer at the given offset. +//| def pack_into(self, buffer: Any, offset: Any = 0) -> Any: +//| """Packs the UUID into the given buffer at the given offset.""" +//| ... //| STATIC mp_obj_t bleio_uuid_pack_into(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); @@ -256,11 +253,9 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| - -//| .. method:: __eq__(other) -//| -//| Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit. +//| def __eq__(self, other: Any) -> Any: +//| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit.""" +//| ... //| STATIC mp_obj_t bleio_uuid_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { switch (op) { diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index dd401398c5..da7bfdd816 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -41,7 +41,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -//| :mod:`_bleio` --- Bluetooth Low Energy (BLE) communication +//| """:mod:`_bleio` --- Bluetooth Low Energy (BLE) communication //| ================================================================ //| //| .. module:: _bleio @@ -79,13 +79,14 @@ //| .. attribute:: adapter //| //| BLE Adapter used to manage device discovery and connections. -//| This object is the sole instance of `_bleio.Adapter`. +//| This object is the sole instance of `_bleio.Adapter`.""" //| -//| .. class:: BluetoothError(Exception) -//| -//| Catch all exception for Bluetooth related errors. -//| + +//| class BluetoothError: +//| def __init__(self, Exception: Any): +//| """Catch all exception for Bluetooth related errors.""" +//| ... MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { @@ -95,10 +96,10 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) va_end(argptr); nlr_raise(exception); } - -//| .. class:: ConnectionError(BluetoothError) -//| -//| Raised when a connection is unavailable. +//| class ConnectionError: +//| def __init__(self, BluetoothError: Any): +//| """Raised when a connection is unavailable.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError) NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { @@ -109,19 +110,20 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ... nlr_raise(exception); } -//| .. class:: RoleError(BluetoothError) -//| -//| Raised when a resource is used as the mismatched role. For example, if a local CCCD is -//| attempted to be set but they can only be set when remote. +//| class RoleError: +//| def __init__(self, BluetoothError: Any): +//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is +//| attempted to be set but they can only be set when remote.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError) NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { mp_raise_msg(&mp_type_bleio_RoleError, msg); } - -//| .. class:: SecurityError(BluetoothError) -//| -//| Raised when a security related error occurs. +//| class SecurityError: +//| def __init__(self, BluetoothError: Any): +//| """Raised when a security related error occurs.""" +//| ... //| MP_DEFINE_BLEIO_EXCEPTION(SecurityError, bleio_BluetoothError) NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) { diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 9fa2b1578e..17f82e3f64 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -36,66 +36,67 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: audiopwmio +//| class PWMAudioOut: +//| """.. currentmodule:: audiopwmio //| -//| :class:`PWMAudioOut` -- Output an analog audio signal -//| ======================================================== +//| :class:`PWMAudioOut` -- Output an analog audio signal +//| ======================================================== //| -//| AudioOut can be used to output an analog audio signal on a given pin. +//| AudioOut can be used to output an analog audio signal on a given pin.""" //| -//| .. class:: PWMAudioOut(left_channel, *, right_channel=None, quiescent_value=0x8000) +//| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): +//| """Create a PWMAudioOut object associated with the given pin(s). This allows you to +//| play audio signals out on the given pin(s). In contrast to mod:`audioio`, +//| the pin(s) specified are digital pins, and are driven with a device-dependent PWM +//| signal. //| -//| Create a PWMAudioOut object associated with the given pin(s). This allows you to -//| play audio signals out on the given pin(s). In contrast to mod:`audioio`, -//| the pin(s) specified are digital pins, and are driven with a device-dependent PWM -//| signal. +//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to +//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to +//| :param int quiescent_value: The output value when no signal is present. Samples should start +//| and end with this value to prevent audible popping. //| -//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to -//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to -//| :param int quiescent_value: The output value when no signal is present. Samples should start -//| and end with this value to prevent audible popping. +//| Simple 8ksps 440 Hz sin wave:: //| -//| Simple 8ksps 440 Hz sin wave:: +//| import audiocore +//| import audiopwmio +//| import board +//| import array +//| import time +//| import math //| -//| import audiocore -//| import audiopwmio -//| import board -//| import array -//| import time -//| import math +//| # Generate one period of sine wav. +//| length = 8000 // 440 +//| sine_wave = array.array("H", [0] * length) +//| for i in range(length): +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| # Generate one period of sine wav. -//| length = 8000 // 440 -//| sine_wave = array.array("H", [0] * length) -//| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| dac = audiopwmio.PWMAudioOut(board.SPEAKER) +//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) +//| dac.play(sine_wave, loop=True) +//| time.sleep(1) +//| dac.stop() //| -//| dac = audiopwmio.PWMAudioOut(board.SPEAKER) -//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) -//| dac.play(sine_wave, loop=True) -//| time.sleep(1) -//| dac.stop() +//| Playing a wave file from flash:: //| -//| Playing a wave file from flash:: +//| import board +//| import audiocore +//| import audiopwmio +//| import digitalio //| -//| import board -//| import audiocore -//| import audiopwmio -//| import digitalio +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) //| -//| # Required for CircuitPlayground Express -//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) -//| speaker_enable.switch_to_output(value=True) +//| data = open("cplay-5.1-16bit-16khz.wav", "rb") +//| wav = audiocore.WaveFile(data) +//| a = audiopwmio.PWMAudioOut(board.SPEAKER) //| -//| data = open("cplay-5.1-16bit-16khz.wav", "rb") -//| wav = audiocore.WaveFile(data) -//| a = audiopwmio.PWMAudioOut(board.SPEAKER) -//| -//| print("playing") -//| a.play(wav) -//| while a.playing: -//| pass -//| print("stopped") +//| print("playing") +//| a.play(wav) +//| while a.playing: +//| pass +//| print("stopped")""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_left_channel, ARG_right_channel, ARG_quiescent_value }; @@ -118,9 +119,9 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the PWMAudioOut and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the PWMAudioOut and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_deinit(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -134,17 +135,16 @@ STATIC void check_for_deinit(audiopwmio_pwmaudioout_obj_t *self) { raise_deinited_error(); } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. -//| +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; common_hal_audiopwmio_pwmaudioout_deinit(args[0]); @@ -153,16 +153,16 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj___exit__(size_t n_args, const mp_obj_ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiopwmio_pwmaudioout___exit___obj, 4, 4, audiopwmio_pwmaudioout_obj___exit__); -//| .. method:: play(sample, *, loop=False) +//| def play(self, sample: Any, *, loop: Any = False) -> Any: +//| """Plays the sample once when loop=False and continuously when loop=True. +//| Does not block. Use `playing` to block. //| -//| Plays the sample once when loop=False and continuously when loop=True. -//| Does not block. Use `playing` to block. +//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. //| -//| Sample must be an `audiocore.WaveFile`, `audiocore.RawSample`, or `audiomixer.Mixer`. -//| -//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output -//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit -//| DAC that ignores the lowest 6 bits when playing 16 bit samples. +//| The sample itself should consist of 16 bit samples. Microcontrollers with a lower output +//| resolution will use the highest order bits to output. For example, the SAMD21 has a 10 bit +//| DAC that ignores the lowest 6 bits when playing 16 bit samples.""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_play(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_sample, ARG_loop }; @@ -182,9 +182,9 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_play(size_t n_args, const mp_obj_t *p } MP_DEFINE_CONST_FUN_OBJ_KW(audiopwmio_pwmaudioout_play_obj, 1, audiopwmio_pwmaudioout_obj_play); -//| .. method:: stop() -//| -//| Stops playback and resets to the start of the sample. +//| def stop(self, ) -> Any: +//| """Stops playback and resets to the start of the sample.""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_stop(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -194,9 +194,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_stop(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_stop_obj, audiopwmio_pwmaudioout_obj_stop); -//| .. attribute:: playing -//| -//| True when an audio sample is being output even if `paused`. (read-only) +//| playing: Any = ... +//| """True when an audio sample is being output even if `paused`. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_playing(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -212,9 +211,9 @@ const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: pause() -//| -//| Stops playback temporarily while remembering the position. Use `resume` to resume playback. +//| def pause(self, ) -> Any: +//| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_pause(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -228,9 +227,9 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_pause_obj, audiopwmio_pwmaudioout_obj_pause); -//| .. method:: resume() -//| -//| Resumes sample playback after :py:func:`pause`. +//| def resume(self, ) -> Any: +//| """Resumes sample playback after :py:func:`pause`.""" +//| ... //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_resume(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -244,9 +243,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_resume_obj, audiopwmio_pwmaudioout_obj_resume); -//| .. attribute:: paused -//| -//| True when playback is paused. (read-only) +//| paused: Any = ... +//| """True when playback is paused. (read-only)""" //| STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_paused(mp_obj_t self_in) { audiopwmio_pwmaudioout_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/audiopwmio/__init__.c b/shared-bindings/audiopwmio/__init__.c index 8a2b202b36..74d22b45ec 100644 --- a/shared-bindings/audiopwmio/__init__.c +++ b/shared-bindings/audiopwmio/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/audiopwmio/__init__.h" #include "shared-bindings/audiopwmio/PWMAudioOut.h" -//| :mod:`audiopwmio` --- Support for audio input and output +//| """:mod:`audiopwmio` --- Support for audio input and output //| ======================================================== //| //| .. module:: audiopwmio @@ -55,7 +55,7 @@ //| :ref:`lifetime-and-contextmanagers` for more info. //| //| Since CircuitPython 5, `Mixer`, `RawSample` and `WaveFile` are moved -//| to :mod:`audiocore`. +//| to :mod:`audiocore`.""" //| STATIC const mp_rom_map_elem_t audiopwmio_module_globals_table[] = { diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 3c4f137771..a682e050e1 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -37,21 +37,22 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: bitbangio +//| class I2C: +//| """.. currentmodule:: bitbangio //| -//| :class:`I2C` --- Two wire serial protocol -//| ------------------------------------------ +//| :class:`I2C` --- Two wire serial protocol +//| ------------------------------------------""" //| -//| .. class:: I2C(scl, sda, *, frequency=400000, timeout) +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int): +//| """I2C is a two-wire protocol for communicating between devices. At the +//| physical level it consists of 2 wires: SCL and SDA, the clock and data +//| lines respectively. //| -//| I2C is a two-wire protocol for communicating between devices. At the -//| physical level it consists of 2 wires: SCL and SDA, the clock and data -//| lines respectively. -//| -//| :param ~microcontroller.Pin scl: The clock pin -//| :param ~microcontroller.Pin sda: The data pin -//| :param int frequency: The clock frequency of the bus -//| :param int timeout: The maximum clock stretching timeout in microseconds +//| :param ~microcontroller.Pin scl: The clock pin +//| :param ~microcontroller.Pin sda: The data pin +//| :param int frequency: The clock frequency of the bus +//| :param int timeout: The maximum clock stretching timeout in microseconds""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_scl, ARG_sda, ARG_frequency, ARG_timeout }; @@ -73,9 +74,9 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| .. method:: deinit() -//| -//| Releases control of the underlying hardware so other classes can use it. +//| def deinit(self, ) -> Any: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_obj_deinit(mp_obj_t self_in) { bitbangio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -90,16 +91,16 @@ STATIC void check_for_deinit(bitbangio_i2c_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used in Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -114,11 +115,11 @@ static void check_lock(bitbangio_i2c_obj_t *self) { } } -//| .. method:: scan() -//| -//| Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of -//| those that respond. A device responds if it pulls the SDA line low after -//| its address (including a read bit) is sent on the bus. +//| def scan(self, ) -> Any: +//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of +//| those that respond. A device responds if it pulls the SDA line low after +//| its address (including a read bit) is sent on the bus.""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_scan(mp_obj_t self_in) { bitbangio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -136,9 +137,9 @@ STATIC mp_obj_t bitbangio_i2c_scan(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_scan_obj, bitbangio_i2c_scan); -//| .. method:: try_lock() -//| -//| Attempts to grab the I2C lock. Returns True on success. +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the I2C lock. Returns True on success.""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_obj_try_lock(mp_obj_t self_in) { bitbangio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -147,9 +148,9 @@ STATIC mp_obj_t bitbangio_i2c_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_try_lock_obj, bitbangio_i2c_obj_try_lock); -//| .. method:: unlock() -//| -//| Releases the I2C lock. +//| def unlock(self, ) -> Any: +//| """Releases the I2C lock.""" +//| ... //| STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { bitbangio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -159,20 +160,20 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); -//| .. method:: readfrom_into(address, buffer, *, start=0, end=None) +//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: +//| """Read into ``buffer`` from the slave specified by ``address``. +//| The number of bytes read will be the length of ``buffer``. +//| At least one byte must be read. //| -//| Read into ``buffer`` from the slave specified by ``address``. -//| The number of bytes read will be the length of ``buffer``. -//| At least one byte must be read. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buf[start:end]`` will so it saves memory. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buf[start:end]`` will so it saves memory. -//| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer to write into -//| :param int start: Index to start writing at -//| :param int end: Index to write up to but not include +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer to write into +//| :param int start: Index to start writing at +//| :param int end: Index to write up to but not include""" +//| ... //| // Shared arg parsing for readfrom_into and writeto_then_readfrom. STATIC void readfrom(bitbangio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) { @@ -211,25 +212,25 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| .. method:: writeto(address, buffer, *, start=0, end=None, stop=True) +//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: +//| """Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a +//| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start +//| before a read. //| -//| Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a -//| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start -//| before a read. +//| If ``start`` or ``end`` is provided, then the buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like +//| ``buffer[start:end]`` will so it saves memory. //| -//| If ``start`` or ``end`` is provided, then the buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like -//| ``buffer[start:end]`` will so it saves memory. +//| Writing a buffer or slice of length zero is permitted, as it can be used +//| to poll for the existence of a device. //| -//| Writing a buffer or slice of length zero is permitted, as it can be used -//| to poll for the existence of a device. -//| -//| :param int address: 7-bit device address -//| :param bytearray buffer: buffer containing the bytes to write -//| :param int start: Index to start writing from -//| :param int end: Index to read up to but not include -//| :param bool stop: If true, output an I2C stop condition after the buffer is written. -//| Deprecated. Will be removed in 6.x and act as stop=True. +//| :param int address: 7-bit device address +//| :param bytearray buffer: buffer containing the bytes to write +//| :param int start: Index to start writing from +//| :param int end: Index to read up to but not include +//| :param bool stop: If true, output an I2C stop condition after the buffer is written. +//| Deprecated. Will be removed in 6.x and act as stop=True.""" +//| ... //| // Shared arg parsing for writeto and writeto_then_readfrom. STATIC void writeto(bitbangio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) { @@ -271,23 +272,22 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_writeto); -//| .. method:: writeto_then_readfrom(address, out_buffer, in_buffer, *, out_start=0, out_end=None, in_start=0, in_end=None) +//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: +//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and +//| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop -//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and -//| ``in_buffer`` can be the same buffer because they are used sequentially. +//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` +//| will so it saves memory. //| -//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced -//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` -//| will so it saves memory. -//| -//| :param int address: 7-bit device address -//| :param bytearray out_buffer: buffer containing the bytes to write -//| :param bytearray in_buffer: buffer to write into -//| :param int out_start: Index to start writing from -//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` -//| :param int in_start: Index to start writing at -//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)`` +//| :param int address: 7-bit device address +//| :param bytearray out_buffer: buffer containing the bytes to write +//| :param bytearray in_buffer: buffer to write into +//| :param int out_start: Index to start writing from +//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` +//| :param int in_start: Index to start writing at +//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``""" //| STATIC mp_obj_t bitbangio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 95bbd0679c..1c9405bd8d 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -34,33 +34,35 @@ #include "shared-bindings/bitbangio/OneWire.h" #include "shared-bindings/util.h" -//| .. currentmodule:: bitbangio +//| class OneWire: +//| """.. currentmodule:: bitbangio //| -//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//| =============================================================== +//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol +//| =============================================================== //| -//| :class:`~bitbangio.OneWire` implements the timing-sensitive foundation of -//| the Maxim (formerly Dallas Semi) OneWire protocol. +//| :class:`~bitbangio.OneWire` implements the timing-sensitive foundation of +//| the Maxim (formerly Dallas Semi) OneWire protocol. //| -//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 +//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126""" //| -//| .. class:: OneWire(pin) +//| def __init__(self, pin: microcontroller.Pin): //| -//| Create a OneWire object associated with the given pin. The object -//| implements the lowest level timing-sensitive bits of the protocol. +//| """Create a OneWire object associated with the given pin. The object +//| implements the lowest level timing-sensitive bits of the protocol. //| -//| :param ~microcontroller.Pin pin: Pin to read pulses from. +//| :param ~microcontroller.Pin pin: Pin to read pulses from. //| -//| Read a short series of pulses:: +//| Read a short series of pulses:: //| -//| import bitbangio -//| import board +//| import bitbangio +//| import board //| -//| onewire = bitbangio.OneWire(board.D7) -//| onewire.reset() -//| onewire.write_bit(True) -//| onewire.write_bit(False) -//| print(onewire.read_bit()) +//| onewire = bitbangio.OneWire(board.D7) +//| onewire.reset() +//| onewire.write_bit(True) +//| onewire.write_bit(False) +//| print(onewire.read_bit())""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; @@ -79,9 +81,9 @@ STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialize the OneWire bus and release any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_deinit(mp_obj_t self_in) { bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -96,16 +98,16 @@ STATIC void check_for_deinit(bitbangio_onewire_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -114,9 +116,9 @@ STATIC mp_obj_t bitbangio_onewire_obj___exit__(size_t n_args, const mp_obj_t *ar } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_onewire___exit___obj, 4, 4, bitbangio_onewire_obj___exit__); -//| .. method:: reset() -//| -//| Reset the OneWire bus +//| def reset(self, ) -> Any: +//| """Reset the OneWire bus""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_obj_reset(mp_obj_t self_in) { bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -126,12 +128,12 @@ STATIC mp_obj_t bitbangio_onewire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_reset_obj, bitbangio_onewire_obj_reset); -//| .. method:: read_bit() +//| def read_bit(self, ) -> Any: +//| """Read in a bit //| -//| Read in a bit -//| -//| :returns: bit state read -//| :rtype: bool +//| :returns: bit state read +//| :rtype: bool""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_obj_read_bit(mp_obj_t self_in) { bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -141,9 +143,9 @@ STATIC mp_obj_t bitbangio_onewire_obj_read_bit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_read_bit_obj, bitbangio_onewire_obj_read_bit); -//| .. method:: write_bit(value) -//| -//| Write out a bit based on value. +//| def write_bit(self, value: Any) -> Any: +//| """Write out a bit based on value.""" +//| ... //| STATIC mp_obj_t bitbangio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index b1a94c1841..38e0926e8d 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -39,26 +39,27 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: bitbangio +//| class SPI: +//| """.. currentmodule:: bitbangio //| -//| :class:`SPI` -- a 3-4 wire serial protocol -//| ----------------------------------------------- +//| :class:`SPI` -- a 3-4 wire serial protocol +//| ----------------------------------------------- //| -//| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a -//| separate pin is used to control the active slave rather than a transmitted -//| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.) +//| SPI is a serial protocol that has exclusive pins for data in and out of the +//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to control the active slave rather than a transmitted +//| address. This class only manages three of the four SPI lines: `!clock`, +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave +//| select line. (This is common because multiple slaves can share the `!clock`, +//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" //| -//| .. class:: SPI(clock, MOSI=None, MISO=None) +//| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): +//| """Construct an SPI object on the given pins. //| -//| Construct an SPI object on the given pins. -//| -//| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin. +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. +//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| ... //| // TODO(tannewt): Support LSB SPI. @@ -82,9 +83,9 @@ STATIC mp_obj_t bitbangio_spi_make_new(const mp_obj_type_t *type, size_t n_args, return (mp_obj_t)self; } -//| .. method:: deinit() -//| -//| Turn off the SPI bus. +//| def deinit(self, ) -> Any: +//| """Turn off the SPI bus.""" +//| ... //| STATIC mp_obj_t bitbangio_spi_obj_deinit(mp_obj_t self_in) { bitbangio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -99,16 +100,16 @@ STATIC void check_for_deinit(bitbangio_spi_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t bitbangio_spi_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -124,15 +125,15 @@ static void check_lock(bitbangio_spi_obj_t *self) { } } -//| .. method:: configure(*, baudrate=100000, polarity=0, phase=0, bits=8) +//| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: +//| """Configures the SPI bus. Only valid when locked. //| -//| Configures the SPI bus. Only valid when locked. -//| -//| :param int baudrate: the clock rate in Hertz -//| :param int polarity: the base state of the clock line (0 or 1) -//| :param int phase: the edge of the clock that data is captured. First (0) -//| or second (1). Rising or falling depends on clock polarity. -//| :param int bits: the number of bits per word +//| :param int baudrate: the clock rate in Hertz +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity. +//| :param int bits: the number of bits per word""" +//| ... //| STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits }; @@ -166,12 +167,12 @@ STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_spi_configure_obj, 1, bitbangio_spi_configure); -//| .. method:: try_lock() +//| def try_lock(self, ) -> Any: +//| """Attempts to grab the SPI lock. Returns True on success. //| -//| Attempts to grab the SPI lock. Returns True on success. -//| -//| :return: True when lock has been grabbed -//| :rtype: bool +//| :return: True when lock has been grabbed +//| :rtype: bool""" +//| ... //| STATIC mp_obj_t bitbangio_spi_obj_try_lock(mp_obj_t self_in) { bitbangio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -180,9 +181,9 @@ STATIC mp_obj_t bitbangio_spi_obj_try_lock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_try_lock_obj, bitbangio_spi_obj_try_lock); -//| .. method:: unlock() -//| -//| Releases the SPI lock. +//| def unlock(self, ) -> Any: +//| """Releases the SPI lock.""" +//| ... //| STATIC mp_obj_t bitbangio_spi_obj_unlock(mp_obj_t self_in) { bitbangio_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -192,10 +193,10 @@ STATIC mp_obj_t bitbangio_spi_obj_unlock(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_spi_unlock_obj, bitbangio_spi_obj_unlock); -//| .. method:: write(buf) -//| -//| Write the data contained in ``buf``. Requires the SPI being locked. -//| If the buffer is empty, nothing happens. +//| def write(self, buf: Any) -> Any: +//| """Write the data contained in ``buf``. Requires the SPI being locked. +//| If the buffer is empty, nothing happens.""" +//| ... //| // TODO(tannewt): Add support for start and end kwargs. STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { @@ -216,11 +217,11 @@ STATIC mp_obj_t bitbangio_spi_write(mp_obj_t self_in, mp_obj_t wr_buf) { MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_spi_write_obj, bitbangio_spi_write); -//| .. method:: readinto(buf) -//| -//| Read into the buffer specified by ``buf`` while writing zeroes. -//| Requires the SPI being locked. -//| If the number of bytes to read is 0, nothing happens. +//| def readinto(self, buf: Any) -> Any: +//| """Read into the buffer specified by ``buf`` while writing zeroes. +//| Requires the SPI being locked. +//| If the number of bytes to read is 0, nothing happens.""" +//| ... //| // TODO(tannewt): Add support for start and end kwargs. STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { @@ -240,19 +241,19 @@ STATIC mp_obj_t bitbangio_spi_readinto(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_spi_readinto_obj, 2, 2, bitbangio_spi_readinto); -//| .. method:: write_readinto(buffer_out, buffer_in, *, out_start=0, out_end=None, in_start=0, in_end=None) +//| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any: +//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. +//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` +//| must be equal. +//| If buffer slice lengths are both 0, nothing happens. //| -//| Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``. -//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]`` -//| must be equal. -//| If buffer slice lengths are both 0, nothing happens. -//| -//| :param bytearray buffer_out: Write out the data in this buffer -//| :param bytearray buffer_in: Read data into this buffer -//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` -//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` -//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)`` +//| :param bytearray buffer_out: Write out the data in this buffer +//| :param bytearray buffer_in: Read data into this buffer +//| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` +//| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` +//| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| ... //| STATIC mp_obj_t bitbangio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; diff --git a/shared-bindings/bitbangio/__init__.c b/shared-bindings/bitbangio/__init__.c index 3123fb199a..e9600a7e66 100644 --- a/shared-bindings/bitbangio/__init__.c +++ b/shared-bindings/bitbangio/__init__.c @@ -40,7 +40,7 @@ #include "py/runtime.h" -//| :mod:`bitbangio` --- Digital protocols implemented by the CPU +//| """:mod:`bitbangio` --- Digital protocols implemented by the CPU //| ============================================================= //| //| .. module:: bitbangio @@ -81,7 +81,7 @@ //| This example will initialize the the device, run //| :py:meth:`~bitbangio.I2C.scan` and then :py:meth:`~bitbangio.I2C.deinit` the //| hardware. The last step is optional because CircuitPython automatically -//| resets hardware after a program finishes. +//| resets hardware after a program finishes.""" //| STATIC const mp_rom_map_elem_t bitbangio_module_globals_table[] = { From 28179a3aafa038c621f49a73cc243357629e0cff Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Sun, 3 May 2020 18:33:01 -0400 Subject: [PATCH 385/919] .../external_flash.c: Don't attempt to issue CMD_READ_STATUS2 for devices with only a single_status_byte. --- supervisor/shared/external_flash/external_flash.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 69eeec43d1..bfc434664a 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -218,11 +218,12 @@ void supervisor_flash_init(void) { do { spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); } while ((read_status_response[0] & 0x1) != 0); - // The suspended write/erase bit should be low. - do { + if (!flash_device->single_status_byte) { + // The suspended write/erase bit should be low. + do { spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); - } while ((read_status_response[0] & 0x80) != 0); - + } while ((read_status_response[0] & 0x80) != 0); + } spi_flash_command(CMD_ENABLE_RESET); spi_flash_command(CMD_RESET); From cb4fc894d70ecf285f32c2fa8d88e26568877407 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 2 May 2020 20:30:03 +0800 Subject: [PATCH 386/919] nrf: add pca10100 This is the nRF52833-DK board. Signed-off-by: Sean Cross --- .github/workflows/build.yml | 1 + ports/nrf/boards/pca10100/board.c | 38 +++++++++++++++ ports/nrf/boards/pca10100/mpconfigboard.h | 48 +++++++++++++++++++ ports/nrf/boards/pca10100/mpconfigboard.mk | 25 ++++++++++ ports/nrf/boards/pca10100/pins.c | 54 ++++++++++++++++++++++ 5 files changed, 166 insertions(+) create mode 100644 ports/nrf/boards/pca10100/board.c create mode 100644 ports/nrf/boards/pca10100/mpconfigboard.h create mode 100644 ports/nrf/boards/pca10100/mpconfigboard.mk create mode 100644 ports/nrf/boards/pca10100/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddbd26cb4f..90cfc0e837 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -212,6 +212,7 @@ jobs: - "particle_xenon" - "pca10056" - "pca10059" + - "pca10100" - "pewpew10" - "pewpew_m4" - "pirkey_m0" diff --git a/ports/nrf/boards/pca10100/board.c b/ports/nrf/boards/pca10100/board.c new file mode 100644 index 0000000000..f891f54a13 --- /dev/null +++ b/ports/nrf/boards/pca10100/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/pca10100/mpconfigboard.h b/ports/nrf/boards/pca10100/mpconfigboard.h new file mode 100644 index 0000000000..c645b778be --- /dev/null +++ b/ports/nrf/boards/pca10100/mpconfigboard.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "PCA10100 nRF52833 Dongle" +#define MICROPY_HW_MCU_NAME "nRF52833" + +#define MICROPY_HW_LED_STATUS (&pin_P0_13) +#define MICROPY_HW_LED_TX (&pin_P0_14) +#define MICROPY_HW_LED_RX (&pin_P0_15) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (60*1024) + +#define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) + +// Reduce nRF SoftRadio memory usage +#define BLEIO_VS_UUID_COUNT 10 +#define BLEIO_HVN_TX_QUEUE_SIZE 2 +#define BLEIO_CENTRAL_ROLE_COUNT 2 +#define BLEIO_PERIPH_ROLE_COUNT 2 +#define BLEIO_TOTAL_CONNECTION_COUNT 2 +#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk new file mode 100644 index 0000000000..1206c8fe59 --- /dev/null +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -0,0 +1,25 @@ +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "PCA10100" +USB_MANUFACTURER = "Nordic Semiconductor" + +MCU_CHIP = nrf52833 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BUSIO = 1 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 1 +CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_ULAB = 0 + +# These defines must be overridden before mpconfigboard.h is included, which is +# why they are passed on the command line. +CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' diff --git a/ports/nrf/boards/pca10100/pins.c b/ports/nrf/boards/pca10100/pins.c new file mode 100644 index 0000000000..dd030bae9a --- /dev/null +++ b/ports/nrf/boards/pca10100/pins.c @@ -0,0 +1,54 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_00) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_01) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON1_DEFAULT), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON1_OPTIONAL), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON2_DEFAULT), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON2_OPTIONAL), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON3), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON4), MP_ROM_PTR(&pin_P0_25) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From b128399d1eeb529767bf5478e5db49ff45fb1279 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 4 May 2020 15:37:53 +0800 Subject: [PATCH 387/919] nrf: simmel: enable CIRCUITPY_USB_HID Simmel had USB HID disabled in order to save space. However, the board configuration did not set USB_DEVICES, causing it to inherit the default device bouquet of MSC,CDC,MIDI,HID. This in turn caused HID to be included in the USB Configuration Descriptor. For some reason, this was not a problem in an earlier version of tinyusb or circuitpython. However, in the most recent version this has rightfully caused asserts to appear during configuration. Re-enable USB_HID for now, as it doesn't add too much in terms of space. We may disable it again later on if we become pressed for space. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 342d1ca39d..e71ada1de6 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -23,7 +23,6 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 -CIRCUITPY_USB_HID = 0 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 From d6c6f9f4f080d60716b148aed951462a065074d2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 14:29:37 -0400 Subject: [PATCH 388/919] add PacketBuffer .incoming_ and .outgoing_packet_length --- locale/ID.po | 6 +- locale/circuitpython.pot | 6 +- locale/de_DE.po | 6 +- locale/en_US.po | 6 +- locale/en_x_pirate.po | 6 +- locale/es.po | 6 +- locale/fil.po | 6 +- locale/fr.po | 6 +- locale/it_IT.po | 6 +- locale/ko.po | 6 +- locale/pl.po | 6 +- locale/pt_BR.po | 6 +- locale/zh_Latn_pinyin.po | 6 +- ports/nrf/common-hal/_bleio/PacketBuffer.c | 86 +++++++++++++++++----- ports/nrf/common-hal/_bleio/PacketBuffer.h | 4 +- ports/nrf/common-hal/_bleio/__init__.c | 4 +- shared-bindings/_bleio/PacketBuffer.c | 84 ++++++++++++++++----- shared-bindings/_bleio/PacketBuffer.h | 5 +- 18 files changed, 208 insertions(+), 53 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index bf21fbc9a3..b2956cf10c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1443,6 +1443,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3111308213..766b44085c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:13-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1428,6 +1428,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6eac26936c..4d9fd2ffb8 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" "Language: de_DE\n" @@ -1446,6 +1446,10 @@ msgstr "" msgid "Too many displays" msgstr "Zu viele displays" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" diff --git a/locale/en_US.po b/locale/en_US.po index 6ee9a6c3a0..05533b4d6e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -1427,6 +1427,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index a68218dc34..98d061a961 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" "Language: en_x_pirate\n" @@ -1431,6 +1431,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/es.po b/locale/es.po index 0290665b26..d92cbf3136 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n" @@ -1444,6 +1444,10 @@ msgstr "Demasiados buses de pantalla" msgid "Too many displays" msgstr "Muchos displays" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (ultima llamada reciente):\n" diff --git a/locale/fil.po b/locale/fil.po index 092fbc6501..defd8cc210 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" "Language: fil\n" @@ -1450,6 +1450,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (pinakahuling huling tawag): \n" diff --git a/locale/fr.po b/locale/fr.po index ea5b5ad92c..9349e140bd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" "Language: fr\n" @@ -1465,6 +1465,10 @@ msgstr "Trop de bus d'affichage" msgid "Too many displays" msgstr "Trop d'affichages" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Trace (appels les plus récents en dernier):\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index 40fb074bef..4d6c426771 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" "Language: it_IT\n" @@ -1461,6 +1461,10 @@ msgstr "" msgid "Too many displays" msgstr "Troppi schermi" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (chiamata più recente per ultima):\n" diff --git a/locale/ko.po b/locale/ko.po index e2df3625fc..17ea97e31a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" "Language: ko\n" @@ -1431,6 +1431,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 6387de0fe9..8e6a333915 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" "Language: pl\n" @@ -1432,6 +1432,10 @@ msgstr "Zbyt wiele magistrali" msgid "Too many displays" msgstr "Zbyt wiele wyświetlaczy" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index badeb54d0c..9c92c65c0f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1444,6 +1444,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 7b4d56ddab..69e45a985c 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-30 09:11-0400\n" +"POT-Creation-Date: 2020-05-04 15:41-0400\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh\n" @@ -1453,6 +1453,10 @@ msgstr "Xiǎnshì zǒngxiàn tài duōle" msgid "Too many displays" msgstr "Xiǎnshì tài duō" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 4617cc330b..38c45d019c 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -281,21 +281,33 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self return ret; } -void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { +mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len) { if (self->outgoing[0] == NULL) { mp_raise_bleio_BluetoothError(translate("Writes not supported on Characteristic")); } if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return; + return -1; } - uint16_t packet_size = common_hal_bleio_packet_buffer_get_packet_size(self); - uint16_t max_size = packet_size - len; - while (max_size < self->pending_size && self->conn_handle != BLE_CONN_HANDLE_INVALID) { - RUN_BACKGROUND_TASKS; + uint16_t outgoing_packet_length = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); + + if (len + header_len > outgoing_packet_length) { + // Supplied data will not fit in a single BLE packet. + mp_raise_ValueError(translate("Total data to write is larger than outgoing_packet_length")); + } + + if (len + self->pending_size > outgoing_packet_length) { + // No room to append len bytes to packet. Wait until we get a free buffer, + // and keep checking that we haven't been disconnected. + while (self->pending_size != 0 && self->conn_handle != BLE_CONN_HANDLE_INVALID) { + RUN_BACKGROUND_TASKS; + } } if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { - return; + return -1; } + + size_t num_bytes_written = 0; + uint8_t is_nested_critical_region; sd_nvic_critical_region_enter(&is_nested_critical_region); @@ -304,9 +316,11 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (self->pending_size == 0) { memcpy(pending, header, header_len); self->pending_size += header_len; + num_bytes_written += header_len; } memcpy(pending + self->pending_size, data, len); self->pending_size += len; + num_bytes_written += len; sd_nvic_critical_region_exit(is_nested_critical_region); @@ -314,25 +328,32 @@ void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8 if (!self->packet_queued) { queue_next_write(self); } + return num_bytes_written; } -mp_int_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self) { - // If this PacketBuffer is being used for NOTIFY or INDICATE, +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self) { + // If this PacketBuffer is coming from a remote service via NOTIFY or INDICATE // the maximum size is what can be sent in one // BLE packet. But we must be connected to know that value. // // Otherwise it can be as long as the characteristic // will permit, whether or not we're connected. - if (self->characteristic != NULL && - self->characteristic->service != NULL && + if (self->characteristic == NULL) { + return -1; + } + + if (self->characteristic->service != NULL && + self->characteristic->service->is_remote && (common_hal_bleio_characteristic_get_properties(self->characteristic) & - (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY)) && - self->conn_handle != BLE_CONN_HANDLE_INVALID) { - bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); - if (connection) { - return MIN(common_hal_bleio_connection_get_max_packet_length(connection), - self->characteristic->max_length); + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are talking to a remote service, and data is arriving via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } } // There's no current connection, so we don't know the MTU, and // we can't tell what the largest incoming packet length would be. @@ -341,6 +362,37 @@ mp_int_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_ return self->characteristic->max_length; } +mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_buffer_obj_t *self) { + // If we are sending data via NOTIFY or INDICATE, the maximum size + // is what can be sent in one BLE packet. But we must be connected + // to know that value. + // + // Otherwise it can be as long as the characteristic + // will permit, whether or not we're connected. + + if (self->characteristic == NULL) { + return -1; + } + + if (self->characteristic->service != NULL && + !self->characteristic->service->is_remote && + (common_hal_bleio_characteristic_get_properties(self->characteristic) & + (CHAR_PROP_INDICATE | CHAR_PROP_NOTIFY))) { + // We are sending to a client, via NOTIFY or INDICATE. + if (self->conn_handle != BLE_CONN_HANDLE_INVALID) { + bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle); + if (connection) { + return MIN(common_hal_bleio_connection_get_max_packet_length(connection), + self->characteristic->max_length); + } + } + // There's no current connection, so we don't know the MTU, and + // we can't tell what the largest outgoing packet length would be. + return -1; + } + return self->characteristic->max_length; +} + bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) { return self->characteristic == NULL; } diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.h b/ports/nrf/common-hal/_bleio/PacketBuffer.h index 1ebe60be5f..699291749f 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.h +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.h @@ -40,10 +40,10 @@ typedef struct { // Two outgoing buffers to alternate between. One will be queued for transmission by the SD and // the other is waiting to be queued and can be extended. uint8_t* outgoing[2]; - uint16_t pending_size; + volatile uint16_t pending_size; // We remember the conn_handle so we can do a NOTIFY/INDICATE to a client. // We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read). - uint16_t conn_handle; + volatile uint16_t conn_handle; uint8_t pending_index; uint8_t write_type; bool client; diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 83c2af8fac..e84bba6626 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -119,7 +119,7 @@ void common_hal_bleio_check_connected(uint16_t conn_handle) { // GATTS read of a Characteristic or Descriptor. size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_t* buf, size_t len) { // conn_handle is ignored unless this is a system attribute. - // If we're not connected, but that's OK, because we can still read and write the local value. + // If we're not connected, that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = buf, @@ -133,7 +133,7 @@ size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_ void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buffer_info_t *bufinfo) { // conn_handle is ignored unless this is a system attribute. - // If we're not connected, but that's OK, because we can still read and write the local value. + // If we're not connected, that's OK, because we can still read and write the local value. ble_gatts_value_t gatts_value = { .p_value = bufinfo->buf, diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 145eec2ea5..1520c8b5c4 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -42,8 +42,8 @@ //| //| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware //| outgoing writes. A packet's size is either the characteristic length or the maximum transmission -//| unit (MTU), whichever is smaller. The MTU can change so check `packet_size` before creating a -//| buffer to store data. +//| unit (MTU) minus overhead, whichever is smaller. The MTU can change so check `incoming_packet_length` +//| and `outgoing_packet_length` before creating a buffer to store data. //| //| When we're the server, we ignore all connections besides the first to subscribe to //| notifications. @@ -51,7 +51,7 @@ //| .. class:: PacketBuffer(characteristic, *, buffer_size) //| //| Monitor the given Characteristic. Each time a new value is written to the Characteristic -//| add the newly-written bytes to a FIFO buffer. +//| add the newly-written packet of bytes to a FIFO buffer. //| //| :param Characteristic characteristic: The Characteristic to monitor. //| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic @@ -125,6 +125,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_ //| //| This does not block until the data is sent. It only blocks until the data is pending. //| +//| :return: number of bytes written. May include header bytes when packet is empty. +//| :rtype: int +//| // TODO: Add a kwarg `merge=False` to dictate whether subsequent writes are merged into a pending // one. STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -149,9 +152,21 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ mp_get_buffer_raise(args[ARG_header].u_obj, &header_bufinfo, MP_BUFFER_READ); } - common_hal_bleio_packet_buffer_write(self, data_bufinfo.buf, data_bufinfo.len, - header_bufinfo.buf, header_bufinfo.len); - return mp_const_none; + mp_int_t num_bytes_written = common_hal_bleio_packet_buffer_write( + self, data_bufinfo.buf, data_bufinfo.len, header_bufinfo.buf, header_bufinfo.len); + if (num_bytes_written < 0) { + // TODO: Raise an error if not connected. Right now the not-connected error + // is unreliable, because common_hal_bleio_packet_buffer_write() + // checks for conn_handle being set, but setting that + // can be delayed because conn_handle is discovered by spying on + // gatts write events, which may not have been sent yet. + // + // IDEAL: + // mp_raise_bleio_ConnectionError(translate("Not connected")); + // TEMPORARY: + num_bytes_written = 0; + } + return MP_OBJ_NEW_SMALL_INT(num_bytes_written); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write); @@ -168,37 +183,72 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu //| .. attribute:: packet_size //| -//| Maximum size of a packet. +//| `packet_size` is the same as `incoming_packet_length`. +//| The name `packet_size` is deprecated and +//| will be removed in CircuitPython 6.0.0. +//| +//| .. attribute:: incoming_packet_length +//| +//| Maximum length in bytes of a packet we are reading. //| If the packet is arriving from a remote service via notify or indicate, -//| the maximum size is `Connection.max_packet_length`. +//| the maximum length is `Connection.max_packet_length`. //| Otherwise it is the ``max_length`` of the :py:class:`~_bleio.Characteristic`. //| -STATIC mp_obj_t bleio_packet_buffer_get_packet_size(mp_obj_t self_in) { +STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t size = common_hal_bleio_packet_buffer_get_packet_size(self); + mp_int_t size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); if (size < 0) { mp_raise_ValueError(translate("No connection: size cannot be determined")); } return MP_OBJ_NEW_SMALL_INT(size); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_packet_size_obj, bleio_packet_buffer_get_packet_size); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_obj, bleio_packet_buffer_get_incoming_packet_length); -const mp_obj_property_t bleio_packet_buffer_packet_size_obj = { +const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_packet_size_obj, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + +//| .. attribute:: outgoing_packet_length +//| +//| Maximum length in bytes of a packet we are writing. +//| If the packet is being sent via notify or indicate, +//| the maximum length is `Connection.max_packet_length`. +//| Otherwise it is the ``max_length`` of the :py:class:`~_bleio.Characteristic`. +//| +STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) { + bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t size = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); + if (size < 0) { + mp_raise_ValueError(translate("No connection: size cannot be determined")); + } + return MP_OBJ_NEW_SMALL_INT(size); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_outgoing_packet_length_obj, bleio_packet_buffer_get_outgoing_packet_length); + +const mp_obj_property_t bleio_packet_buffer_outgoing_packet_length_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_packet_buffer_get_outgoing_packet_length_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj }, }; STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, // Standard stream methods. - { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bleio_packet_buffer_readinto_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_packet_size_obj) }, + // .packet_size is now an alias for .incoming_packet_length + // TODO: It will be removed in 6.0.0. + { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_incoming_packet_length), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_outgoing_packet_length), MP_ROM_PTR(&bleio_packet_buffer_outgoing_packet_length_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_packet_buffer_locals_dict, bleio_packet_buffer_locals_dict_table); diff --git a/shared-bindings/_bleio/PacketBuffer.h b/shared-bindings/_bleio/PacketBuffer.h index eb291eeccf..769e0a0c78 100644 --- a/shared-bindings/_bleio/PacketBuffer.h +++ b/shared-bindings/_bleio/PacketBuffer.h @@ -34,9 +34,10 @@ extern const mp_obj_type_t bleio_packet_buffer_type; extern void common_hal_bleio_packet_buffer_construct( bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic, size_t buffer_size); -void common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); +mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len, uint8_t* header, size_t header_len); mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len); -mp_int_t common_hal_bleio_packet_buffer_get_packet_size(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self); +mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_buffer_obj_t *self); bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self); void common_hal_bleio_packet_buffer_deinit(bleio_packet_buffer_obj_t *self); From 602eabe668f9218e9e75d44e7153ae73b928a465 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 17:18:53 -0400 Subject: [PATCH 389/919] Squeeze hallowing_m0_express build slightly ko build is a little too big. --- ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index af4a5a2932..875d23f9b7 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CFLAGS_INLINE_LIMIT = 60 +CFLAGS_INLINE_LIMIT = 55 SUPEROPT_GC = 0 # Include these Python libraries in firmware. From 6957aaf4d0d3fb9d08211865e2dd333f295a08d0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 May 2020 15:03:19 -0500 Subject: [PATCH 390/919] Create empty Swedish (sv) translation --- locale/sv.po | 3145 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3145 insertions(+) create mode 100644 locale/sv.po diff --git a/locale/sv.po b/locale/sv.po new file mode 100644 index 0000000000..f993e52d32 --- /dev/null +++ b/locale/sv.po @@ -0,0 +1,3145 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: py/obj.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%s' object does not support '%q'" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/__init__.c +#: ports/cxd56/common-hal/microcontroller/__init__.c +#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display rotation must be in 90 degree increments" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c +#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c +msgid "Function requires lock" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +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 +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +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 +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object '%s' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "" + +#: shared-bindings/touchio/TouchIn.c +msgid "threshold must be in the range 0-65536" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/linalg.c py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" From fd383c80477f433ea74c56803c866fee1eb494f7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 May 2020 17:15:14 -0500 Subject: [PATCH 391/919] actions: build-riscv: switch to checkout@v2 --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90cfc0e837..2125a7c725 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -329,9 +329,14 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 with: submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build From b7836aeac67c32b940ac38ee967e30a24ce8cf6f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 19:51:08 -0400 Subject: [PATCH 392/919] address review comments --- ports/nrf/common-hal/_bleio/PacketBuffer.c | 4 ++++ shared-bindings/_bleio/PacketBuffer.c | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index 37f5846643..a8773f961f 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -267,6 +267,10 @@ mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self if (packet_length > len) { // Packet is longer than requested. Return negative of overrun value. ret = len - packet_length; + // Discard the packet if it's too large. Don't fill data. + while (packet_length--) { + (void) ringbuf_get(&self->ringbuf); + } } else { // Read as much as possible, but might be shorter than len. ringbuf_get_n(&self->ringbuf, data, packet_length); diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 1520c8b5c4..e087cf22db 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -190,16 +190,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu //| .. attribute:: incoming_packet_length //| //| Maximum length in bytes of a packet we are reading. -//| If the packet is arriving from a remote service via notify or indicate, -//| the maximum length is `Connection.max_packet_length`. -//| Otherwise it is the ``max_length`` of the :py:class:`~_bleio.Characteristic`. //| STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); mp_int_t size = common_hal_bleio_packet_buffer_get_incoming_packet_length(self); if (size < 0) { - mp_raise_ValueError(translate("No connection: size cannot be determined")); + mp_raise_ValueError(translate("No connection: length cannot be determined")); } return MP_OBJ_NEW_SMALL_INT(size); } @@ -215,16 +212,13 @@ const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { //| .. attribute:: outgoing_packet_length //| //| Maximum length in bytes of a packet we are writing. -//| If the packet is being sent via notify or indicate, -//| the maximum length is `Connection.max_packet_length`. -//| Otherwise it is the ``max_length`` of the :py:class:`~_bleio.Characteristic`. //| STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); mp_int_t size = common_hal_bleio_packet_buffer_get_outgoing_packet_length(self); if (size < 0) { - mp_raise_ValueError(translate("No connection: size cannot be determined")); + mp_raise_ValueError(translate("No connection: length cannot be determined")); } return MP_OBJ_NEW_SMALL_INT(size); } From c0af9f67b5193466fe1fccd87f6b6a6b015b6170 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 19:52:24 -0400 Subject: [PATCH 393/919] make translate --- locale/ID.po | 4 ++-- locale/circuitpython.pot | 4 ++-- locale/de_DE.po | 4 ++-- locale/en_US.po | 4 ++-- locale/en_x_pirate.po | 4 ++-- locale/es.po | 4 ++-- locale/fil.po | 4 ++-- locale/fr.po | 4 ++-- locale/it_IT.po | 4 ++-- locale/ko.po | 4 ++-- locale/pl.po | 4 ++-- locale/pt_BR.po | 4 ++-- locale/zh_Latn_pinyin.po | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 7c357c63ce..32053577c0 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1097,7 +1097,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 91c7b28a8e..2cca67f063 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1086,7 +1086,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/de_DE.po b/locale/de_DE.po index b82ef326ec..7acebdb903 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -1095,7 +1095,7 @@ msgid "No available clocks" msgstr "Keine Taktgeber verfügbar" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/en_US.po b/locale/en_US.po index 45bf6fe0d5..a3c2cd50e0 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -1086,7 +1086,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index d781c2a35a..86d217e3bc 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -1090,7 +1090,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/es.po b/locale/es.po index b209a91bdb..c3ff86454b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -1094,7 +1094,7 @@ msgid "No available clocks" msgstr "Relojes no disponibles" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/fil.po b/locale/fil.po index 6315826398..11cba9d977 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1102,7 +1102,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/fr.po b/locale/fr.po index fd8d42ca16..bcd20b5b48 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -1109,7 +1109,7 @@ msgid "No available clocks" msgstr "Pas d'horloge disponible" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/it_IT.po b/locale/it_IT.po index f4c04e497e..3d67bf3280 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1106,7 +1106,7 @@ msgid "No available clocks" msgstr "Nessun orologio a disposizione" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/ko.po b/locale/ko.po index 699cfbd4e8..4f87e51c9a 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1090,7 +1090,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/pl.po b/locale/pl.po index 507d971c7c..cdf64cd038 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1091,7 +1091,7 @@ msgid "No available clocks" msgstr "Brak wolnych zegarów" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 469e65c9e0..1398bb266f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1098,7 +1098,7 @@ msgid "No available clocks" msgstr "" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 469fc7c3a6..b56cc3ce52 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 17:26-0400\n" +"POT-Creation-Date: 2020-05-04 19:52-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1099,7 +1099,7 @@ msgid "No available clocks" msgstr "Méiyǒu kěyòng de shízhōng" #: shared-bindings/_bleio/PacketBuffer.c -msgid "No connection: size cannot be determined" +msgid "No connection: length cannot be determined" msgstr "" #: shared-bindings/board/__init__.c From b23ff4160661c28b6b0c1c7b53a9dd1a98759ba7 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 20:38:29 -0400 Subject: [PATCH 394/919] merge from upstream and make translate again (sv.po) --- locale/circuitpython.pot | 2 +- locale/sv.po | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2cca67f063..aa465b0b72 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-04 20:38-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/sv.po b/locale/sv.po index f993e52d32..d9beb3f551 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-04 20:38-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1085,6 +1085,10 @@ msgstr "" msgid "No available clocks" msgstr "" +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + #: shared-bindings/board/__init__.c msgid "No default %q bus" msgstr "" @@ -1429,6 +1433,10 @@ msgstr "" msgid "Too many displays" msgstr "" +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" From e1366d78b125f0aca7d9f2e6faa55d3b0adf2e83 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 4 May 2020 23:05:47 -0400 Subject: [PATCH 395/919] trivial change to force rebuild --- shared-bindings/_bleio/PacketBuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index e087cf22db..6dbf290729 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -239,7 +239,7 @@ STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&bleio_packet_buffer_write_obj) }, // .packet_size is now an alias for .incoming_packet_length - // TODO: It will be removed in 6.0.0. + // TODO: Remove in 6.0.0. { MP_OBJ_NEW_QSTR(MP_QSTR_packet_size), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_incoming_packet_length), MP_ROM_PTR(&bleio_packet_buffer_incoming_packet_length_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_outgoing_packet_length), MP_ROM_PTR(&bleio_packet_buffer_outgoing_packet_length_obj) }, From bfa5cd9c13e308df5462653a53fe99eeb0543bc3 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 5 May 2020 15:23:38 +1000 Subject: [PATCH 396/919] refactor countio based on feedback --- locale/ID.po | 7 +- locale/circuitpython.pot | 7 +- locale/de_DE.po | 7 +- locale/en_US.po | 7 +- locale/en_x_pirate.po | 7 +- locale/es.po | 7 +- locale/fil.po | 7 +- locale/fr.po | 7 +- locale/it_IT.po | 7 +- locale/ko.po | 7 +- locale/pl.po | 7 +- locale/pt_BR.po | 7 +- locale/zh_Latn_pinyin.po | 7 +- ports/atmel-samd/common-hal/countio/Counter.c | 83 ++++++++++ ports/atmel-samd/common-hal/countio/Counter.h | 19 +++ .../atmel-samd/common-hal/countio/__init__.c | 1 + ports/atmel-samd/eic_handler.c | 7 + ports/atmel-samd/eic_handler.h | 1 + ports/cxd56/mpconfigport.mk | 2 +- ports/litex/mpconfigport.mk | 2 +- ports/mimxrt10xx/mpconfigport.mk | 2 +- ports/nrf/mpconfigport.mk | 2 + ports/stm/mpconfigport.mk | 3 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 11 ++ shared-bindings/countio/Counter.c | 152 ++++++++++++++++++ shared-bindings/countio/Counter.h | 18 +++ shared-bindings/countio/__init__.c | 48 ++++++ shared-bindings/countio/__init__.h | 9 ++ 30 files changed, 448 insertions(+), 16 deletions(-) create mode 100644 ports/atmel-samd/common-hal/countio/Counter.c create mode 100644 ports/atmel-samd/common-hal/countio/Counter.h create mode 100644 ports/atmel-samd/common-hal/countio/__init__.c create mode 100644 shared-bindings/countio/Counter.c create mode 100644 shared-bindings/countio/Counter.h create mode 100644 shared-bindings/countio/__init__.c create mode 100644 shared-bindings/countio/__init__.h diff --git a/locale/ID.po b/locale/ID.po index ac10df5bf8..e303c7ca56 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -245,6 +245,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" @@ -1209,6 +1210,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 4b18bfd478..aa82bfe29c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -244,6 +244,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "" @@ -1197,6 +1198,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 6cf4b7d479..f7ef9bfeb8 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -246,6 +246,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "3-arg pow() wird nicht unterstützt" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" @@ -1212,6 +1213,10 @@ msgstr "Zugang verweigert" msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 428a9c4754..c72e6d0c98 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -244,6 +244,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "" @@ -1197,6 +1198,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index aacc176f5c..1c523bb61e 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -246,6 +246,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Avast! A hardware interrupt channel be used already" @@ -1201,6 +1202,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "Belay that! Th' Pin be not ADC capable" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/es.po b/locale/es.po index db60c9d37a..fe5086a99a 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -246,6 +246,7 @@ msgstr "0.0 a una potencia compleja" msgid "3-arg pow() not supported" msgstr "pow() con 3 argumentos no soportado" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" @@ -1211,6 +1212,10 @@ msgstr "Permiso denegado" msgid "Pin does not have ADC capabilities" msgstr "Pin no tiene capacidad ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 6d577823fa..f1178c8cad 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -247,6 +247,7 @@ msgstr "0.0 para sa complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() hindi suportado" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" @@ -1217,6 +1218,10 @@ msgstr "Walang pahintulot" msgid "Pin does not have ADC capabilities" msgstr "Ang pin ay walang kakayahan sa ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 4d07eda19b..ab12be1b6e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -248,6 +248,7 @@ msgstr "0.0 à une puissance complexe" msgid "3-arg pow() not supported" msgstr "pow() non supporté avec 3 arguments" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" @@ -1231,6 +1232,10 @@ msgstr "Permission refusée" msgid "Pin does not have ADC capabilities" msgstr "La broche ne peut être utilisée pour l'ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0c0825e5ec..826b378891 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -246,6 +246,7 @@ msgstr "0.0 elevato alla potenza di un numero complesso" msgid "3-arg pow() not supported" msgstr "pow() con tre argmomenti non supportata" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interrupt hardware è già in uso" @@ -1226,6 +1227,10 @@ msgstr "Permesso negato" msgid "Pin does not have ADC capabilities" msgstr "Il pin non ha capacità di ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 3e3ac1cf60..f6bff27cec 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -246,6 +246,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "" @@ -1201,6 +1202,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 8cc3c30b7a..fa19bfc194 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -245,6 +245,7 @@ msgstr "0.0 do potęgi zespolonej" msgid "3-arg pow() not supported" msgstr "3-argumentowy pow() jest niewspierany" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Kanał przerwań sprzętowych w użyciu" @@ -1202,6 +1203,10 @@ msgstr "Odmowa dostępu" msgid "Pin does not have ADC capabilities" msgstr "Nóżka nie obsługuje ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index d833169c0f..bf56405c64 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -246,6 +246,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" @@ -1212,6 +1213,10 @@ msgstr "Permissão negada" msgid "Pin does not have ADC capabilities" msgstr "O pino não tem recursos de ADC" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e7d6df02fa..52337cdb43 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 14:57+1000\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -251,6 +251,7 @@ msgstr "0.0 dào fùzá diànyuán" msgid "3-arg pow() not supported" msgstr "bù zhīchí 3-arg pow ()" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" @@ -1216,6 +1217,10 @@ msgstr "Quánxiàn bèi jùjué" msgid "Pin does not have ADC capabilities" msgstr "Pin méiyǒu ADC nénglì" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c new file mode 100644 index 0000000000..db5b325b8f --- /dev/null +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -0,0 +1,83 @@ + +#include "common-hal/countio/Counter.h" + +#include "atmel_start_pins.h" + +#include "eic_handler.h" +#include "samd/external_interrupts.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin_a) { + if (!pin_a->has_extint) { + mp_raise_RuntimeError(translate("Pin must support hardware interrupts")); + } + + + if (eic_get_enable()) { + if (!eic_channel_free(pin_a->extint_channel)) { + mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use")); + } + } else { + turn_on_external_interrupt_controller(); + } + + // These default settings apply when the EIC isn't yet enabled. + self->eic_channel_a = pin_a->extint_channel; + + self->pin_a = pin_a->number; + + gpio_set_pin_function(self->pin_a, GPIO_PIN_FUNCTION_A); + gpio_set_pin_pull_mode(self->pin_a, GPIO_PULL_UP); + + set_eic_channel_data(self->eic_channel_a, (void*) self); + + self->count = 0; + + + claim_pin(pin_a); + + + set_eic_handler(self->eic_channel_a, EIC_HANDLER_COUNTER); + turn_on_eic_channel(self->eic_channel_a, EIC_CONFIG_SENSE0_FALL_Val); + +} + +bool common_hal_countio_counter_deinited(countio_counter_obj_t* self) { + return self->pin_a == NO_PIN; +} + +void common_hal_countio_counter_deinit(countio_counter_obj_t* self) { + if (common_hal_countio_counter_deinited(self)) { + return; + } + + set_eic_handler(self->eic_channel_a, EIC_HANDLER_NO_INTERRUPT); + turn_off_eic_channel(self->eic_channel_a); + + + reset_pin_number(self->pin_a); + self->pin_a = NO_PIN; + +} + +mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self) { + return self->count; +} + +void common_hal_countio_counter_set_count(countio_counter_obj_t* self, + mp_int_t new_count) { + self->count = new_count; +} + +void common_hal_countio_counter_reset(countio_counter_obj_t* self){ + self->count = 0; +} + +void counter_interrupt_handler(uint8_t channel) { + countio_counter_obj_t* self = get_eic_channel_data(channel); + + self->count += 1; + +} diff --git a/ports/atmel-samd/common-hal/countio/Counter.h b/ports/atmel-samd/common-hal/countio/Counter.h new file mode 100644 index 0000000000..724c734152 --- /dev/null +++ b/ports/atmel-samd/common-hal/countio/Counter.h @@ -0,0 +1,19 @@ + +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_COUNTIO_COUNTER_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_COUNTIO_COUNTER_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint8_t pin_a; + uint8_t eic_channel_a:4; + mp_int_t count; +} countio_counter_obj_t; + + +void counter_interrupt_handler(uint8_t channel); + +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_COUNTIO_COUNT_H diff --git a/ports/atmel-samd/common-hal/countio/__init__.c b/ports/atmel-samd/common-hal/countio/__init__.c new file mode 100644 index 0000000000..b95b20d153 --- /dev/null +++ b/ports/atmel-samd/common-hal/countio/__init__.c @@ -0,0 +1 @@ +//No countio module functions diff --git a/ports/atmel-samd/eic_handler.c b/ports/atmel-samd/eic_handler.c index 30ecaa7cae..7f26bdefbf 100644 --- a/ports/atmel-samd/eic_handler.c +++ b/ports/atmel-samd/eic_handler.c @@ -27,6 +27,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/ps2io/Ps2.h" #include "common-hal/rotaryio/IncrementalEncoder.h" +#include "common-hal/countio/Counter.h" #include "shared-bindings/microcontroller/__init__.h" //#include "samd/external_interrupts.h" #include "eic_handler.h" @@ -59,6 +60,12 @@ void shared_eic_handler(uint8_t channel) { break; #endif +#if CIRCUITPY_COUNTIO + case EIC_HANDLER_COUNTER: + counter_interrupt_handler(channel); + break; +#endif + default: break; } diff --git a/ports/atmel-samd/eic_handler.h b/ports/atmel-samd/eic_handler.h index 71b0fce678..08da7ea34d 100644 --- a/ports/atmel-samd/eic_handler.h +++ b/ports/atmel-samd/eic_handler.h @@ -30,6 +30,7 @@ #define EIC_HANDLER_PULSEIN 0x1 #define EIC_HANDLER_INCREMENTAL_ENCODER 0x2 #define EIC_HANDLER_PS2 0x3 +#define EIC_HANDLER_COUNTER 0x04 void set_eic_handler(uint8_t channel, uint8_t eic_handler); void shared_eic_handler(uint8_t channel); diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index ad3d0e72df..8aeae1de56 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -18,5 +18,5 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 - +CIRCUITPY_COUNTIO = 0 INTERNAL_LIBM = 1 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 0a82f41619..004930ba70 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -25,7 +25,7 @@ CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 - +CIRCUITPY_COUNTIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 5881ac3020..e9e554142c 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -26,5 +26,5 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 - +CIRCUITPY_COUNTIO = 0 LONGINT_IMPL = MPZ diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 410d3750e5..7939a175bd 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -54,6 +54,8 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 +CIRCUITPY_COUNTIO = 0 + # nRF52840-specific ifeq ($(MCU_CHIP),nrf52840) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 5ef1e8e7b7..ee8b2e1601 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -8,6 +8,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 @@ -26,6 +27,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_NVM = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 + CIRCUITPY_COUNTIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 @@ -46,6 +48,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_ROTARYIO = 0 + CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index ec8e6c3e98..a253f2fa82 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -136,6 +136,9 @@ endif ifeq ($(CIRCUITPY_BUSIO),1) SRC_PATTERNS += busio/% bitbangio/OneWire.% endif +ifeq ($(CIRCUITPY_COUNTIO),1) +SRC_PATTERNS += countio/% +endif ifeq ($(CIRCUITPY_DIGITALIO),1) SRC_PATTERNS += digitalio/% endif @@ -263,6 +266,8 @@ SRC_COMMON_HAL_ALL = \ busio/SPI.c \ busio/UART.c \ busio/__init__.c \ + countio/Counter.c \ + countio/__init__.c \ digitalio/DigitalInOut.c \ digitalio/__init__.c \ displayio/ParallelBus.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 29a4d524ca..a3ab4da941 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -314,6 +314,13 @@ extern const struct _mp_obj_module_t busio_module; #define BUSIO_MODULE #endif +#if CIRCUITPY_COUNTIO +extern const struct _mp_obj_module_t countio_module; +#define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module }, +#else +#define COUNTIO_MODULE +#endif + #if CIRCUITPY_DIGITALIO extern const struct _mp_obj_module_t digitalio_module; #define DIGITALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module }, @@ -630,6 +637,7 @@ extern const struct _mp_obj_module_t ustack_module; BLEIO_MODULE \ BOARD_MODULE \ BUSIO_MODULE \ + COUNTIO_MODULE \ DIGITALIO_MODULE \ DISPLAYIO_MODULE \ FONTIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 30ab720d70..7ef87a7ea2 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -109,6 +109,12 @@ CIRCUITPY_DIGITALIO = 1 endif CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) +ifndef CIRCUITPY_COUNTIO +CIRCUITPY_COUNTIO = 1 +endif +CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) + + ifndef CIRCUITPY_DISPLAYIO CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD) endif @@ -207,6 +213,11 @@ CIRCUITPY_ROTARYIO = 1 endif CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) +ifndef CIRCUITPY_COUNTIO +CIRCUITPY_COUNTIO = 1 +endif +CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) + ifndef CIRCUITPY_RTC CIRCUITPY_RTC = 1 endif diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c new file mode 100644 index 0000000000..c10294199a --- /dev/null +++ b/shared-bindings/countio/Counter.c @@ -0,0 +1,152 @@ + +#include + +#include "lib/utils/context_manager_helpers.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/runtime0.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/countio/Counter.h" +#include "shared-bindings/util.h" + +//| .. currentmodule:: countio +//| +//| :class:`Counter` -- Track the count of edge transistions (pulses) on a given pin +//| ==================================================================================== +//| +//| Counter will keep track of the number of edge transistions (pulses) on a given pin +//| +//| .. class:: Counter(pin_a) +//| +//| Create an Counter object associated with the given pin. It tracks the number of +//| pulses relative when the object is contructed. +//| +//| :param ~microcontroller.Pin pin_a: Pin to read pulses from. +//| +//| +//| For example:: +//| +//| import countio +//| import time +//| from board import * +//| +//| pin_counter = countio.Counter(board.D1) +//| +//| while True: +//| count = pin_counter.count +//| if count == None 10: +//| pin_counter.reset() +//| print(pin_counter.count) +//| +STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_pin_a }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pin_a, MP_ARG_REQUIRED | MP_ARG_OBJ } + + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); + + + countio_counter_obj_t *self = m_new_obj(countio_counter_obj_t); + self->base.type = &countio_counter_type; + + common_hal_countio_counter_construct(self, pin_a); + + return MP_OBJ_FROM_PTR(self); +} + +//| .. method:: deinit() +//| +//| Deinitializes the Counter and releases any hardware resources for reuse. +//| +STATIC mp_obj_t countio_counter_deinit(mp_obj_t self_in) { + countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_countio_counter_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_deinit_obj, countio_counter_deinit); + +STATIC void check_for_deinit(countio_counter_obj_t *self) { + if (common_hal_countio_counter_deinited(self)) { + raise_deinited_error(); + } +} + +//| .. method:: __enter__() +//| +//| No-op used by Context Managers. +//| +// Provided by context manager helper. + +//| .. method:: __exit__() +//| +//| Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +STATIC mp_obj_t countio_counter_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_countio_counter_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(countio_counter___exit___obj, 4, 4, countio_counter_obj___exit__); + + +//| .. attribute:: count +//| +//| The current count in terms of pulses. +//| +//| +STATIC mp_obj_t countio_counter_obj_get_count(mp_obj_t self_in) { + countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + return mp_obj_new_int(common_hal_countio_counter_get_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_get_count_obj, countio_counter_obj_get_count); + +STATIC mp_obj_t countio_counter_obj_set_count(mp_obj_t self_in, mp_obj_t new_count) { + countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_countio_counter_set_count(self, mp_obj_get_int(new_count)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(countio_counter_set_count_obj, countio_counter_obj_set_count); + +const mp_obj_property_t countio_counter_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&countio_counter_get_count_obj, + (mp_obj_t)&countio_counter_set_count_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in){ + countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + //set the position to zero for reset + common_hal_countio_counter_reset(self); + return mp_const_none; +} + + +MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_reset_obj, countio_counter_reset); + +STATIC const mp_rom_map_elem_t countio_counter_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&countio_counter_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&countio_counter___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&countio_counter_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&countio_counter_reset_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(countio_counter_locals_dict, countio_counter_locals_dict_table); + +const mp_obj_type_t countio_counter_type = { + { &mp_type_type }, + .name = MP_QSTR_Counter, + .make_new = countio_counter_make_new, + .locals_dict = (mp_obj_dict_t*)&countio_counter_locals_dict, +}; diff --git a/shared-bindings/countio/Counter.h b/shared-bindings/countio/Counter.h new file mode 100644 index 0000000000..15adbbe2ac --- /dev/null +++ b/shared-bindings/countio/Counter.h @@ -0,0 +1,18 @@ +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO_COUNTER_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO_COUNTER_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/countio/Counter.h" + +extern const mp_obj_type_t countio_counter_type; + +extern void common_hal_countio_counter_construct(countio_counter_obj_t* self, + const mcu_pin_obj_t* pin_a); +extern void common_hal_countio_counter_deinit(countio_counter_obj_t* self); +extern bool common_hal_countio_counter_deinited(countio_counter_obj_t* self); +extern mp_int_t common_hal_countio_counter_get_count(countio_counter_obj_t* self); +extern void common_hal_countio_counter_set_count(countio_counter_obj_t* self, + mp_int_t new_count); +extern void common_hal_countio_counter_reset(countio_counter_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO_COUNTER_H diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c new file mode 100644 index 0000000000..8929bf7edb --- /dev/null +++ b/shared-bindings/countio/__init__.c @@ -0,0 +1,48 @@ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/countio/__init__.h" +#include "shared-bindings/countio/Counter.h" + +//| :mod:`countio` --- Support for edge counting +//| ======================================================== +//| +//| .. module:: countio +//| :synopsis: Support for edge counting +//| :platform: SAMD +//| +//| The `countio` module contains logic to read and count edge transistions +//| +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| Counter +//| + +//| .. warning:: This module is not available in some SAMD21 (aka M0) builds. See the +//| :ref:`module-support-matrix` for more info. +//| + +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| + +STATIC const mp_rom_map_elem_t countio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_countio) }, + { MP_ROM_QSTR(MP_QSTR_Counter), MP_ROM_PTR(&countio_counter_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(countio_module_globals, countio_module_globals_table); + +const mp_obj_module_t countio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&countio_module_globals, +}; diff --git a/shared-bindings/countio/__init__.h b/shared-bindings/countio/__init__.h new file mode 100644 index 0000000000..35ae9f0354 --- /dev/null +++ b/shared-bindings/countio/__init__.h @@ -0,0 +1,9 @@ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO___INIT___H + +#include "py/obj.h" + +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_COUNTIO___INIT___H From 0ecc5155441e79e9b82cff8e2ff8eff6ff74c91e Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 5 May 2020 15:46:58 +1000 Subject: [PATCH 397/919] added missing translation --- locale/circuitpython.pot | 2 +- locale/sv.po | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index aa82bfe29c..5f5b5b7c52 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-05 14:57+1000\n" +"POT-Creation-Date: 2020-05-05 15:46+1000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/sv.po b/locale/sv.po index f993e52d32..6cefc8a03d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-27 18:34-0700\n" +"POT-Creation-Date: 2020-05-05 15:46+1000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -244,6 +244,7 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" msgstr "" @@ -1197,6 +1198,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" msgstr "" From d5c24b99b8860adc33ac95e3001b2bc53ce6055f Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 5 May 2020 16:04:28 +1000 Subject: [PATCH 398/919] hallowing m0 - exclude countio --- ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index af4a5a2932..5469f13388 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -19,7 +19,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 - +CIRCUITPY_COUNTIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 From f63ee9fb9b8c6f2e7f72bbaeede0315c545d4332 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 5 May 2020 16:15:57 +1000 Subject: [PATCH 399/919] excluded countio from other smaller boards --- ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index c1dbf514d7..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -23,6 +23,7 @@ CIRCUITPY_TOUCHIO_USE_NATIVE=0 CIRCUITPY_TOUCHIO=0 CIRCUITPY_USB_MIDI=0 CIRCUITPY_RTC=0 +CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice From a129be22b88a36be1ab1e23bcec82ce04cd2932e Mon Sep 17 00:00:00 2001 From: Weblate Admin Date: Sun, 29 Mar 2020 16:49:15 +0000 Subject: [PATCH 400/919] Translated using Weblate (French) Currently translated at 65.8% (476 of 723 strings) Translation: CircuitPython/circuitpython-master Translate-URL: https://later.unpythonic.net/projects/circuitpython/circuitpython-master/fr/ --- locale/fr.po | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index bcd20b5b48..b25bcfb002 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,17 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" -"PO-Revision-Date: 2019-04-14 20:05+0100\n" -"Last-Translator: Pierrick Couturier \n" -"Language-Team: fr\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"PO-Revision-Date: 2020-03-29 16:58+0000\n" +"Last-Translator: Weblate Admin \n" +"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.11.3\n" #: main.c msgid "" @@ -31,12 +34,18 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Veuillez signaler un problème avec le contenu de votre lecteur CIRCUITPY à l'" +"adresse\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Pour repartir, veuillez réinitialiser sans " #: py/obj.c msgid " File \"%q\"" @@ -48,7 +57,7 @@ msgstr " Fichier \"%q\", ligne %d" #: main.c msgid " output:\n" -msgstr " sortie:\n" +msgstr " sortie :\n" #: py/objstr.c #, c-format @@ -75,14 +84,12 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "%q must be >= 1" msgstr "%d doit être >=1" #: shared-bindings/fontio/BuiltinFont.c -#, fuzzy msgid "%q should be an int" -msgstr "y doit être un entier (int)" +msgstr "%q doit être un entier (int)" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -144,11 +151,11 @@ msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "L'objet '%s' ne peut pas assigner l'attribut '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "L'objet '%s' ne prends pas en charge '%q'" #: py/obj.c #, c-format @@ -198,7 +205,7 @@ msgstr "'align' nécessite 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' ou 'async with' sans fonction async" #: py/compile.c msgid "'await' outside function" From e8ad37c7eada846fcea633349aca2030a6270081 Mon Sep 17 00:00:00 2001 From: Weblate Admin Date: Sun, 29 Mar 2020 17:01:44 +0000 Subject: [PATCH 401/919] Translated using Weblate (French) Currently translated at 65.8% (476 of 723 strings) Translation: CircuitPython/circuitpython-master Translate-URL: https://later.unpythonic.net/projects/circuitpython/circuitpython-master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index b25bcfb002..3332654510 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-03-20 17:57-0500\n" -"PO-Revision-Date: 2020-03-29 16:58+0000\n" +"PO-Revision-Date: 2020-03-29 17:02+0000\n" "Last-Translator: Weblate Admin \n" "Language-Team: French \n" @@ -85,7 +85,7 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c msgid "%q must be >= 1" -msgstr "%d doit être >=1" +msgstr "%q doit être >=1" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" From c1eb33347f204f64bd783019280318c8f6ecd34f Mon Sep 17 00:00:00 2001 From: Tannewt Date: Mon, 30 Mar 2020 22:11:18 +0000 Subject: [PATCH 402/919] Translated using Weblate (English) Currently translated at 2.9% (21 of 723 strings) Translation: CircuitPython/circuitpython-master Translate-URL: https://later.unpythonic.net/projects/circuitpython/circuitpython-master/en_X@pirate/ --- locale/en_x_pirate.po | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 86d217e3bc..5238bb3160 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,15 +7,17 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" -"Last-Translator: \n" -"Language-Team: @sommersoft, @MrCertainly\n" +"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"PO-Revision-Date: 2020-03-30 22:11+0000\n" +"Last-Translator: Tannewt \n" +"Language-Team: English \n" "Language: en_x_pirate\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.11.3\n" #: main.c msgid "" @@ -31,6 +33,9 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Yar, there is a hole in the keel. Let the cap'n know at\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" From fdd0deb0e12ab5fb6d369936d86899f11c32ed76 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 30 Apr 2020 16:51:13 +0000 Subject: [PATCH 403/919] Translated using Weblate (German) Currently translated at 67.9% (495 of 729 strings) Translation: CircuitPython/circuitpython-master Translate-URL: https://later.unpythonic.net/projects/circuitpython/circuitpython-master/de/ --- locale/de_DE.po | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 7acebdb903..f759bc28cf 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,15 +7,17 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" -"PO-Revision-Date: 2018-07-27 11:55-0700\n" -"Last-Translator: Pascal Deneaux\n" -"Language-Team: Sebastian Plamauer, Pascal Deneaux\n" +"POT-Creation-Date: 2020-04-26 14:46-0500\n" +"PO-Revision-Date: 2020-04-30 17:01+0000\n" +"Last-Translator: Jeff Epler \n" +"Language-Team: German \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.0.2\n" #: main.c msgid "" @@ -31,12 +33,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Bitte melden Sie ein Problem mit dem Inhalt Ihres CIRCUITPY-Laufwerks unter\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Zum Beenden setzen Sie bitte die Karte ohne " #: py/obj.c msgid " File \"%q\"" @@ -142,11 +149,11 @@ msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "Das Objekt '%s' kann das Attribut '%q' nicht zuweisen" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "Das Objekt '%s' unterstützt '%q' nicht" #: py/obj.c #, c-format @@ -196,7 +203,7 @@ msgstr "'align' erfordert genau ein Argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion" #: py/compile.c msgid "'await' outside function" @@ -240,7 +247,7 @@ msgstr "" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0.0 zu einer komplexen Potenz" #: py/modbuiltins.c msgid "3-arg pow() not supported" From a1330747e8160064237f79be9b679c1042ffc881 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 5 May 2020 12:46:30 -0400 Subject: [PATCH 404/919] text fixes, postpone warning disable --- ports/mimxrt10xx/Makefile | 3 ++- ports/mimxrt10xx/common-hal/busio/SPI.c | 29 +------------------------ 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index cc2ec8f2b2..2efb4d6cb3 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -93,8 +93,9 @@ endif CFLAGS += $(INC) -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +# TODO: add these when -Werror is applied # Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align -CFLAGS += -Wno-undef -Wno-cast-align +# CFLAGS += -Wno-undef -Wno-cast-align CFLAGS += \ -mthumb \ diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index be5f1a6fc8..cc19ba354c 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -39,7 +39,7 @@ STATIC bool reserved_spi[MAX_SPI]; STATIC bool never_reset_spi[MAX_SPI]; -static void config_periph_pin(const mcu_periph_obj_t *periph) { +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { IOMUXC_SetPinMux( periph->pin->mux_reg, periph->mux_mode, periph->input_reg, periph->input_idx, @@ -153,33 +153,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } } - // for (uint32_t i = 0; i < sck_count; ++i) { - // if (mcu_spi_sck_list[i].pin != clock) - // continue; - - // for (uint32_t j = 0; j < miso_count; ++j) { - // if (mcu_spi_miso_list[j].pin != miso) - // continue; - - // if (mcu_spi_miso_list[j].bank_idx != mcu_spi_sck_list[i].bank_idx) - // continue; - - // for (uint32_t k = 0; k < mosi_count; ++k) { - // if (mcu_spi_mosi_list[k].pin != mosi) - // continue; - - // if (mcu_spi_mosi_list[k].bank_idx != mcu_spi_miso_list[j].bank_idx) - // continue; - - // self->clock = &mcu_spi_sck_list[i]; - // self->miso_pin = &mcu_spi_miso_list[j]; - // self->mosi_pin = &mcu_spi_mosi_list[k]; - - // break; - // } - // } - // } - if (self->clock != NULL && (self->mosi != NULL || self->miso != NULL)) { self->spi = mcu_spi_banks[self->clock->bank_idx - 1]; } else { From 2e29f7f1412678eab15095932b7cee554b10f276 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 5 May 2020 20:23:56 +0000 Subject: [PATCH 405/919] Translated using Weblate (French) Currently translated at 65.1% (477 of 732 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 3332654510..e0e16fb7fe 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-03-20 17:57-0500\n" -"PO-Revision-Date: 2020-03-29 17:02+0000\n" -"Last-Translator: Weblate Admin \n" +"PO-Revision-Date: 2020-05-05 20:24+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -18,7 +18,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 3.11.3\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" @@ -120,7 +120,7 @@ msgid "'%s' expects an FPU register" msgstr "'%s' attend un registre FPU" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an address of the form [a, b]" msgstr "'%s' attend une adresse de la forme [a, b]" From 7f1be814c89e4ecbaf6c396561ce2d01d9e7a049 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Wed, 6 May 2020 09:04:15 +1000 Subject: [PATCH 406/919] changed build variables as per advice --- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index b799406732..475d8b6342 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -9,10 +9,10 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - +CIRCUITPY_COUNTIO = 0 SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 35 -endif \ No newline at end of file +endif From 8961dd9fe74a3ba6e55bfb1b8132a93de920a1dc Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Wed, 6 May 2020 09:05:14 +1000 Subject: [PATCH 407/919] changed build variables as per advice --- py/circuitpy_mpconfig.mk | 4 ++-- shared-bindings/countio/Counter.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 7ef87a7ea2..be1e0ad9af 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -110,7 +110,7 @@ endif CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) ifndef CIRCUITPY_COUNTIO -CIRCUITPY_COUNTIO = 1 +CIRCUITPY_COUNTIO ?= 1 endif CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) @@ -214,7 +214,7 @@ endif CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) ifndef CIRCUITPY_COUNTIO -CIRCUITPY_COUNTIO = 1 +CIRCUITPY_COUNTIO = $(CIRCUITPY_FULL_BUILD) endif CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index c10294199a..efa3387a6f 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -31,10 +31,9 @@ //| from board import * //| //| pin_counter = countio.Counter(board.D1) -//| +//| #reset the count after 100 counts //| while True: -//| count = pin_counter.count -//| if count == None 10: +//| if pin_counter.count == 100: //| pin_counter.reset() //| print(pin_counter.count) //| From b168784fa0fd97b17807836b390c79abaadfa8e4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 14 Apr 2020 11:18:45 +0800 Subject: [PATCH 408/919] aesio: add basic AES encryption and decryption This adds initial support for an AES module named aesio. This implementation supports only a subset of AES modes, namely ECB, CBC, and CTR modes. Example usage: ``` >>> import aesio >>> >>> key = b'Sixteen byte key' >>> cipher = aesio.AES(key, aesio.MODE_ECB) >>> output = bytearray(16) >>> cipher.encrypt_into(b'Circuit Python!!', output) >>> output bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n') >>> ``` This key is 16-bytes, so it uses AES128. If your key is 24- or 32- bytes long, it will switch to AES192 or AES256 respectively. This has been tested with many of the official NIST test vectors, such as those used in `pycryptodome` at https://github.com/Legrandin/pycryptodome/tree/39626a5b01ce5c1cf51d022be166ad0aea722177/lib/Crypto/SelfTest/Cipher/test_vectors/AES CTR has not been tested as NIST does not provide test vectors for it. Signed-off-by: Sean Cross --- py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/aesio/__init__.c | 79 ++++ shared-bindings/aesio/__init__.h | 53 +++ shared-bindings/aesio/aes.c | 271 ++++++++++++++ shared-module/aesio/__init__.c | 58 +++ shared-module/aesio/__init__.h | 59 +++ shared-module/aesio/aes.c | 608 +++++++++++++++++++++++++++++++ shared-module/aesio/aes.h | 105 ++++++ 10 files changed, 1249 insertions(+) create mode 100644 shared-bindings/aesio/__init__.c create mode 100644 shared-bindings/aesio/__init__.h create mode 100644 shared-bindings/aesio/aes.c create mode 100644 shared-module/aesio/__init__.c create mode 100644 shared-module/aesio/__init__.h create mode 100644 shared-module/aesio/aes.c create mode 100644 shared-module/aesio/aes.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index ec8e6c3e98..e3892d98e4 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -99,6 +99,9 @@ endif ### # Select which builtin modules to compile and include. +ifeq ($(CIRCUITPY_AESIO),1) +SRC_PATTERNS += aesio/% +endif ifeq ($(CIRCUITPY_ANALOGIO),1) SRC_PATTERNS += analogio/% endif @@ -341,6 +344,8 @@ SRC_SHARED_MODULE_ALL = \ bitbangio/__init__.c \ board/__init__.c \ busio/OneWire.c \ + aesio/__init__.c \ + aesio/aes.c \ displayio/Bitmap.c \ displayio/ColorConverter.c \ displayio/Display.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 29a4d524ca..6b7fc192f9 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -223,6 +223,13 @@ typedef long mp_off_t; // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. +#if CIRCUITPY_AESIO +extern const struct _mp_obj_module_t aesio_module; +#define AESIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_aesio), (mp_obj_t)&aesio_module }, +#else +#define AESIO_MODULE +#endif + #if CIRCUITPY_ANALOGIO #define ANALOGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module }, extern const struct _mp_obj_module_t analogio_module; @@ -619,6 +626,7 @@ extern const struct _mp_obj_module_t ustack_module; // Some of these definitions will be blank depending on what is turned on and off. // Some are omitted because they're in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS above. #define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \ + AESIO_MODULE \ ANALOGIO_MODULE \ AUDIOBUSIO_MODULE \ AUDIOCORE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index c0943230c6..105253aec4 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -33,6 +33,9 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +CIRCUITPY_AESIO ?= 0 +CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) + CIRCUITPY_ANALOGIO ?= 1 CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c new file mode 100644 index 0000000000..43dc73e8b1 --- /dev/null +++ b/shared-bindings/aesio/__init__.c @@ -0,0 +1,79 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "__init__.h" + +//| :mod:`aesio` --- AES encryption routines +//| ======================================== +//| +//| .. module:: aesio +//| :synopsis: Embedded implementation of AES +//| +//| The `AES` module contains classes used to implement encryption +//| and decryption. It aims to be low overhead in terms of memory. +//| +//| + +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| aes + + +STATIC const mp_obj_tuple_t mp_aes_key_size_obj = { + {&mp_type_tuple}, + 3, + { + MP_OBJ_NEW_SMALL_INT(16), + MP_OBJ_NEW_SMALL_INT(24), + MP_OBJ_NEW_SMALL_INT(32), + } +}; + +STATIC const mp_rom_map_elem_t aesio_module_globals_table[] = { + {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_aesio)}, + {MP_ROM_QSTR(MP_QSTR_AES), MP_ROM_PTR(&aesio_aes_type) }, + {MP_ROM_QSTR(MP_QSTR_MODE_ECB), MP_ROM_INT(AES_MODE_ECB)}, + {MP_ROM_QSTR(MP_QSTR_MODE_CBC), MP_ROM_INT(AES_MODE_CBC)}, + {MP_ROM_QSTR(MP_QSTR_MODE_CTR), MP_ROM_INT(AES_MODE_CTR)}, + {MP_ROM_QSTR(MP_QSTR_block_size), MP_ROM_INT(AES_BLOCKLEN)}, + {MP_ROM_QSTR(MP_QSTR_key_size), (mp_obj_t)&mp_aes_key_size_obj}, +}; + +STATIC MP_DEFINE_CONST_DICT(aesio_module_globals, aesio_module_globals_table); + +const mp_obj_module_t aesio_module = { + .base = {&mp_type_module}, + .globals = (mp_obj_dict_t *)&aesio_module_globals, +}; + diff --git a/shared-bindings/aesio/__init__.h b/shared-bindings/aesio/__init__.h new file mode 100644 index 0000000000..634fed2e54 --- /dev/null +++ b/shared-bindings/aesio/__init__.h @@ -0,0 +1,53 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H + +#include "shared-module/aesio/__init__.h" + +extern const mp_obj_type_t aesio_aes_type; + +void common_hal_aesio_aes_construct(aesio_aes_obj_t* self, + const uint8_t* key, + uint32_t key_length, + const uint8_t* iv, + int mode, + int counter); +void common_hal_aesio_aes_rekey(aesio_aes_obj_t* self, + const uint8_t* key, + uint32_t key_length, + const uint8_t* iv); +void common_hal_aesio_aes_set_mode(aesio_aes_obj_t* self, + int mode); +void common_hal_aesio_aes_encrypt(aesio_aes_obj_t* self, + uint8_t* buffer, + size_t len); +void common_hal_aesio_aes_decrypt(aesio_aes_obj_t* self, + uint8_t* buffer, + size_t len); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_AESIO_H diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c new file mode 100644 index 0000000000..4ddcfa898b --- /dev/null +++ b/shared-bindings/aesio/aes.c @@ -0,0 +1,271 @@ +#include +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "shared-bindings/aesio/__init__.h" + +// Defined at the end of this file + +//| .. currentmodule:: aesio +//| +//| :class:`aesio` -- Encrypt and decrypt AES streams +//| ===================================================== +//| +//| An object that represents an AES stream, including the current state. +//| +//| .. class:: AES(key, mode=0, iv=None, segment_size=8) +//| +//| Create a new AES state with the given key. +//| +//| :param bytearray key: A 16-, 24-, or 32-byte key +//| :param int mode: AES mode to use. One of: AES.MODE_ECB, AES.MODE_CBC, or +//| AES.MODE_CTR +//| :param bytearray iv: Initialization vector to use for CBC or CTR mode +//| +//| Additional arguments are supported for legacy reasons. +//| +//| Encrypting a string:: +//| +//| import aesio +//| from binascii import hexlify +//| +//| key = b'Sixteen byte key' +//| inp = b'Circuit Python!!' # Note: 16-bytes long +//| outp = bytearray(len(inp)) +//| cipher = aesio.AES(key, aesio.mode.MODE_ECB) +//| cipher.encrypt_into(inp, outp) +//| hexlify(outp) +//| + +STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + (void)type; + enum { ARG_key, ARG_mode, ARG_IV, ARG_counter, ARG_segment_size }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_key, MP_ARG_OBJ | MP_ARG_REQUIRED}, + {MP_QSTR_mode, MP_ARG_INT, {.u_int = AES_MODE_ECB}}, + {MP_QSTR_IV, MP_ARG_OBJ}, + {MP_QSTR_counter, MP_ARG_OBJ}, + {MP_QSTR_segment_size, MP_ARG_INT, {.u_int = 8}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + aesio_aes_obj_t *self = m_new_obj(aesio_aes_obj_t); + self->base.type = &aesio_aes_type; + + mp_buffer_info_t bufinfo; + + const uint8_t *key = NULL; + uint32_t key_length = 0; + if (mp_get_buffer(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ)) { + if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); + } + key = bufinfo.buf; + key_length = bufinfo.len; + } else { + mp_raise_TypeError(translate("No key was specified")); + } + + int mode = args[ARG_mode].u_int; + switch (args[ARG_mode].u_int) { + case AES_MODE_CBC: + case AES_MODE_ECB: + case AES_MODE_CTR: + break; + default: + mp_raise_TypeError(translate("Requested AES mode is unsupported")); + } + + // IV is required for CBC mode and is ignored for other modes. + const uint8_t *iv = NULL; + if (args[ARG_IV].u_obj != NULL && + mp_get_buffer(args[ARG_IV].u_obj, &bufinfo, MP_BUFFER_READ)) { + if (bufinfo.len != AES_BLOCKLEN) { + mp_raise_TypeError_varg(translate("IV must be %d bytes long"), + AES_BLOCKLEN); + } + iv = bufinfo.buf; + } + + common_hal_aesio_aes_construct(self, key, key_length, iv, mode, + args[ARG_counter].u_int); + return MP_OBJ_FROM_PTR(self); +} + +STATIC mp_obj_t aesio_aes_rekey(size_t n_args, const mp_obj_t *pos_args) { + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + size_t key_length = 0; + const uint8_t *key = + (const uint8_t *)mp_obj_str_get_data(pos_args[1], &key_length); + if (key == NULL) { + mp_raise_ValueError(translate("No key was specified")); + } + if ((key_length != 16) && (key_length != 24) && (key_length != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); + } + + const uint8_t *iv = NULL; + if (n_args > 2) { + size_t iv_length = 0; + iv = (const uint8_t *)mp_obj_str_get_data(pos_args[2], &iv_length); + if (iv_length != AES_BLOCKLEN) { + mp_raise_TypeError_varg(translate("IV must be %d bytes long"), + AES_BLOCKLEN); + } + } + + common_hal_aesio_aes_rekey(self, key, key_length, iv); + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_VAR(aesio_aes_rekey_obj, 2, aesio_aes_rekey); + +STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, + size_t dest_length) { + if (src_length != dest_length) { + mp_raise_ValueError( + translate("Source and destination buffers must be the same length")); + } + + switch (self->mode) { + case AES_MODE_ECB: + if (src_length != 16) { + mp_raise_msg(&mp_type_ValueError, + translate("ECB only operates on 16 bytes at a time")); + } + break; + case AES_MODE_CBC: + if ((src_length & 15) != 0) { + mp_raise_msg(&mp_type_ValueError, + translate("CBC blocks must be multiples of 16 bytes")); + } + break; + case AES_MODE_CTR: + break; + } +} + +//| .. method:: encrypt_into(src, dest) +//| +//| Encrypt the buffer from ``src`` into ``dest``. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions. +//| +STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, + mp_obj_t dest) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + // Convert parameters into expected types. + aesio_aes_obj_t *aes = MP_OBJ_TO_PTR(aesio_obj); + + mp_buffer_info_t srcbufinfo, destbufinfo; + mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + validate_length(aes, srcbufinfo.len, destbufinfo.len); + + memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); + + common_hal_aesio_aes_encrypt(aes, (uint8_t *)destbufinfo.buf, + destbufinfo.len); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, + aesio_aes_encrypt_into); + +//| .. method:: decrypt_into(src, dest) +//| +//| Decrypt the buffer from ``src`` into ``dest``. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions. +//| +STATIC mp_obj_t aesio_aes_decrypt_into(mp_obj_t aesio_obj, mp_obj_t src, + mp_obj_t dest) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + // Convert parameters into expected types. + aesio_aes_obj_t *aes = MP_OBJ_TO_PTR(aesio_obj); + + mp_buffer_info_t srcbufinfo, destbufinfo; + mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + validate_length(aes, srcbufinfo.len, destbufinfo.len); + + memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); + + common_hal_aesio_aes_decrypt(aes, (uint8_t *)destbufinfo.buf, + destbufinfo.len); + return mp_const_none; +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_decrypt_into_obj, + aesio_aes_decrypt_into); + +STATIC mp_obj_t aesio_aes_get_mode(mp_obj_t aesio_obj) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(aesio_obj); + return MP_OBJ_NEW_SMALL_INT(self->mode); +} +MP_DEFINE_CONST_FUN_OBJ_1(aesio_aes_get_mode_obj, aesio_aes_get_mode); + +STATIC mp_obj_t aesio_aes_set_mode(mp_obj_t aesio_obj, mp_obj_t mode_obj) { + if (!MP_OBJ_IS_TYPE(aesio_obj, &aesio_aes_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), aesio_aes_type.name); + } + aesio_aes_obj_t *self = MP_OBJ_TO_PTR(aesio_obj); + + int mode = mp_obj_get_int(mode_obj); + switch (mode) { + case AES_MODE_CBC: + case AES_MODE_ECB: + case AES_MODE_CTR: + break; + default: + mp_raise_TypeError(translate("Requested AES mode is unsupported")); + } + + common_hal_aesio_aes_set_mode(self, mode); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(aesio_aes_set_mode_obj, aesio_aes_set_mode); + +const mp_obj_property_t aesio_aes_mode_obj = { + .base.type = &mp_type_property, + .proxy = { + (mp_obj_t)&aesio_aes_get_mode_obj, + (mp_obj_t)&aesio_aes_set_mode_obj, + (mp_obj_t)&mp_const_none_obj + }, +}; + +STATIC const mp_rom_map_elem_t aesio_locals_dict_table[] = { + // Methods + {MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_AES)}, + {MP_ROM_QSTR(MP_QSTR_encrypt_into), (mp_obj_t)&aesio_aes_encrypt_into_obj}, + {MP_ROM_QSTR(MP_QSTR_decrypt_into), (mp_obj_t)&aesio_aes_decrypt_into_obj}, + {MP_ROM_QSTR(MP_QSTR_rekey), (mp_obj_t)&aesio_aes_rekey_obj}, + {MP_ROM_QSTR(MP_QSTR_mode), (mp_obj_t)&aesio_aes_mode_obj}, +}; +STATIC MP_DEFINE_CONST_DICT(aesio_locals_dict, aesio_locals_dict_table); + +const mp_obj_type_t aesio_aes_type = { + {&mp_type_type}, + .name = MP_QSTR_AES, + .make_new = aesio_aes_make_new, + .locals_dict = (mp_obj_dict_t *)&aesio_locals_dict, +}; diff --git a/shared-module/aesio/__init__.c b/shared-module/aesio/__init__.c new file mode 100644 index 0000000000..2cacaeb66e --- /dev/null +++ b/shared-module/aesio/__init__.c @@ -0,0 +1,58 @@ +#include + +#include "py/runtime.h" + +#include "shared-bindings/aesio/__init__.h" +#include "shared-module/aesio/__init__.h" + +void common_hal_aesio_aes_construct(aesio_aes_obj_t *self, const uint8_t *key, + uint32_t key_length, const uint8_t *iv, + int mode, int counter) { + self->mode = mode; + self->counter = counter; + common_hal_aesio_aes_rekey(self, key, key_length, iv); +} + +void common_hal_aesio_aes_rekey(aesio_aes_obj_t *self, const uint8_t *key, + uint32_t key_length, const uint8_t *iv) { + memset(&self->ctx, 0, sizeof(self->ctx)); + if (iv != NULL) { + AES_init_ctx_iv(&self->ctx, key, key_length, iv); + } else { + AES_init_ctx(&self->ctx, key, key_length); + } +} + +void common_hal_aesio_aes_set_mode(aesio_aes_obj_t *self, int mode) { + self->mode = mode; +} + +void common_hal_aesio_aes_encrypt(aesio_aes_obj_t *self, uint8_t *buffer, + size_t length) { + switch (self->mode) { + case AES_MODE_ECB: + AES_ECB_encrypt(&self->ctx, buffer); + break; + case AES_MODE_CBC: + AES_CBC_encrypt_buffer(&self->ctx, buffer, length); + break; + case AES_MODE_CTR: + AES_CTR_xcrypt_buffer(&self->ctx, buffer, length); + break; + } +} + +void common_hal_aesio_aes_decrypt(aesio_aes_obj_t *self, uint8_t *buffer, + size_t length) { + switch (self->mode) { + case AES_MODE_ECB: + AES_ECB_decrypt(&self->ctx, buffer); + break; + case AES_MODE_CBC: + AES_CBC_decrypt_buffer(&self->ctx, buffer, length); + break; + case AES_MODE_CTR: + AES_CTR_xcrypt_buffer(&self->ctx, buffer, length); + break; + } +} diff --git a/shared-module/aesio/__init__.h b/shared-module/aesio/__init__.h new file mode 100644 index 0000000000..1a0bb86967 --- /dev/null +++ b/shared-module/aesio/__init__.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H +#define MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H + +#include +#include + +#include "py/obj.h" +#include "py/proto.h" + +#include "shared-module/aesio/aes.h" + +// These values were chosen to correspond with the values +// present in pycrypto. +enum AES_MODE { + AES_MODE_ECB = 1, + AES_MODE_CBC = 2, + AES_MODE_CTR = 6, +}; + +typedef struct { + mp_obj_base_t base; + + // The tinyaes context + struct AES_ctx ctx; + + // Which AES mode this instance of the object is configured to use + enum AES_MODE mode; + + // Counter for running in CTR mode + uint32_t counter; +} aesio_aes_obj_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_AESIO__INIT__H diff --git a/shared-module/aesio/aes.c b/shared-module/aesio/aes.c new file mode 100644 index 0000000000..b62b5afc48 --- /dev/null +++ b/shared-module/aesio/aes.c @@ -0,0 +1,608 @@ +/* + +This is an implementation of the AES algorithm, specifically ECB, CTR and CBC mode. +Block size can be chosen in aes.h - available choices are AES128, AES192, AES256. + +The implementation is verified against the test vectors in: + National Institute of Standards and Technology Special Publication 800-38A 2001 ED + +ECB-AES128 +---------- + + plain-text: + 6bc1bee22e409f96e93d7e117393172a + ae2d8a571e03ac9c9eb76fac45af8e51 + 30c81c46a35ce411e5fbc1191a0a52ef + f69f2445df4f9b17ad2b417be66c3710 + + key: + 2b7e151628aed2a6abf7158809cf4f3c + + resulting cipher + 3ad77bb40d7a3660a89ecaf32466ef97 + f5d3d58503b9699de785895a96fdbaaf + 43b1cd7f598ece23881b00e3ed030688 + 7b0c785e27e8ad3f8223207104725dd4 + + +NOTE: String length must be evenly divisible by 16byte (str_len % 16 == 0) + You should pad the end of the string with zeros if this is not the case. + For AES192/256 the key size is proportionally larger. + +*/ + +/*****************************************************************************/ +/* Includes: */ +/*****************************************************************************/ +#include // CBC mode, for memset +#include "aes.h" + +/*****************************************************************************/ +/* Defines: */ +/*****************************************************************************/ +// The number of columns comprising a state in AES. This is a constant in AES. +// Value=4 +#define Nb 4UL + +#if defined(AES256) && (AES256 == 1) + #define Nk256 8UL + #define Nr256 14UL +#endif +#if defined(AES192) && (AES192 == 1) + #define Nk192 6UL + #define Nr192 12UL +#endif +#if defined(AES128) && (AES128 == 1) + #define Nk128 4UL // The number of 32 bit words in a key. + #define Nr128 10UL // The number of rounds in AES Cipher. +#endif + +// jcallan@github points out that declaring Multiply as a function reduces code +// size considerably with the Keil ARM compiler. See this link for more +// information: https://github.com/kokke/tiny-AES-C/pull/3 +#ifndef MULTIPLY_AS_A_FUNCTION + #define MULTIPLY_AS_A_FUNCTION 0 +#endif + + + + +/*****************************************************************************/ +/* Private variables: */ +/*****************************************************************************/ +// state - array holding the intermediate results during decryption. +typedef uint8_t state_t[4][4]; + + + +// The lookup-tables are marked const so they can be placed in read-only storage +// instead of RAM The numbers below can be computed dynamically trading ROM for +// RAM - This can be useful in (embedded) bootloader applications, where ROM is +// often limited. +static const uint8_t sbox[256] = { + //0 1 2 3 4 5 6 7 8 9 A B C D E F + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; + +static const uint8_t rsbox[256] = { + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d }; + +// The round constant word array, Rcon[i], contains the values given by x to the +// power (i-1) being powers of x (x is denoted as {02}) in the field GF(2^8) +static const uint8_t Rcon[11] = { + 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 }; + +/* + * Jordan Goulder points out in PR #12 + * (https://github.com/kokke/tiny-AES-C/pull/12), that you can remove most of + * the elements in the Rcon array, because they are unused. + * + * From Wikipedia's article on the Rijndael key schedule @ + * https://en.wikipedia.org/wiki/Rijndael_key_schedule#Rcon + * + * "Only the first some of these constants are actually used – up to rcon[10] + * for AES-128 (as 11 round keys are needed), up to rcon[8] for AES-192, up to + * rcon[7] for AES-256. rcon[0] is not used in AES algorithm." + */ + + +/*****************************************************************************/ +/* Private functions: */ +/*****************************************************************************/ +static const uint8_t *GetRoundKey(const struct AES_ctx *ctx) { + switch (ctx->KeyLength) { +#if defined(AES128) && (AES128 == 1) + case 16: return ctx->RoundKey128; +#endif +#if defined(AES192) && (AES192 == 1) + case 24: return ctx->RoundKey192; +#endif +#if defined(AES256) && (AES256 == 1) + case 32: return ctx->RoundKey256; +#endif + } + return NULL; +} + + +/* +static uint8_t getSBoxValue(uint8_t num) +{ + return sbox[num]; +} +*/ +#define getSBoxValue(num) (sbox[(num)]) +/* +static uint8_t getSBoxInvert(uint8_t num) +{ + return rsbox[num]; +} +*/ +#define getSBoxInvert(num) (rsbox[(num)]) + +// This function produces Nb(Nr+1) round keys. The round keys are used in each +// round to decrypt the states. +static void KeyExpansion(struct AES_ctx* ctx, const uint8_t* Key) +{ + uint8_t* RoundKey = (uint8_t *)GetRoundKey(ctx); + + unsigned i, j, k; + uint8_t tempa[4]; // Used for the column/row operations + + // The first round key is the key itself. + for (i = 0; i < ctx->Nk; ++i) + { + RoundKey[(i * 4) + 0] = Key[(i * 4) + 0]; + RoundKey[(i * 4) + 1] = Key[(i * 4) + 1]; + RoundKey[(i * 4) + 2] = Key[(i * 4) + 2]; + RoundKey[(i * 4) + 3] = Key[(i * 4) + 3]; + } + + // All other round keys are found from the previous round keys. + for (i = ctx->Nk; i < Nb * (ctx->Nr + 1); ++i) + { + { + k = (i - 1) * 4; + tempa[0]=RoundKey[k + 0]; + tempa[1]=RoundKey[k + 1]; + tempa[2]=RoundKey[k + 2]; + tempa[3]=RoundKey[k + 3]; + + } + + if (i % ctx->Nk == 0) + { + // This function shifts the 4 bytes in a word to the left once. + // [a0,a1,a2,a3] becomes [a1,a2,a3,a0] + + // Function RotWord() + { + const uint8_t u8tmp = tempa[0]; + tempa[0] = tempa[1]; + tempa[1] = tempa[2]; + tempa[2] = tempa[3]; + tempa[3] = u8tmp; + } + + // SubWord() is a function that takes a four-byte input word and applies + // the S-box to each of the four bytes to produce an output word. + + // Function Subword() + { + tempa[0] = getSBoxValue(tempa[0]); + tempa[1] = getSBoxValue(tempa[1]); + tempa[2] = getSBoxValue(tempa[2]); + tempa[3] = getSBoxValue(tempa[3]); + } + + tempa[0] = tempa[0] ^ Rcon[i/ctx->Nk]; + } +#if defined(AES256) && (AES256 == 1) + if (ctx->KeyLength == 32) { + if (i % ctx->Nk == 4) + { + // Function Subword() + { + tempa[0] = getSBoxValue(tempa[0]); + tempa[1] = getSBoxValue(tempa[1]); + tempa[2] = getSBoxValue(tempa[2]); + tempa[3] = getSBoxValue(tempa[3]); + } + } + } +#endif + j = i * 4; k=(i - ctx->Nk) * 4; + RoundKey[j + 0] = RoundKey[k + 0] ^ tempa[0]; + RoundKey[j + 1] = RoundKey[k + 1] ^ tempa[1]; + RoundKey[j + 2] = RoundKey[k + 2] ^ tempa[2]; + RoundKey[j + 3] = RoundKey[k + 3] ^ tempa[3]; + } +} + +void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen) +{ + ctx->KeyLength = keylen; + switch (ctx->KeyLength) { +#if defined(AES128) && (AES128 == 1) + case 16: ctx->Nr = Nr128; ctx->Nk = Nk128; break; +#endif +#if defined(AES192) && (AES192 == 1) + case 24: ctx->Nr = Nr192; ctx->Nk = Nk192; break; +#endif +#if defined(AES256) && (AES256 == 1) + case 32: ctx->Nr = Nr256; ctx->Nk = Nk256; break; +#endif + default: ctx->Nr = 0; ctx->Nk = 0; break; + } + KeyExpansion(ctx, key); +} +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) +void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen, const uint8_t* iv) +{ + AES_init_ctx(ctx, key, keylen); + memcpy (ctx->Iv, iv, AES_BLOCKLEN); +} +void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv) +{ + memcpy (ctx->Iv, iv, AES_BLOCKLEN); +} +#endif + +// This function adds the round key to state. The round key is added to the +// state by an XOR function. +static void AddRoundKey(uint8_t round, state_t* state, const uint8_t* RoundKey) +{ + uint8_t i,j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[i][j] ^= RoundKey[(round * Nb * 4) + (i * Nb) + j]; + } + } +} + +// The SubBytes Function Substitutes the values in the state matrix with values +// in an S-box. +static void SubBytes(state_t* state) +{ + uint8_t i, j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[j][i] = getSBoxValue((*state)[j][i]); + } + } +} + +// The ShiftRows() function shifts the rows in the state to the left. Each row +// is shifted with different offset. Offset = Row number. So the first row is +// not shifted. +static void ShiftRows(state_t* state) +{ + uint8_t temp; + + // Rotate first row 1 columns to left + temp = (*state)[0][1]; + (*state)[0][1] = (*state)[1][1]; + (*state)[1][1] = (*state)[2][1]; + (*state)[2][1] = (*state)[3][1]; + (*state)[3][1] = temp; + + // Rotate second row 2 columns to left + temp = (*state)[0][2]; + (*state)[0][2] = (*state)[2][2]; + (*state)[2][2] = temp; + + temp = (*state)[1][2]; + (*state)[1][2] = (*state)[3][2]; + (*state)[3][2] = temp; + + // Rotate third row 3 columns to left + temp = (*state)[0][3]; + (*state)[0][3] = (*state)[3][3]; + (*state)[3][3] = (*state)[2][3]; + (*state)[2][3] = (*state)[1][3]; + (*state)[1][3] = temp; +} + +static uint8_t xtime(uint8_t x) +{ + return ((x<<1) ^ (((x>>7) & 1) * 0x1b)); +} + +// MixColumns function mixes the columns of the state matrix +static void MixColumns(state_t* state) +{ + uint8_t i; + uint8_t Tmp, Tm, t; + for (i = 0; i < 4; ++i) + { + t = (*state)[i][0]; + Tmp = (*state)[i][0] ^ (*state)[i][1] ^ (*state)[i][2] ^ (*state)[i][3] ; + Tm = (*state)[i][0] ^ (*state)[i][1] ; Tm = xtime(Tm); (*state)[i][0] ^= Tm ^ Tmp ; + Tm = (*state)[i][1] ^ (*state)[i][2] ; Tm = xtime(Tm); (*state)[i][1] ^= Tm ^ Tmp ; + Tm = (*state)[i][2] ^ (*state)[i][3] ; Tm = xtime(Tm); (*state)[i][2] ^= Tm ^ Tmp ; + Tm = (*state)[i][3] ^ t ; Tm = xtime(Tm); (*state)[i][3] ^= Tm ^ Tmp ; + } +} + +// Multiply is used to multiply numbers in the field GF(2^8) +// Note: The last call to xtime() is unneeded, but often ends up generating a smaller binary +// The compiler seems to be able to vectorize the operation better this way. +// See https://github.com/kokke/tiny-AES-c/pull/34 +#if MULTIPLY_AS_A_FUNCTION +static uint8_t Multiply(uint8_t x, uint8_t y) +{ + return (((y & 1) * x) ^ + ((y>>1 & 1) * xtime(x)) ^ + ((y>>2 & 1) * xtime(xtime(x))) ^ + ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ + ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))); /* this last call to xtime() can be omitted */ + } +#else +#define Multiply(x, y) \ + ( ((y & 1) * x) ^ \ + ((y>>1 & 1) * xtime(x)) ^ \ + ((y>>2 & 1) * xtime(xtime(x))) ^ \ + ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ \ + ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) \ + +#endif + +#if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) +// MixColumns function mixes the columns of the state matrix. The method used to +// multiply may be difficult to understand for the inexperienced. Please use the +// references to gain more information. +static void InvMixColumns(state_t* state) +{ + int i; + uint8_t a, b, c, d; + for (i = 0; i < 4; ++i) + { + a = (*state)[i][0]; + b = (*state)[i][1]; + c = (*state)[i][2]; + d = (*state)[i][3]; + + (*state)[i][0] = Multiply(a, 0x0e) ^ Multiply(b, 0x0b) ^ Multiply(c, 0x0d) ^ Multiply(d, 0x09); + (*state)[i][1] = Multiply(a, 0x09) ^ Multiply(b, 0x0e) ^ Multiply(c, 0x0b) ^ Multiply(d, 0x0d); + (*state)[i][2] = Multiply(a, 0x0d) ^ Multiply(b, 0x09) ^ Multiply(c, 0x0e) ^ Multiply(d, 0x0b); + (*state)[i][3] = Multiply(a, 0x0b) ^ Multiply(b, 0x0d) ^ Multiply(c, 0x09) ^ Multiply(d, 0x0e); + } +} + + +// The SubBytes Function Substitutes the values in the state matrix with values +// in an S-box. +static void InvSubBytes(state_t* state) +{ + uint8_t i, j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[j][i] = getSBoxInvert((*state)[j][i]); + } + } +} + +static void InvShiftRows(state_t* state) +{ + uint8_t temp; + + // Rotate first row 1 columns to right + temp = (*state)[3][1]; + (*state)[3][1] = (*state)[2][1]; + (*state)[2][1] = (*state)[1][1]; + (*state)[1][1] = (*state)[0][1]; + (*state)[0][1] = temp; + + // Rotate second row 2 columns to right + temp = (*state)[0][2]; + (*state)[0][2] = (*state)[2][2]; + (*state)[2][2] = temp; + + temp = (*state)[1][2]; + (*state)[1][2] = (*state)[3][2]; + (*state)[3][2] = temp; + + // Rotate third row 3 columns to right + temp = (*state)[0][3]; + (*state)[0][3] = (*state)[1][3]; + (*state)[1][3] = (*state)[2][3]; + (*state)[2][3] = (*state)[3][3]; + (*state)[3][3] = temp; +} +#endif // #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) + +// Cipher is the main function that encrypts the PlainText. +static void Cipher(state_t* state, const struct AES_ctx* ctx) +{ + const uint8_t* RoundKey = GetRoundKey(ctx); + uint8_t round = 0; + + // Add the First round key to the state before starting the rounds. + AddRoundKey(0, state, RoundKey); + + // There will be Nr rounds. The first Nr-1 rounds are identical. These Nr + // rounds are executed in the loop below. Last one without MixColumns() + for (round = 1; ; ++round) + { + SubBytes(state); + ShiftRows(state); + if (round == ctx->Nr) { + break; + } + MixColumns(state); + AddRoundKey(round, state, RoundKey); + } + // Add round key to last round + AddRoundKey(ctx->Nr, state, RoundKey); +} + +#if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) +static void InvCipher(state_t* state, const struct AES_ctx* ctx) +{ + const uint8_t* RoundKey = GetRoundKey(ctx); + uint8_t round = 0; + + // Add the First round key to the state before starting the rounds. + AddRoundKey(ctx->Nr, state, RoundKey); + + // There will be Nr rounds. The first Nr-1 rounds are identical. These Nr + // rounds are executed in the loop below. Last one without InvMixColumn() + for (round = (ctx->Nr - 1); ; --round) + { + InvShiftRows(state); + InvSubBytes(state); + AddRoundKey(round, state, RoundKey); + if (round == 0) { + break; + } + InvMixColumns(state); + } + +} +#endif // #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) + +/*****************************************************************************/ +/* Public functions: */ +/*****************************************************************************/ +#if defined(ECB) && (ECB == 1) + + +void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf) +{ + // The next function call encrypts the PlainText with the Key using AES + // algorithm. + Cipher((state_t*)buf, ctx); +} + +void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf) +{ + // The next function call decrypts the PlainText with the Key using AES + // algorithm. + InvCipher((state_t*)buf, ctx); +} + + +#endif // #if defined(ECB) && (ECB == 1) + + + + + +#if defined(CBC) && (CBC == 1) + + +static void XorWithIv(uint8_t* buf, const uint8_t* Iv) +{ + uint8_t i; + for (i = 0; i < AES_BLOCKLEN; ++i) // The block in AES is always 128bit no matter the key size + { + buf[i] ^= Iv[i]; + } +} + +void AES_CBC_encrypt_buffer(struct AES_ctx *ctx, uint8_t* buf, uint32_t length) +{ + uintptr_t i; + uint8_t *Iv = ctx->Iv; + for (i = 0; i < length; i += AES_BLOCKLEN) + { + XorWithIv(buf, Iv); + Cipher((state_t*)buf, ctx); + Iv = buf; + buf += AES_BLOCKLEN; + } + /* store Iv in ctx for next call */ + memcpy(ctx->Iv, Iv, AES_BLOCKLEN); +} + +void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length) +{ + uintptr_t i; + uint8_t storeNextIv[AES_BLOCKLEN]; + for (i = 0; i < length; i += AES_BLOCKLEN) + { + memcpy(storeNextIv, buf, AES_BLOCKLEN); + InvCipher((state_t*)buf, ctx); + XorWithIv(buf, ctx->Iv); + memcpy(ctx->Iv, storeNextIv, AES_BLOCKLEN); + buf += AES_BLOCKLEN; + } + +} + +#endif // #if defined(CBC) && (CBC == 1) + + + +#if defined(CTR) && (CTR == 1) + +/* Symmetrical operation: same function for encrypting as for decrypting. Note +any IV/nonce should never be reused with the same key */ +void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length) +{ + uint8_t buffer[AES_BLOCKLEN]; + + unsigned i; + int bi; + for (i = 0, bi = AES_BLOCKLEN; i < length; ++i, ++bi) + { + if (bi == AES_BLOCKLEN) /* we need to regen xor compliment in buffer */ + { + memcpy(buffer, ctx->Iv, AES_BLOCKLEN); + Cipher((state_t*)buffer, ctx); + + /* Increment Iv and handle overflow */ + for (bi = (AES_BLOCKLEN - 1); bi >= 0; --bi) + { + /* inc will overflow */ + if (ctx->Iv[bi] == 255) + { + ctx->Iv[bi] = 0; + continue; + } + ctx->Iv[bi] += 1; + break; + } + bi = 0; + } + + buf[i] = (buf[i] ^ buffer[bi]); + } +} + +#endif // #if defined(CTR) && (CTR == 1) diff --git a/shared-module/aesio/aes.h b/shared-module/aesio/aes.h new file mode 100644 index 0000000000..a87fa5be75 --- /dev/null +++ b/shared-module/aesio/aes.h @@ -0,0 +1,105 @@ +#ifndef _AES_H_ +#define _AES_H_ + +#include + +// #define the macros below to 1/0 to enable/disable the mode of operation. +// +// CBC enables AES encryption in CBC-mode of operation. +// CTR enables encryption in counter-mode. +// ECB enables the basic ECB 16-byte block algorithm. All can be enabled simultaneously. + +// The #ifndef-guard allows it to be configured before #include'ing or at compile time. +#ifndef CBC + #define CBC 1 +#endif + +#ifndef ECB + #define ECB 1 +#endif + +#ifndef CTR + #define CTR 1 +#endif + + +#define AES128 1 +#define AES192 1 +#define AES256 1 + +#define AES_BLOCKLEN 16 // Block length in bytes - AES is 128b block only + +#if defined(AES256) && (AES256 == 1) + #define AES_KEYLEN256 32 + #define AES_keyExpSize256 240 +#endif +#if defined(AES192) && (AES192 == 1) + #define AES_KEYLEN192 24 + #define AES_keyExpSize192 208 +#endif +#if defined(AES128) && (AES128 == 1) + #define AES_KEYLEN128 16 // Key length in bytes + #define AES_keyExpSize128 176 +#endif + +struct AES_ctx +{ + union { +#if defined(AES256) && (AES256 == 1) + uint8_t RoundKey256[AES_keyExpSize256]; +#endif +#if defined(AES192) && (AES192 == 1) + uint8_t RoundKey192[AES_keyExpSize192]; +#endif +#if defined(AES128) && (AES128 == 1) + uint8_t RoundKey128[AES_keyExpSize128]; +#endif + }; +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) + uint8_t Iv[AES_BLOCKLEN]; +#endif + uint32_t KeyLength; + uint8_t Nr; + uint8_t Nk; +}; + +void AES_init_ctx(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen); +#if (defined(CBC) && (CBC == 1)) || (defined(CTR) && (CTR == 1)) +void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, uint32_t keylen, const uint8_t* iv); +void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv); +#endif + +#if defined(ECB) && (ECB == 1) +// buffer size is exactly AES_BLOCKLEN bytes; +// you need only AES_init_ctx as IV is not used in ECB +// NB: ECB is considered insecure for most uses +void AES_ECB_encrypt(const struct AES_ctx* ctx, uint8_t* buf); +void AES_ECB_decrypt(const struct AES_ctx* ctx, uint8_t* buf); + +#endif // #if defined(ECB) && (ECB == !) + + +#if defined(CBC) && (CBC == 1) +// buffer size MUST be mutile of AES_BLOCKLEN; +// Suggest https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme +// NOTES: you need to set IV in ctx via AES_init_ctx_iv() or AES_ctx_set_iv() +// no IV should ever be reused with the same key +void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); +void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); + +#endif // #if defined(CBC) && (CBC == 1) + + +#if defined(CTR) && (CTR == 1) + +// Same function for encrypting as for decrypting. +// IV is incremented for every block, and used after encryption as XOR-compliment for output +// Suggesting https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS7 for padding scheme +// NOTES: you need to set IV in ctx with AES_init_ctx_iv() or AES_ctx_set_iv() +// no IV should ever be reused with the same key +void AES_CTR_xcrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length); + +#endif // #if defined(CTR) && (CTR == 1) + + +#endif // _AES_H_ From b9f62ab14a05c15cdcc6c0e10ff2bc1634dd7754 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 6 May 2020 17:47:44 +0800 Subject: [PATCH 409/919] locale: add translations for aesio This is the result of running `make translate` after creating aesio. Signed-off-by: Sean Cross --- locale/ID.po | 33 +++++++++++++++++++++++++++++++-- locale/circuitpython.pot | 33 +++++++++++++++++++++++++++++++-- locale/de_DE.po | 33 +++++++++++++++++++++++++++++++-- locale/en_US.po | 33 +++++++++++++++++++++++++++++++-- locale/en_x_pirate.po | 33 +++++++++++++++++++++++++++++++-- locale/es.po | 33 +++++++++++++++++++++++++++++++-- locale/fil.po | 33 +++++++++++++++++++++++++++++++-- locale/fr.po | 37 +++++++++++++++++++++++++++++++++---- locale/it_IT.po | 33 +++++++++++++++++++++++++++++++-- locale/ko.po | 33 +++++++++++++++++++++++++++++++-- locale/pl.po | 33 +++++++++++++++++++++++++++++++-- locale/pt_BR.po | 33 +++++++++++++++++++++++++++++++-- locale/sv.po | 33 +++++++++++++++++++++++++++++++-- locale/zh_Latn_pinyin.po | 33 +++++++++++++++++++++++++++++++-- 14 files changed, 436 insertions(+), 30 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 32053577c0..3a2afdef8f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -434,6 +434,10 @@ msgstr "buffers harus mempunyai panjang yang sama" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -671,6 +675,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +690,7 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -809,6 +817,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operasi I2C tidak didukung" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -988,6 +1001,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" @@ -1121,6 +1138,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1302,6 +1323,10 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Channel Kanan tidak didukung" @@ -1366,6 +1391,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index aa465b0b72..edfef28df4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 20:38-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -429,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -660,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -671,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -798,6 +806,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -977,6 +990,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1110,6 +1127,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1287,6 +1308,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1350,6 +1375,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f759bc28cf..578e2d86b2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2020-04-30 17:01+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: fil\n" @@ -436,6 +436,10 @@ msgstr "buffer ay dapat bytes-like object" msgid "Bytes must be between 0 and 255." msgstr "Sa gitna ng 0 o 255 dapat ang bytes." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -672,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -683,7 +691,7 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -812,6 +820,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Hindi supportado ang operasyong I2C" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -993,6 +1006,10 @@ msgstr "May hindi tama sa wave file" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" @@ -1126,6 +1143,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1310,6 +1331,10 @@ msgstr "Basahin-lamang" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Hindi supportado ang kanang channel" @@ -1373,6 +1398,10 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" diff --git a/locale/fr.po b/locale/fr.po index e0e16fb7fe..ede3d2f2da 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2020-05-05 20:24+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" @@ -436,6 +436,10 @@ msgstr "i buffer devono essere della stessa lunghezza" msgid "Bytes must be between 0 and 255." msgstr "I byte devono essere compresi tra 0 e 255" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -672,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -683,7 +691,7 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -812,6 +820,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operazione I2C non supportata" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -996,6 +1009,10 @@ msgstr "File wave non valido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1130,6 +1147,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1319,6 +1340,10 @@ msgstr "Sola lettura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canale destro non supportato" @@ -1384,6 +1409,10 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" diff --git a/locale/ko.po b/locale/ko.po index 4f87e51c9a..5f28a85992 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -433,6 +433,10 @@ msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." msgid "Bytes must be between 0 and 255." msgstr "바이트는 0에서 255 사이 여야합니다." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -664,6 +668,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -675,7 +683,7 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -802,6 +810,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -981,6 +994,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1114,6 +1131,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1291,6 +1312,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1354,6 +1379,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index cdf64cd038..6e410cbbbc 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -432,6 +432,10 @@ msgstr "Bufor musi mieć 16 bajtów." msgid "Bytes must be between 0 and 255." msgstr "Bytes musi być między 0 a 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -663,6 +667,10 @@ msgstr "Wyświetlacz można obracać co 90 stopni" msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -674,7 +682,7 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -801,6 +809,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Operacja I2C nieobsługiwana" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -982,6 +995,10 @@ msgstr "Zły plik wave" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" @@ -1115,6 +1132,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1292,6 +1313,10 @@ msgstr "Obiekt tylko do odczytu" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Prawy kanał jest niewspierany" @@ -1355,6 +1380,10 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Podział z podgrupami" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1398bb266f..c5ef3b9c19 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -433,6 +433,10 @@ msgstr "buffers devem ser o mesmo tamanho" msgid "Bytes must be between 0 and 255." msgstr "Os bytes devem estar entre 0 e 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -667,6 +671,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -678,7 +686,7 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -807,6 +815,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "I2C operação não suportada" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -989,6 +1002,10 @@ msgstr "Aqruivo de ondas inválido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1122,6 +1139,10 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1304,6 +1325,10 @@ msgstr "Somente leitura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canal direito não suportado" @@ -1367,6 +1392,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index d9beb3f551..7c5f43e19d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 20:38-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -429,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -660,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -671,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -798,6 +806,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -977,6 +990,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1110,6 +1127,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" @@ -1287,6 +1308,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1350,6 +1375,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b56cc3ce52..51c59e7631 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-06 17:47+0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -438,6 +438,10 @@ msgstr "Zì jié huǎnchōng qū bìxū shì 16 zì jié." msgid "Bytes must be between 0 and 255." msgstr "Zì jié bìxū jiè yú 0 dào 255 zhī jiān." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()" @@ -671,6 +675,10 @@ msgstr "Xiǎnshì xuánzhuǎn bìxū 90 dù jiā xīn" msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +690,7 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -809,6 +817,11 @@ msgstr "I2C chūshǐhuà cuòwù" msgid "I2C operation not supported" msgstr "I2C cāozuò bù zhīchí" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -990,6 +1003,10 @@ msgstr "Wúxiào de làng làngcháo wénjiàn" msgid "Invalid word/bit length" msgstr "Wúxiào de zì/wèi chángdù" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" @@ -1123,6 +1140,10 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." @@ -1306,6 +1327,10 @@ msgstr "Zhǐ dú duìxiàng" msgid "Refresh too soon" msgstr "Shuāxīn tài kuàile" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Bù zhīchí yòu tōngdào" @@ -1369,6 +1394,10 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Yǔ zi bǔhuò fēnliè" From af55af216a3aadd78960f7c8e60bc51b49a13df1 Mon Sep 17 00:00:00 2001 From: spkuehl Date: Wed, 6 May 2020 14:11:11 -0500 Subject: [PATCH 410/919] Fix type in RTC documentation. --- shared-bindings/rtc/RTC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 3ff09a4ec5..07d170ee65 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -65,7 +65,7 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const //| import time //| //| r = rtc.RTC() -//| r.datetime = rtctime.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) +//| r.datetime = time.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) //| //| //| Once set, the RTC will automatically update this value as time passes. You can read this From 84c806a4bebb72b8deaae8cb5cada9d5ab7aa41b Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Thu, 7 May 2020 12:42:46 +1000 Subject: [PATCH 411/919] updated descriptions and build variable --- py/circuitpy_mpconfig.mk | 2 +- shared-bindings/countio/Counter.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index be1e0ad9af..95e3512f10 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -110,7 +110,7 @@ endif CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) ifndef CIRCUITPY_COUNTIO -CIRCUITPY_COUNTIO ?= 1 +CIRCUITPY_COUNTIO = 1 endif CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index efa3387a6f..1777acc8a2 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -11,15 +11,15 @@ //| .. currentmodule:: countio //| -//| :class:`Counter` -- Track the count of edge transistions (pulses) on a given pin +//| :class:`Counter` -- Track the count of falling edge transistions (pulses) on a given pin //| ==================================================================================== //| -//| Counter will keep track of the number of edge transistions (pulses) on a given pin +//| Counter will keep track of the number of falling edge transistions (pulses) on a given pin //| //| .. class:: Counter(pin_a) //| //| Create an Counter object associated with the given pin. It tracks the number of -//| pulses relative when the object is contructed. +//| falling pulses relative when the object is constructed. //| //| :param ~microcontroller.Pin pin_a: Pin to read pulses from. //| From 2ebe3035dff0ce66b2fe65eb91d6889c4ba93b5c Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 7 May 2020 10:54:09 -0400 Subject: [PATCH 412/919] Did board, digitalio, displayio --- shared-bindings/board/__init__.c | 33 ++-- shared-bindings/digitalio/DigitalInOut.c | 109 ++++++------ shared-bindings/digitalio/Direction.c | 25 ++- shared-bindings/digitalio/DriveMode.c | 27 ++- shared-bindings/digitalio/Pull.c | 29 ++- shared-bindings/digitalio/__init__.c | 4 +- shared-bindings/displayio/Bitmap.c | 65 ++++--- shared-bindings/displayio/ColorConverter.c | 31 ++-- shared-bindings/displayio/Display.c | 196 ++++++++++----------- shared-bindings/displayio/EPaperDisplay.c | 128 +++++++------- shared-bindings/displayio/FourWire.c | 57 +++--- shared-bindings/displayio/Group.c | 115 ++++++------ shared-bindings/displayio/I2CDisplay.c | 47 ++--- shared-bindings/displayio/OnDiskBitmap.c | 79 ++++----- shared-bindings/displayio/Palette.c | 58 +++--- shared-bindings/displayio/ParallelBus.c | 58 +++--- shared-bindings/displayio/Shape.c | 31 ++-- shared-bindings/displayio/TileGrid.c | 107 ++++++----- shared-bindings/displayio/__init__.c | 18 +- 19 files changed, 600 insertions(+), 617 deletions(-) diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 3dda59fb8e..501879be80 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -29,7 +29,7 @@ #include "shared-bindings/board/__init__.h" -//| :mod:`board` --- Board specific pin names +//| """:mod:`board` --- Board specific pin names //| ======================================================== //| //| .. module:: board @@ -39,11 +39,11 @@ //| board so don't expect portability when using this module. //| //| .. warning:: The board module varies by board. The APIs documented here may or may not be -//| available on a specific board. +//| available on a specific board.""" -//| .. function:: I2C() -//| -//| Returns the `busio.I2C` object for the board designated SDA and SCL pins. It is a singleton. +//| def I2C() -> Any: +//| """Returns the `busio.I2C` object for the board designated SDA and SCL pins. It is a singleton.""" +//| ... //| #if BOARD_I2C @@ -65,10 +65,10 @@ mp_obj_t board_i2c(void) { MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); -//| .. function:: SPI() -//| -//| Returns the `busio.SPI` object for the board designated SCK, MOSI and MISO pins. It is a -//| singleton. +//| def SPI() -> Any: +//| """Returns the `busio.SPI` object for the board designated SCK, MOSI and MISO pins. It is a +//| singleton.""" +//| ... //| #if BOARD_SPI mp_obj_t board_spi(void) { @@ -89,15 +89,14 @@ mp_obj_t board_spi(void) { #endif MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); -//| .. function:: UART() -//| -//| Returns the `busio.UART` object for the board designated TX and RX pins. It is a singleton. -//| -//| The object created uses the default parameter values for `busio.UART`. If you need to set -//| parameters that are not changeable after creation, such as ``receiver_buffer_size``, -//| do not use `board.UART()`; instead create a `busio.UART` object explicitly with the -//| desired parameters. +//| def UART() -> Any: +//| """Returns the `busio.UART` object for the board designated TX and RX pins. It is a singleton. //| +//| The object created uses the default parameter values for `busio.UART`. If you need to set +//| parameters that are not changeable after creation, such as ``receiver_buffer_size``, +//| do not use `board.UART()`; instead create a `busio.UART` object explicitly with the +//| desired parameters.""" +//| ... //| #if BOARD_UART mp_obj_t board_uart(void) { diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 39da00cf71..5fffb3f653 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -43,23 +43,23 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: digitalio +//| class DigitalInOut: +//| """.. currentmodule:: digitalio //| -//| :class:`DigitalInOut` -- digital input and output -//| ========================================================= +//| :class:`DigitalInOut` -- digital input and output +//| ========================================================= //| -//| A DigitalInOut is used to digitally control I/O pins. For analog control of -//| a pin, see the :py:class:`analogio.AnalogIn` and -//| :py:class:`analogio.AnalogOut` classes. +//| A DigitalInOut is used to digitally control I/O pins. For analog control of +//| a pin, see the :py:class:`analogio.AnalogIn` and +//| :py:class:`analogio.AnalogOut` classes.""" //| - -//| .. class:: DigitalInOut(pin) +//| def __init__(self, pin: microcontroller.Pin): +//| """Create a new DigitalInOut object associated with the pin. Defaults to input +//| with no pull. Use :py:meth:`switch_to_input` and +//| :py:meth:`switch_to_output` to change the direction. //| -//| Create a new DigitalInOut object associated with the pin. Defaults to input -//| with no pull. Use :py:meth:`switch_to_input` and -//| :py:meth:`switch_to_output` to change the direction. -//| -//| :param ~microcontroller.Pin pin: The pin to control +//| :param ~microcontroller.Pin pin: The pin to control""" +//| ... //| STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -74,9 +74,9 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Turn off the DigitalInOut and release the pin for other use. +//| def deinit(self, ) -> Any: +//| """Turn off the DigitalInOut and release the pin for other use.""" +//| ... //| STATIC mp_obj_t digitalio_digitalinout_obj_deinit(mp_obj_t self_in) { digitalio_digitalinout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -85,16 +85,16 @@ STATIC mp_obj_t digitalio_digitalinout_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(digitalio_digitalinout_deinit_obj, digitalio_digitalinout_obj_deinit); -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t digitalio_digitalinout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -109,14 +109,13 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { } } +//| def switch_to_output(self, value: bool = False, drive_mode: digitalio.DriveMode = digitalio.DriveMode.PUSH_PULL) -> Any: +//| """Set the drive mode and value and then switch to writing out digital +//| values. //| -//| .. method:: switch_to_output(value=False, drive_mode=digitalio.DriveMode.PUSH_PULL) -//| -//| Set the drive mode and value and then switch to writing out digital -//| values. -//| -//| :param bool value: default value to set upon switching -//| :param ~digitalio.DriveMode drive_mode: drive mode for the output +//| :param bool value: default value to set upon switching +//| :param ~digitalio.DriveMode drive_mode: drive mode for the output""" +//| ... //| STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_value, ARG_drive_mode }; @@ -139,22 +138,22 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_output_obj, 1, digitalio_digitalinout_switch_to_output); -//| .. method:: switch_to_input(pull=None) +//| def switch_to_input(self, pull: Pull = None) -> Any: +//| """Set the pull and then switch to read in digital values. //| -//| Set the pull and then switch to read in digital values. +//| :param Pull pull: pull configuration for the input //| -//| :param Pull pull: pull configuration for the input +//| Example usage:: //| -//| Example usage:: +//| import digitalio +//| import board //| -//| import digitalio -//| import board -//| -//| switch = digitalio.DigitalInOut(board.SLIDE_SWITCH) -//| switch.switch_to_input(pull=digitalio.Pull.UP) -//| # Or, after switch_to_input -//| switch.pull = digitalio.Pull.UP -//| print(switch.value) +//| switch = digitalio.DigitalInOut(board.SLIDE_SWITCH) +//| switch.switch_to_input(pull=digitalio.Pull.UP) +//| # Or, after switch_to_input +//| switch.pull = digitalio.Pull.UP +//| print(switch.value)""" +//| ... //| STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pull }; @@ -178,14 +177,13 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_o } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_input_obj, 1, digitalio_digitalinout_switch_to_input); -//| .. attribute:: direction -//| -//| The direction of the pin. +//| direction: Any = ... +//| """The direction of the pin. //| //| Setting this will use the defaults from the corresponding //| :py:meth:`switch_to_input` or :py:meth:`switch_to_output` method. If //| you want to set pull, value or drive mode prior to switching, then use -//| those methods instead. +//| those methods instead.""" //| typedef struct { mp_obj_base_t base; @@ -225,9 +223,8 @@ const mp_obj_property_t digitalio_digitalio_direction_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: value -//| -//| The digital logic level of the pin. +//| value: Any = ... +//| """The digital logic level of the pin.""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_value(mp_obj_t self_in) { digitalio_digitalinout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -256,12 +253,11 @@ const mp_obj_property_t digitalio_digitalinout_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: drive_mode -//| -//| The pin drive mode. One of: +//| drive_mode: Any = ... +//| """The pin drive mode. One of: //| //| - `digitalio.DriveMode.PUSH_PULL` -//| - `digitalio.DriveMode.OPEN_DRAIN` +//| - `digitalio.DriveMode.OPEN_DRAIN`""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_drive_mode(mp_obj_t self_in) { digitalio_digitalinout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -301,15 +297,14 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: pull -//| -//| The pin pull direction. One of: +//| pull: Any = ... +//| """The pin pull direction. One of: //| //| - `digitalio.Pull.UP` //| - `digitalio.Pull.DOWN` //| - `None` //| -//| :raises AttributeError: if `direction` is :py:data:`~digitalio.Direction.OUTPUT`. +//| :raises AttributeError: if `direction` is :py:data:`~digitalio.Direction.OUTPUT`.""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_pull(mp_obj_t self_in) { digitalio_digitalinout_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index c8188fc899..0586e95def 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -38,23 +38,22 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -//| .. currentmodule:: digitalio +//| class Direction: +//| """.. currentmodule:: digitalio //| -//| :class:`Direction` -- defines the direction of a digital pin -//| ============================================================= +//| :class:`Direction` -- defines the direction of a digital pin +//| =============================================================""" //| -//| .. class:: Direction +//| def __init__(self, ): +//| """Enum-like class to define which direction the digital values are +//| going.""" +//| ... //| -//| Enum-like class to define which direction the digital values are -//| going. +//| INPUT: Any = ... +//| """Read digital data in""" //| -//| .. data:: INPUT -//| -//| Read digital data in -//| -//| .. data:: OUTPUT -//| -//| Write digital data out +//| OUTPUT: Any = ... +//| """Write digital data out""" //| const mp_obj_type_t digitalio_direction_type; diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index 51e1e2ee50..23745b0469 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -26,24 +26,23 @@ #include "shared-bindings/digitalio/DriveMode.h" -//| .. currentmodule:: digitalio +//| class DriveMode: +//| """.. currentmodule:: digitalio //| -//| :class:`DriveMode` -- defines the drive mode of a digital pin -//| ============================================================= +//| :class:`DriveMode` -- defines the drive mode of a digital pin +//| =============================================================""" //| -//| .. class:: DriveMode +//| def __init__(self, ): +//| """Enum-like class to define the drive mode used when outputting +//| digital values.""" +//| ... //| -//| Enum-like class to define the drive mode used when outputting -//| digital values. +//| PUSH_PULL: Any = ... +//| """Output both high and low digital values""" //| -//| .. data:: PUSH_PULL -//| -//| Output both high and low digital values -//| -//| .. data:: OPEN_DRAIN -//| -//| Output low digital values but go into high z for digital high. This is -//| useful for i2c and other protocols that share a digital line. +//| OPEN_DRAIN: Any = ... +//| """Output low digital values but go into high z for digital high. This is +//| useful for i2c and other protocols that share a digital line.""" //| const mp_obj_type_t digitalio_drive_mode_type; diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 813268db78..1e64d07887 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -26,25 +26,24 @@ #include "shared-bindings/digitalio/Pull.h" -//| .. currentmodule:: digitalio +//| class Pull: +//| """.. currentmodule:: digitalio //| -//| :class:`Pull` -- defines the pull of a digital input pin -//| ============================================================= +//| :class:`Pull` -- defines the pull of a digital input pin +//| =============================================================""" //| -//| .. class:: Pull +//| def __init__(self, ): +//| """Enum-like class to define the pull value, if any, used while reading +//| digital values in.""" +//| ... //| -//| Enum-like class to define the pull value, if any, used while reading -//| digital values in. +//| UP: Any = ... +//| """When the input line isn't being driven the pull up can pull the state +//| of the line high so it reads as true.""" //| -//| .. data:: UP -//| -//| When the input line isn't being driven the pull up can pull the state -//| of the line high so it reads as true. -//| -//| .. data:: DOWN -//| -//| When the input line isn't being driven the pull down can pull the -//| state of the line low so it reads as false. +//| DOWN: Any = ... +//| """When the input line isn't being driven the pull down can pull the +//| state of the line low so it reads as false.""" //| const mp_obj_type_t digitalio_pull_type; diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index 1632262d2a..5a11436a23 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -38,7 +38,7 @@ #include "py/runtime.h" -//| :mod:`digitalio` --- Basic digital pin support +//| """:mod:`digitalio` --- Basic digital pin support //| ================================================= //| //| .. module:: digitalio @@ -86,7 +86,7 @@ //| led.value = True //| time.sleep(0.1) //| led.value = False -//| time.sleep(0.1) +//| time.sleep(0.1)""" //| STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 391f3e5955..d15c3b1078 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -36,22 +36,23 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class Bitmap: +//| """.. currentmodule:: displayio //| -//| :class:`Bitmap` -- Stores values in a 2D array -//| ========================================================================== +//| :class:`Bitmap` -- Stores values in a 2D array +//| ========================================================================== //| -//| Stores values of a certain size in a 2D array +//| Stores values of a certain size in a 2D array""" //| -//| .. class:: Bitmap(width, height, value_count) +//| def __init__(self, width: int, height: int, value_count: int): +//| """Create a Bitmap object with the given fixed size. Each pixel stores a value that is used to +//| index into a corresponding palette. This enables differently colored sprites to share the +//| underlying Bitmap. value_count is used to minimize the memory used to store the Bitmap. //| -//| Create a Bitmap object with the given fixed size. Each pixel stores a value that is used to -//| index into a corresponding palette. This enables differently colored sprites to share the -//| underlying Bitmap. value_count is used to minimize the memory used to store the Bitmap. -//| -//| :param int width: The number of values wide -//| :param int height: The number of values high -//| :param int value_count: The number of possible pixel values. +//| :param int width: The number of values wide +//| :param int height: The number of values high +//| :param int value_count: The number of possible pixel values.""" +//| ... //| STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 3, 3, false); @@ -77,9 +78,8 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. attribute:: width -//| -//| Width of the bitmap. (read only) +//| width: Any = ... +//| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); @@ -96,9 +96,8 @@ const mp_obj_property_t displayio_bitmap_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: height -//| -//| Height of the bitmap. (read only) +//| height: Any = ... +//| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); @@ -115,23 +114,23 @@ const mp_obj_property_t displayio_bitmap_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: __getitem__(index) +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the value at the given index. The index can either be an x,y tuple or an int equal +//| to ``y * width + x``. //| -//| Returns the value at the given index. The index can either be an x,y tuple or an int equal -//| to ``y * width + x``. +//| This allows you to:: //| -//| This allows you to:: +//| print(bitmap[0,1])""" +//| ... //| -//| print(bitmap[0,1]) +//| def __setitem__(self, index: Any, value: Any) -> Any: +//| """Sets the value at the given index. The index can either be an x,y tuple or an int equal +//| to ``y * width + x``. //| -//| .. method:: __setitem__(index, value) +//| This allows you to:: //| -//| Sets the value at the given index. The index can either be an x,y tuple or an int equal -//| to ``y * width + x``. -//| -//| This allows you to:: -//| -//| bitmap[0,1] = 3 +//| bitmap[0,1] = 3""" +//| ... //| STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value_obj) { if (value_obj == mp_const_none) { @@ -178,9 +177,9 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val return mp_const_none; } -//| .. method:: fill(value) -//| -//| Fills the bitmap with the supplied palette index value. +//| def fill(self, value: Any) -> Any: +//| """Fills the bitmap with the supplied palette index value.""" +//| ... //| STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index db2d1b6e29..1d6e5a0cc9 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -36,18 +36,20 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class ColorConverter: +//| """.. currentmodule:: displayio //| -//| :class:`ColorConverter` -- Converts one color format to another -//| ========================================================================================= +//| :class:`ColorConverter` -- Converts one color format to another +//| ========================================================================================= //| -//| Converts one color format to another. +//| Converts one color format to another.""" //| -//| .. class:: ColorConverter(*, dither=False) +//| def __init__(self, *, dither: bool = False): +//| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 +//| currently. +//| :param bool dither: Adds random noise to dither the output image""" +//| ... //| -//| Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 -//| currently. -//| :param bool dither: Adds random noise to dither the output image // TODO(tannewt): Add support for other color formats. //| @@ -68,9 +70,9 @@ STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, siz return MP_OBJ_FROM_PTR(self); } -//| .. method:: convert(color) -//| -//| Converts the given RGB888 color to RGB565 +//| def convert(self, color: Any) -> Any: +//| """Converts the given RGB888 color to RGB565""" +//| ... //| STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); @@ -87,10 +89,9 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert); -//| .. attribute:: dither -//| -//| When true the color converter dithers the output by adding random noise when -//| truncating to display bitdepth +//| dither: Any = ... +//| """When true the color converter dithers the output by adding random noise when +//| truncating to display bitdepth""" //| STATIC mp_obj_t displayio_colorconverter_obj_get_dither(mp_obj_t self_in) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index a22b2add22..12abec1c83 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -39,73 +39,74 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class Display: +//| """.. currentmodule:: displayio //| -//| :class:`Display` -- Manage updating a display over a display bus -//| ========================================================================== +//| :class:`Display` -- Manage updating a display over a display bus +//| ========================================================================== //| -//| This initializes a display and connects it into CircuitPython. Unlike other -//| objects in CircuitPython, Display objects live until `displayio.release_displays()` -//| is called. This is done so that CircuitPython can use the display itself. +//| This initializes a display and connects it into CircuitPython. Unlike other +//| objects in CircuitPython, Display objects live until `displayio.release_displays()` +//| is called. This is done so that CircuitPython can use the display itself. //| -//| Most people should not use this class directly. Use a specific display driver instead that will -//| contain the initialization sequence at minimum. +//| Most people should not use this class directly. Use a specific display driver instead that will +//| contain the initialization sequence at minimum.""" //| -//| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, grayscale=False, pixels_in_byte_share_row=True, bytes_per_cell=1, reverse_pixels_in_byte=False, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, brightness_command=None, brightness=1.0, auto_brightness=False, single_byte_bounds=False, data_as_commands=False, auto_refresh=True, native_frames_per_second=60) +//| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): +//| """Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| -//| Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a +//| command byte followed by a byte to determine the parameter count and if a delay is need after. +//| When the top bit of the second byte is 1, the next byte will be the delay time in milliseconds. +//| The remaining 7 bits are the parameter count excluding any delay byte. The third through final +//| bytes are the remaining command parameters. The next byte will begin a new command definition. +//| Here is a portion of ILI9341 init code: //| -//| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a -//| command byte followed by a byte to determine the parameter count and if a delay is need after. -//| When the top bit of the second byte is 1, the next byte will be the delay time in milliseconds. -//| The remaining 7 bits are the parameter count excluding any delay byte. The third through final -//| bytes are the remaining command parameters. The next byte will begin a new command definition. -//| Here is a portion of ILI9341 init code: +//| .. code-block:: python //| -//| .. code-block:: python +//| init_sequence = (b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma +//| b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms) +//| b"\x29\x80\x78"# Display on then delay 0x78 (120ms) +//| ) +//| display = displayio.Display(display_bus, init_sequence, width=320, height=240) //| -//| init_sequence = (b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma -//| b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms) -//| b"\x29\x80\x78"# Display on then delay 0x78 (120ms) -//| ) -//| display = displayio.Display(display_bus, init_sequence, width=320, height=240) +//| The first command is 0xe1 with 15 (0xf) parameters following. The second and third are 0x11 and +//| 0x29 respectively with delays (0x80) of 120ms (0x78) and no parameters. Multiple byte literals +//| (b"") are merged together on load. The parens are needed to allow byte literals on subsequent +//| lines. //| -//| The first command is 0xe1 with 15 (0xf) parameters following. The second and third are 0x11 and -//| 0x29 respectively with delays (0x80) of 120ms (0x78) and no parameters. Multiple byte literals -//| (b"") are merged together on load. The parens are needed to allow byte literals on subsequent -//| lines. +//| The initialization sequence should always leave the display memory access inline with the scan +//| of the display to minimize tearing artifacts. //| -//| The initialization sequence should always leave the display memory access inline with the scan -//| of the display to minimize tearing artifacts. -//| -//| :param display_bus: The bus that the display is connected to -//| :type display_bus: displayio.FourWire or displayio.ParallelBus -//| :param buffer init_sequence: Byte-packed initialization sequence. -//| :param int width: Width in pixels -//| :param int height: Height in pixels -//| :param int colstart: The index if the first visible column -//| :param int rowstart: The index if the first visible row -//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) -//| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays -//| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.) -//| :param bool grayscale: True if the display only shows a single color. -//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. -//| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. -//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) -//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 -//| :param int set_column_command: Command used to set the start and end columns to update -//| :param int set_row_command: Command used so set the start and end rows to update -//| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. -//| :param int set_vertical_scroll: Command used to set the first row to show -//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight -//| :param int brightness_command: Command to set display brightness. Usually available in OLED controllers. -//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. -//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. -//| :param bool single_byte_bounds: Display column and row commands use single bytes -//| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. -//| :param bool auto_refresh: Automatically refresh the screen -//| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. -//| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. +//| :param display_bus: The bus that the display is connected to +//| :type display_bus: displayio.FourWire or displayio.ParallelBus +//| :param buffer init_sequence: Byte-packed initialization sequence. +//| :param int width: Width in pixels +//| :param int height: Height in pixels +//| :param int colstart: The index if the first visible column +//| :param int rowstart: The index if the first visible row +//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) +//| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays +//| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.) +//| :param bool grayscale: True if the display only shows a single color. +//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column. +//| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row. +//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.) +//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16 +//| :param int set_column_command: Command used to set the start and end columns to update +//| :param int set_row_command: Command used so set the start and end rows to update +//| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. +//| :param int set_vertical_scroll: Command used to set the first row to show +//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight +//| :param int brightness_command: Command to set display brightness. Usually available in OLED controllers. +//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True. +//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. +//| :param bool single_byte_bounds: Display column and row commands use single bytes +//| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. +//| :param bool auto_refresh: Automatically refresh the screen +//| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. +//| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on.""" +//| ... //| STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high }; @@ -190,12 +191,13 @@ static displayio_display_obj_t* native_display(mp_obj_t display_obj) { return MP_OBJ_TO_PTR(native_display); } -//| .. method:: show(group) +//| def show(self, group: Group) -> Any: +//| """Switches to displaying the given group of layers. When group is None, the default +//| CircuitPython terminal will be shown. //| -//| Switches to displaying the given group of layers. When group is None, the default -//| CircuitPython terminal will be shown. +//| :param Group group: The group to show.""" +//| ... //| -//| :param Group group: The group to show. STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) { displayio_display_obj_t *self = native_display(self_in); displayio_group_t* group = NULL; @@ -211,21 +213,21 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show); -//| .. method:: refresh(*, target_frames_per_second=60, minimum_frames_per_second=1) +//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> Any: +//| """When auto refresh is off, waits for the target frame rate and then refreshes the display, +//| returning True. If the call has taken too long since the last refresh call for the given +//| target frame rate, then the refresh returns False immediately without updating the screen to +//| hopefully help getting caught up. //| -//| When auto refresh is off, waits for the target frame rate and then refreshes the display, -//| returning True. If the call has taken too long since the last refresh call for the given -//| target frame rate, then the refresh returns False immediately without updating the screen to -//| hopefully help getting caught up. +//| If the time since the last successful refresh is below the minimum frame rate, then an +//| exception will be raised. Set minimum_frames_per_second to 0 to disable. //| -//| If the time since the last successful refresh is below the minimum frame rate, then an -//| exception will be raised. Set minimum_frames_per_second to 0 to disable. +//| When auto refresh is on, updates the display immediately. (The display will also update +//| without calls to this.) //| -//| When auto refresh is on, updates the display immediately. (The display will also update -//| without calls to this.) -//| -//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second. +//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. +//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" +//| ... //| STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; @@ -246,9 +248,8 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_display_refresh_obj, 1, displayio_display_obj_refresh); -//| .. attribute:: auto_refresh -//| -//| True when the display is refreshed automatically. +//| auto_refresh: Any = ... +//| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t displayio_display_obj_get_auto_refresh(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -272,11 +273,10 @@ const mp_obj_property_t displayio_display_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: brightness -//| -//| The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When +//| brightness: Any = ... +//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. -//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False. +//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" //| STATIC mp_obj_t displayio_display_obj_get_brightness(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -310,12 +310,11 @@ const mp_obj_property_t displayio_display_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: auto_brightness -//| -//| True when the display brightness is adjusted automatically, based on an ambient +//| auto_brightness: Any = ... +//| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False -//| if `brightness` is set manually. +//| if `brightness` is set manually.""" //| STATIC mp_obj_t displayio_display_obj_get_auto_brightness(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -342,9 +341,8 @@ const mp_obj_property_t displayio_display_auto_brightness_obj = { -//| .. attribute:: width -//| -//| Gets the width of the board +//| width: Any = ... +//| Gets the width of the board //| //| STATIC mp_obj_t displayio_display_obj_get_width(mp_obj_t self_in) { @@ -360,9 +358,8 @@ const mp_obj_property_t displayio_display_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: height -//| -//| Gets the height of the board +//| height: Any = ... +//| """Gets the height of the board""" //| //| STATIC mp_obj_t displayio_display_obj_get_height(mp_obj_t self_in) { @@ -378,9 +375,8 @@ const mp_obj_property_t displayio_display_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: rotation -//| -//| The rotation of the display as an int in degrees. +//| rotation: Any = ... +//| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -402,9 +398,8 @@ const mp_obj_property_t displayio_display_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: bus -//| -//| The bus being used by the display +//| bus: Any = ... +//| """The bus being used by the display""" //| //| STATIC mp_obj_t displayio_display_obj_get_bus(mp_obj_t self_in) { @@ -421,12 +416,13 @@ const mp_obj_property_t displayio_display_bus_obj = { }; -//| .. method:: fill_row(y, buffer) +//| def fill_row(self, y: int, buffer: bytearray) -> Any: +//| """Extract the pixels from a single row //| -//| Extract the pixels from a single row +//| :param int y: The top edge of the area +//| :param bytearray buffer: The buffer in which to place the pixel data""" +//| ... //| -//| :param int y: The top edge of the area -//| :param bytearray buffer: The buffer in which to place the pixel data STATIC mp_obj_t displayio_display_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_y, ARG_buffer }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 1459c16809..8b03ddc067 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -39,55 +39,56 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class EPaperDisplay: +//| """.. currentmodule:: displayio //| -//| :class:`EPaperDisplay` -- Manage updating an epaper display over a display bus -//| ============================================================================== +//| :class:`EPaperDisplay` -- Manage updating an epaper display over a display bus +//| ============================================================================== //| -//| This initializes an epaper display and connects it into CircuitPython. Unlike other -//| objects in CircuitPython, EPaperDisplay objects live until `displayio.release_displays()` -//| is called. This is done so that CircuitPython can use the display itself. +//| This initializes an epaper display and connects it into CircuitPython. Unlike other +//| objects in CircuitPython, EPaperDisplay objects live until `displayio.release_displays()` +//| is called. This is done so that CircuitPython can use the display itself. //| -//| Most people should not use this class directly. Use a specific display driver instead that will -//| contain the startup and shutdown sequences at minimum. +//| Most people should not use this class directly. Use a specific display driver instead that will +//| contain the startup and shutdown sequences at minimum.""" //| -//| .. class:: EPaperDisplay(display_bus, start_sequence, stop_sequence, *, width, height, ram_width, ram_height, colstart=0, rowstart=0, rotation=0, set_column_window_command=None, set_row_window_command=None, single_byte_bounds=False, write_black_ram_command, black_bits_inverted=False, write_color_ram_command=None, color_bits_inverted=False, highlight_color=0x000000, refresh_display_command, refresh_time=40, busy_pin=None, busy_state=True, seconds_per_frame=180, always_toggle_chip_select=False) +//| def __init__(self, display_bus: Any, start_sequence: buffer, stop_sequence: buffer, *, width: int, height: int, ram_width: int, ram_height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, set_column_window_command: int = None, set_row_window_command: int = None, single_byte_bounds: Any = False, write_black_ram_command: int, black_bits_inverted: bool = False, write_color_ram_command: int = None, color_bits_inverted: bool = False, highlight_color: int = 0x000000, refresh_display_command: int, refresh_time: float = 40, busy_pin: microcontroller.Pin = None, busy_state: bool = True, seconds_per_frame: float = 180, always_toggle_chip_select: bool = False): +//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| -//| Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every +//| command begins with a command byte followed by a byte to determine the parameter count and if +//| a delay is need after. When the top bit of the second byte is 1, the next byte will be the +//| delay time in milliseconds. The remaining 7 bits are the parameter count excluding any delay +//| byte. The third through final bytes are the remaining command parameters. The next byte will +//| begin a new command definition. //| -//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every -//| command begins with a command byte followed by a byte to determine the parameter count and if -//| a delay is need after. When the top bit of the second byte is 1, the next byte will be the -//| delay time in milliseconds. The remaining 7 bits are the parameter count excluding any delay -//| byte. The third through final bytes are the remaining command parameters. The next byte will -//| begin a new command definition. -//| -//| :param display_bus: The bus that the display is connected to -//| :type display_bus: displayio.FourWire or displayio.ParallelBus -//| :param buffer start_sequence: Byte-packed initialization sequence. -//| :param buffer stop_sequence: Byte-packed initialization sequence. -//| :param int width: Width in pixels -//| :param int height: Height in pixels -//| :param int ram_width: RAM width in pixels -//| :param int ram_height: RAM height in pixels -//| :param int colstart: The index if the first visible column -//| :param int rowstart: The index if the first visible row -//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) -//| :param int set_column_window_command: Command used to set the start and end columns to update -//| :param int set_row_window_command: Command used so set the start and end rows to update -//| :param int set_current_column_command: Command used to set the current column location -//| :param int set_current_row_command: Command used to set the current row location -//| :param int write_black_ram_command: Command used to write pixels values into the update region -//| :param bool black_bits_inverted: True if 0 bits are used to show black pixels. Otherwise, 1 means to show black. -//| :param int write_color_ram_command: Command used to write pixels values into the update region -//| :param bool color_bits_inverted: True if 0 bits are used to show the color. Otherwise, 1 means to show color. -//| :param int highlight_color: RGB888 of source color to highlight with third ePaper color. -//| :param int refresh_display_command: Command used to start a display refresh -//| :param float refresh_time: Time it takes to refresh the display before the stop_sequence should be sent. Ignored when busy_pin is provided. -//| :param microcontroller.Pin busy_pin: Pin used to signify the display is busy -//| :param bool busy_state: State of the busy pin when the display is busy -//| :param float seconds_per_frame: Minimum number of seconds between screen refreshes -//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte +//| :param display_bus: The bus that the display is connected to +//| :type display_bus: displayio.FourWire or displayio.ParallelBus +//| :param buffer start_sequence: Byte-packed initialization sequence. +//| :param buffer stop_sequence: Byte-packed initialization sequence. +//| :param int width: Width in pixels +//| :param int height: Height in pixels +//| :param int ram_width: RAM width in pixels +//| :param int ram_height: RAM height in pixels +//| :param int colstart: The index if the first visible column +//| :param int rowstart: The index if the first visible row +//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) +//| :param int set_column_window_command: Command used to set the start and end columns to update +//| :param int set_row_window_command: Command used so set the start and end rows to update +//| :param int set_current_column_command: Command used to set the current column location +//| :param int set_current_row_command: Command used to set the current row location +//| :param int write_black_ram_command: Command used to write pixels values into the update region +//| :param bool black_bits_inverted: True if 0 bits are used to show black pixels. Otherwise, 1 means to show black. +//| :param int write_color_ram_command: Command used to write pixels values into the update region +//| :param bool color_bits_inverted: True if 0 bits are used to show the color. Otherwise, 1 means to show color. +//| :param int highlight_color: RGB888 of source color to highlight with third ePaper color. +//| :param int refresh_display_command: Command used to start a display refresh +//| :param float refresh_time: Time it takes to refresh the display before the stop_sequence should be sent. Ignored when busy_pin is provided. +//| :param microcontroller.Pin busy_pin: Pin used to signify the display is busy +//| :param bool busy_state: State of the busy pin when the display is busy +//| :param float seconds_per_frame: Minimum number of seconds between screen refreshes +//| :param bool always_toggle_chip_select: When True, chip select is toggled every byte""" +//| ... //| STATIC mp_obj_t displayio_epaperdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_display_bus, ARG_start_sequence, ARG_stop_sequence, ARG_width, ARG_height, ARG_ram_width, ARG_ram_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_set_column_window_command, ARG_set_row_window_command, ARG_set_current_column_command, ARG_set_current_row_command, ARG_write_black_ram_command, ARG_black_bits_inverted, ARG_write_color_ram_command, ARG_color_bits_inverted, ARG_highlight_color, ARG_refresh_display_command, ARG_refresh_time, ARG_busy_pin, ARG_busy_state, ARG_seconds_per_frame, ARG_always_toggle_chip_select }; @@ -170,12 +171,13 @@ static displayio_epaperdisplay_obj_t* native_display(mp_obj_t display_obj) { return MP_OBJ_TO_PTR(native_display); } -//| .. method:: show(group) +//| def show(self, group: Group) -> Any: +//| """Switches to displaying the given group of layers. When group is None, the default +//| CircuitPython terminal will be shown. //| -//| Switches to displaying the given group of layers. When group is None, the default -//| CircuitPython terminal will be shown. +//| :param Group group: The group to show.""" +//| ... //| -//| :param Group group: The group to show. STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t group_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); displayio_group_t* group = NULL; @@ -191,10 +193,10 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t grou } MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show); -//| .. method:: refresh() -//| -//| Refreshes the display immediately or raises an exception if too soon. Use -//| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur. +//| def refresh(self, ) -> Any: +//| """Refreshes the display immediately or raises an exception if too soon. Use +//| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.""" +//| ... //| STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); @@ -206,10 +208,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_refresh_obj, displayio_epaperdisplay_obj_refresh); -//| .. attribute:: time_to_refresh -//| -//| Time, in fractional seconds, until the ePaper display can be refreshed. -//| +//| time_to_refresh: Any = ... +//| """Time, in fractional seconds, until the ePaper display can be refreshed.""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); @@ -224,10 +224,8 @@ const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: width -//| -//| Gets the width of the display in pixels -//| +//| width: Any = ... +//| """Gets the width of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_width(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); @@ -242,10 +240,8 @@ const mp_obj_property_t displayio_epaperdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: height -//| -//| Gets the height of the display in pixels -//| +//| height: Any = ... +//| """Gets the height of the display in pixels""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); @@ -260,10 +256,8 @@ const mp_obj_property_t displayio_epaperdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: bus -//| -//| The bus being used by the display -//| +//| bus: Any = ... +//| """The bus being used by the display""" //| STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) { displayio_epaperdisplay_obj_t *self = native_display(self_in); diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 6ad1624114..649045039e 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -38,31 +38,32 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class FourWire: +//| """.. currentmodule:: displayio //| -//| :class:`FourWire` -- Manage updating a display over SPI four wire protocol -//| ========================================================================== +//| :class:`FourWire` -- Manage updating a display over SPI four wire protocol +//| ========================================================================== //| -//| Manage updating a display over SPI four wire protocol in the background while Python code runs. -//| It doesn't handle display initialization. +//| Manage updating a display over SPI four wire protocol in the background while Python code runs. +//| It doesn't handle display initialization.""" //| -//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None, baudrate=24000000, polarity=0, phase=0) +//| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0): +//| """Create a FourWire object associated with the given pins. //| -//| Create a FourWire object associated with the given pins. +//| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is +//| called even after a reload. (It does this so CircuitPython can use the display after your code +//| is done.) So, the first time you initialize a display bus in code.py you should call +//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. //| -//| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is -//| called even after a reload. (It does this so CircuitPython can use the display after your code -//| is done.) So, the first time you initialize a display bus in code.py you should call -//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. -//| -//| :param busio.SPI spi_bus: The SPI bus that make up the clock and data lines -//| :param microcontroller.Pin command: Data or command pin -//| :param microcontroller.Pin chip_select: Chip select pin -//| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used -//| :param int baudrate: Maximum baudrate in Hz for the display on the bus -//| :param int polarity: the base state of the clock line (0 or 1) -//| :param int phase: the edge of the clock that data is captured. First (0) -//| or second (1). Rising or falling depends on clock polarity. +//| :param busio.SPI spi_bus: The SPI bus that make up the clock and data lines +//| :param microcontroller.Pin command: Data or command pin +//| :param microcontroller.Pin chip_select: Chip select pin +//| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used +//| :param int baudrate: Maximum baudrate in Hz for the display on the bus +//| :param int polarity: the base state of the clock line (0 or 1) +//| :param int phase: the edge of the clock that data is captured. First (0) +//| or second (1). Rising or falling depends on clock polarity.""" +//| ... //| STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset, ARG_baudrate, ARG_polarity, ARG_phase }; @@ -100,10 +101,10 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ return self; } -//| .. method:: reset() -//| -//| Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin -//| is available. +//| def reset(self, ) -> Any: +//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin +//| is available.""" +//| ... //| STATIC mp_obj_t displayio_fourwire_obj_reset(mp_obj_t self_in) { displayio_fourwire_obj_t *self = self_in; @@ -115,10 +116,10 @@ STATIC mp_obj_t displayio_fourwire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_fourwire_reset_obj, displayio_fourwire_obj_reset); -//| .. method:: send(command, data, *, toggle_every_byte=False) -//| -//| Sends the given command value followed by the full set of data. Display state, such as -//| vertical scroll, set via ``send`` may or may not be reset once the code is done. +//| def send(self, command: Any, data: Any, *, toggle_every_byte: Any = False) -> Any: +//| """Sends the given command value followed by the full set of data. Display state, such as +//| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" +//| ... //| STATIC mp_obj_t displayio_fourwire_obj_send(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_command, ARG_data, ARG_toggle_every_byte }; diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index dd7600eb9c..36e137dc9b 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -35,22 +35,23 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class Group: +//| """.. currentmodule:: displayio //| -//| :class:`Group` -- Group together sprites and subgroups -//| ========================================================================== +//| :class:`Group` -- Group together sprites and subgroups +//| ========================================================================== //| -//| Manage a group of sprites and groups and how they are inter-related. +//| Manage a group of sprites and groups and how they are inter-related.""" //| -//| .. class:: Group(*, max_size=4, scale=1, x=0, y=0) +//| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0): +//| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 +//| leads to a layer's pixel being 2x2 pixels when in the group. //| -//| Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 -//| leads to a layer's pixel being 2x2 pixels when in the group. -//| -//| :param int max_size: The maximum group size. -//| :param int scale: Scale of layer pixels in one dimension. -//| :param int x: Initial x position within the parent. -//| :param int y: Initial y position within the parent. +//| :param int max_size: The maximum group size. +//| :param int scale: Scale of layer pixels in one dimension. +//| :param int x: Initial x position within the parent. +//| :param int y: Initial y position within the parent.""" +//| ... //| STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_max_size, ARG_scale, ARG_x, ARG_y }; @@ -90,10 +91,9 @@ displayio_group_t* native_group(mp_obj_t group_obj) { return MP_OBJ_TO_PTR(native_group); } -//| .. attribute:: hidden -//| -//| True when the Group and all of it's layers are not visible. When False, the Group's layers -//| are visible if they haven't been hidden. +//| hidden: Any = ... +//| """True when the Group and all of it's layers are not visible. When False, the Group's layers +//| are visible if they haven't been hidden.""" //| STATIC mp_obj_t displayio_group_obj_get_hidden(mp_obj_t self_in) { displayio_group_t *self = native_group(self_in); @@ -116,10 +116,9 @@ const mp_obj_property_t displayio_group_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: scale -//| -//| Scales each pixel within the Group in both directions. For example, when scale=2 each pixel -//| will be represented by 2x2 pixels. +//| scale: Any = ... +//| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel +//| will be represented by 2x2 pixels.""" //| STATIC mp_obj_t displayio_group_obj_get_scale(mp_obj_t self_in) { displayio_group_t *self = native_group(self_in); @@ -146,9 +145,8 @@ const mp_obj_property_t displayio_group_scale_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: x -//| -//| X position of the Group in the parent. +//| x: Any = ... +//| """X position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_x(mp_obj_t self_in) { displayio_group_t *self = native_group(self_in); @@ -172,9 +170,8 @@ const mp_obj_property_t displayio_group_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: y -//| -//| Y position of the Group in the parent. +//| y: Any = ... +//| """Y position of the Group in the parent.""" //| STATIC mp_obj_t displayio_group_obj_get_y(mp_obj_t self_in) { displayio_group_t *self = native_group(self_in); @@ -198,9 +195,9 @@ const mp_obj_property_t displayio_group_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: append(layer) -//| -//| Append a layer to the group. It will be drawn above other layers. +//| def append(self, layer: Any) -> Any: +//| """Append a layer to the group. It will be drawn above other layers.""" +//| ... //| STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { displayio_group_t *self = native_group(self_in); @@ -209,9 +206,9 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); -//| .. method:: insert(index, layer) -//| -//| Insert a layer into the group. +//| def insert(self, index: Any, layer: Any) -> Any: +//| """Insert a layer into the group.""" +//| ... //| STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t layer) { displayio_group_t *self = native_group(self_in); @@ -222,9 +219,9 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); -//| .. method:: index(layer) -//| -//| Returns the index of the first copy of layer. Raises ValueError if not found. +//| def index(self, layer: Any) -> Any: +//| """Returns the index of the first copy of layer. Raises ValueError if not found.""" +//| ... //| STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { displayio_group_t *self = native_group(self_in); @@ -236,9 +233,9 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index); -//| .. method:: pop(i=-1) -//| -//| Remove the ith item and return it. +//| def pop(self, i: Any = -1) -> Any: +//| """Remove the ith item and return it.""" +//| ... //| STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_i }; @@ -259,9 +256,9 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop); -//| .. method:: remove(layer) -//| -//| Remove the first copy of layer. Raises ValueError if it is not present. +//| def remove(self, layer: Any) -> Any: +//| """Remove the first copy of layer. Raises ValueError if it is not present.""" +//| ... //| STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { mp_obj_t index = displayio_group_obj_index(self_in, layer); @@ -272,9 +269,9 @@ STATIC mp_obj_t displayio_group_obj_remove(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_remove_obj, displayio_group_obj_remove); -//| .. method:: __len__() -//| -//| Returns the number of layers in a Group +//| def __len__(self, ) -> Any: +//| """Returns the number of layers in a Group""" +//| ... //| STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { displayio_group_t *self = native_group(self_in); @@ -286,29 +283,29 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| .. method:: __getitem__(index) +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the value at the given index. //| -//| Returns the value at the given index. +//| This allows you to:: //| -//| This allows you to:: +//| print(group[0])""" +//| ... //| -//| print(group[0]) +//| def __setitem__(self, index: Any, value: Any) -> Any: +//| """Sets the value at the given index. //| -//| .. method:: __setitem__(index, value) +//| This allows you to:: //| -//| Sets the value at the given index. +//| group[0] = sprite""" +//| ... //| -//| This allows you to:: +//| def __delitem__(self, index: Any) -> Any: +//| """Deletes the value at the given index. //| -//| group[0] = sprite +//| This allows you to:: //| -//| .. method:: __delitem__(index) -//| -//| Deletes the value at the given index. -//| -//| This allows you to:: -//| -//| del group[0] +//| del group[0]""" +//| ... //| STATIC mp_obj_t group_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { displayio_group_t *self = native_group(self_in); diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index 963e8377c5..e2402dc49b 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -38,26 +38,27 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class I2CDisplay: +//| """.. currentmodule:: displayio //| -//| :class:`I2CDisplay` -- Manage updating a display over I2C -//| ========================================================================== +//| :class:`I2CDisplay` -- Manage updating a display over I2C +//| ========================================================================== //| -//| Manage updating a display over I2C in the background while Python code runs. -//| It doesn't handle display initialization. +//| Manage updating a display over I2C in the background while Python code runs. +//| It doesn't handle display initialization.""" //| -//| .. class:: I2CDisplay(i2c_bus, *, device_address, reset=None) +//| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None): +//| """Create a I2CDisplay object associated with the given I2C bus and reset pin. //| -//| Create a I2CDisplay object associated with the given I2C bus and reset pin. +//| The I2C bus and pins are then in use by the display until `displayio.release_displays()` is +//| called even after a reload. (It does this so CircuitPython can use the display after your code +//| is done.) So, the first time you initialize a display bus in code.py you should call +//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. //| -//| The I2C bus and pins are then in use by the display until `displayio.release_displays()` is -//| called even after a reload. (It does this so CircuitPython can use the display after your code -//| is done.) So, the first time you initialize a display bus in code.py you should call -//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. -//| -//| :param busio.I2C i2c_bus: The I2C bus that make up the clock and data lines -//| :param int device_address: The I2C address of the device -//| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used +//| :param busio.I2C i2c_bus: The I2C bus that make up the clock and data lines +//| :param int device_address: The I2C address of the device +//| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used""" +//| ... //| STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_i2c_bus, ARG_device_address, ARG_reset }; @@ -80,10 +81,10 @@ STATIC mp_obj_t displayio_i2cdisplay_make_new(const mp_obj_type_t *type, size_t return self; } -//| .. method:: reset() -//| -//| Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin -//| is available. +//| def reset(self, ) -> Any: +//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin +//| is available.""" +//| ... //| STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) { displayio_i2cdisplay_obj_t *self = self_in; @@ -95,10 +96,10 @@ STATIC mp_obj_t displayio_i2cdisplay_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_obj_reset); -//| .. method:: send(command, data) -//| -//| Sends the given command value followed by the full set of data. Display state, such as -//| vertical scroll, set via ``send`` may or may not be reset once the code is done. +//| def send(self, command: Any, data: Any) -> Any: +//| """Sends the given command value followed by the full set of data. Display state, such as +//| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" +//| ... //| STATIC mp_obj_t displayio_i2cdisplay_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 57179947ed..95c890c3b9 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -33,51 +33,52 @@ #include "supervisor/shared/translate.h" #include "shared-bindings/displayio/OnDiskBitmap.h" -//| .. currentmodule:: displayio +//| class OnDiskBitmap: +//| """.. currentmodule:: displayio //| -//| :class:`OnDiskBitmap` -- Loads pixels straight from disk -//| ========================================================================== +//| :class:`OnDiskBitmap` -- Loads pixels straight from disk +//| ========================================================================== //| -//| Loads values straight from disk. This minimizes memory use but can lead to -//| much slower pixel load times. These load times may result in frame tearing where only part of -//| the image is visible. +//| Loads values straight from disk. This minimizes memory use but can lead to +//| much slower pixel load times. These load times may result in frame tearing where only part of +//| the image is visible. //| -//| It's easiest to use on a board with a built in display such as the `Hallowing M0 Express -//| `_. +//| It's easiest to use on a board with a built in display such as the `Hallowing M0 Express +//| `_. //| -//| .. code-block:: Python +//| .. code-block:: Python //| -//| import board -//| import displayio -//| import time -//| import pulseio +//| import board +//| import displayio +//| import time +//| import pulseio //| -//| board.DISPLAY.auto_brightness = False -//| board.DISPLAY.brightness = 0 -//| splash = displayio.Group() -//| board.DISPLAY.show(splash) +//| board.DISPLAY.auto_brightness = False +//| board.DISPLAY.brightness = 0 +//| splash = displayio.Group() +//| board.DISPLAY.show(splash) //| -//| with open("/sample.bmp", "rb") as f: -//| odb = displayio.OnDiskBitmap(f) -//| face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter()) -//| splash.append(face) -//| # Wait for the image to load. -//| board.DISPLAY.refresh(target_frames_per_second=60) +//| with open("/sample.bmp", "rb") as f: +//| odb = displayio.OnDiskBitmap(f) +//| face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter()) +//| splash.append(face) +//| # Wait for the image to load. +//| board.DISPLAY.refresh(target_frames_per_second=60) //| -//| # Fade up the backlight -//| for i in range(100): -//| board.DISPLAY.brightness = 0.01 * i -//| time.sleep(0.05) +//| # Fade up the backlight +//| for i in range(100): +//| board.DISPLAY.brightness = 0.01 * i +//| time.sleep(0.05) //| -//| # Wait forever -//| while True: -//| pass +//| # Wait forever +//| while True: +//| pass""" //| -//| .. class:: OnDiskBitmap(file) +//| def __init__(self, file: file): +//| """Create an OnDiskBitmap object with the given file. //| -//| Create an OnDiskBitmap object with the given file. -//| -//| :param file file: The open bitmap file +//| :param file file: The open bitmap file""" +//| ... //| STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -93,9 +94,8 @@ STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_ return MP_OBJ_FROM_PTR(self); } -//| .. attribute:: width -//| -//| Width of the bitmap. (read only) +//| width: Any = ... +//| """Width of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_width(mp_obj_t self_in) { displayio_ondiskbitmap_t *self = MP_OBJ_TO_PTR(self_in); @@ -113,9 +113,8 @@ const mp_obj_property_t displayio_ondiskbitmap_width_obj = { }; -//| .. attribute:: height -//| -//| Height of the bitmap. (read only) +//| height: Any = ... +//| """Height of the bitmap. (read only)""" //| STATIC mp_obj_t displayio_ondiskbitmap_obj_get_height(mp_obj_t self_in) { displayio_ondiskbitmap_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 67a7db85b8..5df11d2b10 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -36,19 +36,27 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio + + + + + + +//| class Palette: +//| """.. currentmodule:: displayio //| -//| :class:`Palette` -- Stores a mapping from bitmap pixel palette_indexes to display colors -//| ========================================================================================= +//| :class:`Palette` -- Stores a mapping from bitmap pixel palette_indexes to display colors +//| ========================================================================================= //| -//| Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to -//| save memory. +//| Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to +//| save memory.""" //| -//| .. class:: Palette(color_count) +//| def __init__(self, color_count: int): +//| """Create a Palette object to store a set number of colors. //| -//| Create a Palette object to store a set number of colors. +//| :param int color_count: The number of colors in the Palette""" +//| ... //| -//| :param int color_count: The number of colors in the Palette // TODO(tannewt): Add support for other color formats. // TODO(tannewt): Add support for 8-bit alpha blending. //| @@ -67,9 +75,9 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a return MP_OBJ_FROM_PTR(self); } -//| .. method:: __len__() -//| -//| Returns the number of colors in a Palette +//| def __len__(self, ) -> Any: +//| """Returns the number of colors in a Palette""" +//| ... //| STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); @@ -81,21 +89,21 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| .. method:: __setitem__(index, value) +//| def __setitem__(self, index: Any, value: Any) -> Any: +//| """Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| -//| Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. +//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). +//| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, +//| or a tuple or list of 3 integers. //| -//| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). -//| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, -//| or a tuple or list of 3 integers. +//| This allows you to:: //| -//| This allows you to:: -//| -//| palette[0] = 0xFFFFFF # set using an integer -//| palette[1] = b'\xff\xff\x00' # set using 3 bytes -//| palette[2] = b'\xff\xff\x00\x00' # set using 4 bytes -//| palette[3] = bytearray(b'\x00\x00\xFF') # set using a bytearay of 3 or 4 bytes -//| palette[4] = (10, 20, 30) # set using a tuple of 3 integers +//| palette[0] = 0xFFFFFF # set using an integer +//| palette[1] = b'\xff\xff\x00' # set using 3 bytes +//| palette[2] = b'\xff\xff\x00\x00' # set using 4 bytes +//| palette[3] = bytearray(b'\x00\x00\xFF') # set using a bytearay of 3 or 4 bytes +//| palette[4] = (10, 20, 30) # set using a tuple of 3 integers""" +//| ... //| STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { @@ -144,7 +152,7 @@ STATIC mp_obj_t palette_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t val return mp_const_none; } -//| .. method:: make_transparent(palette_index) +//| def make_transparent(self, palette_index: Any) -> Any: ... //| STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); @@ -158,7 +166,7 @@ STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_2(displayio_palette_make_transparent_obj, displayio_palette_obj_make_transparent); -//| .. method:: make_opaque(palette_index) +//| def make_opaque(self, palette_index: Any) -> Any: ... //| STATIC mp_obj_t displayio_palette_obj_make_opaque(mp_obj_t self_in, mp_obj_t palette_index_obj) { displayio_palette_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index bdafdaef6d..cedcf1de52 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -37,31 +37,32 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class ParallelBus: +//| """.. currentmodule:: displayio //| -//| :class:`ParallelBus` -- Manage updating a display over 8-bit parallel bus -//| ============================================================================== +//| :class:`ParallelBus` -- Manage updating a display over 8-bit parallel bus +//| ============================================================================== //| -//| Manage updating a display over 8-bit parallel bus in the background while Python code runs. This -//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle -//| display initialization. +//| Manage updating a display over 8-bit parallel bus in the background while Python code runs. This +//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle +//| display initialization.""" //| -//| .. class:: ParallelBus(*, data0, command, chip_select, write, read, reset) +//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin): +//| """Create a ParallelBus object associated with the given pins. The bus is inferred from data0 +//| by implying the next 7 additional pins on a given GPIO port. //| -//| Create a ParallelBus object associated with the given pins. The bus is inferred from data0 -//| by implying the next 7 additional pins on a given GPIO port. +//| The parallel bus and pins are then in use by the display until `displayio.release_displays()` +//| is called even after a reload. (It does this so CircuitPython can use the display after your +//| code is done.) So, the first time you initialize a display bus in code.py you should call +//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. //| -//| The parallel bus and pins are then in use by the display until `displayio.release_displays()` -//| is called even after a reload. (It does this so CircuitPython can use the display after your -//| code is done.) So, the first time you initialize a display bus in code.py you should call -//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run. -//| -//| :param microcontroller.Pin data0: The first data pin. The rest are implied -//| :param microcontroller.Pin command: Data or command pin -//| :param microcontroller.Pin chip_select: Chip select pin -//| :param microcontroller.Pin write: Write pin -//| :param microcontroller.Pin read: Read pin -//| :param microcontroller.Pin reset: Reset pin +//| :param microcontroller.Pin data0: The first data pin. The rest are implied +//| :param microcontroller.Pin command: Data or command pin +//| :param microcontroller.Pin chip_select: Chip select pin +//| :param microcontroller.Pin write: Write pin +//| :param microcontroller.Pin read: Read pin +//| :param microcontroller.Pin reset: Reset pin""" +//| ... //| STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_data0, ARG_command, ARG_chip_select, ARG_write, ARG_read, ARG_reset }; @@ -90,11 +91,12 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t return self; } -//| .. method:: reset() -//| -//| Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin -//| is available. +//| def reset(self, ) -> Any: +//| """Performs a hardware reset via the reset pin. Raises an exception if called when no reset pin +//| is available.""" +//| ... //| + STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) { displayio_parallelbus_obj_t *self = self_in; @@ -105,10 +107,10 @@ STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset); -//| .. method:: send(command, data) -//| -//| Sends the given command value followed by the full set of data. Display state, such as -//| vertical scroll, set via ``send`` may or may not be reset once the code is done. +//| def send(self, command: Any, data: Any) -> Any: +//| """Sends the given command value followed by the full set of data. Display state, such as +//| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" +//| ... //| STATIC mp_obj_t displayio_parallelbus_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index 7c7b105015..0f22bb2a3e 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -34,22 +34,23 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class Shape: +//| """.. currentmodule:: displayio //| -//| :class:`Shape` -- Represents a shape by defining its bounds on each row -//| ========================================================================== +//| :class:`Shape` -- Represents a shape by defining its bounds on each row +//| ========================================================================== //| -//| Represents any shape made by defining boundaries that may be mirrored. +//| Represents any shape made by defining boundaries that may be mirrored.""" //| -//| .. class:: Shape(width, height, *, mirror_x=False, mirror_y=False) +//| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False): +//| """Create a Shape object with the given fixed size. Each pixel is one bit and is stored by the +//| column boundaries of the shape on each row. Each row's boundary defaults to the full row. //| -//| Create a Shape object with the given fixed size. Each pixel is one bit and is stored by the -//| column boundaries of the shape on each row. Each row's boundary defaults to the full row. -//| -//| :param int width: The number of pixels wide -//| :param int height: The number of pixels high -//| :param bool mirror_x: When true the left boundary is mirrored to the right. -//| :param bool mirror_y: When true the top boundary is mirrored to the bottom. +//| :param int width: The number of pixels wide +//| :param int height: The number of pixels high +//| :param bool mirror_x: When true the left boundary is mirrored to the right. +//| :param bool mirror_y: When true the top boundary is mirrored to the bottom.""" +//| ... //| STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_width, ARG_height, ARG_mirror_x, ARG_mirror_y }; @@ -83,9 +84,9 @@ STATIC mp_obj_t displayio_shape_make_new(const mp_obj_type_t *type, size_t n_arg } -//| .. method:: set_boundary(y, start_x, end_x) -//| -//| Loads pre-packed data into the given row. +//| def set_boundary(self, y: Any, start_x: Any, end_x: Any) -> Any: +//| """Loads pre-packed data into the given row.""" +//| ... //| STATIC mp_obj_t displayio_shape_obj_set_boundary(size_t n_args, const mp_obj_t *args) { (void) n_args; diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 288eb4b236..e7410e4b67 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -40,33 +40,33 @@ #include "shared-bindings/displayio/Shape.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: displayio +//| class TileGrid: +//| """.. currentmodule:: displayio //| -//| :class:`TileGrid` -- A grid of tiles sourced out of one bitmap -//| ========================================================================== +//| :class:`TileGrid` -- A grid of tiles sourced out of one bitmap +//| ========================================================================== //| -//| Position a grid of tiles sourced from a bitmap and pixel_shader combination. Multiple grids -//| can share bitmaps and pixel shaders. +//| Position a grid of tiles sourced from a bitmap and pixel_shader combination. Multiple grids +//| can share bitmaps and pixel shaders. //| -//| A single tile grid is also known as a Sprite. +//| A single tile grid is also known as a Sprite.""" //| -//| .. class:: TileGrid(bitmap, *, pixel_shader, width=1, height=1, tile_width=None, tile_height=None, default_tile=0, x=0, y=0) +//| def __init__(self, bitmap: displayio.Bitmap, *, pixel_shader: displayio.Palette, width: int = 1, height: int = 1, tile_width: int = None, tile_height: int = None, default_tile: int = 0, x: int = 0, y: int = 0): +//| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to +//| convert the value and its location to a display native pixel color. This may be a simple color +//| palette lookup, a gradient, a pattern or a color transformer. //| -//| Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to -//| convert the value and its location to a display native pixel color. This may be a simple color -//| palette lookup, a gradient, a pattern or a color transformer. +//| tile_width and tile_height match the height of the bitmap by default. //| -//| tile_width and tile_height match the height of the bitmap by default. -//| -//| :param displayio.Bitmap bitmap: The bitmap storing one or more tiles. -//| :param displayio.Palette pixel_shader: The pixel shader that produces colors from values -//| :param int width: Width of the grid in tiles. -//| :param int height: Height of the grid in tiles. -//| :param int tile_width: Width of a single tile in pixels. Defaults to the full Bitmap and must evenly divide into the Bitmap's dimensions. -//| :param int tile_height: Height of a single tile in pixels. Defaults to the full Bitmap and must evenly divide into the Bitmap's dimensions. -//| :param int default_tile: Default tile index to show. -//| :param int x: Initial x position of the left edge within the parent. -//| :param int y: Initial y position of the top edge within the parent. +//| :param displayio.Bitmap bitmap: The bitmap storing one or more tiles. +//| :param displayio.Palette pixel_shader: The pixel shader that produces colors from values +//| :param int width: Width of the grid in tiles. +//| :param int height: Height of the grid in tiles. +//| :param int tile_width: Width of a single tile in pixels. Defaults to the full Bitmap and must evenly divide into the Bitmap's dimensions. +//| :param int tile_height: Height of a single tile in pixels. Defaults to the full Bitmap and must evenly divide into the Bitmap's dimensions. +//| :param int default_tile: Default tile index to show. +//| :param int x: Initial x position of the left edge within the parent. +//| :param int y: Initial y position of the top edge within the parent.""" //| STATIC mp_obj_t displayio_tilegrid_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_bitmap, ARG_pixel_shader, ARG_width, ARG_height, ARG_tile_width, ARG_tile_height, ARG_default_tile, ARG_x, ARG_y }; @@ -144,9 +144,8 @@ static displayio_tilegrid_t* native_tilegrid(mp_obj_t tilegrid_obj) { mp_obj_assert_native_inited(native_tilegrid); return MP_OBJ_TO_PTR(native_tilegrid); } -//| .. attribute:: hidden -//| -//| True when the TileGrid is hidden. This may be False even when a part of a hidden Group. +//| hidden: Any = ... +//| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_hidden(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -169,9 +168,8 @@ const mp_obj_property_t displayio_tilegrid_hidden_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: x -//| -//| X position of the left edge in the parent. +//| x: Any = ... +//| """X position of the left edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_x(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -195,9 +193,8 @@ const mp_obj_property_t displayio_tilegrid_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: y -//| -//| Y position of the top edge in the parent. +//| y: Any = ... +//| """Y position of the top edge in the parent.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_y(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -221,9 +218,8 @@ const mp_obj_property_t displayio_tilegrid_y_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: flip_x -//| -//| If true, the left edge rendered will be the right edge of the right-most tile. +//| flip_x: Any = ... +//| """If true, the left edge rendered will be the right edge of the right-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_x(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -246,9 +242,8 @@ const mp_obj_property_t displayio_tilegrid_flip_x_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: flip_y -//| -//| If true, the top edge rendered will be the bottom edge of the bottom-most tile. +//| flip_y: Any = ... +//| """If true, the top edge rendered will be the bottom edge of the bottom-most tile.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_flip_y(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -272,10 +267,9 @@ const mp_obj_property_t displayio_tilegrid_flip_y_obj = { }; -//| .. attribute:: transpose_xy -//| -//| If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree -//| rotation can be achieved along with the corresponding mirrored version. +//| transpose_xy: Any = ... +//| """If true, the TileGrid's axis will be swapped. When combined with mirroring, any 90 degree +//| rotation can be achieved along with the corresponding mirrored version.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_transpose_xy(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -298,9 +292,8 @@ const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: pixel_shader -//| -//| The pixel shader of the tilegrid. +//| pixel_shader: Any = ... +//| """The pixel shader of the tilegrid.""" //| STATIC mp_obj_t displayio_tilegrid_obj_get_pixel_shader(mp_obj_t self_in) { displayio_tilegrid_t *self = native_tilegrid(self_in); @@ -327,27 +320,27 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: __getitem__(index) +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the tile index at the given index. The index can either be an x,y tuple or an int equal +//| to ``y * width + x``. //| -//| Returns the tile index at the given index. The index can either be an x,y tuple or an int equal -//| to ``y * width + x``. +//| This allows you to:: //| -//| This allows you to:: +//| print(grid[0])""" +//| ... //| -//| print(grid[0]) +//| def __setitem__(self, index: Any, tile_index: Any) -> Any: +//| """Sets the tile index at the given index. The index can either be an x,y tuple or an int equal +//| to ``y * width + x``. //| -//| .. method:: __setitem__(index, tile_index) +//| This allows you to:: //| -//| Sets the tile index at the given index. The index can either be an x,y tuple or an int equal -//| to ``y * width + x``. +//| grid[0] = 10 //| -//| This allows you to:: +//| or:: //| -//| grid[0] = 10 -//| -//| or:: -//| -//| grid[0,0] = 10 +//| grid[0,0] = 10""" +//| ... //| STATIC mp_obj_t tilegrid_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value_obj) { displayio_tilegrid_t *self = native_tilegrid(self_in); diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index f783255930..37c0253292 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -43,7 +43,7 @@ #include "shared-bindings/displayio/Shape.h" #include "shared-bindings/displayio/TileGrid.h" -//| :mod:`displayio` --- Native display driving +//| """:mod:`displayio` --- Native display driving //| ========================================================================= //| //| .. module:: displayio @@ -69,18 +69,18 @@ //| Palette //| ParallelBus //| Shape -//| TileGrid +//| TileGrid""" //| -//| .. function:: release_displays() +//| def release_displays() -> Any: +//| """Releases any actively used displays so their busses and pins can be used again. This will also +//| release the builtin display on boards that have one. You will need to reinitialize it yourself +//| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing. //| -//| Releases any actively used displays so their busses and pins can be used again. This will also -//| release the builtin display on boards that have one. You will need to reinitialize it yourself -//| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing. -//| -//| Use this once in your code.py if you initialize a display. Place it right before the -//| initialization so the display is active as long as possible. +//| Use this once in your code.py if you initialize a display. Place it right before the +//| initialization so the display is active as long as possible.""" +//| ... //| STATIC mp_obj_t displayio_release_displays(void) { common_hal_displayio_release_displays(); From a3d5adb43c897d591baabaaf1e7ef83deedbd3ce Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 7 May 2020 11:56:46 -0400 Subject: [PATCH 413/919] Did _eve, fontio, framebufferio, and frequencyio --- shared-bindings/_eve/__init__.c | 441 +++++++++--------- shared-bindings/fontio/BuiltinFont.c | 38 +- shared-bindings/fontio/Glyph.c | 29 +- shared-bindings/fontio/__init__.c | 4 +- .../framebufferio/FramebufferDisplay.c | 109 +++-- shared-bindings/framebufferio/__init__.c | 4 +- shared-bindings/frequencyio/FrequencyIn.c | 106 ++--- shared-bindings/frequencyio/__init__.c | 4 +- 8 files changed, 371 insertions(+), 364 deletions(-) diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 9bc790f5d1..0e78cea160 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -34,7 +34,20 @@ #include "shared-module/_eve/__init__.h" #include "shared-bindings/_eve/__init__.h" -//| :mod:`_eve` --- low-level BridgeTek EVE bindings + + + + + + + + + + + + + +//| """:mod:`_eve` --- low-level BridgeTek EVE bindings //| ================================================ //| //| .. module:: _eve @@ -43,7 +56,7 @@ //| //| The `_eve` module provides a class _EVE which //| contains methods for constructing EVE command -//| buffers and appending basic graphics commands. +//| buffers and appending basic graphics commands.""" //| typedef struct _mp_obj__EVE_t { @@ -63,11 +76,11 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register); -//| .. method:: flush() -//| -//| Send any queued drawing commands directly to the hardware. +//| def flush(self, ) -> Any: +//| """Send any queued drawing commands directly to the hardware. //| -//| :param int width: The width of the grid in tiles, or 1 for sprites. +//| :param int width: The width of the grid in tiles, or 1 for sprites.""" +//| ... //| STATIC mp_obj_t _flush(mp_obj_t self) { common_hal__eve_flush(EVEHAL(self)); @@ -75,11 +88,11 @@ STATIC mp_obj_t _flush(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush); -//| .. method:: cc(b) -//| -//| Append bytes to the command FIFO. +//| def cc(self, b: bytes) -> Any: +//| """Append bytes to the command FIFO. //| -//| :param bytes b: The bytes to add +//| :param bytes b: The bytes to add""" +//| ... //| STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) { mp_buffer_info_t buffer_info; @@ -91,14 +104,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc); //{ -//| .. method:: AlphaFunc(func, ref) -//| -//| Set the alpha test function +//| def AlphaFunc(self, func: int, ref: int) -> Any: +//| """Set the alpha test function //| //| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) //| :param int ref: specifies the reference value for the alpha test. Range 0-255. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -109,14 +122,14 @@ STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(alphafunc_obj, _alphafunc); -//| .. method:: Begin(prim) -//| -//| Begin drawing a graphics primitive +//| def Begin(self, prim: int) -> Any: +//| """Begin drawing a graphics primitive //| //| :param int prim: graphics primitive. //| -//| Valid primitives are ``BITMAPS``, ``POINTS``, ``LINES``, ``LINE_STRIP``, ``EDGE_STRIP_R``, ``EDGE_STRIP_L``, ``EDGE_STRIP_A``, ``EDGE_STRIP_B`` and ``RECTS``. -//| +//| Valid primitives are ``BITMAPS``, ``POINTS``, ``LINES``, ``LINE_STRIP``, ``EDGE_STRIP_R``, ``EDGE_STRIP_L``, ``EDGE_STRIP_A``, ``EDGE_STRIP_B`` and ``RECTS``.""" +//| ... +//| STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) { uint32_t prim = mp_obj_get_int_truncated(a0); @@ -125,11 +138,11 @@ STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(begin_obj, _begin); -//| .. method:: BitmapExtFormat(format) +//| def BitmapExtFormat(self, format: int) -> Any: +//| """Set the bitmap format //| -//| Set the bitmap format -//| -//| :param int format: bitmap pixel format. +//| :param int format: bitmap pixel format.""" +//| ... //| STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) { @@ -139,13 +152,13 @@ STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapextformat_obj, _bitmapextformat); -//| .. method:: BitmapHandle(handle) -//| -//| Set the bitmap handle +//| def BitmapHandle(self, handle: int) -> Any: +//| """Set the bitmap handle //| //| :param int handle: bitmap handle. Range 0-31. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) { @@ -155,12 +168,12 @@ STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaphandle_obj, _bitmaphandle); -//| .. method:: BitmapLayoutH(linestride, height) -//| -//| Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps +//| def BitmapLayoutH(self, linestride: int, height: int) -> Any: +//| """Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps //| //| :param int linestride: high part of bitmap line stride, in bytes. Range 0-7 -//| :param int height: high part of bitmap height, in lines. Range 0-3 +//| :param int height: high part of bitmap height, in lines. Range 0-3""" +//| ... //| STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -171,13 +184,13 @@ STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaplayouth_obj, _bitmaplayouth); -//| .. method:: BitmapLayout(format, linestride, height) -//| -//| Set the source bitmap memory format and layout for the current handle +//| def BitmapLayout(self, format: int, linestride: int, height: int) -> Any: +//| """Set the source bitmap memory format and layout for the current handle //| //| :param int format: bitmap pixel format, or GLFORMAT to use BITMAP_EXT_FORMAT instead. Range 0-31 //| :param int linestride: bitmap line stride, in bytes. Range 0-1023 -//| :param int height: bitmap height, in lines. Range 0-511 +//| :param int height: bitmap height, in lines. Range 0-511""" +//| ... //| STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) { @@ -189,12 +202,12 @@ STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmaplayout_obj, 4, 4, _bitmaplayout); -//| .. method:: BitmapSizeH(width, height) -//| -//| Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps +//| def BitmapSizeH(self, width: int, height: int) -> Any: +//| """Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps //| //| :param int width: high part of drawn bitmap width, in pixels. Range 0-3 -//| :param int height: high part of drawn bitmap height, in pixels. Range 0-3 +//| :param int height: high part of drawn bitmap height, in pixels. Range 0-3""" +//| ... //| STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -205,15 +218,15 @@ STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmapsizeh_obj, _bitmapsizeh); -//| .. method:: BitmapSize(filter, wrapx, wrapy, width, height) -//| -//| Set the screen drawing of bitmaps for the current handle +//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> Any: +//| """Set the screen drawing of bitmaps for the current handle //| //| :param int filter: bitmap filtering mode, one of ``NEAREST`` or ``BILINEAR``. Range 0-1 //| :param int wrapx: bitmap :math:`x` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 //| :param int wrapy: bitmap :math:`y` wrap mode, one of ``REPEAT`` or ``BORDER``. Range 0-1 //| :param int width: drawn bitmap width, in pixels. Range 0-511 -//| :param int height: drawn bitmap height, in pixels. Range 0-511 +//| :param int height: drawn bitmap height, in pixels. Range 0-511""" +//| ... //| STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) { @@ -227,11 +240,11 @@ STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapsize_obj, 6, 6, _bitmapsize); -//| .. method:: BitmapSource(addr) +//| def BitmapSource(self, addr: int) -> Any: +//| """Set the source address for bitmap graphics //| -//| Set the source address for bitmap graphics -//| -//| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215 +//| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215""" +//| ... //| STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) { @@ -241,14 +254,14 @@ STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapsource_obj, _bitmapsource); -//| .. method:: BitmapSwizzle(r, g, b, a) -//| -//| Set the source for the r,g,b and a channels of a bitmap +//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> Any: +//| """Set the source for the r,g,b and a channels of a bitmap //| //| :param int r: red component source channel. Range 0-7 //| :param int g: green component source channel. Range 0-7 //| :param int b: blue component source channel. Range 0-7 -//| :param int a: alpha component source channel. Range 0-7 +//| :param int a: alpha component source channel. Range 0-7""" +//| ... //| STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) { @@ -261,16 +274,16 @@ STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapswizzle_obj, 5, 5, _bitmapswizzle); -//| .. method:: BitmapTransformA(p, v) -//| -//| Set the :math:`a` component of the bitmap transform matrix +//| def BitmapTransformA(self, p: Any, v: int) -> Any: +//| """Set the :math:`a` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 //| :param int v: The :math:`a` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 //| //| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -281,16 +294,16 @@ STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforma_obj, _bitmaptransforma); -//| .. method:: BitmapTransformB(p, v) -//| -//| Set the :math:`b` component of the bitmap transform matrix +//| def BitmapTransformB(self, p: Any, v: int) -> Any: +//| """Set the :math:`b` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 //| :param int v: The :math:`b` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 //| //| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -301,13 +314,13 @@ STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformb_obj, _bitmaptransformb); -//| .. method:: BitmapTransformC(v) -//| -//| Set the :math:`c` component of the bitmap transform matrix +//| def BitmapTransformC(self, v: int) -> Any: +//| """Set the :math:`c` component of the bitmap transform matrix //| //| :param int v: The :math:`c` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) { @@ -317,16 +330,16 @@ STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformc_obj, _bitmaptransformc); -//| .. method:: BitmapTransformD(p, v) -//| -//| Set the :math:`d` component of the bitmap transform matrix +//| def BitmapTransformD(self, p: Any, v: int) -> Any: +//| """Set the :math:`d` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 //| :param int v: The :math:`d` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 0 //| //| The initial value is **p** = 0, **v** = 0. This represents the value 0.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -337,16 +350,16 @@ STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformd_obj, _bitmaptransformd); -//| .. method:: BitmapTransformE(p, v) -//| -//| Set the :math:`e` component of the bitmap transform matrix +//| def BitmapTransformE(self, p: Any, v: int) -> Any: +//| """Set the :math:`e` component of the bitmap transform matrix //| //| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0 //| :param int v: The :math:`e` component of the bitmap transform matrix, in signed 8.8 or 1.15 bit fixed-point form. Range 0-131071. The initial value is 256 //| //| The initial value is **p** = 0, **v** = 256. This represents the value 1.0. //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -357,13 +370,13 @@ STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforme_obj, _bitmaptransforme); -//| .. method:: BitmapTransformF(v) -//| -//| Set the :math:`f` component of the bitmap transform matrix +//| def BitmapTransformF(self, v: int) -> Any: +//| """Set the :math:`f` component of the bitmap transform matrix //| //| :param int v: The :math:`f` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) { @@ -373,14 +386,14 @@ STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformf_obj, _bitmaptransformf); -//| .. method:: BlendFunc(src, dst) -//| -//| Set pixel arithmetic +//| def BlendFunc(self, src: int, dst: int) -> Any: +//| """Set pixel arithmetic //| //| :param int src: specifies how the source blending factor is computed. One of ``ZERO``, ``ONE``, ``SRC_ALPHA``, ``DST_ALPHA``, ``ONE_MINUS_SRC_ALPHA`` or ``ONE_MINUS_DST_ALPHA``. Range 0-7. The initial value is SRC_ALPHA(2) //| :param int dst: specifies how the destination blending factor is computed, one of the same constants as **src**. Range 0-7. The initial value is ONE_MINUS_SRC_ALPHA(4) //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -391,11 +404,11 @@ STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(blendfunc_obj, _blendfunc); -//| .. method:: Call(dest) +//| def Call(self, dest: int) -> Any: +//| """Execute a sequence of commands at another location in the display list //| -//| Execute a sequence of commands at another location in the display list -//| -//| :param int dest: display list address. Range 0-65535 +//| :param int dest: display list address. Range 0-65535""" +//| ... //| STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) { @@ -405,13 +418,13 @@ STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(call_obj, _call); -//| .. method:: Cell(cell) -//| -//| Set the bitmap cell number for the vertex2f command +//| def Cell(self, cell: int) -> Any: +//| """Set the bitmap cell number for the vertex2f command //| //| :param int cell: bitmap cell number. Range 0-127. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) { @@ -421,13 +434,13 @@ STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cell_obj, _cell); -//| .. method:: ClearColorA(alpha) -//| -//| Set clear value for the alpha channel +//| def ClearColorA(self, alpha: int) -> Any: +//| """Set clear value for the alpha channel //| //| :param int alpha: alpha value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) { @@ -437,15 +450,15 @@ STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearcolora_obj, _clearcolora); -//| .. method:: ClearColorRGB(red, green, blue) -//| -//| Set clear values for red, green and blue channels +//| def ClearColorRGB(self, red: int, green: int, blue: int) -> Any: +//| """Set clear values for red, green and blue channels //| //| :param int red: red value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| :param int green: green value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| :param int blue: blue value used when the color buffer is cleared. Range 0-255. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) { @@ -457,13 +470,13 @@ STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clearcolorrgb_obj, 4, 4, _clearcolorrgb); -//| .. method:: Clear(c, s, t) -//| -//| Clear buffers to preset values +//| def Clear(self, c: int, s: int, t: int) -> Any: +//| """Clear buffers to preset values //| //| :param int c: clear color buffer. Range 0-1 //| :param int s: clear stencil buffer. Range 0-1 -//| :param int t: clear tag buffer. Range 0-1 +//| :param int t: clear tag buffer. Range 0-1""" +//| ... //| STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) { @@ -475,13 +488,13 @@ STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clear_obj, 1, 4, _clear); -//| .. method:: ClearStencil(s) -//| -//| Set clear value for the stencil buffer +//| def ClearStencil(self, s: int) -> Any: +//| """Set clear value for the stencil buffer //| //| :param int s: value used when the stencil buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) { @@ -491,13 +504,12 @@ STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearstencil_obj, _clearstencil); -//| .. method:: ClearTag(s) -//| -//| Set clear value for the tag buffer +//| def ClearTag(self, s: int) -> Any: +//| """Set clear value for the tag buffer //| //| :param int s: value used when the tag buffer is cleared. Range 0-255. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" //| STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) { @@ -507,13 +519,13 @@ STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cleartag_obj, _cleartag); -//| .. method:: ColorA(alpha) -//| -//| Set the current color alpha +//| def ColorA(self, alpha: int) -> Any: +//| """Set the current color alpha //| //| :param int alpha: alpha for the current color. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) { @@ -523,16 +535,16 @@ STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(colora_obj, _colora); -//| .. method:: ColorMask(r, g, b, a) -//| -//| Enable and disable writing of frame buffer color components +//| def ColorMask(self, r: int, g: int, b: int, a: int) -> Any: +//| """Enable and disable writing of frame buffer color components //| //| :param int r: allow updates to the frame buffer red component. Range 0-1. The initial value is 1 //| :param int g: allow updates to the frame buffer green component. Range 0-1. The initial value is 1 //| :param int b: allow updates to the frame buffer blue component. Range 0-1. The initial value is 1 //| :param int a: allow updates to the frame buffer alpha component. Range 0-1. The initial value is 1 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) { @@ -545,15 +557,15 @@ STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colormask_obj, 5, 5, _colormask); -//| .. method:: ColorRGB(red, green, blue) -//| -//| Set the drawing color +//| def ColorRGB(self, red: int, green: int, blue: int) -> Any: +//| """Set the drawing color //| //| :param int red: red value for the current color. Range 0-255. The initial value is 255 //| :param int green: green for the current color. Range 0-255. The initial value is 255 //| :param int blue: blue for the current color. Range 0-255. The initial value is 255 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { @@ -565,9 +577,8 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb); -//| .. method:: Display() -//| -//| End the display list +//| def Display(self, ) -> Any: ... +//| """End the display list""" //| STATIC mp_obj_t _display(mp_obj_t self) { @@ -577,12 +588,12 @@ STATIC mp_obj_t _display(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display); -//| .. method:: End() +//| def End(self, ) -> Any: +//| """End drawing a graphics primitive //| -//| End drawing a graphics primitive +//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`.""" +//| ... //| -//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`. -//| STATIC mp_obj_t _end(mp_obj_t self) { @@ -591,11 +602,11 @@ STATIC mp_obj_t _end(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(end_obj, _end); -//| .. method:: Jump(dest) +//| def Jump(self, dest: int) -> Any: +//| """Execute commands at another location in the display list //| -//| Execute commands at another location in the display list -//| -//| :param int dest: display list address. Range 0-65535 +//| :param int dest: display list address. Range 0-65535""" +//| ... //| STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) { @@ -605,13 +616,13 @@ STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(jump_obj, _jump); -//| .. method:: LineWidth(width) -//| -//| Set the width of rasterized lines +//| def LineWidth(self, width: int) -> Any: +//| """Set the width of rasterized lines //| //| :param int width: line width in :math:`1/16` pixel. Range 0-4095. The initial value is 16 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) { @@ -621,11 +632,11 @@ STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(linewidth_obj, _linewidth); -//| .. method:: Macro(m) +//| def Macro(self, m: int) -> Any: +//| """Execute a single command from a macro register //| -//| Execute a single command from a macro register -//| -//| :param int m: macro register to read. Range 0-1 +//| :param int m: macro register to read. Range 0-1""" +//| ... //| STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { @@ -635,9 +646,9 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro); -//| .. method:: Nop() -//| -//| No operation +//| def Nop(self, ) -> Any: +//| """No operation""" +//| ... //| STATIC mp_obj_t _nop(mp_obj_t self) { @@ -647,13 +658,13 @@ STATIC mp_obj_t _nop(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(nop_obj, _nop); -//| .. method:: PaletteSource(addr) -//| -//| Set the base address of the palette +//| def PaletteSource(self, addr: int) -> Any: +//| """Set the base address of the palette //| //| :param int addr: Address in graphics SRAM, 2-byte aligned. Range 0-4194303. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) { @@ -663,13 +674,13 @@ STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(palettesource_obj, _palettesource); -//| .. method:: PointSize(size) -//| -//| Set the radius of rasterized points +//| def PointSize(self, size: int) -> Any: +//| """Set the radius of rasterized points //| //| :param int size: point radius in :math:`1/16` pixel. Range 0-8191. The initial value is 16 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { @@ -679,9 +690,9 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); -//| .. method:: RestoreContext() -//| -//| Restore the current graphics context from the context stack +//| def RestoreContext(self, ) -> Any: +//| """Restore the current graphics context from the context stack""" +//| ... //| STATIC mp_obj_t _restorecontext(mp_obj_t self) { @@ -691,9 +702,9 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext); -//| .. method:: Return() -//| -//| Return from a previous call command +//| def Return(self, ) -> Any: +//| """Return from a previous call command""" +//| ... //| STATIC mp_obj_t _return(mp_obj_t self) { @@ -703,9 +714,9 @@ STATIC mp_obj_t _return(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return); -//| .. method:: SaveContext() -//| -//| Push the current graphics context on the context stack +//| def SaveContext(self, ) -> Any: +//| """Push the current graphics context on the context stack""" +//| ... //| STATIC mp_obj_t _savecontext(mp_obj_t self) { @@ -715,14 +726,14 @@ STATIC mp_obj_t _savecontext(mp_obj_t self) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(savecontext_obj, _savecontext); -//| .. method:: ScissorSize(width, height) -//| -//| Set the size of the scissor clip rectangle +//| def ScissorSize(self, width: int, height: int) -> Any: +//| """Set the size of the scissor clip rectangle //| //| :param int width: The width of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is hsize //| :param int height: The height of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is 2048 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -733,14 +744,14 @@ STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorsize_obj, _scissorsize); -//| .. method:: ScissorXY(x, y) -//| -//| Set the top left corner of the scissor clip rectangle +//| def ScissorXY(self, x: int, y: int) -> Any: +//| """Set the top left corner of the scissor clip rectangle //| //| :param int x: The :math:`x` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 //| :param int y: The :math:`y` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -751,15 +762,15 @@ STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorxy_obj, _scissorxy); -//| .. method:: StencilFunc(func, ref, mask) -//| -//| Set function and reference value for stencil testing +//| def StencilFunc(self, func: int, ref: int, mask: int) -> Any: +//| """Set function and reference value for stencil testing //| //| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7) //| :param int ref: specifies the reference value for the stencil test. Range 0-255. The initial value is 0 //| :param int mask: specifies a mask that is ANDed with the reference value and the stored stencil value. Range 0-255. The initial value is 255 //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) { @@ -771,13 +782,13 @@ STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stencilfunc_obj, 4, 4, _stencilfunc); -//| .. method:: StencilMask(mask) -//| -//| Control the writing of individual bits in the stencil planes +//| def StencilMask(self, mask: int) -> Any: +//| """Control the writing of individual bits in the stencil planes //| //| :param int mask: the mask used to enable writing stencil bits. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) { @@ -787,14 +798,14 @@ STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(stencilmask_obj, _stencilmask); -//| .. method:: StencilOp(sfail, spass) -//| -//| Set stencil test actions +//| def StencilOp(self, sfail: int, spass: int) -> Any: +//| """Set stencil test actions //| //| :param int sfail: specifies the action to take when the stencil test fails, one of ``KEEP``, ``ZERO``, ``REPLACE``, ``INCR``, ``INCR_WRAP``, ``DECR``, ``DECR_WRAP``, and ``INVERT``. Range 0-7. The initial value is KEEP(1) //| :param int spass: specifies the action to take when the stencil test passes, one of the same constants as **sfail**. Range 0-7. The initial value is KEEP(1) //| -//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| These values are part of the graphics context and are saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { @@ -805,13 +816,13 @@ STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(stencilop_obj, _stencilop); -//| .. method:: TagMask(mask) -//| -//| Control the writing of the tag buffer +//| def TagMask(self, mask: int) -> Any: +//| """Control the writing of the tag buffer //| //| :param int mask: allow updates to the tag buffer. Range 0-1. The initial value is 1 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) { @@ -821,13 +832,13 @@ STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tagmask_obj, _tagmask); -//| .. method:: Tag(s) -//| -//| Set the current tag value +//| def Tag(self, s: int) -> Any: +//| """Set the current tag value //| //| :param int s: tag value. Range 0-255. The initial value is 255 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) { @@ -837,13 +848,13 @@ STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(tag_obj, _tag); -//| .. method:: VertexTranslateX(x) -//| -//| Set the vertex transformation's x translation component +//| def VertexTranslateX(self, x: int) -> Any: +//| """Set the vertex transformation's x translation component //| //| :param int x: signed x-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) { @@ -853,13 +864,13 @@ STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatex_obj, _vertextranslatex); -//| .. method:: VertexTranslateY(y) -//| -//| Set the vertex transformation's y translation component +//| def VertexTranslateY(self, y: int) -> Any: +//| """Set the vertex transformation's y translation component //| //| :param int y: signed y-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| @@ -870,13 +881,13 @@ STATIC mp_obj_t _vertextranslatey(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatey_obj, _vertextranslatey); -//| .. method:: VertexFormat(frac) -//| -//| Set the precision of vertex2f coordinates +//| def VertexFormat(self, frac: int) -> Any: +//| """Set the precision of vertex2f coordinates //| //| :param int frac: Number of fractional bits in X,Y coordinates, 0-4. Range 0-7. The initial value is 4 //| -//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`. +//| This value is part of the graphics context and is saved and restored by :meth:`SaveContext` and :meth:`RestoreContext`.""" +//| ... //| STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) { @@ -886,15 +897,15 @@ STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertexformat_obj, _vertexformat); -//| .. method:: Vertex2ii(x, y, handle, cell) -//| -//| :param int x: x-coordinate in pixels. Range 0-511 +//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> Any: +//| """:param int x: x-coordinate in pixels. Range 0-511 //| :param int y: y-coordinate in pixels. Range 0-511 //| :param int handle: bitmap handle. Range 0-31 //| :param int cell: cell number. Range 0-127 //| -//| This method is an alternative to :meth:`Vertex2f`. -//| +//| This method is an alternative to :meth:`Vertex2f`.""" +//| ... +//| STATIC mp_obj_t _vertex2ii(size_t n_args, const mp_obj_t *args) { uint32_t x = mp_obj_get_int_truncated(args[1]); @@ -961,12 +972,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(vertex2ii_obj, 3, 5, _vertex2ii); // Hand-written functions { -//| .. method:: Vertex2f(b) -//| -//| Draw a point. +//| def Vertex2f(self, b: Any) -> Any: +//| """Draw a point. //| //| :param float x: pixel x-coordinate -//| :param float y: pixel y-coordinate +//| :param float y: pixel y-coordinate""" +//| ... //| STATIC mp_obj_t _vertex2f(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) { mp_float_t x = mp_obj_get_float(a0); @@ -980,14 +991,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(vertex2f_obj, _vertex2f); #define ADD_X(self, x) \ common_hal__eve_add(EVEHAL(self), sizeof(x), &(x)); -//| .. method:: cmd0(n) -//| -//| Append the command word n to the FIFO +//| def cmd0(self, n: int) -> Any: +//| """Append the command word n to the FIFO //| //| :param int n: The command code //| //| This method is used by the ``eve`` module to efficiently add -//| commands to the FIFO. +//| commands to the FIFO.""" +//| ... //| STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) { @@ -997,9 +1008,8 @@ STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0); -//| .. method:: cmd(n, fmt, args) -//| -//| Append a command packet to the FIFO. +//| def cmd(self, n: int, fmt: str, args: tuple) -> Any: +//| """Append a command packet to the FIFO. //| //| :param int n: The command code //| :param str fmt: The command format `struct` layout @@ -1008,7 +1018,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0); //| Supported format codes: h, H, i, I. //| //| This method is used by the ``eve`` module to efficiently add -//| commands to the FIFO. +//| commands to the FIFO.""" +//| ... //| STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) { mp_obj_t self = args[0]; diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 74bc4d29ea..f60c9e36c7 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -36,25 +36,25 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: fontio +//| class BuiltinFont: +//| """.. currentmodule:: fontio //| -//| :class:`BuiltinFont` -- A font built into CircuitPython -//| ========================================================================================= +//| :class:`BuiltinFont` -- A font built into CircuitPython +//| ========================================================================================= //| -//| A font built into CircuitPython. +//| A font built into CircuitPython.""" //| -//| .. class:: BuiltinFont() -//| -//| Creation not supported. Available fonts are defined when CircuitPython is built. See the -//| `Adafruit_CircuitPython_Bitmap_Font `_ -//| library for dynamically loaded fonts. +//| def __init__(self, ): +//| """Creation not supported. Available fonts are defined when CircuitPython is built. See the +//| `Adafruit_CircuitPython_Bitmap_Font `_ +//| library for dynamically loaded fonts.""" +//| ... //| -//| .. attribute:: bitmap -//| -//| Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use +//| bitmap: Any = ... +//| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use //| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and -//| `terminalio.Terminal`. +//| `terminalio.Terminal`.""" //| STATIC mp_obj_t fontio_builtinfont_obj_get_bitmap(mp_obj_t self_in) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); @@ -69,9 +69,9 @@ const mp_obj_property_t fontio_builtinfont_bitmap_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: get_bounding_box() -//| -//| Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height. +//| def get_bounding_box(self, ) -> Any: +//| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" +//| ... //| STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); @@ -81,9 +81,9 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box); -//| .. method:: get_glyph(codepoint) -//| -//| Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available. +//| def get_glyph(self, codepoint: Any) -> Any: +//| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.""" +//| ... //| STATIC mp_obj_t fontio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/fontio/Glyph.c b/shared-bindings/fontio/Glyph.c index a232841521..6235dbc46f 100644 --- a/shared-bindings/fontio/Glyph.c +++ b/shared-bindings/fontio/Glyph.c @@ -28,23 +28,24 @@ #include -//| .. currentmodule:: fontio +//| class Glyph: +//| """.. currentmodule:: fontio //| -//| :class:`Glyph` -- Storage of glyph info -//| ========================================================================== +//| :class:`Glyph` -- Storage of glyph info +//| ==========================================================================""" //| -//| .. class:: Glyph(bitmap, tile_index, width, height, dx, dy, shift_x, shift_y) +//| def __init__(self, bitmap: displayio.Bitmap, tile_index: int, width: int, height: int, dx: int, dy: int, shift_x: int, shift_y: int): +//| """Named tuple used to capture a single glyph and its attributes. //| -//| Named tuple used to capture a single glyph and its attributes. -//| -//| :param displayio.Bitmap bitmap: the bitmap including the glyph -//| :param int tile_index: the tile index within the bitmap -//| :param int width: the width of the glyph's bitmap -//| :param int height: the height of the glyph's bitmap -//| :param int dx: x adjustment to the bitmap's position -//| :param int dy: y adjustment to the bitmap's position -//| :param int shift_x: the x difference to the next glyph -//| :param int shift_y: the y difference to the next glyph +//| :param displayio.Bitmap bitmap: the bitmap including the glyph +//| :param int tile_index: the tile index within the bitmap +//| :param int width: the width of the glyph's bitmap +//| :param int height: the height of the glyph's bitmap +//| :param int dx: x adjustment to the bitmap's position +//| :param int dy: y adjustment to the bitmap's position +//| :param int shift_x: the x difference to the next glyph +//| :param int shift_y: the y difference to the next glyph""" +//| ... //| const mp_obj_namedtuple_type_t fontio_glyph_type = { .base = { diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index cd0f5ab0f8..478fc18068 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| :mod:`fontio` --- Core font related data structures +//| """:mod:`fontio` --- Core font related data structures //| ========================================================================= //| //| .. module:: fontio @@ -48,7 +48,7 @@ //| :maxdepth: 3 //| //| BuiltinFont -//| Glyph +//| Glyph""" //| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 9ff6cc12d7..5e63b988e3 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -40,23 +40,24 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: framebufferio +//| class FramebufferDisplay: +//| """.. currentmodule:: framebufferio //| -//| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM -//| ================================================================================ +//| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM +//| ================================================================================ //| -//| This initializes a display and connects it into CircuitPython. Unlike other -//| objects in CircuitPython, Display objects live until `displayio.release_displays()` -//| is called. This is done so that CircuitPython can use the display itself. +//| This initializes a display and connects it into CircuitPython. Unlike other +//| objects in CircuitPython, Display objects live until `displayio.release_displays()` +//| is called. This is done so that CircuitPython can use the display itself.""" //| -//| .. class:: FramebufferDisplay(framebuffer, *, rotation=0, auto_refresh=True) +//| def __init__(self, framebuffer: Any, *, rotation: int = 0, auto_refresh: bool = True): +//| """Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) //| -//| Create a Display object with the given framebuffer (a buffer, array, ulab.array, etc) -//| -//| :param framebuffer: The framebuffer that the display is connected to -//| :type framebuffer: any core object implementing the framebuffer protocol -//| :param bool auto_refresh: Automatically refresh the screen -//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270) +//| :param framebuffer: The framebuffer that the display is connected to +//| :type framebuffer: any core object implementing the framebuffer protocol +//| :param bool auto_refresh: Automatically refresh the screen +//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)""" +//| ... //| STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_framebuffer, ARG_rotation, ARG_auto_refresh, NUM_ARGS }; @@ -96,12 +97,12 @@ static framebufferio_framebufferdisplay_obj_t* native_display(mp_obj_t display_o return MP_OBJ_TO_PTR(native_display); } -//| .. method:: show(group) +//| def show(self, group: Group) -> Any: +//| """Switches to displaying the given group of layers. When group is None, the default +//| CircuitPython terminal will be shown. //| -//| Switches to displaying the given group of layers. When group is None, the default -//| CircuitPython terminal will be shown. -//| -//| :param Group group: The group to show. +//| :param Group group: The group to show.""" +//| ... //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_show(mp_obj_t self_in, mp_obj_t group_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -118,21 +119,21 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_show(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_show_obj, framebufferio_framebufferdisplay_obj_show); -//| .. method:: refresh(*, target_frames_per_second=60, minimum_frames_per_second=1) +//| def refresh(self, *, target_frames_per_second: int = 60, minimum_frames_per_second: int = 1) -> Any: +//| """When auto refresh is off, waits for the target frame rate and then refreshes the display, +//| returning True. If the call has taken too long since the last refresh call for the given +//| target frame rate, then the refresh returns False immediately without updating the screen to +//| hopefully help getting caught up. //| -//| When auto refresh is off, waits for the target frame rate and then refreshes the display, -//| returning True. If the call has taken too long since the last refresh call for the given -//| target frame rate, then the refresh returns False immediately without updating the screen to -//| hopefully help getting caught up. +//| If the time since the last successful refresh is below the minimum frame rate, then an +//| exception will be raised. Set minimum_frames_per_second to 0 to disable. //| -//| If the time since the last successful refresh is below the minimum frame rate, then an -//| exception will be raised. Set minimum_frames_per_second to 0 to disable. +//| When auto refresh is on, updates the display immediately. (The display will also update +//| without calls to this.) //| -//| When auto refresh is on, updates the display immediately. (The display will also update -//| without calls to this.) -//| -//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second. +//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. +//| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" +//| ... //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; @@ -153,9 +154,8 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_refresh(size_t n_args, cons } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_refresh_obj, 1, framebufferio_framebufferdisplay_obj_refresh); -//| .. attribute:: auto_refresh -//| -//| True when the display is refreshed automatically. +//| auto_refresh: Any = ... +//| """True when the display is refreshed automatically.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_refresh(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -179,11 +179,10 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: brightness -//| -//| The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When +//| brightness: Any = ... +//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When //| `auto_brightness` is True, the value of `brightness` will change automatically. -//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False. +//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_brightness(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -217,12 +216,11 @@ const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: auto_brightness -//| -//| True when the display brightness is adjusted automatically, based on an ambient +//| auto_brightness: Any = ... +//| """True when the display brightness is adjusted automatically, based on an ambient //| light sensor or other method. Note that some displays may have this set to True by default, //| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False -//| if `brightness` is set manually. +//| if `brightness` is set manually.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_brightness(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -249,9 +247,8 @@ const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: width -//| -//| Gets the width of the framebuffer +//| width: Any = ... +//| """Gets the width of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -266,9 +263,8 @@ const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: height -//| -//| Gets the height of the framebuffer +//| height: Any = ... +//| """Gets the height of the framebuffer""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -283,9 +279,8 @@ const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: rotation -//| -//| The rotation of the display as an int in degrees. +//| rotation: Any = ... +//| """The rotation of the display as an int in degrees.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_rotation(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -307,9 +302,8 @@ const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: framebuffer -//| -//| The framebuffer being used by the display +//| framebuffer: Any = ... +//| """The framebuffer being used by the display""" //| //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_framebuffer(mp_obj_t self_in) { @@ -326,12 +320,13 @@ const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { }; -//| .. method:: fill_row(y, buffer) +//| def fill_row(self, y: int, buffer: bytearray) -> Any: +//| """Extract the pixels from a single row //| -//| Extract the pixels from a single row +//| :param int y: The top edge of the area +//| :param bytearray buffer: The buffer in which to place the pixel data""" +//| ... //| -//| :param int y: The top edge of the area -//| :param bytearray buffer: The buffer in which to place the pixel data STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_y, ARG_buffer }; static const mp_arg_t allowed_args[] = { diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index 88f69bb2c3..50725c5150 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -28,7 +28,7 @@ #include "shared-bindings/framebufferio/__init__.h" #include "shared-bindings/framebufferio/FramebufferDisplay.h" -//| :mod:`framebufferio` --- Native framebuffer display driving +//| """:mod:`framebufferio` --- Native framebuffer display driving //| ========================================================================= //| //| .. module:: framebufferio @@ -46,7 +46,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| FramebufferDisplay +//| FramebufferDisplay""" //| #if CIRCUITPY_FRAMEBUFFERIO diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 6743f87063..270fa87c31 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -35,43 +35,44 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: frequencyio +//| class FrequencyIn: +//| """.. currentmodule:: frequencyio //| -//| :class:`FrequencyIn` -- Read a frequency signal -//| ======================================================== +//| :class:`FrequencyIn` -- Read a frequency signal +//| ======================================================== //| -//| FrequencyIn is used to measure the frequency, in hertz, of a digital signal -//| on an incoming pin. Accuracy has shown to be within 10%, if not better. It -//| is recommended to utilize an average of multiple samples to smooth out readings. +//| FrequencyIn is used to measure the frequency, in hertz, of a digital signal +//| on an incoming pin. Accuracy has shown to be within 10%, if not better. It +//| is recommended to utilize an average of multiple samples to smooth out readings. //| -//| Frequencies below 1KHz are not currently detectable. +//| Frequencies below 1KHz are not currently detectable. //| -//| FrequencyIn will not determine pulse width (use ``PulseIn``). +//| FrequencyIn will not determine pulse width (use ``PulseIn``).""" //| -//| .. class:: FrequencyIn(pin, capture_period=10) +//| def __init__(self, pin: microcontroller.Pin, capture_period: int = 10): +//| """Create a FrequencyIn object associated with the given pin. //| -//| Create a FrequencyIn object associated with the given pin. +//| :param ~microcontroller.Pin pin: Pin to read frequency from. +//| :param int capture_period: Keyword argument to set the measurement period, in +//| milliseconds. Default is 10ms; range is 1ms - 500ms. //| -//| :param ~microcontroller.Pin pin: Pin to read frequency from. -//| :param int capture_period: Keyword argument to set the measurement period, in -//| milliseconds. Default is 10ms; range is 1ms - 500ms. +//| Read the incoming frequency from a pin:: //| -//| Read the incoming frequency from a pin:: +//| import frequencyio +//| import board //| -//| import frequencyio -//| import board +//| frequency = frequencyio.FrequencyIn(board.D11) //| -//| frequency = frequencyio.FrequencyIn(board.D11) +//| # Loop while printing the detected frequency +//| while True: +//| print(frequency.value) //| -//| # Loop while printing the detected frequency -//| while True: -//| print(frequency.value) -//| -//| # Optional clear() will reset the value -//| # to zero. Without this, if the incoming -//| # signal stops, the last reading will remain -//| # as the value. -//| frequency.clear() +//| # Optional clear() will reset the value +//| # to zero. Without this, if the incoming +//| # signal stops, the last reading will remain +//| # as the value. +//| frequency.clear()""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -96,9 +97,9 @@ STATIC mp_obj_t frequencyio_frequencyin_make_new(const mp_obj_type_t *type, size return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the FrequencyIn and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the FrequencyIn and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_deinit(mp_obj_t self_in) { frequencyio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -113,16 +114,16 @@ STATIC void check_for_deinit(frequencyio_frequencyin_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -131,9 +132,9 @@ STATIC mp_obj_t frequencyio_frequencyin_obj___exit__(size_t n_args, const mp_obj } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(frequencyio_frequencyin___exit___obj, 4, 4, frequencyio_frequencyin_obj___exit__); -//| .. method:: pause() -//| -//| Pause frequency capture. +//| def pause(self, ) -> Any: +//| """Pause frequency capture.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_obj_pause(mp_obj_t self_in) { frequencyio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -144,9 +145,9 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_pause_obj, frequencyio_frequencyin_obj_pause); -//| .. method:: resume() -//| -//| Resumes frequency capture. +//| def resume(self, ) -> Any: +//| """Resumes frequency capture.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_obj_resume(mp_obj_t self_in) { frequencyio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -157,9 +158,9 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_resume(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_resume_obj, frequencyio_frequencyin_obj_resume); -//| .. method:: clear() -//| -//| Clears the last detected frequency capture value. +//| def clear(self, ) -> Any: +//| """Clears the last detected frequency capture value.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) { @@ -171,14 +172,13 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_clear_obj, frequencyio_frequencyin_obj_clear); -//| .. attribute:: capture_period -//| -//| The capture measurement period. Lower incoming frequencies will be measured +//| capture_period: Any = ... +//| """The capture measurement period. Lower incoming frequencies will be measured //| more accurately with longer capture periods. Higher frequencies are more //| accurate with shorter capture periods. //| -//| .. note:: When setting a new ``capture_period``, all previous capture information is -//| cleared with a call to ``clear()``. +//| .. note:: When setting a new ``capture_period``, all previous capture information is +//| cleared with a call to ``clear()``.""" //| STATIC mp_obj_t frequencyio_frequencyin_obj_get_capture_period(mp_obj_t self_in) { frequencyio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -204,9 +204,9 @@ const mp_obj_property_t frequencyio_frequencyin_capture_period_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: __get__(index) -//| -//| Returns the value of the last frequency captured. +//| def __get__(self, index: Any) -> Any: +//| """Returns the value of the last frequency captured.""" +//| ... //| STATIC mp_obj_t frequencyio_frequencyin_obj_get_value(mp_obj_t self_in) { frequencyio_frequencyin_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/frequencyio/__init__.c b/shared-bindings/frequencyio/__init__.c index 48a0268249..219d5f6452 100644 --- a/shared-bindings/frequencyio/__init__.c +++ b/shared-bindings/frequencyio/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/frequencyio/__init__.h" #include "shared-bindings/frequencyio/FrequencyIn.h" -//| :mod:`frequencyio` --- Support for frequency based protocols +//| """:mod:`frequencyio` --- Support for frequency based protocols //| ============================================================= //| //| .. module:: frequencyio @@ -73,7 +73,7 @@ //| :py:data:`~frequencyio.FrequencyIn.capture_period`, and then sleep 0.1 seconds. //| CircuitPython will automatically turn off FrequencyIn capture when it resets all //| hardware after program completion. Use ``deinit()`` or a ``with`` statement -//| to do it yourself. +//| to do it yourself.""" //| STATIC const mp_rom_map_elem_t frequencyio_module_globals_table[] = { From 4f33a20d17c7b7688e5dd1ee37346ff2d4f4a340 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 7 May 2020 15:10:44 -0400 Subject: [PATCH 414/919] Added gamepad, gamepadshift, and i2cslave --- shared-bindings/gamepad/GamePad.c | 104 +++++++-------- shared-bindings/gamepad/__init__.c | 4 +- shared-bindings/gamepadshift/GamePadShift.c | 41 +++--- shared-bindings/gamepadshift/__init__.c | 4 +- shared-bindings/i2cslave/I2CSlave.c | 138 ++++++++++---------- shared-bindings/i2cslave/__init__.c | 4 +- 6 files changed, 146 insertions(+), 149 deletions(-) diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index d3c29019a5..946a24dbff 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -34,65 +34,65 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: gamepad +//| class GamePad: +//| """.. currentmodule:: gamepad //| -//| :class:`GamePad` -- Scan buttons for presses -//| ============================================ +//| :class:`GamePad` -- Scan buttons for presses +//| ============================================ //| -//| Usage:: +//| Usage:: //| -//| import board -//| import digitalio -//| import gamepad -//| import time +//| import board +//| import digitalio +//| import gamepad +//| import time //| -//| B_UP = 1 << 0 -//| B_DOWN = 1 << 1 +//| B_UP = 1 << 0 +//| B_DOWN = 1 << 1 //| //| -//| pad = gamepad.GamePad( -//| digitalio.DigitalInOut(board.D10), -//| digitalio.DigitalInOut(board.D11), -//| ) +//| pad = gamepad.GamePad( +//| digitalio.DigitalInOut(board.D10), +//| digitalio.DigitalInOut(board.D11), +//| ) //| -//| y = 0 -//| while True: -//| buttons = pad.get_pressed() -//| if buttons & B_UP: -//| y -= 1 -//| print(y) -//| elif buttons & B_DOWN: -//| y += 1 -//| print(y) -//| time.sleep(0.1) -//| while buttons: -//| # Wait for all buttons to be released. +//| y = 0 +//| while True: //| buttons = pad.get_pressed() +//| if buttons & B_UP: +//| y -= 1 +//| print(y) +//| elif buttons & B_DOWN: +//| y += 1 +//| print(y) //| time.sleep(0.1) +//| while buttons: +//| # Wait for all buttons to be released. +//| buttons = pad.get_pressed() +//| time.sleep(0.1)""" //| -//| .. class:: GamePad([b1[, b2[, b3[, b4[, b5[, b6[, b7[, b8]]]]]]]]) +//| def __init__(self, b1: Any, b2: Any, b3: Any, b4: Any, b5: Any, b6: Any, b7: Any, b8: Any): +//| """Initializes button scanning routines. //| -//| Initializes button scanning routines. +//| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which +//| immediately get switched to input with a pull-up, (unless they already +//| were set to pull-down, in which case they remain so), and then scanned +//| regularly for button presses. The order is the same as the order of +//| bits returned by the ``get_pressed`` function. You can re-initialize +//| it with different keys, then the new object will replace the previous +//| one. //| -//| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which -//| immediately get switched to input with a pull-up, (unless they already -//| were set to pull-down, in which case they remain so), and then scanned -//| regularly for button presses. The order is the same as the order of -//| bits returned by the ``get_pressed`` function. You can re-initialize -//| it with different keys, then the new object will replace the previous -//| one. +//| The basic feature required here is the ability to poll the keys at +//| regular intervals (so that de-bouncing is consistent) and fast enough +//| (so that we don't miss short button presses) while at the same time +//| letting the user code run normally, call blocking functions and wait +//| on delays. //| -//| The basic feature required here is the ability to poll the keys at -//| regular intervals (so that de-bouncing is consistent) and fast enough -//| (so that we don't miss short button presses) while at the same time -//| letting the user code run normally, call blocking functions and wait -//| on delays. -//| -//| They button presses are accumulated, until the ``get_pressed`` method -//| is called, at which point the button state is cleared, and the new -//| button presses start to be recorded. +//| They button presses are accumulated, until the ``get_pressed`` method +//| is called, at which point the button state is cleared, and the new +//| button presses start to be recorded.""" +//| ... //| STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -114,15 +114,15 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| .. method:: get_pressed() -//| -//| Get the status of buttons pressed since the last call and clear it. +//| def get_pressed(self, ) -> Any: +//| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, //| which have been pressed (or held down) since the last call to this //| function set to 1, and the remaining bits set to 0. Then it clears //| the button state, so that new button presses (or buttons that are -//| held down) can be recorded for the next call. +//| held down) can be recorded for the next call.""" +//| ... //| STATIC mp_obj_t gamepad_get_pressed(mp_obj_t self_in) { gamepad_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton); @@ -133,9 +133,9 @@ STATIC mp_obj_t gamepad_get_pressed(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(gamepad_get_pressed_obj, gamepad_get_pressed); -//| .. method:: deinit() -//| -//| Disable button scanning. +//| def deinit(self, ) -> Any: +//| """Disable button scanning.""" +//| ... //| STATIC mp_obj_t gamepad_deinit(mp_obj_t self_in) { common_hal_gamepad_gamepad_deinit(self_in); diff --git a/shared-bindings/gamepad/__init__.c b/shared-bindings/gamepad/__init__.c index cea0b4ee96..0c32fd6c1c 100644 --- a/shared-bindings/gamepad/__init__.c +++ b/shared-bindings/gamepad/__init__.c @@ -29,7 +29,7 @@ #include "shared-bindings/gamepad/GamePad.h" #include "shared-bindings/util.h" -//| :mod:`gamepad` --- Button handling +//| """:mod:`gamepad` --- Button handling //| ================================== //| //| .. module:: gamepad @@ -39,7 +39,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| GamePad +//| GamePad""" //| STATIC const mp_rom_map_elem_t gamepad_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepad) }, diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 91203ad20d..37be3d9576 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -32,24 +32,25 @@ #include "shared-bindings/gamepadshift/__init__.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: gamepadshift +//| class GamePadShift: +//| """.. currentmodule:: gamepadshift //| -//| :class:`GamePadShift` -- Scan buttons for presses through a shift register -//| =========================================================================== +//| :class:`GamePadShift` -- Scan buttons for presses through a shift register +//| ===========================================================================""" //| -//| .. class:: GamePadShift(clock, data, latch) +//| def __init__(self, clock: Any, data: Any, latch: Any): +//| """Initializes button scanning routines. //| -//| Initializes button scanning routines. +//| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` +//| objects connected to the shift register controlling the buttons. //| -//| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` -//| objects connected to the shift register controlling the buttons. +//| They button presses are accumulated, until the ``get_pressed`` method +//| is called, at which point the button state is cleared, and the new +//| button presses start to be recorded. //| -//| They button presses are accumulated, until the ``get_pressed`` method -//| is called, at which point the button state is cleared, and the new -//| button presses start to be recorded. -//| -//| Only one gamepad (`gamepad.GamePad` or `gamepadshift.GamePadShift`) -//| may be used at a time. +//| Only one gamepad (`gamepad.GamePad` or `gamepadshift.GamePadShift`) +//| may be used at a time.""" +//| ... //| STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -81,15 +82,15 @@ STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(gamepad_singleton); } -//| .. method:: get_pressed() -//| -//| Get the status of buttons pressed since the last call and clear it. +//| def get_pressed(self, ) -> Any: +//| """Get the status of buttons pressed since the last call and clear it. //| //| Returns an 8-bit number, with bits that correspond to buttons, //| which have been pressed (or held down) since the last call to this //| function set to 1, and the remaining bits set to 0. Then it clears //| the button state, so that new button presses (or buttons that are -//| held down) can be recorded for the next call. +//| held down) can be recorded for the next call.""" +//| ... //| STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { gamepadshift_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton); @@ -99,9 +100,9 @@ STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed); -//| .. method:: deinit() -//| -//| Disable button scanning. +//| def deinit(self, ) -> Any: +//| """Disable button scanning.""" +//| ... //| STATIC mp_obj_t gamepadshift_deinit(mp_obj_t self_in) { common_hal_gamepadshift_gamepadshift_deinit(self_in); diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c index 2d36677260..3763b04877 100644 --- a/shared-bindings/gamepadshift/__init__.c +++ b/shared-bindings/gamepadshift/__init__.c @@ -30,7 +30,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" -//| :mod:`gamepadshift` --- Tracks button presses read through a shift register +//| """:mod:`gamepadshift` --- Tracks button presses read through a shift register //| =========================================================================== //| //| .. module:: gamepadshift @@ -40,7 +40,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| GamePadShift +//| GamePadShift""" //| STATIC const mp_rom_map_elem_t gamepadshift_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepadshift) }, diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index e28eb3f253..5bab2af74e 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -49,20 +49,21 @@ STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t * return (mp_obj_t)self; } -//| .. currentmodule:: i2cslave +//| class I2CSlave: +//| """.. currentmodule:: i2cslave //| -//| :class:`I2CSlave` --- Two wire serial protocol slave -//| ---------------------------------------------------- +//| :class:`I2CSlave` --- Two wire serial protocol slave +//| ----------------------------------------------------""" //| -//| .. class:: I2CSlave(scl, sda, addresses, smbus=False) +//| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): +//| """I2C is a two-wire protocol for communicating between devices. +//| This implements the slave side. //| -//| I2C is a two-wire protocol for communicating between devices. -//| This implements the slave side. -//| -//| :param ~microcontroller.Pin scl: The clock pin -//| :param ~microcontroller.Pin sda: The data pin -//| :param tuple addresses: The I2C addresses to respond to (how many is hw dependent). -//| :param bool smbus: Use SMBUS timings if the hardware supports it +//| :param ~microcontroller.Pin scl: The clock pin +//| :param ~microcontroller.Pin sda: The data pin +//| :param tuple addresses: The I2C addresses to respond to (how many is hw dependent). +//| :param bool smbus: Use SMBUS timings if the hardware supports it""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { i2cslave_i2c_slave_obj_t *self = m_new_obj(i2cslave_i2c_slave_obj_t); @@ -104,9 +105,9 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ return (mp_obj_t)self; } -//| .. method:: deinit() -//| -//| Releases control of the underlying hardware so other classes can use it. +//| def deinit(self, ) -> Any: +//| """Releases control of the underlying hardware so other classes can use it.""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_obj_deinit(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_type)); @@ -116,16 +117,16 @@ STATIC mp_obj_t i2cslave_i2c_slave_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_deinit); -//| .. method:: __enter__() -//| -//| No-op used in Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware on context exit. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware on context exit. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_type)); @@ -135,13 +136,12 @@ STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *a } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); -//| .. method:: request(timeout=-1) +//| def request(self, timeout: float = -1) -> Any: +//| """Wait for an I2C request from a master. //| -//| Wait for an I2C request from a master. -//| -//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once -//| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cslave.I2CSlaveRequest +//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once +//| :return: I2C Slave Request or None if timeout=-1 and there's no request +//| :rtype: ~i2cslave.I2CSlaveRequest""" //| STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_type)); @@ -228,34 +228,33 @@ const mp_obj_type_t i2cslave_i2c_slave_type = { .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_locals_dict, }; - -//| :class:`I2CSlaveRequest` --- I2C Slave Request -//| ---------------------------------------------- +//| class I2CSlaveRequest: +//| """:class:`I2CSlaveRequest` --- I2C Slave Request +//| ----------------------------------------------""" //| -//| .. class:: I2CSlaveRequest(slave, address, is_read, is_restart) +//| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): +//| """I2C transfer request from a master. +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. //| -//| I2C transfer request from a master. -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. -//| -//| :param ~i2cslave.I2CSlave slave: The I2C Slave receiving this request -//| :param int address: I2C address -//| :param bool is_read: I2C Master read request -//| :param bool is_restart: Repeated Start Condition +//| :param ~i2cslave.I2CSlave slave: The I2C Slave receiving this request +//| :param int address: I2C address +//| :param bool is_read: I2C Master read request +//| :param bool is_restart: Repeated Start Condition""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 4, 4, false); return mp_obj_new_i2cslave_i2c_slave_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } -//| .. method:: __enter__() -//| -//| No-op used in Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used in Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Close the request. +//| def __exit__(self, ) -> Any: +//| """Close the request.""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); @@ -265,9 +264,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_ } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request___exit___obj, 4, 4, i2cslave_i2c_slave_request_obj___exit__); -//| .. attribute:: address -//| -//| The I2C address of the request. +//| address: Any = ... +//| """The I2C address of the request.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); @@ -276,9 +274,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); -//| .. attribute:: is_read -//| -//| The I2C master is reading from the device. +//| is_read: Any = ... +//| """The I2C master is reading from the device.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); @@ -287,9 +284,8 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_read_obj, i2cslave_i2c_slave_request_get_is_read); -//| .. attribute:: is_restart -//| -//| Is Repeated Start Condition. +//| is_restart: Any = ... +//| """Is Repeated Start Condition.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); @@ -298,15 +294,15 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_restart_obj, i2cslave_i2c_slave_request_get_is_restart); -//| .. method:: read(n=-1, ack=True) +//| def read(self, n: int = -1, ack: bool = True) -> Any: +//| """Read data. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. //| -//| Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. -//| -//| :param int n: Number of bytes to read (negative means all) -//| :param bool ack: Whether or not to send an ACK after the n'th byte -//| :return: Bytes read -//| :rtype: bytearray +//| :param int n: Number of bytes to read (negative means all) +//| :param bool ack: Whether or not to send an ACK after the n'th byte +//| :return: Bytes read +//| :rtype: bytearray""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_request_type)); @@ -359,12 +355,12 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p } MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_slave_request_read); -//| .. method:: write(buffer) +//| def write(self, buffer: bytearray) -> Any: +//| """Write the data contained in buffer. //| -//| Write the data contained in buffer. -//| -//| :param bytearray buffer: Write out the data in this buffer -//| :return: Number of bytes written +//| :param bytearray buffer: Write out the data in this buffer +//| :return: Number of bytes written""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); @@ -393,12 +389,12 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ } STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cslave_i2c_slave_request_write_obj, i2cslave_i2c_slave_request_write); -//| .. method:: ack(ack=True) +//| def ack(self, ack: bool = True) -> Any: +//| """Acknowledge or Not Acknowledge last byte received. +//| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. //| -//| Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. -//| -//| :param bool ack: Whether to send an ACK or NACK +//| :param bool ack: Whether to send an ACK or NACK""" +//| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_ack(uint n_args, const mp_obj_t *args) { mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cslave/__init__.c index 1c692e54e7..ffeb216fae 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cslave/__init__.c @@ -35,7 +35,7 @@ #include "py/runtime.h" -//| :mod:`i2cslave` --- Two wire serial protocol slave +//| """:mod:`i2cslave` --- Two wire serial protocol slave //| ================================================== //| //| .. module:: i2cslave @@ -101,7 +101,7 @@ //| //| Raspberry Pi in particular does not support this with its I2C hw block. //| This can be worked around by using the ``i2c-gpio`` bit banging driver. -//| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom. +//| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" //| STATIC const mp_rom_map_elem_t i2cslave_module_globals_table[] = { From e31e9eeaa1e1dad1bd2243b7be76012aa2ee64b8 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 7 May 2020 15:59:52 -0400 Subject: [PATCH 415/919] Did math, microcontroller, and multiterminal --- shared-bindings/math/__init__.c | 164 ++++++++++---------- shared-bindings/microcontroller/Pin.c | 19 +-- shared-bindings/microcontroller/Processor.c | 49 +++--- shared-bindings/microcontroller/RunMode.c | 37 ++--- shared-bindings/microcontroller/__init__.c | 78 +++++----- shared-bindings/multiterminal/__init__.c | 32 ++-- 6 files changed, 184 insertions(+), 195 deletions(-) diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 0bf8047c98..755bf75897 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -38,7 +38,7 @@ #define MP_PI MICROPY_FLOAT_CONST(3.14159265358979323846) -//| :mod:`math` --- mathematical functions +//| """:mod:`math` --- mathematical functions //| ======================================================== //| //| .. module:: math @@ -46,7 +46,7 @@ //| :platform: SAMD21/SAMD51 //| //| The `math` module provides some basic mathematical functions for -//| working with floating-point numbers. +//| working with floating-point numbers.""" //| STATIC NORETURN void math_error(void) { @@ -86,117 +86,113 @@ STATIC NORETURN void math_error(void) { //| Constants //| --------- //| - //| .. data:: e + //| e: Any = ... + //| """base of the natural logarithm""" //| - //| base of the natural logarithm - //| - //| .. data:: pi - //| - //| the ratio of a circle's circumference to its diameter + //| pi: Any = ... + //| """the ratio of a circle's circumference to its diameter""" //| //| Functions //| --------- //| - //| .. function:: acos(x) + //| def acos(x: Any) -> Any: + //| """Return the inverse cosine of ``x``.""" + //| ... //| - //| Return the inverse cosine of ``x``. + //| def asin(x: Any) -> Any: + //| """Return the inverse sine of ``x``.""" + //| ... //| - //| .. function:: asin(x) + //| def atan(x: Any) -> Any: + //| """Return the inverse tangent of ``x``.""" + //| ... //| - //| Return the inverse sine of ``x``. + //| def atan2(y: Any, x: Any) -> Any: + //| """Return the principal value of the inverse tangent of ``y/x``.""" + //| ... //| - //| .. function:: atan(x) + //| def ceil(x: Any) -> Any: + //| """Return an integer, being ``x`` rounded towards positive infinity.""" + //| ... //| - //| Return the inverse tangent of ``x``. + //| def copysign(x: Any, y: Any) -> Any: + //| """Return ``x`` with the sign of ``y``.""" + //| ... //| - //| .. function:: atan2(y,x) + //| def cos(x: Any) -> Any: + //| """Return the cosine of ``x``.""" + //| ... //| - //| Return the principal value of the inverse tangent of ``y/x``. + //| def degrees(x: Any) -> Any: + //| """Return radians ``x`` converted to degrees.""" + //| ... //| - //| .. function:: ceil(x) + //| def exp(x: Any) -> Any: + //| """Return the exponential of ``x``.""" + //| ... //| - //| Return an integer, being ``x`` rounded towards positive infinity. + //| def fabs(x: Any) -> Any: + //| """Return the absolute value of ``x``.""" + //| ... //| - //| .. function:: copysign(x,y) + //| def floor(x: Any) -> Any: + //| """Return an integer, being ``x`` rounded towards negative infinity.""" + //| ... //| - //| Return ``x`` with the sign of ``y``. + //| def fmod(x: Any, y: Any) -> Any: + //| """Return the remainder of ``x/y``.""" + //| ... //| - //| .. function:: cos(x) + //| def frexp(x: Any) -> Any: + //| """Decomposes a floating-point number into its mantissa and exponent. + //| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` + //| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise + //| the relation ``0.5 <= abs(m) < 1`` holds.""" + //| ... //| - //| Return the cosine of ``x``. + //| def isfinite(x: Any) -> Any: + //| """Return ``True`` if ``x`` is finite.""" + //| ... //| - //| .. function:: degrees(x) + //| def isinf(x: Any) -> Any: + //| """Return ``True`` if ``x`` is infinite.""" + //| ... //| - //| Return radians ``x`` converted to degrees. + //| def isnan(x: Any) -> Any: + //| """Return ``True`` if ``x`` is not-a-number""" + //| ... //| - //| .. function:: exp(x) + //| def ldexp(x: Any, exp: Any) -> Any: + //| """Return ``x * (2**exp)``.""" + //| ... //| - //| Return the exponential of ``x``. + //| def modf(x: Any) -> Any: + //| """Return a tuple of two floats, being the fractional and integral parts of + //| ``x``. Both return values have the same sign as ``x``.""" + //| ... //| - //| .. function:: fabs(x) + //| def pow(x: Any, y: Any) -> Any: + //| """Returns ``x`` to the power of ``y``.""" //| - //| Return the absolute value of ``x``. + //| def radians(x: Any) -> Any: + //| """Return degrees ``x`` converted to radians.""" //| - //| .. function:: floor(x) + //| def sin(x: Any) -> Any: + //| """Return the sine of ``x``.""" + //| ... //| - //| Return an integer, being ``x`` rounded towards negative infinity. + //| def sqrt(x: Any) -> Any: + //| """Returns the square root of ``x``.""" + //| ... //| - //| .. function:: fmod(x,y) + //| def tan(x: Any) -> Any: ... + //| """Return the tangent of ``x``.""" + //| ... //| - //| Return the remainder of ``x/y``. - //| - //| .. function:: frexp(x) - //| - //| Decomposes a floating-point number into its mantissa and exponent. - //| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` - //| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise - //| the relation ``0.5 <= abs(m) < 1`` holds. - //| - //| .. function:: isfinite(x) - //| - //| Return ``True`` if ``x`` is finite. - //| - //| .. function:: isinf(x) - //| - //| Return ``True`` if ``x`` is infinite. - //| - //| .. function:: isnan(x) - //| - //| Return ``True`` if ``x`` is not-a-number - //| - //| .. function:: ldexp(x, exp) - //| - //| Return ``x * (2**exp)``. - //| - //| .. function:: modf(x) - //| - //| Return a tuple of two floats, being the fractional and integral parts of - //| ``x``. Both return values have the same sign as ``x``. - //| - //| .. function:: pow(x, y) - //| - //| Returns ``x`` to the power of ``y``. - //| - //| .. function:: radians(x) - //| - //| Return degrees ``x`` converted to radians. - //| - //| .. function:: sin(x) - //| - //| Return the sine of ``x``. - //| - //| .. function:: sqrt(x) - //| - //| Returns the square root of ``x``. - //| - //| .. function:: tan(x) - //| - //| Return the tangent of ``x``. - //| - //| .. function:: trunc(x) - //| - //| Return an integer, being ``x`` rounded towards 0. + //| def trunc(x: Any) -> Any: + //| """Return an integer, being ``x`` rounded towards 0.""" + //| ... //| MATH_FUN_1_ERRCOND(sqrt, sqrt, (x < (mp_float_t)0.0)) diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 67aecaf66e..cad0d67b1d 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -33,18 +33,19 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: microcontroller +//| class Pin: +//| """.. currentmodule:: microcontroller //| -//| :class:`Pin` --- Pin reference -//| ------------------------------------------ +//| :class:`Pin` --- Pin reference +//| ------------------------------------------ //| -//| Identifies an IO pin on the microcontroller. +//| Identifies an IO pin on the microcontroller.""" //| -//| .. class:: Pin() -//| -//| Identifies an IO pin on the microcontroller. They are fixed by the -//| hardware so they cannot be constructed on demand. Instead, use -//| `board` or `microcontroller.pin` to reference the desired pin. +//| def __init__(self, ): +//| """Identifies an IO pin on the microcontroller. They are fixed by the +//| hardware so they cannot be constructed on demand. Instead, use +//| `board` or `microcontroller.pin` to reference the desired pin.""" +//| ... //| static void get_pin_name(const mcu_pin_obj_t *self, qstr* package, qstr* module, qstr* name) { diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index 023f063e02..dedb5a27c2 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -34,29 +34,29 @@ #include "py/runtime.h" -//| .. currentmodule:: microcontroller +//| class Processor: +//| """.. currentmodule:: microcontroller //| -//| :class:`Processor` --- Microcontroller CPU information and control -//| ------------------------------------------------------------------ +//| :class:`Processor` --- Microcontroller CPU information and control +//| ------------------------------------------------------------------ //| -//| Get information about the microcontroller CPU and control it. +//| Get information about the microcontroller CPU and control it. //| -//| Usage:: +//| Usage:: //| -//| import microcontroller -//| print(microcontroller.cpu.frequency) -//| print(microcontroller.cpu.temperature) +//| import microcontroller +//| print(microcontroller.cpu.frequency) +//| print(microcontroller.cpu.temperature)""" //| -//| .. class:: Processor() -//| -//| You cannot create an instance of `microcontroller.Processor`. -//| Use `microcontroller.cpu` to access the sole instance available. +//| def __init__(self, ): +//| """You cannot create an instance of `microcontroller.Processor`. +//| Use `microcontroller.cpu` to access the sole instance available.""" +//| ... //| -//| .. attribute:: frequency -//| -//| The CPU operating frequency as an `int`, in Hertz. (read-only) +//| frequency: Any = ... +//| """The CPU operating frequency as an `int`, in Hertz. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency()); @@ -72,11 +72,10 @@ const mp_obj_property_t mcu_processor_frequency_obj = { }, }; -//| .. attribute:: temperature +//| temperature: Any = ... +//| """The on-chip temperature, in Celsius, as a float. (read-only) //| -//| The on-chip temperature, in Celsius, as a float. (read-only) -//| -//| Is `None` if the temperature is not available. +//| Is `None` if the temperature is not available.""" //| STATIC mp_obj_t mcu_processor_get_temperature(mp_obj_t self) { float temperature = common_hal_mcu_processor_get_temperature(); @@ -93,9 +92,8 @@ const mp_obj_property_t mcu_processor_temperature_obj = { }, }; -//| .. attribute:: uid -//| -//| The unique id (aka serial number) of the chip as a `bytearray`. (read-only) +//| uid: Any = ... +//| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) { uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; @@ -113,11 +111,10 @@ const mp_obj_property_t mcu_processor_uid_obj = { }, }; -//| .. attribute:: voltage +//| voltage: Any = ... +//| """The input voltage to the microcontroller, as a float. (read-only) //| -//| The input voltage to the microcontroller, as a float. (read-only) -//| -//| Is `None` if the voltage is not available. +//| Is `None` if the voltage is not available.""" //| STATIC mp_obj_t mcu_processor_get_voltage(mp_obj_t self) { float voltage = common_hal_mcu_processor_get_voltage(); diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index 913242ad26..df3ff41868 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -26,34 +26,31 @@ #include "shared-bindings/microcontroller/RunMode.h" -//| .. currentmodule:: microcontroller +//| class RunMode: +//| """.. currentmodule:: microcontroller //| -//| :class:`RunMode` -- run state of the microcontroller -//| ============================================================= +//| :class:`RunMode` -- run state of the microcontroller +//| =============================================================""" //| -//| .. class:: RunMode() +//| def __init__(self, ): +//| """Enum-like class to define the run mode of the microcontroller and +//| CircuitPython.""" //| -//| Enum-like class to define the run mode of the microcontroller and -//| CircuitPython. +//| NORMAL: Any = ... +//| """Run CircuitPython as normal. //| -//| .. attribute:: NORMAL +//| :type microcontroller.RunMode:""" //| -//| Run CircuitPython as normal. +//| SAFE_MODE: Any = ... +//| """Run CircuitPython in safe mode. User code will not be run and the +//| file system will be writeable over USB. //| -//| :type microcontroller.RunMode: +//| :type microcontroller.RunMode:""" //| -//| .. attribute:: SAFE_MODE +//| BOOTLOADER: Any = ... +//| """Run the bootloader. //| -//| Run CircuitPython in safe mode. User code will not be run and the -//| file system will be writeable over USB. -//| -//| :type microcontroller.RunMode: -//| -//| .. attribute:: BOOTLOADER -//| -//| Run the bootloader. -//| -//| :type microcontroller.RunMode: +//| :type microcontroller.RunMode:""" //| const mp_obj_type_t mcu_runmode_type; diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 090c4564da..75b7639808 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -42,7 +42,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| :mod:`microcontroller` --- Pin references and cpu functionality +//| """:mod:`microcontroller` --- Pin references and cpu functionality //| ================================================================ //| //| .. module:: microcontroller @@ -59,24 +59,23 @@ //| //| Pin //| Processor -//| RunMode +//| RunMode""" //| -//| .. data:: cpu -//| -//| CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency`` -//| (clock frequency). -//| This object is the sole instance of `microcontroller.Processor`. +//| cpu: Any = ... +//| """CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency`` +//| (clock frequency). +//| This object is the sole instance of `microcontroller.Processor`.""" //| -//| .. function:: delay_us(delay) -//| -//| Dedicated delay method used for very short delays. **Do not** do long delays -//| because this stops all other functions from completing. Think of this as an empty -//| ``while`` loop that runs for the specified ``(delay)`` time. If you have other -//| code or peripherals (e.g audio recording) that require specific timing or -//| processing while you are waiting, explore a different avenue such as using -//| `time.sleep()`. +//| def delay_us(delay: Any) -> Any: +//| """Dedicated delay method used for very short delays. **Do not** do long delays +//| because this stops all other functions from completing. Think of this as an empty +//| ``while`` loop that runs for the specified ``(delay)`` time. If you have other +//| code or peripherals (e.g audio recording) that require specific timing or +//| processing while you are waiting, explore a different avenue such as using +//| `time.sleep()`.""" +//| ... //| STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) { uint32_t delay = mp_obj_get_int(delay_obj); @@ -87,9 +86,9 @@ STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_delay_us_obj, mcu_delay_us); -//| .. function:: disable_interrupts() -//| -//| Disable all interrupts. Be very careful, this can stall everything. +//| def disable_interrupts() -> Any: +//| """Disable all interrupts. Be very careful, this can stall everything.""" +//| ... //| STATIC mp_obj_t mcu_disable_interrupts(void) { common_hal_mcu_disable_interrupts(); @@ -97,9 +96,9 @@ STATIC mp_obj_t mcu_disable_interrupts(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_disable_interrupts_obj, mcu_disable_interrupts); -//| .. function:: enable_interrupts() -//| -//| Enable the interrupts that were enabled at the last disable. +//| def enable_interrupts() -> Any: +//| """Enable the interrupts that were enabled at the last disable.""" +//| ... //| STATIC mp_obj_t mcu_enable_interrupts(void) { common_hal_mcu_enable_interrupts(); @@ -107,12 +106,12 @@ STATIC mp_obj_t mcu_enable_interrupts(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_enable_interrupts_obj, mcu_enable_interrupts); -//| .. function:: on_next_reset(run_mode) +//| def on_next_reset(run_mode: microcontroller.RunMode) -> Any: +//| """Configure the run mode used the next time the microcontroller is reset but +//| not powered down. //| -//| Configure the run mode used the next time the microcontroller is reset but -//| not powered down. -//| -//| :param ~microcontroller.RunMode run_mode: The next run mode +//| :param ~microcontroller.RunMode run_mode: The next run mode""" +//| ... //| STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) { mcu_runmode_t run_mode; @@ -132,14 +131,14 @@ STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mcu_on_next_reset_obj, mcu_on_next_reset); -//| .. function:: reset() +//| def reset() -> Any: +//| """Reset the microcontroller. After reset, the microcontroller will enter the +//| run mode last set by `on_next_reset`. //| -//| Reset the microcontroller. After reset, the microcontroller will enter the -//| run mode last set by `on_next_reset`. -//| -//| .. warning:: This may result in file system corruption when connected to a -//| host computer. Be very careful when calling this! Make sure the device -//| "Safely removed" on Windows or "ejected" on Mac OSX and Linux. +//| .. warning:: This may result in file system corruption when connected to a +//| host computer. Be very careful when calling this! Make sure the device +//| "Safely removed" on Windows or "ejected" on Mac OSX and Linux.""" +//| ... //| STATIC mp_obj_t mcu_reset(void) { common_hal_mcu_reset(); @@ -148,22 +147,21 @@ STATIC mp_obj_t mcu_reset(void) { } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mcu_reset_obj, mcu_reset); -//| .. data:: nvm +//| nvm: Any = ... +//| """Available non-volatile memory. +//| This object is the sole instance of `nvm.ByteArray` when available or ``None`` otherwise. //| -//| Available non-volatile memory. -//| This object is the sole instance of `nvm.ByteArray` when available or ``None`` otherwise. -//| -//| :type: nvm.ByteArray or None +//| :type: nvm.ByteArray or None""" //| -//| :mod:`microcontroller.pin` --- Microcontroller pin names +//| """:mod:`microcontroller.pin` --- Microcontroller pin names //| -------------------------------------------------------- //| //| .. module:: microcontroller.pin //| :synopsis: Microcontroller pin names //| :platform: SAMD21 //| -//| References to pins as named by the microcontroller +//| References to pins as named by the microcontroller""" //| const mp_obj_module_t mcu_pin_module = { .base = { &mp_type_module }, diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index 8de3c50d7b..3a40650191 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| :mod:`multiterminal` --- Manage additional terminal sources +//| """:mod:`multiterminal` --- Manage additional terminal sources //| =========================================================== //| //| .. module:: multiterminal @@ -39,25 +39,25 @@ //| //| The `multiterminal` module allows you to configure an additional serial //| terminal source. Incoming characters are accepted from both the internal -//| serial connection and the optional secondary connection. +//| serial connection and the optional secondary connection.""" //| -//| .. function:: get_secondary_terminal() -//| -//| Returns the current secondary terminal. +//| def get_secondary_terminal() -> Any: +//| """Returns the current secondary terminal.""" +//| ... //| STATIC mp_obj_t multiterminal_obj_get_secondary_terminal() { return common_hal_multiterminal_get_secondary_terminal(); } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_get_secondary_terminal_obj, multiterminal_obj_get_secondary_terminal); -//| .. function:: set_secondary_terminal(stream) -//| -//| Read additional input from the given stream and write out back to it. +//| def set_secondary_terminal(stream: stream) -> Any: +//| """Read additional input from the given stream and write out back to it. //| This doesn't replace the core stream (usually UART or native USB) but is //| mixed in instead. //| -//| :param stream stream: secondary stream +//| :param stream stream: secondary stream""" +//| ... //| STATIC mp_obj_t multiterminal_obj_set_secondary_terminal(mp_obj_t secondary_terminal) { mp_obj_t write_m[3]; @@ -73,9 +73,9 @@ STATIC mp_obj_t multiterminal_obj_set_secondary_terminal(mp_obj_t secondary_term } MP_DEFINE_CONST_FUN_OBJ_1(multiterminal_set_secondary_terminal_obj, multiterminal_obj_set_secondary_terminal); -//| .. function:: clear_secondary_terminal() -//| -//| Clears the secondary terminal. +//| def clear_secondary_terminal() -> Any: +//| """Clears the secondary terminal.""" +//| ... //| STATIC mp_obj_t multiterminal_obj_clear_secondary_terminal() { common_hal_multiterminal_clear_secondary_terminal(); @@ -83,11 +83,11 @@ STATIC mp_obj_t multiterminal_obj_clear_secondary_terminal() { } MP_DEFINE_CONST_FUN_OBJ_0(multiterminal_clear_secondary_terminal_obj, multiterminal_obj_clear_secondary_terminal); -//| .. function:: schedule_secondary_terminal_read(socket) -//| -//| In cases where the underlying OS is doing task scheduling, this notifies +//| def schedule_secondary_terminal_read(socket: Any) -> Any: +//| """In cases where the underlying OS is doing task scheduling, this notifies //| the OS when more data is available on the socket to read. This is useful -//| as a callback for lwip sockets. +//| as a callback for lwip sockets.""" +//| ... //| // TODO(tannewt): This is a funny API. Replace it with a direct call into the OS // by the lwip object. From 94ca233d976a9641c207a244f7c92097cb75da91 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Fri, 8 May 2020 07:55:11 +1000 Subject: [PATCH 416/919] Update py/circuitpy_mpconfig.mk Co-authored-by: Scott Shawcroft --- py/circuitpy_mpconfig.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 95e3512f10..c805b0501a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -109,9 +109,7 @@ CIRCUITPY_DIGITALIO = 1 endif CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) -ifndef CIRCUITPY_COUNTIO -CIRCUITPY_COUNTIO = 1 -endif +CIRCUITPY_COUNTIO ?= 1 CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) From d750096befe2e6d23b1d0d4796306382cfbbb198 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 7 May 2020 18:40:46 -0400 Subject: [PATCH 417/919] Did neopixel, network, nvm --- shared-bindings/neopixel_write/__init__.c | 13 ++++----- shared-bindings/network/__init__.c | 10 +++---- shared-bindings/nvm/ByteArray.c | 34 +++++++++++++---------- shared-bindings/nvm/__init__.c | 5 ++-- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index 1ee66337bb..f18c7fdfd1 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -31,7 +31,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "supervisor/shared/translate.h" -//| :mod:`neopixel_write` --- Low-level neopixel implementation +//| """:mod:`neopixel_write` --- Low-level neopixel implementation //| =========================================================== //| //| .. module:: neopixel_write @@ -53,15 +53,14 @@ //| pin = digitalio.DigitalInOut(board.NEOPIXEL) //| pin.direction = digitalio.Direction.OUTPUT //| pixel_off = bytearray([0, 0, 0]) -//| neopixel_write.neopixel_write(pin, pixel_off) +//| neopixel_write.neopixel_write(pin, pixel_off)""" //| -//| .. function:: neopixel_write(digitalinout, buf) -//| -//| Write buf out on the given DigitalInOut. +//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> Any: +//| """Write buf out on the given DigitalInOut. //| //| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with -//| :param bytearray buf: The bytes to clock out. No assumption is made about color order -//| +//| :param bytearray buf: The bytes to clock out. No assumption is made about color order""" +//| ... STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { if (!MP_OBJ_IS_TYPE(digitalinout_obj, &digitalio_digitalinout_type)) { mp_raise_TypeError_varg(translate("Expected a %q"), digitalio_digitalinout_type.name); diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 01763a73c5..4f03781cf4 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -38,7 +38,7 @@ #if CIRCUITPY_NETWORK -//| :mod:`network` --- Network Interface Management +//| """:mod:`network` --- Network Interface Management //| =============================================== //| //| .. module:: network @@ -47,11 +47,11 @@ //| //| This module provides a registry of configured NICs. //| It is used by the 'socket' module to look up a suitable -//| NIC when a socket is created. +//| NIC when a socket is created.""" //| -//| .. function:: route() -//| -//| Returns a list of all configured NICs. +//| def route() -> Any: +//| """Returns a list of all configured NICs.""" +//| ... //| STATIC mp_obj_t network_route(void) { diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 31bedeacc0..a28c2c4f9a 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -31,29 +31,33 @@ #include "shared-bindings/nvm/ByteArray.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: nvm + + + +//| class ByteArray: +//| """.. currentmodule:: nvm //| -//| :class:`ByteArray` -- Presents a stretch of non-volatile memory as a bytearray. -//| ================================================================================ +//| :class:`ByteArray` -- Presents a stretch of non-volatile memory as a bytearray. +//| ================================================================================ //| -//| Non-volatile memory is available as a byte array that persists over reloads -//| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign -//| all values to change at once. +//| Non-volatile memory is available as a byte array that persists over reloads +//| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign +//| all values to change at once. //| -//| Usage:: +//| Usage:: //| -//| import microcontroller -//| microcontroller.nvm[0:3] = b"\xcc\x10\x00" +//| import microcontroller +//| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\"""" //| -//| .. class:: ByteArray() -//| -//| Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`. +//| def __init__(self, ): +//| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`.""" +//| ... //| -//| .. method:: __len__() -//| -//| Return the length. This is used by (`len`) +//| def __len__(self, ) -> Any: +//| """Return the length. This is used by (`len`)""" +//| ... //| STATIC mp_obj_t nvm_bytearray_unary_op(mp_unary_op_t op, mp_obj_t self_in) { nvm_bytearray_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c index 811855c093..3bd9a309b5 100644 --- a/shared-bindings/nvm/__init__.c +++ b/shared-bindings/nvm/__init__.c @@ -31,7 +31,7 @@ #include "shared-bindings/nvm/__init__.h" #include "shared-bindings/nvm/ByteArray.h" -//| :mod:`nvm` --- Non-volatile memory +//| """:mod:`nvm` --- Non-volatile memory //| =========================================================== //| //| .. module:: nvm @@ -47,7 +47,8 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| ByteArray +//| ByteArray""" +//| STATIC const mp_rom_map_elem_t nvm_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_nvm) }, { MP_ROM_QSTR(MP_QSTR_ByteArray), MP_ROM_PTR(&nvm_bytearray_type) }, From 182ae10080d85adc34d7865c9b8cccf4b3d2f89c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 May 2020 14:44:08 -0500 Subject: [PATCH 418/919] Fix build after #2831 (stm32f4xx rgbmatrix) broke it --- lib/protomatter | 2 +- ports/stm/mpconfigport.mk | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index 1b8f461f64..9f71088d2c 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit 1b8f461f6401d6418bba5c6ec0108375c2c1b62f +Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index d23c14b7b6..06dace8439 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -3,12 +3,15 @@ LONGINT_IMPL = MPZ INTERNAL_LIBM = 1 USB_SERIAL_NUMBER_LENGTH = 24 +ifeq ($(MCU_VARIANT),STM32F405xx) + CIRCUITPY_FRAMEBUFFERIO = 1 + CIRCUITPY_RGBMATRIX = 1 +endif + ifeq ($(MCU_SERIES),F4) # Not yet implemented common-hal modules: CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_FRAMEBUFFERIO = 1 - CIRCUITPY_RGBMATRIX = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 From 5249a7b02cc326d7b88caa90d6def6a10d84525a Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 7 May 2020 14:49:33 -0400 Subject: [PATCH 419/919] Add timeout and adjustment to LSI --- ports/stm/supervisor/port.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 779348c02a..328a8d660c 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -153,9 +153,9 @@ __attribute__((used, naked)) void Reset_Handler(void) { static RTC_HandleTypeDef _hrtc; #if BOARD_HAS_LOW_SPEED_CRYSTAL -#define RTC_CLOCK_FREQUENCY LSE_VALUE +static uint32_t rtc_clock_frequency = LSE_VALUE; #else -#define RTC_CLOCK_FREQUENCY LSI_VALUE +static uint32_t rtc_clock_frequency = LSI_VALUE; #endif safe_mode_t port_init(void) { @@ -172,22 +172,36 @@ safe_mode_t port_init(void) { HAL_PWR_EnableBkUpAccess(); #if BOARD_HAS_LOW_SPEED_CRYSTAL __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); - while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) {} + bool lse_setupsuccess = true; + uint32_t i = 0; + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { + if ( ++i > 1000000 ) + { + lse_setupsuccess = false; + __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); + __HAL_RCC_LSI_ENABLE(); + rtc_clock_frequency = LSI_VALUE; + } + } #else __HAL_RCC_LSI_ENABLE(); #endif #if BOARD_HAS_LOW_SPEED_CRYSTAL - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); + if (lse_setupsuccess) { + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); + } else { + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); + } #else __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); #endif __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - // Divide async as little as possible so that we have RTC_CLOCK_FREQUENCY count in subseconds. + // Divide async as little as possible so that we have rtc_clock_frequency count in subseconds. // This ensures our timing > 1 second is correct. _hrtc.Init.AsynchPrediv = 0x0; - _hrtc.Init.SynchPrediv = RTC_CLOCK_FREQUENCY - 1; + _hrtc.Init.SynchPrediv = rtc_clock_frequency - 1; _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; HAL_RTC_Init(&_hrtc); @@ -293,7 +307,7 @@ volatile uint32_t cached_date = 0; volatile uint32_t seconds_to_minute = 0; volatile uint32_t cached_hours_minutes = 0; uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t subseconds = RTC_CLOCK_FREQUENCY - (uint32_t)(RTC->SSR); + uint32_t subseconds = rtc_clock_frequency - (uint32_t)(RTC->SSR); uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); if (date != cached_date) { @@ -341,7 +355,7 @@ void RTC_Alarm_IRQHandler(void) { // Enable 1/1024 second tick. void port_enable_tick(void) { - HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, RTC_CLOCK_FREQUENCY / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); + HAL_RTCEx_SetWakeUpTimer_IT(&_hrtc, rtc_clock_frequency / 1024 / 2, RTC_WAKEUPCLOCK_RTCCLK_DIV2); HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 1, 0U); HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); } @@ -372,7 +386,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { alarm.AlarmMask = RTC_ALARMMASK_ALL; } - alarm.AlarmTime.SubSeconds = RTC_CLOCK_FREQUENCY - + alarm.AlarmTime.SubSeconds = rtc_clock_frequency - ((raw_ticks % 1024) * 32); alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; From 37e5ff7757f753516b5fca5aa345f6d112f8b2fa Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 8 May 2020 13:25:52 -0400 Subject: [PATCH 420/919] Update colorwheel from GRB to RGB. --- shared-bindings/_pixelbuf/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 424ed23e4c..394ab3a9df 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -69,10 +69,10 @@ const int32_t colorwheel(float pos) { pos = pos - ((uint32_t)(pos / 256) * 256); } if (pos < 85) - return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8; + return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3); else if (pos < 170) { pos -= 85; - return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3); + return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8; } else { pos -= 170; return (uint8_t)(pos * 3) << 8 | (uint8_t)(255 - pos * 3); From a83d1d7b4b8f5ad1220a9ce9a4a08d8f50116bab Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 8 May 2020 14:44:41 -0400 Subject: [PATCH 421/919] Update wheel to colorwheel and fix RGB order. --- shared-bindings/_pixelbuf/__init__.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 394ab3a9df..744a8a2b86 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -53,36 +53,39 @@ //| PixelBuf -//| .. function:: wheel(n) +//| .. function:: colorwheel(n) //| //| C implementation of the common wheel() function found in many examples. //| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar). //| +//| .. function:: wheel(n) +//| Use of wheel() is deprecated. Please use colorwheel(). -STATIC mp_obj_t pixelbuf_wheel(mp_obj_t n) { +STATIC mp_obj_t pixelbuf_colorwheel(mp_obj_t n) { return MP_OBJ_NEW_SMALL_INT(colorwheel(MP_OBJ_IS_SMALL_INT(n) ? MP_OBJ_SMALL_INT_VALUE(n) : mp_obj_float_get(n))); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_wheel_obj, pixelbuf_wheel); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_colorwheel_obj, pixelbuf_colorwheel); const int32_t colorwheel(float pos) { if (pos > 255) { pos = pos - ((uint32_t)(pos / 256) * 256); } if (pos < 85) - return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3); + return (uint8_t)(255 - (pos * 3)) << 16 | (uint8_t)(pos * 3) << 8; else if (pos < 170) { pos -= 85; - return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)) << 8; + return (uint8_t)(255 - (pos * 3)) << 8 | (uint8_t)(pos * 3); } else { pos -= 170; - return (uint8_t)(pos * 3) << 8 | (uint8_t)(255 - pos * 3); + return (uint8_t)(pos * 3) << 16 | (uint8_t)(255 - (pos * 3)); } } STATIC const mp_rom_map_elem_t pixelbuf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pixelbuf) }, { MP_ROM_QSTR(MP_QSTR_PixelBuf), MP_ROM_PTR(&pixelbuf_pixelbuf_type) }, - { MP_ROM_QSTR(MP_QSTR_wheel), MP_ROM_PTR(&pixelbuf_wheel_obj) }, + { MP_ROM_QSTR(MP_QSTR_wheel), MP_ROM_PTR(&pixelbuf_colorwheel_obj) }, + { MP_ROM_QSTR(MP_QSTR_colorwheel), MP_ROM_PTR(&pixelbuf_colorwheel_obj) }, }; STATIC MP_DEFINE_CONST_DICT(pixelbuf_module_globals, pixelbuf_module_globals_table); From 09530e5dc34d6fbcbf5fa85a1f7df9d47d8c8329 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 8 May 2020 16:03:39 -0400 Subject: [PATCH 422/919] Did os, _pixelbuf, _pew --- shared-bindings/_pew/PewPew.c | 40 ++++----- shared-bindings/_pew/__init__.c | 4 +- shared-bindings/_pixelbuf/PixelBuf.c | 94 ++++++++++----------- shared-bindings/_pixelbuf/__init__.c | 14 ++-- shared-bindings/os/__init__.c | 120 +++++++++++++-------------- 5 files changed, 134 insertions(+), 138 deletions(-) diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 3ff2087614..37188d2b74 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -34,33 +34,33 @@ #include "shared-module/_pew/PewPew.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: _pew +//| class PewPew: +//| """.. currentmodule:: _pew //| -//| :class:`PewPew` -- LED matrix and button driver -//| =============================================== +//| :class:`PewPew` -- LED matrix and button driver +//| =============================================== //| -//| This is an internal module to be used by the ``pew.py`` library from -//| https://github.com/pewpew-game/pew-pewpew-standalone-10.x to handle the -//| LED matrix display and buttons on the ``pewpew10`` board. +//| This is an internal module to be used by the ``pew.py`` library from +//| https://github.com/pewpew-game/pew-pewpew-standalone-10.x to handle the +//| LED matrix display and buttons on the ``pewpew10`` board. //| -//| Usage:: +//| Usage:: //| -//| This singleton class is instantiated by the ``pew`` library, and -//| used internally by it. All user-visible interactions are done through -//| that library. +//| This singleton class is instantiated by the ``pew`` library, and +//| used internally by it. All user-visible interactions are done through +//| that library.""" //| -//| .. class:: PewPew(buffer, rows, cols, buttons) +//| def __init__(self, buffer: Any, rows: Any, cols: Any, buttons: Any): +//| """Initializes matrix scanning routines. //| -//| Initializes matrix scanning routines. -//| -//| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should -//| be displayed on the matrix. ``rows`` and ``cols`` are both lists of -//| eight ``DigitalInputOutput`` objects that are connected to the matrix -//| rows and columns. ``buttons`` is a ``DigitalInputOutput`` object that -//| is connected to the common side of all buttons (the other sides of the -//| buttons are connected to rows of the matrix). +//| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should +//| be displayed on the matrix. ``rows`` and ``cols`` are both lists of +//| eight ``DigitalInputOutput`` objects that are connected to the matrix +//| rows and columns. ``buttons`` is a ``DigitalInputOutput`` object that +//| is connected to the common side of all buttons (the other sides of the +//| buttons are connected to rows of the matrix).""" +//| ... //| STATIC mp_obj_t pewpew_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index 6c5520ac58..b6aab67264 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -41,7 +41,7 @@ STATIC mp_obj_t get_pressed(void) { STATIC MP_DEFINE_CONST_FUN_OBJ_0(get_pressed_obj, get_pressed); -//| :mod:`_pew` --- LED matrix driver +//| """:mod:`_pew` --- LED matrix driver //| ================================== //| //| .. module:: _pew @@ -51,7 +51,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(get_pressed_obj, get_pressed); //| .. toctree:: //| :maxdepth: 3 //| -//| PewPew +//| PewPew""" //| STATIC const mp_rom_map_elem_t pew_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pew) }, diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 61b4c9ae09..1c0888802d 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -44,31 +44,32 @@ extern const int32_t colorwheel(float pos); static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t* parsed); -//| .. currentmodule:: pixelbuf +//| class PixelBuf: +//| """.. currentmodule:: pixelbuf //| -//| :class:`PixelBuf` -- A fast RGB[W] pixel buffer for LED and similar devices -//| =========================================================================== +//| :class:`PixelBuf` -- A fast RGB[W] pixel buffer for LED and similar devices +//| =========================================================================== //| -//| :class:`~_pixelbuf.PixelBuf` implements an RGB[W] bytearray abstraction. +//| :class:`~_pixelbuf.PixelBuf` implements an RGB[W] bytearray abstraction.""" //| -//| .. class:: PixelBuf(size, *, byteorder="BGR", brightness=0, auto_write=False, header=b"", trailer=b"") +//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b""): +//| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel. //| -//| Create a PixelBuf object of the specified size, byteorder, and bits per pixel. +//| When brightness is less than 1.0, a second buffer will be used to store the color values +//| before they are adjusted for brightness. //| -//| When brightness is less than 1.0, a second buffer will be used to store the color values -//| before they are adjusted for brightness. +//| When ``P`` (pwm duration) is present as the 4th character of the byteorder +//| string, the 4th value in the tuple/list for a pixel is the individual pixel +//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the +//| output buffer (``buf``). //| -//| When ``P`` (pwm duration) is present as the 4th character of the byteorder -//| string, the 4th value in the tuple/list for a pixel is the individual pixel -//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the -//| output buffer (``buf``). -//| -//| :param ~int size: Number of pixelsx -//| :param ~str byteorder: Byte order string (such as "BGR" or "PBGR") -//| :param ~float brightness: Brightness (0 to 1.0, default 1.0) -//| :param ~bool auto_write: Whether to automatically write pixels (Default False) -//| :param bytes header: Sequence of bytes to always send before pixel values. -//| :param bytes trailer: Sequence of bytes to always send after pixel values. +//| :param ~int size: Number of pixelsx +//| :param ~str byteorder: Byte order string (such as "BGR" or "PBGR") +//| :param ~float brightness: Brightness (0 to 1.0, default 1.0) +//| :param ~bool auto_write: Whether to automatically write pixels (Default False) +//| :param bytes header: Sequence of bytes to always send before pixel values. +//| :param bytes trailer: Sequence of bytes to always send after pixel values.""" +//| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, MP_OBJ_FUN_ARGS_MAX, true); @@ -156,9 +157,8 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t } } -//| .. attribute:: bpp -//| -//| The number of bytes per pixel in the buffer (read-only) +//| bpp: Any = ... +//| """The number of bytes per pixel in the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_bpp(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal__pixelbuf_pixelbuf_get_bpp(self_in)); @@ -173,12 +173,11 @@ const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = { }; -//| .. attribute:: brightness -//| -//| Float value between 0 and 1. Output brightness. +//| brightness: Any = ... +//| """Float value between 0 and 1. Output brightness. //| //| When brightness is less than 1.0, a second buffer will be used to store the color values -//| before they are adjusted for brightness. +//| before they are adjusted for brightness.""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_brightness(mp_obj_t self_in) { return mp_obj_new_float(common_hal__pixelbuf_pixelbuf_get_brightness(self_in)); @@ -205,9 +204,8 @@ const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: auto_write -//| -//| Whether to automatically write the pixels after each update. +//| auto_write: Any = ... +//| """Whether to automatically write the pixels after each update.""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_auto_write(mp_obj_t self_in) { return mp_obj_new_bool(common_hal__pixelbuf_pixelbuf_get_auto_write(self_in)); @@ -228,9 +226,8 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: byteorder -//| -//| byteorder string for the buffer (read-only) +//| byteorder: Any = ... +//| """byteorder string for the buffer (read-only)""" //| STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) { return common_hal__pixelbuf_pixelbuf_get_byteorder_string(self_in); @@ -253,10 +250,10 @@ STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| .. method:: show() -//| -//| Transmits the color data to the pixels so that they are shown. This is done automatically -//| when `auto_write` is True. +//| def show(self, ) -> Any: +//| """Transmits the color data to the pixels so that they are shown. This is done automatically +//| when `auto_write` is True.""" +//| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) { @@ -265,9 +262,9 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_show_obj, pixelbuf_pixelbuf_show); -//| .. function:: fill(color) -//| -//| Fills the given pixelbuf with the given color. +//| def fill(color: Any) -> Any: +//| """Fills the given pixelbuf with the given color.""" +//| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) { @@ -277,17 +274,16 @@ STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_fill); - -//| .. method:: __getitem__(index) +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values +//| between 0 and 255.""" +//| ... //| -//| Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values -//| between 0 and 255. -//| -//| .. method:: __setitem__(index, value) -//| -//| Sets the pixel value at the given index. Value can either be a tuple of (Red, Green, Blue -//| [, White]) values between 0 and 255 or an integer where the red, green and blue values are -//| packed into the lower three bytes (0xRRGGBB). +//| def __setitem__(self, index: Any, value: Any) -> Any: +//| """Sets the pixel value at the given index. Value can either be a tuple of (Red, Green, Blue +//| [, White]) values between 0 and 255 or an integer where the red, green and blue values are +//| packed into the lower three bytes (0xRRGGBB).""" +//| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { if (value == MP_OBJ_NULL) { diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 424ed23e4c..3c04d436ad 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/_pixelbuf/PixelBuf.h" -//| :mod:`_pixelbuf` --- Fast RGB(W) pixel buffer and helpers +//| """:mod:`_pixelbuf` --- Fast RGB(W) pixel buffer and helpers //| =========================================================== //| .. module:: _pixelbuf @@ -50,13 +50,13 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| PixelBuf - - -//| .. function:: wheel(n) +//| PixelBuf""" //| -//| C implementation of the common wheel() function found in many examples. -//| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar). + +//| def wheel(n: Any) -> Any: +//| """C implementation of the common wheel() function found in many examples. +//| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar).""" +//| ... //| STATIC mp_obj_t pixelbuf_wheel(mp_obj_t n) { diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index f3b745aefe..2a6b13c9b0 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -37,7 +37,7 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" -//| :mod:`os` --- functions that an OS normally provides +//| """:mod:`os` --- functions that an OS normally provides //| ======================================================== //| //| .. module:: os @@ -46,22 +46,22 @@ //| //| The `os` module is a strict subset of the CPython `cpython:os` module. So, //| code written in CircuitPython will work in CPython but not necessarily the -//| other way around. +//| other way around.""" //| -//| .. function:: uname() -//| -//| Returns a named tuple of operating specific and CircuitPython port -//| specific information. +//| def uname() -> Any: +//| """Returns a named tuple of operating specific and CircuitPython port +//| specific information.""" +//| ... //| STATIC mp_obj_t os_uname(void) { return common_hal_os_uname(); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname); -//| .. function:: chdir(path) -//| -//| Change current directory. +//| def chdir(path: Any) -> Any: +//| """Change current directory.""" +//| ... //| mp_obj_t os_chdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -70,18 +70,18 @@ mp_obj_t os_chdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_chdir_obj, os_chdir); -//| .. function:: getcwd() -//| -//| Get the current directory. +//| def getcwd() -> Any: +//| """Get the current directory.""" +//| ... //| mp_obj_t os_getcwd(void) { return common_hal_os_getcwd(); } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); -//| .. function:: listdir([dir]) -//| -//| With no argument, list the current directory. Otherwise list the given directory. +//| def listdir(dir: Any) -> Any: +//| """With no argument, list the current directory. Otherwise list the given directory.""" +//| ... //| mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { const char* path; @@ -94,9 +94,9 @@ mp_obj_t os_listdir(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(os_listdir_obj, 0, 1, os_listdir); -//| .. function:: mkdir(path) -//| -//| Create a new directory. +//| def mkdir(path: Any) -> Any: +//| """Create a new directory.""" +//| ... //| mp_obj_t os_mkdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -105,9 +105,9 @@ mp_obj_t os_mkdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_mkdir_obj, os_mkdir); -//| .. function:: remove(path) -//| -//| Remove a file. +//| def remove(path: Any) -> Any: +//| """Remove a file.""" +//| ... //| mp_obj_t os_remove(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -116,9 +116,9 @@ mp_obj_t os_remove(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_remove_obj, os_remove); -//| .. function:: rmdir(path) -//| -//| Remove a directory. +//| def rmdir(path: Any) -> Any: +//| """Remove a directory.""" +//| ... //| mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { const char *old_path = mp_obj_str_get_str(old_path_in); @@ -128,9 +128,9 @@ mp_obj_t os_rename(mp_obj_t old_path_in, mp_obj_t new_path_in) { } MP_DEFINE_CONST_FUN_OBJ_2(os_rename_obj, os_rename); -//| .. function:: rename(old_path, new_path) -//| -//| Rename a file. +//| def rename(old_path: Any, new_path: Any) -> Any: +//| """Rename a file.""" +//| ... //| mp_obj_t os_rmdir(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -139,14 +139,14 @@ mp_obj_t os_rmdir(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); -//| .. function:: stat(path) +//| def stat(path: Any) -> Any: +//| """Get the status of a file or directory. //| -//| Get the status of a file or directory. -//| -//| .. note:: On builds without long integers, the number of seconds -//| for contemporary dates will not fit in a small integer. -//| So the time fields return 946684800, -//| which is the number of seconds corresponding to 1999-12-31. +//| .. note:: On builds without long integers, the number of seconds +//| for contemporary dates will not fit in a small integer. +//| So the time fields return 946684800, +//| which is the number of seconds corresponding to 1999-12-31.""" +//| ... //| mp_obj_t os_stat(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -154,26 +154,26 @@ mp_obj_t os_stat(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_stat_obj, os_stat); -//| .. function:: statvfs(path) +//| def statvfs(path: Any) -> Any: +//| """Get the status of a fileystem. //| -//| Get the status of a fileystem. +//| Returns a tuple with the filesystem information in the following order: //| -//| Returns a tuple with the filesystem information in the following order: +//| * ``f_bsize`` -- file system block size +//| * ``f_frsize`` -- fragment size +//| * ``f_blocks`` -- size of fs in f_frsize units +//| * ``f_bfree`` -- number of free blocks +//| * ``f_bavail`` -- number of free blocks for unpriviliged users +//| * ``f_files`` -- number of inodes +//| * ``f_ffree`` -- number of free inodes +//| * ``f_favail`` -- number of free inodes for unpriviliged users +//| * ``f_flag`` -- mount flags +//| * ``f_namemax`` -- maximum filename length //| -//| * ``f_bsize`` -- file system block size -//| * ``f_frsize`` -- fragment size -//| * ``f_blocks`` -- size of fs in f_frsize units -//| * ``f_bfree`` -- number of free blocks -//| * ``f_bavail`` -- number of free blocks for unpriviliged users -//| * ``f_files`` -- number of inodes -//| * ``f_ffree`` -- number of free inodes -//| * ``f_favail`` -- number of free inodes for unpriviliged users -//| * ``f_flag`` -- mount flags -//| * ``f_namemax`` -- maximum filename length -//| -//| Parameters related to inodes: ``f_files``, ``f_ffree``, ``f_avail`` -//| and the ``f_flags`` parameter may return ``0`` as they can be unavailable -//| in a port-specific implementation. +//| Parameters related to inodes: ``f_files``, ``f_ffree``, ``f_avail`` +//| and the ``f_flags`` parameter may return ``0`` as they can be unavailable +//| in a port-specific implementation.""" +//| ... //| mp_obj_t os_statvfs(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); @@ -181,9 +181,9 @@ mp_obj_t os_statvfs(mp_obj_t path_in) { } MP_DEFINE_CONST_FUN_OBJ_1(os_statvfs_obj, os_statvfs); -//| .. function:: sync() -//| -//| Sync all filesystems. +//| def sync() -> Any: +//| """Sync all filesystems.""" +//| ... //| STATIC mp_obj_t os_sync(void) { for (mp_vfs_mount_t *vfs = MP_STATE_VM(vfs_mount_table); vfs != NULL; vfs = vfs->next) { @@ -194,10 +194,10 @@ STATIC mp_obj_t os_sync(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_sync_obj, os_sync); -//| .. function:: urandom(size) -//| -//| Returns a string of *size* random bytes based on a hardware True Random -//| Number Generator. When not available, it will raise a NotImplementedError. +//| def urandom(size: Any) -> Any: +//| """Returns a string of *size* random bytes based on a hardware True Random +//| Number Generator. When not available, it will raise a NotImplementedError.""" +//| ... //| STATIC mp_obj_t os_urandom(mp_obj_t size_in) { mp_int_t size = mp_obj_get_int(size_in); @@ -229,9 +229,9 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&os_urandom_obj) }, -//| .. data:: sep +//| """.. data:: sep //| -//| Separator used to delineate path components such as folder and file names. +//| Separator used to delineate path components such as folder and file names.""" //| { MP_ROM_QSTR(MP_QSTR_sep), MP_ROM_QSTR(MP_QSTR__slash_) }, }; From e7fc8060345d4200dfda920c7f29298377190eae Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 8 May 2020 16:33:26 -0500 Subject: [PATCH 423/919] Throw a NotImplementedError for time functions on boards without long ints Fix for Issue #2812. Instead of reporting a missing attribute for functions such as time.time() and time.mktime(); platforms that do not have long integer support will raise a NotImplementedError --- shared-bindings/time/__init__.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 8d7f2f3fd2..ef75a23bda 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -188,6 +188,14 @@ void struct_time_to_tm(mp_obj_t t, timeutils_struct_time_t *tm) { tm->tm_yday = mp_obj_get_int(elems[7]); // elems[8] tm_isdst is not supported } +#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE +// Function to return a NotImplementedError on platforms that don't +// support long integers +STATIC mp_obj_t time_not_implemented(void) { + mp_raise_NotImplementedError(translate("No long integer support")); +} +MP_DEFINE_CONST_FUN_OBJ_0(time_not_implemented_obj, time_not_implemented); +#endif #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE mp_obj_t MP_WEAK rtc_get_time_source_time(void) { @@ -307,6 +315,12 @@ STATIC const mp_rom_map_elem_t time_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_time_obj) }, { MP_ROM_QSTR(MP_QSTR_monotonic_ns), MP_ROM_PTR(&time_monotonic_ns_obj) }, #endif + #if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE + { MP_ROM_QSTR(MP_QSTR_localtime), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_mktime), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_time), MP_ROM_PTR(&time_not_implemented_obj) }, + { MP_ROM_QSTR(MP_QSTR_monotonic_ns), MP_ROM_PTR(&time_not_implemented_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table); From 4435cf0020976422584de5da8f06a052d3c92ca1 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2020 17:15:50 -0500 Subject: [PATCH 424/919] make translate --- lib/protomatter | 2 +- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 10 +++++++--- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 15 files changed, 73 insertions(+), 17 deletions(-) diff --git a/lib/protomatter b/lib/protomatter index c411714cbd..9f71088d2c 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit c411714cbdc05725e80398acb18c3c1fb6fa68a4 +Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 diff --git a/locale/ID.po b/locale/ID.po index 32053577c0..7ccd090c0d 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1121,6 +1121,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index aa465b0b72..b0e7a5a6c4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 20:38-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1110,6 +1110,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f759bc28cf..376db44c8f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-04-26 14:46-0500\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2020-04-30 17:01+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: fil\n" @@ -1126,6 +1126,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 3332654510..65a0771455 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-20 17:57-0500\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2020-03-29 17:02+0000\n" "Last-Translator: Weblate Admin \n" "Language-Team: French \n" "Language-Team: \n" @@ -1130,6 +1130,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 4f87e51c9a..b18890bcc4 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1114,6 +1114,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/pl.po b/locale/pl.po index cdf64cd038..71d501c8b1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1115,6 +1115,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1398bb266f..51d5180a87 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1122,6 +1122,10 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/sv.po b/locale/sv.po index d9beb3f551..0eaa91d16f 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 20:38-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1110,6 +1110,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b56cc3ce52..01c815b0df 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-04 19:52-0400\n" +"POT-Creation-Date: 2020-05-08 17:15-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1123,6 +1123,10 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì." From 8d00d99ca012fd0298dcfb67bb28262004c43e73 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 May 2020 22:51:21 -0400 Subject: [PATCH 425/919] Shrink hallowing_m0_express to fit ko build --- ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index af4a5a2932..875d23f9b7 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CFLAGS_INLINE_LIMIT = 60 +CFLAGS_INLINE_LIMIT = 55 SUPEROPT_GC = 0 # Include these Python libraries in firmware. From e947e4eb580e080d37445240ec88610fc1787975 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Sat, 9 May 2020 17:56:38 +1000 Subject: [PATCH 426/919] removed duplicate build param --- py/circuitpy_mpconfig.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index c805b0501a..73eb4fa5ae 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -211,10 +211,6 @@ CIRCUITPY_ROTARYIO = 1 endif CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO) -ifndef CIRCUITPY_COUNTIO -CIRCUITPY_COUNTIO = $(CIRCUITPY_FULL_BUILD) -endif -CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) ifndef CIRCUITPY_RTC CIRCUITPY_RTC = 1 From 9ef28d85363718b2bf0dd17e78c50f422712bccb Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Sat, 9 May 2020 12:00:59 -0700 Subject: [PATCH 427/919] Replacing device that was accidentally deleted --- supervisor/shared/external_flash/devices.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 08e38ed912..f99fad4e70 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -511,6 +511,25 @@ typedef struct { .single_status_byte = true, \ } +// Settings for the Macronix MX25R1635F 8MiB SPI flash. +// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F,%20Wide%20Range,%2016Mb,%20v1.6.pdf +// In low power mode, quad operations can only run at 8 MHz. +#define MX25R1635F {\ + .total_size = (1 << 21), /* 2 MiB */ \ + .start_up_time_us = 800, \ + .manufacturer_id = 0xc2, \ + .memory_type = 0x28, \ + .capacity = 0x18, \ + .max_clock_speed_mhz = 33, /* 8 mhz for dual/quad */ \ + .quad_enable_bit_mask = 0x80, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} + // Settings for the Macronix MX25L51245G 64MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7437/MX25L51245G,%203V,%20512Mb,%20v1.6.pdf #define MX25L51245G {\ From 9e01bb213617fd46723f3dbb869ba51c1985ac21 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Sat, 9 May 2020 12:03:26 -0700 Subject: [PATCH 428/919] Removing erroneous else statements --- .../shared/external_flash/external_flash.c | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 168bbbf68a..a2d8ff5f3a 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -131,31 +131,30 @@ static bool page_erased(uint32_t sector_address) { if (flash_device->no_erase_cmd){ // skip this if device doesn't have an erase command. return true; - } else { - uint8_t short_buffer[4]; - if (read_flash(sector_address, short_buffer, 4)) { - for (uint16_t i = 0; i < 4; i++) { - if (short_buffer[i] != 0xff) { - return false; - } - } - } else { - return false; - } - - // Now check the full length. - uint8_t full_buffer[FILESYSTEM_BLOCK_SIZE]; - if (read_flash(sector_address, full_buffer, FILESYSTEM_BLOCK_SIZE)) { - for (uint16_t i = 0; i < FILESYSTEM_BLOCK_SIZE; i++) { - if (short_buffer[i] != 0xff) { - return false; - } - } - } else { - return false; - } - return true; } + uint8_t short_buffer[4]; + if (read_flash(sector_address, short_buffer, 4)) { + for (uint16_t i = 0; i < 4; i++) { + if (short_buffer[i] != 0xff) { + return false; + } + } + } else { + return false; + } + + // Now check the full length. + uint8_t full_buffer[FILESYSTEM_BLOCK_SIZE]; + if (read_flash(sector_address, full_buffer, FILESYSTEM_BLOCK_SIZE)) { + for (uint16_t i = 0; i < FILESYSTEM_BLOCK_SIZE; i++) { + if (short_buffer[i] != 0xff) { + return false; + } + } + } else { + return false; + } + return true; } // Erases the given sector. Make sure you copied all of the data out of it you @@ -166,16 +165,15 @@ static bool erase_sector(uint32_t sector_address) { if (flash_device->no_erase_cmd){ // skip this if device doesn't have an erase command. return true; - } else { - if (!wait_for_flash_ready() || !write_enable()) { - return false; - } - if (flash_device->no_erase_cmd) { - return true; - } else { - spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address); + } + if (!wait_for_flash_ready() || !write_enable()) { + return false; + } + if (flash_device->no_erase_cmd) { return true; - } + } else { + spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address); + return true; } } From 8b6587a0c646089608b0c8bbace97a73462cf88f Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Sat, 9 May 2020 12:09:01 -0700 Subject: [PATCH 429/919] Unified single_status_byte & no_reset_cmd behavior --- supervisor/shared/external_flash/external_flash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index a2d8ff5f3a..71b2d6d541 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -244,13 +244,14 @@ void supervisor_flash_init(void) { do { spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); } while ((read_status_response[0] & 0x1) != 0); - - if (!(flash_device->no_reset_cmd)){ + if (!flash_device->single_status_byte) { // The suspended write/erase bit should be low. do { spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1); } while ((read_status_response[0] & 0x80) != 0); - } else { + } + + if (!(flash_device->no_reset_cmd)){ spi_flash_command(CMD_ENABLE_RESET); spi_flash_command(CMD_RESET); } From 964040b7702a66f44aa8e9f4af6cf74712ed44ed Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Sat, 9 May 2020 12:16:04 -0700 Subject: [PATCH 430/919] More erroneous else statements --- supervisor/shared/external_flash/external_flash.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 71b2d6d541..5bde7fd485 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -62,13 +62,12 @@ static bool wait_for_flash_ready(void) { if (flash_device->no_ready_bit){ // For NVM without a ready bit in status register return ok; - } else { - uint8_t read_status_response[1] = {0x00}; - do { - ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); - } while (ok && (read_status_response[0] & 0x3) != 0); - return ok; } + uint8_t read_status_response[1] = {0x00}; + do { + ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1); + } while (ok && (read_status_response[0] & 0x3) != 0); + return ok; } // Turn on the write enable bit so we can program and erase the flash. @@ -171,10 +170,9 @@ static bool erase_sector(uint32_t sector_address) { } if (flash_device->no_erase_cmd) { return true; - } else { + } spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address); return true; - } } // Sector is really 24 bits. From 206d0e598adb66e2b23a39a7d11e2f5087513205 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 2 May 2020 02:21:35 -0700 Subject: [PATCH 431/919] Add vectorio: for drawing shapes vectorio builds on m4 express feather Concrete shapes are composed into a VectorShape which is put into a displayio Group for display. VectorShape provides transpose and x/y positioning for shape implementations. Included Shapes: * Circle - A radius; Circle is positioned at its axis in the VectorShape. - You can freely modify the radius to grow and shrink the circle in-place. * Polygon - An ordered list of points. - Beteween each successive point an edge is inferred. A final edge closing the shape is inferred between the last point and the first point. - You can modify the points in a Polygon. The points' coordinate system is relative to (0, 0) so if you'd like a top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape x and y properties will position the rectangle relative to its top center point * Rectangle A width and a height. --- .../feather_m4_express/mpconfigboard.mk | 3 + py/circuitpy_defns.mk | 8 + py/circuitpy_mpconfig.h | 6 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/vectorio/Circle.c | 79 +++++ shared-bindings/vectorio/Circle.h | 22 ++ shared-bindings/vectorio/Polygon.c | 139 +++++++++ shared-bindings/vectorio/Polygon.h | 24 ++ shared-bindings/vectorio/Rectangle.c | 56 ++++ shared-bindings/vectorio/Rectangle.h | 15 + shared-bindings/vectorio/VectorShape.c | 213 +++++++++++++ shared-bindings/vectorio/VectorShape.h | 25 ++ shared-bindings/vectorio/__init__.c | 46 +++ shared-module/displayio/Group.c | 35 ++- shared-module/displayio/display_core.c | 4 + shared-module/vectorio/Circle.c | 55 ++++ shared-module/vectorio/Circle.h | 17 ++ shared-module/vectorio/Polygon.c | 110 +++++++ shared-module/vectorio/Polygon.h | 16 + shared-module/vectorio/Rectangle.c | 35 +++ shared-module/vectorio/Rectangle.h | 15 + shared-module/vectorio/VectorShape.c | 282 ++++++++++++++++++ shared-module/vectorio/VectorShape.h | 51 ++++ shared-module/vectorio/__init__.c | 3 + shared-module/vectorio/__init__.h | 15 + 25 files changed, 1276 insertions(+), 1 deletion(-) create mode 100644 shared-bindings/vectorio/Circle.c create mode 100644 shared-bindings/vectorio/Circle.h create mode 100644 shared-bindings/vectorio/Polygon.c create mode 100644 shared-bindings/vectorio/Polygon.h create mode 100644 shared-bindings/vectorio/Rectangle.c create mode 100644 shared-bindings/vectorio/Rectangle.h create mode 100644 shared-bindings/vectorio/VectorShape.c create mode 100644 shared-bindings/vectorio/VectorShape.h create mode 100644 shared-bindings/vectorio/__init__.c create mode 100644 shared-module/vectorio/Circle.c create mode 100644 shared-module/vectorio/Circle.h create mode 100644 shared-module/vectorio/Polygon.c create mode 100644 shared-module/vectorio/Polygon.h create mode 100644 shared-module/vectorio/Rectangle.c create mode 100644 shared-module/vectorio/Rectangle.h create mode 100644 shared-module/vectorio/VectorShape.c create mode 100644 shared-module/vectorio/VectorShape.h create mode 100644 shared-module/vectorio/__init__.c create mode 100644 shared-module/vectorio/__init__.h diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 38dd477581..7cb53bd130 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -10,3 +10,6 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ + +CIRCUITPY_VECTORIO = 1 + diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index e3892d98e4..c6ea2b45bb 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -145,6 +145,9 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% terminalio/% fontio/% endif +ifeq ($(CIRCUITPY_VECTORIO),1) +SRC_PATTERNS += vectorio/% +endif ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1) SRC_PATTERNS += framebufferio/% endif @@ -358,6 +361,11 @@ SRC_SHARED_MODULE_ALL = \ displayio/Shape.c \ displayio/TileGrid.c \ displayio/__init__.c \ + vectorio/Circle.c \ + vectorio/Rectangle.c \ + vectorio/Polygon.c \ + vectorio/VectorShape.c \ + vectorio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 6b7fc192f9..f48a648c49 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -352,6 +352,11 @@ extern const struct _mp_obj_module_t framebufferio_module; #define FRAMEBUFFERIO_MODULE #endif +#if CIRCUITPY_VECTORIO +extern const struct _mp_obj_module_t vectorio_module; +#define VECTORIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_vectorio), (mp_obj_t)&vectorio_module }, +#endif + #if CIRCUITPY_FREQUENCYIO extern const struct _mp_obj_module_t frequencyio_module; #define FREQUENCYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_frequencyio), (mp_obj_t)&frequencyio_module }, @@ -642,6 +647,7 @@ extern const struct _mp_obj_module_t ustack_module; DISPLAYIO_MODULE \ FONTIO_MODULE \ TERMINALIO_MODULE \ + VECTORIO_MODULE \ ERRNO_MODULE \ FRAMEBUFFERIO_MODULE \ FREQUENCYIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 105253aec4..e9e3d80138 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -94,6 +94,9 @@ CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) CIRCUITPY_FRAMEBUFFERIO ?= 0 CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) +CIRCUITPY_VECTORIO ?= 0 +CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) + CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c new file mode 100644 index 0000000000..8f409bd654 --- /dev/null +++ b/shared-bindings/vectorio/Circle.c @@ -0,0 +1,79 @@ + +#include "shared-bindings/vectorio/Circle.h" + + +#include + +#include "py/objproperty.h" +#include "py/objtype.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + + +//| .. currentmodule:: vectorio +//| +//| :class:`Circle` -- Represents a circle by its radius +//| ========================================================================== +//| +//| .. class:: Circle(radius) +//| +//| :param int radius: The radius of the circle in pixels +//| +static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_radius }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_radius, MP_ARG_REQUIRED | MP_ARG_INT }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t radius = args[ARG_radius].u_int; + if (radius < 1) { + mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_radius); + } + + vectorio_circle_t *self = m_new_obj(vectorio_circle_t); + self->base.type = &vectorio_circle_type; + common_hal_vectorio_circle_construct(self, radius); + + return MP_OBJ_FROM_PTR(self); +} + + +//| .. attribute:: radius +//| +//| Update the radius of the circle +//| +STATIC mp_obj_t vectorio_circle_obj_get_radius(mp_obj_t self_in) { + vectorio_circle_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(common_hal_vectorio_circle_get_radius(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_circle_get_radius_obj, vectorio_circle_obj_get_radius); + +STATIC mp_obj_t vectorio_circle_obj_set_radius(mp_obj_t self_in, mp_obj_t radius) { + vectorio_circle_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_vectorio_circle_set_radius(self, mp_obj_get_int(radius)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_circle_set_radius_obj, vectorio_circle_obj_set_radius); + +const mp_obj_property_t vectorio_circle_radius_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_circle_get_radius_obj, + (mp_obj_t)&vectorio_circle_set_radius_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +STATIC const mp_rom_map_elem_t vectorio_circle_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_radius), MP_ROM_PTR(&vectorio_circle_radius_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(vectorio_circle_locals_dict, vectorio_circle_locals_dict_table); + +const mp_obj_type_t vectorio_circle_type = { + { &mp_type_type }, + .name = MP_QSTR_Circle, + .make_new = vectorio_circle_make_new, + .locals_dict = (mp_obj_dict_t*)&vectorio_circle_locals_dict, +}; + diff --git a/shared-bindings/vectorio/Circle.h b/shared-bindings/vectorio/Circle.h new file mode 100644 index 0000000000..e8fc048eb8 --- /dev/null +++ b/shared-bindings/vectorio/Circle.h @@ -0,0 +1,22 @@ +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_CIRCLE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_CIRCLE_H + +#include "shared-module/vectorio/__init__.h" +#include "shared-module/vectorio/Circle.h" +#include "shared-module/displayio/area.h" + +extern const mp_obj_type_t vectorio_circle_type; + +void common_hal_vectorio_circle_construct(vectorio_circle_t *self, uint16_t radius); + +void common_hal_vectorio_circle_set_on_dirty(vectorio_circle_t *self, vectorio_event_t notification); + +uint32_t common_hal_vectorio_circle_get_pixel(void *circle, int16_t x, int16_t y); + +void common_hal_vectorio_circle_get_area(void *circle, displayio_area_t *out_area); + + +int16_t common_hal_vectorio_circle_get_radius(void *circle); +void common_hal_vectorio_circle_set_radius(void *circle, int16_t radius); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_CIRCLE_H diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c new file mode 100644 index 0000000000..b8bb377ac5 --- /dev/null +++ b/shared-bindings/vectorio/Polygon.c @@ -0,0 +1,139 @@ + +#include "shared-module/vectorio/__init__.h" +#include "shared-bindings/vectorio/Polygon.h" + +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/objtype.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + + +#define VECTORIO_POLYGON_DEBUG(...) (void)0 +// #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + +// Converts a list of points tuples to a flat list of ints for speedier internal use. +// Also validates the points. +static mp_obj_t _to_points_list(mp_obj_t points_tuple_list) { + size_t len = 0; + mp_obj_t *items; + mp_obj_list_get(points_tuple_list, &len, &items); + VECTORIO_POLYGON_DEBUG("polygon_points_list len: %d\n", len); + + if ( len == 0 ) { + mp_raise_TypeError_varg(translate("empty %q list"), MP_QSTR_point); + } + + mp_obj_t points_list = mp_obj_new_list(0, NULL); + + for ( size_t i = 0; i < len; ++i) { + size_t tuple_len = 0; + mp_obj_t *tuple_items; + mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); + + if (tuple_len != 2) { + mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); + } + int value; + if (!mp_obj_get_int_maybe(tuple_items[0], &value)) { + mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + } + mp_obj_list_append(points_list, MP_OBJ_NEW_SMALL_INT(value)); + if (!mp_obj_get_int_maybe(tuple_items[1], &value)) { + mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + } + mp_obj_list_append(points_list, MP_OBJ_NEW_SMALL_INT(value)); + } + return points_list; +} + + + +//| .. currentmodule:: vectorio +//| +//| :class:`Polygon` -- Represents a closed shape by ordered vertices +//| ========================================================================== +//| +//| .. class:: Polygon( List[ Tuple[ x, y ], ... ] ) +//| +//| :param [Point] points_array: Vertices for the polygon +//| +static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_points_list }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_points, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + if (!MP_OBJ_IS_TYPE(args[ARG_points_list].u_obj, &mp_type_list)) { + mp_raise_TypeError_varg(translate("%q list must be a list"), MP_QSTR_point); + } + mp_obj_t points_list = _to_points_list(args[ARG_points_list].u_obj); + + vectorio_polygon_t *self = m_new_obj(vectorio_polygon_t); + self->base.type = &vectorio_polygon_type; + + common_hal_vectorio_polygon_construct(self, points_list); + + return MP_OBJ_FROM_PTR(self); +} + + +//| .. attribute:: points +//| +//| Set a new look and shape for this polygon +//| +STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { + vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); + mp_obj_t list = mp_obj_new_list(0, NULL); + + size_t len = 0; + mp_obj_t *items; + mp_obj_list_get(common_hal_vectorio_polygon_get_points(self), &len, &items); + + for (size_t i = 0; i < len; i += 2) { + mp_obj_t tuple[] = { items[i], items[i+1] }; + mp_obj_list_append( + list, + mp_obj_new_tuple(2, tuple) + ); + } + return list; +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_polygon_get_points_obj, vectorio_polygon_obj_get_points); + +STATIC mp_obj_t vectorio_polygon_obj_set_points(mp_obj_t self_in, mp_obj_t points) { + vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); + + mp_obj_t points_list = _to_points_list(points); + + common_hal_vectorio_polygon_set_points(self, points_list); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_polygon_set_points_obj, vectorio_polygon_obj_set_points); + +const mp_obj_property_t vectorio_polygon_points_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_polygon_get_points_obj, + (mp_obj_t)&vectorio_polygon_set_points_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + + +STATIC const mp_rom_map_elem_t vectorio_polygon_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_points), MP_ROM_PTR(&vectorio_polygon_points_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(vectorio_polygon_locals_dict, vectorio_polygon_locals_dict_table); + +const mp_obj_type_t vectorio_polygon_type = { + { &mp_type_type }, + .name = MP_QSTR_Polygon, + .make_new = vectorio_polygon_make_new, + .locals_dict = (mp_obj_dict_t*)&vectorio_polygon_locals_dict, +}; + diff --git a/shared-bindings/vectorio/Polygon.h b/shared-bindings/vectorio/Polygon.h new file mode 100644 index 0000000000..5594fbec4a --- /dev/null +++ b/shared-bindings/vectorio/Polygon.h @@ -0,0 +1,24 @@ +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_POLYGON_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_POLYGON_H + +#include "shared-module/vectorio/Polygon.h" +#include "shared-module/displayio/area.h" +#include "shared-module/vectorio/__init__.h" + +extern const mp_obj_type_t vectorio_polygon_type; + +void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t points_list); +void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio_event_t notification); + + +uint32_t common_hal_vectorio_polygon_get_pixel(void *polygon, int16_t x, int16_t y); + +void common_hal_vectorio_polygon_get_area(void *polygon, displayio_area_t *out_area); + + + +mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self); +void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t points_list); + + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_POLYGON_H diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c new file mode 100644 index 0000000000..ea468f7888 --- /dev/null +++ b/shared-bindings/vectorio/Rectangle.c @@ -0,0 +1,56 @@ + +#include "shared-bindings/vectorio/Rectangle.h" + +#include + +#include "py/objtype.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + + +//| .. currentmodule:: vectorio +//| +//| :class:`Rectangle` -- Represents a rectangle by defining its bounds +//| ========================================================================== +//| +//| .. class:: Rectangle(width, height) +//| +//| :param int width: The number of pixels wide +//| :param int height: The number of pixels high +//| +static mp_obj_t vectorio_rectangle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_width, ARG_height }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t width = args[ARG_width].u_int; + if (width < 1) { + mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_width); + } + mp_int_t height = args[ARG_height].u_int; + if (height < 1) { + mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_height); + } + + vectorio_rectangle_t *self = m_new_obj(vectorio_rectangle_t); + self->base.type = &vectorio_rectangle_type; + common_hal_vectorio_rectangle_construct(self, width, height); + + return MP_OBJ_FROM_PTR(self); +} + + +STATIC const mp_rom_map_elem_t vectorio_rectangle_locals_dict_table[] = { +}; +STATIC MP_DEFINE_CONST_DICT(vectorio_rectangle_locals_dict, vectorio_rectangle_locals_dict_table); + +const mp_obj_type_t vectorio_rectangle_type = { + { &mp_type_type }, + .name = MP_QSTR_Rectangle, + .make_new = vectorio_rectangle_make_new, + .locals_dict = (mp_obj_dict_t*)&vectorio_rectangle_locals_dict, +}; diff --git a/shared-bindings/vectorio/Rectangle.h b/shared-bindings/vectorio/Rectangle.h new file mode 100644 index 0000000000..bb461ed9d5 --- /dev/null +++ b/shared-bindings/vectorio/Rectangle.h @@ -0,0 +1,15 @@ +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_RECTANGLE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_RECTANGLE_H + +#include "shared-module/vectorio/Rectangle.h" +#include "shared-module/displayio/area.h" + +extern const mp_obj_type_t vectorio_rectangle_type; + +void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_t width, uint32_t height); + +uint32_t common_hal_vectorio_rectangle_get_pixel(void *rectangle, int16_t x, int16_t y); + +void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_RECTANGLE_H diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c new file mode 100644 index 0000000000..8f99577b4f --- /dev/null +++ b/shared-bindings/vectorio/VectorShape.c @@ -0,0 +1,213 @@ + +#include "shared-module/vectorio/__init__.h" +#include "shared-bindings/vectorio/VectorShape.h" +#include "shared-bindings/vectorio/Circle.h" +#include "shared-bindings/vectorio/Polygon.h" +#include "shared-bindings/vectorio/Rectangle.h" + +#include "shared-bindings/displayio/ColorConverter.h" +#include "shared-bindings/displayio/Palette.h" + +#include + +#include "lib/utils/context_manager_helpers.h" + +#include "py/binary.h" +#include "py/objproperty.h" +#include "py/objtype.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + + +//| .. currentmodule:: vectorio +//| +//| :class:`VectorShape` -- Binds a vector shape to a location and pixel color +//| ========================================================================== +//| +//| .. class:: VectorShape( shape, pixel_shader, x=0, y=0) +//| +//| :param vectorio.Polygon shape: The shape to draw. +//| :param displayio.Palette pixel_shader: The pixel shader that produces colors from values +//| :param int x: Initial x position of the center axis of the shape within the parent. +//| :param int y: Initial y position of the center axis of the shape within the parent. +//| +STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_shape, ARG_pixel_shader, ARG_x, ARG_y, ARG_transpose_xy }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_shape, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_transpose_xy, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_obj_t pixel_shader = args[ARG_pixel_shader].u_obj; + if (!MP_OBJ_IS_TYPE(pixel_shader, &displayio_colorconverter_type) && + !MP_OBJ_IS_TYPE(pixel_shader, &displayio_palette_type)) { + mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_pixel_shader); + } + + int16_t x = args[ARG_x].u_int; + int16_t y = args[ARG_y].u_int; + + mp_obj_t shape = args[ARG_shape].u_obj; + vectorio_ishape_t ishape; + // Wire up shape functions + if (MP_OBJ_IS_TYPE(shape, &vectorio_polygon_type)) { + ishape.shape = shape; + ishape.get_area = &common_hal_vectorio_polygon_get_area; + ishape.get_pixel = &common_hal_vectorio_polygon_get_pixel; + } else if (MP_OBJ_IS_TYPE(shape, &vectorio_rectangle_type)) { + ishape.shape = shape; + ishape.get_area = &common_hal_vectorio_rectangle_get_area; + ishape.get_pixel = &common_hal_vectorio_rectangle_get_pixel; + } else if (MP_OBJ_IS_TYPE(shape, &vectorio_circle_type)) { + ishape.shape = shape; + ishape.get_area = &common_hal_vectorio_circle_get_area; + ishape.get_pixel = &common_hal_vectorio_circle_get_pixel; + } else { + mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_shape); + } + + vectorio_vector_shape_t *self = m_new_obj(vectorio_vector_shape_t); + self->base.type = &vectorio_vector_shape_type; + common_hal_vectorio_vector_shape_construct(self, + ishape, pixel_shader, x, y, args[ARG_transpose_xy].u_bool + ); + + // Wire up event callbacks + vectorio_event_t on_dirty = { + .obj = self, + .event = &common_hal_vectorio_vector_shape_set_dirty + }; + + if (MP_OBJ_IS_TYPE(shape, &vectorio_polygon_type)) { + common_hal_vectorio_polygon_set_on_dirty(self->ishape.shape, on_dirty); + } else if (MP_OBJ_IS_TYPE(shape, &vectorio_rectangle_type)) { + common_hal_vectorio_circle_set_on_dirty(self->ishape.shape, on_dirty); + } else if (MP_OBJ_IS_TYPE(shape, &vectorio_circle_type)) { + } else { + mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_shape); + } + + return MP_OBJ_FROM_PTR(self); +} + + +//| .. attribute:: x +//| +//| X position of the center point of the shape in the parent. +//| +STATIC mp_obj_t vectorio_vector_shape_obj_get_x(mp_obj_t self_in) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_vectorio_vector_shape_get_x(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_x_obj, vectorio_vector_shape_obj_get_x); + +STATIC mp_obj_t vectorio_vector_shape_obj_set_x(mp_obj_t self_in, mp_obj_t x_obj) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t x = mp_obj_get_int(x_obj); + common_hal_vectorio_vector_shape_set_x(self, x); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_x_obj, vectorio_vector_shape_obj_set_x); + +const mp_obj_property_t vectorio_vector_shape_x_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_vector_shape_get_x_obj, + (mp_obj_t)&vectorio_vector_shape_set_x_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +//| .. attribute:: y +//| +//| Y position of the center point of the shape in the parent. +//| +STATIC mp_obj_t vectorio_vector_shape_obj_get_y(mp_obj_t self_in) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_vectorio_vector_shape_get_y(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_y_obj, vectorio_vector_shape_obj_get_y); + +STATIC mp_obj_t vectorio_vector_shape_obj_set_y(mp_obj_t self_in, mp_obj_t y_obj) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + + mp_int_t y = mp_obj_get_int(y_obj); + common_hal_vectorio_vector_shape_set_y(self, y); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_y_obj, vectorio_vector_shape_obj_set_y); + +const mp_obj_property_t vectorio_vector_shape_y_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_vector_shape_get_y_obj, + (mp_obj_t)&vectorio_vector_shape_set_y_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +//| .. attribute:: transpose_xy +//| +//| true if the object is to be flipped. +//| +STATIC mp_obj_t vectorio_vector_shape_obj_get_transpose_xy(mp_obj_t self_in) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(common_hal_vectorio_vector_shape_get_transpose_xy(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_transpose_xy_obj, vectorio_vector_shape_obj_get_transpose_xy); + +const mp_obj_property_t vectorio_vector_shape_transpose_xy_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_vector_shape_get_transpose_xy_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: pixel_shader +//| +//| The pixel shader of the shape. +//| +STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t self_in) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + return common_hal_vectorio_vector_shape_get_pixel_shader(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_pixel_shader_obj, vectorio_vector_shape_obj_get_pixel_shader); + +STATIC mp_obj_t vectorio_vector_shape_obj_set_pixel_shader(mp_obj_t self_in, mp_obj_t pixel_shader) { + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); + if (!MP_OBJ_IS_TYPE(pixel_shader, &displayio_palette_type) && !MP_OBJ_IS_TYPE(pixel_shader, &displayio_colorconverter_type)) { + mp_raise_TypeError(translate("pixel_shader must be displayio.Palette or displayio.ColorConverter")); + } + + common_hal_vectorio_vector_shape_set_pixel_shader(self, pixel_shader); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_pixel_shader_obj, vectorio_vector_shape_obj_set_pixel_shader); + +const mp_obj_property_t vectorio_vector_shape_pixel_shader_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&vectorio_vector_shape_get_pixel_shader_obj, + (mp_obj_t)&vectorio_vector_shape_set_pixel_shader_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +STATIC const mp_rom_map_elem_t vectorio_vector_shape_locals_dict_table[] = { + // Properties + { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, + { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(vectorio_vector_shape_locals_dict, vectorio_vector_shape_locals_dict_table); + +const mp_obj_type_t vectorio_vector_shape_type = { + { &mp_type_type }, + .name = MP_QSTR_VectorShape, + .make_new = vectorio_vector_shape_make_new, + .locals_dict = (mp_obj_dict_t*)&vectorio_vector_shape_locals_dict, +}; diff --git a/shared-bindings/vectorio/VectorShape.h b/shared-bindings/vectorio/VectorShape.h new file mode 100644 index 0000000000..ad745b30ff --- /dev/null +++ b/shared-bindings/vectorio/VectorShape.h @@ -0,0 +1,25 @@ +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H + +#include "shared-module/vectorio/VectorShape.h" + +extern const mp_obj_type_t vectorio_vector_shape_type; + +void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, + vectorio_ishape_t ishape, + mp_obj_t pixel_shader, uint16_t x, uint16_t y, bool transpose_xy); + +void common_hal_vectorio_vector_shape_set_dirty(void *self); + +mp_int_t common_hal_vectorio_vector_shape_get_x(vectorio_vector_shape_t *self); +void common_hal_vectorio_vector_shape_set_x(vectorio_vector_shape_t *self, mp_int_t x); + +mp_int_t common_hal_vectorio_vector_shape_get_y(vectorio_vector_shape_t *self); +void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_int_t y); + +bool common_hal_vectorio_vector_shape_get_transpose_xy(vectorio_vector_shape_t *self); + +mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self); +void common_hal_vectorio_vector_shape_set_pixel_shader(vectorio_vector_shape_t *self, mp_obj_t pixel_shader); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H diff --git a/shared-bindings/vectorio/__init__.c b/shared-bindings/vectorio/__init__.c new file mode 100644 index 0000000000..b9e3828bdc --- /dev/null +++ b/shared-bindings/vectorio/__init__.c @@ -0,0 +1,46 @@ +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/vectorio/Circle.h" +#include "shared-bindings/vectorio/Polygon.h" +#include "shared-bindings/vectorio/Rectangle.h" +#include "shared-bindings/vectorio/VectorShape.h" + +//| :mod:`vectorio` --- Lightweight 2d shapes for displays +//| ========================================================================= +//| +//| .. module:: vectorio +//| :synopsis: Adds vector graphics to displayio +//| :platform: SAMD21, SAMD51, nRF52 +//| +//| The `vectorio` module contains classes to construct shapes +//| by describing their points rather than providing them in bitmaps. +//| +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| Circle +//| Polygon +//| Rectangle +//| VectorShape +//| + + +STATIC const mp_rom_map_elem_t vectorio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_vectorio) }, + { MP_ROM_QSTR(MP_QSTR_Circle), MP_ROM_PTR(&vectorio_circle_type) }, + { MP_ROM_QSTR(MP_QSTR_Polygon), MP_ROM_PTR(&vectorio_polygon_type) }, + { MP_ROM_QSTR(MP_QSTR_Rectangle), MP_ROM_PTR(&vectorio_rectangle_type) }, + { MP_ROM_QSTR(MP_QSTR_VectorShape), MP_ROM_PTR(&vectorio_vector_shape_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(vectorio_module_globals, vectorio_module_globals_table); + +const mp_obj_module_t vectorio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&vectorio_module_globals, +}; diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index d69e9f5859..9d50dabec7 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -29,6 +29,11 @@ #include "py/runtime.h" #include "shared-bindings/displayio/TileGrid.h" +#if CIRCUITPY_VECTORIO +#include "shared-bindings/vectorio/VectorShape.h" +#endif + + void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y) { displayio_group_child_t* children = m_new(displayio_group_child_t, max_size); displayio_group_construct(self, children, max_size, scale, x, y); @@ -200,7 +205,14 @@ void common_hal_displayio_group_set_y(displayio_group_t* self, mp_int_t y) { } static mp_obj_t _add_layer(displayio_group_t* self, mp_obj_t layer) { - mp_obj_t native_layer = mp_instance_cast_to_native_base(layer, &displayio_group_type); + mp_obj_t native_layer; +#if CIRCUITPY_VECTORIO + native_layer = mp_instance_cast_to_native_base(layer, &vectorio_vector_shape_type); + if (native_layer != MP_OBJ_NULL) { + return native_layer; + } +#endif + native_layer = mp_instance_cast_to_native_base(layer, &displayio_group_type); if (native_layer == MP_OBJ_NULL) { native_layer = mp_instance_cast_to_native_base(layer, &displayio_tilegrid_type); if (native_layer == MP_OBJ_NULL) { @@ -317,6 +329,15 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp bool full_coverage = false; for (int32_t i = self->size - 1; i >= 0 ; i--) { mp_obj_t layer = self->children[i].native; +#if CIRCUITPY_VECTORIO + if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + if (vectorio_vector_shape_fill_area(layer, colorspace, area, mask, buffer)) { + full_coverage = true; + break; + } + } + else +#endif if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { full_coverage = true; @@ -336,6 +357,12 @@ void displayio_group_finish_refresh(displayio_group_t *self) { self->item_removed = false; for (int32_t i = self->size - 1; i >= 0 ; i--) { mp_obj_t layer = self->children[i].native; +#if CIRCUITPY_VECTORIO + if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + vectorio_vector_shape_finish_refresh(layer); + } + else +#endif if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { displayio_tilegrid_finish_refresh(layer); } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { @@ -352,6 +379,12 @@ displayio_area_t* displayio_group_get_refresh_areas(displayio_group_t *self, dis for (int32_t i = self->size - 1; i >= 0 ; i--) { mp_obj_t layer = self->children[i].native; +#if CIRCUITPY_VECTORIO + if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + tail = vectorio_vector_shape_get_refresh_areas(layer, tail); + } + else +#endif if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { tail = displayio_tilegrid_get_refresh_areas(layer, tail); } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index d01100f7f1..43f2d19375 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -40,6 +40,9 @@ #include #include +#define DISPLAYIO_CORE_DEBUG(...) (void)0 +// #define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + void displayio_display_core_construct(displayio_display_core_t* self, mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word) { @@ -298,6 +301,7 @@ void displayio_display_core_start_refresh(displayio_display_core_t* self) { void displayio_display_core_finish_refresh(displayio_display_core_t* self) { if (self->current_group != NULL) { + DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n"); displayio_group_finish_refresh(self->current_group); } self->full_refresh = false; diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c new file mode 100644 index 0000000000..6bcd6318fe --- /dev/null +++ b/shared-module/vectorio/Circle.c @@ -0,0 +1,55 @@ + +#include "shared-bindings/vectorio/Circle.h" +#include "shared-module/vectorio/__init__.h" +#include "shared-module/displayio/area.h" + +#include "py/runtime.h" +#include "stdlib.h" + + +void common_hal_vectorio_circle_construct(vectorio_circle_t *self, uint16_t radius) { + self->radius = radius; + self->on_dirty.obj = NULL; +} + +void common_hal_vectorio_circle_set_on_dirty(vectorio_circle_t *self, vectorio_event_t on_dirty) { + if (self->on_dirty.obj != NULL) { + mp_raise_TypeError(translate("circle can only be registered in one parent")); + } + self->on_dirty = on_dirty; +} + + +uint32_t common_hal_vectorio_circle_get_pixel(void *obj, int16_t x, int16_t y) { + vectorio_circle_t *self = obj; + int16_t radius = abs(self->radius); + x = abs(x); + y = abs(y); + if (x+y <= radius) return 1; + if (x > radius) return 0; + if (y > radius) return 0; + return (int32_t)x*x + (int32_t)y*y <= (int32_t)radius*radius; +} + + +void common_hal_vectorio_circle_get_area(void *circle, displayio_area_t *out_area) { + vectorio_circle_t *self = circle; + out_area->x1 = -1 * self->radius; + out_area->y1 = -1 * self->radius; + out_area->x2 = self->radius + 1; + out_area->y2 = self->radius + 1; +} + +int16_t common_hal_vectorio_circle_get_radius(void *obj) { + vectorio_circle_t *self = obj; + return self->radius; +} + +void common_hal_vectorio_circle_set_radius(void *obj, int16_t radius) { + vectorio_circle_t *self = obj; + self->radius = abs(radius); + if (self->on_dirty.obj != NULL) { + self->on_dirty.event(self->on_dirty.obj); + } +} + diff --git a/shared-module/vectorio/Circle.h b/shared-module/vectorio/Circle.h new file mode 100644 index 0000000000..4b43d767ec --- /dev/null +++ b/shared-module/vectorio/Circle.h @@ -0,0 +1,17 @@ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H +#define MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H + +#include + +#include "py/obj.h" + +#include "shared-module/vectorio/__init__.h" + +typedef struct { + mp_obj_base_t base; + uint16_t radius; + vectorio_event_t on_dirty; +} vectorio_circle_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H + diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c new file mode 100644 index 0000000000..6722912c2d --- /dev/null +++ b/shared-module/vectorio/Polygon.c @@ -0,0 +1,110 @@ + +#include "shared-module/vectorio/__init__.h" +#include "shared-bindings/vectorio/Polygon.h" +#include "shared-module/displayio/area.h" + +#include "py/runtime.h" +#include "stdlib.h" +#include + + +#define VECTORIO_POLYGON_DEBUG(...) (void)0 +// #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + +void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t points_list) { + VECTORIO_POLYGON_DEBUG("%p polygon_construct\n", self); + self->points_list = points_list; + self->on_dirty.obj = NULL; +} + + +mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self) { + return self->points_list; +} +void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t points_list) { + self->points_list = points_list; + if (self->on_dirty.obj != NULL) { + self->on_dirty.event(self->on_dirty.obj); + } +} + +void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio_event_t notification) { + if ( self->on_dirty.obj != NULL ) { + mp_raise_TypeError(translate("polygon can only be registered in one parent")); + } + self->on_dirty = notification; +} + + +void common_hal_vectorio_polygon_get_area(void *polygon, displayio_area_t *area) { + VECTORIO_POLYGON_DEBUG("%p polygon get_area", polygon); + vectorio_polygon_t *self = polygon; + size_t len; + mp_obj_t *points; + mp_obj_list_get(self->points_list, &len, &points); + VECTORIO_POLYGON_DEBUG(" len: %2d, points: %d\n", len, len/2); + + area->x1 = SHRT_MAX; + area->y1 = SHRT_MAX; + area->x2 = SHRT_MIN; + area->y2 = SHRT_MIN; + for (size_t i=0; i < len; ++i) { + mp_int_t x = mp_obj_get_int(points[i]); + ++i; + mp_int_t y = mp_obj_get_int(points[i]); + if (x <= area->x1) area->x1 = x-1; + if (y <= area->y1) area->y1 = y-1; + if (x >= area->x2) area->x2 = x+1; + if (y >= area->y2) area->y2 = y+1; + } +} + + +// <0 if the point is to the left of the line vector +// 0 if the point is on the line +// >0 if the point is to the right of the line vector +__attribute__((always_inline)) static inline int line_side( mp_int_t x1, mp_int_t y1, mp_int_t x2, mp_int_t y2, int16_t px, int16_t py ) { + return (px - x1) * (y2 - y1) + - (py - y1) * (x2 - x1); +} + + +uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) { + VECTORIO_POLYGON_DEBUG("%p polygon get_pixel %d, %d\n", obj, x, y); + vectorio_polygon_t *self = obj; + size_t len; + mp_obj_t *points; + mp_obj_list_get(self->points_list, &len, &points); + + if (len == 0) { + return 0; + } + + int winding_number = 0; + mp_int_t x1 = mp_obj_get_int(points[0]); + mp_int_t y1 = mp_obj_get_int(points[1]); + for (size_t i=2; i <= len + 1; ++i) { + VECTORIO_POLYGON_DEBUG(" {(%3d, %3d),", x1, y1); + mp_int_t x2 = mp_obj_get_int(points[i % len]); + ++i; + mp_int_t y2 = mp_obj_get_int(points[i % len]); + VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2); + if ( y1 <= y ) { + if ( y2 > y && line_side(x1, y1, x2, y2, x, y) > 0 ) { + // Wind up, point is to the right of the edge vector + ++winding_number; + VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", 1, winding_number); + } + } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) { + // Wind down, point is to the left of the edge vector + --winding_number; + VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); + } + + x1 = x2; + y1 = y2; + } + return winding_number == 0 ? 0 : 1; +} + diff --git a/shared-module/vectorio/Polygon.h b/shared-module/vectorio/Polygon.h new file mode 100644 index 0000000000..1aef854a7b --- /dev/null +++ b/shared-module/vectorio/Polygon.h @@ -0,0 +1,16 @@ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_POLYGON_H +#define MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_POLYGON_H + +#include + +#include "py/obj.h" +#include "shared-module/vectorio/__init__.h" + +typedef struct { + mp_obj_base_t base; + // A micropython List[ x, y, ... ] + mp_obj_t points_list; + vectorio_event_t on_dirty; +} vectorio_polygon_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_POLYGON_H diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c new file mode 100644 index 0000000000..dfad58a4d1 --- /dev/null +++ b/shared-module/vectorio/Rectangle.c @@ -0,0 +1,35 @@ +#include "shared-bindings/vectorio/Rectangle.h" +#include "shared-module/displayio/area.h" + +#include "py/runtime.h" + + +void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_t width, uint32_t height) { + self->width = width; + self->height = height; +} + + +uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) { + vectorio_rectangle_t *self = obj; + if (x < 0 || x >= self->width || y >= self->height || y < 0) { + return 0; + } + return 1; +} + + +void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area) { + vectorio_rectangle_t *self = rectangle; + out_area->x1 = 0; + out_area->y1 = 0; + out_area->x2 = self->width; + out_area->y2 = self->height; +} + + +uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) { + vectorio_rectangle_t *self = rectangle; + return self->height; +} + diff --git a/shared-module/vectorio/Rectangle.h b/shared-module/vectorio/Rectangle.h new file mode 100644 index 0000000000..c1f2a7a64e --- /dev/null +++ b/shared-module/vectorio/Rectangle.h @@ -0,0 +1,15 @@ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H +#define MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H + +#include + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + uint16_t width; + uint16_t height; +} vectorio_rectangle_t; + +#endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H + diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c new file mode 100644 index 0000000000..985b778584 --- /dev/null +++ b/shared-module/vectorio/VectorShape.c @@ -0,0 +1,282 @@ + +#include "stdlib.h" + +#include "shared-module/vectorio/__init__.h" +#include "shared-bindings/vectorio/VectorShape.h" + +#include "py/runtime.h" +#include "shared-bindings/displayio/ColorConverter.h" +#include "shared-bindings/displayio/Palette.h" + +#include "shared-bindings/vectorio/Circle.h" +#include "shared-bindings/vectorio/Polygon.h" +#include "shared-bindings/vectorio/Rectangle.h" + +// Lifecycle actions. +#define VECTORIO_SHAPE_DEBUG(...) (void)0 +// #define VECTORIO_SHAPE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + +// Really verbose. +#define VECTORIO_SHAPE_PIXEL_DEBUG(...) (void)0 +// #define VECTORIO_SHAPE_PIXEL_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + +inline __attribute__((always_inline)) +static int32_t max(int32_t a, int32_t b) { + return a > b ? a : b; +} + + +inline __attribute__((always_inline)) +static void _transpose_area(displayio_area_t *out_area) { + int16_t swap = out_area->x1; + out_area->x1 = out_area->y1; + out_area->y1 = swap; + swap = out_area->x2; + out_area->x2 = out_area->y2; + out_area->y2 = swap; +} + + +inline __attribute__((always_inline)) +static void _get_shape_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { + VECTORIO_SHAPE_DEBUG("%p get_area\n", self); + self->ishape.get_area(self->ishape.shape, out_area); +} + + +inline __attribute__((always_inline)) +static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { + VECTORIO_SHAPE_DEBUG("%p get_screen_area\n", self); + self->ishape.get_area(self->ishape.shape, out_area); + if (self->transpose_xy) { + _transpose_area(out_area); + displayio_area_shift(out_area, self->y, self->x); + } else { + displayio_area_shift(out_area, self->x, self->y); + } +} + + +// This must be invoked each time a shape changes its position or its shape in any way. +void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) { + vectorio_vector_shape_t *self = vector_shape; + // In screen space. Need to offset the shape space. + displayio_area_t current_area; + _get_screen_area(self, ¤t_area); + VECTORIO_SHAPE_DEBUG("%p shape_dirty current:{(%3d,%3d), (%3d,%3d)} dirty:{(%3d,%3d), (%3d,%3d)}", + self, + current_area.x1, current_area.y1, current_area.x2, current_area.y2, + self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + self->dirty = true; + // Dirty area tracks the shape's footprint between draws. It's reset on refresh finish, + displayio_area_expand(&self->ephemeral_dirty_area, ¤t_area); + VECTORIO_SHAPE_DEBUG(" -> expanded:{(%3d,%3d), (%3d,%3d)}\n", self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); +} + + +void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, + vectorio_ishape_t ishape, + mp_obj_t pixel_shader, uint16_t x, uint16_t y, bool transpose_xy) { + VECTORIO_SHAPE_DEBUG("%p vector_shape_construct x:%3d, y:%3d\n", self, x, y); + self->x = x; + self->y = y; + self->pixel_shader = pixel_shader; + self->ishape = ishape; + self->transpose_xy = transpose_xy; + self->dirty = true; + _get_screen_area(self, &self->ephemeral_dirty_area); + self->ephemeral_dirty_area.next = NULL; +} + + +mp_int_t common_hal_vectorio_vector_shape_get_x(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_x\n", self); + return self->x; +} + + +void common_hal_vectorio_vector_shape_set_x(vectorio_vector_shape_t *self, mp_int_t x) { + VECTORIO_SHAPE_DEBUG("%p set_x %d\n", self, x); + if (self->x == x) { + return; + } + self->x = x; + common_hal_vectorio_vector_shape_set_dirty(self); +} + + +mp_int_t common_hal_vectorio_vector_shape_get_y(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_y\n", self); + return self->y; +} + + +void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_int_t y) { + VECTORIO_SHAPE_DEBUG("%p set_y %d\n", self, y); + if (self->y == y) { + return; + } + self->y = y; + common_hal_vectorio_vector_shape_set_dirty(self); +} + + +bool common_hal_vectorio_vector_shape_get_transpose_xy(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_transpose_xy\n", self); + return self->transpose_xy; +} + + +mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_pixel_shader\n", self); + return self->pixel_shader; +} + +void common_hal_vectorio_vector_shape_set_pixel_shader(vectorio_vector_shape_t *self, mp_obj_t pixel_shader) { + VECTORIO_SHAPE_DEBUG("%p set_pixel_shader\n", self); + self->pixel_shader = pixel_shader; + common_hal_vectorio_vector_shape_set_dirty(self); +} + + +bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displayio_colorspace_t* colorspace, const displayio_area_t* area, uint32_t* mask, uint32_t *buffer) { + // Shape areas are relative to 0,0. This will allow rotation about a known axis. + // The consequence is that the area reported by the shape itself is _relative_ to 0,0. + // To make it relative to the VectorShape position, we must shift it. + // Pixels are drawn on the screen_area (shifted) coordinate space, while pixels are _determined_ from + // the shape_area (unshifted) space. + displayio_area_t overlap; + displayio_area_t shape_area; + _get_shape_area(self, &shape_area); + VECTORIO_SHAPE_DEBUG("%p fill_area dirty:%d fill: {(%3d,%3d), (%3d,%3d)} dirty: {(%3d,%3d), (%3d,%3d)}", + self, self->dirty, + area->x1, area->y1, area->x2, area->y2, + self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2 + ); + if (!displayio_area_compute_overlap(area, &self->ephemeral_dirty_area, &overlap)) { + VECTORIO_SHAPE_DEBUG(" no overlap\n"); + return false; + } + VECTORIO_SHAPE_DEBUG(", overlap: {(%3d,%3d), (%3d,%3d)}", overlap.x1, overlap.y1, overlap.x2, overlap.y2); + + bool full_coverage = displayio_area_equal(area, &overlap); + + uint8_t pixels_per_byte = 8 / colorspace->depth; + + uint32_t linestride_px = displayio_area_width(area); + uint32_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; + uint32_t column_dirty_offset_px = overlap.x1 - area->x1; + VECTORIO_SHAPE_DEBUG(", linestride:%3d line_offset:%3d col_offset:%3d depth:%2d ppb:%2d\n", linestride_px, line_dirty_offset_px, column_dirty_offset_px, colorspace->depth, pixels_per_byte); + + displayio_input_pixel_t input_pixel; + displayio_output_pixel_t output_pixel; + + uint32_t mask_start_px = line_dirty_offset_px; + for (input_pixel.y = overlap.y1; input_pixel.y < overlap.y2; ++input_pixel.y) { + mask_start_px += column_dirty_offset_px; + for (input_pixel.x = overlap.x1; input_pixel.x < overlap.x2; ++input_pixel.x) { + // Check the mask first to see if the pixel has already been set. + uint32_t pixel_index = mask_start_px + (input_pixel.x - overlap.x1); + uint32_t *mask_doubleword = &(mask[pixel_index / 32]); + uint8_t mask_bit = pixel_index % 32; + VECTORIO_SHAPE_PIXEL_DEBUG("%p pixel_index: %5u mask_bit: %2u", self, pixel_index, mask_bit); + if ((*mask_doubleword & (1u << mask_bit)) != 0) { + VECTORIO_SHAPE_PIXEL_DEBUG(" masked\n"); + continue; + } + output_pixel.pixel = 0; + + // Get the target pixel based on the shape's coordinate space + int16_t pixel_to_get_x; + int16_t pixel_to_get_y; + if (self->transpose_xy) { + pixel_to_get_x = input_pixel.y - self->x; + pixel_to_get_y = input_pixel.x - self->y; + } else { + pixel_to_get_x = input_pixel.x - self->x; + pixel_to_get_y = input_pixel.y - self->y; + } + VECTORIO_SHAPE_PIXEL_DEBUG(" get_pixel %p (%3d, %3d) -> ( %3d, %3d )", self->ishape.shape, input_pixel.x, input_pixel.y, pixel_to_get_x, pixel_to_get_y); + input_pixel.pixel = self->ishape.get_pixel(self->ishape.shape, pixel_to_get_x, pixel_to_get_y); + VECTORIO_SHAPE_PIXEL_DEBUG(" -> %d", input_pixel.pixel); + + output_pixel.opaque = true; + if (self->pixel_shader == mp_const_none) { + output_pixel.pixel = input_pixel.pixel; + } else if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_palette_type)) { + output_pixel.opaque = displayio_palette_get_color(self->pixel_shader, colorspace, input_pixel.pixel, &output_pixel.pixel); + } else if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_colorconverter_type)) { + displayio_colorconverter_convert(self->pixel_shader, colorspace, &input_pixel, &output_pixel); + } + if (!output_pixel.opaque) { + VECTORIO_SHAPE_PIXEL_DEBUG(" (encountered transparent pixel; input area is not fully covered)\n"); + full_coverage = false; + } else { + *mask_doubleword |= 1u << mask_bit; + if (colorspace->depth == 16) { + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %04x 16\n", output_pixel.pixel); + *(((uint16_t*) buffer) + pixel_index) = output_pixel.pixel; + } else if (colorspace->depth == 8) { + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %02x 8\n", output_pixel.pixel); + *(((uint8_t*) buffer) + pixel_index) = output_pixel.pixel; + } else if (colorspace->depth < 8) { + // Reorder the offsets to pack multiple rows into a byte (meaning they share a column). + if (!colorspace->pixels_in_byte_share_row) { + uint16_t width = linestride_px; + uint16_t row = pixel_index / width; + uint16_t col = pixel_index % width; + pixel_index = col * pixels_per_byte + (row / pixels_per_byte) * pixels_per_byte * width + row % pixels_per_byte; + } + uint8_t shift = (pixel_index % pixels_per_byte) * colorspace->depth; + if (colorspace->reverse_pixels_in_byte) { + // Reverse the shift by subtracting it from the leftmost shift. + shift = (pixels_per_byte - 1) * colorspace->depth - shift; + } + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %2d %d\n", output_pixel.pixel, colorspace->depth); + ((uint8_t*)buffer)[pixel_index / pixels_per_byte] |= output_pixel.pixel << shift; + } + } + } + mask_start_px += linestride_px - column_dirty_offset_px; + } + return full_coverage; +} + + +void vectorio_vector_shape_finish_refresh(vectorio_vector_shape_t *self) { + if ( !self->dirty ) { + return; + } + VECTORIO_SHAPE_DEBUG("%p finish_refresh was:{(%3d,%3d), (%3d,%3d)}\n", self, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + self->dirty = false; + // Reset dirty area tracking to current footprint + _get_screen_area(self, &self->ephemeral_dirty_area); + self->ephemeral_dirty_area.next = NULL; + VECTORIO_SHAPE_DEBUG("%p finish_refresh now:{(%3d,%3d), (%3d,%3d)}\n", self, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + + if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_palette_type)) { + displayio_palette_finish_refresh(self->pixel_shader); + } else if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_colorconverter_type)) { + displayio_colorconverter_finish_refresh(self->pixel_shader); + } +} + + +// Assembles a singly linked list of dirty areas from all components on the display. +displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t* tail) { + if (self->dirty + || (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_palette_type) && displayio_palette_needs_refresh(self->pixel_shader)) + || (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_colorconverter_type) && displayio_colorconverter_needs_refresh(self->pixel_shader)) + ) { + VECTORIO_SHAPE_DEBUG("%p get_refresh_area dirty:%d {(%3d,%3d), (%3d,%3d)}", self, self->dirty, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + common_hal_vectorio_vector_shape_set_dirty(self); + // vector.add_to_head + self->ephemeral_dirty_area.next = tail; + VECTORIO_SHAPE_DEBUG(" this_area: %p next: %p after: %p\n", &self->ephemeral_dirty_area, tail, tail == NULL ? NULL : tail->next); + return &self->ephemeral_dirty_area; + } + return tail; +} + diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h new file mode 100644 index 0000000000..ac60e5b985 --- /dev/null +++ b/shared-module/vectorio/VectorShape.h @@ -0,0 +1,51 @@ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_SHAPE_H +#define MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_SHAPE_H + +#include +#include + +#include "py/obj.h" +#include "shared-module/displayio/area.h" +#include "shared-module/displayio/Palette.h" + +typedef void get_area_function(mp_obj_t shape, displayio_area_t *out_area); +typedef uint32_t get_pixel_function(mp_obj_t shape, int16_t x, int16_t y); + +// This struct binds a shape's common Shape support functions (its vector shape interface) +// to its instance pointer. We only check at construction time what the type of the +// associated shape is and link the correct functions up. +// Later when using the shape for drawing logic these functions may be invoked +// unconditionally. This simplifies the addition of new types and restricts the +// respective responsibilities of VectorShape and actual shape implementations. +typedef struct { + mp_obj_t shape; + get_area_function *get_area; + get_pixel_function *get_pixel; +} vectorio_ishape_t; + +typedef struct { + mp_obj_base_t base; + vectorio_ishape_t ishape; + mp_obj_t pixel_shader; + int16_t x; + int16_t y; + bool transpose_xy; + bool dirty; // True if we need to draw + // Tracks current shape footprint and expands outward as the shape dirties and changes. + // This is suboptimal if you move your shape far. Could add more state to only redraw + // exactly what we left behind. + displayio_area_t ephemeral_dirty_area; +} vectorio_vector_shape_t; + +displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t* tail); + +// Area is always in absolute screen coordinates. +bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer); + +// Fills in out_area with the maximum bounds of all related pixels in the last rendered frame. Returns +// false if the vector shape wasn't rendered in the last frame. +bool vectorio_vector_shape_get_previous_area(vectorio_vector_shape_t *self, displayio_area_t *out_area); +void vectorio_vector_shape_finish_refresh(vectorio_vector_shape_t *self); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_SHAPE_H diff --git a/shared-module/vectorio/__init__.c b/shared-module/vectorio/__init__.c new file mode 100644 index 0000000000..473c509c3c --- /dev/null +++ b/shared-module/vectorio/__init__.c @@ -0,0 +1,3 @@ + +// Don't need anything in here yet + diff --git a/shared-module/vectorio/__init__.h b/shared-module/vectorio/__init__.h new file mode 100644 index 0000000000..6ae381f067 --- /dev/null +++ b/shared-module/vectorio/__init__.h @@ -0,0 +1,15 @@ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_INIT_H +#define MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_INIT_H + +#include "py/obj.h" + +typedef void event_function(mp_obj_t obj); + +typedef struct { + mp_obj_t obj; + event_function *event; +} vectorio_event_t; + + +#endif + From 7697c419b4718a96ec8b86620a82af5f8d81f958 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 9 May 2020 16:45:55 -0700 Subject: [PATCH 432/919] translations for vectorio --- locale/ID.po | 41 +++++++++++++++++++++++++++++++--------- locale/circuitpython.pot | 41 +++++++++++++++++++++++++++++++--------- locale/de_DE.po | 41 +++++++++++++++++++++++++++++++--------- locale/en_US.po | 41 +++++++++++++++++++++++++++++++--------- locale/en_x_pirate.po | 41 +++++++++++++++++++++++++++++++--------- locale/es.po | 41 +++++++++++++++++++++++++++++++--------- locale/fil.po | 41 +++++++++++++++++++++++++++++++--------- locale/fr.po | 41 +++++++++++++++++++++++++++++++--------- locale/it_IT.po | 41 +++++++++++++++++++++++++++++++--------- locale/ko.po | 41 +++++++++++++++++++++++++++++++--------- locale/pl.po | 41 +++++++++++++++++++++++++++++++--------- locale/pt_BR.po | 41 +++++++++++++++++++++++++++++++--------- locale/sv.po | 41 +++++++++++++++++++++++++++++++--------- locale/zh_Latn_pinyin.po | 41 +++++++++++++++++++++++++++++++--------- 14 files changed, 448 insertions(+), 126 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 3a2afdef8f..8fccb8c1a7 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,13 +70,22 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "buffers harus mempunyai panjang yang sama" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -797,7 +806,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1050,7 +1060,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1058,7 +1068,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1089,11 +1099,11 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2012,6 +2022,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2114,6 +2128,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap kosong" @@ -2804,10 +2822,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3127,7 +3149,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index edfef28df4..dd0162c2cd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,12 +70,21 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -786,7 +795,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1039,7 +1049,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1047,7 +1057,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1078,11 +1088,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1988,6 +1998,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2090,6 +2104,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2779,10 +2797,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3101,7 +3123,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 578e2d86b2..476962dd26 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2020-04-30 17:01+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German = 1" msgstr "%q muss >= 1 sein" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q sollte ein int sein" @@ -799,7 +808,8 @@ msgstr "Gruppe schon benutzt" msgid "Group full" msgstr "Gruppe voll" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1055,7 +1065,7 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1063,7 +1073,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1094,11 +1104,11 @@ msgstr "Kein DAC im Chip vorhanden" msgid "No DMA channel found" msgstr "Kein DMA Kanal gefunden" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2023,6 +2033,10 @@ msgstr "chr() arg ist nicht in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg ist nicht in range(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "Farbpuffer muss 3 Bytes (RGB) oder 4 Bytes (RGB + pad byte) sein" @@ -2126,6 +2140,10 @@ msgstr "Division durch Null" msgid "empty" msgstr "leer" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "leerer heap" @@ -2824,10 +2842,14 @@ msgstr "Pixelkoordinaten außerhalb der Grenzen" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3153,7 +3175,8 @@ msgstr "" msgid "unreadable attribute" msgstr "nicht lesbares Attribut" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "Nicht unterstützter %q-Typ" diff --git a/locale/en_US.po b/locale/en_US.po index 6aba6d3262..b1b03a3e7f 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -70,12 +70,21 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -786,7 +795,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1039,7 +1049,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1047,7 +1057,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1078,11 +1088,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1988,6 +1998,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2090,6 +2104,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2779,10 +2797,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3101,7 +3123,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 36583bfd2f..9828932bee 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English = 1" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -795,7 +804,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1048,7 +1058,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1056,7 +1066,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1087,11 +1097,11 @@ msgstr "Shiver me timbers! There be no DAC on this chip" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1997,6 +2007,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2099,6 +2113,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2788,10 +2806,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3110,7 +3132,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/es.po b/locale/es.po index b20ddff7df..0c7ba72ac7 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -72,12 +72,21 @@ msgstr "%q indice fuera de rango" msgid "%q indices must be integers, not %s" msgstr "%q indices deben ser enteros, no %s" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q debe ser >= 1" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q debe ser un int" @@ -792,7 +801,8 @@ msgstr "" msgid "Group full" msgstr "Group lleno" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1047,7 +1057,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1055,7 +1065,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1086,11 +1096,11 @@ msgstr "El chip no tiene DAC" msgid "No DMA channel found" msgstr "No se encontró el canal DMA" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2017,6 +2027,10 @@ msgstr "El argumento de chr() esta fuera de rango(0x110000)" msgid "chr() arg not in range(256)" msgstr "El argumento de chr() no esta en el rango(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "color buffer debe ser 3 bytes (RGB) ó 4 bytes (RGB + pad byte)" @@ -2121,6 +2135,10 @@ msgstr "división por cero" msgid "empty" msgstr "vacío" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vacío" @@ -2817,10 +2835,14 @@ msgstr "coordenadas del pixel fuera de límites" msgid "pixel value requires too many bits" msgstr "valor del pixel require demasiado bits" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3142,7 +3164,8 @@ msgstr "No coinciden '{' en format" msgid "unreadable attribute" msgstr "atributo no legible" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "tipo de %q no soportado" diff --git a/locale/fil.po b/locale/fil.po index 1af4bbc3cf..44206d6e7b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -70,13 +70,22 @@ msgstr "%q indeks wala sa sakop" msgid "%q indices must be integers, not %s" msgstr "%q indeks ay dapat integers, hindi %s" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "aarehas na haba dapat ang buffer slices" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -800,7 +809,8 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1055,7 +1065,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1063,7 +1073,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1094,11 +1104,11 @@ msgstr "Walang DAC sa chip" msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2028,6 +2038,10 @@ msgstr "chr() arg wala sa sakop ng range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg wala sa sakop ng range(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "color buffer ay dapat na 3 bytes (RGB) o 4 bytes (RGB + pad byte)" @@ -2134,6 +2148,10 @@ msgstr "dibisyon ng zero" msgid "empty" msgstr "walang laman" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "walang laman ang heap" @@ -2831,10 +2849,14 @@ msgstr "wala sa sakop ang address" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3157,7 +3179,8 @@ msgstr "hindi tugma ang '{' sa format" msgid "unreadable attribute" msgstr "hindi mabasa ang attribute" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "Hindi supportadong tipo ng %q" diff --git a/locale/fr.po b/locale/fr.po index ede3d2f2da..61263f6c36 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2020-05-05 20:24+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French = 1" msgstr "%q doit être >=1" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q doit être un entier (int)" @@ -810,7 +819,8 @@ msgstr "" msgid "Group full" msgstr "Groupe plein" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1069,7 +1079,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1077,7 +1087,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1108,11 +1118,11 @@ msgstr "Pas de DAC sur la puce" msgid "No DMA channel found" msgstr "Aucun canal DMA trouvé" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2058,6 +2068,10 @@ msgstr "argument de chr() hors de la gamme range(0x11000)" msgid "chr() arg not in range(256)" msgstr "argument de chr() hors de la gamme range(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "le tampon de couleur doit faire 3 octets (RVB) ou 4 (RVB + pad byte)" @@ -2166,6 +2180,10 @@ msgstr "division par zéro" msgid "empty" msgstr "vide" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tas vide" @@ -2869,11 +2887,15 @@ msgstr "coordonnées de pixel hors limites" msgid "pixel value requires too many bits" msgstr "la valeur du pixel requiet trop de bits" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" "pixel_shader doit être un objet displayio.Palette ou displayio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3197,7 +3219,8 @@ msgstr "'{' sans correspondance dans le format" msgid "unreadable attribute" msgstr "attribut illisible" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c #, fuzzy msgid "unsupported %q type" msgstr "type de %q non supporté" diff --git a/locale/it_IT.po b/locale/it_IT.po index ad7964feaf..17895aa3f6 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -70,13 +70,22 @@ msgstr "indice %q fuori intervallo" msgid "%q indices must be integers, not %s" msgstr "gli indici %q devono essere interi, non %s" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "slice del buffer devono essere della stessa lunghezza" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -800,7 +809,8 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1059,7 +1069,7 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Il ritardo di avvio del microfono deve essere nell'intervallo tra 0.0 e 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1067,7 +1077,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1098,11 +1108,11 @@ msgstr "Nessun DAC sul chip" msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2028,6 +2038,10 @@ msgstr "argomento di chr() non è in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argomento di chr() non è in range(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2135,6 +2149,10 @@ msgstr "divisione per zero" msgid "empty" msgstr "vuoto" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vuoto" @@ -2838,10 +2856,14 @@ msgstr "indirizzo fuori limite" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3164,7 +3186,8 @@ msgstr "'{' spaiato nella stringa di formattazione" msgid "unreadable attribute" msgstr "attributo non leggibile" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "tipo di %q non supportato" diff --git a/locale/ko.po b/locale/ko.po index 5f28a85992..51bbad5646 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -72,12 +72,21 @@ msgstr "%q 인덱스 범위를 벗어났습니다" msgid "%q indices must be integers, not %s" msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q 는 >=1이어야합니다" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q 는 정수(int) 여야합니다" @@ -790,7 +799,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1043,7 +1053,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1051,7 +1061,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1082,11 +1092,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1993,6 +2003,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2095,6 +2109,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2784,10 +2802,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3106,7 +3128,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 6e410cbbbc..5c71601b67 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -71,12 +71,21 @@ msgstr "%q poza zakresem" msgid "%q indices must be integers, not %s" msgstr "%q indeks musi być liczbą całkowitą, a nie %s" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q musi być >= 1" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q powinno być typu int" @@ -789,7 +798,8 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1044,7 +1054,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1052,7 +1062,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1083,11 +1093,11 @@ msgstr "Brak DAC" msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1996,6 +2006,10 @@ msgstr "argument chr() poza zakresem range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argument chr() poza zakresem range(256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "bufor kolorów musi nieć 3 bajty (RGB) lub 4 bajty (RGB + wypełnienie)" @@ -2099,6 +2113,10 @@ msgstr "dzielenie przez zero" msgid "empty" msgstr "puste" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "pusta sterta" @@ -2788,11 +2806,15 @@ msgstr "współrzędne piksela poza zakresem" msgid "pixel value requires too many bits" msgstr "wartość piksela wymaga zbyt wielu bitów" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" "pixel_shader musi być typu displayio.Palette lub dispalyio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3112,7 +3134,8 @@ msgstr "niepasujące '{' for formacie" msgid "unreadable attribute" msgstr "nieczytelny atrybut" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "zły typ %q" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index c5ef3b9c19..1669056357 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -70,13 +70,22 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "buffers devem ser o mesmo tamanho" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -795,7 +804,8 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1051,7 +1061,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1059,7 +1069,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1090,11 +1100,11 @@ msgstr "Nenhum DAC no chip" msgid "No DMA channel found" msgstr "Nenhum canal DMA encontrado" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -2009,6 +2019,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2111,6 +2125,10 @@ msgstr "divisão por zero" msgid "empty" msgstr "vazio" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vazia" @@ -2801,10 +2819,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3125,7 +3147,8 @@ msgstr "" msgid "unreadable attribute" msgstr "atributo ilegível" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 7c5f43e19d..15fb0ee849 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,12 +70,21 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -786,7 +795,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -1039,7 +1049,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1047,7 +1057,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1078,11 +1088,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1988,6 +1998,10 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2090,6 +2104,10 @@ msgstr "" msgid "empty" msgstr "" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -2779,10 +2797,14 @@ msgstr "" msgid "pixel value requires too many bits" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3101,7 +3123,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 51c59e7631..1905ead0a4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 17:47+0800\n" +"POT-Creation-Date: 2020-05-09 16:44-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -77,12 +77,21 @@ msgstr "%q suǒyǐn chāochū fànwéi" msgid "%q indices must be integers, not %s" msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q bìxū dàyú huò děngyú 1" +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q yīnggāi shì yīgè int" @@ -797,7 +806,8 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" @@ -1052,7 +1062,7 @@ msgstr "MicroPython zhìmìng cuòwù." msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" @@ -1060,7 +1070,7 @@ msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" @@ -1091,11 +1101,11 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Méiyǒu MISO yǐn jiǎo" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Méiyǒu MOSI yǐn jiǎo" @@ -2021,6 +2031,10 @@ msgstr "chr() cān shǔ bùzài fànwéi (0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() cān shǔ bùzài fànwéi (256)" +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2127,6 +2141,10 @@ msgstr "bèi líng chú" msgid "empty" msgstr "kòngxián" +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "kōng yīn yīnxiào" @@ -2818,10 +2836,14 @@ msgstr "xiàngsù zuòbiāo chāochū biānjiè" msgid "pixel value requires too many bits" msgstr "xiàngsù zhí xūyào tài duō wèi" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter" +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c @@ -3142,7 +3164,8 @@ msgstr "géshì wèi pǐpèi '{'" msgid "unreadable attribute" msgstr "bùkě dú shǔxìng" -#: shared-bindings/displayio/TileGrid.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "bù zhīchí %q lèixíng" From 1c6e646f5630a46ea77e848788947c099e2c1f31 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sat, 9 May 2020 17:58:01 -0700 Subject: [PATCH 433/919] vectorio: fix mpconfig definition for disabled boards --- py/circuitpy_mpconfig.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index f48a648c49..a62ac11e9c 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -355,6 +355,8 @@ extern const struct _mp_obj_module_t framebufferio_module; #if CIRCUITPY_VECTORIO extern const struct _mp_obj_module_t vectorio_module; #define VECTORIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_vectorio), (mp_obj_t)&vectorio_module }, +#else +#define VECTORIO_MODULE #endif #if CIRCUITPY_FREQUENCYIO From 4086600b61f14e043f02c1b8771e7780b82f313c Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Fri, 8 May 2020 23:03:15 -0700 Subject: [PATCH 434/919] vectorio: switch per-shape transform to Display Rather than maintain a transform per-shape, we'll just use whatever settings are on the Display. Currently only transpose is done. --- shared-bindings/vectorio/VectorShape.c | 22 ++--------------- shared-bindings/vectorio/VectorShape.h | 8 +++--- shared-module/displayio/Group.c | 6 +++++ shared-module/vectorio/VectorShape.c | 34 ++++++++++++++++++-------- shared-module/vectorio/VectorShape.h | 2 +- 5 files changed, 38 insertions(+), 34 deletions(-) diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 8f99577b4f..02a42536d7 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -32,13 +32,12 @@ //| :param int y: Initial y position of the center axis of the shape within the parent. //| STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_shape, ARG_pixel_shader, ARG_x, ARG_y, ARG_transpose_xy }; + enum { ARG_shape, ARG_pixel_shader, ARG_x, ARG_y }; static const mp_arg_t allowed_args[] = { { MP_QSTR_shape, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - { MP_QSTR_transpose_xy, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); @@ -74,7 +73,7 @@ STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t vectorio_vector_shape_t *self = m_new_obj(vectorio_vector_shape_t); self->base.type = &vectorio_vector_shape_type; common_hal_vectorio_vector_shape_construct(self, - ishape, pixel_shader, x, y, args[ARG_transpose_xy].u_bool + ishape, pixel_shader, x, y ); // Wire up event callbacks @@ -150,23 +149,6 @@ const mp_obj_property_t vectorio_vector_shape_y_obj = { }; -//| .. attribute:: transpose_xy -//| -//| true if the object is to be flipped. -//| -STATIC mp_obj_t vectorio_vector_shape_obj_get_transpose_xy(mp_obj_t self_in) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_bool(common_hal_vectorio_vector_shape_get_transpose_xy(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_transpose_xy_obj, vectorio_vector_shape_obj_get_transpose_xy); - -const mp_obj_property_t vectorio_vector_shape_transpose_xy_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_vector_shape_get_transpose_xy_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - //| .. attribute:: pixel_shader //| //| The pixel shader of the shape. diff --git a/shared-bindings/vectorio/VectorShape.h b/shared-bindings/vectorio/VectorShape.h index ad745b30ff..d098504e93 100644 --- a/shared-bindings/vectorio/VectorShape.h +++ b/shared-bindings/vectorio/VectorShape.h @@ -2,12 +2,13 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H #include "shared-module/vectorio/VectorShape.h" +#include "shared-module/displayio/area.h" extern const mp_obj_type_t vectorio_vector_shape_type; void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, vectorio_ishape_t ishape, - mp_obj_t pixel_shader, uint16_t x, uint16_t y, bool transpose_xy); + mp_obj_t pixel_shader, uint16_t x, uint16_t y); void common_hal_vectorio_vector_shape_set_dirty(void *self); @@ -17,9 +18,10 @@ void common_hal_vectorio_vector_shape_set_x(vectorio_vector_shape_t *self, mp_in mp_int_t common_hal_vectorio_vector_shape_get_y(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_int_t y); -bool common_hal_vectorio_vector_shape_get_transpose_xy(vectorio_vector_shape_t *self); - mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_pixel_shader(vectorio_vector_shape_t *self, mp_obj_t pixel_shader); + +void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displayio_buffer_transform_t *group_transform); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 9d50dabec7..0c31de5320 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -122,6 +122,12 @@ static void _update_child_transforms(displayio_group_t* self) { } for (size_t i = 0; i < self->size; i++) { mp_obj_t layer = self->children[i].native; +#if CIRCUITPY_VECTORIO + if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + vectorio_vector_shape_update_transform(layer, &self->absolute_transform); + } + else +#endif if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { displayio_tilegrid_update_transform(layer, &self->absolute_transform); } else if (MP_OBJ_IS_TYPE(layer, &displayio_group_type)) { diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 985b778584..6030c1e3d5 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -50,7 +50,7 @@ inline __attribute__((always_inline)) static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { VECTORIO_SHAPE_DEBUG("%p get_screen_area\n", self); self->ishape.get_area(self->ishape.shape, out_area); - if (self->transpose_xy) { + if (self->absolute_transform->transpose_xy) { _transpose_area(out_area); displayio_area_shift(out_area, self->y, self->x); } else { @@ -76,18 +76,32 @@ void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) { } +static displayio_buffer_transform_t null_transform = { + .x = 0, + .y = 0, + .dx = 0, + .dy = 0, + .scale = 1, + .width = 0, + .height = 0, + .mirror_x = false, + .mirror_y = false, + .transpose_xy = false +}; + + void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, vectorio_ishape_t ishape, - mp_obj_t pixel_shader, uint16_t x, uint16_t y, bool transpose_xy) { + mp_obj_t pixel_shader, uint16_t x, uint16_t y) { VECTORIO_SHAPE_DEBUG("%p vector_shape_construct x:%3d, y:%3d\n", self, x, y); self->x = x; self->y = y; self->pixel_shader = pixel_shader; self->ishape = ishape; - self->transpose_xy = transpose_xy; self->dirty = true; _get_screen_area(self, &self->ephemeral_dirty_area); self->ephemeral_dirty_area.next = NULL; + self->absolute_transform = &null_transform; } @@ -123,12 +137,6 @@ void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_in } -bool common_hal_vectorio_vector_shape_get_transpose_xy(vectorio_vector_shape_t *self) { - VECTORIO_SHAPE_DEBUG("%p get_transpose_xy\n", self); - return self->transpose_xy; -} - - mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self) { VECTORIO_SHAPE_DEBUG("%p get_pixel_shader\n", self); return self->pixel_shader; @@ -191,7 +199,7 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ // Get the target pixel based on the shape's coordinate space int16_t pixel_to_get_x; int16_t pixel_to_get_y; - if (self->transpose_xy) { + if (self->absolute_transform->transpose_xy) { pixel_to_get_x = input_pixel.y - self->x; pixel_to_get_y = input_pixel.x - self->y; } else { @@ -280,3 +288,9 @@ displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_ return tail; } +void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displayio_buffer_transform_t *group_transform) { + self->absolute_transform = group_transform; + common_hal_vectorio_vector_shape_set_dirty(self); +} + + diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h index ac60e5b985..8fc698dbc1 100644 --- a/shared-module/vectorio/VectorShape.h +++ b/shared-module/vectorio/VectorShape.h @@ -30,7 +30,7 @@ typedef struct { mp_obj_t pixel_shader; int16_t x; int16_t y; - bool transpose_xy; + displayio_buffer_transform_t *absolute_transform; bool dirty; // True if we need to draw // Tracks current shape footprint and expands outward as the shape dirties and changes. // This is suboptimal if you move your shape far. Could add more state to only redraw From 2f7c0ec8e4497c95bb7f5f5ee630c3748acdf9a9 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 10 May 2020 16:22:01 -0400 Subject: [PATCH 435/919] Minor fixes to _pixelbuf.PixelBuf docs --- shared-bindings/_pixelbuf/PixelBuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 61b4c9ae09..78f94b66bc 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -44,7 +44,7 @@ extern const int32_t colorwheel(float pos); static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t* parsed); -//| .. currentmodule:: pixelbuf +//| .. currentmodule:: _pixelbuf //| //| :class:`PixelBuf` -- A fast RGB[W] pixel buffer for LED and similar devices //| =========================================================================== @@ -64,7 +64,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| output buffer (``buf``). //| //| :param ~int size: Number of pixelsx -//| :param ~str byteorder: Byte order string (such as "BGR" or "PBGR") +//| :param ~str byteorder: Byte order string (such as "BGR" or "BGRP") //| :param ~float brightness: Brightness (0 to 1.0, default 1.0) //| :param ~bool auto_write: Whether to automatically write pixels (Default False) //| :param bytes header: Sequence of bytes to always send before pixel values. From 6660311a96f063e935e85a228f8b12e3a07ca95c Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 10 May 2020 14:17:57 -0700 Subject: [PATCH 436/919] vectorio: respect display transpose and mirror. VectorShape now just uses the Group's and Display's absolute transforms. --- shared-module/displayio/Group.c | 7 +++ shared-module/vectorio/Circle.c | 4 +- shared-module/vectorio/VectorShape.c | 69 +++++++++++++++------------- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index 0c31de5320..d6df01f3de 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -215,6 +215,7 @@ static mp_obj_t _add_layer(displayio_group_t* self, mp_obj_t layer) { #if CIRCUITPY_VECTORIO native_layer = mp_instance_cast_to_native_base(layer, &vectorio_vector_shape_type); if (native_layer != MP_OBJ_NULL) { + vectorio_vector_shape_update_transform(native_layer, &self->absolute_transform); return native_layer; } #endif @@ -247,6 +248,12 @@ static void _remove_layer(displayio_group_t* self, size_t index) { mp_obj_t layer = self->children[index].native; displayio_area_t layer_area; bool rendered_last_frame = false; +#if CIRCUITPY_VECTORIO + if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + vectorio_vector_shape_update_transform(layer, NULL); + } + else +#endif if (MP_OBJ_IS_TYPE(layer, &displayio_tilegrid_type)) { displayio_tilegrid_t* tilegrid = layer; rendered_last_frame = displayio_tilegrid_get_previous_area(tilegrid, &layer_area); diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 6bcd6318fe..e6e3268e7e 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -34,8 +34,8 @@ uint32_t common_hal_vectorio_circle_get_pixel(void *obj, int16_t x, int16_t y) { void common_hal_vectorio_circle_get_area(void *circle, displayio_area_t *out_area) { vectorio_circle_t *self = circle; - out_area->x1 = -1 * self->radius; - out_area->y1 = -1 * self->radius; + out_area->x1 = -1 * self->radius - 1; + out_area->y1 = -1 * self->radius - 1; out_area->x2 = self->radius + 1; out_area->y2 = self->radius + 1; } diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 6030c1e3d5..b23baa4cf2 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -28,34 +28,39 @@ static int32_t max(int32_t a, int32_t b) { } -inline __attribute__((always_inline)) -static void _transpose_area(displayio_area_t *out_area) { - int16_t swap = out_area->x1; - out_area->x1 = out_area->y1; - out_area->y1 = swap; - swap = out_area->x2; - out_area->x2 = out_area->y2; - out_area->y2 = swap; -} - - -inline __attribute__((always_inline)) -static void _get_shape_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { - VECTORIO_SHAPE_DEBUG("%p get_area\n", self); - self->ishape.get_area(self->ishape.shape, out_area); -} - - inline __attribute__((always_inline)) static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { - VECTORIO_SHAPE_DEBUG("%p get_screen_area\n", self); + VECTORIO_SHAPE_DEBUG("%p get_screen_area tform:{x:%d y:%d dx:%d dy:%d scl:%d w:%d h:%d mx:%d my:%d tr:%d}", self, + self->absolute_transform->x, self->absolute_transform->y, self->absolute_transform->dx, self->absolute_transform->dy, self->absolute_transform->scale, + self->absolute_transform->width, self->absolute_transform->height, self->absolute_transform->mirror_x, self->absolute_transform->mirror_y, self->absolute_transform->transpose_xy + ); self->ishape.get_area(self->ishape.shape, out_area); + VECTORIO_SHAPE_DEBUG(" in:{(%5d,%5d), (%5d,%5d)}", out_area->x1, out_area->y1, out_area->x2, out_area->y2); if (self->absolute_transform->transpose_xy) { - _transpose_area(out_area); - displayio_area_shift(out_area, self->y, self->x); + int16_t swap = out_area->x1; + out_area->x1 = (out_area->y1 + self->y) * self->absolute_transform->dx + self->absolute_transform->x; + out_area->y1 = (swap + self->x) * self->absolute_transform->dy + self->absolute_transform->y; + swap = out_area->x2; + out_area->x2 = (out_area->y2 + self->y) * self->absolute_transform->dx + self->absolute_transform->x; + out_area->y2 = (swap + self->x) * self->absolute_transform->dy + self->absolute_transform->y; } else { - displayio_area_shift(out_area, self->x, self->y); + out_area->x1 = (out_area->x1 + self->x) * self->absolute_transform->dx + self->absolute_transform->x; + out_area->y1 = (out_area->y1 + self->y) * self->absolute_transform->dy + self->absolute_transform->y; + out_area->x2 = (out_area->x2 + self->x) * self->absolute_transform->dx + self->absolute_transform->x; + out_area->y2 = (out_area->y2 + self->y) * self->absolute_transform->dy + self->absolute_transform->y; } + // We might have mirrored due to dx + if (out_area->x2 < out_area->x1) { + int16_t swap = out_area->x1; + out_area->x1 = out_area->x2; + out_area->x2 = swap; + } + if (out_area->y2 < out_area->y1) { + int16_t swap = out_area->y1; + out_area->y1 = out_area->y2; + out_area->y2 = swap; + } + VECTORIO_SHAPE_DEBUG(" out:{(%5d,%5d), (%5d,%5d)}\n", out_area->x1, out_area->y1, out_area->x2, out_area->y2); } @@ -79,8 +84,8 @@ void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) { static displayio_buffer_transform_t null_transform = { .x = 0, .y = 0, - .dx = 0, - .dy = 0, + .dx = 1, + .dy = 1, .scale = 1, .width = 0, .height = 0, @@ -99,9 +104,9 @@ void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, self->pixel_shader = pixel_shader; self->ishape = ishape; self->dirty = true; + self->absolute_transform = &null_transform; // Critical to have a valid transform before getting screen area. _get_screen_area(self, &self->ephemeral_dirty_area); self->ephemeral_dirty_area.next = NULL; - self->absolute_transform = &null_transform; } @@ -156,9 +161,7 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ // Pixels are drawn on the screen_area (shifted) coordinate space, while pixels are _determined_ from // the shape_area (unshifted) space. displayio_area_t overlap; - displayio_area_t shape_area; - _get_shape_area(self, &shape_area); - VECTORIO_SHAPE_DEBUG("%p fill_area dirty:%d fill: {(%3d,%3d), (%3d,%3d)} dirty: {(%3d,%3d), (%3d,%3d)}", + VECTORIO_SHAPE_DEBUG("%p fill_area dirty:%d fill: {(%5d,%5d), (%5d,%5d)} dirty: {(%5d,%5d), (%5d,%5d)}", self, self->dirty, area->x1, area->y1, area->x2, area->y2, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2 @@ -200,11 +203,11 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ int16_t pixel_to_get_x; int16_t pixel_to_get_y; if (self->absolute_transform->transpose_xy) { - pixel_to_get_x = input_pixel.y - self->x; - pixel_to_get_y = input_pixel.x - self->y; + pixel_to_get_x = (input_pixel.y - self->absolute_transform->dy * self->x - self->absolute_transform->y) / self->absolute_transform->dy; + pixel_to_get_y = (input_pixel.x - self->absolute_transform->dx * self->y - self->absolute_transform->x) / self->absolute_transform->dx; } else { - pixel_to_get_x = input_pixel.x - self->x; - pixel_to_get_y = input_pixel.y - self->y; + pixel_to_get_x = (input_pixel.x - self->absolute_transform->dx * self->x) / self->absolute_transform->dx; + pixel_to_get_y = (input_pixel.y - self->absolute_transform->dy * self->y) / self->absolute_transform->dy; } VECTORIO_SHAPE_PIXEL_DEBUG(" get_pixel %p (%3d, %3d) -> ( %3d, %3d )", self->ishape.shape, input_pixel.x, input_pixel.y, pixel_to_get_x, pixel_to_get_y); input_pixel.pixel = self->ishape.get_pixel(self->ishape.shape, pixel_to_get_x, pixel_to_get_y); @@ -289,7 +292,7 @@ displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_ } void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displayio_buffer_transform_t *group_transform) { - self->absolute_transform = group_transform; + self->absolute_transform = group_transform == NULL ? &null_transform : group_transform; common_hal_vectorio_vector_shape_set_dirty(self); } From 58c8e00745064bd290fc9ec18a838960b27c1eea Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 10 May 2020 15:36:23 -0700 Subject: [PATCH 437/919] vectorio: clean up after group removal VectorShape tells the Group to redraw whatever it left behind when it is removed now. --- shared-module/displayio/Group.c | 2 ++ shared-module/vectorio/VectorShape.c | 7 +++++++ shared-module/vectorio/VectorShape.h | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index d6df01f3de..15cf5b8e48 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -250,6 +250,8 @@ static void _remove_layer(displayio_group_t* self, size_t index) { bool rendered_last_frame = false; #if CIRCUITPY_VECTORIO if (MP_OBJ_IS_TYPE(layer, &vectorio_vector_shape_type)) { + bool has_dirty_area = vectorio_vector_shape_get_dirty_area(layer, &layer_area); + rendered_last_frame = has_dirty_area; vectorio_vector_shape_update_transform(layer, NULL); } else diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index b23baa4cf2..f57739047a 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -64,6 +64,13 @@ static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *ou } +// For use by Group to know where it needs to redraw on layer removal. +bool vectorio_vector_shape_get_dirty_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { + displayio_area_copy(&self->ephemeral_dirty_area, out_area); + return true; // For now just always redraw. +} + + // This must be invoked each time a shape changes its position or its shape in any way. void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) { vectorio_vector_shape_t *self = vector_shape; diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h index 8fc698dbc1..56eb3d8a53 100644 --- a/shared-module/vectorio/VectorShape.h +++ b/shared-module/vectorio/VectorShape.h @@ -38,7 +38,9 @@ typedef struct { displayio_area_t ephemeral_dirty_area; } vectorio_vector_shape_t; -displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t* tail); +displayio_area_t* vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t *tail); + +bool vectorio_vector_shape_get_dirty_area(vectorio_vector_shape_t *self, displayio_area_t *current_dirty_area); // Area is always in absolute screen coordinates. bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer); From 32f85f7a44b6ce753070168b4f008a9499d70883 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 10 May 2020 16:21:07 -0700 Subject: [PATCH 438/919] vectorio: fix up Rectangle * Fix drawing 1 pixel too large * Need to pad dirty area to ensure removed shapes are fully removed --- shared-module/vectorio/Rectangle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index dfad58a4d1..7fabe6ff93 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -12,7 +12,7 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_ uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) { vectorio_rectangle_t *self = obj; - if (x < 0 || x >= self->width || y >= self->height || y < 0) { + if (x < 0 || x > self->width || y > self->height || y < 0) { return 0; } return 1; @@ -21,8 +21,8 @@ uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area) { vectorio_rectangle_t *self = rectangle; - out_area->x1 = 0; - out_area->y1 = 0; + out_area->x1 = -1; + out_area->y1 = -1; out_area->x2 = self->width; out_area->y2 = self->height; } From 70f2ef3f8ef3707744741549bf7f094fd60f8435 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 10 May 2020 19:50:10 -0400 Subject: [PATCH 439/919] Fix docs some more --- shared-bindings/_pixelbuf/PixelBuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 78f94b66bc..3414b5d62b 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -58,7 +58,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| When brightness is less than 1.0, a second buffer will be used to store the color values //| before they are adjusted for brightness. //| -//| When ``P`` (pwm duration) is present as the 4th character of the byteorder +//| When ``P`` (pwm duration) is present as the first character of the byteorder //| string, the 4th value in the tuple/list for a pixel is the individual pixel //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the //| output buffer (``buf``). @@ -265,7 +265,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_show_obj, pixelbuf_pixelbuf_show); -//| .. function:: fill(color) +//| .. method:: fill(color) //| //| Fills the given pixelbuf with the given color. //| From 09fedb3fd5d0dd5852d7aa54ac9826c9a0b287b0 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 10 May 2020 21:35:37 -0400 Subject: [PATCH 440/919] fix another doc error (pixelsx - thanks @theacodes) --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 3414b5d62b..626dde680c 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -63,7 +63,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the //| output buffer (``buf``). //| -//| :param ~int size: Number of pixelsx +//| :param ~int size: Number of pixels //| :param ~str byteorder: Byte order string (such as "BGR" or "BGRP") //| :param ~float brightness: Brightness (0 to 1.0, default 1.0) //| :param ~bool auto_write: Whether to automatically write pixels (Default False) From eb3d5fa453bd04cc116e704c36a97250c93b7b4b Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 10 May 2020 20:45:42 -0700 Subject: [PATCH 441/919] ujson: do not eat trailing whitespace Ujson should only worry about whitespace before JSON. This becomes apparent when you are using MP stream protocol to read directly from input buffers. When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout. Fixes: - Waiting for a timeout after you have completed reading a correct and complete JSON off the input. - Raising an OSError after reading a correct and complete JSON off the input. - Eating more data than semantically owned off the input buffer. - Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object. Code you would write before: ``` line = board_busio_uart_port.read_line() json_dict = json.loads(line) ``` or reaching for fixed buffers and swapping them around in Python. Code that did not work before that does now: ``` json_dict = json.load(board_busio_uart_port) ``` - This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs. - It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA. - It simplifies code that users write while improving their apps. --- extmod/modujson.c | 26 ++++++++++++++++-------- ports/atmel-samd/common-hal/busio/UART.c | 3 +++ shared-bindings/busio/UART.c | 4 ++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/extmod/modujson.c b/extmod/modujson.c index 6b24bf5781..daefe18baf 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -53,6 +53,10 @@ STATIC mp_obj_t mod_ujson_dumps(mp_obj_t obj) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_dumps_obj, mod_ujson_dumps); +#define JSON_DEBUG(...) (void)0 +// #define JSON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + // The function below implements a simple non-recursive JSON parser. // // The JSON specification is at http://www.ietf.org/rfc/rfc4627.txt @@ -80,6 +84,7 @@ typedef struct _ujson_stream_t { STATIC byte ujson_stream_next(ujson_stream_t *s) { mp_uint_t ret = s->read(s->stream_obj, &s->cur, 1, &s->errcode); + JSON_DEBUG(" usjon_stream_next err:%2d cur: %c \n", s->errcode, s->cur); if (s->errcode != 0) { mp_raise_OSError(s->errcode); } @@ -92,6 +97,7 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); ujson_stream_t s = {stream_obj, stream_p->read, 0, 0}; + JSON_DEBUG("got JSON stream\n"); vstr_t vstr; vstr_init(&vstr, 8); mp_obj_list_t stack; // we use a list as a simple stack for nested JSON @@ -101,6 +107,15 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { mp_obj_type_t *stack_top_type = NULL; mp_obj_t stack_key = MP_OBJ_NULL; S_NEXT(s); + // Eat _leading_ whitespace. + // If we eat trailing whitespace we will block for timeout on streams like UART that + // wait for requested data. Furthermore, it is an OSError to read(1) and incur + // a timeout on those APIs. + // For these reasons, we must only eat _leading_ whitespace. + while (unichar_isspace(S_CUR(s))) { + JSON_DEBUG("Eating leading whitespace"); + S_NEXT(s); + } for (;;) { cont: if (S_END(s)) { @@ -262,14 +277,9 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { } } success: - // eat trailing whitespace - while (unichar_isspace(S_CUR(s))) { - S_NEXT(s); - } - if (!S_END(s)) { - // unexpected chars - goto fail; - } + // It is legal for a stream to have contents before and after JSON. + // If this parser has consumed a full successful JSON and its parse + // stack is empty, the parse has succeeded. if (stack_top == MP_OBJ_NULL || stack.len != 0) { // not exactly 1 object goto fail; diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 1f6b75f972..d6c13eb7e5 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -45,6 +45,9 @@ #include "samd/sercom.h" +#define UART_DEBUG(...) (void)0 +// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + // Do-nothing callback needed so that usart_async code will enable rx interrupts. // See comment below re usart_async_register_callback() static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index f231924d50..883b4630f7 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -39,6 +39,9 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" +#define STREAM_DEBUG(...) (void)0 +// #define STREAM_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + //| .. currentmodule:: busio //| @@ -219,6 +222,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These three methods are used by the shared stream methods. STATIC mp_uint_t busio_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) { + STREAM_DEBUG("busio_uart_read stream %d\n", size); busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); byte *buf = buf_in; From d8491f31768b04322728bc436b2f8e6c5f2bf0d6 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Sun, 10 May 2020 21:56:01 -0700 Subject: [PATCH 442/919] ujson: back out overeager loads() change; only change load() --- extmod/modujson.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/extmod/modujson.c b/extmod/modujson.c index daefe18baf..0f93ccb110 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -94,7 +94,7 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) { return s->cur; } -STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { +STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) { const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ); ujson_stream_t s = {stream_obj, stream_p->read, 0, 0}; JSON_DEBUG("got JSON stream\n"); @@ -107,15 +107,6 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { mp_obj_type_t *stack_top_type = NULL; mp_obj_t stack_key = MP_OBJ_NULL; S_NEXT(s); - // Eat _leading_ whitespace. - // If we eat trailing whitespace we will block for timeout on streams like UART that - // wait for requested data. Furthermore, it is an OSError to read(1) and incur - // a timeout on those APIs. - // For these reasons, we must only eat _leading_ whitespace. - while (unichar_isspace(S_CUR(s))) { - JSON_DEBUG("Eating leading whitespace"); - S_NEXT(s); - } for (;;) { cont: if (S_END(s)) { @@ -277,9 +268,19 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { } } success: - // It is legal for a stream to have contents before and after JSON. - // If this parser has consumed a full successful JSON and its parse - // stack is empty, the parse has succeeded. + // It is legal for a stream to have contents after JSON. + // E.g., A UART is not closed after receiving an object; in load() we will + // return the first complete JSON object, while in loads() we will retain + // strict adherence to the buffer's complete semantic. + if (!return_first_json) { + while (unichar_isspace(S_CUR(s))) { + S_NEXT(s); + } + if (!S_END(s)) { + // unexpected chars + goto fail; + } + } if (stack_top == MP_OBJ_NULL || stack.len != 0) { // not exactly 1 object goto fail; @@ -290,6 +291,10 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { fail: mp_raise_ValueError(translate("syntax error in JSON")); } + +STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) { + return _mod_ujson_load(stream_obj, true); +} STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_load_obj, mod_ujson_load); STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) { @@ -297,7 +302,7 @@ STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) { const char *buf = mp_obj_str_get_data(obj, &len); vstr_t vstr = {len, len, (char*)buf, true}; mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL}; - return mod_ujson_load(MP_OBJ_FROM_PTR(&sio)); + return _mod_ujson_load(MP_OBJ_FROM_PTR(&sio), false); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_loads_obj, mod_ujson_loads); From 838b6c56858fa3888c558e5640031b8764c313d7 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 11 May 2020 10:48:11 -0400 Subject: [PATCH 443/919] Did ps2io, pulseio, random --- shared-bindings/ps2io/Ps2.c | 135 ++++++++++++------------ shared-bindings/ps2io/__init__.c | 4 +- shared-bindings/pulseio/PWMOut.c | 114 ++++++++++---------- shared-bindings/pulseio/PulseIn.c | 161 ++++++++++++++--------------- shared-bindings/pulseio/PulseOut.c | 83 +++++++-------- shared-bindings/pulseio/__init__.c | 4 +- shared-bindings/random/__init__.c | 55 +++++----- 7 files changed, 278 insertions(+), 278 deletions(-) diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index 89ed0a76ce..d327d41801 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -36,38 +36,39 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: ps2io +//| class Ps2: +//| """.. currentmodule:: ps2io //| -//| :class:`Ps2` -- Communicate with a PS/2 keyboard or mouse -//| ========================================================= +//| :class:`Ps2` -- Communicate with a PS/2 keyboard or mouse +//| ========================================================= //| -//| Ps2 implements the PS/2 keyboard/mouse serial protocol, used in -//| legacy devices. It is similar to UART but there are only two -//| lines (Data and Clock). PS/2 devices are 5V, so bidirectional -//| level converters must be used to connect the I/O lines to pins -//| of 3.3V boards. +//| Ps2 implements the PS/2 keyboard/mouse serial protocol, used in +//| legacy devices. It is similar to UART but there are only two +//| lines (Data and Clock). PS/2 devices are 5V, so bidirectional +//| level converters must be used to connect the I/O lines to pins +//| of 3.3V boards.""" //| -//| .. class:: Ps2(data_pin, clock_pin) +//| def __init__(self, data_pin: microcontroller.Pin, clock_pin: microcontroller.Pin): +//| """Create a Ps2 object associated with the given pins. //| -//| Create a Ps2 object associated with the given pins. +//| :param ~microcontroller.Pin data_pin: Pin tied to data wire. +//| :param ~microcontroller.Pin clock_pin: Pin tied to clock wire. +//| This pin must support interrupts. //| -//| :param ~microcontroller.Pin data_pin: Pin tied to data wire. -//| :param ~microcontroller.Pin clock_pin: Pin tied to clock wire. -//| This pin must support interrupts. +//| Read one byte from PS/2 keyboard and turn on Scroll Lock LED:: //| -//| Read one byte from PS/2 keyboard and turn on Scroll Lock LED:: +//| import ps2io +//| import board //| -//| import ps2io -//| import board +//| kbd = ps2io.Ps2(board.D10, board.D11) //| -//| kbd = ps2io.Ps2(board.D10, board.D11) +//| while len(kbd) == 0: +//| pass //| -//| while len(kbd) == 0: -//| pass -//| -//| print(kbd.popleft()) -//| print(kbd.sendcmd(0xed)) -//| print(kbd.sendcmd(0x01)) +//| print(kbd.popleft()) +//| print(kbd.sendcmd(0xed)) +//| print(kbd.sendcmd(0x01))""" +//| ... //| STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_datapin, ARG_clkpin }; @@ -89,9 +90,9 @@ STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, con return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the Ps2 and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the Ps2 and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t ps2io_ps2_deinit(mp_obj_t self_in) { ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -106,16 +107,16 @@ STATIC void check_for_deinit(ps2io_ps2_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -124,10 +125,10 @@ STATIC mp_obj_t ps2io_ps2_obj___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ps2io_ps2___exit___obj, 4, 4, ps2io_ps2_obj___exit__); -//| .. method:: popleft() -//| -//| Removes and returns the oldest received byte. When buffer -//| is empty, raises an IndexError exception. +//| def popleft(self, ) -> Any: +//| """Removes and returns the oldest received byte. When buffer +//| is empty, raises an IndexError exception.""" +//| ... //| STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -141,18 +142,18 @@ STATIC mp_obj_t ps2io_ps2_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_popleft_obj, ps2io_ps2_obj_popleft); -//| .. method:: sendcmd(byte) +//| def sendcmd(self, byte: int) -> Any: +//| """Sends a command byte to PS/2. Returns the response byte, typically +//| the general ack value (0xFA). Some commands return additional data +//| which is available through :py:func:`popleft()`. //| -//| Sends a command byte to PS/2. Returns the response byte, typically -//| the general ack value (0xFA). Some commands return additional data -//| which is available through :py:func:`popleft()`. +//| Raises a RuntimeError in case of failure. The root cause can be found +//| by calling :py:func:`clear_errors()`. It is advisable to call +//| :py:func:`clear_errors()` before :py:func:`sendcmd()` to flush any +//| previous errors. //| -//| Raises a RuntimeError in case of failure. The root cause can be found -//| by calling :py:func:`clear_errors()`. It is advisable to call -//| :py:func:`clear_errors()` before :py:func:`sendcmd()` to flush any -//| previous errors. -//| -//| :param int byte: byte value of the command +//| :param int byte: byte value of the command""" +//| ... //| STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -166,35 +167,35 @@ STATIC mp_obj_t ps2io_ps2_obj_sendcmd(mp_obj_t self_in, mp_obj_t ob) { } MP_DEFINE_CONST_FUN_OBJ_2(ps2io_ps2_sendcmd_obj, ps2io_ps2_obj_sendcmd); -//| .. method:: clear_errors() +//| def clear_errors(self, ) -> Any: +//| """Returns and clears a bitmap with latest recorded communication errors. //| -//| Returns and clears a bitmap with latest recorded communication errors. +//| Reception errors (arise asynchronously, as data is received): //| -//| Reception errors (arise asynchronously, as data is received): +//| 0x01: start bit not 0 //| -//| 0x01: start bit not 0 +//| 0x02: timeout //| -//| 0x02: timeout +//| 0x04: parity bit error //| -//| 0x04: parity bit error +//| 0x08: stop bit not 1 //| -//| 0x08: stop bit not 1 +//| 0x10: buffer overflow, newest data discarded //| -//| 0x10: buffer overflow, newest data discarded +//| Transmission errors (can only arise in the course of sendcmd()): //| -//| Transmission errors (can only arise in the course of sendcmd()): +//| 0x100: clock pin didn't go to LO in time //| -//| 0x100: clock pin didn't go to LO in time +//| 0x200: clock pin didn't go to HI in time //| -//| 0x200: clock pin didn't go to HI in time +//| 0x400: data pin didn't ACK //| -//| 0x400: data pin didn't ACK +//| 0x800: clock pin didn't ACK //| -//| 0x800: clock pin didn't ACK +//| 0x1000: device didn't respond to RTS //| -//| 0x1000: device didn't respond to RTS -//| -//| 0x2000: device didn't send a response byte in time +//| 0x2000: device didn't send a response byte in time""" +//| ... //| STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -204,10 +205,10 @@ STATIC mp_obj_t ps2io_ps2_obj_clear_errors(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ps2io_ps2_clear_errors_obj, ps2io_ps2_obj_clear_errors); -//| .. method:: __len__() -//| -//| Returns the number of received bytes in buffer, available -//| to :py:func:`popleft()`. +//| def __len__(self, ) -> Any: +//| """Returns the number of received bytes in buffer, available +//| to :py:func:`popleft()`.""" +//| ... //| STATIC mp_obj_t ps2_unary_op(mp_unary_op_t op, mp_obj_t self_in) { ps2io_ps2_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/ps2io/__init__.c b/shared-bindings/ps2io/__init__.c index ec7c43e51f..081127bac4 100644 --- a/shared-bindings/ps2io/__init__.c +++ b/shared-bindings/ps2io/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/ps2io/Ps2.h" -//| :mod:`ps2io` --- Support for PS/2 protocol +//| """:mod:`ps2io` --- Support for PS/2 protocol //| ===================================================== //| //| .. module:: ps2io @@ -57,7 +57,7 @@ //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| :ref:`lifetime-and-contextmanagers` for more info.""" //| STATIC const mp_rom_map_elem_t ps2io_module_globals_table[] = { diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 2491a5c3f1..3a25d69380 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -35,55 +35,56 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: pulseio +//| class PWMOut: +//| """.. currentmodule:: pulseio //| -//| :class:`PWMOut` -- Output a Pulse Width Modulated signal -//| ======================================================== +//| :class:`PWMOut` -- Output a Pulse Width Modulated signal +//| ======================================================== //| -//| PWMOut can be used to output a PWM signal on a given pin. +//| PWMOut can be used to output a PWM signal on a given pin.""" //| -//| .. class:: PWMOut(pin, *, duty_cycle=0, frequency=500, variable_frequency=False) +//| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False): +//| """Create a PWM object associated with the given pin. This allows you to +//| write PWM signals out on the given pin. Frequency is fixed after init +//| unless ``variable_frequency`` is True. //| -//| Create a PWM object associated with the given pin. This allows you to -//| write PWM signals out on the given pin. Frequency is fixed after init -//| unless ``variable_frequency`` is True. +//| .. note:: When ``variable_frequency`` is True, further PWM outputs may be +//| limited because it may take more internal resources to be flexible. So, +//| when outputting both fixed and flexible frequency signals construct the +//| fixed outputs first. //| -//| .. note:: When ``variable_frequency`` is True, further PWM outputs may be -//| limited because it may take more internal resources to be flexible. So, -//| when outputting both fixed and flexible frequency signals construct the -//| fixed outputs first. +//| :param ~microcontroller.Pin pin: The pin to output to +//| :param int duty_cycle: The fraction of each pulse which is high. 16-bit +//| :param int frequency: The target frequency in Hertz (32-bit) +//| :param bool variable_frequency: True if the frequency will change over time //| -//| :param ~microcontroller.Pin pin: The pin to output to -//| :param int duty_cycle: The fraction of each pulse which is high. 16-bit -//| :param int frequency: The target frequency in Hertz (32-bit) -//| :param bool variable_frequency: True if the frequency will change over time +//| Simple LED fade:: //| -//| Simple LED fade:: +//| import pulseio +//| import board //| -//| import pulseio -//| import board +//| pwm = pulseio.PWMOut(board.D13) # output on D13 +//| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at the default 500hz //| -//| pwm = pulseio.PWMOut(board.D13) # output on D13 -//| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at the default 500hz +//| PWM at specific frequency (servos and motors):: //| -//| PWM at specific frequency (servos and motors):: +//| import pulseio +//| import board //| -//| import pulseio -//| import board +//| pwm = pulseio.PWMOut(board.D13, frequency=50) +//| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at 50hz //| -//| pwm = pulseio.PWMOut(board.D13, frequency=50) -//| pwm.duty_cycle = 2 ** 15 # Cycles the pin with 50% duty cycle (half of 2 ** 16) at 50hz +//| Variable frequency (usually tones):: //| -//| Variable frequency (usually tones):: +//| import pulseio +//| import board +//| import time //| -//| import pulseio -//| import board -//| import time -//| -//| pwm = pulseio.PWMOut(board.D13, duty_cycle=2 ** 15, frequency=440, variable_frequency=True) -//| time.sleep(0.2) -//| pwm.frequency = 880 -//| time.sleep(0.1) +//| pwm = pulseio.PWMOut(board.D13, duty_cycle=2 ** 15, frequency=440, variable_frequency=True) +//| time.sleep(0.2) +//| pwm.frequency = 880 +//| time.sleep(0.1)""" +//| ... //| STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { enum { ARG_pin, ARG_duty_cycle, ARG_frequency, ARG_variable_frequency }; @@ -119,9 +120,9 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the PWMOut and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the PWMOut and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t pulseio_pwmout_deinit(mp_obj_t self_in) { pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -136,16 +137,16 @@ STATIC void check_for_deinit(pulseio_pwmout_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -154,16 +155,16 @@ STATIC mp_obj_t pulseio_pwmout_obj___exit__(size_t n_args, const mp_obj_t *args) } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pwmout___exit___obj, 4, 4, pulseio_pwmout_obj___exit__); -//| .. attribute:: duty_cycle +//| duty_cycle: Any = ... +//| """16 bit value that dictates how much of one cycle is high (1) versus low +//| (0). 0xffff will always be high, 0 will always be low and 0x7fff will +//| be half high and then half low. //| -//| 16 bit value that dictates how much of one cycle is high (1) versus low -//| (0). 0xffff will always be high, 0 will always be low and 0x7fff will -//| be half high and then half low. +//| Depending on how PWM is implemented on a specific board, the internal +//| representation for duty cycle might have less than 16 bits of resolution. +//| Reading this property will return the value from the internal representation, +//| so it may differ from the value set.""" //| -//| Depending on how PWM is implemented on a specific board, the internal -//| representation for duty cycle might have less than 16 bits of resolution. -//| Reading this property will return the value from the internal representation, -//| so it may differ from the value set. STATIC mp_obj_t pulseio_pwmout_obj_get_duty_cycle(mp_obj_t self_in) { pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -190,16 +191,15 @@ const mp_obj_property_t pulseio_pwmout_duty_cycle_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: frequency -//| -//| 32 bit value that dictates the PWM frequency in Hertz (cycles per +//| frequency: Any = ... +//| """32 bit value that dictates the PWM frequency in Hertz (cycles per //| second). Only writeable when constructed with ``variable_frequency=True``. //| //| Depending on how PWM is implemented on a specific board, the internal value //| for the PWM's duty cycle may need to be recalculated when the frequency //| changes. In these cases, the duty cycle is automatically recalculated //| from the original duty cycle value. This should happen without any need -//| to manually re-set the duty cycle. +//| to manually re-set the duty cycle.""" //| STATIC mp_obj_t pulseio_pwmout_obj_get_frequency(mp_obj_t self_in) { pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 6c01a4c178..9024f53e3b 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -35,51 +35,52 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: pulseio +//| class PulseIn: +//| """.. currentmodule:: pulseio //| -//| :class:`PulseIn` -- Read a series of pulse durations -//| ======================================================== +//| :class:`PulseIn` -- Read a series of pulse durations +//| ======================================================== //| -//| PulseIn is used to measure a series of active and idle pulses. This is -//| commonly used in infrared receivers and low cost temperature sensors (DHT). -//| The pulsed signal consists of timed active and idle periods. Unlike PWM, -//| there is no set duration for active and idle pairs. +//| PulseIn is used to measure a series of active and idle pulses. This is +//| commonly used in infrared receivers and low cost temperature sensors (DHT). +//| The pulsed signal consists of timed active and idle periods. Unlike PWM, +//| there is no set duration for active and idle pairs.""" //| -//| .. class:: PulseIn(pin, maxlen=2, *, idle_state=False) +//| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False): +//| """Create a PulseIn object associated with the given pin. The object acts as +//| a read-only sequence of pulse lengths with a given max length. When it is +//| active, new pulse lengths are added to the end of the list. When there is +//| no more room (len() == `maxlen`) the oldest pulse length is removed to +//| make room. //| -//| Create a PulseIn object associated with the given pin. The object acts as -//| a read-only sequence of pulse lengths with a given max length. When it is -//| active, new pulse lengths are added to the end of the list. When there is -//| no more room (len() == `maxlen`) the oldest pulse length is removed to -//| make room. +//| :param ~microcontroller.Pin pin: Pin to read pulses from. +//| :param int maxlen: Maximum number of pulse durations to store at once +//| :param bool idle_state: Idle state of the pin. At start and after `resume` +//| the first recorded pulse will the opposite state from idle. //| -//| :param ~microcontroller.Pin pin: Pin to read pulses from. -//| :param int maxlen: Maximum number of pulse durations to store at once -//| :param bool idle_state: Idle state of the pin. At start and after `resume` -//| the first recorded pulse will the opposite state from idle. +//| Read a short series of pulses:: //| -//| Read a short series of pulses:: +//| import pulseio +//| import board //| -//| import pulseio -//| import board +//| pulses = pulseio.PulseIn(board.D7) //| -//| pulses = pulseio.PulseIn(board.D7) +//| # Wait for an active pulse +//| while len(pulses) == 0: +//| pass +//| # Pause while we do something with the pulses +//| pulses.pause() //| -//| # Wait for an active pulse -//| while len(pulses) == 0: -//| pass -//| # Pause while we do something with the pulses -//| pulses.pause() +//| # Print the pulses. pulses[0] is an active pulse unless the length +//| # reached max length and idle pulses are recorded. +//| print(pulses) //| -//| # Print the pulses. pulses[0] is an active pulse unless the length -//| # reached max length and idle pulses are recorded. -//| print(pulses) +//| # Clear the rest +//| pulses.clear() //| -//| # Clear the rest -//| pulses.clear() -//| -//| # Resume with an 80 microsecond active pulse -//| pulses.resume(80) +//| # Resume with an 80 microsecond active pulse +//| pulses.resume(80)""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin, ARG_maxlen, ARG_idle_state }; @@ -101,9 +102,9 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the PulseIn and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the PulseIn and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_deinit(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -118,16 +119,16 @@ STATIC void check_for_deinit(pulseio_pulsein_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -136,9 +137,9 @@ STATIC mp_obj_t pulseio_pulsein_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulsein___exit___obj, 4, 4, pulseio_pulsein_obj___exit__); -//| .. method:: pause() -//| -//| Pause pulse capture +//| def pause(self, ) -> Any: +//| """Pause pulse capture""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_obj_pause(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -149,16 +150,16 @@ STATIC mp_obj_t pulseio_pulsein_obj_pause(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_pause_obj, pulseio_pulsein_obj_pause); -//| .. method:: resume(trigger_duration=0) +//| def resume(self, trigger_duration: int = 0) -> Any: +//| """Resumes pulse capture after an optional trigger pulse. //| -//| Resumes pulse capture after an optional trigger pulse. +//| .. warning:: Using trigger pulse with a device that drives both high and +//| low signals risks a short. Make sure your device is open drain (only +//| drives low) when using a trigger pulse. You most likely added a +//| "pull-up" resistor to your circuit to do this. //| -//| .. warning:: Using trigger pulse with a device that drives both high and -//| low signals risks a short. Make sure your device is open drain (only -//| drives low) when using a trigger pulse. You most likely added a -//| "pull-up" resistor to your circuit to do this. -//| -//| :param int trigger_duration: trigger pulse duration in microseconds +//| :param int trigger_duration: trigger pulse duration in microseconds""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_obj_resume(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_trigger_duration }; @@ -176,9 +177,9 @@ STATIC mp_obj_t pulseio_pulsein_obj_resume(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(pulseio_pulsein_resume_obj, 1, pulseio_pulsein_obj_resume); -//| .. method:: clear() -//| -//| Clears all captured pulses +//| def clear(self, ) -> Any: +//| """Clears all captured pulses""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_obj_clear(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -189,9 +190,9 @@ STATIC mp_obj_t pulseio_pulsein_obj_clear(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_clear_obj, pulseio_pulsein_obj_clear); -//| .. method:: popleft() -//| -//| Removes and returns the oldest read pulse. +//| def popleft(self, ) -> Any: +//| """Removes and returns the oldest read pulse.""" +//| ... //| STATIC mp_obj_t pulseio_pulsein_obj_popleft(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -201,10 +202,9 @@ STATIC mp_obj_t pulseio_pulsein_obj_popleft(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_popleft_obj, pulseio_pulsein_obj_popleft); -//| .. attribute:: maxlen -//| -//| The maximum length of the PulseIn. When len() is equal to maxlen, -//| it is unclear which pulses are active and which are idle. +//| maxlen: Any = ... +//| """The maximum length of the PulseIn. When len() is equal to maxlen, +//| it is unclear which pulses are active and which are idle.""" //| STATIC mp_obj_t pulseio_pulsein_obj_get_maxlen(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -221,10 +221,9 @@ const mp_obj_property_t pulseio_pulsein_maxlen_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: paused -//| -//| True when pulse capture is paused as a result of :py:func:`pause` or an error during capture -//| such as a signal that is too fast. +//| paused: Any = ... +//| """True when pulse capture is paused as a result of :py:func:`pause` or an error during capture +//| such as a signal that is too fast.""" //| STATIC mp_obj_t pulseio_pulsein_obj_get_paused(mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -241,14 +240,14 @@ const mp_obj_property_t pulseio_pulsein_paused_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: __len__() +//| def __len__(self, ) -> Any: +//| """Returns the current pulse length //| -//| Returns the current pulse length +//| This allows you to:: //| -//| This allows you to:: -//| -//| pulses = pulseio.PulseIn(pin) -//| print(len(pulses)) +//| pulses = pulseio.PulseIn(pin) +//| print(len(pulses))""" +//| ... //| STATIC mp_obj_t pulsein_unary_op(mp_unary_op_t op, mp_obj_t self_in) { pulseio_pulsein_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -261,14 +260,14 @@ STATIC mp_obj_t pulsein_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| .. method:: __getitem__(index) +//| def __getitem__(self, index: Any) -> Any: +//| """Returns the value at the given index or values in slice. //| -//| Returns the value at the given index or values in slice. +//| This allows you to:: //| -//| This allows you to:: -//| -//| pulses = pulseio.PulseIn(pin) -//| print(pulses[0]) +//| pulses = pulseio.PulseIn(pin) +//| print(pulses[0])""" +//| ... //| STATIC mp_obj_t pulsein_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value) { if (value == mp_const_none) { diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 172459e5df..9c650731bb 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -36,37 +36,38 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: pulseio +//| class PulseOut: +//| """.. currentmodule:: pulseio //| -//| :class:`PulseOut` -- Output a pulse train -//| ======================================================== +//| :class:`PulseOut` -- Output a pulse train +//| ======================================================== //| -//| PulseOut is used to pulse PWM "carrier" output on and off. This is commonly -//| used in infrared remotes. The pulsed signal consists of timed on and off -//| periods. Unlike PWM, there is no set duration for on and off pairs. +//| PulseOut is used to pulse PWM "carrier" output on and off. This is commonly +//| used in infrared remotes. The pulsed signal consists of timed on and off +//| periods. Unlike PWM, there is no set duration for on and off pairs.""" //| -//| .. class:: PulseOut(carrier) +//| def __init__(self, carrier: pulseio.PWMOut): +//| """Create a PulseOut object associated with the given PWMout object. //| -//| Create a PulseOut object associated with the given PWMout object. +//| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. //| -//| :param ~pulseio.PWMOut carrier: PWMOut that is set to output on the desired pin. +//| Send a short series of pulses:: //| -//| Send a short series of pulses:: +//| import array +//| import pulseio +//| import board //| -//| import array -//| import pulseio -//| import board +//| # 50% duty cycle at 38kHz. +//| pwm = pulseio.PWMOut(board.D13, frequency=38000, duty_cycle=32768) +//| pulse = pulseio.PulseOut(pwm) +//| # on off on off on +//| pulses = array.array('H', [65000, 1000, 65000, 65000, 1000]) +//| pulse.send(pulses) //| -//| # 50% duty cycle at 38kHz. -//| pwm = pulseio.PWMOut(board.D13, frequency=38000, duty_cycle=32768) -//| pulse = pulseio.PulseOut(pwm) -//| # on off on off on -//| pulses = array.array('H', [65000, 1000, 65000, 65000, 1000]) -//| pulse.send(pulses) -//| -//| # Modify the array of pulses. -//| pulses[0] = 200 -//| pulse.send(pulses) +//| # Modify the array of pulses. +//| pulses[0] = 200 +//| pulse.send(pulses)""" +//| ... //| STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 1, 1, false); @@ -85,9 +86,9 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitialises the PulseOut and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the PulseOut and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t pulseio_pulseout_deinit(mp_obj_t self_in) { pulseio_pulseout_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -96,16 +97,16 @@ STATIC mp_obj_t pulseio_pulseout_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulseout_deinit_obj, pulseio_pulseout_deinit); -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t pulseio_pulseout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -114,16 +115,16 @@ STATIC mp_obj_t pulseio_pulseout_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulseout___exit___obj, 4, 4, pulseio_pulseout_obj___exit__); -//| .. method:: send(pulses) +//| def send(self, pulses: array.array) -> Any: +//| """Pulse alternating on and off durations in microseconds starting with on. +//| ``pulses`` must be an `array.array` with data type 'H' for unsigned +//| halfword (two bytes). //| -//| Pulse alternating on and off durations in microseconds starting with on. -//| ``pulses`` must be an `array.array` with data type 'H' for unsigned -//| halfword (two bytes). +//| This method waits until the whole array of pulses has been sent and +//| ensures the signal is off afterwards. //| -//| This method waits until the whole array of pulses has been sent and -//| ensures the signal is off afterwards. -//| -//| :param array.array pulses: pulse durations in microseconds +//| :param array.array pulses: pulse durations in microseconds""" +//| ... //| STATIC mp_obj_t pulseio_pulseout_obj_send(mp_obj_t self_in, mp_obj_t pulses) { pulseio_pulseout_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index a3cec3dca5..70cb61fc30 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -35,7 +35,7 @@ #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pulseio/PWMOut.h" -//| :mod:`pulseio` --- Support for pulse based protocols +//| """:mod:`pulseio` --- Support for pulse based protocols //| ===================================================== //| //| .. module:: pulseio @@ -73,7 +73,7 @@ //| :py:data:`~pulseio.PWMOut.duty_cycle`, and then sleep 0.1 seconds. //| CircuitPython will automatically turn off the PWM when it resets all //| hardware after program completion. Use ``deinit()`` or a ``with`` statement -//| to do it yourself. +//| to do it yourself.""" //| STATIC const mp_rom_map_elem_t pulseio_module_globals_table[] = { diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index de4c90910d..d8b266be00 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/random/__init__.h" #include "supervisor/shared/translate.h" -//| :mod:`random` --- pseudo-random numbers and choices +//| """:mod:`random` --- pseudo-random numbers and choices //| ======================================================== //| //| .. module:: random @@ -49,13 +49,13 @@ //| Once seeded, it will be deterministic, which is why its bad for cryptography. //| //| .. warning:: Numbers from this module are not cryptographically strong! Use -//| bytes from `os.urandom` directly for true randomness. +//| bytes from `os.urandom` directly for true randomness.""" //| -//| .. function:: seed(seed) -//| -//| Sets the starting seed of the random number generation. Further calls to -//| `random` will return deterministic results afterwards. +//| def seed(seed: Any) -> Any: +//| """Sets the starting seed of the random number generation. Further calls to +//| `random` will return deterministic results afterwards.""" +//| ... //| STATIC mp_obj_t random_seed(mp_obj_t seed_in) { mp_uint_t seed = mp_obj_get_int_truncated(seed_in); @@ -64,9 +64,9 @@ STATIC mp_obj_t random_seed(mp_obj_t seed_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_seed_obj, random_seed); -//| .. function:: getrandbits(k) -//| -//| Returns an integer with *k* random bits. +//| def getrandbits(k: Any) -> Any: +//| """Returns an integer with *k* random bits.""" +//| ... //| STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) { int n = mp_obj_get_int(num_in); @@ -77,10 +77,9 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits); -//| .. function:: randrange(stop) -//| randrange(start, stop, step=1) -//| -//| Returns a randomly selected integer from ``range(start, stop, step)``. +//| def randrange(stop: Any) -> Any: +//| """Returns a randomly selected integer from ``range(start, stop, step)``.""" +//| ... //| STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { mp_int_t start = 0; @@ -120,10 +119,10 @@ STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(random_randrange_obj, 1, 3, random_randrange); -//| .. function:: randint(a, b) -//| -//| Returns a randomly selected integer between a and b inclusive. Equivalent -//| to ``randrange(a, b + 1, 1)`` +//| def randint(a: Any, b: Any) -> Any: +//| """Returns a randomly selected integer between a and b inclusive. Equivalent +//| to ``randrange(a, b + 1, 1)``""" +//| ... //| STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) { mp_int_t a = mp_obj_get_int(a_in); @@ -135,10 +134,10 @@ STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(random_randint_obj, random_randint); -//| .. function:: choice(seq) -//| -//| Returns a randomly selected element from the given sequence. Raises -//| IndexError when the sequence is empty. +//| def choice(seq: Any) -> Any: +//| """Returns a randomly selected element from the given sequence. Raises +//| IndexError when the sequence is empty.""" +//| ... //| STATIC mp_obj_t random_choice(mp_obj_t seq) { mp_int_t len = mp_obj_get_int(mp_obj_len(seq)); @@ -149,19 +148,19 @@ STATIC mp_obj_t random_choice(mp_obj_t seq) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_choice_obj, random_choice); -//| .. function:: random() -//| -//| Returns a random float between 0 and 1.0. +//| def random() -> Any: +//| """Returns a random float between 0 and 1.0.""" +//| ... //| STATIC mp_obj_t random_random(void) { return mp_obj_new_float(shared_modules_random_random()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(random_random_obj, random_random); -//| .. function:: uniform(a, b) -//| -//| Returns a random float between a and b. It may or may not be inclusive -//| depending on float rounding. +//| def uniform(a: Any, b: Any) -> Any: +//| """Returns a random float between a and b. It may or may not be inclusive +//| depending on float rounding.""" +//| ... //| STATIC mp_obj_t random_uniform(mp_obj_t a_in, mp_obj_t b_in) { mp_float_t a = mp_obj_get_float(a_in); From 2ddfab315ca8709a5a18aa8411abdc899b71b44f Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 11 May 2020 11:31:18 -0500 Subject: [PATCH 444/919] Added call to rtc_reset() in rtc_init() Fix for issue #2872. The rtc_time_source had not been initialized; causing a time.time() call to fail. --- ports/atmel-samd/supervisor/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index b3903bb862..f232572e47 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -174,6 +174,7 @@ static void rtc_init(void) { #endif NVIC_ClearPendingIRQ(RTC_IRQn); NVIC_EnableIRQ(RTC_IRQn); + rtc_reset(); } safe_mode_t port_init(void) { From c7a9d49cba38499ec6701fdfef0c14e1dd5503a8 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 11 May 2020 13:00:19 -0400 Subject: [PATCH 445/919] Did rgbmatrix, rotaryio, and RTC --- shared-bindings/rgbmatrix/RGBMatrix.c | 103 +++++++++--------- shared-bindings/rgbmatrix/__init__.c | 5 +- shared-bindings/rotaryio/IncrementalEncoder.c | 72 ++++++------ shared-bindings/rotaryio/__init__.c | 4 +- shared-bindings/rtc/RTC.c | 49 +++++---- shared-bindings/rtc/__init__.c | 30 ++--- 6 files changed, 132 insertions(+), 131 deletions(-) diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index d758774d9f..e2393eb61d 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -38,10 +38,11 @@ #include "shared-module/framebufferio/__init__.h" #include "shared-module/framebufferio/FramebufferDisplay.h" -//| .. currentmodule:: rgbmatrix +//| class RGBMatrix: +//| """.. currentmodule:: rgbmatrix //| -//| :class:`RGBMatrix` -- Driver for HUB75-style RGB LED matrices -//| ================================================================ +//| :class:`RGBMatrix` -- Driver for HUB75-style RGB LED matrices +//| ================================================================ //| extern Protomatter_core *_PM_protoPtr; @@ -133,45 +134,45 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } -//| :class:`~rgbmatrix.RGBMatrix` displays an in-memory framebuffer to an LED matrix. + +//| :class:`~rgbmatrix.RGBMatrix` displays an in-memory framebuffer to an LED matrix.""" //| -//| .. class:: RGBMatrix(*, width, bit_depth, rgb_pins, addr_pins, clock_pin, latch_pin, output_enable_pin, doublebuffer=True, framebuffer=None, height=0) +//| def __init__(self, *, width: Any, bit_depth: Any, rgb_pins: Any, addr_pins: Any, clock_pin: Any, latch_pin: Any, output_enable_pin: Any, doublebuffer: Any = True, framebuffer: Any = None, height: Any = 0): +//| """Create a RGBMatrix object with the given attributes. The height of +//| the display is determined by the number of rgb and address pins: +//| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 +//| address lines, the display will be 32 pixels tall. If the optional height +//| parameter is specified and is not 0, it is checked against the calculated +//| height. //| -//| Create a RGBMatrix object with the given attributes. The height of -//| the display is determined by the number of rgb and address pins: -//| len(rgb_pins) // 3 * 2 ** len(address_pins). With 6 RGB pins and 4 -//| address lines, the display will be 32 pixels tall. If the optional height -//| parameter is specified and is not 0, it is checked against the calculated -//| height. +//| Up to 30 RGB pins and 8 address pins are supported. //| -//| Up to 30 RGB pins and 8 address pins are supported. +//| The RGB pins must be within a single "port" and performance and memory +//| usage are best when they are all within "close by" bits of the port. +//| The clock pin must also be on the same port as the RGB pins. See the +//| documentation of the underlying protomatter C library for more +//| information. Generally, Adafruit's interface boards are designed so +//| that these requirements are met when matched with the intended +//| microcontroller board. For instance, the Feather M4 Express works +//| together with the RGB Matrix Feather. //| -//| The RGB pins must be within a single "port" and performance and memory -//| usage are best when they are all within "close by" bits of the port. -//| The clock pin must also be on the same port as the RGB pins. See the -//| documentation of the underlying protomatter C library for more -//| information. Generally, Adafruit's interface boards are designed so -//| that these requirements are met when matched with the intended -//| microcontroller board. For instance, the Feather M4 Express works -//| together with the RGB Matrix Feather. +//| The framebuffer is in "RGB565" format. //| -//| The framebuffer is in "RGB565" format. +//| "RGB565" means that it is organized as a series of 16-bit numbers +//| where the highest 5 bits are interpreted as red, the next 6 as +//| green, and the final 5 as blue. The object can be any buffer, but +//| `array.array` and `ulab.array` objects are most often useful. +//| To update the content, modify the framebuffer and call refresh. //| -//| "RGB565" means that it is organized as a series of 16-bit numbers -//| where the highest 5 bits are interpreted as red, the next 6 as -//| green, and the final 5 as blue. The object can be any buffer, but -//| `array.array` and `ulab.array` objects are most often useful. -//| To update the content, modify the framebuffer and call refresh. +//| If a framebuffer is not passed in, one is allocated and initialized +//| to all black. In any case, the framebuffer can be retrieved +//| by passing the RGBMatrix object to memoryview(). //| -//| If a framebuffer is not passed in, one is allocated and initialized -//| to all black. In any case, the framebuffer can be retrieved -//| by passing the RGBMatrix object to memoryview(). +//| If doublebuffer is False, some memory is saved, but the display may +//| flicker during updates. //| -//| If doublebuffer is False, some memory is saved, but the display may -//| flicker during updates. -//| -//| A RGBMatrix is often used in conjunction with a -//| `framebufferio.FramebufferDisplay`. +//| A RGBMatrix is often used in conjunction with a +//| `framebufferio.FramebufferDisplay`.""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -245,11 +246,11 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit -//| -//| Free the resources (pins, timers, etc.) associated with this -//| rgbmatrix instance. After deinitialization, no further operations -//| may be performed. +//| def deinit(self, ) -> Any: +//| """Free the resources (pins, timers, etc.) associated with this +//| rgbmatrix instance. After deinitialization, no further operations +//| may be performed.""" +//| ... //| STATIC mp_obj_t rgbmatrix_rgbmatrix_deinit(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; @@ -265,10 +266,9 @@ static void check_for_deinit(rgbmatrix_rgbmatrix_obj_t *self) { } } -//| .. attribute:: brightness -//| -//| In the current implementation, 0.0 turns the display off entirely -//| and any other value up to 1.0 turns the display on fully. +//| brightness: Any = ... +//| """In the current implementation, 0.0 turns the display off entirely +//| and any other value up to 1.0 turns the display on fully.""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_brightness(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; @@ -297,10 +297,9 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: refresh() -//| -//| Transmits the color data in the buffer to the pixels so that -//| they are shown. +//| def refresh(self, ) -> Any: ... +//| """Transmits the color data in the buffer to the pixels so that +//| they are shown.""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; @@ -310,9 +309,8 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_refresh_obj, rgbmatrix_rgbmatrix_refresh); -//| .. attribute:: width -//| -//| The width of the display, in pixels +//| width: Any = ... +//| """The width of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_width(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; @@ -327,9 +325,8 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: height -//| -//| The height of the display, in pixels +//| height: Any = ... +//| """The height of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_height(mp_obj_t self_in) { rgbmatrix_rgbmatrix_obj_t *self = (rgbmatrix_rgbmatrix_obj_t*)self_in; diff --git a/shared-bindings/rgbmatrix/__init__.c b/shared-bindings/rgbmatrix/__init__.c index 662d2c4f6c..f61002a780 100644 --- a/shared-bindings/rgbmatrix/__init__.c +++ b/shared-bindings/rgbmatrix/__init__.c @@ -31,7 +31,7 @@ #include "shared-bindings/rgbmatrix/RGBMatrix.h" -//| :mod:`rgbmatrix` --- Low-level routines for bitbanged LED matrices +//| """:mod:`rgbmatrix` --- Low-level routines for bitbanged LED matrices //| ===================================================================== //| //| .. module:: rgbmatrix @@ -40,7 +40,8 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| RGBMatrix +//| RGBMatrix""" +//| STATIC const mp_rom_map_elem_t rgbmatrix_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_rgbmatrix) }, diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index 058241d24a..a10fb6fd5f 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -34,35 +34,36 @@ #include "shared-bindings/rotaryio/IncrementalEncoder.h" #include "shared-bindings/util.h" -//| .. currentmodule:: rotaryio +//| class IncrementalEncoder: +//| """.. currentmodule:: rotaryio //| -//| :class:`IncrementalEncoder` -- Track the relative position of an incremental encoder -//| ==================================================================================== +//| :class:`IncrementalEncoder` -- Track the relative position of an incremental encoder +//| ==================================================================================== //| -//| IncrementalEncoder determines the relative rotational position based on two series of pulses. +//| IncrementalEncoder determines the relative rotational position based on two series of pulses.""" //| -//| .. class:: IncrementalEncoder(pin_a, pin_b) +//| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin): +//| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional +//| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is +//| relative to the position when the object is contructed. //| -//| Create an IncrementalEncoder object associated with the given pins. It tracks the positional -//| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is -//| relative to the position when the object is contructed. +//| :param ~microcontroller.Pin pin_a: First pin to read pulses from. +//| :param ~microcontroller.Pin pin_b: Second pin to read pulses from. //| -//| :param ~microcontroller.Pin pin_a: First pin to read pulses from. -//| :param ~microcontroller.Pin pin_b: Second pin to read pulses from. +//| For example:: //| -//| For example:: +//| import rotaryio +//| import time +//| from board import * //| -//| import rotaryio -//| import time -//| from board import * -//| -//| enc = rotaryio.IncrementalEncoder(D1, D2) -//| last_position = None -//| while True: -//| position = enc.position -//| if last_position == None or position != last_position: -//| print(position) -//| last_position = position +//| enc = rotaryio.IncrementalEncoder(D1, D2) +//| last_position = None +//| while True: +//| position = enc.position +//| if last_position == None or position != last_position: +//| print(position) +//| last_position = position""" +//| ... //| STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin_a, ARG_pin_b }; @@ -84,9 +85,9 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitializes the IncrementalEncoder and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitializes the IncrementalEncoder and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t rotaryio_incrementalencoder_deinit(mp_obj_t self_in) { rotaryio_incrementalencoder_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -101,16 +102,16 @@ STATIC void check_for_deinit(rotaryio_incrementalencoder_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -120,10 +121,9 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj___exit__(size_t n_args, const mp STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(rotaryio_incrementalencoder___exit___obj, 4, 4, rotaryio_incrementalencoder_obj___exit__); -//| .. attribute:: position -//| -//| The current position in terms of pulses. The number of pulses per rotation is defined by the -//| specific hardware. +//| position: Any = ... +//| """The current position in terms of pulses. The number of pulses per rotation is defined by the +//| specific hardware.""" //| STATIC mp_obj_t rotaryio_incrementalencoder_obj_get_position(mp_obj_t self_in) { rotaryio_incrementalencoder_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/rotaryio/__init__.c b/shared-bindings/rotaryio/__init__.c index a0166771ab..0cc8eb5560 100644 --- a/shared-bindings/rotaryio/__init__.c +++ b/shared-bindings/rotaryio/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/rotaryio/__init__.h" #include "shared-bindings/rotaryio/IncrementalEncoder.h" -//| :mod:`rotaryio` --- Support for reading rotation sensors +//| """:mod:`rotaryio` --- Support for reading rotation sensors //| ======================================================== //| //| .. module:: rotaryio @@ -59,7 +59,7 @@ //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| :ref:`lifetime-and-contextmanagers` for more info.""" //| STATIC const mp_rom_map_elem_t rotaryio_module_globals_table[] = { diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 3ff09a4ec5..8a3e89d732 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -38,14 +38,19 @@ const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; -//| .. currentmodule:: rtc + + + + +//| class RTC: +//| """.. currentmodule:: rtc //| -//| :class:`RTC` --- Real Time Clock -//| -------------------------------- +//| :class:`RTC` --- Real Time Clock +//| --------------------------------""" //| -//| .. class:: RTC() -//| -//| This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance. +//| def __init__(self, ): +//| """This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance.""" +//| ... //| STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { // No arguments @@ -55,25 +60,24 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const return (mp_obj_t)&rtc_rtc_obj; } -//| .. attribute:: datetime +//| datetime: Any = ... +//| """The current date and time of the RTC as a `time.struct_time`. //| -//| The current date and time of the RTC as a `time.struct_time`. +//| This must be set to the current date and time whenever the board loses power:: //| -//| This must be set to the current date and time whenever the board loses power:: +//| import rtc +//| import time //| -//| import rtc -//| import time -//| -//| r = rtc.RTC() -//| r.datetime = rtctime.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) +//| r = rtc.RTC() +//| r.datetime = rtctime.struct_time((2019, 5, 29, 15, 14, 15, 0, -1, -1)) //| //| -//| Once set, the RTC will automatically update this value as time passes. You can read this -//| property to get a snapshot of the current time:: +//| Once set, the RTC will automatically update this value as time passes. You can read this +//| property to get a snapshot of the current time:: //| -//| current_time = r.datetime -//| print(current_time) -//| # struct_time(tm_year=2019, tm_month=5, ...) +//| current_time = r.datetime +//| print(current_time) +//| # struct_time(tm_year=2019, tm_month=5, ...)""" //| STATIC mp_obj_t rtc_rtc_obj_get_datetime(mp_obj_t self_in) { timeutils_struct_time_t tm; @@ -97,12 +101,11 @@ const mp_obj_property_t rtc_rtc_datetime_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: calibration -//| -//| The RTC calibration value as an `int`. +//| calibration: Any = ... +//| """The RTC calibration value as an `int`. //| //| A positive value speeds up the clock and a negative value slows it down. -//| Range and value is hardware specific, but one step is often approximately 1 ppm. +//| Range and value is hardware specific, but one step is often approximately 1 ppm.""" //| STATIC mp_obj_t rtc_rtc_obj_get_calibration(mp_obj_t self_in) { int calibration = common_hal_rtc_get_calibration(); diff --git a/shared-bindings/rtc/__init__.c b/shared-bindings/rtc/__init__.c index 22eda9b663..66669ca5fe 100644 --- a/shared-bindings/rtc/__init__.c +++ b/shared-bindings/rtc/__init__.c @@ -31,7 +31,7 @@ #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" -//| :mod:`rtc` --- Real Time Clock +//| """:mod:`rtc` --- Real Time Clock //| ======================================================== //| //| .. module:: rtc @@ -47,7 +47,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| RTC +//| RTC""" //| void rtc_reset(void) { @@ -62,22 +62,22 @@ mp_obj_t rtc_get_time_source_time(void) { return struct_time_from_tm(&tm); } -//| .. function:: set_time_source(rtc) +//| def set_time_source(rtc: Any) -> Any: +//| """Sets the RTC time source used by :func:`time.localtime`. +//| The default is :class:`rtc.RTC`, but it's useful to use this to override the +//| time source for testing purposes. For example:: //| -//| Sets the RTC time source used by :func:`time.localtime`. -//| The default is :class:`rtc.RTC`, but it's useful to use this to override the -//| time source for testing purposes. For example:: +//| import rtc +//| import time //| -//| import rtc -//| import time +//| class RTC(object): +//| @property +//| def datetime(self): +//| return time.struct_time((2018, 3, 17, 21, 1, 47, 0, 0, 0)) //| -//| class RTC(object): -//| @property -//| def datetime(self): -//| return time.struct_time((2018, 3, 17, 21, 1, 47, 0, 0, 0)) -//| -//| r = RTC() -//| rtc.set_time_source(r) +//| r = RTC() +//| rtc.set_time_source(r)""" +//| ... //| STATIC mp_obj_t rtc_set_time_source(mp_obj_t time_source) { MP_STATE_VM(rtc_time_source) = time_source; From 407938bf3a7d194a3ac4e0888037ca7025185c2f Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 11 May 2020 12:03:44 -0500 Subject: [PATCH 446/919] Added a check for platforms supporting RTC before calling rtc_reset() Added an #if CIRCUITPY_RTC check for platforms supporting RTC --- ports/atmel-samd/supervisor/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index f232572e47..04e2c9191a 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -174,7 +174,10 @@ static void rtc_init(void) { #endif NVIC_ClearPendingIRQ(RTC_IRQn); NVIC_EnableIRQ(RTC_IRQn); +#if CIRCUITPY_RTC rtc_reset(); +#endif + } safe_mode_t port_init(void) { From 603df58f971743bc36b9e391cd5fb04812262533 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 11 May 2020 13:40:02 -0400 Subject: [PATCH 447/919] Did stage, socket, storage --- shared-bindings/_stage/Layer.c | 45 +++++---- shared-bindings/_stage/Text.c | 37 +++---- shared-bindings/_stage/__init__.c | 12 +-- shared-bindings/socket/__init__.c | 156 +++++++++++++++-------------- shared-bindings/storage/__init__.c | 138 ++++++++++++------------- 5 files changed, 196 insertions(+), 192 deletions(-) diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 12028b1319..437114cd31 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -30,25 +30,26 @@ #include "Layer.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: _stage +//| class Layer: +//| """.. currentmodule:: _stage //| -//| :class:`Layer` -- Keep information about a single layer of graphics -//| =================================================================== +//| :class:`Layer` -- Keep information about a single layer of graphics +//| ===================================================================""" //| -//| .. class:: Layer(width, height, graphic, palette, [grid]) +//| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray): +//| """Keep internal information about a layer of graphics (either a +//| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering +//| with the ``render()`` function. //| -//| Keep internal information about a layer of graphics (either a -//| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering -//| with the ``render()`` function. +//| :param int width: The width of the grid in tiles, or 1 for sprites. +//| :param int height: The height of the grid in tiles, or 1 for sprites. +//| :param bytearray graphic: The graphic data of the tiles. +//| :param bytearray palette: The color palette to be used. +//| :param bytearray grid: The contents of the grid map. //| -//| :param int width: The width of the grid in tiles, or 1 for sprites. -//| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param bytearray graphic: The graphic data of the tiles. -//| :param bytearray palette: The color palette to be used. -//| :param bytearray grid: The contents of the grid map. -//| -//| This class is intended for internal use in the ``stage`` library and -//| it shouldn't be used on its own. +//| This class is intended for internal use in the ``stage`` library and +//| it shouldn't be used on its own.""" +//| ... //| STATIC mp_obj_t layer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -90,9 +91,9 @@ STATIC mp_obj_t layer_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| .. method:: move(x, y) -//| -//| Set the offset of the layer to the specified values. +//| def move(self, x: Any, y: Any) -> Any: +//| """Set the offset of the layer to the specified values.""" +//| ... //| STATIC mp_obj_t layer_move(mp_obj_t self_in, mp_obj_t x_in, mp_obj_t y_in) { layer_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -102,10 +103,10 @@ STATIC mp_obj_t layer_move(mp_obj_t self_in, mp_obj_t x_in, mp_obj_t y_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_3(layer_move_obj, layer_move); -//| .. method:: frame(frame, rotation) -//| -//| Set the animation frame of the sprite, and optionally rotation its -//| graphic. +//| def frame(self, frame: Any, rotation: Any) -> Any: +//| """Set the animation frame of the sprite, and optionally rotation its +//| graphic.""" +//| ... //| STATIC mp_obj_t layer_frame(mp_obj_t self_in, mp_obj_t frame_in, mp_obj_t rotation_in) { diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 49c1d00ca8..8797f74dbe 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -30,25 +30,26 @@ #include "Text.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: _stage +//| class Text: +//| """.. currentmodule:: _stage //| -//| :class:`Text` -- Keep information about a single text of text -//| ============================================================== +//| :class:`Text` -- Keep information about a single text of text +//| ==============================================================""" //| -//| .. class:: Text(width, height, font, palette, chars) +//| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray): +//| """Keep internal information about a text of text +//| in a format suitable for fast rendering +//| with the ``render()`` function. //| -//| Keep internal information about a text of text -//| in a format suitable for fast rendering -//| with the ``render()`` function. +//| :param int width: The width of the grid in tiles, or 1 for sprites. +//| :param int height: The height of the grid in tiles, or 1 for sprites. +//| :param bytearray font: The font data of the characters. +//| :param bytearray palette: The color palette to be used. +//| :param bytearray chars: The contents of the character grid. //| -//| :param int width: The width of the grid in tiles, or 1 for sprites. -//| :param int height: The height of the grid in tiles, or 1 for sprites. -//| :param bytearray font: The font data of the characters. -//| :param bytearray palette: The color palette to be used. -//| :param bytearray chars: The contents of the character grid. -//| -//| This class is intended for internal use in the ``stage`` library and -//| it shouldn't be used on its own. +//| This class is intended for internal use in the ``stage`` library and +//| it shouldn't be used on its own.""" +//| ... //| STATIC mp_obj_t text_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -84,9 +85,9 @@ STATIC mp_obj_t text_make_new(const mp_obj_type_t *type, size_t n_args, return MP_OBJ_FROM_PTR(self); } -//| .. method:: move(x, y) -//| -//| Set the offset of the text to the specified values. +//| def move(self, x: Any, y: Any) -> Any: +//| """Set the offset of the text to the specified values.""" +//| ... //| STATIC mp_obj_t text_move(mp_obj_t self_in, mp_obj_t x_in, mp_obj_t y_in) { text_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 4bac280bf2..6b5c4fd8b1 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -34,7 +34,7 @@ #include "Layer.h" #include "Text.h" -//| :mod:`_stage` --- C-level helpers for animation of sprites on a stage +//| """:mod:`_stage` --- C-level helpers for animation of sprites on a stage //| ===================================================================== //| //| .. module:: _stage @@ -49,11 +49,10 @@ //| :maxdepth: 3 //| //| Layer -//| Text +//| Text""" //| -//| .. function:: render(x0, y0, x1, y1, layers, buffer, display[, scale[, background]]) -//| -//| Render and send to the display a fragment of the screen. +//| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: bytearray, display: displayio.Display, scale: int, background: int) -> Any: +//| """Render and send to the display a fragment of the screen. //| //| :param int x0: Left edge of the fragment. //| :param int y0: Top edge of the fragment. @@ -70,7 +69,8 @@ //| valid. //| //| This function is intended for internal use in the ``stage`` library -//| and all the necessary checks are performed there. +//| and all the necessary checks are performed there.""" +//| STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) { uint16_t x0 = mp_obj_get_int(args[0]); uint16_t y0 = mp_obj_get_int(args[1]); diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 2d6c16e90f..4c0811bdb6 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -37,27 +37,28 @@ #include "shared-module/network/__init__.h" -//| :mod:`socket` --- TCP, UDP and RAW socket support +//| """:mod:`socket` --- TCP, UDP and RAW socket support //| ================================================= //| //| .. module:: socket //| :synopsis: TCP, UDP and RAW sockets //| :platform: SAMD21, SAMD51 //| -//| Create TCP, UDP and RAW sockets for communicating over the Internet. +//| Create TCP, UDP and RAW sockets for communicating over the Internet.""" //| STATIC const mp_obj_type_t socket_type; -//| .. currentmodule:: socket +//| class socket: +//| """.. currentmodule:: socket""" //| -//| .. class:: socket(family, type, proto) +//| def __init__(self, family: int, type: int, proto: int): +//| """Create a new socket //| -//| Create a new socket -//| -//| :param ~int family: AF_INET or AF_INET6 -//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW -//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored) +//| :param ~int family: AF_INET or AF_INET6 +//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW +//| :param ~int proto: IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW (ignored)""" +//| ... //| STATIC mp_obj_t socket_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -98,11 +99,11 @@ STATIC void socket_select_nic(mod_network_socket_obj_t *self, const byte *ip) { } } -//| .. method:: bind(address) +//| def bind(self, address: tuple) -> Any: +//| """Bind a socket to an address //| -//| Bind a socket to an address -//| -//| :param ~tuple address: tuple of (remote_address, remote_port) +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... //| STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { @@ -125,11 +126,11 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_bind_obj, socket_bind); -//| .. method:: listen(backlog) +//| def listen(self, backlog: int) -> Any: +//| """Set socket to listen for incoming connections //| -//| Set socket to listen for incoming connections -//| -//| :param ~int backlog: length of backlog queue for waiting connetions +//| :param ~int backlog: length of backlog queue for waiting connetions""" +//| ... //| STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { @@ -150,11 +151,10 @@ STATIC mp_obj_t socket_listen(mp_obj_t self_in, mp_obj_t backlog) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen); -//| .. method:: accept() -//| -//| Accept a connection on a listening socket of type SOCK_STREAM, -//| creating a new socket of type SOCK_STREAM. -//| Returns a tuple of (new_socket, remote_address) +//| def accept(self, ) -> Any: +//| """Accept a connection on a listening socket of type SOCK_STREAM, +//| creating a new socket of type SOCK_STREAM. +//| Returns a tuple of (new_socket, remote_address)""" //| STATIC mp_obj_t socket_accept(mp_obj_t self_in) { @@ -188,11 +188,11 @@ STATIC mp_obj_t socket_accept(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(socket_accept_obj, socket_accept); -//| .. method:: connect(address) +//| def connect(self, address: tuple) -> Any: +//| """Connect a socket to a remote address //| -//| Connect a socket to a remote address -//| -//| :param ~tuple address: tuple of (remote_address, remote_port) +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... //| STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { @@ -215,12 +215,12 @@ STATIC mp_obj_t socket_connect(mp_obj_t self_in, mp_obj_t addr_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_connect_obj, socket_connect); -//| .. method:: send(bytes) +//| def send(self, bytes: bytes) -> Any: +//| """Send some bytes to the connected remote address. +//| Suits sockets of type SOCK_STREAM //| -//| Send some bytes to the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| -//| :param ~bytes bytes: some bytes to send +//| :param ~bytes bytes: some bytes to send""" +//| ... //| STATIC mp_obj_t socket_send(mp_obj_t self_in, mp_obj_t buf_in) { @@ -252,19 +252,20 @@ STATIC mp_int_t _socket_recv_into(mod_network_socket_obj_t *sock, byte *buf, mp_ } -//| .. method:: recv_into(buffer[, bufsize]) +//| def recv_into(self, buffer: bytearray, bufsize: int) -> Any: +//| """Reads some bytes from the connected remote address, writing +//| into the provided buffer. If bufsize <= len(buffer) is given, +//| a maximum of bufsize bytes will be read into the buffer. If no +//| valid value is given for bufsize, the default is the length of +//| the given buffer. //| -//| Reads some bytes from the connected remote address, writing -//| into the provided buffer. If bufsize <= len(buffer) is given, -//| a maximum of bufsize bytes will be read into the buffer. If no -//| valid value is given for bufsize, the default is the length of -//| the given buffer. +//| Suits sockets of type SOCK_STREAM +//| Returns an int of number of bytes read. //| -//| Suits sockets of type SOCK_STREAM -//| Returns an int of number of bytes read. +//| :param bytearray buffer: buffer to receive into +//| :param int bufsize: optionally, a maximum number of bytes to read.""" +//| ... //| -//| :param bytearray buffer: buffer to receive into -//| :param int bufsize: optionally, a maximum number of bytes to read. STATIC mp_obj_t socket_recv_into(size_t n_args, const mp_obj_t *args) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); @@ -287,13 +288,14 @@ STATIC mp_obj_t socket_recv_into(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_recv_into_obj, 2, 3, socket_recv_into); -//| .. method:: recv(bufsize) +//| def recv(self, bufsize: int) -> Any: +//| """Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM +//| Returns a bytes() of length <= bufsize //| -//| Reads some bytes from the connected remote address. -//| Suits sockets of type SOCK_STREAM -//| Returns a bytes() of length <= bufsize +//| :param ~int bufsize: maximum number of bytes to receive""" +//| ... //| -//| :param ~int bufsize: maximum number of bytes to receive STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -313,13 +315,13 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recv_obj, socket_recv); -//| .. method:: sendto(bytes, address) +//| def sendto(self, bytes: bytes, address: tuple) -> Any: +//| """Send some bytes to a specific address. +//| Suits sockets of type SOCK_DGRAM //| -//| Send some bytes to a specific address. -//| Suits sockets of type SOCK_DGRAM -//| -//| :param ~bytes bytes: some bytes to send -//| :param ~tuple address: tuple of (remote_address, remote_port) +//| :param ~bytes bytes: some bytes to send +//| :param ~tuple address: tuple of (remote_address, remote_port)""" +//| ... //| STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) { @@ -347,16 +349,16 @@ STATIC mp_obj_t socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_ } STATIC MP_DEFINE_CONST_FUN_OBJ_3(socket_sendto_obj, socket_sendto); -//| .. method:: recvfrom(bufsize) +//| def recvfrom(self, bufsize: int) -> Any: +//| """Reads some bytes from the connected remote address. +//| Suits sockets of type SOCK_STREAM //| -//| Reads some bytes from the connected remote address. -//| Suits sockets of type SOCK_STREAM +//| Returns a tuple containing +//| * a bytes() of length <= bufsize +//| * a remote_address, which is a tuple of ip address and port number //| -//| Returns a tuple containing -//| * a bytes() of length <= bufsize -//| * a remote_address, which is a tuple of ip address and port number -//| -//| :param ~int bufsize: maximum number of bytes to receive +//| :param ~int bufsize: maximum number of bytes to receive""" +//| ... //| STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { @@ -386,9 +388,9 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_recvfrom_obj, socket_recvfrom); -//| .. method:: setsockopt(level, optname, value) -//| -//| Sets socket options +//| def setsockopt(self, level: Any, optname: Any, value: Any) -> Any: +//| """Sets socket options""" +//| ... //| STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { @@ -420,11 +422,11 @@ STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_setsockopt_obj, 4, 4, socket_setsockopt); -//| .. method:: settimeout(value) +//| def settimeout(self, value: int) -> Any: +//| """Set the timeout value for this socket. //| -//| Set the timeout value for this socket. -//| -//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely. +//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely.""" +//| ... //| STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { @@ -451,11 +453,11 @@ STATIC mp_obj_t socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_settimeout_obj, socket_settimeout); -//| .. method:: setblocking(flag) +//| def setblocking(self, flag: bool) -> Any: +//| """Set the blocking behaviour of this socket. //| -//| Set the blocking behaviour of this socket. -//| -//| :param ~bool flag: False means non-blocking, True means block indefinitely. +//| :param ~bool flag: False means non-blocking, True means block indefinitely.""" +//| ... //| // method socket.setblocking(flag) @@ -513,13 +515,13 @@ STATIC const mp_obj_type_t socket_type = { .locals_dict = (mp_obj_dict_t*)&socket_locals_dict, }; -//| .. function:: getaddrinfo(host, port) +//| def getaddrinfo(host: Any, port: Any) -> Any: +//| """Gets the address information for a hostname and port //| -//| Gets the address information for a hostname and port -//| -//| Returns the appropriate family, socket type, socket protocol and -//| address information to call socket.socket() and socket.connect() with, -//| as a tuple. +//| Returns the appropriate family, socket type, socket protocol and +//| address information to call socket.socket() and socket.connect() with, +//| as a tuple.""" +//| ... //| STATIC mp_obj_t socket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) { diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index ba439b951c..feb1a9bd76 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -35,7 +35,7 @@ #include "shared-bindings/storage/__init__.h" #include "supervisor/shared/translate.h" -//| :mod:`storage` --- storage management +//| """:mod:`storage` --- storage management //| ======================================================== //| //| .. module:: storage @@ -45,16 +45,16 @@ //| The `storage` provides storage management functionality such as mounting and //| unmounting which is typically handled by the operating system hosting Python. //| CircuitPython does not have an OS, so this module provides this functionality -//| directly. +//| directly.""" //| -//| .. function:: mount(filesystem, mount_path, *, readonly=False) +//| def mount(filesystem: Any, mount_path: Any, *, readonly: bool = False) -> Any: +//| """Mounts the given filesystem object at the given path. //| -//| Mounts the given filesystem object at the given path. +//| This is the CircuitPython analog to the UNIX ``mount`` command. //| -//| This is the CircuitPython analog to the UNIX ``mount`` command. -//| -//| :param bool readonly: True when the filesystem should be readonly to CircuitPython. +//| :param bool readonly: True when the filesystem should be readonly to CircuitPython.""" +//| ... //| mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_readonly }; @@ -85,12 +85,12 @@ mp_obj_t storage_mount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_arg } MP_DEFINE_CONST_FUN_OBJ_KW(storage_mount_obj, 2, storage_mount); -//| .. function:: umount(mount) +//| def umount(mount: Any) -> Any: +//| """Unmounts the given filesystem object or if *mount* is a path, then unmount +//| the filesystem mounted at that location. //| -//| Unmounts the given filesystem object or if *mount* is a path, then unmount -//| the filesystem mounted at that location. -//| -//| This is the CircuitPython analog to the UNIX ``umount`` command. +//| This is the CircuitPython analog to the UNIX ``umount`` command.""" +//| ... //| mp_obj_t storage_umount(mp_obj_t mnt_in) { if (MP_OBJ_IS_STR(mnt_in)) { @@ -103,15 +103,15 @@ mp_obj_t storage_umount(mp_obj_t mnt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(storage_umount_obj, storage_umount); -//| .. function:: remount(mount_path, readonly=False, *, disable_concurrent_write_protection=False) +//| def remount(mount_path: Any, readonly: bool = False, *, disable_concurrent_write_protection: bool = False) -> Any: +//| """Remounts the given path with new parameters. //| -//| Remounts the given path with new parameters. -//| -//| :param bool readonly: True when the filesystem should be readonly to CircuitPython. -//| :param bool disable_concurrent_write_protection: When True, the check that makes sure the -//| underlying filesystem data is written by one computer is disabled. Disabling the protection -//| allows CircuitPython and a host to write to the same filesystem with the risk that the -//| filesystem will be corrupted. +//| :param bool readonly: True when the filesystem should be readonly to CircuitPython. +//| :param bool disable_concurrent_write_protection: When True, the check that makes sure the +//| underlying filesystem data is written by one computer is disabled. Disabling the protection +//| allows CircuitPython and a host to write to the same filesystem with the risk that the +//| filesystem will be corrupted.""" +//| ... //| mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_readonly, ARG_disable_concurrent_write_protection }; @@ -133,28 +133,29 @@ mp_obj_t storage_remount(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_a } MP_DEFINE_CONST_FUN_OBJ_KW(storage_remount_obj, 1, storage_remount); -//| .. function:: getmount(mount_path) -//| -//| Retrieves the mount object associated with the mount path +//| def getmount(mount_path: Any) -> Any: +//| """Retrieves the mount object associated with the mount path""" +//| ... //| mp_obj_t storage_getmount(const mp_obj_t mnt_in) { return common_hal_storage_getmount(mp_obj_str_get_str(mnt_in)); } MP_DEFINE_CONST_FUN_OBJ_1(storage_getmount_obj, storage_getmount); -//| .. function:: erase_filesystem() +//| def erase_filesystem() -> Any: +//| """Erase and re-create the ``CIRCUITPY`` filesystem. //| -//| Erase and re-create the ``CIRCUITPY`` filesystem. +//| On boards that present USB-visible ``CIRCUITPY`` drive (e.g., SAMD21 and SAMD51), +//| then call `microcontroller.reset()` to restart CircuitPython and have the +//| host computer remount CIRCUITPY. //| -//| On boards that present USB-visible ``CIRCUITPY`` drive (e.g., SAMD21 and SAMD51), -//| then call `microcontroller.reset()` to restart CircuitPython and have the -//| host computer remount CIRCUITPY. +//| This function can be called from the REPL when ``CIRCUITPY`` +//| has become corrupted. //| -//| This function can be called from the REPL when ``CIRCUITPY`` -//| has become corrupted. +//| .. warning:: All the data on ``CIRCUITPY`` will be lost, and +//| CircuitPython will restart on certain boards.""" +//| ... //| -//| .. warning:: All the data on ``CIRCUITPY`` will be lost, and -//| CircuitPython will restart on certain boards. mp_obj_t storage_erase_filesystem(void) { common_hal_storage_erase_filesystem(); @@ -171,54 +172,53 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) }, { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, - //| .. class:: VfsFat(block_device) + //| class VfsFat: + //| def __init__(self, block_device: Any): ... + //| """Create a new VfsFat filesystem around the given block device. //| - //| Create a new VfsFat filesystem around the given block device. + //| :param block_device: Block device the the filesystem lives on""" //| - //| :param block_device: Block device the the filesystem lives on + //| label: Any = ... + //| """The filesystem label, up to 11 case-insensitive bytes. Note that + //| this property can only be set when the device is writable by the + //| microcontroller.""" //| - //| .. attribute:: label + //| def mkfs(self, ) -> Any: + //| """Format the block device, deleting any data that may have been there""" + //| ... //| - //| The filesystem label, up to 11 case-insensitive bytes. Note that - //| this property can only be set when the device is writable by the - //| microcontroller. + //| def open(self, path: Any, mode: Any) -> Any: + //| """Like builtin ``open()``""" + //| ... //| - //| .. method:: mkfs() + //| def ilistdir(self, path: Any) -> Any: + //| """Return an iterator whose values describe files and folders within + //| ``path``""" + //| ... //| - //| Format the block device, deleting any data that may have been there + //| def mkdir(self, path: Any) -> Any: + //| """Like `os.mkdir`""" + //| ... //| - //| .. method:: open(path, mode) + //| def rmdir(self, path: Any) -> Any: + //| """Like `os.rmdir`""" + //| ... //| - //| Like builtin ``open()`` + //| def stat(self, path: Any) -> Any: + //| """Like `os.stat`""" + //| ... //| - //| .. method:: ilistdir([path]) + //| def statvfs(self, path: Any) -> Any: + //| """Like `os.statvfs`""" + //| ... //| - //| Return an iterator whose values describe files and folders within - //| ``path`` + //| def mount(self, readonly: Any, mkfs: Any) -> Any: + //| """Don't call this directly, call `storage.mount`.""" + //| ... //| - //| .. method:: mkdir(path) - //| - //| Like `os.mkdir` - //| - //| .. method:: rmdir(path) - //| - //| Like `os.rmdir` - //| - //| .. method:: stat(path) - //| - //| Like `os.stat` - //| - //| .. method:: statvfs(path) - //| - //| Like `os.statvfs` - //| - //| .. method:: mount(readonly, mkfs) - //| - //| Don't call this directly, call `storage.mount`. - //| - //| .. method:: umount() - //| - //| Don't call this directly, call `storage.umount`. + //| def umount(self, ) -> Any: + //| """Don't call this directly, call `storage.umount`.""" + //| ... //| { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, }; From 61450cbd5604a2e2c371bda4637f082151d3d8c8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 11 May 2020 13:58:58 -0700 Subject: [PATCH 448/919] Add Teensy 4.1 board definition --- .github/workflows/build.yml | 1 + ports/mimxrt10xx/boards/teensy41/board.c | 39 ++++++ ports/mimxrt10xx/boards/teensy41/board.ld | 1 + .../mimxrt10xx/boards/teensy41/flash_config.c | 126 ++++++++++++++++++ .../boards/teensy41/mpconfigboard.h | 18 +++ .../boards/teensy41/mpconfigboard.mk | 8 ++ ports/mimxrt10xx/boards/teensy41/pins.c | 116 ++++++++++++++++ 7 files changed, 309 insertions(+) create mode 100644 ports/mimxrt10xx/boards/teensy41/board.c create mode 100644 ports/mimxrt10xx/boards/teensy41/board.ld create mode 100644 ports/mimxrt10xx/boards/teensy41/flash_config.c create mode 100644 ports/mimxrt10xx/boards/teensy41/mpconfigboard.h create mode 100644 ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk create mode 100644 ports/mimxrt10xx/boards/teensy41/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2125a7c725..6cd6289b30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,6 +249,7 @@ jobs: - "stm32f746g_discovery" - "stringcar_m0_express" - "teensy40" + - "teensy41" - "teknikio_bluebird" - "thunderpack" - "trellis_m4_express" diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c new file mode 100644 index 0000000000..52dd498b3f --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/mimxrt10xx/boards/teensy41/board.ld b/ports/mimxrt10xx/boards/teensy41/board.ld new file mode 100644 index 0000000000..8f19810a35 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/board.ld @@ -0,0 +1 @@ +_ld_reserved_flash_size = 4K; diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c new file mode 100644 index 0000000000..426deb884d --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -0,0 +1,126 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "fsl_flexspi_nor_boot.h" +#include "fsl_flexspi_nor_config.h" + +/* Component ID definition, used by tools. */ +#ifndef FSL_COMPONENT_ID +#define FSL_COMPONENT_ID "platform.drivers.xip_device" +#endif + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + IVT_HEADER, /* IVT Header */ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + FLASH_SIZE, /* size */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +__attribute__((section(".boot_hdr.conf"))) +// Values copied from https://github.com/PaulStoffregen/cores/blob/ddb23fa5d97dac763bc06e11b9b41f026bd51f0a/teensy4/bootdata.c#L39 +const flexspi_nor_config_t qspiflash_config = { + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 1u, + .csSetupTime = 2u, + // Enable DDR mode, Wordaddressable, Safe configuration, Differential clock + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | + // FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) + // Read LUTs + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04), + 0, + 0, + + 0x24040405, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x00000406, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x08180420, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x081804D8, + 0, + 0, + 0, + + 0x08180402, + 0x00002004, + 0, + 0, + + 0, + 0, + 0, + 0, + + 0x00000460, + }, + }, + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, +}; diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h new file mode 100644 index 0000000000..15b8c0f34a --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.h @@ -0,0 +1,18 @@ +#define MICROPY_HW_BOARD_NAME "Teensy 4.1" +#define MICROPY_HW_MCU_NAME "IMXRT1062DVJ6A" + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (8 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk new file mode 100644 index 0000000000..201e0e660f --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80AE +USB_PRODUCT = "Teensy 4.1" +USB_MANUFACTURER = "PJRC" + +CHIP_VARIANT = MIMXRT1062DVJ6A +CHIP_FAMILY = MIMXRT1062 +FLASH = W25Q64JV diff --git a/ports/mimxrt10xx/boards/teensy41/pins.c b/ports/mimxrt10xx/boards/teensy41/pins.c new file mode 100644 index 0000000000..5eb5ab0f55 --- /dev/null +++ b/ports/mimxrt10xx/boards/teensy41/pins.c @@ -0,0 +1,116 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + // With USB on left. Bottom edge. + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + + // Bottom Edge extended for 4.1 + { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, + + // Top edge + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + + // Top edge extended for Teensy 4.1 + { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05) }, + + // SD Card slot + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + + // Flash expansion spot and PSRAM expansion spot on a shared QSPI BUS + { MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + + + { 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); From 94949fb46f88ab92de5a424287f90e03b2981817 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 11 May 2020 18:02:40 -0400 Subject: [PATCH 449/919] Add recovery domain write access, adjust stack --- ports/stm/boards/STM32F401xd_fs.ld | 2 +- ports/stm/boards/STM32F401xe_boot.ld | 2 +- ports/stm/boards/STM32F401xe_fs.ld | 2 +- ports/stm/boards/STM32F405_boot.ld | 2 +- ports/stm/boards/STM32F405_default.ld | 2 +- ports/stm/boards/STM32F405_fs.ld | 2 +- ports/stm/boards/STM32F407_fs.ld | 2 +- ports/stm/boards/STM32F411_fs.ld | 2 +- ports/stm/boards/STM32F411_nvm.ld | 2 +- ports/stm/boards/STM32F412_fs.ld | 2 +- ports/stm/boards/STM32F746xG_fs.ld | 2 +- ports/stm/boards/STM32F767_fs.ld | 2 +- ports/stm/boards/STM32H743_fs.ld | 2 +- ports/stm/supervisor/port.c | 50 ++++++++++++++++++++++----- 14 files changed, 54 insertions(+), 22 deletions(-) diff --git a/ports/stm/boards/STM32F401xd_fs.ld b/ports/stm/boards/STM32F401xd_fs.ld index 3086c2c6b0..69bae46cb6 100644 --- a/ports/stm/boards/STM32F401xd_fs.ld +++ b/ports/stm/boards/STM32F401xd_fs.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 0409476949..37827c3301 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -12,7 +12,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F401xe_fs.ld b/ports/stm/boards/STM32F401xe_fs.ld index b55bc4bb4a..20247930c2 100644 --- a/ports/stm/boards/STM32F401xe_fs.ld +++ b/ports/stm/boards/STM32F401xe_fs.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 906f56e0d2..5768d1a01e 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define the top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index 0aafdbcac5..4c11fd7cf3 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index bff312660e..e6c66127fb 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -14,7 +14,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index 5330b4116f..f06c19d992 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -14,7 +14,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index 82c7aea065..1b45f235fa 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index 897b996313..5ac3e52a6e 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -14,7 +14,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define the top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index afd51c6b19..8837bd87d6 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index f1bd3d5dc0..be10a14294 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -38,7 +38,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 40e67829bf..25322b0b6f 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -13,7 +13,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index 686f93ea36..b6c3d5b62d 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -22,7 +22,7 @@ MEMORY } /* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; +_minimum_stack_size = 24K; /*TODO: this can probably be bigger, but how big?*/ _minimum_heap_size = 16K; /* brainless copy paste for stack code. Results in ambiguous hard crash */ diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 328a8d660c..23ba7d8745 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -49,7 +49,7 @@ #include STM32_HAL_H //only enable the Reset Handler overwrite for the H7 for now -#if defined(STM32H7) +#if (CPY_STM32H7) // Device memories must be accessed in order. #define DEVICE 2 @@ -162,7 +162,7 @@ safe_mode_t port_init(void) { HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); - #if defined(STM32F4) + #if (CPY_STM32F4) __HAL_RCC_PWR_CLK_ENABLE(); #endif @@ -170,31 +170,63 @@ safe_mode_t port_init(void) { stm32_peripherals_gpio_init(); HAL_PWR_EnableBkUpAccess(); + + // TODO: move all of this to clocks.c #if BOARD_HAS_LOW_SPEED_CRYSTAL - __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); + uint32_t tickstart = HAL_GetTick(); + + // H7/F7 untested with LSE, so autofail them until above move is done + #if (CPY_STM32F4) bool lse_setupsuccess = true; - uint32_t i = 0; + #else + bool lse_setupsuccess = false; + #endif + + // Update LSE configuration in Backup Domain control register + // Requires to enable write access to Backup Domain of necessary + // TODO: should be using the HAL OSC initializer, otherwise we'll need + // preprocessor defines for every register to account for F7/H7 + #if (CPY_STM32F4) + if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + // Enable write access to Backup domain + SET_BIT(PWR->CR, PWR_CR_DBP); + // Wait for Backup domain Write protection disable + tickstart = HAL_GetTick(); + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) + { + lse_setupsuccess = false; + } + } + } + #endif + + __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); + tickstart = HAL_GetTick(); while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if ( ++i > 1000000 ) + if((HAL_GetTick() - tickstart ) > LSE_STARTUP_TIMEOUT) { lse_setupsuccess = false; __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); __HAL_RCC_LSI_ENABLE(); rtc_clock_frequency = LSI_VALUE; + break; } } - #else - __HAL_RCC_LSI_ENABLE(); - #endif - #if BOARD_HAS_LOW_SPEED_CRYSTAL + if (lse_setupsuccess) { __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); } else { __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); } + #else + __HAL_RCC_LSI_ENABLE(); __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); #endif + __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; From 235098efb84d9b64537884910cf080640d8ce28d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 6 May 2020 12:03:18 +0800 Subject: [PATCH 450/919] nrf: simmel: correct CSn pin The CSn pin is pin 6 on bank 1, not bank 0. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c index c946493d47..6c572cae21 100644 --- a/ports/nrf/boards/simmel/pins.c +++ b/ports/nrf/boards/simmel/pins.c @@ -1,7 +1,7 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_SPI_CSN), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_SPI_CSN), MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_P1_04) }, { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_P0_09) }, { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_P0_10) }, From 79c055f958dc5d85942cadf21b384b4654e92bba Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 7 May 2020 11:28:50 +0800 Subject: [PATCH 451/919] nrf: simmel: enable aesio This adds AES support to simmel. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index e71ada1de6..83fda6bda1 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -11,6 +11,7 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_AESIO = 1 CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BUSIO = 1 CIRCUITPY_DISPLAYIO = 0 From 370fc7293a9ebe8015b70b9579f15386e59cbfea Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 7 May 2020 17:00:51 +0800 Subject: [PATCH 452/919] nrf: support disabling SPIM3 SPIM3 is faster than all other SPI blocks, and is capable of generating a 32 MHz clock. However, it cannot be used at the same time as the BLE radio without dedicating an additional 8 kB of RAM to it. Therefore, some boards may want to disable this. Support pre-defining NRFX_SPIM3_ENABLED on the command line to disable it on some bords. Signed-off-by: Sean Cross --- ports/nrf/nrfx_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index 05ec95ae38..7a7f2e6d64 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -41,12 +41,14 @@ #define NRFX_SPIM1_ENABLED 1 #endif #define NRFX_SPIM2_ENABLED 1 +#ifndef NRFX_SPIM3_ENABLED #if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) #define NRFX_SPIM_EXTENDED_ENABLED 1 #define NRFX_SPIM3_ENABLED 1 #elif CIRCUITPY_NRF_NUM_I2C == 2 #define NRFX_SPIM3_ENABLED 0 #endif +#endif #define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 7 From f7fcd43516f8aa51184ae45fe16d5b56af92f2d9 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 7 May 2020 17:02:40 +0800 Subject: [PATCH 453/919] nrf: simmel: disable SPIM3 Disable the SPIM3 controller to avoid needing to dedicate 8 kB to the SPIM3 block. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 83fda6bda1..36a6fadda2 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -30,4 +30,4 @@ CIRCUITPY_ULAB = 0 # These defines must be overridden before mpconfigboard.h is included, which is # why they are passed on the command line. -CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' +CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' -DNRFX_SPIM3_ENABLED=0 From ffaeeda749e8cd6d284d256f7676378ce9425b13 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 12 May 2020 09:29:23 +0800 Subject: [PATCH 454/919] nrf: simmel: decrease flash filesystem size The flash filesystem must be reduced in order to allow the current build to fit. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index 4c73e86eb2..bcffb40ea5 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -40,7 +40,7 @@ #endif #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (84*1024) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (80*1024) #define BOOTLOADER_SIZE (0x4000) // 12 kiB #define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) From f446f6c2ee510958c2b0e3163b1cfe3c84c4a344 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 May 2020 21:27:49 -0500 Subject: [PATCH 455/919] Adding message --- locale/ID.po | 2 +- locale/circuitpython.pot | 2 +- locale/de_DE.po | 2 +- locale/en_US.po | 2 +- locale/en_x_pirate.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 10 +++++----- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 7ccd090c0d..233d3f67b7 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b0e7a5a6c4..25013dfa20 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index 376db44c8f..31ac25cf5a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2020-04-30 17:01+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 65a0771455..9db0f5811d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" -"PO-Revision-Date: 2020-03-29 17:02+0000\n" -"Last-Translator: Weblate Admin \n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"PO-Revision-Date: 2020-05-05 20:24+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -18,7 +18,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 3.11.3\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" @@ -120,7 +120,7 @@ msgid "'%s' expects an FPU register" msgstr "'%s' attend un registre FPU" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an address of the form [a, b]" msgstr "'%s' attend une adresse de la forme [a, b]" diff --git a/locale/it_IT.po b/locale/it_IT.po index 7f2a17991c..6350781a39 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index b18890bcc4..bee69fde6f 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pl.po b/locale/pl.po index 71d501c8b1..f94994fb08 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 51d5180a87..ceaa251109 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index 0eaa91d16f..d79c307124 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 01c815b0df..2975b86e92 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-08 17:15-0500\n" +"POT-Creation-Date: 2020-05-11 21:27-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From ebcda59e535960220475286b6a54fa3e0f7bcbeb Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 11 May 2020 21:40:25 -0500 Subject: [PATCH 456/919] Adding message for reporting of no long integers Adding a message for the fix of issue #2812 --- locale/ID.po | 44 +++++++++++++++++++++++++++++++++------- locale/circuitpython.pot | 44 +++++++++++++++++++++++++++++++++------- locale/de_DE.po | 44 +++++++++++++++++++++++++++++++++------- locale/en_US.po | 44 +++++++++++++++++++++++++++++++++------- locale/en_x_pirate.po | 44 +++++++++++++++++++++++++++++++++------- locale/es.po | 44 +++++++++++++++++++++++++++++++++------- locale/fil.po | 44 +++++++++++++++++++++++++++++++++------- locale/fr.po | 44 +++++++++++++++++++++++++++++++++------- locale/it_IT.po | 44 +++++++++++++++++++++++++++++++++------- locale/ko.po | 44 +++++++++++++++++++++++++++++++++------- locale/pl.po | 44 +++++++++++++++++++++++++++++++++------- locale/pt_BR.po | 44 +++++++++++++++++++++++++++++++++------- locale/sv.po | 44 +++++++++++++++++++++++++++++++++------- locale/zh_Latn_pinyin.po | 44 +++++++++++++++++++++++++++++++++------- 14 files changed, 518 insertions(+), 98 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 233d3f67b7..767e150c55 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -434,6 +434,10 @@ msgstr "buffers harus mempunyai panjang yang sama" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -671,6 +675,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +690,7 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -789,7 +797,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -809,6 +818,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operasi I2C tidak didukung" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -988,6 +1002,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" @@ -1033,7 +1051,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1041,7 +1059,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1072,11 +1090,11 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip" msgid "No DMA channel found" msgstr "tidak ada channel DMA ditemukan" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1121,6 +1139,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Tidak ada dukungan hardware untuk pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1306,6 +1328,10 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Channel Kanan tidak didukung" @@ -1370,6 +1396,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 25013dfa20..f6b3de7faa 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -429,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -660,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -671,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -778,7 +786,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -798,6 +807,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -977,6 +991,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1022,7 +1040,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1030,7 +1048,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1061,11 +1079,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1110,6 +1128,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1291,6 +1313,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1354,6 +1380,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 31ac25cf5a..1b3716fdbf 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2020-04-30 17:01+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: fil\n" @@ -436,6 +436,10 @@ msgstr "buffer ay dapat bytes-like object" msgid "Bytes must be between 0 and 255." msgstr "Sa gitna ng 0 o 255 dapat ang bytes." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -672,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -683,7 +691,7 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -792,7 +800,8 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -812,6 +821,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Hindi supportado ang operasyong I2C" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -993,6 +1007,10 @@ msgstr "May hindi tama sa wave file" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" @@ -1038,7 +1056,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1046,7 +1064,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1077,11 +1095,11 @@ msgstr "Walang DAC sa chip" msgid "No DMA channel found" msgstr "Walang DMA channel na mahanap" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1126,6 +1144,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Walang support sa hardware ang pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1314,6 +1336,10 @@ msgstr "Basahin-lamang" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Hindi supportado ang kanang channel" @@ -1377,6 +1403,10 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" diff --git a/locale/fr.po b/locale/fr.po index 9db0f5811d..7fa801a19d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2020-05-05 20:24+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" @@ -436,6 +436,10 @@ msgstr "i buffer devono essere della stessa lunghezza" msgid "Bytes must be between 0 and 255." msgstr "I byte devono essere compresi tra 0 e 255" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -672,6 +676,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -683,7 +691,7 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -792,7 +800,8 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -812,6 +821,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "operazione I2C non supportata" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -996,6 +1010,10 @@ msgstr "File wave non valido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1042,7 +1060,7 @@ msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Il ritardo di avvio del microfono deve essere nell'intervallo tra 0.0 e 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1050,7 +1068,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1081,11 +1099,11 @@ msgstr "Nessun DAC sul chip" msgid "No DMA channel found" msgstr "Nessun canale DMA trovato" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1130,6 +1148,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Nessun supporto hardware sul pin" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1323,6 +1345,10 @@ msgstr "Sola lettura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canale destro non supportato" @@ -1388,6 +1414,10 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" diff --git a/locale/ko.po b/locale/ko.po index bee69fde6f..41795bc445 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -433,6 +433,10 @@ msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." msgid "Bytes must be between 0 and 255." msgstr "바이트는 0에서 255 사이 여야합니다." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -664,6 +668,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -675,7 +683,7 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -782,7 +790,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -802,6 +811,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -981,6 +995,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1026,7 +1044,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1034,7 +1052,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1065,11 +1083,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1114,6 +1132,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1295,6 +1317,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1358,6 +1384,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index f94994fb08..9f7f72027f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -432,6 +432,10 @@ msgstr "Bufor musi mieć 16 bajtów." msgid "Bytes must be between 0 and 255." msgstr "Bytes musi być między 0 a 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -663,6 +667,10 @@ msgstr "Wyświetlacz można obracać co 90 stopni" msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -674,7 +682,7 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -781,7 +789,8 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -801,6 +810,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "Operacja I2C nieobsługiwana" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -982,6 +996,10 @@ msgstr "Zły plik wave" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" @@ -1027,7 +1045,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1035,7 +1053,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1066,11 +1084,11 @@ msgstr "Brak DAC" msgid "No DMA channel found" msgstr "Nie znaleziono kanału DMA" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1115,6 +1133,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "Brak sprzętowej obsługi na nóżce" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1296,6 +1318,10 @@ msgstr "Obiekt tylko do odczytu" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Prawy kanał jest niewspierany" @@ -1359,6 +1385,10 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Podział z podgrupami" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ceaa251109..1ade16a9d7 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -433,6 +433,10 @@ msgstr "buffers devem ser o mesmo tamanho" msgid "Bytes must be between 0 and 255." msgstr "Os bytes devem estar entre 0 e 255." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -667,6 +671,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -678,7 +686,7 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -787,7 +795,8 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -807,6 +816,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "I2C operação não suportada" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -989,6 +1003,10 @@ msgstr "Aqruivo de ondas inválido" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1034,7 +1052,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1042,7 +1060,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1073,11 +1091,11 @@ msgstr "Nenhum DAC no chip" msgid "No DMA channel found" msgstr "Nenhum canal DMA encontrado" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1122,6 +1140,10 @@ msgstr "Sem suporte de hardware no pino de clock" msgid "No hardware support on pin" msgstr "Nenhum suporte de hardware no pino" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1308,6 +1330,10 @@ msgstr "Somente leitura" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Canal direito não suportado" @@ -1371,6 +1397,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index d79c307124..a019a3dc1b 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -429,6 +429,10 @@ msgstr "" msgid "Bytes must be between 0 and 255." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "" @@ -660,6 +664,10 @@ msgstr "" msgid "Drive mode not used when direction is input." msgstr "" +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -671,7 +679,7 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -778,7 +786,8 @@ msgstr "" msgid "Group full" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "" @@ -798,6 +807,11 @@ msgstr "" msgid "I2C operation not supported" msgstr "" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -977,6 +991,10 @@ msgstr "" msgid "Invalid word/bit length" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" @@ -1022,7 +1040,7 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" @@ -1030,7 +1048,7 @@ msgstr "" msgid "Must be a %q subclass." msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "" @@ -1061,11 +1079,11 @@ msgstr "" msgid "No DMA channel found" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" @@ -1110,6 +1128,10 @@ msgstr "" msgid "No hardware support on pin" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1291,6 +1313,10 @@ msgstr "" msgid "Refresh too soon" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1354,6 +1380,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2975b86e92..c08f0d2a17 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-11 21:27-0500\n" +"POT-Creation-Date: 2020-05-11 21:38-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -438,6 +438,10 @@ msgstr "Zì jié huǎnchōng qū bìxū shì 16 zì jié." msgid "Bytes must be between 0 and 255." msgstr "Zì jié bìxū jiè yú 0 dào 255 zhī jiān." +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + #: py/objtype.c msgid "Call super().__init__() before accessing native object." msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()" @@ -671,6 +675,10 @@ msgstr "Xiǎnshì xuánzhuǎn bìxū 90 dù jiā xīn" msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -682,7 +690,7 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" @@ -789,7 +797,8 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" @@ -809,6 +818,11 @@ msgstr "I2C chūshǐhuà cuòwù" msgid "I2C operation not supported" msgstr "I2C cāozuò bù zhīchí" +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -990,6 +1004,10 @@ msgstr "Wúxiào de làng làngcháo wénjiàn" msgid "Invalid word/bit length" msgstr "Wúxiào de zì/wèi chángdù" +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" @@ -1035,7 +1053,7 @@ msgstr "MicroPython zhìmìng cuòwù." msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" @@ -1043,7 +1061,7 @@ msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" msgstr "Bìxū tígōng MISO huò MOSI yǐn jiǎo" @@ -1074,11 +1092,11 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de" msgid "No DMA channel found" msgstr "Wèi zhǎodào DMA píndào" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Méiyǒu MISO yǐn jiǎo" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Méiyǒu MOSI yǐn jiǎo" @@ -1123,6 +1141,10 @@ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" msgid "No hardware support on pin" msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1310,6 +1332,10 @@ msgstr "Zhǐ dú duìxiàng" msgid "Refresh too soon" msgstr "Shuāxīn tài kuàile" +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "Bù zhīchí yòu tōngdào" @@ -1373,6 +1399,10 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + #: extmod/modure.c msgid "Splitting with sub-captures" msgstr "Yǔ zi bǔhuò fēnliè" From cfd0de9c11629216f743a9edcadf93ad9e48fa1e Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 11 May 2020 21:08:58 -0700 Subject: [PATCH 457/919] set vectorio to FULL_BUILD and see what works --- py/circuitpy_mpconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index e9e3d80138..687ef72635 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -94,7 +94,7 @@ CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) CIRCUITPY_FRAMEBUFFERIO ?= 0 CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) -CIRCUITPY_VECTORIO ?= 0 +CIRCUITPY_VECTORIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) From 040beb0577f4360f34953db16c285a9af1bea6b8 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 11 May 2020 21:15:40 -0700 Subject: [PATCH 458/919] Clean up circle documentation --- shared-bindings/vectorio/Circle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 8f409bd654..260e80d0fb 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -17,6 +17,8 @@ //| //| .. class:: Circle(radius) //| +//| Circle is positioned on screen by its center point. +//| //| :param int radius: The radius of the circle in pixels //| static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -42,7 +44,7 @@ static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_arg //| .. attribute:: radius //| -//| Update the radius of the circle +//| The radius of the circle in pixels. //| STATIC mp_obj_t vectorio_circle_obj_get_radius(mp_obj_t self_in) { vectorio_circle_t *self = MP_OBJ_TO_PTR(self_in); From 78444a1018f5a9dbac6e2fac1b7385970accedbc Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 11 May 2020 21:21:05 -0700 Subject: [PATCH 459/919] fix VectorShape on_dirty callback registration being set for the wrong type --- shared-bindings/vectorio/VectorShape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 02a42536d7..4b39ec9960 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -85,8 +85,8 @@ STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t if (MP_OBJ_IS_TYPE(shape, &vectorio_polygon_type)) { common_hal_vectorio_polygon_set_on_dirty(self->ishape.shape, on_dirty); } else if (MP_OBJ_IS_TYPE(shape, &vectorio_rectangle_type)) { - common_hal_vectorio_circle_set_on_dirty(self->ishape.shape, on_dirty); } else if (MP_OBJ_IS_TYPE(shape, &vectorio_circle_type)) { + common_hal_vectorio_circle_set_on_dirty(self->ishape.shape, on_dirty); } else { mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_shape); } From 22bf99ccc438e499378af099a446d1c6d9b542ac Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 12 May 2020 14:52:48 +1000 Subject: [PATCH 460/919] Fixed underline in documentation --- shared-bindings/countio/Counter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 1777acc8a2..d9d97f0ead 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -12,13 +12,13 @@ //| .. currentmodule:: countio //| //| :class:`Counter` -- Track the count of falling edge transistions (pulses) on a given pin -//| ==================================================================================== +//| ======================================================================================== //| //| Counter will keep track of the number of falling edge transistions (pulses) on a given pin //| //| .. class:: Counter(pin_a) //| -//| Create an Counter object associated with the given pin. It tracks the number of +//| Create a Counter object associated with the given pin. It tracks the number of //| falling pulses relative when the object is constructed. //| //| :param ~microcontroller.Pin pin_a: Pin to read pulses from. From 5e5461e77eec52dd866b0fe840dd946948ca3dc2 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 12 May 2020 16:32:35 +1000 Subject: [PATCH 461/919] removed countio from catwan_usbstick build --- ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 8724e0d4bb..61869e6b2d 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -9,3 +9,4 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_COUNTIO = 0 From c00f81c0a3e94cebfead9a1868b84282b53c7e57 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 12 May 2020 16:33:09 +1000 Subject: [PATCH 462/919] changed branch on protomatter --- lib/protomatter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protomatter b/lib/protomatter index c411714cbd..9f71088d2c 160000 --- a/lib/protomatter +++ b/lib/protomatter @@ -1 +1 @@ -Subproject commit c411714cbdc05725e80398acb18c3c1fb6fa68a4 +Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764 From 62bdfb74e3c13ab65f598fc57b646ec2ca3df495 Mon Sep 17 00:00:00 2001 From: Daniel Pollard Date: Tue, 12 May 2020 16:40:23 +1000 Subject: [PATCH 463/919] removed lib from catwan_usbstick - updated transalations overflowed --- ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 61869e6b2d..892a5371ef 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -10,3 +10,4 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_ROTARYIO = 0 From 991045b9ce958db9d7102d621f4e7860301e4c21 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 12 May 2020 11:28:33 -0400 Subject: [PATCH 464/919] Did struct, supervisor, terminalio --- shared-bindings/struct/__init__.c | 48 +++++++++++++-------------- shared-bindings/supervisor/Runtime.c | 41 +++++++++++------------ shared-bindings/supervisor/__init__.c | 47 +++++++++++++------------- shared-bindings/terminalio/Terminal.c | 26 +++++++-------- shared-bindings/terminalio/__init__.c | 4 +-- 5 files changed, 82 insertions(+), 84 deletions(-) diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index ea14b37637..3772f93a76 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -38,7 +38,7 @@ #include "shared-module/struct/__init__.h" #include "supervisor/shared/translate.h" -//| :mod:`struct` --- manipulation of c-style data +//| """:mod:`struct` --- manipulation of c-style data //| ======================================================== //| //| .. module:: struct @@ -52,13 +52,13 @@ //| Supported size/byte order prefixes: *@*, *<*, *>*, *!*. //| //| Supported format codes: *b*, *B*, *x*, *h*, *H*, *i*, *I*, *l*, *L*, *q*, *Q*, -//| *s*, *P*, *f*, *d* (the latter 2 depending on the floating-point support). +//| *s*, *P*, *f*, *d* (the latter 2 depending on the floating-point support).""" //| -//| .. function:: calcsize(fmt) -//| -//| Return the number of bytes needed to store the given fmt. +//| def calcsize(fmt: Any) -> Any: +//| """Return the number of bytes needed to store the given fmt.""" +//| ... //| STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { @@ -67,10 +67,10 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(struct_calcsize_obj, struct_calcsize); -//| .. function:: pack(fmt, *values) -//| -//| Pack the values according to the format string fmt. -//| The return value is a bytes object encoding the values. +//| def pack(fmt: Any, *values: Any) -> Any: +//| """Pack the values according to the format string fmt. +//| The return value is a bytes object encoding the values.""" +//| ... //| STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { @@ -85,10 +85,10 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack); -//| .. function:: pack_into(fmt, buffer, offset, *values) -//| -//| Pack the values according to the format string fmt into a buffer -//| starting at offset. offset may be negative to count from the end of buffer. +//| def pack_into(fmt: Any, buffer: Any, offset: Any, *values: Any) -> Any: +//| """Pack the values according to the format string fmt into a buffer +//| starting at offset. offset may be negative to count from the end of buffer.""" +//| ... //| STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { @@ -111,11 +111,11 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_into_obj, 3, MP_OBJ_FUN_ARGS_MAX, struct_pack_into); -//| .. function:: unpack(fmt, data) -//| -//| Unpack from the data according to the format string fmt. The return value -//| is a tuple of the unpacked values. The buffer size must match the size -//| required by the format. +//| def unpack(fmt: Any, data: Any) -> Any: +//| """Unpack from the data according to the format string fmt. The return value +//| is a tuple of the unpacked values. The buffer size must match the size +//| required by the format.""" +//| ... //| STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { @@ -129,12 +129,12 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_obj, 2, 3, struct_unpack); -//| .. function:: unpack_from(fmt, data, offset=0) -//| -//| Unpack from the data starting at offset according to the format string fmt. -//| offset may be negative to count from the end of buffer. The return value is -//| a tuple of the unpacked values. The buffer size must be at least as big -//| as the size required by the form. +//| def unpack_from(fmt: Any, data: Any, offset: Any = 0) -> Any: +//| """Unpack from the data starting at offset according to the format string fmt. +//| offset may be negative to count from the end of buffer. The return value is +//| a tuple of the unpacked values. The buffer size must be at least as big +//| as the size required by the form.""" +//| ... //| STATIC mp_obj_t struct_unpack_from(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 746dfe5ee7..05921899ce 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -29,35 +29,35 @@ #include "shared-bindings/supervisor/Runtime.h" //TODO: add USB, REPL to description once they're operational -//| .. currentmodule:: supervisor +//| class Runtime: +//| """.. currentmodule:: supervisor //| -//| :class:`Runtime` --- Supervisor Runtime information -//| ---------------------------------------------------- +//| :class:`Runtime` --- Supervisor Runtime information +//| ---------------------------------------------------- //| -//| Get current status of runtime objects. +//| Get current status of runtime objects. //| -//| Usage:: +//| Usage:: //| -//| import supervisor -//| if supervisor.runtime.serial_connected: -//| print("Hello World!") +//| import supervisor +//| if supervisor.runtime.serial_connected: +//| print("Hello World!")""" //| -//| .. class:: Runtime() -//| -//| You cannot create an instance of `supervisor.Runtime`. -//| Use `supervisor.runtime` to access the sole instance available. +//| def __init__(self, ): +//| """You cannot create an instance of `supervisor.Runtime`. +//| Use `supervisor.runtime` to access the sole instance available.""" +//| ... //| -//| .. attribute:: runtime.serial_connected -//| -//| Returns the USB serial communication status (read-only). +//| runtime.serial_connected: Any = ... +//| """Returns the USB serial communication status (read-only). //| //| .. note:: //| //| SAMD: Will return ``True`` if the USB serial connection //| has been established at any point. Will not reset if -//| USB is disconnected but power remains (e.g. battery connected) +//| USB is disconnected but power remains (e.g. battery connected)""" //| STATIC mp_obj_t supervisor_get_serial_connected(mp_obj_t self){ @@ -78,11 +78,10 @@ const mp_obj_property_t supervisor_serial_connected_obj = { }; -//| .. attribute:: runtime.serial_bytes_available -//| -//| Returns the whether any bytes are available to read -//| on the USB serial input. Allows for polling to see whether -//| to call the built-in input() or wait. (read-only) +//| runtime.serial_bytes_available: Any = ... +//| """Returns the whether any bytes are available to read +//| on the USB serial input. Allows for polling to see whether +//| to call the built-in input() or wait. (read-only)""" //| STATIC mp_obj_t supervisor_get_serial_bytes_available(mp_obj_t self){ if (!common_hal_get_serial_bytes_available()) { diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 2705c8e581..7fe6668f48 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -36,7 +36,7 @@ #include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/supervisor/Runtime.h" -//| :mod:`supervisor` --- Supervisor settings +//| """:mod:`supervisor` --- Supervisor settings //| ================================================= //| //| .. module:: supervisor @@ -50,19 +50,18 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| Runtime +//| Runtime""" //| -//| .. attribute:: runtime -//| -//| Runtime information, such as `runtime.serial_connected` -//| (USB serial connection status). -//| This object is the sole instance of `supervisor.Runtime`. +//| runtime: Any = ... +//| """Runtime information, such as `runtime.serial_connected` +//| (USB serial connection status). +//| This object is the sole instance of `supervisor.Runtime`.""" //| -//| .. method:: enable_autoreload() -//| -//| Enable autoreload based on USB file write activity. +//| def enable_autoreload(self, ) -> Any: +//| """Enable autoreload based on USB file write activity.""" +//| ... //| STATIC mp_obj_t supervisor_enable_autoreload(void) { autoreload_enable(); @@ -70,10 +69,10 @@ STATIC mp_obj_t supervisor_enable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_enable_autoreload_obj, supervisor_enable_autoreload); -//| .. method:: disable_autoreload() -//| -//| Disable autoreload based on USB file write activity until -//| `enable_autoreload` is called. +//| def disable_autoreload(self, ) -> Any: +//| """Disable autoreload based on USB file write activity until +//| `enable_autoreload` is called.""" +//| ... //| STATIC mp_obj_t supervisor_disable_autoreload(void) { autoreload_disable(); @@ -81,10 +80,10 @@ STATIC mp_obj_t supervisor_disable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_disable_autoreload_obj, supervisor_disable_autoreload); -//| .. method:: set_rgb_status_brightness() -//| -//| Set brightness of status neopixel from 0-255 -//| `set_rgb_status_brightness` is called. +//| def set_rgb_status_brightness(self, ) -> Any: +//| """Set brightness of status neopixel from 0-255 +//| `set_rgb_status_brightness` is called.""" +//| ... //| STATIC mp_obj_t supervisor_set_rgb_status_brightness(mp_obj_t lvl){ // This must be int. If cast to uint8_t first, will never raise a ValueError. @@ -97,9 +96,9 @@ STATIC mp_obj_t supervisor_set_rgb_status_brightness(mp_obj_t lvl){ } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_set_rgb_status_brightness_obj, supervisor_set_rgb_status_brightness); -//| .. method:: reload() -//| -//| Reload the main Python code and run it (equivalent to hitting Ctrl-D at the REPL). +//| def reload(self, ) -> Any: +//| """Reload the main Python code and run it (equivalent to hitting Ctrl-D at the REPL).""" +//| ... //| STATIC mp_obj_t supervisor_reload(void) { reload_requested = true; @@ -108,9 +107,9 @@ STATIC mp_obj_t supervisor_reload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); -//| .. method:: set_next_stack_limit(size) -//| -//| Set the size of the stack for the next vm run. If its too large, the default will be used. +//| def set_next_stack_limit(self, size: Any) -> Any: +//| """Set the size of the stack for the next vm run. If its too large, the default will be used.""" +//| ... //| STATIC mp_obj_t supervisor_set_next_stack_limit(mp_obj_t size_obj) { mp_int_t size = mp_obj_get_int(size_obj); diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 9c01fba20b..1288b70182 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -37,16 +37,16 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: terminalio +//| class Terminal: +//| """.. currentmodule:: terminalio //| -//| :class:`Terminal` -- display a character stream with a TileGrid -//| ================================================================ +//| :class:`Terminal` -- display a character stream with a TileGrid +//| ================================================================""" //| -//| .. class:: Terminal(tilegrid, font) -//| -//| Terminal manages tile indices and cursor position based on VT100 commands. The font should be -//| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap. +//| def __init__(self, tilegrid: Any, font: Any): +//| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be +//| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.""" +//| ... //| STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -75,12 +75,12 @@ STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n // These are standard stream methods. Code is in py/stream.c. // -//| .. method:: write(buf) +//| def write(self, buf: Any) -> Any: +//| """Write the buffer of bytes to the bus. //| -//| Write the buffer of bytes to the bus. -//| -//| :return: the number of bytes written -//| :rtype: int or None +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... //| STATIC mp_uint_t terminalio_terminal_write(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { terminalio_terminal_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index a9fe20f30b..591be839ad 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -35,7 +35,7 @@ #include "py/runtime.h" -//| :mod:`terminalio` --- Displays text in a TileGrid +//| """:mod:`terminalio` --- Displays text in a TileGrid //| ================================================= //| //| .. module:: terminalio @@ -49,7 +49,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| Terminal +//| Terminal""" //| //| STATIC const mp_rom_map_elem_t terminalio_module_globals_table[] = { From e4589543fbe8df12f5c30101e94ddc0fa95cd29e Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 12 May 2020 11:43:24 -0400 Subject: [PATCH 465/919] Did time, touchio, uheap --- shared-bindings/time/__init__.c | 103 +++++++++++++++-------------- shared-bindings/touchio/TouchIn.c | 68 +++++++++---------- shared-bindings/touchio/__init__.c | 4 +- shared-bindings/uheap/__init__.c | 12 ++-- 4 files changed, 93 insertions(+), 94 deletions(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 8d7f2f3fd2..36eaa27f63 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -36,7 +36,7 @@ #include "shared-bindings/time/__init__.h" #include "supervisor/shared/translate.h" -//| :mod:`time` --- time and timing related functions +//| """:mod:`time` --- time and timing related functions //| ======================================================== //| //| .. module:: time @@ -45,15 +45,15 @@ //| //| The `time` module is a strict subset of the CPython `cpython:time` module. So, code //| written in MicroPython will work in CPython but not necessarily the other -//| way around. +//| way around.""" //| -//| .. function:: monotonic() +//| def monotonic() -> Any: +//| """Returns an always increasing value of time with an unknown reference +//| point. Only use it to compare against other values from `monotonic`. //| -//| Returns an always increasing value of time with an unknown reference -//| point. Only use it to compare against other values from `monotonic`. -//| -//| :return: the current monotonic time -//| :rtype: float +//| :return: the current monotonic time +//| :rtype: float""" +//| ... //| STATIC mp_obj_t time_monotonic(void) { uint64_t time64 = common_hal_time_monotonic(); @@ -62,11 +62,11 @@ STATIC mp_obj_t time_monotonic(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic); -//| .. function:: sleep(seconds) +//| def sleep(seconds: float) -> Any: +//| """Sleep for a given number of seconds. //| -//| Sleep for a given number of seconds. -//| -//| :param float seconds: the time to sleep in fractional seconds +//| :param float seconds: the time to sleep in fractional seconds""" +//| ... //| STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) { #if MICROPY_PY_BUILTINS_FLOAT @@ -97,21 +97,22 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp return namedtuple_make_new(type, 9, tuple->items, NULL); } -//| .. class:: struct_time(time_tuple) +//| class struct_time: +//| def __init__(self, time_tuple: Any): +//| """Structure used to capture a date and time. Note that it takes a tuple! //| -//| Structure used to capture a date and time. Note that it takes a tuple! +//| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` //| -//| :param tuple time_tuple: Tuple of time info: ``(tm_year, tm_mon, tm_mday, tm_hour, tm_min, tm_sec, tm_wday, tm_yday, tm_isdst)`` -//| -//| * ``tm_year``: the year, 2017 for example -//| * ``tm_month``: the month, range [1, 12] -//| * ``tm_mday``: the day of the month, range [1, 31] -//| * ``tm_hour``: the hour, range [0, 23] -//| * ``tm_minute``: the minute, range [0, 59] -//| * ``tm_sec``: the second, range [0, 61] -//| * ``tm_wday``: the day of the week, range [0, 6], Monday is 0 -//| * ``tm_yday``: the day of the year, range [1, 366], -1 indicates not known -//| * ``tm_isdst``: 1 when in daylight savings, 0 when not, -1 if unknown. +//| * ``tm_year``: the year, 2017 for example +//| * ``tm_month``: the month, range [1, 12] +//| * ``tm_mday``: the day of the month, range [1, 31] +//| * ``tm_hour``: the hour, range [0, 23] +//| * ``tm_minute``: the minute, range [0, 59] +//| * ``tm_sec``: the second, range [0, 61] +//| * ``tm_wday``: the day of the week, range [0, 6], Monday is 0 +//| * ``tm_yday``: the day of the year, range [1, 366], -1 indicates not known +//| * ``tm_isdst``: 1 when in daylight savings, 0 when not, -1 if unknown.""" +//| ... //| const mp_obj_namedtuple_type_t struct_time_type_obj = { .base = { @@ -194,12 +195,12 @@ mp_obj_t MP_WEAK rtc_get_time_source_time(void) { mp_raise_RuntimeError(translate("RTC is not supported on this board")); } -//| .. function:: time() +//| def time() -> Any: +//| """Return the current time in seconds since since Jan 1, 1970. //| -//| Return the current time in seconds since since Jan 1, 1970. -//| -//| :return: the current time -//| :rtype: int +//| :return: the current time +//| :rtype: int""" +//| ... //| STATIC mp_obj_t time_time(void) { timeutils_struct_time_t tm; @@ -210,12 +211,12 @@ STATIC mp_obj_t time_time(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time); -//| .. function:: monotonic_ns() +//| def monotonic_ns() -> Any: +//| """Return the time of the specified clock clk_id in nanoseconds. //| -//| Return the time of the specified clock clk_id in nanoseconds. -//| -//| :return: the current time -//| :rtype: int +//| :return: the current time +//| :rtype: int""" +//| ... //| STATIC mp_obj_t time_monotonic_ns(void) { uint64_t time64 = common_hal_time_monotonic_ns(); @@ -223,15 +224,15 @@ STATIC mp_obj_t time_monotonic_ns(void) { } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_ns_obj, time_monotonic_ns); -//| .. function:: localtime([secs]) +//| def localtime(secs: Any) -> Any: +//| """Convert a time expressed in seconds since Jan 1, 1970 to a struct_time in +//| local time. If secs is not provided or None, the current time as returned +//| by time() is used. +//| The earliest date for which it can generate a time is Jan 1, 2000. //| -//| Convert a time expressed in seconds since Jan 1, 1970 to a struct_time in -//| local time. If secs is not provided or None, the current time as returned -//| by time() is used. -//| The earliest date for which it can generate a time is Jan 1, 2000. -//| -//| :return: the current time -//| :rtype: time.struct_time +//| :return: the current time +//| :rtype: time.struct_time""" +//| ... //| STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) { if (n_args == 0 || args[0] == mp_const_none) { @@ -256,15 +257,15 @@ STATIC mp_obj_t time_localtime(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime); -//| .. function:: mktime(t) +//| def mktime(t: Any) -> Any: +//| """This is the inverse function of localtime(). Its argument is the +//| struct_time or full 9-tuple (since the dst flag is needed; use -1 as the +//| dst flag if it is unknown) which expresses the time in local time, not UTC. +//| The earliest date for which it can generate a time is Jan 1, 2000. //| -//| This is the inverse function of localtime(). Its argument is the -//| struct_time or full 9-tuple (since the dst flag is needed; use -1 as the -//| dst flag if it is unknown) which expresses the time in local time, not UTC. -//| The earliest date for which it can generate a time is Jan 1, 2000. -//| -//| :return: seconds -//| :rtype: int +//| :return: seconds +//| :rtype: int""" +//| ... //| STATIC mp_obj_t time_mktime(mp_obj_t t) { mp_obj_t *elem; diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index db53ec1bc8..6d59a17446 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -38,27 +38,28 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: touchio +//| class TouchIn: +//| """.. currentmodule:: touchio //| -//| :class:`TouchIn` -- Read the state of a capacitive touch sensor -//| =================================================================== +//| :class:`TouchIn` -- Read the state of a capacitive touch sensor +//| =================================================================== //| -//| Usage:: +//| Usage:: //| -//| import touchio -//| from board import * +//| import touchio +//| from board import * //| -//| touch = touchio.TouchIn(A1) -//| while True: -//| if touch.value: -//| print("touched!") +//| touch = touchio.TouchIn(A1) +//| while True: +//| if touch.value: +//| print("touched!")""" //| -//| .. class:: TouchIn(pin) +//| def __init__(self, pin: microcontroller.Pin): +//| """Use the TouchIn on the given pin. //| -//| Use the TouchIn on the given pin. -//| -//| :param ~microcontroller.Pin pin: the pin to read from +//| :param ~microcontroller.Pin pin: the pin to read from""" +//| ... //| STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -75,9 +76,9 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type, return (mp_obj_t) self; } -//| .. method:: deinit() -//| -//| Deinitialises the TouchIn and releases any hardware resources for reuse. +//| def deinit(self, ) -> Any: +//| """Deinitialises the TouchIn and releases any hardware resources for reuse.""" +//| ... //| STATIC mp_obj_t touchio_touchin_deinit(mp_obj_t self_in) { touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -92,16 +93,16 @@ STATIC void check_for_deinit(touchio_touchin_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers.""" +//| ... //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... //| STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -110,11 +111,10 @@ STATIC mp_obj_t touchio_touchin_obj___exit__(size_t n_args, const mp_obj_t *args } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(touchio_touchin___exit___obj, 4, 4, touchio_touchin_obj___exit__); -//| .. attribute:: value +//| value: Any = ... +//| """Whether the touch pad is being touched or not. (read-only) //| -//| Whether the touch pad is being touched or not. (read-only) -//| -//| True when `raw_value` > `threshold`. +//| True when `raw_value` > `threshold`.""" //| STATIC mp_obj_t touchio_touchin_obj_get_value(mp_obj_t self_in) { touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -131,9 +131,8 @@ const mp_obj_property_t touchio_touchin_value_obj = { }; -//| .. attribute:: raw_value -//| -//| The raw touch measurement as an `int`. (read-only) +//| raw_value: Any = ... +//| """The raw touch measurement as an `int`. (read-only)""" //| STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) { touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -151,14 +150,13 @@ const mp_obj_property_t touchio_touchin_raw_value_obj = { }; -//| .. attribute:: threshold -//| -//| Minimum `raw_value` needed to detect a touch (and for `value` to be `True`). +//| threshold: Any = ... +//| """Minimum `raw_value` needed to detect a touch (and for `value` to be `True`). //| //| When the **TouchIn** object is created, an initial `raw_value` is read from the pin, //| and then `threshold` is set to be 100 + that value. //| -//| You can adjust `threshold` to make the pin more or less sensitive. +//| You can adjust `threshold` to make the pin more or less sensitive.""" //| STATIC mp_obj_t touchio_touchin_obj_get_threshold(mp_obj_t self_in) { touchio_touchin_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/touchio/__init__.c b/shared-bindings/touchio/__init__.c index 6adbe09cf8..96367f0823 100644 --- a/shared-bindings/touchio/__init__.c +++ b/shared-bindings/touchio/__init__.c @@ -35,7 +35,7 @@ #include "py/runtime.h" -//| :mod:`touchio` --- Touch related IO +//| """:mod:`touchio` --- Touch related IO //| ================================================= //| //| .. module:: touchio @@ -66,7 +66,7 @@ //| print(touch_pin.value) //| //| This example will initialize the the device, and print the -//| :py:data:`~touchio.TouchIn.value`. +//| :py:data:`~touchio.TouchIn.value`.""" //| STATIC const mp_rom_map_elem_t touchio_module_globals_table[] = { diff --git a/shared-bindings/uheap/__init__.c b/shared-bindings/uheap/__init__.c index 0d699cd282..f1be304247 100644 --- a/shared-bindings/uheap/__init__.c +++ b/shared-bindings/uheap/__init__.c @@ -31,17 +31,17 @@ #include "shared-bindings/uheap/__init__.h" -//| :mod:`uheap` --- Heap size analysis +//| """:mod:`uheap` --- Heap size analysis //| ================================================================ //| //| .. module:: uheap -//| :synopsis: Heap size analysis +//| :synopsis: Heap size analysis""" //| -//| .. function:: info(object) -//| -//| Prints memory debugging info for the given object and returns the -//| estimated size. +//| def info(object: Any) -> Any: +//| """Prints memory debugging info for the given object and returns the +//| estimated size.""" +//| ... //| STATIC mp_obj_t uheap_info(mp_obj_t obj) { uint32_t size = shared_module_uheap_info(obj); From 6490137812eb9f0c0b08ad81bc77ea21f5f31d04 Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 12 May 2020 12:08:46 -0400 Subject: [PATCH 466/919] Did usb_hid, usb_midi, ustack, wiznet --- shared-bindings/usb_hid/Device.c | 39 ++++++++++---------- shared-bindings/usb_hid/__init__.c | 14 ++++---- shared-bindings/usb_midi/PortIn.c | 46 ++++++++++++------------ shared-bindings/usb_midi/PortOut.c | 27 +++++++------- shared-bindings/usb_midi/__init__.c | 4 +-- shared-bindings/ustack/__init__.c | 31 ++++++++-------- shared-bindings/wiznet/__init__.c | 4 +-- shared-bindings/wiznet/wiznet5k.c | 55 ++++++++++++++--------------- 8 files changed, 110 insertions(+), 110 deletions(-) diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index b1097fb24b..bcea5b2c55 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -27,27 +27,28 @@ #include "py/objproperty.h" #include "shared-bindings/usb_hid/Device.h" -//| .. currentmodule:: usb_hid +//| class Device: +//| """.. currentmodule:: usb_hid //| -//| :class:`Device` -- HID Device -//| ============================================ +//| :class:`Device` -- HID Device +//| ============================================ //| -//| Usage:: +//| Usage:: //| -//| import usb_hid +//| import usb_hid //| -//| mouse = usb_hid.devices[0] +//| mouse = usb_hid.devices[0] //| -//| mouse.send_report() +//| mouse.send_report()""" //| -//| .. class:: Device() +//| def __init__(self, ): +//| """Not currently dynamically supported.""" +//| ... //| -//| Not currently dynamically supported. -//| -//| .. method:: send_report(buf) -//| -//| Send a HID report. +//| def send_report(self, buf: Any) -> Any: +//| """Send a HID report.""" +//| ... //| STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -60,9 +61,8 @@ STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { } MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); -//| .. attribute:: usage_page -//| -//| The usage page of the device as an `int`. Can be thought of a category. (read-only) +//| usage_page: Any = ... +//| """The usage page of the device as an `int`. Can be thought of a category. (read-only)""" //| STATIC mp_obj_t usb_hid_device_obj_get_usage_page(mp_obj_t self_in) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -77,12 +77,11 @@ const mp_obj_property_t usb_hid_device_usage_page_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: usage -//| -//| The functionality of the device as an int. (read-only) +//| usage: Any = ... +//| """The functionality of the device as an int. (read-only) //| //| For example, Keyboard is 0x06 within the generic desktop usage page 0x01. -//| Mouse is 0x02 within the same usage page. +//| Mouse is 0x02 within the same usage page.""" //| STATIC mp_obj_t usb_hid_device_obj_get_usage(mp_obj_t self_in) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index 3ad5b06e04..3d0978d623 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -31,27 +31,27 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" -//| :mod:`usb_hid` --- USB Human Interface Device +//| """:mod:`usb_hid` --- USB Human Interface Device //| =========================================================== //| //| .. module:: usb_hid //| :synopsis: USB Human Interface Device //| :platform: SAMD21 //| -//| The `usb_hid` module allows you to output data as a HID device. +//| The `usb_hid` module allows you to output data as a HID device.""" //| -//| .. attribute:: usb_hid.devices -//| -//| Tuple of all active HID device interfaces. +//| usb_hid.devices: Any = ... +//| """Tuple of all active HID device interfaces.""" //| -//| Libraries +//| """Libraries //| //| .. toctree:: //| :maxdepth: 3 //| -//| Device +//| Device""" +//| STATIC const mp_rom_map_elem_t usb_hid_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid) }, { MP_ROM_QSTR(MP_QSTR_devices), MP_ROM_PTR(&common_hal_usb_hid_devices) }, diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index e2df56e954..55a5865ca7 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -35,39 +35,39 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: usb_midi +//| class PortIn: +//| """.. currentmodule:: usb_midi //| -//| :class:`PortIn` -- receives midi commands over USB -//| =================================================== +//| :class:`PortIn` -- receives midi commands over USB +//| ===================================================""" //| -//| .. class:: PortIn() +//| def __init__(self, ): +//| """You cannot create an instance of `usb_midi.PortIn`. //| -//| You cannot create an instance of `usb_midi.PortIn`. -//| -//| PortIn objects are constructed for every corresponding entry in the USB -//| descriptor and added to the ``usb_midi.ports`` tuple. +//| PortIn objects are constructed for every corresponding entry in the USB +//| descriptor and added to the ``usb_midi.ports`` tuple.""" +//| ... //| // These are standard stream methods. Code is in py/stream.c. // -//| .. method:: read(nbytes=None) +//| def read(self, nbytes: Any = None) -> Any: +//| """Read characters. If ``nbytes`` is specified then read at most that many +//| bytes. Otherwise, read everything that arrives until the connection +//| times out. Providing the number of bytes expected is highly recommended +//| because it will be faster. //| -//| Read characters. If ``nbytes`` is specified then read at most that many -//| bytes. Otherwise, read everything that arrives until the connection -//| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//| :return: Data read +//| :rtype: bytes or None""" +//| ... //| -//| :return: Data read -//| :rtype: bytes or None +//| def readinto(self, buf: Any, nbytes: Any = None) -> Any: +//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most +//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. //| -//| .. method:: readinto(buf, nbytes=None) -//| -//| Read bytes into the ``buf``. If ``nbytes`` is specified then read at most -//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. -//| -//| :return: number of bytes read and stored into ``buf`` -//| :rtype: bytes or None +//| :return: number of bytes read and stored into ``buf`` +//| :rtype: bytes or None""" +//| ... //| // These three methods are used by the shared stream methods. diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index e3eddfaf57..d83eb53b69 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -35,28 +35,27 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: usb_midi +//| class PortOut: +//| """.. currentmodule:: usb_midi //| -//| :class:`PortOut` -- sends midi messages to a computer over USB -//| ============================================================== +//| :class:`PortOut` -- sends midi messages to a computer over USB +//| ==============================================================""" //| -//| .. class:: PortOut() +//| def __init__(self, ): +//| """You cannot create an instance of `usb_midi.PortOut`. //| -//| You cannot create an instance of `usb_midi.PortOut`. -//| -//| PortOut objects are constructed for every corresponding entry in the USB -//| descriptor and added to the ``usb_midi.ports`` tuple. +//| PortOut objects are constructed for every corresponding entry in the USB +//| descriptor and added to the ``usb_midi.ports`` tuple.""" //| // These are standard stream methods. Code is in py/stream.c. // -//| .. method:: write(buf) +//| def write(self, buf: Any) -> Any: +//| """Write the buffer of bytes to the bus. //| -//| Write the buffer of bytes to the bus. -//| -//| :return: the number of bytes written -//| :rtype: int or None +//| :return: the number of bytes written +//| :rtype: int or None""" +//| ... //| STATIC mp_uint_t usb_midi_portout_write(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) { diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index f57d3631bc..2631d8a882 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -35,7 +35,7 @@ #include "py/runtime.h" -//| :mod:`usb_midi` --- MIDI over USB +//| """:mod:`usb_midi` --- MIDI over USB //| ================================================= //| //| .. module:: usb_midi @@ -49,7 +49,7 @@ //| :maxdepth: 3 //| //| PortIn -//| PortOut +//| PortOut""" //| //| mp_map_elem_t usb_midi_module_globals_table[] = { diff --git a/shared-bindings/ustack/__init__.c b/shared-bindings/ustack/__init__.c index 08b772e41e..073840abac 100644 --- a/shared-bindings/ustack/__init__.c +++ b/shared-bindings/ustack/__init__.c @@ -31,17 +31,20 @@ #include "shared-bindings/ustack/__init__.h" -//| :mod:`ustack` --- Stack information and analysis + + + +//| """:mod:`ustack` --- Stack information and analysis //| ======================================================== //| //| .. module:: ustack -//| :synopsis: stack information functions +//| :synopsis: stack information functions""" //| #if MICROPY_MAX_STACK_USAGE -//| .. function:: max_stack_usage() -//| -//| Return the maximum excursion of the stack so far. +//| def max_stack_usage() -> Any: +//| """Return the maximum excursion of the stack so far.""" +//| ... //| STATIC mp_obj_t max_stack_usage(void) { return MP_OBJ_NEW_SMALL_INT(shared_module_ustack_max_stack_usage()); @@ -50,21 +53,21 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(max_stack_usage_obj, max_stack_usage); #endif // MICROPY_MAX_STACK_USAGE -//| .. function:: stack_size() -//| -//| Return the size of the entire stack. -//| Same as in micropython.mem_info(), but returns a value instead -//| of just printing it. +//| def stack_size() -> Any: +//| """Return the size of the entire stack. +//| Same as in micropython.mem_info(), but returns a value instead +//| of just printing it.""" +//| ... //| STATIC mp_obj_t stack_size(void) { return MP_OBJ_NEW_SMALL_INT(shared_module_ustack_stack_size()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(stack_size_obj, stack_size); -//| .. function:: stack_usage() -//| -//| Return how much stack is currently in use. -//| Same as micropython.stack_use(); duplicated here for convenience. +//| def stack_usage() -> Any: +//| """Return how much stack is currently in use. +//| Same as micropython.stack_use(); duplicated here for convenience.""" +//| ... //| STATIC mp_obj_t stack_usage(void) { return MP_OBJ_NEW_SMALL_INT(shared_module_ustack_stack_usage()); diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index e230deeccc..5c8e8d3fd2 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -35,7 +35,7 @@ #include "shared-module/network/__init__.h" -//| :mod:`wiznet` --- Support for WizNet hardware +//| """:mod:`wiznet` --- Support for WizNet hardware //| ============================================= //| //| .. module:: wiznet @@ -49,7 +49,7 @@ //| .. toctree:: //| :maxdepth: 3 //| -//| wiznet5k +//| wiznet5k""" //| extern const mod_network_nic_type_t mod_network_nic_type_wiznet5k; diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 786978bfe8..2e2ee39496 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -46,25 +46,26 @@ #include "shared-module/network/__init__.h" #include "shared-module/wiznet/wiznet5k.h" -//| .. currentmodule:: wiznet +//| class WIZNET5K: +//| """.. currentmodule:: wiznet //| -//| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface -//| =============================================================== +//| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface +//| ===============================================================""" //| -//| .. class:: WIZNET5K(spi, cs, rst, dhcp=True) +//| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True): +//| """Create a new WIZNET5500 interface using the specified pins //| -//| Create a new WIZNET5500 interface using the specified pins +//| :param ~busio.SPI spi: spi bus to use +//| :param ~microcontroller.Pin cs: pin to use for Chip Select +//| :param ~microcontroller.Pin rst: pin to use for Reset (optional) +//| :param bool dhcp: boolean flag, whether to start DHCP automatically (optional, keyword only, default True) //| -//| :param ~busio.SPI spi: spi bus to use -//| :param ~microcontroller.Pin cs: pin to use for Chip Select -//| :param ~microcontroller.Pin rst: pin to use for Reset (optional) -//| :param bool dhcp: boolean flag, whether to start DHCP automatically (optional, keyword only, default True) -//| -//| * The reset pin is optional: if supplied it is used to reset the -//| wiznet board before initialization. -//| * The SPI bus will be initialized appropriately by this library. -//| * At present, the WIZNET5K object is a singleton, so only one WizNet -//| interface is supported at a time. +//| * The reset pin is optional: if supplied it is used to reset the +//| wiznet board before initialization. +//| * The SPI bus will be initialized appropriately by this library. +//| * At present, the WIZNET5K object is a singleton, so only one WizNet +//| interface is supported at a time.""" +//| ... //| STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -86,9 +87,8 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons return ret; } -//| .. attribute:: connected -//| -//| (boolean, readonly) is this device physically connected? +//| connected: Any = ... +//| """(boolean, readonly) is this device physically connected?""" //| STATIC mp_obj_t wiznet5k_connected_get_value(mp_obj_t self_in) { @@ -104,11 +104,10 @@ const mp_obj_property_t wiznet5k_connected_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. attribute:: dhcp +//| dhcp: Any = ... +//| """(boolean, readwrite) is DHCP active on this device? //| -//| (boolean, readwrite) is DHCP active on this device? -//| -//| * set to True to activate DHCP, False to turn it off +//| * set to True to activate DHCP, False to turn it off""" //| STATIC mp_obj_t wiznet5k_dhcp_get_value(mp_obj_t self_in) { @@ -138,13 +137,13 @@ const mp_obj_property_t wiznet5k_dhcp_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: ifconfig(params=None) +//| def ifconfig(self, params: Any = None) -> Any: +//| """Called without parameters, returns a tuple of +//| (ip_address, subnet_mask, gateway_address, dns_server) //| -//| Called without parameters, returns a tuple of -//| (ip_address, subnet_mask, gateway_address, dns_server) -//| -//| Or can be called with the same tuple to set those parameters. -//| Setting ifconfig parameters turns DHCP off, if it was on. +//| Or can be called with the same tuple to set those parameters. +//| Setting ifconfig parameters turns DHCP off, if it was on.""" +//| ... //| STATIC mp_obj_t wiznet5k_ifconfig(size_t n_args, const mp_obj_t *args) { From 5af59cbabebca75f156acd995f23591361726321 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 12 May 2020 11:46:04 -0700 Subject: [PATCH 467/919] Enable vectorio by default where displayio is enabled --- py/circuitpy_mpconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 687ef72635..046d91caa8 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -94,7 +94,7 @@ CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) CIRCUITPY_FRAMEBUFFERIO ?= 0 CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) -CIRCUITPY_VECTORIO ?= $(CIRCUITPY_FULL_BUILD) +CIRCUITPY_VECTORIO ?= $(CIRCUITPY_DISPLAYIO) CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) From 6aa9709d98c578bf9de342117137ef6595251960 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 12 May 2020 11:47:19 -0700 Subject: [PATCH 468/919] make Circle return explicit --- shared-module/vectorio/Circle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index e6e3268e7e..999d625121 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -28,7 +28,8 @@ uint32_t common_hal_vectorio_circle_get_pixel(void *obj, int16_t x, int16_t y) { if (x+y <= radius) return 1; if (x > radius) return 0; if (y > radius) return 0; - return (int32_t)x*x + (int32_t)y*y <= (int32_t)radius*radius; + const bool pythagorasSmallerThanRadius = (int32_t)x*x + (int32_t)y*y <= (int32_t)radius*radius; + return pythagorasSmallerThanRadius ? 1 : 0; } From fd94c08cf45d1b0669c276ba61bbad1b501ee13f Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 12 May 2020 11:49:15 -0700 Subject: [PATCH 469/919] add performance measurement to VectorShape --- shared-module/vectorio/VectorShape.c | 32 +++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index f57739047a..4fb353aae7 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -5,6 +5,7 @@ #include "shared-bindings/vectorio/VectorShape.h" #include "py/runtime.h" +#include "shared-bindings/time/__init__.h" #include "shared-bindings/displayio/ColorConverter.h" #include "shared-bindings/displayio/Palette.h" @@ -17,6 +18,10 @@ // #define VECTORIO_SHAPE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// Used in both logging and ifdefs, for extra variables +// #define VECTORIO_PERF(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + + // Really verbose. #define VECTORIO_SHAPE_PIXEL_DEBUG(...) (void)0 // #define VECTORIO_SHAPE_PIXEL_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) @@ -167,6 +172,10 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ // To make it relative to the VectorShape position, we must shift it. // Pixels are drawn on the screen_area (shifted) coordinate space, while pixels are _determined_ from // the shape_area (unshifted) space. +#ifdef VECTORIO_PERF + uint64_t start = common_hal_time_monotonic_ns(); + uint64_t pixel_time = 0; +#endif displayio_area_t overlap; VECTORIO_SHAPE_DEBUG("%p fill_area dirty:%d fill: {(%5d,%5d), (%5d,%5d)} dirty: {(%5d,%5d), (%5d,%5d)}", self, self->dirty, @@ -186,7 +195,8 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ uint32_t linestride_px = displayio_area_width(area); uint32_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; uint32_t column_dirty_offset_px = overlap.x1 - area->x1; - VECTORIO_SHAPE_DEBUG(", linestride:%3d line_offset:%3d col_offset:%3d depth:%2d ppb:%2d\n", linestride_px, line_dirty_offset_px, column_dirty_offset_px, colorspace->depth, pixels_per_byte); + VECTORIO_SHAPE_DEBUG(", linestride:%3d line_offset:%3d col_offset:%3d depth:%2d ppb:%2d shape:%s", + linestride_px, line_dirty_offset_px, column_dirty_offset_px, colorspace->depth, pixels_per_byte, mp_obj_get_type_str(self->ishape.shape)); displayio_input_pixel_t input_pixel; displayio_output_pixel_t output_pixel; @@ -217,7 +227,14 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ pixel_to_get_y = (input_pixel.y - self->absolute_transform->dy * self->y) / self->absolute_transform->dy; } VECTORIO_SHAPE_PIXEL_DEBUG(" get_pixel %p (%3d, %3d) -> ( %3d, %3d )", self->ishape.shape, input_pixel.x, input_pixel.y, pixel_to_get_x, pixel_to_get_y); +#ifdef VECTORIO_PERF + uint64_t pre_pixel = common_hal_time_monotonic_ns(); +#endif input_pixel.pixel = self->ishape.get_pixel(self->ishape.shape, pixel_to_get_x, pixel_to_get_y); +#ifdef VECTORIO_PERF + uint64_t post_pixel = common_hal_time_monotonic_ns(); + pixel_time += post_pixel - pre_pixel; +#endif VECTORIO_SHAPE_PIXEL_DEBUG(" -> %d", input_pixel.pixel); output_pixel.opaque = true; @@ -259,6 +276,19 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ } mask_start_px += linestride_px - column_dirty_offset_px; } +#ifdef VECTORIO_PERF + uint64_t end = common_hal_time_monotonic_ns(); + uint32_t pixels = (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1); + VECTORIO_PERF("draw %16s -> shape:{%4dpx, %4.1fms,%9.1fpps fill} shape_pixels:{%6.1fus total, %4.1fus/px}\n", + mp_obj_get_type_str(self->ishape.shape), + (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1), + (double)((end - start) / 1000000.0), + (double)(max(1, pixels * (1000000000.0 / (end - start)))), + (double)(pixel_time / 1000.0), + (double)(pixel_time / 1000.0 / pixels) + ); +#endif + VECTORIO_SHAPE_DEBUG(" -> pixels:%4d\n"); return full_coverage; } From 5a80f5e606fe893a6ccd78cb8ebf7f39055e2e43 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 12 May 2020 15:23:00 -0700 Subject: [PATCH 470/919] nerf vectorio on a ton of m0 and overcommitted m4 boards due to translation text size --- ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk | 1 + .../atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk | 2 ++ .../circuitplayground_express_displayio/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk | 1 + .../atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk | 2 ++ .../boards/feather_radiofruit_zigbee/mpconfigboard.mk | 4 ++++ ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 1 + ports/atmel-samd/boards/snekboard/mpconfigboard.mk | 1 + ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk | 1 + .../boards/sparkfun_redboard_turbo/mpconfigboard.mk | 1 + ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk | 1 + 14 files changed, 21 insertions(+) diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk index 1537540424..5a47a5890d 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 3587f1a33b..19e5dd2ab9 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 + diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index d65dc993f7..4220aa77ff 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -17,6 +17,8 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 +# So not all of displayio, sorry! +CIRCUITPY_VECTORIO = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index cdee7b7946..199cef362a 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index cb13adb76d..a94dd3c4e7 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -14,6 +14,8 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 +# supersized, not ultra-supersized +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index 05c305b1a2..3aa7c5721a 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -15,3 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 # No DAC on SAMR21G CIRCUITPY_AUDIOIO = 0 + +# Too much flash for Korean translations +CIRCUITPY_VECTORIO = 0 + diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 875d23f9b7..d848363a0c 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -19,6 +19,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 55 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 4d516c75b6..812c208ccb 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -17,6 +17,8 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_RTC = 0 +# too itsy bitsy for all of displayio +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index b52b1343fb..588e50ee1b 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index f5b6ca3899..87f92ae9ec 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -34,6 +34,7 @@ CIRCUITPY_NETWORK = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_VECTORIO = 0 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index 4faa041b1b..08f8d431ea 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 6a2afc306e..3f75d175c8 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -13,5 +13,6 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_VECTORIO = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index f2d4eccad9..7a9b44e4c9 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 20feabd189..c4b1f6d5af 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_RTC = 0 +CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 From 4e8de3c554024d3ac89e9ee77b958a6932a64bec Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 17:15:28 -0700 Subject: [PATCH 471/919] Swap sphinx to autoapi and the inline stubs --- .github/workflows/build.yml | 2 +- .gitignore | 2 + Makefile | 6 +- conf.py | 14 +++- docs/c2rst.py | 31 --------- ports/atmel-samd/README.rst | 2 +- ports/atmel-samd/bindings/samd/Clock.c | 36 ++++------- ports/atmel-samd/bindings/samd/__init__.c | 19 +----- setup.py | 8 +-- shared-bindings/_bleio/Adapter.c | 5 +- shared-bindings/_bleio/Address.c | 9 +-- shared-bindings/_bleio/Attribute.c | 6 +- shared-bindings/_bleio/Characteristic.c | 9 +-- shared-bindings/_bleio/CharacteristicBuffer.c | 7 +- shared-bindings/_bleio/Connection.c | 14 ++-- shared-bindings/_bleio/Descriptor.c | 6 +- shared-bindings/_bleio/PacketBuffer.c | 26 +++----- shared-bindings/_bleio/ScanEntry.c | 9 +-- shared-bindings/_bleio/ScanResults.c | 7 +- shared-bindings/_bleio/Service.c | 7 +- shared-bindings/_bleio/UUID.c | 9 +-- shared-bindings/_bleio/__init__.c | 26 +------- shared-bindings/_eve/__init__.c | 22 +------ shared-bindings/_pew/PewPew.c | 7 +- shared-bindings/_pew/__init__.c | 12 +--- shared-bindings/_pixelbuf/PixelBuf.c | 7 +- shared-bindings/_pixelbuf/__init__.c | 27 ++------ shared-bindings/_stage/Layer.c | 5 +- shared-bindings/_stage/Text.c | 7 +- shared-bindings/_stage/__init__.c | 16 +---- shared-bindings/aesio/__init__.c | 17 +---- shared-bindings/aesio/aes.c | 64 +++++++++---------- shared-bindings/analogio/AnalogIn.c | 5 +- shared-bindings/analogio/AnalogOut.c | 7 +- shared-bindings/analogio/__init__.c | 15 +---- shared-bindings/audiobusio/I2SOut.c | 7 +- shared-bindings/audiobusio/PDMIn.c | 7 +- shared-bindings/audiobusio/__init__.c | 15 +---- shared-bindings/audiocore/RawSample.c | 13 +--- shared-bindings/audiocore/WaveFile.c | 5 +- shared-bindings/audiocore/__init__.c | 17 +---- shared-bindings/audioio/AudioOut.c | 7 +- shared-bindings/audioio/__init__.c | 14 +--- shared-bindings/audiomixer/Mixer.c | 7 +- shared-bindings/audiomixer/MixerVoice.c | 5 +- shared-bindings/audiomixer/__init__.c | 16 +---- shared-bindings/audiomp3/MP3Decoder.c | 7 +- shared-bindings/audiomp3/__init__.c | 15 +---- shared-bindings/audiopwmio/PWMAudioOut.c | 7 +- shared-bindings/audiopwmio/__init__.c | 14 +--- shared-bindings/bitbangio/I2C.c | 5 +- shared-bindings/bitbangio/OneWire.c | 5 +- shared-bindings/bitbangio/SPI.c | 5 +- shared-bindings/bitbangio/__init__.c | 16 +---- shared-bindings/board/__init__.c | 6 +- shared-bindings/busio/I2C.c | 5 +- shared-bindings/busio/OneWire.c | 5 +- shared-bindings/busio/SPI.c | 7 +- shared-bindings/busio/UART.c | 5 +- shared-bindings/busio/__init__.c | 17 +---- shared-bindings/digitalio/DigitalInOut.c | 5 +- shared-bindings/digitalio/Direction.c | 5 +- shared-bindings/digitalio/DriveMode.c | 5 +- shared-bindings/digitalio/Pull.c | 5 +- shared-bindings/digitalio/__init__.c | 17 +---- shared-bindings/displayio/Bitmap.c | 7 +- shared-bindings/displayio/ColorConverter.c | 7 +- shared-bindings/displayio/Display.c | 5 +- shared-bindings/displayio/EPaperDisplay.c | 5 +- shared-bindings/displayio/FourWire.c | 7 +- shared-bindings/displayio/Group.c | 7 +- shared-bindings/displayio/I2CDisplay.c | 7 +- shared-bindings/displayio/OnDiskBitmap.c | 7 +- shared-bindings/displayio/Palette.c | 7 +- shared-bindings/displayio/ParallelBus.c | 7 +- shared-bindings/displayio/Shape.c | 7 +- shared-bindings/displayio/TileGrid.c | 5 +- shared-bindings/displayio/__init__.c | 27 +------- shared-bindings/fontio/BuiltinFont.c | 7 +- shared-bindings/fontio/Glyph.c | 31 +++++---- shared-bindings/fontio/__init__.c | 17 +---- .../framebufferio/FramebufferDisplay.c | 5 +- shared-bindings/framebufferio/__init__.c | 16 +---- shared-bindings/frequencyio/FrequencyIn.c | 5 +- shared-bindings/frequencyio/__init__.c | 17 +---- shared-bindings/gamepad/GamePad.c | 7 +- shared-bindings/gamepad/__init__.c | 12 +--- shared-bindings/gamepadshift/GamePadShift.c | 5 +- shared-bindings/gamepadshift/__init__.c | 12 +--- shared-bindings/help.c | 34 ---------- shared-bindings/help.rst | 31 +++++++++ shared-bindings/i2cslave/I2CSlave.c | 36 +++++------ shared-bindings/i2cslave/__init__.c | 14 +--- shared-bindings/index.rst | 10 ++- shared-bindings/math/__init__.c | 7 +- shared-bindings/microcontroller/Pin.c | 7 +- shared-bindings/microcontroller/Processor.c | 11 +--- shared-bindings/microcontroller/RunMode.c | 5 +- shared-bindings/microcontroller/__init__.c | 20 +----- shared-bindings/multiterminal/__init__.c | 7 +- shared-bindings/neopixel_write/__init__.c | 13 ++-- shared-bindings/network/__init__.c | 7 +- shared-bindings/nvm/ByteArray.c | 8 +-- shared-bindings/nvm/__init__.c | 17 +---- shared-bindings/os/__init__.c | 7 +- shared-bindings/ps2io/Ps2.c | 5 +- shared-bindings/ps2io/__init__.c | 14 +--- shared-bindings/pulseio/PWMOut.c | 7 +- shared-bindings/pulseio/PulseIn.c | 12 +--- shared-bindings/pulseio/PulseOut.c | 13 ++-- shared-bindings/pulseio/__init__.c | 16 +---- shared-bindings/random/__init__.c | 7 +- shared-bindings/rgbmatrix/RGBMatrix.c | 14 ++-- shared-bindings/rgbmatrix/__init__.c | 11 +--- shared-bindings/rotaryio/IncrementalEncoder.c | 7 +- shared-bindings/rotaryio/__init__.c | 18 +----- shared-bindings/rtc/RTC.c | 13 +--- shared-bindings/rtc/__init__.c | 16 +---- shared-bindings/socket/__init__.c | 8 +-- shared-bindings/storage/__init__.c | 7 +- shared-bindings/struct/__init__.c | 9 +-- shared-bindings/supervisor/Runtime.c | 11 +--- shared-bindings/supervisor/__init__.c | 30 +++------ shared-bindings/terminalio/Terminal.c | 5 +- shared-bindings/terminalio/__init__.c | 16 +---- shared-bindings/time/__init__.c | 7 +- shared-bindings/touchio/TouchIn.c | 5 +- shared-bindings/touchio/__init__.c | 14 +--- shared-bindings/uheap/__init__.c | 6 +- .../ulab/{__init__.rst => __init__.pyi} | 0 shared-bindings/usb_hid/Device.c | 5 +- shared-bindings/usb_hid/__init__.c | 15 +---- shared-bindings/usb_midi/PortIn.c | 7 +- shared-bindings/usb_midi/PortOut.c | 5 +- shared-bindings/usb_midi/__init__.c | 17 +---- shared-bindings/ustack/__init__.c | 10 +-- shared-bindings/wiznet/__init__.c | 16 +---- shared-bindings/wiznet/wiznet5k.c | 5 +- tools/extract_pyi.py | 12 +++- 139 files changed, 337 insertions(+), 1239 deletions(-) delete mode 100644 docs/c2rst.py delete mode 100644 shared-bindings/help.c create mode 100644 shared-bindings/help.rst rename shared-bindings/ulab/{__init__.rst => __init__.pyi} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dda76db4e..057395eeef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml - name: Versions run: | gcc --version diff --git a/.gitignore b/.gitignore index 435ed73a78..403fcc2997 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ ############ dist/ *.egg-info +.eggs # Logs and Databases ###################### @@ -51,6 +52,7 @@ _build # Generated rst files ###################### genrst/ +autoapi/ # ctags and similar ################### diff --git a/Makefile b/Makefile index aa8fc26d1f..1971076a38 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ clean: rm -rf $(BUILDDIR)/* rm -rf $(STUBDIR) $(DISTDIR) *.egg-info -html: +html: stubs $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @@ -213,8 +213,10 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po) $(PYTHON) tools/check_translations.py $^ stubs: + mkdir -p circuitpython-stubs python tools/extract_pyi.py shared-bindings/ $(STUBDIR) - #python setup.py sdist + python tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) + python setup.py sdist update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." diff --git a/conf.py b/conf.py index 2e503737c9..aea84dd21d 100644 --- a/conf.py +++ b/conf.py @@ -55,7 +55,6 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.coverage', 'rstjinja', - 'c2rst', 'recommonmark', ] @@ -66,9 +65,17 @@ templates_path = ['templates'] source_suffix = { '.rst': 'restructuredtext', '.md': 'markdown', - '.c': '' } +extensions.append('autoapi.extension') + +autoapi_type = 'python' +# Uncomment this if debugging autoapi +# autoapi_keep_files = True +autoapi_dirs = ['circuitpython-stubs'] +autoapi_add_toctree_entry = False +autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] +autoapi_template_dir = 'docs/autoapi/templates' # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -78,7 +85,7 @@ source_suffix = { # General information about the project. project = 'Adafruit CircuitPython' -copyright = '2014-2018, MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)' +copyright = '2014-2020, MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)' # These are overwritten on ReadTheDocs. # The version info for the project you're documenting, acts as replacement for @@ -105,6 +112,7 @@ exclude_patterns = ["**/build*", ".git", ".venv", ".direnv", + "docs/autoapi", "docs/README.md", "drivers", "examples", diff --git a/docs/c2rst.py b/docs/c2rst.py deleted file mode 100644 index 76489dca30..0000000000 --- a/docs/c2rst.py +++ /dev/null @@ -1,31 +0,0 @@ -def c2rst(app, docname, source): - """ Pre-parse '.c' & '.h' files that contain rST source. - """ - # Make sure we're outputting HTML - if app.builder.format != 'html': - return - - fname = app.env.doc2path(docname) - if (not fname.endswith(".c") and - not fname.endswith(".h")): - #print("skipping:", fname) - return - - src = source[0] - - stripped = [] - for line in src.split("\n"): - line = line.strip() - if line == "//|": - stripped.append("") - elif line.startswith("//| "): - stripped.append(line[len("//| "):]) - stripped = "\r\n".join(stripped) - - rendered = app.builder.templates.render_string( - stripped, app.config.html_context - ) - source[0] = rendered - -def setup(app): - app.connect("source-read", c2rst) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index 7211772750..a6881902e9 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -21,4 +21,4 @@ Port Specific modules --------------------- .. toctree:: - bindings/samd/__init__ + ../../autoapi/samd/index diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index b88bb82e22..24e425e8cb 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -30,18 +30,12 @@ #include "py/objproperty.h" #include "py/runtime.h" -//| .. currentmodule:: samd +//| import typing +//| class Clock: +//| """Identifies a clock on the microcontroller. //| -//| :class:`Clock` --- Clock reference -//| ------------------------------------------ -//| -//| Identifies a clock on the microcontroller. -//| -//| .. class:: Clock -//| -//| Identifies a clock on the microcontroller. They are fixed by the -//| hardware so they cannot be constructed on demand. Instead, use -//| `samd.clock` to reference the desired clock. +//| They are fixed by the hardware so they cannot be constructed on demand. Instead, use +//| ``samd.clock`` to reference the desired clock.""" //| STATIC void samd_clock_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { @@ -50,9 +44,8 @@ STATIC void samd_clock_print(const mp_print_t *print, mp_obj_t self_in, mp_print mp_printf(print, "%q.%q.%q", MP_QSTR_samd, MP_QSTR_clock, self->name); } -//| .. attribute:: enabled -//| -//| Is the clock enabled? (read-only) +//| enabled: bool = ... +//| """Is the clock enabled? (read-only)""" //| STATIC mp_obj_t samd_clock_get_enabled(mp_obj_t self_in) { samd_clock_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -69,9 +62,8 @@ const mp_obj_property_t samd_clock_enabled_obj = { }, }; -//| .. attribute:: parent -//| -//| Clock parent. (read-only) +//| parent: typing.Union(Clock | None) = ... +//| """Clock parent. (read-only)""" //| STATIC mp_obj_t samd_clock_get_parent(mp_obj_t self_in) { samd_clock_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -98,9 +90,8 @@ const mp_obj_property_t samd_clock_parent_obj = { }, }; -//| .. attribute:: frequency -//| -//| Clock frequency. (read-only) +//| frequency: int = ... +//| """Clock frequency in Herz. (read-only)""" //| STATIC mp_obj_t samd_clock_get_frequency(mp_obj_t self_in) { samd_clock_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -117,9 +108,8 @@ const mp_obj_property_t samd_clock_frequency_obj = { }, }; -//| .. attribute:: calibration -//| -//| Clock calibration. Not all clocks can be calibrated. +//| calibration: int = ... +//| """Clock calibration. Not all clocks can be calibrated.""" //| STATIC mp_obj_t samd_clock_get_calibration(mp_obj_t self_in) { samd_clock_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/atmel-samd/bindings/samd/__init__.c b/ports/atmel-samd/bindings/samd/__init__.c index 55a10001d2..6e9b68ccc6 100644 --- a/ports/atmel-samd/bindings/samd/__init__.c +++ b/ports/atmel-samd/bindings/samd/__init__.c @@ -30,29 +30,16 @@ #include "bindings/samd/Clock.h" -//| :mod:`samd` --- SAMD implementation settings -//| ================================================= -//| -//| .. module:: samd -//| :synopsis: SAMD implementation settings -//| :platform: SAMD21 -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Clock -//| +//| """SAMD implementation settings""" -//| :mod:`samd.clock` --- samd clock names +//| """:mod:`samd.clock` --- samd clock names //| -------------------------------------------------------- //| //| .. module:: samd.clock //| :synopsis: samd clock names //| :platform: SAMD21 //| -//| References to clocks as named by the microcontroller +//| References to clocks as named by the microcontroller""" //| const mp_obj_module_t samd_clock_module = { .base = { &mp_type_module }, diff --git a/setup.py b/setup.py index 1e0d81da36..37afb6f1b1 100644 --- a/setup.py +++ b/setup.py @@ -5,18 +5,16 @@ from pathlib import Path stub_root = Path("circuitpython-stubs") stubs = [p.relative_to(stub_root).as_posix() for p in stub_root.glob("*.pyi")] -now = datetime.utcnow() -version = now.strftime("%Y.%m.%d") - setup( name="circuitpython-stubs", description="PEP 561 type stubs for CircuitPython", url="https://github.com/adafruit/circuitpython", maintainer="CircuitPythonistas", author_email="circuitpython@adafruit.com", - version=version, + use_scm_version=True, license="MIT", package_data={"circuitpython-stubs": stubs}, packages=["circuitpython-stubs"], - setup_requires=["setuptools>=38.6.0"], + setup_requires=["setuptools>=38.6.0", + "setuptools_scm"], ) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 6fb5c323d7..4816294f7f 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -48,10 +48,7 @@ #define WINDOW_DEFAULT (0.1f) //| class Adapter: -//| """.. currentmodule:: _bleio -//| -//| :class:`Adapter` --- BLE adapter -//| ---------------------------------------------------- +//| """BLE adapter //| //| The Adapter manages the discovery and connection to other nearby Bluetooth Low Energy devices. //| This part of the Bluetooth Low Energy Specification is known as Generic Access Profile (GAP). diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 2071bd3b24..ccbab1b9d2 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -35,12 +35,7 @@ #include "shared-module/_bleio/Address.h" //| class Address: -//| """.. currentmodule:: _bleio -//| -//| :class:`Address` -- BLE address -//| ========================================================= -//| -//| Encapsulates the address of a BLE device.""" +//| """Encapsulates the address of a BLE device.""" //| //| def __init__(self, address: buf, address_type: Any): @@ -97,7 +92,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, //| >>> _bleio.adapter.address //|
//| >>> _bleio.adapter.address.address_bytes -//| b'5\xa8\xed\xf5\x1d\xc8'""" +//| b'5\\xa8\\xed\\xf5\\x1d\\xc8'""" //| STATIC mp_obj_t bleio_address_get_address_bytes(mp_obj_t self_in) { bleio_address_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/Attribute.c b/shared-bindings/_bleio/Attribute.c index 72fd13d1cc..6c47c87ba8 100644 --- a/shared-bindings/_bleio/Attribute.c +++ b/shared-bindings/_bleio/Attribute.c @@ -30,12 +30,8 @@ #include "shared-bindings/_bleio/UUID.h" //| class Attribute: -//| """.. currentmodule:: _bleio +//| """Definitions associated with all BLE attributes: characteristics, descriptors, etc. //| -//| :class:`Attribute` -- BLE Attribute -//| ========================================================= -//| -//| Definitions associated with all BLE attributes: characteristics, descriptors, etc. //| :py:class:`~_bleio.Attribute` is, notionally, a superclass of //| :py:class:`~Characteristic` and :py:class:`~Descriptor`, //| but is not defined as a Python superclass of those classes.""" diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index f8f18d0bd6..785b677d67 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -34,13 +34,8 @@ #include "shared-bindings/_bleio/UUID.h" //| class Characteristic: -//| """.. currentmodule:: _bleio -//| -//| :class:`Characteristic` -- BLE service characteristic -//| ========================================================= -//| -//| Stores information about a BLE service characteristic and allows reading -//| and writing of the characteristic's value.""" +//| """Stores information about a BLE service characteristic and allows reading +//| and writing of the characteristic's value.""" //| //| def __init__(self, ): //| """There is no regular constructor for a Characteristic. A new local Characteristic can be created diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index f38f650d91..6cbd587c64 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -42,12 +42,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self } //| class CharacteristicBuffer: -//| """.. currentmodule:: _bleio -//| -//| :class:`CharacteristicBuffer` -- BLE Service incoming values buffer. -//| ===================================================================== -//| -//| Accumulates a Characteristic's incoming values in a FIFO buffer.""" +//| """Accumulates a Characteristic's incoming values in a FIFO buffer.""" //| //| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64): //| diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 93600e76d9..0a96d8a111 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -43,12 +43,7 @@ #include "shared-bindings/_bleio/Service.h" //| class Connection: -//| """.. currentmodule:: _bleio -//| -//| :class:`Connection` -- A BLE connection -//| ========================================================= -//| -//| A BLE connection to another device. Used to discover and interact with services on the other +//| """A BLE connection to another device. Used to discover and interact with services on the other //| device. //| //| Usage:: @@ -211,15 +206,14 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); -//| .. attribute:: max_packet_length -//| -//| The maximum number of data bytes that can be sent in a single transmission, +//| attribute: Any = ... +//| """The maximum number of data bytes that can be sent in a single transmission, //| not including overhead bytes. //| //| This is the maximum number of bytes that can be sent in a notification, //| which must be sent in a single packet. //| But for a regular characteristic read or write, may be sent in multiple packets, -//| so this limit does not apply. +//| so this limit does not apply.""" //| STATIC mp_obj_t bleio_connection_get_max_packet_length(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 00b3bacf51..9d70208494 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -34,12 +34,8 @@ #include "shared-bindings/_bleio/UUID.h" //| class Descriptor: -//| """.. currentmodule:: _bleio +//| """Stores information about a BLE descriptor. //| -//| :class:`Descriptor` -- BLE descriptor -//| ========================================================= -//| -//| Stores information about a BLE descriptor. //| Descriptors are attached to BLE characteristics and provide contextual //| information about the characteristic.""" //| diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index 80beadb158..907bfabd27 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -36,12 +36,7 @@ #include "shared-bindings/util.h" //| class PacketBuffer: -//| """.. currentmodule:: _bleio -//| -//| :class:`PacketBuffer` -- Packet-oriented characteristic usage. -//| ===================================================================== -//| -//| Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware +//| """Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware //| outgoing writes. A packet's size is either the characteristic length or the maximum transmission //| unit (MTU) minus overhead, whichever is smaller. The MTU can change so check `incoming_packet_length` //| and `outgoing_packet_length` before creating a buffer to store data. @@ -60,7 +55,7 @@ //| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic //| in a remote Service that a Central has connected to. //| :param int buffer_size: Size of ring buffer (in packets of the Characteristic's maximum -//| length) that stores incoming packets coming from the peer. +//| length) that stores incoming packets coming from the peer.""" //| ... //| STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -126,11 +121,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_ //| """Writes all bytes from data into the same outgoing packet. The bytes from header are included //| before data when the pending packet is currently empty. //| -//| This does not block until the data is sent. It only blocks until the data is pending.""" -//| ... +//| This does not block until the data is sent. It only blocks until the data is pending. //| -//| :return: number of bytes written. May include header bytes when packet is empty. -//| :rtype: int +//| :return: number of bytes written. May include header bytes when packet is empty. +//| :rtype: int""" +//| ... //| // TODO: Add a kwarg `merge=False` to dictate whether subsequent writes are merged into a pending // one. @@ -174,7 +169,7 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_ } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write); -//| def deinit(self, ) -> Any: +//| def deinit(self) -> Any: //| """Disable permanently.""" //| ... STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { @@ -184,7 +179,7 @@ STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_buffer_deinit); -//| packet_size: Any = ... +//| packet_size: int = ... //| """`packet_size` is the same as `incoming_packet_length`. //| The name `packet_size` is deprecated and //| will be removed in CircuitPython 6.0.0.""" @@ -210,9 +205,8 @@ const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. attribute:: outgoing_packet_length -//| -//| Maximum length in bytes of a packet we are writing. +//| outgoing_packet_length: int = ... +//| """Maximum length in bytes of a packet we are writing.""" //| STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) { bleio_packet_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index a92b247be3..905bea81d2 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -36,12 +36,7 @@ #include "shared-module/_bleio/ScanEntry.h" //| class ScanEntry: -//| """.. currentmodule:: _bleio -//| -//| :class:`ScanEntry` -- BLE scan data -//| ========================================================= -//| -//| Encapsulates information about a device that was received during scanning. It can be +//| """Encapsulates information about a device that was received during scanning. It can be //| advertisement or scan response data. This object may only be created by a `_bleio.ScanResults`: //| it has no user-visible constructor.""" //| @@ -68,7 +63,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - + mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_prefixes].u_obj, &bufinfo, MP_BUFFER_READ); return mp_obj_new_bool(common_hal_bleio_scanentry_matches(self, bufinfo.buf, bufinfo.len, args[ARG_all].u_bool)); diff --git a/shared-bindings/_bleio/ScanResults.c b/shared-bindings/_bleio/ScanResults.c index 4b274fc682..6077dcbdae 100644 --- a/shared-bindings/_bleio/ScanResults.c +++ b/shared-bindings/_bleio/ScanResults.c @@ -33,12 +33,7 @@ #include "shared-bindings/_bleio/ScanResults.h" //| class ScanResults: -//| """.. currentmodule:: _bleio -//| -//| :class:`ScanResults` -- An Iterator over BLE scanning results -//| =============================================================== -//| -//| Iterates over advertising data received while scanning. This object is always created +//| """Iterates over advertising data received while scanning. This object is always created //| by a `_bleio.Adapter`: it has no user-visible constructor.""" //| STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) { diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 3526ce1899..5ca7504f27 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -33,12 +33,7 @@ #include "shared-bindings/_bleio/UUID.h" //| class Service: -//| """.. currentmodule:: _bleio -//| -//| :class:`Service` -- BLE GATT Service -//| ========================================================= -//| -//| Stores information about a BLE service and its characteristics.""" +//| """Stores information about a BLE service and its characteristics.""" //| //| def __init__(self, uuid: UUID, *, secondary: bool = False): //| """Create a new Service identified by the specified UUID. It can be accessed by all diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index d4b0f84cad..78161b9566 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -34,12 +34,7 @@ #include "shared-bindings/_bleio/UUID.h" //| class UUID: -//| """.. currentmodule:: _bleio -//| -//| :class:`UUID` -- BLE UUID -//| ========================================================= -//| -//| A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" +//| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more.""" //| //| def __init__(self, value: Any): //| """Create a new UUID or UUID object encapsulating the uuid value. @@ -207,7 +202,7 @@ STATIC mp_obj_t bleio_uuid_pack_into(mp_uint_t n_args, const mp_obj_t *pos_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - + mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index da7bfdd816..90b185f79a 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -41,13 +41,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -//| """:mod:`_bleio` --- Bluetooth Low Energy (BLE) communication -//| ================================================================ -//| -//| .. module:: _bleio -//| :synopsis: Bluetooth Low Energy functionality -//| :platform: nRF -//| +//| """ //| The `_bleio` module provides necessary low-level functionality for communicating //| using Bluetooth Low Energy (BLE). The '_' prefix indicates this module is meant //| for internal use by libraries but not by the end user. Its API may change incompatibly @@ -58,24 +52,6 @@ //| provides higher-level convenience functionality, including predefined beacons, clients, //| servers. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Address -//| Adapter -//| Attribute -//| Characteristic -//| CharacteristicBuffer -//| Connection -//| Descriptor -//| PacketBuffer -//| ScanEntry -//| ScanResults -//| Service -//| UUID -//| //| .. attribute:: adapter //| //| BLE Adapter used to manage device discovery and connections. diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 0e78cea160..4fa48f2c75 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -34,28 +34,10 @@ #include "shared-module/_eve/__init__.h" #include "shared-bindings/_eve/__init__.h" - - - - - - - - - - - - - -//| """:mod:`_eve` --- low-level BridgeTek EVE bindings -//| ================================================ -//| -//| .. module:: _eve -//| :synopsis: low-level BridgeTek EVE bindings -//| :platform: SAMD21/SAMD51 +//| """Low-level BridgeTek EVE bindings //| //| The `_eve` module provides a class _EVE which -//| contains methods for constructing EVE command +//| contains methods for constructing EVE command //| buffers and appending basic graphics commands.""" //| diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 37188d2b74..82bf04a617 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -35,12 +35,7 @@ #include "supervisor/shared/translate.h" //| class PewPew: -//| """.. currentmodule:: _pew -//| -//| :class:`PewPew` -- LED matrix and button driver -//| =============================================== -//| -//| This is an internal module to be used by the ``pew.py`` library from +//| """This is an internal module to be used by the ``pew.py`` library from //| https://github.com/pewpew-game/pew-pewpew-standalone-10.x to handle the //| LED matrix display and buttons on the ``pewpew10`` board. //| diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index b6aab67264..6e0070d8e2 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -41,17 +41,7 @@ STATIC mp_obj_t get_pressed(void) { STATIC MP_DEFINE_CONST_FUN_OBJ_0(get_pressed_obj, get_pressed); -//| """:mod:`_pew` --- LED matrix driver -//| ================================== -//| -//| .. module:: _pew -//| :synopsis: LED matrix driver -//| :platform: SAMD21 -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| PewPew""" +//| """LED matrix driver""" //| STATIC const mp_rom_map_elem_t pew_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pew) }, diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 2d1f4fff2f..71a91d7076 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -45,12 +45,7 @@ extern const int32_t colorwheel(float pos); static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t* parsed); //| class PixelBuf: -//| """.. currentmodule:: _pixelbuf -//| -//| :class:`PixelBuf` -- A fast RGB[W] pixel buffer for LED and similar devices -//| =========================================================================== -//| -//| :class:`~_pixelbuf.PixelBuf` implements an RGB[W] bytearray abstraction.""" +//| """A fast RGB[W] pixel buffer for LED and similar devices.""" //| //| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b""): //| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel. diff --git a/shared-bindings/_pixelbuf/__init__.c b/shared-bindings/_pixelbuf/__init__.c index 30656f1c78..bfd479fde0 100644 --- a/shared-bindings/_pixelbuf/__init__.c +++ b/shared-bindings/_pixelbuf/__init__.c @@ -33,35 +33,22 @@ #include "shared-bindings/_pixelbuf/PixelBuf.h" -//| """:mod:`_pixelbuf` --- Fast RGB(W) pixel buffer and helpers -//| =========================================================== - -//| .. module:: _pixelbuf -//| :synopsis: A fast RGB(W) pixel buffer library for like NeoPixel and DotStar. +//| """A fast RGB(W) pixel buffer library for like NeoPixel and DotStar. //| //| The `_pixelbuf` module provides the :py:class:`PixelBuf` class to accelerate //| RGB(W) strip/matrix manipulation, such as DotStar and Neopixel. //| -//| Byteorders are configured with strings, such as "RGB" or "RGBD". -//| TODO: Pull in docs from pypixelbuf. +//| Byteorders are configured with strings, such as "RGB" or "RGBD".""" +// TODO: Pull in docs from pypixelbuf. -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| PixelBuf""" - -//| def colorwheel(n: Any) -> Any: ... -//| - -//| def wheel(n: Any) -> Any: +//| def colorwheel(n: int) -> Any: //| """C implementation of the common wheel() function found in many examples. //| Returns the colorwheel RGB value as an integer value for n (usable in :py:class:`PixelBuf`, neopixel, and dotstar).""" //| ... //| -//| .. function:: wheel(n) -//| Use of wheel() is deprecated. Please use colorwheel(). +//| def wheel(n: Any) -> Any: +//| """Use of wheel() is deprecated. Please use colorwheel().""" +//| STATIC mp_obj_t pixelbuf_colorwheel(mp_obj_t n) { return MP_OBJ_NEW_SMALL_INT(colorwheel(MP_OBJ_IS_SMALL_INT(n) ? MP_OBJ_SMALL_INT_VALUE(n) : mp_obj_float_get(n))); diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index 437114cd31..0f8260e53f 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -31,10 +31,7 @@ #include "supervisor/shared/translate.h" //| class Layer: -//| """.. currentmodule:: _stage -//| -//| :class:`Layer` -- Keep information about a single layer of graphics -//| ===================================================================""" +//| """Keep information about a single layer of graphics""" //| //| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray): //| """Keep internal information about a layer of graphics (either a diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index 8797f74dbe..b0ff1525c3 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -31,13 +31,10 @@ #include "supervisor/shared/translate.h" //| class Text: -//| """.. currentmodule:: _stage -//| -//| :class:`Text` -- Keep information about a single text of text -//| ==============================================================""" +//| """Keep information about a single grid of text""" //| //| def __init__(self, width: int, height: int, font: bytearray, palette: bytearray, chars: bytearray): -//| """Keep internal information about a text of text +//| """Keep internal information about a grid of text //| in a format suitable for fast rendering //| with the ``render()`` function. //| diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 6b5c4fd8b1..6a56381856 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -34,22 +34,10 @@ #include "Layer.h" #include "Text.h" -//| """:mod:`_stage` --- C-level helpers for animation of sprites on a stage -//| ===================================================================== -//| -//| .. module:: _stage -//| :synopsis: C-level helpers for animation of sprites on a stage -//| :platform: SAMD21 +//| """C-level helpers for animation of sprites on a stage //| //| The `_stage` module contains native code to speed-up the ```stage`` Library -//| `_. -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Layer -//| Text""" +//| `_.""" //| //| def render(x0: int, y0: int, x1: int, y1: int, layers: list, buffer: bytearray, display: displayio.Display, scale: int, background: int) -> Any: //| """Render and send to the display a fragment of the screen. diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c index 43dc73e8b1..fa2a2c426e 100644 --- a/shared-bindings/aesio/__init__.c +++ b/shared-bindings/aesio/__init__.c @@ -31,23 +31,10 @@ #include "__init__.h" -//| :mod:`aesio` --- AES encryption routines -//| ======================================== -//| -//| .. module:: aesio -//| :synopsis: Embedded implementation of AES +//| """AES encryption routines //| //| The `AES` module contains classes used to implement encryption -//| and decryption. It aims to be low overhead in terms of memory. -//| -//| - -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| aes +//| and decryption. It aims to be low overhead in terms of memory.""" STATIC const mp_obj_tuple_t mp_aes_key_size_obj = { diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 4ddcfa898b..7a559b0bbe 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -9,35 +9,31 @@ // Defined at the end of this file -//| .. currentmodule:: aesio +//| class AES: +//| """Encrypt and decrypt AES streams""" //| -//| :class:`aesio` -- Encrypt and decrypt AES streams -//| ===================================================== +//| def __init__(self, key, mode=0, iv=None, segment_size=8) -> Any: +//| """Create a new AES state with the given key. //| -//| An object that represents an AES stream, including the current state. +//| :param bytearray key: A 16-, 24-, or 32-byte key +//| :param int mode: AES mode to use. One of: AES.MODE_ECB, AES.MODE_CBC, or +//| AES.MODE_CTR +//| :param bytearray iv: Initialization vector to use for CBC or CTR mode //| -//| .. class:: AES(key, mode=0, iv=None, segment_size=8) +//| Additional arguments are supported for legacy reasons. //| -//| Create a new AES state with the given key. +//| Encrypting a string:: //| -//| :param bytearray key: A 16-, 24-, or 32-byte key -//| :param int mode: AES mode to use. One of: AES.MODE_ECB, AES.MODE_CBC, or -//| AES.MODE_CTR -//| :param bytearray iv: Initialization vector to use for CBC or CTR mode +//| import aesio +//| from binascii import hexlify //| -//| Additional arguments are supported for legacy reasons. -//| -//| Encrypting a string:: -//| -//| import aesio -//| from binascii import hexlify -//| -//| key = b'Sixteen byte key' -//| inp = b'Circuit Python!!' # Note: 16-bytes long -//| outp = bytearray(len(inp)) -//| cipher = aesio.AES(key, aesio.mode.MODE_ECB) -//| cipher.encrypt_into(inp, outp) -//| hexlify(outp) +//| key = b'Sixteen byte key' +//| inp = b'Circuit Python!!' # Note: 16-bytes long +//| outp = bytearray(len(inp)) +//| cipher = aesio.AES(key, aesio.mode.MODE_ECB) +//| cipher.encrypt_into(inp, outp) +//| hexlify(outp)""" +//| ... //| STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, @@ -154,12 +150,13 @@ STATIC void validate_length(aesio_aes_obj_t *self, size_t src_length, } } -//| .. method:: encrypt_into(src, dest) +//| def encrypt_into(src, dest) -> None: +//| """Encrypt the buffer from ``src`` into ``dest``. //| -//| Encrypt the buffer from ``src`` into ``dest``. -//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the -//| buffers must be a multiple of 16 bytes, and must be equal length. For -//| CTX mode, there are no restrictions. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions.""" +//| ... //| STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, mp_obj_t dest) { @@ -184,12 +181,13 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, STATIC MP_DEFINE_CONST_FUN_OBJ_3(aesio_aes_encrypt_into_obj, aesio_aes_encrypt_into); -//| .. method:: decrypt_into(src, dest) +//| def decrypt_into(src, dest) -> None: //| -//| Decrypt the buffer from ``src`` into ``dest``. -//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the -//| buffers must be a multiple of 16 bytes, and must be equal length. For -//| CTX mode, there are no restrictions. +//| """Decrypt the buffer from ``src`` into ``dest``. +//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the +//| buffers must be a multiple of 16 bytes, and must be equal length. For +//| CTX mode, there are no restrictions.""" +//| ... //| STATIC mp_obj_t aesio_aes_decrypt_into(mp_obj_t aesio_obj, mp_obj_t src, mp_obj_t dest) { diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 2fb5051ebe..bafa287ff1 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -37,10 +37,7 @@ #include "shared-bindings/util.h" //| class AnalogIn: -//| """.. currentmodule:: analogio -//| -//| :class:`AnalogIn` -- read analog voltage -//| ============================================ +//| """Read analog voltage levels //| //| Usage:: //| diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index 9064bb5dce..a8edcc0ae1 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class AnalogOut: -//| """.. currentmodule:: analogio -//| -//| :class:`AnalogOut` -- output analog voltage -//| ============================================ -//| -//| The AnalogOut is used to output analog values (a specific voltage). +//| """Output analog values (a specific voltage). //| //| Example usage:: //| diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 79627f16aa..1f059f3402 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -34,25 +34,12 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogOut.h" -//| """:mod:`analogio` --- Analog hardware support -//| ================================================= -//| -//| .. module:: analogio -//| :synopsis: Analog hardware support -//| :platform: SAMD21, ESP8266 +//| """Analog hardware support //| //| The `analogio` module contains classes to provide access to analog IO //| typically implemented with digital-to-analog (DAC) and analog-to-digital //| (ADC) converters. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| AnalogIn -//| AnalogOut -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 724a65a347..d965aac89e 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -36,12 +36,7 @@ #include "supervisor/shared/translate.h" //| class I2SOut: -//| """.. currentmodule:: audiobusio -//| -//| :class:`I2SOut` -- Output an I2S audio signal -//| ======================================================== -//| -//| I2S is used to output an audio signal on an I2S bus.""" +//| """Output an I2S audio signal""" //| //| def __init__(self, bit_clock: microcontroller.Pin, word_select: microcontroller.Pin, data: microcontroller.Pin, *, left_justified: bool): //| """Create a I2SOut object associated with the given pins. diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 6cc834724b..5b950297b5 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class PDMIn: -//| """.. currentmodule:: audiobusio -//| -//| :class:`PDMIn` -- Record an input PDM audio stream -//| ======================================================== -//| -//| PDMIn can be used to record an input audio signal on a given set of pins.""" +//| """Record an input PDM audio stream""" //| //| def __init__(self, clock_pin: microcontroller.Pin, data_pin: microcontroller.Pin, *, sample_rate: int = 16000, bit_depth: int = 8, mono: bool = True, oversample: int = 64, startup_delay: float = 0.11): //| """Create a PDMIn object associated with the given pins. This allows you to diff --git a/shared-bindings/audiobusio/__init__.c b/shared-bindings/audiobusio/__init__.c index c5c3873619..89ccbb88b5 100644 --- a/shared-bindings/audiobusio/__init__.c +++ b/shared-bindings/audiobusio/__init__.c @@ -34,26 +34,13 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiobusio/PDMIn.h" -//| """:mod:`audiobusio` --- Support for audio input and output over digital bus -//| ========================================================================= -//| -//| .. module:: audiobusio -//| :synopsis: Support for audio input and output over digital bus -//| :platform: SAMD21 +//| """Support for audio input and output over digital buses //| //| The `audiobusio` module contains classes to provide access to audio IO //| over digital buses. These protocols are used to communicate audio to other //| chips in the same circuit. It doesn't include audio interconnect protocols //| such as S/PDIF. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| I2SOut -//| PDMIn -//| //| All libraries change hardware state and should be deinitialized when they //| are no longer needed. To do so, either call :py:meth:`!deinit` or use a //| context manager.""" diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 6091fbfc00..c0f9325e67 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -35,19 +35,8 @@ #include "shared-bindings/audiocore/RawSample.h" #include "supervisor/shared/translate.h" - - - - - - //| class RawSample: -//| """.. currentmodule:: audiocore -//| -//| :class:`RawSample` -- A raw audio sample buffer -//| ======================================================== -//| -//| An in-memory sound sample""" +//| """A raw audio sample buffer in memory""" //| //| def __init__(self, buffer: array.array, *, channel_count: int = 1, sample_rate: int = 8000): //| """Create a RawSample based on the given buffer of signed values. If channel_count is more than diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 65b42fb6c4..a067f6cda8 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -34,10 +34,7 @@ #include "supervisor/shared/translate.h" //| class WaveFile: -//| """.. currentmodule:: audiocore -//| -//| :class:`WaveFile` -- Load a wave file for audio playback -//| ======================================================== +//| """Load a wave file for audio playback //| //| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating diff --git a/shared-bindings/audiocore/__init__.c b/shared-bindings/audiocore/__init__.c index 38f91d8eeb..b400b94548 100644 --- a/shared-bindings/audiocore/__init__.c +++ b/shared-bindings/audiocore/__init__.c @@ -35,22 +35,7 @@ #include "shared-bindings/audiocore/WaveFile.h" //#include "shared-bindings/audiomixer/Mixer.h" -//| """:mod:`audiocore` --- Support for audio samples and mixer -//| ======================================================== -//| -//| .. module:: audiocore -//| :synopsis: Support for audio samples and mixer -//| :platform: SAMD21 -//| -//| The `audiocore` module contains core classes for audio IO -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| RawSample -//| WaveFile""" +//| """Support for audio samples""" //| STATIC const mp_rom_map_elem_t audiocore_module_globals_table[] = { diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 84e5e44227..5748682020 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class AudioOut: -//| """.. currentmodule:: audioio -//| -//| :class:`AudioOut` -- Output an analog audio signal -//| ======================================================== -//| -//| AudioOut can be used to output an analog audio signal on a given pin.""" +//| """Output an analog audio signal""" //| //| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): //| """Create a AudioOut object associated with the given pin(s). This allows you to diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index bc2e26cfce..7ec927834f 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -42,22 +42,10 @@ #include "shared-bindings/audiomixer/Mixer.h" #endif -//| """:mod:`audioio` --- Support for audio input and output -//| ====================================================== -//| -//| .. module:: audioio -//| :synopsis: Support for audio input and output -//| :platform: SAMD21 +//| """Support for audio output //| //| The `audioio` module contains classes to provide access to audio IO. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| AudioOut -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 966581d454..31e62cdae1 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -39,12 +39,7 @@ #include "supervisor/shared/translate.h" //| class Mixer: -//| """.. currentmodule:: audiomixer -//| -//| :class:`Mixer` -- Mixes one or more audio samples together -//| =========================================================== -//| -//| Mixer mixes multiple samples into one sample.""" +//| """Mixes one or more audio samples together into one sample.""" //| //| def __init__(self, voice_count: int = 2, buffer_size: int = 1024, channel_count: int = 2, bits_per_sample: int = 16, samples_signed: bool = True, sample_rate: int = 8000): //| """Create a Mixer object that can mix multiple channels with the same sample rate. diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 257d9507b9..ec5768d2f0 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -38,10 +38,7 @@ #include "supervisor/shared/translate.h" //| class MixerVoice: -//| """.. currentmodule:: audiomixer -//| -//| :class:`MixerVoice` -- Voice objects used with Mixer -//| ===================================================== +//| """Voice objects used with Mixer //| //| Used to access and control samples with `audiomixer.Mixer`.""" //| diff --git a/shared-bindings/audiomixer/__init__.c b/shared-bindings/audiomixer/__init__.c index c90a4a0e65..1146bb7981 100644 --- a/shared-bindings/audiomixer/__init__.c +++ b/shared-bindings/audiomixer/__init__.c @@ -32,21 +32,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiomixer/Mixer.h" -//| """:mod:`audiomixer` --- Support for audio mixer -//| ======================================================== -//| -//| .. module:: audiomixer -//| :synopsis: Support for audio mixer -//| -//| The `audiomixer` module contains core classes for mixing audio sources -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Mixer -//| MixerVoice""" +//| """Support for audio mixing""" //| STATIC const mp_rom_map_elem_t audiomixer_module_globals_table[] = { diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index d9c85bbf63..e6d48e32cb 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -35,12 +35,7 @@ #include "supervisor/shared/translate.h" //| class MP3: -//| """.. currentmodule:: audiomp3 -//| -//| :class:`MP3Decoder` -- Load a mp3 file for audio playback -//| ========================================================= -//| -//| An object that decodes MP3 files for playback on an audio device.""" +//| """Load a mp3 file for audio playback""" //| //| def __init__(self, file: typing.BinaryIO, buffer: bytearray): //| diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index 50b29da529..62e5f56cbb 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -31,20 +31,7 @@ #include "shared-bindings/audiomp3/MP3Decoder.h" -//| """:mod:`audiomp3` --- Support for MP3-compressed audio files -//| ========================================================== -//| -//| .. module:: audiomp3 -//| :synopsis: Support for mp3 files -//| -//| The `audiomp3` module contains an mp3 decoder -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| MP3Decoder""" +//| """Support for MP3-compressed audio files""" //| STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 17f82e3f64..d6b102317f 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class PWMAudioOut: -//| """.. currentmodule:: audiopwmio -//| -//| :class:`PWMAudioOut` -- Output an analog audio signal -//| ======================================================== -//| -//| AudioOut can be used to output an analog audio signal on a given pin.""" +//| """Output an analog audio signal by varying the PWM duty cycle.""" //| //| def __init__(self, left_channel: microcontroller.Pin, *, right_channel: microcontroller.Pin = None, quiescent_value: int = 0x8000): //| """Create a PWMAudioOut object associated with the given pin(s). This allows you to diff --git a/shared-bindings/audiopwmio/__init__.c b/shared-bindings/audiopwmio/__init__.c index 74d22b45ec..5caea14209 100644 --- a/shared-bindings/audiopwmio/__init__.c +++ b/shared-bindings/audiopwmio/__init__.c @@ -33,22 +33,10 @@ #include "shared-bindings/audiopwmio/__init__.h" #include "shared-bindings/audiopwmio/PWMAudioOut.h" -//| """:mod:`audiopwmio` --- Support for audio input and output -//| ======================================================== -//| -//| .. module:: audiopwmio -//| :synopsis: Support for audio output via digital PWM -//| :platform: NRF52 +//| """Audio output via digital PWM //| //| The `audiopwmio` module contains classes to provide access to audio IO. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| PWMAudioOut -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index a682e050e1..2043fc903f 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -38,10 +38,7 @@ #include "supervisor/shared/translate.h" //| class I2C: -//| """.. currentmodule:: bitbangio -//| -//| :class:`I2C` --- Two wire serial protocol -//| ------------------------------------------""" +//| """Two wire serial protocol""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int): //| """I2C is a two-wire protocol for communicating between devices. At the diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c index 1c9405bd8d..a236f4c2aa 100644 --- a/shared-bindings/bitbangio/OneWire.c +++ b/shared-bindings/bitbangio/OneWire.c @@ -35,10 +35,7 @@ #include "shared-bindings/util.h" //| class OneWire: -//| """.. currentmodule:: bitbangio -//| -//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//| =============================================================== +//| """Lowest-level of the Maxim OneWire protocol //| //| :class:`~bitbangio.OneWire` implements the timing-sensitive foundation of //| the Maxim (formerly Dallas Semi) OneWire protocol. diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 38e0926e8d..08bbf1257f 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -40,10 +40,7 @@ #include "supervisor/shared/translate.h" //| class SPI: -//| """.. currentmodule:: bitbangio -//| -//| :class:`SPI` -- a 3-4 wire serial protocol -//| ----------------------------------------------- +//| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the //| master. It is typically faster than :py:class:`~bitbangio.I2C` because a diff --git a/shared-bindings/bitbangio/__init__.c b/shared-bindings/bitbangio/__init__.c index e9600a7e66..e04bdf7011 100644 --- a/shared-bindings/bitbangio/__init__.c +++ b/shared-bindings/bitbangio/__init__.c @@ -40,12 +40,7 @@ #include "py/runtime.h" -//| """:mod:`bitbangio` --- Digital protocols implemented by the CPU -//| ============================================================= -//| -//| .. module:: bitbangio -//| :synopsis: Digital protocols implemented by the CPU -//| :platform: SAMD21, ESP8266 +//| """Digital protocols implemented by the CPU //| //| The `bitbangio` module contains classes to provide digital bus protocol //| support regardless of whether the underlying hardware exists to use the @@ -55,15 +50,6 @@ //| hardware to implement the protocols. Native implementations will be faster //| than bitbanged versions and have more capabilities. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| I2C -//| OneWire -//| SPI -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 77675e0937..010a9fb92a 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -29,11 +29,7 @@ #include "shared-bindings/board/__init__.h" -//| """:mod:`board` --- Board specific pin names -//| ======================================================== -//| -//| .. module:: board -//| :synopsis: Board specific pin names +//| """Board specific pin names //| //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 8ae3658eee..7e8af765f7 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -37,10 +37,7 @@ #include "supervisor/shared/translate.h" //| class I2C: -//| """.. currentmodule:: busio -//| -//| :class:`I2C` --- Two wire serial protocol -//| ------------------------------------------""" +//| """Two wire serial protocol""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, *, frequency: int = 400000, timeout: int = 255): //| diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/busio/OneWire.c index 556e567efc..723cc031a8 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/busio/OneWire.c @@ -35,10 +35,7 @@ #include "shared-bindings/util.h" //| class OneWire: -//| """.. currentmodule:: busio -//| -//| :class:`OneWire` -- Lowest-level of the Maxim OneWire protocol -//| =================================================================""" +//| """Lowest-level of the Maxim OneWire protocol""" //| //| def __init__(self, pin: microcontroller.Pin): //| """(formerly Dallas Semi) OneWire protocol. diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 5b1881702c..2ba9a4c22c 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -42,10 +42,7 @@ //| class SPI: -//| """.. currentmodule:: busio -//| -//| `SPI` -- a 3-4 wire serial protocol -//| ----------------------------------------------- +//| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the //| master. It is typically faster than :py:class:`~busio.I2C` because a @@ -147,7 +144,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) { //| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any: //| """Configures the SPI bus. The SPI object must be locked. //| -//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower +//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower //| due to the granularity of available clock settings. //| Check the `frequency` attribute for the actual clock rate. //| :param int polarity: the base state of the clock line (0 or 1) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 5984194a9a..d4642225c0 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -43,10 +43,7 @@ // #define STREAM_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) //| class UART: -//| """.. currentmodule:: busio -//| -//| :class:`UART` -- a bidirectional serial protocol -//| =================================================""" +//| """A bidirectional serial protocol""" //| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64): //| """A common bidirectional serial protocol that uses an an agreed upon speed //| rather than a shared clock line. diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 212b3218c1..04632c2f4a 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -38,12 +38,7 @@ #include "py/runtime.h" -//| """:mod:`busio` --- Hardware accelerated behavior -//| ================================================= -//| -//| .. module:: busio -//| :synopsis: Hardware accelerated behavior -//| :platform: SAMD21 +//| """Hardware accelerated external bus access //| //| The `busio` module contains classes to support a variety of serial //| protocols. @@ -54,16 +49,6 @@ //| then a RuntimeError will be raised. Use the `bitbangio` module to explicitly //| bitbang a serial protocol on any general purpose pins. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| I2C -//| OneWire -//| SPI -//| UART -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 5fffb3f653..54ced099db 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -44,10 +44,7 @@ #include "supervisor/shared/translate.h" //| class DigitalInOut: -//| """.. currentmodule:: digitalio -//| -//| :class:`DigitalInOut` -- digital input and output -//| ========================================================= +//| """Digital input and output //| //| A DigitalInOut is used to digitally control I/O pins. For analog control of //| a pin, see the :py:class:`analogio.AnalogIn` and diff --git a/shared-bindings/digitalio/Direction.c b/shared-bindings/digitalio/Direction.c index 0586e95def..dbd0e93e47 100644 --- a/shared-bindings/digitalio/Direction.c +++ b/shared-bindings/digitalio/Direction.c @@ -39,10 +39,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" //| class Direction: -//| """.. currentmodule:: digitalio -//| -//| :class:`Direction` -- defines the direction of a digital pin -//| =============================================================""" +//| """Defines the direction of a digital pin""" //| //| def __init__(self, ): //| """Enum-like class to define which direction the digital values are diff --git a/shared-bindings/digitalio/DriveMode.c b/shared-bindings/digitalio/DriveMode.c index 23745b0469..31b682d388 100644 --- a/shared-bindings/digitalio/DriveMode.c +++ b/shared-bindings/digitalio/DriveMode.c @@ -27,10 +27,7 @@ #include "shared-bindings/digitalio/DriveMode.h" //| class DriveMode: -//| """.. currentmodule:: digitalio -//| -//| :class:`DriveMode` -- defines the drive mode of a digital pin -//| =============================================================""" +//| """Defines the drive mode of a digital pin""" //| //| def __init__(self, ): //| """Enum-like class to define the drive mode used when outputting diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 1e64d07887..9aeec1f331 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -27,10 +27,7 @@ #include "shared-bindings/digitalio/Pull.h" //| class Pull: -//| """.. currentmodule:: digitalio -//| -//| :class:`Pull` -- defines the pull of a digital input pin -//| =============================================================""" +//| """Defines the pull of a digital input pin""" //| //| def __init__(self, ): //| """Enum-like class to define the pull value, if any, used while reading diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index 5a11436a23..f8f45b158b 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -38,25 +38,10 @@ #include "py/runtime.h" -//| """:mod:`digitalio` --- Basic digital pin support -//| ================================================= -//| -//| .. module:: digitalio -//| :synopsis: Basic digital pin support -//| :platform: SAMD21, ESP8266 +//| """Basic digital pin support //| //| The `digitalio` module contains classes to provide access to basic digital IO. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| DigitalInOut -//| Direction -//| DriveMode -//| Pull -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index d15c3b1078..a52840f2e0 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class Bitmap: -//| """.. currentmodule:: displayio -//| -//| :class:`Bitmap` -- Stores values in a 2D array -//| ========================================================================== -//| -//| Stores values of a certain size in a 2D array""" +//| """Stores values of a certain size in a 2D array""" //| //| def __init__(self, width: int, height: int, value_count: int): //| """Create a Bitmap object with the given fixed size. Each pixel stores a value that is used to diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 1d6e5a0cc9..505e9f7665 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class ColorConverter: -//| """.. currentmodule:: displayio -//| -//| :class:`ColorConverter` -- Converts one color format to another -//| ========================================================================================= -//| -//| Converts one color format to another.""" +//| """Converts one color format to another.""" //| //| def __init__(self, *, dither: bool = False): //| """Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565 diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 12abec1c83..62ef0f5d00 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -40,10 +40,7 @@ #include "supervisor/shared/translate.h" //| class Display: -//| """.. currentmodule:: displayio -//| -//| :class:`Display` -- Manage updating a display over a display bus -//| ========================================================================== +//| """Manage updating a display over a display bus //| //| This initializes a display and connects it into CircuitPython. Unlike other //| objects in CircuitPython, Display objects live until `displayio.release_displays()` diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index 8b03ddc067..8b77e4df37 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -40,10 +40,7 @@ #include "supervisor/shared/translate.h" //| class EPaperDisplay: -//| """.. currentmodule:: displayio -//| -//| :class:`EPaperDisplay` -- Manage updating an epaper display over a display bus -//| ============================================================================== +//| """Manage updating an epaper display over a display bus //| //| This initializes an epaper display and connects it into CircuitPython. Unlike other //| objects in CircuitPython, EPaperDisplay objects live until `displayio.release_displays()` diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 649045039e..5ee4ec5a9a 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -39,12 +39,7 @@ #include "supervisor/shared/translate.h" //| class FourWire: -//| """.. currentmodule:: displayio -//| -//| :class:`FourWire` -- Manage updating a display over SPI four wire protocol -//| ========================================================================== -//| -//| Manage updating a display over SPI four wire protocol in the background while Python code runs. +//| """Manage updating a display over SPI four wire protocol in the background while Python code runs. //| It doesn't handle display initialization.""" //| //| def __init__(self, spi_bus: busio.SPI, *, command: microcontroller.Pin, chip_select: microcontroller.Pin, reset: microcontroller.Pin = None, baudrate: int = 24000000, polarity: int = 0, phase: int = 0): diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 36e137dc9b..b6f96883b9 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -36,12 +36,7 @@ #include "supervisor/shared/translate.h" //| class Group: -//| """.. currentmodule:: displayio -//| -//| :class:`Group` -- Group together sprites and subgroups -//| ========================================================================== -//| -//| Manage a group of sprites and groups and how they are inter-related.""" +//| """Manage a group of sprites and groups and how they are inter-related.""" //| //| def __init__(self, *, max_size: int = 4, scale: int = 1, x: int = 0, y: int = 0): //| """Create a Group of a given size and scale. Scale is in one dimension. For example, scale=2 diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index e2402dc49b..0cfac66720 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -39,12 +39,7 @@ #include "supervisor/shared/translate.h" //| class I2CDisplay: -//| """.. currentmodule:: displayio -//| -//| :class:`I2CDisplay` -- Manage updating a display over I2C -//| ========================================================================== -//| -//| Manage updating a display over I2C in the background while Python code runs. +//| """Manage updating a display over I2C in the background while Python code runs. //| It doesn't handle display initialization.""" //| //| def __init__(self, i2c_bus: busio.I2C, *, device_address: int, reset: microcontroller.Pin = None): diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 95c890c3b9..170873653a 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -34,12 +34,7 @@ #include "shared-bindings/displayio/OnDiskBitmap.h" //| class OnDiskBitmap: -//| """.. currentmodule:: displayio -//| -//| :class:`OnDiskBitmap` -- Loads pixels straight from disk -//| ========================================================================== -//| -//| Loads values straight from disk. This minimizes memory use but can lead to +//| """Loads values straight from disk. This minimizes memory use but can lead to //| much slower pixel load times. These load times may result in frame tearing where only part of //| the image is visible. //| diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 5df11d2b10..871b2b06af 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -43,12 +43,7 @@ //| class Palette: -//| """.. currentmodule:: displayio -//| -//| :class:`Palette` -- Stores a mapping from bitmap pixel palette_indexes to display colors -//| ========================================================================================= -//| -//| Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to +//| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to //| save memory.""" //| //| def __init__(self, color_count: int): diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/displayio/ParallelBus.c index cedcf1de52..eb75ecc038 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/displayio/ParallelBus.c @@ -38,12 +38,7 @@ #include "supervisor/shared/translate.h" //| class ParallelBus: -//| """.. currentmodule:: displayio -//| -//| :class:`ParallelBus` -- Manage updating a display over 8-bit parallel bus -//| ============================================================================== -//| -//| Manage updating a display over 8-bit parallel bus in the background while Python code runs. This +//| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This //| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index 0f22bb2a3e..fce89c7716 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -35,12 +35,7 @@ #include "supervisor/shared/translate.h" //| class Shape: -//| """.. currentmodule:: displayio -//| -//| :class:`Shape` -- Represents a shape by defining its bounds on each row -//| ========================================================================== -//| -//| Represents any shape made by defining boundaries that may be mirrored.""" +//| """Represents a shape made by defining boundaries that may be mirrored.""" //| //| def __init__(self, width: int, height: int, *, mirror_x: bool = False, mirror_y: bool = False): //| """Create a Shape object with the given fixed size. Each pixel is one bit and is stored by the diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index e7410e4b67..01fba46a58 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -41,10 +41,7 @@ #include "supervisor/shared/translate.h" //| class TileGrid: -//| """.. currentmodule:: displayio -//| -//| :class:`TileGrid` -- A grid of tiles sourced out of one bitmap -//| ========================================================================== +//| """A grid of tiles sourced out of one bitmap //| //| Position a grid of tiles sourced from a bitmap and pixel_shader combination. Multiple grids //| can share bitmaps and pixel shaders. diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 37c0253292..b791336b56 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -43,33 +43,10 @@ #include "shared-bindings/displayio/Shape.h" #include "shared-bindings/displayio/TileGrid.h" -//| """:mod:`displayio` --- Native display driving -//| ========================================================================= -//| -//| .. module:: displayio -//| :synopsis: Native helpers for driving displays -//| :platform: SAMD21, SAMD51, nRF52 +//| """Native helpers for driving displays //| //| The `displayio` module contains classes to manage display output -//| including synchronizing with refresh rates and partial updating. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Bitmap -//| ColorConverter -//| Display -//| EPaperDisplay -//| FourWire -//| Group -//| I2CDisplay -//| OnDiskBitmap -//| Palette -//| ParallelBus -//| Shape -//| TileGrid""" +//| including synchronizing with refresh rates and partial updating.""" //| diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index f60c9e36c7..bf9a658739 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -37,12 +37,7 @@ #include "supervisor/shared/translate.h" //| class BuiltinFont: -//| """.. currentmodule:: fontio -//| -//| :class:`BuiltinFont` -- A font built into CircuitPython -//| ========================================================================================= -//| -//| A font built into CircuitPython.""" +//| """A font built into CircuitPython""" //| //| def __init__(self, ): //| """Creation not supported. Available fonts are defined when CircuitPython is built. See the diff --git a/shared-bindings/fontio/Glyph.c b/shared-bindings/fontio/Glyph.c index 6235dbc46f..6558e2e7a1 100644 --- a/shared-bindings/fontio/Glyph.c +++ b/shared-bindings/fontio/Glyph.c @@ -29,22 +29,27 @@ #include //| class Glyph: -//| """.. currentmodule:: fontio +//| """Storage of glyph info""" //| -//| :class:`Glyph` -- Storage of glyph info -//| ==========================================================================""" -//| -//| def __init__(self, bitmap: displayio.Bitmap, tile_index: int, width: int, height: int, dx: int, dy: int, shift_x: int, shift_y: int): +//| def __init__(self, +//| bitmap: displayio.Bitmap, +//| tile_index: int, +//| width: int, +//| height: int, +//| dx: int, +//| dy: int, +//| shift_x: int, +//| shift_y: int): //| """Named tuple used to capture a single glyph and its attributes. //| -//| :param displayio.Bitmap bitmap: the bitmap including the glyph -//| :param int tile_index: the tile index within the bitmap -//| :param int width: the width of the glyph's bitmap -//| :param int height: the height of the glyph's bitmap -//| :param int dx: x adjustment to the bitmap's position -//| :param int dy: y adjustment to the bitmap's position -//| :param int shift_x: the x difference to the next glyph -//| :param int shift_y: the y difference to the next glyph""" +//| :param bitmap: the bitmap including the glyph +//| :param tile_index: the tile index within the bitmap +//| :param width: the width of the glyph's bitmap +//| :param height: the height of the glyph's bitmap +//| :param dx: x adjustment to the bitmap's position +//| :param dy: y adjustment to the bitmap's position +//| :param shift_x: the x difference to the next glyph +//| :param shift_y: the y difference to the next glyph""" //| ... //| const mp_obj_namedtuple_type_t fontio_glyph_type = { diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index 478fc18068..f376f35035 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,22 +33,7 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| """:mod:`fontio` --- Core font related data structures -//| ========================================================================= -//| -//| .. module:: fontio -//| :synopsis: Core font related data structures -//| :platform: SAMD21, SAMD51, nRF52 -//| -//| The `fontio` module contains classes to store font related information. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| BuiltinFont -//| Glyph""" +//| """Core font related data structures""" //| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index 5e63b988e3..51ef090599 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -41,10 +41,7 @@ #include "supervisor/shared/translate.h" //| class FramebufferDisplay: -//| """.. currentmodule:: framebufferio -//| -//| :class:`FramebufferDisplay` -- Manage updating a display with framebuffer in RAM -//| ================================================================================ +//| """Manage updating a display with framebuffer in RAM //| //| This initializes a display and connects it into CircuitPython. Unlike other //| objects in CircuitPython, Display objects live until `displayio.release_displays()` diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index 50725c5150..492423464a 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -28,25 +28,13 @@ #include "shared-bindings/framebufferio/__init__.h" #include "shared-bindings/framebufferio/FramebufferDisplay.h" -//| """:mod:`framebufferio` --- Native framebuffer display driving -//| ========================================================================= -//| -//| .. module:: framebufferio -//| :synopsis: Native helpers for driving displays -//| :platform: SAMD51, nRF52 +//| """Native framebuffer display driving //| //| The `framebufferio` module contains classes to manage display output //| including synchronizing with refresh rates and partial updating. //| It is used in conjunction with classes from `displayio` to actually //| place items on the display; and classes like `RGBMatrix` to actually -//| drive the display. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| FramebufferDisplay""" +//| drive the display.""" //| #if CIRCUITPY_FRAMEBUFFERIO diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index 270fa87c31..2d628088b7 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -36,10 +36,7 @@ #include "supervisor/shared/translate.h" //| class FrequencyIn: -//| """.. currentmodule:: frequencyio -//| -//| :class:`FrequencyIn` -- Read a frequency signal -//| ======================================================== +//| """Read a frequency signal //| //| FrequencyIn is used to measure the frequency, in hertz, of a digital signal //| on an incoming pin. Accuracy has shown to be within 10%, if not better. It diff --git a/shared-bindings/frequencyio/__init__.c b/shared-bindings/frequencyio/__init__.c index 219d5f6452..031004d4b4 100644 --- a/shared-bindings/frequencyio/__init__.c +++ b/shared-bindings/frequencyio/__init__.c @@ -33,23 +33,8 @@ #include "shared-bindings/frequencyio/__init__.h" #include "shared-bindings/frequencyio/FrequencyIn.h" -//| """:mod:`frequencyio` --- Support for frequency based protocols -//| ============================================================= +//| """Support for frequency based protocols //| -//| .. module:: frequencyio -//| :synopsis: Support for frequency based protocols -//| :platform: SAMD51 -//| -//| The `frequencyio` module contains classes to provide access to basic frequency IO. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| FrequencyIn -//| - //| .. warning:: This module is not available in SAMD21 builds. See the //| :ref:`module-support-matrix` for more info. //| diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 946a24dbff..a750892fef 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -35,10 +35,7 @@ #include "supervisor/shared/translate.h" //| class GamePad: -//| """.. currentmodule:: gamepad -//| -//| :class:`GamePad` -- Scan buttons for presses -//| ============================================ +//| """Scan buttons for presses //| //| Usage:: //| @@ -90,7 +87,7 @@ //| on delays. //| //| They button presses are accumulated, until the ``get_pressed`` method -//| is called, at which point the button state is cleared, and the new +//| is called, at which point the button state is cleared, and the new //| button presses start to be recorded.""" //| ... //| diff --git a/shared-bindings/gamepad/__init__.c b/shared-bindings/gamepad/__init__.c index 0c32fd6c1c..557777f50b 100644 --- a/shared-bindings/gamepad/__init__.c +++ b/shared-bindings/gamepad/__init__.c @@ -29,17 +29,7 @@ #include "shared-bindings/gamepad/GamePad.h" #include "shared-bindings/util.h" -//| """:mod:`gamepad` --- Button handling -//| ================================== -//| -//| .. module:: gamepad -//| :synopsis: Button handling -//| :platform: SAMD21 -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| GamePad""" +//| """Button handling in the background""" //| STATIC const mp_rom_map_elem_t gamepad_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepad) }, diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 37be3d9576..48b579457d 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -33,10 +33,7 @@ #include "supervisor/shared/translate.h" //| class GamePadShift: -//| """.. currentmodule:: gamepadshift -//| -//| :class:`GamePadShift` -- Scan buttons for presses through a shift register -//| ===========================================================================""" +//| """Scan buttons for presses through a shift register""" //| //| def __init__(self, clock: Any, data: Any, latch: Any): //| """Initializes button scanning routines. diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c index 3763b04877..f171358930 100644 --- a/shared-bindings/gamepadshift/__init__.c +++ b/shared-bindings/gamepadshift/__init__.c @@ -30,17 +30,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" -//| """:mod:`gamepadshift` --- Tracks button presses read through a shift register -//| =========================================================================== -//| -//| .. module:: gamepadshift -//| :synopsis: Tracks button presses read through a shift register -//| :platform: SAMD21, SAMD51 -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| GamePadShift""" +//| """Tracks button presses read through a shift register""" //| STATIC const mp_rom_map_elem_t gamepadshift_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepadshift) }, diff --git a/shared-bindings/help.c b/shared-bindings/help.c deleted file mode 100644 index 4e7c3a78bb..0000000000 --- a/shared-bindings/help.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 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. - */ - -//| :func:`help` - Built-in method to provide helpful information -//| ============================================================== -//| -//| .. function:: help(object=None) -//| -//| Prints a help method about the given object. When ``object`` is none, -//| prints general port information. -//| diff --git a/shared-bindings/help.rst b/shared-bindings/help.rst new file mode 100644 index 0000000000..63991bff2c --- /dev/null +++ b/shared-bindings/help.rst @@ -0,0 +1,31 @@ +# This file is part of the MicroPython project, http://micropython.org/ +# +# The MIT License (MIT) +# +# Copyright (c) 2016 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. + +:func:`help` - Built-in method to provide helpful information +============================================================== + +.. function:: help(object=None) + + Prints a help method about the given object. When ``object`` is none, + prints general port information. diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index 5bab2af74e..80875ce758 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -50,10 +50,7 @@ STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t * } //| class I2CSlave: -//| """.. currentmodule:: i2cslave -//| -//| :class:`I2CSlave` --- Two wire serial protocol slave -//| ----------------------------------------------------""" +//| """Two wire serial protocol slave""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): //| """I2C is a two-wire protocol for communicating between devices. @@ -229,17 +226,15 @@ const mp_obj_type_t i2cslave_i2c_slave_type = { }; //| class I2CSlaveRequest: -//| """:class:`I2CSlaveRequest` --- I2C Slave Request -//| ----------------------------------------------""" //| //| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): //| """I2C transfer request from a master. //| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. //| -//| :param ~i2cslave.I2CSlave slave: The I2C Slave receiving this request -//| :param int address: I2C address -//| :param bool is_read: I2C Master read request -//| :param bool is_restart: Repeated Start Condition""" +//| :param slave: The I2C Slave receiving this request +//| :param address: I2C address +//| :param is_read: I2C Master read request +//| :param is_restart: Repeated Start Condition""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 4, 4, false); @@ -264,7 +259,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_ } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request___exit___obj, 4, 4, i2cslave_i2c_slave_request_obj___exit__); -//| address: Any = ... +//| address: int = ... //| """The I2C address of the request.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { @@ -274,7 +269,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); -//| is_read: Any = ... +//| is_read: bool = ... //| """The I2C master is reading from the device.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { @@ -284,7 +279,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_read_obj, i2cslave_i2c_slave_request_get_is_read); -//| is_restart: Any = ... +//| is_restart: bool = ... //| """Is Repeated Start Condition.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { @@ -294,14 +289,13 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { } MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_restart_obj, i2cslave_i2c_slave_request_get_is_restart); -//| def read(self, n: int = -1, ack: bool = True) -> Any: +//| def read(self, n: int = -1, ack: bool = True) -> bytearray: //| """Read data. //| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. //| -//| :param int n: Number of bytes to read (negative means all) -//| :param bool ack: Whether or not to send an ACK after the n'th byte -//| :return: Bytes read -//| :rtype: bytearray""" +//| :param n: Number of bytes to read (negative means all) +//| :param ack: Whether or not to send an ACK after the n'th byte +//| :return: Bytes read""" //| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -355,10 +349,10 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p } MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_slave_request_read); -//| def write(self, buffer: bytearray) -> Any: +//| def write(self, buffer: bytearray) -> int: //| """Write the data contained in buffer. //| -//| :param bytearray buffer: Write out the data in this buffer +//| :param buffer: Write out the data in this buffer //| :return: Number of bytes written""" //| ... //| @@ -393,7 +387,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cslave_i2c_slave_request_write_obj, i2cslave_ //| """Acknowledge or Not Acknowledge last byte received. //| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. //| -//| :param bool ack: Whether to send an ACK or NACK""" +//| :param ack: Whether to send an ACK or NACK""" //| ... //| STATIC mp_obj_t i2cslave_i2c_slave_request_ack(uint n_args, const mp_obj_t *args) { diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cslave/__init__.c index ffeb216fae..41b42fef83 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cslave/__init__.c @@ -35,22 +35,10 @@ #include "py/runtime.h" -//| """:mod:`i2cslave` --- Two wire serial protocol slave -//| ================================================== -//| -//| .. module:: i2cslave -//| :synopsis: Two wire serial protocol slave -//| :platform: SAMD21, SAMD51 +//| """Two wire serial protocol slave //| //| The `i2cslave` module contains classes to support a I2C slave. //| -//| Classes -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| I2CSlave -//| //| Example emulating 2 devices:: //| //| import board diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index cbffdb6140..d941773943 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -7,13 +7,17 @@ present or if flash space is limited. For example, a microcontroller without analog features will not have `analogio`. See the `support_matrix` page for a list of modules supported on each board. +.. toctree:: + :hidden: + + support_matrix + Modules --------- .. toctree:: :glob: - :maxdepth: 3 + :maxdepth: 2 - support_matrix - */__init__ + ../autoapi/*/index help diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 755bf75897..56155306ff 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -38,12 +38,7 @@ #define MP_PI MICROPY_FLOAT_CONST(3.14159265358979323846) -//| """:mod:`math` --- mathematical functions -//| ======================================================== -//| -//| .. module:: math -//| :synopsis: mathematical functions -//| :platform: SAMD21/SAMD51 +//| """mathematical functions //| //| The `math` module provides some basic mathematical functions for //| working with floating-point numbers.""" diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index cad0d67b1d..765e602e5f 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -34,12 +34,7 @@ #include "supervisor/shared/translate.h" //| class Pin: -//| """.. currentmodule:: microcontroller -//| -//| :class:`Pin` --- Pin reference -//| ------------------------------------------ -//| -//| Identifies an IO pin on the microcontroller.""" +//| """Identifies an IO pin on the microcontroller.""" //| //| def __init__(self, ): //| """Identifies an IO pin on the microcontroller. They are fixed by the diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index dedb5a27c2..c4b2491247 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -35,12 +35,7 @@ #include "py/runtime.h" //| class Processor: -//| """.. currentmodule:: microcontroller -//| -//| :class:`Processor` --- Microcontroller CPU information and control -//| ------------------------------------------------------------------ -//| -//| Get information about the microcontroller CPU and control it. +//| """Microcontroller CPU information and control //| //| Usage:: //| @@ -55,8 +50,8 @@ //| ... //| -//| frequency: Any = ... -//| """The CPU operating frequency as an `int`, in Hertz. (read-only)""" +//| frequency: int = ... +//| """The CPU operating frequency in Hertz. (read-only)""" //| STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency()); diff --git a/shared-bindings/microcontroller/RunMode.c b/shared-bindings/microcontroller/RunMode.c index df3ff41868..6db315d8d9 100644 --- a/shared-bindings/microcontroller/RunMode.c +++ b/shared-bindings/microcontroller/RunMode.c @@ -27,10 +27,7 @@ #include "shared-bindings/microcontroller/RunMode.h" //| class RunMode: -//| """.. currentmodule:: microcontroller -//| -//| :class:`RunMode` -- run state of the microcontroller -//| =============================================================""" +//| """run state of the microcontroller""" //| //| def __init__(self, ): //| """Enum-like class to define the run mode of the microcontroller and diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 75b7639808..21e1c90a92 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -42,27 +42,13 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| """:mod:`microcontroller` --- Pin references and cpu functionality -//| ================================================================ -//| -//| .. module:: microcontroller -//| :synopsis: Pin references and core functionality -//| :platform: SAMD21, ESP8266 +//| """Pin references and cpu functionality //| //| The `microcontroller` module defines the pins from the perspective of the -//| microcontroller. See `board` for board-specific pin mappings. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Pin -//| Processor -//| RunMode""" +//| microcontroller. See `board` for board-specific pin mappings.""" //| -//| cpu: Any = ... +//| cpu: Processor = ... //| """CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency`` //| (clock frequency). //| This object is the sole instance of `microcontroller.Processor`.""" diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index 3a40650191..baf2fb6749 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -30,12 +30,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -//| """:mod:`multiterminal` --- Manage additional terminal sources -//| =========================================================== -//| -//| .. module:: multiterminal -//| :synopsis: Manage additional terminal sources -//| :platform: ESP8266 +//| """Manage additional terminal sources //| //| The `multiterminal` module allows you to configure an additional serial //| terminal source. Incoming characters are accepted from both the internal diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index f18c7fdfd1..5e5bc31eb7 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -31,12 +31,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "supervisor/shared/translate.h" -//| """:mod:`neopixel_write` --- Low-level neopixel implementation -//| =========================================================== -//| -//| .. module:: neopixel_write -//| :synopsis: Low-level neopixel implementation -//| :platform: SAMD21 +//| """Low-level neopixel implementation //| //| The `neopixel_write` module contains a helper method to write out bytes in //| the 800khz neopixel protocol. @@ -55,11 +50,11 @@ //| pixel_off = bytearray([0, 0, 0]) //| neopixel_write.neopixel_write(pin, pixel_off)""" //| -//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> Any: +//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: bytearray) -> None: //| """Write buf out on the given DigitalInOut. //| -//| :param ~digitalio.DigitalInOut digitalinout: the DigitalInOut to output with -//| :param bytearray buf: The bytes to clock out. No assumption is made about color order""" +//| :param digitalinout: the DigitalInOut to output with +//| :param buf: The bytes to clock out. No assumption is made about color order""" //| ... STATIC mp_obj_t neopixel_write_neopixel_write_(mp_obj_t digitalinout_obj, mp_obj_t buf) { if (!MP_OBJ_IS_TYPE(digitalinout_obj, &digitalio_digitalinout_type)) { diff --git a/shared-bindings/network/__init__.c b/shared-bindings/network/__init__.c index 4f03781cf4..6af86688eb 100644 --- a/shared-bindings/network/__init__.c +++ b/shared-bindings/network/__init__.c @@ -38,12 +38,7 @@ #if CIRCUITPY_NETWORK -//| """:mod:`network` --- Network Interface Management -//| =============================================== -//| -//| .. module:: network -//| :synopsis: Network Interface Management -//| :platform: SAMD +//| """Network Interface Management //| //| This module provides a registry of configured NICs. //| It is used by the 'socket' module to look up a suitable diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index a28c2c4f9a..326f719a83 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -31,14 +31,8 @@ #include "shared-bindings/nvm/ByteArray.h" #include "supervisor/shared/translate.h" - - - //| class ByteArray: -//| """.. currentmodule:: nvm -//| -//| :class:`ByteArray` -- Presents a stretch of non-volatile memory as a bytearray. -//| ================================================================================ +//| """Presents a stretch of non-volatile memory as a bytearray. //| //| Non-volatile memory is available as a byte array that persists over reloads //| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c index 3bd9a309b5..51c5bb2789 100644 --- a/shared-bindings/nvm/__init__.c +++ b/shared-bindings/nvm/__init__.c @@ -31,23 +31,10 @@ #include "shared-bindings/nvm/__init__.h" #include "shared-bindings/nvm/ByteArray.h" -//| """:mod:`nvm` --- Non-volatile memory -//| =========================================================== -//| -//| .. module:: nvm -//| :synopsis: Non-volatile memory -//| :platform: SAMD21 +//| """Non-volatile memory //| //| The `nvm` module allows you to store whatever raw bytes you wish in a -//| reserved section non-volatile memory. -//| - -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| ByteArray""" +//| reserved section non-volatile memory.""" //| STATIC const mp_rom_map_elem_t nvm_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_nvm) }, diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 2a6b13c9b0..4e991d089d 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -37,12 +37,7 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" -//| """:mod:`os` --- functions that an OS normally provides -//| ======================================================== -//| -//| .. module:: os -//| :synopsis: functions that an OS normally provides -//| :platform: SAMD21 +//| """functions that an OS normally provides //| //| The `os` module is a strict subset of the CPython `cpython:os` module. So, //| code written in CircuitPython will work in CPython but not necessarily the diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index d327d41801..a87b14ddd7 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -37,10 +37,7 @@ #include "supervisor/shared/translate.h" //| class Ps2: -//| """.. currentmodule:: ps2io -//| -//| :class:`Ps2` -- Communicate with a PS/2 keyboard or mouse -//| ========================================================= +//| """Communicate with a PS/2 keyboard or mouse //| //| Ps2 implements the PS/2 keyboard/mouse serial protocol, used in //| legacy devices. It is similar to UART but there are only two diff --git a/shared-bindings/ps2io/__init__.c b/shared-bindings/ps2io/__init__.c index 081127bac4..38a70b1a27 100644 --- a/shared-bindings/ps2io/__init__.c +++ b/shared-bindings/ps2io/__init__.c @@ -33,22 +33,10 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/ps2io/Ps2.h" -//| """:mod:`ps2io` --- Support for PS/2 protocol -//| ===================================================== -//| -//| .. module:: ps2io -//| :synopsis: Support for PS/2 based devices -//| :platform: SAMD21 +//| """Support for PS/2 protocol //| //| The `ps2io` module contains classes to provide PS/2 communication. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Ps2 -//| //| .. warning:: This module is not available in some SAMD21 builds. See the //| :ref:`module-support-matrix` for more info. diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c index 3a25d69380..7970c02f34 100644 --- a/shared-bindings/pulseio/PWMOut.c +++ b/shared-bindings/pulseio/PWMOut.c @@ -36,12 +36,7 @@ #include "supervisor/shared/translate.h" //| class PWMOut: -//| """.. currentmodule:: pulseio -//| -//| :class:`PWMOut` -- Output a Pulse Width Modulated signal -//| ======================================================== -//| -//| PWMOut can be used to output a PWM signal on a given pin.""" +//| """Output a Pulse Width Modulated signal on a given pin.""" //| //| def __init__(self, pin: microcontroller.Pin, *, duty_cycle: int = 0, frequency: int = 500, variable_frequency: bool = False): //| """Create a PWM object associated with the given pin. This allows you to diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 9024f53e3b..5c52b25822 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -36,15 +36,9 @@ #include "supervisor/shared/translate.h" //| class PulseIn: -//| """.. currentmodule:: pulseio -//| -//| :class:`PulseIn` -- Read a series of pulse durations -//| ======================================================== -//| -//| PulseIn is used to measure a series of active and idle pulses. This is -//| commonly used in infrared receivers and low cost temperature sensors (DHT). -//| The pulsed signal consists of timed active and idle periods. Unlike PWM, -//| there is no set duration for active and idle pairs.""" +//| """Measure a series of active and idle pulses. This is commonly used in infrared receivers +//| and low cost temperature sensors (DHT). The pulsed signal consists of timed active and +//| idle periods. Unlike PWM, there is no set duration for active and idle pairs.""" //| //| def __init__(self, pin: microcontroller.Pin, maxlen: int = 2, *, idle_state: bool = False): //| """Create a PulseIn object associated with the given pin. The object acts as diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 9c650731bb..16b0a6f0cc 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -37,14 +37,9 @@ #include "supervisor/shared/translate.h" //| class PulseOut: -//| """.. currentmodule:: pulseio -//| -//| :class:`PulseOut` -- Output a pulse train -//| ======================================================== -//| -//| PulseOut is used to pulse PWM "carrier" output on and off. This is commonly -//| used in infrared remotes. The pulsed signal consists of timed on and off -//| periods. Unlike PWM, there is no set duration for on and off pairs.""" +//| """Pulse PWM "carrier" output on and off. This is commonly used in infrared remotes. The +//| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration +//| for on and off pairs.""" //| //| def __init__(self, carrier: pulseio.PWMOut): //| """Create a PulseOut object associated with the given PWMout object. @@ -115,7 +110,7 @@ STATIC mp_obj_t pulseio_pulseout_obj___exit__(size_t n_args, const mp_obj_t *arg } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulseout___exit___obj, 4, 4, pulseio_pulseout_obj___exit__); -//| def send(self, pulses: array.array) -> Any: +//| def send(self, pulses: array.array) -> Any: //| """Pulse alternating on and off durations in microseconds starting with on. //| ``pulses`` must be an `array.array` with data type 'H' for unsigned //| halfword (two bytes). diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index 70cb61fc30..87946e5f0b 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -35,24 +35,10 @@ #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pulseio/PWMOut.h" -//| """:mod:`pulseio` --- Support for pulse based protocols -//| ===================================================== -//| -//| .. module:: pulseio -//| :synopsis: Support for pulse based protocols -//| :platform: SAMD21, ESP8266 +//| """Support for pulse based protocols //| //| The `pulseio` module contains classes to provide access to basic pulse IO. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| PulseIn -//| PulseOut -//| PWMOut -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index d8b266be00..c0124df417 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -33,12 +33,7 @@ #include "shared-bindings/random/__init__.h" #include "supervisor/shared/translate.h" -//| """:mod:`random` --- pseudo-random numbers and choices -//| ======================================================== -//| -//| .. module:: random -//| :synopsis: pseudo-random numbers and choices -//| :platform: SAMD21, ESP8266 +//| """pseudo-random numbers and choices //| //| The `random` module is a strict subset of the CPython `cpython:random` //| module. So, code written in CircuitPython will work in CPython but not diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index e2393eb61d..cbf570958a 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -39,10 +39,7 @@ #include "shared-module/framebufferio/FramebufferDisplay.h" //| class RGBMatrix: -//| """.. currentmodule:: rgbmatrix -//| -//| :class:`RGBMatrix` -- Driver for HUB75-style RGB LED matrices -//| ================================================================ +//| """Displays an in-memory framebuffer to a HUB75-style RGB LED matrix.""" //| extern Protomatter_core *_PM_protoPtr; @@ -134,9 +131,6 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_ } } - -//| :class:`~rgbmatrix.RGBMatrix` displays an in-memory framebuffer to an LED matrix.""" -//| //| def __init__(self, *, width: Any, bit_depth: Any, rgb_pins: Any, addr_pins: Any, clock_pin: Any, latch_pin: Any, output_enable_pin: Any, doublebuffer: Any = True, framebuffer: Any = None, height: Any = 0): //| """Create a RGBMatrix object with the given attributes. The height of //| the display is determined by the number of rgb and address pins: @@ -297,7 +291,7 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| def refresh(self, ) -> Any: ... +//| def refresh(self) -> Any: ... //| """Transmits the color data in the buffer to the pixels so that //| they are shown.""" //| @@ -309,7 +303,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_refresh(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_refresh_obj, rgbmatrix_rgbmatrix_refresh); -//| width: Any = ... +//| width: int = ... //| """The width of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_width(mp_obj_t self_in) { @@ -325,7 +319,7 @@ const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| height: Any = ... +//| height: int = ... //| """The height of the display, in pixels""" //| STATIC mp_obj_t rgbmatrix_rgbmatrix_get_height(mp_obj_t self_in) { diff --git a/shared-bindings/rgbmatrix/__init__.c b/shared-bindings/rgbmatrix/__init__.c index f61002a780..7f0576652a 100644 --- a/shared-bindings/rgbmatrix/__init__.c +++ b/shared-bindings/rgbmatrix/__init__.c @@ -31,16 +31,7 @@ #include "shared-bindings/rgbmatrix/RGBMatrix.h" -//| """:mod:`rgbmatrix` --- Low-level routines for bitbanged LED matrices -//| ===================================================================== -//| -//| .. module:: rgbmatrix -//| :synopsis: Low-level routines for bitbanged LED matrices -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| RGBMatrix""" +//| """Low-level routines for bitbanged LED matrices""" //| STATIC const mp_rom_map_elem_t rgbmatrix_module_globals_table[] = { diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index a10fb6fd5f..8b27238668 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -35,12 +35,7 @@ #include "shared-bindings/util.h" //| class IncrementalEncoder: -//| """.. currentmodule:: rotaryio -//| -//| :class:`IncrementalEncoder` -- Track the relative position of an incremental encoder -//| ==================================================================================== -//| -//| IncrementalEncoder determines the relative rotational position based on two series of pulses.""" +//| """IncrementalEncoder determines the relative rotational position based on two series of pulses.""" //| //| def __init__(self, pin_a: microcontroller.Pin, pin_b: microcontroller.Pin): //| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional diff --git a/shared-bindings/rotaryio/__init__.c b/shared-bindings/rotaryio/__init__.c index 0cc8eb5560..0fa457ca73 100644 --- a/shared-bindings/rotaryio/__init__.c +++ b/shared-bindings/rotaryio/__init__.c @@ -33,27 +33,13 @@ #include "shared-bindings/rotaryio/__init__.h" #include "shared-bindings/rotaryio/IncrementalEncoder.h" -//| """:mod:`rotaryio` --- Support for reading rotation sensors -//| ======================================================== -//| -//| .. module:: rotaryio -//| :synopsis: Support for reading rotation sensors -//| :platform: SAMD +//| """Support for reading rotation sensors //| //| The `rotaryio` module contains classes to read different rotation encoding schemes. See //| `Wikipedia's Rotary Encoder page `_ for more //| background. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| IncrementalEncoder -//| -//| .. warning:: This module is not available in some SAMD21 (aka M0) builds. See the -//| :ref:`module-support-matrix` for more info. +//| .. warning:: This module is not available in some SAMD21 (aka M0) builds. See the :ref:`module-support-matrix` for more info. //| //| All classes change hardware state and should be deinitialized when they diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index 663f5be6cb..58fe308f53 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -38,15 +38,8 @@ const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; - - - - //| class RTC: -//| """.. currentmodule:: rtc -//| -//| :class:`RTC` --- Real Time Clock -//| --------------------------------""" +//| """Real Time Clock""" //| //| def __init__(self, ): //| """This class represents the onboard Real Time Clock. It is a singleton and will always return the same instance.""" @@ -60,7 +53,7 @@ STATIC mp_obj_t rtc_rtc_make_new(const mp_obj_type_t *type, size_t n_args, const return (mp_obj_t)&rtc_rtc_obj; } -//| datetime: Any = ... +//| datetime: time.struct_time = ... //| """The current date and time of the RTC as a `time.struct_time`. //| //| This must be set to the current date and time whenever the board loses power:: @@ -101,7 +94,7 @@ const mp_obj_property_t rtc_rtc_datetime_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| calibration: Any = ... +//| calibration: int = ... //| """The RTC calibration value as an `int`. //| //| A positive value speeds up the clock and a negative value slows it down. diff --git a/shared-bindings/rtc/__init__.c b/shared-bindings/rtc/__init__.c index 66669ca5fe..b204d511c9 100644 --- a/shared-bindings/rtc/__init__.c +++ b/shared-bindings/rtc/__init__.c @@ -31,23 +31,11 @@ #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" -//| """:mod:`rtc` --- Real Time Clock -//| ======================================================== -//| -//| .. module:: rtc -//| :synopsis: Real Time Clock -//| :platform: SAMD21, SAMD51, nRF52 +//| """Real Time Clock //| //| The `rtc` module provides support for a Real Time Clock. You can access and manage the //| RTC using :class:`rtc.RTC`. It also backs the :func:`time.time` and :func:`time.localtime` -//| functions using the onboard RTC if present. -//| -//| Classes -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| RTC""" +//| functions using the onboard RTC if present.""" //| void rtc_reset(void) { diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 4c0811bdb6..19c4850cde 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -37,12 +37,7 @@ #include "shared-module/network/__init__.h" -//| """:mod:`socket` --- TCP, UDP and RAW socket support -//| ================================================= -//| -//| .. module:: socket -//| :synopsis: TCP, UDP and RAW sockets -//| :platform: SAMD21, SAMD51 +//| """TCP, UDP and RAW socket support //| //| Create TCP, UDP and RAW sockets for communicating over the Internet.""" //| @@ -50,7 +45,6 @@ STATIC const mp_obj_type_t socket_type; //| class socket: -//| """.. currentmodule:: socket""" //| //| def __init__(self, family: int, type: int, proto: int): //| """Create a new socket diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index feb1a9bd76..8ac08d8c9b 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -35,12 +35,7 @@ #include "shared-bindings/storage/__init__.h" #include "supervisor/shared/translate.h" -//| """:mod:`storage` --- storage management -//| ======================================================== -//| -//| .. module:: storage -//| :synopsis: storage management -//| :platform: SAMD21, SAMD51 +//| """Storage management //| //| The `storage` provides storage management functionality such as mounting and //| unmounting which is typically handled by the operating system hosting Python. diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 3772f93a76..256b385c8e 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -38,12 +38,7 @@ #include "shared-module/struct/__init__.h" #include "supervisor/shared/translate.h" -//| """:mod:`struct` --- manipulation of c-style data -//| ======================================================== -//| -//| .. module:: struct -//| :synopsis: byte data control -//| :platform: SAMD21 +//| """Manipulation of c-style data //| //| This module implements a subset of the corresponding CPython module, //| as described below. For more information, refer to the original CPython @@ -56,7 +51,7 @@ //| -//| def calcsize(fmt: Any) -> Any: +//| def calcsize(fmt: str) -> int: //| """Return the number of bytes needed to store the given fmt.""" //| ... //| diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 05921899ce..a420d5b805 100755 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -30,12 +30,7 @@ //TODO: add USB, REPL to description once they're operational //| class Runtime: -//| """.. currentmodule:: supervisor -//| -//| :class:`Runtime` --- Supervisor Runtime information -//| ---------------------------------------------------- -//| -//| Get current status of runtime objects. +//| """Current status of runtime objects. //| //| Usage:: //| @@ -50,7 +45,7 @@ //| ... //| -//| runtime.serial_connected: Any = ... +//| serial_connected: bool = ... //| """Returns the USB serial communication status (read-only). //| //| .. note:: @@ -78,7 +73,7 @@ const mp_obj_property_t supervisor_serial_connected_obj = { }; -//| runtime.serial_bytes_available: Any = ... +//| serial_bytes_available: int = ... //| """Returns the whether any bytes are available to read //| on the USB serial input. Allows for polling to see whether //| to call the built-in input() or wait. (read-only)""" diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 7fe6668f48..1830308b7d 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -36,30 +36,16 @@ #include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/supervisor/Runtime.h" -//| """:mod:`supervisor` --- Supervisor settings -//| ================================================= -//| -//| .. module:: supervisor -//| :synopsis: Supervisor settings -//| :platform: SAMD21/51 (All), nRF (Runtime only) -//| -//| The `supervisor` module. (TODO: expand description) -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Runtime""" +//| """Supervisor settings""" //| -//| runtime: Any = ... -//| """Runtime information, such as `runtime.serial_connected` +//| runtime: Runtime = ... +//| """Runtime information, such as ``runtime.serial_connected`` //| (USB serial connection status). //| This object is the sole instance of `supervisor.Runtime`.""" //| -//| def enable_autoreload(self, ) -> Any: +//| def enable_autoreload(self) -> None: //| """Enable autoreload based on USB file write activity.""" //| ... //| @@ -69,7 +55,7 @@ STATIC mp_obj_t supervisor_enable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_enable_autoreload_obj, supervisor_enable_autoreload); -//| def disable_autoreload(self, ) -> Any: +//| def disable_autoreload(self) -> None: //| """Disable autoreload based on USB file write activity until //| `enable_autoreload` is called.""" //| ... @@ -80,7 +66,7 @@ STATIC mp_obj_t supervisor_disable_autoreload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_disable_autoreload_obj, supervisor_disable_autoreload); -//| def set_rgb_status_brightness(self, ) -> Any: +//| def set_rgb_status_brightness(self, brightness: int) -> None: //| """Set brightness of status neopixel from 0-255 //| `set_rgb_status_brightness` is called.""" //| ... @@ -96,7 +82,7 @@ STATIC mp_obj_t supervisor_set_rgb_status_brightness(mp_obj_t lvl){ } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_set_rgb_status_brightness_obj, supervisor_set_rgb_status_brightness); -//| def reload(self, ) -> Any: +//| def reload(self) -> None: //| """Reload the main Python code and run it (equivalent to hitting Ctrl-D at the REPL).""" //| ... //| @@ -107,7 +93,7 @@ STATIC mp_obj_t supervisor_reload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); -//| def set_next_stack_limit(self, size: Any) -> Any: +//| def set_next_stack_limit(self, size: int) -> None: //| """Set the size of the stack for the next vm run. If its too large, the default will be used.""" //| ... //| diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index 1288b70182..5c045fdee2 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -38,10 +38,7 @@ #include "supervisor/shared/translate.h" //| class Terminal: -//| """.. currentmodule:: terminalio -//| -//| :class:`Terminal` -- display a character stream with a TileGrid -//| ================================================================""" +//| """Display a character stream with a TileGrid""" //| //| def __init__(self, tilegrid: Any, font: Any): //| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 591be839ad..5892111395 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -35,22 +35,10 @@ #include "py/runtime.h" -//| """:mod:`terminalio` --- Displays text in a TileGrid -//| ================================================= -//| -//| .. module:: terminalio -//| :synopsis: Displays text in a TileGrid +//| """Displays text in a TileGrid //| //| The `terminalio` module contains classes to display a character stream on a display. The built -//| in font is available as ``terminalio.FONT``. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Terminal""" -//| +//| in font is available as ``terminalio.FONT``.""" //| STATIC const mp_rom_map_elem_t terminalio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_terminalio) }, diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 36eaa27f63..20277d6b07 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -36,12 +36,7 @@ #include "shared-bindings/time/__init__.h" #include "supervisor/shared/translate.h" -//| """:mod:`time` --- time and timing related functions -//| ======================================================== -//| -//| .. module:: time -//| :synopsis: time and timing related functions -//| :platform: SAMD21 +//| """time and timing related functions //| //| The `time` module is a strict subset of the CPython `cpython:time` module. So, code //| written in MicroPython will work in CPython but not necessarily the other diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 6d59a17446..4c1d534eaa 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -39,10 +39,7 @@ #include "supervisor/shared/translate.h" //| class TouchIn: -//| """.. currentmodule:: touchio -//| -//| :class:`TouchIn` -- Read the state of a capacitive touch sensor -//| =================================================================== +//| """Read the state of a capacitive touch sensor //| //| Usage:: //| diff --git a/shared-bindings/touchio/__init__.c b/shared-bindings/touchio/__init__.c index 96367f0823..92e067cf68 100644 --- a/shared-bindings/touchio/__init__.c +++ b/shared-bindings/touchio/__init__.c @@ -35,23 +35,11 @@ #include "py/runtime.h" -//| """:mod:`touchio` --- Touch related IO -//| ================================================= -//| -//| .. module:: touchio -//| :synopsis: Hardware accelerated behavior -//| :platform: SAMD21 +//| """Touch related IO //| //| The `touchio` module contains classes to provide access to touch IO typically //| accelerated by hardware on the onboard microcontroller. //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| TouchIn -//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/uheap/__init__.c b/shared-bindings/uheap/__init__.c index f1be304247..f089f29221 100644 --- a/shared-bindings/uheap/__init__.c +++ b/shared-bindings/uheap/__init__.c @@ -31,11 +31,7 @@ #include "shared-bindings/uheap/__init__.h" -//| """:mod:`uheap` --- Heap size analysis -//| ================================================================ -//| -//| .. module:: uheap -//| :synopsis: Heap size analysis""" +//| """Heap size analysis""" //| //| def info(object: Any) -> Any: diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.pyi similarity index 100% rename from shared-bindings/ulab/__init__.rst rename to shared-bindings/ulab/__init__.pyi diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index bcea5b2c55..8c0c364ff3 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -28,10 +28,7 @@ #include "shared-bindings/usb_hid/Device.h" //| class Device: -//| """.. currentmodule:: usb_hid -//| -//| :class:`Device` -- HID Device -//| ============================================ +//| """HID Device //| //| Usage:: //| diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index 3d0978d623..e12ea8da4e 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -31,12 +31,7 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" -//| """:mod:`usb_hid` --- USB Human Interface Device -//| =========================================================== -//| -//| .. module:: usb_hid -//| :synopsis: USB Human Interface Device -//| :platform: SAMD21 +//| """USB Human Interface Device //| //| The `usb_hid` module allows you to output data as a HID device.""" //| @@ -44,14 +39,6 @@ //| usb_hid.devices: Any = ... //| """Tuple of all active HID device interfaces.""" //| - -//| """Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Device""" -//| STATIC const mp_rom_map_elem_t usb_hid_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid) }, { MP_ROM_QSTR(MP_QSTR_devices), MP_ROM_PTR(&common_hal_usb_hid_devices) }, diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 55a5865ca7..9d9310b47a 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -36,12 +36,9 @@ #include "supervisor/shared/translate.h" //| class PortIn: -//| """.. currentmodule:: usb_midi +//| """Receives midi commands over USB""" //| -//| :class:`PortIn` -- receives midi commands over USB -//| ===================================================""" -//| -//| def __init__(self, ): +//| def __init__(self): //| """You cannot create an instance of `usb_midi.PortIn`. //| //| PortIn objects are constructed for every corresponding entry in the USB diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index d83eb53b69..14ed0e767e 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -36,10 +36,7 @@ #include "supervisor/shared/translate.h" //| class PortOut: -//| """.. currentmodule:: usb_midi -//| -//| :class:`PortOut` -- sends midi messages to a computer over USB -//| ==============================================================""" +//| """Sends midi messages to a computer over USB""" //| //| def __init__(self, ): //| """You cannot create an instance of `usb_midi.PortOut`. diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index 2631d8a882..5570b601ca 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -35,22 +35,7 @@ #include "py/runtime.h" -//| """:mod:`usb_midi` --- MIDI over USB -//| ================================================= -//| -//| .. module:: usb_midi -//| :synopsis: MIDI over USB -//| -//| The `usb_midi` module contains classes to transmit and receive MIDI messages over USB -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| PortIn -//| PortOut""" -//| +//| """Classes to transmit and receive MIDI messages over USB""" //| mp_map_elem_t usb_midi_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_midi) }, diff --git a/shared-bindings/ustack/__init__.c b/shared-bindings/ustack/__init__.c index 073840abac..e5fac69417 100644 --- a/shared-bindings/ustack/__init__.c +++ b/shared-bindings/ustack/__init__.c @@ -34,15 +34,11 @@ -//| """:mod:`ustack` --- Stack information and analysis -//| ======================================================== -//| -//| .. module:: ustack -//| :synopsis: stack information functions""" +//| """Stack information and analysis""" //| #if MICROPY_MAX_STACK_USAGE -//| def max_stack_usage() -> Any: +//| def max_stack_usage() -> int: //| """Return the maximum excursion of the stack so far.""" //| ... //| @@ -53,7 +49,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(max_stack_usage_obj, max_stack_usage); #endif // MICROPY_MAX_STACK_USAGE -//| def stack_size() -> Any: +//| def stack_size() -> int: //| """Return the size of the entire stack. //| Same as in micropython.mem_info(), but returns a value instead //| of just printing it.""" diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index 5c8e8d3fd2..0b0b7b14b7 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -35,21 +35,7 @@ #include "shared-module/network/__init__.h" -//| """:mod:`wiznet` --- Support for WizNet hardware -//| ============================================= -//| -//| .. module:: wiznet -//| :synopsis: Support for WizNet hardware -//| :platform: SAMD -//| -//| Support for WizNet hardware, including the WizNet 5500 Ethernet adaptor. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| wiznet5k""" +//| """Support for WizNet hardware, including the WizNet 5500 Ethernet adaptor.""" //| extern const mod_network_nic_type_t mod_network_nic_type_wiznet5k; diff --git a/shared-bindings/wiznet/wiznet5k.c b/shared-bindings/wiznet/wiznet5k.c index 2e2ee39496..2f49dffea9 100644 --- a/shared-bindings/wiznet/wiznet5k.c +++ b/shared-bindings/wiznet/wiznet5k.c @@ -47,10 +47,7 @@ #include "shared-module/wiznet/wiznet5k.h" //| class WIZNET5K: -//| """.. currentmodule:: wiznet -//| -//| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface -//| ===============================================================""" +//| """Wrapper for Wiznet 5500 Ethernet interface""" //| //| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True): //| """Create a new WIZNET5500 interface using the specified pins diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index de783eb270..95370f7619 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -22,7 +22,7 @@ for module in modules: pyi_lines = [] classes = os.listdir(module_path) classes = [x for x in sorted(classes) if x.endswith(".c")] - if classes[-1] == "__init__.c": + if classes and classes[-1] == "__init__.c": classes.insert(0, classes.pop()) for class_file in classes: class_path = os.path.join(module_path, class_file) @@ -37,6 +37,13 @@ for module in modules: continue pyi_lines.append(line) + raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] + if raw_stubs and raw_stubs[-1] == "__init__.pyi": + raw_stubs.insert(0, raw_stubs.pop()) + for raw_stub in raw_stubs: + raw_stub_path = os.path.join(module_path, raw_stub) + with open(raw_stub_path, "r") as f: + pyi_lines.extend(f.readlines()) stub_filename = os.path.join(stub_directory, module + ".pyi") print(stub_filename) stub_contents = "".join(pyi_lines) @@ -54,3 +61,6 @@ for module in modules: print() print(f"{ok} ok out of {total}") + +if ok != total: + sys.exit(total - ok) From c816cfed58a6f875f91a3bb8629dd81acf076882 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 17:37:42 -0700 Subject: [PATCH 472/919] Build stubs before docs --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 057395eeef..7ecdb66ee3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: run: | sudo apt-get install -y eatmydata sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 - pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml + pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid - name: Versions run: | gcc --version @@ -64,6 +64,8 @@ jobs: - name: mpy Tests run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float working-directory: tests + - name: Stubs + run: make stubs -j2 - name: Docs run: sphinx-build -E -W -b html . _build/html - name: Translations From 4e646ee6e4473195df3eba4bd7e006e44bfd1cdc Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 18:40:02 -0700 Subject: [PATCH 473/919] Move vectorio to stubs --- shared-bindings/vectorio/Circle.c | 18 +++++--------- shared-bindings/vectorio/Polygon.c | 23 +++++++----------- shared-bindings/vectorio/Rectangle.c | 14 ++++------- shared-bindings/vectorio/VectorShape.c | 33 +++++++++++--------------- shared-bindings/vectorio/__init__.c | 21 +--------------- 5 files changed, 34 insertions(+), 75 deletions(-) diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 260e80d0fb..6b5682e149 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -9,17 +9,12 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: vectorio +//| class Circle: //| -//| :class:`Circle` -- Represents a circle by its radius -//| ========================================================================== +//| def __init__(self, radius: int): +//| """Circle is positioned on screen by its center point. //| -//| .. class:: Circle(radius) -//| -//| Circle is positioned on screen by its center point. -//| -//| :param int radius: The radius of the circle in pixels +//| :param radius: The radius of the circle in pixels""" //| static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_radius }; @@ -42,9 +37,8 @@ static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_arg } -//| .. attribute:: radius -//| -//| The radius of the circle in pixels. +//| radius : int = ... +//| """The radius of the circle in pixels.""" //| STATIC mp_obj_t vectorio_circle_obj_get_radius(mp_obj_t self_in) { vectorio_circle_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index b8bb377ac5..5f4d85e211 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -49,17 +49,13 @@ static mp_obj_t _to_points_list(mp_obj_t points_tuple_list) { } return points_list; } - - - -//| .. currentmodule:: vectorio +//| from typing import List, Tuple //| -//| :class:`Polygon` -- Represents a closed shape by ordered vertices -//| ========================================================================== +//| class Polygon: +//| def __init__(self, points: List[ Tuple[ x, y ], ... ] ): +//| """Represents a closed shape by ordered vertices //| -//| .. class:: Polygon( List[ Tuple[ x, y ], ... ] ) -//| -//| :param [Point] points_array: Vertices for the polygon +//| :param points: Vertices for the polygon""" //| static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_points_list }; @@ -83,14 +79,13 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar } -//| .. attribute:: points -//| -//| Set a new look and shape for this polygon +//| points: List[ Tuple[ x, y ], ... ] = ... +//| """Set a new look and shape for this polygon""" //| STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); mp_obj_t list = mp_obj_new_list(0, NULL); - + size_t len = 0; mp_obj_t *items; mp_obj_list_get(common_hal_vectorio_polygon_get_points(self), &len, &items); @@ -123,8 +118,6 @@ const mp_obj_property_t vectorio_polygon_points_obj = { (mp_obj_t)&mp_const_none_obj}, }; - - STATIC const mp_rom_map_elem_t vectorio_polygon_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_points), MP_ROM_PTR(&vectorio_polygon_points_obj) }, }; diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index ea468f7888..f04a25c35a 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -7,16 +7,12 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" - -//| .. currentmodule:: vectorio +//| class Rectangle: +//| def __init__(self, width: int, height: int): +//| """Represents a rectangle by defining its bounds //| -//| :class:`Rectangle` -- Represents a rectangle by defining its bounds -//| ========================================================================== -//| -//| .. class:: Rectangle(width, height) -//| -//| :param int width: The number of pixels wide -//| :param int height: The number of pixels high +//| :param width: The number of pixels wide +//| :param height: The number of pixels high""" //| static mp_obj_t vectorio_rectangle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_width, ARG_height }; diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 4b39ec9960..c512bcd546 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -19,17 +19,15 @@ #include "supervisor/shared/translate.h" -//| .. currentmodule:: vectorio +//| class VectorShape: +//| def __init__(self, shape: vectorio.Polygon, pixel_shader: displayio.Palette, x: int=0, y: int=0): +//| """Binds a vector shape to a location and pixel color //| -//| :class:`VectorShape` -- Binds a vector shape to a location and pixel color -//| ========================================================================== -//| -//| .. class:: VectorShape( shape, pixel_shader, x=0, y=0) -//| -//| :param vectorio.Polygon shape: The shape to draw. -//| :param displayio.Palette pixel_shader: The pixel shader that produces colors from values -//| :param int x: Initial x position of the center axis of the shape within the parent. -//| :param int y: Initial y position of the center axis of the shape within the parent. +//| :param shape: The shape to draw. +//| :param pixel_shader: The pixel shader that produces colors from values +//| :param x: Initial x position of the center axis of the shape within the parent. +//| :param y: Initial y position of the center axis of the shape within the parent.""" +//| ... //| STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_shape, ARG_pixel_shader, ARG_x, ARG_y }; @@ -95,9 +93,8 @@ STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t } -//| .. attribute:: x -//| -//| X position of the center point of the shape in the parent. +//| x: int = ... +//| """X position of the center point of the shape in the parent.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_x(mp_obj_t self_in) { vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); @@ -122,9 +119,8 @@ const mp_obj_property_t vectorio_vector_shape_x_obj = { }; -//| .. attribute:: y -//| -//| Y position of the center point of the shape in the parent. +//| y: int = ... +//| """Y position of the center point of the shape in the parent.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_y(mp_obj_t self_in) { vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); @@ -149,9 +145,8 @@ const mp_obj_property_t vectorio_vector_shape_y_obj = { }; -//| .. attribute:: pixel_shader -//| -//| The pixel shader of the shape. +//| pixel_shader: displayio.Palette = ... +//| """The pixel shader of the shape.""" //| STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t self_in) { vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/vectorio/__init__.c b/shared-bindings/vectorio/__init__.c index b9e3828bdc..c747834263 100644 --- a/shared-bindings/vectorio/__init__.c +++ b/shared-bindings/vectorio/__init__.c @@ -8,27 +8,8 @@ #include "shared-bindings/vectorio/Rectangle.h" #include "shared-bindings/vectorio/VectorShape.h" -//| :mod:`vectorio` --- Lightweight 2d shapes for displays -//| ========================================================================= +//| """Lightweight 2d shapes for displays""" //| -//| .. module:: vectorio -//| :synopsis: Adds vector graphics to displayio -//| :platform: SAMD21, SAMD51, nRF52 -//| -//| The `vectorio` module contains classes to construct shapes -//| by describing their points rather than providing them in bitmaps. -//| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Circle -//| Polygon -//| Rectangle -//| VectorShape -//| - STATIC const mp_rom_map_elem_t vectorio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_vectorio) }, From 80129c5a21fb51e37d0a634b9714911201e74555 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 18:55:49 -0700 Subject: [PATCH 474/919] Disable countio on trinket haxpress --- ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index bd6c9c9ff7..e56517b5c7 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = W25Q32BV LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 From 4612270f98988ac4646c5cbf4bebddb35e71f660 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 19:00:51 -0700 Subject: [PATCH 475/919] Only enable COUNTIO in full builds --- py/circuitpy_mpconfig.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 74ad7a2cc2..0801540bc0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -88,7 +88,7 @@ CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) CIRCUITPY_DIGITALIO ?= 1 CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO) -CIRCUITPY_COUNTIO ?= 1 +CIRCUITPY_COUNTIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) From 2efe17bcb76197137287ae4a984b4481ab77be15 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 12 May 2020 19:01:17 -0700 Subject: [PATCH 476/919] Don't build in empty help.c --- py/circuitpy_defns.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index c6ea2b45bb..9913329c2d 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -318,7 +318,6 @@ $(filter $(SRC_PATTERNS), \ ) SRC_BINDINGS_ENUMS += \ - help.c \ util.c SRC_SHARED_MODULE_ALL = \ From fbf052bb2755b2a3afb85b94ea9625ab29da4ab0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:04:19 -0500 Subject: [PATCH 477/919] Gamepad & GamepadShift: Enable ticks while object exists Otherwise, button presses might not be noticed. --- shared-bindings/gamepad/GamePad.c | 4 ++++ shared-bindings/gamepadshift/GamePadShift.c | 4 ++++ shared-module/gamepad/GamePad.c | 2 ++ shared-module/gamepad/__init__.c | 4 ++++ shared-module/gamepadshift/GamePadShift.c | 2 ++ 5 files changed, 16 insertions(+) diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index d3c29019a5..88f072f3eb 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -33,6 +33,7 @@ #include "shared-bindings/gamepad/__init__.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" //| .. currentmodule:: gamepad @@ -108,6 +109,9 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, gamepad_singleton = m_new_obj(gamepad_obj_t); gamepad_singleton->base.type = &gamepad_type; gamepad_singleton = gc_make_long_lived(gamepad_singleton); + if (!MP_STATE_VM(gamepad_singleton)) { + supervisor_enable_tick(); + } MP_STATE_VM(gamepad_singleton) = gamepad_singleton; } common_hal_gamepad_gamepad_init(gamepad_singleton, args, n_args); diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 91203ad20d..76f054aae9 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -31,6 +31,7 @@ #include "shared-bindings/gamepadshift/GamePadShift.h" #include "shared-bindings/gamepadshift/__init__.h" #include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" //| .. currentmodule:: gamepadshift //| @@ -75,6 +76,9 @@ STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, gamepad_singleton = m_new_obj(gamepadshift_obj_t); gamepad_singleton->base.type = &gamepadshift_type; gamepad_singleton = gc_make_long_lived(gamepad_singleton); + if (!MP_STATE_VM(gamepad_singleton)) { + supervisor_enable_tick(); + } MP_STATE_VM(gamepad_singleton) = gamepad_singleton; } common_hal_gamepadshift_gamepadshift_init(gamepad_singleton, clock_pin, data_pin, latch_pin); diff --git a/shared-module/gamepad/GamePad.c b/shared-module/gamepad/GamePad.c index fdce0caab4..7b4108eb2e 100644 --- a/shared-module/gamepad/GamePad.c +++ b/shared-module/gamepad/GamePad.c @@ -27,6 +27,7 @@ #include "py/mpstate.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/gamepad/GamePad.h" +#include "supervisor/shared/tick.h" void common_hal_gamepad_gamepad_init(gamepad_obj_t *gamepad, const mp_obj_t pins[], size_t n_pins) { @@ -54,4 +55,5 @@ void common_hal_gamepad_gamepad_init(gamepad_obj_t *gamepad, void common_hal_gamepad_gamepad_deinit(gamepad_obj_t *self) { MP_STATE_VM(gamepad_singleton) = NULL; + supervisor_disable_tick(); } diff --git a/shared-module/gamepad/__init__.c b/shared-module/gamepad/__init__.c index 3e17a0fb5b..9874b27529 100644 --- a/shared-module/gamepad/__init__.c +++ b/shared-module/gamepad/__init__.c @@ -29,6 +29,7 @@ #include "py/mpstate.h" #include "shared-bindings/gamepad/__init__.h" #include "shared-bindings/gamepad/GamePad.h" +#include "supervisor/shared/tick.h" #include "shared-bindings/digitalio/DigitalInOut.h" @@ -59,5 +60,8 @@ void gamepad_tick(void) { } void gamepad_reset(void) { + if (MP_STATE_VM(gamepad_singleton)) { + supervisor_disable_tick(); + } MP_STATE_VM(gamepad_singleton) = NULL; } diff --git a/shared-module/gamepadshift/GamePadShift.c b/shared-module/gamepadshift/GamePadShift.c index b8fb4d3f44..51da617021 100644 --- a/shared-module/gamepadshift/GamePadShift.c +++ b/shared-module/gamepadshift/GamePadShift.c @@ -27,6 +27,7 @@ #include "py/mpstate.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-module/gamepadshift/GamePadShift.h" +#include "supervisor/shared/tick.h" void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, digitalio_digitalinout_obj_t *clock_pin, @@ -46,4 +47,5 @@ void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift) { MP_STATE_VM(gamepad_singleton) = NULL; + supervisor_disable_tick(); } From 23ba58bbf574d029d5b18e57c40d4257b37dfd7a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:05:48 -0500 Subject: [PATCH 478/919] Gamepad & GamepadShift: Initially allocate as long-lived This makes less heap churn and decreases code size a tiny bit --- shared-bindings/gamepad/GamePad.c | 3 +-- shared-bindings/gamepadshift/GamePadShift.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c index 88f072f3eb..d6f91c1c08 100644 --- a/shared-bindings/gamepad/GamePad.c +++ b/shared-bindings/gamepad/GamePad.c @@ -106,9 +106,8 @@ STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, gamepad_obj_t* gamepad_singleton = MP_STATE_VM(gamepad_singleton); if (!gamepad_singleton || !MP_OBJ_IS_TYPE(MP_OBJ_FROM_PTR(gamepad_singleton), &gamepad_type)) { - gamepad_singleton = m_new_obj(gamepad_obj_t); + gamepad_singleton = m_new_ll_obj(gamepad_obj_t); gamepad_singleton->base.type = &gamepad_type; - gamepad_singleton = gc_make_long_lived(gamepad_singleton); if (!MP_STATE_VM(gamepad_singleton)) { supervisor_enable_tick(); } diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index 76f054aae9..9586e01ed9 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -73,9 +73,8 @@ STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, if (!gamepad_singleton || !MP_OBJ_IS_TYPE(MP_OBJ_FROM_PTR(gamepad_singleton), &gamepadshift_type)) { - gamepad_singleton = m_new_obj(gamepadshift_obj_t); + gamepad_singleton = m_new_ll_obj(gamepadshift_obj_t); gamepad_singleton->base.type = &gamepadshift_type; - gamepad_singleton = gc_make_long_lived(gamepad_singleton); if (!MP_STATE_VM(gamepad_singleton)) { supervisor_enable_tick(); } From adef45403bc05dfc2bae616003fc90d2f40a3da4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:29:36 -0500 Subject: [PATCH 479/919] samd: audio dma: enable/disable supervisor tick as needed --- ports/atmel-samd/audio_dma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/atmel-samd/audio_dma.c b/ports/atmel-samd/audio_dma.c index 352af89802..93cd96b985 100644 --- a/ports/atmel-samd/audio_dma.c +++ b/ports/atmel-samd/audio_dma.c @@ -31,6 +31,7 @@ #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/audiocore/WaveFile.h" +#include "supervisor/shared/tick.h" #include "py/mpstate.h" #include "py/runtime.h" @@ -60,6 +61,7 @@ void audio_dma_free_channel(uint8_t channel) { assert(audio_dma_allocated[channel]); audio_dma_disable_channel(channel); audio_dma_allocated[channel] = false; + supervisor_disable_tick(); } void audio_dma_disable_channel(uint8_t channel) { @@ -71,6 +73,7 @@ void audio_dma_disable_channel(uint8_t channel) { void audio_dma_enable_channel(uint8_t channel) { if (channel >= AUDIO_DMA_CHANNEL_COUNT) return; + supervisor_enable_tick(); dma_enable_channel(channel); } @@ -318,6 +321,9 @@ void audio_dma_reset(void) { for (uint8_t i = 0; i < AUDIO_DMA_CHANNEL_COUNT; i++) { audio_dma_state[i] = NULL; audio_dma_pending[i] = false; + if (audio_dma_allocated[i]) { + supervisor_disable_tick(); + } audio_dma_allocated[i] = false; audio_dma_disable_channel(i); dma_descriptor(i)->BTCTRL.bit.VALID = false; From 3ffa5604fc0523aa131be4a353fb883a9c8a37ff Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 13 May 2020 08:36:16 -0700 Subject: [PATCH 480/919] Update countio to python stub docs --- shared-bindings/busio/UART.c | 10 ++--- shared-bindings/countio/Counter.c | 70 ++++++++++++++---------------- shared-bindings/countio/__init__.c | 16 +------ 3 files changed, 38 insertions(+), 58 deletions(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index d4642225c0..2bd36145d2 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -346,13 +346,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_o //| class Parity: //| """Enum-like class to define the parity used to verify correct data transfer.""" //| -//| def __init__(self, ): -//| ODD: Any = ... -//| """Total number of ones should be odd.""" +//| ODD: Any = ... +//| """Total number of ones should be odd.""" //| -//| EVEN: Any = ... -//| """Total number of ones should be even.""" -//| ... +//| EVEN: Any = ... +//| """Total number of ones should be even.""" //| const mp_obj_type_t busio_uart_parity_type; diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index d9d97f0ead..8db795015d 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -9,45 +9,41 @@ #include "shared-bindings/countio/Counter.h" #include "shared-bindings/util.h" -//| .. currentmodule:: countio +//| class Counter: +//| """Counter will keep track of the number of falling edge transistions (pulses) on a +//| given pin""" //| -//| :class:`Counter` -- Track the count of falling edge transistions (pulses) on a given pin -//| ======================================================================================== +//| def __init__(self, pin_a): +//| """Create a Counter object associated with the given pin. It tracks the number of +//| falling pulses relative when the object is constructed. //| -//| Counter will keep track of the number of falling edge transistions (pulses) on a given pin +//| :param ~microcontroller.Pin pin_a: Pin to read pulses from. //| -//| .. class:: Counter(pin_a) //| -//| Create a Counter object associated with the given pin. It tracks the number of -//| falling pulses relative when the object is constructed. +//| For example:: //| -//| :param ~microcontroller.Pin pin_a: Pin to read pulses from. -//| +//| import countio +//| import time +//| from board import * //| -//| For example:: -//| -//| import countio -//| import time -//| from board import * -//| -//| pin_counter = countio.Counter(board.D1) -//| #reset the count after 100 counts -//| while True: -//| if pin_counter.count == 100: -//| pin_counter.reset() -//| print(pin_counter.count) +//| pin_counter = countio.Counter(board.D1) +//| #reset the count after 100 counts +//| while True: +//| if pin_counter.count == 100: +//| pin_counter.reset() +//| print(pin_counter.count)""" //| STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin_a }; static const mp_arg_t allowed_args[] = { { MP_QSTR_pin_a, MP_ARG_REQUIRED | MP_ARG_OBJ } - + }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); const mcu_pin_obj_t* pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); - + countio_counter_obj_t *self = m_new_obj(countio_counter_obj_t); self->base.type = &countio_counter_type; @@ -57,9 +53,8 @@ STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } -//| .. method:: deinit() -//| -//| Deinitializes the Counter and releases any hardware resources for reuse. +//| def deinit(self): +//| """Deinitializes the Counter and releases any hardware resources for reuse.""" //| STATIC mp_obj_t countio_counter_deinit(mp_obj_t self_in) { countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -74,16 +69,14 @@ STATIC void check_for_deinit(countio_counter_obj_t *self) { } } -//| .. method:: __enter__() -//| -//| No-op used by Context Managers. +//| def __enter__(self): +//| """No-op used by Context Managers.""" //| // Provided by context manager helper. -//| .. method:: __exit__() -//| -//| Automatically deinitializes the hardware when exiting a context. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| def __exit__(self): +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" //| STATIC mp_obj_t countio_counter_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; @@ -93,10 +86,8 @@ STATIC mp_obj_t countio_counter_obj___exit__(size_t n_args, const mp_obj_t *args STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(countio_counter___exit___obj, 4, 4, countio_counter_obj___exit__); -//| .. attribute:: count -//| -//| The current count in terms of pulses. -//| +//| count: int = ... +//| """The current count in terms of pulses.""" //| STATIC mp_obj_t countio_counter_obj_get_count(mp_obj_t self_in) { countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -122,6 +113,9 @@ const mp_obj_property_t countio_counter_count_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| def reset(self): +//| """Resets the count back to 0.""" +//| STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in){ countio_counter_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); @@ -129,7 +123,7 @@ STATIC mp_obj_t countio_counter_reset(mp_obj_t self_in){ common_hal_countio_counter_reset(self); return mp_const_none; } - + MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_reset_obj, countio_counter_reset); diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index 8929bf7edb..7046a5e721 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -8,22 +8,10 @@ #include "shared-bindings/countio/__init__.h" #include "shared-bindings/countio/Counter.h" -//| :mod:`countio` --- Support for edge counting -//| ======================================================== -//| -//| .. module:: countio -//| :synopsis: Support for edge counting -//| :platform: SAMD +//| """Support for edge counting //| //| The `countio` module contains logic to read and count edge transistions //| -//| Libraries -//| -//| .. toctree:: -//| :maxdepth: 3 -//| -//| Counter -//| //| .. warning:: This module is not available in some SAMD21 (aka M0) builds. See the //| :ref:`module-support-matrix` for more info. @@ -32,7 +20,7 @@ //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See -//| :ref:`lifetime-and-contextmanagers` for more info. +//| :ref:`lifetime-and-contextmanagers` for more info.""" //| STATIC const mp_rom_map_elem_t countio_module_globals_table[] = { From 011acf41c0d5c369fabf5a45976c63b433baa546 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:39:40 -0500 Subject: [PATCH 481/919] nrf: Ensure ticks enabled while playing audio --- ports/nrf/common-hal/audiobusio/I2SOut.c | 7 +++++++ ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 2fa28afac0..9db6504538 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -31,6 +31,7 @@ #include "common-hal/audiobusio/I2SOut.h" #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-module/audiocore/__init__.h" +#include "supervisor/shared/tick.h" #include "py/obj.h" #include "py/runtime.h" @@ -211,6 +212,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, NRF_I2S->CONFIG.ALIGN = I2S_CONFIG_ALIGN_ALIGN_Left; NRF_I2S->CONFIG.FORMAT = left_justified ? I2S_CONFIG_FORMAT_FORMAT_Aligned : I2S_CONFIG_FORMAT_FORMAT_I2S; + + supervisor_enable_tick(); } bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) { @@ -230,6 +233,7 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { reset_pin_number(self->data_pin_number); self->data_pin_number = 0xff; instance = NULL; + supervisor_disable_tick(); } void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, @@ -340,5 +344,8 @@ void i2s_reset(void) { NRF_I2S->PSEL.LRCK = 0xFFFFFFFF; NRF_I2S->PSEL.SDOUT = 0xFFFFFFFF; NRF_I2S->PSEL.SDIN = 0xFFFFFFFF; + if (instance) { + supervisor_disable_tick(); + } instance = NULL; } diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 89966b7da9..7fec766fb8 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -36,6 +36,7 @@ #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" // TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that @@ -67,6 +68,7 @@ STATIC void activate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (!active_audio[i]) { active_audio[i] = self; + supervisor_enable_tick(); break; } } @@ -77,12 +79,16 @@ STATIC void deactivate_audiopwmout_obj(audiopwmio_pwmaudioout_obj_t *self) { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { if (active_audio[i] == self) { active_audio[i] = NULL; + supervisor_disable_tick(); } } } void audiopwmout_reset() { for (size_t i=0; i < MP_ARRAY_SIZE(active_audio); i++) { + if (active_audio[i]) { + supervisor_disable_tick(); + } active_audio[i] = NULL; } } From eb876e21c317e19537eeeb6937b058c17d82d582 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 13 May 2020 10:40:41 -0500 Subject: [PATCH 482/919] nrf: code style --- ports/nrf/common-hal/audiobusio/I2SOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 9db6504538..34eecf8d54 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -159,7 +159,7 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { // Find the last frame of real audio data and replicate its samples until // you have 32 bits worth, which is the fundamental unit of nRF I2S DMA - if(buffer != buffer_start) { + if (buffer != buffer_start) { if (self->bytes_per_sample == 1 && self->channel_count == 1) { // For 8-bit mono, 4 copies of the final sample are required self->hold_value = 0x01010101 * *(uint8_t*)(buffer-1); From 794d5f5900410730b84a1ab47c2c286b954b5c0a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 13 May 2020 14:45:09 -0700 Subject: [PATCH 483/919] Correct version numbering --- setup.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 37afb6f1b1..769bc66e1d 100644 --- a/setup.py +++ b/setup.py @@ -1,20 +1,36 @@ from datetime import datetime from setuptools import setup from pathlib import Path +import subprocess +import re stub_root = Path("circuitpython-stubs") stubs = [p.relative_to(stub_root).as_posix() for p in stub_root.glob("*.pyi")] +git_out = subprocess.check_output(["git", "describe", "--tags"]) +version = git_out.strip().decode("utf-8") + +# Detect a development build and mutate it to be valid semver and valid python version. +pieces = version.split("-") +if len(pieces) > 2: + # Merge the commit portion onto the commit count since the tag. + pieces[-2] += "+" + pieces[-1] + pieces.pop() + # Merge the commit count and build to the pre-release identifier. + pieces[-2] += ".dev." + pieces[-1] + pieces.pop() +version = "-".join(pieces) + setup( name="circuitpython-stubs", description="PEP 561 type stubs for CircuitPython", url="https://github.com/adafruit/circuitpython", maintainer="CircuitPythonistas", + maintainer_email="circuitpython@adafruit.com", author_email="circuitpython@adafruit.com", - use_scm_version=True, + version=version, license="MIT", package_data={"circuitpython-stubs": stubs}, packages=["circuitpython-stubs"], - setup_requires=["setuptools>=38.6.0", - "setuptools_scm"], + setup_requires=["setuptools>=38.6.0"], ) From 3d6a23411f065fdec2d9e501305ae90200bbdbe2 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 14 May 2020 11:59:07 +0000 Subject: [PATCH 484/919] Translated using Weblate (Swedish) Currently translated at 3.4% (26 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 62 ++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 493245dbfc..7ca0af3e2f 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-05-14 12:23+0000\n" +"Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Koden har kört klart. Väntar på omladdning.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -38,11 +41,11 @@ msgstr "" #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr " Filen \"%q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr " Fil \"%q\", rad %d" #: main.c msgid " output:\n" @@ -51,7 +54,7 @@ msgstr "" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%%c kräver int eller char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -60,42 +63,43 @@ msgstr "" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q används redan" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "Index %q ligger utanför intervallet" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Indexet %q måste vara ett heltal, inte %s" #: shared-bindings/vectorio/Polygon.c +#, fuzzy msgid "%q list must be a list" -msgstr "" +msgstr "%q-listan måste vara en lista" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "%q måste vara >= 1" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q måste vara en tuple av längd 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "%q ska vara en int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "" +msgstr "%q() kräver %d positionsargument men %d gavs" #: py/argcheck.c msgid "'%q' argument required" -msgstr "" +msgstr "'%q' argument krävs" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -105,17 +109,17 @@ msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s' förväntar sig ett register" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s' förväntar sig ett specialregister" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "" +msgstr "'%s' förväntar sig ett FPU-register" #: py/emitinlinethumb.c #, c-format @@ -125,35 +129,35 @@ msgstr "" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "" +msgstr "'%s' förväntar sig ett heltal" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects at most r%d" -msgstr "" +msgstr "'%s' förväntar sig högst r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s' förväntar sig {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "" +msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "" +msgstr "'%s' heltal 0x%x får inte plats i mask 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "Objektet '%s' kan inte tilldela attributet '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "Objektet '%s' har inte stöd för '%q'" #: py/obj.c #, c-format @@ -167,17 +171,17 @@ msgstr "" #: py/runtime.c msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "Objektet '%s' har inget attribut '%q'" #: py/runtime.c #, c-format msgid "'%s' object is not an iterator" -msgstr "" +msgstr "Objektet '%s' är inte en iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "" +msgstr "Objektet '%s' kan inte anropas" #: py/runtime.c #, c-format From b446d3eee1011a5c7834abfb66101d0911f5505d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 14 May 2020 12:22:49 +0000 Subject: [PATCH 485/919] Translated using Weblate (Swedish) Currently translated at 3.4% (26 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/sv.po b/locale/sv.po index 7ca0af3e2f..410a3f271e 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-14 12:23+0000\n" -"Last-Translator: Jonny Bergdahl \n" +"Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -38,6 +38,8 @@ msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"För att avsluta, återställ brädet utan" #: py/obj.c msgid " File \"%q\"" From 09e740d6ea8676366b70fab453e8b1b57b4e979f Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Thu, 14 May 2020 12:23:15 +0000 Subject: [PATCH 486/919] Translated using Weblate (Swedish) Currently translated at 3.7% (28 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 410a3f271e..5708b66427 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-14 12:23+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-14 12:41+0000\n" +"Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -39,7 +39,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"För att avsluta, återställ brädet utan" +"För att avsluta, resetta kortet utan " #: py/obj.c msgid " File \"%q\"" @@ -50,8 +50,9 @@ msgid " File \"%q\", line %d" msgstr " Fil \"%q\", rad %d" #: main.c +#, fuzzy msgid " output:\n" -msgstr "" +msgstr " utdata:\n" #: py/objstr.c #, c-format @@ -106,7 +107,7 @@ msgstr "'%q' argument krävs" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' förväntar sig en etikett" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -126,7 +127,7 @@ msgstr "'%s' förväntar sig ett FPU-register" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an address of the form [a, b]" -msgstr "" +msgstr "'%s' förväntar sig en adress i formen [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format From b477c4812d1f0d0ed0fe56abcdcaa356cc3a652e Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 16:58:25 -0400 Subject: [PATCH 487/919] Fixed minor indentation issue --- shared-bindings/analogio/AnalogIn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index bafa287ff1..400784b390 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -70,9 +70,9 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: -//| """Turn off the AnalogIn and release the pin for other use.""" -//| ... +//| def deinit(self, ) -> Any: +//| """Turn off the AnalogIn and release the pin for other use.""" +//| ... //| STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) { analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in); From a16edbc45ca00b3181bfe68a30a3fd7681393a7f Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 18:22:07 -0400 Subject: [PATCH 488/919] First semi-functional version of extract_types.py --- tools/extract_types.py | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tools/extract_types.py diff --git a/tools/extract_types.py b/tools/extract_types.py new file mode 100644 index 0000000000..2e9b0a4965 --- /dev/null +++ b/tools/extract_types.py @@ -0,0 +1,80 @@ +import os +import sys +import astroid +import traceback + +top_level = sys.argv[1].strip("/") + +if top_level.count("/") == 1: + top_level, module = top_level.split("/") + modules = [module] +else: + modules = os.listdir(top_level) + modules = sorted(modules) + +ok = 0 +total = 0 +for module in modules: + module_path = os.path.join(top_level, module) + if not os.path.isdir(module_path): + continue + pyi_lines = [] + classes = os.listdir(module_path) + classes = [x for x in sorted(classes) if x.endswith(".c")] + if classes and classes[-1] == "__init__.c": + classes.insert(0, classes.pop()) + for class_file in classes: + class_path = os.path.join(module_path, class_file) + with open(class_path, "r") as f: + for line in f: + if line.startswith("//|"): + if line[3] == " ": + line = line[4:] + elif line[3] == "\n": + line = line[3:] + else: + continue + pyi_lines.append(line) + + raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] + if raw_stubs and raw_stubs[-1] == "__init__.pyi": + raw_stubs.insert(0, raw_stubs.pop()) + for raw_stub in raw_stubs: + raw_stub_path = os.path.join(module_path, raw_stub) + with open(raw_stub_path, "r") as f: + pyi_lines.extend(f.readlines()) + stub_contents = "".join(pyi_lines) + + # Validate that the module is a parseable stub. + total += 1 + try: + tree = astroid.parse(stub_contents) + #print(tree.repr_tree()) + for i in tree.body: + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + argdict = j.args.__dict__ + a = argdict.pop('lineno') + a = argdict.pop('col_offset') + a = argdict.pop('parent') + print(argdict) + if j.returns: + returndict = j.returns.__dict__ + a = returndict.pop('lineno') + a = returndict.pop('col_offset') + a = returndict.pop('parent') + print(returndict) + print('\n') + #print(tree.body[0].body[0]) + else: + print(type(j)) + ok += 1 + except astroid.exceptions.AstroidSyntaxError as e: + e = e.__cause__ + traceback.print_exception(type(e), e, e.__traceback__) + print() + +print(f"{ok} ok out of {total}") + +if ok != total: + sys.exit(total - ok) From 9613cdd184758421fba558f3d07e58f0b5cb15d1 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 14 May 2020 18:58:28 -0400 Subject: [PATCH 489/919] First fully working version --- tools/extract_types.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tools/extract_types.py b/tools/extract_types.py index 2e9b0a4965..502c69455d 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -47,34 +47,40 @@ for module in modules: # Validate that the module is a parseable stub. total += 1 + missing_parameter_type = 0 + total_1 = 0 + missing_return_type = 0 + total_2 = 0 + missing_attribute_type = 0 + total_3 = 0 try: tree = astroid.parse(stub_contents) - #print(tree.repr_tree()) for i in tree.body: for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - argdict = j.args.__dict__ - a = argdict.pop('lineno') - a = argdict.pop('col_offset') - a = argdict.pop('parent') - print(argdict) + if None in j.args.__dict__['annotations']: + missing_parameter_type += 1 + total_1 += 1 if j.returns: - returndict = j.returns.__dict__ - a = returndict.pop('lineno') - a = returndict.pop('col_offset') - a = returndict.pop('parent') - print(returndict) - print('\n') - #print(tree.body[0].body[0]) - else: - print(type(j)) + if 'Any' in j.returns.__dict__.values(): + missing_return_type += 1 + total_2 += 1 + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'Any' == j.__dict__['annotation'].__dict__['name']: + missing_attribute_type += 1 + total_3 += 1 + + ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) print() -print(f"{ok} ok out of {total}") +print(f"{missing_parameter_type} of {total_1} are missing the parameter type") +print(f"{missing_return_type} of {total_2} are missing the return type") +print(f"{missing_attribute_type} of {total_3} are missing the attribute type") + if ok != total: sys.exit(total - ok) From afc84c2fd115aa1c7a80bd5d83834c30c4563a6c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 14 May 2020 15:57:35 -0700 Subject: [PATCH 490/919] Fix ulab, math and template. --- .gitignore | 2 +- Makefile | 9 +- conf.py | 6 +- docs/autoapi/templates/python/module.rst | 93 +++ shared-bindings/math/__init__.c | 322 +++++------ shared-bindings/ulab/__init__.pyi | 606 ++++---------------- shared-bindings/ulab/compare/__init__.pyi | 30 + shared-bindings/ulab/extras/__init__.pyi | 10 + shared-bindings/ulab/fft/__init__.pyi | 22 + shared-bindings/ulab/filter/__init__.pyi | 19 + shared-bindings/ulab/linalg/__init__.pyi | 57 ++ shared-bindings/ulab/numerical/__init__.pyi | 57 ++ shared-bindings/ulab/poly/__init__.pyi | 10 + shared-bindings/ulab/vector/__init__.pyi | 108 ++++ tools/extract_pyi.py | 77 +-- 15 files changed, 739 insertions(+), 689 deletions(-) create mode 100644 docs/autoapi/templates/python/module.rst create mode 100644 shared-bindings/ulab/compare/__init__.pyi create mode 100644 shared-bindings/ulab/extras/__init__.pyi create mode 100644 shared-bindings/ulab/fft/__init__.pyi create mode 100644 shared-bindings/ulab/filter/__init__.pyi create mode 100644 shared-bindings/ulab/linalg/__init__.pyi create mode 100644 shared-bindings/ulab/numerical/__init__.pyi create mode 100644 shared-bindings/ulab/poly/__init__.pyi create mode 100644 shared-bindings/ulab/vector/__init__.pyi diff --git a/.gitignore b/.gitignore index 403fcc2997..f5edb89f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,7 @@ _build # Generated rst files ###################### genrst/ -autoapi/ +/autoapi/ # ctags and similar ################### diff --git a/Makefile b/Makefile index 1971076a38..842c18da5b 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ help: clean: rm -rf $(BUILDDIR)/* + rm -rf autoapi rm -rf $(STUBDIR) $(DISTDIR) *.egg-info html: stubs @@ -213,10 +214,10 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po) $(PYTHON) tools/check_translations.py $^ stubs: - mkdir -p circuitpython-stubs - python tools/extract_pyi.py shared-bindings/ $(STUBDIR) - python tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) - python setup.py sdist + @mkdir -p circuitpython-stubs + @$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR) + @$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR) + @$(PYTHON) setup.py -q sdist update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." diff --git a/conf.py b/conf.py index aea84dd21d..ee65e39fb4 100644 --- a/conf.py +++ b/conf.py @@ -71,11 +71,13 @@ extensions.append('autoapi.extension') autoapi_type = 'python' # Uncomment this if debugging autoapi -# autoapi_keep_files = True -autoapi_dirs = ['circuitpython-stubs'] +autoapi_keep_files = True +autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circuitpython-stubs')] +print(autoapi_dirs) autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' +autoapi_python_use_implicit_namespaces = True # The encoding of source files. #source_encoding = 'utf-8-sig' diff --git a/docs/autoapi/templates/python/module.rst b/docs/autoapi/templates/python/module.rst new file mode 100644 index 0000000000..7ede6bdfdf --- /dev/null +++ b/docs/autoapi/templates/python/module.rst @@ -0,0 +1,93 @@ +{% if not obj.display %} +:orphan: + +{% endif %} +:mod:`{{ obj.name }}` +======={{ "=" * obj.name|length }} + +.. py:module:: {{ obj.name }} + +{% if obj.docstring %} +.. autoapi-nested-parse:: + + {{ obj.docstring|prepare_docstring|indent(3) }} + +{% endif %} + +{% block subpackages %} +{% set visible_subpackages = obj.subpackages|selectattr("display")|list %} +{% if visible_subpackages %} +.. toctree:: + :titlesonly: + :maxdepth: 3 + +{% for subpackage in visible_subpackages %} + {{ subpackage.short_name }}/index.rst +{% endfor %} + + +{% endif %} +{% endblock %} +{% block submodules %} +{% set visible_submodules = obj.submodules|selectattr("display")|list %} +{% if visible_submodules %} + +.. toctree:: + :titlesonly: + :maxdepth: 1 + +{% for submodule in visible_submodules %} + {{ submodule.short_name }}/index.rst +{% endfor %} + + +{% endif %} +{% endblock %} +{% block content %} +{% if obj.all is not none %} +{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %} +{% elif obj.type is equalto("package") %} +{% set visible_children = obj.children|selectattr("display")|list %} +{% else %} +{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %} +{% endif %} +{% if visible_children %} + +{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} +{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} +{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %} +{% block classes %} +{% if visible_classes %} +Classes +~~~~~~~ + +.. autoapisummary:: + +{% for klass in visible_classes %} + {{ klass.id }} +{% endfor %} + + +{% endif %} +{% endblock %} + +{% block functions %} +{% if visible_functions %} +Functions +~~~~~~~~~ + +.. autoapisummary:: + +{% for function in visible_functions %} + {{ function.id }} +{% endfor %} + + +{% endif %} +{% endblock %} +{% endif %} +{% for obj_item in visible_children %} +{{ obj_item.rendered|indent(0) }} +{% endfor %} +{% endif %} +{% endblock %} diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index 56155306ff..8226a08ecb 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -78,178 +78,170 @@ STATIC NORETURN void math_error(void) { // 1.442695040888963407354163704 is 1/_M_LN2 #define log2(x) (log(x) * 1.442695040888963407354163704) #endif - //| Constants - //| --------- - //| - //| e: Any = ... - //| """base of the natural logarithm""" - //| - //| pi: Any = ... - //| """the ratio of a circle's circumference to its diameter""" - //| - //| Functions - //| --------- - //| - //| def acos(x: Any) -> Any: - //| """Return the inverse cosine of ``x``.""" - //| ... - //| - //| def asin(x: Any) -> Any: - //| """Return the inverse sine of ``x``.""" - //| ... - //| - //| def atan(x: Any) -> Any: - //| """Return the inverse tangent of ``x``.""" - //| ... - //| - //| def atan2(y: Any, x: Any) -> Any: - //| """Return the principal value of the inverse tangent of ``y/x``.""" - //| ... - //| - //| def ceil(x: Any) -> Any: - //| """Return an integer, being ``x`` rounded towards positive infinity.""" - //| ... - //| - //| def copysign(x: Any, y: Any) -> Any: - //| """Return ``x`` with the sign of ``y``.""" - //| ... - //| - //| def cos(x: Any) -> Any: - //| """Return the cosine of ``x``.""" - //| ... - //| - //| def degrees(x: Any) -> Any: - //| """Return radians ``x`` converted to degrees.""" - //| ... - //| - //| def exp(x: Any) -> Any: - //| """Return the exponential of ``x``.""" - //| ... - //| - //| def fabs(x: Any) -> Any: - //| """Return the absolute value of ``x``.""" - //| ... - //| - //| def floor(x: Any) -> Any: - //| """Return an integer, being ``x`` rounded towards negative infinity.""" - //| ... - //| - //| def fmod(x: Any, y: Any) -> Any: - //| """Return the remainder of ``x/y``.""" - //| ... - //| - //| def frexp(x: Any) -> Any: - //| """Decomposes a floating-point number into its mantissa and exponent. - //| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` - //| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise - //| the relation ``0.5 <= abs(m) < 1`` holds.""" - //| ... - //| - //| def isfinite(x: Any) -> Any: - //| """Return ``True`` if ``x`` is finite.""" - //| ... - //| - //| def isinf(x: Any) -> Any: - //| """Return ``True`` if ``x`` is infinite.""" - //| ... - //| - //| def isnan(x: Any) -> Any: - //| """Return ``True`` if ``x`` is not-a-number""" - //| ... - //| - //| def ldexp(x: Any, exp: Any) -> Any: - //| """Return ``x * (2**exp)``.""" - //| ... - //| - //| def modf(x: Any) -> Any: - //| """Return a tuple of two floats, being the fractional and integral parts of - //| ``x``. Both return values have the same sign as ``x``.""" - //| ... - //| - //| def pow(x: Any, y: Any) -> Any: - //| """Returns ``x`` to the power of ``y``.""" - //| - //| def radians(x: Any) -> Any: - //| """Return degrees ``x`` converted to radians.""" - //| - //| def sin(x: Any) -> Any: - //| """Return the sine of ``x``.""" - //| ... - //| - //| def sqrt(x: Any) -> Any: - //| """Returns the square root of ``x``.""" - //| ... - //| - //| def tan(x: Any) -> Any: ... - //| """Return the tangent of ``x``.""" - //| ... - //| - //| def trunc(x: Any) -> Any: - //| """Return an integer, being ``x`` rounded towards 0.""" - //| ... - //| +//| e: Any = ... +//| """base of the natural logarithm""" +//| +//| pi: Any = ... +//| """the ratio of a circle's circumference to its diameter""" +//| + +//| def acos(x: Any) -> Any: +//| """Return the inverse cosine of ``x``.""" +//| ... +//| +//| def asin(x: Any) -> Any: +//| """Return the inverse sine of ``x``.""" +//| ... +//| +//| def atan(x: Any) -> Any: +//| """Return the inverse tangent of ``x``.""" +//| ... +//| +//| def atan2(y: Any, x: Any) -> Any: +//| """Return the principal value of the inverse tangent of ``y/x``.""" +//| ... +//| +//| def ceil(x: Any) -> Any: +//| """Return an integer, being ``x`` rounded towards positive infinity.""" +//| ... +//| +//| def copysign(x: Any, y: Any) -> Any: +//| """Return ``x`` with the sign of ``y``.""" +//| ... +//| +//| def cos(x: Any) -> Any: +//| """Return the cosine of ``x``.""" +//| ... +//| +//| def degrees(x: Any) -> Any: +//| """Return radians ``x`` converted to degrees.""" +//| ... +//| +//| def exp(x: Any) -> Any: +//| """Return the exponential of ``x``.""" +//| ... +//| +//| def fabs(x: Any) -> Any: +//| """Return the absolute value of ``x``.""" +//| ... +//| +//| def floor(x: Any) -> Any: +//| """Return an integer, being ``x`` rounded towards negative infinity.""" +//| ... +//| +//| def fmod(x: Any, y: Any) -> Any: +//| """Return the remainder of ``x/y``.""" +//| ... +//| +//| def frexp(x: Any) -> Any: +//| """Decomposes a floating-point number into its mantissa and exponent. +//| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` +//| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise +//| the relation ``0.5 <= abs(m) < 1`` holds.""" +//| ... +//| +//| def isfinite(x: Any) -> Any: +//| """Return ``True`` if ``x`` is finite.""" +//| ... +//| +//| def isinf(x: Any) -> Any: +//| """Return ``True`` if ``x`` is infinite.""" +//| ... +//| +//| def isnan(x: Any) -> Any: +//| """Return ``True`` if ``x`` is not-a-number""" +//| ... +//| +//| def ldexp(x: Any, exp: Any) -> Any: +//| """Return ``x * (2**exp)``.""" +//| ... +//| +//| def modf(x: Any) -> Any: +//| """Return a tuple of two floats, being the fractional and integral parts of +//| ``x``. Both return values have the same sign as ``x``.""" +//| ... +//| +//| def pow(x: Any, y: Any) -> Any: +//| """Returns ``x`` to the power of ``y``.""" +//| +//| def radians(x: Any) -> Any: +//| """Return degrees ``x`` converted to radians.""" +//| +//| def sin(x: Any) -> Any: +//| """Return the sine of ``x``.""" +//| ... +//| +//| def sqrt(x: Any) -> Any: +//| """Returns the square root of ``x``.""" +//| ... +//| +//| def tan(x: Any) -> Any: +//| """Return the tangent of ``x``.""" +//| ... +//| +//| def trunc(x: Any) -> Any: +//| """Return an integer, being ``x`` rounded towards 0.""" +//| ... +//| MATH_FUN_1_ERRCOND(sqrt, sqrt, (x < (mp_float_t)0.0)) MATH_FUN_2(pow, pow) MATH_FUN_1(exp, exp) #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS -// Special functions -// ----------------- -// -// .. function:: expm1(x) -// -// Return ``exp(x) - 1``. -// +//| def expm1(x): +//| """Return ``exp(x) - 1``.""" +//| ... +//| MATH_FUN_1(expm1, expm1) -// .. function:: log2(x) -// -// Return the base-2 logarithm of ``x``. -// +//| def log2(x): +//| """Return the base-2 logarithm of ``x``.""" +//| ... +//| MATH_FUN_1_ERRCOND(log2, log2, (x <= (mp_float_t)0.0)) -// .. function:: log10(x) -// -// Return the base-10 logarithm of ``x``. -// +//| def log10(x): +//| """Return the base-10 logarithm of ``x``.""" +//| ... +//| MATH_FUN_1_ERRCOND(log10, log10, (x <= (mp_float_t)0.0)) -// .. function:: cosh(x) -// -// Return the hyperbolic cosine of ``x``. -// +//| def cosh(x): +//| """Return the hyperbolic cosine of ``x``.""" +//| ... +//| MATH_FUN_1(cosh, cosh) -// .. function:: sinh(x) -// -// Return the hyperbolic sine of ``x``. -// +//| def sinh(x): +//| """Return the hyperbolic sine of ``x``.""" +//| ... +//| MATH_FUN_1(sinh, sinh) -// .. function:: tanh(x) -// -// Return the hyperbolic tangent of ``x``. -// +//| def tanh(x): +//| """Return the hyperbolic tangent of ``x``.""" +//| ... +//| MATH_FUN_1(tanh, tanh) -// .. function:: acosh(x) -// -// Return the inverse hyperbolic cosine of ``x``. -// +//| def acosh(x): +//| """Return the inverse hyperbolic cosine of ``x``.""" +//| ... +//| MATH_FUN_1(acosh, acosh) -// .. function:: asinh(x) -// -// Return the inverse hyperbolic sine of ``x``. -// +//| def asinh(x): +//| """Return the inverse hyperbolic sine of ``x``.""" +//| ... +//| MATH_FUN_1(asinh, asinh) -// .. function:: atanh(x) -// -// Return the inverse hyperbolic tangent of ``x``. -// +//| def atanh(x): +//| """Return the inverse hyperbolic tangent of ``x``.""" +//| ... +//| MATH_FUN_1(atanh, atanh) #endif @@ -288,28 +280,28 @@ MATH_FUN_1_TO_INT(trunc, trunc) MATH_FUN_2(ldexp, ldexp) #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS -// .. function:: erf(x) -// -// Return the error function of ``x``. -// +//| def erf(x): +//| """Return the error function of ``x``.""" +//| ... +//| MATH_FUN_1(erf, erf) -// .. function:: erfc(x) -// -// Return the complementary error function of ``x``. -// +//| def erfc(x): +//| """Return the complementary error function of ``x``.""" +//| ... +//| MATH_FUN_1(erfc, erfc) -// .. function:: gamma(x) -// -// Return the gamma function of ``x``. -// +//| def gamma(x): +//| """Return the gamma function of ``x``.""" +//| ... +//| MATH_FUN_1(gamma, tgamma) -// .. function:: lgamma(x) -// -// Return the natural logarithm of the gamma function of ``x``. -// +//| def lgamma(x): +//| """Return the natural logarithm of the gamma function of ``x``.""" +//| ... +//| MATH_FUN_1(lgamma, lgamma) #endif //TODO: factorial, fsum diff --git a/shared-bindings/ulab/__init__.pyi b/shared-bindings/ulab/__init__.pyi index d2ff7eb80b..e5de1391b6 100644 --- a/shared-bindings/ulab/__init__.pyi +++ b/shared-bindings/ulab/__init__.pyi @@ -1,9 +1,4 @@ - -:mod:`ulab` --- Manipulate numeric data similar to numpy -======================================================== - -.. module:: ulab - :synopsis: Manipulate numeric data similar to numpy +"""Manipulate numeric data similar to numpy `ulab` is a numpy-like module for micropython, meant to simplify and speed up common mathematical operations on arrays. The primary goal was to @@ -17,507 +12,158 @@ https://micropython-ulab.readthedocs.io/en/latest/ `ulab` is modeled after numpy, and aims to be a compatible subset where possible. Numpy's documentation can be found at -https://docs.scipy.org/doc/numpy/index.html - -.. contents:: - -.. attribute:: __version__ - -The closest corresponding version of micropython-ulab - -ulab.array -- 1- and 2- dimensional array ------------------------------------------ - -.. class:: ulab.array(values, \*, dtype=float) - - :param sequence values: Sequence giving the initial content of the array. - :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` - - The `values` sequence can either be another ~ulab.array, sequence of numbers - (in which case a 1-dimensional array is created), or a sequence where each - subsequence has the same length (in which case a 2-dimensional array is - created). - - Passing a ~ulab.array and a different dtype can be used to convert an array - from one dtype to another. - - In many cases, it is more convenient to create an array from a function - like `zeros` or `linspace`. - - `ulab.array` implements the buffer protocol, so it can be used in many - places an `array.array` can be used. - - .. attribute:: shape - - The size of the array, a tuple of length 1 or 2 - - .. attribute:: size - - The number of elements in the array - - .. attribute:: itemsize - - The number of elements in the array - - .. method:: flatten(\*, order='C') - - :param order: Whether to flatten by rows ('C') or columns ('F') - - Returns a new `ulab.array` object which is always 1 dimensional. - If order is 'C' (the default", then the data is ordered in rows; - If it is 'F', then the data is ordered in columns. "C" and "F" refer - to the typical storage organization of the C and Fortran languages. - - .. method:: sort(\*, axis=1) - - :param axis: Whether to sort elements within rows (0), columns (1), or elements (None) - - .. method:: transpose() - - Swap the rows and columns of a 2-dimensional array - - .. method:: __add__() - - Adds corresponding elements of the two arrays, or adds a number to all - elements of the array. If both arguments are arrays, their sizes must match. - - .. method:: __sub__() - - Subtracts corresponding elements of the two arrays, or adds a number to all - elements of the array. If both arguments are arrays, their sizes must match. - - .. method:: __mul__() - - Multiplies corresponding elements of the two arrays, or multiplies - all elements of the array by a number. If both arguments are arrays, - their sizes must match. - - .. method:: __div__() - - Multiplies corresponding elements of the two arrays, or divides - all elements of the array by a number. If both arguments are arrays, - their sizes must match. - - .. method:: __pow__() - - Computes the power (x**y) of corresponding elements of the the two arrays, - or one number and one array. If both arguments are arrays, their sizes - must match. - - .. method:: __getitem__() - - Retrieve an element of the array. - - .. method:: __setitem__() - - Set an element of the array. - -Array type codes ----------------- -.. attribute:: int8 - - Type code for signed integers in the range -128 .. 127 inclusive, like the 'b' typecode of `array.array` - -.. attribute:: int16 - - Type code for signed integers in the range -32768 .. 32767 inclusive, like the 'h' typecode of `array.array` - -.. attribute:: float - - Type code for floating point values, like the 'f' typecode of `array.array` - -.. attribute:: uint8 - - Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array` - -.. attribute:: uint16 - - Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array` +https://docs.scipy.org/doc/numpy/index.html""" -Basic Array defining functions ------------------------------- +class array: + """1- and 2- dimensional array""" + def __init__(self, values, *, dtype=float): + """:param sequence values: Sequence giving the initial content of the array. + :param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float`` -.. method:: ones(shape, \*, dtype=float) + The `values` sequence can either be another ~ulab.array, sequence of numbers + (in which case a 1-dimensional array is created), or a sequence where each + subsequence has the same length (in which case a 2-dimensional array is + created). - .. param: shape - Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + Passing a ~ulab.array and a different dtype can be used to convert an array + from one dtype to another. - .. param: dtype - Type of values in the array + In many cases, it is more convenient to create an array from a function + like `zeros` or `linspace`. - Return a new array of the given shape with all elements set to 1. + `ulab.array` implements the buffer protocol, so it can be used in many + places an `array.array` can be used.""" + ... -.. method:: zeros + shape: tuple = ... + """The size of the array, a tuple of length 1 or 2""" - .. param: shape - Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + size: int = ... + """The number of elements in the array""" - .. param: dtype - Type of values in the array + itemsize: int = ... + """The number of elements in the array""" - Return a new array of the given shape with all elements set to 0. + def flatten(self, *, order='C'): + """:param order: Whether to flatten by rows ('C') or columns ('F') + + Returns a new `ulab.array` object which is always 1 dimensional. + If order is 'C' (the default", then the data is ordered in rows; + If it is 'F', then the data is ordered in columns. "C" and "F" refer + to the typical storage organization of the C and Fortran languages.""" + ... + + def sort(self, *, axis=1): + """:param axis: Whether to sort elements within rows (0), columns (1), or elements (None)""" + ... + + def transpose(self): + """Swap the rows and columns of a 2-dimensional array""" + ... + + def __add__(self): + """Adds corresponding elements of the two arrays, or adds a number to all + elements of the array. If both arguments are arrays, their sizes must match.""" + ... + + def __sub__(self): + """Subtracts corresponding elements of the two arrays, or adds a number to all + elements of the array. If both arguments are arrays, their sizes must match.""" + ... + + def __mul__(self): + """Multiplies corresponding elements of the two arrays, or multiplies + all elements of the array by a number. If both arguments are arrays, + their sizes must match.""" + ... + + def __div__(self): + """Multiplies corresponding elements of the two arrays, or divides + all elements of the array by a number. If both arguments are arrays, + their sizes must match.""" + ... + + def __pow__(): + """Computes the power (x**y) of corresponding elements of the the two arrays, + or one number and one array. If both arguments are arrays, their sizes + must match.""" + ... + + def __getitem__(): + """Retrieve an element of the array.""" + ... + + def __setitem__(): + """Set an element of the array.""" + ... + +int8 = ... +"""Type code for signed integers in the range -128 .. 127 inclusive, like the 'b' typecode of `array.array`""" + +int16 = ... +"""Type code for signed integers in the range -32768 .. 32767 inclusive, like the 'h' typecode of `array.array`""" + +float = ... +"""Type code for floating point values, like the 'f' typecode of `array.array`""" + +uint8 = ... +"""Type code for unsigned integers in the range 0 .. 255 inclusive, like the 'H' typecode of `array.array`""" + +uint16 = ... +"""Type code for unsigned integers in the range 0 .. 65535 inclusive, like the 'h' typecode of `array.array`""" + +def ones(shape, *, dtype=float): + """ + .. param: shape + Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + + .. param: dtype + Type of values in the array + + Return a new array of the given shape with all elements set to 1.""" + ... + +def zeros(shape, *, dtype): + """ + .. param: shape + Shape of the array, either an integer (for a 1-D array) or a tuple of 2 integers (for a 2-D array) + + .. param: dtype + Type of values in the array + + Return a new array of the given shape with all elements set to 0.""" + ... -.. method:: eye(size, \*, dtype=float) +def eye(size, *, dtype=float): + """Return a new square array of size, with the diagonal elements set to 1 + and the other elements set to 0.""" + ... - Return a new square array of size, with the diagonal elements set to 1 - and the other elements set to 0. - -.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True) - - .. param: start +def linspace(start, stop, *, dtype=float, num=50, endpoint=True): + """ + .. param: start First value in the array - .. param: stop + .. param: stop Final value in the array - .. param int: num + .. param int: num Count of values in the array - .. param: dtype + .. param: dtype Type of values in the array - .. param bool: endpoint + .. param bool: endpoint Whether the ``stop`` value is included. Note that even when endpoint=True, the exact ``stop`` value may not be included due to the inaccuracy of floating point arithmetic. - Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly. - - -:mod:`ulab.compare` --- Comparison functions -============================================ - -.. module::ulab.compare - -.. method:: clip(x1, x2, x3) - - Constrain the values from ``x1`` to be between ``x2`` and ``x3``. - ``x2`` is assumed to be less than or equal to ``x3``. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are all scalars, a 1-element - array is returned. - - Shorthand for ``ulab.maximum(x2, ulab.minimum(x1, x3))`` - -.. method:: maximum(x1, x2) - - Compute the element by element maximum of the arguments. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are both scalars, a number is - returned - -.. method:: minimum(x1, x2) - - Compute the element by element minimum of the arguments. - - Arguments may be ulab arrays or numbers. All array arguments - must be the same size. If the inputs are both scalars, a number is - returned - - -:mod:`ulab.vector` --- Element-by-element functions -=================================================== - -.. module:: ulab.vector - -These functions can operate on numbers, 1-D arrays, or 2-D arrays by -applying the function to every element in the array. This is typically -much more efficient than expressing the same operation as a Python loop. - -.. method:: acos - - Computes the inverse cosine function - -.. method:: acosh - - Computes the inverse hyperbolic cosine function - -.. method:: asin - - Computes the inverse sine function - -.. method:: asinh - - Computes the inverse hyperbolic sine function - -.. method:: around(a, \*, decimals) - - Returns a new float array in which each element is rounded to - ``decimals`` places. - -.. method:: atan - - Computes the inverse tangent function; the return values are in the - range [-pi/2,pi/2]. - -.. method:: atan2(y,x) - - Computes the inverse tangent function of y/x; the return values are in - the range [-pi, pi]. - -.. method:: atanh - - Computes the inverse hyperbolic tangent function - -.. method:: ceil - - Rounds numbers up to the next whole number - -.. method:: cos - - Computes the cosine function - -.. method:: erf - - Computes the error function, which has applications in statistics - -.. method:: erfc - - Computes the complementary error function, which has applications in statistics - -.. method:: exp - - Computes the exponent function. - -.. method:: expm1 - - Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function. - -.. method:: floor - - Rounds numbers up to the next whole number - -.. method:: gamma - - Computes the gamma function - -.. method:: lgamma - - Computes the natural log of the gamma function - -.. method:: log - - Computes the natural log - -.. method:: log10 - - Computes the log base 10 - -.. method:: log2 - - Computes the log base 2 - -.. method:: sin - - Computes the sine - -.. method:: sinh - - Computes the hyperbolic sine - -.. method:: sqrt - - Computes the square root - -.. method:: tan - - Computes the tangent - -.. method:: tanh - - Computes the hyperbolic tangent - -:mod:`ulab.linalg` - Linear algebra functions -============================================= - -.. module:: ulab.linalg - -.. method:: cholesky(A) - - :param ~ulab.array A: a positive definite, symmetric square matrix - :return ~ulab.array L: a square root matrix in the lower triangular form - :raises ValueError: If the input does not fulfill the necessary conditions - - The returned matrix satisfies the equation m=LL* - -.. method:: det - - :param: m, a square matrix - :return float: The determinant of the matrix - - Computes the eigenvalues and eigenvectors of a square matrix - -.. method:: dot(m1, m2) - - :param ~ulab.array m1: a matrix - :param ~ulab.array m2: a matrix - - Computes the matrix product of two matrices - - **WARNING:** Unlike ``numpy``, this function cannot be used to compute the dot product of two vectors - -.. method:: eig(m) - - :param m: a square matrix - :return tuple (eigenvectors, eigenvalues): - - Computes the eigenvalues and eigenvectors of a square matrix - -.. method:: inv(m) - - :param ~ulab.array m: a square matrix - :return: The inverse of the matrix, if it exists - :raises ValueError: if the matrix is not invertible - - Computes the inverse of a square matrix - -.. method:: size(array) - - Return the total number of elements in the array, as an integer. - -.. method:: trace(m) - - :param m: a square matrix - - Compute the trace of the matrix, the sum of its diagonal elements. - -:mod:`ulab.filter` --- Filtering functions -========================================== - -.. module:: ulab.filter - -.. method:: convolve(r, c=None) - - :param ulab.array a: - :param ulab.array v: - - Returns the discrete, linear convolution of two one-dimensional sequences. - The result is always an array of float. Only the ``full`` mode is supported, - and the ``mode`` named parameter of numpy is not accepted. Note that all other - modes can be had by slicing a ``full`` result. - - Convolution filters can implement high pass, low pass, band pass, etc., - filtering operations. Convolution filters are typically constructed ahead - of time. This can be done using desktop python with scipy, or on web pages - such as https://fiiir.com/ - - Convolution is most time-efficient when both inputs are of float type. - -:mod:`ulab.fft` --- Frequency-domain functions -============================================== - -.. module:: ulab.fft - -.. method:: fft(r, c=None) - - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value - :return tuple (r, c): The real and complex parts of the FFT - - Perform a Fast Fourier Transform from the time domain into the frequency domain - - See also ~ulab.extras.spectrum, which computes the magnitude of the fft, - rather than separately returning its real and imaginary parts. - -.. method:: ifft(r, c=None) - - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value - :return tuple (r, c): The real and complex parts of the inverse FFT - - Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain - -:mod:`ulab.numerical` --- Numerical and Statistical functions -============================================================= - -.. module:: ulab.numerical - -Most of these functions take an "axis" argument, which indicates whether to -operate over the flattened array (None), rows (0), or columns (1). - -.. method:: argmax(array, \*, axis=None) - - Return the index of the maximum element of the 1D array - -.. method:: argmin(array, \*, axis=None) - - Return the index of the minimum element of the 1D array - -.. method:: argsort(array, \*, axis=None) - - Returns an array which gives indices into the input array from least to greatest. - -.. method:: diff(array, \*, axis=1) - - Return the numerical derivative of successive elements of the array, as - an array. axis=None is not supported. - -.. method:: flip(array, \*, axis=None) - - Returns a new array that reverses the order of the elements along the - given axis, or along all axes if axis is None. - -.. method:: max(array, \*, axis=None) - - Return the maximum element of the 1D array - -.. method:: mean(array, \*, axis=None) - - Return the mean element of the 1D array, as a number if axis is None, otherwise as an array. - -.. method:: min(array, \*, axis=None) - - Return the minimum element of the 1D array - -.. method:: roll(array, distance, \*, axis=None) - - Shift the content of a vector by the positions given as the second - argument. If the ``axis`` keyword is supplied, the shift is applied to - the given axis. The array is modified in place. - -.. method:: std(array, \*, axis=None) - - Return the standard deviation of the array, as a number if axis is None, otherwise as an array. - -.. method:: sum(array, \*, axis=None) - - Return the sum of the array, as a number if axis is None, otherwise as an array. - -.. method:: sort(array, \*, axis=0) - - Sort the array along the given axis, or along all axes if axis is None. - The array is modified in place. - -:mod:`ulab.poly` --- Polynomial functions -========================================= - -.. module:: ulab.poly - -.. method:: polyfit([x, ] y, degree) - - Return a polynomial of given degree that approximates the function - f(x)=y. If x is not supplied, it is the range(len(y)). - -.. method:: polyval(p, x) - - Evaluate the polynomial p at the points x. x must be an array. - -:mod:`ulab.extras` --- Additional functions not in numpy -======================================================== - -.. method:: spectrum(r): - - :param ulab.array r: A 1-dimension array of values whose size is a power of 2 - - Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. - - This function is similar to scipy's ``scipy.signal.spectrogram``. + Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly.""" + ... diff --git a/shared-bindings/ulab/compare/__init__.pyi b/shared-bindings/ulab/compare/__init__.pyi new file mode 100644 index 0000000000..00a9eae1e6 --- /dev/null +++ b/shared-bindings/ulab/compare/__init__.pyi @@ -0,0 +1,30 @@ +"""Comparison functions""" + +def clip(x1, x2, x3): + """ + Constrain the values from ``x1`` to be between ``x2`` and ``x3``. + ``x2`` is assumed to be less than or equal to ``x3``. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are all scalars, a 1-element + array is returned. + + Shorthand for ``ulab.maximum(x2, ulab.minimum(x1, x3))``""" + ... + +def maximum(x1, x2): + """ + Compute the element by element maximum of the arguments. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are both scalars, a number is + returned""" + ... + +def minimum(x1, x2): + """Compute the element by element minimum of the arguments. + + Arguments may be ulab arrays or numbers. All array arguments + must be the same size. If the inputs are both scalars, a number is + returned""" + ... diff --git a/shared-bindings/ulab/extras/__init__.pyi b/shared-bindings/ulab/extras/__init__.pyi new file mode 100644 index 0000000000..4da56a5822 --- /dev/null +++ b/shared-bindings/ulab/extras/__init__.pyi @@ -0,0 +1,10 @@ +"""Additional functions not in numpy""" + +def spectrum(r): + """ + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + + Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal. + + This function is similar to scipy's ``scipy.signal.spectrogram``.""" + ... diff --git a/shared-bindings/ulab/fft/__init__.pyi b/shared-bindings/ulab/fft/__init__.pyi new file mode 100644 index 0000000000..401ecb6445 --- /dev/null +++ b/shared-bindings/ulab/fft/__init__.pyi @@ -0,0 +1,22 @@ +"""Frequency-domain functions""" + +def fft(r, c=None): + """ + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value + :return tuple (r, c): The real and complex parts of the FFT + + Perform a Fast Fourier Transform from the time domain into the frequency domain + + See also ~ulab.extras.spectrum, which computes the magnitude of the fft, + rather than separately returning its real and imaginary parts.""" + ... + +def ifft(r, c=None): + """ + :param ulab.array r: A 1-dimension array of values whose size is a power of 2 + :param ulab.array c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value + :return tuple (r, c): The real and complex parts of the inverse FFT + + Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain""" + ... diff --git a/shared-bindings/ulab/filter/__init__.pyi b/shared-bindings/ulab/filter/__init__.pyi new file mode 100644 index 0000000000..fff404300b --- /dev/null +++ b/shared-bindings/ulab/filter/__init__.pyi @@ -0,0 +1,19 @@ +"""Filtering functions""" + +def convolve(r, c=None): + """ + :param ulab.array a: + :param ulab.array v: + + Returns the discrete, linear convolution of two one-dimensional sequences. + The result is always an array of float. Only the ``full`` mode is supported, + and the ``mode`` named parameter of numpy is not accepted. Note that all other + modes can be had by slicing a ``full`` result. + + Convolution filters can implement high pass, low pass, band pass, etc., + filtering operations. Convolution filters are typically constructed ahead + of time. This can be done using desktop python with scipy, or on web pages + such as https://fiiir.com/ + + Convolution is most time-efficient when both inputs are of float type.""" + ... diff --git a/shared-bindings/ulab/linalg/__init__.pyi b/shared-bindings/ulab/linalg/__init__.pyi new file mode 100644 index 0000000000..d16e61807b --- /dev/null +++ b/shared-bindings/ulab/linalg/__init__.pyi @@ -0,0 +1,57 @@ +"""Linear algebra functions""" + + +def cholesky(A): + """ + :param ~ulab.array A: a positive definite, symmetric square matrix + :return ~ulab.array L: a square root matrix in the lower triangular form + :raises ValueError: If the input does not fulfill the necessary conditions + + The returned matrix satisfies the equation m=LL*""" + ... + +def det(): + """ + :param: m, a square matrix + :return float: The determinant of the matrix + + Computes the eigenvalues and eigenvectors of a square matrix""" + ... + +def dot(m1, m2): + """ + :param ~ulab.array m1: a matrix + :param ~ulab.array m2: a matrix + + Computes the matrix product of two matrices + + **WARNING:** Unlike ``numpy``, this function cannot be used to compute the dot product of two vectors""" + ... + +def eig(m): + """ + :param m: a square matrix + :return tuple (eigenvectors, eigenvalues): + + Computes the eigenvalues and eigenvectors of a square matrix""" + ... + +def inv(m): + """ + :param ~ulab.array m: a square matrix + :return: The inverse of the matrix, if it exists + :raises ValueError: if the matrix is not invertible + + Computes the inverse of a square matrix""" + ... + +def size(array): + """Return the total number of elements in the array, as an integer.""" + ... + +def trace(m): + """ + :param m: a square matrix + + Compute the trace of the matrix, the sum of its diagonal elements.""" + ... diff --git a/shared-bindings/ulab/numerical/__init__.pyi b/shared-bindings/ulab/numerical/__init__.pyi new file mode 100644 index 0000000000..7596789218 --- /dev/null +++ b/shared-bindings/ulab/numerical/__init__.pyi @@ -0,0 +1,57 @@ +"""Numerical and Statistical functions + +Most of these functions take an "axis" argument, which indicates whether to +operate over the flattened array (None), rows (0), or columns (1).""" + +def argmax(array, *, axis=None): + """Return the index of the maximum element of the 1D array""" + ... + +def argmin(array, *, axis=None): + """Return the index of the minimum element of the 1D array""" + ... + +def argsort(array, *, axis=None): + """Returns an array which gives indices into the input array from least to greatest.""" + ... + +def diff(array, *, axis=1): + """Return the numerical derivative of successive elements of the array, as + an array. axis=None is not supported.""" + ... + +def flip(array, *, axis=None): + """Returns a new array that reverses the order of the elements along the + given axis, or along all axes if axis is None.""" + ... + +def max(array, *, axis=None): + """Return the maximum element of the 1D array""" + ... + +def mean(array, *, axis=None): + """Return the mean element of the 1D array, as a number if axis is None, otherwise as an array.""" + ... + +def min(array, *, axis=None): + """Return the minimum element of the 1D array""" + ... + +def roll(array, distance, *, axis=None): + """Shift the content of a vector by the positions given as the second + argument. If the ``axis`` keyword is supplied, the shift is applied to + the given axis. The array is modified in place.""" + ... + +def std(array, *, axis=None): + """Return the standard deviation of the array, as a number if axis is None, otherwise as an array.""" + ... + +def sum(array, *, axis=None): + """Return the sum of the array, as a number if axis is None, otherwise as an array.""" + ... + +def sort(array, *, axis=0): + """Sort the array along the given axis, or along all axes if axis is None. + The array is modified in place.""" + ... diff --git a/shared-bindings/ulab/poly/__init__.pyi b/shared-bindings/ulab/poly/__init__.pyi new file mode 100644 index 0000000000..d051bbded4 --- /dev/null +++ b/shared-bindings/ulab/poly/__init__.pyi @@ -0,0 +1,10 @@ +"""Polynomial functions""" + +def polyfit(x, y, degree): + """Return a polynomial of given degree that approximates the function + f(x)=y. If x is not supplied, it is the range(len(y)).""" + ... + +def polyval(p, x): + """Evaluate the polynomial p at the points x. x must be an array.""" + ... diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi new file mode 100644 index 0000000000..2c7a804463 --- /dev/null +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -0,0 +1,108 @@ +"""Element-by-element functions + +These functions can operate on numbers, 1-D arrays, or 2-D arrays by +applying the function to every element in the array. This is typically +much more efficient than expressing the same operation as a Python loop.""" + +def acos(): + """Computes the inverse cosine function""" + ... + +def acosh(): + """Computes the inverse hyperbolic cosine function""" + ... + +def asin(): + """Computes the inverse sine function""" + ... + +def asinh(): + """Computes the inverse hyperbolic sine function""" + ... + +def around(a, *, decimals): + """Returns a new float array in which each element is rounded to + ``decimals`` places.""" + ... + +def atan(): + """Computes the inverse tangent function; the return values are in the + range [-pi/2,pi/2].""" + ... + +def atan2(y,x): + """Computes the inverse tangent function of y/x; the return values are in + the range [-pi, pi].""" + ... + +def atanh(): + """Computes the inverse hyperbolic tangent function""" + ... + +def ceil(): + """Rounds numbers up to the next whole number""" + ... + +def cos(): + """Computes the cosine function""" + ... + +def erf(): + """Computes the error function, which has applications in statistics""" + ... + +def erfc(): + """Computes the complementary error function, which has applications in statistics""" + ... + +def exp(): + """Computes the exponent function.""" + ... + +def expm1(): + """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" + ... + +def floor(): + """Rounds numbers up to the next whole number""" + ... + +def gamma(): + """Computes the gamma function""" + ... + +def lgamma(): + """Computes the natural log of the gamma function""" + ... + +def log(): + """Computes the natural log""" + ... + +def log10(): + """Computes the log base 10""" + ... + +def log2(): + """Computes the log base 2""" + ... + +def sin(): + """Computes the sine""" + ... + +def sinh(): + """Computes the hyperbolic sine""" + ... + +def sqrt(): + """Computes the square root""" + ... + +def tan(): + """Computes the tangent""" + ... + +def tanh(): + """Computes the hyperbolic tangent""" + ... diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 95370f7619..f15f15ba67 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -6,47 +6,47 @@ import traceback top_level = sys.argv[1].strip("/") stub_directory = sys.argv[2] -if top_level.count("/") == 1: - top_level, module = top_level.split("/") - modules = [module] -else: - modules = os.listdir(top_level) - modules = sorted(modules) - -ok = 0 -total = 0 -for module in modules: - module_path = os.path.join(top_level, module) - if not os.path.isdir(module_path): - continue +def convert_folder(top_level, stub_directory): + print(top_level, stub_directory) + ok = 0 + total = 0 + filenames = sorted(os.listdir(top_level)) pyi_lines = [] - classes = os.listdir(module_path) - classes = [x for x in sorted(classes) if x.endswith(".c")] - if classes and classes[-1] == "__init__.c": - classes.insert(0, classes.pop()) - for class_file in classes: - class_path = os.path.join(module_path, class_file) - with open(class_path, "r") as f: - for line in f: - if line.startswith("//|"): - if line[3] == " ": - line = line[4:] - elif line[3] == "\n": - line = line[3:] - else: - continue - pyi_lines.append(line) + for filename in filenames: + full_path = os.path.join(top_level, filename) + file_lines = [] + if os.path.isdir(full_path): + mok, mtotal = convert_folder(full_path, os.path.join(stub_directory, filename)) + ok += mok + total += mtotal + elif filename.endswith(".c"): + with open(full_path, "r") as f: + for line in f: + if line.startswith("//|"): + if line[3] == " ": + line = line[4:] + elif line[3] == "\n": + line = line[3:] + else: + continue + file_lines.append(line) + elif filename.endswith(".pyi"): + with open(full_path, "r") as f: + file_lines.extend(f.readlines()) - raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] - if raw_stubs and raw_stubs[-1] == "__init__.pyi": - raw_stubs.insert(0, raw_stubs.pop()) - for raw_stub in raw_stubs: - raw_stub_path = os.path.join(module_path, raw_stub) - with open(raw_stub_path, "r") as f: - pyi_lines.extend(f.readlines()) - stub_filename = os.path.join(stub_directory, module + ".pyi") + # Always put the contents from an __init__ first. + if filename.startswith("__init__."): + pyi_lines = file_lines + pyi_lines + else: + pyi_lines.extend(file_lines) + + if not pyi_lines: + return ok, total + + stub_filename = os.path.join(stub_directory, "__init__.pyi") print(stub_filename) stub_contents = "".join(pyi_lines) + os.makedirs(stub_directory, exist_ok=True) with open(stub_filename, "w") as f: f.write(stub_contents) @@ -59,6 +59,9 @@ for module in modules: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) print() + return ok, total + +ok, total = convert_folder(top_level, stub_directory) print(f"{ok} ok out of {total}") From 15c2d16bf927c4cbf6c4dbb9773b7c835f26c06d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 14 May 2020 16:06:13 -0700 Subject: [PATCH 491/919] Fix help doc --- shared-bindings/help.rst | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/shared-bindings/help.rst b/shared-bindings/help.rst index 63991bff2c..f6d72a5568 100644 --- a/shared-bindings/help.rst +++ b/shared-bindings/help.rst @@ -1,26 +1,26 @@ -# This file is part of the MicroPython project, http://micropython.org/ -# -# The MIT License (MIT) -# -# Copyright (c) 2016 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. +.. This file is part of the MicroPython project, http://micropython.org/ + + The MIT License (MIT) + + Copyright (c) 2016 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. :func:`help` - Built-in method to provide helpful information ============================================================== From 8ac3e7977f87219454dbab50264a723e797b877a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 14 May 2020 18:48:07 -0700 Subject: [PATCH 492/919] Remove debug prints --- conf.py | 1 - tools/extract_pyi.py | 1 - 2 files changed, 2 deletions(-) diff --git a/conf.py b/conf.py index ee65e39fb4..d6fa8f7e50 100644 --- a/conf.py +++ b/conf.py @@ -73,7 +73,6 @@ autoapi_type = 'python' # Uncomment this if debugging autoapi autoapi_keep_files = True autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circuitpython-stubs')] -print(autoapi_dirs) autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index f15f15ba67..e590e25f1f 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -7,7 +7,6 @@ top_level = sys.argv[1].strip("/") stub_directory = sys.argv[2] def convert_folder(top_level, stub_directory): - print(top_level, stub_directory) ok = 0 total = 0 filenames = sorted(os.listdir(top_level)) From 52b3e1faba958b351dc0bb040b2eee1fabb45007 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 May 2020 21:03:49 -0500 Subject: [PATCH 493/919] actions: upload artifacts for stubs & docs --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4216f61392..de3aa5a9e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,16 @@ jobs: working-directory: tests - name: Stubs run: make stubs -j2 + - uses: actions/upload-artifact@v2 + with: + name: stubs + path: circuitpython-stubs* - name: Docs run: sphinx-build -E -W -b html . _build/html + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/html - name: Translations run: make check-translate - name: New boards check From aba36e4abff80bc8897e752b93e7a2ffa4fd69e6 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 15 May 2020 10:14:09 +0800 Subject: [PATCH 494/919] aesio: use bufinfo rather than mp_str_bytes In order to accept both `bytes` objects and `bytearray` objects, use a `bufinfo` construct to retrieve the data rather than `mp_obj_str_get_data()`. Signed-off-by: Sean Cross --- shared-bindings/aesio/aes.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 4ddcfa898b..a8f92e251e 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -103,9 +103,10 @@ STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, STATIC mp_obj_t aesio_aes_rekey(size_t n_args, const mp_obj_t *pos_args) { aesio_aes_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - size_t key_length = 0; - const uint8_t *key = - (const uint8_t *)mp_obj_str_get_data(pos_args[1], &key_length); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(pos_args[1], &bufinfo, MP_BUFFER_READ); + const uint8_t *key = bufinfo.buf; + size_t key_length = bufinfo.len; if (key == NULL) { mp_raise_ValueError(translate("No key was specified")); } @@ -115,8 +116,9 @@ STATIC mp_obj_t aesio_aes_rekey(size_t n_args, const mp_obj_t *pos_args) { const uint8_t *iv = NULL; if (n_args > 2) { - size_t iv_length = 0; - iv = (const uint8_t *)mp_obj_str_get_data(pos_args[2], &iv_length); + mp_get_buffer_raise(pos_args[2], &bufinfo, MP_BUFFER_READ); + size_t iv_length = bufinfo.len; + iv = (const uint8_t *)bufinfo.buf; if (iv_length != AES_BLOCKLEN) { mp_raise_TypeError_varg(translate("IV must be %d bytes long"), AES_BLOCKLEN); @@ -246,11 +248,8 @@ MP_DEFINE_CONST_FUN_OBJ_2(aesio_aes_set_mode_obj, aesio_aes_set_mode); const mp_obj_property_t aesio_aes_mode_obj = { .base.type = &mp_type_property, - .proxy = { - (mp_obj_t)&aesio_aes_get_mode_obj, - (mp_obj_t)&aesio_aes_set_mode_obj, - (mp_obj_t)&mp_const_none_obj - }, + .proxy = {(mp_obj_t)&aesio_aes_get_mode_obj, + (mp_obj_t)&aesio_aes_set_mode_obj, (mp_obj_t)&mp_const_none_obj}, }; STATIC const mp_rom_map_elem_t aesio_locals_dict_table[] = { From f9ed3acf6d7582f495a4b6c1ae25aff5619a55ad Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 15 May 2020 10:20:49 +0800 Subject: [PATCH 495/919] aesio: specify writable buffers for destination buffers When calling `AES.decrypt_into()` or `AES.encrypt_into()`, the destination buffers may be any buffer kind. However, we currently aren't checking to make sure the destination buffer is actually writable. Specify `MP_BUFFER_WRITE` for the destination buffers of both of these objects so we don't inadvertently write to immutable data. Signed-off-by: Sean Cross --- shared-bindings/aesio/aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index a8f92e251e..d92865b8a1 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -173,7 +173,7 @@ STATIC mp_obj_t aesio_aes_encrypt_into(mp_obj_t aesio_obj, mp_obj_t src, mp_buffer_info_t srcbufinfo, destbufinfo; mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); - mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_WRITE); validate_length(aes, srcbufinfo.len, destbufinfo.len); memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); @@ -203,7 +203,7 @@ STATIC mp_obj_t aesio_aes_decrypt_into(mp_obj_t aesio_obj, mp_obj_t src, mp_buffer_info_t srcbufinfo, destbufinfo; mp_get_buffer_raise(src, &srcbufinfo, MP_BUFFER_READ); - mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(dest, &destbufinfo, MP_BUFFER_WRITE); validate_length(aes, srcbufinfo.len, destbufinfo.len); memcpy(destbufinfo.buf, srcbufinfo.buf, srcbufinfo.len); From fe3e8ee02c08e78691ebad293796985c9589824f Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Thu, 14 May 2020 21:16:26 -0700 Subject: [PATCH 496/919] Add bytearray.decode() for CPython compatibility CPython has a `decode()` method on `bytearray`. This adds that method using the code from `bytes.decode`. Test program: ```python byte_boi = bytes([0x6D, 0x65, 0x65, 0x70]) print(byte_boi) # b'meep' byte_boi_str = byte_boi.decode("utf-8") print(byte_boi_str) # meep byte_array_boi = bytearray(byte_boi) print(byte_array_boi) # bytearray(b'meep') byte_array_boi_str = byte_array_boi.decode("utf-8") print(byte_array_boi_str) # meep print(byte_array_boi_str == byte_boi_str) # True ``` --- py/objarray.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/py/objarray.c b/py/objarray.c index 9114a63c5a..5cdbd26788 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -63,6 +63,10 @@ STATIC mp_obj_t array_iterator_new(mp_obj_t array_in, mp_obj_iter_buf_t *iter_bu STATIC mp_obj_t array_append(mp_obj_t self_in, mp_obj_t arg); STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in); STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_uint_t flags); +#if MICROPY_CPYTHON_COMPAT +STATIC mp_obj_t array_decode(size_t n_args, const mp_obj_t *args); +#endif + /******************************************************************************/ // array @@ -546,10 +550,30 @@ STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_ui return 0; } + +#if MICROPY_CPYTHON_COMPAT +// Directly lifted from objstr.c +STATIC mp_obj_t array_decode(size_t n_args, const mp_obj_t *args) { + mp_obj_t new_args[2]; + if (n_args == 1) { + new_args[0] = args[0]; + new_args[1] = MP_OBJ_NEW_QSTR(MP_QSTR_utf_hyphen_8); + args = new_args; + n_args++; + } + return mp_obj_str_make_new(&mp_type_str, n_args, args, NULL); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(array_decode_obj, 1, 3, array_decode); +#endif + + #if MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_ARRAY STATIC const mp_rom_map_elem_t array_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) }, { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, +#if MICROPY_CPYTHON_COMPAT + { MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&array_decode_obj) }, +#endif }; STATIC MP_DEFINE_CONST_DICT(array_locals_dict, array_locals_dict_table); From 49cd9ac36e605d85ef393c8c009b90c418305ebe Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:29:41 -0400 Subject: [PATCH 497/919] Made extract_types return a more useful output --- tools/extract_types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/extract_types.py b/tools/extract_types.py index 502c69455d..f5b9e8613e 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -60,14 +60,17 @@ for module in modules: if isinstance(j, astroid.scoped_nodes.FunctionDef): if None in j.args.__dict__['annotations']: missing_parameter_type += 1 + print(f"Parameter: {j.__dict__['name']} on line {j.__dict__['lineno']}") total_1 += 1 if j.returns: if 'Any' in j.returns.__dict__.values(): - missing_return_type += 1 + print(f"Return: {j.__dict__['name']} on line {j.__dict__['lineno']}") + missing_return_type += 1 total_2 += 1 elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: missing_attribute_type += 1 + print(f"attribute on line {j.__dict__['lineno']}") total_3 += 1 From 416da442c073397112b54c8cc10ef6acc8af3197 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:33:20 -0400 Subject: [PATCH 498/919] Now outputs class name --- tools/extract_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/extract_types.py b/tools/extract_types.py index f5b9e8613e..d8de1c193b 100644 --- a/tools/extract_types.py +++ b/tools/extract_types.py @@ -56,6 +56,7 @@ for module in modules: try: tree = astroid.parse(stub_contents) for i in tree.body: + print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): if None in j.args.__dict__['annotations']: @@ -72,6 +73,7 @@ for module in modules: missing_attribute_type += 1 print(f"attribute on line {j.__dict__['lineno']}") total_3 += 1 + print('\n') ok += 1 From 0e39d4398c95412edd05c7202b7051fe7bd1e2b9 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:55:46 -0400 Subject: [PATCH 499/919] Merged extract_types into extract_pyi --- tools/extract_pyi.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 95370f7619..d6309212a0 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -53,12 +53,29 @@ for module in modules: # Validate that the module is a parseable stub. total += 1 try: - astroid.parse(stub_contents) + tree = astroid.parse(stub_contents) + for i in tree.body: + print(i.__dict__['name']) + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + a = '' + if None in j.args.__dict__['annotations']: + a += f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n" + if j.returns: + if 'Any' in j.returns.__dict__.values(): + a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" + if a: + raise TypeError(a) + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'Any' == j.__dict__['annotation'].__dict__['name']: + raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}") + ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - print() + except TypeError as err: + print(err) print(f"{ok} ok out of {total}") From acf88d7c0089c732222740a26a1d73563d016a13 Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 15 May 2020 13:57:13 -0400 Subject: [PATCH 500/919] Removed extract_types.py --- tools/extract_types.py | 91 ------------------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 tools/extract_types.py diff --git a/tools/extract_types.py b/tools/extract_types.py deleted file mode 100644 index d8de1c193b..0000000000 --- a/tools/extract_types.py +++ /dev/null @@ -1,91 +0,0 @@ -import os -import sys -import astroid -import traceback - -top_level = sys.argv[1].strip("/") - -if top_level.count("/") == 1: - top_level, module = top_level.split("/") - modules = [module] -else: - modules = os.listdir(top_level) - modules = sorted(modules) - -ok = 0 -total = 0 -for module in modules: - module_path = os.path.join(top_level, module) - if not os.path.isdir(module_path): - continue - pyi_lines = [] - classes = os.listdir(module_path) - classes = [x for x in sorted(classes) if x.endswith(".c")] - if classes and classes[-1] == "__init__.c": - classes.insert(0, classes.pop()) - for class_file in classes: - class_path = os.path.join(module_path, class_file) - with open(class_path, "r") as f: - for line in f: - if line.startswith("//|"): - if line[3] == " ": - line = line[4:] - elif line[3] == "\n": - line = line[3:] - else: - continue - pyi_lines.append(line) - - raw_stubs = [x for x in sorted(classes) if x.endswith(".pyi")] - if raw_stubs and raw_stubs[-1] == "__init__.pyi": - raw_stubs.insert(0, raw_stubs.pop()) - for raw_stub in raw_stubs: - raw_stub_path = os.path.join(module_path, raw_stub) - with open(raw_stub_path, "r") as f: - pyi_lines.extend(f.readlines()) - stub_contents = "".join(pyi_lines) - - # Validate that the module is a parseable stub. - total += 1 - missing_parameter_type = 0 - total_1 = 0 - missing_return_type = 0 - total_2 = 0 - missing_attribute_type = 0 - total_3 = 0 - try: - tree = astroid.parse(stub_contents) - for i in tree.body: - print(i.__dict__['name']) - for j in i.body: - if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - missing_parameter_type += 1 - print(f"Parameter: {j.__dict__['name']} on line {j.__dict__['lineno']}") - total_1 += 1 - if j.returns: - if 'Any' in j.returns.__dict__.values(): - print(f"Return: {j.__dict__['name']} on line {j.__dict__['lineno']}") - missing_return_type += 1 - total_2 += 1 - elif isinstance(j, astroid.node_classes.AnnAssign): - if 'Any' == j.__dict__['annotation'].__dict__['name']: - missing_attribute_type += 1 - print(f"attribute on line {j.__dict__['lineno']}") - total_3 += 1 - print('\n') - - - ok += 1 - except astroid.exceptions.AstroidSyntaxError as e: - e = e.__cause__ - traceback.print_exception(type(e), e, e.__traceback__) - print() - -print(f"{missing_parameter_type} of {total_1} are missing the parameter type") -print(f"{missing_return_type} of {total_2} are missing the return type") -print(f"{missing_attribute_type} of {total_3} are missing the attribute type") - - -if ok != total: - sys.exit(total - ok) From 99538c2414520dab8c0c2847b1a1f1f777189770 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 11 May 2020 11:15:02 -0400 Subject: [PATCH 501/919] Implement pin claiming, pin reset, and pin protections --- ports/mimxrt10xx/Makefile | 1 + .../mimxrt10xx/boards/feather_m7_1011/board.c | 18 + .../boards/feather_mimxrt1011/board.c | 18 + .../boards/feather_mimxrt1062/board.c | 23 ++ ports/mimxrt10xx/boards/imxrt1010_evk/board.c | 16 + ports/mimxrt10xx/boards/imxrt1020_evk/board.c | 17 + ports/mimxrt10xx/boards/imxrt1060_evk/board.c | 23 ++ ports/mimxrt10xx/boards/teensy40/board.c | 17 + .../mimxrt10xx/common-hal/analogio/AnalogIn.c | 3 +- .../common-hal/digitalio/DigitalInOut.c | 6 +- .../common-hal/microcontroller/Pin.c | 218 +++------- .../common-hal/microcontroller/Pin.h | 8 +- .../peripherals/mimxrt10xx/MIMXRT1011/pins.c | 134 +++++-- .../peripherals/mimxrt10xx/MIMXRT1011/pins.h | 2 + .../peripherals/mimxrt10xx/MIMXRT1021/pins.c | 282 ++++++++----- .../peripherals/mimxrt10xx/MIMXRT1021/pins.h | 2 + .../peripherals/mimxrt10xx/MIMXRT1062/pins.c | 375 ++++++++++++------ .../peripherals/mimxrt10xx/MIMXRT1062/pins.h | 2 + .../mimxrt10xx/peripherals/mimxrt10xx/pins.h | 12 +- 19 files changed, 742 insertions(+), 435 deletions(-) diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 59b833cc52..9e2c6d236d 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -88,6 +88,7 @@ ifeq ($(DEBUG), 1) # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra else + CFLAGS += -ggdb #CFLAGS += -flto -flto-partition=none endif diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/board.c b/ports/mimxrt10xx/boards/feather_m7_1011/board.c index 52dd498b3f..8763cd5708 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/board.c @@ -27,8 +27,26 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_13);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_12);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_09);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_12); + common_hal_never_reset_pin(&pin_GPIO_SD_11); + common_hal_never_reset_pin(&pin_GPIO_SD_10); + common_hal_never_reset_pin(&pin_GPIO_SD_09); + common_hal_never_reset_pin(&pin_GPIO_SD_08); + common_hal_never_reset_pin(&pin_GPIO_SD_07); + common_hal_never_reset_pin(&pin_GPIO_SD_06); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_12); + common_hal_never_reset_pin(&pin_GPIO_13); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c index 52dd498b3f..8763cd5708 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c @@ -27,8 +27,26 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_13);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_12);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_09);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_12); + common_hal_never_reset_pin(&pin_GPIO_SD_11); + common_hal_never_reset_pin(&pin_GPIO_SD_10); + common_hal_never_reset_pin(&pin_GPIO_SD_09); + common_hal_never_reset_pin(&pin_GPIO_SD_08); + common_hal_never_reset_pin(&pin_GPIO_SD_07); + common_hal_never_reset_pin(&pin_GPIO_SD_06); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_12); + common_hal_never_reset_pin(&pin_GPIO_13); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c index 52dd498b3f..c3895473ef 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c @@ -27,8 +27,31 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_01); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_02); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_03); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_04); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index 52dd498b3f..b94e6055e4 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -27,8 +27,24 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_13); //SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_12); //SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_09); //SWO + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_12); + common_hal_never_reset_pin(&pin_GPIO_SD_11); + common_hal_never_reset_pin(&pin_GPIO_SD_10); + common_hal_never_reset_pin(&pin_GPIO_SD_09); + common_hal_never_reset_pin(&pin_GPIO_SD_08); + common_hal_never_reset_pin(&pin_GPIO_SD_07); + common_hal_never_reset_pin(&pin_GPIO_SD_06); + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_12); + common_hal_never_reset_pin(&pin_GPIO_13); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index 52dd498b3f..aaa7b382c0 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -27,8 +27,25 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_00);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_B0_01);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B1_11); + common_hal_never_reset_pin(&pin_GPIO_AD_B1_12); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index 52dd498b3f..c3895473ef 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -27,8 +27,31 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_01); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_02); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_03); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_04); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 52dd498b3f..a16e901037 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -27,8 +27,25 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // SWD Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO + + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // USB Pins + common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index 2cc2681b44..9587eba633 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -26,6 +26,7 @@ */ #include "common-hal/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include @@ -65,7 +66,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) { if (common_hal_analogio_analogin_deinited(self)) { return; } - reset_pin_number(self->pin->number); + common_hal_reset_pin(self->pin); self->pin = NULL; } diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 603515764f..4c2f8c87ee 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -34,7 +34,7 @@ #include "fsl_gpio.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "supervisor/shared/translate.h" @@ -74,7 +74,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { - never_reset_pin_number(self->pin->number); + never_reset_pin_number(self->pin->port, self->pin->number); } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { @@ -85,7 +85,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self if (common_hal_digitalio_digitalinout_deinited(self)) { return; } - reset_pin_number(self->pin->number); + common_hal_reset_pin(self->pin); self->pin = NULL; } diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 21e61d29d4..0b438144ca 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -31,170 +31,69 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif -#ifdef MICROPY_HW_APA102_MOSI -bool apa102_sck_in_use; -bool apa102_mosi_in_use; -#endif -#ifdef SPEAKER_ENABLE_PIN -bool speaker_enable_in_use; -#endif -//TODO +#define GPIO_PORT_COUNT (IOMUXC_SW_PAD_CTL_PAD_COUNT / 32 + 1) -#define PORT_COUNT (IOMUXC_SW_PAD_CTL_PAD_COUNT / 32 + 1) - -//STATIC uint32_t never_reset_pins[PORT_COUNT]; +// GPIO ports are 32 pins wide +STATIC uint32_t claimed_pins[GPIO_PORT_COUNT]; //remove? +STATIC uint32_t never_reset_pins[GPIO_PORT_COUNT]; +// There are two numbering systems used here: +// IOMUXC index, used for iterating through pins and accessing reset information, +// and GPIO port and number, used to store claimed and reset tagging. The two number +// systems are not related and one cannot determine the other without a pin object void reset_all_pins(void) { -// uint32_t pin_mask[PORT_COUNT] = PORT_OUT_IMPLEMENTED; - -// // Do not full reset USB lines. -// pin_mask[0] &= ~(PORT_PA24 | PORT_PA25); - -// // Do not reset SWD when a debugger is present. -// if (DSU->STATUSB.bit.DBGPRES == 1) { -// pin_mask[0] &= ~(PORT_PA30 | PORT_PA31); -// } - -// for (uint32_t i = 0; i < PORT_COUNT; i++) { -// pin_mask[i] &= ~never_reset_pins[i]; -// } - -// gpio_set_port_direction(GPIO_PORTA, pin_mask[0] & ~MICROPY_PORT_A, GPIO_DIRECTION_OFF); -// gpio_set_port_direction(GPIO_PORTB, pin_mask[1] & ~MICROPY_PORT_B, GPIO_DIRECTION_OFF); -// #if PORT_BITS > 64 -// gpio_set_port_direction(GPIO_PORTC, pin_mask[2] & ~MICROPY_PORT_C, GPIO_DIRECTION_OFF); -// #endif -// #if PORT_BITS > 96 -// gpio_set_port_direction(GPIO_PORTD, pin_mask[3] & ~MICROPY_PORT_D, GPIO_DIRECTION_OFF); -// #endif -// -// // Configure SWD. SWDIO will be automatically switched on PA31 when a signal is input on -// // SWCLK. -// #ifdef SAMD51 -// gpio_set_pin_function(PIN_PA30, MUX_PA30H_CM4_SWCLK); -// #endif -// #ifdef SAMD21 -// gpio_set_pin_function(PIN_PA30, GPIO_PIN_FUNCTION_G); -// gpio_set_pin_function(PIN_PA31, GPIO_PIN_FUNCTION_G); -// #endif -// - #ifdef MICROPY_HW_NEOPIXEL - neopixel_in_use = false; - #endif - #ifdef MICROPY_HW_APA102_MOSI - apa102_sck_in_use = false; - apa102_mosi_in_use = false; - #endif - - // After configuring SWD because it may be shared. - #ifdef SPEAKER_ENABLE_PIN - speaker_enable_in_use = false; -// gpio_set_pin_function(SPEAKER_ENABLE_PIN->number, GPIO_PIN_FUNCTION_OFF); -// gpio_set_pin_direction(SPEAKER_ENABLE_PIN->number, GPIO_DIRECTION_OUT); -// gpio_set_pin_level(SPEAKER_ENABLE_PIN->number, false); - #endif -} - -void never_reset_pin_number(uint8_t pin_number) { -// never_reset_pins[GPIO_PORT(pin_number)] |= 1 << GPIO_PIN(pin_number); -} - -void reset_pin_number(uint8_t pin_number) { - // never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number)); - - if (pin_number >= IOMUXC_SW_PAD_CTL_PAD_COUNT) { - return; + for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { + claimed_pins[i] = never_reset_pins[i]; + } + for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { + // mp_printf(&mp_plat_print, "CTL MUX i=%d:%x\n",i,IOMUXC->SW_MUX_CTL_PAD[i]); + // mp_printf(&mp_plat_print, "CTL PAD i=%d:%x\n",i,IOMUXC->SW_PAD_CTL_PAD[i]); + if(!(never_reset_pins[mcu_pin_list[i].port] & (1 << mcu_pin_list[i].number))) { + // mp_printf(&mp_plat_print, "SUCCESS\n"); + IOMUXC->SW_MUX_CTL_PAD[i] = mcu_pin_list[i].mux_reset; + IOMUXC->SW_PAD_CTL_PAD[i] = mcu_pin_list[i].pad_reset; + } } #ifdef MICROPY_HW_NEOPIXEL - if (pin_number == MICROPY_HW_NEOPIXEL->number) { + neopixel_in_use = false; + #endif +} + +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + never_reset_pins[pin_port] |= 1 << pin_number; +} + +// Since i.MX pins need extra register and reset information to reset properly, +// resetting pins by number alone has been removed. +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { + never_reset_pins[pin->port] &= ~(1 << pin->number); + claimed_pins[pin->port] &= ~(1 << pin->number); + *(uint32_t*)pin->mux_reg = pin->mux_reset; + *(uint32_t*)pin->cfg_reg = pin->pad_reset; + + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { neopixel_in_use = false; rgb_led_status_init(); return; } #endif - #ifdef MICROPY_HW_APA102_MOSI - if (pin_number == MICROPY_HW_APA102_MOSI->number || - pin_number == MICROPY_HW_APA102_SCK->number) { -// apa102_mosi_in_use = apa102_mosi_in_use && pin_number != MICROPY_HW_APA102_MOSI->number; -// apa102_sck_in_use = apa102_sck_in_use && pin_number != MICROPY_HW_APA102_SCK->number; - if (!apa102_sck_in_use && !apa102_mosi_in_use) { -// rgb_led_status_init(); - } - return; - } - #endif +} -// if (pin_number == PIN_PA30 -// #ifdef SAMD51 -// ) { -// #endif -// #ifdef SAMD21 -// || pin_number == PIN_PA31) { -// #endif -// gpio_set_pin_function(pin_number, SWD_MUX); -// } else { -// gpio_set_pin_direction(pin_number, GPIO_DIRECTION_OFF); -// gpio_set_pin_function(pin_number, GPIO_PIN_FUNCTION_OFF); -// } -// - #ifdef SPEAKER_ENABLE_PIN - if (pin_number == SPEAKER_ENABLE_PIN->number) { - speaker_enable_in_use = false; -// gpio_set_pin_function(pin_number, GPIO_PIN_FUNCTION_OFF); -// gpio_set_pin_direction(SPEAKER_ENABLE_PIN->number, GPIO_DIRECTION_OUT); -// gpio_set_pin_level(SPEAKER_ENABLE_PIN->number, false); - } - #endif +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { + never_reset_pin_number(pin->port, pin->number); } void claim_pin(const mcu_pin_obj_t* pin) { + claimed_pins[pin->port] |= 1 << pin->number; + #ifdef MICROPY_HW_NEOPIXEL if (pin == MICROPY_HW_NEOPIXEL) { neopixel_in_use = true; } #endif - #ifdef MICROPY_HW_APA102_MOSI - if (pin == MICROPY_HW_APA102_MOSI) { - apa102_mosi_in_use = true; - } - if (pin == MICROPY_HW_APA102_SCK) { - apa102_sck_in_use = true; - } - #endif - - #ifdef SPEAKER_ENABLE_PIN - if (pin == SPEAKER_ENABLE_PIN) { - speaker_enable_in_use = true; - } - #endif -} - -bool pin_number_is_free(uint8_t pin_number) { -// PortGroup *const port = &PORT->Group[(enum gpio_port)GPIO_PORT(pin_number)]; -// uint8_t pin_index = GPIO_PIN(pin_number); -// volatile PORT_PINCFG_Type *state = &port->PINCFG[pin_index]; -// volatile PORT_PMUX_Type *pmux = &port->PMUX[pin_index / 2]; -// -// if (pin_number == PIN_PA30 || pin_number == PIN_PA31) { -// if (DSU->STATUSB.bit.DBGPRES == 1) { -// return false; -// } -// if (pin_number == PIN_PA30 -// #ifdef SAMD51 -// ) { -// #endif -// #ifdef SAMD21 -// || pin_number == PIN_PA31) { -// #endif) { -// return state->bit.PMUXEN == 1 && ((pmux->reg >> (4 * pin_index % 2)) & 0xf) == SWD_MUX; -// } -// } -// -// return state->bit.PMUXEN == 0 && state->bit.INEN == 0 && -// state->bit.PULLEN == 0 && (port->DIR.reg & (1 << pin_index)) == 0; - return true; } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { @@ -203,28 +102,23 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { return !neopixel_in_use; } #endif - #ifdef MICROPY_HW_APA102_MOSI - if (pin == MICROPY_HW_APA102_MOSI) { - return !apa102_mosi_in_use; - } - if (pin == MICROPY_HW_APA102_SCK) { - return !apa102_sck_in_use; - } - #endif - #ifdef SPEAKER_ENABLE_PIN - if (pin == SPEAKER_ENABLE_PIN) { - return !speaker_enable_in_use; - } - #endif - - return pin_number_is_free(pin->number); + return !(claimed_pins[pin->port] & 1<number); } -void common_hal_reset_pin(const mcu_pin_obj_t* pin) { -// reset_pin_number(pin->number); +uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) { + return pin->mux_idx; // returns IOMUXC to align with pin table + // Note: IOMUXC "numbers" do not align cleanly with GPIO values } -void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { -// never_reset_pin_number(pin->port, pin->number); +void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { + claim_pin(pin); } + +void common_hal_mcu_pin_reset_number(uint8_t pin_no) { + common_hal_reset_pin(&mcu_pin_list[pin_no]); +} + +// TODO: replace use of GPIO pointers in pin struct with this system? +// GPIO_TypeDef * pin_port(uint8_t pin_port) {} +// uint16_t pin_mask(uint8_t pin_number) {} diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 74a1f7cbbd..def583973b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -35,17 +35,11 @@ #ifdef MICROPY_HW_NEOPIXEL extern bool neopixel_in_use; #endif -#ifdef MICROPY_HW_APA102_MOSI -extern bool apa102_sck_in_use; -extern bool apa102_mosi_in_use; -#endif void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. -void reset_pin_number(uint8_t pin_number); -void never_reset_pin_number(uint8_t pin_number); +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); void claim_pin(const mcu_pin_obj_t* pin); -bool pin_number_is_free(uint8_t pin_number); #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c index 8e68e77027..034efb3b6e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c @@ -29,49 +29,97 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_00 = PIN(GPIO1, 0, GPIO_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_01 = PIN(GPIO1, 1, GPIO_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_02 = PIN(GPIO1, 2, GPIO_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_03 = PIN(GPIO1, 3, GPIO_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_04 = PIN(GPIO1, 4, GPIO_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_05 = PIN(GPIO1, 5, GPIO_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_06 = PIN(GPIO1, 6, GPIO_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_07 = PIN(GPIO1, 7, GPIO_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_08 = PIN(GPIO1, 8, GPIO_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_09 = PIN(GPIO1, 9, GPIO_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_10 = PIN(GPIO1, 10, GPIO_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_11 = PIN(GPIO1, 11, GPIO_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_12 = PIN(GPIO1, 12, GPIO_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_13 = PIN(GPIO1, 13, GPIO_13, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_00 = PIN(GPIO1, 0, 0, GPIO_00, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_01 = PIN(GPIO1, 0, 1, GPIO_01, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_02 = PIN(GPIO1, 0, 2, GPIO_02, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_03 = PIN(GPIO1, 0, 3, GPIO_03, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_04 = PIN(GPIO1, 0, 4, GPIO_04, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_05 = PIN(GPIO1, 0, 5, GPIO_05, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_06 = PIN(GPIO1, 0, 6, GPIO_06, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_07 = PIN(GPIO1, 0, 7, GPIO_07, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_08 = PIN(GPIO1, 0, 8, GPIO_08, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_09 = PIN(GPIO1, 0, 9, GPIO_09, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_10 = PIN(GPIO1, 0, 10, GPIO_10, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_11 = PIN(GPIO1, 0, 11, GPIO_11, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_12 = PIN(GPIO1, 0, 12, GPIO_12, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_13 = PIN(GPIO1, 0, 13, GPIO_13, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_00 = PIN(GPIO1, 14, GPIO_AD_00, ADC1, 0); -const mcu_pin_obj_t pin_GPIO_AD_01 = PIN(GPIO1, 15, GPIO_AD_01, ADC1, 1); -const mcu_pin_obj_t pin_GPIO_AD_02 = PIN(GPIO1, 16, GPIO_AD_02, ADC1, 2); -const mcu_pin_obj_t pin_GPIO_AD_03 = PIN(GPIO1, 17, GPIO_AD_03, ADC1, 3); -const mcu_pin_obj_t pin_GPIO_AD_04 = PIN(GPIO1, 18, GPIO_AD_04, ADC1, 4); -const mcu_pin_obj_t pin_GPIO_AD_05 = PIN(GPIO1, 19, GPIO_AD_05, ADC1, 5); -const mcu_pin_obj_t pin_GPIO_AD_06 = PIN(GPIO1, 20, GPIO_AD_06, ADC1, 6); -const mcu_pin_obj_t pin_GPIO_AD_07 = PIN(GPIO1, 21, GPIO_AD_07, ADC1, 7); -const mcu_pin_obj_t pin_GPIO_AD_08 = PIN(GPIO1, 22, GPIO_AD_08, ADC1, 8); -const mcu_pin_obj_t pin_GPIO_AD_09 = PIN(GPIO1, 23, GPIO_AD_09, ADC1, 9); -const mcu_pin_obj_t pin_GPIO_AD_10 = PIN(GPIO1, 24, GPIO_AD_10, ADC1, 10); -const mcu_pin_obj_t pin_GPIO_AD_11 = PIN(GPIO1, 25, GPIO_AD_11, ADC1, 11); -const mcu_pin_obj_t pin_GPIO_AD_12 = PIN(GPIO1, 26, GPIO_AD_12, ADC1, 12); -const mcu_pin_obj_t pin_GPIO_AD_13 = PIN(GPIO1, 27, GPIO_AD_13, ADC1, 13); -const mcu_pin_obj_t pin_GPIO_AD_14 = PIN(GPIO1, 28, GPIO_AD_14, ADC1, 14); +const mcu_pin_obj_t pin_GPIO_AD_00 = PIN(GPIO1, 0, 14, GPIO_AD_00, ADC1, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_01 = PIN(GPIO1, 0, 15, GPIO_AD_01, ADC1, 1, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_02 = PIN(GPIO1, 0, 16, GPIO_AD_02, ADC1, 2, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_03 = PIN(GPIO1, 0, 17, GPIO_AD_03, ADC1, 3, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_04 = PIN(GPIO1, 0, 18, GPIO_AD_04, ADC1, 4, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_05 = PIN(GPIO1, 0, 19, GPIO_AD_05, ADC1, 5, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_06 = PIN(GPIO1, 0, 20, GPIO_AD_06, ADC1, 6, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_07 = PIN(GPIO1, 0, 21, GPIO_AD_07, ADC1, 7, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_08 = PIN(GPIO1, 0, 22, GPIO_AD_08, ADC1, 8, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_09 = PIN(GPIO1, 0, 23, GPIO_AD_09, ADC1, 9, 0x00000007, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_10 = PIN(GPIO1, 0, 24, GPIO_AD_10, ADC1, 10, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_11 = PIN(GPIO1, 0, 25, GPIO_AD_11, ADC1, 11, 0x00000007, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_12 = PIN(GPIO1, 0, 26, GPIO_AD_12, ADC1, 12, 0x00000007, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_13 = PIN(GPIO1, 0, 27, GPIO_AD_13, ADC1, 13, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_14 = PIN(GPIO1, 0, 28, GPIO_AD_14, ADC1, 14, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_00 = PIN(GPIO2, 0, GPIO_SD_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_01 = PIN(GPIO2, 1, GPIO_SD_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_02 = PIN(GPIO2, 2, GPIO_SD_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_03 = PIN(GPIO2, 3, GPIO_SD_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_04 = PIN(GPIO2, 4, GPIO_SD_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_05 = PIN(GPIO2, 5, GPIO_SD_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_06 = PIN(GPIO2, 6, GPIO_SD_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_07 = PIN(GPIO2, 7, GPIO_SD_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_08 = PIN(GPIO2, 8, GPIO_SD_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_09 = PIN(GPIO2, 9, GPIO_SD_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_10 = PIN(GPIO2, 10, GPIO_SD_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_11 = PIN(GPIO2, 11, GPIO_SD_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_12 = PIN(GPIO2, 12, GPIO_SD_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_13 = PIN(GPIO2, 13, GPIO_SD_13, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_SD_00 = PIN(GPIO2, 1, 0, GPIO_SD_00, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_01 = PIN(GPIO2, 1, 1, GPIO_SD_01, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_02 = PIN(GPIO2, 1, 2, GPIO_SD_02, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_03 = PIN(GPIO2, 1, 3, GPIO_SD_03, NO_ADC, 0, 0x00000006, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_SD_04 = PIN(GPIO2, 1, 4, GPIO_SD_04, NO_ADC, 0, 0x00000006, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_SD_05 = PIN(GPIO2, 1, 5, GPIO_SD_05, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_06 = PIN(GPIO2, 1, 6, GPIO_SD_06, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_07 = PIN(GPIO2, 1, 7, GPIO_SD_07, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_08 = PIN(GPIO2, 1, 8, GPIO_SD_08, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_09 = PIN(GPIO2, 1, 9, GPIO_SD_09, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_10 = PIN(GPIO2, 1, 10, GPIO_SD_10, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_11 = PIN(GPIO2, 1, 11, GPIO_SD_11, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_12 = PIN(GPIO2, 1, 12, GPIO_SD_12, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_13 = PIN(GPIO2, 1, 13, GPIO_SD_13, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_14 = PIN(GPIO2, 1, 14, GPIO_SD_14, NO_ADC, 0, 0x00000000, 0x000010A0); +// pin_GPIO_SD_14 isn't actually used as a pad but we include it anyway to make resetting easier +const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { + pin_GPIO_AD_14, + pin_GPIO_AD_13, + pin_GPIO_AD_12, + pin_GPIO_AD_11, + pin_GPIO_AD_10, + pin_GPIO_AD_09, + pin_GPIO_AD_08, + pin_GPIO_AD_07, + pin_GPIO_AD_06, + pin_GPIO_AD_05, + pin_GPIO_AD_04, + pin_GPIO_AD_03, + pin_GPIO_AD_02, + pin_GPIO_AD_01, + pin_GPIO_AD_00, + pin_GPIO_SD_14, //spooky ghost pin + pin_GPIO_SD_13, + pin_GPIO_SD_12, + pin_GPIO_SD_11, + pin_GPIO_SD_10, + pin_GPIO_SD_09, + pin_GPIO_SD_08, + pin_GPIO_SD_07, + pin_GPIO_SD_06, + pin_GPIO_SD_05, + pin_GPIO_SD_04, + pin_GPIO_SD_03, + pin_GPIO_SD_02, + pin_GPIO_SD_01, + pin_GPIO_SD_00, + pin_GPIO_13, + pin_GPIO_12, + pin_GPIO_11, + pin_GPIO_10, + pin_GPIO_09, + pin_GPIO_08, + pin_GPIO_07, + pin_GPIO_06, + pin_GPIO_05, + pin_GPIO_04, + pin_GPIO_03, + pin_GPIO_02, + pin_GPIO_01, + pin_GPIO_00, +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.h index 6b31d6d8ed..58ef7329e7 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.h @@ -74,4 +74,6 @@ extern const mcu_pin_obj_t pin_GPIO_AD_12; extern const mcu_pin_obj_t pin_GPIO_AD_13; extern const mcu_pin_obj_t pin_GPIO_AD_14; +extern const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PINS_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c index 4106c9bad4..629fdf4bd6 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c @@ -29,100 +29,196 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, GPIO_AD_B0_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 1, GPIO_AD_B0_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 2, GPIO_AD_B0_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 3, GPIO_AD_B0_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 4, GPIO_AD_B0_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 5, GPIO_AD_B0_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 6, GPIO_AD_B0_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 7, GPIO_AD_B0_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 8, GPIO_AD_B0_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 9, GPIO_AD_B0_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 10, GPIO_AD_B0_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 11, GPIO_AD_B0_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 12, GPIO_AD_B0_12, ADC1, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 13, GPIO_AD_B0_13, ADC2, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 14, GPIO_AD_B0_14, ADC2, 1); -const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 15, GPIO_AD_B0_15, ADC1, 2); +const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 0, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 0, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 0, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 0, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 0, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 0, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 0, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 0, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 0, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 0, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 0, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 0, 12, GPIO_AD_B0_12, ADC1, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 0, 13, GPIO_AD_B0_13, ADC2, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 0, 14, GPIO_AD_B0_14, ADC2, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 0, 15, GPIO_AD_B0_15, ADC1, 2, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 16, GPIO_AD_B1_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 17, GPIO_AD_B1_01, ADC1, 3); -const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 18, GPIO_AD_B1_02, ADC2, 3); -const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 19, GPIO_AD_B1_03, ADC1, 4); -const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 20, GPIO_AD_B1_04, ADC2, 4); -const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 21, GPIO_AD_B1_05, ADC2, 5); -const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 22, GPIO_AD_B1_06, ADC2, 6); -const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 23, GPIO_AD_B1_07, ADC2, 7); -const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 24, GPIO_AD_B1_08, ADC2, 8); -const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 25, GPIO_AD_B1_09, ADC2, 9); -const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 26, GPIO_AD_B1_10, ADC2, 10); -const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 27, GPIO_AD_B1_11, ADC2, 11); -const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 28, GPIO_AD_B1_12, ADC2, 12); -const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 29, GPIO_AD_B1_13, ADC2, 13); -const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 30, GPIO_AD_B1_14, ADC2, 14); -const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 31, GPIO_AD_B1_15, ADC2, 15); +const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 0, 16, GPIO_AD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 0, 17, GPIO_AD_B1_01, ADC1, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 0, 18, GPIO_AD_B1_02, ADC2, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 0, 19, GPIO_AD_B1_03, ADC1, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 0, 20, GPIO_AD_B1_04, ADC2, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 0, 21, GPIO_AD_B1_05, ADC2, 5, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 0, 22, GPIO_AD_B1_06, ADC2, 6, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 0, 23, GPIO_AD_B1_07, ADC2, 7, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 0, 24, GPIO_AD_B1_08, ADC2, 8, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 0, 25, GPIO_AD_B1_09, ADC2, 9, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 0, 26, GPIO_AD_B1_10, ADC2, 10, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 0, 27, GPIO_AD_B1_11, ADC2, 11, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 0, 28, GPIO_AD_B1_12, ADC2, 12, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 0, 29, GPIO_AD_B1_13, ADC2, 13, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 0, 30, GPIO_AD_B1_14, ADC2, 14, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 0, 31, GPIO_AD_B1_15, ADC2, 15, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO2, 0, GPIO_EMC_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO2, 1, GPIO_EMC_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO2, 2, GPIO_EMC_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO2, 3, GPIO_EMC_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO2, 4, GPIO_EMC_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO2, 5, GPIO_EMC_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO2, 6, GPIO_EMC_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO2, 7, GPIO_EMC_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO2, 8, GPIO_EMC_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO2, 9, GPIO_EMC_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO2, 10, GPIO_EMC_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO2, 11, GPIO_EMC_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO2, 12, GPIO_EMC_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO2, 13, GPIO_EMC_13, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO2, 14, GPIO_EMC_14, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO2, 15, GPIO_EMC_15, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO2, 16, GPIO_EMC_16, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO2, 17, GPIO_EMC_17, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO2, 18, GPIO_EMC_18, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO2, 19, GPIO_EMC_19, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO2, 20, GPIO_EMC_20, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO2, 21, GPIO_EMC_21, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO2, 22, GPIO_EMC_22, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO2, 23, GPIO_EMC_23, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO2, 24, GPIO_EMC_24, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO2, 25, GPIO_EMC_25, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO2, 26, GPIO_EMC_26, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO2, 27, GPIO_EMC_27, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO2, 28, GPIO_EMC_28, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO2, 29, GPIO_EMC_29, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO2, 30, GPIO_EMC_30, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO2, 31, GPIO_EMC_31, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 0, GPIO_EMC_32, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 1, GPIO_EMC_33, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 2, GPIO_EMC_34, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 3, GPIO_EMC_35, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 4, GPIO_EMC_36, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 5, GPIO_EMC_37, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 6, GPIO_EMC_38, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 7, GPIO_EMC_39, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 8, GPIO_EMC_40, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 9, GPIO_EMC_41, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO2, 1, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO2, 1, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO2, 1, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO2, 1, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO2, 1, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO2, 1, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO2, 1, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO2, 1, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO2, 1, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO2, 1, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO2, 1, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO2, 1, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO2, 1, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO2, 1, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO2, 1, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO2, 1, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO2, 1, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000006, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO2, 1, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000006, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO2, 1, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO2, 1, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO2, 1, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO2, 1, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO2, 1, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO2, 1, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO2, 1, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO2, 1, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO2, 1, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO2, 1, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO2, 1, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO2, 1, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO2, 1, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO2, 1, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 1, 0, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 1, 1, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 1, 2, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 1, 3, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 1, 4, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 1, 5, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 1, 6, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 1, 7, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 1, 8, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 1, 9, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 13, GPIO_SD_B0_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 14, GPIO_SD_B0_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 15, GPIO_SD_B0_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 16, GPIO_SD_B0_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 17, GPIO_SD_B0_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 18, GPIO_SD_B0_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_06 = PIN(GPIO3, 19, GPIO_SD_B0_06, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 2, 13, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 2, 14, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 2, 15, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 2, 16, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 2, 17, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 2, 18, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_06 = PIN(GPIO3, 2, 19, GPIO_SD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 20, GPIO_SD_B1_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 21, GPIO_SD_B1_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 22, GPIO_SD_B1_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 23, GPIO_SD_B1_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 24, GPIO_SD_B1_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 25, GPIO_SD_B1_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 26, GPIO_SD_B1_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 27, GPIO_SD_B1_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 28, GPIO_SD_B1_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 29, GPIO_SD_B1_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 30, GPIO_SD_B1_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 31, GPIO_SD_B1_11, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 2, 20, GPIO_SD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 2, 21, GPIO_SD_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, 22, GPIO_SD_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 2, 23, GPIO_SD_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 2, 24, GPIO_SD_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 2, 25, GPIO_SD_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 2, 26, GPIO_SD_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 2, 27, GPIO_SD_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 28, GPIO_SD_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 29, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 30, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 31, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); + +const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { + pin_GPIO_EMC_00, + pin_GPIO_EMC_01, + pin_GPIO_EMC_02, + pin_GPIO_EMC_03, + pin_GPIO_EMC_04, + pin_GPIO_EMC_05, + pin_GPIO_EMC_06, + pin_GPIO_EMC_07, + pin_GPIO_EMC_08, + pin_GPIO_EMC_09, + pin_GPIO_EMC_10, + pin_GPIO_EMC_11, + pin_GPIO_EMC_12, + pin_GPIO_EMC_13, + pin_GPIO_EMC_14, + pin_GPIO_EMC_15, + pin_GPIO_EMC_16, + pin_GPIO_EMC_17, + pin_GPIO_EMC_18, + pin_GPIO_EMC_19, + pin_GPIO_EMC_20, + pin_GPIO_EMC_21, + pin_GPIO_EMC_22, + pin_GPIO_EMC_23, + pin_GPIO_EMC_24, + pin_GPIO_EMC_25, + pin_GPIO_EMC_26, + pin_GPIO_EMC_27, + pin_GPIO_EMC_28, + pin_GPIO_EMC_29, + pin_GPIO_EMC_30, + pin_GPIO_EMC_31, + pin_GPIO_EMC_32, + pin_GPIO_EMC_33, + pin_GPIO_EMC_34, + pin_GPIO_EMC_35, + pin_GPIO_EMC_36, + pin_GPIO_EMC_37, + pin_GPIO_EMC_38, + pin_GPIO_EMC_39, + pin_GPIO_EMC_40, + pin_GPIO_EMC_41, + pin_GPIO_AD_B0_00, + pin_GPIO_AD_B0_01, + pin_GPIO_AD_B0_02, + pin_GPIO_AD_B0_03, + pin_GPIO_AD_B0_04, + pin_GPIO_AD_B0_05, + pin_GPIO_AD_B0_06, + pin_GPIO_AD_B0_07, + pin_GPIO_AD_B0_08, + pin_GPIO_AD_B0_09, + pin_GPIO_AD_B0_10, + pin_GPIO_AD_B0_11, + pin_GPIO_AD_B0_12, + pin_GPIO_AD_B0_13, + pin_GPIO_AD_B0_14, + pin_GPIO_AD_B0_15, + pin_GPIO_AD_B1_00, + pin_GPIO_AD_B1_01, + pin_GPIO_AD_B1_02, + pin_GPIO_AD_B1_03, + pin_GPIO_AD_B1_04, + pin_GPIO_AD_B1_05, + pin_GPIO_AD_B1_06, + pin_GPIO_AD_B1_07, + pin_GPIO_AD_B1_08, + pin_GPIO_AD_B1_09, + pin_GPIO_AD_B1_10, + pin_GPIO_AD_B1_11, + pin_GPIO_AD_B1_12, + pin_GPIO_AD_B1_13, + pin_GPIO_AD_B1_14, + pin_GPIO_AD_B1_15, + pin_GPIO_SD_B0_00, + pin_GPIO_SD_B0_01, + pin_GPIO_SD_B0_02, + pin_GPIO_SD_B0_03, + pin_GPIO_SD_B0_04, + pin_GPIO_SD_B0_05, + pin_GPIO_SD_B0_06, + pin_GPIO_SD_B1_00, + pin_GPIO_SD_B1_01, + pin_GPIO_SD_B1_02, + pin_GPIO_SD_B1_03, + pin_GPIO_SD_B1_04, + pin_GPIO_SD_B1_05, + pin_GPIO_SD_B1_06, + pin_GPIO_SD_B1_07, + pin_GPIO_SD_B1_08, + pin_GPIO_SD_B1_09, + pin_GPIO_SD_B1_10, + pin_GPIO_SD_B1_11, +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.h index a13bacfc35..4485b6e152 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.h @@ -126,4 +126,6 @@ extern const mcu_pin_obj_t pin_GPIO_SD_B1_09; extern const mcu_pin_obj_t pin_GPIO_SD_B1_10; extern const mcu_pin_obj_t pin_GPIO_SD_B1_11; +extern const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PINS_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c index c622e759ae..5b3fce1f5e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c @@ -29,133 +29,260 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO4, 0, GPIO_EMC_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO4, 1, GPIO_EMC_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO4, 2, GPIO_EMC_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO4, 3, GPIO_EMC_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO4, 4, GPIO_EMC_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO4, 5, GPIO_EMC_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO4, 6, GPIO_EMC_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO4, 7, GPIO_EMC_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO4, 8, GPIO_EMC_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO4, 9, GPIO_EMC_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO4, 10, GPIO_EMC_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO4, 11, GPIO_EMC_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO4, 12, GPIO_EMC_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO4, 13, GPIO_EMC_13, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO4, 14, GPIO_EMC_14, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO4, 15, GPIO_EMC_15, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO4, 16, GPIO_EMC_16, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO4, 17, GPIO_EMC_17, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO4, 18, GPIO_EMC_18, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO4, 19, GPIO_EMC_19, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO4, 20, GPIO_EMC_20, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO4, 21, GPIO_EMC_21, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO4, 22, GPIO_EMC_22, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO4, 23, GPIO_EMC_23, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO4, 24, GPIO_EMC_24, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO4, 25, GPIO_EMC_25, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO4, 26, GPIO_EMC_26, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO4, 27, GPIO_EMC_27, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO4, 28, GPIO_EMC_28, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO4, 29, GPIO_EMC_29, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO4, 30, GPIO_EMC_30, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO4, 31, GPIO_EMC_31, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 18, GPIO_EMC_32, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 19, GPIO_EMC_33, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 20, GPIO_EMC_34, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 21, GPIO_EMC_35, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 22, GPIO_EMC_36, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 23, GPIO_EMC_37, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 24, GPIO_EMC_38, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 25, GPIO_EMC_39, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 26, GPIO_EMC_40, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 27, GPIO_EMC_41, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO4, 3, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO4, 3, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO4, 3, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO4, 3, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO4, 3, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO4, 3, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO4, 3, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO4, 3, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO4, 3, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO4, 3, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO4, 3, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO4, 3, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO4, 3, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO4, 3, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO4, 3, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO4, 3, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO4, 3, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO4, 3, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO4, 3, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO4, 3, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO4, 3, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO4, 3, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO4, 3, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO4, 3, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO4, 3, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO4, 3, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO4, 3, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO4, 3, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO4, 3, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO4, 3, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO4, 3, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO4, 3, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 2, 18, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 2, 19, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 2, 20, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 2, 21, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 2, 22, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 2, 23, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 2, 24, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 2, 25, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 2, 26, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 2, 27, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, GPIO_AD_B0_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 1, GPIO_AD_B0_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 2, GPIO_AD_B0_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 3, GPIO_AD_B0_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 4, GPIO_AD_B0_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 5, GPIO_AD_B0_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 6, GPIO_AD_B0_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 7, GPIO_AD_B0_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 8, GPIO_AD_B0_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 9, GPIO_AD_B0_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 10, GPIO_AD_B0_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 11, GPIO_AD_B0_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 12, GPIO_AD_B0_12, ADC1, 1); -const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 13, GPIO_AD_B0_13, ADC1, 2); -const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 14, GPIO_AD_B0_14, ADC1, 3); -const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 15, GPIO_AD_B0_15, ADC1, 4); +const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 0, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 0, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 0, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 0, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 0, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 0, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 0, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 0, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 0, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 0, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000000, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 0, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 0, 12, GPIO_AD_B0_12, ADC1, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 0, 13, GPIO_AD_B0_13, ADC1, 2, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 0, 14, GPIO_AD_B0_14, ADC1, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 0, 15, GPIO_AD_B0_15, ADC1, 4, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 16, GPIO_AD_B1_00, ADC1, 5); -const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 17, GPIO_AD_B1_01, ADC1, 6); -const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 18, GPIO_AD_B1_02, ADC1, 7); -const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 19, GPIO_AD_B1_03, ADC1, 8); -const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 20, GPIO_AD_B1_04, ADC1, 9); -const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 21, GPIO_AD_B1_05, ADC1, 10); -const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 22, GPIO_AD_B1_06, ADC1, 11); -const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 23, GPIO_AD_B1_07, ADC1, 12); -const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 24, GPIO_AD_B1_08, ADC1, 13); -const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 25, GPIO_AD_B1_09, ADC1, 14); -const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 26, GPIO_AD_B1_10, ADC1, 15); -const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 27, GPIO_AD_B1_11, ADC1, 0); -const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 28, GPIO_AD_B1_12, ADC2, 1); -const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 29, GPIO_AD_B1_13, ADC2, 2); -const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 30, GPIO_AD_B1_14, ADC2, 3); -const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 31, GPIO_AD_B1_15, ADC2, 4); +const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 0, 16, GPIO_AD_B1_00, ADC1, 5, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 0, 17, GPIO_AD_B1_01, ADC1, 6, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 0, 18, GPIO_AD_B1_02, ADC1, 7, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 0, 19, GPIO_AD_B1_03, ADC1, 8, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 0, 20, GPIO_AD_B1_04, ADC1, 9, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 0, 21, GPIO_AD_B1_05, ADC1, 10, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 0, 22, GPIO_AD_B1_06, ADC1, 11, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 0, 23, GPIO_AD_B1_07, ADC1, 12, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 0, 24, GPIO_AD_B1_08, ADC1, 13, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 0, 25, GPIO_AD_B1_09, ADC1, 14, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 0, 26, GPIO_AD_B1_10, ADC1, 15, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 0, 27, GPIO_AD_B1_11, ADC1, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 0, 28, GPIO_AD_B1_12, ADC2, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 0, 29, GPIO_AD_B1_13, ADC2, 2, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 0, 30, GPIO_AD_B1_14, ADC2, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 0, 31, GPIO_AD_B1_15, ADC2, 4, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_00 = PIN(GPIO2, 0, GPIO_B0_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_01 = PIN(GPIO2, 1, GPIO_B0_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_02 = PIN(GPIO2, 2, GPIO_B0_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_03 = PIN(GPIO2, 3, GPIO_B0_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_04 = PIN(GPIO2, 4, GPIO_B0_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_05 = PIN(GPIO2, 5, GPIO_B0_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_06 = PIN(GPIO2, 6, GPIO_B0_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_07 = PIN(GPIO2, 7, GPIO_B0_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_08 = PIN(GPIO2, 8, GPIO_B0_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_09 = PIN(GPIO2, 9, GPIO_B0_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_10 = PIN(GPIO2, 10, GPIO_B0_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_11 = PIN(GPIO2, 11, GPIO_B0_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_12 = PIN(GPIO2, 12, GPIO_B0_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_13 = PIN(GPIO2, 13, GPIO_B0_13, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_14 = PIN(GPIO2, 14, GPIO_B0_14, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B0_15 = PIN(GPIO2, 15, GPIO_B0_15, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_B0_00 = PIN(GPIO2, 1, 0, GPIO_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_01 = PIN(GPIO2, 1, 1, GPIO_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_02 = PIN(GPIO2, 1, 2, GPIO_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_03 = PIN(GPIO2, 1, 3, GPIO_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_04 = PIN(GPIO2, 1, 4, GPIO_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_05 = PIN(GPIO2, 1, 5, GPIO_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_06 = PIN(GPIO2, 1, 6, GPIO_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_07 = PIN(GPIO2, 1, 7, GPIO_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_08 = PIN(GPIO2, 1, 8, GPIO_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_09 = PIN(GPIO2, 1, 9, GPIO_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_10 = PIN(GPIO2, 1, 10, GPIO_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_11 = PIN(GPIO2, 1, 11, GPIO_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_12 = PIN(GPIO2, 1, 12, GPIO_B0_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_13 = PIN(GPIO2, 1, 13, GPIO_B0_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_14 = PIN(GPIO2, 1, 14, GPIO_B0_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_15 = PIN(GPIO2, 1, 15, GPIO_B0_15, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_00 = PIN(GPIO2, 16, GPIO_B1_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_01 = PIN(GPIO2, 17, GPIO_B1_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_02 = PIN(GPIO2, 18, GPIO_B1_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_03 = PIN(GPIO2, 19, GPIO_B1_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_04 = PIN(GPIO2, 20, GPIO_B1_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_05 = PIN(GPIO2, 21, GPIO_B1_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_06 = PIN(GPIO2, 22, GPIO_B1_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_07 = PIN(GPIO2, 23, GPIO_B1_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_08 = PIN(GPIO2, 24, GPIO_B1_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_09 = PIN(GPIO2, 25, GPIO_B1_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_10 = PIN(GPIO2, 26, GPIO_B1_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_11 = PIN(GPIO2, 27, GPIO_B1_11, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_12 = PIN(GPIO2, 28, GPIO_B1_12, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_13 = PIN(GPIO2, 29, GPIO_B1_13, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_14 = PIN(GPIO2, 30, GPIO_B1_14, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_B1_15 = PIN(GPIO2, 31, GPIO_B1_15, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_B1_00 = PIN(GPIO2, 1, 16, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_01 = PIN(GPIO2, 1, 17, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_02 = PIN(GPIO2, 1, 18, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_03 = PIN(GPIO2, 1, 19, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_04 = PIN(GPIO2, 1, 20, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_05 = PIN(GPIO2, 1, 21, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_06 = PIN(GPIO2, 1, 22, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_07 = PIN(GPIO2, 1, 23, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_08 = PIN(GPIO2, 1, 24, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_09 = PIN(GPIO2, 1, 25, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_10 = PIN(GPIO2, 1, 26, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_11 = PIN(GPIO2, 1, 27, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_12 = PIN(GPIO2, 1, 28, GPIO_B1_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_13 = PIN(GPIO2, 1, 29, GPIO_B1_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_14 = PIN(GPIO2, 1, 30, GPIO_B1_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_15 = PIN(GPIO2, 1, 31, GPIO_B1_15, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 12, GPIO_SD_B0_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 13, GPIO_SD_B0_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 14, GPIO_SD_B0_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 15, GPIO_SD_B0_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 16, GPIO_SD_B0_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 17, GPIO_SD_B0_05, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 2, 12, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 2, 13, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 2, 14, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 2, 15, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 2, 16, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 2, 17, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_B1_00, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_B1_01, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_B1_02, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_B1_03, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_B1_04, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_B1_05, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_B1_06, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_B1_07, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_B1_08, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_B1_09, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_B1_10, NO_ADC, 0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_B1_11, NO_ADC, 0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 2, 0, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 2, 1, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, 2, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 2, 3, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 2, 4, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 2, 5, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 2, 6, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 2, 7, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 8, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); + +const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { + pin_GPIO_EMC_00, + pin_GPIO_EMC_01, + pin_GPIO_EMC_02, + pin_GPIO_EMC_03, + pin_GPIO_EMC_04, + pin_GPIO_EMC_05, + pin_GPIO_EMC_06, + pin_GPIO_EMC_07, + pin_GPIO_EMC_08, + pin_GPIO_EMC_09, + pin_GPIO_EMC_10, + pin_GPIO_EMC_11, + pin_GPIO_EMC_12, + pin_GPIO_EMC_13, + pin_GPIO_EMC_14, + pin_GPIO_EMC_15, + pin_GPIO_EMC_16, + pin_GPIO_EMC_17, + pin_GPIO_EMC_18, + pin_GPIO_EMC_19, + pin_GPIO_EMC_20, + pin_GPIO_EMC_21, + pin_GPIO_EMC_22, + pin_GPIO_EMC_23, + pin_GPIO_EMC_24, + pin_GPIO_EMC_25, + pin_GPIO_EMC_26, + pin_GPIO_EMC_27, + pin_GPIO_EMC_28, + pin_GPIO_EMC_29, + pin_GPIO_EMC_30, + pin_GPIO_EMC_31, + pin_GPIO_EMC_32, + pin_GPIO_EMC_33, + pin_GPIO_EMC_34, + pin_GPIO_EMC_35, + pin_GPIO_EMC_36, + pin_GPIO_EMC_37, + pin_GPIO_EMC_38, + pin_GPIO_EMC_39, + pin_GPIO_EMC_40, + pin_GPIO_EMC_41, + pin_GPIO_AD_B0_00, + pin_GPIO_AD_B0_01, + pin_GPIO_AD_B0_02, + pin_GPIO_AD_B0_03, + pin_GPIO_AD_B0_04, + pin_GPIO_AD_B0_05, + pin_GPIO_AD_B0_06, + pin_GPIO_AD_B0_07, + pin_GPIO_AD_B0_08, + pin_GPIO_AD_B0_09, + pin_GPIO_AD_B0_10, + pin_GPIO_AD_B0_11, + pin_GPIO_AD_B0_12, + pin_GPIO_AD_B0_13, + pin_GPIO_AD_B0_14, + pin_GPIO_AD_B0_15, + pin_GPIO_AD_B1_00, + pin_GPIO_AD_B1_01, + pin_GPIO_AD_B1_02, + pin_GPIO_AD_B1_03, + pin_GPIO_AD_B1_04, + pin_GPIO_AD_B1_05, + pin_GPIO_AD_B1_06, + pin_GPIO_AD_B1_07, + pin_GPIO_AD_B1_08, + pin_GPIO_AD_B1_09, + pin_GPIO_AD_B1_10, + pin_GPIO_AD_B1_11, + pin_GPIO_AD_B1_12, + pin_GPIO_AD_B1_13, + pin_GPIO_AD_B1_14, + pin_GPIO_AD_B1_15, + pin_GPIO_B0_00, + pin_GPIO_B0_01, + pin_GPIO_B0_02, + pin_GPIO_B0_03, + pin_GPIO_B0_04, + pin_GPIO_B0_05, + pin_GPIO_B0_06, + pin_GPIO_B0_07, + pin_GPIO_B0_08, + pin_GPIO_B0_09, + pin_GPIO_B0_10, + pin_GPIO_B0_11, + pin_GPIO_B0_12, + pin_GPIO_B0_13, + pin_GPIO_B0_14, + pin_GPIO_B0_15, + pin_GPIO_B1_00, + pin_GPIO_B1_01, + pin_GPIO_B1_02, + pin_GPIO_B1_03, + pin_GPIO_B1_04, + pin_GPIO_B1_05, + pin_GPIO_B1_06, + pin_GPIO_B1_07, + pin_GPIO_B1_08, + pin_GPIO_B1_09, + pin_GPIO_B1_10, + pin_GPIO_B1_11, + pin_GPIO_B1_12, + pin_GPIO_B1_13, + pin_GPIO_B1_14, + pin_GPIO_B1_15, + pin_GPIO_SD_B0_00, + pin_GPIO_SD_B0_01, + pin_GPIO_SD_B0_02, + pin_GPIO_SD_B0_03, + pin_GPIO_SD_B0_04, + pin_GPIO_SD_B0_05, + pin_GPIO_SD_B1_00, + pin_GPIO_SD_B1_01, + pin_GPIO_SD_B1_02, + pin_GPIO_SD_B1_03, + pin_GPIO_SD_B1_04, + pin_GPIO_SD_B1_05, + pin_GPIO_SD_B1_06, + pin_GPIO_SD_B1_07, + pin_GPIO_SD_B1_08, + pin_GPIO_SD_B1_09, + pin_GPIO_SD_B1_10, + pin_GPIO_SD_B1_11, +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.h index 1e69224595..6a72eaa7b2 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.h @@ -158,4 +158,6 @@ extern const mcu_pin_obj_t pin_GPIO_SD_B1_09; extern const mcu_pin_obj_t pin_GPIO_SD_B1_10; extern const mcu_pin_obj_t pin_GPIO_SD_B1_11; +extern const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1062_PINS_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 404a411e18..68710f999a 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -48,22 +48,30 @@ extern const mp_obj_type_t mcu_pin_type; typedef struct { mp_obj_base_t base; GPIO_Type *gpio; - uint8_t number; + uint8_t port:3; //0 start index + uint8_t number:5; + uint16_t mux_idx; uint32_t mux_reg; uint32_t cfg_reg; ADC_Type *adc; uint8_t adc_channel; + uint32_t mux_reset; + uint32_t pad_reset; } mcu_pin_obj_t; -#define PIN(p_gpio, p_number, p_enum, p_adc, p_adc_channel) \ +#define PIN(p_gpio, p_port, p_number, p_enum, p_adc, p_adc_channel, p_mux_reset, p_pad_reset) \ { \ { &mcu_pin_type }, \ .gpio = p_gpio, \ + .port = p_port, \ .number = p_number, \ + .mux_idx = kIOMUXC_SW_MUX_CTL_PAD_ ## p_enum, \ .mux_reg = (uint32_t)&(IOMUXC->SW_MUX_CTL_PAD[kIOMUXC_SW_MUX_CTL_PAD_ ## p_enum]), \ .cfg_reg = (uint32_t)&(IOMUXC->SW_PAD_CTL_PAD[kIOMUXC_SW_PAD_CTL_PAD_ ## p_enum]), \ .adc = p_adc, \ .adc_channel = p_adc_channel, \ + .mux_reset = p_mux_reset, \ + .pad_reset = p_pad_reset, \ } #ifdef MIMXRT1011_SERIES From 0876034adb8487f45c88224cb1ce29743848244e Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Fri, 15 May 2020 14:32:44 -0700 Subject: [PATCH 502/919] Make decode only apply to bytearray and not array as well --- py/objarray.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/py/objarray.c b/py/objarray.c index 5cdbd26788..fccb966a2b 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -551,7 +551,7 @@ STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinfo, mp_ui } -#if MICROPY_CPYTHON_COMPAT +#if MICROPY_CPYTHON_COMPAT && MICROPY_PY_BUILTINS_BYTEARRAY // Directly lifted from objstr.c STATIC mp_obj_t array_decode(size_t n_args, const mp_obj_t *args) { mp_obj_t new_args[2]; @@ -567,18 +567,28 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(array_decode_obj, 1, 3, array_decode); #endif -#if MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_ARRAY +#if MICROPY_PY_ARRAY STATIC const mp_rom_map_elem_t array_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) }, { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(array_locals_dict, array_locals_dict_table); +#endif + +#if MICROPY_PY_BUILTINS_BYTEARRAY +STATIC const mp_rom_map_elem_t bytearray_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) }, + { MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) }, #if MICROPY_CPYTHON_COMPAT { MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&array_decode_obj) }, #endif }; -STATIC MP_DEFINE_CONST_DICT(array_locals_dict, array_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(bytearray_locals_dict, bytearray_locals_dict_table); #endif + #if MICROPY_PY_ARRAY const mp_obj_type_t mp_type_array = { { &mp_type_type }, @@ -605,7 +615,7 @@ const mp_obj_type_t mp_type_bytearray = { .binary_op = array_binary_op, .subscr = array_subscr, .buffer_p = { .get_buffer = array_get_buffer }, - .locals_dict = (mp_obj_dict_t*)&array_locals_dict, + .locals_dict = (mp_obj_dict_t*)&bytearray_locals_dict, }; #endif From 7d167560af0e317edef2d4bc4385dfa0982f19f8 Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Fri, 15 May 2020 14:53:14 -0700 Subject: [PATCH 503/919] Note that nvm.ByteArray is available at microcontroller.nvm Fixes #2766 --- shared-bindings/nvm/__init__.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c index 51c5bb2789..cdcc285dc4 100644 --- a/shared-bindings/nvm/__init__.c +++ b/shared-bindings/nvm/__init__.c @@ -34,7 +34,11 @@ //| """Non-volatile memory //| //| The `nvm` module allows you to store whatever raw bytes you wish in a -//| reserved section non-volatile memory.""" +//| reserved section non-volatile memory. +//| +//| Note that this module can't be imported and used directly. The sole +//| instance of :class:`ByteArray` is available at +//| :attr:`microcontroller.nvm`.""" //| STATIC const mp_rom_map_elem_t nvm_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_nvm) }, From a3ca9401b4eab35d4fa3190141d576bcd059d070 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 15 May 2020 18:29:37 -0400 Subject: [PATCH 504/919] Shrink crickit build --- .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index c5ef958c9b..3daa2e4fcd 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_PIXELBUF = 1 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 55 +CFLAGS_INLINE_LIMIT = 50 # Include these Python libraries in firmware. From 6aaab005c5f3a781fec229640c74bf44a601fc97 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 17 Apr 2020 16:23:28 -0700 Subject: [PATCH 505/919] Initial ESP32S2 port. Basic blinky works but doesn't check pins. --- .github/workflows/build.yml | 84 +- .gitmodules | 3 + conf.py | 2 + main.c | 12 +- ports/atmel-samd/mpconfigport.h | 2 - ports/atmel-samd/supervisor/port.c | 4 + ports/esp32s2/.gitignore | 2 + ports/esp32s2/CMakeLists.txt | 11 + ports/esp32s2/Makefile | 279 ++++++ ports/esp32s2/background.c | 63 ++ ports/esp32s2/background.h | 35 + ports/esp32s2/boards/board.h | 45 + .../boards/espressif_saola_1_wroom/board.c | 39 + .../espressif_saola_1_wroom/mpconfigboard.h | 32 + .../espressif_saola_1_wroom/mpconfigboard.mk | 20 + .../boards/espressif_saola_1_wroom/pins.c | 46 + .../boards/espressif_saola_1_wroom/sdkconfig | 0 .../boards/espressif_saola_1_wrover/board.c | 39 + .../espressif_saola_1_wrover/mpconfigboard.h | 32 + .../espressif_saola_1_wrover/mpconfigboard.mk | 20 + .../boards/espressif_saola_1_wrover/pins.c | 46 + .../boards/espressif_saola_1_wrover/sdkconfig | 0 ports/esp32s2/common-hal/board/__init__.c | 1 + .../common-hal/digitalio/DigitalInOut.c | 137 +++ .../common-hal/digitalio/DigitalInOut.h | 38 + ports/esp32s2/common-hal/digitalio/__init__.c | 1 + .../esp32s2/common-hal/microcontroller/Pin.c | 46 + .../esp32s2/common-hal/microcontroller/Pin.h | 44 + .../common-hal/microcontroller/Processor.c | 46 + .../common-hal/microcontroller/Processor.h | 39 + .../common-hal/microcontroller/__init__.c | 128 +++ .../common-hal/neopixel_write/__init__.c | 33 + ports/esp32s2/common-hal/os/__init__.c | 61 ++ ports/esp32s2/common-hal/supervisor/Runtime.c | 38 + ports/esp32s2/common-hal/supervisor/Runtime.h | 37 + .../esp32s2/common-hal/supervisor/__init__.c | 40 + ports/esp32s2/common-hal/time/__init__.c | 45 + ports/esp32s2/esp-idf | 1 + ports/esp32s2/esp32s2_peripherals_config.h | 38 + ports/esp32s2/fatfs_port.c | 33 + ports/esp32s2/mpconfigport.h | 45 + ports/esp32s2/mpconfigport.mk | 35 + ports/esp32s2/mphalport.c | 42 + ports/esp32s2/mphalport.h | 41 + ports/esp32s2/partitions.csv | 10 + ports/esp32s2/peripherals/pins.c | 81 ++ ports/esp32s2/peripherals/pins.h | 86 ++ ports/esp32s2/qstrdefsport.h | 1 + ports/esp32s2/sdkconfig.defaults | 822 ++++++++++++++++++ ports/esp32s2/supervisor/internal_flash.c | 122 +++ ports/esp32s2/supervisor/internal_flash.h | 38 + .../supervisor/internal_flash_root_pointers.h | 31 + ports/esp32s2/supervisor/port.c | 162 ++++ ports/esp32s2/supervisor/usb.c | 80 ++ ports/litex/supervisor/port.c | 4 + py/circuitpy_mpconfig.h | 8 + supervisor/port.h | 3 + supervisor/shared/memory.c | 2 + supervisor/shared/stack.c | 28 +- supervisor/shared/stack.h | 2 + supervisor/shared/usb/tusb_config.h | 2 + supervisor/shared/usb/usb.c | 2 + supervisor/supervisor.mk | 11 +- tools/build_board_info.py | 3 +- tools/join_bins.py | 20 + 65 files changed, 3280 insertions(+), 23 deletions(-) create mode 100644 ports/esp32s2/.gitignore create mode 100644 ports/esp32s2/CMakeLists.txt create mode 100644 ports/esp32s2/Makefile create mode 100644 ports/esp32s2/background.c create mode 100644 ports/esp32s2/background.h create mode 100644 ports/esp32s2/boards/board.h create mode 100644 ports/esp32s2/boards/espressif_saola_1_wroom/board.c create mode 100644 ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h create mode 100644 ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/espressif_saola_1_wroom/pins.c create mode 100644 ports/esp32s2/boards/espressif_saola_1_wroom/sdkconfig create mode 100644 ports/esp32s2/boards/espressif_saola_1_wrover/board.c create mode 100644 ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h create mode 100644 ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/espressif_saola_1_wrover/pins.c create mode 100644 ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig create mode 100644 ports/esp32s2/common-hal/board/__init__.c create mode 100644 ports/esp32s2/common-hal/digitalio/DigitalInOut.c create mode 100644 ports/esp32s2/common-hal/digitalio/DigitalInOut.h create mode 100644 ports/esp32s2/common-hal/digitalio/__init__.c create mode 100644 ports/esp32s2/common-hal/microcontroller/Pin.c create mode 100644 ports/esp32s2/common-hal/microcontroller/Pin.h create mode 100644 ports/esp32s2/common-hal/microcontroller/Processor.c create mode 100644 ports/esp32s2/common-hal/microcontroller/Processor.h create mode 100644 ports/esp32s2/common-hal/microcontroller/__init__.c create mode 100644 ports/esp32s2/common-hal/neopixel_write/__init__.c create mode 100644 ports/esp32s2/common-hal/os/__init__.c create mode 100644 ports/esp32s2/common-hal/supervisor/Runtime.c create mode 100644 ports/esp32s2/common-hal/supervisor/Runtime.h create mode 100644 ports/esp32s2/common-hal/supervisor/__init__.c create mode 100644 ports/esp32s2/common-hal/time/__init__.c create mode 160000 ports/esp32s2/esp-idf create mode 100644 ports/esp32s2/esp32s2_peripherals_config.h create mode 100644 ports/esp32s2/fatfs_port.c create mode 100644 ports/esp32s2/mpconfigport.h create mode 100644 ports/esp32s2/mpconfigport.mk create mode 100644 ports/esp32s2/mphalport.c create mode 100644 ports/esp32s2/mphalport.h create mode 100644 ports/esp32s2/partitions.csv create mode 100755 ports/esp32s2/peripherals/pins.c create mode 100644 ports/esp32s2/peripherals/pins.h create mode 100644 ports/esp32s2/qstrdefsport.h create mode 100644 ports/esp32s2/sdkconfig.defaults create mode 100644 ports/esp32s2/supervisor/internal_flash.c create mode 100644 ports/esp32s2/supervisor/internal_flash.h create mode 100644 ports/esp32s2/supervisor/internal_flash_root_pointers.h create mode 100644 ports/esp32s2/supervisor/port.c create mode 100644 ports/esp32s2/supervisor/usb.c create mode 100644 tools/join_bins.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4216f61392..c379e890e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,6 @@ jobs: - name: New boards check run: python3 -u ci_new_boards_check.py working-directory: tools - - name: Build mpy-cross.static-raspbian run: make -C mpy-cross -j2 -f Makefile.static-raspbian - uses: actions/upload-artifact@v1.0.0 @@ -359,3 +358,86 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) + build-xtensa: + runs-on: ubuntu-latest + needs: test + strategy: + fail-fast: false + matrix: + board: + - "espressif_saola_1_wroom" + - "espressif_saola_1_wrover" + + steps: + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* + - run: git submodule sync + - run: git submodule foreach git remote -v + - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* + - name: CircuitPython version + run: git describe --dirty --tags + - uses: actions/cache@v1 + name: Fetch IDF tool cache + id: idf-cache + with: + path: ${{ github.workspace }}/.idf_tools + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }} + - name: Install IDF tools + if: steps.idf-cache.outputs.cache-hit != 'true' + run: | + $IDF_PATH/tools/idf_tools.py --non-interactive install required + $IDF_PATH/tools/idf_tools.py --non-interactive install cmake + $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env + rm -rf $IDF_TOOLS_PATH/dist + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools + - name: Install CircuitPython deps + run: | + source $IDF_PATH/export.sh + pip install requests sh click setuptools awscli + sudo apt-get install -y gettext ninja-build + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools + - name: Versions + run: | + source $IDF_PATH/export.sh + gcc --version + xtensa-esp32s2-elf-gcc --version + python3 --version + ninja --version + cmake --version + shell: bash + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools + - name: mpy-cross + run: make -C mpy-cross -j2 + - name: build + run: | + source $IDF_PATH/export.sh + python3 -u build_release_files.py + working-directory: tools + shell: bash + env: + IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools + BOARDS: ${{ matrix.board }} + - uses: actions/upload-artifact@v1.0.0 + with: + name: ${{ matrix.board }} + path: bin/${{ matrix.board }} + - name: Upload to S3 + run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) diff --git a/.gitmodules b/.gitmodules index 2884f79a57..a990aed2ab 100644 --- a/.gitmodules +++ b/.gitmodules @@ -140,3 +140,6 @@ [submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"] path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center +[submodule "ports/esp32s2/esp-idf"] + path = ports/esp32s2/esp-idf + url = https://github.com/tannewt/esp-idf.git diff --git a/conf.py b/conf.py index d6fa8f7e50..f5aa957de0 100644 --- a/conf.py +++ b/conf.py @@ -136,6 +136,8 @@ exclude_patterns = ["**/build*", "ports/atmel-samd/tools", "ports/cxd56/mkspk", "ports/cxd56/spresense-exported-sdk", + "ports/esp32s2/esp-idf", + "ports/esp32s2/peripherals", "ports/litex/hw", "ports/minimal", "ports/mimxrt10xx/peripherals", diff --git a/main.c b/main.c index c60cded165..c05157e865 100755 --- a/main.c +++ b/main.c @@ -105,12 +105,18 @@ void start_mp(supervisor_allocation* heap) { // Stack limit should be less than real stack size, so we have a chance // to recover from limit hit. (Limit is measured in bytes.) mp_stack_ctrl_init(); - mp_stack_set_limit(stack_alloc->length - 1024); + + if (stack_alloc != NULL) { + mp_stack_set_limit(stack_alloc->length - 1024); + } + #if MICROPY_MAX_STACK_USAGE // _ezero (same as _ebss) is an int, so start 4 bytes above it. - mp_stack_set_bottom(stack_alloc->ptr); - mp_stack_fill_with_sentinel(); + if (stack_alloc != NULL) { + mp_stack_set_bottom(stack_alloc->ptr); + mp_stack_fill_with_sentinel(); + } #endif // Sync the file systems in case any used RAM from the GC to cache. As soon diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 04ad98c22a..63e92c9676 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -48,7 +48,6 @@ // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) #define MICROPY_PY_UJSON (0) -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ X(ENOENT) \ @@ -79,7 +78,6 @@ // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) // MICROPY_PY_UERRNO_LIST - Use the default #endif // SAMD51 diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 04e2c9191a..eadd3e8f53 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -361,6 +361,10 @@ void reset_cpu(void) { reset(); } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + uint32_t *port_stack_get_limit(void) { return &_ebss; } diff --git a/ports/esp32s2/.gitignore b/ports/esp32s2/.gitignore new file mode 100644 index 0000000000..4bfc5e7845 --- /dev/null +++ b/ports/esp32s2/.gitignore @@ -0,0 +1,2 @@ +build* +sdkconfig.old diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt new file mode 100644 index 0000000000..c831e48469 --- /dev/null +++ b/ports/esp32s2/CMakeLists.txt @@ -0,0 +1,11 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) +set(COMPONENTS esptool_py soc driver log main) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(circuitpython) + +idf_build_set_property(__OUTPUT_SDKCONFIG 0) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile new file mode 100644 index 0000000000..6fe805811d --- /dev/null +++ b/ports/esp32s2/Makefile @@ -0,0 +1,279 @@ +# 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. + +# Select the board to build for. +ifeq ($(BOARD),) + $(error You must provide a BOARD parameter) +else + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD specified) + endif +endif + +# If the build directory is not given, make it reflect the board name. +BUILD ?= build-$(BOARD) + +include ../../py/mkenv.mk +# Board-specific +include boards/$(BOARD)/mpconfigboard.mk +# Port-specific +include mpconfigport.mk + +# CircuitPython-specific +include $(TOP)/py/circuitpy_mpconfig.mk + +# qstr definitions (must come before including py.mk) +QSTR_DEFS = qstrdefsport.h + +# include py core make definitions +include $(TOP)/py/py.mk + +include $(TOP)/supervisor/supervisor.mk + +# Include make rules and variables common across CircuitPython builds. +include $(TOP)/py/circuitpy_defns.mk + +CROSS_COMPILE = xtensa-esp32s2-elf- + +####################################### +# CFLAGS +####################################### + +INC += -I. +INC += -I../.. +INC += -I$(BUILD) +INC += -I$(BUILD)/genhdr +INC += -I./boards +INC += -I./boards/$(BOARD) +INC += -I./peripherals +INC += -I../../lib/mp-readline +INC += -I../../lib/tinyusb/src +INC += -I../../supervisor/shared/usb +INC += -Iesp-idf/components/freertos/include/freertos +INC += -Iesp-idf/components/freertos/xtensa/include +INC += -Iesp-idf/components/esp32s2/include +INC += -Iesp-idf/components/xtensa/esp32s2/include +INC += -Iesp-idf/components/esp_common/include +INC += -Iesp-idf/components/esp_rom/include +INC += -Iesp-idf/components/xtensa/include +INC += -Iesp-idf/components/esp_timer/include +INC += -Iesp-idf/components/soc/include +INC += -Iesp-idf/components/soc/src/esp32s2/include +INC += -Iesp-idf/components/soc/soc/include +INC += -Iesp-idf/components/soc/soc/esp32s2/include +INC += -Iesp-idf/components/heap/include +INC += -Iesp-idf/components/esp_system/include +INC += -I$(BUILD)/esp-idf/config + +CFLAGS += -DHAVE_CONFIG_H \ + -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" \ + -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX + +# Make our canary value match FreeRTOS's +CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5 + +#Debugging/Optimization +ifeq ($(DEBUG), 1) + CFLAGS += -ggdb + # You may want to enable these flags to make setting breakpoints easier. + # CFLAGS += -fno-inline -fno-ipa-sra +else + CFLAGS += -Os -DNDEBUG -ggdb3 + # TODO: Test with -flto + ### CFLAGS += -flto +endif + +CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) + +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref +LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ + -Tesp32s2_out.ld \ + -L$(BUILD)/esp-idf/esp-idf/esp32s2/ld \ + -Tesp32s2.project.ld \ + -Lesp-idf/components/esp32s2/ld \ + -Tesp32s2.peripherals.ld \ + -Lesp-idf/components/esp_rom/esp32s2/ld \ + -Tesp32s2.rom.ld \ + -Tesp32s2.rom.libgcc.ld \ + -Tesp32s2.rom.newlib-data.ld \ + -Tesp32s2.rom.newlib-funcs.ld \ + -Tesp32s2.rom.spiflash.ld +LIBS := -lgcc -lc + +# + +LDFLAGS += -Wl,-Bstatic \ + -Wl,--no-warn-mismatch \ + -Wl,--build-id=none \ + -fno-rtti + +# Use toolchain libm if we're not using our own. +ifndef INTERNAL_LIBM +LIBS += -lm +endif + +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32S2 -DCFG_TUSB_OS=OPT_OS_FREERTOS -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 + + +###################################### +# source +###################################### + + +SRC_C += \ + background.c \ + fatfs_port.c \ + mphalport.c \ + boards/$(BOARD)/board.c \ + boards/$(BOARD)/pins.c \ + lib/libc/string0.c \ + lib/mp-readline/readline.c \ + lib/oofatfs/ff.c \ + lib/oofatfs/option/ccsbcs.c \ + lib/timeutils/timeutils.c \ + lib/utils/buffer_helper.c \ + lib/utils/context_manager_helpers.c \ + lib/utils/interrupt_char.c \ + lib/utils/pyexec.c \ + lib/utils/stdout_helpers.c \ + lib/utils/sys_stdio_mphal.c \ + peripherals/pins.c \ + supervisor/shared/memory.c + +ifneq ($(USB),FALSE) +SRC_C += lib/tinyusb/src/portable/espressif/esp32s2/dcd_esp32s2.c +endif + +SRC_S = + +SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ + $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ + $(addprefix common-hal/, $(SRC_COMMON_HAL)) + +SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ + $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) + + +ifneq ($(FROZEN_MPY_DIR),) +FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') +FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +endif + +OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +ifeq ($(INTERNAL_LIBM),1) +OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) +endif +OBJ += $(addprefix $(BUILD)/, $(SRC_S:.S=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) + +$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os +$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os + +# List of sources for qstr extraction +SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) +# Sources that only hold QSTRs after pre-processing. +SRC_QSTR_PREPROCESSOR += + +# IDF build commands +IDF_PATH = $(realpath ./esp-idf) +# create the directory +$(BUILD)/esp-idf: + $(Q)$(MKDIR) -p $@ + +# create the config headers +$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + +# build a lib +# Adding -d explain -j 1 -v to the ninja line will output debug info +$(BUILD)/esp-idf/esp-idf/%.a: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf esp-idf/$*.a + +$(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf esp-idf/esp32s2/esp32s2_out.ld + +$(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf esp-idf/esp32s2/ld/esp32s2.project.ld + + +$(BUILD)/esp-idf/partition_table/partition-table.bin: $(BUILD)/esp-idf/config/sdkconfig.h + IDF_PATH=$(IDF_PATH) ninja -C $(BUILD)/esp-idf partition_table/partition-table.bin + +$(BUILD)/esp-idf/bootloader/bootloader.bin: $(BUILD)/esp-idf/config/sdkconfig.h + ninja -C $(BUILD)/esp-idf bootloader/bootloader.bin + +# run menuconfig +menuconfig: $(BUILD)/esp-idf/config + ninja -C $(BUILD)/esp-idf menuconfig + diff --old-line-format= --unchanged-line-format= sdkconfig.defaults $(BUILD)/esp-idf/sdkconfig > boards/$(BOARD)/sdkconfig || true + +# qstr builds include headers so we need to make sure they are up to date +$(HEADER_BUILD)/qstr.i.last: | $(BUILD)/esp-idf/config/sdkconfig.h + +# Order here matters +ESP_IDF_COMPONENTS_LINK = freertos log esp_system esp32s2 bootloader_support pthread esp_timer vfs spi_flash app_update esp_common esp32s2 heap newlib driver xtensa soc esp_ringbuf # + +ESP_IDF_COMPONENTS_INCLUDE = driver freertos log soc + +INC += $(foreach component, $(ESP_IDF_COMPONENTS_INCLUDE), -Iesp-idf/components/$(component)/include) + +ESP_IDF_COMPONENTS_EXPANDED = $(foreach component, $(ESP_IDF_COMPONENTS_LINK), $(BUILD)/esp-idf/esp-idf/$(component)/lib$(component).a) +BINARY_BLOBS = esp-idf/components/xtensa/esp32s2/libhal.a +BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a librtc.a libsmartconfig.a libphy.a +BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/esp32s2/, $(BINARY_WIFI_BLOBS)) + +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/soc/soc/esp32s2/libsoc_esp32s2.a esp-idf/components/xtensa/esp32s2/libhal.a +ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-idf/esp-idf/esp32s2/ld/esp32s2.project.ld + +FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) + +all: $(BUILD)/firmware.bin + +$(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD) + $(STEPECHO) "LINK $@" + $(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl + # $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld + +$(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf + $(STEPECHO) "Create $@" + $(Q)esptool.py --chip esp32s2 elf2image $(FLASH_FLAGS) --elf-sha256-offset 0xb0 -o $@ $^ +# $(Q)$(OBJCOPY) -O binary $^ $@ +# $(Q)$(OBJCOPY) -O binary -j .vectors -j .text -j .data $^ $@ + +$(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BUILD)/esp-idf/bootloader/bootloader.bin $(BUILD)/circuitpython-firmware.bin + $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin + +flash: $(BUILD)/firmware.bin + esptool.py --chip esp32s2 -p /dev/tty.SLAB_USBtoUART -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + +include $(TOP)/py/mkrules.mk + +# Print out the value of a make variable. +# https://stackoverflow.com/questions/16467718/how-to-print-out-a-variable-in-makefile +print-%: + @echo $* = $($*) diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c new file mode 100644 index 0000000000..e22cf4aacc --- /dev/null +++ b/ports/esp32s2/background.c @@ -0,0 +1,63 @@ +/* + * 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 "py/runtime.h" +#include "supervisor/filesystem.h" +#include "supervisor/shared/stack.h" + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif + +static bool running_background_tasks = false; + +void background_tasks_reset(void) { + running_background_tasks = false; +} + +void run_background_tasks(void) { + // Don't call ourselves recursively. + if (running_background_tasks) { + return; + } + + // Delay for 1 tick so that we don't starve the idle task. + // TODO: 1 tick is 10ms which is a long time! Can we delegate to idle for a minimal amount of + // time? + vTaskDelay(1); + running_background_tasks = true; + filesystem_background(); + + // #if CIRCUITPY_DISPLAYIO + // displayio_background(); + // #endif + running_background_tasks = false; + + assert_heap_ok(); +} diff --git a/ports/esp32s2/background.h b/ports/esp32s2/background.h new file mode 100644 index 0000000000..0e1fb7a568 --- /dev/null +++ b/ports/esp32s2/background.h @@ -0,0 +1,35 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_BACKGROUND_H +#define MICROPY_INCLUDED_ESP32S2_BACKGROUND_H + +#include + +void background_tasks_reset(void); +void run_background_tasks(void); + +#endif // MICROPY_INCLUDED_ESP32S2_BACKGROUND_H diff --git a/ports/esp32s2/boards/board.h b/ports/esp32s2/boards/board.h new file mode 100644 index 0000000000..2f0db81356 --- /dev/null +++ b/ports/esp32s2/boards/board.h @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// This file defines board specific functions. + +#ifndef MICROPY_INCLUDED_ESP32S2_BOARDS_BOARD_H +#define MICROPY_INCLUDED_ESP32S2_BOARDS_BOARD_H + +#include + +// Initializes board related state once on start up. +void board_init(void); + +// Returns true if the user initiates safe mode in a board specific way. +// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific +// way. +bool board_requests_safe_mode(void); + +// Reset the state of off MCU components such as neopixels. +void reset_board(void); + +#endif // MICROPY_INCLUDED_ESP32S2_BOARDS_BOARD_H diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c new file mode 100644 index 0000000000..a3a351f272 --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h new file mode 100644 index 0000000000..78652e215b --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h @@ -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 "Saola 1 w/Wroom" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk new file mode 100644 index 0000000000..aa82588a5c --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x239A +USB_PID = 0x80A8 +USB_PRODUCT = "Saola 1 w/WROOM" +USB_MANUFACTURER = "Espressif" +USB_DEVICES = "CDC,MSC,HID" + +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_DIGITALIO = 0 +CIRCUITPY_MICROCONTROLLER = 0 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c b/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c new file mode 100644 index 0000000000..1d4e2c4eba --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c @@ -0,0 +1,46 @@ +#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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/sdkconfig b/ports/esp32s2/boards/espressif_saola_1_wroom/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c new file mode 100644 index 0000000000..a3a351f272 --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h new file mode 100644 index 0000000000..7d08ccf7f1 --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h @@ -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 "Saola 1 w/Wrover" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk new file mode 100644 index 0000000000..ff7e6228af --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x239A +USB_PID = 0x80A6 +USB_PRODUCT = "Saola 1 w/WROVER" +USB_MANUFACTURER = "Espressif" +USB_DEVICES = "CDC,MSC,HID" + +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_DIGITALIO = 0 +CIRCUITPY_MICROCONTROLLER = 0 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c b/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c new file mode 100644 index 0000000000..1d4e2c4eba --- /dev/null +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c @@ -0,0 +1,46 @@ +#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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig b/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/common-hal/board/__init__.c b/ports/esp32s2/common-hal/board/__init__.c new file mode 100644 index 0000000000..7a409d503e --- /dev/null +++ b/ports/esp32s2/common-hal/board/__init__.c @@ -0,0 +1 @@ +// No board module functions. diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c new file mode 100644 index 0000000000..349da6bf48 --- /dev/null +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -0,0 +1,137 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017-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 "shared-bindings/digitalio/DigitalInOut.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +#include "driver/gpio.h" + + +#include "esp_log.h" + +static const char* TAG = "CircuitPython digitalio"; + +void common_hal_digitalio_digitalinout_never_reset( + digitalio_digitalinout_obj_t *self) { + (void)self; +} + +digitalinout_result_t common_hal_digitalio_digitalinout_construct( + digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { + + // claim_pin(pin); + self->pin = pin; + + ESP_EARLY_LOGW(TAG, "construct %d", pin->number); + + return DIGITALINOUT_OK; +} + +bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { + return self->pin == mp_const_none; +} + +void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { + if (common_hal_digitalio_digitalinout_deinited(self)) { + return; + } + + // reset_pin_number(0, self->pin->number); + self->pin = mp_const_none; +} + +void common_hal_digitalio_digitalinout_switch_to_input( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + gpio_config_t config = { + .pin_bit_mask = 1 << self->pin->number, + .mode = GPIO_MODE_INPUT + }; + if (pull == PULL_UP) { + config.pull_up_en = GPIO_PULLUP_ENABLE; + } else if (pull == PULL_DOWN) { + config.pull_down_en = GPIO_PULLDOWN_ENABLE; + } + + gpio_config(&config); +} + +void common_hal_digitalio_digitalinout_switch_to_output( + digitalio_digitalinout_obj_t *self, bool value, + digitalio_drive_mode_t drive_mode) { + gpio_config_t config = { + .pin_bit_mask = 1ULL << self->pin->number, + .mode = GPIO_MODE_OUTPUT + }; + if (drive_mode == DRIVE_MODE_OPEN_DRAIN) { + config.mode = GPIO_MODE_OUTPUT_OD; + } + gpio_set_level(self->pin->number, value); + gpio_config(&config); +} + +digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( + digitalio_digitalinout_obj_t *self) { + + return DIRECTION_OUTPUT; +} + +void common_hal_digitalio_digitalinout_set_value( + digitalio_digitalinout_obj_t *self, bool value) { + ESP_EARLY_LOGW(TAG, "set %d %d", self->pin->number, value); + gpio_set_level(self->pin->number, value); +} + +bool common_hal_digitalio_digitalinout_get_value( + digitalio_digitalinout_obj_t *self) { + return true; +} + +void common_hal_digitalio_digitalinout_set_drive_mode( + digitalio_digitalinout_obj_t *self, + digitalio_drive_mode_t drive_mode) { + (void)self; + (void)drive_mode; +} + +digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( + digitalio_digitalinout_obj_t *self) { + // if (common_hal_digitalio_digitalinout_get_direction(self) == DIRECTION_OUTPUT) + // return DRIVE_MODE_PUSH_PULL; + // else + return DRIVE_MODE_OPEN_DRAIN; +} + +void common_hal_digitalio_digitalinout_set_pull( + digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { + (void)self; + (void)pull; +} + +digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( + digitalio_digitalinout_obj_t *self) { + return PULL_NONE; +} diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.h b/ports/esp32s2/common-hal/digitalio/DigitalInOut.h new file mode 100644 index 0000000000..6877f1741a --- /dev/null +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin; +} digitalio_digitalinout_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/esp32s2/common-hal/digitalio/__init__.c b/ports/esp32s2/common-hal/digitalio/__init__.c new file mode 100644 index 0000000000..20fad45959 --- /dev/null +++ b/ports/esp32s2/common-hal/digitalio/__init__.c @@ -0,0 +1 @@ +// No digitalio module functions. diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c new file mode 100644 index 0000000000..e142191fd7 --- /dev/null +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" + +#include "py/mphal.h" + +// Mark pin as free and return it to a quiescent state. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { +} + + +void claim_pin(const mcu_pin_obj_t* pin) { +} + +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { + return true; +} + +bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { + return pin_number_is_free(0, pin->number); +} diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h new file mode 100644 index 0000000000..ab55744221 --- /dev/null +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H + +#include "py/mphal.h" + +#include "peripherals/pins.h" + +void reset_all_pins(void); +// reset_pin_number takes the pin number instead of the pointer so that objects don't +// need to store a full pointer. +void reset_pin_number(uint8_t pin_port, uint8_t pin_number); +void claim_pin(const mcu_pin_obj_t* pin); +bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number); +void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); +// GPIO_TypeDef * pin_port(uint8_t pin_port); +uint16_t pin_mask(uint8_t pin_number); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/esp32s2/common-hal/microcontroller/Processor.c new file mode 100644 index 0000000000..8eaf1a33d2 --- /dev/null +++ b/ports/esp32s2/common-hal/microcontroller/Processor.c @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "common-hal/microcontroller/Processor.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +float common_hal_mcu_processor_get_temperature(void) { + return NAN; +} + +float common_hal_mcu_processor_get_voltage(void) { + return NAN; +} + +uint32_t common_hal_mcu_processor_get_frequency(void) { + return 0; +} + +void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { +} diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.h b/ports/esp32s2/common-hal/microcontroller/Processor.h new file mode 100644 index 0000000000..a2ea261c8f --- /dev/null +++ b/ports/esp32s2/common-hal/microcontroller/Processor.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H + +#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 15 + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} mcu_processor_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c new file mode 100644 index 0000000000..a36d0c440f --- /dev/null +++ b/ports/esp32s2/common-hal/microcontroller/__init__.c @@ -0,0 +1,128 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/microcontroller/Processor.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Processor.h" + +#include "supervisor/filesystem.h" +#include "supervisor/shared/safe_mode.h" + +void common_hal_mcu_delay_us(uint32_t delay) { + +} + +volatile uint32_t nesting_count = 0; + +void common_hal_mcu_disable_interrupts(void) { + nesting_count++; +} + +void common_hal_mcu_enable_interrupts(void) { + if (nesting_count == 0) { + + } + nesting_count--; + if (nesting_count > 0) { + return; + } +} + +void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { + if(runmode == RUNMODE_SAFE_MODE) + safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); +} + +void common_hal_mcu_reset(void) { + filesystem_flush(); //TODO: implement as part of flash improvements + // NVIC_SystemReset(); + while(1); +} + +// The singleton microcontroller.Processor object, bound to microcontroller.cpu +// It currently only has properties, and no state. +const mcu_processor_obj_t common_hal_mcu_processor_obj = { + .base = { + .type = &mcu_processor_type, + }, +}; + +// This maps MCU pin names to pin objects. +STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GPIO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GPIO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GPIO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GPIO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GPIO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GPIO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GPIO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GPIO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GPIO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GPIO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GPIO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GPIO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_GPIO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GPIO27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GPIO28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GPIO29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GPIO30), MP_ROM_PTR(&pin_GPIO30) }, + { MP_ROM_QSTR(MP_QSTR_GPIO31), MP_ROM_PTR(&pin_GPIO31) }, + { MP_ROM_QSTR(MP_QSTR_GPIO32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_GPIO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_GPIO34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_GPIO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_GPIO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_GPIO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_GPIO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_GPIO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_GPIO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_GPIO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_GPIO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_GPIO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_GPIO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_GPIO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_GPIO46), MP_ROM_PTR(&pin_GPIO46) }, +}; +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_global_dict_table); diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/esp32s2/common-hal/neopixel_write/__init__.c new file mode 100644 index 0000000000..a9b42fc96a --- /dev/null +++ b/ports/esp32s2/common-hal/neopixel_write/__init__.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "shared-bindings/neopixel_write/__init__.h" + +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { + (void)digitalinout; + (void)numBytes; +} diff --git a/ports/esp32s2/common-hal/os/__init__.c b/ports/esp32s2/common-hal/os/__init__.c new file mode 100644 index 0000000000..17bda75ad3 --- /dev/null +++ b/ports/esp32s2/common-hal/os/__init__.c @@ -0,0 +1,61 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Sean Cross + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "genhdr/mpversion.h" +#include "py/mpconfig.h" +#include "py/objstr.h" +#include "py/objtuple.h" +#include "py/qstr.h" + +STATIC const qstr os_uname_info_fields[] = { + MP_QSTR_sysname, MP_QSTR_nodename, + MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine +}; +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "esp32s2"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "esp32s2"); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE); +STATIC const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME); + + +STATIC MP_DEFINE_ATTRTUPLE( + os_uname_info_obj, + os_uname_info_fields, + 5, + (mp_obj_t)&os_uname_info_sysname_obj, + (mp_obj_t)&os_uname_info_nodename_obj, + (mp_obj_t)&os_uname_info_release_obj, + (mp_obj_t)&os_uname_info_version_obj, + (mp_obj_t)&os_uname_info_machine_obj +); + +mp_obj_t common_hal_os_uname(void) { + return (mp_obj_t)&os_uname_info_obj; +} + +bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { + return false; +} diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.c b/ports/esp32s2/common-hal/supervisor/Runtime.c new file mode 100644 index 0000000000..feab6987d8 --- /dev/null +++ b/ports/esp32s2/common-hal/supervisor/Runtime.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * 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 +#include "shared-bindings/supervisor/Runtime.h" +#include "supervisor/serial.h" + +bool common_hal_get_serial_connected(void) { + return (bool) serial_connected(); +} + +bool common_hal_get_serial_bytes_available(void) { + return (bool) serial_bytes_available(); +} + diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.h b/ports/esp32s2/common-hal/supervisor/Runtime.h new file mode 100644 index 0000000000..d1fe246211 --- /dev/null +++ b/ports/esp32s2/common-hal/supervisor/Runtime.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H +#define MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + // Stores no state currently. +} super_runtime_obj_t; + +#endif // MICROPY_INCLUDED_LITEX_COMMON_HAL_SUPERVISOR_RUNTIME_H diff --git a/ports/esp32s2/common-hal/supervisor/__init__.c b/ports/esp32s2/common-hal/supervisor/__init__.c new file mode 100644 index 0000000000..ac88556b45 --- /dev/null +++ b/ports/esp32s2/common-hal/supervisor/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Michael Schroeder + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "py/obj.h" + +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/Runtime.h" + + +// The singleton supervisor.Runtime object, bound to supervisor.runtime +// It currently only has properties, and no state. +const super_runtime_obj_t common_hal_supervisor_runtime_obj = { + .base = { + .type = &supervisor_runtime_type, + }, +}; \ No newline at end of file diff --git a/ports/esp32s2/common-hal/time/__init__.c b/ports/esp32s2/common-hal/time/__init__.c new file mode 100644 index 0000000000..c85077868a --- /dev/null +++ b/ports/esp32s2/common-hal/time/__init__.c @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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 "py/mphal.h" + +#include "tick.h" + +uint64_t common_hal_time_monotonic(void) { + return supervisor_ticks_ms64(); +} + +uint64_t common_hal_time_monotonic_ns(void) { + uint64_t ms; + uint32_t us_until_ms; + current_tick(&ms, &us_until_ms); + // us counts down. + return 1000 * (ms * 1000 + (1000 - us_until_ms)); +} + +void common_hal_time_delay_ms(uint32_t delay) { + mp_hal_delay_ms(delay); +} diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf new file mode 160000 index 0000000000..0daf6e0e41 --- /dev/null +++ b/ports/esp32s2/esp-idf @@ -0,0 +1 @@ +Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405 diff --git a/ports/esp32s2/esp32s2_peripherals_config.h b/ports/esp32s2/esp32s2_peripherals_config.h new file mode 100644 index 0000000000..aac1a2fa65 --- /dev/null +++ b/ports/esp32s2/esp32s2_peripherals_config.h @@ -0,0 +1,38 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H + +#include "py/obj.h" + +extern const mp_obj_type_t mcu_pin_type; + +#define PIN_PREFIX_VALUES { &mcu_pin_type }, +#define PIN_PREFIX_FIELDS mp_obj_base_t base; + + +#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_CONFIG_H diff --git a/ports/esp32s2/fatfs_port.c b/ports/esp32s2/fatfs_port.c new file mode 100644 index 0000000000..13ac21fb1b --- /dev/null +++ b/ports/esp32s2/fatfs_port.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +DWORD get_fattime(void) { + // TODO: Implement this function. For now, fake it. + return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); +} diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h new file mode 100644 index 0000000000..c307d47916 --- /dev/null +++ b/ports/esp32s2/mpconfigport.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef ESP32S2_MPCONFIGPORT_H__ +#define ESP32S2_MPCONFIGPORT_H__ + +#define CIRCUITPY_INTERNAL_NVM_SIZE (0) +#define MICROPY_NLR_THUMB (0) + +#define MICROPY_PY_UJSON (0) + +#include "py/circuitpy_mpconfig.h" + + +#define MICROPY_PORT_ROOT_POINTERS \ + CIRCUITPY_COMMON_ROOT_POINTERS +#define MICROPY_NLR_SETJMP (1) +#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 + + +#endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk new file mode 100644 index 0000000000..6d66d90573 --- /dev/null +++ b/ports/esp32s2/mpconfigport.mk @@ -0,0 +1,35 @@ +# Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk +# $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. +# This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + +# Internal math library is substantially smaller than toolchain one +INTERNAL_LIBM = 1 + +# Chip supplied serial number, in bytes +USB_SERIAL_NUMBER_LENGTH = 30 + +# Longints can be implemented as mpz, as longlong, or not +LONGINT_IMPL = MPZ + +CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BOARD = 1 +CIRCUITPY_DIGITALIO = 1 +CIRCUITPY_BUSIO = 0 +CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_MICROCONTROLLER = 1 +CIRCUITPY_NVM = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_TOUCHIO = 0 + +# Enable USB support +CIRCUITPY_USB_HID = 1 +CIRCUITPY_USB_MIDI = 1 diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c new file mode 100644 index 0000000000..772b61c9e0 --- /dev/null +++ b/ports/esp32s2/mphalport.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2018 Artur Pacholec + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/mphal.h" +#include "py/mpstate.h" +#include "py/gc.h" + +#include "esp-idf/components/xtensa/include/esp_debug_helpers.h" + +void mp_hal_delay_us(mp_uint_t delay) { + mp_hal_delay_ms(delay / 1000); +} + +mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) { + return (mp_uint_t) __builtin_frame_address(0); +} diff --git a/ports/esp32s2/mphalport.h b/ports/esp32s2/mphalport.h new file mode 100644 index 0000000000..4feddbd9b0 --- /dev/null +++ b/ports/esp32s2/mphalport.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Glenn Ruben Bakke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef __ESP32S2_HAL +#define __ESP32S2_HAL + +#include +#include + +#include "lib/utils/interrupt_char.h" +#include "py/mpconfig.h" +#include "supervisor/shared/tick.h" + +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) + +bool mp_hal_stdin_any(void); + +#endif diff --git a/ports/esp32s2/partitions.csv b/ports/esp32s2/partitions.csv new file mode 100644 index 0000000000..47fb295e5e --- /dev/null +++ b/ports/esp32s2/partitions.csv @@ -0,0 +1,10 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin 0x1000 +# partition table 0x8000, 0xC00 +otadata, data, ota, 0xd000, 0x2000, +ota_0, 0, ota_0, 0x10000, 512K, +ota_1, 0, ota_1, 0x90000, 512K, +phy_init, data, phy, 0x110000, 0x1000, +nvs, data, nvs, 0x111000, 0x6000, +user_fs, data, fat, 0x200000, 2M, diff --git a/ports/esp32s2/peripherals/pins.c b/ports/esp32s2/peripherals/pins.c new file mode 100755 index 0000000000..34fd6483eb --- /dev/null +++ b/ports/esp32s2/peripherals/pins.c @@ -0,0 +1,81 @@ +/* + * This file is part of the Micro Python 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 "peripherals/pins.h" + +#define NO_ADC 0xff + +// This macro is used to simplify pin definition in boards//pins.c +#define PIN(p_name, p_number) \ +const mcu_pin_obj_t pin_## p_name = { \ + PIN_PREFIX_VALUES \ + .number = p_number, \ +} + +PIN(GPIO0, 0); +PIN(GPIO1, 1); +PIN(GPIO2, 2); +PIN(GPIO3, 3); +PIN(GPIO4, 4); +PIN(GPIO5, 5); +PIN(GPIO6, 6); +PIN(GPIO7, 7); +PIN(GPIO8, 8); +PIN(GPIO9, 9); +PIN(GPIO10, 10); +PIN(GPIO11, 11); +PIN(GPIO12, 12); +PIN(GPIO13, 13); +PIN(GPIO14, 14); +PIN(GPIO15, 15); +PIN(GPIO16, 16); +PIN(GPIO17, 17); +PIN(GPIO18, 18); + +PIN(GPIO19, 19); +PIN(GPIO20, 20); +PIN(GPIO21, 21); +PIN(GPIO26, 26); +PIN(GPIO27, 27); +PIN(GPIO28, 28); +PIN(GPIO29, 29); +PIN(GPIO30, 30); +PIN(GPIO31, 31); +PIN(GPIO32, 32); +PIN(GPIO33, 33); +PIN(GPIO34, 34); +PIN(GPIO35, 35); +PIN(GPIO36, 36); +PIN(GPIO37, 37); +PIN(GPIO38, 38); +PIN(GPIO39, 39); +PIN(GPIO40, 40); +PIN(GPIO41, 41); +PIN(GPIO42, 42); +PIN(GPIO43, 43); +PIN(GPIO44, 44); +PIN(GPIO45, 45); +PIN(GPIO46, 46); diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h new file mode 100644 index 0000000000..1a74b0367d --- /dev/null +++ b/ports/esp32s2/peripherals/pins.h @@ -0,0 +1,86 @@ +/* + * This file is part of the Micro Python 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. + */ + +// DO NOT include this file directly. Use shared-bindings/microcontroller/Pin.h instead to ensure +// that all necessary includes are already included. + +#ifndef MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H +#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H + +#include + +#include "esp32s2_peripherals_config.h" + +typedef struct { + PIN_PREFIX_FIELDS + uint8_t number; +} mcu_pin_obj_t; + +extern const mcu_pin_obj_t pin_GPIO0; +extern const mcu_pin_obj_t pin_GPIO1; +extern const mcu_pin_obj_t pin_GPIO2; +extern const mcu_pin_obj_t pin_GPIO3; +extern const mcu_pin_obj_t pin_GPIO4; +extern const mcu_pin_obj_t pin_GPIO5; +extern const mcu_pin_obj_t pin_GPIO6; +extern const mcu_pin_obj_t pin_GPIO7; +extern const mcu_pin_obj_t pin_GPIO8; +extern const mcu_pin_obj_t pin_GPIO9; +extern const mcu_pin_obj_t pin_GPIO10; +extern const mcu_pin_obj_t pin_GPIO11; +extern const mcu_pin_obj_t pin_GPIO12; +extern const mcu_pin_obj_t pin_GPIO13; +extern const mcu_pin_obj_t pin_GPIO14; +extern const mcu_pin_obj_t pin_GPIO15; +extern const mcu_pin_obj_t pin_GPIO16; +extern const mcu_pin_obj_t pin_GPIO17; +extern const mcu_pin_obj_t pin_GPIO18; +extern const mcu_pin_obj_t pin_GPIO19; +extern const mcu_pin_obj_t pin_GPIO20; +extern const mcu_pin_obj_t pin_GPIO21; +extern const mcu_pin_obj_t pin_GPIO26; +extern const mcu_pin_obj_t pin_GPIO27; +extern const mcu_pin_obj_t pin_GPIO28; +extern const mcu_pin_obj_t pin_GPIO29; +extern const mcu_pin_obj_t pin_GPIO30; +extern const mcu_pin_obj_t pin_GPIO31; +extern const mcu_pin_obj_t pin_GPIO32; +extern const mcu_pin_obj_t pin_GPIO33; +extern const mcu_pin_obj_t pin_GPIO34; +extern const mcu_pin_obj_t pin_GPIO35; +extern const mcu_pin_obj_t pin_GPIO36; +extern const mcu_pin_obj_t pin_GPIO37; +extern const mcu_pin_obj_t pin_GPIO38; +extern const mcu_pin_obj_t pin_GPIO39; +extern const mcu_pin_obj_t pin_GPIO40; +extern const mcu_pin_obj_t pin_GPIO41; +extern const mcu_pin_obj_t pin_GPIO42; +extern const mcu_pin_obj_t pin_GPIO43; +extern const mcu_pin_obj_t pin_GPIO44; +extern const mcu_pin_obj_t pin_GPIO45; +extern const mcu_pin_obj_t pin_GPIO46; + +#endif // MICROPY_INCLUDED_ESP32S2_PERIPHERALS_PINS_H diff --git a/ports/esp32s2/qstrdefsport.h b/ports/esp32s2/qstrdefsport.h new file mode 100644 index 0000000000..3ba897069b --- /dev/null +++ b/ports/esp32s2/qstrdefsport.h @@ -0,0 +1 @@ +// qstrs specific to this port diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults new file mode 100644 index 0000000000..f7deb53fb0 --- /dev/null +++ b/ports/esp32s2/sdkconfig.defaults @@ -0,0 +1,822 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TARGET="esp32s2" +CONFIG_IDF_TARGET_ESP32S2=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0002 + +# +# SDK tool configuration +# +CONFIG_SDK_TOOLPREFIX="xtensa-esp32s2-elf-" +# CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set +# end of SDK tool configuration + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# end of Build type + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +# +# Bootloader config +# +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_TRAX is not set +CONFIG_APPTRACE_DEST_NONE=y +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Driver configurations +# + +# +# ADC configuration +# +# CONFIG_ADC_FORCE_XPD_FSM is not set +CONFIG_ADC_DISABLE_DAC=y +# end of ADC configuration + +# +# SPI configuration +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI configuration + +# +# UART configuration +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of UART configuration +# end of Driver configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +CONFIG_EFUSE_MAX_BLK_LEN=256 +# end of eFuse Bit Manager + +# +# ESP32S2-specific +# +# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=160 + +# +# Memory protection +# +# CONFIG_ESP32S2_MEMPROT_FEATURE is not set +# end of Memory protection + +# +# Cache config +# +# CONFIG_ESP32S2_INSTRUCTION_CACHE_8KB is not set +CONFIG_ESP32S2_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S2_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S2_INSTRUCTION_CACHE_LINE_32B=y +# CONFIG_ESP32S2_DATA_CACHE_0KB is not set +# CONFIG_ESP32S2_DATA_CACHE_8KB is not set +CONFIG_ESP32S2_DATA_CACHE_16KB=y +# CONFIG_ESP32S2_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S2_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S2_INSTRUCTION_CACHE_WRAP is not set +# CONFIG_ESP32S2_DATA_CACHE_WRAP is not set +# end of Cache config + +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set +# CONFIG_ESP32S2_TRAX is not set +CONFIG_ESP32S2_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_ONE is not set +CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO=y +CONFIG_ESP32S2_UNIVERSAL_MAC_ADDRESSES=2 +# CONFIG_ESP32S2_ULP_COPROC_ENABLED is not set +CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32S2_DEBUG_OCDAWARE=y +# CONFIG_ESP32S2_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32S2_BROWNOUT_DET=y +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP32S2_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S2_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S2_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S2_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S2_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32S2_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S2_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S2_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S2_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES=576 +# CONFIG_ESP32S2_NO_BLOBS is not set +# end of ESP32S2-specific + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +# end of Power Management + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_TX_GPIO=1 +CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_TASK_WDT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +# end of Common ESP-related + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_USE_OPENETH is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y +# end of ESP NETIF Adapter + +# +# ESP System Settings +# +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# end of ESP System Settings + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +# CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +# CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE is not set +# end of Wi-Fi + +# +# PHY +# +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# end of PHY + +# +# Core dump +# +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +# end of Core dump + +# +# FreeRTOS +# +CONFIG_FREERTOS_UNICORE=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y +# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set +# CONFIG_FREERTOS_ASSERT_DISABLE is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# end of FreeRTOS + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_FRAG=y +# CONFIG_LWIP_IP_REASSEMBLY is not set +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set + +# +# DHCP server +# +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set + +# +# ICMP +# +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_ESP_LWIP_ASSERT=y +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DEBUG is not set + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y +CONFIG_MBEDTLS_HARDWARE_GCM=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +CONFIG_MBEDTLS_PSK_MODES=y +CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +CONFIG_MBEDTLS_SSL_PROTO_TLS1=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +CONFIG_MBEDTLS_RC4_DISABLED=y +# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set +# CONFIG_MBEDTLS_RC4_ENABLED is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_SECURITY_RISKS is not set +# end of mbedTLS + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +# end of Newlib + +# +# NVS +# +# end of NVS + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +# end of Auto-detect flash chips +# end of SPI Flash driver + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Supplicant +# +CONFIG_WPA_MBEDTLS_CRYPTO=y +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_WPA_TLS_V12 is not set +# end of Supplicant +# end of Component config + +# +# Compatibility options +# +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +# end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32s2-elf-" +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set +CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_IPC_TASK_STACK_SIZE=1024 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_TX_GPIO=1 +CONFIG_CONSOLE_UART_RX_GPIO=3 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_ESP32S2_PANIC_PRINT_HALT=y +# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=6 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# End of deprecated options diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c new file mode 100644 index 0000000000..aab7e587ae --- /dev/null +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -0,0 +1,122 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "supervisor/internal_flash.h" + +#include +#include +#include + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mphal.h" +#include "py/obj.h" +#include "py/runtime.h" +#include "lib/oofatfs/ff.h" + +#include "esp-idf/components/spi_flash/include/esp_partition.h" + +#include "esp_log.h" + + +static const char* TAG = "CircuitPython Internal Flash"; + +#include "supervisor/usb.h" + +STATIC const esp_partition_t * _partition; + +void supervisor_flash_init(void) { + _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, + ESP_PARTITION_SUBTYPE_DATA_FAT, + NULL); + + ESP_EARLY_LOGW(TAG, "fatfs partition %p", _partition); +} + +uint32_t supervisor_flash_get_block_size(void) { + return FILESYSTEM_BLOCK_SIZE; +} + +uint32_t supervisor_flash_get_block_count(void) { + return _partition->size / FILESYSTEM_BLOCK_SIZE; +} + +void port_internal_flash_flush(void) { + +} + +// TODO: Split the caching out of supervisor/shared/external_flash so we can use it. +#define SECTOR_SIZE 4096 +STATIC uint8_t _cache[SECTOR_SIZE]; +STATIC uint32_t _cache_lba; + +mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { + esp_err_t ok = esp_partition_read(_partition, + block * FILESYSTEM_BLOCK_SIZE, + dest, + num_blocks * FILESYSTEM_BLOCK_SIZE); + ESP_EARLY_LOGW(TAG, "read %d", ok); + return 0; +} + +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32_t num_blocks) { + uint32_t blocks_per_sector = SECTOR_SIZE / FILESYSTEM_BLOCK_SIZE; + uint32_t block = 0; + while (block < num_blocks) { + uint32_t block_address = lba + block; + uint32_t sector_offset = block_address / blocks_per_sector * SECTOR_SIZE; + uint8_t block_offset = block_address % blocks_per_sector; + + esp_err_t result; + if (_cache_lba != block_address) { + result = esp_partition_read(_partition, + sector_offset, + _cache, + SECTOR_SIZE); + ESP_EARLY_LOGW(TAG, "flash read before write %d", result); + _cache_lba = sector_offset; + } + for (uint8_t b = block_offset; b < blocks_per_sector; b++) { + memcpy(_cache + b * FILESYSTEM_BLOCK_SIZE, + src + block * FILESYSTEM_BLOCK_SIZE, + FILESYSTEM_BLOCK_SIZE); + block++; + } + result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); + ESP_EARLY_LOGW(TAG, "erase %d", result); + result = esp_partition_write(_partition, + sector_offset, + _cache, + SECTOR_SIZE); + ESP_EARLY_LOGW(TAG, "write %d", result); + } + + return 0; // success +} + +void supervisor_flash_release_cache(void) { +} + diff --git a/ports/esp32s2/supervisor/internal_flash.h b/ports/esp32s2/supervisor/internal_flash.h new file mode 100644 index 0000000000..e06ef2d160 --- /dev/null +++ b/ports/esp32s2/supervisor/internal_flash.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H +#define MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H + +#include +#include + +#include "py/mpconfig.h" + +#define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms +#define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) + +#endif // MICROPY_INCLUDED_ESP32S2_INTERNAL_FLASH_H diff --git a/ports/esp32s2/supervisor/internal_flash_root_pointers.h b/ports/esp32s2/supervisor/internal_flash_root_pointers.h new file mode 100644 index 0000000000..ae3e45e14c --- /dev/null +++ b/ports/esp32s2/supervisor/internal_flash_root_pointers.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#ifndef MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H +#define MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H + +#define FLASH_ROOT_POINTERS + +#endif // MICROPY_INCLUDED_LITEX_INTERNAL_FLASH_ROOT_POINTERS_H diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c new file mode 100644 index 0000000000..4389bb6a85 --- /dev/null +++ b/ports/esp32s2/supervisor/port.c @@ -0,0 +1,162 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include +#include "supervisor/port.h" +#include "boards/board.h" + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#include "supervisor/memory.h" +#include "supervisor/shared/tick.h" + +#include "esp_log.h" + +static const char* TAG = "CircuitPython"; + +STATIC esp_timer_handle_t _tick_timer; + +void tick_timer_cb(void* arg) { + supervisor_tick(); +} + +safe_mode_t port_init(void) { + esp_timer_create_args_t args; + args.callback = &tick_timer_cb; + args.arg = NULL; + args.dispatch_method = ESP_TIMER_TASK; + args.name = "CircuitPython Tick"; + esp_err_t result = esp_timer_create(&args, &_tick_timer); + if (result != ESP_OK) { + ESP_EARLY_LOGE(TAG, "Unable to create tick timer."); + } + ESP_EARLY_LOGW(TAG, "port init done"); + return NO_SAFE_MODE; +} + +void reset_port(void) { + +} + +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]); +} + +uint32_t *port_stack_get_limit(void) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-align" + return (uint32_t*) pxTaskGetStackStart(NULL); + #pragma GCC diagnostic pop +} + +uint32_t *port_stack_get_top(void) { + return port_stack_get_limit() + CONFIG_ESP_MAIN_TASK_STACK_SIZE / (sizeof(uint32_t) / sizeof(StackType_t)); +} + +supervisor_allocation _fixed_stack; + +supervisor_allocation* port_fixed_stack(void) { + + ESP_EARLY_LOGW(TAG, "port fixed stack"); + _fixed_stack.ptr = port_stack_get_limit(); + ESP_EARLY_LOGW(TAG, "got limit %p", _fixed_stack.ptr); + _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); + ESP_EARLY_LOGW(TAG, "got length %d", _fixed_stack.length); + return &_fixed_stack; +} + +// Place the word to save just after our BSS section that gets blanked. +void port_set_saved_word(uint32_t value) { +} + +uint32_t port_get_saved_word(void) { + return 0; +} + +uint64_t port_get_raw_ticks(uint8_t* subticks) { + struct timeval tv_now; + gettimeofday(&tv_now, NULL); + uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 32768; + if (subticks != NULL) { + *subticks = all_subticks % 32; + } + return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; +} + +// Enable 1/1024 second tick. +void port_enable_tick(void) { + esp_err_t result = esp_timer_start_periodic(_tick_timer, 1000000 / 1024); + if (result != ESP_OK) { + ESP_EARLY_LOGE(TAG, "Unable to start tick timer."); + } +} + +// Disable 1/1024 second tick. +void port_disable_tick(void) { + esp_timer_stop(_tick_timer); +} + +TickType_t sleep_time_set; +TickType_t sleep_time_duration; +void port_interrupt_after_ticks(uint32_t ticks) { + // ESP_EARLY_LOGW(TAG, "after ticks"); + sleep_time_set = xTaskGetTickCount(); + sleep_time_duration = ticks / portTICK_PERIOD_MS; + // esp_sleep_enable_timer_wakeup(uint64_t time_in_us) +} + +void port_sleep_until_interrupt(void) { + // ESP_EARLY_LOGW(TAG, "sleep until"); + // FreeRTOS delay here maybe. + // Light sleep shuts down BLE and wifi. + // esp_light_sleep_start() + vTaskDelayUntil(&sleep_time_set, sleep_time_duration); +} + + +// Wrap main in app_main that the IDF expects. +extern void main(void); +void app_main(void) { + ESP_EARLY_LOGW(TAG, "Hello from CircuitPython"); + // ESP_LOGW(TAG, "Hello from CircuitPython"); + + main(); +} diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c new file mode 100644 index 0000000000..7a24a90cb9 --- /dev/null +++ b/ports/esp32s2/supervisor/usb.c @@ -0,0 +1,80 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 hathach for Adafruit Industries + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/usb.h" +#include "lib/utils/interrupt_char.h" +#include "lib/mp-readline/readline.h" + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#include "hal/usb_hal.h" + +#include "tusb.h" + +#ifdef CFG_TUSB_DEBUG + #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE) +#else + #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) +#endif + +StackType_t usb_device_stack[USBD_STACK_SIZE]; +StaticTask_t usb_device_taskdef; + +// USB Device Driver task +// This top level thread process all usb events and invoke callbacks +void usb_device_task(void* param) +{ + (void) param; + + // RTOS forever loop + while (1) + { + // tinyusb device task + if (tusb_inited()) { + tud_task(); + tud_cdc_write_flush(); + } + vTaskDelay(10); + } +} + +void init_usb_hardware(void) { + usb_hal_context_t hal = { + .use_external_phy = false // use built-in PHY + }; + usb_hal_init(&hal); + + (void) xTaskCreateStatic(usb_device_task, + "usbd", + USBD_STACK_SIZE, + NULL, + configMAX_PRIORITIES-1, + usb_device_stack, + &usb_device_taskdef); +} + diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 2297b15b17..4721d82fad 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -91,6 +91,10 @@ void reset_to_bootloader(void) { void reset_cpu(void) { } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + uint32_t *port_heap_get_bottom(void) { return port_stack_get_limit(); } diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 6ea413216a..3e5affda94 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -216,6 +216,10 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif +#ifndef MICROPY_PY_REVERSE_SPECIAL_METHODS +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) +#endif + #if INTERNAL_FLASH_FILESYSTEM == 0 && QSPI_FLASH_FILESYSTEM == 0 && SPI_FLASH_FILESYSTEM == 0 && !DISABLE_FILESYSTEM #error No *_FLASH_FILESYSTEM set! #endif @@ -610,6 +614,10 @@ extern const struct _mp_obj_module_t ustack_module; #endif #if defined(CIRCUITPY_ULAB) && CIRCUITPY_ULAB +// ulab requires reverse special methods +#if defined(MICROPY_PY_REVERSE_SPECIAL_METHODS) && !MICROPY_PY_REVERSE_SPECIAL_METHODS +#error "ulab requires MICROPY_PY_REVERSE_SPECIAL_METHODS" +#endif #define ULAB_MODULE \ { MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) }, #else diff --git a/supervisor/port.h b/supervisor/port.h index ccbb314adf..8a12d34c8a 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -29,6 +29,7 @@ #include "py/mpconfig.h" +#include "supervisor/memory.h" #include "supervisor/shared/safe_mode.h" // Provided by the linker; @@ -60,6 +61,8 @@ uint32_t *port_stack_get_limit(void); // Get stack top address uint32_t *port_stack_get_top(void); +supervisor_allocation* port_fixed_stack(void); + // Get heap bottom address uint32_t *port_heap_get_bottom(void); diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index d52334eb49..8ae8a16997 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -129,5 +129,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { } void supervisor_move_memory(void) { + #if CIRCUITPY_DISPLAYIO supervisor_display_move_memory(); + #endif } diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index 2b7b1c03a4..e7aa956b01 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -41,22 +41,24 @@ supervisor_allocation* stack_alloc = NULL; #define EXCEPTION_STACK_SIZE 1024 void allocate_stack(void) { - mp_uint_t regs[10]; - mp_uint_t sp = cpu_get_regs_and_sp(regs); - mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; - - if (port_stack_get_top() != port_heap_get_top()) { - return; - } - - stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true); - if (stack_alloc == NULL) { - stack_alloc = allocate_memory(c_size + CIRCUITPY_DEFAULT_STACK_SIZE + EXCEPTION_STACK_SIZE, true); - current_stack_size = CIRCUITPY_DEFAULT_STACK_SIZE; + if (port_fixed_stack() != NULL) { + stack_alloc = port_fixed_stack(); + current_stack_size = stack_alloc->length; } else { - current_stack_size = next_stack_size; + mp_uint_t regs[10]; + mp_uint_t sp = cpu_get_regs_and_sp(regs); + + mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; + stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true); + if (stack_alloc == NULL) { + stack_alloc = allocate_memory(c_size + CIRCUITPY_DEFAULT_STACK_SIZE + EXCEPTION_STACK_SIZE, true); + current_stack_size = CIRCUITPY_DEFAULT_STACK_SIZE; + } else { + current_stack_size = next_stack_size; + } } + *stack_alloc->ptr = STACK_CANARY_VALUE; } diff --git a/supervisor/shared/stack.h b/supervisor/shared/stack.h index 1fb43be573..7096f0b3ed 100755 --- a/supervisor/shared/stack.h +++ b/supervisor/shared/stack.h @@ -43,6 +43,8 @@ bool stack_ok(void); // exception when the stack has likely overwritten a portion of the heap. void assert_heap_ok(void); +#ifndef STACK_CANARY_VALUE #define STACK_CANARY_VALUE 0x017829ef +#endif #endif // MICROPY_INCLUDED_SUPERVISOR_STACK_H diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 1b0c834160..627de743e2 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -52,7 +52,9 @@ #define CFG_TUSB_DEBUG 0 /*------------- RTOS -------------*/ +#ifndef CFG_TUSB_OS #define CFG_TUSB_OS OPT_OS_NONE +#endif //#define CFG_TUD_TASK_QUEUE_SZ 16 //#define CFG_TUD_TASK_PRIO 0 //#define CFG_TUD_TASK_STACK_SZ 150 diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 774055a82a..edf8101188 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -75,7 +75,9 @@ void usb_init(void) { void usb_background(void) { if (usb_enabled()) { + #if CFG_TUSB_OS == OPT_OS_NONE tud_task(); + #endif tud_cdc_write_flush(); } } diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index d6422f074e..195e4a9b23 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -3,7 +3,6 @@ SRC_SUPERVISOR = \ supervisor/port.c \ supervisor/shared/autoreload.c \ supervisor/shared/board.c \ - supervisor/shared/display.c \ supervisor/shared/filesystem.c \ supervisor/shared/flash.c \ supervisor/shared/micropython.c \ @@ -104,6 +103,14 @@ else CFLAGS += -DUSB_AVAILABLE endif +SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) + +ifeq ($(CIRCUITPY_DISPLAYIO), 1) + SRC_SUPERVISOR += \ + supervisor/shared/display.c + + SUPERVISOR_O += $(BUILD)/autogen_display_resources.o +endif ifndef USB_INTERFACE_NAME USB_INTERFACE_NAME = "CircuitPython" endif @@ -182,8 +189,6 @@ ifeq ($(USB_RENUMBER_ENDPOINTS), 0) USB_DESCRIPTOR_ARGS += --no-renumber_endpoints endif -SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o)) $(BUILD)/autogen_display_resources.o - $(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: autogen_usb_descriptor.intermediate diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 3594f2ae76..7eed2c70cc 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -12,7 +12,7 @@ from sh.contrib import git sys.path.append("adabot") import adabot.github_requests as github -SUPPORTED_PORTS = ["nrf", "atmel-samd", "stm", "cxd56", "mimxrt10xx", "litex"] +SUPPORTED_PORTS = ["atmel-samd", "cxd56", "esp32s2", "litex", "mimxrt10xx", "nrf", "stm"] BIN = ('bin',) UF2 = ('uf2',) @@ -35,6 +35,7 @@ extension_by_port = { "cxd56": SPK, "mimxrt10xx": HEX_UF2, "litex": DFU, + "esp32s2": BIN } # Per board overrides diff --git a/tools/join_bins.py b/tools/join_bins.py new file mode 100644 index 0000000000..cb73aaabb8 --- /dev/null +++ b/tools/join_bins.py @@ -0,0 +1,20 @@ +import sys + +output_filename = sys.argv[1] +input_filenames = {} +i = 2 +while i < len(sys.argv): + offset = int(sys.argv[i], 16) + filename = sys.argv[i + 1] + input_filenames[offset] = filename + i += 2 + +with open(output_filename, "wb") as output_file: + offsets = sorted(input_filenames.keys()) + for offset in offsets: + input_filename = input_filenames[offset] + # Fill with ones to save NOR flash. + while output_file.tell() < offset: + output_file.write(b"\xff") + with open(input_filename, "rb") as input_file: + output_file.write(input_file.read()) From 3c1469b0a507c104e6623290a20f13081e6a52a6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 May 2020 16:22:33 -0700 Subject: [PATCH 506/919] Add port_fixed_stack for more builds --- ports/mimxrt10xx/supervisor/port.c | 4 ++++ ports/nrf/supervisor/port.c | 4 ++++ ports/stm/supervisor/port.c | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 18cb408cb0..b6ae002930 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -318,6 +318,10 @@ void reset_cpu(void) { reset(); } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + extern uint32_t _ld_heap_start, _ld_heap_end, _ld_stack_top, _ld_stack_bottom; uint32_t *port_stack_get_limit(void) { return &_ld_heap_start; diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 539a9cf90b..87632fa4dd 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -185,6 +185,10 @@ uint32_t *port_heap_get_top(void) { return port_stack_get_top(); } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + uint32_t *port_stack_get_limit(void) { return &_ebss; } diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 23ba7d8745..9b62fa2eb1 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -176,7 +176,7 @@ safe_mode_t port_init(void) { uint32_t tickstart = HAL_GetTick(); // H7/F7 untested with LSE, so autofail them until above move is done - #if (CPY_STM32F4) + #if (CPY_STM32F4) bool lse_setupsuccess = true; #else bool lse_setupsuccess = false; @@ -281,6 +281,10 @@ uint32_t *port_heap_get_top(void) { return &_ld_heap_end; } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + uint32_t *port_stack_get_limit(void) { return &_ld_stack_bottom; } From 86f865afe04b07e8ffe482a58e957935908b4ef8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 May 2020 16:42:22 -0700 Subject: [PATCH 507/919] Turn reverse methods off for cpx_crickit --- .../boards/circuitplayground_express_crickit/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 312fd26268..17204a31a4 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -32,6 +32,8 @@ // Increase stack size slightly due to CPX library import nesting #define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) + #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) From bad635e117e0b6a7aca55c72cb9a15e7a557507f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 15 May 2020 19:05:31 -0500 Subject: [PATCH 508/919] add new Czech (cs) translation file --- locale/cs.po | 3214 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3214 insertions(+) create mode 100644 locale/cs.po diff --git a/locale/cs.po b/locale/cs.po new file mode 100644 index 0000000000..493245dbfc --- /dev/null +++ b/locale/cs.po @@ -0,0 +1,3214 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: py/obj.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%s' object does not support '%q'" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/__init__.c +#: ports/cxd56/common-hal/microcontroller/__init__.c +#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display rotation must be in 90 degree increments" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c +#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c +msgid "Function requires lock" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +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 +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +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 +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object '%s' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "" + +#: shared-bindings/touchio/TouchIn.c +msgid "threshold must be in the range 0-65536" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/linalg.c py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" From 8edb8e87c8d372203fcde3ec9df044c64d9caa0b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 May 2020 17:22:22 -0700 Subject: [PATCH 509/919] Turn reverse methods off for trinket haxpress --- ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h index af473b1288..182c6fa050 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h @@ -18,6 +18,8 @@ #define CALIBRATE_CRYSTALLESS 1 +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) + #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) From a57da6b808b53e1a23aff327710a0e365ecc6acc Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 15 May 2020 17:22:41 -0700 Subject: [PATCH 510/919] Add port_fixed_stack for more spresence --- ports/cxd56/supervisor/port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 73d6fb9309..9ec9dbfdf2 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -76,6 +76,10 @@ void reset_port(void) { void reset_to_bootloader(void) { } +supervisor_allocation* port_fixed_stack(void) { + return NULL; +} + uint32_t *port_stack_get_limit(void) { struct tcb_s *rtcb = this_task(); From e175a64036585a4848892c33620e7b0ac1d40ece Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 15 May 2020 20:35:12 -0400 Subject: [PATCH 511/919] disable rotaryio in CPX crickit --- .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 3daa2e4fcd..46a245e609 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_PIXELBUF = 1 +CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 From 7424e418272eaf34e84ae579188e89e18a5f5a9f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 16 May 2020 11:20:25 -0400 Subject: [PATCH 512/919] update frozen libs --- frozen/Adafruit_CircuitPython_BLE | 2 +- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_ESP32SPI | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_IRRemote | 2 +- frozen/Adafruit_CircuitPython_LIS3DH | 2 +- frozen/Adafruit_CircuitPython_LSM6DS | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_Register | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- frozen/Adafruit_CircuitPython_Thermistor | 2 +- frozen/Adafruit_CircuitPython_seesaw | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index 96774b15da..5d584576ef 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit 96774b15da61da54662bcfbbf15b5bdc27315a9f +Subproject commit 5d584576ef79ca36506e6c7470e7ac5204cf0a8d diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index 0b0d1e999a..e9411c4244 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit 0b0d1e999a6c7944e55bed59a30ccc21b3c96666 +Subproject commit e9411c4244984b69ec6928370ede40cec014c10b diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index 2cf0f40ab8..e9f15d6150 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit 2cf0f40ab818fddbc2cecf3ec495ed16067c5f7e +Subproject commit e9f15d61502f34173912ba271aaaf9446dae8da1 diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 09bd10e948..0e1230676a 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 09bd10e94894a4eec7e3a02b51ffb5d8581b3024 +Subproject commit 0e1230676a54da17a309d1dfffdd7fa90240191c diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index 84eadeafa9..f4f66fa039 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit 84eadeafa9144829b8c6faf903b4282d58a77353 +Subproject commit f4f66fa03990428c239eac68d37f79a7245b4cd3 diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index f523b2316b..94b03517c1 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit f523b2316bc3e25220b88c5435868c6a5880dfab +Subproject commit 94b03517c1f4ff68cc2bb09b0963f7e7e3ce3d04 diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index f044548d6d..65fb213b8c 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit f044548d6d3aa21650b50232bb16e0b29f540b8f +Subproject commit 65fb213b8c554181d54b77f75335e16e2f4c0987 diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index 9dac9628e4..d435fc9a9d 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit 9dac9628e48675308d447b70b2005f7d1f0ddf6b +Subproject commit d435fc9a9d90cb063608ae037bf5284b33bc5e84 diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index 42a55eafcb..457aba6dd5 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit 42a55eafcb29f563b31e23af902c31dac8289900 +Subproject commit 457aba6dd59ad00502b80c9031655d3d26ecc82b diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 24224cc905..ee8f2187d4 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 24224cc905fad4646506caeb2451b4a495804ffc +Subproject commit ee8f2187d4795b08ae4aa60558f564d26c997be9 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index ddcd1e7154..5fd72fb963 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit ddcd1e7154f1b27f9a87daffb6e691e1e7051b64 +Subproject commit 5fd72fb963c4a0318d29282ca2cc988f19787fda diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index 10db851c81..59add970cc 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit 10db851c81873fd8db207ff0c4d9342426ee25a4 +Subproject commit 59add970cc66f9b0f2d45082e86b25650843a159 diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index c525eedeb0..56358b4494 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit c525eedeb0d20c9829febfbf621eab707da71f8a +Subproject commit 56358b4494da825cd99a56a854119f926abca670 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index e8a759719e..41de8b3c05 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit e8a759719e94c69a01f9e07d418ca6db39114db3 +Subproject commit 41de8b3c05dd78d7be8893a0f6cb47a7e9b421a2 diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index efd548b1e3..96ee9954a3 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit efd548b1e36c534bbce494f4cb0d9a625dd170cd +Subproject commit 96ee9954a3099ee9c9d7d7b7747f30ab3c6a45bf diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index ac83a3dc70..b5bbdbd56c 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit ac83a3dc703ec50b2236c773d22c47a0c0aaba43 +Subproject commit b5bbdbd56ca205c581ba2c84d927ef99befce88e diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index dc01285aa4..76c0dd1329 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit dc01285aa45dd8260bb3ae35a657e4cdcbf325b8 +Subproject commit 76c0dd13294ce8ae0518cb9882dcad5d3668977e From db924fb01eaf267b9516d355ba8cb3ba404c7096 Mon Sep 17 00:00:00 2001 From: ppolk-nocimed Date: Sat, 16 May 2020 12:47:49 -0700 Subject: [PATCH 513/919] Digital In Out Type Hints --- shared-bindings/digitalio/DigitalInOut.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 54ced099db..0ae8b804c7 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -71,7 +71,7 @@ STATIC mp_obj_t digitalio_digitalinout_make_new(const mp_obj_type_t *type, return MP_OBJ_FROM_PTR(self); } -//| def deinit(self, ) -> Any: +//| def deinit(self) -> None: //| """Turn off the DigitalInOut and release the pin for other use.""" //| ... //| @@ -82,13 +82,13 @@ STATIC mp_obj_t digitalio_digitalinout_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(digitalio_digitalinout_deinit_obj, digitalio_digitalinout_obj_deinit); -//| def __enter__(self, ) -> Any: +//| def __enter__(self, ) -> self: //| """No-op used by Context Managers.""" //| ... //| // Provided by context manager helper. -//| def __exit__(self, ) -> Any: +//| def __exit__(self, ) -> None: //| """Automatically deinitializes the hardware when exiting a context. See //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... @@ -106,12 +106,13 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { } } -//| def switch_to_output(self, value: bool = False, drive_mode: digitalio.DriveMode = digitalio.DriveMode.PUSH_PULL) -> Any: +//| def switch_to_output(self, value: bool = False, drive_mode: digitalio.DriveMode = digitalio.DriveMode.PUSH_PULL) -> None: //| """Set the drive mode and value and then switch to writing out digital //| values. //| //| :param bool value: default value to set upon switching -//| :param ~digitalio.DriveMode drive_mode: drive mode for the output""" +//| :param ~digitalio.DriveMode drive_mode: drive mode for the output +//| """ //| ... //| STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { @@ -135,7 +136,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_output_obj, 1, digitalio_digitalinout_switch_to_output); -//| def switch_to_input(self, pull: Pull = None) -> Any: +//| def switch_to_input(self, pull: Pull = None) -> None: //| """Set the pull and then switch to read in digital values. //| //| :param Pull pull: pull configuration for the input @@ -161,6 +162,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_o check_for_deinit(self); mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + digitalio_pull_t pull = PULL_NONE; if (args[ARG_pull].u_rom_obj == &digitalio_pull_up_obj) { @@ -174,7 +176,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_o } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_input_obj, 1, digitalio_digitalinout_switch_to_input); -//| direction: Any = ... +//| direction: Direction = ... //| """The direction of the pin. //| //| Setting this will use the defaults from the corresponding @@ -220,7 +222,7 @@ const mp_obj_property_t digitalio_digitalio_direction_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| value: Any = ... +//| value: Bool = ... //| """The digital logic level of the pin.""" //| STATIC mp_obj_t digitalio_digitalinout_obj_get_value(mp_obj_t self_in) { @@ -250,7 +252,7 @@ const mp_obj_property_t digitalio_digitalinout_value_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| drive_mode: Any = ... +//| drive_mode: DriveMode = ... //| """The pin drive mode. One of: //| //| - `digitalio.DriveMode.PUSH_PULL` @@ -294,7 +296,7 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pull: Any = ... +//| pull: Optional[Pull] ... //| """The pin pull direction. One of: //| //| - `digitalio.Pull.UP` From f76ff1eb698ed20d47d6cdd968dca300093836cc Mon Sep 17 00:00:00 2001 From: ppolk-nocimed Date: Sat, 16 May 2020 13:14:50 -0700 Subject: [PATCH 514/919] Fixed Optional[Pull] --- shared-bindings/digitalio/DigitalInOut.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 0ae8b804c7..342f684ba6 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -162,7 +162,7 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_input(size_t n_args, const mp_o check_for_deinit(self); mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - + digitalio_pull_t pull = PULL_NONE; if (args[ARG_pull].u_rom_obj == &digitalio_pull_up_obj) { @@ -296,7 +296,7 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| pull: Optional[Pull] ... +//| pull: Optional[Pull] = ... //| """The pin pull direction. One of: //| //| - `digitalio.Pull.UP` From c6406c74eccb585d8034b948b0228a09d6717b30 Mon Sep 17 00:00:00 2001 From: ppolk-nocimed Date: Sat, 16 May 2020 13:21:34 -0700 Subject: [PATCH 515/919] Added DigitalInOut suggestion --- shared-bindings/digitalio/DigitalInOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 342f684ba6..0cea74da0b 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -82,7 +82,7 @@ STATIC mp_obj_t digitalio_digitalinout_obj_deinit(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(digitalio_digitalinout_deinit_obj, digitalio_digitalinout_obj_deinit); -//| def __enter__(self, ) -> self: +//| def __enter__(self, ) -> DigitalInOut: //| """No-op used by Context Managers.""" //| ... //| From 5e43f7a36174267515cfdf651f0a9b871953543b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 16 May 2020 17:58:08 -0500 Subject: [PATCH 516/919] add weblate status badge in readme --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 51db41a8bc..dfddd13373 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ CircuitPython .. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png -|Build Status| |Doc Status| |License| |Discord| +|Build Status| |Doc Status| |License| |Discord| |Weblate| `circuitpython.org `__ \| `Get CircuitPython <#get-circuitpython>`__ \| `Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \| @@ -219,3 +219,5 @@ The remaining port directories not listed above are in the repo to maintain comp :target: https://adafru.it/discord .. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg :target: https://choosealicense.com/licenses/mit/ +.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg + :target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget From 4f7b4241a2149dea50f973e466fe96a9500b7040 Mon Sep 17 00:00:00 2001 From: cyz Date: Mon, 18 May 2020 09:42:37 +0800 Subject: [PATCH 517/919] add hiibot_bluefi --- ports/nrf/boards/hiibot_bluefi/board.c | 103 ++++++++++ .../nrf/boards/hiibot_bluefi/mpconfigboard.h | 67 +++++++ .../nrf/boards/hiibot_bluefi/mpconfigboard.mk | 18 ++ ports/nrf/boards/hiibot_bluefi/pins.c | 180 ++++++++++++++++++ 4 files changed, 368 insertions(+) create mode 100644 ports/nrf/boards/hiibot_bluefi/board.c create mode 100644 ports/nrf/boards/hiibot_bluefi/mpconfigboard.h create mode 100644 ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk create mode 100644 ports/nrf/boards/hiibot_bluefi/pins.c diff --git a/ports/nrf/boards/hiibot_bluefi/board.c b/ports/nrf/boards/hiibot_bluefi/board.c new file mode 100644 index 0000000000..6b53cab139 --- /dev/null +++ b/ports/nrf/boards/hiibot_bluefi/board.c @@ -0,0 +1,103 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0x01, 0 | DELAY, 150, // SWRESET + 0x11, 0 | DELAY, 255, // SLPOUT + 0x36, 1, 0b10100000, // _MADCTL for rotation 0 + 0x3a, 1, 0x55, // COLMOD - 16bit color + 0x21, 0 | DELAY, 10, // _INVON + 0x13, 0 | DELAY, 10, // _NORON + 0x29, 0 | DELAY, 255, // _DISPON +}; + +void board_init(void) { + busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_P0_07, &pin_P1_08, NULL); // SCK, MOSI, MISO + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_P0_27, // TFT_DC Command or data + &pin_P0_05, // TFT_CS Chip select + NULL, // no TFT_RST Reset + //&pin_P1_14, // TFT_RST Reset + 60000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t* display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 240, // Width (after rotation) + 240, // Height (after rotation) + 80, // column start + 0, // row start + 180, // rotation + 16, // Color depth + false, // Grayscale + false, // Pixels in a byte share a row. Only used for depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + 0x37, // set vertical scroll command + display_init_sequence, + sizeof(display_init_sequence), + &pin_P1_13, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true); // backlight_on_high +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h new file mode 100644 index 0000000000..c4833e7196 --- /dev/null +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h @@ -0,0 +1,67 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "HiiBot BlueFi" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_NEOPIXEL (&pin_P1_10) // P18 / D18 + +#define MICROPY_HW_LED_STATUS (&pin_P1_12) // P17 / D17 + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 1) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(1, 4) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 6) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 5) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 3) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 2) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P1_01 +#define SPI_FLASH_MISO_PIN &pin_P1_04 +#define SPI_FLASH_SCK_PIN &pin_P1_03 +#define SPI_FLASH_CS_PIN &pin_P1_02 +#endif + +// No 32kHz crystal. THere's a 32MHz crystal in the nRF module. +#define BOARD_HAS_32KHZ_XTAL (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_00) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_31) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_06) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_26) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_04) + +#define DEFAULT_UART_BUS_RX (&pin_P0_28) +#define DEFAULT_UART_BUS_TX (&pin_P0_02) + + + diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk new file mode 100644 index 0000000000..ad477e534a --- /dev/null +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x239A +USB_PID = 0x0016 +USB_PRODUCT = "HiiBot BlueFi" +USB_MANUFACTURER = "HiiBot" + +MCU_CHIP = nrf52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ" + +# Allocate two, not just one I2C peripheral for Bluefi, so that we have both +# on-board and off-board I2C available. +# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals. +# We use a CFLAGS define here because there are include order issues +# if we try to include "mpconfigport.h" into nrfx_config.h . +CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 + diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c new file mode 100644 index 0000000000..340ea948cf --- /dev/null +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -0,0 +1,180 @@ +#include "shared-bindings/board/__init__.h" + +#include "boards/board.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_28) }, + + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_02) }, + + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_30) }, + + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_P1_07) }, + + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_08) }, + + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_25) }, + + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_23) }, + + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_21) }, + + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_19) }, + + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_P0_01) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_01) }, + + { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_REDLED), MP_ROM_PTR(&pin_P1_12) }, + + { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_P0_00) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_00) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_00) }, + + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_P21), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_09) }, + + { MP_ROM_QSTR(MP_QSTR_P22), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_P23), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_P0_07) }, + + { MP_ROM_QSTR(MP_QSTR_P24), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_P1_08) }, + + { MP_ROM_QSTR(MP_QSTR_P25), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_P26), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_P0_27) }, + + { MP_ROM_QSTR(MP_QSTR_P27), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_14) }, + + // P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ) + + { MP_ROM_QSTR(MP_QSTR_P34), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_SCK), MP_ROM_PTR(&pin_P0_22) }, + + { MP_ROM_QSTR(MP_QSTR_P35), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_MISO), MP_ROM_PTR(&pin_P0_17) }, + + { MP_ROM_QSTR(MP_QSTR_P36), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_MOSI), MP_ROM_PTR(&pin_P0_20) }, + + { MP_ROM_QSTR(MP_QSTR_P37), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_BUSY), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_P38), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_CS), MP_ROM_PTR(&pin_P0_24) }, + + { MP_ROM_QSTR(MP_QSTR_P39), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_RESET), MP_ROM_PTR(&pin_P1_00) }, + + { MP_ROM_QSTR(MP_QSTR_P40), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_PWR), MP_ROM_PTR(&pin_P0_13) }, + + { MP_ROM_QSTR(MP_QSTR_P41), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_SENSORS_SCL), MP_ROM_PTR(&pin_P0_11) }, + + { MP_ROM_QSTR(MP_QSTR_P42), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_SENSORS_SDA), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_P43), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_IMU_IRQ), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P0_14) }, + + { MP_ROM_QSTR(MP_QSTR_P44), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_WHITELED), MP_ROM_PTR(&pin_P1_14) }, + + { MP_ROM_QSTR(MP_QSTR_P45), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_P1_11) }, + + { MP_ROM_QSTR(MP_QSTR_P46), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO), MP_ROM_PTR(&pin_P1_15) }, + + { 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_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 58e7f280578ed076d23166f7ab9b4b4f7b1fb6ee Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sat, 16 May 2020 20:42:17 +0000 Subject: [PATCH 518/919] Translated using Weblate (Swedish) Currently translated at 80.6% (602 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 1148 ++++++++++++++++++++++++++------------------------ 1 file changed, 597 insertions(+), 551 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 5708b66427..ef958db944 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-14 12:41+0000\n" +"PO-Revision-Date: 2020-05-17 15:24+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -32,6 +32,9 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Skapa ett ärende med innehållet i din CIRCUITPY på\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" @@ -50,7 +53,6 @@ msgid " File \"%q\", line %d" msgstr " Fil \"%q\", rad %d" #: main.c -#, fuzzy msgid " output:\n" msgstr " utdata:\n" @@ -62,7 +64,7 @@ msgstr "%%c kräver int eller char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d adresspinnar och %d RGB-pinnar indikerar en höjd av %d, inte %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -77,7 +79,6 @@ msgid "%q indices must be integers, not %s" msgstr "Indexet %q måste vara ett heltal, inte %s" #: shared-bindings/vectorio/Polygon.c -#, fuzzy msgid "%q list must be a list" msgstr "%q-listan måste vara en lista" @@ -165,12 +166,12 @@ msgstr "Objektet '%s' har inte stöd för '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "" +msgstr "Objektet \"%s\" stöder inte tilldelning av objekt" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "" +msgstr "'%s'-objekt stöder inte borttagning av objekt" #: py/runtime.c msgid "'%s' object has no attribute '%q'" @@ -189,114 +190,114 @@ msgstr "Objektet '%s' kan inte anropas" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "" +msgstr "Objektet '%s' är inte itererbar" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "" +msgstr "Objektet \"%s\" är inte indexbar" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "" +msgstr "'='-justering tillåts inte i strängformatspecificerare" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "" +msgstr "'S' och 'O' stöds inte som formattyper" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "'align' kräver 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' eller 'async with' utanför asynk-funktion" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'await' utanför funktion" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' utanför loop" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' utanför loop" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' kräver minst 2 argument" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' kräver heltalsargument" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' kräver 1 argument" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "'return' utanför funktion" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "'yield' utanför funktion" #: py/compile.c msgid "*x must be assignment target" -msgstr "" +msgstr "*x måste vara mål för tilldelning" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", i %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0,0 till ett komplext nummer" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "3-arguments pow() stöds inte" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "" +msgstr "En kanal för hårdvaruavbrotts används redan" #: shared-bindings/_bleio/Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "" +msgstr "Adressen måste vara %d byte lång" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Adresstyp utanför intervallet" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "" +msgstr "All I2C-kringutrustning används" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "" +msgstr "All SPI-kringutrustning används" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "" +msgstr "Alla UART-tillbehör används" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "" +msgstr "Alla händelsekanaler används" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" +msgstr "Alla händelsekanaler används" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "" +msgstr "Alla timers för denna pinne är i bruk" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -307,444 +308,453 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" -msgstr "" +msgstr "Alla timers används" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Annonserar redan." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn stöds inte på en given pinne" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "" +msgstr "AnalogOut-funktionalitet stöds inte" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "AnalogOut är bara 16 bitar. Värdet måste vara mindre än 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "" +msgstr "AnalogOut stöds inte på given pinne" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "" +msgstr "En annan sändning är redan aktiv" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "Matrisen måste innehålla halfwords (typ \"H\")" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Matrisvärden ska vara enstaka byte." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Högst %d %q kan anges (inte %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" +msgstr "Försökte tilldelning av heap när MicroPython VM inte körs." #: main.c msgid "Auto-reload is off.\n" -msgstr "" +msgstr "Autoladdning är avstängd.\n" #: main.c msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" +"Autoladdning är på. Spara bara filer via USB för att köra dem eller ange " +"REPL för att inaktivera.\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Under minsta bildfrekvens" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" +msgstr "Bitklocka och ordval måste dela en klockenhet" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bitdjupet måste vara multipel av 8." #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "Båda pinnarna måste stödja maskinvaruavbrott" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Ljusstyrkan måste vara 0-1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "" +msgstr "Ljusstyrkan måste vara mellan 0 och 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Ljusstyrkan kan inte justeras" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffert + offset för liten %d %d %d" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "Buffert har felaktig storlek. Ska vara %d byte." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffert är inte en bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Bufferten är för liten" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "Bufferten måste ha minst längd 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Bufferten är för stor och kan inte allokeras" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffert för kort med %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Busspinne %d används redan" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "" +msgstr "Byte-buffert måste vara 16 byte." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "Bytes måste vara mellan 0 och 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC-block måste vara multiplar om 16 byte" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Anropa super().__init__() innan du använder det nativa objektet." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Kan inte ställa in CCCD på lokal karaktäristik" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Kan radera värden" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "Kan inte ange pull i output-läge" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "" +msgstr "Kan inte hämta temperatur" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Det går inte att ha skanningssvar för utökade, anslutningsbara aviseringar." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "" +msgstr "Det går inte att mata ut båda kanalerna på samma pinne" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "" +msgstr "Kan inte läsa utan MISO-pinne." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Det går inte att spela in till en fil" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "" +msgstr "Kan inte återmontera '/' när USB är aktivt." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" +"Det går inte att återställa till bootloader eftersom det inte finns någon " +"bootloader." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Kan inte sätta värde när riktning är input." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Det går inte att specificera RTS eller CTS i RS485-läget" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Det går inte att subklassa slice" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "" +msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "Kan inte entydigt få sizeof scalar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Det går inte att ändra frekvensen på en timer som redan används" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "" +msgstr "Kan inte skriva utan MOSI-pinne." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "Skrivning för CharacteristicBuffer är inte tillhandahållen" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "CircuitPython kärnkod kraschade hårt. Hoppsan!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython är i säkert läge eftersom du tryckte på återställningsknappen " +"under start. Tryck igen för att lämna säkert läge.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "" +msgstr "Initiering av klockpinne misslyckades." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Klockförlängning för lång" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "" +msgstr "Klockenhet används" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Kolumnposten måste vara digitalio. DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "" +msgstr "Kommandot måste vara en int mellan 0 och 255" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Anslutningen har kopplats bort och kan inte längre användas. Skapa en ny " +"anslutning." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Skadad .mpy-fil" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Korrupt rå kod" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" -msgstr "" +msgstr "Det gick inte att initiera UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Det gick inte att initiera kanalen" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Det gick inte att initialisera timern" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Det gick inte att återinitiera kanalen" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Det gick inte att återinitiera timern" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Det gick inte att starta om PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Det gick inte att starta PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Det gick inte att starta avbrott, RX upptagen" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Det gick inte att allokera avkodaren" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "" +msgstr "Det gick inte att allokera den första bufferten" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Det gick inte att allokera indatabufferten" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "" +msgstr "Det gick inte att allokera den andra bufferten" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Krasch in i HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Initieringsfel för DAC-kanal" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Initieringsfel för DAC-enhet" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC används redan" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Datapinne 0 måste vara bytejusterad" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Datasegmentet måste följa fmt-segmentet" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "Data för stor för annonseringspaket" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Målkapaciteten är mindre än destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Enheten används redan" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut stöds inte på given pinne" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Displayen måste ha en 16-bitars färgrymd." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" -msgstr "" +msgstr "Displayens rotation måste vara i steg om 90 grader" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "Drivläge används inte när riktning är input." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB arbetar endast på 16 byte åt gången" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINT-kanalen används redan" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "Fel i regex" #: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" -msgstr "" +msgstr "Förväntade %q" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "" +msgstr "Förväntade en karaktäristik" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Förväntade en tjänst" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" -msgstr "" +msgstr "Förväntade en UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Förväntade en adress" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Förväntad tupel med längd %d, fick %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "Utökad annonsering i kombination med skanningssvar stöds inte." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT är enbart definierade för ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Det gick inte att skicka kommandot." #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "" +msgstr "Det gick inte att förvärva mutex, fel 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" -msgstr "" +msgstr "Det gick inte att tilldela RX-buffert" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -753,214 +763,216 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" -msgstr "" +msgstr "Det gick inte att allokera RX-bufferten på %d byte" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Det gick inte att ansluta: internt fel" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Det gick inte att ansluta: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Det gick inte att tolka MP3-filen" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "" +msgstr "Det gick inte att frigöra mutex, fel 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Det gick inte att skriva till intern flash." #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "" +msgstr "Infångningsfrekvens är för hög. Infångning pausad." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "" +msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "" +msgstr "Funktion kräver lås" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Grupp används redan" #: shared-module/displayio/Group.c msgid "Group full" -msgstr "" +msgstr "Gruppen är full" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hårdvaran är upptagen, prova alternativa pinnar" #: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hårdvaran används redan, prova alternativa pinnar" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "" +msgstr "I/O-operation på stängd fil" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C init-fel" #: extmod/machine_i2c.c msgid "I2C operation not supported" -msgstr "" +msgstr "I2C-åtgärd stöds inte" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV måste vara %d byte lång" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Inkompatibel .mpy-fil. Uppdatera alla .mpy-filer. Se http://adafru.it/mpy-" +"update för mer information." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Fel buffertstorlek" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Indata-/utdatafel" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Otillräcklig autentisering" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Otillräcklig kryptering" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Internt define-fel" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Internt fel #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "" +msgstr "Ogiltig %q-pinne" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Ogiltigt ADC-enhetsvärde" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" -msgstr "" +msgstr "Ogiltig BMP-fil" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Ogiltig DAC-pinne angiven" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Ogiltigt val av I2C-pinne" #: 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 msgid "Invalid PWM frequency" -msgstr "" +msgstr "Ogiltig PWM-frekvens" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Ogiltigt val av SPI-pinne" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Ogiltigt val av UART-pinne" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" -msgstr "" +msgstr "Ogiltigt argument" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Ogiltigt värde för bitar per värde" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" -msgstr "" +msgstr "Ogiltig buffertstorlek" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Ogiltig byteorder-sträng" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" -msgstr "" +msgstr "Ogiltigt kanalantal" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "" +msgstr "Ogiltig riktning." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" -msgstr "" +msgstr "Felaktig fil" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Ogiltig formatsegmentstorlek" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Ogiltig frekvens angiven" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Ogiltig minnesåtkomst." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" -msgstr "" +msgstr "Ogiltigt antal bitar" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid phase" -msgstr "" +msgstr "Ogiltig fas" #: 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 msgid "Invalid pin" -msgstr "" +msgstr "Ogiltig pinne" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for left channel" -msgstr "" +msgstr "Ogiltig pinne för vänster kanal" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for right channel" -msgstr "" +msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c @@ -969,242 +981,245 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" -msgstr "" +msgstr "Ogiltiga pinnar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Ogiltiga pinnar för PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "Ogiltig polaritet" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Ogiltiga egenskaper" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "Ogiltigt körläge." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "Ogiltigt säkerhetsläge" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Ogiltig kanal" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" -msgstr "" +msgstr "Ogiltigt kanalantal" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "" +msgstr "Ogiltig wave-fil" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Ogiltig word-/bitlängd" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång" #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "" +msgstr "LHS av keword arg måste vara ett id" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "Lagret finns redan i en grupp." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "Layer måste vara en subklass av Group eller TileGrid." #: py/objslice.c msgid "Length must be an int" -msgstr "" +msgstr "Length måste vara en int" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "Length måste vara positiv" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "" +msgstr "init för MISO-pinne misslyckades." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "" +msgstr "init för MOSI-pinne misslyckades." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "Maximum x-värde vid spegling är %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "MicroPython NLR jump misslyckades. Troligen korrupt minne." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "MicroPython fatalt fel." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "Startfördröjningen för mikrofonen måste vara i intervallet 0,0 till 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "MISO- eller MOSI-pinne saknas" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Måste vara en %q-subklass." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Måste ange MISO- eller MOSI-pinne" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Måste använda ett multipel av 6 rgb-pinnar, inte %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Name är för långt" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" -msgstr "" +msgstr "Negativt step stöds inte" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Ingen CCCD för denna karaktäristik" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" -msgstr "" +msgstr "Ingen DAC på chipet" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "No DMA channel found" -msgstr "" +msgstr "Ingen DMA-kanal hittades" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Ingen MISO-pinne" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Ingen MOSI-pinne" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "Ingen RX-pinne" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "Ingen TX-pinne" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Inga tillgängliga klockor" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Ingen anslutning: längden kan inte bestämmas" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "Ingen standard %q-buss" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" -msgstr "" +msgstr "Inga fria GCLK: er" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Ingen hårdvaru-random tillgänglig" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "Inget hårdvarustöd på clk-pinne" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" -msgstr "" +msgstr "Inget hårdvarustöd på pinne" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Ingen nyckel angavs" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Inget stöd för långt heltal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Inga fler timers tillgängliga på denna pinne." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Inget utrymme kvar på enheten" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Ingen sådan fil/katalog" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Ingen timer tillgänglig" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Nordic Soft Device failure assertion." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" -msgstr "" +msgstr "Inte ansluten" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Ingen uppspelning" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Objektet har deinitialiserats och kan inte längre användas. Skapa ett nytt " +"objekt." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" -msgstr "" +msgstr "Udda paritet stöds inte" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "" +msgstr "Endast 8 eller 16 bitars mono med " #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"Endast Windows-format, okomprimerad BMP stöds: given headerstorlek är %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1212,29 +1227,33 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Endast monokrom, indexerad 4 bpp eller 8 bpp och 16 bpp eller högre BMP: er " +"stöds: %d bpp angiven" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "Översampling måste vara multipel av 8." #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" +msgstr "PWM duty_cykel måste vara mellan 0 och 65535 (16 bitars upplösning)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"PWM-frekvensen är inte skrivbar när variable_frequency är falsk vid " +"skapandet." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus stöds ännu inte" #: py/moduerrno.c msgid "Permission denied" -msgstr "" +msgstr "Åtkomst nekad" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1242,15 +1261,15 @@ msgstr "" #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" -msgstr "" +msgstr "Pinnen har inte ADC-funktionalitet" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pinnen måste stödja hårdvaruavbrott" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "PInn-nummer redan reserverat av EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1259,183 +1278,191 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinout använder %d byte per element, vilket förbrukar mer än det idealiska %" +"d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till " +"konstruktorn" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" -msgstr "" +msgstr "Plus eventuella moduler i filsystemet\n" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop från en tom Ps2-buffert" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Prefixbufferten måste finnas på heap" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +"Tryck på valfri knapp för att gå in i REPL. Använd CTRL-D för att ladda om." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "Pull används inte när riktningen är output." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn stöds inte av detta chip" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseIn stöds inte av detta chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "RNG DeInit-fel" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "RNG Init-fel" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "RS485-inversion specificerad när den inte är i RS485-läge" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "" +msgstr "RTC-kalibrering stöds inte av detta kort" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "" +msgstr "RTC stöds inte av detta kort" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Fel vid generering av slumptal" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" -msgstr "" +msgstr "Skrivskyddad" #: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" -msgstr "" +msgstr "Skrivskyddat filsystem" #: shared-module/displayio/Bitmap.c msgid "Read-only object" -msgstr "" +msgstr "Skrivskyddat objekt" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Uppdaterad för tidigt" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Det begärda AES-läget stöds inte" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "" +msgstr "Höger kanal stöds inte" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Radvärdet måste vara digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" +msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" #: main.c msgid "Running in safe mode! Not running saved code.\n" -msgstr "" +msgstr "Kör i säkert läge! Sparad kod körs inte.\n" #: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" -msgstr "" +msgstr "SDA eller SCL behöver en pullup" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI Init-fel" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI reinitialiseringsfel" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "Samplingsfrekvensen måste vara positiv" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format msgid "Sample rate too high. It must be less than %d" -msgstr "" +msgstr "Samplingsfrekvensen är för hög. Den måste vara mindre än %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Skanning pågår redan. Avsluta med stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Vald CTS-pinne är inte giltig" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Vald CTS-pinne är inte giltig" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" -msgstr "" +msgstr "Serializern används redan" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Slice och värde har olika längd." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Slice stöds inte" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Käll- och målbuffertar måste ha samma längd" #: extmod/modure.c msgid "Splitting with sub-captures" -msgstr "" +msgstr "Splitting med sub-captures" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "" +msgstr "Stackstorleken måste vara minst 256" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Stream saknar readinto() eller write() metod." #: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Ange minst en UART-pinne" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Temperaturavläsning tog för lång tid" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"CircuitPythons heap blev korrupt eftersom stacken var för liten.\n" +"Öka stackstorleken om du vet hur, eller om inte:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"Modulen \"microkontroller\" användes för att starta i säkert läge. Tryck på " +"reset för att lämna säkert läge.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1443,205 +1470,211 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Mikrokontrollerns matningsspänning droppade. Se till att strömförsörjningen " +"ger\n" +"tillräckligt med ström för hela kretsen och tryck på reset (efter utmatning " +"av CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "Samplingens bits_per_sample matchar inte mixerns" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "Samplingens kanalantal matchar inte mixerns" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "Samplingens frekvens matchar inte mixerns" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "Samplingens signerad/osignerad stämmer inte med mixern" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Tile-höjden måste vara jämnt delbar med höjd på bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Tile-index utanför gräns" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Tile-värde utanför intervall" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "" +msgstr "För många kanaler i sampling." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "För många display-bussar" #: shared-module/displayio/__init__.c msgid "Too many displays" -msgstr "" +msgstr "För många displayer" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "Total data som ska skrivas är större än outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "Traceback (senaste anrop):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "" +msgstr "Tuple- eller struct_time-argument krävs" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UART-buffertallokeringsfel" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "UART deinit-fel" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UART Init-fel" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UART reinit-fel" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART skrivfel" #: shared-module/usb_hid/Device.c msgid "USB Busy" -msgstr "" +msgstr "USB upptagen" #: shared-module/usb_hid/Device.c msgid "USB Error" -msgstr "" +msgstr "USB-fel" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "UUID-heltal måste vara 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "UUID-sträng inte \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "UUID-värdet är inte str, int eller byte-buffert" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Unable to allocate buffers for signed conversion" -msgstr "" +msgstr "Det går inte att allokera buffert för signerad konvertering" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Det gick inte att hitta I2C-display på %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Unable to find free GCLK" -msgstr "" +msgstr "Det gick inte att hitta ledig GCLK" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "Kan inte initiera tolken" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Det går inte att läsa färgpalettdata" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "" +msgstr "Det gick inte att skriva till nvm." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "Oväntad nrfx uuid-typ" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Okänt gatt-fel: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Okänd anledning." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Okänt säkerhetsfel: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Okänt mjukvarufel: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "Omatchat antal på RHS (förväntat %d, fick %d)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Ospecificerat problem. Kan vara att parningen på den andra enheten avvisades " +"eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" -msgstr "" +msgstr "Baudrate stöd inte" #: shared-module/displayio/display_core.c msgid "Unsupported display bus type" -msgstr "" +msgstr "Busstyp för display stöds inte" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" -msgstr "" +msgstr "Formatet stöds inte" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "" +msgstr "Åtgärd som inte stöds" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "" +msgstr "Ogiltigt Pull-värde." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Värdets längde ! = krävd fast längd" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "Värdets längd > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "" +msgstr "Viper-funktioner stöder för närvarande inte mer än fyra argument" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Avläsning av spänning tog för lång tid" #: main.c msgid "WARNING: Your code filename has two extensions\n" -msgstr "" +msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" #: py/builtinhelp.c #, c-format @@ -1652,972 +1685,985 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +"Välkommen till Adafruit CircuitPython %s!\n" +"\n" +"Besök learning.adafruit.com/category/circuitpython för projektguider.\n" +"\n" +"För att lista inbyggda moduler, vänligen `help(\" modules \")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Skrivning stöds inte på karaktäristik" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Du är i säkert läge: något öväntat hände.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " -msgstr "" +msgstr "Du begärt att starta i felsäkert läge genom att " #: py/objtype.c msgid "__init__() should return None" -msgstr "" +msgstr "__init __ () ska returnera None" #: py/objtype.c #, c-format msgid "__init__() should return None, not '%s'" -msgstr "" +msgstr "__init __ () ska returnera None, inte '%s'" #: py/objobject.c msgid "__new__ arg must be a user-type" -msgstr "" +msgstr "__new__ arg måste vara en användartyp" #: extmod/modubinascii.c extmod/moduhashlib.c msgid "a bytes-like object is required" -msgstr "" +msgstr "ett bytesliknande objekt krävs" #: lib/embed/abort_.c msgid "abort() called" -msgstr "" +msgstr "abort() anropad" #: extmod/machine_mem.c #, c-format msgid "address %08x is not aligned to %d bytes" -msgstr "" +msgstr "adressen %08x är inte justerad till %d byte" #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" -msgstr "" +msgstr "adress utanför gränsen" #: shared-bindings/i2cslave/I2CSlave.c msgid "addresses is empty" -msgstr "" +msgstr "adresserna är tomma" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 är enbart implementerad för scalar och ndarray" #: py/modbuiltins.c msgid "arg is an empty sequence" -msgstr "" +msgstr "arg är en tom sekvens" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "argumentet argsort måste vara en ndarray" #: py/runtime.c msgid "argument has wrong type" -msgstr "" +msgstr "argumentet har fel typ" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "" +msgstr "argument antal/typ matchar inte" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "" +msgstr "argumentet skall vara en '%q', inte en '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "argumenten måste vara ndarray" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" -msgstr "" +msgstr "array/bytes krävs på höger sida" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "försök att få argmin/argmax för en tom sekvens" #: py/objstr.c msgid "attributes not supported yet" -msgstr "" +msgstr "attribut stöds inte än" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "axis ska vara -1, 0, None eller 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "axis ska vara -1, 0 eller 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "axis ska vara None, 0, eller 1" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "Ogiltigt kompileringsläge" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "Ogiltig konverteringsspecifikation" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "Ogiltig formatsträng" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "Ogiltig typkod" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "binär op %q är inte implementerad" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "bits måste vara 7, 8 eller 9" #: extmod/machine_spi.c msgid "bits must be 8" -msgstr "" +msgstr "bits måste vara 8" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sample måste vara 8 eller 16" #: py/emitinlinethumb.c msgid "branch not in range" -msgstr "" +msgstr "branch utanför räckvidd" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "buffer måste vara en byte-liknande objekt" #: shared-module/struct/__init__.c msgid "buffer size must match format" -msgstr "" +msgstr "buffertstorleken måste matcha formatet" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "buffertsegmenten måste vara lika långa" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "buffert för liten" #: extmod/machine_spi.c msgid "buffers must be the same length" -msgstr "" +msgstr "buffertar måste vara samma längd" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "buttons måste vara digitalio.DigitalInOut" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "byte-kod inte implementerad" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder är inte en sträng" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" -msgstr "" +msgstr "bytes> 8 bitar stöds inte" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "bytevärde utanför intervallet" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" -msgstr "" +msgstr "kalibrering är utanför intervallet" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "" +msgstr "kalibrering är skrivskyddad" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" -msgstr "" +msgstr "kalibreringsvärde utanför intervallet +/- 127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "kan bara ha upp till 4 parametrar för Thumbs assembly" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "kan bara ha upp till 4 parametrar att Xtensa assembly" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "kan bara spara bytekod" #: py/objtype.c msgid "can't add special method to already-subclassed class" -msgstr "" +msgstr "kan inte lägga till särskild metod för redan subklassad klass" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "kan inte tilldela uttryck" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "kan inte konvertera %s till komplex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "kan inte konvertera %s till float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "kan inte konvertera %s till int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "kan inte konvertera '%q' objekt implicit till %q" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "kan inte konvertera NaN till int" #: shared-bindings/i2cslave/I2CSlave.c msgid "can't convert address to int" -msgstr "" +msgstr "kan inte konvertera address till int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "kan inte konvertera inf till int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "kan inte konvertera till komplex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "kan inte konvertera till float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "kan inte konvertera till int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "kan inte implicit konvertera till str" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "kan inte deklarera icke-lokalt i yttre kod" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "kan inte ta bort uttryck" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "kan inte göra binära op mellan '%q' och '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "kan inte göra trunkerad division av komplext tal" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "kan inte ha flera **x" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "kan inte ha flera *x" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "kan inte implicit konvertera '%q' till 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "kan inte ladda från '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "kan inte ladda med '%q' index" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "kan inte 'pend throw' för nystartad generator" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" -msgstr "" +msgstr "kan inte skicka icke-None värde till nystartad generator" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "kan inte att ange attribut" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "kan inte lagra '%q'" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "kan inte spara till '%q'" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "kan inte lagra med '%q'-index" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"kan inte byta från automatisk fältnumrering till manuell fältspecifikation" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"kan inte byta från manuell fältspecifikation till automatisk fältnumrering" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "kan inte skapa instanser av '% q'" #: py/objtype.c msgid "cannot create instance" -msgstr "" +msgstr "kan inte skapa instans" #: py/runtime.c msgid "cannot import name %q" -msgstr "" +msgstr "kan inte importera namn %q" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "kan inte utföra relativ import" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "kan inte omforma matris (inkompatibel indata-/utdataform)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "casting" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "teckenbuffert för liten" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "chr() arg är inte i intervallet(0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "chr() arg är inte i intervallet(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "circle kan endast registreras i en förälder" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "färgbuffert måste vara 3 byte (RGB) eller 4 byte (RGB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "färgbuffert måste vara en buffert, tupel, en lista, eller int" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" +msgstr "färgbuffert måste vara en bytearray eller matris av typ 'b' eller 'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "" +msgstr "färg måste vara mellan 0x000000 och 0xffffff" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" -msgstr "" +msgstr "color ska vara en int" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "komplex division med noll" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "komplexa värden stöds inte" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "komprimeringsheader" #: py/parse.c msgid "constant must be an integer" -msgstr "" +msgstr "konstant måste vara ett heltal" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "konvertering till objekt" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "Argumenten convolve måste vara linjära matriser" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "Argumenten convolve måste vara ndarray:er" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "Argumenten convolve kan inte vara tomma" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "Kan inte sända indatamatris från form" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "kan inte invertera Vandermonde-matris" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof måste vara mindre än längden på datauppsättningen" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "decimaltal stöds inte" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "standard \"except\" måste ligga sist" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"destinationsbuffert måste vara en bytearray eller matris av typ 'B' för " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" msgstr "" +"destinationsbufferten måste vara en matris av typen 'H' för bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "" +msgstr "destination_length måste vara ett heltal >= 0" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "uppdateringssekvensen för dict har fel längd" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "argumentet diff måste vara en ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" -msgstr "" +msgstr "division med noll" #: py/objdeque.c msgid "empty" -msgstr "" +msgstr "tom" #: shared-bindings/vectorio/Polygon.c msgid "empty %q list" -msgstr "" +msgstr "tom %q-lista" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "" +msgstr "tom heap" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "tom separator" #: shared-bindings/random/__init__.c msgid "empty sequence" -msgstr "" +msgstr "tom sekvens" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "slut på format vid sökning efter konverteringsspecificerare" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "" +msgstr "color ska vara en int" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "fel = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "exceptions måste ärvas från BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "förväntade ':' efter formatspecifikation" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "förväntade tupel/lista" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "förväntar en dict för keyword args" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "förväntar en assemblerinstruktion" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "förväntar bara ett värde för set" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "förväntar nyckel:värde för dict" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "" +msgstr "extra keyword-argument angivna" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "" +msgstr "extra positions-argument angivna" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-stränguttrycksdelen kan inte innehålla en '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-string-uttrycksdelen kan inte innehålla ett omvänt snedstreck" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-sträng: tomt uttryck inte tillåten" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: förväntat '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: singel '}' är inte tillåten" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "filen måste vara en fil som öppnats i byte-läge" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "" +msgstr "filsystemet måste tillhandahålla mount-metod" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "första argumentet måste vara en iterable" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "första argumentet måste vara en ndarray" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "första argumentet till super() måste vara typ" #: extmod/machine_spi.c msgid "firstbit must be MSB" -msgstr "" +msgstr "firstbit måste vara MSB" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "Argumentet flip måste vara en ndarray" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "flyttalet för stort" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "typsnitt måste vara 2048 bytes långt" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "formatet kräver en dict" #: py/objdeque.c msgid "full" -msgstr "" +msgstr "full" #: py/argcheck.c msgid "function does not take keyword arguments" -msgstr "" +msgstr "funktionen tar inte nyckelordsargument" #: py/argcheck.c #, c-format msgid "function expected at most %d arguments, got %d" -msgstr "" +msgstr "funktionen förväntar som mest %d argument, fick %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "funktionen fick flera värden för argumentet '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "funktionen är endast implementerad för scalar och ndarray" #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" -msgstr "" +msgstr "funktion saknar %d obligatoriska positionsargument" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "funktionen saknar nyckelordsargument" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "funktionen saknar det obligatoriska nyckelordsargumentet '%q'" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "funktionen saknar det obligatoriska positionsargumentet #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format msgid "function takes %d positional arguments but %d were given" -msgstr "" +msgstr "funktionen kräver %d positionsargument men %d angavs" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "" +msgstr "funktionen kräver exakt 9 argument" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "generatorn kör redan" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "generatorn ignorerade GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "graphic måste vara 2048 byte lång" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "" +msgstr "heap måste vara en lista" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "identifieraren omdefinierad till global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "identifieraren omdefinierad som icke-lokal" #: py/objstr.c msgid "incomplete format" -msgstr "" +msgstr "ofullständigt format" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "ofullständig formatnyckel" #: extmod/modubinascii.c msgid "incorrect padding" -msgstr "" +msgstr "felaktig utfyllnad" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "index är utanför gränserna" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" -msgstr "" +msgstr "index utanför intervallet" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "index måste vara heltal" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "index måste vara heltal, slices, eller Boolean-listor" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "inline assembler måste vara en funktion" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "indataarraylängden måste vara en multipel av 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "indata måste vara en iterable" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "indatamatrisen är asymmetrisk" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "indatamatrisen är singulär" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "indata måste vara kvadratmatris" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "indata måste vara tupel, lista, range, eller ndarray" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "indatavektorer måste ha samma längd" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() arg 2 måste vara >= 2 och <= 36" #: py/objstr.c msgid "integer required" -msgstr "" +msgstr "heltal krävs" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "interval måste vara i intervallet %s-%s" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" -msgstr "" +msgstr "ogiltig I2C-kringutrustning" #: extmod/machine_spi.c msgid "invalid SPI peripheral" -msgstr "" +msgstr "ogiltig SPI-kringutrustning" #: lib/netutils/netutils.c msgid "invalid arguments" -msgstr "" +msgstr "ogiltiga argument" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "" +msgstr "ogiltigt certifikat" #: extmod/uos_dupterm.c msgid "invalid dupterm index" -msgstr "" +msgstr "ogiltigt dupterm index" #: extmod/modframebuf.c msgid "invalid format" -msgstr "" +msgstr "ogiltigt format" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "ogiltig formatspecificerare" #: extmod/modussl_axtls.c msgid "invalid key" -msgstr "" +msgstr "ogiltig nyckel" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "ogiltig mikropython-dekorator" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "ogiltigt steg" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "ogiltig syntax" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "ogiltig syntax för heltal" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "ogiltig syntax för heltal med bas %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "ogiltig syntax för tal" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() arg 1 måste vara en klass" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() arg 2 måste vara en klass eller en tupel av klasser" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "iterables är inte av samma längd" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "iterations konvergerar inte" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join förväntar sig en lista över str/bytes-objekt som överensstämmer med " +"objektet self" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"nyckelordsargument är ännu inte implementerade - använd vanliga argument" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "nyckelord måste vara strängar" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "etiketten '%q' har inte definierats" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "etiketten omdefinierad" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "argumentet length är inte är tillåten för denna typ" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "level ska ligga mellan 0 och 1" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "lhs och rhs måste vara kompatibla" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "lokala '%q' har typ '%q' men källan är '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "lokal '%q' används innan typen är känd" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "lokal variabel refererad före tilldelning" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "long int stöds inte i denna build" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "f-sträng har felaktigt format" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "map-buffert för liten" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "matematikdomänfel" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "matrisdimensioner matchar inte" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "matrisen är inte positiv bestämd" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length måste vara 0-%d när fixed_length är %s" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "maximal rekursionsdjup överskriden" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "minnesallokering misslyckades, allokerar %u byte" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "" +msgstr "minnesallokeringen misslyckades, heapen är låst" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "modulen hittades inte" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "fler frihetsgrader än datapunkter" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "flera *x i tilldelning" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "Multipla basklasser har instanslayoutkonflikt" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "multipelt arv stöds inte" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "måste ge ett objekt" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" -msgstr "" +msgstr "måste ange alla av sck/mosi/miso" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "måste använda nyckelordsargument för nyckelfunktion" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n måste vara mellan 0 och 9" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "namnet '%q' är inte definierat" #: py/runtime.c msgid "name not defined" -msgstr "" +msgstr "namn inte definierat" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "namn återanvänt för argument" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "native yield" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "behöver mer än %d värden för att packa upp" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" From 1d3447b5a36aff1f3ab8ebd081ea7fa155ca8f1a Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:27:46 +0000 Subject: [PATCH 519/919] Translated using Weblate (French) Currently translated at 63.9% (477 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index b87e0cd216..9dee0e20a2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-05 20:24+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-05-17 15:28+0000\n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -45,7 +45,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Pour repartir, veuillez réinitialiser sans " +"Pour quitter, veuillez réinitialiser la carte sans" #: py/obj.c msgid " File \"%q\"" From aa57a2c800395fec319236b364b5150a5f5c2232 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:28:10 +0000 Subject: [PATCH 520/919] Translated using Weblate (French) Currently translated at 64.0% (478 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9dee0e20a2..1710c0cf3e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:28+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -45,7 +45,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Pour quitter, veuillez réinitialiser la carte sans" +"Pour quitter, veuillez réinitialiser la carte sans " #: py/obj.c msgid " File \"%q\"" From 9e590c14e3e3105c4536e3b53b6a9b47f7b8a152 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:28:34 +0000 Subject: [PATCH 521/919] Translated using Weblate (French) Currently translated at 64.0% (478 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 1710c0cf3e..0206e7917c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:28+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -68,6 +68,8 @@ msgstr "%%c nécessite un entier 'int' ou un caractère 'char'" #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +"Les broches d'adresse% d et les broches RVB% d indiquent une hauteur de% d, " +"pas% d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From 530469ff69d329dcb8c1e3f1775835e93bfe4754 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:28:52 +0000 Subject: [PATCH 522/919] Translated using Weblate (French) Currently translated at 64.2% (479 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 0206e7917c..27909e1e6f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:28+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:29+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -68,8 +68,8 @@ msgstr "%%c nécessite un entier 'int' ou un caractère 'char'" #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" -"Les broches d'adresse% d et les broches RVB% d indiquent une hauteur de% d, " -"pas% d" +"Les broches d'adresse %d et les broches RVB %d indiquent une hauteur de %d, " +"pas %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From aea15ad1694cca7e9accba0964e63bbe64dd5006 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:29:04 +0000 Subject: [PATCH 523/919] Translated using Weblate (French) Currently translated at 64.2% (479 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 27909e1e6f..9af41fb7b0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:29+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -85,7 +85,7 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "La liste% q doit être une liste" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c From eed21c4886671f3d0184f6f1df0822634fd34b44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:29:33 +0000 Subject: [PATCH 524/919] Translated using Weblate (French) Currently translated at 64.3% (480 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9af41fb7b0..2bdb2ace04 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:29+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -85,7 +85,7 @@ msgstr "les indices %q doivent être des entiers, pas %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "La liste% q doit être une liste" +msgstr "La liste %q doit être une liste" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c From e8adbdbddc5d440034859683e527f5b72f8875e9 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:29:42 +0000 Subject: [PATCH 525/919] Translated using Weblate (French) Currently translated at 64.3% (480 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2bdb2ace04..7508170ca4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:29+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -96,7 +96,7 @@ msgstr "%q doit être >=1" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "% q doit être un tuple de longueur 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" From e054e7ec9af69a07f6e10047162a45ea7cce84bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:29:48 +0000 Subject: [PATCH 526/919] Translated using Weblate (French) Currently translated at 64.7% (483 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 7508170ca4..d052920d24 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:29+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:33+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -96,7 +96,7 @@ msgstr "%q doit être >=1" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "% q doit être un tuple de longueur 2" +msgstr "%q doit être un tuple de longueur 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -162,11 +162,11 @@ msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "L'objet '%s' ne peut pas assigner l'attribut '%q'" +msgstr "L'objet '%s' ne peut pas attribuer '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "L'objet '%s' ne prends pas en charge '%q'" +msgstr "L'objet '%s' ne prend pas en charge '%q'" #: py/obj.c #, c-format @@ -216,7 +216,7 @@ msgstr "'align' nécessite 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "'async for' ou 'async with' sans fonction async" +msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure" #: py/compile.c msgid "'await' outside function" From 50dab65dd998f1f416432c5bcdc7403272787d8d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:31:13 +0000 Subject: [PATCH 527/919] Translated using Weblate (French) Currently translated at 64.7% (483 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index d052920d24..34ee14671c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:33+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -278,7 +278,7 @@ msgstr "L'adresse doit être longue de %d octets" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Type d'adresse hors plage" #: ports/nrf/common-hal/busio/I2C.c #, fuzzy @@ -324,7 +324,7 @@ msgstr "" #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -356,7 +356,7 @@ msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Au plus% d% q peut être spécifié (pas% d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." From f67e35a88b1622b4d22284a975e3faf78ade075c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:33:29 +0000 Subject: [PATCH 528/919] Translated using Weblate (French) Currently translated at 65.1% (486 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 34ee14671c..9925e29606 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:33+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:34+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -356,7 +356,7 @@ msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "Au plus% d% q peut être spécifié (pas% d)" +msgstr "Au plus %d %q peut être spécifié (pas %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." From fa418945b7a10118d5947cb8065855aebfe93923 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:33:41 +0000 Subject: [PATCH 529/919] Translated using Weblate (French) Currently translated at 65.1% (486 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9925e29606..b534157c45 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:34+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -361,6 +361,8 @@ msgstr "Au plus %d %q peut être spécifié (pas %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"Tentative d'allocation de segments lorsque la machine virtuelle MicroPython " +"n'est pas en cours d'exécution." #: main.c msgid "Auto-reload is off.\n" @@ -377,7 +379,7 @@ msgstr "" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Inférieur à la fréquence d'images minimale" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -395,7 +397,7 @@ msgstr "Les deux entrées doivent supporter les interruptions matérielles" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "La luminosité doit être de 0 à 1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" From 94868852a16b825679456d414b1f0678a312470b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:34:01 +0000 Subject: [PATCH 530/919] Translated using Weblate (French) Currently translated at 65.2% (487 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index b534157c45..2a8998b36d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:34+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -397,7 +397,7 @@ msgstr "Les deux entrées doivent supporter les interruptions matérielles" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "La luminosité doit être de 0 à 1,0" +msgstr "La luminosité doit être de 0 à 1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" From a0b1d98c7986ad773aca28fc7c7ec71da96ab56c Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:34:10 +0000 Subject: [PATCH 531/919] Translated using Weblate (French) Currently translated at 65.2% (487 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2a8998b36d..e0bd19d835 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:34+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -411,7 +411,7 @@ msgstr "Luminosité non-ajustable" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Tampon + décalage trop petit% d% d% d" #: shared-module/usb_hid/Device.c #, c-format From d05c0ec590531ef5f63f6bfa4a45280919bfc152 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:34:27 +0000 Subject: [PATCH 532/919] Translated using Weblate (French) Currently translated at 65.6% (490 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e0bd19d835..2821c1b1bf 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:34+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:35+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -411,7 +411,7 @@ msgstr "Luminosité non-ajustable" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "Tampon + décalage trop petit% d% d% d" +msgstr "Tampon + décalage trop petit %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -421,7 +421,7 @@ msgstr "Tampon de taille incorrect. Devrait être de %d octets." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Le tampon n'est pas un 'bytearray'." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c From 69d1a91edeeed8c176a9bf9b70a9ccbec0eaf47b Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:35:04 +0000 Subject: [PATCH 533/919] Translated using Weblate (French) Currently translated at 65.6% (490 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2821c1b1bf..11d46c821b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:35+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -426,12 +426,12 @@ msgstr "Le tampon n'est pas un 'bytearray'." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Le tampon est trop petit" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "La longueur du tampon% d est trop grande. Il doit être inférieur à% d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" From ec1e51c683263f5dcc7185a41286e60002bb1afa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:35:18 +0000 Subject: [PATCH 534/919] Translated using Weblate (French) Currently translated at 65.9% (492 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 11d46c821b..2ed236224c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:35+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -431,7 +431,7 @@ msgstr "Le tampon est trop petit" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "La longueur du tampon% d est trop grande. Il doit être inférieur à% d" +msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" From 292d61b0d79495226bd2576afd05ec3485c845a2 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:35:25 +0000 Subject: [PATCH 535/919] Translated using Weblate (French) Currently translated at 65.9% (492 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2ed236224c..54c3094eca 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:35+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -439,12 +439,12 @@ msgstr "Le tampon doit être de longueur au moins 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Tampon trop volumineux et impossible à allouer" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Tampon trop court de% d octets" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c From fb1892409964a04b7789b0db46b95cfe30a9f7aa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:35:36 +0000 Subject: [PATCH 536/919] Translated using Weblate (French) Currently translated at 66.3% (495 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 54c3094eca..75b3fe25cd 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:35+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:36+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -444,7 +444,7 @@ msgstr "Tampon trop volumineux et impossible à allouer" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Tampon trop court de% d octets" +msgstr "Tampon trop court de %d octets" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c From 2edb2c86f2b182df64df6491f0d227e0bde4829a Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:35:45 +0000 Subject: [PATCH 537/919] Translated using Weblate (French) Currently translated at 66.3% (495 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 75b3fe25cd..92abe51fde 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:36+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -463,15 +463,15 @@ msgstr "Les octets 'bytes' doivent être entre 0 et 255" #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Les blocs CBC doivent être des multiples de 16 octets" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Impossible de définir CCCD sur la caractéristique locale" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" From 8a58d1a42e1370cc6820a2afb5183b27db86df66 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:36:11 +0000 Subject: [PATCH 538/919] Translated using Weblate (French) Currently translated at 71.3% (532 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 92abe51fde..f63cbaa761 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:36+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:40+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -471,7 +471,7 @@ msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "Impossible de définir CCCD sur la caractéristique locale" +msgstr "Impossible de définir CCCD sur une caractéristique locale" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" From 1a7fbd83fa98355e3c26312a7e7b0a7f9420c159 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:36:31 +0000 Subject: [PATCH 539/919] Translated using Weblate (French) Currently translated at 71.3% (532 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 76 ++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index f63cbaa761..332d022a43 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:40+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -521,7 +521,7 @@ msgstr "Impossible d'affecter une valeur quand la direction est 'input'." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Impossible de spécifier RTS ou CTS en mode RS485" #: py/objslice.c msgid "Cannot subclass slice" @@ -537,7 +537,7 @@ msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Impossible de faire varier la fréquence sur une minuterie déjà utilisée" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -549,13 +549,16 @@ msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython est en mode sans échec car vous avez appuyé sur le bouton de " +"réinitialisation pendant le démarrage. Appuyez à nouveau pour quitter le " +"mode sans échec.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -584,14 +587,16 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"La connexion a été déconnectée et ne peut plus être utilisée. Créez une " +"nouvelle connexion." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Fichier .mpy corrompu" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Code brut corrompu" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -599,35 +604,35 @@ msgstr "L'UART n'a pu être initialisé" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Impossible d'initialiser la chaîne" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Impossible d'initialiser la minuterie" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Impossible de réinitialiser la chaîne" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Impossible de réinitialiser le minuteur" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Impossible de redémarrer PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Impossible de démarrer PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Impossible de démarrer l'interruption, RX occupé" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Impossible d'allouer le décodeur" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -636,7 +641,7 @@ msgstr "Impossible d'allouer le 1er tampon" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Impossible d'allouer le tampon d'entrée" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -645,15 +650,15 @@ msgstr "Impossible d'allouer le 2e tampon" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Crash dans le HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Erreur d'initialisation du canal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Erreur d'initialisation du périphérique DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -679,16 +684,16 @@ msgstr "La capacité de destination est plus petite que 'destination_length'." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Appareil utilisé" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut non pris en charge sur la broche donnée" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "L'affichage doit avoir un espace colorimétrique de 16 bits." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -702,7 +707,7 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "La BCE ne fonctionne que sur 16 octets à la fois" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -729,7 +734,7 @@ msgstr "Une 'Characteristic' est attendue" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Attendu un service" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -739,7 +744,7 @@ msgstr "Un UUID est attendu" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Attendu une adresse" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -752,11 +757,11 @@ msgstr "" #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "La FFT est définie pour les ndarrays uniquement" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Échec de l'envoi de la commande." #: ports/nrf/sd_mutex.c #, fuzzy, c-format @@ -778,15 +783,15 @@ msgstr "Echec de l'allocation de %d octets du tampon RX" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Impossible de se connecter: erreur interne" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Impossible de se connecter: délai d'expiration" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Impossible d'analyser le fichier MP3" #: ports/nrf/sd_mutex.c #, fuzzy, c-format @@ -795,7 +800,7 @@ msgstr "Impossible de libérer mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Échec de l'écriture du flash interne." #: py/moduerrno.c msgid "File exists" @@ -808,6 +813,7 @@ msgstr "La fréquence capturée est au delà des capacités. Capture en pause." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"La fréquence doit correspondre à PWMOut existant à l'aide de cette minuterie" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -818,7 +824,7 @@ msgstr "La fonction nécessite un verrou" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Groupe déjà utilisé" #: shared-module/displayio/Group.c msgid "Group full" @@ -827,11 +833,11 @@ msgstr "Groupe plein" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Matériel occupé, essayez d'autres broches" #: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Matériel utilisé, essayez d'autres broches" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -839,7 +845,7 @@ msgstr "opération d'E/S sur un fichier fermé" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Erreur d'initialisation I2C" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -848,7 +854,7 @@ msgstr "opération sur I2C non supportée" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV doit être long de% d octets" #: py/persistentcode.c msgid "" From 5c950fc2bc2fa3840b9669fe76c9e4f72bff69b3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:40:52 +0000 Subject: [PATCH 540/919] Translated using Weblate (French) Currently translated at 71.8% (536 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 332d022a43..1cfd8ef913 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:40+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:41+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -854,7 +854,7 @@ msgstr "opération sur I2C non supportée" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "IV doit être long de% d octets" +msgstr "IV doit être long de %d octets" #: py/persistentcode.c msgid "" From 1689cc6ec0f9262f4de7047018c0d1951c46d5e7 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:40:59 +0000 Subject: [PATCH 541/919] Translated using Weblate (French) Currently translated at 71.8% (536 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1cfd8ef913..f71c926898 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:41+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -874,20 +874,20 @@ msgstr "Erreur d'entrée/sortie" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Authentification insuffisante" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Chiffrement insuffisant" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Erreur de définition interne" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Erreur interne #% d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From ad06264e66e48fa4f5bb6a297bb90b1d8e2e3ad5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:41:19 +0000 Subject: [PATCH 542/919] Translated using Weblate (French) Currently translated at 73.1% (546 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index f71c926898..dc6ad0baa6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:41+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:42+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -887,7 +887,7 @@ msgstr "Erreur de définition interne" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "Erreur interne #% d" +msgstr "Erreur interne #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From 9ef61896d8842319fd2e3d9aaa2933534ab8b3a9 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:41:27 +0000 Subject: [PATCH 543/919] Translated using Weblate (French) Currently translated at 73.1% (546 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index dc6ad0baa6..1a6cadd7de 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:42+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -896,7 +896,7 @@ msgstr "Broche invalide pour '%q'" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Valeur d'unité ADC non valide" #: shared-module/displayio/OnDiskBitmap.c #, fuzzy @@ -905,11 +905,11 @@ msgstr "Fichier BMP invalide" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Broche DAC non valide fournie" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Sélection de broches I2C non valide" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -919,11 +919,11 @@ msgstr "Fréquence de PWM invalide" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Sélection de broches SPI non valide" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Sélection de broches UART non valide" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -940,7 +940,7 @@ msgstr "Longueur de tampon invalide" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Chaîne d'octets non valide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -965,11 +965,11 @@ msgstr "Taille de bloc de formatage invalide" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Fréquence invalide fournie" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Accès mémoire invalide." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1005,7 +1005,7 @@ msgstr "Broches invalides" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Broches non valides pour PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1014,7 +1014,7 @@ msgstr "Polarité invalide" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Propriétés non valides" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." From 0480776e8516bade7f5d2f8654a663996d01b276 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:42:50 +0000 Subject: [PATCH 544/919] Translated using Weblate (French) Currently translated at 73.3% (547 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1a6cadd7de..90c6d5cb13 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:42+0000\n" +"PO-Revision-Date: 2020-05-17 15:43+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" @@ -1022,7 +1022,7 @@ msgstr "Mode de lancement invalide." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "Mode_sécurité non valide" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" From f6d057fe10e66d745557e80ec11d789c05c2ecfc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:43:03 +0000 Subject: [PATCH 545/919] Translated using Weblate (French) Currently translated at 74.3% (555 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 90c6d5cb13..d07ae6f36f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:43+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:44+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1022,7 +1022,7 @@ msgstr "Mode de lancement invalide." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "Mode_sécurité non valide" +msgstr "'mode_security' non valide" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" From 63e25360233daf505ca159b84339c11fd636cf93 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:43:09 +0000 Subject: [PATCH 546/919] Translated using Weblate (French) Currently translated at 74.3% (555 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index d07ae6f36f..0ed18ddf2b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:44+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1026,7 +1026,7 @@ msgstr "'mode_security' non valide" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Voix invalide" #: shared-bindings/audiomixer/Mixer.c #, fuzzy @@ -1039,11 +1039,11 @@ msgstr "Fichier WAVE invalide" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Longueur de mot / bit non valide" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "La clé doit comporter 16, 24 ou 32 octets" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1051,7 +1051,7 @@ msgstr "La partie gauche de l'argument nommé doit être un identifiant" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "Couche déjà dans un groupe." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." @@ -1080,11 +1080,11 @@ msgstr "La valeur max. de x est %d lors d'une opération miroir" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "Le saut MicroPython NLR a échoué. Altération probable de la mémoire." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Erreur fatale MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1092,11 +1092,11 @@ msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Broche MISO ou MOSI manquante" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Doit être une sous-classe% q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" From ce8896844cf4ee58ef0d57323c7d5fb6e2b59bce Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:44:04 +0000 Subject: [PATCH 547/919] Translated using Weblate (French) Currently translated at 74.6% (557 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 0ed18ddf2b..7cb0e1ef4c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:44+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1096,7 +1096,7 @@ msgstr "Broche MISO ou MOSI manquante" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "Doit être une sous-classe% q." +msgstr "Doit être une sous-classe de %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" From b2f4c8cb9865573c5298f8d33ff531ab13a3de03 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:44:08 +0000 Subject: [PATCH 548/919] Translated using Weblate (French) Currently translated at 74.6% (557 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 7cb0e1ef4c..57f07fc347 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:44+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1100,12 +1100,12 @@ msgstr "Doit être une sous-classe de %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Doit fournir une broche MISO ou MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Doit utiliser un multiple de 6 broches RVB, pas% d" #: py/parse.c msgid "Name too long" From c51ef206429725bebb272e7009fd93513e344e2b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:44:21 +0000 Subject: [PATCH 549/919] Translated using Weblate (French) Currently translated at 76.5% (571 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 57f07fc347..fdb8419ef2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:44+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:45+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1105,7 +1105,7 @@ msgstr "Doit fournir une broche MISO ou MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "Doit utiliser un multiple de 6 broches RVB, pas% d" +msgstr "Doit utiliser un multiple de 6 broches RVB, pas %d" #: py/parse.c msgid "Name too long" From 0cd6e233ba2febcd3afa54f6874459e6665715b3 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:44:27 +0000 Subject: [PATCH 550/919] Translated using Weblate (French) Currently translated at 76.5% (571 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index fdb8419ef2..5d8f007d23 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:45+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1109,15 +1109,15 @@ msgstr "Doit utiliser un multiple de 6 broches RVB, pas %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nom trop long" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" -msgstr "" +msgstr "Étape négative non prise en charge" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Pas de CCCD pour cette caractéristique" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1131,11 +1131,11 @@ msgstr "Aucun canal DMA trouvé" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Pas de broche MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Pas de broche MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1155,7 +1155,7 @@ msgstr "Pas d'horloge disponible" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Pas de connexion: la longueur ne peut pas être déterminée" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1171,7 +1171,7 @@ msgstr "Pas de source matérielle d'aléa disponible" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "Pas de support matériel sur la broche clk" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -1180,19 +1180,19 @@ msgstr "Pas de support matériel pour cette broche" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Aucune clé n'a été spécifiée" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Pas de support entier long" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Plus de minuteurs disponibles sur cette broche." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Pas de pulldown sur la broche; 1Mohm recommandé" #: py/moduerrno.c msgid "No space left on device" @@ -1204,11 +1204,11 @@ msgstr "Fichier/dossier introuvable" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Pas de minuterie disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Affirmation de défaillance du Nordic Soft Device." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1251,6 +1251,8 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " +"ou plus:% d bpp fournis" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." From 7adc63125eb510c09a0250c6bc166deb4ff705fc Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:45:48 +0000 Subject: [PATCH 551/919] Translated using Weblate (French) Currently translated at 77.0% (575 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 5d8f007d23..06f4857830 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:45+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:46+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1252,7 +1252,7 @@ msgid "" "%d bpp given" msgstr "" "Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " -"ou plus:% d bpp fournis" +"ou plus: %d bpp fournis" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." From 5ebc1d4746217404c38045b747da26f182ffe347 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:45:54 +0000 Subject: [PATCH 552/919] Translated using Weblate (French) Currently translated at 77.0% (575 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 06f4857830..63aea61881 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:46+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1276,7 +1276,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus pas encore pris en charge" #: py/moduerrno.c msgid "Permission denied" @@ -1292,11 +1292,11 @@ msgstr "La broche ne peut être utilisée pour l'ADC" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "La broche doit prendre en charge les interruptions matérielles" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Numéro de broche déjà réservé par EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1305,6 +1305,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Le brochage utilise% d octets par élément, ce qui consomme plus que le% d " +"octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient =" +" True au constructeur" #: py/builtinhelp.c #, fuzzy From bb962554ad9e134fc940fdcb8ba92143f70991db Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:46:27 +0000 Subject: [PATCH 553/919] Translated using Weblate (French) Currently translated at 81.3% (607 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 63aea61881..23db9fb483 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:46+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:49+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1305,7 +1305,7 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -"Le brochage utilise% d octets par élément, ce qui consomme plus que le% d " +"Le brochage utilise %d octets par élément, ce qui consomme plus que le %d " "octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient =" " True au constructeur" From ce1767ef0840f8e0e986a02c0c9a1b5062fe84ee Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:46:35 +0000 Subject: [PATCH 554/919] Translated using Weblate (French) Currently translated at 81.3% (607 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 67 +++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 23db9fb483..7ad6313949 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:49+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1316,11 +1316,11 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop à partir d'un tampon Ps2 vide" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Le tampon de préfixe doit être sur le tas" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." @@ -1332,23 +1332,23 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn non pris en charge sur cette puce" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut non pris en charge sur cette puce" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Erreur RNG DeInit" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Erreur d'initialisation RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "Inversion RS485 spécifiée lorsqu'elle n'est pas en mode RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1362,11 +1362,11 @@ msgstr "RTC non supportée sur cette carte" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS / CTS / RS485 Pas encore pris en charge sur cet appareil" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Erreur de génération de nombres aléatoires" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1383,11 +1383,11 @@ msgstr "Objet en lecture seule" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Rafraîchissez trop tôt" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Le mode AES demandé n'est pas pris en charge" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1411,11 +1411,11 @@ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Erreur d'initialisation SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Erreur de réinitialisation SPI" #: shared-bindings/audiomixer/Mixer.c #, fuzzy @@ -1429,15 +1429,15 @@ msgstr "Taux d'échantillonage trop élevé. Doit être inf. à %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Scan déjà en cours. Arrêtez avec stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Broche CTS sélectionnée non valide" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Broche RTS sélectionnée non valide" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1455,7 +1455,7 @@ msgstr "Tranches non supportées" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Les tampons source et de destination doivent être de la même longueur" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1471,23 +1471,27 @@ msgstr "Il manque une méthode readinto() ou write() au flux." #: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Fournissez au moins une broche UART" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Temporisation de lecture dépassée" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"Le tas CircuitPython a été corrompu car la pile était trop petite.\n" +"Veuillez augmenter la taille de la pile si vous savez comment, ou sinon:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"Le module `microcontrôleur` a été utilisé pour démarrer en mode sans échec. " +"Appuyez sur reset pour quitter le mode sans échec.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1495,6 +1499,10 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"La puissance du microcontrôleur a baissé. Assurez-vous que votre " +"alimentation\n" +"assez de puissance pour tout le circuit et appuyez sur reset (après avoir " +"éjecté CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1519,11 +1527,11 @@ msgstr "La hauteur de la tuile doit diviser exactement la hauteur de l'image" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Index des tuiles hors limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Valeur de tuile hors limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1544,6 +1552,7 @@ msgstr "Trop d'affichages" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +"Le nombre total de données à écrire est supérieur à outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1555,23 +1564,23 @@ msgstr "Argument de type tuple ou struct_time nécessaire" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "Erreur d'allocation de tampon UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Erreur de désactivation UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Erreur d'initialisation UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Erreur de réinitialisation UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Erreur d'écriture UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1583,7 +1592,7 @@ msgstr "Erreur USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "La valeur entière UUID doit être 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1604,7 +1613,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Impossible de trouver l'affichage I2C à% x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From d5097891f13057a20a582a20c0d4eb01056aac91 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:49:36 +0000 Subject: [PATCH 555/919] Translated using Weblate (French) Currently translated at 81.5% (608 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 7ad6313949..e3ca027ecf 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:49+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1613,7 +1613,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "Impossible de trouver l'affichage I2C à% x" +msgstr "Impossible de trouver l'affichage I2C à %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From 4341b4a356a0318f37ff594dbe4c92c771ecc349 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:49:41 +0000 Subject: [PATCH 556/919] Translated using Weblate (French) Currently translated at 81.5% (608 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e3ca027ecf..c1a6606ab3 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:49+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1640,7 +1640,7 @@ msgstr "Type inattendu pour l'uuid nrfx" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Erreur gatt inconnue: 0x% 04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." From 2263b3c536ba470343ea1016508b0195f08295eb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:49:48 +0000 Subject: [PATCH 557/919] Translated using Weblate (French) Currently translated at 81.7% (610 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c1a6606ab3..07f9e55e11 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:49+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:50+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1640,7 +1640,7 @@ msgstr "Type inattendu pour l'uuid nrfx" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "Erreur gatt inconnue: 0x% 04x" +msgstr "Erreur gatt inconnue: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." From eee39afdbe6d6b627bc3505c89923b05df3307c8 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:49:53 +0000 Subject: [PATCH 558/919] Translated using Weblate (French) Currently translated at 81.7% (610 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 07f9e55e11..c64c57f718 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:50+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1644,12 +1644,12 @@ msgstr "Erreur gatt inconnue: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Raison inconnue." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Erreur de sécurité inconnue: 0x% 04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format From fbdd45cbb7c0825ee5480fdf263290cecc1f84a9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:50:03 +0000 Subject: [PATCH 559/919] Translated using Weblate (French) Currently translated at 81.9% (611 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c64c57f718..d727be5eb2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:50+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1649,7 +1649,7 @@ msgstr "Raison inconnue." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "Erreur de sécurité inconnue: 0x% 04x" +msgstr "Erreur de sécurité inconnue: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format From 1238850bc6978f027c55bea532e8ae87561c97c5 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:50:27 +0000 Subject: [PATCH 560/919] Translated using Weblate (French) Currently translated at 81.9% (611 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index d727be5eb2..25520a7eb0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:50+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1654,7 +1654,7 @@ msgstr "Erreur de sécurité inconnue: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Erreur de périphérique logiciel inconnue:% 04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format From 78506469e587cd68b66b282d1dc31432dc76e675 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:50:35 +0000 Subject: [PATCH 561/919] Translated using Weblate (French) Currently translated at 82.3% (614 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 25520a7eb0..34d28dc076 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:50+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:52+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1654,7 +1654,7 @@ msgstr "Erreur de sécurité inconnue: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "Erreur de périphérique logiciel inconnue:% 04x" +msgstr "Erreur de périphérique logiciel inconnue: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format From 0475897b69a7ec9d1997f424729d3af4acfdcde6 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:50:40 +0000 Subject: [PATCH 562/919] Translated using Weblate (French) Currently translated at 82.3% (614 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 34d28dc076..5253e97bc1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:52+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1667,6 +1667,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Problème non spécifié. Il se peut que l'invite d'association sur l'autre " +"appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1692,12 +1694,12 @@ msgstr "Valeur de tirage 'pull' non supportée." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Longueur de valeur! = Longueur fixe requise" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "Longueur de la valeur> longueur_max" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" From 9aee97c0a05fd3b7eb50f6830d356c5c715b26ad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:52:24 +0000 Subject: [PATCH 563/919] Translated using Weblate (French) Currently translated at 82.7% (617 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 5253e97bc1..68b52d4220 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:52+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:53+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1699,7 +1699,7 @@ msgstr "Longueur de valeur! = Longueur fixe requise" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "Longueur de la valeur> longueur_max" +msgstr "Longueur de la valeur > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" From 56c8a3d5bd9d44e7a55aeeeb8d6bae9ccdc94ebb Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:52:31 +0000 Subject: [PATCH 564/919] Translated using Weblate (French) Currently translated at 82.7% (617 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 68b52d4220..276a3afa34 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:53+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1708,7 +1708,7 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "La lecture de la tension a expiré" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1731,11 +1731,11 @@ msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Écritures non prises en charge sur la caractéristique" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Vous êtes en mode sans échec: quelque chose d'imprévu s'est produit.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " From 8ed19c16e23b71b5c74dfc619571d14efd8e703b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:53:12 +0000 Subject: [PATCH 565/919] Translated using Weblate (French) Currently translated at 83.3% (622 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 276a3afa34..8d36b29e4c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:53+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1735,7 +1735,7 @@ msgstr "Écritures non prises en charge sur la caractéristique" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "Vous êtes en mode sans échec: quelque chose d'imprévu s'est produit.\n" +msgstr "Vous êtes en mode sans échec: quelque chose d'imprévu s'est passé.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " From aa0b21a852afa28c59c8b85b96cad8e907bfa3ec Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:53:29 +0000 Subject: [PATCH 566/919] Translated using Weblate (French) Currently translated at 83.3% (622 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 8d36b29e4c..715101c449 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:53+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1777,7 +1777,7 @@ msgstr "adresses vides" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 est implémenté uniquement pour les scalaires et les ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1785,7 +1785,7 @@ msgstr "l'argument est une séquence vide" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "L'argument argsort doit être un ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1802,7 +1802,7 @@ msgstr "l'argument devrait être un(e) '%q', pas '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "les arguments doivent être des ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1810,7 +1810,7 @@ msgstr "tableau/octets requis à droite" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "tenter d'obtenir argmin / argmax d'une séquence vide" #: py/objstr.c msgid "attributes not supported yet" @@ -1818,7 +1818,7 @@ msgstr "attribut pas encore supporté" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "l'axe doit être -1, 0, Aucun ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" From 19eec97959e5c5dc6987002f756ebc952843699f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:53:58 +0000 Subject: [PATCH 567/919] Translated using Weblate (French) Currently translated at 83.6% (624 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 715101c449..b1dcba1d70 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:53+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:54+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1818,7 +1818,7 @@ msgstr "attribut pas encore supporté" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "l'axe doit être -1, 0, Aucun ou 1" +msgstr "l'axe doit être -1, 0, None ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" From c51f5a6b26b3717f53cd8ec26278d8e167a731e4 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:54:03 +0000 Subject: [PATCH 568/919] Translated using Weblate (French) Currently translated at 83.6% (624 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index b1dcba1d70..58b8567516 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:54+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1822,11 +1822,11 @@ msgstr "l'axe doit être -1, 0, None ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "l'axe doit être -1, 0 ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "l'axe doit être Aucun, 0 ou 1" #: py/builtinevex.c msgid "bad compile mode" From d40ac8e65da26bd3c96cbc2f87be243a3f02ef0f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:54:18 +0000 Subject: [PATCH 569/919] Translated using Weblate (French) Currently translated at 85.2% (636 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 58b8567516..6a31fbaab7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:54+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:55+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1826,7 +1826,7 @@ msgstr "l'axe doit être -1, 0 ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "l'axe doit être Aucun, 0 ou 1" +msgstr "l'axe doit être None, 0 ou 1" #: py/builtinevex.c msgid "bad compile mode" From 992f290eb83db99a378925478d9e580cbd93405d Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:54:26 +0000 Subject: [PATCH 570/919] Translated using Weblate (French) Currently translated at 85.2% (636 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 6a31fbaab7..2c0b57e845 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:55+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -1898,7 +1898,7 @@ msgstr "bytecode non implémenté" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder n'est pas une chaîne" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -2085,7 +2085,7 @@ msgstr "ne peut pas réaliser un import relatif" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "ne peut pas remodeler le tableau (forme d'entrée / sortie incompatible)" #: py/emitnative.c msgid "casting" @@ -2105,7 +2105,7 @@ msgstr "argument de chr() hors de la gamme range(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "le cercle ne peut être enregistré que dans un seul parent" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2114,6 +2114,7 @@ msgstr "le tampon de couleur doit faire 3 octets (RVB) ou 4 (RVB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" msgstr "" +"le tampon de couleur doit être un tampon, un tuple, une liste ou un entier" #: shared-bindings/displayio/Palette.c #, fuzzy @@ -2153,27 +2154,27 @@ msgstr "conversion en objet" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "les arguments convolve doivent être des tableaux linéaires" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "les arguments convolve doivent être des ndarrays" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "les arguments convolve ne doivent pas être vides" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "n'a pas pu inverser la matrice Vandermonde" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof doit être inférieur à la longueur de l'ensemble de données" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2204,7 +2205,7 @@ msgstr "la séquence de mise à jour de dict a une mauvaise longueur" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "l'argument diff doit être un ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2217,7 +2218,7 @@ msgstr "vide" #: shared-bindings/vectorio/Polygon.c msgid "empty %q list" -msgstr "" +msgstr "liste% q vide" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" From a7f4a35d80ea89628266575531f09df93abf6e67 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:55:31 +0000 Subject: [PATCH 571/919] Translated using Weblate (French) Currently translated at 88.0% (657 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2c0b57e845..35a14cbd31 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:55+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:57+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2218,7 +2218,7 @@ msgstr "vide" #: shared-bindings/vectorio/Polygon.c msgid "empty %q list" -msgstr "liste% q vide" +msgstr "liste %q vide" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" From a65182dccf2ec0a97fd6a831a7e0f7a10a855f87 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:55:38 +0000 Subject: [PATCH 572/919] Translated using Weblate (French) Currently translated at 88.0% (657 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 35a14cbd31..7e265dd282 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:57+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -2284,23 +2284,25 @@ msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "La partie d'expression de chaîne f ne peut pas inclure de '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" msgstr "" +"La partie d'expression de chaîne f ne peut pas inclure de barre oblique " +"inverse" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: expression vide non autorisée" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: attend '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: single '}' n'est pas autorisé" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2313,11 +2315,11 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "le premier argument doit être un itérable" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "le premier argument doit être un ndarray" #: py/objtype.c msgid "first argument to super() must be type" @@ -2329,11 +2331,11 @@ msgstr "le 1er bit doit être le MSB" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "l'ordre d'aplatissement doit être «C» ou «F»" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "l'argument flip doit être un ndarray" #: py/objint.c msgid "float too big" @@ -2367,6 +2369,7 @@ msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" +"la fonction est implémentée pour les scalaires et les ndarrays uniquement" #: py/argcheck.c #, c-format @@ -2433,7 +2436,7 @@ msgstr "espacement incorrect" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "l'index est hors limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2449,6 +2452,7 @@ msgstr "les indices doivent être des entiers" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" msgstr "" +"les indices doivent être des entiers, des tranches ou des listes booléennes" #: py/compile.c msgid "inline assembler must be a function" @@ -2456,35 +2460,35 @@ msgstr "l'assembleur doit être une fonction" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "l'argument d'entrée doit être un entier ou un tuple 2" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "la longueur du tableau d'entrée doit être une puissance de 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "les données d'entrée doivent être un itérable" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "la matrice d'entrée est asymétrique" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "la matrice d'entrée est singulière" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "l'entrée doit être une matrice carrée" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "l'entrée doit être tuple, list, range ou ndarray" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "les vecteurs d'entrée doivent être de longueur égale" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2497,7 +2501,7 @@ msgstr "entier requis" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "l'intervalle doit être dans la plage% s-% s" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" From 362c4d3443479fc119d731ee7bb29de5ca4a1974 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:57:18 +0000 Subject: [PATCH 573/919] Translated using Weblate (French) Currently translated at 89.0% (664 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 7e265dd282..08c64c50a0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:57+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:58+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2501,7 +2501,7 @@ msgstr "entier requis" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "l'intervalle doit être dans la plage% s-% s" +msgstr "l'intervalle doit être dans la plage %s-%s" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" From e942dd6f7819cdbbe526c6edc9ded247b8e42477 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:57:26 +0000 Subject: [PATCH 574/919] Translated using Weblate (French) Currently translated at 89.0% (664 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 08c64c50a0..a5a3c2fbd1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:58+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -2571,11 +2571,11 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "les itérables ne sont pas de la même longueur" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "les itérations n'ont pas convergé" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2606,7 +2606,7 @@ msgstr "argument 'length' non-permis pour ce type" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "le niveau doit être compris entre 0 et 1" #: py/objarray.c msgid "lhs and rhs should be compatible" @@ -2630,7 +2630,7 @@ msgstr "entiers longs non supportés dans cette build" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "f-string mal formé" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2642,17 +2642,17 @@ msgstr "erreur de domaine math" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "les dimensions de la matrice ne correspondent pas" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "la matrice n'est pas définie positive" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length doit être 0-% d lorsque fixed_length est% s" #: py/runtime.c msgid "maximum recursion depth exceeded" From 2f363b5052c8503f69ee0d76b1055d8c0abfdb70 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:58:07 +0000 Subject: [PATCH 575/919] Translated using Weblate (French) Currently translated at 89.4% (667 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index a5a3c2fbd1..e5f0b963ef 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:58+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2652,7 +2652,7 @@ msgstr "la matrice n'est pas définie positive" #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "max_length doit être 0-% d lorsque fixed_length est% s" +msgstr "max_length doit être 0-%d lorsque fixed_length est %s" #: py/runtime.c msgid "maximum recursion depth exceeded" From b88541158c9843499d9d4188e2fddb3279d874b5 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:58:14 +0000 Subject: [PATCH 576/919] Translated using Weblate (French) Currently translated at 89.4% (667 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e5f0b963ef..c5fb7d5479 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:58+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -2673,7 +2673,7 @@ msgstr "module introuvable" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "plus de degrés de liberté que de points de données" #: py/compile.c msgid "multiple *x in assignment" @@ -2701,7 +2701,7 @@ msgstr "doit utiliser un argument nommé pour une fonction key" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n doit être compris entre 0 et 9" #: py/runtime.c msgid "name '%q' is not defined" @@ -2717,7 +2717,7 @@ msgstr "nom réutilisé comme argument" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "rendement natif" #: py/runtime.c #, c-format From f4e82134392ded670a7e879acdb36ad94e79bd14 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:58:35 +0000 Subject: [PATCH 577/919] Translated using Weblate (French) Currently translated at 91.1% (680 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c5fb7d5479..6800417f33 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:58+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 15:59+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2717,7 +2717,7 @@ msgstr "nom réutilisé comme argument" #: py/emitnative.c msgid "native yield" -msgstr "rendement natif" +msgstr "'yield' natif" #: py/runtime.c #, c-format From 4642c60f14d813cde7d477b647356932d38a74db Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:58:40 +0000 Subject: [PATCH 578/919] Translated using Weblate (French) Currently translated at 91.1% (680 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 6800417f33..c9e67842cb 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:59+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -2752,7 +2752,7 @@ msgstr "pas de module '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "pas de broche de réinitialisation disponible" #: py/runtime.c msgid "no such attribute" @@ -2760,7 +2760,7 @@ msgstr "pas de tel attribut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "non UUID trouvé dans service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" @@ -2794,11 +2794,11 @@ msgstr "pas assez d'arguments pour la chaîne de format" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "le nombre d'arguments doit être 2 ou 3" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "le nombre de points doit être d'au moins 2" #: py/obj.c #, c-format @@ -2857,11 +2857,11 @@ msgstr "adresse hors limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "seul bit_depth = 16 est pris en charge" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "seul sample_rate = 16000 est pris en charge" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c @@ -2871,15 +2871,15 @@ msgstr "seules les tranches avec 'step=1' (cad None) sont supportées" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "les opérandes ne pouvaient pas être diffusés ensemble" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "l'opération n'est pas implémentée sur les ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "l'opération n'est pas prise en charge pour un type donné" #: py/modbuiltins.c msgid "ord expects a character" @@ -2934,7 +2934,7 @@ msgstr "" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "le polygone ne peut être enregistré que dans un parent" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2969,11 +2969,11 @@ msgstr "dépassement de file" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "les chaînes f brutes ne sont pas implémentées" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "les parties réelles et imaginaires doivent être de longueur égale" #: py/builtinimport.c msgid "relative import" @@ -2995,7 +2995,7 @@ msgstr "return attendait '%q' mais a reçu '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins [% d] duplique une autre affectation de broches" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From a0d7f5cce35912c267dfb382a148d2c551fe03fb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:59:43 +0000 Subject: [PATCH 579/919] Translated using Weblate (French) Currently translated at 91.2% (681 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c9e67842cb..74c0947a09 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:59+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2995,7 +2995,7 @@ msgstr "return attendait '%q' mais a reçu '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "rgb_pins [% d] duplique une autre affectation de broches" +msgstr "rgb_pins [%d] duplique une autre affectation de broches" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format From f48a50fdd160957139d6c3e2bc7ef399231766ee Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 15:59:49 +0000 Subject: [PATCH 580/919] Translated using Weblate (French) Currently translated at 91.2% (681 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 74c0947a09..64be6c43b5 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 15:59+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3000,7 +3000,7 @@ msgstr "rgb_pins [%d] duplique une autre affectation de broches" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins [% d] n'est pas sur le même port que l'horloge" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" From 68406d0eea6d62d7b96954d5307698ec1f6ffe79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 15:59:55 +0000 Subject: [PATCH 581/919] Translated using Weblate (French) Currently translated at 91.5% (683 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 64be6c43b5..9e01035dbc 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:59+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 16:00+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -2995,12 +2995,12 @@ msgstr "return attendait '%q' mais a reçu '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "rgb_pins [%d] duplique une autre affectation de broches" +msgstr "rgb_pins[%d] duplique une autre affectation de broches" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "rgb_pins [% d] n'est pas sur le même port que l'horloge" +msgstr "rgb_pins[%d] n'est pas sur le même port que l'horloge" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" From edb033c63ba79a0ed35e1cb5d83f1f9763cdb632 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 16:00:13 +0000 Subject: [PATCH 582/919] Translated using Weblate (French) Currently translated at 91.5% (683 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9e01035dbc..c4cf732f54 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:00+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3004,11 +3004,11 @@ msgstr "rgb_pins[%d] n'est pas sur le même port que l'horloge" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "le côté droit doit être un ndarray ou un scalaire" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit (Aucun, n)" #: shared-bindings/audiocore/RawSample.c msgid "" From 5eb43a35a26ebbfe48990cbf389bff28d6dcb6a6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 16:00:28 +0000 Subject: [PATCH 583/919] Translated using Weblate (French) Currently translated at 91.9% (686 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index c4cf732f54..75909d4f43 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:00+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -3008,7 +3008,7 @@ msgstr "le côté droit doit être un ndarray ou un scalaire" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "rsplit (Aucun, n)" +msgstr "rsplit(None, n)" #: shared-bindings/audiocore/RawSample.c msgid "" From 0d7e22b36da6b7e28f82d6486be74ba8c1a6eb04 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 16:00:33 +0000 Subject: [PATCH 584/919] Translated using Weblate (French) Currently translated at 91.9% (686 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 75909d4f43..2bd6f0a387 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:00+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3032,7 +3032,7 @@ msgstr "compilation de script non supportée" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "la forme doit être un tuple 2" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -3048,7 +3048,7 @@ msgstr "'}' seule rencontrée dans une chaîne de format" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "la taille est définie pour les ndarrays uniquement" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" @@ -3068,7 +3068,7 @@ msgstr "redémarrage logiciel\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "l'argument de tri doit être un ndarray" #: py/objstr.c msgid "start/end indices" From 360777e7fe10d153329d9b68a29e6cd71212f6aa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 16:00:52 +0000 Subject: [PATCH 585/919] Translated using Weblate (French) Currently translated at 92.0% (687 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2bd6f0a387..e1784e74a0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 16:00+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 16:01+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -3068,7 +3068,7 @@ msgstr "redémarrage logiciel\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "l'argument de tri doit être un ndarray" +msgstr "l'argument de «sort» doit être un ndarray" #: py/objstr.c msgid "start/end indices" From a543f9fd7160992b6d7f47a6aed706e6474bd35f Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 16:00:58 +0000 Subject: [PATCH 586/919] Translated using Weblate (French) Currently translated at 92.0% (687 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index e1784e74a0..2ea90249a1 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:01+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3147,7 +3147,7 @@ msgstr "time.struct_time() prend une séquence de longueur 9" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "le délai doit être compris entre 0,0 et 100,0 secondes" #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy From 2c4e18be60519c116aba96ca27384f95b4749722 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 16:01:06 +0000 Subject: [PATCH 587/919] Translated using Weblate (French) Currently translated at 92.3% (689 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 2ea90249a1..5e904628ea 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:01+0000\n" -"Last-Translator: Anonymous \n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -3147,7 +3147,7 @@ msgstr "time.struct_time() prend une séquence de longueur 9" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "le délai doit être compris entre 0,0 et 100,0 secondes" +msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy From 85fb23163935ebfadd4f38989e466d1049cd1191 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 16:01:12 +0000 Subject: [PATCH 588/919] Translated using Weblate (French) Currently translated at 92.3% (689 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 5e904628ea..3bdaf42528 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 16:01+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3164,7 +3164,7 @@ msgstr "trop d'arguments fournis avec ce format" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "trop d'indices" #: py/runtime.c #, c-format @@ -3295,7 +3295,7 @@ msgstr "type non supporté pour %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "la valeur doit tenir dans% d octet (s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" From a04d453e5cbad159e3f14e0eed68ecabf73a91db Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 16:01:26 +0000 Subject: [PATCH 589/919] Translated using Weblate (French) Currently translated at 92.8% (693 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 3bdaf42528..43ddc9c99a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 16:01+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 17:36+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -3295,7 +3295,7 @@ msgstr "type non supporté pour %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "la valeur doit tenir dans% d octet (s)" +msgstr "la valeur doit tenir dans %d octet(s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" From b7292a3c349ea303029f04eda7e6961d600ee984 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 16:01:33 +0000 Subject: [PATCH 590/919] Translated using Weblate (French) Currently translated at 92.8% (693 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 43ddc9c99a..0659514b2f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 17:36+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -3303,15 +3303,15 @@ msgstr "'value_count' doit être > 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "la fenêtre doit être <= intervalle" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "type d'argument incorrect" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "type d'index incorrect" #: py/objstr.c msgid "wrong number of arguments" @@ -3323,7 +3323,7 @@ msgstr "mauvais nombre de valeurs à dégrouper" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "type d'opérande incorrect" #: shared-module/displayio/Shape.c #, fuzzy From 5506765db5807bd678b248f77ecf9def79f22078 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Sun, 17 May 2020 15:24:51 +0000 Subject: [PATCH 591/919] Translated using Weblate (Swedish) Currently translated at 100.0% (746 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 291 ++++++++++++++++++++++++++------------------------- 1 file changed, 147 insertions(+), 144 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index ef958db944..15ff0802b0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 15:24+0000\n" +"PO-Revision-Date: 2020-05-17 17:36+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -2040,7 +2040,7 @@ msgstr "kan inte omforma matris (inkompatibel indata-/utdataform)" #: py/emitnative.c msgid "casting" -msgstr "casting" +msgstr "casting inte implementerad" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -2667,601 +2667,604 @@ msgstr "behöver mer än %d värden för att packa upp" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negativ exponent utan stöd för flyttal" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "negativt skiftantal" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "ingen aktiv exception för reraise" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "ingen tillgänglig NIC" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "ingen bindning för ickelokal hittad" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "ingen modul med namnet '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "ingen reset-pinne tillgänglig" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "inget sådant attribut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "icke-UUID hittades i service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "icke-standard argument följer standard argument" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "icke-hexnummer hittade" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "icke nyckelord arg efter * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "icke nyckelord arg efter nyckelord arg" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "inte en 128-bitars UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "inte alla argument omvandlade under strängformatering" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "inte tillräckligt med argument för formatsträng" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "antal argument måste vara 2 eller 3" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "antal punkter måste vara minst 2" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "objektet '%s' är inte en tupel eller lista" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "Objektet stöder inte tilldelning" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "objektet stöder inte borttagning" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "objektet har inte len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "Objektet är inte indexbart" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "objektet är inte en iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "objektet är inte anropbart" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" -msgstr "" +msgstr "objektet är inte i sekvens" #: py/runtime.c msgid "object not iterable" -msgstr "" +msgstr "objektet är inte iterable" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "objekt av typen '%s' har ingen len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "objekt med buffertprotokoll krävs" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "sträng har udda längd" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "offset utanför gränserna" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "bara bit_depth=16 stöds" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "enbart sample_rate=16000 stöds" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" -msgstr "" +msgstr "endast segment med steg=1 (aka Ingen) stöds" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "operander kan inte sändas tillsammans" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "åtgärden är inte implementerad för ndarray:er" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "åtgärden stöds inte för given typ" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "ord förväntar sig ett tecken" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "" +msgstr "ord() förväntade sig ett tecken, men en sträng med längden %d hittades" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "" +msgstr "Konvertering av long int till machine word överskred maxvärde" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "palette måste vara 32 bytes lång" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index ska vara en int" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "parametern annotation måste vara en identifierare" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "parametrarna måste registreras i följd a2-a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "parametrarna måste registreras i följd r0-r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "pixelkoordinater utanför gränserna" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "pixelvärdet kräver för många bitar" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgstr "" +"pixel_shader måste vara displayio.Palette eller displayio.ColorConverter" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "polygon kan endast registreras i en förälder" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop från en tom PulseIn" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop från en tom uppsättning" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop från tom lista" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): ordlistan är tom" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "pow() 3: e argument kan inte vara 0" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow() med 3 argument kräver heltal" #: extmod/modutimeq.c msgid "queue overflow" -msgstr "" +msgstr "köstorlek överskreds" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "råa f-strängar inte implementerade" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "verkliga och imaginära delar måste ha samma längd" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "relativ import" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "begärd längd %d men objektet har längden %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "retur-annotation måste vara en identifierare" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "retur förväntade '%q' men fick '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] duplicerar en annan pinntilldelning" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] är inte på samma port som en klocka" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "höger sida måste vara en ndarray, eller en scalar" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"sample_source buffert måste vara en bytearray eller matris av typ 'h', 'H', " +"'b' eller 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "" +msgstr "samplingsfrekvens utanför räckvidden" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "schemastack full" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "" +msgstr "skriptkompilering stöds inte" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "shape måste vara en 2-tupel" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "tecknet tillåts inte i strängformatspecificerare" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "tecken tillåts inte med heltalsformatspecificeraren 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "Enkelt '}' påträffades i formatsträngen" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "storlek är enbart definierad ndarrays" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "värdet för sleep måste vara positivt" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "segmentsteg får inte vara noll" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "värdet för konvertering till small int överskreds" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "mjuk omstart\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "argumentet sort måste vara en ndarray" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "start-/slutindex" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" -msgstr "" +msgstr "start_x ska vara en int" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "" +msgstr "step måste vara icke-noll" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "stop måste vara 1 eller 2" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop kan inte nås från start" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "stream-åtgärd stöds inte" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "strängindex utanför intervallet" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "strängindex måste vara heltal, inte %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "sträng stöds inte; använd bytes eller bytearray" #: extmod/moductypes.c msgid "struct: cannot index" -msgstr "" +msgstr "struct: kan inte indexera" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "" +msgstr "struct: index utanför intervallet" #: extmod/moductypes.c msgid "struct: no fields" -msgstr "" +msgstr "struct: inga fält" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "det gick inte att hitta delsträng" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "super() kan inte hitta self" #: extmod/modujson.c msgid "syntax error in JSON" -msgstr "" +msgstr "syntaxfel i JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "syntaxfel i uctypes deskriptor" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "" +msgstr "tröskelvärdet måste ligga i intervallet 0-65536" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() kräver en 9-sekvens" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "timeout måste vara 0.0-100.0 sekunder" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "" +msgstr "timeout måste vara >= 0.0" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "timestamp utom räckvidd för plattformens \"time_t\"" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "för många argument för det givna formatet" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "för många index" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "för många värden att packa upp (förväntat %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "tupelindex utanför intervallet" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "tupel/lista har fel längd" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "tupel/lista krävs för RHS" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "" +msgstr "tx och rx kan inte båda vara None" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "typ '%q' är inte en acceptabel bastyp" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "typ är inte en acceptabel bastyp" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "typobjektet '%q' har inget attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "typen tar 1 eller 3 argument" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong för stor" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "binär op %q är inte implementerad" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "oväntat indrag" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "oväntat nyckelordsargument" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "oväntat nyckelordsargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "unicode name escapes" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "indentering inte matchar någon yttre indenteringsnivå" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "okänd konverteringsspecificerare %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "okänt format '%c' för objekt av typ '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "okänd typ" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "okänd typ '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "omatchad '{' i format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" -msgstr "" +msgstr "attribut kan inte läsas" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c #: shared-bindings/vectorio/VectorShape.c msgid "unsupported %q type" -msgstr "" +msgstr "typ %q stöds inte" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "Thumb-instruktion '%s' med %d argument stöd inte" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "Xtensa-instruktion '%s' med %d argument stöds inte" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "Formattecknet '%c' (0x%x) stöds inte vid index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "typ som inte stöds för %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "typ stöds inte för operatören" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "typ som inte stöds för %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "värdet måste passa i %d byte(s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_count måste vara > 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "window måste vara <= interval" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "fel typ av argument" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "fel indextyp" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "fel antal argument" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "fel antal värden för att packa upp" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "fel operandtyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "x-värde utanför intervall" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "" +msgstr "y ska vara en int" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "y-värde utanför intervall" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "noll steg" From 5454877fb87f4e1259d9948b69df713964e98eaa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 19:08:21 +0000 Subject: [PATCH 592/919] Translated using Weblate (Spanish) Currently translated at 68.9% (514 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/es/ --- locale/es.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/locale/es.po b/locale/es.po index 12ecb0c182..60a8af0599 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,14 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2018-08-24 22:56-0500\n" -"Last-Translator: \n" +"PO-Revision-Date: 2020-05-17 20:56+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: \n" -"Language: en_US\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" @@ -1802,6 +1803,7 @@ msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" #: py/emitinlinethumb.c +#, fuzzy msgid "branch not in range" msgstr "El argumento de chr() no esta en el rango(256)" From bc64b8b35857e81b0d1e199bb44a6b0ae746356a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 May 2020 18:48:04 +0000 Subject: [PATCH 593/919] Translated using Weblate (French) Currently translated at 100.0% (746 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 154 +++++++++++++++++++-------------------------------- 1 file changed, 57 insertions(+), 97 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 0659514b2f..5fdaae07c7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 17:36+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-17 20:56+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -121,12 +121,12 @@ msgid "'%s' expects a register" msgstr "'%s' attend un registre" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects a special register" msgstr "'%s' attend un registre special" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects an FPU register" msgstr "'%s' attend un registre FPU" @@ -141,12 +141,12 @@ msgid "'%s' expects an integer" msgstr "'%s' attend un entier" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects at most r%d" msgstr "'%s' s'attend au plus à r%d" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' expects {r0, r1, ...}" msgstr "'%s' attend {r0, r1, ...}" @@ -156,7 +156,7 @@ msgid "'%s' integer %d is not within range %d..%d" msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" @@ -272,7 +272,7 @@ msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" #: shared-bindings/_bleio/Address.c -#, fuzzy, c-format +#, c-format msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" @@ -281,19 +281,16 @@ msgid "Address type out of range" msgstr "Type d'adresse hors plage" #: ports/nrf/common-hal/busio/I2C.c -#, fuzzy msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" #: ports/nrf/common-hal/busio/SPI.c -#, fuzzy msgid "All SPI peripherals are in use" msgstr "Tous les périphériques SPI sont utilisés" #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "All UART peripherals are in use" -msgstr "Tous les périphériques I2C sont utilisés" +msgstr "Tous les périphériques UART sont utilisés" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -320,7 +317,7 @@ msgstr "Tous les timers sont utilisés" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "S'annonce déjà." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" @@ -448,18 +445,17 @@ msgstr "Tampon trop court de %d octets" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy, c-format +#, c-format msgid "Bus pin %d is already in use" msgstr "La broche %d du bus est déjà utilisée" #: shared-bindings/_bleio/UUID.c -#, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "Le tampon d'octets doit être de 16 octets." +msgstr "Le tampon doit être de 16 octets." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "Les octets 'bytes' doivent être entre 0 et 255" +msgstr "Les octets 'bytes' doivent être entre 0 et 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" @@ -484,7 +480,6 @@ msgid "Cannot get pull while in output mode" msgstr "Ne peut être tiré ('pull') en mode 'output'" #: ports/nrf/common-hal/microcontroller/Processor.c -#, fuzzy msgid "Cannot get temperature" msgstr "Impossible de lire la température" @@ -549,7 +544,7 @@ msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups!\n" +msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups !\n" #: supervisor/shared/safe_mode.c msgid "" @@ -562,7 +557,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "Echec de l'init. de la broche d'horloge" +msgstr "Echec de l'init. de la broche d'horloge." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -578,7 +573,6 @@ msgstr "L'entrée 'Column' doit être un digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c -#, fuzzy msgid "Command must be an int between 0 and 255" msgstr "La commande doit être un entier entre 0 et 255" @@ -666,7 +660,6 @@ msgstr "DAC déjà utilisé" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy msgid "Data 0 pin must be byte aligned" msgstr "La broche 'Data 0' doit être aligné sur l'octet" @@ -728,7 +721,6 @@ msgstr "Attendu un %q" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c -#, fuzzy msgid "Expected a Characteristic" msgstr "Une 'Characteristic' est attendue" @@ -738,7 +730,6 @@ msgstr "Attendu un service" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c -#, fuzzy msgid "Expected a UUID" msgstr "Un UUID est attendu" @@ -764,7 +755,7 @@ msgid "Failed sending command." msgstr "Échec de l'envoi de la commande." #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" @@ -783,18 +774,18 @@ msgstr "Echec de l'allocation de %d octets du tampon RX" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "Impossible de se connecter: erreur interne" +msgstr "Impossible de se connecter : erreur interne" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "Impossible de se connecter: délai d'expiration" +msgstr "Impossible de se connecter : délai d'expiration" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Impossible d'analyser le fichier MP3" #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Impossible de libérer mutex, err 0x%04x" @@ -899,7 +890,6 @@ msgid "Invalid ADC Unit value" msgstr "Valeur d'unité ADC non valide" #: shared-module/displayio/OnDiskBitmap.c -#, fuzzy msgid "Invalid BMP file" msgstr "Fichier BMP invalide" @@ -934,7 +924,6 @@ msgid "Invalid bits per value" msgstr "Bits par valeur invalides" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -#, fuzzy msgid "Invalid buffer size" msgstr "Longueur de tampon invalide" @@ -944,16 +933,15 @@ msgstr "Chaîne d'octets non valide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Période de capture invalide. Gamme valide: 1 à 500" +msgstr "Période de capture invalide. Gamme valide : 1 à 500" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid channel count" msgstr "Nombre de canaux invalide" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Direction invalide" +msgstr "Direction invalide." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1029,7 +1017,6 @@ msgid "Invalid voice" msgstr "Voix invalide" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid voice count" msgstr "Nombre de voix invalide" @@ -1067,11 +1054,11 @@ msgstr "La longueur ne doit pas être négative" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "Echec de l'init. de la broche MISO" +msgstr "Echec de l'init. de la broche MISO." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "Echec de l'init. de la broche MOSI" +msgstr "Echec de l'init. de la broche MOSI." #: shared-module/displayio/Shape.c #, c-format @@ -1155,7 +1142,7 @@ msgstr "Pas d'horloge disponible" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "Pas de connexion: la longueur ne peut pas être déterminée" +msgstr "Pas de connexion : la longueur ne peut pas être déterminée" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1192,7 +1179,7 @@ msgstr "Plus de minuteurs disponibles sur cette broche." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "Pas de pulldown sur la broche; 1Mohm recommandé" +msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" #: py/moduerrno.c msgid "No space left on device" @@ -1212,7 +1199,6 @@ msgstr "Affirmation de défaillance du Nordic Soft Device." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "Not connected" msgstr "Non connecté" @@ -1229,7 +1215,6 @@ msgstr "" "objet." #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "Odd parity is not supported" msgstr "Parité impaire non supportée" @@ -1242,8 +1227,8 @@ msgstr "Uniquement 8 ou 16 bit mono avec " msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" -"Seul le format BMP Windows, non compressé est supporté: la taille de " -"l'entêtefournie est %d" +"Seul le format BMP Windows, non compressé est supporté : la taille de " +"l'entête fournie est %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1252,7 +1237,7 @@ msgid "" "%d bpp given" msgstr "" "Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " -"ou plus: %d bpp fournis" +"ou plus : %d bpp fournis" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." @@ -1266,7 +1251,6 @@ msgstr "" "bits)" #: shared-bindings/pulseio/PWMOut.c -#, fuzzy msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" @@ -1310,7 +1294,6 @@ msgstr "" " True au constructeur" #: py/builtinhelp.c -#, fuzzy msgid "Plus any modules on the filesystem\n" msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" @@ -1377,7 +1360,6 @@ msgid "Read-only filesystem" msgstr "Système de fichier en lecture seule" #: shared-module/displayio/Bitmap.c -#, fuzzy msgid "Read-only object" msgstr "Objet en lecture seule" @@ -1399,11 +1381,11 @@ msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "Mode sans-échec! Auto-chargement désactivé.\n" +msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" #: main.c msgid "Running in safe mode! Not running saved code.\n" -msgstr "Mode sans-échec! Le code sauvegardé n'est pas éxecuté.\n" +msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" #: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1418,7 +1400,6 @@ msgid "SPI Re-initialization error" msgstr "Erreur de réinitialisation SPI" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Sample rate must be positive" msgstr "Le taux d'échantillonage doit être positif" @@ -1446,7 +1427,7 @@ msgstr "Sérialiseur en cours d'utilisation" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "Tranche et valeur de tailles différentes" +msgstr "Tranche et valeur de tailles différentes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c @@ -1483,7 +1464,7 @@ msgid "" "Please increase the stack size if you know how, or if not:" msgstr "" "Le tas CircuitPython a été corrompu car la pile était trop petite.\n" -"Veuillez augmenter la taille de la pile si vous savez comment, ou sinon:" +"Veuillez augmenter la taille de la pile si vous savez comment, ou sinon :" #: supervisor/shared/safe_mode.c msgid "" @@ -1556,7 +1537,7 @@ msgstr "" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "Trace (appels les plus récents en dernier):\n" +msgstr "Trace (appels les plus récents en dernier) :\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" @@ -1633,14 +1614,13 @@ msgid "Unable to write to nvm." msgstr "Impossible d'écrire sur la mémoire non-volatile." #: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy msgid "Unexpected nrfx uuid type" msgstr "Type inattendu pour l'uuid nrfx" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "Erreur gatt inconnue: 0x%04x" +msgstr "Erreur gatt inconnue : 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." @@ -1649,18 +1629,18 @@ msgstr "Raison inconnue." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "Erreur de sécurité inconnue: 0x%04x" +msgstr "Erreur de sécurité inconnue : 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "Erreur de périphérique logiciel inconnue: %04x" +msgstr "Erreur de périphérique logiciel inconnue : %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" -"Pas de correspondance du nombres d'éléments à droite (attendu %d, obtenu %d)" +"Pas de correspondance du nombres d'éléments à droite (attendu %d, obtenu %d)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" @@ -1675,7 +1655,6 @@ msgid "Unsupported baudrate" msgstr "Débit non supporté" #: shared-module/displayio/display_core.c -#, fuzzy msgid "Unsupported display bus type" msgstr "Type de bus d'affichage non supporté" @@ -1694,7 +1673,7 @@ msgstr "Valeur de tirage 'pull' non supportée." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "Longueur de valeur! = Longueur fixe requise" +msgstr "Longueur de valeur != Longueur fixe requise" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1712,7 +1691,7 @@ msgstr "La lecture de la tension a expiré" #: main.c msgid "WARNING: Your code filename has two extensions\n" -msgstr "ATTENTION: le nom de fichier de votre code a deux extensions\n" +msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" #: py/builtinhelp.c #, c-format @@ -1723,7 +1702,7 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" -"Bienvenue sur Adafruit CircuitPython %s!\n" +"Bienvenue sur Adafruit CircuitPython %s !\n" "\n" "Visitez learn.adafruit.com/category/circuitpython pour les guides.\n" "\n" @@ -1735,7 +1714,7 @@ msgstr "Écritures non prises en charge sur la caractéristique" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "Vous êtes en mode sans échec: quelque chose d'imprévu s'est passé.\n" +msgstr "Vous êtes en mode sans échec : quelque chose d'imprévu s'est passé.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1857,12 +1836,10 @@ msgid "bits must be 8" msgstr "les bits doivent être 8" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" msgstr "branche hors-bornes" @@ -1871,7 +1848,6 @@ msgid "buffer must be a bytes-like object" msgstr "le tampon doit être un objet bytes-like" #: shared-module/struct/__init__.c -#, fuzzy msgid "buffer size must match format" msgstr "la taille du tampon doit correspondre au format" @@ -1965,7 +1941,6 @@ msgid "can't convert NaN to int" msgstr "on ne peut convertir NaN en entier 'int'" #: shared-bindings/i2cslave/I2CSlave.c -#, fuzzy msgid "can't convert address to int" msgstr "ne peut convertir l'adresse en entier 'int'" @@ -2117,18 +2092,15 @@ msgstr "" "le tampon de couleur doit être un tampon, un tuple, une liste ou un entier" #: shared-bindings/displayio/Palette.c -#, fuzzy msgid "color buffer must be a bytearray or array of type 'b' or 'B'" msgstr "" "le tampon de couleur doit être un bytearray ou un tableau de type 'b' ou 'B'" #: shared-bindings/displayio/Palette.c -#, fuzzy msgid "color must be between 0x000000 and 0xffffff" msgstr "la couleur doit être entre 0x000000 et 0xffffff" #: shared-bindings/displayio/ColorConverter.c -#, fuzzy msgid "color should be an int" msgstr "la couleur doit être un entier 'int'" @@ -2237,9 +2209,8 @@ msgid "end of format while looking for conversion specifier" msgstr "fin de format en cherchant une spécification de conversion" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "end_x should be an int" -msgstr "y doit être un entier 'int'" +msgstr "end_x doit être un entier 'int'" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -2294,15 +2265,15 @@ msgstr "" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "f-string: expression vide non autorisée" +msgstr "f-string : expression vide non autorisée" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "f-string: attend '}'" +msgstr "f-string : attend '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "f-string: single '}' n'est pas autorisé" +msgstr "f-string : single '}' n'est pas autorisé" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2737,7 +2708,6 @@ msgid "no active exception to reraise" msgstr "aucune exception active à relever" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c -#, fuzzy msgid "no available NIC" msgstr "adapteur réseau non disponible" @@ -2851,9 +2821,8 @@ msgid "odd-length string" msgstr "chaîne de longueur impaire" #: py/objstr.c py/objstrunicode.c -#, fuzzy msgid "offset out of bounds" -msgstr "adresse hors limites" +msgstr "décalage hors limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" @@ -2901,7 +2870,6 @@ msgid "palette must be 32 bytes long" msgstr "la palette doit être longue de 32 octets" #: shared-bindings/displayio/Palette.c -#, fuzzy msgid "palette_index should be an int" msgstr "palette_index devrait être un entier 'int'" @@ -2914,12 +2882,10 @@ msgid "parameters must be registers in sequence a2 to a5" msgstr "les paramètres doivent être des registres dans la séquence a2 à a5" #: py/emitinlinethumb.c -#, fuzzy msgid "parameters must be registers in sequence r0 to r3" msgstr "les paramètres doivent être des registres dans la séquence r0 à r3" #: shared-bindings/displayio/Bitmap.c -#, fuzzy msgid "pixel coordinates out of bounds" msgstr "coordonnées de pixel hors limites" @@ -2953,7 +2919,7 @@ msgstr "'pop' d'une liste vide" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "popitem(): dictionnaire vide" +msgstr "popitem() : dictionnaire vide" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" @@ -3075,7 +3041,6 @@ msgid "start/end indices" msgstr "indices de début/fin" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "start_x should be an int" msgstr "'start_x' doit être un entier 'int'" @@ -3107,19 +3072,19 @@ msgstr "les indices de chaîne de caractères doivent être des entiers, pas %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" msgstr "" -"chaîne de carac. non supportée; utilisez des bytes ou un tableau de bytes" +"chaîne de carac. non supportée ; utilisez des bytes ou un tableau de bytes" #: extmod/moductypes.c msgid "struct: cannot index" -msgstr "struct: indexage impossible" +msgstr "struct : indexage impossible" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "struct: index hors limites" +msgstr "struct : index hors limites" #: extmod/moductypes.c msgid "struct: no fields" -msgstr "struct: aucun champs" +msgstr "struct : aucun champs" #: py/objstr.c msgid "substring not found" @@ -3150,9 +3115,8 @@ msgid "timeout must be 0.0-100.0 seconds" msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "timeout must be >= 0.0" -msgstr "'timeout' doit être >=0.0" +msgstr "'timeout' doit être >= 0.0" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3261,12 +3225,11 @@ msgstr "attribut illisible" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c #: shared-bindings/vectorio/VectorShape.c -#, fuzzy msgid "unsupported %q type" -msgstr "type de %q non supporté" +msgstr "type %q non pris on charge" #: py/emitinlinethumb.c -#, fuzzy, c-format +#, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" msgstr "instruction Thumb '%s' non supportée avec %d arguments" @@ -3282,7 +3245,7 @@ msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "type non supporté pour %q: '%s'" +msgstr "type non supporté pour %q : '%s'" #: py/runtime.c msgid "unsupported type for operator" @@ -3290,7 +3253,7 @@ msgstr "type non supporté pour l'opérateur" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "type non supporté pour %q: '%s', '%s'" +msgstr "type non supporté pour %q : '%s', '%s'" #: py/objint.c #, c-format @@ -3326,17 +3289,14 @@ msgid "wrong operand type" msgstr "type d'opérande incorrect" #: shared-module/displayio/Shape.c -#, fuzzy msgid "x value out of bounds" msgstr "valeur x hors limites" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "y should be an int" -msgstr "y doit être un entier 'int'" +msgstr "'y' doit être un entier 'int'" #: shared-module/displayio/Shape.c -#, fuzzy msgid "y value out of bounds" msgstr "valeur y hors limites" From 4d1cbf3d635f0b1963d8edfca10df66719da9c2f Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 19:07:19 +0000 Subject: [PATCH 594/919] Translated using Weblate (French) Currently translated at 100.0% (746 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 5fdaae07c7..4958ee7452 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: Anonymous \n" "Language-Team: French \n" "Language: fr\n" @@ -486,6 +486,8 @@ msgstr "Impossible de lire la température" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Impossible d'avoir des réponses d'analyse pour les publicités étendues et " +"connectables." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -745,6 +747,7 @@ msgstr "Tuple de longueur %d attendu, obtenu %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." msgstr "" +"Les publicités étendues avec réponse d'analyse ne sont pas prises en charge." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" From f362ee1e75bc3603b83d122bcd0f46e05d2e53cd Mon Sep 17 00:00:00 2001 From: Anonymous Date: Sun, 17 May 2020 19:13:47 +0000 Subject: [PATCH 595/919] Translated using Weblate (Swedish) Currently translated at 100.0% (746 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 15ff0802b0..8d64d4b7b5 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-17 17:36+0000\n" -"Last-Translator: Jonny Bergdahl \n" +"PO-Revision-Date: 2020-05-17 20:56+0000\n" +"Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -1187,7 +1187,7 @@ msgstr "Ingen timer tillgänglig" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "Nordic Soft Device failure assertion." +msgstr "Påståendet om Nordic Soft Device-fel." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c From cb3c8f1423fda4d836caf9f4873f87a129e340bd Mon Sep 17 00:00:00 2001 From: Anonymous Date: Mon, 18 May 2020 02:46:17 +0000 Subject: [PATCH 596/919] Translated using Weblate (German) Currently translated at 66.6% (497 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 797c095b83..2c6565bc4b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-04-30 17:01+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-05-18 02:47+0000\n" +"Last-Translator: Anonymous \n" "Language-Team: German \n" "Language: de_DE\n" @@ -17,7 +17,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.0.2\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" @@ -81,7 +81,7 @@ msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "% q Liste muss eine Liste sein" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -92,7 +92,7 @@ msgstr "%q muss >= 1 sein" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "% q muss ein Tupel der Länge 2 sein" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" From 66b79c994e3d1f83e1e4460169911dd0c65a3d1c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 18 May 2020 02:47:42 +0000 Subject: [PATCH 597/919] Translated using Weblate (German) Currently translated at 66.6% (497 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 2c6565bc4b..d90c49bf23 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-18 02:47+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-18 02:48+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language: de_DE\n" @@ -81,7 +81,7 @@ msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "% q Liste muss eine Liste sein" +msgstr "%q Liste muss eine Liste sein" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -92,7 +92,7 @@ msgstr "%q muss >= 1 sein" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "% q muss ein Tupel der Länge 2 sein" +msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" From f002c784c0af2272b1fdd5430379bc7775d89743 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 May 2020 11:43:21 +0800 Subject: [PATCH 598/919] nrf: linker: add a new .uninitialized section This section immediately follows the .bss section, and is designed to contain uninitialized variables that should persist across reboots. The section is placed directly after .bss, under the theory that the size of Circuit Python's .bss + .data is bigger than the bootloader's .bss + .data, so there is less likely to be a conflict. Signed-off-by: Sean Cross --- ports/nrf/boards/common.template.ld | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index a2bbf0ec80..9a7df69a47 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -103,7 +103,7 @@ SECTIONS _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ } >RAM - /* Uninitialized data section */ + /* Zero-initialized data section */ .bss : { . = ALIGN(4); @@ -116,6 +116,19 @@ SECTIONS _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ } >RAM + /* Uninitialized data section + Data placed into this section will remain unchanged across reboots. */ + .uninitialized (NOLOAD) : + { + . = ALIGN(4); + _suninitialized = .; /* define a global symbol at uninitialized start; currently unused */ + *(.uninitialized) + *(.uninitialized*) + + . = ALIGN(4); + _euninitialized = .; /* define a global symbol at uninitialized end; currently unused */ + } >RAM + /* this is to define the start of the heap, and make sure we have a minimum size */ .heap : { From 192bb155fafb78b2f6073fdbfbbf41d8c44dc12e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 May 2020 11:45:35 +0800 Subject: [PATCH 599/919] nrf: port: move the heap after .uninitialized Previously, it was placed following .bss. However, now that there is a new section after .bss, the heap must be moved forward. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 539a9cf90b..a0c7be62ba 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -177,8 +177,13 @@ void reset_cpu(void) { NVIC_SystemReset(); } +// The uninitialized data section is placed directly after BSS, under the theory +// that Circuit Python has a lot more .data and .bss than the bootloader. As a +// result, this section is less likely to be tampered with by the bootloader. +extern uint32_t _euninitialized; + uint32_t *port_heap_get_bottom(void) { - return port_stack_get_limit(); + return &_euninitialized; } uint32_t *port_heap_get_top(void) { @@ -186,14 +191,13 @@ uint32_t *port_heap_get_top(void) { } uint32_t *port_stack_get_limit(void) { - return &_ebss; + return &_euninitialized; } uint32_t *port_stack_get_top(void) { return &_estack; } -extern uint32_t _ebss; // Place the word to save just after our BSS section that gets blanked. void port_set_saved_word(uint32_t value) { _ebss = value; From 3b5f5ddaa6232a8d3ac868c703e8a511abe045e0 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 May 2020 11:46:38 +0800 Subject: [PATCH 600/919] nrf: port: move saved word into .uninitialized section Circuit Python supports saving a single word of data across reboots. Previously, this data was placed immediately following the .bss. However, this appeared to not work, as Circuit Python zeroes out the heap when it starts up, and the heap begins immediately after the .bss. Switch to using the new .uninitialized section in order to store this word across resets. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index a0c7be62ba..3a76fa878c 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -198,13 +198,14 @@ uint32_t *port_stack_get_top(void) { return &_estack; } -// Place the word to save just after our BSS section that gets blanked. +// Place the word in the uninitialized section so it won't get overwritten. +__attribute__((section(".uninitialized"))) uint32_t _saved_word; void port_set_saved_word(uint32_t value) { - _ebss = value; + _saved_word = value; } uint32_t port_get_saved_word(void) { - return _ebss; + return _saved_word; } uint64_t port_get_raw_ticks(uint8_t* subticks) { From 83680c41db821672ff006b96151c6daeca6280e3 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 May 2020 11:48:23 +0800 Subject: [PATCH 601/919] nrf: rtc: persist rtc offset across reboots Store the RTC value in the .uninitialized section, but make sure to flank it with some known values. That way we can determine if the RTC value has been initialized, or if it's random uninitialized garbage. As part of this, add a `common_hal_rtc_init()` routine to determine if the value is correct, or reset it to 0 if it is not valid. Signed-off-by: Sean Cross --- ports/nrf/common-hal/rtc/RTC.c | 29 ++++++++++++++++++++++++++--- ports/nrf/common-hal/rtc/RTC.h | 1 + 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 9f56f2f0df..06345f5895 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -34,11 +34,28 @@ #include "supervisor/shared/translate.h" // This is the time in seconds since 2000 that the RTC was started. -static uint32_t rtc_offset = 0; +__attribute__((section(".uninitialized"))) static uint32_t rtc_offset[3]; + +// These values are placed before and after the current RTC count. They are +// used to determine if the RTC count is valid. These randomly-generated values +// will be set when the RTC value is set in order to mark the RTC as valid. If +// the system crashes or reboots, these values will remain undisturbed and the +// RTC offset will remain valid. +// +// If Circuit Python is updated or these symbols shift around, the prefix and +// suffix will no longer match, and the time will no longer be valid. +#define RTC_OFFSET_CHECK_PREFIX 0x25ea7e2a +#define RTC_OFFSET_CHECK_SUFFIX 0x2b80b69e + +void common_hal_rtc_init(void) { + // If the prefix and suffix are not valid, zero-initialize the RTC offset. + if ((rtc_offset[0] != RTC_OFFSET_CHECK_PREFIX) || (rtc_offset[2] != RTC_OFFSET_CHECK_SUFFIX)) + rtc_offset[1] = 0; +} void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { uint64_t ticks_s = port_get_raw_ticks(NULL) / 1024; - timeutils_seconds_since_2000_to_struct_time(rtc_offset + ticks_s, tm); + timeutils_seconds_since_2000_to_struct_time(rtc_offset[1] + ticks_s, tm); } void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { @@ -46,7 +63,13 @@ void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { uint32_t epoch_s = timeutils_seconds_since_2000( tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec ); - rtc_offset = epoch_s - ticks_s; + rtc_offset[1] = epoch_s - ticks_s; + + // Set the prefix and suffix in order to indicate the time is valid. This + // must be done after the offset is updated, in case there is a crash or + // power failure. + rtc_offset[0] = RTC_OFFSET_CHECK_PREFIX; + rtc_offset[2] = RTC_OFFSET_CHECK_SUFFIX; } int common_hal_rtc_get_calibration(void) { diff --git a/ports/nrf/common-hal/rtc/RTC.h b/ports/nrf/common-hal/rtc/RTC.h index 0207c8338c..e51f1f7848 100644 --- a/ports/nrf/common-hal/rtc/RTC.h +++ b/ports/nrf/common-hal/rtc/RTC.h @@ -29,5 +29,6 @@ extern void rtc_init(void); extern void rtc_reset(void); +extern void common_hal_rtc_init(void); #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_RTC_RTC_H From 9f7c26c60ddcd8ef371290e505f21148e3c98726 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 18 May 2020 11:50:04 +0800 Subject: [PATCH 602/919] nrf: port: call common_hal_rtc_init() during init Call the new function to set the RTC, or reset it if the offset is not valid. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 3a76fa878c..4edb78f7c0 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -120,6 +120,10 @@ safe_mode_t port_init(void) { // Configure millisecond timer initialization. tick_init(); +#if CIRCUITPY_RTC + common_hal_rtc_init(); +#endif + #if CIRCUITPY_ANALOGIO analogin_init(); #endif From f92d53eaab6261c680b05e6016524cd87a5b7b6e Mon Sep 17 00:00:00 2001 From: arturo182 Date: Mon, 18 May 2020 22:07:38 +0200 Subject: [PATCH 603/919] mimxrt1010: Increase max SPI speed --- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/clocks.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index cc19ba354c..15c320140a 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -58,7 +58,7 @@ STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } -#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv))) +#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1)) void spi_reset(void) { for (int i = 0; i < MAX_SPI; i++) { diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/clocks.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/clocks.c index 854ae4dee9..61888fcaa7 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/clocks.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/clocks.c @@ -55,7 +55,7 @@ #define BOARD_BOOTCLOCKRUN_GPT2_IPG_CLK_HIGHFREQ 62500000UL #define BOARD_BOOTCLOCKRUN_IPG_CLK_ROOT 125000000UL #define BOARD_BOOTCLOCKRUN_LPI2C_CLK_ROOT 60000000UL -#define BOARD_BOOTCLOCKRUN_LPSPI_CLK_ROOT 105600000UL +#define BOARD_BOOTCLOCKRUN_LPSPI_CLK_ROOT 130900000UL #define BOARD_BOOTCLOCKRUN_MQS_MCLK 63529411UL #define BOARD_BOOTCLOCKRUN_PERCLK_CLK_ROOT 62500000UL #define BOARD_BOOTCLOCKRUN_SAI1_CLK_ROOT 63529411UL @@ -137,7 +137,7 @@ void clocks_init(void) { CLOCK_DisableClock(kCLOCK_Lpspi1); CLOCK_DisableClock(kCLOCK_Lpspi2); /* Set LPSPI_PODF. */ - CLOCK_SetDiv(kCLOCK_LpspiDiv, 7); + CLOCK_SetDiv(kCLOCK_LpspiDiv, 2); /* Set Lpspi clock source. */ CLOCK_SetMux(kCLOCK_LpspiMux, 1); /* Disable TRACE clock gate. */ From 058a73128cf7b52d6eea9b97e1abeaa369a853f0 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Mon, 18 May 2020 22:29:31 +0200 Subject: [PATCH 604/919] mimxrt10xx: Fix cpu.temperature crash Fixes #2514 --- ports/mimxrt10xx/common-hal/microcontroller/Processor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 0c8131ef40..f3a578014e 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -37,11 +37,13 @@ float common_hal_mcu_processor_get_temperature(void) { tempmon_config_t config; TEMPMON_GetDefaultConfig(&config); + OCOTP_Init(OCOTP, CLOCK_GetFreq(kCLOCK_IpgClk)); TEMPMON_Init(TEMPMON, &config); TEMPMON_StartMeasure(TEMPMON); const float temp = TEMPMON_GetCurrentTemperature(TEMPMON); TEMPMON_Deinit(TEMPMON); + OCOTP_Deinit(OCOTP); return temp; } From 4bbb80e31af4c5626d118995e36ade470935fafe Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Tue, 12 May 2020 21:55:18 -0700 Subject: [PATCH 605/919] vectorio: speed up polygon This change takes polygon from 126k pixels per second fill to 240k pps fill on a reference 5 point star 50x66px polygon, updating both location and shape at 10hz. Tested on an m4 express feather. As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;` fills just shy of 375k pixels per second. --- shared-bindings/vectorio/Polygon.c | 42 +--------------- shared-module/vectorio/Polygon.c | 79 +++++++++++++++++++++++------- shared-module/vectorio/Polygon.h | 5 +- 3 files changed, 65 insertions(+), 61 deletions(-) diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 5f4d85e211..e9e90942a9 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -15,41 +15,6 @@ // #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) -// Converts a list of points tuples to a flat list of ints for speedier internal use. -// Also validates the points. -static mp_obj_t _to_points_list(mp_obj_t points_tuple_list) { - size_t len = 0; - mp_obj_t *items; - mp_obj_list_get(points_tuple_list, &len, &items); - VECTORIO_POLYGON_DEBUG("polygon_points_list len: %d\n", len); - - if ( len == 0 ) { - mp_raise_TypeError_varg(translate("empty %q list"), MP_QSTR_point); - } - - mp_obj_t points_list = mp_obj_new_list(0, NULL); - - for ( size_t i = 0; i < len; ++i) { - size_t tuple_len = 0; - mp_obj_t *tuple_items; - mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); - - if (tuple_len != 2) { - mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); - } - int value; - if (!mp_obj_get_int_maybe(tuple_items[0], &value)) { - mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); - } - mp_obj_list_append(points_list, MP_OBJ_NEW_SMALL_INT(value)); - if (!mp_obj_get_int_maybe(tuple_items[1], &value)) { - mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); - } - mp_obj_list_append(points_list, MP_OBJ_NEW_SMALL_INT(value)); - } - return points_list; -} -//| from typing import List, Tuple //| //| class Polygon: //| def __init__(self, points: List[ Tuple[ x, y ], ... ] ): @@ -68,12 +33,11 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar if (!MP_OBJ_IS_TYPE(args[ARG_points_list].u_obj, &mp_type_list)) { mp_raise_TypeError_varg(translate("%q list must be a list"), MP_QSTR_point); } - mp_obj_t points_list = _to_points_list(args[ARG_points_list].u_obj); vectorio_polygon_t *self = m_new_obj(vectorio_polygon_t); self->base.type = &vectorio_polygon_type; - common_hal_vectorio_polygon_construct(self, points_list); + common_hal_vectorio_polygon_construct(self, args[ARG_points_list].u_obj); return MP_OBJ_FROM_PTR(self); } @@ -104,9 +68,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(vectorio_polygon_get_points_obj, vectorio_polygon_obj_ STATIC mp_obj_t vectorio_polygon_obj_set_points(mp_obj_t self_in, mp_obj_t points) { vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); - mp_obj_t points_list = _to_points_list(points); - - common_hal_vectorio_polygon_set_points(self, points_list); + common_hal_vectorio_polygon_set_points(self, points); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_polygon_set_points_obj, vectorio_polygon_obj_set_points); diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 6722912c2d..7e3a3acfe9 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -4,6 +4,8 @@ #include "shared-module/displayio/area.h" #include "py/runtime.h" +#include "py/gc.h" + #include "stdlib.h" #include @@ -12,10 +14,57 @@ // #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// Converts a list of points tuples to a flat list of ints for speedier internal use. +// Also validates the points. +static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple_list) { + size_t len = 0; + mp_obj_t *items; + mp_obj_list_get(points_tuple_list, &len, &items); + VECTORIO_POLYGON_DEBUG("polygon_points_list len: %d\n", len); + + if ( len < 3 ) { + mp_raise_TypeError_varg(translate("Polygon needs at least 3 points")); + } + + if ( self->len < 2*len ) { + if ( self->points_list != NULL ) { + gc_free( self->points_list ); + } + self->points_list = gc_alloc( 2 * len * sizeof(int), false, false ); + } + self->len = 2*len; + + for ( size_t i = 0; i < len; ++i) { + size_t tuple_len = 0; + mp_obj_t *tuple_items; + mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); + + if (tuple_len != 2) { + mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); + } + if (!mp_obj_get_int_maybe(tuple_items[0], &self->points_list[2*i])) { + self->len = 0; + gc_free( self->points_list ); + self->points_list = NULL; + mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + } + if (!mp_obj_get_int_maybe(tuple_items[1], &self->points_list[2*i + 1])) { + self->len = 0; + gc_free( self->points_list ); + self->points_list = NULL; + mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + } + } +} + + + void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t points_list) { VECTORIO_POLYGON_DEBUG("%p polygon_construct\n", self); - self->points_list = points_list; + self->points_list = NULL; + self->len = 0; self->on_dirty.obj = NULL; + _clobber_points_list( self, points_list ); } @@ -23,7 +72,7 @@ mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self) { return self->points_list; } void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t points_list) { - self->points_list = points_list; + _clobber_points_list( self, points_list ); if (self->on_dirty.obj != NULL) { self->on_dirty.event(self->on_dirty.obj); } @@ -38,21 +87,16 @@ void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio void common_hal_vectorio_polygon_get_area(void *polygon, displayio_area_t *area) { - VECTORIO_POLYGON_DEBUG("%p polygon get_area", polygon); vectorio_polygon_t *self = polygon; - size_t len; - mp_obj_t *points; - mp_obj_list_get(self->points_list, &len, &points); - VECTORIO_POLYGON_DEBUG(" len: %2d, points: %d\n", len, len/2); area->x1 = SHRT_MAX; area->y1 = SHRT_MAX; area->x2 = SHRT_MIN; area->y2 = SHRT_MIN; - for (size_t i=0; i < len; ++i) { - mp_int_t x = mp_obj_get_int(points[i]); + for (size_t i=0; i < self->len; ++i) { + int x = self->points_list[i]; ++i; - mp_int_t y = mp_obj_get_int(points[i]); + int y = self->points_list[i]; if (x <= area->x1) area->x1 = x-1; if (y <= area->y1) area->y1 = y-1; if (x >= area->x2) area->x2 = x+1; @@ -73,22 +117,19 @@ __attribute__((always_inline)) static inline int line_side( mp_int_t x1, mp_int_ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) { VECTORIO_POLYGON_DEBUG("%p polygon get_pixel %d, %d\n", obj, x, y); vectorio_polygon_t *self = obj; - size_t len; - mp_obj_t *points; - mp_obj_list_get(self->points_list, &len, &points); - if (len == 0) { + if (self->len == 0) { return 0; } int winding_number = 0; - mp_int_t x1 = mp_obj_get_int(points[0]); - mp_int_t y1 = mp_obj_get_int(points[1]); - for (size_t i=2; i <= len + 1; ++i) { + int x1 = self->points_list[0]; + int y1 = self->points_list[1]; + for (size_t i=2; i <= self->len + 1; ++i) { VECTORIO_POLYGON_DEBUG(" {(%3d, %3d),", x1, y1); - mp_int_t x2 = mp_obj_get_int(points[i % len]); + int x2 = self->points_list[i % self->len]; ++i; - mp_int_t y2 = mp_obj_get_int(points[i % len]); + int y2 = self->points_list[i % self->len]; VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2); if ( y1 <= y ) { if ( y2 > y && line_side(x1, y1, x2, y2, x, y) > 0 ) { diff --git a/shared-module/vectorio/Polygon.h b/shared-module/vectorio/Polygon.h index 1aef854a7b..70de9036d7 100644 --- a/shared-module/vectorio/Polygon.h +++ b/shared-module/vectorio/Polygon.h @@ -8,8 +8,9 @@ typedef struct { mp_obj_base_t base; - // A micropython List[ x, y, ... ] - mp_obj_t points_list; + // An int array[ x, y, ... ] + int *points_list; + size_t len; vectorio_event_t on_dirty; } vectorio_polygon_t; From dde66cadde44e478d7b11358f768b1debc0b03c7 Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Thu, 14 May 2020 11:44:36 -0700 Subject: [PATCH 606/919] remove a duplication in polygon.c --- shared-bindings/vectorio/Polygon.c | 1 + shared-module/vectorio/Polygon.c | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index e9e90942a9..01045d098f 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -15,6 +15,7 @@ // #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +//| from typing import List, Tuple //| //| class Polygon: //| def __init__(self, points: List[ Tuple[ x, y ], ... ] ): diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 7e3a3acfe9..aadf47911a 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -42,13 +42,9 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple if (tuple_len != 2) { mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); } - if (!mp_obj_get_int_maybe(tuple_items[0], &self->points_list[2*i])) { - self->len = 0; - gc_free( self->points_list ); - self->points_list = NULL; - mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); - } - if (!mp_obj_get_int_maybe(tuple_items[1], &self->points_list[2*i + 1])) { + if ( !mp_obj_get_int_maybe(tuple_items[ 0 ], &self->points_list[2*i ]) + || !mp_obj_get_int_maybe(tuple_items[ 1 ], &self->points_list[2*i + 1]) + ) { self->len = 0; gc_free( self->points_list ); self->points_list = NULL; From a78f245ea649c2bf67e2748d068b531b352cc4aa Mon Sep 17 00:00:00 2001 From: warriorofwire <3454741+WarriorOfWire@users.noreply.github.com> Date: Mon, 18 May 2020 13:33:16 -0700 Subject: [PATCH 607/919] translations for polygon --- locale/ID.po | 16 ++++++++-------- locale/circuitpython.pot | 16 ++++++++-------- locale/cs.po | 16 ++++++++-------- locale/de_DE.po | 16 ++++++++-------- locale/en_US.po | 16 ++++++++-------- locale/en_x_pirate.po | 16 ++++++++-------- locale/es.po | 16 ++++++++-------- locale/fil.po | 16 ++++++++-------- locale/fr.po | 29 +++++++++++++++++------------ locale/it_IT.po | 16 ++++++++-------- locale/ko.po | 16 ++++++++-------- locale/pl.po | 16 ++++++++-------- locale/pt_BR.po | 16 ++++++++-------- locale/sv.po | 26 +++++++++++++++----------- locale/zh_Latn_pinyin.po | 16 ++++++++-------- 15 files changed, 136 insertions(+), 127 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e4420f046f..9c1c3b9bf9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,7 +82,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "buffers harus mempunyai panjang yang sama" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1269,6 +1269,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Tambahkan module apapun pada filesystem\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2137,10 +2141,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap kosong" @@ -3158,8 +3158,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d1f4978059..5654256464 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -81,7 +81,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1257,6 +1257,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2113,10 +2117,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3132,8 +3132,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 493245dbfc..7f02e5215d 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -81,7 +81,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1257,6 +1257,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2113,10 +2117,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3132,8 +3132,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d90c49bf23..d81570b70f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German = 1" msgstr "%q muss >= 1 sein" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" @@ -1279,6 +1279,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "und alle Module im Dateisystem \n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2149,10 +2153,6 @@ msgstr "Division durch Null" msgid "empty" msgstr "leer" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "leerer heap" @@ -3184,8 +3184,8 @@ msgstr "" msgid "unreadable attribute" msgstr "nicht lesbares Attribut" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "Nicht unterstützter %q-Typ" diff --git a/locale/en_US.po b/locale/en_US.po index d18ea18083..9e07d2bf22 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -81,7 +81,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1257,6 +1257,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2113,10 +2117,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3132,8 +3132,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 6515beaf9f..8737a3d8d6 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English = 1" msgstr "" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1266,6 +1266,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2122,10 +2126,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3141,8 +3141,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/es.po b/locale/es.po index 60a8af0599..6b904200b3 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" @@ -84,7 +84,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "%q debe ser >= 1" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1273,6 +1273,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Incapaz de montar de nuevo el sistema de archivos" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Pop de un buffer Ps2 vacio" @@ -2146,10 +2150,6 @@ msgstr "división por cero" msgid "empty" msgstr "vacío" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vacío" @@ -3175,8 +3175,8 @@ msgstr "No coinciden '{' en format" msgid "unreadable attribute" msgstr "atributo no legible" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "tipo de %q no soportado" diff --git a/locale/fil.po b/locale/fil.po index 2dd773eef0..b9af70d854 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -82,7 +82,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "aarehas na haba dapat ang buffer slices" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1277,6 +1277,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Kasama ang kung ano pang modules na sa filesystem\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2157,10 +2161,6 @@ msgstr "dibisyon ng zero" msgid "empty" msgstr "walang laman" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "walang laman ang heap" @@ -3188,8 +3188,8 @@ msgstr "hindi tugma ang '{' sa format" msgid "unreadable attribute" msgstr "hindi mabasa ang attribute" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "Hindi supportadong tipo ng %q" diff --git a/locale/fr.po b/locale/fr.po index 4958ee7452..820bd9375a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French = 1" msgstr "%q doit être >=1" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "%q doit être un tuple de longueur 2" @@ -534,7 +534,8 @@ msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "Impossible de faire varier la fréquence sur une minuterie déjà utilisée" +msgstr "" +"Impossible de faire varier la fréquence sur une minuterie déjà utilisée" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -1293,13 +1294,17 @@ msgid "" "constructor" msgstr "" "Le brochage utilise %d octets par élément, ce qui consomme plus que le %d " -"octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient =" -" True au constructeur" +"octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient " +"= True au constructeur" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Pop à partir d'un tampon Ps2 vide" @@ -2063,7 +2068,8 @@ msgstr "ne peut pas réaliser un import relatif" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "ne peut pas remodeler le tableau (forme d'entrée / sortie incompatible)" +msgstr "" +"ne peut pas remodeler le tableau (forme d'entrée / sortie incompatible)" #: py/emitnative.c msgid "casting" @@ -2191,10 +2197,6 @@ msgstr "division par zéro" msgid "empty" msgstr "vide" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "liste %q vide" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tas vide" @@ -3226,8 +3228,8 @@ msgstr "'{' sans correspondance dans le format" msgid "unreadable attribute" msgstr "attribut illisible" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "type %q non pris on charge" @@ -3701,6 +3703,9 @@ msgstr "'step' nul" #~ msgid "either pos or kw args are allowed" #~ msgstr "soit 'pos', soit 'kw' est permis en argument" +#~ msgid "empty %q list" +#~ msgstr "liste %q vide" + #~ msgid "expected a DigitalInOut" #~ msgstr "objet DigitalInOut attendu" diff --git a/locale/it_IT.po b/locale/it_IT.po index 61de76f544..44c5cccbad 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -82,7 +82,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "slice del buffer devono essere della stessa lunghezza" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1287,6 +1287,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Imposssibile rimontare il filesystem" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2158,10 +2162,6 @@ msgstr "divisione per zero" msgid "empty" msgstr "vuoto" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vuoto" @@ -3195,8 +3195,8 @@ msgstr "'{' spaiato nella stringa di formattazione" msgid "unreadable attribute" msgstr "attributo non leggibile" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "tipo di %q non supportato" diff --git a/locale/ko.po b/locale/ko.po index e6e386b304..ac2a75a9e4 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -83,7 +83,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "%q 는 >=1이어야합니다" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1261,6 +1261,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2118,10 +2122,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3137,8 +3137,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 962c090054..f872b28ba6 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -82,7 +82,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "%q musi być >= 1" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1262,6 +1262,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Oraz moduły w systemie plików\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "" @@ -2122,10 +2126,6 @@ msgstr "dzielenie przez zero" msgid "empty" msgstr "puste" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "pusta sterta" @@ -3143,8 +3143,8 @@ msgstr "niepasujące '{' for formacie" msgid "unreadable attribute" msgstr "nieczytelny atrybut" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "zły typ %q" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e18355fa3e..a376fdf063 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -82,7 +82,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "buffers devem ser o mesmo tamanho" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1273,6 +1273,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Não é possível remontar o sistema de arquivos" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Buffer Ps2 vazio" @@ -2134,10 +2138,6 @@ msgstr "divisão por zero" msgid "empty" msgstr "vazio" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vazia" @@ -3156,8 +3156,8 @@ msgstr "" msgid "unreadable attribute" msgstr "atributo ilegível" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 8d64d4b7b5..34927a2516 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -89,7 +89,7 @@ msgstr "%q-listan måste vara en lista" msgid "%q must be >= 1" msgstr "%q måste vara >= 1" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "%q måste vara en tuple av längd 2" @@ -1067,7 +1067,8 @@ msgstr "MicroPython fatalt fel." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "Startfördröjningen för mikrofonen måste vara i intervallet 0,0 till 1,0" +msgstr "" +"Startfördröjningen för mikrofonen måste vara i intervallet 0,0 till 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" @@ -1278,14 +1279,18 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -"Pinout använder %d byte per element, vilket förbrukar mer än det idealiska %" -"d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till " +"Pinout använder %d byte per element, vilket förbrukar mer än det idealiska " +"%d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till " "konstruktorn" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" msgstr "Plus eventuella moduler i filsystemet\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Pop från en tom Ps2-buffert" @@ -2163,10 +2168,6 @@ msgstr "division med noll" msgid "empty" msgstr "tom" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "tom %q-lista" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tom heap" @@ -3188,8 +3189,8 @@ msgstr "omatchad '{' i format" msgid "unreadable attribute" msgstr "attribut kan inte läsas" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "typ %q stöds inte" @@ -3268,3 +3269,6 @@ msgstr "y-värde utanför intervall" #: py/objrange.c msgid "zero step" msgstr "noll steg" + +#~ msgid "empty %q list" +#~ msgstr "tom %q-lista" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9d0bd392d8..e2247c79d9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-18 13:32-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -88,7 +88,7 @@ msgstr "" msgid "%q must be >= 1" msgstr "%q bìxū dàyú huò děngyú 1" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" @@ -1276,6 +1276,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Cóng kōng de Ps2 huǎnchōng qū dànchū" @@ -2150,10 +2154,6 @@ msgstr "bèi líng chú" msgid "empty" msgstr "kòngxián" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "kōng yīn yīnxiào" @@ -3173,8 +3173,8 @@ msgstr "géshì wèi pǐpèi '{'" msgid "unreadable attribute" msgstr "bùkě dú shǔxìng" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "bù zhīchí %q lèixíng" From cf524cb6b19dc971610452986f1ce8d1001d9d7e Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Mon, 18 May 2020 18:59:14 -0400 Subject: [PATCH 608/919] extract_pyi no longer raises a TypeError for missing types --- tools/extract_pyi.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index d6309212a0..7c664d9653 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -64,18 +64,16 @@ for module in modules: if j.returns: if 'Any' in j.returns.__dict__.values(): a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" - if a: - raise TypeError(a) elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: - raise TypeError(f"missing attribute type on line {j.__dict__['lineno']}") + a = f"missing attribute type on line {j.__dict__['lineno']}" + if a: + print(a) ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - except TypeError as err: - print(err) print(f"{ok} ok out of {total}") From 1e9436519b39efbe0e0e48e3725eebb4cea41feb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 18 May 2020 16:07:07 -0700 Subject: [PATCH 609/919] Fix ReadTheDocs after switching to stubs + autoapi. --- conf.py | 2 ++ docs/requirements.txt | 2 ++ requirements-dev.txt | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 requirements-dev.txt diff --git a/conf.py b/conf.py index d6fa8f7e50..c36ba86479 100644 --- a/conf.py +++ b/conf.py @@ -18,6 +18,7 @@ import sys import os import recommonmark +import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -67,6 +68,7 @@ source_suffix = { '.md': 'markdown', } +subprocess.check_output(["make", "stubs"]) extensions.append('autoapi.extension') autoapi_type = 'python' diff --git a/docs/requirements.txt b/docs/requirements.txt index 9edf6d328d..f2ec24c2ea 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,5 @@ sphinx==1.8.5 recommonmark==0.5.0 sphinxcontrib-svg2pdfconverter==0.1.0 +astroid +sphinx-autoapi diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 7cd491adef..0000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1 +0,0 @@ -rst2pyi>=0.3.0 From 007c92ee6ab8da342dacb8967ef999b6d83596ec Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Mon, 18 May 2020 14:04:55 +0200 Subject: [PATCH 610/919] Enable showing the console on a debug uart --- main.c | 3 ++ ports/atmel-samd/common-hal/busio/UART.c | 3 +- ports/cxd56/common-hal/busio/UART.c | 3 +- ports/mimxrt10xx/common-hal/busio/UART.c | 3 +- ports/nrf/common-hal/busio/UART.c | 3 +- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 3 ++ ports/stm/boards/nucleo_f746zg/pins.c | 5 +- ports/stm/common-hal/busio/UART.c | 52 ++++++++++++++++--- ports/stm/common-hal/busio/UART.h | 2 + shared-bindings/busio/UART.c | 2 +- shared-bindings/busio/UART.h | 6 ++- shared-module/board/__init__.c | 2 +- supervisor/serial.h | 1 + supervisor/shared/serial.c | 52 +++++++++++++++++++ supervisor/stub/serial.c | 4 ++ 15 files changed, 128 insertions(+), 16 deletions(-) diff --git a/main.c b/main.c index c60cded165..a3bf49fc31 100755 --- a/main.c +++ b/main.c @@ -430,6 +430,9 @@ int __attribute__((used)) main(void) { // displays init after filesystem, since they could share the flash SPI board_init(); + // Start the debug serial + serial_early_init(); + // Reset everything and prep MicroPython to run boot.py. reset_port(); reset_board(); diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 1f6b75f972..30a618cca6 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -56,7 +56,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { Sercom* sercom = NULL; uint8_t sercom_index = 255; // Unset index diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 3bca240e01..e455b0568d 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -57,7 +57,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { struct termios tio; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index e3642daf59..fbb45eeea4 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -76,7 +76,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { // TODO: Allow none rx or tx diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index dbf40ea516..89f3c9f327 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -134,7 +134,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 1d86149193..b1abd140fa 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -34,3 +34,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) + +#define DEBUG_UART_TX (&pin_PD08) +#define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f746zg/pins.c b/ports/stm/boards/nucleo_f746zg/pins.c index 56b6a745f9..7c6a075e23 100644 --- a/ports/stm/boards/nucleo_f746zg/pins.c +++ b/ports/stm/boards/nucleo_f746zg/pins.c @@ -58,8 +58,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_USB_ID), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, -{ MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PD08) }, -{ MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PD09) }, +// As we use these for the debug_console, we won't enable them here. +// { MP_ROM_QSTR(MP_QSTR_VCP_TX), MP_ROM_PTR(&pin_PD08) }, +// { MP_ROM_QSTR(MP_QSTR_VCP_RX), MP_ROM_PTR(&pin_PD09) }, { MP_ROM_QSTR(MP_QSTR_UART2_TX), MP_ROM_PTR(&pin_PD05) }, { MP_ROM_QSTR(MP_QSTR_UART2_RX), MP_ROM_PTR(&pin_PD06) }, { MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_PD04) }, diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 54ac68d738..c83479126a 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -28,6 +28,7 @@ #include "shared-bindings/busio/UART.h" #include "mpconfigport.h" +#include "lib/mp-readline/readline.h" #include "lib/utils/interrupt_char.h" #include "py/gc.h" #include "py/mperrno.h" @@ -39,6 +40,7 @@ //arrays use 0 based numbering: UART1 is stored at index 0 STATIC bool reserved_uart[MAX_UART]; +STATIC bool never_reset_uart[MAX_UART]; int errflag; //Used to restart read halts STATIC void uart_clock_enable(uint16_t mask); @@ -61,11 +63,16 @@ STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eva } void uart_reset(void) { + uint16_t never_reset_mask = 0x00; for (uint8_t i = 0; i < MAX_UART; i++) { - reserved_uart[i] = false; - MP_STATE_PORT(cpy_uart_obj_all)[i] = NULL; + if (!never_reset_uart[i]) { + reserved_uart[i] = false; + MP_STATE_PORT(cpy_uart_obj_all)[i] = NULL; + } else { + never_reset_mask |= 1 << i; + } } - uart_clock_disable(ALL_UARTS); + uart_clock_disable(ALL_UARTS & ~(never_reset_mask)); } void common_hal_busio_uart_construct(busio_uart_obj_t *self, @@ -73,7 +80,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size) { + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { //match pins to UART objects USART_TypeDef * USARTx; @@ -209,8 +217,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Init buffer for rx and claim pins if (self->rx != NULL) { - if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_ValueError(translate("UART Buffer allocation error")); + if (receiver_buffer != NULL) { + self->ringbuf = (ringbuf_t){ receiver_buffer, receiver_buffer_size }; + } else { + if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { + mp_raise_ValueError(translate("UART Buffer allocation error")); + } } claim_pin(rx); } @@ -219,6 +231,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } self->baudrate = baudrate; self->timeout_ms = timeout * 1000; + self->sigint_enabled = sigint_enabled; //start the interrupt series if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { @@ -234,6 +247,17 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, errflag = HAL_OK; } +void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { + for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_uart_banks); i++) { + if (mcu_uart_banks[i] == self->handle.Instance) { + never_reset_uart[i] = true; + never_reset_pin_number(self->tx->pin->port, self->tx->pin->number); + never_reset_pin_number(self->rx->pin->port, self->rx->pin->number); + break; + } + } +} + bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { return self->tx->pin == NULL; } @@ -241,6 +265,13 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) return; + for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_uart_banks); i++) { + if (mcu_uart_banks[i] == self->handle.Instance) { + never_reset_uart[i] = false; + break; + } + } + reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = NULL; @@ -289,7 +320,8 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, bool write_err = false; //write error shouldn't disable interrupts HAL_NVIC_DisableIRQ(self->irq); - if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, HAL_MAX_DELAY) != HAL_OK) { + HAL_StatusTypeDef ret = HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, HAL_MAX_DELAY); + if (ret != HAL_OK) { write_err = true; } HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); @@ -313,6 +345,12 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) } ringbuf_put_n(&context->ringbuf, &context->rx_char, 1); errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); + if (context->sigint_enabled) { + if (context->rx_char == CHAR_CTRL_C) { + common_hal_busio_uart_clear_rx_buffer(context); + mp_keyboard_interrupt(); + } + } return; } diff --git a/ports/stm/common-hal/busio/UART.h b/ports/stm/common-hal/busio/UART.h index d1971ce27a..a6a69a5922 100644 --- a/ports/stm/common-hal/busio/UART.h +++ b/ports/stm/common-hal/busio/UART.h @@ -52,6 +52,8 @@ typedef struct { uint32_t baudrate; uint32_t timeout_ms; + + bool sigint_enabled; } busio_uart_obj_t; void uart_reset(void); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index f231924d50..a448abb780 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -140,7 +140,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, args[ARG_baudrate].u_int, bits, parity, stop, timeout, - args[ARG_receiver_buffer_size].u_int); + args[ARG_receiver_buffer_size].u_int, NULL, false); return (mp_obj_t)self; } diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h index fe71e86689..3aed4e534c 100644 --- a/shared-bindings/busio/UART.h +++ b/shared-bindings/busio/UART.h @@ -29,6 +29,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/busio/UART.h" +#include "py/ringbuf.h" extern const mp_obj_type_t busio_uart_type; @@ -44,7 +45,8 @@ extern void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, - mp_float_t timeout, uint16_t receiver_buffer_size); + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled); extern void common_hal_busio_uart_deinit(busio_uart_obj_t *self); extern bool common_hal_busio_uart_deinited(busio_uart_obj_t *self); @@ -66,4 +68,6 @@ extern uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t * extern void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self); extern bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self); +extern void common_hal_busio_uart_never_reset(busio_uart_obj_t *self); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_UART_H diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 789318a053..0fbf916cd9 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -123,7 +123,7 @@ mp_obj_t common_hal_board_create_uart(void) { #endif common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, - 9600, 8, PARITY_NONE, 1, 1.0f, 64); + 9600, 8, PARITY_NONE, 1, 1.0f, 64, NULL, false); MP_STATE_VM(shared_uart_bus) = MP_OBJ_FROM_PTR(self); return MP_STATE_VM(shared_uart_bus); } diff --git a/supervisor/serial.h b/supervisor/serial.h index 84b3062a3b..ef88ad346d 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -38,6 +38,7 @@ FIL* boot_output_file; #endif +void serial_early_init(void); void serial_init(void); void serial_write(const char* text); // Only writes up to given length. Does not check for null termination at all. diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index a61899576f..513022667a 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -32,26 +32,73 @@ #include "shared-bindings/terminalio/Terminal.h" #include "supervisor/serial.h" #include "supervisor/usb.h" +#include "shared-bindings/microcontroller/Pin.h" #include "tusb.h" +/* + * Note: DEBUG_UART currently only works on STM32, + * enabling on another platform will cause a crash. + */ + +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) +#include "shared-bindings/busio/UART.h" +busio_uart_obj_t debug_uart; +byte buf_array[64]; +#endif + +void serial_early_init(void) { +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) + debug_uart.base.type = &busio_uart_type; + + const mcu_pin_obj_t* rx = MP_OBJ_TO_PTR(DEBUG_UART_RX); + const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(DEBUG_UART_TX); + + common_hal_busio_uart_construct(&debug_uart, tx, rx, NULL, NULL, NULL, + false, 115200, 8, PARITY_NONE, 1, 1.0f, 64, + buf_array, true); + common_hal_busio_uart_never_reset(&debug_uart); +#endif +} + void serial_init(void) { usb_init(); } bool serial_connected(void) { +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) + return true; +#else return tud_cdc_connected(); +#endif } char serial_read(void) { +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) + if (tud_cdc_connected() && tud_cdc_available() > 0) { + return (char) tud_cdc_read_char(); + } + int uart_errcode; + char text; + common_hal_busio_uart_read(&debug_uart, (uint8_t*) &text, 1, &uart_errcode); + return text; +#else return (char) tud_cdc_read_char(); +#endif } bool serial_bytes_available(void) { +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) + return common_hal_busio_uart_rx_characters_available(&debug_uart) || (tud_cdc_available() > 0); +#else return tud_cdc_available() > 0; +#endif } void serial_write_substring(const char* text, uint32_t length) { + if (length == 0) { + return; + } #if CIRCUITPY_DISPLAYIO int errcode; common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t*) text, length, &errcode); @@ -62,6 +109,11 @@ void serial_write_substring(const char* text, uint32_t length) { count += tud_cdc_write(text + count, length - count); usb_background(); } + +#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX) + int uart_errcode; + common_hal_busio_uart_write(&debug_uart, (const uint8_t*) text, length, &uart_errcode); +#endif } void serial_write(const char* text) { diff --git a/supervisor/stub/serial.c b/supervisor/stub/serial.c index 9565519141..34b433e536 100644 --- a/supervisor/stub/serial.c +++ b/supervisor/stub/serial.c @@ -26,6 +26,10 @@ #include "supervisor/serial.h" +void serial_early_init(void) { + +} + void serial_init(void) { } From 164628282d4128c094c3f1c0f0faf67c74f84801 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 18 May 2020 17:27:49 -0700 Subject: [PATCH 611/919] Update TinyUSB and shorten USB task delay --- lib/tinyusb | 2 +- ports/esp32s2/supervisor/usb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tinyusb b/lib/tinyusb index a74a823b0a..76bf96bcb0 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit a74a823b0a140667a4e4e80fa2678870faba2bd0 +Subproject commit 76bf96bcb0c12ba241ee4ecc175afb257e550d19 diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 7a24a90cb9..7c508485e4 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -59,7 +59,7 @@ void usb_device_task(void* param) tud_task(); tud_cdc_write_flush(); } - vTaskDelay(10); + vTaskDelay(1); } } From 03b6f7b87b8713af4f52d8d97898dd62937319e6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 18 May 2020 17:28:13 -0700 Subject: [PATCH 612/919] Add commend about FreeRTOS stack canary --- ports/esp32s2/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 6fe805811d..be4b2f00fd 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -91,6 +91,7 @@ CFLAGS += -DHAVE_CONFIG_H \ -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX # Make our canary value match FreeRTOS's +# This define is in FreeRTOS as tskSTACK_FILL_BYTE 0xa5U which we expand out to a full word. CFLAGS += -DSTACK_CANARY_VALUE=0xa5a5a5a5 #Debugging/Optimization From cfe65742a376652be0b44ff93d47f407a9db8bf9 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 17 May 2020 22:06:21 +0800 Subject: [PATCH 613/919] _bleio: support anonymous advertising Add a new parameter to the `start_advertising()` function to enable anonymous advertising. This forces a call to `sd_ble_gap_privacy_set()` with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and `private_addr_type` set to `BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`. With this, addresses will cycle at a predefined rate (currently once every 15 minutes). Signed-off-by: Sean Cross --- ports/nrf/common-hal/_bleio/Adapter.c | 30 ++++++++++++++++++++++----- shared-bindings/_bleio/Adapter.c | 7 +++++-- shared-bindings/_bleio/Adapter.h | 4 ++-- supervisor/shared/bluetooth.c | 1 + 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 36c79e88ec..a1a2f6c3e1 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -594,7 +594,7 @@ STATIC void check_data_fit(size_t data_len, bool connectable) { } } -uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { +uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { return NRF_ERROR_BUSY; } @@ -605,7 +605,7 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, common_hal_bleio_adapter_stop_advertising(self); } - + uint32_t err_code; bool extended = advertising_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX || scan_response_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX; @@ -626,7 +626,27 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; } - uint32_t err_code; + if (anonymous) { + ble_gap_privacy_params_t privacy = { + .privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY, + .private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, + .private_addr_cycle_s = 0, + .p_device_irk = NULL, + }; + err_code = sd_ble_gap_privacy_set(&privacy); + } else { + ble_gap_privacy_params_t privacy = { + .privacy_mode = BLE_GAP_PRIVACY_MODE_OFF, + .private_addr_type = BLE_GAP_ADDR_TYPE_PUBLIC, + .private_addr_cycle_s = 0, + .p_device_irk = NULL, + }; + err_code = sd_ble_gap_privacy_set(&privacy); + } + if (err_code != NRF_SUCCESS) { + return err_code; + } + ble_gap_adv_params_t adv_params = { .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), .properties.type = adv_type, @@ -657,7 +677,7 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, } -void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { +void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { mp_raise_bleio_BluetoothError(translate("Already advertising.")); } @@ -681,7 +701,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); - check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, interval, + check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, interval, self->advertising_data, advertising_data_bufinfo->len, self->scan_response_data, diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 4816294f7f..e602e2ea12 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -145,17 +145,19 @@ const mp_obj_property_t bleio_adapter_name_obj = { //| :param buf data: advertising data packet bytes //| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. //| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. +//| :param bool anonymous: If `True` then this device's MAC address is randomized regularly. //| :param float interval: advertising interval, in seconds""" //| ... //| STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_data, ARG_scan_response, ARG_connectable, ARG_interval }; + enum { ARG_data, ARG_scan_response, ARG_connectable, ARG_anonymous, ARG_interval }; static const mp_arg_t allowed_args[] = { { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_scan_response, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_connectable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, + { MP_QSTR_anonymous, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_interval, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, }; @@ -182,11 +184,12 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t } bool connectable = args[ARG_connectable].u_bool; + bool anonymous = args[ARG_anonymous].u_bool; if (data_bufinfo.len > 31 && connectable && scan_response_bufinfo.len > 0) { mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements.")); } - common_hal_bleio_adapter_start_advertising(self, connectable, interval, + common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, interval, &data_bufinfo, &scan_response_bufinfo); return mp_const_none; diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 9b20a461a8..30d8763408 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -45,9 +45,9 @@ extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_o extern mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); -extern uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); +extern uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); -extern void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); +extern void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); extern void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self); extern mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active); diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index b463160cf5..6b1c03fc0b 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -74,6 +74,7 @@ void supervisor_bluetooth_start_advertising(void) { // TODO: switch to Adafruit short UUID for the advertisement and add manufacturing data to distinguish ourselves from arduino. _common_hal_bleio_adapter_start_advertising(&common_hal_bleio_adapter_obj, true, + false, 1.0, circuitpython_advertising_data, sizeof(circuitpython_advertising_data), From 34f91f01c6691908e024eba07b7f0eff187a693a Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 19 May 2020 14:56:04 +0800 Subject: [PATCH 614/919] bleio: adapter: add advertising timeout and status Add a field to allow specifying a timeout when initiating advertising. As part of this, add a new property to determine if the device is still advertising. Additionally, have the `anonymous` property require a timeout, and set the timeout to the maximum possible value if no timeout is specified. Signed-off-by: Sean Cross --- ports/nrf/common-hal/_bleio/Adapter.c | 61 ++++++++++++++++++++++++--- shared-bindings/_bleio/Adapter.c | 31 ++++++++++++-- shared-bindings/_bleio/Adapter.h | 5 ++- supervisor/shared/bluetooth.c | 2 +- 4 files changed, 87 insertions(+), 12 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index a1a2f6c3e1..83cd3bc1b2 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -26,6 +26,7 @@ * THE SOFTWARE. */ +#include #include #include #include @@ -594,7 +595,26 @@ STATIC void check_data_fit(size_t data_len, bool connectable) { } } -uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { +STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { + bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in; + + switch (ble_evt->header.evt_id) { + case BLE_GAP_EVT_ADV_SET_TERMINATED: + mp_printf(&mp_plat_print, "Advertising set terminated - %d advertising events were completed - reason: %d\n", ble_evt->evt.gap_evt.params.adv_set_terminated.num_completed_adv_events, ble_evt->evt.gap_evt.params.adv_set_terminated.reason); + common_hal_bleio_adapter_stop_advertising(self); + ble_drv_remove_event_handler(advertising_on_ble_evt, self_in); + break; + + default: + // For debugging. + mp_printf(&mp_plat_print, "Unhandled Advertising etvent: 0x%04x\n", ble_evt->header.evt_id); + return false; + break; + } + return true; +} + +uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len) { if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { return NRF_ERROR_BUSY; } @@ -630,7 +650,11 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, ble_gap_privacy_params_t privacy = { .privacy_mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY, .private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, - .private_addr_cycle_s = 0, + // Rotate the keys one second after we're scheduled to stop + // advertising. This prevents a potential race condition where we + // fire off a beacon with the same advertising data but a new MAC + // address just as we tear down the connection. + .private_addr_cycle_s = timeout + 1, .p_device_irk = NULL, }; err_code = sd_ble_gap_privacy_set(&privacy); @@ -650,7 +674,7 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, ble_gap_adv_params_t adv_params = { .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), .properties.type = adv_type, - .duration = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED, + .duration = SEC_TO_UNITS(timeout, UNIT_10_MS), .filter_policy = BLE_GAP_ADV_FP_ANY, .primary_phy = BLE_GAP_PHY_1MBPS, }; @@ -667,6 +691,8 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, return err_code; } + ble_drv_add_event_handler(advertising_on_ble_evt, self); + vm_used_ble = true; err_code = sd_ble_gap_adv_start(adv_handle, BLE_CONN_CFG_TAG_CUSTOM); if (err_code != NRF_SUCCESS) { @@ -677,7 +703,7 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, } -void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { +void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { mp_raise_bleio_BluetoothError(translate("Already advertising.")); } @@ -689,6 +715,27 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool if (advertising_data_bufinfo->len > 31 && scan_response_data_bufinfo->len > 0) { mp_raise_bleio_BluetoothError(translate("Extended advertisements with scan response not supported.")); } + + // Anonymous mode requires a timeout so that we don't continue to broadcast + // the same data while cycling the MAC address -- otherwise, what's the + // point of randomizing the MAC address? + if (!timeout) { + if (anonymous) { + // The Nordic macro is in units of 10ms. Convert to seconds. + uint32_t adv_timeout_max_secs = BLE_GAP_ADV_TIMEOUT_LIMITED_MAX / 100; + uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; + timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); + } + else { + timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED; + } + } else { + if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { + mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), + BLE_GAP_ADV_TIMEOUT_LIMITED_MAX / 100); + } + } + // The advertising data buffers must not move, because the SoftDevice depends on them. // So make them long-lived and reuse them onwards. if (self->advertising_data == NULL) { @@ -701,7 +748,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); - check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, interval, + check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, timeout, interval, self->advertising_data, advertising_data_bufinfo->len, self->scan_response_data, @@ -721,6 +768,10 @@ void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { } } +bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self) { + return self->current_advertising_data != NULL; +} + bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self) { for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { bleio_connection_internal_t *connection = &bleio_connections[i]; diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index e602e2ea12..13acb9d3cf 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -135,29 +135,34 @@ const mp_obj_property_t bleio_adapter_name_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, interval: float = 0.1) -> Any: +//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> Any: //| """Starts advertising until `stop_advertising` is called or if connectable, another device //| connects to us. //| //| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an //| extended advertisement that older BLE 4.x clients won't be able to scan for. //| +//| .. note: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is +//| specified, then the maximum allowed timeout will be selected automatically. +//| //| :param buf data: advertising data packet bytes //| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. //| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. -//| :param bool anonymous: If `True` then this device's MAC address is randomized regularly. +//| :param bool anonymous: If `True` then this device's MAC address is randomized before advertising. +//| :param int timeout: If set, we will only advertise for this many seconds. //| :param float interval: advertising interval, in seconds""" //| ... //| STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_data, ARG_scan_response, ARG_connectable, ARG_anonymous, ARG_interval }; + enum { ARG_data, ARG_scan_response, ARG_connectable, ARG_anonymous, ARG_timeout, ARG_interval }; static const mp_arg_t allowed_args[] = { { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_scan_response, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_connectable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_anonymous, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_interval, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, }; @@ -185,11 +190,12 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t bool connectable = args[ARG_connectable].u_bool; bool anonymous = args[ARG_anonymous].u_bool; + uint32_t timeout = args[ARG_timeout].u_int; if (data_bufinfo.len > 31 && connectable && scan_response_bufinfo.len > 0) { mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements.")); } - common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, interval, + common_hal_bleio_adapter_start_advertising(self, connectable, anonymous, timeout, interval, &data_bufinfo, &scan_response_bufinfo); return mp_const_none; @@ -295,6 +301,22 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_scan_obj, bleio_adapter_stop_scan); +//| advertising: Any = ... +//| """True when the adapter is currently advertising. (read-only)""" +//| +STATIC mp_obj_t bleio_adapter_get_advertising(mp_obj_t self) { + return mp_obj_new_bool(common_hal_bleio_adapter_get_advertising(self)); + +} +MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_advertising_obj, bleio_adapter_get_advertising); + +const mp_obj_property_t bleio_adapter_advertising_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_adapter_get_advertising_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + //| connected: Any = ... //| """True when the adapter is connected to another device regardless of who initiated the //| connection. (read-only)""" @@ -378,6 +400,7 @@ STATIC const mp_rom_map_elem_t bleio_adapter_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_start_advertising), MP_ROM_PTR(&bleio_adapter_start_advertising_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_advertising), MP_ROM_PTR(&bleio_adapter_stop_advertising_obj) }, + { MP_ROM_QSTR(MP_QSTR_advertising), MP_ROM_PTR(&bleio_adapter_advertising_obj) }, { MP_ROM_QSTR(MP_QSTR_start_scan), MP_ROM_PTR(&bleio_adapter_start_scan_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_scan), MP_ROM_PTR(&bleio_adapter_stop_scan_obj) }, diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 30d8763408..39147b6ebc 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -37,6 +37,7 @@ const mp_obj_type_t bleio_adapter_type; +extern bool common_hal_bleio_adapter_get_advertising(bleio_adapter_obj_t *self); extern bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enabled); extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); @@ -45,9 +46,9 @@ extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_o extern mp_obj_str_t* common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char* name); -extern uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); +extern uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len); -extern void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); +extern void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo); extern void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self); extern mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active); diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index 6b1c03fc0b..98d0fab38e 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -74,7 +74,7 @@ void supervisor_bluetooth_start_advertising(void) { // TODO: switch to Adafruit short UUID for the advertisement and add manufacturing data to distinguish ourselves from arduino. _common_hal_bleio_adapter_start_advertising(&common_hal_bleio_adapter_obj, true, - false, + false, 0, 1.0, circuitpython_advertising_data, sizeof(circuitpython_advertising_data), From f56188c2616a399a2db07b3d964f1cbc23051d3a Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 19 May 2020 15:01:38 +0800 Subject: [PATCH 615/919] locale: regenerate translations for new bleio msg There is now an adapter timeout message. Signed-off-by: Sean Cross --- locale/ID.po | 7 ++++++- locale/circuitpython.pot | 7 ++++++- locale/cs.po | 7 ++++++- locale/de_DE.po | 7 ++++++- locale/en_US.po | 7 ++++++- locale/en_x_pirate.po | 7 ++++++- locale/es.po | 7 ++++++- locale/fil.po | 7 ++++++- locale/fr.po | 7 ++++++- locale/it_IT.po | 7 ++++++- locale/ko.po | 7 ++++++- locale/pl.po | 7 ++++++- locale/pt_BR.po | 7 ++++++- locale/sv.po | 7 ++++++- locale/zh_Latn_pinyin.po | 7 ++++++- 15 files changed, 90 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9c1c3b9bf9..2bbd602dfb 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1489,6 +1489,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5654256464..7e80e5c9d6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1473,6 +1473,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7f02e5215d..0537ca14bd 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1473,6 +1473,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d81570b70f..5bbfd9d403 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -1491,6 +1491,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." diff --git a/locale/fil.po b/locale/fil.po index b9af70d854..b05247f43a 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1496,6 +1496,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." diff --git a/locale/fr.po b/locale/fr.po index 820bd9375a..481b20604e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -1507,6 +1507,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/ko.po b/locale/ko.po index ac2a75a9e4..19aad3b9dc 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1477,6 +1477,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" diff --git a/locale/pl.po b/locale/pl.po index f872b28ba6..212bbba352 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1478,6 +1478,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a376fdf063..8a2c9e92ed 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1490,6 +1490,11 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." diff --git a/locale/sv.po b/locale/sv.po index 34927a2516..25ed8009fb 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -1512,6 +1512,11 @@ msgstr "Tile-värde utanför intervall" msgid "Tile width must exactly divide bitmap width" msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e2247c79d9..00a131bbbc 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1499,6 +1499,11 @@ msgstr "Píng pū zhí chāochū fànwéi" msgid "Tile width must exactly divide bitmap width" msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." From c1bcc25b88ff76dcbd7e365b3e9be7a94806f66b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 19 May 2020 21:03:56 +0800 Subject: [PATCH 616/919] nrf: _bleio: clean up timeout calculation The timeout value is calculated by the common-hal layer now, so we don't need to be quite so clever about calculating it here. Signed-off-by: Sean Cross --- ports/nrf/bluetooth/ble_drv.h | 1 + ports/nrf/common-hal/_bleio/Adapter.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index ece4b2436f..d69f83e6ef 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -41,6 +41,7 @@ #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) #define SEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000000) / (RESOLUTION)) +#define UNITS_TO_SEC(TIME, RESOLUTION) (((TIME) * (RESOLUTION)) / 1000000) // 0.625 msecs (625 usecs) #define ADV_INTERVAL_UNIT_FLOAT_SECS (0.000625) // Microseconds is the base unit. The macros above know that. diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 83cd3bc1b2..0b23bb7bfa 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -600,14 +600,13 @@ STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { switch (ble_evt->header.evt_id) { case BLE_GAP_EVT_ADV_SET_TERMINATED: - mp_printf(&mp_plat_print, "Advertising set terminated - %d advertising events were completed - reason: %d\n", ble_evt->evt.gap_evt.params.adv_set_terminated.num_completed_adv_events, ble_evt->evt.gap_evt.params.adv_set_terminated.reason); common_hal_bleio_adapter_stop_advertising(self); ble_drv_remove_event_handler(advertising_on_ble_evt, self_in); break; default: // For debugging. - mp_printf(&mp_plat_print, "Unhandled Advertising etvent: 0x%04x\n", ble_evt->header.evt_id); + // mp_printf(&mp_plat_print, "Unhandled advertising event: 0x%04x\n", ble_evt->header.evt_id); return false; break; } @@ -722,7 +721,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool if (!timeout) { if (anonymous) { // The Nordic macro is in units of 10ms. Convert to seconds. - uint32_t adv_timeout_max_secs = BLE_GAP_ADV_TIMEOUT_LIMITED_MAX / 100; + uint32_t adv_timeout_max_secs = UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS); uint32_t rotate_timeout_max_secs = BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S; timeout = MIN(adv_timeout_max_secs, rotate_timeout_max_secs); } @@ -732,7 +731,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool } else { if (SEC_TO_UNITS(timeout, UNIT_10_MS) > BLE_GAP_ADV_TIMEOUT_LIMITED_MAX) { mp_raise_bleio_BluetoothError(translate("Timeout is too long: Maximum timeout length is %d seconds"), - BLE_GAP_ADV_TIMEOUT_LIMITED_MAX / 100); + UNITS_TO_SEC(BLE_GAP_ADV_TIMEOUT_LIMITED_MAX, UNIT_10_MS)); } } From 2f3a6773fcbfe3eeeb1d91363b491e3794e81a27 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 18 May 2020 21:25:57 +0000 Subject: [PATCH 617/919] Added translation using Weblate (Dutch) --- locale/nl.po | 3213 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3213 insertions(+) create mode 100644 locale/nl.po diff --git a/locale/nl.po b/locale/nl.po new file mode 100644 index 0000000000..f882772e8f --- /dev/null +++ b/locale/nl.po @@ -0,0 +1,3213 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + +#: py/obj.c +msgid " File \"%q\"" +msgstr "" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr "" + +#: main.c +msgid " output:\n" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "" + +#: py/obj.c +msgid "%q index out of range" +msgstr "" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q list must be a list" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c +#: shared-bindings/vectorio/Rectangle.c +msgid "%q must be >= 1" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "%q must be a tuple of length 2" +msgstr "" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an address of the form [a, b]" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects an integer" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects at most r%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects {r0, r1, ...}" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "'%s' integer %d is not within range %d..%d" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' integer 0x%x does not fit in mask 0x%x" +msgstr "" + +#: py/runtime.c +msgid "'%s' object cannot assign attribute '%q'" +msgstr "" + +#: py/proto.c +msgid "'%s' object does not support '%q'" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +msgstr "" + +#: py/objstr.c +msgid "'=' alignment not allowed in string format specifier" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "'S' and 'O' are not supported format types" +msgstr "" + +#: py/compile.c +msgid "'align' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'async for' or 'async with' outside async function" +msgstr "" + +#: py/compile.c +msgid "'await' outside function" +msgstr "" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "" + +#: py/compile.c +msgid "'return' outside function" +msgstr "" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr "" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/_bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels in use" +msgstr "" + +#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "All sync event channels in use" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c +#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +msgid "All timers in use" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogIn.c +msgid "AnalogIn not supported on given pin" +msgstr "" + +#: ports/cxd56/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/nrf/common-hal/analogio/AnalogOut.c +msgid "AnalogOut functionality not supported" +msgstr "" + +#: shared-bindings/analogio/AnalogOut.c +msgid "AnalogOut is only 16 bits. Value must be less than 65536." +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +msgid "AnalogOut not supported on given pin" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/cxd56/common-hal/pulseio/PulseOut.c +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "At most %d %q may be specified (not %d)" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" + +#: main.c +msgid "Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "" +"Auto-reload is on. Simply save files over USB to run them or enter REPL to " +"disable.\n" +msgstr "" + +#: shared-module/displayio/Display.c +#: shared-module/framebufferio/FramebufferDisplay.c +msgid "Below minimum frame rate" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +#: shared-bindings/rgbmatrix/RGBMatrix.c +msgid "Brightness must be 0-1.0" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Brightness not adjustable" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Buffer is too small" +msgstr "" + +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +#, c-format +msgid "Buffer length %d too big. It must be less than %d" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Buffer too large and unable to allocate" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +#, c-format +msgid "Buffer too short by %d bytes" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +#, c-format +msgid "Bus pin %d is already in use" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "Byte buffer must be 16 bytes." +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "CBC blocks must be multiples of 16 bytes" +msgstr "" + +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/common-hal/digitalio/DigitalInOut.c +msgid "Cannot get pull while in output mode" +msgstr "" + +#: ports/nrf/common-hal/microcontroller/Processor.c +msgid "Cannot get temperature" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Cannot record to a file" +msgstr "" + +#: shared-module/storage/__init__.c +msgid "Cannot remount '/' when USB is active." +msgstr "" + +#: ports/atmel-samd/common-hal/microcontroller/__init__.c +#: ports/cxd56/common-hal/microcontroller/__init__.c +#: ports/mimxrt10xx/common-hal/microcontroller/__init__.c +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Cannot specify RTS or CTS in RS485 mode" +msgstr "" + +#: py/objslice.c +msgid "Cannot subclass slice" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot transfer without MOSI and MISO pins." +msgstr "" + +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Cannot vary frequency on a timer that is already in use" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Clock pin init failed." +msgstr "" + +#: shared-module/bitbangio/I2C.c +msgid "Clock stretch too long" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Clock unit in use" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Column entry must be digitalio.DigitalInOut" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "" + +#: shared-bindings/_bleio/Connection.c +msgid "" +"Connection has been disconnected and can no longer be used. Create a new " +"connection." +msgstr "" + +#: py/persistentcode.c +msgid "Corrupt .mpy file" +msgstr "" + +#: py/emitglue.c +msgid "Corrupt raw code" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not initialize timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init channel" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not re-init timer" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not restart PWM" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Could not start PWM" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Could not start interrupt, RX busy" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate decoder" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3Decoder.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler." +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Channel Init Error" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "DAC Device Init Error" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "DAC already in use" +msgstr "" + +#: ports/atmel-samd/common-hal/displayio/ParallelBus.c +#: ports/nrf/common-hal/displayio/ParallelBus.c +msgid "Data 0 pin must be byte aligned" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: ports/nrf/common-hal/audiobusio/I2SOut.c +msgid "Device in use" +msgstr "" + +#: ports/cxd56/common-hal/digitalio/DigitalInOut.c +msgid "DigitalInOut not supported on given pin" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Display rotation must be in 90 degree increments" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Drive mode not used when direction is input." +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "ECB only operates on 16 bytes at a time" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c +msgid "Expected a Characteristic" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c +msgid "Expected a UUID" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Extended advertisements with scan response not supported." +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "FFT is defined for ndarrays only" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Failed sending command." +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: shared-module/audiomp3/MP3Decoder.c +msgid "Failed to parse MP3 file" +msgstr "" + +#: ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Frequency must match existing PWMOut using this timer" +msgstr "" + +#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c +#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c +msgid "Function requires lock" +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +#: shared-bindings/framebufferio/FramebufferDisplay.c +msgid "Group already used" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/SPI.c +msgid "Hardware busy, try alternative pins" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Hardware in use, try alternative pins" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: ports/stm/common-hal/busio/I2C.c +msgid "I2C Init Error" +msgstr "" + +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +#, c-format +msgid "IV must be %d bytes long" +msgstr "" + +#: py/persistentcode.c +msgid "" +"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" +"mpy-update for more info." +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Incorrect buffer size" +msgstr "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Internal define error" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Internal error #%d" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Invalid ADC Unit value" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "Invalid DAC pin supplied" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +msgid "Invalid I2C pin selection" +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 +msgid "Invalid PWM frequency" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Invalid SPI pin selection" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid UART pin selection" +msgstr "" + +#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Invalid byteorder string" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid format chunk size" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid frequency supplied" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Invalid memory access." +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid number of bits" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +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 +msgid "Invalid pin" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for left channel" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Invalid pin for right channel" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/SPI.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "Invalid pins for PWMOut" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +#: shared-bindings/displayio/FourWire.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Invalid word/bit length" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Key must be 16, 24, or 32 bytes long" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer already in a group." +msgstr "" + +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass." +msgstr "" + +#: py/objslice.c +msgid "Length must be an int" +msgstr "" + +#: py/objslice.c +msgid "Length must be non-negative" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MISO pin init failed." +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "MOSI pin init failed." +msgstr "" + +#: shared-module/displayio/Shape.c +#, c-format +msgid "Maximum x value when mirrored is %d" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error." +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "" + +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "Must provide MISO or MOSI pin" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "Must use a multiple of 6 rgb pins, not %d" +msgstr "" + +#: py/parse.c +msgid "Name too long" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogOut.c +#: ports/stm/common-hal/analogio/AnalogOut.c +msgid "No DAC on chip" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "No DMA channel found" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +msgid "No MOSI Pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c +msgid "No TX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "No available clocks" +msgstr "" + +#: shared-bindings/_bleio/PacketBuffer.c +msgid "No connection: length cannot be determined" +msgstr "" + +#: shared-bindings/board/__init__.c +msgid "No default %q bus" +msgstr "" + +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +msgid "No free GCLKs" +msgstr "" + +#: shared-bindings/os/__init__.c +msgid "No hardware random available" +msgstr "" + +#: ports/atmel-samd/common-hal/ps2io/Ps2.c +msgid "No hardware support on clk pin" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "No key was specified" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "No long integer support" +msgstr "" + +#: ports/stm/common-hal/pulseio/PWMOut.c +msgid "No more timers available on this pin." +msgstr "" + +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "No timer available" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +#: shared-bindings/audiopwmio/PWMAudioOut.c +msgid "Not playing" +msgstr "" + +#: shared-bindings/util.c +msgid "" +"Object has been deinitialized and can no longer be used. Create a new object." +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Odd parity is not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Only 8 or 16 bit mono with " +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only Windows format, uncompressed BMP supported: given header size is %d" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +#, c-format +msgid "" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +#: ports/stm/common-hal/displayio/ParallelBus.c +msgid "ParallelBus not yet supported" +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/cxd56/common-hal/analogio/AnalogIn.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +#: ports/stm/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: ports/atmel-samd/common-hal/countio/Counter.c +msgid "Pin must support hardware interrupts" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "Pin number already reserved by EXTI" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "" +"Pinout uses %d bytes per element, which consumes more than the ideal %d " +"bytes. If this cannot be avoided, pass allow_inefficient=True to the " +"constructor" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "Prefix buffer must be on the heap" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "PulseIn not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/pulseio/PulseOut.c +msgid "PulseOut not supported on this chip" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG DeInit Error" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "RNG Init Error" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "RS485 inversion specified when not in RS485 mode" +msgstr "" + +#: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "RTS/CTS/RS485 Not yet supported on this device" +msgstr "" + +#: ports/stm/common-hal/os/__init__.c +msgid "Random number generation error" +msgstr "" + +#: shared-bindings/pulseio/PulseIn.c +msgid "Read-only" +msgstr "" + +#: extmod/vfs_fat.c py/moduerrno.c +msgid "Read-only filesystem" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Read-only object" +msgstr "" + +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Requested AES mode is unsupported" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Right channel unsupported" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "Row entry must be digitalio.DigitalInOut" +msgstr "" + +#: main.c +msgid "Running in safe mode! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI Re-initialization error" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Sample rate must be positive" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#, c-format +msgid "Sample rate too high. It must be less than %d" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Scan already in progess. Stop with stop_scan." +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected CTS pin not valid" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Selected RTS pin not valid" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Slice and value different lengths." +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: shared-bindings/aesio/aes.c +msgid "Source and destination buffers must be the same length" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "Supply at least one UART pin" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Temperature read timed out" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase the stack size if you know how, or if not:" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audiomixer/MixerVoice.c +msgid "The sample's signedness does not match the mixer's" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile height must exactly divide bitmap height" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c +msgid "Tile index out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile value out of bounds" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many display busses" +msgstr "" + +#: shared-module/displayio/__init__.c +msgid "Too many displays" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Total data to write is larger than outgoing_packet_length" +msgstr "" + +#: py/obj.c +msgid "Traceback (most recent call last):\n" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "Tuple or struct_time argument required" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Buffer allocation error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART De-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Init Error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART Re-init error" +msgstr "" + +#: ports/stm/common-hal/busio/UART.c +msgid "UART write error" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Busy" +msgstr "" + +#: shared-module/usb_hid/Device.c +msgid "USB Error" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "UUID value is not str, int or byte buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Unable to allocate buffers for signed conversion" +msgstr "" + +#: shared-module/displayio/I2CDisplay.c +#, c-format +msgid "Unable to find I2C Display at %x" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Unable to find free GCLK" +msgstr "" + +#: py/parse.c +msgid "Unable to init parser" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Unable to read color palette data" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Unable to write to nvm." +msgstr "" + +#: ports/nrf/common-hal/_bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown security error: 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown soft device error: %04x" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "" +"Unspecified issue. Can be that the pairing prompt on the other device was " +"declined or ignored." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/display_core.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audiocore/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: ports/stm/common-hal/microcontroller/Processor.c +msgid "Voltage read timed out" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +msgstr "" + +#: py/builtinhelp.c +#, c-format +msgid "" +"Welcome to Adafruit CircuitPython %s!\n" +"\n" +"Please visit learn.adafruit.com/category/circuitpython for project guides.\n" +"\n" +"To list built-in modules please do `help(\"modules\")`.\n" +msgstr "" + +#: ports/nrf/common-hal/_bleio/PacketBuffer.c +msgid "Writes not supported on Characteristic" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "You requested starting safe mode by " +msgstr "" + +#: py/objtype.c +msgid "__init__() should return None" +msgstr "" + +#: py/objtype.c +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "addresses is empty" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "arctan2 is implemented for scalars and ndarrays only" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "argsort argument must be an ndarray" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +msgstr "" + +#: py/argcheck.c shared-bindings/_stage/__init__.c +#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +msgid "argument num/types mismatch" +msgstr "" + +#: py/runtime.c +msgid "argument should be a '%q' not a '%q'" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "arguments must be ndarrays" +msgstr "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "attempt to get argmin/argmax of an empty sequence" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, None, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be -1, 0, or 1" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "axis must be None, 0, or 1" +msgstr "" + +#: py/builtinevex.c +msgid "bad compile mode" +msgstr "" + +#: py/objstr.c +msgid "bad conversion specifier" +msgstr "" + +#: py/objstr.c +msgid "bad format string" +msgstr "" + +#: py/binary.c +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "buffer must be a bytes-like object" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "buffer size must match format" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "buffer slices must be of equal length" +msgstr "" + +#: py/modstruct.c shared-bindings/struct/__init__.c +#: shared-module/struct/__init__.c +msgid "buffer too small" +msgstr "" + +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + +#: shared-bindings/_pew/PewPew.c +msgid "buttons must be digitalio.DigitalInOut" +msgstr "" + +#: py/vm.c +msgid "byte code not implemented" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "byteorder is not a string" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.c +msgid "calibration is read only" +msgstr "" + +#: ports/atmel-samd/common-hal/rtc/RTC.c +msgid "calibration value out of range +/-127" +msgstr "" + +#: py/emitinlinethumb.c +msgid "can only have up to 4 parameters to Thumb assembly" +msgstr "" + +#: py/emitinlinextensa.c +msgid "can only have up to 4 parameters to Xtensa assembly" +msgstr "" + +#: py/persistentcode.c +msgid "can only save bytecode" +msgstr "" + +#: py/objtype.c +msgid "can't add special method to already-subclassed class" +msgstr "" + +#: py/compile.c +msgid "can't assign to expression" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert to str implicitly" +msgstr "" + +#: py/compile.c +msgid "can't declare nonlocal in outer code" +msgstr "" + +#: py/compile.c +msgid "can't delete expression" +msgstr "" + +#: py/emitnative.c +msgid "can't do binary op between '%q' and '%q'" +msgstr "" + +#: py/objcomplex.c +msgid "can't do truncated division of a complex number" +msgstr "" + +#: py/compile.c +msgid "can't have multiple **x" +msgstr "" + +#: py/compile.c +msgid "can't have multiple *x" +msgstr "" + +#: py/emitnative.c +msgid "can't implicitly convert '%q' to 'bool'" +msgstr "" + +#: py/emitnative.c +msgid "can't load from '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't load with '%q' index" +msgstr "" + +#: py/objgenerator.c +msgid "can't pend throw to just-started generator" +msgstr "" + +#: py/objgenerator.c +msgid "can't send non-None value to a just-started generator" +msgstr "" + +#: py/objnamedtuple.c +msgid "can't set attribute" +msgstr "" + +#: py/emitnative.c +msgid "can't store '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store to '%q'" +msgstr "" + +#: py/emitnative.c +msgid "can't store with '%q' index" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from automatic field numbering to manual field specification" +msgstr "" + +#: py/objstr.c +msgid "" +"can't switch from manual field specification to automatic field numbering" +msgstr "" + +#: py/objtype.c +msgid "cannot create '%q' instances" +msgstr "" + +#: py/objtype.c +msgid "cannot create instance" +msgstr "" + +#: py/runtime.c +msgid "cannot import name %q" +msgstr "" + +#: py/builtinimport.c +msgid "cannot perform relative import" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "cannot reshape array (incompatible input/output shape)" +msgstr "" + +#: py/emitnative.c +msgid "casting" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "chars buffer too small" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(0x110000)" +msgstr "" + +#: py/modbuiltins.c +msgid "chr() arg not in range(256)" +msgstr "" + +#: shared-module/vectorio/Circle.c +msgid "circle can only be registered in one parent" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a buffer, tuple, list, or int" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color buffer must be a bytearray or array of type 'b' or 'B'" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "color must be between 0x000000 and 0xffffff" +msgstr "" + +#: shared-bindings/displayio/ColorConverter.c +msgid "color should be an int" +msgstr "" + +#: py/objcomplex.c +msgid "complex division by zero" +msgstr "" + +#: py/objfloat.c py/parsenum.c +msgid "complex values not supported" +msgstr "" + +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + +#: py/parse.c +msgid "constant must be an integer" +msgstr "" + +#: py/emitnative.c +msgid "conversion to object" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be linear arrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must be ndarrays" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "convolve arguments must not be empty" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "could not broadast input array from shape" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "could not invert Vandermonde matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "ddof must be smaller than length of data set" +msgstr "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "" +"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination buffer must be an array of type 'H' for bit_depth = 16" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "destination_length must be an int >= 0" +msgstr "" + +#: py/objdict.c +msgid "dict update sequence has wrong length" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "diff argument must be an ndarray" +msgstr "" + +#: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c +#: shared-bindings/math/__init__.c +msgid "division by zero" +msgstr "" + +#: py/objdeque.c +msgid "empty" +msgstr "" + +#: shared-bindings/vectorio/Polygon.c +msgid "empty %q list" +msgstr "" + +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + +#: py/objstr.c +msgid "empty separator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "empty sequence" +msgstr "" + +#: py/objstr.c +msgid "end of format while looking for conversion specifier" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "end_x should be an int" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "" + +#: py/compile.c +msgid "expecting an assembler instruction" +msgstr "" + +#: py/compile.c +msgid "expecting just a value for set" +msgstr "" + +#: py/compile.c +msgid "expecting key:value for dict" +msgstr "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a '#'" +msgstr "" + +#: py/parse.c +msgid "f-string expression part cannot include a backslash" +msgstr "" + +#: py/parse.c +msgid "f-string: empty expression not allowed" +msgstr "" + +#: py/parse.c +msgid "f-string: expecting '}'" +msgstr "" + +#: py/parse.c +msgid "f-string: single '}' is not allowed" +msgstr "" + +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c +#: shared-bindings/displayio/OnDiskBitmap.c +msgid "file must be a file opened in byte mode" +msgstr "" + +#: shared-bindings/storage/__init__.c +msgid "filesystem must provide mount method" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "first argument must be an iterable" +msgstr "" + +#: extmod/ulab/code/vectorise.c +msgid "first argument must be an ndarray" +msgstr "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "flattening order must be either 'C', or 'F'" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "flip argument must be an ndarray" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "" + +#: shared-bindings/_stage/Text.c +msgid "font must be 2048 bytes long" +msgstr "" + +#: py/objstr.c +msgid "format requires a dict" +msgstr "" + +#: py/objdeque.c +msgid "full" +msgstr "" + +#: py/argcheck.c +msgid "function does not take keyword arguments" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function expected at most %d arguments, got %d" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "function got multiple values for argument '%q'" +msgstr "" + +#: extmod/ulab/code/compare.c +msgid "function is implemented for scalars and ndarrays only" +msgstr "" + +#: py/argcheck.c +#, c-format +msgid "function missing %d required positional arguments" +msgstr "" + +#: py/bc.c +msgid "function missing keyword-only argument" +msgstr "" + +#: py/bc.c +msgid "function missing required keyword argument '%q'" +msgstr "" + +#: py/bc.c +#, c-format +msgid "function missing required positional argument #%d" +msgstr "" + +#: py/argcheck.c py/bc.c py/objnamedtuple.c +#, c-format +msgid "function takes %d positional arguments but %d were given" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "function takes exactly 9 arguments" +msgstr "" + +#: py/objgenerator.c +msgid "generator already executing" +msgstr "" + +#: py/objgenerator.c +msgid "generator ignored GeneratorExit" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "graphic must be 2048 bytes long" +msgstr "" + +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as global" +msgstr "" + +#: py/compile.c +msgid "identifier redefined as nonlocal" +msgstr "" + +#: py/objstr.c +msgid "incomplete format" +msgstr "" + +#: py/objstr.c +msgid "incomplete format key" +msgstr "" + +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "index is out of bounds" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "indices must be integers, slices, or Boolean lists" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "input argument must be an integer or a 2-tuple" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "input array length must be power of 2" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input data must be an iterable" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is asymmetric" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input matrix is singular" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "input must be square matrix" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "input must be tuple, list, range, or ndarray" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "input vectors must be of equal length" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" + +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + +#: py/compile.c +msgid "invalid micropython decorator" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "invalid step" +msgstr "" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "" + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 1 must be a class" +msgstr "" + +#: py/objtype.c +msgid "issubclass() arg 2 must be a class or a tuple of classes" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "iterables are not of the same length" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "iterations did not converge" +msgstr "" + +#: py/objstr.c +msgid "join expects a list of str/bytes objects consistent with self object" +msgstr "" + +#: py/argcheck.c +msgid "keyword argument(s) not yet implemented - use normal args instead" +msgstr "" + +#: py/bc.c +msgid "keywords must be strings" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +msgid "label '%q' not defined" +msgstr "" + +#: py/compile.c +msgid "label redefined" +msgstr "" + +#: py/stream.c +msgid "length argument not allowed for this type" +msgstr "" + +#: shared-bindings/audiomixer/MixerVoice.c +msgid "level must be between 0 and 1" +msgstr "" + +#: py/objarray.c +msgid "lhs and rhs should be compatible" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' has type '%q' but source is '%q'" +msgstr "" + +#: py/emitnative.c +msgid "local '%q' used before type known" +msgstr "" + +#: py/vm.c +msgid "local variable referenced before assignment" +msgstr "" + +#: py/objint.c +msgid "long int not supported in this build" +msgstr "" + +#: py/parse.c +msgid "malformed f-string" +msgstr "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix dimensions do not match" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "matrix is not positive definite" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +#, c-format +msgid "max_length must be 0-%d when fixed_length is %s" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "memory allocation failed, allocating %u bytes" +msgstr "" + +#: py/runtime.c +msgid "memory allocation failed, heap is locked" +msgstr "" + +#: py/builtinimport.c +msgid "module not found" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "more degrees of freedom than data points" +msgstr "" + +#: py/compile.c +msgid "multiple *x in assignment" +msgstr "" + +#: py/objtype.c +msgid "multiple bases have instance lay-out conflict" +msgstr "" + +#: py/objtype.c +msgid "multiple inheritance not supported" +msgstr "" + +#: py/emitnative.c +msgid "must raise an object" +msgstr "" + +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "n must be between 0, and 9" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: py/runtime.c +msgid "name not defined" +msgstr "" + +#: py/compile.c +msgid "name reused for argument" +msgstr "" + +#: py/emitnative.c +msgid "native yield" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "need more than %d values to unpack" +msgstr "" + +#: py/objint_longlong.c py/objint_mpz.c py/runtime.c +msgid "negative power with no float support" +msgstr "" + +#: py/objint_mpz.c py/runtime.c +msgid "negative shift count" +msgstr "" + +#: py/vm.c +msgid "no active exception to reraise" +msgstr "" + +#: shared-bindings/socket/__init__.c shared-module/network/__init__.c +msgid "no available NIC" +msgstr "" + +#: py/compile.c +msgid "no binding for nonlocal found" +msgstr "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c +msgid "no reset pin available" +msgstr "" + +#: py/runtime.c +msgid "no such attribute" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" +msgstr "" + +#: py/compile.c +msgid "non-default argument follows default argument" +msgstr "" + +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after */**" +msgstr "" + +#: py/compile.c +msgid "non-keyword arg after keyword arg" +msgstr "" + +#: shared-bindings/_bleio/UUID.c +msgid "not a 128-bit UUID" +msgstr "" + +#: py/objstr.c +msgid "not all arguments converted during string formatting" +msgstr "" + +#: py/objstr.c +msgid "not enough arguments for format string" +msgstr "" + +#: extmod/ulab/code/poly.c +msgid "number of arguments must be 2, or 3" +msgstr "" + +#: extmod/ulab/code/create.c +msgid "number of points must be at least 2" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object '%s' is not a tuple or list" +msgstr "" + +#: py/obj.c +msgid "object does not support item assignment" +msgstr "" + +#: py/obj.c +msgid "object does not support item deletion" +msgstr "" + +#: py/obj.c +msgid "object has no len" +msgstr "" + +#: py/obj.c +msgid "object is not subscriptable" +msgstr "" + +#: py/runtime.c +msgid "object not an iterator" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "object not callable" +msgstr "" + +#: py/sequence.c shared-bindings/displayio/Group.c +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only bit_depth=16 is supported" +msgstr "" + +#: ports/nrf/common-hal/audiobusio/PDMIn.c +msgid "only sample_rate=16000 is supported" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +msgstr "" + +#: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c +#: extmod/ulab/code/vectorise.c +msgid "operands could not be broadcast together" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "operation is not implemented on ndarrays" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "operation is not supported for given type" +msgstr "" + +#: py/modbuiltins.c +msgid "ord expects a character" +msgstr "" + +#: py/modbuiltins.c +#, c-format +msgid "ord() expected a character, but string of length %d found" +msgstr "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +msgstr "" + +#: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c +msgid "palette must be 32 bytes long" +msgstr "" + +#: shared-bindings/displayio/Palette.c +msgid "palette_index should be an int" +msgstr "" + +#: py/compile.c +msgid "parameter annotation must be an identifier" +msgstr "" + +#: py/emitinlinextensa.c +msgid "parameters must be registers in sequence a2 to a5" +msgstr "" + +#: py/emitinlinethumb.c +msgid "parameters must be registers in sequence r0 to r3" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel coordinates out of bounds" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "pixel value requires too many bits" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: shared-module/vectorio/Polygon.c +msgid "polygon can only be registered in one parent" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#: ports/stm/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() 3rd argument cannot be 0" +msgstr "" + +#: py/objint_mpz.c +msgid "pow() with 3 arguments requires integers" +msgstr "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: py/parse.c +msgid "raw f-strings are not implemented" +msgstr "" + +#: extmod/ulab/code/fft.c +msgid "real and imaginary parts must be of equal length" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] duplicates another pin assignment" +msgstr "" + +#: shared-bindings/rgbmatrix/RGBMatrix.c +#, c-format +msgid "rgb_pins[%d] is not on the same port as clock" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "right hand side must be an ndarray, or a scalar" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audiocore/RawSample.c +msgid "" +"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " +"'B'" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "sampling rate out of range" +msgstr "" + +#: py/modmicropython.c +msgid "schedule stack full" +msgstr "" + +#: lib/utils/pyexec.c py/builtinimport.c +msgid "script compilation not supported" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "shape must be a 2-tuple" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed in string format specifier" +msgstr "" + +#: py/objstr.c +msgid "sign not allowed with integer format specifier 'c'" +msgstr "" + +#: py/objstr.c +msgid "single '}' encountered in format string" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "size is defined for ndarrays only" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +msgstr "" + +#: py/objslice.c py/sequence.c +msgid "slice step cannot be zero" +msgstr "" + +#: py/objint.c py/sequence.c +msgid "small int overflow" +msgstr "" + +#: main.c +msgid "soft reboot\n" +msgstr "" + +#: extmod/ulab/code/numerical.c +msgid "sort argument must be an ndarray" +msgstr "" + +#: py/objstr.c +msgid "start/end indices" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "start_x should be an int" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "step must be non-zero" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "stop must be 1 or 2" +msgstr "" + +#: shared-bindings/random/__init__.c +msgid "stop not reachable from start" +msgstr "" + +#: py/stream.c +msgid "stream operation not supported" +msgstr "" + +#: py/objstrunicode.c +msgid "string index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +msgstr "" + +#: py/stream.c +msgid "string not supported; use bytes or bytearray" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: py/objstr.c +msgid "substring not found" +msgstr "" + +#: py/compile.c +msgid "super() can't find self" +msgstr "" + +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "" + +#: shared-bindings/touchio/TouchIn.c +msgid "threshold must be in the range 0-65536" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout must be 0.0-100.0 seconds" +msgstr "" + +#: shared-bindings/_bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "too many indices" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: extmod/ulab/code/linalg.c py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: shared-bindings/busio/UART.c +msgid "tx and rx cannot both be None" +msgstr "" + +#: py/objtype.c +msgid "type '%q' is not an acceptable base type" +msgstr "" + +#: py/objtype.c +msgid "type is not an acceptable base type" +msgstr "" + +#: py/runtime.c +msgid "type object '%q' has no attribute '%q'" +msgstr "" + +#: py/objtype.c +msgid "type takes 1 or 3 arguments" +msgstr "" + +#: py/objint_longlong.c +msgid "ulonglong too large" +msgstr "" + +#: py/emitnative.c +msgid "unary op %q not implemented" +msgstr "" + +#: py/parse.c +msgid "unexpected indent" +msgstr "" + +#: py/bc.c +msgid "unexpected keyword argument" +msgstr "" + +#: py/bc.c py/objnamedtuple.c +msgid "unexpected keyword argument '%q'" +msgstr "" + +#: py/lexer.c +msgid "unicode name escapes" +msgstr "" + +#: py/parse.c +msgid "unindent does not match any outer indentation level" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown conversion specifier %c" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/compile.c +msgid "unknown type" +msgstr "" + +#: py/emitnative.c +msgid "unknown type '%q'" +msgstr "" + +#: py/objstr.c +msgid "unmatched '{' in format" +msgstr "" + +#: py/objtype.c py/runtime.c +msgid "unreadable attribute" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c +#: shared-bindings/vectorio/VectorShape.c +msgid "unsupported %q type" +msgstr "" + +#: py/emitinlinethumb.c +#, c-format +msgid "unsupported Thumb instruction '%s' with %d arguments" +msgstr "" + +#: py/emitinlinextensa.c +#, c-format +msgid "unsupported Xtensa instruction '%s' with %d arguments" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unsupported format character '%c' (0x%x) at index %d" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for %q: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: py/objint.c +#, c-format +msgid "value must fit in %d byte(s)" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + +#: extmod/ulab/code/linalg.c +msgid "wrong argument type" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong index type" +msgstr "" + +#: py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: extmod/ulab/code/ndarray.c +msgid "wrong operand type" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +msgstr "" + +#: shared-bindings/displayio/Shape.c +msgid "y should be an int" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "y value out of bounds" +msgstr "" + +#: py/objrange.c +msgid "zero step" +msgstr "" From ebea4d158db577fe6c9a2feb87c765f1747f044c Mon Sep 17 00:00:00 2001 From: Dustin Watts Date: Mon, 18 May 2020 21:40:30 +0000 Subject: [PATCH 618/919] Translated using Weblate (Dutch) Currently translated at 4.9% (37 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 81 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index f882772e8f..c4830012a6 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,19 +8,23 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-05-18 22:06+0000\n" +"Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Code is uitgevoerd. Wachten op herladen.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -28,169 +32,174 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Meld een probleem met de inhoud van de CIRCUITPY drive op:\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Om te verlatten, herstart de module zonder " #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr " Bestand" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr " Bestand \"%q\", regel %d" #: main.c msgid " output:\n" -msgstr "" +msgstr " output\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%%c vereist een int of char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d adres pins en %d RGB pins geven een hoogte van %d aan, niet %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q in gebruik" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "%q index buiten bereik" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "%q indexen moeten integers zijn, niet %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "%q lijst moet een lijst zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "%q moet >= 1 zijn" #: shared-bindings/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q moet een tuple van lengte 2 zijn" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "%q moet een int zijn" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "" +msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" #: py/argcheck.c msgid "'%q' argument required" -msgstr "" +msgstr "'%q' argument vereist" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' verwacht een label" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s' verwacht een register" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s' verwacht een speciaal register" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "" +msgstr "'%s' verwacht een FPU register" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an address of the form [a, b]" -msgstr "" +msgstr "'%s' verwacht een adres in de vorm [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "" +msgstr "'%s' verwacht een integer" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects at most r%d" -msgstr "" +msgstr "'%s' verwacht op zijn meest r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s' verwacht {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "" +msgstr "'%s' integer %d is niet in bereik %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "" +msgstr "'%s' integer 0x%x past niet in mask 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "'%s' object kan niet aan attribuut '%q' toewijzen" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "'%s' object ondersteunt '%q' niet" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "" +msgstr "'%s' object ondersteunt item toewijzing niet" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "" +msgstr "'%s' object ondersteunt item verwijdering niet" #: py/runtime.c msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "'%s' object heeft geen attribuut '%q'" #: py/runtime.c #, c-format msgid "'%s' object is not an iterator" -msgstr "" +msgstr "'%s' object is geen iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "" +msgstr "'%s' object is niet aanroepbaar" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "" +msgstr "'%s' object is niet itereerbaar" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "" +msgstr "'%s' object is niet onderschrijfbaar" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "" +msgstr "'=' alignment not allowed in string format specifier" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" From bbe6ed53190e2c32644736a30f4b260137c0d8e8 Mon Sep 17 00:00:00 2001 From: Dustin Watts Date: Mon, 18 May 2020 22:07:16 +0000 Subject: [PATCH 619/919] Translated using Weblate (Dutch) Currently translated at 5.3% (40 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index c4830012a6..2fdc55e32a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-18 22:06+0000\n" +"PO-Revision-Date: 2020-05-18 22:17+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" @@ -199,19 +199,19 @@ msgstr "'%s' object is niet onderschrijfbaar" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "'=' alignment not allowed in string format specifier" +msgstr "'=' uitlijning niet toegestaan in string format specifier" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "" +msgstr "'S' and 'O' zijn niet ondersteunde format types" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "'align' vereist 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'async for' of 'async with' buiten async functie" #: py/compile.c msgid "'await' outside function" From f874e21ad77e2e19fbf38a0b3edc1694dcdff5af Mon Sep 17 00:00:00 2001 From: Dustin Watts Date: Tue, 19 May 2020 06:39:29 +0000 Subject: [PATCH 620/919] Translated using Weblate (Dutch) Currently translated at 52.5% (392 of 746 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 709 +++++++++++++++++++++++++++------------------------ 1 file changed, 374 insertions(+), 335 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 2fdc55e32a..ecae69eecd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-12 14:37+1000\n" -"PO-Revision-Date: 2020-05-18 22:17+0000\n" +"PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" @@ -215,89 +215,89 @@ msgstr "'async for' of 'async with' buiten async functie" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'await' buiten de functie" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' buiten de loop" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' buiten de loop" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' vereist op zijn minst 2 argumenten" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' vereist integer argumenten" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' vereist 1 argument" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "'return' buiten de functie" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "'yield' buiten de functie" #: py/compile.c msgid "*x must be assignment target" -msgstr "" +msgstr "*x moet een assignment target zijn" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", in %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0.0 tot een complexe macht" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "3-arg pow() niet ondersteund" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "" +msgstr "Een hardware interrupt kanaal is al in gebruik" #: shared-bindings/_bleio/Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "" +msgstr "Adres moet %d bytes lang zijn" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Adres type buiten bereik" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "" +msgstr "Alle I2C peripherals zijn in gebruik" #: ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "" +msgstr "Alle SPI peripherals zijn in gebruik" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "" +msgstr "Alle UART peripherals zijn in gebruik" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "" +msgstr "Alle event kanalen zijn in gebruik" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" +msgstr "Alle sync event kanalen zijn in gebruik" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "" +msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -308,444 +308,451 @@ msgstr "" #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c msgid "All timers in use" -msgstr "" +msgstr "Alle timers zijn in gebruik" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Advertising is al bezig." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn niet ondersteund door gegeven pin" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" -msgstr "" +msgstr "AnalogOut functionaliteit niet ondersteund" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "AnalogOut is slechts 16 bits. Waarde moet minder dan 65536 zijn." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "" +msgstr "AnalogOut niet ondersteund door gegeven pin" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "" +msgstr "Een andere send is al actief" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "Array moet halfwords (type 'H') bevatten" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Array waardes moet enkele bytes zijn." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "" +msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait." #: main.c msgid "Auto-reload is off.\n" -msgstr "" +msgstr "Auto-herlaad staat uit.\n" #: main.c msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" +"Auto-herlaad staat aan. Sla bestanden simpelweg op over USB om uit te voeren " +"of start REPL om uit te schakelen.\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Onder de minimum frame rate" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" +msgstr "Bit clock en word select moeten een clock eenheid delen" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bit diepte moet een meervoud van 8 zijn." #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "Beide pinnen moeten hardware interrupts ondersteunen" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Helderheid moet tussen de 0 en 1.0 liggen" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "" +msgstr "Helderheid moet tussen de 0 en 255 liggen" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Helderheid is niet aanpasbaar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffer + offset te klein %d %d %d" #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer is geen bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Buffer is te klein" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "Buffer moet op zijn minst lengte 1 zijn" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Buffer is te groot en niet in staat te alloceren" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer is %d bytes te klein" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Bus pin %d al in gebruik" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "" +msgstr "Byte buffer moet 16 bytes zijn." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "Bytes moeten tussen 0 en 255 liggen." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC blocks moeten meervouden van 16 bytes zijn" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Roep super().__init__() aan voor toegang native object." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Kan CCCD niet toewijzen aan lokaal Characteristic" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Kan waardes niet verwijderen" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "get pull kan niet gedurende output mode" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "" +msgstr "Kan de temperatuur niet verkrijgen" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Kan geen scan responses voor extended, connectable advertisements hebben." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "" +msgstr "Output van beide kanalen kan niet op dezelfde pin" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." -msgstr "" +msgstr "Kan niet lezen zonder MISO pin." #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Kan niet opnemen naar een bestand" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "" +msgstr "Kan '/' niet hermounten als USB actief is." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" +msgstr "Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Kan de waarde niet toewijzen als de richting input is." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Kan RTS of CTS niet specificeren in RS485 modus" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Kan slice niet subclasseren" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." -msgstr "" +msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "Kan niet ondubbelzinning sizeof scalar verkrijgen" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Kan de frequentie van een timer die al in gebruik is niet variëren" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "" +msgstr "Kan niet schrijven zonder MOSI pin." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "CharacteristicBuffer schrijven is niet beschikbaar" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "CircuitPython core code is hard gecrashed. Ojee!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython is in veilige modus omdat de rest knop werd ingedrukt tijdens " +"het opstarten. Druk nogmaals om veilige modus te verlaten\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "" +msgstr "Clock pin init mislukt." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Clock stretch is te lang" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "" +msgstr "Clock unit in gebruik" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Column entry moet digitalio.DigitalInOut zijn" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "" +msgstr "Command moet een int tussen 0 en 255 zijn" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Verbinding is verbroken en kan niet langer gebruikt worden. Creëer een " +"nieuwe verbinding." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Corrupt .mpy bestand" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Corrupt raw code" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" -msgstr "" +msgstr "Kan UART niet initialiseren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Kan kanaal niet initialiseren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Kan timer niet initialiseren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Kan kanaal niet her-initialiseren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Kan timer niet her-initialiseren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Kan PWM niet herstarten" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Kan PWM niet starten" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Kan interrupt niet starten, RX is bezig" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Kan decoder niet alloceren" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "" +msgstr "Kan eerste buffer niet alloceren" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Kan input buffer niet alloceren" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "" +msgstr "Kan tweede buffer niet alloceren" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Crash naar de HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "DAC kanaal Init Fout" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "DAC Apparaat Init Fout" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC al in gebruik" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Data 0 pin moet byte uitgelijnd zijn" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Data chunk moet gevolgd worden door fmt chunk" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "Data te groot voor advertisement pakket" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Bestemming grootte is kleiner dan destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Apparaat al in gebruik" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut niet ondersteund door gegeven pin" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Beeldscherm moet een 16bit kleurruimte hebben." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" -msgstr "" +msgstr "Beeldscherm rotatie moet in stappen van 90 graden" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "Drive modus niet gebruikt als de richting input is." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINT kanaal al in gebruik" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "Fout in regex" #: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" -msgstr "" +msgstr "Verwacht een %q" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c msgid "Expected a Characteristic" -msgstr "" +msgstr "Verwachtte een Characteristic" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Verwachtte een Service" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c msgid "Expected a UUID" -msgstr "" +msgstr "Verwachtte een UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Verwachtte een adres" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "Extended advertisements met scan antwoord niet ondersteund." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT alleen voor ndarrays gedefineerd" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Commando verzenden mislukt." #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "" +msgstr "Fout tijdens verkrijgen mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" -msgstr "" +msgstr "RX buffer alloceren mislukt" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -754,214 +761,218 @@ msgstr "" #: ports/stm/common-hal/pulseio/PulseIn.c #, c-format msgid "Failed to allocate RX buffer of %d bytes" -msgstr "" +msgstr "Mislukt een RX buffer van %d bytes te alloceren" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Verbinding mislukt: interne fout" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Verbinding mislukt: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Mislukt om MP3 bestand te ontleden" #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "" +msgstr "Mislukt mutex los te laten, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Schrijven naar interne flash mislukt." #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" +"De vastgelegde frequentie is boven de capaciteit. Vastleggen gepauzeerd." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"Frequentie moet overeenkomen met bestaande PWMOut bij gebruik van deze timer" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "" +msgstr "Functie vereist lock" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Groep al gebruikt" #: shared-module/displayio/Group.c msgid "Group full" -msgstr "" +msgstr "Groep is vol" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware bezig, probeer alternatieve pinnen" #: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware in gebruik, probeer alternatieve pinnen" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "" +msgstr "I/O actie op gesloten bestand" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C Init Fout" #: extmod/machine_i2c.c msgid "I2C operation not supported" -msgstr "" +msgstr "I2C actie niet ondersteund" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV %d bytes lang zijn" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Incompatibel .mpy bestand. Update alle .mpy bestanden. Zie http://adafru.it/" +"mpy-update voor meer informatie." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Incorrecte buffer grootte" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Input/Output fout" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Onvoldoende authenticatie" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Onvoldoende encryptie" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Interne define fout" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Interne fout #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" -msgstr "" +msgstr "Ongeldige %q pin" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Ongeldige ADC Unit waarde" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" -msgstr "" +msgstr "Ongeldig BMP bestand" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Ongeldige DAC pin opgegeven" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Ongeldige I2C pin selectie" #: 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 msgid "Invalid PWM frequency" -msgstr "" +msgstr "Ongeldige PWM frequentie" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Ongeldige SPI pin selectie" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Ongeldige UART pin selectie" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" -msgstr "" +msgstr "Ongeldig argument" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Ongeldige bits per waarde" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" -msgstr "" +msgstr "Ongeldige buffer grootte" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Ongeldige byteorder string" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" -msgstr "" +msgstr "Ongeldige kanaal aantallen" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "" +msgstr "Ongeldige richting." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" -msgstr "" +msgstr "Ongeldig bestand" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Ongeldig formaat stuk grootte" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Ongeldige frequentie opgegeven" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Ongeldig geheugen adres." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" -msgstr "" +msgstr "Ongeldig aantal bits" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid phase" -msgstr "" +msgstr "Ongeldige fase" #: 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 msgid "Invalid pin" -msgstr "" +msgstr "Ongeldige pin" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for left channel" -msgstr "" +msgstr "Ongeldige pin voor linker kanaal" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for right channel" -msgstr "" +msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c @@ -970,242 +981,246 @@ msgstr "" #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" -msgstr "" +msgstr "Ongeldige pinnen" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Ongeldige pinnen voor PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "Ongeldige polariteit" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Ongeldige eigenschappen" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "Ongeldige run modus." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "Ongeldige security_mode" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Ongeldige stem" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" -msgstr "" +msgstr "Ongeldig stem aantal" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" -msgstr "" +msgstr "Ongeldig wave bestand" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Ongeldig woord/bit lengte" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Sleutel moet 16, 24, of 32 bytes lang zijn" #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "" +msgstr "LHS van sleutelwoord arg moet een id zijn" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "Laag al in groep." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "Laag moet een Groep of TileGrid subklasse zijn." #: py/objslice.c msgid "Length must be an int" -msgstr "" +msgstr "Lengte moet een int zijn" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "Lengte moet niet negatief zijn" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "" +msgstr "MISO pin init mislukt." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "" +msgstr "MOSI pin init mislukt." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "Maximale x waarde indien gespiegeld is %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "MicroPython NLR sprong mislukt. Waarschijnlijk geheugen corruptie." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "MicroPython fatale fout." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Ontbrekende MISO of MOSI Pin" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "%q moet een subklasse zijn." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "MISO of MOSI moeten worden gegeven" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Naam te lang" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" -msgstr "" +msgstr "Negatieve stappen niet ondersteund" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Geen CCCD voor deze Characteristic" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" -msgstr "" +msgstr "Geen DAC op de chip" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "No DMA channel found" -msgstr "" +msgstr "Geen DMA kanaal gevonden" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Geen MISO pin" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Geen MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "Geen RX pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "Geen TX pin" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Geen klokken beschikbaar" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Geen verbinding: lengte kan niet worden bepaald" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "Geen standaard %q bus" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" -msgstr "" +msgstr "Geen vrije GCLKs" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Geen hardware random beschikbaar" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" -msgstr "" +msgstr "Geen hardware ondersteuning beschikbaar op clk pin" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "No hardware support on pin" -msgstr "" +msgstr "Geen hardware ondersteuning op pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Een sleutel was niet gespecificeerd" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Geen lange integer ondersteuning" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Geen timers meer beschikbaar op deze pin." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Geen pulldown op pin; 1MOhm aangeraden" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Geen ruimte meer beschikbaar op apparaat" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Bestand/map bestaat niet" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Geen timer beschikbaar" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Nordic Soft Device assertion mislukt." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" -msgstr "" +msgstr "Niet verbonden" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Wordt niet afgespeeld" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Object is gedeïnitialiseerd en kan niet meer gebruikt worden. Creëer een " +"nieuw object." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" -msgstr "" +msgstr "Oneven pariteit is niet ondersteund" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "" +msgstr "Alleen 8 of 16 bit mono met " #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"Alleen Windows formaat en ongecomprimeerd BMP ondersteund: gegeven header " +"grootte is %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1213,29 +1228,33 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"Alleen monochrome en 4bpp of 8bpp, en 16bpp of grotere geïndiceerde BMP's " +"zijn ondersteund: %d bpp is gegeven" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "Oversample moet een meervoud van 8 zijn." #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" +msgstr "PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"PWM frequentie is niet schrijfbaar wanneer de variable_frequency False is " +"tijdens constructie." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus nog niet ondersteund" #: py/moduerrno.c msgid "Permission denied" -msgstr "" +msgstr "Toegang geweigerd" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c @@ -1243,15 +1262,15 @@ msgstr "" #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" -msgstr "" +msgstr "Pin heeft geen ADC mogelijkheden" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin moet hardware interrupts ondersteunen" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Pin nummer al gereserveerd door EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1260,183 +1279,192 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinout gebruikt %d bytes per element, welke meer dan de ideale %d bytes " +"gebruikt. Als dit niet kan worden vermeden, geef dan het argument " +"allow_inefficient=True aan de constructor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" -msgstr "" +msgstr "En iedere module in het bestandssysteem\n" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop van een lege Ps2 buffer" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Prefix buffer moet op de heap zijn" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +"Druk een willekeurige toets om de REPL te starten. Gebruik CTRL+D om te " +"herstarten." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "Pull niet gebruikt wanneer de richting output is." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PusleIn niet ondersteund door deze chip" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut niet ondersteund door deze chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "RNG DeInit Fout" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "RNG Init Fout" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "RS485 inversie gespecificeerd terwijl niet in RS485 modus" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "" +msgstr "RTC calibratie niet ondersteund door dit board" #: shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "" +msgstr "RTC is niet ondersteund door dit board" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Random number generatie fout" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" -msgstr "" +msgstr "Alleen-lezen" #: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" -msgstr "" +msgstr "Alleen-lezen bestandssysteem" #: shared-module/displayio/Bitmap.c msgid "Read-only object" -msgstr "" +msgstr "Alleen-lezen object" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Verversing te snel" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Gevraagde AES modus is niet ondersteund" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" -msgstr "" +msgstr "Rechter kanaal niet ondersteund" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "Rij invoeging moet digitalio.DigitalInOut zijn" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" -msgstr "" +msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" #: main.c msgid "Running in safe mode! Not running saved code.\n" -msgstr "" +msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" #: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" -msgstr "" +msgstr "SDA of SCL hebben een pullup nodig" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI Init Fout" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI Herinitialisatie Fout" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "Sample rate moet positief zijn" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format msgid "Sample rate too high. It must be less than %d" -msgstr "" +msgstr "Sample rate is te hoog. Moet minder dan %d zijn" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Scan wordt al uitvoerd. Stop met stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Geselecteerde CTS pin niet geldig" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Geselecteerde RTS pin niet geldig" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" -msgstr "" +msgstr "Serializer in gebruik" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Slice en waarde hebben verschillende lengtes." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Slices niet ondersteund" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Bron en bestemming buffers moeten dezelfde lengte hebben" #: extmod/modure.c msgid "Splitting with sub-captures" -msgstr "" +msgstr "Splitting met sub-captures" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" -msgstr "" +msgstr "Stack grootte moet op zijn minst 256 zijn" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Stream mist readinto() of write() methode." #: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Geef op zijn minst 1 UART pin op" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Temperatuur lees time-out" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"De CircuitPyton heap is corrupt omdat de stack te klein was.\n" +"Vergroot de stack grootte als je weet hoe, zo niet:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"De `microcontroller` module is gebruikt om in veilige modus op te starten. " +"Druk reset om de veilige modus te verlaten.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1444,205 +1472,211 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Het vermogen van de microcontroller zakte. Zorg ervoor dat de " +"stroomvoorziening \n" +"voldoende vermogen heeft voor het hele systeem en druk reset (na uitwerpen " +"van CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "De sample's bits_per_sample komen niet overeen met die van de mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "De sample's kanaal aantal komt niet overeen met die van de mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "De sample's sample rate komt niet overeen met die van de mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "De sample's signature komt niet overeen met die van de mixer" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Tile hoogte moet exact de bitmap hoogte verdelen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Tile index buiten bereik" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Tile waarde buiten bereik" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Tile breedte moet exact de bitmap breedte verdelen" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "" +msgstr "Teveel kanalen in sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Teveel beeldscherm bussen" #: shared-module/displayio/__init__.c msgid "Too many displays" -msgstr "" +msgstr "Teveel beeldschermen" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "Totale data om te schrijven is groter dan outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "Traceback (meest recente call laatst):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "" +msgstr "Tuple of struct_time argument vereist" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UART Buffer allocatie fout" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "UART De-init fout" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UART Init Fout" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UART Re-init Fout" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART schrijf fout" #: shared-module/usb_hid/Device.c msgid "USB Busy" -msgstr "" +msgstr "USB Bezet" #: shared-module/usb_hid/Device.c msgid "USB Error" -msgstr "" +msgstr "USB Fout" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "UUID integer waarde moet tussen 0 en 0xffff liggen" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "UUID string is niet 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "UUID waarde is geen str, int, of byte buffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Unable to allocate buffers for signed conversion" -msgstr "" +msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Geen I2C beeldscherm gevonden bij %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Unable to find free GCLK" -msgstr "" +msgstr "Niet in staat een vrije GCLK te vinden" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "Niet in staat om de parser te initialiseren" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Niet in staat kleurenpalet data te lezen" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "" +msgstr "Niet in staat om naar nvm te schrijven." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "Onverwacht mrfx uuid type" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Onbekende gatt fout: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Onbekende reden." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Onbekende veiligheidsfout: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Onbekende soft device fout: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "Niet overeenkomend aantal RHS items (verwachtte %d, kreeg %d)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Ongespecificeerd probleem. Kan zijn dat de pariteit prompt op het andere " +"apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" -msgstr "" +msgstr "Niet-ondersteunde baudsnelheid" #: shared-module/displayio/display_core.c msgid "Unsupported display bus type" -msgstr "" +msgstr "Niet-ondersteund beeldscherm bus type" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" -msgstr "" +msgstr "Niet-ondersteunde format" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "" +msgstr "Niet-ondersteunde operatie" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "" +msgstr "Niet-ondersteunde pull-waarde." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Waarde lengte != vereist vaste lengte" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "Waarde length > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "" +msgstr "Viper-functies ondersteunen momenteel niet meer dan 4 argumenten" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Voltage lees time-out" #: main.c msgid "WARNING: Your code filename has two extensions\n" -msgstr "" +msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" #: py/builtinhelp.c #, c-format @@ -1653,109 +1687,114 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +"Welkom bij Adafruit CircuitPython %s!\n" +"\n" +"Bezoek learn.adafruit.com/category/circuitpython voor projectgidsen.\n" +"\n" +"Voor een lijst van ingebouwde modules, gebruik `help(\"modules\")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Schrijven niet ondersteund op Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Je bent in de veilige modus: er is iets onverwachts gebeurd.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " -msgstr "" +msgstr "Je hebt aangeven de veilige modus te starten door " #: py/objtype.c msgid "__init__() should return None" -msgstr "" +msgstr "__init __ () zou None moeten retourneren" #: py/objtype.c #, c-format msgid "__init__() should return None, not '%s'" -msgstr "" +msgstr "__init __ () zou None moeten retouneren, niet '%s'" #: py/objobject.c msgid "__new__ arg must be a user-type" -msgstr "" +msgstr "__new__ arg moet een user-type zijn" #: extmod/modubinascii.c extmod/moduhashlib.c msgid "a bytes-like object is required" -msgstr "" +msgstr "een bytes-achtig object is vereist" #: lib/embed/abort_.c msgid "abort() called" -msgstr "" +msgstr "abort() aangeroepen" #: extmod/machine_mem.c #, c-format msgid "address %08x is not aligned to %d bytes" -msgstr "" +msgstr "adres %08x is niet afgestemd op %d bytes" #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" -msgstr "" +msgstr "adres buiten bereik" #: shared-bindings/i2cslave/I2CSlave.c msgid "addresses is empty" -msgstr "" +msgstr "adressen zijn leeg" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 is alleen geïmplementeerd voor scalars en ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" -msgstr "" +msgstr "arg is een lege sequentie" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "argsort argument moet een ndarray zijn" #: py/runtime.c msgid "argument has wrong type" -msgstr "" +msgstr "argument heeft het verkeerde type" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "" +msgstr "argument num/typen komen niet overeen" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "" +msgstr "argument moet een '%q' zijn en niet een '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "argumenten moeten ndarrays zijn" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" -msgstr "" +msgstr "array/bytes vereist aan de rechterkant" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "poging om argmin/argmax van een lege sequentie te krijgen" #: py/objstr.c msgid "attributes not supported yet" -msgstr "" +msgstr "attributen nog niet ondersteund" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "as moet -1, 0, None, of 1 zijn" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "as moet -1, 0, of 1 zijn" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "as moet None, 0, of 1 zijn" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "verkeerde compileer modus" #: py/objstr.c msgid "bad conversion specifier" From 1d77000c19cc1100d5f748dff31a969ce9eb4eca Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 May 2020 10:30:47 -0700 Subject: [PATCH 621/919] Update doc deps --- docs/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index f2ec24c2ea..51029bcba8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ -sphinx==1.8.5 -recommonmark==0.5.0 +sphinx<3 +recommonmark==0.6.0 sphinxcontrib-svg2pdfconverter==0.1.0 astroid sphinx-autoapi From dbb304f4cf1ccb6916b3e36ec4daec087b9099de Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 19 May 2020 19:40:03 +0200 Subject: [PATCH 622/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/nl.po | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index ecae69eecd..c948425dab 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-12 14:37+1000\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -89,7 +89,7 @@ msgstr "%q lijst moet een lijst zijn" msgid "%q must be >= 1" msgstr "%q moet >= 1 zijn" -#: shared-bindings/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" @@ -500,7 +500,8 @@ msgstr "Kan '/' niet hermounten als USB actief is." #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." +msgstr "" +"Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -1238,7 +1239,8 @@ msgstr "Oversample moet een meervoud van 8 zijn." #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" +msgstr "" +"PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" #: shared-bindings/pulseio/PWMOut.c msgid "" @@ -1287,6 +1289,10 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "En iedere module in het bestandssysteem\n" +#: shared-module/vectorio/Polygon.c +msgid "Polygon needs at least 3 points" +msgstr "" + #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" msgstr "Pop van een lege Ps2 buffer" @@ -1509,6 +1515,11 @@ msgstr "Tile waarde buiten bereik" msgid "Tile width must exactly divide bitmap width" msgstr "Tile breedte moet exact de bitmap breedte verdelen" +#: ports/nrf/common-hal/_bleio/Adapter.c +#, c-format +msgid "Timeout is too long: Maximum timeout length is %d seconds" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -2160,10 +2171,6 @@ msgstr "" msgid "empty" msgstr "" -#: shared-bindings/vectorio/Polygon.c -msgid "empty %q list" -msgstr "" - #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3179,8 +3186,8 @@ msgstr "" msgid "unreadable attribute" msgstr "" -#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/Polygon.c -#: shared-bindings/vectorio/VectorShape.c +#: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c +#: shared-module/vectorio/Polygon.c msgid "unsupported %q type" msgstr "" From 2acd173e1459f7816e687ba5362a737e67c205fb Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 19 May 2020 13:54:47 -0400 Subject: [PATCH 623/919] Implement core requested changes --- ports/mimxrt10xx/Makefile | 4 +- .../mimxrt10xx/boards/feather_m7_1011/board.c | 5 - .../boards/feather_mimxrt1011/board.c | 5 - .../boards/feather_mimxrt1062/board.c | 11 -- .../common-hal/microcontroller/Pin.c | 14 +- .../common-hal/microcontroller/__init__.c | 91 +++++++------ .../peripherals/mimxrt10xx/MIMXRT1011/pins.c | 47 ------- .../peripherals/mimxrt10xx/MIMXRT1021/pins.c | 96 ------------- .../peripherals/mimxrt10xx/MIMXRT1062/pins.c | 127 ------------------ 9 files changed, 54 insertions(+), 346 deletions(-) diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 9e2c6d236d..922978ac2e 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -82,17 +82,15 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_ #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb # You may want to disable -flto if it interferes with debugging. # CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra else - CFLAGS += -ggdb #CFLAGS += -flto -flto-partition=none endif -CFLAGS += $(INC) -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # TODO: add these when -Werror is applied # Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/board.c b/ports/mimxrt10xx/boards/feather_m7_1011/board.c index 8763cd5708..ed543e1b06 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_13);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_12);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_09);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_12); @@ -43,10 +42,6 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_08); common_hal_never_reset_pin(&pin_GPIO_SD_07); common_hal_never_reset_pin(&pin_GPIO_SD_06); - - // USB Pins - common_hal_never_reset_pin(&pin_GPIO_12); - common_hal_never_reset_pin(&pin_GPIO_13); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c index 8763cd5708..ed543e1b06 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_13);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_12);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_09);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_12); @@ -43,10 +42,6 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_08); common_hal_never_reset_pin(&pin_GPIO_SD_07); common_hal_never_reset_pin(&pin_GPIO_SD_06); - - // USB Pins - common_hal_never_reset_pin(&pin_GPIO_12); - common_hal_never_reset_pin(&pin_GPIO_13); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c index c3895473ef..9878a62a29 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c @@ -33,25 +33,14 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO // FLEX flash - common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_01); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_02); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_03); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_04); - common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); - - // USB Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 0b438144ca..783ae4877d 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -24,7 +24,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" @@ -47,12 +47,10 @@ void reset_all_pins(void) { claimed_pins[i] = never_reset_pins[i]; } for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { - // mp_printf(&mp_plat_print, "CTL MUX i=%d:%x\n",i,IOMUXC->SW_MUX_CTL_PAD[i]); - // mp_printf(&mp_plat_print, "CTL PAD i=%d:%x\n",i,IOMUXC->SW_PAD_CTL_PAD[i]); - if(!(never_reset_pins[mcu_pin_list[i].port] & (1 << mcu_pin_list[i].number))) { - // mp_printf(&mp_plat_print, "SUCCESS\n"); - IOMUXC->SW_MUX_CTL_PAD[i] = mcu_pin_list[i].mux_reset; - IOMUXC->SW_PAD_CTL_PAD[i] = mcu_pin_list[i].pad_reset; + if(!(never_reset_pins[((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->port] + & (1 << ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->number))) { + IOMUXC->SW_MUX_CTL_PAD[i] = ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->mux_reset; + IOMUXC->SW_PAD_CTL_PAD[i] = ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->pad_reset; } } @@ -116,7 +114,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { } void common_hal_mcu_pin_reset_number(uint8_t pin_no) { - common_hal_reset_pin(&mcu_pin_list[pin_no]); + common_hal_reset_pin((mcu_pin_obj_t*)(mcu_pin_globals.map.table[pin_no].value)); } // TODO: replace use of GPIO pointers in pin struct with this system? diff --git a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c index a9f4c740fe..6a8537e2da 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c @@ -107,53 +107,53 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { #endif // This maps MCU pin names to pin objects. +// NOTE: for all i.MX chips, order MUST match _iomuxc_sw_mux_ctl_pad enum STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { #ifdef MIMXRT1011_SERIES - { MP_ROM_QSTR(MP_QSTR_GPIO_00), MP_ROM_PTR(&pin_GPIO_00) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_01), MP_ROM_PTR(&pin_GPIO_01) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_02), MP_ROM_PTR(&pin_GPIO_02) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_03), MP_ROM_PTR(&pin_GPIO_03) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_04), MP_ROM_PTR(&pin_GPIO_04) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_05), MP_ROM_PTR(&pin_GPIO_05) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_06), MP_ROM_PTR(&pin_GPIO_06) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_07), MP_ROM_PTR(&pin_GPIO_07) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_08), MP_ROM_PTR(&pin_GPIO_08) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_09), MP_ROM_PTR(&pin_GPIO_09) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_10), MP_ROM_PTR(&pin_GPIO_10) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_11), MP_ROM_PTR(&pin_GPIO_11) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_12), MP_ROM_PTR(&pin_GPIO_12) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_13), MP_ROM_PTR(&pin_GPIO_13) }, - - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_00), MP_ROM_PTR(&pin_GPIO_SD_00) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_01), MP_ROM_PTR(&pin_GPIO_SD_01) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_02), MP_ROM_PTR(&pin_GPIO_SD_02) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_03), MP_ROM_PTR(&pin_GPIO_SD_03) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_04), MP_ROM_PTR(&pin_GPIO_SD_04) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_05), MP_ROM_PTR(&pin_GPIO_SD_05) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_06), MP_ROM_PTR(&pin_GPIO_SD_06) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_07), MP_ROM_PTR(&pin_GPIO_SD_07) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_08), MP_ROM_PTR(&pin_GPIO_SD_08) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_09), MP_ROM_PTR(&pin_GPIO_SD_09) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_10), MP_ROM_PTR(&pin_GPIO_SD_10) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_11), MP_ROM_PTR(&pin_GPIO_SD_11) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_12), MP_ROM_PTR(&pin_GPIO_SD_12) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_SD_13), MP_ROM_PTR(&pin_GPIO_SD_13) }, - - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_00), MP_ROM_PTR(&pin_GPIO_AD_00) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_01), MP_ROM_PTR(&pin_GPIO_AD_01) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_02), MP_ROM_PTR(&pin_GPIO_AD_02) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_03), MP_ROM_PTR(&pin_GPIO_AD_03) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_04), MP_ROM_PTR(&pin_GPIO_AD_04) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_05), MP_ROM_PTR(&pin_GPIO_AD_05) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_06), MP_ROM_PTR(&pin_GPIO_AD_06) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_07), MP_ROM_PTR(&pin_GPIO_AD_07) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_08), MP_ROM_PTR(&pin_GPIO_AD_08) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_09), MP_ROM_PTR(&pin_GPIO_AD_09) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_10), MP_ROM_PTR(&pin_GPIO_AD_10) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_11), MP_ROM_PTR(&pin_GPIO_AD_11) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_12), MP_ROM_PTR(&pin_GPIO_AD_12) }, - { MP_ROM_QSTR(MP_QSTR_GPIO_AD_13), MP_ROM_PTR(&pin_GPIO_AD_13) }, { MP_ROM_QSTR(MP_QSTR_GPIO_AD_14), MP_ROM_PTR(&pin_GPIO_AD_14) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_13), MP_ROM_PTR(&pin_GPIO_AD_13) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_12), MP_ROM_PTR(&pin_GPIO_AD_12) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_11), MP_ROM_PTR(&pin_GPIO_AD_11) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_10), MP_ROM_PTR(&pin_GPIO_AD_10) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_09), MP_ROM_PTR(&pin_GPIO_AD_09) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_08), MP_ROM_PTR(&pin_GPIO_AD_08) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_07), MP_ROM_PTR(&pin_GPIO_AD_07) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_06), MP_ROM_PTR(&pin_GPIO_AD_06) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_05), MP_ROM_PTR(&pin_GPIO_AD_05) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_04), MP_ROM_PTR(&pin_GPIO_AD_04) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_03), MP_ROM_PTR(&pin_GPIO_AD_03) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_02), MP_ROM_PTR(&pin_GPIO_AD_02) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_01), MP_ROM_PTR(&pin_GPIO_AD_01) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_AD_00), MP_ROM_PTR(&pin_GPIO_AD_00) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_14), MP_ROM_PTR(&pin_GPIO_SD_14) }, //spooky ghost pin + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_13), MP_ROM_PTR(&pin_GPIO_SD_13) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_12), MP_ROM_PTR(&pin_GPIO_SD_12) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_11), MP_ROM_PTR(&pin_GPIO_SD_11) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_10), MP_ROM_PTR(&pin_GPIO_SD_10) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_09), MP_ROM_PTR(&pin_GPIO_SD_09) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_08), MP_ROM_PTR(&pin_GPIO_SD_08) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_07), MP_ROM_PTR(&pin_GPIO_SD_07) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_06), MP_ROM_PTR(&pin_GPIO_SD_06) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_05), MP_ROM_PTR(&pin_GPIO_SD_05) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_04), MP_ROM_PTR(&pin_GPIO_SD_04) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_03), MP_ROM_PTR(&pin_GPIO_SD_03) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_02), MP_ROM_PTR(&pin_GPIO_SD_02) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_01), MP_ROM_PTR(&pin_GPIO_SD_01) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_00), MP_ROM_PTR(&pin_GPIO_SD_00) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_13), MP_ROM_PTR(&pin_GPIO_13) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_12), MP_ROM_PTR(&pin_GPIO_12) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_11), MP_ROM_PTR(&pin_GPIO_11) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_10), MP_ROM_PTR(&pin_GPIO_10) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_09), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_08), MP_ROM_PTR(&pin_GPIO_08) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_07), MP_ROM_PTR(&pin_GPIO_07) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_06), MP_ROM_PTR(&pin_GPIO_06) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_05), MP_ROM_PTR(&pin_GPIO_05) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_04), MP_ROM_PTR(&pin_GPIO_04) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_03), MP_ROM_PTR(&pin_GPIO_03) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_02), MP_ROM_PTR(&pin_GPIO_02) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_01), MP_ROM_PTR(&pin_GPIO_01) }, + { MP_ROM_QSTR(MP_QSTR_GPIO_00), MP_ROM_PTR(&pin_GPIO_00) }, #else { MP_ROM_QSTR(MP_QSTR_GPIO_EMC_00), MP_ROM_PTR(&pin_GPIO_EMC_00) }, { MP_ROM_QSTR(MP_QSTR_GPIO_EMC_01), MP_ROM_PTR(&pin_GPIO_EMC_01) }, @@ -269,6 +269,9 @@ STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B0_03), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B0_04), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B0_05), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + #ifdef MIMXRT1021_SERIES + { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B0_06), MP_ROM_PTR(&pin_GPIO_SD_B0_06) }, + #endif { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B1_00), MP_ROM_PTR(&pin_GPIO_SD_B1_00) }, { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B1_01), MP_ROM_PTR(&pin_GPIO_SD_B1_01) }, { MP_ROM_QSTR(MP_QSTR_GPIO_SD_B1_02), MP_ROM_PTR(&pin_GPIO_SD_B1_02) }, diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c index 034efb3b6e..b60dcbdabb 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c @@ -76,50 +76,3 @@ const mcu_pin_obj_t pin_GPIO_SD_12 = PIN(GPIO2, 1, 12, GPIO_SD_12, NO_ADC, 0, 0x const mcu_pin_obj_t pin_GPIO_SD_13 = PIN(GPIO2, 1, 13, GPIO_SD_13, NO_ADC, 0, 0x00000005, 0x000010A0); const mcu_pin_obj_t pin_GPIO_SD_14 = PIN(GPIO2, 1, 14, GPIO_SD_14, NO_ADC, 0, 0x00000000, 0x000010A0); // pin_GPIO_SD_14 isn't actually used as a pad but we include it anyway to make resetting easier - -const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { - pin_GPIO_AD_14, - pin_GPIO_AD_13, - pin_GPIO_AD_12, - pin_GPIO_AD_11, - pin_GPIO_AD_10, - pin_GPIO_AD_09, - pin_GPIO_AD_08, - pin_GPIO_AD_07, - pin_GPIO_AD_06, - pin_GPIO_AD_05, - pin_GPIO_AD_04, - pin_GPIO_AD_03, - pin_GPIO_AD_02, - pin_GPIO_AD_01, - pin_GPIO_AD_00, - pin_GPIO_SD_14, //spooky ghost pin - pin_GPIO_SD_13, - pin_GPIO_SD_12, - pin_GPIO_SD_11, - pin_GPIO_SD_10, - pin_GPIO_SD_09, - pin_GPIO_SD_08, - pin_GPIO_SD_07, - pin_GPIO_SD_06, - pin_GPIO_SD_05, - pin_GPIO_SD_04, - pin_GPIO_SD_03, - pin_GPIO_SD_02, - pin_GPIO_SD_01, - pin_GPIO_SD_00, - pin_GPIO_13, - pin_GPIO_12, - pin_GPIO_11, - pin_GPIO_10, - pin_GPIO_09, - pin_GPIO_08, - pin_GPIO_07, - pin_GPIO_06, - pin_GPIO_05, - pin_GPIO_04, - pin_GPIO_03, - pin_GPIO_02, - pin_GPIO_01, - pin_GPIO_00, -}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c index 629fdf4bd6..d992931f2c 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c @@ -126,99 +126,3 @@ const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 28, GPIO_SD_B1_08, NO_ADC, const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 29, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 30, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 31, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { - pin_GPIO_EMC_00, - pin_GPIO_EMC_01, - pin_GPIO_EMC_02, - pin_GPIO_EMC_03, - pin_GPIO_EMC_04, - pin_GPIO_EMC_05, - pin_GPIO_EMC_06, - pin_GPIO_EMC_07, - pin_GPIO_EMC_08, - pin_GPIO_EMC_09, - pin_GPIO_EMC_10, - pin_GPIO_EMC_11, - pin_GPIO_EMC_12, - pin_GPIO_EMC_13, - pin_GPIO_EMC_14, - pin_GPIO_EMC_15, - pin_GPIO_EMC_16, - pin_GPIO_EMC_17, - pin_GPIO_EMC_18, - pin_GPIO_EMC_19, - pin_GPIO_EMC_20, - pin_GPIO_EMC_21, - pin_GPIO_EMC_22, - pin_GPIO_EMC_23, - pin_GPIO_EMC_24, - pin_GPIO_EMC_25, - pin_GPIO_EMC_26, - pin_GPIO_EMC_27, - pin_GPIO_EMC_28, - pin_GPIO_EMC_29, - pin_GPIO_EMC_30, - pin_GPIO_EMC_31, - pin_GPIO_EMC_32, - pin_GPIO_EMC_33, - pin_GPIO_EMC_34, - pin_GPIO_EMC_35, - pin_GPIO_EMC_36, - pin_GPIO_EMC_37, - pin_GPIO_EMC_38, - pin_GPIO_EMC_39, - pin_GPIO_EMC_40, - pin_GPIO_EMC_41, - pin_GPIO_AD_B0_00, - pin_GPIO_AD_B0_01, - pin_GPIO_AD_B0_02, - pin_GPIO_AD_B0_03, - pin_GPIO_AD_B0_04, - pin_GPIO_AD_B0_05, - pin_GPIO_AD_B0_06, - pin_GPIO_AD_B0_07, - pin_GPIO_AD_B0_08, - pin_GPIO_AD_B0_09, - pin_GPIO_AD_B0_10, - pin_GPIO_AD_B0_11, - pin_GPIO_AD_B0_12, - pin_GPIO_AD_B0_13, - pin_GPIO_AD_B0_14, - pin_GPIO_AD_B0_15, - pin_GPIO_AD_B1_00, - pin_GPIO_AD_B1_01, - pin_GPIO_AD_B1_02, - pin_GPIO_AD_B1_03, - pin_GPIO_AD_B1_04, - pin_GPIO_AD_B1_05, - pin_GPIO_AD_B1_06, - pin_GPIO_AD_B1_07, - pin_GPIO_AD_B1_08, - pin_GPIO_AD_B1_09, - pin_GPIO_AD_B1_10, - pin_GPIO_AD_B1_11, - pin_GPIO_AD_B1_12, - pin_GPIO_AD_B1_13, - pin_GPIO_AD_B1_14, - pin_GPIO_AD_B1_15, - pin_GPIO_SD_B0_00, - pin_GPIO_SD_B0_01, - pin_GPIO_SD_B0_02, - pin_GPIO_SD_B0_03, - pin_GPIO_SD_B0_04, - pin_GPIO_SD_B0_05, - pin_GPIO_SD_B0_06, - pin_GPIO_SD_B1_00, - pin_GPIO_SD_B1_01, - pin_GPIO_SD_B1_02, - pin_GPIO_SD_B1_03, - pin_GPIO_SD_B1_04, - pin_GPIO_SD_B1_05, - pin_GPIO_SD_B1_06, - pin_GPIO_SD_B1_07, - pin_GPIO_SD_B1_08, - pin_GPIO_SD_B1_09, - pin_GPIO_SD_B1_10, - pin_GPIO_SD_B1_11, -}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c index 5b3fce1f5e..4bb025f372 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c @@ -159,130 +159,3 @@ const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 8, GPIO_B1_08, NO_ADC, 0, const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t mcu_pin_list[IOMUXC_SW_PAD_CTL_PAD_COUNT] = { - pin_GPIO_EMC_00, - pin_GPIO_EMC_01, - pin_GPIO_EMC_02, - pin_GPIO_EMC_03, - pin_GPIO_EMC_04, - pin_GPIO_EMC_05, - pin_GPIO_EMC_06, - pin_GPIO_EMC_07, - pin_GPIO_EMC_08, - pin_GPIO_EMC_09, - pin_GPIO_EMC_10, - pin_GPIO_EMC_11, - pin_GPIO_EMC_12, - pin_GPIO_EMC_13, - pin_GPIO_EMC_14, - pin_GPIO_EMC_15, - pin_GPIO_EMC_16, - pin_GPIO_EMC_17, - pin_GPIO_EMC_18, - pin_GPIO_EMC_19, - pin_GPIO_EMC_20, - pin_GPIO_EMC_21, - pin_GPIO_EMC_22, - pin_GPIO_EMC_23, - pin_GPIO_EMC_24, - pin_GPIO_EMC_25, - pin_GPIO_EMC_26, - pin_GPIO_EMC_27, - pin_GPIO_EMC_28, - pin_GPIO_EMC_29, - pin_GPIO_EMC_30, - pin_GPIO_EMC_31, - pin_GPIO_EMC_32, - pin_GPIO_EMC_33, - pin_GPIO_EMC_34, - pin_GPIO_EMC_35, - pin_GPIO_EMC_36, - pin_GPIO_EMC_37, - pin_GPIO_EMC_38, - pin_GPIO_EMC_39, - pin_GPIO_EMC_40, - pin_GPIO_EMC_41, - pin_GPIO_AD_B0_00, - pin_GPIO_AD_B0_01, - pin_GPIO_AD_B0_02, - pin_GPIO_AD_B0_03, - pin_GPIO_AD_B0_04, - pin_GPIO_AD_B0_05, - pin_GPIO_AD_B0_06, - pin_GPIO_AD_B0_07, - pin_GPIO_AD_B0_08, - pin_GPIO_AD_B0_09, - pin_GPIO_AD_B0_10, - pin_GPIO_AD_B0_11, - pin_GPIO_AD_B0_12, - pin_GPIO_AD_B0_13, - pin_GPIO_AD_B0_14, - pin_GPIO_AD_B0_15, - pin_GPIO_AD_B1_00, - pin_GPIO_AD_B1_01, - pin_GPIO_AD_B1_02, - pin_GPIO_AD_B1_03, - pin_GPIO_AD_B1_04, - pin_GPIO_AD_B1_05, - pin_GPIO_AD_B1_06, - pin_GPIO_AD_B1_07, - pin_GPIO_AD_B1_08, - pin_GPIO_AD_B1_09, - pin_GPIO_AD_B1_10, - pin_GPIO_AD_B1_11, - pin_GPIO_AD_B1_12, - pin_GPIO_AD_B1_13, - pin_GPIO_AD_B1_14, - pin_GPIO_AD_B1_15, - pin_GPIO_B0_00, - pin_GPIO_B0_01, - pin_GPIO_B0_02, - pin_GPIO_B0_03, - pin_GPIO_B0_04, - pin_GPIO_B0_05, - pin_GPIO_B0_06, - pin_GPIO_B0_07, - pin_GPIO_B0_08, - pin_GPIO_B0_09, - pin_GPIO_B0_10, - pin_GPIO_B0_11, - pin_GPIO_B0_12, - pin_GPIO_B0_13, - pin_GPIO_B0_14, - pin_GPIO_B0_15, - pin_GPIO_B1_00, - pin_GPIO_B1_01, - pin_GPIO_B1_02, - pin_GPIO_B1_03, - pin_GPIO_B1_04, - pin_GPIO_B1_05, - pin_GPIO_B1_06, - pin_GPIO_B1_07, - pin_GPIO_B1_08, - pin_GPIO_B1_09, - pin_GPIO_B1_10, - pin_GPIO_B1_11, - pin_GPIO_B1_12, - pin_GPIO_B1_13, - pin_GPIO_B1_14, - pin_GPIO_B1_15, - pin_GPIO_SD_B0_00, - pin_GPIO_SD_B0_01, - pin_GPIO_SD_B0_02, - pin_GPIO_SD_B0_03, - pin_GPIO_SD_B0_04, - pin_GPIO_SD_B0_05, - pin_GPIO_SD_B1_00, - pin_GPIO_SD_B1_01, - pin_GPIO_SD_B1_02, - pin_GPIO_SD_B1_03, - pin_GPIO_SD_B1_04, - pin_GPIO_SD_B1_05, - pin_GPIO_SD_B1_06, - pin_GPIO_SD_B1_07, - pin_GPIO_SD_B1_08, - pin_GPIO_SD_B1_09, - pin_GPIO_SD_B1_10, - pin_GPIO_SD_B1_11, -}; From 9eb85a5febeaffa85295c72467b3e4dd6b83a929 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 May 2020 10:55:02 -0700 Subject: [PATCH 624/919] shrink Xinabox CS11 by turning off unused pins --- .../boards/xinabox_cs11/mpconfigboard.h | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h index 9699568dad..0b2f99c56e 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h @@ -22,3 +22,34 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// Turn off pins not in the board mapping to save space. They aren't broken out. +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA03 1 + +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 + +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PA06 1 +#define IGNORE_PIN_PA08 1 + +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PA18 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 + +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 + +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 From b310b040073d636ead04d3c9c3a4338e18e1627d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 19 May 2020 14:20:07 -0400 Subject: [PATCH 625/919] Remove pin/port distinction --- .../common-hal/digitalio/DigitalInOut.c | 2 +- .../common-hal/microcontroller/Pin.c | 49 ++-- .../common-hal/microcontroller/Pin.h | 3 - .../peripherals/mimxrt10xx/MIMXRT1011/pins.c | 90 +++---- .../peripherals/mimxrt10xx/MIMXRT1021/pins.c | 190 +++++++------ .../peripherals/mimxrt10xx/MIMXRT1062/pins.c | 254 +++++++++--------- .../mimxrt10xx/peripherals/mimxrt10xx/pins.h | 6 +- 7 files changed, 283 insertions(+), 311 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 4c2f8c87ee..4931599d4e 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -74,7 +74,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { - never_reset_pin_number(self->pin->port, self->pin->number); + common_hal_never_reset_pin(self->pin); } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self) { diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 783ae4877d..4989a91863 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -34,21 +34,19 @@ bool neopixel_in_use; #define GPIO_PORT_COUNT (IOMUXC_SW_PAD_CTL_PAD_COUNT / 32 + 1) -// GPIO ports are 32 pins wide -STATIC uint32_t claimed_pins[GPIO_PORT_COUNT]; //remove? -STATIC uint32_t never_reset_pins[GPIO_PORT_COUNT]; +STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; +STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; // There are two numbering systems used here: // IOMUXC index, used for iterating through pins and accessing reset information, // and GPIO port and number, used to store claimed and reset tagging. The two number // systems are not related and one cannot determine the other without a pin object void reset_all_pins(void) { - for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { + for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { claimed_pins[i] = never_reset_pins[i]; } for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { - if(!(never_reset_pins[((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->port] - & (1 << ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->number))) { + if(!never_reset_pins[i]) { IOMUXC->SW_MUX_CTL_PAD[i] = ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->mux_reset; IOMUXC->SW_PAD_CTL_PAD[i] = ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value))->pad_reset; } @@ -59,15 +57,11 @@ void reset_all_pins(void) { #endif } -void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { - never_reset_pins[pin_port] |= 1 << pin_number; -} - // Since i.MX pins need extra register and reset information to reset properly, // resetting pins by number alone has been removed. void common_hal_reset_pin(const mcu_pin_obj_t* pin) { - never_reset_pins[pin->port] &= ~(1 << pin->number); - claimed_pins[pin->port] &= ~(1 << pin->number); + never_reset_pins[pin->mux_idx] = false; + claimed_pins[pin->mux_idx] = false; *(uint32_t*)pin->mux_reg = pin->mux_reset; *(uint32_t*)pin->cfg_reg = pin->pad_reset; @@ -81,17 +75,7 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin) { } void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { - never_reset_pin_number(pin->port, pin->number); -} - -void claim_pin(const mcu_pin_obj_t* pin) { - claimed_pins[pin->port] |= 1 << pin->number; - - #ifdef MICROPY_HW_NEOPIXEL - if (pin == MICROPY_HW_NEOPIXEL) { - neopixel_in_use = true; - } - #endif + never_reset_pins[pin->mux_idx] = true; } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { @@ -101,22 +85,27 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { } #endif - return !(claimed_pins[pin->port] & 1<number); + return !claimed_pins[pin->mux_idx]; } uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) { return pin->mux_idx; // returns IOMUXC to align with pin table - // Note: IOMUXC "numbers" do not align cleanly with GPIO values } void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { - claim_pin(pin); + claimed_pins[pin->mux_idx] = true; + + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + neopixel_in_use = true; + } + #endif +} + +void claim_pin(const mcu_pin_obj_t* pin) { + common_hal_mcu_pin_claim(pin); } void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t*)(mcu_pin_globals.map.table[pin_no].value)); } - -// TODO: replace use of GPIO pointers in pin struct with this system? -// GPIO_TypeDef * pin_port(uint8_t pin_port) {} -// uint16_t pin_mask(uint8_t pin_number) {} diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index def583973b..59ca83082e 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -37,9 +37,6 @@ extern bool neopixel_in_use; #endif void reset_all_pins(void); -// reset_pin_number takes the pin number instead of the pointer so that objects don't -// need to store a full pointer. -void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); void claim_pin(const mcu_pin_obj_t* pin); #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c index b60dcbdabb..cfab35cea8 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/pins.c @@ -29,50 +29,48 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_00 = PIN(GPIO1, 0, 0, GPIO_00, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_01 = PIN(GPIO1, 0, 1, GPIO_01, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_02 = PIN(GPIO1, 0, 2, GPIO_02, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_03 = PIN(GPIO1, 0, 3, GPIO_03, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_04 = PIN(GPIO1, 0, 4, GPIO_04, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_05 = PIN(GPIO1, 0, 5, GPIO_05, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_06 = PIN(GPIO1, 0, 6, GPIO_06, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_07 = PIN(GPIO1, 0, 7, GPIO_07, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_08 = PIN(GPIO1, 0, 8, GPIO_08, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_09 = PIN(GPIO1, 0, 9, GPIO_09, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_10 = PIN(GPIO1, 0, 10, GPIO_10, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_11 = PIN(GPIO1, 0, 11, GPIO_11, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_12 = PIN(GPIO1, 0, 12, GPIO_12, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_13 = PIN(GPIO1, 0, 13, GPIO_13, NO_ADC, 0, 0x00000005, 0x000010A0); - -const mcu_pin_obj_t pin_GPIO_AD_00 = PIN(GPIO1, 0, 14, GPIO_AD_00, ADC1, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_01 = PIN(GPIO1, 0, 15, GPIO_AD_01, ADC1, 1, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_02 = PIN(GPIO1, 0, 16, GPIO_AD_02, ADC1, 2, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_03 = PIN(GPIO1, 0, 17, GPIO_AD_03, ADC1, 3, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_04 = PIN(GPIO1, 0, 18, GPIO_AD_04, ADC1, 4, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_05 = PIN(GPIO1, 0, 19, GPIO_AD_05, ADC1, 5, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_06 = PIN(GPIO1, 0, 20, GPIO_AD_06, ADC1, 6, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_07 = PIN(GPIO1, 0, 21, GPIO_AD_07, ADC1, 7, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_AD_08 = PIN(GPIO1, 0, 22, GPIO_AD_08, ADC1, 8, 0x00000007, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_09 = PIN(GPIO1, 0, 23, GPIO_AD_09, ADC1, 9, 0x00000007, 0x000090B1); -const mcu_pin_obj_t pin_GPIO_AD_10 = PIN(GPIO1, 0, 24, GPIO_AD_10, ADC1, 10, 0x00000007, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_11 = PIN(GPIO1, 0, 25, GPIO_AD_11, ADC1, 11, 0x00000007, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_12 = PIN(GPIO1, 0, 26, GPIO_AD_12, ADC1, 12, 0x00000007, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_13 = PIN(GPIO1, 0, 27, GPIO_AD_13, ADC1, 13, 0x00000007, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_14 = PIN(GPIO1, 0, 28, GPIO_AD_14, ADC1, 14, 0x00000005, 0x000010A0); - -const mcu_pin_obj_t pin_GPIO_SD_00 = PIN(GPIO2, 1, 0, GPIO_SD_00, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_01 = PIN(GPIO2, 1, 1, GPIO_SD_01, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_02 = PIN(GPIO2, 1, 2, GPIO_SD_02, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_03 = PIN(GPIO2, 1, 3, GPIO_SD_03, NO_ADC, 0, 0x00000006, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_SD_04 = PIN(GPIO2, 1, 4, GPIO_SD_04, NO_ADC, 0, 0x00000006, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_SD_05 = PIN(GPIO2, 1, 5, GPIO_SD_05, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_06 = PIN(GPIO2, 1, 6, GPIO_SD_06, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_07 = PIN(GPIO2, 1, 7, GPIO_SD_07, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_08 = PIN(GPIO2, 1, 8, GPIO_SD_08, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_09 = PIN(GPIO2, 1, 9, GPIO_SD_09, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_10 = PIN(GPIO2, 1, 10, GPIO_SD_10, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_11 = PIN(GPIO2, 1, 11, GPIO_SD_11, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_12 = PIN(GPIO2, 1, 12, GPIO_SD_12, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_13 = PIN(GPIO2, 1, 13, GPIO_SD_13, NO_ADC, 0, 0x00000005, 0x000010A0); -const mcu_pin_obj_t pin_GPIO_SD_14 = PIN(GPIO2, 1, 14, GPIO_SD_14, NO_ADC, 0, 0x00000000, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_00 = PIN(GPIO1, 0, GPIO_00, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_01 = PIN(GPIO1, 1, GPIO_01, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_02 = PIN(GPIO1, 2, GPIO_02, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_03 = PIN(GPIO1, 3, GPIO_03, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_04 = PIN(GPIO1, 4, GPIO_04, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_05 = PIN(GPIO1, 5, GPIO_05, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_06 = PIN(GPIO1, 6, GPIO_06, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_07 = PIN(GPIO1, 7, GPIO_07, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_08 = PIN(GPIO1, 8, GPIO_08, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_09 = PIN(GPIO1, 9, GPIO_09, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_10 = PIN(GPIO1, 10, GPIO_10, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_11 = PIN(GPIO1, 11, GPIO_11, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_12 = PIN(GPIO1, 12, GPIO_12, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_13 = PIN(GPIO1, 13, GPIO_13, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_00 = PIN(GPIO1, 14, GPIO_AD_00, ADC1, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_01 = PIN(GPIO1, 15, GPIO_AD_01, ADC1, 1, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_02 = PIN(GPIO1, 16, GPIO_AD_02, ADC1, 2, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_03 = PIN(GPIO1, 17, GPIO_AD_03, ADC1, 3, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_04 = PIN(GPIO1, 18, GPIO_AD_04, ADC1, 4, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_05 = PIN(GPIO1, 19, GPIO_AD_05, ADC1, 5, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_06 = PIN(GPIO1, 20, GPIO_AD_06, ADC1, 6, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_07 = PIN(GPIO1, 21, GPIO_AD_07, ADC1, 7, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_AD_08 = PIN(GPIO1, 22, GPIO_AD_08, ADC1, 8, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_09 = PIN(GPIO1, 23, GPIO_AD_09, ADC1, 9, 0x00000007, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_10 = PIN(GPIO1, 24, GPIO_AD_10, ADC1, 10, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_11 = PIN(GPIO1, 25, GPIO_AD_11, ADC1, 11, 0x00000007, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_12 = PIN(GPIO1, 26, GPIO_AD_12, ADC1, 12, 0x00000007, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_13 = PIN(GPIO1, 27, GPIO_AD_13, ADC1, 13, 0x00000007, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_14 = PIN(GPIO1, 28, GPIO_AD_14, ADC1, 14, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_00 = PIN(GPIO2, 0, GPIO_SD_00, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_01 = PIN(GPIO2, 1, GPIO_SD_01, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_02 = PIN(GPIO2, 2, GPIO_SD_02, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_03 = PIN(GPIO2, 3, GPIO_SD_03, NO_ADC, 0, 0x00000006, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_SD_04 = PIN(GPIO2, 4, GPIO_SD_04, NO_ADC, 0, 0x00000006, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_SD_05 = PIN(GPIO2, 5, GPIO_SD_05, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_06 = PIN(GPIO2, 6, GPIO_SD_06, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_07 = PIN(GPIO2, 7, GPIO_SD_07, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_08 = PIN(GPIO2, 8, GPIO_SD_08, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_09 = PIN(GPIO2, 9, GPIO_SD_09, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_10 = PIN(GPIO2, 10, GPIO_SD_10, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_11 = PIN(GPIO2, 11, GPIO_SD_11, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_12 = PIN(GPIO2, 12, GPIO_SD_12, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_13 = PIN(GPIO2, 13, GPIO_SD_13, NO_ADC, 0, 0x00000005, 0x000010A0); +const mcu_pin_obj_t pin_GPIO_SD_14 = PIN(GPIO2, 14, GPIO_SD_14, NO_ADC, 0, 0x00000000, 0x000010A0); // pin_GPIO_SD_14 isn't actually used as a pad but we include it anyway to make resetting easier diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c index d992931f2c..a25937cab7 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/pins.c @@ -29,100 +29,96 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 0, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000000, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 0, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000000, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 0, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 0, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000090B1); -const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 0, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 0, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 0, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 0, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 0, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 0, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 0, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 0, 12, GPIO_AD_B0_12, ADC1, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 0, 13, GPIO_AD_B0_13, ADC2, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 0, 14, GPIO_AD_B0_14, ADC2, 1, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 0, 15, GPIO_AD_B0_15, ADC1, 2, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 0, 16, GPIO_AD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 0, 17, GPIO_AD_B1_01, ADC1, 3, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 0, 18, GPIO_AD_B1_02, ADC2, 3, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 0, 19, GPIO_AD_B1_03, ADC1, 4, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 0, 20, GPIO_AD_B1_04, ADC2, 4, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 0, 21, GPIO_AD_B1_05, ADC2, 5, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 0, 22, GPIO_AD_B1_06, ADC2, 6, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 0, 23, GPIO_AD_B1_07, ADC2, 7, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 0, 24, GPIO_AD_B1_08, ADC2, 8, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 0, 25, GPIO_AD_B1_09, ADC2, 9, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 0, 26, GPIO_AD_B1_10, ADC2, 10, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 0, 27, GPIO_AD_B1_11, ADC2, 11, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 0, 28, GPIO_AD_B1_12, ADC2, 12, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 0, 29, GPIO_AD_B1_13, ADC2, 13, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 0, 30, GPIO_AD_B1_14, ADC2, 14, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 0, 31, GPIO_AD_B1_15, ADC2, 15, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO2, 1, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO2, 1, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO2, 1, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO2, 1, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO2, 1, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO2, 1, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO2, 1, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO2, 1, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO2, 1, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO2, 1, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO2, 1, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO2, 1, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO2, 1, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO2, 1, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO2, 1, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO2, 1, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO2, 1, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000006, 0x000030B0); -const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO2, 1, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000006, 0x000030B0); -const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO2, 1, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO2, 1, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO2, 1, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO2, 1, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO2, 1, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO2, 1, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO2, 1, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO2, 1, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO2, 1, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO2, 1, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO2, 1, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO2, 1, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000030B0); -const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO2, 1, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO2, 1, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 1, 0, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 1, 1, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 1, 2, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 1, 3, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 1, 4, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 1, 5, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 1, 6, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 1, 7, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 1, 8, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 1, 9, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 2, 13, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 2, 14, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 2, 15, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 2, 16, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 2, 17, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 2, 18, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_06 = PIN(GPIO3, 2, 19, GPIO_SD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 2, 20, GPIO_SD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 2, 21, GPIO_SD_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, 22, GPIO_SD_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 2, 23, GPIO_SD_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 2, 24, GPIO_SD_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 2, 25, GPIO_SD_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 2, 26, GPIO_SD_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 2, 27, GPIO_SD_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 28, GPIO_SD_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 29, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 30, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 31, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 12, GPIO_AD_B0_12, ADC1, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 13, GPIO_AD_B0_13, ADC2, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 14, GPIO_AD_B0_14, ADC2, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 15, GPIO_AD_B0_15, ADC1, 2, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 16, GPIO_AD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 17, GPIO_AD_B1_01, ADC1, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 18, GPIO_AD_B1_02, ADC2, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 19, GPIO_AD_B1_03, ADC1, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 20, GPIO_AD_B1_04, ADC2, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 21, GPIO_AD_B1_05, ADC2, 5, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 22, GPIO_AD_B1_06, ADC2, 6, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 23, GPIO_AD_B1_07, ADC2, 7, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 24, GPIO_AD_B1_08, ADC2, 8, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 25, GPIO_AD_B1_09, ADC2, 9, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 26, GPIO_AD_B1_10, ADC2, 10, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 27, GPIO_AD_B1_11, ADC2, 11, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 28, GPIO_AD_B1_12, ADC2, 12, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 29, GPIO_AD_B1_13, ADC2, 13, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 30, GPIO_AD_B1_14, ADC2, 14, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 31, GPIO_AD_B1_15, ADC2, 15, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO2, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO2, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO2, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO2, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO2, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO2, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO2, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO2, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO2, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO2, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO2, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO2, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO2, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO2, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO2, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO2, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO2, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000006, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO2, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000006, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO2, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO2, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO2, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO2, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO2, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO2, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO2, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO2, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO2, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO2, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO2, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO2, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO2, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO2, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 0, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 1, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 2, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 3, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 4, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 5, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 6, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 7, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 8, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 9, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 13, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 14, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 15, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 16, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 17, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 18, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_06 = PIN(GPIO3, 19, GPIO_SD_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 20, GPIO_SD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 21, GPIO_SD_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 22, GPIO_SD_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 23, GPIO_SD_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 24, GPIO_SD_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 25, GPIO_SD_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 26, GPIO_SD_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 27, GPIO_SD_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 28, GPIO_SD_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 29, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 30, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 31, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c index 4bb025f372..9f25225bb6 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c @@ -29,133 +29,127 @@ #include "py/mphal.h" #include "mimxrt10xx/pins.h" -const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO4, 3, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO4, 3, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO4, 3, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO4, 3, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO4, 3, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO4, 3, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO4, 3, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO4, 3, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO4, 3, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO4, 3, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO4, 3, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO4, 3, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO4, 3, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO4, 3, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO4, 3, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO4, 3, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO4, 3, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO4, 3, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO4, 3, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO4, 3, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO4, 3, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO4, 3, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO4, 3, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO4, 3, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO4, 3, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO4, 3, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO4, 3, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO4, 3, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO4, 3, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO4, 3, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO4, 3, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO4, 3, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 2, 18, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 2, 19, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 2, 20, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 2, 21, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 2, 22, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 2, 23, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 2, 24, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 2, 25, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 2, 26, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 2, 27, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 0, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 0, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 0, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 0, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000030B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 0, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000030B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 0, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 0, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000000, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 0, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000000, 0x000030A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 0, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 0, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000000, 0x000090B1); -const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 0, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000000, 0x000070A0); -const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 0, 12, GPIO_AD_B0_12, ADC1, 1, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 0, 13, GPIO_AD_B0_13, ADC1, 2, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 0, 14, GPIO_AD_B0_14, ADC1, 3, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 0, 15, GPIO_AD_B0_15, ADC1, 4, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 0, 16, GPIO_AD_B1_00, ADC1, 5, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 0, 17, GPIO_AD_B1_01, ADC1, 6, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 0, 18, GPIO_AD_B1_02, ADC1, 7, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 0, 19, GPIO_AD_B1_03, ADC1, 8, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 0, 20, GPIO_AD_B1_04, ADC1, 9, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 0, 21, GPIO_AD_B1_05, ADC1, 10, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 0, 22, GPIO_AD_B1_06, ADC1, 11, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 0, 23, GPIO_AD_B1_07, ADC1, 12, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 0, 24, GPIO_AD_B1_08, ADC1, 13, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 0, 25, GPIO_AD_B1_09, ADC1, 14, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 0, 26, GPIO_AD_B1_10, ADC1, 15, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 0, 27, GPIO_AD_B1_11, ADC1, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 0, 28, GPIO_AD_B1_12, ADC2, 1, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 0, 29, GPIO_AD_B1_13, ADC2, 2, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 0, 30, GPIO_AD_B1_14, ADC2, 3, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 0, 31, GPIO_AD_B1_15, ADC2, 4, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_B0_00 = PIN(GPIO2, 1, 0, GPIO_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_01 = PIN(GPIO2, 1, 1, GPIO_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_02 = PIN(GPIO2, 1, 2, GPIO_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_03 = PIN(GPIO2, 1, 3, GPIO_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_04 = PIN(GPIO2, 1, 4, GPIO_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_05 = PIN(GPIO2, 1, 5, GPIO_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_06 = PIN(GPIO2, 1, 6, GPIO_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_07 = PIN(GPIO2, 1, 7, GPIO_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_08 = PIN(GPIO2, 1, 8, GPIO_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_09 = PIN(GPIO2, 1, 9, GPIO_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_10 = PIN(GPIO2, 1, 10, GPIO_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_11 = PIN(GPIO2, 1, 11, GPIO_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_12 = PIN(GPIO2, 1, 12, GPIO_B0_12, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_13 = PIN(GPIO2, 1, 13, GPIO_B0_13, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_14 = PIN(GPIO2, 1, 14, GPIO_B0_14, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B0_15 = PIN(GPIO2, 1, 15, GPIO_B0_15, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_B1_00 = PIN(GPIO2, 1, 16, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_01 = PIN(GPIO2, 1, 17, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_02 = PIN(GPIO2, 1, 18, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_03 = PIN(GPIO2, 1, 19, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_04 = PIN(GPIO2, 1, 20, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_05 = PIN(GPIO2, 1, 21, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_06 = PIN(GPIO2, 1, 22, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_07 = PIN(GPIO2, 1, 23, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_08 = PIN(GPIO2, 1, 24, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_09 = PIN(GPIO2, 1, 25, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_10 = PIN(GPIO2, 1, 26, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_11 = PIN(GPIO2, 1, 27, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_12 = PIN(GPIO2, 1, 28, GPIO_B1_12, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_13 = PIN(GPIO2, 1, 29, GPIO_B1_13, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_14 = PIN(GPIO2, 1, 30, GPIO_B1_14, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_B1_15 = PIN(GPIO2, 1, 31, GPIO_B1_15, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 2, 12, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 2, 13, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 2, 14, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 2, 15, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 2, 16, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 2, 17, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); - -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 2, 0, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 2, 1, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, 2, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 2, 3, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 2, 4, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 2, 5, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 2, 6, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 2, 7, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 2, 8, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 2, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 2, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 2, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_00 = PIN(GPIO4, 0, GPIO_EMC_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_01 = PIN(GPIO4, 1, GPIO_EMC_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_02 = PIN(GPIO4, 2, GPIO_EMC_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_03 = PIN(GPIO4, 3, GPIO_EMC_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_04 = PIN(GPIO4, 4, GPIO_EMC_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_05 = PIN(GPIO4, 5, GPIO_EMC_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_06 = PIN(GPIO4, 6, GPIO_EMC_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_07 = PIN(GPIO4, 7, GPIO_EMC_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_08 = PIN(GPIO4, 8, GPIO_EMC_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_09 = PIN(GPIO4, 9, GPIO_EMC_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_10 = PIN(GPIO4, 10, GPIO_EMC_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_11 = PIN(GPIO4, 11, GPIO_EMC_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_12 = PIN(GPIO4, 12, GPIO_EMC_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_13 = PIN(GPIO4, 13, GPIO_EMC_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_14 = PIN(GPIO4, 14, GPIO_EMC_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_15 = PIN(GPIO4, 15, GPIO_EMC_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_16 = PIN(GPIO4, 16, GPIO_EMC_16, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_17 = PIN(GPIO4, 17, GPIO_EMC_17, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_18 = PIN(GPIO4, 18, GPIO_EMC_18, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_19 = PIN(GPIO4, 19, GPIO_EMC_19, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_20 = PIN(GPIO4, 20, GPIO_EMC_20, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_21 = PIN(GPIO4, 21, GPIO_EMC_21, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_22 = PIN(GPIO4, 22, GPIO_EMC_22, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_23 = PIN(GPIO4, 23, GPIO_EMC_23, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_24 = PIN(GPIO4, 24, GPIO_EMC_24, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_25 = PIN(GPIO4, 25, GPIO_EMC_25, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_26 = PIN(GPIO4, 26, GPIO_EMC_26, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_27 = PIN(GPIO4, 27, GPIO_EMC_27, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_28 = PIN(GPIO4, 28, GPIO_EMC_28, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_29 = PIN(GPIO4, 29, GPIO_EMC_29, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_30 = PIN(GPIO4, 30, GPIO_EMC_30, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_31 = PIN(GPIO4, 31, GPIO_EMC_31, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_32 = PIN(GPIO3, 18, GPIO_EMC_32, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_33 = PIN(GPIO3, 19, GPIO_EMC_33, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_34 = PIN(GPIO3, 20, GPIO_EMC_34, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_35 = PIN(GPIO3, 21, GPIO_EMC_35, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_36 = PIN(GPIO3, 22, GPIO_EMC_36, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_37 = PIN(GPIO3, 23, GPIO_EMC_37, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_38 = PIN(GPIO3, 24, GPIO_EMC_38, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_39 = PIN(GPIO3, 25, GPIO_EMC_39, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_40 = PIN(GPIO3, 26, GPIO_EMC_40, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_EMC_41 = PIN(GPIO3, 27, GPIO_EMC_41, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_00 = PIN(GPIO1, 0, GPIO_AD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_01 = PIN(GPIO1, 1, GPIO_AD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_02 = PIN(GPIO1, 2, GPIO_AD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_03 = PIN(GPIO1, 3, GPIO_AD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_04 = PIN(GPIO1, 4, GPIO_AD_B0_04, NO_ADC, 0, 0x00000000, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_05 = PIN(GPIO1, 5, GPIO_AD_B0_05, NO_ADC, 0, 0x00000000, 0x000030B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_06 = PIN(GPIO1, 6, GPIO_AD_B0_06, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_07 = PIN(GPIO1, 7, GPIO_AD_B0_07, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_08 = PIN(GPIO1, 8, GPIO_AD_B0_08, NO_ADC, 0, 0x00000000, 0x000030A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_09 = PIN(GPIO1, 9, GPIO_AD_B0_09, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_10 = PIN(GPIO1, 10, GPIO_AD_B0_10, NO_ADC, 0, 0x00000000, 0x000090B1); +const mcu_pin_obj_t pin_GPIO_AD_B0_11 = PIN(GPIO1, 11, GPIO_AD_B0_11, NO_ADC, 0, 0x00000000, 0x000070A0); +const mcu_pin_obj_t pin_GPIO_AD_B0_12 = PIN(GPIO1, 12, GPIO_AD_B0_12, ADC1, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_13 = PIN(GPIO1, 13, GPIO_AD_B0_13, ADC1, 2, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_14 = PIN(GPIO1, 14, GPIO_AD_B0_14, ADC1, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B0_15 = PIN(GPIO1, 15, GPIO_AD_B0_15, ADC1, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_00 = PIN(GPIO1, 16, GPIO_AD_B1_00, ADC1, 5, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_01 = PIN(GPIO1, 17, GPIO_AD_B1_01, ADC1, 6, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_02 = PIN(GPIO1, 18, GPIO_AD_B1_02, ADC1, 7, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_03 = PIN(GPIO1, 19, GPIO_AD_B1_03, ADC1, 8, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_04 = PIN(GPIO1, 20, GPIO_AD_B1_04, ADC1, 9, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_05 = PIN(GPIO1, 21, GPIO_AD_B1_05, ADC1, 10, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_06 = PIN(GPIO1, 22, GPIO_AD_B1_06, ADC1, 11, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_07 = PIN(GPIO1, 23, GPIO_AD_B1_07, ADC1, 12, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_08 = PIN(GPIO1, 24, GPIO_AD_B1_08, ADC1, 13, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_09 = PIN(GPIO1, 25, GPIO_AD_B1_09, ADC1, 14, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_10 = PIN(GPIO1, 26, GPIO_AD_B1_10, ADC1, 15, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_11 = PIN(GPIO1, 27, GPIO_AD_B1_11, ADC1, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_12 = PIN(GPIO1, 28, GPIO_AD_B1_12, ADC2, 1, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_13 = PIN(GPIO1, 29, GPIO_AD_B1_13, ADC2, 2, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_14 = PIN(GPIO1, 30, GPIO_AD_B1_14, ADC2, 3, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_AD_B1_15 = PIN(GPIO1, 31, GPIO_AD_B1_15, ADC2, 4, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_00 = PIN(GPIO2, 0, GPIO_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_01 = PIN(GPIO2, 1, GPIO_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_02 = PIN(GPIO2, 2, GPIO_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_03 = PIN(GPIO2, 3, GPIO_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_04 = PIN(GPIO2, 4, GPIO_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_05 = PIN(GPIO2, 5, GPIO_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_06 = PIN(GPIO2, 6, GPIO_B0_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_07 = PIN(GPIO2, 7, GPIO_B0_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_08 = PIN(GPIO2, 8, GPIO_B0_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_09 = PIN(GPIO2, 9, GPIO_B0_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_10 = PIN(GPIO2, 10, GPIO_B0_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_11 = PIN(GPIO2, 11, GPIO_B0_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_12 = PIN(GPIO2, 12, GPIO_B0_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_13 = PIN(GPIO2, 13, GPIO_B0_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_14 = PIN(GPIO2, 14, GPIO_B0_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B0_15 = PIN(GPIO2, 15, GPIO_B0_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_00 = PIN(GPIO2, 16, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_01 = PIN(GPIO2, 17, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_02 = PIN(GPIO2, 18, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_03 = PIN(GPIO2, 19, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_04 = PIN(GPIO2, 20, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_05 = PIN(GPIO2, 21, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_06 = PIN(GPIO2, 22, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_07 = PIN(GPIO2, 23, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_08 = PIN(GPIO2, 24, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_09 = PIN(GPIO2, 25, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_10 = PIN(GPIO2, 26, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_11 = PIN(GPIO2, 27, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_12 = PIN(GPIO2, 28, GPIO_B1_12, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_13 = PIN(GPIO2, 29, GPIO_B1_13, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_14 = PIN(GPIO2, 30, GPIO_B1_14, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_B1_15 = PIN(GPIO2, 31, GPIO_B1_15, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_00 = PIN(GPIO3, 12, GPIO_SD_B0_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_01 = PIN(GPIO3, 13, GPIO_SD_B0_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 14, GPIO_SD_B0_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 15, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 16, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 17, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 68710f999a..7168854a5e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -48,8 +48,7 @@ extern const mp_obj_type_t mcu_pin_type; typedef struct { mp_obj_base_t base; GPIO_Type *gpio; - uint8_t port:3; //0 start index - uint8_t number:5; + uint8_t number; uint16_t mux_idx; uint32_t mux_reg; uint32_t cfg_reg; @@ -59,11 +58,10 @@ typedef struct { uint32_t pad_reset; } mcu_pin_obj_t; -#define PIN(p_gpio, p_port, p_number, p_enum, p_adc, p_adc_channel, p_mux_reset, p_pad_reset) \ +#define PIN(p_gpio, p_number, p_enum, p_adc, p_adc_channel, p_mux_reset, p_pad_reset) \ { \ { &mcu_pin_type }, \ .gpio = p_gpio, \ - .port = p_port, \ .number = p_number, \ .mux_idx = kIOMUXC_SW_MUX_CTL_PAD_ ## p_enum, \ .mux_reg = (uint32_t)&(IOMUXC->SW_MUX_CTL_PAD[kIOMUXC_SW_MUX_CTL_PAD_ ## p_enum]), \ From acf4b1bedeabe18a7b4b969e7156217ae6bde10a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 May 2020 11:43:57 -0700 Subject: [PATCH 626/919] Remove reverse methods from per-board defs --- .../boards/circuitplayground_express_crickit/mpconfigboard.h | 2 -- ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h | 2 -- ports/atmel-samd/mpconfigport.h | 1 + py/circuitpy_mpconfig.h | 1 + 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 17204a31a4..312fd26268 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -32,8 +32,6 @@ // Increase stack size slightly due to CPX library import nesting #define CIRCUITPY_DEFAULT_STACK_SIZE (4760) // divisible by 8 -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h index 182c6fa050..af473b1288 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h @@ -18,8 +18,6 @@ #define CALIBRATE_CRYSTALLESS 1 -#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 63e92c9676..1aa305cd30 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -47,6 +47,7 @@ #define MICROPY_PY_FUNCTION_ATTRS (0) // MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (0) +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) #define MICROPY_PY_UJSON (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3e5affda94..5f2605c92f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -623,6 +623,7 @@ extern const struct _mp_obj_module_t ustack_module; #else #define ULAB_MODULE #endif + #if MICROPY_PY_URE #define RE_MODULE { MP_ROM_QSTR(MP_QSTR_re), MP_ROM_PTR(&mp_module_ure) }, #else From 58b07ecb43047ca252a031b7ba673ba8d4e0de4e Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Tue, 19 May 2020 14:50:47 -0400 Subject: [PATCH 627/919] Removed a --- tools/extract_pyi.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 3b30e1ac33..b61e86e4b5 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -57,17 +57,14 @@ def convert_folder(top_level, stub_directory): print(i.__dict__['name']) for j in i.body: if isinstance(j, astroid.scoped_nodes.FunctionDef): - a = '' if None in j.args.__dict__['annotations']: - a += f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n" + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") if j.returns: if 'Any' in j.returns.__dict__.values(): - a += f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}" + print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") elif isinstance(j, astroid.node_classes.AnnAssign): if 'Any' == j.__dict__['annotation'].__dict__['name']: - a = f"missing attribute type on line {j.__dict__['lineno']}" - if a: - print(a) + print(f"missing attribute type on line {j.__dict__['lineno']}") ok += 1 except astroid.exceptions.AstroidSyntaxError as e: From 38fd9c25f22ec68920afcf736cb75d4d316ba8bb Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 19 May 2020 15:33:34 -0400 Subject: [PATCH 628/919] Re-add APA102 --- .../common-hal/microcontroller/Pin.c | 37 ++++++++++++++++++- .../common-hal/microcontroller/Pin.h | 4 ++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 4989a91863..e75df6e609 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -31,8 +31,10 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif - -#define GPIO_PORT_COUNT (IOMUXC_SW_PAD_CTL_PAD_COUNT / 32 + 1) +#ifdef MICROPY_HW_APA102_MOSI +bool apa102_sck_in_use; +bool apa102_mosi_in_use; +#endif STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; @@ -55,6 +57,10 @@ void reset_all_pins(void) { #ifdef MICROPY_HW_NEOPIXEL neopixel_in_use = false; #endif + #ifdef MICROPY_HW_APA102_MOSI + apa102_sck_in_use = false; + apa102_mosi_in_use = false; + #endif } // Since i.MX pins need extra register and reset information to reset properly, @@ -72,6 +78,17 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin) { return; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin->mux_idx == MICROPY_HW_APA102_MOSI->mux_idx || + pin->mux_idx == MICROPY_HW_APA102_SCK->mux_idx) { + apa102_mosi_in_use = apa102_mosi_in_use && pin->mux_idx != MICROPY_HW_APA102_MOSI->mux_idx; + apa102_sck_in_use = apa102_sck_in_use && pin->mux_idx != MICROPY_HW_APA102_SCK->mux_idx; + if (!apa102_sck_in_use && !apa102_mosi_in_use) { + rgb_led_status_init(); + } + return; + } + #endif } void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { @@ -84,6 +101,14 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) { return !neopixel_in_use; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) { + return !apa102_mosi_in_use; + } + if (pin == MICROPY_HW_APA102_SCK) { + return !apa102_sck_in_use; + } + #endif return !claimed_pins[pin->mux_idx]; } @@ -100,6 +125,14 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { neopixel_in_use = true; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) { + apa102_mosi_in_use = true; + } + if (pin == MICROPY_HW_APA102_SCK) { + apa102_sck_in_use = true; + } + #endif } void claim_pin(const mcu_pin_obj_t* pin) { diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 59ca83082e..2f1aaa8955 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -35,6 +35,10 @@ #ifdef MICROPY_HW_NEOPIXEL extern bool neopixel_in_use; #endif +#ifdef MICROPY_HW_APA102_MOSI +extern bool apa102_sck_in_use; +extern bool apa102_mosi_in_use; +#endif void reset_all_pins(void); void claim_pin(const mcu_pin_obj_t* pin); From 49090d13780121c221b191002b058fa3150bc7ec Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 May 2020 17:46:29 -0700 Subject: [PATCH 629/919] Fully implement digitalio and pin-in-use tracking. Fixes #2901 --- ports/esp32s2/Makefile | 1 + .../boards/espressif_saola_1_wroom/board.c | 8 ++ .../espressif_saola_1_wroom/mpconfigboard.mk | 2 + .../boards/espressif_saola_1_wrover/board.c | 7 ++ .../espressif_saola_1_wrover/mpconfigboard.mk | 2 + .../common-hal/digitalio/DigitalInOut.c | 86 ++++++++++--------- .../esp32s2/common-hal/microcontroller/Pin.c | 43 ++++++++-- .../esp32s2/common-hal/microcontroller/Pin.h | 9 +- ports/esp32s2/modules/module.h | 35 ++++++++ ports/esp32s2/modules/none.c | 28 ++++++ ports/esp32s2/modules/wroom.c | 37 ++++++++ ports/esp32s2/modules/wrover.c | 38 ++++++++ ports/esp32s2/mpconfigport.mk | 2 + ports/esp32s2/peripherals/pins.h | 4 +- ports/esp32s2/supervisor/port.c | 4 + shared-bindings/digitalio/DigitalInOut.c | 10 ++- shared-bindings/digitalio/DigitalInOut.h | 7 +- 17 files changed, 265 insertions(+), 58 deletions(-) create mode 100644 ports/esp32s2/modules/module.h create mode 100644 ports/esp32s2/modules/none.c create mode 100644 ports/esp32s2/modules/wroom.c create mode 100644 ports/esp32s2/modules/wrover.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index be4b2f00fd..edd0fb2504 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -149,6 +149,7 @@ SRC_C += \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ + modules/$(CIRCUITPY_MODULE).c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ lib/oofatfs/ff.c \ diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c index a3a351f272..b7b2c4ef5b 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c @@ -26,8 +26,16 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { + // USB + never_reset_pin(&pin_GPIO19); + never_reset_pin(&pin_GPIO20); + + // Debug UART + never_reset_pin(&pin_GPIO43); + never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index aa82588a5c..cd27356153 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -18,3 +18,5 @@ CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wroom diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index a3a351f272..816163cd92 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -28,6 +28,13 @@ #include "mpconfigboard.h" void board_init(void) { + // USB + never_reset_pin(&pin_GPIO19); + never_reset_pin(&pin_GPIO20); + + // Debug UART + never_reset_pin(&pin_GPIO43); + never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index ff7e6228af..0b847de943 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -18,3 +18,5 @@ CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m CIRCUITPY_ESP_FLASH_SIZE=4MB + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index 349da6bf48..7745a9c0a3 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -30,24 +30,18 @@ #include "driver/gpio.h" - -#include "esp_log.h" - -static const char* TAG = "CircuitPython digitalio"; +#include "esp-idf/components/soc/include/hal/gpio_hal.h" void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { - (void)self; + never_reset_pin_number(self->pin->number); } digitalinout_result_t common_hal_digitalio_digitalinout_construct( digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { - - // claim_pin(pin); + claim_pin(pin); self->pin = pin; - ESP_EARLY_LOGW(TAG, "construct %d", pin->number); - return DIGITALINOUT_OK; } @@ -60,78 +54,86 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self return; } - // reset_pin_number(0, self->pin->number); + reset_pin_number(self->pin->number); self->pin = mp_const_none; } void common_hal_digitalio_digitalinout_switch_to_input( digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { - gpio_config_t config = { - .pin_bit_mask = 1 << self->pin->number, - .mode = GPIO_MODE_INPUT - }; - if (pull == PULL_UP) { - config.pull_up_en = GPIO_PULLUP_ENABLE; - } else if (pull == PULL_DOWN) { - config.pull_down_en = GPIO_PULLDOWN_ENABLE; - } - - gpio_config(&config); + common_hal_digitalio_digitalinout_set_pull(self, pull); + gpio_set_direction(self->pin->number, GPIO_MODE_DEF_INPUT); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { - gpio_config_t config = { - .pin_bit_mask = 1ULL << self->pin->number, - .mode = GPIO_MODE_OUTPUT - }; - if (drive_mode == DRIVE_MODE_OPEN_DRAIN) { - config.mode = GPIO_MODE_OUTPUT_OD; - } gpio_set_level(self->pin->number, value); - gpio_config(&config); + return common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_digitalinout_obj_t *self) { - + uint32_t iomux = READ_PERI_REG(GPIO_PIN_MUX_REG[self->pin->number]); + if ((iomux & FUN_IE) != 0) { + return DIRECTION_INPUT; + } return DIRECTION_OUTPUT; } void common_hal_digitalio_digitalinout_set_value( digitalio_digitalinout_obj_t *self, bool value) { - ESP_EARLY_LOGW(TAG, "set %d %d", self->pin->number, value); gpio_set_level(self->pin->number, value); } bool common_hal_digitalio_digitalinout_get_value( digitalio_digitalinout_obj_t *self) { - return true; + return gpio_get_level(self->pin->number) == 1; } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { - (void)self; - (void)drive_mode; + gpio_num_t number = self->pin->number; + gpio_mode_t mode; + if (drive_mode == DRIVE_MODE_OPEN_DRAIN) { + mode = GPIO_MODE_DEF_OD; + } else { + mode = GPIO_MODE_DEF_OUTPUT; + } + esp_err_t result = gpio_set_direction(number, mode); + if (result != ESP_OK) { + return DIGITALINOUT_INPUT_ONLY; + } + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( digitalio_digitalinout_obj_t *self) { - // if (common_hal_digitalio_digitalinout_get_direction(self) == DIRECTION_OUTPUT) - // return DRIVE_MODE_PUSH_PULL; - // else - return DRIVE_MODE_OPEN_DRAIN; + if (GPIO_HAL_GET_HW(GPIO_PORT_0)->pin[self->pin->number].pad_driver == 1) { + return DRIVE_MODE_OPEN_DRAIN; + } + return DRIVE_MODE_PUSH_PULL; } void common_hal_digitalio_digitalinout_set_pull( digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { - (void)self; - (void)pull; + gpio_num_t number = self->pin->number; + gpio_pullup_dis(number); + gpio_pulldown_dis(number); + if (pull == PULL_UP) { + gpio_pullup_en(number); + } else if (pull == PULL_DOWN) { + gpio_pulldown_en(number); + } } digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( digitalio_digitalinout_obj_t *self) { + gpio_num_t gpio_num = self->pin->number; + if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PU) == 1) { + return PULL_UP; + } else if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PD) == 1) { + return PULL_DOWN; + } return PULL_NONE; } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index e142191fd7..4c39eea164 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -29,18 +29,51 @@ #include "py/mphal.h" -// Mark pin as free and return it to a quiescent state. -void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { +#include "esp-idf/components/driver/include/driver/gpio.h" +#include "esp-idf/components/soc/include/hal/gpio_hal.h" + +STATIC uint32_t never_reset_pins[2]; +STATIC uint32_t in_use[2]; + +void never_reset_pin_number(gpio_num_t pin_number) { + never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } +void never_reset_pin(const mcu_pin_obj_t* pin) { + never_reset_pin_number(pin->number); +} + +// Mark pin as free and return it to a quiescent state. +void reset_pin_number(gpio_num_t pin_number) { + never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32); + in_use[pin_number / 32] &= ~(1 << pin_number % 32); +} + +void reset_all_pins(void) { + for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { + uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; + if (iomux_address == 0 || + (never_reset_pins[i / 32] & (1 << i % 32)) != 0) { + continue; + } + gpio_set_direction(i, GPIO_MODE_DEF_INPUT); + gpio_pullup_dis(i); + gpio_pulldown_dis(i); + } + in_use[0] = 0; + in_use[1] = 0; +} void claim_pin(const mcu_pin_obj_t* pin) { + in_use[pin->number / 32] |= (1 << pin->number % 32); } -bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { - return true; +bool pin_number_is_free(gpio_num_t pin_number) { + uint8_t offset = pin_number / 32; + uint8_t mask = 1 << pin_number % 32; + return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { - return pin_number_is_free(0, pin->number); + return pin_number_is_free(pin->number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index ab55744221..6f47b1ed31 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -34,11 +34,10 @@ void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. -void reset_pin_number(uint8_t pin_port, uint8_t pin_number); +void reset_pin_number(gpio_num_t pin_number); void claim_pin(const mcu_pin_obj_t* pin); -bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number); -void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number); -// GPIO_TypeDef * pin_port(uint8_t pin_port); -uint16_t pin_mask(uint8_t pin_number); +bool pin_number_is_free(gpio_num_t pin_number); +void never_reset_pin_number(gpio_num_t pin_number); +void never_reset_pin(const mcu_pin_obj_t* pin); #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/esp32s2/modules/module.h b/ports/esp32s2/modules/module.h new file mode 100644 index 0000000000..6c40e30e07 --- /dev/null +++ b/ports/esp32s2/modules/module.h @@ -0,0 +1,35 @@ +/* + * This file is part of the Micro Python 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. + */ + + +#ifndef MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H +#define MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H + +#include "shared-bindings/microcontroller/Pin.h" + +void never_reset_module_internal_pins(void); + +#endif // MICROPY_INCLUDED_ESP32S2_MODULES_MODULE_H diff --git a/ports/esp32s2/modules/none.c b/ports/esp32s2/modules/none.c new file mode 100644 index 0000000000..9b5433bd9d --- /dev/null +++ b/ports/esp32s2/modules/none.c @@ -0,0 +1,28 @@ +/* + * This file is part of the Micro Python 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. + */ + +void never_reset_module_internal_pins(void) { +} diff --git a/ports/esp32s2/modules/wroom.c b/ports/esp32s2/modules/wroom.c new file mode 100644 index 0000000000..16c5861187 --- /dev/null +++ b/ports/esp32s2/modules/wroom.c @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python 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 "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash + never_reset_pin(&pin_GPIO27); + never_reset_pin(&pin_GPIO28); + never_reset_pin(&pin_GPIO29); + never_reset_pin(&pin_GPIO30); + never_reset_pin(&pin_GPIO31); + never_reset_pin(&pin_GPIO32); +} diff --git a/ports/esp32s2/modules/wrover.c b/ports/esp32s2/modules/wrover.c new file mode 100644 index 0000000000..d589a8fd4d --- /dev/null +++ b/ports/esp32s2/modules/wrover.c @@ -0,0 +1,38 @@ +/* + * This file is part of the Micro Python 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 "modules/module.h" + +void never_reset_module_internal_pins(void) { + // SPI Flash and RAM + never_reset_pin(&pin_GPIO26); + never_reset_pin(&pin_GPIO27); + never_reset_pin(&pin_GPIO28); + never_reset_pin(&pin_GPIO29); + never_reset_pin(&pin_GPIO30); + never_reset_pin(&pin_GPIO31); + never_reset_pin(&pin_GPIO32); +} diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 6d66d90573..c9df81db03 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -33,3 +33,5 @@ CIRCUITPY_TOUCHIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 + +CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/peripherals/pins.h b/ports/esp32s2/peripherals/pins.h index 1a74b0367d..07d0b908ee 100644 --- a/ports/esp32s2/peripherals/pins.h +++ b/ports/esp32s2/peripherals/pins.h @@ -33,10 +33,12 @@ #include #include "esp32s2_peripherals_config.h" +#include "esp-idf/config/sdkconfig.h" +#include "esp-idf/components/soc/include/hal/gpio_types.h" typedef struct { PIN_PREFIX_FIELDS - uint8_t number; + gpio_num_t number; } mcu_pin_obj_t; extern const mcu_pin_obj_t pin_GPIO0; diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4389bb6a85..9e83e5778c 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -29,10 +29,12 @@ #include #include "supervisor/port.h" #include "boards/board.h" +#include "modules/module.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "common-hal/microcontroller/Pin.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -56,12 +58,14 @@ safe_mode_t port_init(void) { if (result != ESP_OK) { ESP_EARLY_LOGE(TAG, "Unable to create tick timer."); } + never_reset_module_internal_pins(); ESP_EARLY_LOGW(TAG, "port init done"); return NO_SAFE_MODE; } void reset_port(void) { + reset_all_pins(); } void reset_to_bootloader(void) { diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 0cea74da0b..eaf2c18101 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -131,7 +131,10 @@ STATIC mp_obj_t digitalio_digitalinout_switch_to_output(size_t n_args, const mp_ drive_mode = DRIVE_MODE_OPEN_DRAIN; } // do the transfer - common_hal_digitalio_digitalinout_switch_to_output(self, args[ARG_value].u_bool, drive_mode); + digitalinout_result_t result = common_hal_digitalio_digitalinout_switch_to_output(self, args[ARG_value].u_bool, drive_mode); + if (result == DIGITALINOUT_INPUT_ONLY) { + mp_raise_NotImplementedError(translate("Pin is input only")); + } return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_KW(digitalio_digitalinout_switch_to_output_obj, 1, digitalio_digitalinout_switch_to_output); @@ -207,7 +210,10 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_direction(mp_obj_t self_in, mp_ob if (value == &digitalio_direction_input_obj) { common_hal_digitalio_digitalinout_switch_to_input(self, PULL_NONE); } else if (value == &digitalio_direction_output_obj) { - common_hal_digitalio_digitalinout_switch_to_output(self, false, DRIVE_MODE_PUSH_PULL); + digitalinout_result_t result = common_hal_digitalio_digitalinout_switch_to_output(self, false, DRIVE_MODE_PUSH_PULL); + if (result == DIGITALINOUT_INPUT_ONLY) { + mp_raise_NotImplementedError(translate("Pin is input only")); + } } else { mp_raise_ValueError(translate("Invalid direction.")); } diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h index eee0d58012..dd6f088ab4 100644 --- a/shared-bindings/digitalio/DigitalInOut.h +++ b/shared-bindings/digitalio/DigitalInOut.h @@ -37,18 +37,19 @@ extern const mp_obj_type_t digitalio_digitalinout_type; typedef enum { DIGITALINOUT_OK, - DIGITALINOUT_PIN_BUSY + DIGITALINOUT_PIN_BUSY, + DIGITALINOUT_INPUT_ONLY } digitalinout_result_t; digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t* self, const mcu_pin_obj_t* pin); void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t* self); bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t* self); void common_hal_digitalio_digitalinout_switch_to_input(digitalio_digitalinout_obj_t* self, digitalio_pull_t pull); -void common_hal_digitalio_digitalinout_switch_to_output(digitalio_digitalinout_obj_t* self, bool value, digitalio_drive_mode_t drive_mode); +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(digitalio_digitalinout_obj_t* self, bool value, digitalio_drive_mode_t drive_mode); digitalio_direction_t common_hal_digitalio_digitalinout_get_direction(digitalio_digitalinout_obj_t* self); void common_hal_digitalio_digitalinout_set_value(digitalio_digitalinout_obj_t* self, bool value); bool common_hal_digitalio_digitalinout_get_value(digitalio_digitalinout_obj_t* self); -void common_hal_digitalio_digitalinout_set_drive_mode(digitalio_digitalinout_obj_t* self, digitalio_drive_mode_t drive_mode); +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(digitalio_digitalinout_obj_t* self, digitalio_drive_mode_t drive_mode); digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode(digitalio_digitalinout_obj_t* self); void common_hal_digitalio_digitalinout_set_pull(digitalio_digitalinout_obj_t* self, digitalio_pull_t pull); digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(digitalio_digitalinout_obj_t* self); From 80517c4cf6cba02370c388ed074cbe8de69a7e99 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 May 2020 17:49:17 -0700 Subject: [PATCH 630/919] First try at critical section support --- ports/esp32s2/common-hal/microcontroller/__init__.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/esp32s2/common-hal/microcontroller/__init__.c index a36d0c440f..6b2e18673d 100644 --- a/ports/esp32s2/common-hal/microcontroller/__init__.c +++ b/ports/esp32s2/common-hal/microcontroller/__init__.c @@ -39,24 +39,31 @@ #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" +#include "freertos/FreeRTOS.h" + void common_hal_mcu_delay_us(uint32_t delay) { } volatile uint32_t nesting_count = 0; +static portMUX_TYPE cp_mutex = portMUX_INITIALIZER_UNLOCKED; void common_hal_mcu_disable_interrupts(void) { + if (nesting_count == 0) { + portENTER_CRITICAL(&cp_mutex); + } nesting_count++; } void common_hal_mcu_enable_interrupts(void) { if (nesting_count == 0) { - + // Maybe log here because it's very bad. } nesting_count--; if (nesting_count > 0) { return; } + portEXIT_CRITICAL(&cp_mutex); } void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { From 4cca455c9b5651d7b846b9e1a8b49ea81adc8cd7 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 16:44:18 +0800 Subject: [PATCH 631/919] nrf: reset rtc as part of port_reset() On NRF, the `rtc_reset()` function is never called. As a result, calls to `time.time()` return a cryptic error> ``` >>> import time >>> time.time() '' object has no attribute 'datetime' >>> ``` This is because `MP_STATE_VM(rtc_time_source)` is not initialized due to `rtc_reset()` never being called. If `CIRCUITPY_RTC` is enabled, call `rtc_reset()` as part of the `reset_port()` call. This ensures that `time.time()` works as expected. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 4edb78f7c0..e88b6c26fe 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -161,6 +161,10 @@ void reset_port(void) { pulsein_reset(); #endif +#if CIRCUITPY_RTC + rtc_reset(); +#endif + timers_reset(); #if CIRCUITPY_BLEIO From 0543a64dc160a446101baa3e2398898210e04b9a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 20 May 2020 08:55:32 -0700 Subject: [PATCH 632/919] Update translations --- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/cs.po | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/sv.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 15 files changed, 75 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9c1c3b9bf9..0fedf2ba30 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1249,6 +1249,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 5654256464..70ff57c071 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1237,6 +1237,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7f02e5215d..48a9d30931 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1237,6 +1237,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d81570b70f..a4892deda4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -1252,6 +1252,10 @@ msgstr "Permiso denegado" msgid "Pin does not have ADC capabilities" msgstr "Pin no tiene capacidad ADC" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index b9af70d854..e5a9dccd2f 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1257,6 +1257,10 @@ msgstr "Walang pahintulot" msgid "Pin does not have ADC capabilities" msgstr "Ang pin ay walang kakayahan sa ADC" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 820bd9375a..e1941668aa 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -1266,6 +1266,10 @@ msgstr "Permesso negato" msgid "Pin does not have ADC capabilities" msgstr "Il pin non ha capacità di ADC" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index ac2a75a9e4..fa5bc2ca2d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1241,6 +1241,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index f872b28ba6..7d6df7abb2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1242,6 +1242,10 @@ msgstr "Odmowa dostępu" msgid "Pin does not have ADC capabilities" msgstr "Nóżka nie obsługuje ADC" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a376fdf063..a664a44e03 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1252,6 +1252,10 @@ msgstr "Permissão negada" msgid "Pin does not have ADC capabilities" msgstr "O pino não tem recursos de ADC" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 34927a2516..a39616814a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -1264,6 +1264,10 @@ msgstr "Åtkomst nekad" msgid "Pin does not have ADC capabilities" msgstr "Pinnen har inte ADC-funktionalitet" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "Pinnen måste stödja hårdvaruavbrott" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index e2247c79d9..5352833b52 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-18 13:32-0700\n" +"POT-Creation-Date: 2020-05-20 08:55-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1256,6 +1256,10 @@ msgstr "Quánxiàn bèi jùjué" msgid "Pin does not have ADC capabilities" msgstr "Pin méiyǒu ADC nénglì" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" From fd0420d43209a533f4896adae36952d9a11dc49c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 20 May 2020 09:23:42 -0700 Subject: [PATCH 633/919] Update digitalio api for other ports --- ports/atmel-samd/common-hal/digitalio/DigitalInOut.c | 6 ++++-- ports/cxd56/common-hal/digitalio/DigitalInOut.c | 6 ++++-- ports/litex/common-hal/digitalio/DigitalInOut.c | 6 ++++-- ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c | 6 ++++-- ports/nrf/common-hal/digitalio/DigitalInOut.c | 6 ++++-- ports/stm/common-hal/digitalio/DigitalInOut.c | 8 +++++--- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c index 68d3da806c..e37769c157 100644 --- a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +++ b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c @@ -73,7 +73,7 @@ void common_hal_digitalio_digitalinout_switch_to_input( common_hal_digitalio_digitalinout_set_pull(self, pull); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t* self, bool value, digitalio_drive_mode_t drive_mode) { const uint8_t pin = self->pin->number; @@ -86,6 +86,7 @@ void common_hal_digitalio_digitalinout_switch_to_output( // Direction is set in set_value. We don't need to do it here. common_hal_digitalio_digitalinout_set_value(self, value); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( @@ -128,7 +129,7 @@ bool common_hal_digitalio_digitalinout_get_value( } } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t* self, digitalio_drive_mode_t drive_mode) { bool value = common_hal_digitalio_digitalinout_get_value(self); @@ -138,6 +139,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( if (value) { common_hal_digitalio_digitalinout_set_value(self, value); } + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( diff --git a/ports/cxd56/common-hal/digitalio/DigitalInOut.c b/ports/cxd56/common-hal/digitalio/DigitalInOut.c index c9af12e443..37b695567d 100644 --- a/ports/cxd56/common-hal/digitalio/DigitalInOut.c +++ b/ports/cxd56/common-hal/digitalio/DigitalInOut.c @@ -70,7 +70,7 @@ void common_hal_digitalio_digitalinout_switch_to_input(digitalio_digitalinout_ob board_gpio_config(self->pin->number, 0, true, true, pull); } -void common_hal_digitalio_digitalinout_switch_to_output(digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { self->input = false; self->open_drain = drive_mode == DRIVE_MODE_OPEN_DRAIN; board_gpio_write(self->pin->number, -1); @@ -80,6 +80,7 @@ void common_hal_digitalio_digitalinout_switch_to_output(digitalio_digitalinout_o board_gpio_write(self->pin->number, 0); } common_hal_digitalio_digitalinout_set_value(self, value); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction(digitalio_digitalinout_obj_t *self) { @@ -104,7 +105,7 @@ bool common_hal_digitalio_digitalinout_get_value(digitalio_digitalinout_obj_t *s return board_gpio_read(self->pin->number); } -void common_hal_digitalio_digitalinout_set_drive_mode(digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { if (drive_mode == DRIVE_MODE_PUSH_PULL) { board_gpio_write(self->pin->number, -1); board_gpio_config(self->pin->number, 0, false, true, PIN_FLOAT); @@ -115,6 +116,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode(digitalio_digitalinout_obj board_gpio_write(self->pin->number, 0); self->open_drain = true; } + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode(digitalio_digitalinout_obj_t *self) { diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c index 574d0de567..26f79f16df 100644 --- a/ports/litex/common-hal/digitalio/DigitalInOut.c +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -64,12 +64,13 @@ void common_hal_digitalio_digitalinout_switch_to_input( touch_oe_write(touch_oe_read() & ~(1 << self->pin->number)); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { (void)drive_mode; common_hal_digitalio_digitalinout_set_value(self, value); touch_oe_write(touch_oe_read() | (1 << self->pin->number)); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( @@ -92,11 +93,12 @@ bool common_hal_digitalio_digitalinout_get_value( return !!(touch_i_read() & (1 << self->pin->number)); } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { (void)self; (void)drive_mode; + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 603515764f..538f8279fb 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -97,7 +97,7 @@ void common_hal_digitalio_digitalinout_switch_to_input( common_hal_digitalio_digitalinout_set_pull(self, pull); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t* self, bool value, digitalio_drive_mode_t drive_mode) { self->output = true; @@ -108,6 +108,7 @@ void common_hal_digitalio_digitalinout_switch_to_output( const gpio_pin_config_t config = { kGPIO_DigitalOutput, value, kGPIO_NoIntmode }; GPIO_PinInit(self->pin->gpio, self->pin->number, &config); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( @@ -125,7 +126,7 @@ bool common_hal_digitalio_digitalinout_get_value( return GPIO_PinRead(self->pin->gpio, self->pin->number); } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t* self, digitalio_drive_mode_t drive_mode) { bool value = common_hal_digitalio_digitalinout_get_value(self); @@ -138,6 +139,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( if (value) { common_hal_digitalio_digitalinout_set_value(self, value); } + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( diff --git a/ports/nrf/common-hal/digitalio/DigitalInOut.c b/ports/nrf/common-hal/digitalio/DigitalInOut.c index c5a7a7dfba..2a72151b77 100644 --- a/ports/nrf/common-hal/digitalio/DigitalInOut.c +++ b/ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -65,12 +65,13 @@ void common_hal_digitalio_digitalinout_switch_to_input( common_hal_digitalio_digitalinout_set_pull(self, pull); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); common_hal_digitalio_digitalinout_set_value(self, value); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( @@ -92,7 +93,7 @@ bool common_hal_digitalio_digitalinout_get_value( : nrf_gpio_pin_out_read(self->pin->number); } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { nrf_gpio_cfg(self->pin->number, @@ -101,6 +102,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( NRF_GPIO_PIN_NOPULL, drive_mode == DRIVE_MODE_OPEN_DRAIN ? NRF_GPIO_PIN_H0D1 : NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE); + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 647a46e907..1354e1a326 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "supervisor/shared/translate.h" -// The HAL is sparse on obtaining register information, so we use the LLs here. +// The HAL is sparse on obtaining register information, so we use the LLs here. #if (CPY_STM32H7) #include "stm32h7xx_ll_gpio.h" #elif (CPY_STM32F7) @@ -85,12 +85,13 @@ void common_hal_digitalio_digitalinout_switch_to_input( common_hal_digitalio_digitalinout_set_pull(self, pull); } -void common_hal_digitalio_digitalinout_switch_to_output( +digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_digitalinout_obj_t *self, bool value, digitalio_drive_mode_t drive_mode) { common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode); common_hal_digitalio_digitalinout_set_value(self, value); + return DIGITALINOUT_OK; } digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( @@ -112,7 +113,7 @@ bool common_hal_digitalio_digitalinout_get_value( : LL_GPIO_IsOutputPinSet(pin_port(self->pin->port), pin_mask(self->pin->number)); } -void common_hal_digitalio_digitalinout_set_drive_mode( +digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode( digitalio_digitalinout_obj_t *self, digitalio_drive_mode_t drive_mode) { GPIO_InitTypeDef GPIO_InitStruct = {0}; @@ -122,6 +123,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); + return DIGITALINOUT_OK; } digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( From 66c09efae287de5cf099dea09288809b922c191d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 20 May 2020 12:48:01 -0400 Subject: [PATCH 634/919] Add UART one-way instance search, fix bugs in stm32 implementation --- ports/mimxrt10xx/common-hal/busio/SPI.c | 18 +- ports/mimxrt10xx/common-hal/busio/UART.c | 218 ++++++++++++++--------- ports/mimxrt10xx/common-hal/busio/UART.h | 8 +- ports/stm/common-hal/busio/UART.c | 15 +- 4 files changed, 159 insertions(+), 100 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 15c320140a..54c8d001db 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -91,10 +91,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, || (mcu_spi_sck_list[i].bank_idx != mcu_spi_miso_list[k].bank_idx)) { continue; } - //keep looking if the SPI is taken, edge case + // if SPI is taken, break (pins never have >1 periph) if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } //store pins if not self->clock = &mcu_spi_sck_list[i]; @@ -102,11 +102,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->miso = &mcu_spi_miso_list[k]; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; // Multi-level break to pick lowest peripheral } } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } // if just MISO, reduce search @@ -118,14 +118,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } self->clock = &mcu_spi_sck_list[i]; - self->mosi = NULL; self->miso = &mcu_spi_miso_list[j]; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } // if just MOSI, reduce search @@ -137,14 +136,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } if (reserved_spi[mcu_spi_sck_list[i].bank_idx - 1]) { spi_taken = true; - continue; + break; } self->clock = &mcu_spi_sck_list[i]; self->mosi = &mcu_spi_mosi_list[j]; - self->miso = NULL; break; } - if (self->clock != NULL) { + if (self->clock != NULL || spi_taken) { break; } } else { diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index fbb45eeea4..af4328c74b 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -39,7 +39,9 @@ #include "fsl_lpuart.h" -// TODO +//arrays use 0 based numbering: UART is stored at index 0 +#define MAX_UART 8 +STATIC bool reserved_uart[MAX_UART]; #define UART_CLOCK_FREQ (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U) @@ -79,109 +81,161 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { - // TODO: Allow none rx or tx - - bool have_tx = tx != NULL; - bool have_rx = rx != NULL; - if (!have_tx && !have_rx) { - mp_raise_ValueError(translate("tx and rx cannot both be None")); - } - self->baudrate = baudrate; self->character_bits = bits; self->timeout_ms = timeout * 1000; - const uint32_t rx_count = sizeof(mcu_uart_rx_list) / sizeof(mcu_periph_obj_t); - const uint32_t tx_count = sizeof(mcu_uart_tx_list) / sizeof(mcu_periph_obj_t); + bool is_onedirection = false; + if (!rx != !tx) { + is_onedirection = true; + } + bool uart_taken = false; - for (uint32_t i = 0; i < rx_count; ++i) { - if (mcu_uart_rx_list[i].pin != rx) - continue; + const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); + const uint32_t tx_count = MP_ARRAY_SIZE(mcu_uart_tx_list); - for (uint32_t j = 0; j < tx_count; ++j) { - if (mcu_uart_tx_list[j].pin != tx) + // RX loop handles rx only, or both rx and tx + if (rx != NULL) { + for (uint32_t i = 0; i < rx_count; ++i) { + if (mcu_uart_rx_list[i].pin != rx) { continue; - - if (mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) + } + // If TX is on, keep looking, else stop + if (tx != NULL) { + for (uint32_t j = 0; j < tx_count; ++j) { + if (mcu_uart_tx_list[j].pin != tx || + mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) { + continue; + } + // If UART is taken, break (pins never have >1 periph) + if (reserved_uart[mcu_uart_rx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->rx = &mcu_uart_rx_list[i]; + self->tx = &mcu_uart_tx_list[j]; + break; + } + if (self->tx != NULL || uart_taken) { + break; + } + } else { + if (reserved_uart[mcu_uart_rx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->rx = &mcu_uart_rx_list[i]; + } + } + } else if (tx != NULL) { + // TX only case + for (uint32_t i = 0; i < tx_count; ++i) { + if (mcu_uart_tx_list[i].pin != tx) { continue; - - self->rx_pin = &mcu_uart_rx_list[i]; - self->tx_pin = &mcu_uart_tx_list[j]; - + } + if (reserved_uart[mcu_uart_tx_list[i].bank_idx - 1]) { + uart_taken = true; + break; + } + self->tx = &mcu_uart_tx_list[i]; break; } + } else { + mp_raise_ValueError(translate("Supply at least one UART pin")); } - if(self->rx_pin == NULL || self->tx_pin == NULL) { + if (uart_taken) { + mp_raise_RuntimeError(translate("UART peripheral is already in use")); + } + + if(self->rx == NULL && self->tx == NULL) { mp_raise_RuntimeError(translate("Invalid UART pin selection")); } + if (is_onedirection && ((rts != NULL) || (cts != NULL))) { + mp_raise_RuntimeError(translate("Both RX and TX required for flow control")); + } + // Filter for sane settings for RS485 if (rs485_dir != NULL) { - if ((rts != NULL) || (cts != NULL)) { - mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); - } - // For IMXRT the RTS pin is used for RS485 direction - rts = rs485_dir; + if ((rts != NULL) || (cts != NULL)) { + mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); + } + // For IMXRT the RTS pin is used for RS485 direction + rts = rs485_dir; } else { - if (rs485_invert) { - mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); - } + if (rs485_invert) { + mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); + } } // Now check for RTS/CTS (or overloaded RS485 direction) pin(s) - const uint32_t rts_count = sizeof(mcu_uart_rts_list) / sizeof(mcu_periph_obj_t); - const uint32_t cts_count = sizeof(mcu_uart_cts_list) / sizeof(mcu_periph_obj_t); + const uint32_t rts_count = MP_ARRAY_SIZE(mcu_uart_rts_list); + const uint32_t cts_count = MP_ARRAY_SIZE(mcu_uart_cts_list); if (rts != NULL) { - for (uint32_t i=0; i < rts_count; ++i) { - if (mcu_uart_rts_list[i].bank_idx == self->rx_pin->bank_idx) { - if (mcu_uart_rts_list[i].pin == rts) { - self->rts_pin = &mcu_uart_rts_list[i]; - break; - } + for (uint32_t i=0; i < rts_count; ++i) { + if (mcu_uart_rts_list[i].bank_idx == self->rx->bank_idx) { + if (mcu_uart_rts_list[i].pin == rts) { + self->rts = &mcu_uart_rts_list[i]; + break; + } + } + } + if (self->rts == NULL){ + mp_raise_ValueError(translate("Selected RTS pin not valid")); } - } - if (self->rts_pin == NULL) - mp_raise_ValueError(translate("Selected RTS pin not valid")); } if (cts != NULL) { - for (uint32_t i=0; i < cts_count; ++i) { - if (mcu_uart_cts_list[i].bank_idx == self->rx_pin->bank_idx) { - if (mcu_uart_cts_list[i].pin == cts) { - self->cts_pin = &mcu_uart_cts_list[i]; - break; - } + for (uint32_t i=0; i < cts_count; ++i) { + if (mcu_uart_cts_list[i].bank_idx == self->rx->bank_idx) { + if (mcu_uart_cts_list[i].pin == cts) { + self->cts = &mcu_uart_cts_list[i]; + break; + } + } + } + if (self->cts == NULL){ + mp_raise_ValueError(translate("Selected CTS pin not valid")); } - } - if (self->cts_pin == NULL) - mp_raise_ValueError(translate("Selected CTS pin not valid")); } - self->uart = mcu_uart_banks[self->tx_pin->bank_idx - 1]; + if (self->rx) { + self->uart = mcu_uart_banks[self->rx->bank_idx - 1]; + } else { + self->uart = mcu_uart_banks[self->tx->bank_idx - 1]; + } - config_periph_pin(self->rx_pin); - config_periph_pin(self->tx_pin); - if (self->rts_pin) - config_periph_pin(self->rts_pin); - if (self->cts_pin) - config_periph_pin(self->cts_pin); + if (self->rx) { + config_periph_pin(self->rx); + } + if (self->tx) { + config_periph_pin(self->tx); + } + if (self->rts) { + config_periph_pin(self->rts); + } + if (self->cts) { + config_periph_pin(self->cts); + } lpuart_config_t config = { 0 }; LPUART_GetDefaultConfig(&config); config.dataBitsCount = self->character_bits == 8 ? kLPUART_EightDataBits : kLPUART_SevenDataBits; config.baudRate_Bps = self->baudrate; - config.enableTx = self->tx_pin != NULL; - config.enableRx = self->rx_pin != NULL; - config.enableRxRTS = self->rts_pin != NULL; - config.enableTxCTS = self->cts_pin != NULL; - if (self->rts_pin != NULL) - claim_pin(self->rts_pin->pin); - if (self->cts_pin != NULL) - claim_pin(self->cts_pin->pin); + config.enableTx = self->tx != NULL; + config.enableRx = self->rx != NULL; + config.enableRxRTS = self->rts != NULL; + config.enableTxCTS = self->cts != NULL; + if (self->rts != NULL) { + claim_pin(self->rts->pin); + } + if (self->cts != NULL) { + claim_pin(self->cts->pin); + } LPUART_Init(self->uart, &config, UART_CLOCK_FREQ); @@ -189,16 +243,18 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // ..unfortunately this isn't done by the driver library uint32_t modir = (self->uart->MODIR) & ~(LPUART_MODIR_TXRTSPOL_MASK | LPUART_MODIR_TXRTSE_MASK); if (rs485_dir != NULL) { - modir |= LPUART_MODIR_TXRTSE_MASK; - if (rs485_invert) - modir |= LPUART_MODIR_TXRTSPOL_MASK; + modir |= LPUART_MODIR_TXRTSE_MASK; + if (rs485_invert) { + modir |= LPUART_MODIR_TXRTSPOL_MASK; + } } self->uart->MODIR = modir; - if (self->tx_pin != NULL) - claim_pin(self->tx_pin->pin); + if (self->tx != NULL) { + claim_pin(self->tx->pin); + } - if (self->rx_pin != NULL) { + if (self->rx != NULL) { // The LPUART ring buffer wastes one byte to distinguish between full and empty. self->ringbuf = gc_alloc(receiver_buffer_size + 1, false, true /*long-lived*/); @@ -212,12 +268,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // the capacity is one less than the size. LPUART_TransferStartRingBuffer(self->uart, &self->handle, self->ringbuf, receiver_buffer_size + 1); - claim_pin(self->rx_pin->pin); + claim_pin(self->rx->pin); } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->rx_pin == NULL && self->tx_pin == NULL; + return self->rx == NULL && self->tx == NULL; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -229,16 +285,16 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { gc_free(self->ringbuf); -// reset_pin_number(self->rx_pin); -// reset_pin_number(self->tx_pin); +// reset_pin_number(self->rx); +// reset_pin_number(self->tx); - self->rx_pin = NULL; - self->tx_pin = NULL; + self->rx = NULL; + self->tx = NULL; } // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (self->rx_pin == NULL) { + if (self->rx == NULL) { mp_raise_ValueError(translate("No RX pin")); } @@ -284,7 +340,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Write characters. size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - if (self->tx_pin == NULL) { + if (self->tx == NULL) { mp_raise_ValueError(translate("No TX pin")); } @@ -320,7 +376,7 @@ void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - if (self->tx_pin == NULL) { + if (self->tx == NULL) { return false; } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.h b/ports/mimxrt10xx/common-hal/busio/UART.h index 3a326eb3a4..94a5fb02c0 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.h +++ b/ports/mimxrt10xx/common-hal/busio/UART.h @@ -45,10 +45,10 @@ typedef struct { uint32_t baudrate; uint8_t character_bits; uint32_t timeout_ms; - const mcu_periph_obj_t *rx_pin; - const mcu_periph_obj_t *tx_pin; - const mcu_periph_obj_t *cts_pin; - const mcu_periph_obj_t *rts_pin; + const mcu_periph_obj_t *rx; + const mcu_periph_obj_t *tx; + const mcu_periph_obj_t *cts; + const mcu_periph_obj_t *rts; } busio_uart_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index c83479126a..0dc10c4e4c 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -259,7 +259,7 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return self->tx->pin == NULL; + return (self->tx->pin == NULL && self->rx->pin == NULL); } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -272,10 +272,15 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } } - reset_pin_number(self->tx->pin->port,self->tx->pin->number); - reset_pin_number(self->rx->pin->port,self->rx->pin->number); - self->tx = NULL; - self->rx = NULL; + if (self->tx) { + reset_pin_number(self->tx->pin->port,self->tx->pin->number); + self->tx = NULL; + } + if (self->rx) { + reset_pin_number(self->rx->pin->port,self->rx->pin->number); + self->rx = NULL; + } + ringbuf_free(&self->ringbuf); } From 42baf0061b27dc300ae9247bd44215cdf2f07a92 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 20 May 2020 13:28:17 -0400 Subject: [PATCH 635/919] translations --- locale/ID.po | 15 +++++++++++---- locale/circuitpython.pot | 15 +++++++++++---- locale/cs.po | 15 +++++++++++---- locale/de_DE.po | 15 +++++++++++---- locale/en_US.po | 15 +++++++++++---- locale/en_x_pirate.po | 15 +++++++++++---- locale/es.po | 15 +++++++++++---- locale/fil.po | 15 +++++++++++---- locale/fr.po | 15 +++++++++++---- locale/it_IT.po | 15 +++++++++++---- locale/ko.po | 15 +++++++++++---- locale/nl.po | 15 +++++++++++---- locale/pl.po | 15 +++++++++++---- locale/pt_BR.po | 15 +++++++++++---- locale/sv.po | 15 +++++++++++---- locale/zh_Latn_pinyin.po | 15 +++++++++++---- 16 files changed, 176 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 2bbd602dfb..f7328236e1 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -372,6 +372,10 @@ msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Kedua pin harus mendukung hardware interrut" @@ -1430,7 +1434,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1534,6 +1538,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3087,8 +3095,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7e80e5c9d6..343eef9075 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -368,6 +368,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1414,7 +1418,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1518,6 +1522,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3061,8 +3069,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 0537ca14bd..8341513e68 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -368,6 +368,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1414,7 +1418,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1518,6 +1522,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3061,8 +3069,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 5bbfd9d403..ec9774f90f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -375,6 +375,10 @@ msgstr "Bit clock y word select deben compartir una unidad de reloj" msgid "Bit depth must be multiple of 8." msgstr "Bits depth debe ser múltiplo de 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos pines deben soportar interrupciones por hardware" @@ -1432,7 +1436,7 @@ msgstr "El tamaño de la pila debe ser de al menos 256" msgid "Stream missing readinto() or write() method." msgstr "A Stream le falta el método readinto() o write()." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1536,6 +1540,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3104,8 +3112,7 @@ msgstr "tupla/lista tiene una longitud incorrecta" msgid "tuple/list required on RHS" msgstr "tuple/lista se require en RHS" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" diff --git a/locale/fil.po b/locale/fil.po index b05247f43a..7c58be3f7e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -374,6 +374,10 @@ msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" msgid "Bit depth must be multiple of 8." msgstr "Bit depth ay dapat multiple ng 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ang parehong mga pin ay dapat na sumusuporta sa hardware interrupts" @@ -1437,7 +1441,7 @@ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" msgid "Stream missing readinto() or write() method." msgstr "Stream kulang ng readinto() o write() method." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1541,6 +1545,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3117,8 +3125,7 @@ msgstr "mali ang haba ng tuple/list" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" diff --git a/locale/fr.po b/locale/fr.po index 481b20604e..b5b0a7580b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -374,6 +374,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "La profondità di bit deve essere multipla di 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Entrambi i pin devono supportare gli interrupt hardware" @@ -1448,7 +1452,7 @@ msgstr "La dimensione dello stack deve essere almeno 256" msgid "Stream missing readinto() or write() method." msgstr "Metodi mancanti readinto() o write() allo stream." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1552,6 +1556,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3124,8 +3132,7 @@ msgstr "tupla/lista ha la lunghezza sbagliata" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" diff --git a/locale/ko.po b/locale/ko.po index 19aad3b9dc..c6e4d52b44 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -372,6 +372,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -1418,7 +1422,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1522,6 +1526,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3066,8 +3074,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index c948425dab..c6d3de032a 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -378,6 +378,10 @@ msgstr "Bit clock en word select moeten een clock eenheid delen" msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pinnen moeten hardware interrupts ondersteunen" @@ -1448,7 +1452,7 @@ msgstr "Stack grootte moet op zijn minst 256 zijn" msgid "Stream missing readinto() or write() method." msgstr "Stream mist readinto() of write() methode." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" @@ -1560,6 +1564,10 @@ msgstr "UART Init Fout" msgid "UART Re-init error" msgstr "UART Re-init Fout" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART schrijf fout" @@ -3110,8 +3118,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 212bbba352..5229fd5358 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -371,6 +371,10 @@ msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" msgid "Bit depth must be multiple of 8." msgstr "Głębia musi być wielokrotnością 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Obie nóżki muszą wspierać przerwania sprzętowe" @@ -1419,7 +1423,7 @@ msgstr "Stos musi mieć co najmniej 256 bajtów" msgid "Stream missing readinto() or write() method." msgstr "Strumień nie ma metod readinto() lub write()." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1523,6 +1527,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3072,8 +3080,7 @@ msgstr "krotka/lista ma złą długość" msgid "tuple/list required on RHS" msgstr "wymagana krotka/lista po prawej stronie" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogą być oba None" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8a2c9e92ed..3658d91c62 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -371,6 +371,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Ambos os pinos devem suportar interrupções de hardware" @@ -1431,7 +1435,7 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -1535,6 +1539,10 @@ msgstr "" msgid "UART Re-init error" msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" @@ -3085,8 +3093,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" diff --git a/locale/sv.po b/locale/sv.po index 25ed8009fb..e10e7bfc3c 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -378,6 +378,10 @@ msgstr "Bitklocka och ordval måste dela en klockenhet" msgid "Bit depth must be multiple of 8." msgstr "Bitdjupet måste vara multipel av 8." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Båda pinnarna måste stödja maskinvaruavbrott" @@ -1445,7 +1449,7 @@ msgstr "Stackstorleken måste vara minst 256" msgid "Stream missing readinto() or write() method." msgstr "Stream saknar readinto() eller write() metod." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" @@ -1557,6 +1561,10 @@ msgstr "UART Init-fel" msgid "UART Re-init error" msgstr "UART reinit-fel" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART skrivfel" @@ -3118,8 +3126,7 @@ msgstr "tupel/lista har fel längd" msgid "tuple/list required on RHS" msgstr "tupel/lista krävs för RHS" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte båda vara None" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 00a131bbbc..db421973b5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-20 13:28-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -377,6 +377,10 @@ msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dā msgid "Bit depth must be multiple of 8." msgstr "Bǐtè shēndù bìxū shì 8 bèi yǐshàng." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Liǎng gè yǐn jiǎo dōu bìxū zhīchí yìngjiàn zhōngduàn" @@ -1433,7 +1437,7 @@ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" msgid "Stream missing readinto() or write() method." msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" @@ -1544,6 +1548,10 @@ msgstr "UART chūshǐhuà cuòwù" msgid "UART Re-init error" msgstr "UART chóngxīn chūshǐhuà cuòwù" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "UART peripheral is already in use" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART xiě cuòwù" @@ -3102,8 +3110,7 @@ msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" msgid "tuple/list required on RHS" msgstr "RHS yāoqiú de yuán zǔ/lièbiǎo" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dōu shì wú" From 8a42c33dca577e827e31a212f2db6de1428ebc95 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 20 May 2020 10:49:01 -0700 Subject: [PATCH 636/919] Add top level merge-translate target --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 842c18da5b..b642175969 100644 --- a/Makefile +++ b/Makefile @@ -210,6 +210,12 @@ locale/circuitpython.pot: all-source translate: locale/circuitpython.pot for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done +merge-translate: + git merge HEAD 1>&2 2> /dev/null; test $$? -eq 128 + rm locale/*~ || true + git checkout --ours -- locale/* + make translate + check-translate: locale/circuitpython.pot $(wildcard locale/*.po) $(PYTHON) tools/check_translations.py $^ From a43876ad1eb061350160ff5cc9f778cc9445c233 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 20 May 2020 11:37:29 -0700 Subject: [PATCH 637/919] Fix esp wrover --- ports/esp32s2/boards/espressif_saola_1_wrover/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index 816163cd92..b7b2c4ef5b 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -26,6 +26,7 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { // USB From cee428663745c67622bbba2765ba304369472b90 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 19 May 2020 21:17:31 +0000 Subject: [PATCH 638/919] Translated using Weblate (Swedish) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 25ed8009fb..02f865b9c2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-17 20:56+0000\n" -"Last-Translator: Anonymous \n" +"PO-Revision-Date: 2020-05-20 18:32+0000\n" +"Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -463,7 +463,7 @@ msgstr "Kan inte ställa in CCCD på lokal karaktäristik" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "Kan radera värden" +msgstr "Kan inte radera värden" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -1289,7 +1289,7 @@ msgstr "Plus eventuella moduler i filsystemet\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygonen behöver minst 3 punkter" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1515,7 +1515,7 @@ msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Åtgärden tog för lång tid: Max väntetid är %d sekunder" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1699,7 +1699,7 @@ msgstr "" "\n" "Besök learning.adafruit.com/category/circuitpython för projektguider.\n" "\n" -"För att lista inbyggda moduler, vänligen `help(\" modules \")`.\n" +"För att lista inbyggda moduler, ange `help(\"modules\")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" From 02d0881fca69afca8a04a6d807103f127e92603f Mon Sep 17 00:00:00 2001 From: George Waters Date: Wed, 20 May 2020 17:34:34 -0400 Subject: [PATCH 639/919] Fix error when getting a pixelbuf slice --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 71a91d7076..d8f1810db8 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -311,7 +311,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp } mp_obj_tuple_t* t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); for (uint i = 0; i < len; i++) { - t->items[i] = common_hal__pixelbuf_pixelbuf_get_pixel(self_in, i * slice.step); + t->items[i] = common_hal__pixelbuf_pixelbuf_get_pixel(self_in, i * slice.step + slice.start); } return MP_OBJ_FROM_PTR(t); } else { // Set From 4f54514be460385161c291ac644cb6cc1c067b5a Mon Sep 17 00:00:00 2001 From: jason <14111408+jpecor@users.noreply.github.com> Date: Wed, 20 May 2020 21:11:06 -0500 Subject: [PATCH 640/919] Initial version --- .github/workflows/build.yml | 1 + .../boards/aloriumtech_evo_m51/board.c | 57 ++++++++++++++++++ .../aloriumtech_evo_m51/mpconfigboard.h | 47 +++++++++++++++ .../aloriumtech_evo_m51/mpconfigboard.mk | 18 ++++++ .../boards/aloriumtech_evo_m51/pins.c | 60 +++++++++++++++++++ 5 files changed, 183 insertions(+) create mode 100644 ports/atmel-samd/boards/aloriumtech_evo_m51/board.c create mode 100644 ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c379e890e1..6eb55ed127 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,6 +136,7 @@ jobs: board: - "8086_commander" - "TG-Watch02A" + - "aloriumtech_evo_m51" - "aramcon_badge_2019" - "arduino_mkr1300" - "arduino_mkrzero" diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c new file mode 100644 index 0000000000..b418d0f1b9 --- /dev/null +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Updated to support Alorium Technology Evo M51 +// Author: Bryan Craker +// Date: 2020-05-20 + +#include "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { + REG_PORT_DIRSET1 = PORT_PB20; // PB20 as output + REG_PORT_OUTCLR1 = PORT_PB20; // PB20 cleared + PORT->Group[1].PINCFG[20].reg |= PORT_PINCFG_PMUXEN; // Mux enabled on PB20 + PORT->Group[1].PMUX[10].reg = 0x0C; // PB20 as mux function "M" + // Gclk[6] is on PB20 + GCLK->GENCTRL[6].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DPLL0) | + GCLK_GENCTRL_IDC | + GCLK_GENCTRL_DIV(10) | + //GCLK_GENCTRL_DIVSEL | + GCLK_GENCTRL_OE | + GCLK_GENCTRL_GENEN; + while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL6) + { + // Wait for synchronization + } +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.h b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.h new file mode 100644 index 0000000000..cafc82605d --- /dev/null +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.h @@ -0,0 +1,47 @@ +#define MICROPY_HW_BOARD_NAME "AloriumTech Evo M51" +#define MICROPY_HW_MCU_NAME "samd51p19" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// Rev E + +#define MICROPY_HW_LED_STATUS (&pin_PA23) +#define MICROPY_HW_NEOPIXEL (&pin_PB03) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// QSPI CS, QSPI SCK and NeoPixel pin +#define MICROPY_PORT_B (PORT_PB03 | PORT_PB10 | PORT_PB11 | PORT_PB20) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +// BC needed? +//#define AUTORESET_DELAY_MS 500 + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +//#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 + +//#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) +// End BC + +#define EXTERNAL_FLASH_QSPI_DUAL + +#define BOARD_HAS_CRYSTAL 1 + +//#define DEFAULT_I2C_BUS_SCL (&pin_PA13) +//#define DEFAULT_I2C_BUS_SDA (&pin_PA12) +#define DEFAULT_I2C_BUS_SCL (&pin_PA13) +#define DEFAULT_I2C_BUS_SDA (&pin_PA12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA17) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB23) +#define DEFAULT_SPI_BUS_MISO (&pin_PB22) + +#define DEFAULT_UART_BUS_RX (&pin_PB17) +#define DEFAULT_UART_BUS_TX (&pin_PB16) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk new file mode 100644 index 0000000000..28b1434fb7 --- /dev/null +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/mpconfigboard.mk @@ -0,0 +1,18 @@ +LD_FILE = boards/samd51x19-bootloader-external-flash.ld + +USB_VID = 0x32BD +USB_PID = 0x3001 +USB_PRODUCT = "AloriumTech Evo M51" +USB_MANUFACTURER = "Alorium Technology, LLC" + +CHIP_VARIANT = SAMD51P19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +CIRCUITPY_NETWORK = 1 +MICROPY_PY_WIZNET5K = 5500 +CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c new file mode 100644 index 0000000000..129a3eed9c --- /dev/null +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c @@ -0,0 +1,60 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PB08) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB09) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA04) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PB23) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB22) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB01) }, + + { 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_ROM_QSTR(MP_QSTR_SDA_1), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_SCL_1), MP_ROM_PTR(&pin_PD08) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 5ed4e4d0abfc49d3cde89cebc166ebbe0ef512d8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 21:34:44 +0800 Subject: [PATCH 641/919] lib: tinyusb: update to get tud_task_is_queue_empty This update gives us access to a function we can run with interrupts disabled to determine if the queue is empty. Signed-off-by: Sean Cross --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 76bf96bcb0..dc5445e2f4 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 76bf96bcb0c12ba241ee4ecc175afb257e550d19 +Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab From d1a7fdd9d4720c43d0ab9f16267fd124a414ce9d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 8 May 2020 12:37:32 +0800 Subject: [PATCH 642/919] supervisor: support debugging tinyusb Allow for passing `-DCFG_TUSB_DEBUG=1` or `-DCFG_TUSB_DEBUG=2` on the command line to enable debugging tinyusb within circuitpython. Signed-off-by: Sean Cross --- supervisor/shared/usb/tusb_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 627de743e2..5b7230983e 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -49,7 +49,9 @@ //--------------------------------------------------------------------+ #define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE +#ifndef CFG_TUSB_DEBUG #define CFG_TUSB_DEBUG 0 +#endif /*------------- RTOS -------------*/ #ifndef CFG_TUSB_OS From 77cf4dce8f1ae03edbe275cb82e250daeba8990f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 8 May 2020 12:38:23 +0800 Subject: [PATCH 643/919] nrf: disable interrupts before running wfi In order to ensure we don't have any outstanding requests, disable interrupts prior to issuing `WFI`. As part of this process, check to see if there are any pending USB requests, and only execute the `WFI` if there is no pending data. This fixes #2855 on NRF. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index ea09115f76..aa138e4814 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -51,8 +51,11 @@ #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" +#include "lib/tinyusb/src/device/usbd.h" + #ifdef CIRCUITPY_AUDIOBUSIO #include "common-hal/audiobusio/I2SOut.h" #endif @@ -264,7 +267,15 @@ void port_sleep_until_interrupt(void) { sd_app_evt_wait(); } else { // Call wait for interrupt ourselves if the SD isn't enabled. - __WFI(); + // Note that `wfi` should be called with interrupts disabled, + // to ensure that the queue is properly drained. The `wfi` + // instruction will returned as long as an interrupt is + // available, even though the actual handler won't fire until + // we re-enable interrupts. + common_hal_mcu_disable_interrupts(); + if (!tud_task_event_ready()) + __WFI(); + common_hal_mcu_enable_interrupts(); } } From fd4ef233c6d9b312c3582466c68390a16ddf15fa Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 21:46:37 +0800 Subject: [PATCH 644/919] nrf: port: add memory barrier before wfi ARM recommends issuing a DSB instruction propr to issuing WFI, as it is required on many parts suchas Cortex-M7. This is effectively a no-op on the Cortex-M4 used in most NRF parts, however it ensures that we won't be surprised when new parts come out. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHICBGB.html for more information. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index aa138e4814..36725293c8 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -273,8 +273,10 @@ void port_sleep_until_interrupt(void) { // available, even though the actual handler won't fire until // we re-enable interrupts. common_hal_mcu_disable_interrupts(); - if (!tud_task_event_ready()) + if (!tud_task_event_ready()) { + __DSB(); __WFI(); + } common_hal_mcu_enable_interrupts(); } } From 67cf005ee545df6b1d6f2a4947c58d6c2afb0f51 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 8 May 2020 16:59:39 +0800 Subject: [PATCH 645/919] nrf: nvm: assume sd is not enabled if interrupts are off If interrupts are disabled, then calling sd_* functions will hardfault. Instead, assume that it's safe to write if interrupts are disabled. Signed-off-by: Sean Cross --- ports/nrf/peripherals/nrf/nvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index 63b168f14e..dc50e2eefa 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -40,6 +40,8 @@ STATIC bool sd_is_enabled(void) { uint8_t sd_en = 0; + if (__get_PRIMASK()) + return false; (void) sd_softdevice_is_enabled(&sd_en); return sd_en; } From 2e05f628f0ce09bcd411fab8406b4675c40a0dab Mon Sep 17 00:00:00 2001 From: DavePutz Date: Thu, 21 May 2020 11:08:26 -0500 Subject: [PATCH 646/919] Add an increment to tcc_refcount to allow deinits to work properly --- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index 1da0da8444..b627dadc54 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -181,7 +181,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, mux_position = j; // Claim channel. tcc_channels[timer->index] |= (1 << tcc_channel(timer)); - + tcc_refcount[timer->index]++; } } } From 67cb48acbf46b8f9508a6493578e2895c2b75463 Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Thu, 21 May 2020 18:21:32 -0400 Subject: [PATCH 647/919] Added another except --- tools/extract_pyi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index b61e86e4b5..f0c45dab65 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -70,6 +70,8 @@ def convert_folder(top_level, stub_directory): except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) + except KeyError: + print("Function does not have a key: Name") print() return ok, total From 16ffc731f3c64b36a486a27d87b10742cf5bb4ba Mon Sep 17 00:00:00 2001 From: George Waters Date: Thu, 21 May 2020 21:57:45 -0400 Subject: [PATCH 648/919] Implement negative step for pixelbuf slices --- shared-bindings/_pixelbuf/PixelBuf.c | 27 +++++++++++++-------------- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-module/_pixelbuf/PixelBuf.c | 15 +++++++++++---- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index d8f1810db8..88f3fd684a 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -300,17 +300,20 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp size_t length = common_hal__pixelbuf_pixelbuf_get_len(self_in); mp_seq_get_fast_slice_indexes(length, index_in, &slice); - if (slice.step < 0) { - mp_raise_IndexError(translate("Negative step not supported")); + size_t slice_len; + if (slice.step > 0) { + slice_len = slice.stop - slice.start; + }else{ + slice_len = 1 + slice.start - slice.stop; + } + if (slice.step > 1 || slice.step < -1) { + size_t step = slice.step > 0 ? slice.step : slice.step * -1; + slice_len = (slice_len / step) + (slice_len % step ? 1 : 0); } if (value == MP_OBJ_SENTINEL) { // Get - size_t len = slice.stop - slice.start; - if (slice.step > 1) { - len = (len / slice.step) + (len % slice.step ? 1 : 0); - } - mp_obj_tuple_t* t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); - for (uint i = 0; i < len; i++) { + mp_obj_tuple_t* t = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice_len, NULL)); + for (uint i = 0; i < slice_len; i++) { t->items[i] = common_hal__pixelbuf_pixelbuf_get_pixel(self_in, i * slice.step + slice.start); } return MP_OBJ_FROM_PTR(t); @@ -321,10 +324,6 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp mp_raise_ValueError(translate("tuple/list required on RHS")); } - size_t dst_len = (slice.stop - slice.start); - if (slice.step > 1) { - dst_len = (dst_len / slice.step) + (dst_len % slice.step ? 1 : 0); - } mp_obj_t *src_objs; size_t num_items; if (MP_OBJ_IS_TYPE(value, &mp_type_list)) { @@ -336,9 +335,9 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp num_items = l->len; src_objs = l->items; } - if (num_items != dst_len) { + if (num_items != slice_len) { mp_raise_ValueError_varg(translate("Unmatched number of items on RHS (expected %d, got %d)."), - dst_len, num_items); + slice_len, num_items); } common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.stop, slice.step, src_objs); diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index 68d6d4eefc..d058f43768 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -47,6 +47,6 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self, mp_obj_t item); void common_hal__pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, size_t step, mp_obj_t* values); +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, mp_int_t step, mp_obj_t* values); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index 31350b875c..c32544483c 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -216,12 +216,19 @@ void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t v _pixelbuf_set_pixel_color(self, index, r, g, b, w); } -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, size_t step, mp_obj_t* values) { +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, mp_int_t step, mp_obj_t* values) { pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); size_t source_i = 0; - for (size_t target_i = start; target_i < stop; target_i += step) { - _pixelbuf_set_pixel(self, target_i, values[source_i]); - source_i++; + if (step > 0) { + for (size_t target_i = start; target_i < stop; target_i += step) { + _pixelbuf_set_pixel(self, target_i, values[source_i]); + source_i++; + } + }else{ + for (size_t target_i = start; target_i >= stop; target_i += step) { + _pixelbuf_set_pixel(self, target_i, values[source_i]); + source_i++; + } } if (self->auto_write) { common_hal__pixelbuf_pixelbuf_show(self_in); From 93df3b89e814355a970f40bc13290069ed37b161 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Fri, 22 May 2020 09:54:29 -0400 Subject: [PATCH 649/919] allow PORT specifcation for esp32s2 flashing --- ports/esp32s2/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index be4b2f00fd..9086918604 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -31,6 +31,9 @@ else endif endif +# If the flash PORT is not given, use the default /dev/tty.SLAB_USBtoUART. +PORT ?= /dev/tty.SLAB_USBtoUART + # If the build directory is not given, make it reflect the board name. BUILD ?= build-$(BOARD) @@ -270,7 +273,7 @@ $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BU $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p /dev/tty.SLAB_USBtoUART -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ include $(TOP)/py/mkrules.mk From 75b51429545af57da0f17e983014ef2951370600 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 21 May 2020 11:18:22 -0400 Subject: [PATCH 650/919] Minor style changes and translations --- locale/ID.po | 8 ++------ locale/circuitpython.pot | 8 ++------ locale/cs.po | 8 ++------ locale/de_DE.po | 8 ++------ locale/en_US.po | 8 ++------ locale/en_x_pirate.po | 8 ++------ locale/es.po | 8 ++------ locale/fil.po | 8 ++------ locale/fr.po | 8 ++------ locale/it_IT.po | 8 ++------ locale/ko.po | 8 ++------ locale/nl.po | 8 ++------ locale/pl.po | 8 ++------ locale/pt_BR.po | 8 ++------ locale/sv.po | 8 ++------ locale/zh_Latn_pinyin.po | 8 ++------ ports/mimxrt10xx/common-hal/busio/UART.c | 10 ++++------ 17 files changed, 36 insertions(+), 102 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f7328236e1..16d7865ff9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -816,7 +816,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1538,10 +1538,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 343eef9075..4b72833a79 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -805,7 +805,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1522,10 +1522,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 8341513e68..c333ca8eb7 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -805,7 +805,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1522,10 +1522,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index ec9774f90f..6a630d9031 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -812,7 +812,7 @@ msgstr "Group lleno" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1540,10 +1540,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index 7c58be3f7e..6744a4547e 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -819,7 +819,7 @@ msgstr "Puno ang group" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1545,10 +1545,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index b5b0a7580b..19a3cd98d6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: French \n" "Language-Team: \n" @@ -819,7 +819,7 @@ msgstr "Gruppo pieno" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1556,10 +1556,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index c6e4d52b44..b7af516670 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -809,7 +809,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1526,10 +1526,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index c6d3de032a..957fa91fbd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -823,7 +823,7 @@ msgstr "Groep is vol" msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" @@ -1564,10 +1564,6 @@ msgstr "UART Init Fout" msgid "UART Re-init error" msgstr "UART Re-init Fout" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART schrijf fout" diff --git a/locale/pl.po b/locale/pl.po index 5229fd5358..80a3b2012e 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -808,7 +808,7 @@ msgstr "Grupa pełna" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1527,10 +1527,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3658d91c62..1bfb574ed3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -814,7 +814,7 @@ msgstr "Grupo cheio" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -1539,10 +1539,6 @@ msgstr "" msgid "UART Re-init error" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index e10e7bfc3c..07652af7de 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Anonymous \n" "Language-Team: LANGUAGE \n" @@ -822,7 +822,7 @@ msgstr "Gruppen är full" msgid "Hardware busy, try alternative pins" msgstr "Hårdvaran är upptagen, prova alternativa pinnar" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hårdvaran används redan, prova alternativa pinnar" @@ -1561,10 +1561,6 @@ msgstr "UART Init-fel" msgid "UART Re-init error" msgstr "UART reinit-fel" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART skrivfel" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index db421973b5..58637394ef 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-20 13:28-0400\n" +"POT-Creation-Date: 2020-05-21 11:18-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -816,7 +816,7 @@ msgstr "Fēnzǔ yǐ mǎn" msgid "Hardware busy, try alternative pins" msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" @@ -1548,10 +1548,6 @@ msgstr "UART chūshǐhuà cuòwù" msgid "UART Re-init error" msgstr "UART chóngxīn chūshǐhuà cuòwù" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "UART peripheral is already in use" -msgstr "" - #: ports/stm/common-hal/busio/UART.c msgid "UART write error" msgstr "UART xiě cuòwù" diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index af4328c74b..015b0188f4 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -39,7 +39,7 @@ #include "fsl_lpuart.h" -//arrays use 0 based numbering: UART is stored at index 0 +//arrays use 0 based numbering: UART1 is stored at index 0 #define MAX_UART 8 STATIC bool reserved_uart[MAX_UART]; @@ -85,10 +85,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->character_bits = bits; self->timeout_ms = timeout * 1000; - bool is_onedirection = false; - if (!rx != !tx) { - is_onedirection = true; - } + // We are transmitting one direction if one pin is NULL and the other isn't. + bool is_onedirection = (rx != NULL) != (tx != NULL); bool uart_taken = false; const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); @@ -145,7 +143,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (uart_taken) { - mp_raise_RuntimeError(translate("UART peripheral is already in use")); + mp_raise_RuntimeError(translate("Hardware in use, try alternative pins")); } if(self->rx == NULL && self->tx == NULL) { From 4c01ddcbab7dd4977ce125e1af635c1b7fb0a445 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Fri, 22 May 2020 18:51:12 +0200 Subject: [PATCH 651/919] Add support for Fluff M0 --- ports/atmel-samd/boards/fluff_m0/board.c | 38 +++++++++++++++++++ .../boards/fluff_m0/mpconfigboard.h | 20 ++++++++++ .../boards/fluff_m0/mpconfigboard.mk | 18 +++++++++ ports/atmel-samd/boards/fluff_m0/pins.c | 38 +++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 ports/atmel-samd/boards/fluff_m0/board.c create mode 100644 ports/atmel-samd/boards/fluff_m0/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/fluff_m0/pins.c diff --git a/ports/atmel-samd/boards/fluff_m0/board.c b/ports/atmel-samd/boards/fluff_m0/board.c new file mode 100644 index 0000000000..c8e20206a1 --- /dev/null +++ b/ports/atmel-samd/boards/fluff_m0/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h new file mode 100644 index 0000000000..0782c980df --- /dev/null +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.h @@ -0,0 +1,20 @@ +#define MICROPY_HW_BOARD_NAME "Fluff M0" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA30) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA00) +#define DEFAULT_SPI_BUS_MISO (&pin_PA31) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk new file mode 100644 index 0000000000..8efc1b5759 --- /dev/null +++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x239A +USB_PID = 0x80B0 +USB_PRODUCT = "Fluff M0" +USB_MANUFACTURER = "Radomir Dopieralski" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 + +SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +CFLAGS_INLINE_LIMIT = 35 +endif diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c new file mode 100644 index 0000000000..16802e0920 --- /dev/null +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -0,0 +1,38 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA31) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + + { 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); From f078055f592e01269b1a7648cd05af06b4cc81b5 Mon Sep 17 00:00:00 2001 From: George Waters Date: Fri, 22 May 2020 16:28:09 -0400 Subject: [PATCH 652/919] Use mp_int_t for setting pixelbuf slice indices When handling negative steps, start and stop need to be mp_int_t so they can be checked against a potential negative value during the for loop used to set the slice values. --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-module/_pixelbuf/PixelBuf.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 88f3fd684a..be2b2b086e 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -303,7 +303,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp size_t slice_len; if (slice.step > 0) { slice_len = slice.stop - slice.start; - }else{ + } else { slice_len = 1 + slice.start - slice.stop; } if (slice.step > 1 || slice.step < -1) { diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index d058f43768..9e14b96679 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -47,6 +47,6 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self, mp_obj_t item); void common_hal__pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, mp_int_t step, mp_obj_t* values); +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, mp_int_t start, mp_int_t stop, mp_int_t step, mp_obj_t* values); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index c32544483c..4c61a170d0 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -216,16 +216,16 @@ void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t v _pixelbuf_set_pixel_color(self, index, r, g, b, w); } -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, size_t stop, mp_int_t step, mp_obj_t* values) { +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, mp_int_t start, mp_int_t stop, mp_int_t step, mp_obj_t* values) { pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); size_t source_i = 0; if (step > 0) { - for (size_t target_i = start; target_i < stop; target_i += step) { + for (mp_int_t target_i = start; target_i < stop; target_i += step) { _pixelbuf_set_pixel(self, target_i, values[source_i]); source_i++; } - }else{ - for (size_t target_i = start; target_i >= stop; target_i += step) { + } else { + for (mp_int_t target_i = start; target_i >= stop; target_i += step) { _pixelbuf_set_pixel(self, target_i, values[source_i]); source_i++; } From c592a2b4db112a512b6519fd79f22943b96db40a Mon Sep 17 00:00:00 2001 From: George Waters Date: Fri, 22 May 2020 21:19:17 -0400 Subject: [PATCH 653/919] Simplify pixelbuf set_pixels function --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/_pixelbuf/PixelBuf.h | 2 +- shared-module/_pixelbuf/PixelBuf.c | 16 ++++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index be2b2b086e..601c841e33 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -340,7 +340,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp slice_len, num_items); } - common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.stop, slice.step, src_objs); + common_hal__pixelbuf_pixelbuf_set_pixels(self_in, slice.start, slice.step, slice_len, src_objs); return mp_const_none; #else return MP_OBJ_NULL; // op not supported diff --git a/shared-bindings/_pixelbuf/PixelBuf.h b/shared-bindings/_pixelbuf/PixelBuf.h index 9e14b96679..14ee2e900b 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.h +++ b/shared-bindings/_pixelbuf/PixelBuf.h @@ -47,6 +47,6 @@ void common_hal__pixelbuf_pixelbuf_fill(mp_obj_t self, mp_obj_t item); void common_hal__pixelbuf_pixelbuf_show(mp_obj_t self); mp_obj_t common_hal__pixelbuf_pixelbuf_get_pixel(mp_obj_t self, size_t index); void common_hal__pixelbuf_pixelbuf_set_pixel(mp_obj_t self, size_t index, mp_obj_t item); -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, mp_int_t start, mp_int_t stop, mp_int_t step, mp_obj_t* values); +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values); #endif // CP_SHARED_BINDINGS_PIXELBUF_PIXELBUF_H diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index 4c61a170d0..f9a3b54a4e 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -216,19 +216,11 @@ void _pixelbuf_set_pixel(pixelbuf_pixelbuf_obj_t* self, size_t index, mp_obj_t v _pixelbuf_set_pixel_color(self, index, r, g, b, w); } -void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, mp_int_t start, mp_int_t stop, mp_int_t step, mp_obj_t* values) { +void common_hal__pixelbuf_pixelbuf_set_pixels(mp_obj_t self_in, size_t start, mp_int_t step, size_t slice_len, mp_obj_t* values) { pixelbuf_pixelbuf_obj_t* self = native_pixelbuf(self_in); - size_t source_i = 0; - if (step > 0) { - for (mp_int_t target_i = start; target_i < stop; target_i += step) { - _pixelbuf_set_pixel(self, target_i, values[source_i]); - source_i++; - } - } else { - for (mp_int_t target_i = start; target_i >= stop; target_i += step) { - _pixelbuf_set_pixel(self, target_i, values[source_i]); - source_i++; - } + for (size_t i = 0; i < slice_len; i++) { + _pixelbuf_set_pixel(self, start, values[i]); + start+=step; } if (self->auto_write) { common_hal__pixelbuf_pixelbuf_show(self_in); From 6a5eabaa26857ff82fc83aabf6ebcf845155158f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 23 May 2020 08:36:29 -0500 Subject: [PATCH 654/919] actions: Don't skip trying to (re)install idf tools We were seeing actions failures where the cache would be restored "successfully" but then "Install CircuitPython deps" would fail: # Step "Fetch IDF tool cache" Cache Size: ~247 MB (259277989 B) /bin/tar -xz -f /home/runner/work/_temp/a990f24d-c365-4685-b739-10e052812c81/cache.tgz -C /home/runner/work/circuitpython/circuitpython/.idf_tools Cache restored from key: Linux-idf-tools-731ed12bcdfbfa8b5dd37e03703992271b3ce85dd629e45130f80f43b84ce3a8 ... # Step "Install CircuitPython deps" Adding ESP-IDF tools to PATH... Not using an unsupported version of tool cmake found in PATH: 3.17.0. I checked locally, and (even when dist/* is removed) it is very quick to run each of the `idf_tools install` steps, about 2s total. Try doing this to see whether it fixes the CI problems. --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6eb55ed127..00db855abf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -389,9 +389,8 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }} + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200523 - name: Install IDF tools - if: steps.idf-cache.outputs.cache-hit != 'true' run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required $IDF_PATH/tools/idf_tools.py --non-interactive install cmake From 2ed40075a5c2c3193ed3a6b3c2a751b36e10adb3 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 23 May 2020 20:28:51 -0500 Subject: [PATCH 656/919] pyruler: disable RTC to make build fit with upcoming translations --- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 475d8b6342..885f58e4e1 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -10,6 +10,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 CFLAGS_BOARD = --param max-inline-insns-auto=15 From 03866c0598a3ff697d8112cc46390bb80f62adba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 23 May 2020 20:41:25 -0500 Subject: [PATCH 657/919] meowmeow: disable modules to make build fit with upcoming translations --- ports/atmel-samd/boards/meowmeow/mpconfigboard.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index bd0afb60e2..175501313e 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -9,5 +9,8 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 From eb85304d04cabc150ee21cbf613aa76c905a4edb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 23 May 2020 20:45:22 -0500 Subject: [PATCH 658/919] escornabot: disable RTC to make build fit with upcoming translations --- ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index 93f6b1c90f..e45b5aae35 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -9,5 +9,6 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 From 5cffd7e88d19894f5916ab042ba75f182b0c8104 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 23 May 2020 20:46:56 -0500 Subject: [PATCH 659/919] trinket_m0_haxpress: disable RTC to make build fit with upcoming translations --- ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index e56517b5c7..46f727131d 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -13,6 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 From dd980249c65ef02a0ebbccea21022a1e34aba2bd Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 24 May 2020 20:35:13 -0400 Subject: [PATCH 660/919] Allow setting RGBW pixels with RGB tuples --- shared-module/_pixelbuf/PixelBuf.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/shared-module/_pixelbuf/PixelBuf.c b/shared-module/_pixelbuf/PixelBuf.c index f9a3b54a4e..9d671e454b 100644 --- a/shared-module/_pixelbuf/PixelBuf.c +++ b/shared-module/_pixelbuf/PixelBuf.c @@ -147,18 +147,11 @@ void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t* self, mp_obj_t color, uint8_ *r = value >> 16 & 0xff; *g = (value >> 8) & 0xff; *b = value & 0xff; - // Int colors can't set white directly so convert to white when all components are equal. - if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && *r == *g && *r == *b) { - *w = *r; - *r = 0; - *g = 0; - *b = 0; - } } else { mp_obj_t *items; size_t len; mp_obj_get_array(color, &len, &items); - if (len != byteorder->bpp && !byteorder->is_dotstar) { + if (len < 3 || len > 4) { mp_raise_ValueError_varg(translate("Expected tuple of length %d, got %d"), byteorder->bpp, len); } @@ -171,8 +164,17 @@ void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t* self, mp_obj_t color, uint8_ } else { *w = mp_obj_get_int_truncated(items[PIXEL_W]); } + return; } } + // Int colors can't set white directly so convert to white when all components are equal. + // Also handles RGBW values assigned an RGB tuple. + if (!byteorder->is_dotstar && byteorder->bpp == 4 && byteorder->has_white && *r == *g && *r == *b) { + *w = *r; + *r = 0; + *g = 0; + *b = 0; + } } void _pixelbuf_set_pixel_color(pixelbuf_pixelbuf_obj_t* self, size_t index, uint8_t r, uint8_t g, uint8_t b, uint8_t w) { From d13d0244ecdfd97eba201661b81549b502f22327 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sun, 24 May 2020 20:39:53 -0400 Subject: [PATCH 661/919] Adjust docs to reflect behaviour. --- shared-bindings/_pixelbuf/PixelBuf.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 601c841e33..63a4eaa17e 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -53,18 +53,13 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| When brightness is less than 1.0, a second buffer will be used to store the color values //| before they are adjusted for brightness. //| -//| When ``P`` (pwm duration) is present as the 4th character of the byteorder +//| When ``P`` (PWM duration) is present as the 4th character of the byteorder //| string, the 4th value in the tuple/list for a pixel is the individual pixel -//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the -//| output buffer (``buf``). -//| -//| When ``P`` (pwm duration) is present as the first character of the byteorder -//| string, the 4th value in the tuple/list for a pixel is the individual pixel -//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte in the -//| output buffer (``buf``). +//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each +//| pixel. //| //| :param ~int size: Number of pixels -//| :param ~str byteorder: Byte order string (such as "BGR" or "PBGR") +//| :param ~str byteorder: Byte order string (such as "RGB", "RGBW" or "PBGR") //| :param ~float brightness: Brightness (0 to 1.0, default 1.0) //| :param ~bool auto_write: Whether to automatically write pixels (Default False) //| :param bytes header: Sequence of bytes to always send before pixel values. @@ -276,13 +271,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_f //| def __getitem__(self, index: Any) -> Any: //| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values -//| between 0 and 255.""" +//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel +//| intensity from 0-1.0.""" //| ... //| //| def __setitem__(self, index: Any, value: Any) -> Any: -//| """Sets the pixel value at the given index. Value can either be a tuple of (Red, Green, Blue -//| [, White]) values between 0 and 255 or an integer where the red, green and blue values are -//| packed into the lower three bytes (0xRRGGBB).""" +//| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are +//| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the +//| red, green and blue values are packed into the lower three bytes (0xRRGGBB). +//| For RGBW byteorders, if given only RGB values either as an int or as a tuple, the white value +//| is used instead when the red, green, and blue values are the same.""" //| ... //| STATIC mp_obj_t pixelbuf_pixelbuf_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) { From 8e24d1f4b748c7dc3e739c6aaa4624d5175c7dda Mon Sep 17 00:00:00 2001 From: cyz Date: Mon, 25 May 2020 14:59:36 +0800 Subject: [PATCH 662/919] Add hiibot_bluefi board in build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 826ca279c7..892c82483e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,6 +182,7 @@ jobs: - "grandcentral_m4_express" - "hallowing_m0_express" - "hallowing_m4_express" + - "hiibot_bluefi" - "imxrt1010_evk" - "imxrt1020_evk" - "imxrt1060_evk" From e79340601fc051183d6cc243c43da7f2e75249ae Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 25 May 2020 20:51:02 +0700 Subject: [PATCH 663/919] fix racing issue for SAMD when executing WFI --- ports/atmel-samd/supervisor/port.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index eadd3e8f53..2b3e9826f8 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -69,6 +69,7 @@ #include "samd/events.h" #include "samd/external_interrupts.h" #include "samd/dma.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" #include "reset.h" @@ -496,7 +497,12 @@ void port_sleep_until_interrupt(void) { (void) __get_FPSCR(); } #endif - __WFI(); + common_hal_mcu_disable_interrupts(); + if (!tud_task_event_ready()) { + __DSB(); + __WFI(); + } + common_hal_mcu_enable_interrupts(); } /** From b35ab3effb7dca13b37770b4d191f7e6483588d2 Mon Sep 17 00:00:00 2001 From: Timon Date: Thu, 21 May 2020 22:23:44 +0000 Subject: [PATCH 664/919] Translated using Weblate (German) Currently translated at 85.8% (641 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 290 ++++++++++++++++++++++++++---------------------- 1 file changed, 157 insertions(+), 133 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 5bbfd9d403..2c0988d750 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-18 02:48+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-05-22 07:35+0000\n" +"Last-Translator: Timon \n" "Language-Team: German \n" "Language: de_DE\n" @@ -65,7 +65,7 @@ msgstr "%%c erwartet int oder char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -252,7 +252,7 @@ msgstr "*x muss Zuordnungsziel sein" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", in %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -313,11 +313,11 @@ msgstr "Alle timer werden benutzt" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Bereits am anbieten (advertising)." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn ist an diesem Pin nicht unterstützt" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -348,11 +348,13 @@ msgstr "Array-Werte sollten aus Einzelbytes bestehen." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt " +"wird." #: main.c msgid "Auto-reload is off.\n" @@ -401,7 +403,7 @@ msgstr "Die Helligkeit ist nicht einstellbar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Puffer + Offset zu klein% d% d% d" #: shared-module/usb_hid/Device.c #, c-format @@ -429,12 +431,12 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Puffer zu groß und kann nicht reserviert werden" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer um %d Bytes zu kurz" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -452,7 +454,7 @@ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -460,7 +462,7 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -479,6 +481,7 @@ msgstr "Kann Temperatur nicht holen" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Es können keine Scanantworten für erweiterte, verbindbare Anzeigen vorliegen." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -508,11 +511,11 @@ msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "RTS oder CTS können im RS485-Modus nicht angegeben werden" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Slice kann keine sub-klasse sein" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -525,6 +528,7 @@ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" +"Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -536,13 +540,16 @@ msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython befindet sich im abgesicherten Modus, da Sie beim Booten die " +"Reset-Taste gedrückt haben. Drücken Sie erneut, um den abgesicherten Modus " +"zu verlassen.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -570,6 +577,8 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Die Verbindung wurde getrennt und kann nicht mehr verwendet werden. " +"Erstellen Sie eine neue Verbindung." #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -585,35 +594,35 @@ msgstr "Konnte UART nicht initialisieren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Kanal konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Timer konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Kanal konnte nicht neu initiiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Timer konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "PWM konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "PWM konnte nicht gestartet werden" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Interrupt konnte nicht gestartet werden, RX beschäftigt" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Decoder konnte nicht zugeordnet werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -622,7 +631,7 @@ msgstr "Konnte first buffer nicht zuteilen" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Eingabepuffer konnte nicht reserviert werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -631,15 +640,15 @@ msgstr "Konnte second buffer nicht zuteilen" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Absturz in den HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "DAC Kanal Intialisierungs Fehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "DAC Device Init Error" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -668,7 +677,7 @@ msgstr "Gerät in Benutzung" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -687,7 +696,7 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -732,10 +741,11 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." msgstr "" +"Erweiterte Werbung (advertising) mit Scanantwort wird nicht unterstützt." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT ist nur für ndarrays definiert" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -761,7 +771,7 @@ msgstr "Konnte keine RX Buffer mit %d allozieren" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Verbindung fehlgeschlagen: interner Fehler" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" @@ -778,7 +788,7 @@ msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Interner Flash konnte nicht geschrieben werden." #: py/moduerrno.c msgid "File exists" @@ -812,7 +822,7 @@ msgstr "Gruppe voll" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" #: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" @@ -824,7 +834,7 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C-Init-Fehler" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -853,7 +863,7 @@ msgstr "Eingabe-/Ausgabefehler" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Unzureichende Authentifizierung" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" @@ -861,7 +871,7 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Interner Definitionsfehler" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format @@ -875,7 +885,7 @@ msgstr "Ungültiger %q pin" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Ungültiger ADC-Einheitenwert" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -887,7 +897,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Ungültige I2C-Pinauswahl" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -901,7 +911,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Ungültige UART-Pinauswahl" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -941,7 +951,7 @@ msgstr "Ungültige format chunk size" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Ungültige Frequenz geliefert" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." @@ -981,7 +991,7 @@ msgstr "Ungültige Pins" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Ungültige Pins für PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1018,7 +1028,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1059,7 +1069,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Schwerwiegender MicroPython-Fehler." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1076,7 +1086,7 @@ msgstr "Muss eine %q Unterklasse sein." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Muss MISO- oder MOSI-Pin bereitstellen" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1085,7 +1095,7 @@ msgstr "" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Name zu lang" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" @@ -1107,7 +1117,7 @@ msgstr "Kein DMA Kanal gefunden" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Kein MISO Pin" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" @@ -1131,7 +1141,7 @@ msgstr "Keine Taktgeber verfügbar" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Keine Verbindung: Länge kann nicht bestimmt werden" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1160,11 +1170,11 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Keine lange Ganzzahlunterstützung" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "An diesem Pin sind keine Timer mehr verfügbar." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1184,7 +1194,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Fehlerbehauptung für Nordic Soft Device." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1261,7 +1271,7 @@ msgstr "Pin hat keine ADC Funktionalität" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin muss Hardware-Interrupts unterstützen" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" @@ -1274,6 +1284,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinbelegung verwendet% d Bytes pro Element, was mehr als die idealen% d " +"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie " +"allow_inefficient = True an den Konstruktor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1285,7 +1298,7 @@ msgstr "" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop aus einem leeren Ps2-Puffer" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" @@ -1303,7 +1316,7 @@ msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" @@ -1311,7 +1324,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" @@ -1319,7 +1332,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1337,7 +1350,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Fehler bei der Erzeugung von Zufallszahlen" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1381,7 +1394,7 @@ msgstr "SDA oder SCL brauchen pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI-Init-Fehler" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" @@ -1398,7 +1411,7 @@ msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Scannen Sie bereits in Bearbeitung. Stoppen Sie mit stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" @@ -1406,7 +1419,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Ausgewählter RTS-Pin ungültig" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1440,7 +1453,7 @@ msgstr "Stream fehlt readinto() oder write() Methode." #: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Geben Sie mindestens einen UART-Pin an" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -1451,6 +1464,8 @@ msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"Der CircuitPython-Heap wurde beschädigt, weil der Stapel zu klein war.\n" +"Bitte erhöhen Sie die Stapelgröße, wenn Sie wissen wie oder wenn nicht:" #: supervisor/shared/safe_mode.c msgid "" @@ -1469,7 +1484,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" @@ -1477,7 +1492,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" @@ -1485,7 +1500,7 @@ msgstr "" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" @@ -1493,7 +1508,7 @@ msgstr "" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Kachelwert außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1502,7 +1517,7 @@ msgstr "" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1519,6 +1534,8 @@ msgstr "Zu viele displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +"Die Gesamtzahl der zu schreibenden Daten ist größer als " +"outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1534,7 +1551,7 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "UART De-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" @@ -1542,7 +1559,7 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UART Re-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" @@ -1602,7 +1619,7 @@ msgstr "Unerwarteter nrfx uuid-Typ" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Unbekannter Gatt-Fehler: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." @@ -1611,7 +1628,7 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Unbekannter Sicherheitsfehler: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1630,6 +1647,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Nicht näher bezeichnetes Problem. Möglicherweise wurde die Pairing-" +"Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1667,7 +1686,7 @@ msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Lesen der Spannung" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1697,6 +1716,8 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" +"Sie befinden sich im abgesicherten Modus: Es ist etwas Unerwartetes passiert." +"\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1746,7 +1767,7 @@ msgstr "arg ist eine leere Sequenz" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "Das Argument argsort muss ein ndarray sein" #: py/runtime.c msgid "argument has wrong type" @@ -1771,7 +1792,7 @@ msgstr "Array/Bytes auf der rechten Seite erforderlich" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" #: py/objstr.c msgid "attributes not supported yet" @@ -1779,7 +1800,7 @@ msgstr "Attribute werden noch nicht unterstützt" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0, Keine oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" @@ -1787,7 +1808,7 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "Die Achse muss None, 0 oder 1 sein" #: py/builtinevex.c msgid "bad compile mode" @@ -1795,7 +1816,7 @@ msgstr "" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "schlechter Konvertierungsspezifizierer" #: py/objstr.c msgid "bad format string" @@ -1852,7 +1873,7 @@ msgstr "" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "Bytecode nicht implementiert" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" @@ -1864,7 +1885,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "Byte-Wert außerhalb des Bereichs" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" @@ -1983,7 +2004,7 @@ msgstr "Laden mit '%q' index nicht möglich" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "Ich kann den Wurf nicht an den gerade gestarteten Generator hängen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" @@ -2009,6 +2030,8 @@ msgstr "Speichern mit '%q' Index nicht möglich" msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"kann nicht von der automatischen Feldnummerierung zur manuellen " +"Feldspezifikation wechseln" #: py/objstr.c msgid "" @@ -2033,7 +2056,7 @@ msgstr "kann keinen relativen Import durchführen" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" #: py/emitnative.c msgid "casting" @@ -2041,7 +2064,7 @@ msgstr "" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "(char) Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2061,7 +2084,7 @@ msgstr "Farbpuffer muss 3 Bytes (RGB) oder 4 Bytes (RGB + pad byte) sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "Der Farbpuffer muss ein Puffer, ein Tupel, eine Liste oder ein Int sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2102,7 +2125,7 @@ msgstr "" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" @@ -2110,7 +2133,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "Eingabearray konnte nicht aus der Form übertragen werden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" @@ -2118,7 +2141,7 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof muss kleiner als die Länge des Datensatzes sein" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2135,7 +2158,7 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "Der Zielpuffer muss ein Array vom Typ 'H' für bit_depth = 16 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2147,7 +2170,7 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff Argument muss ein ndarray sein" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2181,7 +2204,7 @@ msgstr "end_x sollte ein int sein" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "Fehler = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -2225,7 +2248,7 @@ msgstr "" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "Die f-String expression darf keinen Backslash enthalten" #: py/parse.c msgid "f-string: empty expression not allowed" @@ -2233,7 +2256,7 @@ msgstr "" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: erwartet '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" @@ -2250,7 +2273,7 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "Das erste Argument muss iterierbar sein" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" @@ -2266,7 +2289,7 @@ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" @@ -2282,7 +2305,7 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "Format erfordert ein Wörterbuch (dict)" #: py/objdeque.c msgid "full" @@ -2371,7 +2394,7 @@ msgstr "padding ist inkorrekt" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "Index ist außerhalb der Grenzen" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2394,7 +2417,7 @@ msgstr "inline assembler muss eine function sein" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" @@ -2402,7 +2425,7 @@ msgstr "" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "Eingabedaten müssen iterierbar sein" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" @@ -2410,7 +2433,7 @@ msgstr "" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "Eingabematrix ist singulär" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" @@ -2418,7 +2441,7 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" @@ -2504,7 +2527,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "iterables sind nicht gleich lang" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" @@ -2540,7 +2563,7 @@ msgstr "Für diesen Typ ist length nicht zulässig" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "Der Pegel muss zwischen 0 und 1 liegen" #: py/objarray.c msgid "lhs and rhs should be compatible" @@ -2574,7 +2597,7 @@ msgstr "map buffer zu klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "Mathe-Domain-Fehler" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" @@ -2582,7 +2605,7 @@ msgstr "" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "Matrix ist nicht positiv definitiv" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2617,7 +2640,7 @@ msgstr "mehrere *x in Zuordnung" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "Mehrere Basen haben einen Instanzlayoutkonflikt" #: py/objtype.c msgid "multiple inheritance not supported" @@ -2637,7 +2660,7 @@ msgstr "muss Schlüsselwortargument für key function verwenden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n muss zwischen 0 und 9 liegen" #: py/runtime.c msgid "name '%q' is not defined" @@ -2658,7 +2681,7 @@ msgstr "" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Zum Entpacken sind mehr als %d Werte erforderlich" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" @@ -2666,7 +2689,7 @@ msgstr "" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "Negative shift Anzahl" #: py/vm.c msgid "no active exception to reraise" @@ -2678,7 +2701,7 @@ msgstr "kein verfügbares Netzwerkadapter (NIC)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "Kein Binding für nonlocal gefunden" #: py/builtinimport.c msgid "no module named '%q'" @@ -2707,7 +2730,7 @@ msgstr "eine nicht-hex zahl wurde gefunden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" @@ -2720,6 +2743,7 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" +"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" #: py/objstr.c msgid "not enough arguments for format string" @@ -2727,7 +2751,7 @@ msgstr "" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" @@ -2760,7 +2784,7 @@ msgstr "Objekt ist kein Iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "Objekt nicht aufrufbar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2803,7 +2827,7 @@ msgstr "" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "Operanden konnten nicht zusammen gesendet werden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" @@ -2811,7 +2835,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "Die Operation wird für den angegebenen Typ nicht unterstützt" #: py/modbuiltins.c msgid "ord expects a character" @@ -2846,7 +2870,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -2862,7 +2886,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2897,7 +2921,7 @@ msgstr "Warteschlangenüberlauf" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "rohe F-Strings sind nicht implementiert" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" @@ -2918,7 +2942,7 @@ msgstr "return annotation muss ein identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -2928,7 +2952,7 @@ msgstr "" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" @@ -2936,7 +2960,7 @@ msgstr "" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" @@ -2960,7 +2984,7 @@ msgstr "kompilieren von Skripten nicht unterstützt" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "Form muss ein 2-Tupel sein" #: py/objstr.c msgid "sign not allowed in string format specifier" @@ -2968,7 +2992,7 @@ msgstr "" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" #: py/objstr.c msgid "single '}' encountered in format string" @@ -2976,7 +3000,7 @@ msgstr "" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "Größe ist nur für ndarrays definiert" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" @@ -2984,7 +3008,7 @@ msgstr "" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "Der Slice-Schritt kann nicht Null sein" #: py/objint.c py/sequence.c msgid "small int overflow" @@ -3029,7 +3053,7 @@ msgstr "String index außerhalb des Bereiches" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "String indizes müssen Ganzzahlen sein, nicht %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3074,7 +3098,7 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3086,7 +3110,7 @@ msgstr "" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "zu viele Argumente mit dem angegebenen Format" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -3095,7 +3119,7 @@ msgstr "" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "zu viele Werte zum Auspacken (erwartet %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" @@ -3107,7 +3131,7 @@ msgstr "tupel/list hat falsche Länge" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "Tupel / Liste auf RHS erforderlich" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -3129,7 +3153,7 @@ msgstr "" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "Typ akzeptiert 1 oder 3 Argumente" #: py/objint_longlong.c msgid "ulonglong too large" @@ -3155,7 +3179,7 @@ msgstr "unerwartetes Keyword-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "Unicode Name ausgebrochen (escaped)" #: py/parse.c msgid "unindent does not match any outer indentation level" @@ -3171,7 +3195,7 @@ msgstr "" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" #: py/compile.c msgid "unknown type" @@ -3202,7 +3226,7 @@ msgstr "nicht unterstützter Thumb-Befehl '%s' mit %d Argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "nicht unterstützte Xtensa-Anweisung '%s' mit %d Argumenten" #: py/objstr.c #, c-format @@ -3232,7 +3256,7 @@ msgstr "value_count muss größer als 0 sein" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "Fenster muss <= Intervall sein" #: extmod/ulab/code/linalg.c msgid "wrong argument type" @@ -3240,7 +3264,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "falscher Indextyp" #: py/objstr.c msgid "wrong number of arguments" @@ -3268,7 +3292,7 @@ msgstr "y Wert außerhalb der Grenzen" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "Nullschritt" #~ msgid "AP required" #~ msgstr "AP erforderlich" From 5820a6a7000232ff1b5a6015be77a067a7b5904b Mon Sep 17 00:00:00 2001 From: Dustin Watts Date: Fri, 22 May 2020 16:55:49 +0000 Subject: [PATCH 665/919] Translated using Weblate (Dutch) Currently translated at 99.8% (746 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 263 ++++++++++++++++++++++++++------------------------- 1 file changed, 134 insertions(+), 129 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index c948425dab..81845507d7 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-19 17:08+0000\n" +"PO-Revision-Date: 2020-05-23 12:25+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" @@ -1291,7 +1291,7 @@ msgstr "En iedere module in het bestandssysteem\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygon heeft op zijn minst 3 punten nodig" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1518,7 +1518,7 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1809,532 +1809,537 @@ msgstr "verkeerde compileer modus" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "slechte conversie specificatie" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "string met verkeerde indeling" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "verkeerde typecode" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "binaire op %q niet geïmplementeerd" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "bits moet 7, 8, of 9 zijn" #: extmod/machine_spi.c msgid "bits must be 8" -msgstr "" +msgstr "bits moet 8 zijn" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sample moet 8 of 16 zijn" #: py/emitinlinethumb.c +#, fuzzy msgid "branch not in range" -msgstr "" +msgstr "branch niet binnen bereik" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "buffer moet een byte-achtig object zijn" #: shared-module/struct/__init__.c msgid "buffer size must match format" -msgstr "" +msgstr "grootte van de buffer moet overeenkomen met het formaat" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "buffer slices moeten van gelijke grootte zijn" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "buffer te klein" #: extmod/machine_spi.c msgid "buffers must be the same length" -msgstr "" +msgstr "buffers moeten dezelfde lengte hebben" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "buttons moeten digitalio.DigitalInOut zijn" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "byte code niet geïmplementeerd" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder is geen string" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" -msgstr "" +msgstr "butes > 8 niet ondersteund" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "bytes waarde buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" -msgstr "" +msgstr "calibration is buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "" +msgstr "calibration is alleen-lezen" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" -msgstr "" +msgstr "calibration waarde buiten bereik +/-127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Thumb assembly geven" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Xtensa assembly geven" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "kan alleen byte-code opslaan" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"kan geen speciale methode aan een al ge-subkwalificeerde klasse toevoegen" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "kan niet toewijzen aan expressie" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "kan %s niet converteren naar een complex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "kan %s niet omzetten naar een float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "kan %s niet omzetten naar een int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "kan '%q' object niet omzetten naar %q impliciet" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "kan NaN niet omzetten naar int" #: shared-bindings/i2cslave/I2CSlave.c msgid "can't convert address to int" -msgstr "" +msgstr "kan adres niet omzetten naar int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "kan inf niet omzetten naar int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "kan niet omzetten naar complex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "kan niet omzetten naar float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "kan niet omzetten naar int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "kan niet omzetten naar str impliciet" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "kan geen nonlocal in buitenste code declareren" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "kan expressie niet verwijderen" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "kan geen een binaire operatie doen tussen '%q' en '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "kan geen afgekapte deling doen van een comlex nummer" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "kan niet meerdere **x hebben" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "kan geen meerdere *x hebben" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "kan '%q niet impliciet converteren naar 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "kan niet laden van '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "kan niet met '%q' index laden" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "kan throw niet aan net gestartte generator toevoegen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" -msgstr "" +msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "kan attribute niet instellen" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "kan '%q' niet opslaan" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "kan niet naar '%q' opslaan" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "kan niet opslaan met '%q' als index" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" -msgstr "" +msgstr "kan niet schakelen tussen automatische en handmatige veld specificatie" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" -msgstr "" +msgstr "kan niet schakelen tussen handmatige en automatische veld specificatie" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "kan geen instanties van '%q' creëren" #: py/objtype.c msgid "cannot create instance" -msgstr "" +msgstr "kan geen instantie creëren" #: py/runtime.c msgid "cannot import name %q" -msgstr "" +msgstr "kan naam %q niet importeren" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "kan geen relatieve import uitvoeren" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "kan de array niet hervormen (niet verenigbare input/output vorm)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "casting" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "chars buffer te klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "chr() arg niet binnen bereik (0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "chr() arg niet binnen bereik (256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" msgstr "" +"cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "kleurbuffer moet 3 bytes (RGB) of 4 bytes (RGB + pad byte) zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "kleurbuffer moet een buffer, tuple, list, of int zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" +msgstr "kleurbuffer moet een bytearray of array van type 'b' of 'B' zijn" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "" +msgstr "kleur moet tussen 0x000000 en 0xffffff liggen" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" -msgstr "" +msgstr "kleur moet een int zijn" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "complexe deling door 0" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "complexe waardes niet ondersteund" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "compressie header" #: py/parse.c msgid "constant must be an integer" -msgstr "" +msgstr "constant moet een integer zijn" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "conversie naar object" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "convolutie argumenten moeten lineaire arrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "convolutie argumenten moeten ndarrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "convolutie argumenten mogen niet leeg zijn" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "kon de invoerarray niet vanuit vorm uitzenden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "kon de Vandermonde matrix niet omkeren" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof kleiner dan de lengte van de data set" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "decimale getallen zijn niet ondersteund" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "standaard 'expect' moet laatste zijn" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"bestemming buffer moet een bytearray of array van het type 'B' voor " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "bestemming buffer moet een array van het type 'H' voor bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "" +msgstr "destination_lengte moest een int groter dan of gelijk zijn aan 0 zijn" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "dict update sequence heeft de verkeerde lengte" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff argument moet een ndarray zijn" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" -msgstr "" +msgstr "deling door nul" #: py/objdeque.c msgid "empty" -msgstr "" +msgstr "leeg" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "" +msgstr "lege heap" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "lege seperator" #: shared-bindings/random/__init__.c msgid "empty sequence" -msgstr "" +msgstr "lege sequentie" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "einde van format terwijl zoekend naar conversie-specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "" +msgstr "end_x moet een int zijn" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "fout = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "uitzonderingen moeten afleiden van BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "verwachtte ':' na format specifier" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "verwachtte een tuple/lijst" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "verwacht een dict voor keyword argumenten" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "verwacht een assembler instructie" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "verwacht alleen een waarde voor set" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "verwacht key:waarde for dict" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "" +msgstr "extra keyword argumenten gegeven" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "" +msgstr "extra positionele argumenten gegeven" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expressie deel kan geen '#' bevatten" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-string expressie deel kan geen backslash bevatten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: lege expressie niet toegestaan" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: verwacht '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: enkele '}' is niet toegestaan" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "bestand moet een bestand zijn geopend in byte modus" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "" +msgstr "bestandssysteem moet een mount methode bieden" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "eerst argument moet een iterabel zijn" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "eerst argument moet een ndarray zijn" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "eerste argument voor super() moet een type zijn" #: extmod/machine_spi.c msgid "firstbit must be MSB" -msgstr "" +msgstr "het eerste bit moet het MSB zijn" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "flip argumenten moeten een ndarray zijn" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "float is te groot" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "lettertype moet 2048 bytes lang zijn" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "format vereist een dict" #: py/objdeque.c msgid "full" -msgstr "" +msgstr "vol" #: py/argcheck.c msgid "function does not take keyword arguments" -msgstr "" +msgstr "functie accepteert geen keyword argumenten" #: py/argcheck.c #, c-format msgid "function expected at most %d arguments, got %d" -msgstr "" +msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "functie kreeg meedere waarden voor argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" -msgstr "" +msgstr "functie mist %d vereist positionele argumenten" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "functie mist keyword-only argument" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "functie mist vereist sleutelwoord argument \"%q" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "functie mist vereist positie-argument #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format From e14b064cbb97efde25994132b0a1b4a98a75baa7 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Fri, 22 May 2020 17:35:28 +0000 Subject: [PATCH 666/919] Translated using Weblate (Dutch) Currently translated at 99.8% (746 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 447 ++++++++++++++++++++++++++------------------------- 1 file changed, 227 insertions(+), 220 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 81845507d7..50f7c60954 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-23 12:25+0000\n" -"Last-Translator: Dustin Watts \n" +"Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -2345,929 +2345,936 @@ msgstr "functie mist vereist positie-argument #%d" #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" +"functie vraagt %d argumenten zonder keyword maar %d argumenten werden gegeven" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "" +msgstr "functie vraagt precies 9 argumenten" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "generator wordt al uitgevoerd" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "generator negeerde GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "graphic moet 2048 bytes lang zijn" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "" +msgstr "heap moet een lijst zijn" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als nonlocal" #: py/objstr.c msgid "incomplete format" -msgstr "" +msgstr "incompleet formaat" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "incomplete formaatsleutel" #: extmod/modubinascii.c msgid "incorrect padding" -msgstr "" +msgstr "vulling (padding) is onjuist" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "index is buiten bereik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" -msgstr "" +msgstr "index is buiten bereik" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "indices moeten integers zijn" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "inline assembler moet een functie zijn" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "invoerargument moet een integer of 2-tuple zijn" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "invoer array lengte moet een macht van 2 zijn" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "invoerdata moet itereerbaar zijn" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "invoermatrix is asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "invoermatrix is singulier" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "invoer moet een vierkante matrix zijn" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "invoervectors moeten van gelijke lengte zijn" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() argument 2 moet >=2 en <= 36 zijn" #: py/objstr.c msgid "integer required" -msgstr "" +msgstr "integer vereist" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "interval moet binnen bereik %s-%s vallen" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" -msgstr "" +msgstr "onjuist I2C randapparaat" #: extmod/machine_spi.c msgid "invalid SPI peripheral" -msgstr "" +msgstr "onjuist SPI randapparaat" #: lib/netutils/netutils.c msgid "invalid arguments" -msgstr "" +msgstr "ongeldige argumenten" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "" +msgstr "ongeldig certificaat" #: extmod/uos_dupterm.c msgid "invalid dupterm index" -msgstr "" +msgstr "ongeldige dupterm index" #: extmod/modframebuf.c msgid "invalid format" -msgstr "" +msgstr "ongeldig formaat" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "ongeldige formaatspecificatie" #: extmod/modussl_axtls.c msgid "invalid key" -msgstr "" +msgstr "ongeldige sleutel" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "ongeldige micropython decorator" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "ongeldige stap" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "ongeldige syntax" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "ongeldige syntax voor integer" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "ongeldige syntax voor integer met grondtal %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "ongeldige syntax voor nummer" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() argument 1 moet een klasse zijn" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() argument 2 moet een klasse of tuple van klassen zijn" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "itereerbare objecten hebben niet dezelfde lengte" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "itereerbare objecten convergeren niet" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join verwacht een lijst van str/byte objecten die consistent zijn met het " +"self-object" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"trefwoord argument(en) zijn niet geïmplementeerd, gebruik normale argumenten" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "trefwoorden moeten van type string zijn" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "label '%q' is niet gedefinieerd" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "label opnieuw gedefinieerd" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "voor dit type is length niet toegestaan" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "level moet tussen 0 en 1 liggen" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "lhs en rhs moeten compatibel zijn" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "lokale '%q' is van type '%q' maar bron is '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "lokale '%q' gebruikt voordat type bekend is" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "long int wordt niet ondersteund in deze build" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "onjuist gevormde f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "map buffer te klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "fout in het wiskundig domein (math domain error)" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "matrix afmetingen komen niet overeen" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "matrix is niet positief-definiet" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length moet 0-%d zijn als fixed_length %s is" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "maximale recursiediepte overschreden" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "geheugentoewijzing mislukt, %u bytes worden toegewezen" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "" +msgstr "geheugentoewijzing mislukt, heap is vergrendeld" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "module niet gevonden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "meer vrijheidsgraden dan datapunten" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "meerdere *x in toewijzing" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "meerdere grondtallen (bases) hebben instance lay-out conflicten" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "meervoudige overerving niet ondersteund" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "moet een object oproepen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" -msgstr "" +msgstr "sck/mosi/miso moeten alle gespecificeerd worden" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n moet tussen 0 en 9 liggen" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "naam '%q' is niet gedefinieerd" #: py/runtime.c msgid "name not defined" -msgstr "" +msgstr "naam is niet gedefinieerd" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "naam hergebruikt voor argument" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "natuurlijke opbrengst (native yield)" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Om uit te pakken zijn meer dan %d waarden vereist" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negatieve macht terwijl er geen ondersteuning is voor float" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "negatieve verschuivingstelling (shift count)" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "geen netwerkadapter (NIC) beschikbaar" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "geen binding voor nonlocal gevonden" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "geen module met naam '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "geen reset pin beschikbaar" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "niet zo'n attribuut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "niet-UUID gevonden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "niet-standaard argument volgt op een standaard argument" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "er werd een niet-hexadecimaal cijfer gevonden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "niet-trefwoord argument na */**" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "niet-trefwoord argument na trefwoord argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "geen 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "niet alle argumenten omgezet bij formattering van string" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "niet genoeg argumenten om string te formatteren" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "aantal argumenten moet 2 of 3 zijn" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "aantal punten moet minimaal 2 zijn" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "object '%s' is geen tuple of lijst" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "object ondersteund toewijzen van elementen niet" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "object ondersteund verwijderen van elementen niet" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "object heeft geen len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "object heeft geen '__getitem__'-methode (not subscriptable)" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "object is geen iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "object niet aanroepbaar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" -msgstr "" +msgstr "object niet in volgorde (sequence)" #: py/runtime.c msgid "object not iterable" -msgstr "" +msgstr "object niet itereerbaar" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "object van type '%s' heeft geen len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "object met buffer protocol vereist" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "string met oneven lengte" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "offset buiten bereik" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "alleen bit_depth=16 wordt ondersteund" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "alleen sample_rate=16000 wordt ondersteund" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" -msgstr "" +msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "operands konden niet samen verzonden worden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "bewerking is voor ndarrays niet geïmplementeerd" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "bewerking wordt niet ondersteund voor dit type" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "ord verwacht een teken (char)" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "" +msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "" +msgstr "overloop bij converteren van long int naar machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "palette moet 32 bytes lang zijn" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index moet een int zijn" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "parameter annotatie moet een identifier zijn" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde a2 tot a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde r0 tot r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "pixel coördinaten buiten bereik" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "pixel waarde vereist te veel bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "pixel_shader moet displayio.Palette of displayio.ColorConverter zijn" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" msgstr "" +"polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop van een lege PulseIn" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop van een lege set" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop van een lege lijst" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): dictionary is leeg" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "derde argument van pow() mag geen 0 zijn" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow() met 3 argumenten vereist integers" #: extmod/modutimeq.c msgid "queue overflow" -msgstr "" +msgstr "wachtrij overloop" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "ruwe f-strings zijn niet geïmplementeerd" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "reëel en imaginair deel moeten gelijke lengte hebben" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "relatieve import" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "gevraagde lengte is %d maar object heeft lengte %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "return annotatie moet een identifier zijn" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "return verwacht '%q' maar ontving '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] is hetzelfde als een andere pintoewijzing" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] bevindt zich niet op dezelfde poort als klok" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "de rechterkant moet een ndarray of scalar zijn" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"sample_source buffer moet een bytearray of array van type 'h', 'H', 'b' of " +"'B' zijn" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "" +msgstr "bemonsteringssnelheid buiten bereik" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "schedule stack is vol" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "" +msgstr "scriptcompilatie wordt niet ondersteund" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "vorm moet een 2-tuple zijn" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "teken niet toegestaan in string formaatspecificatie" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "omvang is alleen voor ndarrays gedefinieerd" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "de slaapduur mag niet negatief zijn" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "segmentstap mag niet nul zijn" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "small int overloop" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "zachte herstart\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sorteerargument moet een ndarray zijn" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "start/stop indices" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" -msgstr "" +msgstr "start_x moet een int zijn" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "" +msgstr "step mag geen nul zijn" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "stop moet 1 of 2 zijn" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop is niet bereikbaar vanaf start" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "stream operatie niet ondersteund" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "string index buiten bereik" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "string indices moeten integer zijn, niet %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "string niet ondersteund; gebruik bytes of bytearray" #: extmod/moductypes.c msgid "struct: cannot index" -msgstr "" +msgstr "struct: kan niet indexeren" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "" +msgstr "struct: index buiten bereik" #: extmod/moductypes.c msgid "struct: no fields" -msgstr "" +msgstr "struct: geen velden" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "deelreeks niet gevonden" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "super() kan self niet vinden" #: extmod/modujson.c msgid "syntax error in JSON" -msgstr "" +msgstr "syntaxisfout in JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "syntaxisfout in uctypes aanduiding" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "" +msgstr "drempelwaarde moet in het bereik 0-65536 liggen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() accepteert een 9-rij" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "" +msgstr "timeout moet groter dan 0.0 zijn" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "timestamp buiten bereik voor platform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "te veel argumenten opgegeven bij dit formaat" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "te veel indices" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "te veel waarden om uit te pakken (%d verwacht)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "tuple index buiten bereik" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "tuple of lijst heeft onjuiste lengte" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "tuple of lijst vereist op RHS" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "" +msgstr "tx en rx kunnen niet beiden None zijn" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "type '%q' is geen aanvaardbaar basistype" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "type is geen aanvaardbaar basistype" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "objecttype '%q' heeft geen attribuut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "type accepteert 1 of 3 argumenten" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong te groot" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "unair op %q niet geïmplementeerd" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "onverwachte inspringing" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "onverwacht trefwoordargument" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "onverwacht trefwoordargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "op naam gebaseerde unicode escapes zijn niet geïmplementeerd" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "inspringing komt niet overeen met hoger gelegen inspringingsniveaus" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "onbekende conversiespecificatie %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "onbekende formaatcode '%c' voor object van type '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "onbekend type" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "onbekend type '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' zonder overeenkomst in formaat" #: py/objtype.c py/runtime.c msgid "unreadable attribute" -msgstr "" +msgstr "onleesbaar attribuut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "niet ondersteund %q type" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Thumb instructie '%s' met %d argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Xtensa instructie '%s' met %d argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "niet ondersteund formaatkarakter '%c' (0x%x) op index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "niet ondersteund type voor %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "niet ondersteund type voor operator" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "niet ondersteunde types voor %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "waarde moet in %d byte(s) passen" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_count moet groter dan 0 zijn" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "window moet <= interval zijn" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "onjuist argumenttype" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "onjuist indextype" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "onjuist aantal argumenten" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "verkeerd aantal waarden om uit te pakken" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "verkeerd operandtype" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "x-waarde buiten bereik" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "" +msgstr "y moet een int zijn" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "y-waarde buiten bereik" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "nul-stap" From 8e06b6f9648abe3157be5abb07dd61e5b6c17450 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 22 May 2020 14:04:23 +0000 Subject: [PATCH 667/919] Translated using Weblate (German) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 268 ++++++++++++++++++++++++++---------------------- 1 file changed, 143 insertions(+), 125 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 2c0988d750..6e92c39853 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-22 07:35+0000\n" +"PO-Revision-Date: 2020-05-23 16:13+0000\n" "Last-Translator: Timon \n" "Language-Team: German \n" @@ -43,7 +43,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Zum Beenden setzen Sie bitte die Karte ohne " +"Zum Beenden, resete bitte das Board ohne " #: py/obj.c msgid " File \"%q\"" @@ -77,7 +77,7 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s" +msgstr "%q Indizes müssen Integer sein, nicht %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -96,7 +96,7 @@ msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%q sollte ein int sein" +msgstr "%q sollte ein integer sein" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -167,7 +167,7 @@ msgstr "Das Objekt '%s' unterstützt '%q' nicht" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "'%s' Objekt unterstützt keine Zuordnung von Elementen" +msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" #: py/obj.c #, c-format @@ -186,7 +186,7 @@ msgstr "'%s' Objekt ist kein Iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "'%s' object ist nicht callable" +msgstr "'%s' object ist nicht aufrufbar" #: py/runtime.c #, c-format @@ -403,7 +403,7 @@ msgstr "Die Helligkeit ist nicht einstellbar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "Puffer + Offset zu klein% d% d% d" +msgstr "Buffer + Offset zu klein %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -413,7 +413,7 @@ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Der Puffer ist kein Byte-Array" +msgstr "Der Buffer ist kein Byte-Array." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -423,7 +423,7 @@ msgstr "Der Puffer ist zu klein" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein." +msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -446,7 +446,7 @@ msgstr "Bus pin %d wird schon benutzt" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "Der Puffer muss 16 Bytes lang sein" +msgstr "Der Puffer muss 16 Bytes lang sein." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -497,13 +497,13 @@ msgstr "Aufnahme in eine Datei nicht möglich" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "Kann '/' nicht remounten when USB aktiv ist" +msgstr "Kann '/' nicht remounten when USB aktiv ist." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden" +msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -779,7 +779,7 @@ msgstr "Verbindung nicht erfolgreich: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Parsen der MP3 Datei fehlgeschlagen" #: ports/nrf/sd_mutex.c #, c-format @@ -803,6 +803,8 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"Die Frequenz muss mit dem vorhandenen PWMOut unter Verwendung dieses Timers " +"übereinstimmen" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -826,7 +828,7 @@ msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" #: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware in benutzung, probiere alternative Pins" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -843,7 +845,7 @@ msgstr "I2C-operation nicht unterstützt" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV muss %d Bytes lang sein" #: py/persistentcode.c msgid "" @@ -867,7 +869,7 @@ msgstr "Unzureichende Authentifizierung" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Unzureichende Verschlüsselung" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" @@ -876,7 +878,7 @@ msgstr "Interner Definitionsfehler" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Interner Fehler #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -893,7 +895,7 @@ msgstr "Ungültige BMP-Datei" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Ungültiger DAC-Pin angegeben" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" @@ -907,7 +909,7 @@ msgstr "Ungültige PWM Frequenz" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Ungültige SPI-Pin-Auswahl" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" @@ -927,7 +929,7 @@ msgstr "Ungültige Puffergröße" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Ungültige Byteorder String" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -939,7 +941,7 @@ msgstr "Ungültige Anzahl von Kanälen" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Ungültige Richtung" +msgstr "Ungültige Richtung." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -955,7 +957,7 @@ msgstr "Ungültige Frequenz geliefert" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Ungültiger Speicherzugriff." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1004,7 +1006,7 @@ msgstr "Ungültige Eigenschaften" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "Ungültiger Ausführungsmodus" +msgstr "Ungültiger Ausführungsmodus." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" @@ -1024,7 +1026,7 @@ msgstr "Ungültige wave Datei" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Ungültige Wort- / Bitlänge" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1052,11 +1054,11 @@ msgstr "Länge darf nicht negativ sein" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "MISO pin Initialisierung fehlgeschlagen" +msgstr "MISO pin Initialisierung fehlgeschlagen." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "MOSI pin Initialisierung fehlgeschlagen" +msgstr "MOSI pin Initialisierung fehlgeschlagen." #: shared-module/displayio/Shape.c #, c-format @@ -1066,6 +1068,7 @@ msgstr "Maximaler x-Wert beim Spiegeln ist %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" +"MicroPython NLR-Sprung fehlgeschlagen. Wahrscheinlich Speicherbeschädigung." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." @@ -1078,7 +1081,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Fehlender MISO- oder MOSI-Pin" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1091,7 +1094,7 @@ msgstr "Muss MISO- oder MOSI-Pin bereitstellen" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d" #: py/parse.c msgid "Name too long" @@ -1099,7 +1102,7 @@ msgstr "Name zu lang" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Negative step not supported" -msgstr "" +msgstr "Negativer Schritt wird nicht unterstützt" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1121,7 +1124,7 @@ msgstr "Kein MISO Pin" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Kein MOSI Pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1166,11 +1169,11 @@ msgstr "Keine Hardwareunterstützung an diesem Pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Es wurde kein Schlüssel angegeben" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "Keine lange Ganzzahlunterstützung" +msgstr "Keine langen Integer (long) unterstützt" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." @@ -1190,7 +1193,7 @@ msgstr "Keine solche Datei/Verzeichnis" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Kein Timer verfügbar" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1255,7 +1258,7 @@ msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus wird noch nicht unterstützt" #: py/moduerrno.c msgid "Permission denied" @@ -1275,7 +1278,7 @@ msgstr "Pin muss Hardware-Interrupts unterstützen" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "PIN-Nummer bereits von EXTI reserviert" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1284,7 +1287,7 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" -"Pinbelegung verwendet% d Bytes pro Element, was mehr als die idealen% d " +"Pinbelegung verwendet %d Bytes pro Element, was mehr als die idealen %d " "Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie " "allow_inefficient = True an den Konstruktor" @@ -1294,7 +1297,7 @@ msgstr "und alle Module im Dateisystem \n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1302,13 +1305,13 @@ msgstr "Pop aus einem leeren Ps2-Puffer" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " -"laden" +"laden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1320,7 +1323,7 @@ msgstr "PulseIn wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1328,7 +1331,7 @@ msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "RNG Init Fehler" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" @@ -1346,7 +1349,7 @@ msgstr "Eine RTC wird auf diesem Board nicht unterstützt" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1370,7 +1373,7 @@ msgstr "Zu früh neu geladen" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Der angeforderte AES-Modus wird nicht unterstützt" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1398,7 +1401,7 @@ msgstr "SPI-Init-Fehler" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI-Neuinitialisierungsfehler" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1415,7 +1418,7 @@ msgstr "Scannen Sie bereits in Bearbeitung. Stoppen Sie mit stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Ausgewählter CTS-Pin ungültig" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" @@ -1437,7 +1440,7 @@ msgstr "Slices werden nicht unterstützt" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Quell- und Zielbuffer müssen gleich lang sein" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1457,7 +1460,7 @@ msgstr "Geben Sie mindestens einen UART-Pin an" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "" @@ -1481,6 +1484,11 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Die Spannungsversorgung des Mikrocontrollers hat den minimal Wert " +"unterschritten.\n" +"Stellen Sie sicher, dass Ihr Netzteil genug Strom bereitstellt für den " +"gesamten Stromkreis und drücken Sie Reset (nach dem Auswerfen von CIRCUITPY)." +"\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1488,7 +1496,7 @@ msgstr "Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" @@ -1497,6 +1505,7 @@ msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" msgstr "" +"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" @@ -1504,7 +1513,7 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Kachel index außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" @@ -1512,7 +1521,7 @@ msgstr "Kachelwert außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format @@ -1521,11 +1530,11 @@ msgstr "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekund #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "Zu viele Kanäle im sample" +msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Zu viele Display Busse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -1547,7 +1556,7 @@ msgstr "Tuple- oder struct_time-Argument erforderlich" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UART Buffer reservierungs Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" @@ -1555,7 +1564,7 @@ msgstr "UART De-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UART Init Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" @@ -1563,7 +1572,7 @@ msgstr "UART Re-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART-Schreibfehler" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1579,7 +1588,7 @@ msgstr "UUID Integer-Wert muss ein Wert von 0 bis 0xffff sein" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "UUID Zeichenfolge ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "UUID string ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" @@ -1623,7 +1632,7 @@ msgstr "Unbekannter Gatt-Fehler: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Unbekannter Grund." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -1633,7 +1642,7 @@ msgstr "Unbekannter Sicherheitsfehler: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Unbekannter Soft Device-Fehler: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format @@ -1668,12 +1677,12 @@ msgstr "Nicht unterstützte Operation" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "Nicht unterstützter Pull-Wert" +msgstr "Nicht unterstützter Pull-Wert." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Wert Länge != Erforderliche feste Länge" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1711,7 +1720,7 @@ msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Schreiben nicht unterstüzt für die Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" @@ -1759,7 +1768,7 @@ msgstr "adresses ist leer" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1784,7 +1793,7 @@ msgstr "Argument sollte '%q' sein, nicht '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "Argumente müssen ndarrays sein" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1804,7 +1813,7 @@ msgstr "Die Achse muss -1, 0, Keine oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0 oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" @@ -1812,7 +1821,7 @@ msgstr "Die Achse muss None, 0 oder 1 sein" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "schlechter Kompilierungsmodus" #: py/objstr.c msgid "bad conversion specifier" @@ -1869,7 +1878,7 @@ msgstr "Buffer müssen gleich lang sein" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "Tasten müssen digitalio.DigitalInOut sein" #: py/vm.c msgid "byte code not implemented" @@ -1877,7 +1886,7 @@ msgstr "Bytecode nicht implementiert" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "Byteorder ist kein String" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1914,6 +1923,8 @@ msgstr "kann nur Bytecode speichern" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"Der bereits untergeordneten Klasse kann keine spezielle Methode hinzugefügt " +"werden" #: py/compile.c msgid "can't assign to expression" @@ -2009,6 +2020,8 @@ msgstr "Ich kann den Wurf nicht an den gerade gestarteten Generator hängen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" +"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " +"gesendet werden" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2037,6 +2050,8 @@ msgstr "" msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"kann nicht von der manuellen Feldspezifikation zur automatischen " +"Feldnummerierung wechseln" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2060,7 +2075,7 @@ msgstr "Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "Umwandlung (cast)" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" @@ -2076,7 +2091,7 @@ msgstr "chr() arg ist nicht in range(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "Kreis kann nur in einem Elternteil registriert werden" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2121,7 +2136,7 @@ msgstr "Umwandlung zu Objekt" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "Convolve-Argumente müssen lineare Arrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" @@ -2129,7 +2144,7 @@ msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "Convolve Argumente dürfen nicht leer sein" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" @@ -2137,7 +2152,7 @@ msgstr "Eingabearray konnte nicht aus der Form übertragen werden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "Vandermonde-Matrix konnte nicht invertiert werden" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2155,6 +2170,8 @@ msgstr "Die Standart-Ausnahmebehandlung muss als letztes sein" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " +"8 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -2166,7 +2183,7 @@ msgstr "destination_length muss ein int >= 0 sein" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" @@ -2195,7 +2212,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" @@ -2244,7 +2261,7 @@ msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expression Teil kann kein '#' beinhalten" #: py/parse.c msgid "f-string expression part cannot include a backslash" @@ -2252,7 +2269,7 @@ msgstr "Die f-String expression darf keinen Backslash enthalten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: leere expression nicht erlaubt" #: py/parse.c msgid "f-string: expecting '}'" @@ -2260,7 +2277,7 @@ msgstr "f-string: erwartet '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: einzelne '}' nicht erlaubt" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2277,7 +2294,7 @@ msgstr "Das erste Argument muss iterierbar sein" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "Das erste Argument muss ein Ndarray sein" #: py/objtype.c msgid "first argument to super() must be type" @@ -2293,7 +2310,7 @@ msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "Das Flip-Argument muss ein Ndarray sein" #: py/objint.c msgid "float too big" @@ -2326,7 +2343,7 @@ msgstr "Funktion hat mehrere Werte für Argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" #: py/argcheck.c #, c-format @@ -2405,11 +2422,11 @@ msgstr "index außerhalb der Reichweite" #: py/obj.c msgid "indices must be integers" -msgstr "Indizes müssen ganze Zahlen sein" +msgstr "Indizes müssen Integer sein" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" #: py/compile.c msgid "inline assembler must be a function" @@ -2421,7 +2438,7 @@ msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" @@ -2429,7 +2446,7 @@ msgstr "Eingabedaten müssen iterierbar sein" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "Eingabematrix ist asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" @@ -2437,7 +2454,7 @@ msgstr "Eingabematrix ist singulär" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "Die Eingabe muss eine quadratische Matrix sein" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" @@ -2445,7 +2462,7 @@ msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "Eingabevektoren müssen gleich lang sein" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2531,7 +2548,7 @@ msgstr "iterables sind nicht gleich lang" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "Iterationen sind nicht konvergiert (converged)" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2581,7 +2598,7 @@ msgstr "Lokales '%q' verwendet bevor Typ bekannt" msgid "local variable referenced before assignment" msgstr "" "Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. " -"Variablen immer zuerst Zuweisen!" +"Variablen immer zuerst Zuweisen" #: py/objint.c msgid "long int not supported in this build" @@ -2589,7 +2606,7 @@ msgstr "long int wird in diesem Build nicht unterstützt" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "fehlformatierter f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2601,7 +2618,7 @@ msgstr "Mathe-Domain-Fehler" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "Matrix Dimensionen stimmen nicht überein" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" @@ -2632,7 +2649,7 @@ msgstr "Modul nicht gefunden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "mehr Freiheitsgrade als Datenpunkte" #: py/compile.c msgid "multiple *x in assignment" @@ -2648,7 +2665,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "muss ein Objekt verursachen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" @@ -2676,7 +2693,7 @@ msgstr "Name für Argumente wiederverwendet" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "native Ausbeute (yield)" #: py/runtime.c #, c-format @@ -2685,7 +2702,7 @@ msgstr "Zum Entpacken sind mehr als %d Werte erforderlich" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" @@ -2693,7 +2710,7 @@ msgstr "Negative shift Anzahl" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "Keine aktive Ausnahme zu verusachen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" @@ -2718,7 +2735,7 @@ msgstr "kein solches Attribut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "non-UUID gefunden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" @@ -2734,7 +2751,7 @@ msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -2747,7 +2764,7 @@ msgstr "" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "Nicht genügend Argumente für den Formatierungs-String" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" @@ -2755,7 +2772,7 @@ msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" #: py/obj.c #, c-format @@ -2823,6 +2840,7 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" +"Es werden nur Slices mit Schritt = 1 (auch bekannt als None) unterstützt" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c @@ -2831,7 +2849,7 @@ msgstr "Operanden konnten nicht zusammen gesendet werden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "Die Operation ist für ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" @@ -2845,7 +2863,7 @@ msgstr "ord erwartet ein Zeichen" #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" -"ord() erwartet ein Zeichen aber es wurde eine Zeichenfolge mit Länge %d " +"ord() erwartet einen Buchstaben(char) aber es wurde ein String mit Länge %d " "gefunden" #: py/objint_mpz.c @@ -2854,7 +2872,7 @@ msgstr "Überlauf beim konvertieren von long int zu machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "Die Palette muss 32 Byte lang sein" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" @@ -2878,7 +2896,7 @@ msgstr "Pixelkoordinaten außerhalb der Grenzen" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "Der Pixelwert erfordert zu viele Bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" @@ -2913,7 +2931,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow () mit 3 Argumenten erfordert Integer" #: extmod/modutimeq.c msgid "queue overflow" @@ -2925,7 +2943,7 @@ msgstr "rohe F-Strings sind nicht implementiert" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "Real- und Imaginärteile müssen gleich lang sein" #: py/builtinimport.c msgid "relative import" @@ -2947,7 +2965,7 @@ msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -2956,7 +2974,7 @@ msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "Die rechte Seite muss ein Ndarray oder ein Skalar sein" #: py/objstr.c msgid "rsplit(None,n)" @@ -2988,7 +3006,7 @@ msgstr "Form muss ein 2-Tupel sein" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" @@ -2996,7 +3014,7 @@ msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "einzelne '}' in Formatierungs-String gefunden" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" @@ -3004,7 +3022,7 @@ msgstr "Größe ist nur für ndarrays definiert" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "Die Schlafdauer darf nicht negativ sein" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3020,7 +3038,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sortierungs Argument muss ein ndarray sein" #: py/objstr.c msgid "start/end indices" @@ -3053,7 +3071,7 @@ msgstr "String index außerhalb des Bereiches" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "String indizes müssen Ganzzahlen sein, nicht %s" +msgstr "String indizes müssen Integer sein, nicht %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3094,7 +3112,7 @@ msgstr "threshold muss im Intervall 0-65536 liegen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() nimmt eine 9-Sequenz an" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3106,7 +3124,7 @@ msgstr "timeout muss >= 0.0 sein" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" @@ -3114,7 +3132,7 @@ msgstr "zu viele Argumente mit dem angegebenen Format" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "zu viele Indizes" #: py/runtime.c #, c-format @@ -3123,7 +3141,7 @@ msgstr "zu viele Werte zum Auspacken (erwartet %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "Tupelindex außerhalb des Bereichs" #: py/obj.c msgid "tuple/list has wrong length" @@ -3149,7 +3167,7 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -3157,7 +3175,7 @@ msgstr "Typ akzeptiert 1 oder 3 Argumente" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong zu groß" #: py/emitnative.c msgid "unary op %q not implemented" @@ -3167,7 +3185,7 @@ msgstr "Der unäre Operator %q ist nicht implementiert" msgid "unexpected indent" msgstr "" "unerwarteter Einzug (Einrückung) Bitte Leerzeichen am Zeilenanfang " -"kontrollieren!" +"kontrollieren" #: py/bc.c msgid "unexpected keyword argument" @@ -3185,12 +3203,12 @@ msgstr "Unicode Name ausgebrochen (escaped)" msgid "unindent does not match any outer indentation level" msgstr "" "Einrückung entspricht keiner äußeren Einrückungsebene. Bitte Leerzeichen am " -"Zeilenanfang kontrollieren!" +"Zeilenanfang kontrollieren" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c #, c-format @@ -3207,7 +3225,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' ohne passende Zuordnung im Format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -3231,7 +3249,7 @@ msgstr "nicht unterstützte Xtensa-Anweisung '%s' mit %d Argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" @@ -3260,7 +3278,7 @@ msgstr "Fenster muss <= Intervall sein" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "falscher Argumenttyp" #: extmod/ulab/code/ndarray.c msgid "wrong index type" @@ -3276,7 +3294,7 @@ msgstr "falsche Anzahl zu entpackender Werte" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "falscher Operandentyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From e62880a5943b9e2110c3133f2aa7c0067e92bbab Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Sat, 23 May 2020 12:25:05 +0000 Subject: [PATCH 668/919] Translated using Weblate (Dutch) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 50f7c60954..aa822138fb 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-23 12:25+0000\n" +"PO-Revision-Date: 2020-05-23 16:13+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -143,7 +143,7 @@ msgstr "'%s' verwacht op zijn meest r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "'%s' verwacht {r0, r1, ...}" +msgstr "'%s' verwacht {r0, r1, …}" #: py/emitinlinextensa.c #, c-format @@ -1836,9 +1836,8 @@ msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" -msgstr "branch niet binnen bereik" +msgstr "pad (branch) niet binnen bereik" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" From 7d26240444d7f7cb04535190a913f5aad1589dfe Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 23 May 2020 18:13:27 +0200 Subject: [PATCH 669/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/de_DE.po | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 6e92c39853..9c3af7cdb9 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -1487,12 +1487,13 @@ msgstr "" "Die Spannungsversorgung des Mikrocontrollers hat den minimal Wert " "unterschritten.\n" "Stellen Sie sicher, dass Ihr Netzteil genug Strom bereitstellt für den " -"gesamten Stromkreis und drücken Sie Reset (nach dem Auswerfen von CIRCUITPY)." -"\n" +"gesamten Stromkreis und drücken Sie Reset (nach dem Auswerfen von " +"CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein" +msgstr "" +"Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" @@ -1526,7 +1527,8 @@ msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" +msgstr "" +"Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1725,8 +1727,8 @@ msgstr "Schreiben nicht unterstüzt für die Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Sie befinden sich im abgesicherten Modus: Es ist etwas Unerwartetes passiert." -"\n" +"Sie befinden sich im abgesicherten Modus: Es ist etwas Unerwartetes " +"passiert.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2071,7 +2073,8 @@ msgstr "kann keinen relativen Import durchführen" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" +msgstr "" +"Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" #: py/emitnative.c msgid "casting" @@ -2099,7 +2102,8 @@ msgstr "Farbpuffer muss 3 Bytes (RGB) oder 4 Bytes (RGB + pad byte) sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "Der Farbpuffer muss ein Puffer, ein Tupel, eine Liste oder ein Int sein" +msgstr "" +"Der Farbpuffer muss ein Puffer, ein Tupel, eine Liste oder ein Int sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" From ef4292c1b8ed118e1e82c3ac6fc1d1477b371ed9 Mon Sep 17 00:00:00 2001 From: dronecz Date: Sat, 23 May 2020 22:24:58 +0000 Subject: [PATCH 670/919] Translated using Weblate (Czech) Currently translated at 2.0% (15 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/cs/ --- locale/cs.po | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index 0537ca14bd..825b31509a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-05-24 03:22+0000\n" +"Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Kód byl dokončen. Čekám na opětovné načtení.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,65 +32,70 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Založte prosím problém s obsahem vaší jednotky CIRCUITPY na adrese\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Pro ukončení, prosím resetujte desku bez " #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr "  Soubor \"% q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr "  Soubor \"% q\", řádek% d" #: main.c msgid " output:\n" -msgstr "" +msgstr " výstup:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%% c vyžaduje int nebo char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d adresní piny a %d rgb piny označují výšku %d, nikoli %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q se nyní používá" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Indexy% q musí být celá čísla, nikoli% s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "Seznam% q musí být seznam" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "% q musí být > = 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "% q musí být n-tice délky 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "% q by měl být int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" From fa377fdcba32ed0876b91f407238ef9b59c80ed8 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Sun, 24 May 2020 19:20:26 +0000 Subject: [PATCH 671/919] Translated using Weblate (Dutch) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index aa822138fb..5cc0066f31 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" -"PO-Revision-Date: 2020-05-23 16:13+0000\n" +"PO-Revision-Date: 2020-05-25 13:52+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Om te verlatten, herstart de module zonder " +"Om te verlaten, herstart de module zonder " #: py/obj.c msgid " File \"%q\"" From ece892299ad897513db427542243b407f95d55be Mon Sep 17 00:00:00 2001 From: Dustin Watts Date: Sun, 24 May 2020 19:20:43 +0000 Subject: [PATCH 672/919] Translated using Weblate (Dutch) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 5cc0066f31..c0f3ddf378 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-19 15:01+0800\n" "PO-Revision-Date: 2020-05-25 13:52+0000\n" -"Last-Translator: _fonzlate \n" +"Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -54,7 +54,7 @@ msgstr " Bestand \"%q\", regel %d" #: main.c msgid " output:\n" -msgstr " output\n" +msgstr " uitvoer:\n" #: py/objstr.c #, c-format From 32de8b437ccdadf0b18990d0f3f9fbf624475f46 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 May 2020 09:37:35 -0500 Subject: [PATCH 673/919] shared_bindings_matrix: Work from parsed 'make' output Revisiting this because I noticed the support matrix said that pyruler had several modules it obviously didn't, such as the recently added vectorio. It is less error-prone because we can use the final values instead of re-coding the Makefile logic in python. The only things we need to do are invoke make in "print-database" mode, then chase any indirect references like CIRCUITPY_VECTORIO = $(CIRCUITPY_DISPLAYIO) It does take longer, about 45s on my laptop. --- docs/shared_bindings_matrix.py | 220 +++++++-------------------------- 1 file changed, 47 insertions(+), 173 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index aa5ef02e28..e48c718130 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -24,50 +24,12 @@ import json import os import re +import subprocess +import sys SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"] - -def parse_port_config(contents, chip_keyword=None): - """ Compile a dictionary of port-wide module configs, which may - be categorized by chipset. - """ - chip_fam = "all" - ifeq_found = False - port_config_results = {"all": []} - - chip_pattern = "" - if chip_keyword: - chip_pattern = ( - re.compile("(?<=ifeq\s\(\$\({}\)\,)(\w+)".format(chip_keyword)) - ) - - for line in contents: - if chip_keyword: - if not ifeq_found: - check_ifeq = chip_pattern.search(line) - if check_ifeq: - ifeq_found = True - chip_fam = check_ifeq.group(1) - #print("found chip:", chip_fam) - else: - ifeq_found = False - chip_fam = "all" - else: - if "endif" in line: - ifeq_found = False - chip_fam = "all" - - if "CIRCUITPY_" in line: - if chip_fam in port_config_results: - port_config_results[chip_fam].append(line.rstrip("\n")) - else: - port_config_results[chip_fam] = [line.rstrip("\n")] - - #print(port_config_results) - return port_config_results - def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names """ @@ -117,149 +79,64 @@ def build_module_map(): "excluded": {} } - #print(base) return base +def get_settings_from_makefile(port_dir, board_name): + """ Invoke make in a mode which prints the database, then parse it for + settings. -def get_excluded_boards(base): - """ Cycles through each board's `mpconfigboard.mk` file to determine - if each module is included or not. Boards are selected by existence - in a port listed in `SUPPORTED_PORTS` (e.g. `/port/nrf/feather_52840`) - - Boards are further categorized by their respective chipset (SAMD21, - SAMD51, nRF52840, etc.) + This means that the effect of all Makefile directives is taken + into account, without having to re-encode the logic that sets them + in this script, something that has proved error-prone """ - modules = list(base.keys()) - re_board_chip = None - chip_keyword = None - for port in SUPPORTED_PORTS: - # each port appears to use its own define for the chipset - if port in ["atmel-samd"]: - re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)") - chip_keyword = "CHIP_FAMILY" - elif port in ["nrf"]: - re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)") - elif port in ["stm"]: - re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)") - chip_keyword = "MCU_SERIES" + status, contents = subprocess.getstatusoutput(f"make -C {port_dir} BOARD={board_name} -qp") + # Make signals errors with exit status 2; 0 and 1 are "non-error" statuses + if status not in (0, 1): + raise RuntimeError(f'Invoking make exited with {status}') + if isinstance(contents, bytes): + contents = contents.decode('utf-8', errors='replace') + settings = {} + for line in contents.split('\n'): + m = re.match(r'^([A-Z][A-Z0-9_]*) = (.*)$', line) + if m: + settings[m.group(1)] = m.group(2) + return settings - port_dir = "ports/{}".format(port) - - port_config_contents = "" - with open(os.path.join(port_dir, "mpconfigport.mk")) as port_config: - port_config_contents = port_config.readlines() - port_config = parse_port_config(port_config_contents, chip_keyword) - - for entry in os.scandir(os.path.join(port_dir, "boards")): - if not entry.is_dir(): - continue - - contents = "" - board_dir = os.path.join(entry.path, "mpconfigboard.mk") - with open(board_dir) as board: - contents = board.read() - - board_chip = re_board_chip.search(contents) - if not board_chip: - board_chip = "Unknown Chip" - else: - #print(entry.name, board_chip.group(1)) - board_chip = board_chip.group(1) - - # add port_config results to contents - contents += "\n" + "\n".join(port_config["all"]) - if board_chip in port_config: - contents += "\n" + "\n".join(port_config[board_chip]) - - check_dependent_modules = dict() - for module in modules: - board_is_excluded = False - # check if board turns off `FULL_BUILD`. if yes, and current - # module is marked as `FULL_BUILD`, board is excluded - small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents) - if small_build and base[module]["full_build"] == "1": - board_is_excluded = True - - # check if module is specifically disabled for this board - re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper()) - find_module = re.search(re_pattern, contents) - if not find_module: - if base[module]["default_value"].isdigit(): - # check if default inclusion is off ('0'). if the board doesn't - # have it explicitly enabled, its excluded. - if base[module]["default_value"] == "0": - board_is_excluded = True - else: - # this module is dependent on another module. add it - # to the list to check after processing all other modules. - # only need to check exclusion if it isn't already excluded. - if (not board_is_excluded and - base[module]["default_value"] not in [ - "None", - "CIRCUITPY_DEFAULT_BUILD" - ]): - check_dependent_modules[module] = base[module]["default_value"] - else: - board_is_excluded = find_module.group(1) == "0" - - if board_is_excluded: - if board_chip in base[module]["excluded"]: - base[module]["excluded"][board_chip].append(entry.name) - else: - base[module]["excluded"][board_chip] = [entry.name] - - for module in check_dependent_modules: - depend_results = set() - - parents = check_dependent_modules[module].split("CIRCUITPY_") - parents = [item.strip(", ").lower() for item in parents if item] - - for parent in parents: - if parent in base: - if (board_chip in base[parent]["excluded"] and - entry.name in base[parent]["excluded"][board_chip]): - depend_results.add(False) - else: - depend_results.add(True) - - # only exclude the module if there were zero parents enabled - # as determined by the 'depend_results' set. - if not any(depend_results): - if board_chip in base[module]["excluded"]: - base[module]["excluded"][board_chip].append(entry.name) - else: - base[module]["excluded"][board_chip] = [entry.name] - - #print(json.dumps(base, indent=2)) - return base - - -def support_matrix_excluded_boards(): - """ Compiles a list of available modules, and which board definitions - do not include them. - """ - base = build_module_map() - - return get_excluded_boards(base) +def lookup_setting(settings, key, default=''): + while True: + value = settings.get(key, default) + if not value.startswith('$'): + break + key = value[2:-1] + return value def support_matrix_by_board(): """ Compiles a list of the available core modules available for each board. """ base = build_module_map() - base_with_exclusions = get_excluded_boards(base) boards = dict() for port in SUPPORTED_PORTS: + # each port appears to use its own define for the chipset + if port in ["atmel-samd"]: + chip_keyword = "CHIP_FAMILY" + elif port in ["nrf"]: + chip_keyword = "MCU_VARIANT" + elif port in ["stm"]: + chip_keyword = "MCU_SERIES" + port_dir = "ports/{}/boards".format(port) for entry in os.scandir(port_dir): if not entry.is_dir(): continue board_modules = [] - board_name = entry.name - board_contents = "" + settings = get_settings_from_makefile(f'ports/{port}', entry.name) + + board_chip = lookup_setting(settings, chip_keyword, 'Unknown Chip') + with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: board_contents = get_name.read() board_name_re = re.search("(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", @@ -267,18 +144,15 @@ def support_matrix_by_board(): if board_name_re: board_name = board_name_re.group(1).strip('"') - for module in base_with_exclusions.keys(): - #print(module) - board_has_module = True - if base_with_exclusions[module]["excluded"]: - for port in base_with_exclusions[module]["excluded"].values(): - #print(port) - if entry.name in port: - board_has_module = False - - if board_has_module: - board_modules.append(base_with_exclusions[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) #print(json.dumps(boards, indent=2)) return boards + +if __name__ == '__main__': + print(json.dumps(support_matrix_by_board(), indent=2)) From 894bb3c003a5f34adc54c4ce7d8a1d95e41c87c5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 May 2020 09:58:57 -0500 Subject: [PATCH 674/919] Add esp32s2, litex to SUPPORTED_PORTS, sort it --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index e48c718130..10423d87d0 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -28,7 +28,7 @@ import subprocess import sys -SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"] +SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names From 76149ebf570a108f4b09c3624129fd1b2c7e26ad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 May 2020 09:59:13 -0500 Subject: [PATCH 675/919] Remove board_chip logic Not sure why I moved it, the computed value is never required --- docs/shared_bindings_matrix.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 10423d87d0..7768296a15 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -119,13 +119,6 @@ def support_matrix_by_board(): boards = dict() for port in SUPPORTED_PORTS: - # each port appears to use its own define for the chipset - if port in ["atmel-samd"]: - chip_keyword = "CHIP_FAMILY" - elif port in ["nrf"]: - chip_keyword = "MCU_VARIANT" - elif port in ["stm"]: - chip_keyword = "MCU_SERIES" port_dir = "ports/{}/boards".format(port) for entry in os.scandir(port_dir): @@ -135,8 +128,6 @@ def support_matrix_by_board(): settings = get_settings_from_makefile(f'ports/{port}', entry.name) - board_chip = lookup_setting(settings, chip_keyword, 'Unknown Chip') - with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: board_contents = get_name.read() board_name_re = re.search("(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", From 8f81beea7e83b33664d5ab6fc5e210723b10bb04 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 May 2020 13:46:30 -0500 Subject: [PATCH 676/919] shared_bindings_matrix: Use a trivial target Sommersoft noticed that without submodules (as RTD currently does), the "make -qp" failed due to trying to find files within submodules. The "print-VAR" target doesn't have any dependencies, so it sidesteps the problem. If we move ulab's pyi files into the submodule, though, we'll need to fetch submodules anyway during doc building. --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 7768296a15..0c838fedb4 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -90,7 +90,7 @@ def get_settings_from_makefile(port_dir, board_name): in this script, something that has proved error-prone """ - status, contents = subprocess.getstatusoutput(f"make -C {port_dir} BOARD={board_name} -qp") + status, contents = subprocess.getstatusoutput(f"make -C {port_dir} BOARD={board_name} -qp print-CC") # Make signals errors with exit status 2; 0 and 1 are "non-error" statuses if status not in (0, 1): raise RuntimeError(f'Invoking make exited with {status}') From 4974c933b106db4b7f05f3f4a8f89504e7f4d3ac Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 26 May 2020 03:29:05 +0200 Subject: [PATCH 677/919] Fix swapped SCK and MISO in Fluff M0 --- ports/atmel-samd/boards/fluff_m0/pins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index 16802e0920..d80d46b895 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -11,9 +11,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, From 8371eb27bd2b57b37d944be98b4fced7a9c78447 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 26 May 2020 03:32:12 +0200 Subject: [PATCH 678/919] Add Fluff M0 to boards --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..059d9b7988 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,6 +177,7 @@ jobs: - "feather_nrf52840_express" - "feather_radiofruit_zigbee" - "feather_stm32f405_express" + - "fluff_m0" - "gemma_m0" - "grandcentral_m4_express" - "hallowing_m0_express" From 9966bf86da6abcc6a43b3415737dcf0284f9e998 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 26 May 2020 09:55:23 -0500 Subject: [PATCH 679/919] shared_bindings_matrix: sommersoft's suggestions --- docs/shared_bindings_matrix.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 0c838fedb4..02ef683492 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -89,18 +89,27 @@ def get_settings_from_makefile(port_dir, board_name): into account, without having to re-encode the logic that sets them in this script, something that has proved error-prone """ - - status, contents = subprocess.getstatusoutput(f"make -C {port_dir} BOARD={board_name} -qp print-CC") + contents = subprocess.run( + ["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"], + encoding="utf-8", + errors="replace", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) # Make signals errors with exit status 2; 0 and 1 are "non-error" statuses - if status not in (0, 1): - raise RuntimeError(f'Invoking make exited with {status}') - if isinstance(contents, bytes): - contents = contents.decode('utf-8', errors='replace') + if contents.returncode not in (0, 1): + error_msg = ( + f"Invoking '{' '.join(contents.args)}' exited with " + f"{contents.returncode}: {contents.stderr}" + ) + raise RuntimeError(error_msg) + settings = {} - for line in contents.split('\n'): + for line in contents.stdout.split('\n'): m = re.match(r'^([A-Z][A-Z0-9_]*) = (.*)$', line) if m: settings[m.group(1)] = m.group(2) + return settings def lookup_setting(settings, key, default=''): From d6c59c4de017dd0ee2ac7a185c4e21ed164e7416 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Tue, 26 May 2020 22:36:30 +0200 Subject: [PATCH 680/919] mimxrt10xx: Change exception type to match other ports --- ports/mimxrt10xx/common-hal/busio/I2C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 0bb7dcc6c6..cad0fef982 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -81,7 +81,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } if(self->sda_pin == NULL || self->scl_pin == NULL) { - mp_raise_RuntimeError(translate("Invalid I2C pin selection")); + mp_raise_ValueError(translate("Invalid I2C pin selection")); } else { self->i2c = mcu_i2c_banks[self->sda_pin->bank_idx - 1]; } From d8608e52290a5d2650f91290b20e2b438ee9bfa2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 May 2020 20:17:37 +0000 Subject: [PATCH 681/919] Translated using Weblate (French) Currently translated at 100.0% (747 of 747 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 3ae342a0b4..59f6f049e9 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" -"PO-Revision-Date: 2020-05-17 20:56+0000\n" -"Last-Translator: Anonymous \n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-26 19:37+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1303,7 +1303,7 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygone a besoin d’au moins 3 points" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1529,7 +1529,7 @@ msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Le délai est trop long : le délai maximal est de %d secondes" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." From 51edfb992a7cde3e95683046ab66e56af203d1b1 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 27 May 2020 01:18:54 +0200 Subject: [PATCH 682/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 59f6f049e9..9cd5a7cb64 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-26 13:09-0700\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French Date: Wed, 20 May 2020 20:06:36 +0800 Subject: [PATCH 683/919] nrf: ld: add ARM.exidx to output image With the WDT changes, building Circuit Python results in the following error: /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx LMA [00000000000621c8,00000000000621cf] overlaps section .data LMA [00000000000621c8,0000000000062383] This is because unwinding data is getting generated, but has nowhere to go. Re-enable this data in the linker script so it is saved. Signed-off-by: Sean Cross --- ports/nrf/boards/common.template.ld | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 9a7df69a47..334a3506e1 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -70,7 +70,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ } >FLASH_FIRMWARE - /* .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) @@ -82,7 +81,6 @@ SECTIONS *(.ARM.exidx*) __exidx_end = .; } >FLASH_FIRMWARE - */ /* used by the startup to initialize data */ _sidata = .; From f4719609f7af49697e4b7e0292fc520e39b26daf Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:08:07 +0800 Subject: [PATCH 684/919] wdt: add watchdog support This adds shared bindings for a watchdog timer, based on the API provided by micropython. Signed-off-by: Sean Cross --- py/circuitpy_defns.mk | 7 +- py/circuitpy_mpconfig.h | 8 +++ py/circuitpy_mpconfig.mk | 4 ++ shared-bindings/wdt/WDT.c | 128 +++++++++++++++++++++++++++++++++ shared-bindings/wdt/WDT.h | 47 ++++++++++++ shared-bindings/wdt/__init__.c | 62 ++++++++++++++++ shared-bindings/wdt/__init__.h | 34 +++++++++ 7 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 shared-bindings/wdt/WDT.c create mode 100644 shared-bindings/wdt/WDT.h create mode 100644 shared-bindings/wdt/__init__.c create mode 100644 shared-bindings/wdt/__init__.h diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 9e36f2e6a2..be04dba487 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -241,6 +241,9 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif +ifeq ($(CIRCUITPY_WDT),1) +SRC_PATTERNS += wdt/% +endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% endif @@ -301,7 +304,9 @@ SRC_COMMON_HAL_ALL = \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ - supervisor/__init__.c + supervisor/__init__.c \ + wdt/__init__.c \ + wdt/WDT.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 5f2605c92f..50f1139d7a 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -630,6 +630,13 @@ extern const struct _mp_obj_module_t ustack_module; #define RE_MODULE #endif +#if CIRCUITPY_WDT +extern const struct _mp_obj_module_t wdt_module; +#define WDT_MODULE { MP_ROM_QSTR(MP_QSTR_wdt), MP_ROM_PTR(&wdt_module) }, +#else +#define WDT_MODULE +#endif + // Define certain native modules with weak links so they can be replaced with Python // implementations. This list may grow over time. #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ @@ -700,6 +707,7 @@ extern const struct _mp_obj_module_t ustack_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ + WDT_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 0801540bc0..1b74f45c36 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -228,6 +228,10 @@ CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) +# watchdog hardware support +CIRCUITPY_WDT ?= 0 +CFLAGS += -DCIRCUITPY_WDT=$(CIRCUITPY_WDT) + # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) diff --git a/shared-bindings/wdt/WDT.c b/shared-bindings/wdt/WDT.c new file mode 100644 index 0000000000..edfac897ec --- /dev/null +++ b/shared-bindings/wdt/WDT.c @@ -0,0 +1,128 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * 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 + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/wdt/__init__.h" +#include "shared-bindings/wdt/WDT.h" + +static wdt_wdt_obj_t *wdt_singleton; + +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout_ms, ARG_sleep }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + if (wdt_singleton) + return wdt_singleton; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + if (args[ARG_timeout_ms].u_int <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + wdt_wdt_obj_t *self = m_new_obj(wdt_wdt_obj_t); + self->base.type = &wdt_wdt_type; + self->timeout = args[ARG_timeout_ms].u_int; + self->sleep = args[ARG_sleep].u_bool; + + common_hal_wdt_init(self->timeout, self->sleep); + wdt_singleton = self; + return MP_OBJ_FROM_PTR(self); +} + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the system will reset.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_feed(mp_obj_t self_in) { + (void)self_in; + common_hal_wdt_feed(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_feed_obj, wdt_wdt_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t wdt_wdt_deinit(mp_obj_t self_in) { + (void)self_in; + common_hal_wdt_disable(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_deinit_obj, wdt_wdt_deinit); + +//| timeout: int = ... +//| """The maximum number of milliseconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t wdt_wdt_obj_get_timeout(mp_obj_t self_in) { + wdt_wdt_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(self->timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_obj_get_timeout_obj, wdt_wdt_obj_get_timeout); + +const mp_obj_property_t wdt_wdt_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&wdt_wdt_obj_get_timeout_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t wdt_wdt_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&wdt_wdt_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&wdt_wdt_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&wdt_wdt_timeout_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(wdt_wdt_locals_dict, wdt_wdt_locals_dict_table); + +const mp_obj_type_t wdt_wdt_type = { + { &mp_type_type }, + .name = MP_QSTR_WDT, + .make_new = wdt_wdt_make_new, + .locals_dict = (mp_obj_dict_t*)&wdt_wdt_locals_dict, +}; diff --git a/shared-bindings/wdt/WDT.h b/shared-bindings/wdt/WDT.h new file mode 100644 index 0000000000..bfd83d482c --- /dev/null +++ b/shared-bindings/wdt/WDT.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H + +#include +#include + +extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); +extern void common_hal_wdt_feed(void); +extern void common_hal_wdt_disable(void); + +extern const mp_obj_type_t wdt_wdt_type; + +typedef struct _wdt_wdt_obj_t { + mp_obj_base_t base; + uint32_t timeout; + bool sleep; +} wdt_wdt_obj_t; + +extern const wdt_wdt_obj_t wdt_wdt_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H diff --git a/shared-bindings/wdt/__init__.c b/shared-bindings/wdt/__init__.c new file mode 100644 index 0000000000..a95fa2c539 --- /dev/null +++ b/shared-bindings/wdt/__init__.c @@ -0,0 +1,62 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * 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 + +#include "py/runtime.h" +#include "shared-bindings/wdt/__init__.h" +#include "shared-bindings/wdt/WDT.h" + +//| """Watchdog Timer +//| +//| The `wdt` module provides support for a Watchdog Timer. This timer will reset the device +//| if it hasn't been fed after a specified amount of time. This is useful to ensure the board +//| has not crashed or locked up. You can enable thw watchdog timer using :class:`wdt.WDT`. +//| Note that the watchdog timer cannot be disabled once it has been enabled. +//| +//| The WDT is used to restart the system when the application crashes and ends +//| up into a non recoverable state. Once started it cannot be stopped or +//| reconfigured in any way. After enabling, the application must "feed" the +//| watchdog periodically to prevent it from expiring and resetting the system. +//| +//| Example usage:: +//| +//| from machine import WDT +//| wdt = WDT(timeout=2000) # enable it with a timeout of 2s +//| wdt.feed()""" +//| + +STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, + { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); + +const mp_obj_module_t wdt_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&wdt_module_globals, +}; diff --git a/shared-bindings/wdt/__init__.h b/shared-bindings/wdt/__init__.h new file mode 100644 index 0000000000..b27452ca5d --- /dev/null +++ b/shared-bindings/wdt/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H + +#include +#include + + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H From abd01c5fbb3005fd30e41407c8f8b9d0dad5ef55 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:09:28 +0800 Subject: [PATCH 685/919] nrf: add watchdog module Add common-hal bindings to allow the watchdog module to be used on nrf platforms. Signed-off-by: Sean Cross --- ports/nrf/common-hal/wdt/WDT.c | 40 +++++++++++++++++++++++++++++ ports/nrf/common-hal/wdt/__init__.c | 0 2 files changed, 40 insertions(+) create mode 100644 ports/nrf/common-hal/wdt/WDT.c create mode 100644 ports/nrf/common-hal/wdt/__init__.c diff --git a/ports/nrf/common-hal/wdt/WDT.c b/ports/nrf/common-hal/wdt/WDT.c new file mode 100644 index 0000000000..172bd33463 --- /dev/null +++ b/ports/nrf/common-hal/wdt/WDT.c @@ -0,0 +1,40 @@ +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/rtc/__init__.h" +#include "nrf_wdt.h" + +#define WDT_RELOAD_COUNT 2 + +void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep) { + unsigned int channel; + nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; + if (pause_during_sleep) { + behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; + } + + nrf_wdt_behaviour_set(NRF_WDT, behaviour); + + uint64_t ticks = (duration * 32768ULL) / 1000; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); + + for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_enable(NRF_WDT, channel); + } + + nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); +} + +void common_hal_wdt_feed(void) { + unsigned int channel; + for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); + } +} + +void common_hal_wdt_disable(void) { + // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +} diff --git a/ports/nrf/common-hal/wdt/__init__.c b/ports/nrf/common-hal/wdt/__init__.c new file mode 100644 index 0000000000..e69de29bb2 From fbe1c05832b2924efee9bd650e5c0c118b5846c8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 20:10:11 +0800 Subject: [PATCH 686/919] nrf: simmel: enable wdt support This enables WDT support for Simmel. Other platforms cannot yet use WDT because it overflows their flash storage. Enable CIRCUITPY_WDT support for the nrf target. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 36a6fadda2..64ccccc2bf 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -24,6 +24,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_WDT = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 From c23f151b6b64011a97752b85e97d1d06b70b73d4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 20 May 2020 23:05:05 +0800 Subject: [PATCH 687/919] nrf: enable wdt for all platforms Signed-off-by: Sean Cross --- ports/nrf/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index a9ad11bd44..018a955f5b 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -37,6 +37,7 @@ CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_WDT ?= 1 # nRF52840-specific From 595f6387c2a4f1c919cfab80b07493820ac0051b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 13:47:23 +0800 Subject: [PATCH 688/919] watchdog: rename module from `wdt` and move to `microcontroller` This also places it under the `microcontroller` object. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.mk | 2 +- .../nrf/common-hal/microcontroller/__init__.c | 11 +- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 197 ++++++++++++++++++ .../nrf/common-hal/watchdog/WatchDogTimer.h | 22 +- ports/nrf/common-hal/watchdog/__init__.c | 42 ++++ ports/nrf/common-hal/watchdog/__init__.h | 38 ++++ ports/nrf/common-hal/wdt/WDT.c | 40 ---- ports/nrf/mpconfigport.mk | 2 +- py/circuitpy_defns.mk | 8 +- py/circuitpy_mpconfig.h | 9 +- py/circuitpy_mpconfig.mk | 4 +- shared-bindings/microcontroller/__init__.c | 5 + shared-bindings/microcontroller/__init__.h | 5 +- .../watchdog/WatchDogTimer.c | 0 shared-bindings/watchdog/WatchDogTimer.h | 45 ++++ shared-bindings/{wdt => watchdog}/__init__.c | 38 ++-- shared-bindings/{wdt => watchdog}/__init__.h | 10 +- shared-bindings/wdt/WDT.c | 128 ------------ 18 files changed, 384 insertions(+), 222 deletions(-) create mode 100644 ports/nrf/common-hal/watchdog/WatchDogTimer.c rename shared-bindings/wdt/WDT.h => ports/nrf/common-hal/watchdog/WatchDogTimer.h (72%) create mode 100644 ports/nrf/common-hal/watchdog/__init__.c create mode 100644 ports/nrf/common-hal/watchdog/__init__.h delete mode 100644 ports/nrf/common-hal/wdt/WDT.c rename ports/nrf/common-hal/wdt/__init__.c => shared-bindings/watchdog/WatchDogTimer.c (100%) create mode 100644 shared-bindings/watchdog/WatchDogTimer.h rename shared-bindings/{wdt => watchdog}/__init__.c (59%) rename shared-bindings/{wdt => watchdog}/__init__.h (84%) delete mode 100644 shared-bindings/wdt/WDT.c diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 64ccccc2bf..2bca2492fc 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -24,7 +24,7 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 -CIRCUITPY_WDT = 1 +CIRCUITPY_WATCHDOG = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 90d97f8689..1dd1cecfbf 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -106,7 +106,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 - // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { @@ -117,6 +116,16 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { }; #endif +#if CIRCUITPY_WATCHDOG +// The singleton nvm.WatchDogTimer object. +const watchdog_obj_t common_hal_mcu_watchdog_obj = { + .base = { + .type = &watchdog_type, + }, + .watchdogtimer = (mp_obj_t)&mp_const_none_obj, +}; +#endif + STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) }, { MP_ROM_QSTR(MP_QSTR_P0_01), MP_ROM_PTR(&pin_P0_01) }, diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c new file mode 100644 index 0000000000..8213f91762 --- /dev/null +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -0,0 +1,197 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/runtime.h" + +#include "common-hal/watchdog/WatchDogTimer.h" +#include "nrf_wdt.h" + +#define WATCHDOG_RELOAD_COUNT 2 + +void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { + unsigned int channel; + nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; + if (pause_during_sleep) { + behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; + } + + nrf_wdt_behaviour_set(NRF_WDT, behaviour); + + uint64_t ticks = (duration * 32768ULL) / 1000; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); + + for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_enable(NRF_WDT, channel); + } + + nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); +} + +void common_hal_watchdog_feed(void) { + unsigned int channel; + for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { + nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); + } +} + +void common_hal_watchdog_disable(void) { + // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +} + +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Paul Sokolovsky + * + * 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 + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + +static watchdog_watchdogtimer_obj_t *wdt_singleton; + +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance. +//| +//| """ +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout_ms, ARG_sleep }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + if (wdt_singleton) + return wdt_singleton; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + + if (args[ARG_timeout_ms].u_int <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); + self->base.type = &watchdog_watchdogtimer_type; + self->timeout = args[ARG_timeout_ms].u_int; + self->sleep = args[ARG_sleep].u_bool; + + common_hal_watchdog_init(self->timeout, self->sleep); + wdt_singleton = self; + return MP_OBJ_FROM_PTR(self); +} + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the system will reset.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { + (void)self_in; + common_hal_watchdog_feed(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { + (void)self_in; + common_hal_watchdog_disable(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); + +//| timeout: int = ... +//| """The maximum number of milliseconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(self->timeout); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_obj_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_obj_get_timeout_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); + +const mp_obj_type_t watchdog_watchdogtimer_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimer, + .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, +}; diff --git a/shared-bindings/wdt/WDT.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h similarity index 72% rename from shared-bindings/wdt/WDT.h rename to ports/nrf/common-hal/watchdog/WatchDogTimer.h index bfd83d482c..ca57cf8a43 100644 --- a/shared-bindings/wdt/WDT.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -24,24 +24,16 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H -#include -#include +#include "py/obj.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" -extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); -extern void common_hal_wdt_feed(void); -extern void common_hal_wdt_disable(void); - -extern const mp_obj_type_t wdt_wdt_type; - -typedef struct _wdt_wdt_obj_t { +typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; uint32_t timeout; bool sleep; -} wdt_wdt_obj_t; +} watchdog_watchdogtimer_obj_t; -extern const wdt_wdt_obj_t wdt_wdt_obj; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT_WDT_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/nrf/common-hal/watchdog/__init__.c b/ports/nrf/common-hal/watchdog/__init__.c new file mode 100644 index 0000000000..4013d1317d --- /dev/null +++ b/ports/nrf/common-hal/watchdog/__init__.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "common-hal/watchdog/__init__.h" +#include "common-hal/watchdog/WatchDogTimer.h" + +STATIC const mp_rom_map_elem_t watchdog_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_WatchDogTimer), MP_ROM_PTR(&watchdog_watchdogtimer_type) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_locals_dict, watchdog_locals_dict_table); + +const mp_obj_type_t watchdog_type = { + { &mp_type_type }, + .name = MP_QSTR_watchdog, + // .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_locals_dict, +}; + diff --git a/ports/nrf/common-hal/watchdog/__init__.h b/ports/nrf/common-hal/watchdog/__init__.h new file mode 100644 index 0000000000..fbfb98eff5 --- /dev/null +++ b/ports/nrf/common-hal/watchdog/__init__.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H + +#include "py/obj.h" +#include "shared-bindings/watchdog/__init__.h" + +typedef struct _watchdog_obj_t { + mp_obj_base_t base; + mp_rom_obj_t *watchdogtimer; +} watchdog_obj_t; + +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H diff --git a/ports/nrf/common-hal/wdt/WDT.c b/ports/nrf/common-hal/wdt/WDT.c deleted file mode 100644 index 172bd33463..0000000000 --- a/ports/nrf/common-hal/wdt/WDT.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "py/obj.h" -#include "py/runtime.h" - -#include "shared-bindings/rtc/__init__.h" -#include "nrf_wdt.h" - -#define WDT_RELOAD_COUNT 2 - -void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep) { - unsigned int channel; - nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; - if (pause_during_sleep) { - behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; - } - - nrf_wdt_behaviour_set(NRF_WDT, behaviour); - - uint64_t ticks = (duration * 32768ULL) / 1000; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); - - for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_enable(NRF_WDT, channel); - } - - nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); -} - -void common_hal_wdt_feed(void) { - unsigned int channel; - for (channel = 0; channel < WDT_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); - } -} - -void common_hal_wdt_disable(void) { - // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); -} diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 018a955f5b..d65df1eb89 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -37,7 +37,7 @@ CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_COUNTIO = 0 -CIRCUITPY_WDT ?= 1 +CIRCUITPY_WATCHDOG ?= 1 # nRF52840-specific diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index be04dba487..13b913075c 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -241,8 +241,8 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif -ifeq ($(CIRCUITPY_WDT),1) -SRC_PATTERNS += wdt/% +ifeq ($(CIRCUITPY_WATCHDOG),1) +SRC_PATTERNS += watchdog/% endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% @@ -305,8 +305,8 @@ SRC_COMMON_HAL_ALL = \ rtc/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ - wdt/__init__.c \ - wdt/WDT.c \ + watchdog/__init__.c \ + watchdog/WatchDogTimer.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 50f1139d7a..002b60e8a6 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -630,11 +630,9 @@ extern const struct _mp_obj_module_t ustack_module; #define RE_MODULE #endif -#if CIRCUITPY_WDT -extern const struct _mp_obj_module_t wdt_module; -#define WDT_MODULE { MP_ROM_QSTR(MP_QSTR_wdt), MP_ROM_PTR(&wdt_module) }, -#else -#define WDT_MODULE +// This is not a top-level module; it's microcontroller.watchdog. +#if CIRCUITPY_WATCHDOG +extern const struct _mp_obj_module_t watchdog_module; #endif // Define certain native modules with weak links so they can be replaced with Python @@ -707,7 +705,6 @@ extern const struct _mp_obj_module_t wdt_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ - WDT_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 1b74f45c36..865654a0d5 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -229,8 +229,8 @@ CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) # watchdog hardware support -CIRCUITPY_WDT ?= 0 -CFLAGS += -DCIRCUITPY_WDT=$(CIRCUITPY_WDT) +CIRCUITPY_WATCHDOG ?= 0 +CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 21e1c90a92..907f1ec0ab 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -167,6 +167,11 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = { #else { MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) }, #endif + #if CIRCUITPY_WATCHDOG + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdog_obj) }, + #else + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) }, { MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&mcu_pin_type) }, { MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&mcu_pin_module) }, diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h index e1487c555a..6d61c527eb 100644 --- a/shared-bindings/microcontroller/__init__.h +++ b/shared-bindings/microcontroller/__init__.h @@ -49,10 +49,13 @@ extern const mcu_processor_obj_t common_hal_mcu_processor_obj; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 - #include "common-hal/nvm/ByteArray.h" extern const nvm_bytearray_obj_t common_hal_mcu_nvm_obj; +#endif +#if CIRCUITPY_WATCHDOG +#include "common-hal/watchdog/__init__.h" +extern const watchdog_obj_t common_hal_mcu_watchdog_obj; #endif #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER___INIT___H diff --git a/ports/nrf/common-hal/wdt/__init__.c b/shared-bindings/watchdog/WatchDogTimer.c similarity index 100% rename from ports/nrf/common-hal/wdt/__init__.c rename to shared-bindings/watchdog/WatchDogTimer.c diff --git a/shared-bindings/watchdog/WatchDogTimer.h b/shared-bindings/watchdog/WatchDogTimer.h new file mode 100644 index 0000000000..375ca653d7 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogTimer.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Noralf Trønnes + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H + +#include + +// extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); +// extern void common_hal_wdt_feed(void); +// extern void common_hal_wdt_disable(void); + + +// typedef struct _wdt_wdt_obj_t { +// mp_obj_base_t base; +// uint32_t timeout; +// bool sleep; +// } wdt_wdt_obj_t; + +extern const mp_obj_type_t watchdog_watchdogtimer_type; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H diff --git a/shared-bindings/wdt/__init__.c b/shared-bindings/watchdog/__init__.c similarity index 59% rename from shared-bindings/wdt/__init__.c rename to shared-bindings/watchdog/__init__.c index a95fa2c539..8289bb88ae 100644 --- a/shared-bindings/wdt/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -27,36 +27,40 @@ #include #include "py/runtime.h" -#include "shared-bindings/wdt/__init__.h" -#include "shared-bindings/wdt/WDT.h" +#include "shared-bindings/watchdog/__init__.h" +// #include "shared-bindings/wdt/WDT.h" //| """Watchdog Timer //| -//| The `wdt` module provides support for a Watchdog Timer. This timer will reset the device +//| The `watchdog` module provides support for a Watchdog Timer. This timer will reset the device //| if it hasn't been fed after a specified amount of time. This is useful to ensure the board -//| has not crashed or locked up. You can enable thw watchdog timer using :class:`wdt.WDT`. -//| Note that the watchdog timer cannot be disabled once it has been enabled. +//| has not crashed or locked up. You can enable the watchdog timer using :class:`wdt.WDT`. +//| Note that on some platforms the watchdog timer cannot be disabled once it has been enabled. //| -//| The WDT is used to restart the system when the application crashes and ends +//| The WatchDogTimer is used to restart the system when the application crashes and ends //| up into a non recoverable state. Once started it cannot be stopped or //| reconfigured in any way. After enabling, the application must "feed" the //| watchdog periodically to prevent it from expiring and resetting the system. //| +//| Note that this module can't be imported and used directly. The sole +//| instance of :class:`WatchDogTimer` is available at +//| :attr:`microcontroller.watchdog`.""" +//| //| Example usage:: //| -//| from machine import WDT -//| wdt = WDT(timeout=2000) # enable it with a timeout of 2s +//| from microcontroller.watchdog import WatchDogTimer +//| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds //| wdt.feed()""" //| -STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, - { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, -}; +// STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { +// { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, +// { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, +// }; -STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); +// STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); -const mp_obj_module_t wdt_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&wdt_module_globals, -}; +// const mp_obj_module_t wdt_module = { +// .base = { &mp_type_module }, +// .globals = (mp_obj_dict_t*)&wdt_module_globals, +// }; diff --git a/shared-bindings/wdt/__init__.h b/shared-bindings/watchdog/__init__.h similarity index 84% rename from shared-bindings/wdt/__init__.h rename to shared-bindings/watchdog/__init__.h index b27452ca5d..90426c1e64 100644 --- a/shared-bindings/wdt/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -24,11 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H -#include -#include +extern const mp_obj_type_t watchdog_type; - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WDT___INIT___H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H diff --git a/shared-bindings/wdt/WDT.c b/shared-bindings/wdt/WDT.c deleted file mode 100644 index edfac897ec..0000000000 --- a/shared-bindings/wdt/WDT.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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 - -#include "py/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "shared-bindings/wdt/__init__.h" -#include "shared-bindings/wdt/WDT.h" - -static wdt_wdt_obj_t *wdt_singleton; - -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout_ms, ARG_sleep }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - - if (wdt_singleton) - return wdt_singleton; - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - - if (args[ARG_timeout_ms].u_int <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - wdt_wdt_obj_t *self = m_new_obj(wdt_wdt_obj_t); - self->base.type = &wdt_wdt_type; - self->timeout = args[ARG_timeout_ms].u_int; - self->sleep = args[ARG_sleep].u_bool; - - common_hal_wdt_init(self->timeout, self->sleep); - wdt_singleton = self; - return MP_OBJ_FROM_PTR(self); -} - -//| def feed(self): -//| """Feed the watchdog timer. This must be called regularly, otherwise -//| the system will reset.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_feed(mp_obj_t self_in) { - (void)self_in; - common_hal_wdt_feed(); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_feed_obj, wdt_wdt_feed); - -//| def deinit(self): -//| """Stop the watchdog timer. This may raise an error if the watchdog -//| timer cannot be disabled on this platform.""" -//| ... -//| -STATIC mp_obj_t wdt_wdt_deinit(mp_obj_t self_in) { - (void)self_in; - common_hal_wdt_disable(); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_deinit_obj, wdt_wdt_deinit); - -//| timeout: int = ... -//| """The maximum number of milliseconds that can elapse between calls -//| to feed()""" -//| -STATIC mp_obj_t wdt_wdt_obj_get_timeout(mp_obj_t self_in) { - wdt_wdt_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(self->timeout); -} -MP_DEFINE_CONST_FUN_OBJ_1(wdt_wdt_obj_get_timeout_obj, wdt_wdt_obj_get_timeout); - -const mp_obj_property_t wdt_wdt_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&wdt_wdt_obj_get_timeout_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -STATIC const mp_rom_map_elem_t wdt_wdt_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&wdt_wdt_feed_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&wdt_wdt_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&wdt_wdt_timeout_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(wdt_wdt_locals_dict, wdt_wdt_locals_dict_table); - -const mp_obj_type_t wdt_wdt_type = { - { &mp_type_type }, - .name = MP_QSTR_WDT, - .make_new = wdt_wdt_make_new, - .locals_dict = (mp_obj_dict_t*)&wdt_wdt_locals_dict, -}; From 8f46133917c07c75bde4efdc96f83f18070642e4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 17:46:01 +0800 Subject: [PATCH 689/919] nrf: watchdog: implement software watchdogtimer This adds a software WatchDogTimer implementation that can be used for testing. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 223 +++++++++++++----- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 3 +- 2 files changed, 166 insertions(+), 60 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 8213f91762..300ac77122 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -24,15 +24,47 @@ * THE SOFTWARE. */ + +#include +#include + #include "py/obj.h" +#include "py/objproperty.h" #include "py/runtime.h" #include "common-hal/watchdog/WatchDogTimer.h" + +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + #include "nrf_wdt.h" +#include "nrfx_timer.h" +#include "nrf/timers.h" +STATIC watchdog_watchdogtimer_obj_t *wdt_singleton; +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in); +STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 +STATIC nrfx_timer_t *timer = NULL; -void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +static mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; + + +STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { unsigned int channel; nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; if (pause_during_sleep) { @@ -41,7 +73,7 @@ void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { nrf_wdt_behaviour_set(NRF_WDT, behaviour); - uint64_t ticks = (duration * 32768ULL) / 1000; + uint64_t ticks = duration * 32768ULL; if (ticks > UINT32_MAX) { mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); } @@ -54,52 +86,38 @@ void common_hal_watchdog_init(uint32_t duration, bool pause_during_sleep) { nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); } -void common_hal_watchdog_feed(void) { +STATIC void watchdogtimer_hardware_feed(void) { unsigned int channel; for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); } } -void common_hal_watchdog_disable(void) { - // mp_raise_ValueError(translate("Watchdog timer cannot be disabled -- board will reset shortly")); +STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { + (void)p_context; + if (event_type != NRF_TIMER_EVENT_COMPARE0) { + // Spurious event. + return; + } + + // If the timer hits without being cleared, pause the timer and raise an exception. + nrfx_timer_pause(timer); + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); + MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; +#if MICROPY_ENABLE_SCHEDULER + if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { + MP_STATE_VM(sched_state) = MP_SCHED_PENDING; + } +#endif } -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Paul Sokolovsky - * - * 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 - -#include "py/obj.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "shared-bindings/watchdog/__init__.h" -#include "shared-bindings/watchdog/WatchDogTimer.h" - -static watchdog_watchdogtimer_obj_t *wdt_singleton; +void watchdog_watchdogtimer_reset(void) { + if (timer != NULL) { + nrf_peripherals_free_timer(timer); + } + timer = NULL; + timer_refcount = 0; +} //| class WDT: //| """Watchdog Timer""" @@ -114,31 +132,79 @@ static watchdog_watchdogtimer_obj_t *wdt_singleton; STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_timeout_ms, ARG_sleep }; + enum { ARG_timeout, ARG_sleep, ARG_hardware }; static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout_ms, MP_ARG_INT | MP_ARG_REQUIRED}, + {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - if (wdt_singleton) - return wdt_singleton; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + bool hardware = args[ARG_hardware].u_bool; + bool sleep = args[ARG_sleep].u_bool; - if (args[ARG_timeout_ms].u_int <= 0) { + // If the hardware timer is already running, return that timer. + // If the parameters have changed, then ignore them, but print + // an error. + if (wdt_singleton && hardware) { + if ((sleep != wdt_singleton->sleep) + || (hardware != wdt_singleton->hardware) + || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { + // Print a warning indicating things aren't quite right + // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); + } + watchdogtimer_hardware_feed(); + return wdt_singleton; + } + + if (timeout <= 0) { mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); } watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); self->base.type = &watchdog_watchdogtimer_type; - self->timeout = args[ARG_timeout_ms].u_int; - self->sleep = args[ARG_sleep].u_bool; + self->timeout = timeout; + self->sleep = sleep; + self->hardware = hardware; - common_hal_watchdog_init(self->timeout, self->sleep); - wdt_singleton = self; - return MP_OBJ_FROM_PTR(self); + if (hardware) { + watchdogtimer_hardware_init(self->timeout, self->sleep); + wdt_singleton = self; + } else { + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + + // Feed the watchdog, in case there's a timer that's already running + // and it's only partially finished. + mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); + watchdog_watchdogtimer_feed(self_obj); + return self_obj; } //| def feed(self): @@ -147,8 +213,13 @@ STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_ //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { - (void)self_in; - common_hal_watchdog_feed(); + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (self->hardware) { + watchdogtimer_hardware_feed(); + } else { + nrfx_timer_clear(timer); + } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); @@ -159,8 +230,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { - (void)self_in; - common_hal_watchdog_disable(); + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (!self->hardware) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); @@ -169,23 +248,49 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_wat //| """The maximum number of milliseconds that can elapse between calls //| to feed()""" //| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { +STATIC mp_obj_t watchdog_watchdogtimer_get_timeout(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_int(self->timeout); + return mp_obj_new_float(self->timeout); } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_obj_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_get_timeout); const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_obj_get_timeout_obj, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, (mp_obj_t)&mp_const_none_obj, (mp_obj_t)&mp_const_none_obj}, }; +mp_obj_t watchdog_watchdogtimer___enter__(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + + if (!self->hardware) { + nrfx_timer_resume(timer); + } + watchdog_watchdogtimer_feed(self_in); + return self_in; +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer___enter___obj, watchdog_watchdogtimer___enter__); + +STATIC mp_obj_t watchdog_watchdogtimer___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(args[0]); + if (!self->hardware) { + if (timer) { + nrfx_timer_pause(timer); + } + } + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(watchdog_watchdogtimer___exit___obj, 4, 4, watchdog_watchdogtimer___exit__); + STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, + // { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&watchdog_watchdogtimer___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&watchdog_watchdogtimer___exit___obj) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index ca57cf8a43..c59796820d 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -32,8 +32,9 @@ typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; - uint32_t timeout; + mp_float_t timeout; bool sleep; + bool hardware; } watchdog_watchdogtimer_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H From 87737fb50ac23760ad11f5d23d87dd9020ab5f20 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 18:38:48 +0800 Subject: [PATCH 690/919] watchdog: fix documentation build error Signed-off-by: Sean Cross --- shared-bindings/watchdog/__init__.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 8289bb88ae..21e87d515a 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -28,7 +28,6 @@ #include "py/runtime.h" #include "shared-bindings/watchdog/__init__.h" -// #include "shared-bindings/wdt/WDT.h" //| """Watchdog Timer //| @@ -44,7 +43,7 @@ //| //| Note that this module can't be imported and used directly. The sole //| instance of :class:`WatchDogTimer` is available at -//| :attr:`microcontroller.watchdog`.""" +//| :attr:`microcontroller.watchdog`. //| //| Example usage:: //| @@ -52,15 +51,3 @@ //| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds //| wdt.feed()""" //| - -// STATIC const mp_rom_map_elem_t wdt_module_globals_table[] = { -// { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_wdt) }, -// { MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&wdt_wdt_type) }, -// }; - -// STATIC MP_DEFINE_CONST_DICT(wdt_module_globals, wdt_module_globals_table); - -// const mp_obj_module_t wdt_module = { -// .base = { &mp_type_module }, -// .globals = (mp_obj_dict_t*)&wdt_module_globals, -// }; From 0169ea5155d553094d33613e94a6c597ee2e0860 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 18:39:13 +0800 Subject: [PATCH 691/919] nrf: discard arm exception sections Since these exceptions are unused, don't include them in the output binary. Signed-off-by: Sean Cross --- ports/nrf/boards/common.template.ld | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 334a3506e1..5982b8ba0d 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -70,18 +70,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ } >FLASH_FIRMWARE - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } >FLASH_FIRMWARE - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH_FIRMWARE - /* used by the startup to initialize data */ _sidata = .; @@ -145,6 +133,14 @@ SECTIONS . = ALIGN(4); } >RAM + /* Remove exception unwinding information, since Circuit Python + does not support this GCC feature. */ + /DISCARD/ : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + *(.ARM.exidx*) + } + /* Remove information from the standard libraries */ /* /DISCARD/ : From ae950bc050fc9c7ee675d0a4d52f352ebc24a369 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 20:45:03 +0800 Subject: [PATCH 692/919] add WatchDogTimeout exception This adds an exception to be raised when the WatchDogTimer times out. Note that this currently causes a HardFault, and it's not clear why it's not behaving properly. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 25 +++++-------------- py/modbuiltins.c | 3 +++ py/mpstate.h | 5 ++++ py/obj.h | 3 +++ py/objexcept.c | 3 +++ py/runtime.c | 9 +++++++ 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 300ac77122..148146b01f 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -47,23 +47,6 @@ STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; -const mp_obj_type_t mp_type_WatchDogTimeout = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimeout, - .make_new = mp_obj_exception_make_new, - .attr = mp_obj_exception_attr, - .parent = &mp_type_Exception, -}; - -static mp_obj_exception_t mp_watchdog_timeout_exception = { - .base.type = &mp_type_WatchDogTimeout, - .traceback_alloc = 0, - .traceback_len = 0, - .traceback_data = NULL, - .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, -}; - - STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { unsigned int channel; nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; @@ -93,6 +76,10 @@ STATIC void watchdogtimer_hardware_feed(void) { } } +NORETURN void mp_raise_WatchDogTimeout(void) { + nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); +} + STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; if (event_type != NRF_TIMER_EVENT_COMPARE0) { @@ -102,8 +89,7 @@ STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_co // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); - mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); - MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; + MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception)); #if MICROPY_ENABLE_SCHEDULER if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; @@ -139,6 +125,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_ {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); diff --git a/py/modbuiltins.c b/py/modbuiltins.c index e764f1987e..b031ce9fe0 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -719,6 +719,9 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IndexError), MP_ROM_PTR(&mp_type_IndexError) }, { MP_ROM_QSTR(MP_QSTR_KeyboardInterrupt), MP_ROM_PTR(&mp_type_KeyboardInterrupt) }, { MP_ROM_QSTR(MP_QSTR_ReloadException), MP_ROM_PTR(&mp_type_ReloadException) }, + #if CIRCUITPY_WATCHDOG + { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, + #endif { MP_ROM_QSTR(MP_QSTR_KeyError), MP_ROM_PTR(&mp_type_KeyError) }, { MP_ROM_QSTR(MP_QSTR_LookupError), MP_ROM_PTR(&mp_type_LookupError) }, { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_MemoryError) }, diff --git a/py/mpstate.h b/py/mpstate.h index a5815776a4..5d3b7709b3 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -141,6 +141,11 @@ typedef struct _mp_state_vm_t { // exception object of type ReloadException mp_obj_exception_t mp_reload_exception; + #if CIRCUITPY_WATCHDOG + // exception object of type WatchdogTimeout + mp_obj_exception_t mp_watchdog_exception; + #endif + // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; diff --git a/py/obj.h b/py/obj.h index fa315d12f7..cabe5498db 100644 --- a/py/obj.h +++ b/py/obj.h @@ -596,6 +596,9 @@ extern const mp_obj_type_t mp_type_IndentationError; extern const mp_obj_type_t mp_type_IndexError; extern const mp_obj_type_t mp_type_KeyboardInterrupt; extern const mp_obj_type_t mp_type_ReloadException; +#if CIRCUITPY_WATCHDOG +extern const mp_obj_type_t mp_type_WatchDogTimeout; +#endif extern const mp_obj_type_t mp_type_KeyError; extern const mp_obj_type_t mp_type_LookupError; extern const mp_obj_type_t mp_type_MemoryError; diff --git a/py/objexcept.c b/py/objexcept.c index b7a536c5e3..db09d51538 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -256,6 +256,9 @@ const mp_obj_type_t mp_type_BaseException = { MP_DEFINE_EXCEPTION(SystemExit, BaseException) MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException) MP_DEFINE_EXCEPTION(ReloadException, BaseException) +#if CIRCUITPY_WATCHDOG +MP_DEFINE_EXCEPTION(WatchDogTimeout, BaseException) +#endif MP_DEFINE_EXCEPTION(GeneratorExit, BaseException) MP_DEFINE_EXCEPTION(Exception, BaseException) #if MICROPY_PY_ASYNC_AWAIT diff --git a/py/runtime.c b/py/runtime.c index 59dcbc7a1c..02352ea6c7 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -86,6 +86,15 @@ void mp_init(void) { MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; #endif + #if CIRCUITPY_WATCHDOG + // initialise the exception object for raising WatchDogTimeout + MP_STATE_VM(mp_kbd_exception).base.type = &mp_type_WatchDogTimeout; + MP_STATE_VM(mp_kbd_exception).traceback_alloc = 0; + MP_STATE_VM(mp_kbd_exception).traceback_len = 0; + MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; + MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; + #endif + MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException; MP_STATE_VM(mp_reload_exception).traceback_alloc = 0; MP_STATE_VM(mp_reload_exception).traceback_len = 0; From ec99dae95384fa08e4b1bc72273f1d34c6d646bb Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 21 May 2020 21:33:43 +0800 Subject: [PATCH 693/919] tick: break on watchdog timeout exception Signed-off-by: Sean Cross --- supervisor/shared/tick.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index dc38e76f61..0e2adf2160 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -96,7 +96,8 @@ void mp_hal_delay_ms(mp_uint_t delay) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || + MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))) { break; } remaining = end_tick - port_get_raw_ticks(NULL); From 08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:35:29 +0800 Subject: [PATCH 694/919] watchdogtimer: refactor to new api This refactors the WatchDogTimer API to use the format proposed in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227 Signed-off-by: Sean Cross --- .../nrf/common-hal/microcontroller/__init__.c | 10 +- ports/nrf/common-hal/watchdog/WatchDogMode.c | 0 ports/nrf/common-hal/watchdog/WatchDogTimer.c | 256 ++++++++++-------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 3 +- ports/nrf/common-hal/watchdog/__init__.c | 17 -- py/circuitpy_defns.mk | 1 + py/circuitpy_mpconfig.h | 4 + shared-bindings/microcontroller/__init__.c | 2 +- shared-bindings/microcontroller/__init__.h | 4 +- shared-bindings/watchdog/WatchDogMode.c | 88 ++++++ shared-bindings/watchdog/WatchDogMode.h | 47 ++++ shared-bindings/watchdog/__init__.c | 21 +- shared-bindings/watchdog/__init__.h | 2 +- 13 files changed, 307 insertions(+), 148 deletions(-) create mode 100644 ports/nrf/common-hal/watchdog/WatchDogMode.c create mode 100644 shared-bindings/watchdog/WatchDogMode.c create mode 100644 shared-bindings/watchdog/WatchDogMode.h diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 1dd1cecfbf..187b46ad1b 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -117,12 +117,14 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { #endif #if CIRCUITPY_WATCHDOG -// The singleton nvm.WatchDogTimer object. -const watchdog_obj_t common_hal_mcu_watchdog_obj = { +// The singleton watchdog.WatchDogTimer object. +watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { .base = { - .type = &watchdog_type, + .type = &watchdog_watchdogtimer_type, }, - .watchdogtimer = (mp_obj_t)&mp_const_none_obj, + .timeout = 0.0f, + .sleep = false, + .mode = WATCHDOGMODE_NONE, }; #endif diff --git a/ports/nrf/common-hal/watchdog/WatchDogMode.c b/ports/nrf/common-hal/watchdog/WatchDogMode.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 148146b01f..28a96138f5 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -41,8 +41,6 @@ #include "nrfx_timer.h" #include "nrf/timers.h" -STATIC watchdog_watchdogtimer_obj_t *wdt_singleton; -STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in); STATIC uint8_t timer_refcount = 0; #define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; @@ -80,7 +78,7 @@ NORETURN void mp_raise_WatchDogTimeout(void) { nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); } -STATIC void watchdogtimer_event_handler(nrf_timer_event_t event_type, void *p_context) { +STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; if (event_type != NRF_TIMER_EVENT_COMPARE0) { // Spurious event. @@ -105,107 +103,20 @@ void watchdog_watchdogtimer_reset(void) { timer_refcount = 0; } -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance. -//| -//| """ -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout, ARG_sleep, ARG_hardware }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - bool hardware = args[ARG_hardware].u_bool; - bool sleep = args[ARG_sleep].u_bool; - - // If the hardware timer is already running, return that timer. - // If the parameters have changed, then ignore them, but print - // an error. - if (wdt_singleton && hardware) { - if ((sleep != wdt_singleton->sleep) - || (hardware != wdt_singleton->hardware) - || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { - // Print a warning indicating things aren't quite right - // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); - } - watchdogtimer_hardware_feed(); - return wdt_singleton; - } - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); - self->base.type = &watchdog_watchdogtimer_type; - self->timeout = timeout; - self->sleep = sleep; - self->hardware = hardware; - - if (hardware) { - watchdogtimer_hardware_init(self->timeout, self->sleep); - wdt_singleton = self; - } else { - uint64_t ticks = timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - timer_refcount++; - - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; - - nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - - // Feed the watchdog, in case there's a timer that's already running - // and it's only partially finished. - mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); - watchdog_watchdogtimer_feed(self_obj); - return self_obj; -} - //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise -//| the system will reset.""" +//| the timer will expire.""" //| ... //| STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (self->hardware) { + if (self->mode == WATCHDOGMODE_RESET) { watchdogtimer_hardware_feed(); - } else { + } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); + } else if (self->mode == WATCHDOGMODE_NONE) { + mp_raise_ValueError(translate("WatchDogTimer is not currently running")); } return mp_const_none; } @@ -219,71 +130,178 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watch STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - if (!self->hardware) { + if (self->mode == WATCHDOGMODE_RAISE) { timer_refcount--; if (timer_refcount == 0) { nrf_peripherals_free_timer(timer); timer = NULL; } + } else if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); } return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); -//| timeout: int = ... -//| """The maximum number of milliseconds that can elapse between calls +//| timeout: float = ... +//| """The maximum number of seconds that can elapse between calls //| to feed()""" //| -STATIC mp_obj_t watchdog_watchdogtimer_get_timeout(mp_obj_t self_in) { +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_float(self->timeout); } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_get_timeout); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t timeout = mp_obj_get_float(timeout_obj); + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + if (self->mode == WATCHDOGMODE_RESET) { + // If the WatchDogTimer is already running in "RESET" mode, raise an error + // since the mode cannot be changed once started. + mp_raise_TypeError(translate("Cannot change the timeout once mode is WatchDogMode.RESET")); + } else if (self->mode == WATCHDOGMODE_RAISE) { + // If the WatchDogTimer is already running in "RAISE" mode, reset the timer + // with the new value. + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + } + + self->timeout = timeout; + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, - (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, (mp_obj_t)&mp_const_none_obj}, }; -mp_obj_t watchdog_watchdogtimer___enter__(mp_obj_t self_in) { +//| mode: watchdog.WatchDogMode = ... +//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. +//| +//| Setting a WatchDogMode activates the WatchDog:: +//| +//| import microcontroller +//| import watchdog +//| +//| w = microcontroller.watchdog +//| w.timeout = 5 +//| w.mode = watchdog.WatchDogMode.RAISE +//| +//| +//| Once set, the WatchDogTimer will perform the specified action if the timer expires. +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (!self->hardware) { - nrfx_timer_resume(timer); + switch (self->mode) { + case WATCHDOGMODE_NONE: default: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_none_obj); + case WATCHDOGMODE_RAISE: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); + case WATCHDOGMODE_RESET: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); } - watchdog_watchdogtimer_feed(self_in); - return self_in; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer___enter___obj, watchdog_watchdogtimer___enter__); +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); -STATIC mp_obj_t watchdog_watchdogtimer___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(args[0]); - if (!self->hardware) { - if (timer) { - nrfx_timer_pause(timer); +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_obj_t *mode = MP_OBJ_TO_PTR(mode_obj); + if (mode == MP_ROM_PTR(&watchdog_watchdogmode_none_obj)) { + if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_TypeError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); } + else if (self->mode == WATCHDOGMODE_RAISE) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + self->mode = WATCHDOGMODE_NONE; + + } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + if (self->timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + if (self->mode == WATCHDOGMODE_RESET) { + mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); + } + else if (self->mode == WATCHDOGMODE_NONE) { + uint64_t ticks = self->timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + self->mode = WATCHDOGMODE_RAISE; + + } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + if (self->timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + if (self->mode == WATCHDOGMODE_RAISE) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } + watchdogtimer_hardware_init(self->timeout, self->sleep); + self->mode = WATCHDOGMODE_RESET; } + return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(watchdog_watchdogtimer___exit___obj, 4, 4, watchdog_watchdogtimer___exit__); +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); + +const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, + (mp_obj_t)&mp_const_none_obj}, +}; STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, - // { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mp_stream_close_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&watchdog_watchdogtimer___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&watchdog_watchdogtimer___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); const mp_obj_type_t watchdog_watchdogtimer_type = { { &mp_type_type }, .name = MP_QSTR_WatchDogTimer, - .make_new = watchdog_watchdogtimer_make_new, + // .make_new = watchdog_watchdogtimer_make_new, .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, }; diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index c59796820d..4176944696 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -29,12 +29,13 @@ #include "py/obj.h" #include "shared-bindings/watchdog/WatchDogTimer.h" +#include "shared-bindings/watchdog/WatchDogMode.h" typedef struct _watchdog_watchdogtimer_obj_t { mp_obj_base_t base; mp_float_t timeout; bool sleep; - bool hardware; + watchdog_watchdogmode_t mode; } watchdog_watchdogtimer_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/ports/nrf/common-hal/watchdog/__init__.c b/ports/nrf/common-hal/watchdog/__init__.c index 4013d1317d..79875d1279 100644 --- a/ports/nrf/common-hal/watchdog/__init__.c +++ b/ports/nrf/common-hal/watchdog/__init__.c @@ -23,20 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include "py/obj.h" -#include "common-hal/watchdog/__init__.h" -#include "common-hal/watchdog/WatchDogTimer.h" - -STATIC const mp_rom_map_elem_t watchdog_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_WatchDogTimer), MP_ROM_PTR(&watchdog_watchdogtimer_type) }, -}; -STATIC MP_DEFINE_CONST_DICT(watchdog_locals_dict, watchdog_locals_dict_table); - -const mp_obj_type_t watchdog_type = { - { &mp_type_type }, - .name = MP_QSTR_watchdog, - // .make_new = watchdog_watchdogtimer_make_new, - .locals_dict = (mp_obj_dict_t*)&watchdog_locals_dict, -}; - diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 13b913075c..d77559912f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -306,6 +306,7 @@ SRC_COMMON_HAL_ALL = \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/__init__.c \ + watchdog/WatchDogMode.c \ watchdog/WatchDogTimer.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 002b60e8a6..0b5547058b 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -633,6 +633,9 @@ extern const struct _mp_obj_module_t ustack_module; // This is not a top-level module; it's microcontroller.watchdog. #if CIRCUITPY_WATCHDOG extern const struct _mp_obj_module_t watchdog_module; +#define WATCHDOG_MODULE { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&watchdog_module) }, +#else +#define WATCHDOG_MODULE #endif // Define certain native modules with weak links so they can be replaced with Python @@ -705,6 +708,7 @@ extern const struct _mp_obj_module_t watchdog_module; USB_HID_MODULE \ USB_MIDI_MODULE \ USTACK_MODULE \ + WATCHDOG_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 907f1ec0ab..88fe9c2245 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -168,7 +168,7 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_nvm), MP_ROM_PTR(&mp_const_none_obj) }, #endif #if CIRCUITPY_WATCHDOG - { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdog_obj) }, + { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&common_hal_mcu_watchdogtimer_obj) }, #else { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) }, #endif diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h index 6d61c527eb..8abdff763c 100644 --- a/shared-bindings/microcontroller/__init__.h +++ b/shared-bindings/microcontroller/__init__.h @@ -54,8 +54,8 @@ extern const nvm_bytearray_obj_t common_hal_mcu_nvm_obj; #endif #if CIRCUITPY_WATCHDOG -#include "common-hal/watchdog/__init__.h" -extern const watchdog_obj_t common_hal_mcu_watchdog_obj; +#include "common-hal/watchdog/WatchDogTimer.h" +extern watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj; #endif #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER___INIT___H diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c new file mode 100644 index 0000000000..c5c4b23bc3 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -0,0 +1,88 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Sean Cross for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/watchdog/WatchDogMode.h" + +//| class WatchDogMode: +//| """run state of the watchdog timer""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the run mode of the watchdog timer.""" +//| +//| NONE: Any = ... +//| """Take no action if the watchdog timer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +//| RAISE: Any = ... +//| """Raise an exception when the WatchDogTimer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +//| RESET: Any = ... +//| """Reset the system if the WatchDogTimer expires. +//| +//| :type watchdog.WatchDogMode:""" +//| +const mp_obj_type_t watchdog_watchdogmode_type; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj = { + { &watchdog_watchdogmode_type }, +}; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj = { + { &watchdog_watchdogmode_type }, +}; + +const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj = { + { &watchdog_watchdogmode_type }, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&watchdog_watchdogmode_none_obj)}, + {MP_ROM_QSTR(MP_QSTR_RAISE), MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)}, + {MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogmode_locals_dict, watchdog_watchdogmode_locals_dict_table); + +STATIC void watchdog_watchdogmode_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr runmode = MP_QSTR_NONE; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + runmode = MP_QSTR_RAISE; + } + else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + runmode = MP_QSTR_RESET; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_watchdog, MP_QSTR_WatchDogMode, + runmode); +} + +const mp_obj_type_t watchdog_watchdogmode_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogMode, + .print = watchdog_watchdogmode_print, + .locals_dict = (mp_obj_t)&watchdog_watchdogmode_locals_dict, +}; diff --git a/shared-bindings/watchdog/WatchDogMode.h b/shared-bindings/watchdog/WatchDogMode.h new file mode 100644 index 0000000000..77bf58db63 --- /dev/null +++ b/shared-bindings/watchdog/WatchDogMode.h @@ -0,0 +1,47 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Sean Cross for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H + +#include "py/obj.h" + +typedef enum { + WATCHDOGMODE_NONE, + WATCHDOGMODE_RAISE, + WATCHDOGMODE_RESET, +} watchdog_watchdogmode_t; + +const mp_obj_type_t watchdog_watchdogmode_type; + +typedef struct { + mp_obj_base_t base; +} watchdog_watchdogmode_obj_t; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj; +extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGMODE_H diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 21e87d515a..36993db936 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogMode.h" //| """Watchdog Timer //| @@ -47,7 +48,21 @@ //| //| Example usage:: //| -//| from microcontroller.watchdog import WatchDogTimer -//| wdt = WatchDogTimer(timeout=2.5) # enable it with a timeout of 2.5 seconds -//| wdt.feed()""" +//| from microcontroller import watchdog as w +//| from watchdog import WatchDogMode +//| w.timeout=2.5 # Set a timeout of 2.5 seconds +//| w.mode = WatchDogMode.RAISE +//| w.feed()""" //| + +STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, + { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(watchdog_module_globals, watchdog_module_globals_table); + +const mp_obj_module_t watchdog_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&watchdog_module_globals, +}; diff --git a/shared-bindings/watchdog/__init__.h b/shared-bindings/watchdog/__init__.h index 90426c1e64..7203b8aa51 100644 --- a/shared-bindings/watchdog/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -27,6 +27,6 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H -extern const mp_obj_type_t watchdog_type; +extern const mp_obj_module_t watchdog_module; #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H From 8c5df5f7329f84c005d217d18148b616f55b942f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:56:14 +0800 Subject: [PATCH 695/919] supervisor: add a new WATCHDOG_RESET safe mode reason This mode will be used if the board is reset due to the watchdog expiring. Signed-off-by: Sean Cross --- supervisor/shared/safe_mode.c | 3 +++ supervisor/shared/safe_mode.h | 1 + 2 files changed, 4 insertions(+) diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index c957aee534..a167ab392c 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -160,6 +160,9 @@ void print_safe_mode_message(safe_mode_t reason) { case MEM_MANAGE: serial_write_compressed(translate("Invalid memory access.")); break; + case WATCHDOG_RESET: + serial_write_compressed(translate("Watchdog timer expired.")); + break; default: serial_write_compressed(translate("Unknown reason.")); break; diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 5b09c4b543..c160739aec 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -41,6 +41,7 @@ typedef enum { NORDIC_SOFT_DEVICE_ASSERT, FLASH_WRITE_FAIL, MEM_MANAGE, + WATCHDOG_RESET, } safe_mode_t; safe_mode_t wait_for_safe_mode_reset(void); From e738f5eaa13c0e30dc082c511d9659c5f35e7f7e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 12:56:49 +0800 Subject: [PATCH 696/919] nrf: boot into safe mode sometimes for watchdog reset If the watchdog resets the system and we're plugged into USB, boot into safe mode. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 36725293c8..89797e6dcb 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -131,6 +131,21 @@ safe_mode_t port_init(void) { analogin_init(); #endif + // If the board was reset by the WatchDogTimer, we may + // need to boot into safe mode. Reset the RESETREAS bit + // for the WatchDogTimer so we don't encounter this the + // next time we reboot. + if (NRF_POWER->RESETREAS & POWER_RESETREAS_DOG_Msk) { + NRF_POWER->RESETREAS = POWER_RESETREAS_DOG_Msk; + uint32_t usb_reg = NRF_POWER->USBREGSTATUS; + + // If USB is connected, then the user might be editing `code.py`, + // in which case we should reboot into Safe Mode. + if (usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk) { + return WATCHDOG_RESET; + } + } + return NO_SAFE_MODE; } From 589cb1af6de04a01e1cfda1082fea4f6fbc4440c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 17:29:54 +0800 Subject: [PATCH 697/919] nrf: watchdog: use nrfx_wdt driver Instead of directly poking registers, use `nrfx_wdt`. Signed-off-by: Sean Cross --- ports/nrf/Makefile | 1 + ports/nrf/common-hal/watchdog/WatchDogTimer.c | 71 ++++++++++--------- ports/nrf/nrfx_config.h | 7 ++ ports/nrf/nrfx_glue.h | 8 +-- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8a7b1104b9..e5931af5ee 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -136,6 +136,7 @@ SRC_NRFX = $(addprefix nrfx/,\ drivers/src/nrfx_gpiote.c \ drivers/src/nrfx_rtc.c \ drivers/src/nrfx_nvmc.c \ + drivers/src/nrfx_wdt.c \ ) ifdef EXTERNAL_FLASH_DEVICES diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 28a96138f5..358fab7987 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -37,42 +37,17 @@ #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" -#include "nrf_wdt.h" -#include "nrfx_timer.h" +#include "supervisor/port.h" + #include "nrf/timers.h" +#include "nrf_wdt.h" +#include "nrfx_wdt.h" +#include "nrfx_timer.h" STATIC uint8_t timer_refcount = 0; -#define WATCHDOG_RELOAD_COUNT 2 STATIC nrfx_timer_t *timer = NULL; - -STATIC void watchdogtimer_hardware_init(mp_float_t duration, bool pause_during_sleep) { - unsigned int channel; - nrf_wdt_behaviour_t behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP_HALT; - if (pause_during_sleep) { - behaviour = NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT; - } - - nrf_wdt_behaviour_set(NRF_WDT, behaviour); - - uint64_t ticks = duration * 32768ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - nrf_wdt_reload_value_set(NRF_WDT, (uint32_t) ticks); - - for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_enable(NRF_WDT, channel); - } - - nrf_wdt_task_trigger(NRF_WDT, NRF_WDT_TASK_START); -} - -STATIC void watchdogtimer_hardware_feed(void) { - unsigned int channel; - for (channel = 0; channel < WATCHDOG_RELOAD_COUNT; channel++) { - nrf_wdt_reload_request_set(NRF_WDT, (nrf_wdt_rr_register_t)(NRF_WDT_RR0 + channel)); - } -} +STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); +STATIC nrfx_wdt_channel_id wdt_channel_id; NORETURN void mp_raise_WatchDogTimeout(void) { nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); @@ -95,6 +70,12 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void #endif } +// This function is called if the timer expires. The system will reboot in 1/16384 of a second. +// Issue a reboot ourselves so we can do any cleanup necessary. +STATIC void watchdogtimer_watchdog_event_handler(void) { + reset_cpu(); +} + void watchdog_watchdogtimer_reset(void) { if (timer != NULL) { nrf_peripherals_free_timer(timer); @@ -112,7 +93,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->mode == WATCHDOGMODE_RESET) { - watchdogtimer_hardware_feed(); + nrfx_wdt_feed(&wdt); } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); } else if (self->mode == WATCHDOGMODE_NONE) { @@ -276,7 +257,29 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m timer = NULL; } } - watchdogtimer_hardware_init(self->timeout, self->sleep); + + uint64_t ticks = self->timeout * 1000.0f; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + nrfx_wdt_config_t config = { + .reload_value = ticks, // in units of ms + .behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP, + NRFX_WDT_IRQ_CONFIG + }; + + nrfx_err_t err_code; + err_code = nrfx_wdt_init(&wdt, &config, watchdogtimer_watchdog_event_handler); + if (err_code != NRFX_SUCCESS) { + mp_raise_OSError(1); + } + err_code = nrfx_wdt_channel_alloc(&wdt, &wdt_channel_id); + if (err_code != NRFX_SUCCESS) { + mp_raise_OSError(1); + } + nrfx_wdt_enable(&wdt); + nrfx_wdt_feed(&wdt); self->mode = WATCHDOGMODE_RESET; } diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index 7a7f2e6d64..2dcdba14c6 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -122,4 +122,11 @@ // NVM controller #define NRFX_NVMC_ENABLED 1 +// Watchdog timer +#define NRFX_WDT_ENABLED 1 +#define NRFX_WDT0_ENABLED 1 +// This IRQ indicates the system will reboot shortly, so give +// it a high priority. +#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 1 + #endif // NRFX_CONFIG_H__ diff --git a/ports/nrf/nrfx_glue.h b/ports/nrf/nrfx_glue.h index 345de38704..9f91b72a14 100644 --- a/ports/nrf/nrfx_glue.h +++ b/ports/nrf/nrfx_glue.h @@ -180,17 +180,17 @@ static inline bool _NRFX_IRQ_IS_PENDING(IRQn_Type irq_number) return (NVIC_GetPendingIRQ(irq_number) == 1); } -//#include -//#include +void common_hal_mcu_disable_interrupts(void); +void common_hal_mcu_enable_interrupts(void); /** * @brief Macro for entering into a critical section. */ -#define NRFX_CRITICAL_SECTION_ENTER() CRITICAL_REGION_ENTER() +#define NRFX_CRITICAL_SECTION_ENTER() common_hal_mcu_disable_interrupts() /** * @brief Macro for exiting from a critical section. */ -#define NRFX_CRITICAL_SECTION_EXIT() CRITICAL_REGION_EXIT() +#define NRFX_CRITICAL_SECTION_EXIT() common_hal_mcu_enable_interrupts() //------------------------------------------------------------------------------ From bd086a102e515765b55b50db9f3e45a23164b840 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 17:43:05 +0800 Subject: [PATCH 698/919] Revert "add WatchDogTimeout exception" This reverts commit 561e7e619095869f58fc728d428f3ff20e8bfc40. --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 112 +++++++++++++++++- ports/nrf/common-hal/watchdog/__init__.h | 8 -- py/modbuiltins.c | 3 - py/mpstate.h | 5 - py/obj.h | 3 - py/objexcept.c | 3 - py/runtime.c | 9 -- 7 files changed, 108 insertions(+), 35 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 358fab7987..3820fdccec 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -49,9 +49,21 @@ STATIC nrfx_timer_t *timer = NULL; STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); STATIC nrfx_wdt_channel_id wdt_channel_id; -NORETURN void mp_raise_WatchDogTimeout(void) { - nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))); -} +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +static mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { (void)p_context; @@ -62,7 +74,8 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); - MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception)); + mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); + MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; #if MICROPY_ENABLE_SCHEDULER if (MP_STATE_VM(sched_state) == MP_SCHED_IDLE) { MP_STATE_VM(sched_state) = MP_SCHED_PENDING; @@ -84,6 +97,97 @@ void watchdog_watchdogtimer_reset(void) { timer_refcount = 0; } +<<<<<<< HEAD +======= +//| class WDT: +//| """Watchdog Timer""" +//| +//| def __init__(self, ): +//| """This class represents the system's Watchdog Timer. It is a +//| singleton and will always return the same instance. +//| +//| """ +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, + const mp_obj_t *pos_args, + mp_map_t *kw_args) { + enum { ARG_timeout, ARG_sleep, ARG_hardware }; + static const mp_arg_t allowed_args[] = { + {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, + {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, + {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), + allowed_args, args); + mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); + bool hardware = args[ARG_hardware].u_bool; + bool sleep = args[ARG_sleep].u_bool; + + // If the hardware timer is already running, return that timer. + // If the parameters have changed, then ignore them, but print + // an error. + if (wdt_singleton && hardware) { + if ((sleep != wdt_singleton->sleep) + || (hardware != wdt_singleton->hardware) + || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { + // Print a warning indicating things aren't quite right + // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); + } + watchdogtimer_hardware_feed(); + return wdt_singleton; + } + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); + self->base.type = &watchdog_watchdogtimer_type; + self->timeout = timeout; + self->sleep = sleep; + self->hardware = hardware; + + if (hardware) { + watchdogtimer_hardware_init(self->timeout, self->sleep); + wdt_singleton = self; + } else { + uint64_t ticks = timeout * 31250ULL; + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); + } + timer_refcount++; + + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; + + nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); + + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + } + + // Feed the watchdog, in case there's a timer that's already running + // and it's only partially finished. + mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); + watchdog_watchdogtimer_feed(self_obj); + return self_obj; +} + +>>>>>>> parent of 561e7e619... add WatchDogTimeout exception //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" diff --git a/ports/nrf/common-hal/watchdog/__init__.h b/ports/nrf/common-hal/watchdog/__init__.h index fbfb98eff5..de19bdae44 100644 --- a/ports/nrf/common-hal/watchdog/__init__.h +++ b/ports/nrf/common-hal/watchdog/__init__.h @@ -27,12 +27,4 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H #define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H -#include "py/obj.h" -#include "shared-bindings/watchdog/__init__.h" - -typedef struct _watchdog_obj_t { - mp_obj_base_t base; - mp_rom_obj_t *watchdogtimer; -} watchdog_obj_t; - #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG___INIT___H diff --git a/py/modbuiltins.c b/py/modbuiltins.c index b031ce9fe0..e764f1987e 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -719,9 +719,6 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_IndexError), MP_ROM_PTR(&mp_type_IndexError) }, { MP_ROM_QSTR(MP_QSTR_KeyboardInterrupt), MP_ROM_PTR(&mp_type_KeyboardInterrupt) }, { MP_ROM_QSTR(MP_QSTR_ReloadException), MP_ROM_PTR(&mp_type_ReloadException) }, - #if CIRCUITPY_WATCHDOG - { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, - #endif { MP_ROM_QSTR(MP_QSTR_KeyError), MP_ROM_PTR(&mp_type_KeyError) }, { MP_ROM_QSTR(MP_QSTR_LookupError), MP_ROM_PTR(&mp_type_LookupError) }, { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_MemoryError) }, diff --git a/py/mpstate.h b/py/mpstate.h index 5d3b7709b3..a5815776a4 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -141,11 +141,6 @@ typedef struct _mp_state_vm_t { // exception object of type ReloadException mp_obj_exception_t mp_reload_exception; - #if CIRCUITPY_WATCHDOG - // exception object of type WatchdogTimeout - mp_obj_exception_t mp_watchdog_exception; - #endif - // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; diff --git a/py/obj.h b/py/obj.h index cabe5498db..fa315d12f7 100644 --- a/py/obj.h +++ b/py/obj.h @@ -596,9 +596,6 @@ extern const mp_obj_type_t mp_type_IndentationError; extern const mp_obj_type_t mp_type_IndexError; extern const mp_obj_type_t mp_type_KeyboardInterrupt; extern const mp_obj_type_t mp_type_ReloadException; -#if CIRCUITPY_WATCHDOG -extern const mp_obj_type_t mp_type_WatchDogTimeout; -#endif extern const mp_obj_type_t mp_type_KeyError; extern const mp_obj_type_t mp_type_LookupError; extern const mp_obj_type_t mp_type_MemoryError; diff --git a/py/objexcept.c b/py/objexcept.c index db09d51538..b7a536c5e3 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -256,9 +256,6 @@ const mp_obj_type_t mp_type_BaseException = { MP_DEFINE_EXCEPTION(SystemExit, BaseException) MP_DEFINE_EXCEPTION(KeyboardInterrupt, BaseException) MP_DEFINE_EXCEPTION(ReloadException, BaseException) -#if CIRCUITPY_WATCHDOG -MP_DEFINE_EXCEPTION(WatchDogTimeout, BaseException) -#endif MP_DEFINE_EXCEPTION(GeneratorExit, BaseException) MP_DEFINE_EXCEPTION(Exception, BaseException) #if MICROPY_PY_ASYNC_AWAIT diff --git a/py/runtime.c b/py/runtime.c index 02352ea6c7..59dcbc7a1c 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -86,15 +86,6 @@ void mp_init(void) { MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; #endif - #if CIRCUITPY_WATCHDOG - // initialise the exception object for raising WatchDogTimeout - MP_STATE_VM(mp_kbd_exception).base.type = &mp_type_WatchDogTimeout; - MP_STATE_VM(mp_kbd_exception).traceback_alloc = 0; - MP_STATE_VM(mp_kbd_exception).traceback_len = 0; - MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; - MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj; - #endif - MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException; MP_STATE_VM(mp_reload_exception).traceback_alloc = 0; MP_STATE_VM(mp_reload_exception).traceback_len = 0; From 15530a69c79ded8b38cdb1d87a4e2515a4e12510 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:43:23 +0800 Subject: [PATCH 699/919] supervisor: tick: check for watchdog exception if enabled Check to see if the current exception is a Watchdog exception, if it's enabled. This ensures we break out of the current sleep() if a watchdog timeout hits. Signed-off-by: Sean Cross --- supervisor/shared/tick.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 0e2adf2160..ba12e1e8c7 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -86,6 +86,13 @@ void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { run_background_tasks(); } +#ifdef CIRCUITPY_WATCHDOG +extern mp_obj_exception_t mp_watchdog_timeout_exception; +#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) +#else +#define WATCHDOG_EXCEPTION_CHECK() 0 +#endif + void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. @@ -97,7 +104,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_watchdog_exception))) { + WATCHDOG_EXCEPTION_CHECK()) { break; } remaining = end_tick - port_get_raw_ticks(NULL); From 108409c6cdfb4adb9f18affe8714cfb6a8a86188 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:44:22 +0800 Subject: [PATCH 700/919] nrf: common-hal: finish reworking exceptions This finishes the rework of the exception handler, which is once again stored inside the watchdog timer module. This also implements a `watchdog_reset()` that is used to disable the RAISE watchdog, if one is enabled. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 134 ++++-------------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 2 + 2 files changed, 28 insertions(+), 108 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 3820fdccec..8132ceacc2 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -34,6 +34,7 @@ #include "common-hal/watchdog/WatchDogTimer.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/watchdog/__init__.h" #include "shared-bindings/watchdog/WatchDogTimer.h" @@ -57,7 +58,7 @@ const mp_obj_type_t mp_type_WatchDogTimeout = { .parent = &mp_type_Exception, }; -static mp_obj_exception_t mp_watchdog_timeout_exception = { +mp_obj_exception_t mp_watchdog_timeout_exception = { .base.type = &mp_type_WatchDogTimeout, .traceback_alloc = 0, .traceback_len = 0, @@ -66,7 +67,7 @@ static mp_obj_exception_t mp_watchdog_timeout_exception = { }; STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { - (void)p_context; + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(p_context); if (event_type != NRF_TIMER_EVENT_COMPARE0) { // Spurious event. return; @@ -74,6 +75,7 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void // If the timer hits without being cleared, pause the timer and raise an exception. nrfx_timer_pause(timer); + self->mode = WATCHDOGMODE_NONE; mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&mp_watchdog_timeout_exception)); MP_STATE_VM(mp_pending_exception) = &mp_watchdog_timeout_exception; #if MICROPY_ENABLE_SCHEDULER @@ -89,105 +91,6 @@ STATIC void watchdogtimer_watchdog_event_handler(void) { reset_cpu(); } -void watchdog_watchdogtimer_reset(void) { - if (timer != NULL) { - nrf_peripherals_free_timer(timer); - } - timer = NULL; - timer_refcount = 0; -} - -<<<<<<< HEAD -======= -//| class WDT: -//| """Watchdog Timer""" -//| -//| def __init__(self, ): -//| """This class represents the system's Watchdog Timer. It is a -//| singleton and will always return the same instance. -//| -//| """ -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *pos_args, - mp_map_t *kw_args) { - enum { ARG_timeout, ARG_sleep, ARG_hardware }; - static const mp_arg_t allowed_args[] = { - {MP_QSTR_timeout, MP_ARG_OBJ | MP_ARG_REQUIRED}, - {MP_QSTR_sleep, MP_ARG_BOOL, {.u_bool = false}}, - {MP_QSTR_hardware, MP_ARG_BOOL, {.u_bool = false}}, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), - allowed_args, args); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - bool hardware = args[ARG_hardware].u_bool; - bool sleep = args[ARG_sleep].u_bool; - - // If the hardware timer is already running, return that timer. - // If the parameters have changed, then ignore them, but print - // an error. - if (wdt_singleton && hardware) { - if ((sleep != wdt_singleton->sleep) - || (hardware != wdt_singleton->hardware) - || fabsf(timeout - wdt_singleton->timeout) > 0.01f) { - // Print a warning indicating things aren't quite right - // mp_printf(&mp_stderr_print, translate("warning: hardware timer was already running")); - } - watchdogtimer_hardware_feed(); - return wdt_singleton; - } - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - watchdog_watchdogtimer_obj_t *self = m_new_obj(watchdog_watchdogtimer_obj_t); - self->base.type = &watchdog_watchdogtimer_type; - self->timeout = timeout; - self->sleep = sleep; - self->hardware = hardware; - - if (hardware) { - watchdogtimer_hardware_init(self->timeout, self->sleep); - wdt_singleton = self; - } else { - uint64_t ticks = timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - timer_refcount++; - - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; - - nrfx_timer_init(timer, &timer_config, &watchdogtimer_event_handler); - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - - // Feed the watchdog, in case there's a timer that's already running - // and it's only partially finished. - mp_obj_t *self_obj = MP_OBJ_FROM_PTR(self); - watchdog_watchdogtimer_feed(self_obj); - return self_obj; -} - ->>>>>>> parent of 561e7e619... add WatchDogTimeout exception //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" @@ -221,6 +124,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { nrf_peripherals_free_timer(timer); timer = NULL; } + self->mode = WATCHDOGMODE_NONE; } else if (self->mode == WATCHDOGMODE_RESET) { mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); } @@ -229,6 +133,17 @@ STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); +void watchdog_reset(void) { + if (common_hal_mcu_watchdogtimer_obj.mode == WATCHDOGMODE_RAISE) { + common_hal_mcu_watchdogtimer_obj.mode = WATCHDOGMODE_NONE; + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } + } +} + //| timeout: float = ... //| """The maximum number of seconds that can elapse between calls //| to feed()""" @@ -250,7 +165,7 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ if (self->mode == WATCHDOGMODE_RESET) { // If the WatchDogTimer is already running in "RESET" mode, raise an error // since the mode cannot be changed once started. - mp_raise_TypeError(translate("Cannot change the timeout once mode is WatchDogMode.RESET")); + mp_raise_TypeError(translate("cannot change the timeout once mode is WatchDogMode.RESET")); } else if (self->mode == WATCHDOGMODE_RAISE) { // If the WatchDogTimer is already running in "RAISE" mode, reset the timer // with the new value. @@ -322,15 +237,13 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m if (self->mode == WATCHDOGMODE_RESET) { mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); } - else if (self->mode == WATCHDOGMODE_NONE) { - uint64_t ticks = self->timeout * 31250ULL; - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - + else if (self->mode == WATCHDOGMODE_NONE || self->mode == WATCHDOGMODE_RAISE) { if (timer_refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } + if (timer == NULL) { + mp_raise_RuntimeError(translate("timer was null")); + } timer_refcount++; nrfx_timer_config_t timer_config = { @@ -343,6 +256,11 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); + uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); + } + // true enables interrupt. nrfx_timer_clear(timer); nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index 4176944696..f5ea453ccb 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -38,4 +38,6 @@ typedef struct _watchdog_watchdogtimer_obj_t { watchdog_watchdogmode_t mode; } watchdog_watchdogtimer_obj_t; +void watchdog_reset(void); + #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H From c5c13a8ba14490c94fd7409bae0183e59b5767f4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:51:54 +0800 Subject: [PATCH 701/919] nrf: reset watchdog as part of port_reset() Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 89797e6dcb..9fe72905c6 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -50,6 +50,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/rtc/RTC.h" #include "common-hal/neopixel_write/__init__.h" +#include "common-hal/watchdog/WatchDogTimer.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" @@ -189,6 +190,10 @@ void reset_port(void) { bleio_reset(); #endif +#if CIRCUITPY_WATCHDOG + watchdog_reset(); +#endif + reset_all_pins(); } From c7efc94a336091a1e6d79e94a9e80b31e5d5fc3f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 18:52:21 +0800 Subject: [PATCH 702/919] watchdog: move timeout exception to shared-bindings Make this exception globally available to all platforms that have enabled the watchdog timer. Signed-off-by: Sean Cross --- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 16 ---------------- shared-bindings/watchdog/__init__.c | 16 ++++++++++++++++ shared-bindings/watchdog/__init__.h | 2 ++ supervisor/shared/tick.c | 14 +++++++------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 8132ceacc2..32af258663 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -50,22 +50,6 @@ STATIC nrfx_timer_t *timer = NULL; STATIC nrfx_wdt_t wdt = NRFX_WDT_INSTANCE(0); STATIC nrfx_wdt_channel_id wdt_channel_id; -const mp_obj_type_t mp_type_WatchDogTimeout = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimeout, - .make_new = mp_obj_exception_make_new, - .attr = mp_obj_exception_attr, - .parent = &mp_type_Exception, -}; - -mp_obj_exception_t mp_watchdog_timeout_exception = { - .base.type = &mp_type_WatchDogTimeout, - .traceback_alloc = 0, - .traceback_len = 0, - .traceback_data = NULL, - .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, -}; - STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void *p_context) { watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(p_context); if (event_type != NRF_TIMER_EVENT_COMPARE0) { diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 36993db936..7f818b226c 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -55,6 +55,22 @@ //| w.feed()""" //| +const mp_obj_type_t mp_type_WatchDogTimeout = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimeout, + .make_new = mp_obj_exception_make_new, + .attr = mp_obj_exception_attr, + .parent = &mp_type_Exception, +}; + +mp_obj_exception_t mp_watchdog_timeout_exception = { + .base.type = &mp_type_WatchDogTimeout, + .traceback_alloc = 0, + .traceback_len = 0, + .traceback_data = NULL, + .args = (mp_obj_tuple_t*)&mp_const_empty_tuple_obj, +}; + STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, diff --git a/shared-bindings/watchdog/__init__.h b/shared-bindings/watchdog/__init__.h index 7203b8aa51..b5a0ad71d1 100644 --- a/shared-bindings/watchdog/__init__.h +++ b/shared-bindings/watchdog/__init__.h @@ -28,5 +28,7 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H extern const mp_obj_module_t watchdog_module; +extern mp_obj_exception_t mp_watchdog_timeout_exception; +extern const mp_obj_type_t mp_type_WatchDogTimeout; #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG___INIT___H diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index ba12e1e8c7..23516799fa 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -44,6 +44,13 @@ static volatile uint64_t PLACE_IN_DTCM_BSS(background_ticks); #include "shared-bindings/microcontroller/__init__.h" +#if CIRCUITPY_WATCHDOG +#include "shared-bindings/watchdog/__init__.h" +#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) +#else +#define WATCHDOG_EXCEPTION_CHECK() 0 +#endif + void supervisor_tick(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); @@ -86,13 +93,6 @@ void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { run_background_tasks(); } -#ifdef CIRCUITPY_WATCHDOG -extern mp_obj_exception_t mp_watchdog_timeout_exception; -#define WATCHDOG_EXCEPTION_CHECK() (MP_STATE_VM(mp_pending_exception) == &mp_watchdog_timeout_exception) -#else -#define WATCHDOG_EXCEPTION_CHECK() 0 -#endif - void mp_hal_delay_ms(mp_uint_t delay) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. From 5edc29c6a592fc70f6d273dc89c3dd1be8afcb13 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 19:34:54 +0800 Subject: [PATCH 703/919] nrf: microcontroller: use port reset path For `microcontroller.reset()`, don't manually call NVIC_SystemReset(). Instead, call the `port_reset()` in case the port wants to do any cleanup. Signed-off-by: Sean Cross --- ports/nrf/common-hal/microcontroller/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index 187b46ad1b..cc5f2a285a 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -94,7 +94,7 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { void common_hal_mcu_reset(void) { filesystem_flush(); - NVIC_SystemReset(); + reset_cpu(); } // The singleton microcontroller.Processor object, bound to microcontroller.cpu From daf7c2857da3f0cc61f20474bdd1ce2824cb409c Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 19:36:05 +0800 Subject: [PATCH 704/919] nrf: port: save rtc value across reboots As part of the reset process, save the current tick count to an uninitialized memory location. That way, the current tick value will be preserved across reboots. A reboot will cause us to lose a certain number of ticks, depending on how long a reboot takes, however if reboots are infrequent then this will not be a large amount of time lost. Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 9fe72905c6..5c76f6aa11 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -78,13 +78,19 @@ const nrfx_rtc_config_t rtc_config = { .interrupt_priority = 6 }; -static volatile uint64_t overflowed_ticks = 0; +#define OVERFLOW_CHECK_PREFIX 0x2cad564f +#define OVERFLOW_CHECK_SUFFIX 0x11343ef7 +static volatile struct { + uint32_t prefix; + uint64_t overflowed_ticks; + uint32_t suffix; +} overflow_tracker __attribute__((section(".uninitialized"))); void rtc_handler(nrfx_rtc_int_type_t int_type) { if (int_type == NRFX_RTC_INT_OVERFLOW) { // Our RTC is 24 bits and we're clocking it at 32.768khz which is 32 (2 ** 5) subticks per // tick. - overflowed_ticks += (1L<< (24 - 5)); + overflow_tracker.overflowed_ticks += (1L<< (24 - 5)); } else if (int_type == NRFX_RTC_INT_TICK && nrfx_rtc_counter_get(&rtc_instance) % 32 == 0) { // Do things common to all ports when the tick occurs supervisor_tick(); @@ -101,6 +107,17 @@ void tick_init(void) { nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); nrfx_rtc_enable(&rtc_instance); nrfx_rtc_overflow_enable(&rtc_instance, true); + + // If the check prefix and suffix aren't correct, then the structure + // in memory isn't correct and the clock will be wildly wrong. Initialize + // the prefix and suffix so that we know the value is correct, and reset + // the time to 0. + if (overflow_tracker.prefix != OVERFLOW_CHECK_PREFIX || + overflow_tracker.suffix != OVERFLOW_CHECK_SUFFIX) { + overflow_tracker.prefix = OVERFLOW_CHECK_PREFIX; + overflow_tracker.suffix = OVERFLOW_CHECK_SUFFIX; + overflow_tracker.overflowed_ticks = 0; + } } safe_mode_t port_init(void) { @@ -205,6 +222,10 @@ void reset_to_bootloader(void) { } void reset_cpu(void) { + // We're getting ready to reset, so save the counter off. + // This counter will get reset to zero during the reboot. + uint32_t ticks = nrfx_rtc_counter_get(&rtc_instance); + overflow_tracker.overflowed_ticks += ticks; NVIC_SystemReset(); } @@ -248,7 +269,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { if (subticks != NULL) { *subticks = (rtc % 32); } - return overflowed_ticks + rtc / 32; + return overflow_tracker.overflowed_ticks + rtc / 32; } // Enable 1/1024 second tick. From 33001f4e19ab0e6117713e7e27d8b6b31b314e9d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 22 May 2020 20:31:47 +0800 Subject: [PATCH 705/919] nrf: simmel: shrink filesystem to fit watchdog timer The watchdog timer has increased the amount of code and text that's required. Signed-off-by: Sean Cross --- ports/nrf/boards/simmel/mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index bcffb40ea5..28c4ee7d93 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -40,7 +40,7 @@ #endif #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (80*1024) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (76*1024) #define BOOTLOADER_SIZE (0x4000) // 12 kiB #define CIRCUITPY_BLE_CONFIG_SIZE (12*1024) From d0f1b59be54ddd574bdd15a0dd459c74038a5417 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 10:18:35 +0800 Subject: [PATCH 706/919] nrf: pca10100: disable some unused features to shrink image This removes some features that are largely unused in order to get the image to fit. Recommended in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632859678 Signed-off-by: Sean Cross --- ports/nrf/boards/pca10100/mpconfigboard.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 1206c8fe59..715b65e63e 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -8,9 +8,13 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BUSIO = 1 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 @@ -20,6 +24,8 @@ CIRCUITPY_RTC = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 +SUPEROPT_GC = 0 + # These defines must be overridden before mpconfigboard.h is included, which is # why they are passed on the command line. CFLAGS += -DSPIM3_BUFFER_SIZE=0 -DSOFTDEVICE_RAM_SIZE='(32*1024)' From 296ba101ec8895720012660e36c4e34246b6b1b2 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 11:17:11 +0800 Subject: [PATCH 707/919] nrf: set WDT priority to 2 The previous setting of `1` meant that the bluetooth system couldn't be used when the watchdog timer was enabled. Signed-off-by: Sean Cross --- ports/nrf/nrfx_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index 2dcdba14c6..b528a6032b 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -127,6 +127,6 @@ #define NRFX_WDT0_ENABLED 1 // This IRQ indicates the system will reboot shortly, so give // it a high priority. -#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 1 +#define NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY 2 #endif // NRFX_CONFIG_H__ From e470376c126828c768dfbcf25430869e8bc2b021 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 23 May 2020 11:26:27 +0800 Subject: [PATCH 708/919] nrf: add ticks (not subticks) to overflow count during reset Signed-off-by: Sean Cross --- ports/nrf/supervisor/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 5c76f6aa11..aee2d63e1d 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -225,7 +225,7 @@ void reset_cpu(void) { // We're getting ready to reset, so save the counter off. // This counter will get reset to zero during the reboot. uint32_t ticks = nrfx_rtc_counter_get(&rtc_instance); - overflow_tracker.overflowed_ticks += ticks; + overflow_tracker.overflowed_ticks += ticks / 32; NVIC_SystemReset(); } From dbf1bef56ab3a7ce73388c9833c9aa5a4074eb24 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 10:21:43 +0800 Subject: [PATCH 709/919] watchdog: support catching the timeout With this patch, the exception can now be caught: import microcontroller import watchdog import time wdt = microcontroller.watchdog wdt.timeout = 5 while True: wdt.mode = watchdog.WatchDogMode.RAISE print("Starting loop -- should exit after five seconds") try: while True: time.sleep(10) # pass # This also works for a spinloop except watchdog.WatchDogTimeout as e: print("Watchdog Expired (PASS)") except Exception as e: print("Other exception (FAIL)") print("Exited loop") This prints: Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Signed-off-by: Sean Cross --- shared-bindings/watchdog/__init__.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 7f818b226c..d0704b7cf7 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -74,6 +74,7 @@ mp_obj_exception_t mp_watchdog_timeout_exception = { STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_watchdog) }, { MP_ROM_QSTR(MP_QSTR_WatchDogMode), MP_ROM_PTR(&watchdog_watchdogmode_type) }, + { MP_ROM_QSTR(MP_QSTR_WatchDogTimeout), MP_ROM_PTR(&mp_type_WatchDogTimeout) }, }; STATIC MP_DEFINE_CONST_DICT(watchdog_module_globals, watchdog_module_globals_table); From aac5a4f178f311eb2aaf7d58135e9df49f80f7c4 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 11:25:24 +0800 Subject: [PATCH 710/919] watchdog: use common_hal_watchdog_* pattern This pulls all common functionality into `shared-bindings` and keeps platform-specific code inside `nrf`. Additionally, this performs most validation in the `shared-bindings` site. The only validation that occurs inside platform-specific `common-hal` code is related to timeout limits that are platform-specific. Additionally, all documentation is now inside the `shared-bindings` directory. Signed-off-by: Sean Cross --- .../nrf/common-hal/microcontroller/__init__.c | 1 - ports/nrf/common-hal/watchdog/WatchDogTimer.c | 233 ++++-------------- ports/nrf/common-hal/watchdog/WatchDogTimer.h | 17 +- shared-bindings/watchdog/WatchDogMode.c | 32 ++- shared-bindings/watchdog/WatchDogMode.h | 4 +- shared-bindings/watchdog/WatchDogTimer.c | 172 +++++++++++++ shared-bindings/watchdog/WatchDogTimer.h | 19 +- 7 files changed, 270 insertions(+), 208 deletions(-) diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index cc5f2a285a..f5caf68ef8 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -123,7 +123,6 @@ watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { .type = &watchdog_watchdogtimer_type, }, .timeout = 0.0f, - .sleep = false, .mode = WATCHDOGMODE_NONE, }; #endif diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 32af258663..bec0ac4732 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -69,88 +69,46 @@ STATIC void watchdogtimer_timer_event_handler(nrf_timer_event_t event_type, void #endif } -// This function is called if the timer expires. The system will reboot in 1/16384 of a second. -// Issue a reboot ourselves so we can do any cleanup necessary. +static void timer_free(void) { + timer_refcount--; + if (timer_refcount == 0) { + nrf_peripherals_free_timer(timer); + timer = NULL; + } +} + +// This function is called if the timer expires. The system will reboot +// in 1/16384 of a second. Issue a reboot ourselves so we can do any +// cleanup necessary. STATIC void watchdogtimer_watchdog_event_handler(void) { reset_cpu(); } -//| def feed(self): -//| """Feed the watchdog timer. This must be called regularly, otherwise -//| the timer will expire.""" -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - +void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { if (self->mode == WATCHDOGMODE_RESET) { nrfx_wdt_feed(&wdt); } else if (self->mode == WATCHDOGMODE_RAISE) { nrfx_timer_clear(timer); - } else if (self->mode == WATCHDOGMODE_NONE) { - mp_raise_ValueError(translate("WatchDogTimer is not currently running")); } - return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); -//| def deinit(self): -//| """Stop the watchdog timer. This may raise an error if the watchdog -//| timer cannot be disabled on this platform.""" -//| ... -//| -STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - self->mode = WATCHDOGMODE_NONE; - } else if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); +void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { + if (timer) { + timer_free(); } - - return mp_const_none; + self->mode = WATCHDOGMODE_NONE; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); void watchdog_reset(void) { - if (common_hal_mcu_watchdogtimer_obj.mode == WATCHDOGMODE_RAISE) { - common_hal_mcu_watchdogtimer_obj.mode = WATCHDOGMODE_NONE; - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - } + common_hal_watchdog_deinit(&common_hal_mcu_watchdogtimer_obj); } -//| timeout: float = ... -//| """The maximum number of seconds that can elapse between calls -//| to feed()""" -//| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - return mp_obj_new_float(self->timeout); +mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) { + return self->timeout; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); -STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_float_t timeout = mp_obj_get_float(timeout_obj); - - if (timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - - if (self->mode == WATCHDOGMODE_RESET) { - // If the WatchDogTimer is already running in "RESET" mode, raise an error - // since the mode cannot be changed once started. - mp_raise_TypeError(translate("cannot change the timeout once mode is WatchDogMode.RESET")); - } else if (self->mode == WATCHDOGMODE_RAISE) { +void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t timeout) { + if (self->mode == WATCHDOGMODE_RAISE) { // If the WatchDogTimer is already running in "RAISE" mode, reset the timer // with the new value. uint64_t ticks = timeout * 31250ULL; @@ -162,108 +120,42 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ } self->timeout = timeout; - return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); -const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -//| mode: watchdog.WatchDogMode = ... -//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. -//| -//| Setting a WatchDogMode activates the WatchDog:: -//| -//| import microcontroller -//| import watchdog -//| -//| w = microcontroller.watchdog -//| w.timeout = 5 -//| w.mode = watchdog.WatchDogMode.RAISE -//| -//| -//| Once set, the WatchDogTimer will perform the specified action if the timer expires. -//| -STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - switch (self->mode) { - case WATCHDOGMODE_NONE: default: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_none_obj); - case WATCHDOGMODE_RAISE: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); - case WATCHDOGMODE_RESET: return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); - } +watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self) { + return self->mode; } -MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); -STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { - watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); - watchdog_watchdogmode_obj_t *mode = MP_OBJ_TO_PTR(mode_obj); - if (mode == MP_ROM_PTR(&watchdog_watchdogmode_none_obj)) { - if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_TypeError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); +void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t new_mode) { + watchdog_watchdogmode_t current_mode = self->mode; + + if (new_mode == WATCHDOGMODE_RAISE) { + if (timer_refcount == 0) { + timer = nrf_peripherals_allocate_timer_or_throw(); } - else if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } - } - self->mode = WATCHDOGMODE_NONE; + timer_refcount++; - } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { - if (self->timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_ValueError(translate("WatchDogTimer mode cannot be changed once set to WatchDogMode.RESET")); - } - else if (self->mode == WATCHDOGMODE_NONE || self->mode == WATCHDOGMODE_RAISE) { - if (timer_refcount == 0) { - timer = nrf_peripherals_allocate_timer_or_throw(); - } - if (timer == NULL) { - mp_raise_RuntimeError(translate("timer was null")); - } - timer_refcount++; + nrfx_timer_config_t timer_config = { + .frequency = NRF_TIMER_FREQ_31250Hz, + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_32, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = self, + }; - nrfx_timer_config_t timer_config = { - .frequency = NRF_TIMER_FREQ_31250Hz, - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = self, - }; + nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); - nrfx_timer_init(timer, &timer_config, &watchdogtimer_timer_event_handler); - - uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); - if (ticks > UINT32_MAX) { - mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); - } - - // true enables interrupt. - nrfx_timer_clear(timer); - nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); - nrfx_timer_resume(timer); - } - self->mode = WATCHDOGMODE_RAISE; - - } else if (mode == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { - if (self->timeout <= 0) { - mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); - } - if (self->mode == WATCHDOGMODE_RAISE) { - timer_refcount--; - if (timer_refcount == 0) { - nrf_peripherals_free_timer(timer); - timer = NULL; - } + uint64_t ticks = nrfx_timer_ms_to_ticks(timer, self->timeout * 1000); + if (ticks > UINT32_MAX) { + mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); } + // true enables interrupt. + nrfx_timer_clear(timer); + nrfx_timer_compare(timer, NRF_TIMER_CC_CHANNEL0, ticks, true); + nrfx_timer_resume(timer); + + } else if (new_mode == WATCHDOGMODE_RESET) { uint64_t ticks = self->timeout * 1000.0f; if (ticks > UINT32_MAX) { mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value")); @@ -286,31 +178,12 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m } nrfx_wdt_enable(&wdt); nrfx_wdt_feed(&wdt); - self->mode = WATCHDOGMODE_RESET; } - return mp_const_none; + // If we just switched away from RAISE, disable the timmer. + if (current_mode == WATCHDOGMODE_RAISE && new_mode != WATCHDOGMODE_RAISE) { + timer_free(); + } + + self->mode = new_mode; } -MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); - -const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, - (mp_obj_t)&mp_const_none_obj}, -}; - -STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, - { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); - -const mp_obj_type_t watchdog_watchdogtimer_type = { - { &mp_type_type }, - .name = MP_QSTR_WatchDogTimer, - // .make_new = watchdog_watchdogtimer_make_new, - .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, -}; diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.h b/ports/nrf/common-hal/watchdog/WatchDogTimer.h index f5ea453ccb..8d6df934e4 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.h +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.h @@ -28,16 +28,17 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H #include "py/obj.h" -#include "shared-bindings/watchdog/WatchDogTimer.h" #include "shared-bindings/watchdog/WatchDogMode.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" -typedef struct _watchdog_watchdogtimer_obj_t { - mp_obj_base_t base; - mp_float_t timeout; - bool sleep; - watchdog_watchdogmode_t mode; -} watchdog_watchdogtimer_obj_t; +struct _watchdog_watchdogtimer_obj_t { + mp_obj_base_t base; + mp_float_t timeout; + watchdog_watchdogmode_t mode; +}; +// This needs to be called in order to disable the watchdog if it's set to +// "RAISE". If set to "RESET", then the watchdog cannot be reset. void watchdog_reset(void); -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index c5c4b23bc3..cc75a6ea44 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -32,11 +32,6 @@ //| def __init__(self, ): //| """Enum-like class to define the run mode of the watchdog timer.""" //| -//| NONE: Any = ... -//| """Take no action if the watchdog timer expires. -//| -//| :type watchdog.WatchDogMode:""" -//| //| RAISE: Any = ... //| """Raise an exception when the WatchDogTimer expires. //| @@ -49,10 +44,6 @@ //| const mp_obj_type_t watchdog_watchdogmode_type; -const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj = { - { &watchdog_watchdogmode_type }, -}; - const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj = { { &watchdog_watchdogmode_type }, }; @@ -61,8 +52,29 @@ const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj = { { &watchdog_watchdogmode_type }, }; +watchdog_watchdogmode_t watchdog_watchdogmode_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { + return WATCHDOGMODE_RAISE; + } else if (obj == MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)) { + return WATCHDOGMODE_RESET; + } + return WATCHDOGMODE_NONE; +} + +mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) { + switch (mode) { + case WATCHDOGMODE_RAISE: + return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_raise_obj); + case WATCHDOGMODE_RESET: + return (mp_obj_t)MP_ROM_PTR(&watchdog_watchdogmode_reset_obj); + case WATCHDOGMODE_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&watchdog_watchdogmode_none_obj)}, + {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&mp_const_none_obj)}, {MP_ROM_QSTR(MP_QSTR_RAISE), MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)}, {MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)}, }; diff --git a/shared-bindings/watchdog/WatchDogMode.h b/shared-bindings/watchdog/WatchDogMode.h index 77bf58db63..68022671fb 100644 --- a/shared-bindings/watchdog/WatchDogMode.h +++ b/shared-bindings/watchdog/WatchDogMode.h @@ -37,10 +37,12 @@ typedef enum { const mp_obj_type_t watchdog_watchdogmode_type; +watchdog_watchdogmode_t watchdog_watchdogmode_obj_to_type(mp_obj_t obj); +mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode); + typedef struct { mp_obj_base_t base; } watchdog_watchdogmode_obj_t; -extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_none_obj; extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_raise_obj; extern const watchdog_watchdogmode_obj_t watchdog_watchdogmode_reset_obj; diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index e69de29bb2..5411d0bef5 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -0,0 +1,172 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore 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 +#include + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "common-hal/watchdog/WatchDogTimer.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/watchdog/__init__.h" +#include "shared-bindings/watchdog/WatchDogTimer.h" + +#include "supervisor/port.h" + +//| def feed(self): +//| """Feed the watchdog timer. This must be called regularly, otherwise +//| the timer will expire.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_feed(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + + if (current_mode == WATCHDOGMODE_NONE) { + mp_raise_ValueError(translate("WatchDogTimer is not currently running")); + } + common_hal_watchdog_feed(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_feed_obj, watchdog_watchdogtimer_feed); + +//| def deinit(self): +//| """Stop the watchdog timer. This may raise an error if the watchdog +//| timer cannot be disabled on this platform.""" +//| ... +//| +STATIC mp_obj_t watchdog_watchdogtimer_deinit(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + + if (current_mode == WATCHDOGMODE_RESET) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); + } + + common_hal_watchdog_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_deinit_obj, watchdog_watchdogtimer_deinit); + +//| timeout: float = ... +//| """The maximum number of seconds that can elapse between calls +//| to feed()""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_timeout(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_float(common_hal_watchdog_get_timeout(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_timeout_obj, watchdog_watchdogtimer_obj_get_timeout); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + mp_float_t timeout = mp_obj_get_float(timeout_obj); + + if (timeout <= 0) { + mp_raise_ValueError(translate("watchdog timeout must be greater than 0")); + } + + common_hal_watchdog_set_timeout(self, timeout); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); + +const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| mode: watchdog.WatchDogMode = ... +//| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. +//| +//| Setting a WatchDogMode activates the WatchDog:: +//| +//| import microcontroller +//| import watchdog +//| +//| w = microcontroller.watchdog +//| w.timeout = 5 +//| w.mode = watchdog.WatchDogMode.RAISE +//| +//| +//| Once set, the WatchDogTimer will perform the specified action if the timer expires.""" +//| +STATIC mp_obj_t watchdog_watchdogtimer_obj_get_mode(mp_obj_t self_in) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + return watchdog_watchdogmode_type_to_obj(common_hal_watchdog_get_mode(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(watchdog_watchdogtimer_get_mode_obj, watchdog_watchdogtimer_obj_get_mode); + +STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t mode_obj) { + watchdog_watchdogtimer_obj_t *self = MP_OBJ_TO_PTR(self_in); + watchdog_watchdogmode_t current_mode = common_hal_watchdog_get_mode(self); + watchdog_watchdogmode_t new_mode = watchdog_watchdogmode_obj_to_type(mode_obj); + mp_float_t current_timeout = common_hal_watchdog_get_timeout(self); + + // When setting the mode, the timeout value must be greater than zero + if (new_mode == WATCHDOGMODE_RESET || new_mode == WATCHDOGMODE_RAISE) { + if (current_timeout <= 0) { + mp_raise_ValueError(translate("WatchDogTimer.timeout must be greater than 0")); + } + } + + // Don't allow changing the mode once the watchdog timer has been started + if (current_mode == WATCHDOGMODE_RESET && new_mode != WATCHDOGMODE_RESET) { + mp_raise_TypeError(translate("WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET")); + } + + common_hal_watchdog_set_mode(self, new_mode); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); + +const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&watchdog_watchdogtimer_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&watchdog_watchdogtimer_timeout_obj) }, + { MP_ROM_QSTR(MP_QSTR_mode), MP_ROM_PTR(&watchdog_watchdogtimer_mode_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogtimer_locals_dict, watchdog_watchdogtimer_locals_dict_table); + +const mp_obj_type_t watchdog_watchdogtimer_type = { + { &mp_type_type }, + .name = MP_QSTR_WatchDogTimer, + // .make_new = watchdog_watchdogtimer_make_new, + .locals_dict = (mp_obj_dict_t*)&watchdog_watchdogtimer_locals_dict, +}; diff --git a/shared-bindings/watchdog/WatchDogTimer.h b/shared-bindings/watchdog/WatchDogTimer.h index 375ca653d7..48044748a9 100644 --- a/shared-bindings/watchdog/WatchDogTimer.h +++ b/shared-bindings/watchdog/WatchDogTimer.h @@ -28,17 +28,20 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_WATCHDOG_WATCHDOGTIMER_H #include +#include "shared-bindings/watchdog/WatchDogMode.h" -// extern void common_hal_wdt_init(uint32_t duration, bool pause_during_sleep); -// extern void common_hal_wdt_feed(void); -// extern void common_hal_wdt_disable(void); +typedef struct _watchdog_watchdogtimer_obj_t watchdog_watchdogtimer_obj_t; +extern void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self); -// typedef struct _wdt_wdt_obj_t { -// mp_obj_base_t base; -// uint32_t timeout; -// bool sleep; -// } wdt_wdt_obj_t; +extern void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t); +extern watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self); + +extern void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t timeout); +extern mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self); + +extern void common_hal_watchdog_enable(watchdog_watchdogtimer_obj_t *self); +extern void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self); extern const mp_obj_type_t watchdog_watchdogtimer_type; From aa0445228ba79ac042e2802ae9f1a5e71b9a3ed6 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 27 May 2020 11:38:38 +0800 Subject: [PATCH 711/919] locale: generate strings for watchdog timer Run `make translate` to generate strings for `shared-bindings/watchdog`. Signed-off-by: Sean Cross --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/circuitpython.pot | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/en_US.po | 30 +++++++++++++++++++++++++++++- locale/en_x_pirate.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 30 +++++++++++++++++++++++++++++- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 16 files changed, 464 insertions(+), 16 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8bd3851673..ba2662201f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1662,6 +1662,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3049,6 +3069,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3204,6 +3228,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index b0d766a97b..4201850311 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index de98ac4fc1..8160156995 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 56615c6363..fe738d62a3 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German 0" msgstr "value_count muss größer als 0 sein" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 887bf90402..638e70f66a 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -1645,6 +1645,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3024,6 +3044,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3178,6 +3202,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index ccd05e59d7..fa94bfa1fa 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/es.po b/locale/es.po index d3af180035..a2dcdbd113 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" @@ -1664,6 +1664,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3067,6 +3087,10 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3221,6 +3245,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index c3b5070aa2..3593fa7e94 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1672,6 +1672,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3079,6 +3099,10 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3234,6 +3258,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 9cd5a7cb64..c9b5bf74af 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French 0" msgstr "'value_count' doit être > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" diff --git a/locale/it_IT.po b/locale/it_IT.po index f94a03aee6..5a4e3ac5a5 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1681,6 +1681,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3086,6 +3106,10 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3241,6 +3265,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index f85a4356a4..29f825397b 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1650,6 +1650,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3029,6 +3049,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3183,6 +3207,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index bab9e30793..d1477d83dd 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -1689,6 +1689,26 @@ msgstr "Voltage lees time-out" msgid "WARNING: Your code filename has two extensions\n" msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3073,6 +3093,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3227,6 +3251,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 10716998a7..a5064d6bdf 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1650,6 +1650,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3035,6 +3055,10 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3189,6 +3213,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 21293c4977..d0d81bccba 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1663,6 +1663,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3047,6 +3067,10 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3202,6 +3226,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index c95e36f963..25f8f34da6 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1686,6 +1686,26 @@ msgstr "Avläsning av spänning tog för lång tid" msgid "WARNING: Your code filename has two extensions\n" msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3081,6 +3101,10 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout måste vara 0.0-100.0 sekunder" @@ -3235,6 +3259,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window måste vara <= interval" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 72e5d88cf5..19b79f2c53 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:28+0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1673,6 +1673,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3065,6 +3085,10 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" @@ -3219,6 +3243,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" From 4e22b9a3464bbace0d0cd6d51bf2afaf40cd5722 Mon Sep 17 00:00:00 2001 From: dherrada <=> Date: Wed, 27 May 2020 11:30:51 -0400 Subject: [PATCH 712/919] Better keyerror handling --- tools/extract_pyi.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index f0c45dab65..d749d202b3 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -54,24 +54,24 @@ def convert_folder(top_level, stub_directory): try: tree = astroid.parse(stub_contents) for i in tree.body: - print(i.__dict__['name']) - for j in i.body: - if isinstance(j, astroid.scoped_nodes.FunctionDef): - if None in j.args.__dict__['annotations']: - print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") - if j.returns: - if 'Any' in j.returns.__dict__.values(): - print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") - elif isinstance(j, astroid.node_classes.AnnAssign): - if 'Any' == j.__dict__['annotation'].__dict__['name']: - print(f"missing attribute type on line {j.__dict__['lineno']}") + if 'name' in i.__dict__: + print(i.__dict__['name']) + for j in i.body: + if isinstance(j, astroid.scoped_nodes.FunctionDef): + if None in j.args.__dict__['annotations']: + print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n") + if j.returns: + if 'Any' in j.returns.__dict__.values(): + print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}") + elif isinstance(j, astroid.node_classes.AnnAssign): + if 'name' in j.__dict__['annotation'].__dict__: + if j.__dict__['annotation'].__dict__['name'] == 'Any': + print(f"missing attribute type on line {j.__dict__['lineno']}") ok += 1 except astroid.exceptions.AstroidSyntaxError as e: e = e.__cause__ traceback.print_exception(type(e), e, e.__traceback__) - except KeyError: - print("Function does not have a key: Name") print() return ok, total From 53fb699436739891988bdbd0f1a6546fc1f67859 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:45:15 -0400 Subject: [PATCH 713/919] Add pin resetting across boards, fix array size detection issue --- ports/mimxrt10xx/common-hal/busio/I2C.c | 107 +++++++++++++----- ports/mimxrt10xx/common-hal/busio/I2C.h | 4 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 34 +++++- ports/mimxrt10xx/common-hal/busio/UART.c | 24 +++- .../common-hal/microcontroller/Pin.c | 1 + .../mimxrt10xx/MIMXRT1011/periph.c | 6 +- .../mimxrt10xx/MIMXRT1011/periph.h | 6 + .../mimxrt10xx/MIMXRT1021/periph.c | 6 +- .../mimxrt10xx/MIMXRT1021/periph.h | 6 + .../mimxrt10xx/MIMXRT1062/periph.c | 6 +- .../mimxrt10xx/MIMXRT1062/periph.h | 6 + ports/stm/common-hal/busio/SPI.c | 20 ++-- 12 files changed, 165 insertions(+), 61 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 0bb7dcc6c6..0ac3678680 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -27,15 +27,32 @@ #include +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/I2C.h" #include "py/mperrno.h" #include "py/runtime.h" #include "periph.h" #include "fsl_lpi2c.h" +#include "fsl_gpio.h" #define I2C_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllClk) / 8 / (1+CLOCK_GetDiv(kCLOCK_Lpi2cDiv))) +#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U +//arrays use 0 based numbering: I2C1 is stored at index 0 +#define MAX_I2C 4 +STATIC bool reserved_i2c[MAX_I2C]; +STATIC bool never_reset_i2c[MAX_I2C]; + +void i2c_reset(void) { + for(uint i = 0; i < MP_ARRAY_SIZE(mcu_i2c_banks); i++) { + if (!never_reset_i2c[i]) { + reserved_i2c[i] = false; + LPI2C_MasterDeinit(mcu_i2c_banks[i]); + } + } +} static void config_periph_pin(const mcu_periph_obj_t *periph) { IOMUXC_SetPinMux( @@ -56,11 +73,49 @@ static void config_periph_pin(const mcu_periph_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } +static void i2c_check_pin_config(const mcu_pin_obj_t *pin, uint32_t pull) +{ + IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(1) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) // Pulldown + | IOMUXC_SW_PAD_CTL_PAD_PUE(pull) // 0=nopull (keeper), 1=pull + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(1) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) { - const uint32_t sda_count = sizeof(mcu_i2c_sda_list) / sizeof(mcu_periph_obj_t); - const uint32_t scl_count = sizeof(mcu_i2c_scl_list) / sizeof(mcu_periph_obj_t); + #if CIRCUITPY_REQUIRE_I2C_PULLUPS + // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + IOMUXC_SetPinMux(sda->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + IOMUXC_SetPinMux(scl->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + i2c_check_pin_config(sda, 1); + i2c_check_pin_config(scl, 1); + const gpio_pin_config_t check_config = { kGPIO_DigitalInput, 0, kGPIO_NoIntmode }; + GPIO_PinInit(sda->gpio, sda->number, &check_config); + GPIO_PinInit(scl->gpio, scl->number, &check_config); + + common_hal_mcu_delay_us(10); + + i2c_check_pin_config(sda, 0); + i2c_check_pin_config(scl, 0); + + // We must pull up within 3us to achieve 400khz. + common_hal_mcu_delay_us(3); + + if( !GPIO_PinRead(sda->gpio, sda->number) || !GPIO_PinRead(scl->gpio, scl->number)) { + common_hal_reset_pin(sda); + common_hal_reset_pin(scl); + mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + } + #endif + + const uint32_t sda_count = MP_ARRAY_SIZE(mcu_i2c_sda_list); + const uint32_t scl_count = MP_ARRAY_SIZE(mcu_i2c_scl_list); for (uint32_t i = 0; i < sda_count; ++i) { if (mcu_i2c_sda_list[i].pin != sda) @@ -73,21 +128,21 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (mcu_i2c_scl_list[j].bank_idx != mcu_i2c_sda_list[i].bank_idx) continue; - self->sda_pin = &mcu_i2c_sda_list[i]; - self->scl_pin = &mcu_i2c_scl_list[j]; + self->sda = &mcu_i2c_sda_list[i]; + self->scl = &mcu_i2c_scl_list[j]; break; } } - if(self->sda_pin == NULL || self->scl_pin == NULL) { + if(self->sda == NULL || self->scl == NULL) { mp_raise_RuntimeError(translate("Invalid I2C pin selection")); } else { - self->i2c = mcu_i2c_banks[self->sda_pin->bank_idx - 1]; + self->i2c = mcu_i2c_banks[self->sda->bank_idx - 1]; } - config_periph_pin(self->sda_pin); - config_periph_pin(self->scl_pin); + config_periph_pin(self->sda); + config_periph_pin(self->scl); lpi2c_master_config_t config = { 0 }; LPI2C_MasterGetDefaultConfig(&config); @@ -96,34 +151,35 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, LPI2C_MasterInit(self->i2c, &config, I2C_CLOCK_FREQ); -#if CIRCUITPY_REQUIRE_I2C_PULLUPS -// if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { -// reset_pin_number(sda->number); -// reset_pin_number(scl->number); -// mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); -// } -#endif + claim_pin(self->sda->pin); + claim_pin(self->scl->pin); +} - claim_pin(self->sda_pin->pin); - claim_pin(self->scl_pin->pin); +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + never_reset_i2c[self->sda->bank_idx - 1] = true; + + common_hal_never_reset_pin(self->sda->pin); + common_hal_never_reset_pin(self->scl->pin); } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { - return self->sda_pin == NULL; + return self->sda == NULL; } void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { if (common_hal_busio_i2c_deinited(self)) { return; } + reserved_i2c[self->sda->bank_idx - 1] = false; + never_reset_i2c[self->sda->bank_idx - 1] = false; LPI2C_MasterDeinit(self->i2c); -// reset_pin_number(self->sda_pin); -// reset_pin_number(self->scl_pin); + common_hal_reset_pin(self->sda->pin); + common_hal_reset_pin(self->scl->pin); - self->sda_pin = NULL; - self->scl_pin = NULL; + self->sda = NULL; + self->scl = NULL; } bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { @@ -183,10 +239,3 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, return MP_EIO; } - -void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { -// never_reset_sercom(self->i2c_desc.device.hw); -// -// never_reset_pin_number(self->scl_pin); -// never_reset_pin_number(self->sda_pin); -} diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.h b/ports/mimxrt10xx/common-hal/busio/I2C.h index 924e108116..789f01a5f5 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.h +++ b/ports/mimxrt10xx/common-hal/busio/I2C.h @@ -37,8 +37,8 @@ typedef struct { mp_obj_base_t base; LPI2C_Type *i2c; bool has_lock; - const mcu_periph_obj_t *scl_pin; - const mcu_periph_obj_t *sda_pin; + const mcu_periph_obj_t *scl; + const mcu_periph_obj_t *sda; } busio_i2c_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 54c8d001db..23e2761143 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -25,6 +25,8 @@ * THE SOFTWARE. */ +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/SPI.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -34,6 +36,8 @@ #include +#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1)) + //arrays use 0 based numbering: SPI1 is stored at index 0 #define MAX_SPI 4 STATIC bool reserved_spi[MAX_SPI]; @@ -58,11 +62,12 @@ STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } -#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1)) - void spi_reset(void) { - for (int i = 0; i < MAX_SPI; i++) { - reserved_spi[i] = false; + for (uint i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { + if (!never_reset_spi[i]) { + reserved_spi[i] = false; + LPSPI_Deinit(mcu_spi_banks[i]); + } } } @@ -192,7 +197,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - // TODO + never_reset_spi[self->clock->bank_idx - 1] = true; + common_hal_never_reset_pin(self->clock->pin); + if (self->mosi != NULL) { + common_hal_never_reset_pin(self->mosi->pin); + } + if (self->miso != NULL) { + common_hal_never_reset_pin(self->miso->pin); + } } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { @@ -203,8 +215,20 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (common_hal_busio_spi_deinited(self)) { return; } + LPSPI_Deinit(self->spi); + reserved_spi[self->clock->bank_idx - 1] = false; + never_reset_spi[self->clock->bank_idx - 1] = false; + common_hal_reset_pin(self->clock->pin); + if (self->mosi != NULL) { + common_hal_reset_pin(self->mosi->pin); + } + if (self->miso != NULL) { + common_hal_reset_pin(self->miso->pin); + } self->clock = NULL; + self->mosi = NULL; + self->miso = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 015b0188f4..463c404f9c 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" @@ -73,6 +74,13 @@ void LPUART_UserCallback(LPUART_Type *base, lpuart_handle_t *handle, status_t st } } +void uart_reset(void) { + for(uint i = 0; i < MP_ARRAY_SIZE(mcu_uart_banks); i++) { + reserved_uart[i] = false; + LPUART_Deinit(mcu_uart_banks[i]); + } +} + void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, @@ -278,13 +286,21 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) { return; } - + if (self->rx) { + reserved_uart[self->rx->bank_idx - 1] = false; + } else { + reserved_uart[self->tx->bank_idx - 1] = false; + } + LPUART_Deinit(self->uart); - gc_free(self->ringbuf); -// reset_pin_number(self->rx); -// reset_pin_number(self->tx); + if (self->rx) { + common_hal_reset_pin(self->rx->pin); + } + if (self->tx) { + common_hal_reset_pin(self->tx->pin); + } self->rx = NULL; self->tx = NULL; diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index e75df6e609..233e66006b 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -5,6 +5,7 @@ * * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries * Copyright (c) 2019 Artur Pacholec + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index 2fed6dfc61..3e2c6972b0 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2 }; +LPI2C_Type *mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 0, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_AD_13), @@ -55,7 +55,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(2, 3, kIOMUXC_LPI2C2_SCL_SELECT_INPUT, 3, &pin_GPIO_10), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2 }; +LPSPI_Type *mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; const mcu_periph_obj_t mcu_spi_sck_list[4] = { PERIPH_PIN(1, 0, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_AD_06), @@ -81,7 +81,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[4] = { PERIPH_PIN(2, 1, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_SD_09), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4 }; +LPUART_Type *mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; const mcu_periph_obj_t mcu_uart_rx_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPUART1_RXD_SELECT_INPUT, 0, &pin_GPIO_SD_11), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index d6d4895371..3bc86f33a5 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -27,13 +27,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H +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 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 const mcu_periph_obj_t mcu_uart_rx_list[9]; extern const mcu_periph_obj_t mcu_uart_tx_list[9]; extern const mcu_periph_obj_t mcu_uart_rts_list[4]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 60f301668a..814b4120d1 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -30,7 +30,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 6, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_EMC_03), @@ -60,7 +60,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(4, 3, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_SD_B1_02), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 4, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_SD_B0_02), @@ -104,7 +104,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 4, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_EMC_35), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[16] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_07), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index ba88ef4c61..814bc5f6c3 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -28,13 +28,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H +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 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 const mcu_periph_obj_t mcu_uart_rx_list[16]; extern const mcu_periph_obj_t mcu_uart_tx_list[16]; extern const mcu_periph_obj_t mcu_uart_rts_list[10]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 9a1a4ab65c..388a1b0147 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_SD_B1_05), @@ -61,7 +61,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[9] = { PERIPH_PIN(4, 0, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_AD_B0_12), }; -LPSPI_Type *mcu_spi_banks[] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 3, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_EMC_27), @@ -105,7 +105,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 1, kIOMUXC_LPSPI4_SDI_SELECT_INPUT, 1, &pin_GPIO_B1_05), }; -LPUART_Type *mcu_uart_banks[] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[18] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_13), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 45b92f2473..35ac4fc9b7 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -27,13 +27,19 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H +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 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 const mcu_periph_obj_t mcu_uart_rx_list[18]; extern const mcu_periph_obj_t mcu_uart_tx_list[18]; extern const mcu_periph_obj_t mcu_uart_rts_list[9]; diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index d3310efe06..65eeb8ebcf 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -269,18 +269,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_spi_banks); i++) { - if (mcu_spi_banks[i] == self->handle.Instance) { - never_reset_spi[i] = true; - never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); - if (self->mosi != NULL) { - never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); - } - if (self->miso != NULL) { - never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); - } - break; - } + + never_reset_spi[self->sck->periph_index - 1] = true; + never_reset_pin_number(self->sck->pin->port, self->sck->pin->number); + if (self->mosi != NULL) { + never_reset_pin_number(self->mosi->pin->port, self->mosi->pin->number); + } + if (self->miso != NULL) { + never_reset_pin_number(self->miso->pin->port, self->miso->pin->number); } } From d06a7c467195bd3efb1cbc4aef8887160a45b6b3 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 May 2020 11:47:15 -0400 Subject: [PATCH 714/919] Correct HiiBot BlueFi USB_PID Donated a PID set for HiiBot BlueFi. --- ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk index ad477e534a..b6614f8b3f 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x0016 +USB_PID = 0x80B2 USB_PRODUCT = "HiiBot BlueFi" USB_MANUFACTURER = "HiiBot" From 1e914ac2b006079661558d5de0742aba1fc5b22e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:48:52 -0400 Subject: [PATCH 715/919] Change exception text and type --- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 54c8d001db..cede7b5bdb 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -157,7 +157,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid SPI pin selection")); + mp_raise_ValueError(translate("Invalid pins")); } } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 015b0188f4..2bec667eb7 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -143,15 +143,15 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (uart_taken) { - mp_raise_RuntimeError(translate("Hardware in use, try alternative pins")); + mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } if(self->rx == NULL && self->tx == NULL) { - mp_raise_RuntimeError(translate("Invalid UART pin selection")); + mp_raise_ValueError(translate("Invalid pins")); } if (is_onedirection && ((rts != NULL) || (cts != NULL))) { - mp_raise_RuntimeError(translate("Both RX and TX required for flow control")); + mp_raise_ValueError(translate("Both RX and TX required for flow control")); } // Filter for sane settings for RS485 From 2f6e1d85d22a575a4fb93c484749608dd34d8460 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:55:33 -0400 Subject: [PATCH 716/919] more translations --- locale/ID.po | 9 +++++---- locale/circuitpython.pot | 9 +++++---- locale/cs.po | 9 +++++---- locale/de_DE.po | 9 +++++---- locale/en_US.po | 9 +++++---- locale/en_x_pirate.po | 9 +++++---- locale/es.po | 9 +++++---- locale/fil.po | 9 +++++---- locale/fr.po | 9 +++++---- locale/it_IT.po | 9 +++++---- locale/ko.po | 9 +++++---- locale/nl.po | 9 +++++---- locale/pl.po | 9 +++++---- locale/pt_BR.po | 9 +++++---- locale/sv.po | 9 +++++---- locale/zh_Latn_pinyin.po | 9 +++++---- 16 files changed, 80 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index f181c74262..e070d0642e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -895,11 +895,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frekuensi PWM tidak valid" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 4fbe72000b..eeaaa0a7a9 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -884,11 +884,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7aecaa135c..b4cfed2a90 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -884,11 +884,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 7ed8e9aaf1..25476a7a8f 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-18 02:48+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: German \n" "Language-Team: English \n" "Language-Team: \n" @@ -893,11 +893,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frecuencia PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -973,7 +973,8 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "pines inválidos" diff --git a/locale/fil.po b/locale/fil.po index 4b1075bfef..3f0b7f97ac 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -900,11 +900,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Mali ang PWM frequency" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -980,7 +980,8 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Mali ang pins" diff --git a/locale/fr.po b/locale/fr.po index a73076e68a..aa37383af7 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" @@ -900,11 +900,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequenza PWM non valida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -982,7 +982,8 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin non validi" diff --git a/locale/ko.po b/locale/ko.po index ddd4166a8e..8e4eb76a5c 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -888,11 +888,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -968,7 +968,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index 581f66bcd5..5ee1b36646 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-19 17:08+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" @@ -904,11 +904,11 @@ msgstr "Ongeldige I2C pin selectie" msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ongeldige SPI pin selectie" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ongeldige UART pin selectie" @@ -984,7 +984,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" diff --git a/locale/pl.po b/locale/pl.po index f68b062d15..cf0e0f5648 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -889,11 +889,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Zła częstotliwość PWM" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -969,7 +969,8 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Złe nóżki" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e31fc5a58d..a0c0d9638e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -893,11 +893,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Frequência PWM inválida" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pinos inválidos" diff --git a/locale/sv.po b/locale/sv.po index dac0428fa6..3e50a34d8f 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -903,11 +903,11 @@ msgstr "Ogiltigt val av I2C-pinne" msgid "Invalid PWM frequency" msgstr "Ogiltig PWM-frekvens" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ogiltigt val av SPI-pinne" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ogiltigt val av UART-pinne" @@ -983,7 +983,8 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6bae33fc75..87b6787c30 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-26 13:09-0700\n" +"POT-Creation-Date: 2020-05-27 11:55-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -897,11 +897,11 @@ msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" msgid "Invalid PWM frequency" msgstr "Wúxiào de PWM pínlǜ" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Wúxiào de SPI yǐn jiǎo xuǎnzé" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Wúxiào de UART yǐn jiǎo xuǎnzé" @@ -977,7 +977,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" From 9a9cb2e7d31a57f148be45502fcc27e997b3239d Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 27 May 2020 11:59:13 -0400 Subject: [PATCH 717/919] fix submodule desync --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 76bf96bcb0..dc5445e2f4 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 76bf96bcb0c12ba241ee4ecc175afb257e550d19 +Subproject commit dc5445e2f45cb348a44fe24fc1be4bc8b5ba5bab From 1ed4978620091179dbb082f1848bc221eb6d09bf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 27 May 2020 10:58:21 -0700 Subject: [PATCH 718/919] Remove NONE from mode enum and doc tweaks --- shared-bindings/watchdog/WatchDogMode.c | 3 +-- shared-bindings/watchdog/WatchDogTimer.c | 14 ++++++++++++++ shared-bindings/watchdog/__init__.c | 10 +++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/shared-bindings/watchdog/WatchDogMode.c b/shared-bindings/watchdog/WatchDogMode.c index cc75a6ea44..369454c11b 100644 --- a/shared-bindings/watchdog/WatchDogMode.c +++ b/shared-bindings/watchdog/WatchDogMode.c @@ -74,14 +74,13 @@ mp_obj_t watchdog_watchdogmode_type_to_obj(watchdog_watchdogmode_t mode) { } STATIC const mp_rom_map_elem_t watchdog_watchdogmode_locals_dict_table[] = { - {MP_ROM_QSTR(MP_QSTR_NONE), MP_ROM_PTR(&mp_const_none_obj)}, {MP_ROM_QSTR(MP_QSTR_RAISE), MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)}, {MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&watchdog_watchdogmode_reset_obj)}, }; STATIC MP_DEFINE_CONST_DICT(watchdog_watchdogmode_locals_dict, watchdog_watchdogmode_locals_dict_table); STATIC void watchdog_watchdogmode_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - qstr runmode = MP_QSTR_NONE; + qstr runmode = MP_QSTR_None; if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&watchdog_watchdogmode_raise_obj)) { runmode = MP_QSTR_RAISE; } diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 5411d0bef5..52bda4c779 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -40,6 +40,20 @@ #include "supervisor/port.h" +//| class WatchDogTimer: +//| """Timer that is used to detect code lock ups and automatically reset the microcontroller +//| when one is detected. +//| +//| A lock up is detected when the watchdog hasn't been fed after a given duration. So, make +//| sure to call `feed` within the timeout. +//| """ +//| + +//| def __init__(self, ): +//| """Not currently dynamically supported. Access the sole instance through `microcontroller.watchdog`.""" +//| ... +//| + //| def feed(self): //| """Feed the watchdog timer. This must be called regularly, otherwise //| the timer will expire.""" diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index d0704b7cf7..76e6317294 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -34,18 +34,14 @@ //| //| The `watchdog` module provides support for a Watchdog Timer. This timer will reset the device //| if it hasn't been fed after a specified amount of time. This is useful to ensure the board -//| has not crashed or locked up. You can enable the watchdog timer using :class:`wdt.WDT`. -//| Note that on some platforms the watchdog timer cannot be disabled once it has been enabled. +//| has not crashed or locked up. Note that on some platforms the watchdog timer cannot be disabled +//| once it has been enabled. //| -//| The WatchDogTimer is used to restart the system when the application crashes and ends +//| The `WatchDogTimer` is used to restart the system when the application crashes and ends //| up into a non recoverable state. Once started it cannot be stopped or //| reconfigured in any way. After enabling, the application must "feed" the //| watchdog periodically to prevent it from expiring and resetting the system. //| -//| Note that this module can't be imported and used directly. The sole -//| instance of :class:`WatchDogTimer` is available at -//| :attr:`microcontroller.watchdog`. -//| //| Example usage:: //| //| from microcontroller import watchdog as w From 90571e7b7f773e0bedbb69617101f67be4128a9e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 16:43:35 -0500 Subject: [PATCH 719/919] Various doc examples: Fix the "/ 18" copypasta bug --- shared-bindings/audiobusio/I2SOut.c | 2 +- shared-bindings/audiocore/RawSample.c | 2 +- shared-bindings/audioio/AudioOut.c | 2 +- shared-bindings/audiopwmio/PWMAudioOut.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index d965aac89e..fd71a6e852 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) //| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index c0f9325e67..2eadf1fab4 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("h", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15)) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15)) //| //| dac = audioio.AudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave) diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 5748682020..9ba72bd41d 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -61,7 +61,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| dac = audioio.AudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index d6b102317f..812b7330d4 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -63,7 +63,7 @@ //| length = 8000 // 440 //| sine_wave = array.array("H", [0] * length) //| for i in range(length): -//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) +//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15) //| //| dac = audiopwmio.PWMAudioOut(board.SPEAKER) //| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000) From 3ecd8cbd20e0c230447f180c2b97834fd8eb2f8c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 20:28:58 -0500 Subject: [PATCH 720/919] locale: Restore translations lost in 357467022 Merge pull request #2931 from tannewt/esp32s2_digitalio --- locale/cs.po | 68 ++--- locale/de_DE.po | 570 ++++++++++++++++++++----------------- locale/nl.po | 744 ++++++++++++++++++++++++------------------------ 3 files changed, 716 insertions(+), 666 deletions(-) diff --git a/locale/cs.po b/locale/cs.po index b4cfed2a90..825b31509a 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-24 03:22+0000\n" +"Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Weblate 4.1-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"Kód byl dokončen. Čekám na opětovné načtení.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,65 +32,70 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Založte prosím problém s obsahem vaší jednotky CIRCUITPY na adrese\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Pro ukončení, prosím resetujte desku bez " #: py/obj.c msgid " File \"%q\"" -msgstr "" +msgstr "  Soubor \"% q\"" #: py/obj.c msgid " File \"%q\", line %d" -msgstr "" +msgstr "  Soubor \"% q\", řádek% d" #: main.c msgid " output:\n" -msgstr "" +msgstr " výstup:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "" +msgstr "%% c vyžaduje int nebo char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d adresní piny a %d rgb piny označují výšku %d, nikoli %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" -msgstr "" +msgstr "%q se nyní používá" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "%q index je mimo rozsah" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Indexy% q musí být celá čísla, nikoli% s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "Seznam% q musí být seznam" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "" +msgstr "% q musí být > = 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "% q musí být n-tice délky 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "" +msgstr "% q by měl být int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -368,10 +376,6 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Both RX and TX required for flow control" -msgstr "" - #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -805,7 +809,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -884,11 +888,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -964,8 +968,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1076,6 +1079,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "" + #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "" @@ -1238,10 +1245,6 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" @@ -1419,7 +1422,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -3066,7 +3069,8 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 25476a7a8f..9c3af7cdb9 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" -"PO-Revision-Date: 2020-05-18 02:48+0000\n" -"Last-Translator: Jeff Epler \n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-23 16:13+0000\n" +"Last-Translator: Timon \n" "Language-Team: German \n" "Language: de_DE\n" @@ -43,7 +43,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Zum Beenden setzen Sie bitte die Karte ohne " +"Zum Beenden, resete bitte das Board ohne " #: py/obj.c msgid " File \"%q\"" @@ -65,7 +65,7 @@ msgstr "%%c erwartet int oder char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -77,7 +77,7 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s" +msgstr "%q Indizes müssen Integer sein, nicht %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -96,7 +96,7 @@ msgstr "%q muss ein Tupel der Länge 2 sein" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%q sollte ein int sein" +msgstr "%q sollte ein integer sein" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -167,7 +167,7 @@ msgstr "Das Objekt '%s' unterstützt '%q' nicht" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "'%s' Objekt unterstützt keine Zuordnung von Elementen" +msgstr "'%s' Objekt unterstützt keine Zuweisung von Elementen" #: py/obj.c #, c-format @@ -186,7 +186,7 @@ msgstr "'%s' Objekt ist kein Iterator" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "'%s' object ist nicht callable" +msgstr "'%s' object ist nicht aufrufbar" #: py/runtime.c #, c-format @@ -252,7 +252,7 @@ msgstr "*x muss Zuordnungsziel sein" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", in %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -313,11 +313,11 @@ msgstr "Alle timer werden benutzt" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Bereits am anbieten (advertising)." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "AnalogIn ist an diesem Pin nicht unterstützt" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -348,11 +348,13 @@ msgstr "Array-Werte sollten aus Einzelbytes bestehen." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"Versuch einer Heap Reservierung, wenn die MicroPython-VM nicht ausgeführt " +"wird." #: main.c msgid "Auto-reload is off.\n" @@ -379,10 +381,6 @@ msgstr "Bit clock und word select müssen eine clock unit teilen" msgid "Bit depth must be multiple of 8." msgstr "Bit depth muss ein Vielfaches von 8 sein." -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Both RX and TX required for flow control" -msgstr "" - #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pins müssen Hardware Interrupts unterstützen" @@ -405,7 +403,7 @@ msgstr "Die Helligkeit ist nicht einstellbar" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Buffer + Offset zu klein %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -415,7 +413,7 @@ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "Der Puffer ist kein Byte-Array" +msgstr "Der Buffer ist kein Byte-Array." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -425,7 +423,7 @@ msgstr "Der Puffer ist zu klein" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein." +msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -433,12 +431,12 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Puffer zu groß und kann nicht reserviert werden" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer um %d Bytes zu kurz" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -448,7 +446,7 @@ msgstr "Bus pin %d wird schon benutzt" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "Der Puffer muss 16 Bytes lang sein" +msgstr "Der Puffer muss 16 Bytes lang sein." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -456,7 +454,7 @@ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" #: py/objtype.c msgid "Call super().__init__() before accessing native object." @@ -464,7 +462,7 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -483,6 +481,7 @@ msgstr "Kann Temperatur nicht holen" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Es können keine Scanantworten für erweiterte, verbindbare Anzeigen vorliegen." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" @@ -498,13 +497,13 @@ msgstr "Aufnahme in eine Datei nicht möglich" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when USB is active." -msgstr "Kann '/' nicht remounten when USB aktiv ist" +msgstr "Kann '/' nicht remounten when USB aktiv ist." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden" +msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." @@ -512,11 +511,11 @@ msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "RTS oder CTS können im RS485-Modus nicht angegeben werden" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Slice kann keine sub-klasse sein" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -529,6 +528,7 @@ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" +"Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -540,13 +540,16 @@ msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython befindet sich im abgesicherten Modus, da Sie beim Booten die " +"Reset-Taste gedrückt haben. Drücken Sie erneut, um den abgesicherten Modus " +"zu verlassen.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -574,6 +577,8 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Die Verbindung wurde getrennt und kann nicht mehr verwendet werden. " +"Erstellen Sie eine neue Verbindung." #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -589,35 +594,35 @@ msgstr "Konnte UART nicht initialisieren" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Kanal konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Timer konnte nicht initialisiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Kanal konnte nicht neu initiiert werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Timer konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "PWM konnte nicht neu gestartet werden" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "PWM konnte nicht gestartet werden" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Interrupt konnte nicht gestartet werden, RX beschäftigt" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Decoder konnte nicht zugeordnet werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -626,7 +631,7 @@ msgstr "Konnte first buffer nicht zuteilen" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Eingabepuffer konnte nicht reserviert werden" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -635,15 +640,15 @@ msgstr "Konnte second buffer nicht zuteilen" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Absturz in den HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "DAC Kanal Intialisierungs Fehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "DAC Device Init Error" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -672,7 +677,7 @@ msgstr "Gerät in Benutzung" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -691,7 +696,7 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -736,10 +741,11 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." msgstr "" +"Erweiterte Werbung (advertising) mit Scanantwort wird nicht unterstützt." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "FFT ist nur für ndarrays definiert" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -765,7 +771,7 @@ msgstr "Konnte keine RX Buffer mit %d allozieren" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Verbindung fehlgeschlagen: interner Fehler" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" @@ -773,7 +779,7 @@ msgstr "Verbindung nicht erfolgreich: timeout" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Parsen der MP3 Datei fehlgeschlagen" #: ports/nrf/sd_mutex.c #, c-format @@ -782,7 +788,7 @@ msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Interner Flash konnte nicht geschrieben werden." #: py/moduerrno.c msgid "File exists" @@ -797,6 +803,8 @@ msgstr "" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"Die Frequenz muss mit dem vorhandenen PWMOut unter Verwendung dieses Timers " +"übereinstimmen" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -816,11 +824,11 @@ msgstr "Gruppe voll" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware in benutzung, probiere alternative Pins" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -828,7 +836,7 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "I2C-Init-Fehler" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -837,7 +845,7 @@ msgstr "I2C-operation nicht unterstützt" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV muss %d Bytes lang sein" #: py/persistentcode.c msgid "" @@ -857,20 +865,20 @@ msgstr "Eingabe-/Ausgabefehler" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Unzureichende Authentifizierung" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Unzureichende Verschlüsselung" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Interner Definitionsfehler" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Interner Fehler #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -879,7 +887,7 @@ msgstr "Ungültiger %q pin" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Ungültiger ADC-Einheitenwert" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -887,11 +895,11 @@ msgstr "Ungültige BMP-Datei" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Ungültiger DAC-Pin angegeben" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Ungültige I2C-Pinauswahl" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -899,13 +907,13 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "Ungültige PWM Frequenz" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Ungültige SPI-Pin-Auswahl" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Ungültige UART-Pinauswahl" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -921,7 +929,7 @@ msgstr "Ungültige Puffergröße" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Ungültige Byteorder String" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -933,7 +941,7 @@ msgstr "Ungültige Anzahl von Kanälen" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Ungültige Richtung" +msgstr "Ungültige Richtung." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -945,11 +953,11 @@ msgstr "Ungültige format chunk size" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Ungültige Frequenz geliefert" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Ungültiger Speicherzugriff." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -979,14 +987,13 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ungültige Pins" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Ungültige Pins für PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -999,7 +1006,7 @@ msgstr "Ungültige Eigenschaften" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "Ungültiger Ausführungsmodus" +msgstr "Ungültiger Ausführungsmodus." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" @@ -1019,11 +1026,11 @@ msgstr "Ungültige wave Datei" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Ungültige Wort- / Bitlänge" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1047,11 +1054,11 @@ msgstr "Länge darf nicht negativ sein" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "MISO pin Initialisierung fehlgeschlagen" +msgstr "MISO pin Initialisierung fehlgeschlagen." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "MOSI pin Initialisierung fehlgeschlagen" +msgstr "MOSI pin Initialisierung fehlgeschlagen." #: shared-module/displayio/Shape.c #, c-format @@ -1061,10 +1068,11 @@ msgstr "Maximaler x-Wert beim Spiegeln ist %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" +"MicroPython NLR-Sprung fehlgeschlagen. Wahrscheinlich Speicherbeschädigung." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Schwerwiegender MicroPython-Fehler." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1073,7 +1081,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Fehlender MISO- oder MOSI-Pin" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1081,16 +1089,20 @@ msgstr "Muss eine %q Unterklasse sein." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Muss MISO- oder MOSI-Pin bereitstellen" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Name zu lang" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "Negativer Schritt wird nicht unterstützt" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1108,11 +1120,11 @@ msgstr "Kein DMA Kanal gefunden" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Kein MISO Pin" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Kein MOSI Pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1132,7 +1144,7 @@ msgstr "Keine Taktgeber verfügbar" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Keine Verbindung: Länge kann nicht bestimmt werden" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1157,15 +1169,15 @@ msgstr "Keine Hardwareunterstützung an diesem Pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Es wurde kein Schlüssel angegeben" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Keine langen Integer (long) unterstützt" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "An diesem Pin sind keine Timer mehr verfügbar." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1181,11 +1193,11 @@ msgstr "Keine solche Datei/Verzeichnis" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Kein Timer verfügbar" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Fehlerbehauptung für Nordic Soft Device." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1246,7 +1258,7 @@ msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus wird noch nicht unterstützt" #: py/moduerrno.c msgid "Permission denied" @@ -1260,17 +1272,13 @@ msgstr "Zugang verweigert" msgid "Pin does not have ADC capabilities" msgstr "Pin hat keine ADC Funktionalität" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "Pin muss Hardware-Interrupts unterstützen" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "PIN-Nummer bereits von EXTI reserviert" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1279,6 +1287,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"Pinbelegung verwendet %d Bytes pro Element, was mehr als die idealen %d " +"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie " +"allow_inefficient = True an den Konstruktor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1286,21 +1297,21 @@ msgstr "und alle Module im Dateisystem \n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" -msgstr "" +msgstr "Pop aus einem leeren Ps2-Puffer" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "" +msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " -"laden" +"laden." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1308,23 +1319,23 @@ msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut wird auf diesem Chip nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "RNG Init Fehler" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1338,11 +1349,11 @@ msgstr "Eine RTC wird auf diesem Board nicht unterstützt" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Fehler bei der Erzeugung von Zufallszahlen" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1362,7 +1373,7 @@ msgstr "Zu früh neu geladen" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "Der angeforderte AES-Modus wird nicht unterstützt" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1386,11 +1397,11 @@ msgstr "SDA oder SCL brauchen pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "SPI-Init-Fehler" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "SPI-Neuinitialisierungsfehler" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1403,15 +1414,15 @@ msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Scannen Sie bereits in Bearbeitung. Stoppen Sie mit stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Ausgewählter CTS-Pin ungültig" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Ausgewählter RTS-Pin ungültig" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1429,7 +1440,7 @@ msgstr "Slices werden nicht unterstützt" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Quell- und Zielbuffer müssen gleich lang sein" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1443,19 +1454,21 @@ msgstr "Die Stackgröße sollte mindestens 256 sein" msgid "Stream missing readinto() or write() method." msgstr "Stream fehlt readinto() oder write() Methode." -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Geben Sie mindestens einen UART-Pin an" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"Der CircuitPython-Heap wurde beschädigt, weil der Stapel zu klein war.\n" +"Bitte erhöhen Sie die Stapelgröße, wenn Sie wissen wie oder wenn nicht:" #: supervisor/shared/safe_mode.c msgid "" @@ -1471,51 +1484,59 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Die Spannungsversorgung des Mikrocontrollers hat den minimal Wert " +"unterschritten.\n" +"Stellen Sie sicher, dass Ihr Netzteil genug Strom bereitstellt für den " +"gesamten Stromkreis und drücken Sie Reset (nach dem Auswerfen von " +"CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" +"Das bits_per_sample des Samples stimmt nicht mit dem des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" msgstr "" +"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Kachel index außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Kachelwert außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"Zeitbeschränkung ist zu groß: Maximale Zeitbeschränkung ist %d Sekunden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." -msgstr "Zu viele Kanäle im sample" +msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Zu viele Display Busse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -1524,6 +1545,8 @@ msgstr "Zu viele displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +"Die Gesamtzahl der zu schreibenden Daten ist größer als " +"outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1535,23 +1558,23 @@ msgstr "Tuple- oder struct_time-Argument erforderlich" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "UART Buffer reservierungs Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "UART De-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "UART Init Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "UART Re-Init-Fehler" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "UART-Schreibfehler" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1567,7 +1590,7 @@ msgstr "UUID Integer-Wert muss ein Wert von 0 bis 0xffff sein" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "UUID Zeichenfolge ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" +msgstr "UUID string ist nicht 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" @@ -1607,21 +1630,21 @@ msgstr "Unerwarteter nrfx uuid-Typ" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Unbekannter Gatt-Fehler: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Unbekannter Grund." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Unbekannter Sicherheitsfehler: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Unbekannter Soft Device-Fehler: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format @@ -1635,6 +1658,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Nicht näher bezeichnetes Problem. Möglicherweise wurde die Pairing-" +"Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c msgid "Unsupported baudrate" @@ -1654,12 +1679,12 @@ msgstr "Nicht unterstützte Operation" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "Nicht unterstützter Pull-Wert" +msgstr "Nicht unterstützter Pull-Wert." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Wert Länge != Erforderliche feste Länge" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -1672,7 +1697,7 @@ msgstr "Viper-Funktionen unterstützen derzeit nicht mehr als 4 Argumente" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Zeitüberschreitung beim Lesen der Spannung" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1697,11 +1722,13 @@ msgstr "" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "Schreiben nicht unterstüzt für die Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" +"Sie befinden sich im abgesicherten Modus: Es ist etwas Unerwartetes " +"passiert.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1743,7 +1770,7 @@ msgstr "adresses ist leer" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 ist nur für Skalare und ndarrays implementiert" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1751,7 +1778,7 @@ msgstr "arg ist eine leere Sequenz" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "Das Argument argsort muss ein ndarray sein" #: py/runtime.c msgid "argument has wrong type" @@ -1768,7 +1795,7 @@ msgstr "Argument sollte '%q' sein, nicht '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "Argumente müssen ndarrays sein" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1776,7 +1803,7 @@ msgstr "Array/Bytes auf der rechten Seite erforderlich" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "Sie haben versucht argmin/argmax von einer leeren Sequenz zu bekommen" #: py/objstr.c msgid "attributes not supported yet" @@ -1784,23 +1811,23 @@ msgstr "Attribute werden noch nicht unterstützt" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0, Keine oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "Die Achse muss -1, 0 oder 1 sein" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "Die Achse muss None, 0 oder 1 sein" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "schlechter Kompilierungsmodus" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "schlechter Konvertierungsspezifizierer" #: py/objstr.c msgid "bad format string" @@ -1853,15 +1880,15 @@ msgstr "Buffer müssen gleich lang sein" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "Tasten müssen digitalio.DigitalInOut sein" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "Bytecode nicht implementiert" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "Byteorder ist kein String" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1869,7 +1896,7 @@ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "Byte-Wert außerhalb des Bereichs" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" @@ -1898,6 +1925,8 @@ msgstr "kann nur Bytecode speichern" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"Der bereits untergeordneten Klasse kann keine spezielle Methode hinzugefügt " +"werden" #: py/compile.c msgid "can't assign to expression" @@ -1988,11 +2017,13 @@ msgstr "Laden mit '%q' index nicht möglich" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "Ich kann den Wurf nicht an den gerade gestarteten Generator hängen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" +"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " +"gesendet werden" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2014,11 +2045,15 @@ msgstr "Speichern mit '%q' Index nicht möglich" msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"kann nicht von der automatischen Feldnummerierung zur manuellen " +"Feldspezifikation wechseln" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"kann nicht von der manuellen Feldspezifikation zur automatischen " +"Feldnummerierung wechseln" #: py/objtype.c msgid "cannot create '%q' instances" @@ -2039,14 +2074,15 @@ msgstr "kann keinen relativen Import durchführen" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" msgstr "" +"Array kann nicht umgeformt werden (inkompatible Eingabe- / Ausgabeform)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "Umwandlung (cast)" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "(char) Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2058,7 +2094,7 @@ msgstr "chr() arg ist nicht in range(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "Kreis kann nur in einem Elternteil registriert werden" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2067,6 +2103,7 @@ msgstr "Farbpuffer muss 3 Bytes (RGB) oder 4 Bytes (RGB + pad byte) sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" msgstr "" +"Der Farbpuffer muss ein Puffer, ein Tupel, eine Liste oder ein Int sein" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2103,27 +2140,27 @@ msgstr "Umwandlung zu Objekt" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "Convolve-Argumente müssen lineare Arrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "Convolve Argumente dürfen nicht leer sein" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "Eingabearray konnte nicht aus der Form übertragen werden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "Vandermonde-Matrix konnte nicht invertiert werden" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof muss kleiner als die Länge des Datensatzes sein" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2137,10 +2174,12 @@ msgstr "Die Standart-Ausnahmebehandlung muss als letztes sein" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " +"8 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "Der Zielpuffer muss ein Array vom Typ 'H' für bit_depth = 16 sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2148,11 +2187,11 @@ msgstr "destination_length muss ein int >= 0 sein" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "Die Wörterbuch-Aktualisierungssequenz hat eine falsche Länge" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff Argument muss ein ndarray sein" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2177,7 +2216,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" @@ -2186,7 +2225,7 @@ msgstr "end_x sollte ein int sein" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "Fehler = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -2226,23 +2265,23 @@ msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expression Teil kann kein '#' beinhalten" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "Die f-String expression darf keinen Backslash enthalten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: leere expression nicht erlaubt" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: erwartet '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: einzelne '}' nicht erlaubt" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c @@ -2255,11 +2294,11 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "Das erste Argument muss iterierbar sein" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "Das erste Argument muss ein Ndarray sein" #: py/objtype.c msgid "first argument to super() must be type" @@ -2271,11 +2310,11 @@ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "Das Flip-Argument muss ein Ndarray sein" #: py/objint.c msgid "float too big" @@ -2287,7 +2326,7 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "Format erfordert ein Wörterbuch (dict)" #: py/objdeque.c msgid "full" @@ -2308,7 +2347,7 @@ msgstr "Funktion hat mehrere Werte für Argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "Die Funktion ist nur für Skalare und Ndarrays implementiert" #: py/argcheck.c #, c-format @@ -2376,7 +2415,7 @@ msgstr "padding ist inkorrekt" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "Index ist außerhalb der Grenzen" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2387,11 +2426,11 @@ msgstr "index außerhalb der Reichweite" #: py/obj.c msgid "indices must be integers" -msgstr "Indizes müssen ganze Zahlen sein" +msgstr "Indizes müssen Integer sein" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" #: py/compile.c msgid "inline assembler must be a function" @@ -2399,35 +2438,35 @@ msgstr "inline assembler muss eine function sein" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "Die Länge des Eingabearrays muss eine Potenz von 2 sein" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "Eingabedaten müssen iterierbar sein" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "Eingabematrix ist asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "Eingabematrix ist singulär" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "Die Eingabe muss eine quadratische Matrix sein" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "Die Eingabe muss Tupel, Liste, Bereich oder Ndarray sein" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "Eingabevektoren müssen gleich lang sein" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2509,11 +2548,11 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "iterables sind nicht gleich lang" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "Iterationen sind nicht konvergiert (converged)" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2545,7 +2584,7 @@ msgstr "Für diesen Typ ist length nicht zulässig" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "Der Pegel muss zwischen 0 und 1 liegen" #: py/objarray.c msgid "lhs and rhs should be compatible" @@ -2563,7 +2602,7 @@ msgstr "Lokales '%q' verwendet bevor Typ bekannt" msgid "local variable referenced before assignment" msgstr "" "Es wurde versucht auf eine Variable zuzugreifen, die es (noch) nicht gibt. " -"Variablen immer zuerst Zuweisen!" +"Variablen immer zuerst Zuweisen" #: py/objint.c msgid "long int not supported in this build" @@ -2571,7 +2610,7 @@ msgstr "long int wird in diesem Build nicht unterstützt" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "fehlformatierter f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -2579,15 +2618,15 @@ msgstr "map buffer zu klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "Mathe-Domain-Fehler" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "Matrix Dimensionen stimmen nicht überein" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "Matrix ist nicht positiv definitiv" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -2614,7 +2653,7 @@ msgstr "Modul nicht gefunden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "mehr Freiheitsgrade als Datenpunkte" #: py/compile.c msgid "multiple *x in assignment" @@ -2622,7 +2661,7 @@ msgstr "mehrere *x in Zuordnung" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "Mehrere Basen haben einen Instanzlayoutkonflikt" #: py/objtype.c msgid "multiple inheritance not supported" @@ -2630,7 +2669,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "muss ein Objekt verursachen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" @@ -2642,7 +2681,7 @@ msgstr "muss Schlüsselwortargument für key function verwenden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n muss zwischen 0 und 9 liegen" #: py/runtime.c msgid "name '%q' is not defined" @@ -2658,24 +2697,24 @@ msgstr "Name für Argumente wiederverwendet" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "native Ausbeute (yield)" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Zum Entpacken sind mehr als %d Werte erforderlich" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "Negative shift Anzahl" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "Keine aktive Ausnahme zu verusachen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" @@ -2683,7 +2722,7 @@ msgstr "kein verfügbares Netzwerkadapter (NIC)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "Kein Binding für nonlocal gefunden" #: py/builtinimport.c msgid "no module named '%q'" @@ -2700,7 +2739,7 @@ msgstr "kein solches Attribut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "non-UUID gefunden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" @@ -2712,11 +2751,11 @@ msgstr "eine nicht-hex zahl wurde gefunden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" @@ -2725,18 +2764,19 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" +"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "Nicht genügend Argumente für den Formatierungs-String" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "Die Anzahl der Argumente muss 2 oder 3 sein" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "Die Anzahl der Punkte muss mindestens 2 betragen" #: py/obj.c #, c-format @@ -2765,7 +2805,7 @@ msgstr "Objekt ist kein Iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "Objekt nicht aufrufbar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2804,19 +2844,20 @@ msgstr "nur eine sample_rate=16000 wird unterstützt" #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" +"Es werden nur Slices mit Schritt = 1 (auch bekannt als None) unterstützt" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "Operanden konnten nicht zusammen gesendet werden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "Die Operation ist für ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "Die Operation wird für den angegebenen Typ nicht unterstützt" #: py/modbuiltins.c msgid "ord expects a character" @@ -2826,7 +2867,7 @@ msgstr "ord erwartet ein Zeichen" #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" -"ord() erwartet ein Zeichen aber es wurde eine Zeichenfolge mit Länge %d " +"ord() erwartet einen Buchstaben(char) aber es wurde ein String mit Länge %d " "gefunden" #: py/objint_mpz.c @@ -2835,7 +2876,7 @@ msgstr "Überlauf beim konvertieren von long int zu machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "Die Palette muss 32 Byte lang sein" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" @@ -2851,7 +2892,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -2859,7 +2900,7 @@ msgstr "Pixelkoordinaten außerhalb der Grenzen" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "Der Pixelwert erfordert zu viele Bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" @@ -2867,7 +2908,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2894,7 +2935,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow () mit 3 Argumenten erfordert Integer" #: extmod/modutimeq.c msgid "queue overflow" @@ -2902,11 +2943,11 @@ msgstr "Warteschlangenüberlauf" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "rohe F-Strings sind nicht implementiert" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "Real- und Imaginärteile müssen gleich lang sein" #: py/builtinimport.c msgid "relative import" @@ -2923,25 +2964,25 @@ msgstr "return annotation muss ein identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "Die rechte Seite muss ein Ndarray oder ein Skalar sein" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" @@ -2965,31 +3006,31 @@ msgstr "kompilieren von Skripten nicht unterstützt" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "Form muss ein 2-Tupel sein" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "Vorzeichen mit ganzzahligem Formatbezeichner 'c' nicht erlaubt" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "einzelne '}' in Formatierungs-String gefunden" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "Größe ist nur für ndarrays definiert" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "Die Schlafdauer darf nicht negativ sein" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "Der Slice-Schritt kann nicht Null sein" #: py/objint.c py/sequence.c msgid "small int overflow" @@ -3001,7 +3042,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sortierungs Argument muss ein ndarray sein" #: py/objstr.c msgid "start/end indices" @@ -3034,7 +3075,7 @@ msgstr "String index außerhalb des Bereiches" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "String indizes müssen Integer sein, nicht %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" @@ -3075,11 +3116,11 @@ msgstr "threshold muss im Intervall 0-65536 liegen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() nimmt eine 9-Sequenz an" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3087,24 +3128,24 @@ msgstr "timeout muss >= 0.0 sein" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "zu viele Argumente mit dem angegebenen Format" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "zu viele Indizes" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "zu viele Werte zum Auspacken (erwartet %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "Tupelindex außerhalb des Bereichs" #: py/obj.c msgid "tuple/list has wrong length" @@ -3112,9 +3153,10 @@ msgstr "tupel/list hat falsche Länge" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "Tupel / Liste auf RHS erforderlich" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" @@ -3129,15 +3171,15 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "Typ akzeptiert 1 oder 3 Argumente" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong zu groß" #: py/emitnative.c msgid "unary op %q not implemented" @@ -3147,7 +3189,7 @@ msgstr "Der unäre Operator %q ist nicht implementiert" msgid "unexpected indent" msgstr "" "unerwarteter Einzug (Einrückung) Bitte Leerzeichen am Zeilenanfang " -"kontrollieren!" +"kontrollieren" #: py/bc.c msgid "unexpected keyword argument" @@ -3159,23 +3201,23 @@ msgstr "unerwartetes Keyword-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "Unicode Name ausgebrochen (escaped)" #: py/parse.c msgid "unindent does not match any outer indentation level" msgstr "" "Einrückung entspricht keiner äußeren Einrückungsebene. Bitte Leerzeichen am " -"Zeilenanfang kontrollieren!" +"Zeilenanfang kontrollieren" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "unbekannter Konvertierungs specifier %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "unbekannter Formatcode '%c' für Objekt vom Typ '%s'" #: py/compile.c msgid "unknown type" @@ -3187,7 +3229,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' ohne passende Zuordnung im Format" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -3206,12 +3248,12 @@ msgstr "nicht unterstützter Thumb-Befehl '%s' mit %d Argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "nicht unterstützte Xtensa-Anweisung '%s' mit %d Argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" @@ -3236,15 +3278,15 @@ msgstr "value_count muss größer als 0 sein" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "Fenster muss <= Intervall sein" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "falscher Argumenttyp" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "falscher Indextyp" #: py/objstr.c msgid "wrong number of arguments" @@ -3256,7 +3298,7 @@ msgstr "falsche Anzahl zu entpackender Werte" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "falscher Operandentyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" @@ -3272,7 +3314,7 @@ msgstr "y Wert außerhalb der Grenzen" #: py/objrange.c msgid "zero step" -msgstr "" +msgstr "Nullschritt" #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/nl.po b/locale/nl.po index 5ee1b36646..c0f3ddf378 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" -"PO-Revision-Date: 2020-05-19 17:08+0000\n" +"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"PO-Revision-Date: 2020-05-25 13:52+0000\n" "Last-Translator: Dustin Watts \n" "Language-Team: none\n" "Language: nl\n" @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"Om te verlatten, herstart de module zonder " +"Om te verlaten, herstart de module zonder " #: py/obj.c msgid " File \"%q\"" @@ -54,7 +54,7 @@ msgstr " Bestand \"%q\", regel %d" #: main.c msgid " output:\n" -msgstr " output\n" +msgstr " uitvoer:\n" #: py/objstr.c #, c-format @@ -143,7 +143,7 @@ msgstr "'%s' verwacht op zijn meest r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "'%s' verwacht {r0, r1, ...}" +msgstr "'%s' verwacht {r0, r1, …}" #: py/emitinlinextensa.c #, c-format @@ -378,10 +378,6 @@ msgstr "Bit clock en word select moeten een clock eenheid delen" msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." -#: ports/mimxrt10xx/common-hal/busio/UART.c -msgid "Both RX and TX required for flow control" -msgstr "" - #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pinnen moeten hardware interrupts ondersteunen" @@ -823,7 +819,7 @@ msgstr "Groep is vol" msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" @@ -904,11 +900,11 @@ msgstr "Ongeldige I2C pin selectie" msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" -#: ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ongeldige SPI pin selectie" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ongeldige UART pin selectie" @@ -984,8 +980,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1096,6 +1091,10 @@ msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" msgid "Name too long" msgstr "Naam te lang" +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Negative step not supported" +msgstr "Negatieve stappen niet ondersteund" + #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" @@ -1267,10 +1266,6 @@ msgstr "Toegang geweigerd" msgid "Pin does not have ADC capabilities" msgstr "Pin heeft geen ADC mogelijkheden" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Pin is input only" -msgstr "" - #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "Pin moet hardware interrupts ondersteunen" @@ -1296,7 +1291,7 @@ msgstr "En iedere module in het bestandssysteem\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "Polygon heeft op zijn minst 3 punten nodig" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1453,7 +1448,7 @@ msgstr "Stack grootte moet op zijn minst 256 zijn" msgid "Stream missing readinto() or write() method." msgstr "Stream mist readinto() of write() methode." -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" @@ -1523,7 +1518,7 @@ msgstr "Tile breedte moet exact de bitmap breedte verdelen" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" -msgstr "" +msgstr "Time-out is te lang. Maximale time-out lengte is %d seconden" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1814,1462 +1809,1471 @@ msgstr "verkeerde compileer modus" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "slechte conversie specificatie" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "string met verkeerde indeling" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "verkeerde typecode" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "binaire op %q niet geïmplementeerd" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "bits moet 7, 8, of 9 zijn" #: extmod/machine_spi.c msgid "bits must be 8" -msgstr "" +msgstr "bits moet 8 zijn" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sample moet 8 of 16 zijn" #: py/emitinlinethumb.c msgid "branch not in range" -msgstr "" +msgstr "pad (branch) niet binnen bereik" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "buffer moet een byte-achtig object zijn" #: shared-module/struct/__init__.c msgid "buffer size must match format" -msgstr "" +msgstr "grootte van de buffer moet overeenkomen met het formaat" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "buffer slices moeten van gelijke grootte zijn" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "buffer te klein" #: extmod/machine_spi.c msgid "buffers must be the same length" -msgstr "" +msgstr "buffers moeten dezelfde lengte hebben" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "buttons moeten digitalio.DigitalInOut zijn" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "byte code niet geïmplementeerd" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder is geen string" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" -msgstr "" +msgstr "butes > 8 niet ondersteund" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "bytes waarde buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" -msgstr "" +msgstr "calibration is buiten bereik" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is read only" -msgstr "" +msgstr "calibration is alleen-lezen" #: ports/atmel-samd/common-hal/rtc/RTC.c msgid "calibration value out of range +/-127" -msgstr "" +msgstr "calibration waarde buiten bereik +/-127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Thumb assembly geven" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "kan slechts 4 parameters aan Xtensa assembly geven" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "kan alleen byte-code opslaan" #: py/objtype.c msgid "can't add special method to already-subclassed class" msgstr "" +"kan geen speciale methode aan een al ge-subkwalificeerde klasse toevoegen" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "kan niet toewijzen aan expressie" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "kan %s niet converteren naar een complex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "kan %s niet omzetten naar een float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "kan %s niet omzetten naar een int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "kan '%q' object niet omzetten naar %q impliciet" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "kan NaN niet omzetten naar int" #: shared-bindings/i2cslave/I2CSlave.c msgid "can't convert address to int" -msgstr "" +msgstr "kan adres niet omzetten naar int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "kan inf niet omzetten naar int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "kan niet omzetten naar complex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "kan niet omzetten naar float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "kan niet omzetten naar int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "kan niet omzetten naar str impliciet" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "kan geen nonlocal in buitenste code declareren" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "kan expressie niet verwijderen" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "kan geen een binaire operatie doen tussen '%q' en '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "kan geen afgekapte deling doen van een comlex nummer" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "kan niet meerdere **x hebben" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "kan geen meerdere *x hebben" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "kan '%q niet impliciet converteren naar 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "kan niet laden van '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "kan niet met '%q' index laden" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "kan throw niet aan net gestartte generator toevoegen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" -msgstr "" +msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "kan attribute niet instellen" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "kan '%q' niet opslaan" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "kan niet naar '%q' opslaan" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "kan niet opslaan met '%q' als index" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" -msgstr "" +msgstr "kan niet schakelen tussen automatische en handmatige veld specificatie" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" -msgstr "" +msgstr "kan niet schakelen tussen handmatige en automatische veld specificatie" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "kan geen instanties van '%q' creëren" #: py/objtype.c msgid "cannot create instance" -msgstr "" +msgstr "kan geen instantie creëren" #: py/runtime.c msgid "cannot import name %q" -msgstr "" +msgstr "kan naam %q niet importeren" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "kan geen relatieve import uitvoeren" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "kan de array niet hervormen (niet verenigbare input/output vorm)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "casting" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "chars buffer te klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "chr() arg niet binnen bereik (0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "chr() arg niet binnen bereik (256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" msgstr "" +"cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "kleurbuffer moet 3 bytes (RGB) of 4 bytes (RGB + pad byte) zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "kleurbuffer moet een buffer, tuple, list, of int zijn" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "" +msgstr "kleurbuffer moet een bytearray of array van type 'b' of 'B' zijn" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" -msgstr "" +msgstr "kleur moet tussen 0x000000 en 0xffffff liggen" #: shared-bindings/displayio/ColorConverter.c msgid "color should be an int" -msgstr "" +msgstr "kleur moet een int zijn" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "complexe deling door 0" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "complexe waardes niet ondersteund" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "compressie header" #: py/parse.c msgid "constant must be an integer" -msgstr "" +msgstr "constant moet een integer zijn" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "conversie naar object" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "convolutie argumenten moeten lineaire arrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "convolutie argumenten moeten ndarrays zijn" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "convolutie argumenten mogen niet leeg zijn" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "kon de invoerarray niet vanuit vorm uitzenden" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "kon de Vandermonde matrix niet omkeren" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "ddof kleiner dan de lengte van de data set" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "decimale getallen zijn niet ondersteund" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "standaard 'expect' moet laatste zijn" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"bestemming buffer moet een bytearray of array van het type 'B' voor " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "bestemming buffer moet een array van het type 'H' voor bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" -msgstr "" +msgstr "destination_lengte moest een int groter dan of gelijk zijn aan 0 zijn" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "dict update sequence heeft de verkeerde lengte" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "diff argument moet een ndarray zijn" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c msgid "division by zero" -msgstr "" +msgstr "deling door nul" #: py/objdeque.c msgid "empty" -msgstr "" +msgstr "leeg" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "" +msgstr "lege heap" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "lege seperator" #: shared-bindings/random/__init__.c msgid "empty sequence" -msgstr "" +msgstr "lege sequentie" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "einde van format terwijl zoekend naar conversie-specifier" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" -msgstr "" +msgstr "end_x moet een int zijn" #: ports/nrf/common-hal/busio/UART.c #, c-format msgid "error = 0x%08lX" -msgstr "" +msgstr "fout = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "uitzonderingen moeten afleiden van BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "verwachtte ':' na format specifier" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "verwachtte een tuple/lijst" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "verwacht een dict voor keyword argumenten" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "verwacht een assembler instructie" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "verwacht alleen een waarde voor set" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "verwacht key:waarde for dict" #: py/argcheck.c msgid "extra keyword arguments given" -msgstr "" +msgstr "extra keyword argumenten gegeven" #: py/argcheck.c msgid "extra positional arguments given" -msgstr "" +msgstr "extra positionele argumenten gegeven" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "f-string expressie deel kan geen '#' bevatten" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "f-string expressie deel kan geen backslash bevatten" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: lege expressie niet toegestaan" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: verwacht '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: enkele '}' is niet toegestaan" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "bestand moet een bestand zijn geopend in byte modus" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" -msgstr "" +msgstr "bestandssysteem moet een mount methode bieden" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "eerst argument moet een iterabel zijn" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "eerst argument moet een ndarray zijn" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "eerste argument voor super() moet een type zijn" #: extmod/machine_spi.c msgid "firstbit must be MSB" -msgstr "" +msgstr "het eerste bit moet het MSB zijn" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "flip argumenten moeten een ndarray zijn" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "float is te groot" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "lettertype moet 2048 bytes lang zijn" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "format vereist een dict" #: py/objdeque.c msgid "full" -msgstr "" +msgstr "vol" #: py/argcheck.c msgid "function does not take keyword arguments" -msgstr "" +msgstr "functie accepteert geen keyword argumenten" #: py/argcheck.c #, c-format msgid "function expected at most %d arguments, got %d" -msgstr "" +msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "functie kreeg meedere waarden voor argument '%q'" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" -msgstr "" +msgstr "functie mist %d vereist positionele argumenten" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "functie mist keyword-only argument" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "functie mist vereist sleutelwoord argument \"%q" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "functie mist vereist positie-argument #%d" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format msgid "function takes %d positional arguments but %d were given" msgstr "" +"functie vraagt %d argumenten zonder keyword maar %d argumenten werden gegeven" #: shared-bindings/time/__init__.c msgid "function takes exactly 9 arguments" -msgstr "" +msgstr "functie vraagt precies 9 argumenten" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "generator wordt al uitgevoerd" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "generator negeerde GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "graphic moet 2048 bytes lang zijn" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "" +msgstr "heap moet een lijst zijn" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "identifier is opnieuw gedefinieerd als nonlocal" #: py/objstr.c msgid "incomplete format" -msgstr "" +msgstr "incompleet formaat" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "incomplete formaatsleutel" #: extmod/modubinascii.c msgid "incorrect padding" -msgstr "" +msgstr "vulling (padding) is onjuist" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "index is buiten bereik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" -msgstr "" +msgstr "index is buiten bereik" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "indices moeten integers zijn" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "inline assembler moet een functie zijn" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "invoerargument moet een integer of 2-tuple zijn" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "invoer array lengte moet een macht van 2 zijn" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "invoerdata moet itereerbaar zijn" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "invoermatrix is asymmetrisch" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "invoermatrix is singulier" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "invoer moet een vierkante matrix zijn" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "invoer moet een tuple, lijst, bereik of ndarray zijn" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "invoervectors moeten van gelijke lengte zijn" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() argument 2 moet >=2 en <= 36 zijn" #: py/objstr.c msgid "integer required" -msgstr "" +msgstr "integer vereist" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "interval moet binnen bereik %s-%s vallen" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" -msgstr "" +msgstr "onjuist I2C randapparaat" #: extmod/machine_spi.c msgid "invalid SPI peripheral" -msgstr "" +msgstr "onjuist SPI randapparaat" #: lib/netutils/netutils.c msgid "invalid arguments" -msgstr "" +msgstr "ongeldige argumenten" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "" +msgstr "ongeldig certificaat" #: extmod/uos_dupterm.c msgid "invalid dupterm index" -msgstr "" +msgstr "ongeldige dupterm index" #: extmod/modframebuf.c msgid "invalid format" -msgstr "" +msgstr "ongeldig formaat" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "ongeldige formaatspecificatie" #: extmod/modussl_axtls.c msgid "invalid key" -msgstr "" +msgstr "ongeldige sleutel" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "ongeldige micropython decorator" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "ongeldige stap" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "ongeldige syntax" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "ongeldige syntax voor integer" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "ongeldige syntax voor integer met grondtal %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "ongeldige syntax voor nummer" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() argument 1 moet een klasse zijn" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() argument 2 moet een klasse of tuple van klassen zijn" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "itereerbare objecten hebben niet dezelfde lengte" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "itereerbare objecten convergeren niet" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join verwacht een lijst van str/byte objecten die consistent zijn met het " +"self-object" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"trefwoord argument(en) zijn niet geïmplementeerd, gebruik normale argumenten" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "trefwoorden moeten van type string zijn" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "label '%q' is niet gedefinieerd" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "label opnieuw gedefinieerd" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "voor dit type is length niet toegestaan" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "level moet tussen 0 en 1 liggen" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "lhs en rhs moeten compatibel zijn" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "lokale '%q' is van type '%q' maar bron is '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "lokale '%q' gebruikt voordat type bekend is" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "long int wordt niet ondersteund in deze build" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "onjuist gevormde f-string" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "map buffer te klein" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "fout in het wiskundig domein (math domain error)" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "matrix afmetingen komen niet overeen" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "matrix is niet positief-definiet" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "max_length moet 0-%d zijn als fixed_length %s is" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "maximale recursiediepte overschreden" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "geheugentoewijzing mislukt, %u bytes worden toegewezen" #: py/runtime.c msgid "memory allocation failed, heap is locked" -msgstr "" +msgstr "geheugentoewijzing mislukt, heap is vergrendeld" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "module niet gevonden" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "meer vrijheidsgraden dan datapunten" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "meerdere *x in toewijzing" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "meerdere grondtallen (bases) hebben instance lay-out conflicten" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "meervoudige overerving niet ondersteund" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "moet een object oproepen (raise)" #: extmod/machine_spi.c msgid "must specify all of sck/mosi/miso" -msgstr "" +msgstr "sck/mosi/miso moeten alle gespecificeerd worden" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n moet tussen 0 en 9 liggen" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "naam '%q' is niet gedefinieerd" #: py/runtime.c msgid "name not defined" -msgstr "" +msgstr "naam is niet gedefinieerd" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "naam hergebruikt voor argument" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "natuurlijke opbrengst (native yield)" #: py/runtime.c #, c-format msgid "need more than %d values to unpack" -msgstr "" +msgstr "Om uit te pakken zijn meer dan %d waarden vereist" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "negatieve macht terwijl er geen ondersteuning is voor float" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "negatieve verschuivingstelling (shift count)" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "geen netwerkadapter (NIC) beschikbaar" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "geen binding voor nonlocal gevonden" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "geen module met naam '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "geen reset pin beschikbaar" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "niet zo'n attribuut" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "niet-UUID gevonden in service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "niet-standaard argument volgt op een standaard argument" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "er werd een niet-hexadecimaal cijfer gevonden" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "niet-trefwoord argument na */**" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "niet-trefwoord argument na trefwoord argument" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "geen 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "niet alle argumenten omgezet bij formattering van string" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "niet genoeg argumenten om string te formatteren" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "aantal argumenten moet 2 of 3 zijn" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "aantal punten moet minimaal 2 zijn" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "object '%s' is geen tuple of lijst" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "object ondersteund toewijzen van elementen niet" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "object ondersteund verwijderen van elementen niet" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "object heeft geen len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "object heeft geen '__getitem__'-methode (not subscriptable)" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "object is geen iterator" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "object niet aanroepbaar" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" -msgstr "" +msgstr "object niet in volgorde (sequence)" #: py/runtime.c msgid "object not iterable" -msgstr "" +msgstr "object niet itereerbaar" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "object van type '%s' heeft geen len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "object met buffer protocol vereist" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "string met oneven lengte" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "offset buiten bereik" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "alleen bit_depth=16 wordt ondersteund" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "alleen sample_rate=16000 wordt ondersteund" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" -msgstr "" +msgstr "alleen segmenten met step=1 (ook wel None) worden ondersteund" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "operands konden niet samen verzonden worden" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "bewerking is voor ndarrays niet geïmplementeerd" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "bewerking wordt niet ondersteund voor dit type" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "ord verwacht een teken (char)" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" -msgstr "" +msgstr "ord() verwacht een teken (char) maar vond een string van lengte %d" #: py/objint_mpz.c msgid "overflow converting long int to machine word" -msgstr "" +msgstr "overloop bij converteren van long int naar machine word" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "palette moet 32 bytes lang zijn" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index moet een int zijn" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "parameter annotatie moet een identifier zijn" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde a2 tot a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "parameters moeten registers zijn in de volgorde r0 tot r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "pixel coördinaten buiten bereik" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "pixel waarde vereist te veel bits" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "pixel_shader moet displayio.Palette of displayio.ColorConverter zijn" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" msgstr "" +"polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop van een lege PulseIn" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop van een lege set" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop van een lege lijst" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): dictionary is leeg" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "derde argument van pow() mag geen 0 zijn" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "pow() met 3 argumenten vereist integers" #: extmod/modutimeq.c msgid "queue overflow" -msgstr "" +msgstr "wachtrij overloop" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "ruwe f-strings zijn niet geïmplementeerd" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "reëel en imaginair deel moeten gelijke lengte hebben" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "relatieve import" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "gevraagde lengte is %d maar object heeft lengte %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "return annotatie moet een identifier zijn" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "return verwacht '%q' maar ontving '%q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] is hetzelfde als een andere pintoewijzing" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] bevindt zich niet op dezelfde poort als klok" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "de rechterkant moet een ndarray of scalar zijn" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(None,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"sample_source buffer moet een bytearray of array van type 'h', 'H', 'b' of " +"'B' zijn" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "" +msgstr "bemonsteringssnelheid buiten bereik" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "schedule stack is vol" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" -msgstr "" +msgstr "scriptcompilatie wordt niet ondersteund" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "vorm moet een 2-tuple zijn" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "teken niet toegestaan in string formaatspecificatie" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "teken niet toegestaan bij integer formaatspecificatie 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "enkele '}' aangetroffen in formaat tekenreeks (string)" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "omvang is alleen voor ndarrays gedefinieerd" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "de slaapduur mag niet negatief zijn" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "segmentstap mag niet nul zijn" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "small int overloop" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "zachte herstart\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "sorteerargument moet een ndarray zijn" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "start/stop indices" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" -msgstr "" +msgstr "start_x moet een int zijn" #: shared-bindings/random/__init__.c msgid "step must be non-zero" -msgstr "" +msgstr "step mag geen nul zijn" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "stop moet 1 of 2 zijn" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop is niet bereikbaar vanaf start" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "stream operatie niet ondersteund" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "string index buiten bereik" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "string indices moeten integer zijn, niet %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "string niet ondersteund; gebruik bytes of bytearray" #: extmod/moductypes.c msgid "struct: cannot index" -msgstr "" +msgstr "struct: kan niet indexeren" #: extmod/moductypes.c msgid "struct: index out of range" -msgstr "" +msgstr "struct: index buiten bereik" #: extmod/moductypes.c msgid "struct: no fields" -msgstr "" +msgstr "struct: geen velden" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "deelreeks niet gevonden" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "super() kan self niet vinden" #: extmod/modujson.c msgid "syntax error in JSON" -msgstr "" +msgstr "syntaxisfout in JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "syntaxisfout in uctypes aanduiding" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "" +msgstr "drempelwaarde moet in het bereik 0-65536 liggen" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() accepteert een 9-rij" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" -msgstr "" +msgstr "timeout moet groter dan 0.0 zijn" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "" +msgstr "timestamp buiten bereik voor platform time_t" #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" -msgstr "" +msgstr "te veel argumenten opgegeven bij dit formaat" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "te veel indices" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "te veel waarden om uit te pakken (%d verwacht)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "tuple index buiten bereik" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "tuple of lijst heeft onjuiste lengte" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "tuple of lijst vereist op RHS" -#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" -msgstr "" +msgstr "tx en rx kunnen niet beiden None zijn" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "type '%q' is geen aanvaardbaar basistype" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "type is geen aanvaardbaar basistype" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "objecttype '%q' heeft geen attribuut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "type accepteert 1 of 3 argumenten" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong te groot" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "unair op %q niet geïmplementeerd" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "onverwachte inspringing" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "onverwacht trefwoordargument" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "onverwacht trefwoordargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "op naam gebaseerde unicode escapes zijn niet geïmplementeerd" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "inspringing komt niet overeen met hoger gelegen inspringingsniveaus" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "onbekende conversiespecificatie %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "onbekende formaatcode '%c' voor object van type '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "onbekend type" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "onbekend type '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "'{' zonder overeenkomst in formaat" #: py/objtype.c py/runtime.c msgid "unreadable attribute" -msgstr "" +msgstr "onleesbaar attribuut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "niet ondersteund %q type" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Thumb instructie '%s' met %d argumenten" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "niet ondersteunde Xtensa instructie '%s' met %d argumenten" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "niet ondersteund formaatkarakter '%c' (0x%x) op index %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "niet ondersteund type voor %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "niet ondersteund type voor operator" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "niet ondersteunde types voor %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "waarde moet in %d byte(s) passen" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "value_count moet groter dan 0 zijn" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "window moet <= interval zijn" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "onjuist argumenttype" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "onjuist indextype" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "onjuist aantal argumenten" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "verkeerd aantal waarden om uit te pakken" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "verkeerd operandtype" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "x-waarde buiten bereik" #: shared-bindings/displayio/Shape.c msgid "y should be an int" -msgstr "" +msgstr "y moet een int zijn" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "y-waarde buiten bereik" #: py/objrange.c msgid "zero step" -msgstr "" - -#~ msgid "Negative step not supported" -#~ msgstr "Negatieve stappen niet ondersteund" +msgstr "nul-stap" From f3ac3ead8d049dd52f2dc6726e42fad730422c37 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 20:52:07 -0500 Subject: [PATCH 721/919] make translate --- locale/circuitpython.pot | 2 +- locale/cs.po | 28 ++++++++++++++++------------ locale/de_DE.po | 31 +++++++++++++++++++------------ locale/nl.po | 31 +++++++++++++++++++------------ 4 files changed, 55 insertions(+), 37 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index eeaaa0a7a9..3e7fb74e3d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index 825b31509a..737beebdac 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -376,6 +376,10 @@ msgstr "" msgid "Bit depth must be multiple of 8." msgstr "" +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "" @@ -809,7 +813,7 @@ msgstr "" msgid "Hardware busy, try alternative pins" msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "" @@ -888,11 +892,11 @@ msgstr "" msgid "Invalid PWM frequency" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "" @@ -968,7 +972,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1079,10 +1084,6 @@ msgstr "" msgid "Name too long" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "Negative step not supported" -msgstr "" - #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "" @@ -1245,6 +1246,10 @@ msgstr "" msgid "Pin does not have ADC capabilities" msgstr "" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "" @@ -1422,7 +1427,7 @@ msgstr "" msgid "Stream missing readinto() or write() method." msgstr "" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "" @@ -3069,8 +3074,7 @@ msgstr "" msgid "tuple/list required on RHS" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9c3af7cdb9..bb4a646e51 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-19 15:01+0800\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-23 16:13+0000\n" "Last-Translator: Timon \n" "Language-Team: German \n" "Language-Team: none\n" @@ -378,6 +378,10 @@ msgstr "Bit clock en word select moeten een clock eenheid delen" msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." +#: ports/mimxrt10xx/common-hal/busio/UART.c +msgid "Both RX and TX required for flow control" +msgstr "" + #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" msgstr "Beide pinnen moeten hardware interrupts ondersteunen" @@ -819,7 +823,7 @@ msgstr "Groep is vol" msgid "Hardware busy, try alternative pins" msgstr "Hardware bezig, probeer alternatieve pinnen" -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" @@ -900,11 +904,11 @@ msgstr "Ongeldige I2C pin selectie" msgid "Invalid PWM frequency" msgstr "Ongeldige PWM frequentie" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" msgstr "Ongeldige SPI pin selectie" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +#: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" msgstr "Ongeldige UART pin selectie" @@ -980,7 +984,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1091,10 +1096,6 @@ msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" msgid "Name too long" msgstr "Naam te lang" -#: shared-bindings/_pixelbuf/PixelBuf.c -msgid "Negative step not supported" -msgstr "Negatieve stappen niet ondersteund" - #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" msgstr "Geen CCCD voor deze Characteristic" @@ -1266,6 +1267,10 @@ msgstr "Toegang geweigerd" msgid "Pin does not have ADC capabilities" msgstr "Pin heeft geen ADC mogelijkheden" +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pin is input only" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" msgstr "Pin moet hardware interrupts ondersteunen" @@ -1448,7 +1453,7 @@ msgstr "Stack grootte moet op zijn minst 256 zijn" msgid "Stream missing readinto() or write() method." msgstr "Stream mist readinto() of write() methode." -#: ports/stm/common-hal/busio/UART.c +#: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" @@ -3121,8 +3126,7 @@ msgstr "tuple of lijst heeft onjuiste lengte" msgid "tuple/list required on RHS" msgstr "tuple of lijst vereist op RHS" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c msgid "tx and rx cannot both be None" msgstr "tx en rx kunnen niet beiden None zijn" @@ -3277,3 +3281,6 @@ msgstr "y-waarde buiten bereik" #: py/objrange.c msgid "zero step" msgstr "nul-stap" + +#~ msgid "Negative step not supported" +#~ msgstr "Negatieve stappen niet ondersteund" From fe3e8d1589e54de999cccc775f269a39443c82d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 28 May 2020 07:40:56 -0500 Subject: [PATCH 722/919] string compression: save a few bits per string Length was stored as a 16-bit number always. Most translations have a max length far less. For example, US English translation lengths always fit in just 8 bits. probably all languages fit in 9 bits. This also has the side effect of reducing the alignment of compressed_string_t from 2 bytes to 1. testing performed: ran in german and english on pyruler, printed messages looked right. Firmware size, en_US Before: 3044 bytes free in flash After: 3408 bytes free in flash Firmware size, de_DE (with #2967 merged to restore translations) Before: 1236 bytes free in flash After: 1600 bytes free in flash --- main.c | 2 +- py/builtinhelp.c | 4 +-- py/makeqstrdata.py | 52 +++++++++++++++++++++++++++++------ py/moduerrno.c | 2 +- py/obj.c | 6 ++-- py/objexcept.c | 4 +-- supervisor/shared/translate.c | 26 ++++++++++++------ supervisor/shared/translate.h | 5 ++-- 8 files changed, 74 insertions(+), 27 deletions(-) diff --git a/main.c b/main.c index bb5a7e5cec..c3787122d3 100755 --- a/main.c +++ b/main.c @@ -185,7 +185,7 @@ bool maybe_run_list(const char ** filenames, pyexec_result_t* exec_result) { } mp_hal_stdout_tx_str(filename); const compressed_string_t* compressed = translate(" output:\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_hal_stdout_tx_str(decompressed); pyexec_file(filename, exec_result); diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 9a3407a16f..01c0bc84e0 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -135,7 +135,7 @@ STATIC void mp_help_print_modules(void) { // let the user know there may be other modules available from the filesystem const compressed_string_t* compressed = translate("Plus any modules on the filesystem\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_print_str(MP_PYTHON_PRINTER, decompressed); } @@ -181,7 +181,7 @@ STATIC mp_obj_t mp_builtin_help(size_t n_args, const mp_obj_t *args) { // print a general help message. Translate only works on single strings on one line. const compressed_string_t* compressed = translate("Welcome to Adafruit CircuitPython %s!\n\nPlease visit learn.adafruit.com/category/circuitpython for project guides.\n\nTo list built-in modules please do `help(\"modules\")`.\n"); - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); mp_printf(MP_PYTHON_PRINTER, decompressed, MICROPY_GIT_TAG); } else { diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 0d667959d9..64e4d26f45 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -1,7 +1,7 @@ """ Process raw qstr file and output qstr data with length, hash and data bytes. -This script works with Python 2.6, 2.7, 3.3 and 3.4. +This script works with Python 2.7, 3.3 and 3.4. """ from __future__ import print_function @@ -132,19 +132,37 @@ def compute_huffman_coding(translations, qstrs, compression_filename): print("// estimated total memory size", len(lengths) + 2*len(values) + sum(len(cb[u]) for u in all_strings_concat)) print("//", values, lengths) values_type = "uint16_t" if max(ord(u) for u in values) > 255 else "uint8_t" + max_translation_encoded_length = max(len(translation.encode("utf-8")) for original,translation in translations) with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) + f.write("#define compress_max_length_bits ({})\n".format(max_translation_encoded_length.bit_length())) return values, lengths -def decompress(encoding_table, length, encoded): +def decompress(encoding_table, encoded, encoded_length_bits): values, lengths = encoding_table - #print(l, encoded) dec = [] this_byte = 0 this_bit = 7 b = encoded[this_byte] - for i in range(length): + bits = 0 + for i in range(encoded_length_bits): + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + length = bits + + i = 0 + while i < length: bits = 0 bit_length = 0 max_code = lengths[0] @@ -170,10 +188,11 @@ def decompress(encoding_table, length, encoded): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] + i += len(v.encode('utf-8')) dec.append(v) return ''.join(dec) -def compress(encoding_table, decompressed): +def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): if not isinstance(decompressed, str): raise TypeError() values, lengths = encoding_table @@ -182,6 +201,19 @@ def compress(encoding_table, decompressed): #print(lengths) current_bit = 7 current_byte = 0 + + code = len_translation_encoded + bits = encoded_length_bits+1 + for i in range(bits - 1, 0, -1): + if len_translation_encoded & (1 << (i - 1)): + enc[current_byte] |= 1 << current_bit + if current_bit == 0: + current_bit = 7 + #print("packed {0:0{width}b}".format(enc[current_byte], width=8)) + current_byte += 1 + else: + current_bit -= 1 + for c in decompressed: #print() #print("char", c, values.index(c)) @@ -342,14 +374,17 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): total_text_size = 0 total_text_compressed_size = 0 + max_translation_encoded_length = max(len(translation.encode("utf-8")) for original, translation in i18ns) + encoded_length_bits = max_translation_encoded_length.bit_length() for original, translation in i18ns: translation_encoded = translation.encode("utf-8") - compressed = compress(encoding_table, translation) + compressed = compress(encoding_table, translation, encoded_length_bits, len(translation_encoded)) total_text_compressed_size += len(compressed) - decompressed = decompress(encoding_table, len(translation_encoded), compressed) + decompressed = decompress(encoding_table, compressed, encoded_length_bits) + assert decompressed == translation for c in C_ESCAPES: decompressed = decompressed.replace(c, C_ESCAPES[c]) - print("TRANSLATION(\"{}\", {}, {{ {} }}) // {}".format(original, len(translation_encoded)+1, ", ".join(["0x{:02x}".format(x) for x in compressed]), decompressed)) + print("TRANSLATION(\"{}\", {}) // {}".format(original, ", ".join(["{:d}".format(x) for x in compressed]), decompressed)) total_text_size += len(translation.encode("utf-8")) print() @@ -385,6 +420,7 @@ if __name__ == "__main__": qcfgs, qstrs, i18ns = parse_input_headers(args.infiles) if args.translation: + i18ns = sorted(i18ns) translations = translate(args.translation, i18ns) encoding_table = compute_huffman_coding(translations, qstrs, args.compression_filename) print_qstr_data(encoding_table, qcfgs, qstrs, translations) diff --git a/py/moduerrno.c b/py/moduerrno.c index 7915603e4e..3be5adba1e 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -158,7 +158,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { case ENOSPC: desc = translate("No space left on device"); break; case EROFS: desc = translate("Read-only filesystem"); break; } - if (desc != NULL && desc->length <= len) { + if (desc != NULL && decompress_length(desc) <= len) { decompress(desc, buf); return buf; } diff --git a/py/obj.c b/py/obj.c index f1e00de1a4..4fa2032dc7 100644 --- a/py/obj.c +++ b/py/obj.c @@ -94,17 +94,17 @@ void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { assert(n % 3 == 0); // Decompress the format strings const compressed_string_t* traceback = translate("Traceback (most recent call last):\n"); - char decompressed[traceback->length]; + char decompressed[decompress_length(traceback)]; decompress(traceback, decompressed); #if MICROPY_ENABLE_SOURCE_LINE const compressed_string_t* frame = translate(" File \"%q\", line %d"); #else const compressed_string_t* frame = translate(" File \"%q\""); #endif - char decompressed_frame[frame->length]; + char decompressed_frame[decompress_length(frame)]; decompress(frame, decompressed_frame); const compressed_string_t* block_fmt = translate(", in %q\n"); - char decompressed_block[block_fmt->length]; + char decompressed_block[decompress_length(block_fmt)]; decompress(block_fmt, decompressed_block); // Print the traceback diff --git a/py/objexcept.c b/py/objexcept.c index b7a536c5e3..796be122fe 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -400,7 +400,7 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com // Try to allocate memory for the message mp_obj_str_t *o_str = m_new_obj_maybe(mp_obj_str_t); - size_t o_str_alloc = fmt->length + 1; + size_t o_str_alloc = decompress_length(fmt); byte *o_str_buf = m_new_maybe(byte, o_str_alloc); bool used_emg_buf = false; @@ -433,7 +433,7 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com // We have some memory to format the string struct _exc_printer_t exc_pr = {!used_emg_buf, o_str_alloc, 0, o_str_buf}; mp_print_t print = {&exc_pr, exc_add_strn}; - char fmt_decompressed[fmt->length]; + char fmt_decompressed[decompress_length(fmt)]; decompress(fmt, fmt_decompressed); mp_vprintf(&print, fmt_decompressed, ap); exc_pr.buf[exc_pr.len] = '\0'; diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 187d5ff8a5..606f8fa91a 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -37,7 +37,7 @@ #include "supervisor/serial.h" void serial_write_compressed(const compressed_string_t* compressed) { - char decompressed[compressed->length]; + char decompressed[decompress_length(compressed)]; decompress(compressed, decompressed); serial_write(decompressed); } @@ -58,12 +58,22 @@ STATIC int put_utf8(char *buf, int u) { } } +uint16_t decompress_length(const compressed_string_t* compressed) { + if (compress_max_length_bits <= 8) { + return 1 + (compressed->data >> (8 - compress_max_length_bits)); + } else { + return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits)); + } +} + char* decompress(const compressed_string_t* compressed, char* decompressed) { - uint8_t this_byte = 0; - uint8_t this_bit = 7; - uint8_t b = compressed->data[this_byte]; + uint8_t this_byte = compress_max_length_bits / 8; + uint8_t this_bit = 7 - compress_max_length_bits % 8; + uint8_t b = (&compressed->data)[this_byte]; + uint16_t length = decompress_length(compressed); + // Stop one early because the last byte is always NULL. - for (uint16_t i = 0; i < compressed->length - 1;) { + for (uint16_t i = 0; i < length - 1;) { uint32_t bits = 0; uint8_t bit_length = 0; uint32_t max_code = lengths[0]; @@ -78,7 +88,7 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { if (this_bit == 0) { this_bit = 7; this_byte += 1; - b = compressed->data[this_byte]; // This may read past the end but its never used. + b = (&compressed->data)[this_byte]; // This may read past the end but its never used. } else { this_bit -= 1; } @@ -91,14 +101,14 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { i += put_utf8(decompressed + i, values[searched_length + bits - max_code]); } - decompressed[compressed->length-1] = '\0'; + decompressed[length-1] = '\0'; return decompressed; } inline __attribute__((always_inline)) const compressed_string_t* translate(const char* original) { #ifndef NO_QSTR #define QDEF(id, str) - #define TRANSLATION(id, len, compressed...) if (strcmp(original, id) == 0) { static const compressed_string_t v = {.length = len, .data = compressed}; return &v; } else + #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else #include "genhdr/qstrdefs.generated.h" #undef TRANSLATION #undef QDEF diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 5e8acbb6af..067a44e1fc 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -30,12 +30,13 @@ #include typedef struct { - uint16_t length; - const uint8_t data[]; + uint8_t data; + const uint8_t tail[]; } compressed_string_t; const compressed_string_t* translate(const char* c); void serial_write_compressed(const compressed_string_t* compressed); char* decompress(const compressed_string_t* compressed, char* decompressed); +uint16_t decompress_length(const compressed_string_t* compressed); #endif // MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H From fd00bb8b7faa630f6450feb27ad079f159a7b322 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 28 May 2020 12:15:21 -0400 Subject: [PATCH 723/919] Fix pin reset flash conflict error --- ports/mimxrt10xx/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index b6ae002930..d5f99519a9 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,8 +257,8 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Reset everything into a known state before board_init. - reset_port(); + // Note that reset_port CANNOT GO HERE, unlike other ports, since we currently rely on it to + // protect never_reset pins per board. if (board_requests_safe_mode()) { return USER_SAFE_MODE; From d0f9b5901e37a751a0bf5770c2f26a5c6c039dd4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 28 May 2020 11:29:28 -0500 Subject: [PATCH 724/919] translations: document the compressed format --- py/makeqstrdata.py | 3 +++ supervisor/shared/translate.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 64e4d26f45..df2c687e5c 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -2,6 +2,9 @@ Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.7, 3.3 and 3.4. + +For documentation about the format of compressed translated strings, see +supervisor/shared/translate.h """ from __future__ import print_function diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 067a44e1fc..731b26d123 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -29,11 +29,38 @@ #include +// The format of the compressed data is: +// - the size of the uncompressed string in UTF-8 bytes, encoded as a +// (compress_max_length_bits)-bit number. compress_max_length_bits is +// computed during dictionary generation time, and happens to be 8 +// for all current platforms. However, it'll probably end up being +// 9 in some translations sometime in the future. This length excludes +// the trailing NUL, though notably decompress_length includes it. +// +// - followed by the huffman encoding of the individual UTF-16 code +// points that make up the string. The trailing "\0" is not +// represented by a huffman code, but is implied by the length. +// (building the huffman encoding on UTF-16 code points gave better +// compression than building it on UTF-8 bytes) +// +// The "data" / "tail" construct is so that the struct's last member is a +// "flexible array". However, the _only_ member is not permitted to be +// a flexible member, so we have to declare the first byte as a separte +// member of the structure. +// +// For translations where length needs 8 bits, this saves about 1.5 +// bytes per string on average compared to a structure of {uint16_t, +// flexible array}, but is also future-proofed against strings with +// UTF-8 length above 256, with a savings of about 1.375 bytes per +// string. typedef struct { uint8_t data; const uint8_t tail[]; } compressed_string_t; +// Return the compressed, translated version of a source string +// Usually, due to LTO, this is optimized into a load of a constant +// pointer. const compressed_string_t* translate(const char* c); void serial_write_compressed(const compressed_string_t* compressed); char* decompress(const compressed_string_t* compressed, char* decompressed); From a9419b5d46b00bfcb7577ef5ad3149d57308d00a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:06:24 -0700 Subject: [PATCH 725/919] Update ESP IDF --- ports/esp32s2/esp-idf | 2 +- ports/esp32s2/supervisor/usb.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 0daf6e0e41..7aae7f034b 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 0daf6e0e41f95d22d193d08941a00df9525bc405 +Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 7c508485e4..8bba84015a 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -29,6 +29,11 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "esp-idf/components/soc/soc/esp32s2/include/soc/usb_periph.h" +#include "esp-idf/components/driver/include/driver/periph_ctrl.h" +#include "esp-idf/components/driver/include/driver/gpio.h" +#include "esp-idf/components/esp_rom/include/esp32s2/rom/gpio.h" + #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -64,16 +69,22 @@ void usb_device_task(void* param) } void init_usb_hardware(void) { + periph_module_reset(PERIPH_USB_MODULE); + periph_module_enable(PERIPH_USB_MODULE); usb_hal_context_t hal = { .use_external_phy = false // use built-in PHY }; usb_hal_init(&hal); + // Initialize the pin drive strength. + gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); + gpio_set_drive_capability(USBPHY_DP_NUM, GPIO_DRIVE_CAP_3); + (void) xTaskCreateStatic(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, - configMAX_PRIORITIES-1, + 5, usb_device_stack, &usb_device_taskdef); } From 796373b8be015644425a1167c5c3b64f7a010c8d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:43:55 -0700 Subject: [PATCH 726/919] A number of small ESP32S2 fixes: * Fix flash writes that don't end on a sector boundary. Fixes #2944 * Fix enum incompatibility with IDF. * Fix printf output so it goes out debug UART. * Increase stack size to 8k. * Fix sleep of less than a tick so it doesn't crash. --- ports/atmel-samd/Makefile | 4 ++-- ports/esp32s2/Makefile | 2 +- ports/esp32s2/mpconfigport.h | 1 + ports/esp32s2/sdkconfig.defaults | 2 +- ports/esp32s2/supervisor/internal_flash.c | 6 ++++-- ports/esp32s2/supervisor/port.c | 3 +++ ports/litex/Makefile | 4 ++-- ports/mimxrt10xx/Makefile | 4 ++-- ports/nrf/Makefile | 4 ++-- ports/stm/Makefile | 4 ++-- py/circuitpy_defns.mk | 1 - py/circuitpy_mpconfig.h | 2 ++ 12 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 8a5c3309f4..d0ab65e6b7 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -134,7 +134,7 @@ else endif endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) ifeq ($(CHIP_FAMILY), samd21) CFLAGS += \ @@ -157,7 +157,7 @@ endif -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 1104c5289f..5ad5c2f1d3 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -110,7 +110,7 @@ endif CFLAGS += $(INC) -Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp32s2 \ -Tesp32s2_out.ld \ -L$(BUILD)/esp-idf/esp-idf/esp32s2/ld \ diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index c307d47916..d340bb4805 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -32,6 +32,7 @@ #define MICROPY_NLR_THUMB (0) #define MICROPY_PY_UJSON (0) +#define MICROPY_USE_INTERNAL_PRINTF (0) #include "py/circuitpy_mpconfig.h" diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index f7deb53fb0..958e1852ea 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -259,7 +259,7 @@ CONFIG_ESP32S2_RTC_CLK_CAL_CYCLES=576 CONFIG_ESP_ERR_TO_NAME_LOOKUP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index aab7e587ae..ef216c4b1b 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -100,18 +100,20 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 _cache_lba = sector_offset; } for (uint8_t b = block_offset; b < blocks_per_sector; b++) { + // Stop copying after the last block. + if (block >= num_blocks) { + break; + } memcpy(_cache + b * FILESYSTEM_BLOCK_SIZE, src + block * FILESYSTEM_BLOCK_SIZE, FILESYSTEM_BLOCK_SIZE); block++; } result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "erase %d", result); result = esp_partition_write(_partition, sector_offset, _cache, SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "write %d", result); } return 0; // success diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 9e83e5778c..4c42f11af9 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -152,6 +152,9 @@ void port_sleep_until_interrupt(void) { // FreeRTOS delay here maybe. // Light sleep shuts down BLE and wifi. // esp_light_sleep_start() + if (sleep_time_duration == 0) { + return; + } vTaskDelayUntil(&sleep_time_set, sleep_time_duration); } diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 596eaf2bb3..d75a4da288 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -83,14 +83,14 @@ else ### CFLAGS += -flto endif -CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) # TODO: check this CFLAGS += -D__START=main -DFOMU LD_FILE := boards/$(BOARD)/$(BOARD)-spi.ld -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -Wl,-melf32lriscv LIBS := -lgcc -lc diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 922978ac2e..78cab0188e 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -90,7 +90,7 @@ else #CFLAGS += -flto -flto-partition=none endif -CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -ggdb -Wall -Wno-cast-align -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # TODO: add these when -Werror is applied # Disable some warnings, as do most ports. NXP SDK causes undef, tinyusb causes cast-align @@ -112,7 +112,7 @@ LD_FILES = $(wildcard boards/$(BOARD)/*.ld) $(addprefix linking/, flash/$(FLASH) LD_SCRIPT_FLAG := -Wl,-T, -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib $(addprefix $(LD_SCRIPT_FLAG), $(LD_FILES)) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib $(addprefix $(LD_SCRIPT_FLAG), $(LD_FILES)) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc -lnosys -lm # Use toolchain libm if we're not using our own. diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8a7b1104b9..44d1f3de2d 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -93,7 +93,7 @@ else endif -CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) # Undo some warnings. # nrfx uses undefined preprocessor variables quite casually, so we can't do warning checks for these. @@ -114,7 +114,7 @@ CFLAGS += \ # TODO: check this CFLAGS += -D__START=main -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 diff --git a/ports/stm/Makefile b/ports/stm/Makefile index b667990bda..bd69d6fd7a 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -94,7 +94,7 @@ endif # MCU Series is defined by the HAL package and doesn't need to be specified here C_DEFS = -D$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_VARIANT) -CFLAGS += $(INC) -Werror -Wall -std=gnu11 $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles +CFLAGS += $(INC) -Werror -Wall -std=gnu11 -fshort-enums $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) -nostdlib -nostartfiles # Undo some warnings. # STM32 HAL uses undefined preprocessor variables, shadowed variables, casts that change alignment reqs @@ -136,7 +136,7 @@ ifndef BOOTLOADER_OFFSET BOOTLOADER_OFFSET := 0x8000000 endif -LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-T,$(LD_COMMON) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 9e36f2e6a2..46e8d43d3c 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -48,7 +48,6 @@ BASE_CFLAGS = \ -D__$(CHIP_VARIANT)__ \ -ffunction-sections \ -fdata-sections \ - -fshort-enums \ -DCIRCUITPY_SOFTWARE_SAFE_MODE=0x0ADABEEF \ -DCIRCUITPY_CANARY_WORD=0xADAF00 \ -DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 5f2605c92f..62ef9062dd 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -121,7 +121,9 @@ #define MICROPY_REPL_EVENT_DRIVEN (0) #define MICROPY_STACK_CHECK (1) #define MICROPY_STREAMS_NON_BLOCK (1) +#ifndef MICROPY_USE_INTERNAL_PRINTF #define MICROPY_USE_INTERNAL_PRINTF (1) +#endif // fatfs configuration used in ffconf.h // From 2fb4fa328946b07d90bd951d4a134ea8d31be7e8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 18:29:11 -0700 Subject: [PATCH 727/919] Spill registers before scanning the stack. From the change: // xtensa has more registers than an instruction can address. The 16 that // can be addressed are called the "window". When a function is called or // returns the window rotates. This allows for more efficient function calls // because ram doesn't need to be used. It's only used if the window wraps // around onto itself. At that point values are "spilled" to empty spots in // the stack that were set aside. When the window rotates back around (on // function return), the values are restored into the register from ram. // So, in order to read the values in the stack scan we must make sure all // of the register values we care about have been spilled to RAM. Luckily, // there is a HAL call to do it. There is a bit of a race condition here // because the register value could change after it's been restored but that // is unlikely to happen with a heap pointer while we do a GC. Fixes #2907 --- ports/esp32s2/mphalport.c | 20 +++++++++++++++++++- ports/esp32s2/tools/decode_backtrace.py | 23 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 ports/esp32s2/tools/decode_backtrace.py diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index 772b61c9e0..da5258b0e2 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -37,6 +37,24 @@ void mp_hal_delay_us(mp_uint_t delay) { mp_hal_delay_ms(delay / 1000); } -mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs) { +// This is provided by the esp-idf/components/xtensa/esp32s2/libhal.a binary +// blob. +extern void xthal_window_spill(void); + +mp_uint_t cpu_get_regs_and_sp(mp_uint_t *regs, uint8_t reg_count) { + // xtensa has more registers than an instruction can address. The 16 that + // can be addressed are called the "window". When a function is called or + // returns the window rotates. This allows for more efficient function calls + // because ram doesn't need to be used. It's only used if the window wraps + // around onto itself. At that point values are "spilled" to empty spots in + // the stack that were set aside. When the window rotates back around (on + // function return), the values are restored into the register from ram. + + // So, in order to read the values in the stack scan we must make sure all + // of the register values we care about have been spilled to RAM. Luckily, + // there is a HAL call to do it. There is a bit of a race condition here + // because the register value could change after it's been restored but that + // is unlikely to happen with a heap pointer while we do a GC. + xthal_window_spill(); return (mp_uint_t) __builtin_frame_address(0); } diff --git a/ports/esp32s2/tools/decode_backtrace.py b/ports/esp32s2/tools/decode_backtrace.py new file mode 100644 index 0000000000..3f078895af --- /dev/null +++ b/ports/esp32s2/tools/decode_backtrace.py @@ -0,0 +1,23 @@ +"""Simple script that translates "Backtrace:" lines from the ESP output to files + and line numbers. + + Run with: python3 tools/decode_backtrace.py + + Enter the backtrace line at the "? " prompt. CTRL-C to exit the script. + """ + +import subprocess +import sys + +board = sys.argv[1] +print(board) + +while True: + addresses = input("? ") + if addresses.startswith("Backtrace:"): + addresses = addresses[len("Backtrace:"):] + addresses = addresses.strip().split() + addresses = [address.split(":")[0] for address in addresses] + print('got', addresses) + subprocess.run(["xtensa-esp32s2-elf-addr2line", + "-e", "build-{}/firmware.elf".format(board)] + addresses) From 0d2fee95e25602ba12921e8ca7a4a288a684078d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 29 May 2020 11:06:30 -0400 Subject: [PATCH 728/919] enable aesio on all nRF52840 boards --- ports/nrf/mpconfigport.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index a9ad11bd44..474446f5cd 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -45,6 +45,9 @@ MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52840 +# Fits on nrf52840 but space is tight on nrf52833. +CIRCUITPY_AESIO ?= 1 + SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 From fe75c7793c9b7e18c35935befabdfa3892acc364 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 29 May 2020 12:19:37 -0400 Subject: [PATCH 729/919] Fix SWO/Analog overlap, style changes --- ports/mimxrt10xx/boards/imxrt1010_evk/board.c | 1 - .../boards/imxrt1010_evk/mpconfigboard.h | 4 ++++ ports/mimxrt10xx/boards/imxrt1010_evk/pins.c | 14 ++++++++++---- ports/mimxrt10xx/boards/imxrt1020_evk/board.c | 1 - ports/mimxrt10xx/boards/imxrt1060_evk/board.c | 1 - ports/mimxrt10xx/supervisor/port.c | 4 ++-- ports/stm/common-hal/busio/I2C.c | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index b94e6055e4..ba3498581c 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_13); //SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_12); //SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_09); //SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_12); common_hal_never_reset_pin(&pin_GPIO_SD_11); diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h b/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h index 128e33111e..77d458d75b 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/mpconfigboard.h @@ -7,6 +7,10 @@ #define BOARD_FLASH_SIZE (16 * 1024 * 1024) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_AD_06) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_AD_04) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_AD_03) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO_02) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO_01) diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c index a5a598760b..a0221a2ad2 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c @@ -4,9 +4,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_AD_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_AD_06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_08) }, @@ -20,9 +18,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_AD_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_AD_06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_09) }, @@ -31,6 +27,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_AD_04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_AD_03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_USER_LED), MP_ROM_PTR(&pin_GPIO_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO_SD_05) }, diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index aaa7b382c0..d5166b3560 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_B0_00);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_B0_01);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index c3895473ef..25bc4e8c9d 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -33,7 +33,6 @@ void board_init(void) { // SWD Pins common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_00); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index d5f99519a9..acec3cf727 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,8 +257,8 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Note that reset_port CANNOT GO HERE, unlike other ports, since we currently rely on it to - // protect never_reset pins per board. + // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been + // run yet, which uses `never_reset` to protect critical pins from being reset by `reset_port`. if (board_requests_safe_mode()) { return USER_SAFE_MODE; diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index e3c59e7e05..48c4c1933a 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -122,7 +122,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, #if (CPY_STM32H7 || CPY_STM32F7) self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples #else - self->handle.Init.ClockSpeed = 100000; + self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; #endif From 0e6813d084233580774eb7dc043f54999998c223 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 29 May 2020 10:17:42 -0700 Subject: [PATCH 730/919] Fix merge-translate by starting with 'theirs' --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b642175969..f6146bfe48 100644 --- a/Makefile +++ b/Makefile @@ -213,7 +213,7 @@ translate: locale/circuitpython.pot merge-translate: git merge HEAD 1>&2 2> /dev/null; test $$? -eq 128 rm locale/*~ || true - git checkout --ours -- locale/* + git checkout --theirs -- locale/* make translate check-translate: locale/circuitpython.pot $(wildcard locale/*.po) From 0fe7efdf36a4432a3127ede6a08d00911036f873 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 29 May 2020 14:01:34 -0400 Subject: [PATCH 731/919] Set correct crystal settings on Discovery boards --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 1 + ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h | 1 - ports/stm/boards/stm32f4_discovery/mpconfigboard.h | 3 +-- ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index b1abd140fa..1fc5d37ee6 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -34,6 +34,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index 112d2a83c6..c0590b80c1 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -33,7 +33,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) - #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index 28a370afda..6274345ade 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -33,5 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) - -#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 28784f6ab9..ae21176aee 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -39,5 +39,7 @@ #define BOARD_OSC_PLLN (400) #define BOARD_OSC_PLLQ (9) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) + #define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 From 2303291f38b959c3ad74590627a9a9ab4f1ac697 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 28 May 2020 20:52:28 +0200 Subject: [PATCH 732/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/ID.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index e070d0642e..60c4cbd416 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/es.po b/locale/es.po index 08a2db6ce4..b4f86face8 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index 3f0b7f97ac..08052a9beb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index aa37383af7..fe16dbdc74 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index 8e4eb76a5c..af4fd3e7e6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/pl.po b/locale/pl.po index cf0e0f5648..b218a7b7c1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a0c0d9638e..7223c2e026 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index 3e50a34d8f..18c4708f2c 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-05-20 18:32+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 87b6787c30..289fd03a57 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From 1616f7cf95a103bd1cc6e65fca0055c987dd7ead Mon Sep 17 00:00:00 2001 From: Thomas Friehoff Date: Fri, 29 May 2020 15:37:01 +0000 Subject: [PATCH 733/919] Translated using Weblate (German) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index bb4a646e51..429aedc296 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-23 16:13+0000\n" -"Last-Translator: Timon \n" +"PO-Revision-Date: 2020-05-29 17:42+0000\n" +"Last-Translator: Thomas Friehoff \n" "Language-Team: German \n" "Language: de_DE\n" @@ -383,7 +383,7 @@ msgstr "Bit depth muss ein Vielfaches von 8 sein." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Sowohl RX als auch TX sind zu Flusssteuerung erforderlich" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -652,7 +652,7 @@ msgstr "DAC Kanal Intialisierungs Fehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "DAC Device Init Error" +msgstr "DAC Device Initialisierungs-Fehler" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -1275,7 +1275,7 @@ msgstr "Pin hat keine ADC Funktionalität" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pin kann nur als Eingang verwendet werden" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" @@ -2965,7 +2965,7 @@ msgstr "die ersuchte Länge ist %d, aber das Objekt hat eine Länge von %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "return annotation muss ein identifier sein" +msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" From cf888dc02bf0409cbe6e6ecf3a03a3278a6ec0b2 Mon Sep 17 00:00:00 2001 From: Brian Dean Date: Fri, 29 May 2020 15:40:56 -0400 Subject: [PATCH 734/919] .../devices.h: Add GigaDevices GD25S512MD 64 MiB flash chip support. --- supervisor/shared/external_flash/devices.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index f99fad4e70..466ab49eb8 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -187,6 +187,24 @@ typedef struct { .single_status_byte = false, \ } +// Settings for the Gigadevice GD25S512MD 64MiB SPI flash. +// Datasheet: http://www.gigadevice.com/datasheet/gd25s512md/ +#define GD25S512MD {\ + .total_size = (1 << 26), /* 64 MiB */ \ + .start_up_time_us = 5000, \ + .manufacturer_id = 0xc8, \ + .memory_type = 0x40, \ + .capacity = 0x19, \ + .max_clock_speed_mhz = 104, /* if we need 120 then we can turn on high performance mode */ \ + .quad_enable_bit_mask = 0x02, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = true, \ + .single_status_byte = false, \ +} + // Settings for the Cypress (was Spansion) S25FL064L 8MiB SPI flash. // Datasheet: http://www.cypress.com/file/316661/download #define S25FL064L {\ From a76447ea6ced99d3ec516e5240938057de1da442 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Fri, 29 May 2020 22:49:31 +0000 Subject: [PATCH 735/919] Translated using Weblate (Swedish) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 18c4708f2c..a0f0494bab 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-20 18:32+0000\n" +"PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -380,7 +380,7 @@ msgstr "Bitdjupet måste vara multipel av 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Både RX och TX krävs för handskakning" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1267,7 +1267,7 @@ msgstr "Pinnen har inte ADC-funktionalitet" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pinnen är enbart ingång" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From b354c9e2e8dbbf3ec81e699f13553199df61ef17 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Sat, 30 May 2020 11:03:46 +0000 Subject: [PATCH 736/919] Translated using Weblate (Dutch) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index aca8fbb8d8..55241b3bd0 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-25 13:52+0000\n" -"Last-Translator: Dustin Watts \n" +"PO-Revision-Date: 2020-05-31 11:41+0000\n" +"Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" "MIME-Version: 1.0\n" @@ -380,7 +380,7 @@ msgstr "Bit diepte moet een meervoud van 8 zijn." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RX en TX zijn beide vereist voor stroomregeling" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1269,7 +1269,7 @@ msgstr "Pin heeft geen ADC mogelijkheden" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Pin kan alleen voor invoer gebruikt worden" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From 89bd87d9fca62e3d8255d9435937280a11e857e6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 10:35:42 -0500 Subject: [PATCH 737/919] shared-bindings: Fix docs of storage.VfsFat This is almost, but not entirely, a whitespace change. "..." was missing or mis-placed in several places The invalid syntax 'def f(self, ):' was used in several places. --- shared-bindings/storage/__init__.c | 97 +++++++++++++++--------------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 8ac08d8c9b..3abc5512c9 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -167,54 +167,55 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_getmount), MP_ROM_PTR(&storage_getmount_obj) }, { MP_ROM_QSTR(MP_QSTR_erase_filesystem), MP_ROM_PTR(&storage_erase_filesystem_obj) }, - //| class VfsFat: - //| def __init__(self, block_device: Any): ... - //| """Create a new VfsFat filesystem around the given block device. - //| - //| :param block_device: Block device the the filesystem lives on""" - //| - //| label: Any = ... - //| """The filesystem label, up to 11 case-insensitive bytes. Note that - //| this property can only be set when the device is writable by the - //| microcontroller.""" - //| - //| def mkfs(self, ) -> Any: - //| """Format the block device, deleting any data that may have been there""" - //| ... - //| - //| def open(self, path: Any, mode: Any) -> Any: - //| """Like builtin ``open()``""" - //| ... - //| - //| def ilistdir(self, path: Any) -> Any: - //| """Return an iterator whose values describe files and folders within - //| ``path``""" - //| ... - //| - //| def mkdir(self, path: Any) -> Any: - //| """Like `os.mkdir`""" - //| ... - //| - //| def rmdir(self, path: Any) -> Any: - //| """Like `os.rmdir`""" - //| ... - //| - //| def stat(self, path: Any) -> Any: - //| """Like `os.stat`""" - //| ... - //| - //| def statvfs(self, path: Any) -> Any: - //| """Like `os.statvfs`""" - //| ... - //| - //| def mount(self, readonly: Any, mkfs: Any) -> Any: - //| """Don't call this directly, call `storage.mount`.""" - //| ... - //| - //| def umount(self, ) -> Any: - //| """Don't call this directly, call `storage.umount`.""" - //| ... - //| +//| class VfsFat: +//| def __init__(self, block_device: Any): +//| """Create a new VfsFat filesystem around the given block device. +//| +//| :param block_device: Block device the the filesystem lives on""" +//| +//| label: Any = ... +//| """The filesystem label, up to 11 case-insensitive bytes. Note that +//| this property can only be set when the device is writable by the +//| microcontroller.""" +//| ... +//| +//| def mkfs(self) -> Any: +//| """Format the block device, deleting any data that may have been there""" +//| ... +//| +//| def open(self, path: Any, mode: Any) -> Any: +//| """Like builtin ``open()``""" +//| ... +//| +//| def ilistdir(self, path: Any) -> Any: +//| """Return an iterator whose values describe files and folders within +//| ``path``""" +//| ... +//| +//| def mkdir(self, path: Any) -> Any: +//| """Like `os.mkdir`""" +//| ... +//| +//| def rmdir(self, path: Any) -> Any: +//| """Like `os.rmdir`""" +//| ... +//| +//| def stat(self, path: Any) -> Any: +//| """Like `os.stat`""" +//| ... +//| +//| def statvfs(self, path: Any) -> Any: +//| """Like `os.statvfs`""" +//| ... +//| +//| def mount(self, readonly: Any, mkfs: Any) -> Any: +//| """Don't call this directly, call `storage.mount`.""" +//| ... +//| +//| def umount(self) -> Any: +//| """Don't call this directly, call `storage.umount`.""" +//| ... +//| { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, }; From e0ca70119c420be8d6a65b4b9b7371fb6459af1b Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Mon, 1 Jun 2020 07:13:45 +0000 Subject: [PATCH 738/919] include uf2 firmware for nrf52840 mdk usb dongle which has a uf2 bootloader now --- tools/build_board_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 7eed2c70cc..4433023305 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -53,7 +53,7 @@ extension_by_board = { # nRF52840 dev kits that may not have UF2 bootloaders, "makerdiary_nrf52840_mdk": HEX, - "makerdiary_nrf52840_mdk_usb_dongle": HEX, + "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, "electronut_labs_blip": HEX From ce337eaa27805428b1245502b75e56ae63b8422d Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Mon, 1 Jun 2020 11:35:46 +0200 Subject: [PATCH 739/919] Fix port_get_raw_ticks --- ports/cxd56/supervisor/port.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index 9ec9dbfdf2..a7e9c30a3d 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -29,6 +29,8 @@ #include #include +#include + #include "sched/sched.h" #include "boards/board.h" @@ -45,7 +47,8 @@ safe_mode_t port_init(void) { boardctl(BOARDIOC_INIT, 0); - board_init(); + // Wait until RTC is available + while (g_rtc_enabled == false); if (board_requests_safe_mode()) { return USER_SAFE_MODE; @@ -121,14 +124,10 @@ void board_timerhook(void) } uint64_t port_get_raw_ticks(uint8_t* subticks) { - struct timeval tv; - gettimeofday(&tv, NULL); - long computed_subticks = tv.tv_usec * 1024 * 32 / 1000000; - if (subticks != NULL) { - *subticks = computed_subticks % 32; - } + uint64_t count = cxd56_rtc_count(); + *subticks = count % 32; - return tv.tv_sec * 1024 + computed_subticks / 32; + return count / 32; } // Enable 1/1024 second tick. From 79e2ede7c1f4c712ba159400e10282c8f28fb033 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 07:51:32 -0500 Subject: [PATCH 740/919] Makefile: "make translate" will only update circuitpython.pot We can now rely on weblate to regularly update the individual language files from the template, so "make translate" only needs to update the template file circuitpython.pot. This is advantageous because updating the other files in locale/ was a frequent source of merge conflicts; resolving the conflict incorrectly was something that could easily occur (and did). --- Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f6146bfe48..55f64b17df 100644 --- a/Makefile +++ b/Makefile @@ -202,12 +202,25 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." # phony target so we always run +.PHONY: all-source all-source: locale/circuitpython.pot: all-source find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale +# Historically, `make translate` updated the .pot file and ran msgmerge. +# However, this was a frequent source of merge conflicts. Weblate can perform +# msgmerge, so make translate merely update the translation template file. +.PHONY: translate translate: locale/circuitpython.pot + +# Note that normally we rely on weblate to perform msgmerge. This reduces the +# chance of a merge conflict between developer changes (that only add and +# remove source strings) and weblate changes (that only add and remove +# translated strings from po files). However, in case this is legitimately +# needed we preserve a rule to do it. +.PHONY: msgmerge +msgmerge: for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done merge-translate: @@ -216,8 +229,10 @@ merge-translate: git checkout --theirs -- locale/* make translate -check-translate: locale/circuitpython.pot $(wildcard locale/*.po) - $(PYTHON) tools/check_translations.py $^ +.PHONY: check-translate +check-translate: + find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale + $(PYTHON) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$?; rm -f locale/circuitpython.pot.tmp; exit $$status stubs: @mkdir -p circuitpython-stubs From 9cffe28ae77d1203308c0eed03160ab91e007064 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:20:47 +0000 Subject: [PATCH 741/919] Translated using Weblate (French) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index fe16dbdc74..1c536ab53c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-26 19:37+0000\n" +"PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French \n" @@ -388,7 +388,7 @@ msgstr "La profondeur de bit doit être un multiple de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RX et TX requis pour le contrôle de flux" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -1281,7 +1281,7 @@ msgstr "La broche ne peut être utilisée pour l'ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "La broche est entrée uniquement" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" From c909b733a82385a8661ce54fa3ed0b793a0cfffb Mon Sep 17 00:00:00 2001 From: David Glaude Date: Sun, 31 May 2020 14:21:38 +0000 Subject: [PATCH 742/919] Translated using Weblate (French) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 1c536ab53c..9de062b544 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -10,7 +10,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" -"Last-Translator: Jeff Epler \n" +"Last-Translator: David Glaude \n" "Language-Team: French \n" "Language: fr\n" @@ -190,12 +190,12 @@ msgstr "l'objet '%s' n'est pas un itérateur" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "objet '%s' n'est pas appelable" +msgstr "l'objet '%s' n'est pas appelable" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "objet '%s' n'est pas itérable" +msgstr "l'objet '%s' n'est pas itérable" #: py/obj.c #, c-format From 81452475e4ce3d3005f7eeb9990c25aa5a378ef2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 31 May 2020 14:27:55 +0000 Subject: [PATCH 743/919] Translated using Weblate (Swedish) Currently translated at 100.0% (748 of 748 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index a0f0494bab..e9c7c7fdf6 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-27 20:51-0500\n" -"PO-Revision-Date: 2020-05-30 02:52+0000\n" -"Last-Translator: Jonny Bergdahl \n" +"PO-Revision-Date: 2020-06-01 13:17+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: LANGUAGE \n" "Language: sv\n" "MIME-Version: 1.0\n" @@ -3166,7 +3166,7 @@ msgstr "oväntat nyckelordsargument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "unicode name escapes" +msgstr "unicode-namn flyr" #: py/parse.c msgid "unindent does not match any outer indentation level" From 1cc281b6a49ab4021be92fed7c2975c9d0fa9697 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:20:23 -0500 Subject: [PATCH 744/919] py.mk: Assume we want all C files from ulab --- py/py.mk | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/py/py.mk b/py/py.mk index a5c8a7dc65..f77e8a201a 100644 --- a/py/py.mk +++ b/py/py.mk @@ -106,19 +106,7 @@ $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif ifeq ($(CIRCUITPY_ULAB),1) -SRC_MOD += $(addprefix extmod/ulab/code/, \ -compare.c \ -create.c \ -extras.c \ -fft.c \ -filter.c \ -linalg.c \ -ndarray.c \ -numerical.c \ -poly.c \ -ulab.c \ -vectorise.c \ - ) +SRC_MOD += $(wildcard extmod/ulab/code/*.c) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif From f211a090e297a71a8a512487aa8a2051caecdc95 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:26:23 -0500 Subject: [PATCH 745/919] py.mk: Assume we want all C source files in ulab --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index f77e8a201a..3cb505920c 100644 --- a/py/py.mk +++ b/py/py.mk @@ -106,7 +106,7 @@ $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) endif ifeq ($(CIRCUITPY_ULAB),1) -SRC_MOD += $(wildcard extmod/ulab/code/*.c) +SRC_MOD += $(patsubst $(TOP)/%,%,$(wildcard $(TOP)/extmod/ulab/code/*.c)) CFLAGS_MOD += -DCIRCUITPY_ULAB=1 -DMODULE_ULAB_ENABLED=1 $(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-float-equal -Wno-sign-compare -DCIRCUITPY endif From 18c659780eeb6cf04430cdf9899197f4851d1bf6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:56:15 -0500 Subject: [PATCH 746/919] ulab: update .. add new modules and functions to our shared-bindings stubs --- extmod/ulab | 2 +- shared-bindings/ulab/approx/__init__.pyi | 52 ++++++++++ shared-bindings/ulab/compare/__init__.pyi | 8 ++ shared-bindings/ulab/vector/__init__.pyi | 116 ++++++++++++---------- 4 files changed, 124 insertions(+), 54 deletions(-) create mode 100644 shared-bindings/ulab/approx/__init__.pyi diff --git a/extmod/ulab b/extmod/ulab index cf61d728e7..cbdd1295c1 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit cf61d728e70b9ec57e5711b40540793a89296f5d +Subproject commit cbdd1295c11e9b810a2712ac5bdfd51381967bf0 diff --git a/shared-bindings/ulab/approx/__init__.pyi b/shared-bindings/ulab/approx/__init__.pyi new file mode 100644 index 0000000000..89f136f690 --- /dev/null +++ b/shared-bindings/ulab/approx/__init__.pyi @@ -0,0 +1,52 @@ +"""Numerical approximation methods""" + +def bisect(fun, a, b, *, xtol=2.4e-7, maxiter=100) -> float: + """ + :param callable f: The function to bisect + :param float a: The left side of the interval + :param float b: The right side of the interval + :param float xtol: The tolerance value + :param float maxiter: The maximum number of iterations to perform + + Find a solution (zero) of the function ``f(x)`` on the interval + (``a``..``b``) using the bisection method. The result is accurate to within + ``xtol`` unless more than ``maxiter`` steps are required.""" + ... + +def newton(fun, x0, *, xtol=2.4e-7, rtol=0.0, maxiter=50) -> float: + """ + :param callable f: The function to bisect + :param float x0: The initial x value + :param float xtol: The absolute tolerance value + :param float rtol: The relative tolerance value + :param float maxiter: The maximum number of iterations to perform + + Find a solution (zero) of the function ``f(x)`` using Newton's Method. + The result is accurate to within ``xtol * rtol * |f(x)|`` unless more than + ``maxiter`` steps are requried.""" + ... + +def fmin(fun, x0, *, xatol=2.4e-7, fatol=2.4e-7, maxiter=200) -> float: + """ + :param callable f: The function to bisect + :param float x0: The initial x value + :param float xatol: The absolute tolerance value + :param float fatol: The relative tolerance value + + Find a minimum of the function ``f(x)`` using the downhill simplex method. + The located ``x`` is within ``fxtol`` of the actual minimum, and ``f(x)`` + is within ``fatol`` of the actual minimum unless more than ``maxiter`` + steps are requried.""" + ... + +def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None) -> ulab.array: + """ + :param ulab.array x: The x-coordinates at which to evaluate the interpolated values. + :param ulab.array xp: The x-coordinates of the data points, must be increasing + :param ulab.array fp: The y-coordinates of the data points, same length as xp + :param left: Value to return for ``x < xp[0]``, default is ``fp[0]``. + :param right: Value to return for ``x > xp[-1]``, default is ``fp[-1]``. + + Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.""" + ... + diff --git a/shared-bindings/ulab/compare/__init__.pyi b/shared-bindings/ulab/compare/__init__.pyi index 00a9eae1e6..1606e43c20 100644 --- a/shared-bindings/ulab/compare/__init__.pyi +++ b/shared-bindings/ulab/compare/__init__.pyi @@ -28,3 +28,11 @@ def minimum(x1, x2): must be the same size. If the inputs are both scalars, a number is returned""" ... + +def equal(x1, x2): + """Return an array of bool which is true where x1[i] == x2[i] and false elsewhere""" + ... + +def not_equal(x1, x2): + """Return an array of bool which is false where x1[i] == x2[i] and true elsewhere""" + ... diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index 2c7a804463..0e590f3c83 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -5,104 +5,114 @@ applying the function to every element in the array. This is typically much more efficient than expressing the same operation as a Python loop.""" def acos(): - """Computes the inverse cosine function""" - ... + """Computes the inverse cosine function""" + ... def acosh(): - """Computes the inverse hyperbolic cosine function""" - ... + """Computes the inverse hyperbolic cosine function""" + ... def asin(): - """Computes the inverse sine function""" - ... + """Computes the inverse sine function""" + ... def asinh(): - """Computes the inverse hyperbolic sine function""" - ... + """Computes the inverse hyperbolic sine function""" + ... def around(a, *, decimals): - """Returns a new float array in which each element is rounded to - ``decimals`` places.""" - ... + """Returns a new float array in which each element is rounded to + ``decimals`` places.""" + ... def atan(): - """Computes the inverse tangent function; the return values are in the - range [-pi/2,pi/2].""" - ... + """Computes the inverse tangent function; the return values are in the + range [-pi/2,pi/2].""" + ... def atan2(y,x): - """Computes the inverse tangent function of y/x; the return values are in - the range [-pi, pi].""" - ... + """Computes the inverse tangent function of y/x; the return values are in + the range [-pi, pi].""" + ... def atanh(): - """Computes the inverse hyperbolic tangent function""" - ... + """Computes the inverse hyperbolic tangent function""" + ... def ceil(): - """Rounds numbers up to the next whole number""" - ... + """Rounds numbers up to the next whole number""" + ... def cos(): - """Computes the cosine function""" - ... + """Computes the cosine function""" + ... def erf(): - """Computes the error function, which has applications in statistics""" - ... + """Computes the error function, which has applications in statistics""" + ... def erfc(): - """Computes the complementary error function, which has applications in statistics""" - ... + """Computes the complementary error function, which has applications in statistics""" + ... def exp(): - """Computes the exponent function.""" - ... + """Computes the exponent function.""" + ... def expm1(): - """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" - ... + """Computes $e^x-1$. In certain applications, using this function preserves numeric accuracy better than the `exp` function.""" + ... def floor(): - """Rounds numbers up to the next whole number""" - ... + """Rounds numbers up to the next whole number""" + ... def gamma(): - """Computes the gamma function""" - ... + """Computes the gamma function""" + ... def lgamma(): - """Computes the natural log of the gamma function""" - ... + """Computes the natural log of the gamma function""" + ... def log(): - """Computes the natural log""" - ... + """Computes the natural log""" + ... def log10(): - """Computes the log base 10""" - ... + """Computes the log base 10""" + ... def log2(): - """Computes the log base 2""" - ... + """Computes the log base 2""" + ... def sin(): - """Computes the sine""" - ... + """Computes the sine""" + ... def sinh(): - """Computes the hyperbolic sine""" - ... + """Computes the hyperbolic sine""" + ... def sqrt(): - """Computes the square root""" - ... + """Computes the square root""" + ... def tan(): - """Computes the tangent""" - ... + """Computes the tangent""" + ... def tanh(): - """Computes the hyperbolic tangent""" - ... + """Computes the hyperbolic tangent""" + ... + +def vectorise(f, *, otypes=None): + """ + :param callable f: The function to wrap + :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. + + Wrap a Python function `f` so that it can be applied to arrays. + + The callable must return only values of the types specified by otypes, or the result is undefined.""" + ... From 9f7a874d029afd5b44f5fbcfa05209184d298513 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 08:56:31 -0500 Subject: [PATCH 747/919] make translate --- locale/ID.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/circuitpython.pot | 46 ++++++++++++++++++++++++++++++++++++---- locale/cs.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/de_DE.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/en_US.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/en_x_pirate.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/es.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/fil.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/fr.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/it_IT.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/ko.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/nl.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/pl.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/pt_BR.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/sv.po | 46 ++++++++++++++++++++++++++++++++++++---- locale/zh_Latn_pinyin.po | 46 ++++++++++++++++++++++++++++++++++++---- 16 files changed, 672 insertions(+), 64 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 60c4cbd416..17d54d3a1f 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -885,7 +885,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" @@ -1372,7 +1373,8 @@ msgid "Running in safe mode! Not running saved code.\n" msgstr "" "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" @@ -2109,6 +2111,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2241,6 +2251,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2294,6 +2312,10 @@ msgstr "fungsi diharapkan setidaknya %d argumen, hanya mendapatkan %d" msgid "function got multiple values for argument '%q'" msgstr "fungsi mendapatkan nilai ganda untuk argumen '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2380,6 +2402,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler harus sebuah fungsi" @@ -2424,6 +2450,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3220,6 +3250,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3232,6 +3266,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3e7fb74e3d..8ccfe64bd6 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -874,7 +874,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1356,7 +1357,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2085,6 +2087,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2217,6 +2227,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2270,6 +2288,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2356,6 +2378,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2400,6 +2426,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3194,6 +3224,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3206,6 +3240,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 737beebdac..38cc92fccd 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -882,7 +882,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -972,7 +972,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1364,7 +1365,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2093,6 +2095,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2225,6 +2235,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2278,6 +2296,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2364,6 +2386,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2408,6 +2434,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3202,6 +3232,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3214,6 +3248,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 429aedc296..69948e690b 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-29 17:42+0000\n" "Last-Translator: Thomas Friehoff \n" "Language-Team: German = 2 und <= 36 sein" msgid "integer required" msgstr "integer erforderlich" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3292,6 +3322,10 @@ msgstr "falscher Argumenttyp" msgid "wrong index type" msgstr "falscher Indextyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -3304,6 +3338,10 @@ msgstr "falsche Anzahl zu entpackender Werte" msgid "wrong operand type" msgstr "falscher Operandentyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x Wert außerhalb der Grenzen" diff --git a/locale/en_US.po b/locale/en_US.po index 5f2ea4ea5b..579fc6501e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -874,7 +874,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -964,7 +964,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "" @@ -1356,7 +1357,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2085,6 +2087,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2217,6 +2227,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2270,6 +2288,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2356,6 +2378,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2400,6 +2426,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3194,6 +3224,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3206,6 +3240,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 5428d69021..b240ab689b 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 11:55-0400\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language-Team: English \n" "Language-Team: \n" @@ -883,7 +883,7 @@ msgstr "Archivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -973,7 +973,8 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "pines inválidos" @@ -1374,7 +1375,8 @@ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" @@ -2116,6 +2118,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2250,6 +2260,14 @@ msgstr "el archivo deberia ser una archivo abierto en modo byte" msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2303,6 +2321,10 @@ msgstr "la función esperaba minimo %d argumentos, tiene %d" msgid "function got multiple values for argument '%q'" msgstr "la función tiene múltiples valores para el argumento '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2389,6 +2411,10 @@ msgstr "indices deben ser enteros" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "ensamblador en línea debe ser una función" @@ -2433,6 +2459,10 @@ msgstr "int() arg 2 debe ser >= 2 y <= 36" msgid "integer required" msgstr "Entero requerido" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3237,6 +3267,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -3249,6 +3283,10 @@ msgstr "numero erroneo de valores a descomprimir" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fil.po b/locale/fil.po index 08052a9beb..e4c52dced6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -890,7 +890,7 @@ msgstr "Mali ang BMP file" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -980,7 +980,8 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Mali ang pins" @@ -1379,7 +1380,8 @@ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" @@ -2125,6 +2127,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2262,6 +2272,14 @@ msgstr "file ay dapat buksan sa byte mode" msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2315,6 +2333,10 @@ msgstr "function na inaasahang %d ang argumento, ngunit %d ang nakuha" msgid "function got multiple values for argument '%q'" msgstr "ang function ay nakakuha ng maraming values para sa argument '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2402,6 +2424,10 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler ay dapat na function" @@ -2446,6 +2472,10 @@ msgstr "int() arg 2 ay dapat >=2 at <= 36" msgid "integer required" msgstr "kailangan ng int" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3250,6 +3280,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -3262,6 +3296,10 @@ msgstr "maling number ng value na i-unpack" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/fr.po b/locale/fr.po index fe16dbdc74..82208da6ac 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-26 19:37+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: French =2 et <=36" msgid "integer required" msgstr "entier requis" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3290,6 +3320,10 @@ msgstr "type d'argument incorrect" msgid "wrong index type" msgstr "type d'index incorrect" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" @@ -3302,6 +3336,10 @@ msgstr "mauvais nombre de valeurs à dégrouper" msgid "wrong operand type" msgstr "type d'opérande incorrect" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "valeur x hors limites" diff --git a/locale/it_IT.po b/locale/it_IT.po index 4225fe3371..960542a04e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -890,7 +890,7 @@ msgstr "File BMP non valido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -982,7 +982,8 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pin non validi" @@ -1388,7 +1389,8 @@ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" @@ -2127,6 +2129,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2263,6 +2273,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2316,6 +2334,10 @@ msgstr "la funzione prevede al massimo %d argmoneti, ma ne ha ricevuti %d" msgid "function got multiple values for argument '%q'" msgstr "la funzione ha ricevuto valori multipli per l'argomento '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2403,6 +2425,10 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler deve essere una funzione" @@ -2447,6 +2473,10 @@ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" msgid "integer required" msgstr "intero richiesto" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3257,6 +3287,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -3269,6 +3303,10 @@ msgstr "numero di valori da scompattare non corretto" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c #, fuzzy msgid "x value out of bounds" diff --git a/locale/ko.po b/locale/ko.po index af4fd3e7e6..4f31e320df 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -878,7 +878,7 @@ msgstr "" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -968,7 +968,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" @@ -1360,7 +1361,8 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -2090,6 +2092,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2222,6 +2232,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2275,6 +2293,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2361,6 +2383,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2405,6 +2431,10 @@ msgstr "" msgid "integer required" msgstr "정수가 필요합니다" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3199,6 +3229,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3211,6 +3245,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 55241b3bd0..13ca26261e 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-31 11:41+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -894,7 +894,7 @@ msgstr "Ongeldig BMP bestand" msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Ongeldige I2C pin selectie" @@ -984,7 +984,8 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1390,7 +1391,8 @@ msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA of SCL hebben een pullup nodig" @@ -2136,6 +2138,14 @@ msgstr "kon de invoerarray niet vanuit vorm uitzenden" msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof kleiner dan de lengte van de data set" @@ -2270,6 +2280,14 @@ msgstr "bestand moet een bestand zijn geopend in byte modus" msgid "filesystem must provide mount method" msgstr "bestandssysteem moet een mount methode bieden" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "eerst argument moet een iterabel zijn" @@ -2323,6 +2341,10 @@ msgstr "functie verwachtte op zijn meest %d argumenten, maar kreeg %d" msgid "function got multiple values for argument '%q'" msgstr "functie kreeg meedere waarden voor argument '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funtie is alleen geïmplementeerd voor scalars en ndarrays" @@ -2410,6 +2432,10 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler moet een functie zijn" @@ -2454,6 +2480,10 @@ msgstr "int() argument 2 moet >=2 en <= 36 zijn" msgid "integer required" msgstr "integer vereist" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3254,6 +3284,10 @@ msgstr "onjuist argumenttype" msgid "wrong index type" msgstr "onjuist indextype" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -3266,6 +3300,10 @@ msgstr "verkeerd aantal waarden om uit te pakken" msgid "wrong operand type" msgstr "verkeerd operandtype" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x-waarde buiten bereik" diff --git a/locale/pl.po b/locale/pl.po index b218a7b7c1..694e1d3519 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -879,7 +879,7 @@ msgstr "Zły BMP" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -969,7 +969,8 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Złe nóżki" @@ -1361,7 +1362,8 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" @@ -2093,6 +2095,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2226,6 +2236,14 @@ msgstr "file musi być otwarte w trybie bajtowym" msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodę mount" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2279,6 +2297,10 @@ msgstr "funkcja bierze najwyżej %d argumentów, jest %d" msgid "function got multiple values for argument '%q'" msgstr "funkcja dostała wiele wartości dla argumentu '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2365,6 +2387,10 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "wtrącony asembler musi być funkcją" @@ -2409,6 +2435,10 @@ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" msgid "integer required" msgstr "wymagana liczba całkowita" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3205,6 +3235,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -3217,6 +3251,10 @@ msgstr "zła liczba wartości do rozpakowania" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 7223c2e026..e8e42fa20a 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -883,7 +883,7 @@ msgstr "Arquivo BMP inválido" msgid "Invalid DAC pin supplied" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "" @@ -975,7 +975,8 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Pinos inválidos" @@ -1373,7 +1374,8 @@ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" @@ -2106,6 +2108,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2239,6 +2249,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2292,6 +2310,10 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2378,6 +2400,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2422,6 +2448,10 @@ msgstr "" msgid "integer required" msgstr "inteiro requerido" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3218,6 +3248,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3230,6 +3264,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index a0f0494bab..768ec21bfa 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -893,7 +893,7 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Ogiltigt val av I2C-pinne" @@ -983,7 +983,8 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" @@ -1387,7 +1388,8 @@ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Kör i säkert läge! Sparad kod körs inte.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA eller SCL behöver en pullup" @@ -2133,6 +2135,14 @@ msgstr "Kan inte sända indatamatris från form" msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "ddof måste vara mindre än längden på datauppsättningen" @@ -2268,6 +2278,14 @@ msgstr "filen måste vara en fil som öppnats i byte-läge" msgid "filesystem must provide mount method" msgstr "filsystemet måste tillhandahålla mount-metod" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "första argumentet måste vara en iterable" @@ -2321,6 +2339,10 @@ msgstr "funktionen förväntar som mest %d argument, fick %d" msgid "function got multiple values for argument '%q'" msgstr "funktionen fick flera värden för argumentet '%q'" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "funktionen är endast implementerad för scalar och ndarray" @@ -2407,6 +2429,10 @@ msgstr "index måste vara heltal" msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "inline assembler måste vara en funktion" @@ -2451,6 +2477,10 @@ msgstr "int() arg 2 måste vara >= 2 och <= 36" msgid "integer required" msgstr "heltal krävs" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3251,6 +3281,10 @@ msgstr "fel typ av argument" msgid "wrong index type" msgstr "fel indextyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -3263,6 +3297,10 @@ msgstr "fel antal värden för att packa upp" msgid "wrong operand type" msgstr "fel operandtyp" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x-värde utanför intervall" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 289fd03a57..d2fb379dbf 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -887,7 +887,7 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid DAC pin supplied" msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" -#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" msgstr "Wúxiào de I2C yǐn jiǎo xuǎnzé" @@ -977,7 +977,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/SPI.c +#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" @@ -1375,7 +1376,8 @@ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ g msgid "Running in safe mode! Not running saved code.\n" msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" @@ -2121,6 +2123,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2254,6 +2264,14 @@ msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" msgid "filesystem must provide mount method" msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2307,6 +2325,10 @@ msgstr "hánshù yùjì zuìduō %d cānshù, huòdé %d" msgid "function got multiple values for argument '%q'" msgstr "hánshù huòdé cānshù '%q' de duōchóng zhí" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2393,6 +2415,10 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "nèi lián jíhé bìxū shì yīgè hánshù" @@ -2437,6 +2463,10 @@ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" msgid "integer required" msgstr "xūyào zhěngshù" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3235,6 +3265,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -3247,6 +3281,10 @@ msgstr "wúfǎ jiě bāo de zhí shù" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "x zhí chāochū biānjiè" From 5061405eb3c231473cada799884285c5bd46f8ba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 09:16:55 -0500 Subject: [PATCH 748/919] fix spelling --- shared-bindings/ulab/vector/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index 0e590f3c83..ea2f729aa7 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -107,7 +107,7 @@ def tanh(): """Computes the hyperbolic tangent""" ... -def vectorise(f, *, otypes=None): +def vectorize(f, *, otypes=None): """ :param callable f: The function to wrap :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. From 8af77cb91fa848540e52740e9ed21b969be9cf4f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 11:02:51 -0500 Subject: [PATCH 749/919] ulab: docs: Fix markup error --- shared-bindings/ulab/vector/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/ulab/vector/__init__.pyi b/shared-bindings/ulab/vector/__init__.pyi index ea2f729aa7..bf57e419cd 100644 --- a/shared-bindings/ulab/vector/__init__.pyi +++ b/shared-bindings/ulab/vector/__init__.pyi @@ -112,7 +112,7 @@ def vectorize(f, *, otypes=None): :param callable f: The function to wrap :param otypes: List of array types that may be returned by the function. None is intepreted to mean the return value is float. - Wrap a Python function `f` so that it can be applied to arrays. + Wrap a Python function ``f`` so that it can be applied to arrays. The callable must return only values of the types specified by otypes, or the result is undefined.""" ... From 7f3fd20ea9c6aa6f04ff8901d9fb316fa24194af Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 11:03:38 -0500 Subject: [PATCH 750/919] ulab: update submodule again --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index cbdd1295c1..0394801933 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit cbdd1295c11e9b810a2712ac5bdfd51381967bf0 +Subproject commit 0394801933f6e68a5bc7cdb0da76c7884e8cf70a From 75eb44f234f53767df359c2b1b7651b017352ef1 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 1 Jun 2020 12:20:37 -0400 Subject: [PATCH 751/919] Note temporary issue with Nucleo boards --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 2 +- ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 1fc5d37ee6..cd2c61b919 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -34,7 +34,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 314c96cb5a..1dcb26f49e 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -33,4 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 8909cc5be1..14c2dfe308 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -32,4 +32,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index ae21176aee..cace54e9b0 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -39,7 +39,7 @@ #define BOARD_OSC_PLLN (400) #define BOARD_OSC_PLLQ (9) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 #define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 From 7e632c9414073a36db0b74d891ee0408a2fdb565 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 1 Jun 2020 17:11:20 -0700 Subject: [PATCH 752/919] Update translations --- locale/circuitpython.pot | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0167992b5d..11ecb99e8c 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 16:52-0700\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2107,6 +2107,14 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: extmod/ulab/code/approx.c +msgid "data must be iterable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "data must be of equal length" +msgstr "" + #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" msgstr "" @@ -2239,6 +2247,14 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "first argument must be a callable" +msgstr "" + +#: extmod/ulab/code/approx.c +msgid "first argument must be a function" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" msgstr "" @@ -2292,6 +2308,10 @@ msgstr "" msgid "function got multiple values for argument '%q'" msgstr "" +#: extmod/ulab/code/approx.c +msgid "function has the same sign at the ends of interval" +msgstr "" + #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" msgstr "" @@ -2378,6 +2398,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: extmod/ulab/code/approx.c +msgid "initial values must be iterable" +msgstr "" + #: py/compile.c msgid "inline assembler must be a function" msgstr "" @@ -2422,6 +2446,10 @@ msgstr "" msgid "integer required" msgstr "" +#: extmod/ulab/code/approx.c +msgid "interp is defined for 1D arrays of equal length" +msgstr "" + #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" @@ -3224,6 +3252,10 @@ msgstr "" msgid "wrong index type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong input type" +msgstr "" + #: py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -3236,6 +3268,10 @@ msgstr "" msgid "wrong operand type" msgstr "" +#: extmod/ulab/code/vectorise.c +msgid "wrong output type" +msgstr "" + #: shared-module/displayio/Shape.c msgid "x value out of bounds" msgstr "" From 0722dafc2464b414e680fab700f3f84cd54879df Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 1 Jun 2020 19:10:35 -0500 Subject: [PATCH 753/919] audiomixer: Fix garbled playback when voice 0 is stopped, audio pops There were two main problems - word_buffer was being filled as though with unsigned samples, but during mixing all samples are kept in signed mode - If the first buffer was stopped, the voices_active flag got set anyway, even though the output buffer wasn't initialized yet, so the samples were mixed with indeterminate data We also cover the case where no buffer was playing, and ensure the output buffer is filled. This now works much better. Tested on neotrellis m4 playing back 4 mp3 streams at a time in signed-16, 22050Hz --- shared-module/audiomixer/Mixer.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index 4a72dab28d..6c1ba1973e 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -143,19 +143,17 @@ static inline uint32_t pack8(uint32_t val) { static void mix_down_one_voice(audiomixer_mixer_obj_t* self, audiomixer_mixervoice_obj_t* voice, bool voices_active, uint32_t* word_buffer, uint32_t length) { - bool voice_done = voice->sample == NULL; - while (!voice_done && length != 0) { + while (length != 0) { if (voice->buffer_length == 0) { if (!voice->more_data) { if (voice->loop) { audiosample_reset_buffer(voice->sample, false, 0); } else { voice->sample = NULL; - voice_done = true; break; } } - if (!voice_done) { + if (voice->sample) { // Load another buffer audioio_get_buffer_result_t result = audiosample_get_buffer(voice->sample, false, 0, (uint8_t**) &voice->remaining_buffer, &voice->buffer_length); // Track length in terms of words. @@ -230,10 +228,8 @@ static void mix_down_one_voice(audiomixer_mixer_obj_t* self, } if (length && !voices_active) { - uint32_t sample_value = self->bits_per_sample == 8 - ? 0x80808080 : 0x80008000; for (uint32_t i = 0; ivoice_count; v++) { audiomixer_mixervoice_obj_t* voice = MP_OBJ_TO_PTR(self->voice[v]); + if(voice->sample) { + mix_down_one_voice(self, voice, voices_active, word_buffer, length); + voices_active = true; + } + } - mix_down_one_voice(self, voice, voices_active, word_buffer, length); - voices_active = true; + if (!voices_active) { + for (uint32_t i = 0; isamples_signed) { From ed8a52d1db09930e2edcf434ca45e8f682ddd4b8 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 2 Jun 2020 10:19:40 +0800 Subject: [PATCH 754/919] litex: remove call to `board_init()` These calls were all moved into `main.c`, however this call was not removed from litex. As a result, litex was calling `board_init()` twice. This is currently not a problem, as `fomu` is able to be initialized twice without issue, however future boards may have issue with this. This fixes #2991. Signed-off-by: Sean Cross --- ports/litex/supervisor/port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/litex/supervisor/port.c b/ports/litex/supervisor/port.c index 4721d82fad..3125072e60 100644 --- a/ports/litex/supervisor/port.c +++ b/ports/litex/supervisor/port.c @@ -68,7 +68,6 @@ safe_mode_t port_init(void) { irq_setmask(0); irq_setie(1); tick_init(); - board_init(); return NO_SAFE_MODE; } From 96c6fbd10b6592aa2282111f3a9a7b498a20435e Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 2 Jun 2020 01:51:02 +0200 Subject: [PATCH 755/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index 1dcf5f0042..7e9f3b4381 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 20:51-0500\n" +"POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: David Glaude \n" "Language-Team: French Date: Tue, 2 Jun 2020 17:23:43 +0000 Subject: [PATCH 756/919] Translated using Weblate (Dutch) Currently translated at 100.0% (757 of 757 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 13ca26261e..febfa39dae 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 08:56-0500\n" -"PO-Revision-Date: 2020-05-31 11:41+0000\n" +"PO-Revision-Date: 2020-06-02 17:33+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -1771,7 +1771,7 @@ msgstr "argsort argument moet een ndarray zijn" #: py/runtime.c msgid "argument has wrong type" -msgstr "argument heeft het verkeerde type" +msgstr "argument heeft onjuist type" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c @@ -2140,11 +2140,11 @@ msgstr "kon de Vandermonde matrix niet omkeren" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "data moet itereerbaar zijn" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "data moet van gelijke lengte zijn" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2282,11 +2282,11 @@ msgstr "bestandssysteem moet een mount methode bieden" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "eerste argument moet een aanroepbare (callable) zijn" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "eerste argument moet een functie zijn" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2343,7 +2343,7 @@ msgstr "functie kreeg meedere waarden voor argument '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "functie heeft hetzelfde teken aan beide uiteinden van het interval" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2434,7 +2434,7 @@ msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "oorspronkelijke waarden moeten itereerbaar zijn" #: py/compile.c msgid "inline assembler must be a function" @@ -2482,7 +2482,7 @@ msgstr "integer vereist" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3286,7 +3286,7 @@ msgstr "onjuist indextype" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "onjuist invoertype" #: py/objstr.c msgid "wrong number of arguments" @@ -3302,7 +3302,7 @@ msgstr "verkeerd operandtype" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "onjuist uitvoer type" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From 3f26a56fff80844924ea0adc876f35218e263514 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 2 Jun 2020 19:33:38 +0200 Subject: [PATCH 757/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 30 +++++++++++++++++++++++++++++- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 13 files changed, 377 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 17d54d3a1f..c40ac105c5 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1669,6 +1669,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3084,6 +3104,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3238,6 +3262,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 38cc92fccd..39bf51af8e 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -1660,6 +1660,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3067,6 +3087,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3220,6 +3244,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 69948e690b..76a0eec831 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-29 17:42+0000\n" "Last-Translator: Thomas Friehoff \n" "Language-Team: German 0" msgstr "value_count muss größer als 0 sein" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Fenster muss <= Intervall sein" diff --git a/locale/es.po b/locale/es.po index b41121c4d3..5fe0f945ad 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-17 20:56+0000\n" "Last-Translator: Jeff Epler \n" "Language-Team: \n" @@ -1671,6 +1671,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3102,6 +3122,10 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3255,6 +3279,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fil.po b/locale/fil.po index e4c52dced6..66ccc711ac 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1679,6 +1679,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3114,6 +3134,10 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3268,6 +3292,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 7e9f3b4381..6a3e08bab5 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-01 13:17+0000\n" "Last-Translator: David Glaude \n" "Language-Team: French 0" msgstr "'value_count' doit être > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "la fenêtre doit être <= intervalle" diff --git a/locale/it_IT.po b/locale/it_IT.po index 960542a04e..01368e88a8 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1688,6 +1688,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3121,6 +3141,10 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3275,6 +3299,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 4f31e320df..27f8216f83 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -1657,6 +1657,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3064,6 +3084,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3217,6 +3241,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index febfa39dae..52a8bdc960 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-02 17:33+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -1696,6 +1696,26 @@ msgstr "Voltage lees time-out" msgid "WARNING: Your code filename has two extensions\n" msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3119,6 +3139,10 @@ msgstr "drempelwaarde moet in het bereik 0-65536 liggen" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" @@ -3272,6 +3296,10 @@ msgstr "waarde moet in %d byte(s) passen" msgid "value_count must be > 0" msgstr "value_count moet groter dan 0 zijn" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window moet <= interval zijn" diff --git a/locale/pl.po b/locale/pl.po index 694e1d3519..0e82359f9b 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -1657,6 +1657,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3070,6 +3090,10 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3223,6 +3247,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e8e42fa20a..308809a2be 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -1670,6 +1670,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "AVISO: Seu arquivo de código tem duas extensões\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3082,6 +3102,10 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3236,6 +3260,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/sv.po b/locale/sv.po index 1f41b3fec8..7823cc05bf 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-05-30 02:52+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1693,6 +1693,26 @@ msgstr "Avläsning av spänning tog för lång tid" msgid "WARNING: Your code filename has two extensions\n" msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3116,6 +3136,10 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "timeout måste vara 0.0-100.0 sekunder" @@ -3269,6 +3293,10 @@ msgstr "värdet måste passa i %d byte(s)" msgid "value_count must be > 0" msgstr "value_count måste vara > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "window måste vara <= interval" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d2fb379dbf..9f44fbd9ef 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1680,6 +1680,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -3100,6 +3120,10 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" @@ -3253,6 +3277,10 @@ msgstr "Zhí bìxū fúhé %d zì jié" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "Chuāngkǒu bìxū shì <= jiàngé" From 048b30d65419f217c122a17572ae1fcfa72efbbf Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 2 Jun 2020 18:04:27 +0000 Subject: [PATCH 758/919] Translated using Weblate (French) Currently translated at 99.8% (763 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 6a3e08bab5..9c7adb7e00 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-01 13:17+0000\n" -"Last-Translator: David Glaude \n" +"PO-Revision-Date: 2020-06-02 19:50+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: French \n" "Language: fr\n" @@ -1716,18 +1716,22 @@ msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé " +"sur RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer n'est pas en cours d'exécution" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode ne peut pas être changé une fois réglé pour WatchDogMode." +"RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout doit être supérieur à 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." @@ -2187,11 +2191,11 @@ msgstr "n'a pas pu inverser la matrice Vandermonde" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "les données doivent être les objets iterables" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "les données doivent être de longueur égale" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2331,11 +2335,11 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "le premier argument doit être un appelable" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "le premier argument doit être une fonction" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2392,7 +2396,7 @@ msgstr "la fonction a reçu plusieurs valeurs pour l'argument '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "la fonction a le même signe aux extrémités de l’intervalle" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2484,7 +2488,7 @@ msgstr "" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "les valeurs initiales doivent être itérables" #: py/compile.c msgid "inline assembler must be a function" @@ -2532,7 +2536,7 @@ msgstr "entier requis" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp est défini pour les tableaux 1D de longueur égale" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3177,7 +3181,7 @@ msgstr "time.struct_time() prend une séquence de longueur 9" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "le délai d'expiration a dépassé la valeur maximale prise en charge" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3334,7 +3338,7 @@ msgstr "'value_count' doit être > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog timeout doit être supérieur à 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3350,7 +3354,7 @@ msgstr "type d'index incorrect" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "type d'entrée incorrect" #: py/objstr.c msgid "wrong number of arguments" @@ -3366,7 +3370,7 @@ msgstr "type d'opérande incorrect" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "type de sortie incorrect" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From fa8890f7ba4709c1657f2913f487b50d9808a999 Mon Sep 17 00:00:00 2001 From: _fonzlate Date: Tue, 2 Jun 2020 17:33:42 +0000 Subject: [PATCH 759/919] Translated using Weblate (Dutch) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/nl/ --- locale/nl.po | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/locale/nl.po b/locale/nl.po index 52a8bdc960..5be371d83f 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 17:33+0000\n" +"PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" "Language: nl\n" @@ -1699,22 +1699,26 @@ msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"WatchDogTimer kan niet worden gedeïnitialiseerd zodra de modus in ingesteld " +"op RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer is momenteel niet actief" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode kan niet worden gewijzigd zodra de modus is ingesteld op " +"WatchDogMode.RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout moet groter dan 0 zijn" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Watchdog-timer verstreken." #: py/builtinhelp.c #, c-format @@ -3141,7 +3145,7 @@ msgstr "time.struct_time() accepteert een 9-rij" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "time-outduur is groter dan de ondersteunde maximale waarde" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3298,7 +3302,7 @@ msgstr "value_count moet groter dan 0 zijn" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog time-out moet groter zijn dan 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" From cc1e5d29c7348fee9edd91ff17515d2c98726e81 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 2 Jun 2020 20:59:34 +0000 Subject: [PATCH 760/919] Translated using Weblate (Swedish) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 7823cc05bf..58e810c4c2 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-30 02:52+0000\n" +"PO-Revision-Date: 2020-06-02 21:42+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -33,7 +33,7 @@ msgid "" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" "\n" -"Skapa ett ärende med innehållet i din CIRCUITPY på\n" +"Vänligen skapa ett ärende med innehållet i din CIRCUITPY-enhet på\n" "https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c @@ -42,7 +42,7 @@ msgid "" "To exit, please reset the board without " msgstr "" "\n" -"För att avsluta, resetta kortet utan " +"För att avsluta, gör reset på kortet utan " #: py/obj.c msgid " File \"%q\"" @@ -108,7 +108,7 @@ msgstr "'%q' argument krävs" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "'%s' förväntar sig en etikett" +msgstr "'%s' förväntar sig en label" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -1695,23 +1695,24 @@ msgstr "VARNING: Ditt filnamn för kod har två tillägg\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" -msgstr "" +msgstr "WatchDogTimer kan inte avinitialiseras när läget är inställt på RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer körs för närvarande inte" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"WatchDogTimer.mode kan inte ändras när den är inställd på WatchDogMode.RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "WatchDogTimer.timeout måste vara större än 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Watchdog-timern har löpt ut." #: py/builtinhelp.c #, c-format @@ -2157,11 +2158,11 @@ msgstr "kan inte invertera Vandermonde-matris" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "data måste vara itererbar" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "data måste vara av samma längd" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2300,11 +2301,11 @@ msgstr "filsystemet måste tillhandahålla mount-metod" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "första argumentet måste vara en callable" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "första argumentet måste vara en funktion" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" @@ -2361,7 +2362,7 @@ msgstr "funktionen fick flera värden för argumentet '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "funktionen har samma teckenvärden vid slutet av intervall" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" @@ -2451,7 +2452,7 @@ msgstr "index måste vara heltal, slices, eller Boolean-listor" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "initialvärden måste vara iterable" #: py/compile.c msgid "inline assembler must be a function" @@ -2499,7 +2500,7 @@ msgstr "heltal krävs" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "interp är definierad för 1D-matriser med samma längd" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3138,7 +3139,7 @@ msgstr "time.struct_time() kräver en 9-sekvens" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "timeout-längd överskred det maximala värde som stöds" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" @@ -3295,7 +3296,7 @@ msgstr "value_count måste vara > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "watchdog timeout måste vara större än 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" @@ -3311,7 +3312,7 @@ msgstr "fel indextyp" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "fel indatatyp" #: py/objstr.c msgid "wrong number of arguments" @@ -3327,7 +3328,7 @@ msgstr "fel operandtyp" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "fel utdatatyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From b5b9a569185efa434aae6fae463bfb8ebd3104b4 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 2 Jun 2020 18:05:59 -0400 Subject: [PATCH 761/919] Update teensy 4.0/4.1 pin protections --- ports/mimxrt10xx/boards/teensy40/board.c | 18 ++++++++++-------- ports/mimxrt10xx/boards/teensy41/board.c | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index a16e901037..28786ab902 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -30,11 +30,6 @@ #include "shared-bindings/microcontroller/Pin.h" void board_init(void) { - // SWD Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO - common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK - common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO - // FLEX flash common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); @@ -43,9 +38,16 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); - // USB Pins - common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); - common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 52dd498b3f..f9dea01f70 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -29,6 +29,24 @@ #include "mpconfigboard.h" void board_init(void) { + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); } bool board_requests_safe_mode(void) { From 60df6170cc5d0e495fde9613c05c55b64189b425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 30 May 2020 10:42:29 +0100 Subject: [PATCH 762/919] Update CODE_OF_CONDUCT.md from source-of-truth repository. --- CODE_OF_CONDUCT.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7eb8d93eae..be1966ce1e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,9 @@ + # Adafruit Community Code of Conduct ## Our Pledge @@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include: The goal of the standards and moderation guidelines outlined here is to build and maintain a respectful community. We ask that you don’t just aim to be -"technically unimpeachable", but rather try to be your best self. +"technically unimpeachable", but rather try to be your best self. We value many things beyond technical expertise, including collaboration and supporting others within our community. Providing a positive experience for @@ -74,9 +80,9 @@ You may report in the following ways: In any situation, you may send an email to . On the Adafruit Discord, you may send an open message from any channel -to all Community Moderators by tagging @community moderators. You may -also send an open message from any channel, or a direct message to -@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, +to all Community Moderators by tagging @community moderators. You may +also send an open message from any channel, or a direct message to +@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442, @sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175. Email and direct message reports will be kept confidential. From dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 30 May 2020 10:44:13 +0100 Subject: [PATCH 763/919] Fix up end of file and trailing whitespace. This can be enforced by pre-commit, but correct it separately to make it easier to review. --- .github/workflows/create_website_pr.yml | 2 +- BUILDING.md | 6 +- docs/README.md | 4 +- drivers/wiznet5k/ethernet/socket.c | 104 +++--- drivers/wiznet5k/ethernet/socket.h | 102 +++--- drivers/wiznet5k/ethernet/w5200/w5200.c | 38 +-- drivers/wiznet5k/ethernet/w5200/w5200.h | 82 ++--- drivers/wiznet5k/ethernet/w5500/w5500.c | 47 ++- drivers/wiznet5k/ethernet/w5500/w5500.h | 82 ++--- drivers/wiznet5k/ethernet/wizchip_conf.c | 80 ++--- drivers/wiznet5k/ethernet/wizchip_conf.h | 162 +++++----- drivers/wiznet5k/internet/dhcp/dhcp.h | 54 ++-- drivers/wiznet5k/internet/dns/dns.c | 42 +-- drivers/wiznet5k/internet/dns/dns.h | 40 +-- extmod/font_petme128_8x8.h | 2 +- lib/libm/ef_rem_pio2.c | 50 +-- lib/libm/ef_sqrt.c | 14 +- lib/libm/erf_lgamma.c | 14 +- lib/libm/fdlibm.h | 20 +- lib/libm/kf_cos.c | 8 +- lib/libm/kf_rem_pio2.c | 32 +- lib/libm/kf_sin.c | 6 +- lib/libm/kf_tan.c | 8 +- lib/libm/sf_cos.c | 2 +- lib/libm/sf_erf.c | 16 +- lib/libm/sf_frexp.c | 2 +- lib/libm/sf_ldexp.c | 2 +- lib/libm/sf_modf.c | 2 +- lib/libm/sf_sin.c | 2 +- lib/libm/sf_tan.c | 2 +- lib/libm/wf_lgamma.c | 8 +- lib/libm_dbl/__signbit.c | 2 - lib/memzip/README.md | 1 - lib/memzip/lexermemzip.c | 1 - lib/memzip/make-memzip.py | 1 - lib/oofatfs/option/ccsbcs.c | 1 - lib/tinytest/README | 1 - lib/tinytest/tinytest.c | 1 - logo/adafruit_blinka_angles-back.svg | 2 +- logo/adafruit_blinka_angles-front.svg | 2 +- logo/adafruit_blinka_angles-left.svg | 2 +- logo/adafruit_blinka_angles-right.svg | 2 +- logo/adafruit_blinka_computer.svg | 2 +- ...adafruit_circuit_python_ourboros_color.svg | 2 +- ...it_circuit_python_ouroboros_logo_final.svg | 2 +- .../adafruit_circuit_python_sitting_color.svg | 2 +- ...rcuit_python_stacked_lockup_logo_final.svg | 2 +- logo/awesome_circuitpython.svg | 2 +- logo/blinka_colorform-cooking.svg | 2 +- logo/blinka_colorform-first-birthday.svg | 2 +- logo/blinka_colorform-painting.svg | 2 +- logo/blinka_colorform-reading.svg | 2 +- logo/blinka_colorform-singing.svg | 2 +- logo/blinka_colorform-telescope.svg | 2 +- logo/blinka_colorform-test_tubes.svg | 2 +- mpy-cross/mpconfigport.h | 2 +- ports/atmel-samd/boards/8086_commander/pins.c | 2 +- .../boards/aloriumtech_evo_m51/board.c | 2 +- .../boards/capablerobot_usbhub/pins.c | 2 +- .../circuitbrains_basic_m0/mpconfigboard.h | 2 +- .../circuitbrains_basic_m0/mpconfigboard.mk | 1 - ports/atmel-samd/boards/datum_distance/pins.c | 2 +- ports/atmel-samd/boards/datum_imu/pins.c | 2 +- ports/atmel-samd/boards/datum_light/pins.c | 2 +- ports/atmel-samd/boards/datum_weather/pins.c | 2 +- .../boards/escornabot_makech/pins.c | 12 +- .../feather_m4_express/mpconfigboard.mk | 1 - .../mpconfigboard.mk | 1 - .../boards/hallowing_m4_express/pins.c | 2 +- .../atmel-samd/boards/kicksat-sprite/board.c | 2 +- ports/atmel-samd/boards/kicksat-sprite/pins.c | 6 +- .../boards/monster_m4sk/mpconfigboard.h | 3 - .../boards/ndgarage_ndbit6/mpconfigboard.h | 1 - .../boards/ndgarage_ndbit6/mpconfigboard.mk | 1 - .../atmel-samd/boards/ndgarage_ndbit6/pins.c | 2 +- ports/atmel-samd/boards/pycubed/board.c | 2 +- .../atmel-samd/boards/pycubed/mpconfigboard.h | 2 +- ports/atmel-samd/boards/pycubed/pins.c | 8 +- ports/atmel-samd/boards/pycubed_mram/board.c | 2 +- ports/atmel-samd/boards/pygamer/pins.c | 2 +- .../atmel-samd/boards/pygamer_advance/pins.c | 2 +- ports/atmel-samd/boards/robohatmm1_m4/pins.c | 2 +- ports/atmel-samd/boards/sam32/board.c | 2 +- .../atmel-samd/boards/sam32/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/sam32/pins.c | 10 +- ports/atmel-samd/boards/serpente/pins.c | 1 - .../sparkfun_qwiic_micro_no_flash/pins.c | 4 +- .../sparkfun_qwiic_micro_with_flash/pins.c | 4 +- ports/atmel-samd/common-hal/countio/Counter.c | 14 +- .../common-hal/neopixel_write/__init__.c | 1 - .../common-hal/supervisor/__init__.c | 2 +- ports/cxd56/boards/spresense/mpconfigboard.h | 1 - ports/cxd56/common-hal/busio/I2C.c | 2 +- ports/cxd56/common-hal/busio/SPI.c | 2 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 2 +- ports/cxd56/mkspk/.gitignore | 1 - ports/cxd56/supervisor/port.c | 1 - ports/esp32s2/common-hal/supervisor/Runtime.c | 1 - .../esp32s2/common-hal/supervisor/__init__.c | 2 +- ports/esp32s2/supervisor/internal_flash.c | 1 - ports/esp32s2/supervisor/usb.c | 1 - ports/litex/common-hal/supervisor/Runtime.c | 1 - ports/litex/common-hal/supervisor/__init__.c | 2 +- ports/litex/hw/common.h | 2 +- ports/litex/irq.h | 2 +- ports/litex/supervisor/internal_flash.c | 1 - .../boards/imxrt1020_evk/flash_config.c | 2 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 4 +- .../common-hal/microcontroller/Pin.c | 8 +- .../common-hal/supervisor/__init__.c | 2 +- .../mimxrt10xx/MIMXRT1011/periph.c | 2 +- .../mimxrt10xx/MIMXRT1021/periph.c | 2 +- .../mimxrt10xx/MIMXRT1062/periph.c | 4 +- ports/mimxrt10xx/supervisor/internal_flash.c | 1 - ports/mimxrt10xx/supervisor/port.c | 2 +- ports/mimxrt10xx/supervisor/serial.c | 1 - .../s140_nrf52_6.1.0_API/doc/ble_api.dox | 23 +- .../s140_nrf52_6.1.0_API/include/ble.h | 2 +- .../s140_nrf52_6.1.0_API/include/ble_gap.h | 2 +- .../s140_nrf52_7.0.1_API/doc/ble_api.dox | 39 ++- .../s140_nrf52_7.0.1_API/include/ble.h | 12 +- .../boards/electronut_labs_papyr/README.md | 2 +- .../nrf/boards/hiibot_bluefi/mpconfigboard.h | 3 - .../nrf/boards/hiibot_bluefi/mpconfigboard.mk | 1 - .../boards/particle_argon/mpconfigboard.mk | 2 +- .../boards/particle_boron/mpconfigboard.mk | 2 +- .../boards/particle_xenon/mpconfigboard.mk | 2 +- .../boards/sparkfun_nrf52840_mini/README.md | 2 +- .../nrf/common-hal/neopixel_write/__init__.h | 2 +- .../common-hal/rotaryio/IncrementalEncoder.c | 6 +- ports/nrf/common-hal/rtc/RTC.c | 1 - ports/nrf/common-hal/supervisor/Runtime.c | 1 - ports/nrf/common-hal/supervisor/__init__.c | 2 +- ports/nrf/examples/ubluepy_eddystone.py | 4 +- ports/nrf/examples/ubluepy_scan.py | 8 +- ports/nrf/examples/ubluepy_temp.py | 9 +- ports/nrf/gccollect.c | 2 +- ports/stm/.gitignore | 2 +- ports/stm/README.md | 20 +- ports/stm/boards/STM32F401xe_boot.ld | 3 +- ports/stm/boards/STM32F405_boot.ld | 1 - ports/stm/boards/STM32F405_default.ld | 1 - ports/stm/boards/STM32F405_fs.ld | 1 - ports/stm/boards/STM32F407_fs.ld | 1 - ports/stm/boards/STM32F411_fs.ld | 1 - ports/stm/boards/STM32F412_fs.ld | 1 - ports/stm/boards/STM32F746xG_fs.ld | 1 - ports/stm/boards/STM32F767_fs.ld | 1 - ports/stm/boards/STM32H743_fs.ld | 1 - ports/stm/boards/common_default.ld | 3 +- ports/stm/boards/common_nvm.ld | 1 - ports/stm/boards/common_tcm.ld | 2 +- ports/stm/boards/espruino_pico/README.md | 8 +- .../stm/boards/espruino_pico/mpconfigboard.h | 1 - ports/stm/boards/espruino_wifi/README.MD | 8 +- .../stm/boards/espruino_wifi/mpconfigboard.mk | 3 +- .../mpconfigboard.mk | 5 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 5 +- .../stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- .../stm/boards/nucleo_f767zi/mpconfigboard.mk | 3 +- .../boards/nucleo_h743zi_2/mpconfigboard.mk | 3 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 1 - ports/stm/boards/openmv_h7/mpconfigboard.mk | 3 +- ports/stm/boards/openmv_h7/openmv.csv | 2 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 3 +- ports/stm/boards/pyboard_v11/mpconfigboard.mk | 3 +- .../stm32f411ce_blackpill/mpconfigboard.mk | 3 +- ports/stm/boards/stm32f411ce_blackpill/pins.c | 4 +- .../stm32f411ve_discovery/mpconfigboard.mk | 1 - .../stm32f412zg_discovery/mpconfigboard.mk | 2 - .../boards/stm32f4_discovery/mpconfigboard.mk | 1 - .../stm32f746g_discovery/mpconfigboard.mk | 2 +- ports/stm/boards/system_stm32f4xx.c | 298 +++++++++--------- ports/stm/boards/system_stm32f7xx.c | 60 ++-- ports/stm/boards/system_stm32h7xx.c | 2 +- ports/stm/boards/thunderpack/pins.c | 2 +- ports/stm/common-hal/busio/UART.c | 2 +- ports/stm/common-hal/nvm/ByteArray.c | 2 +- ports/stm/common-hal/os/__init__.c | 2 +- ports/stm/common-hal/supervisor/Runtime.c | 1 - ports/stm/common-hal/supervisor/__init__.c | 2 +- ports/stm/packages/LQFP100_f4.c | 2 +- ports/stm/packages/LQFP100_x7.c | 2 +- ports/stm/packages/LQFP144.c | 4 +- ports/stm/packages/LQFP64.c | 2 +- ports/stm/packages/UFQFPN48.c | 4 +- ports/stm/peripherals/periph.h | 4 +- ports/stm/peripherals/pins.h | 8 +- .../peripherals/stm32f4/stm32f401xe/gpio.c | 1 - .../peripherals/stm32f4/stm32f401xe/periph.h | 2 +- .../peripherals/stm32f4/stm32f401xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f405xx/gpio.c | 4 +- .../peripherals/stm32f4/stm32f405xx/periph.h | 2 +- .../peripherals/stm32f4/stm32f405xx/pins.c | 38 +-- .../peripherals/stm32f4/stm32f405xx/pins.h | 36 +-- .../peripherals/stm32f4/stm32f407xx/gpio.c | 4 +- .../peripherals/stm32f4/stm32f407xx/periph.h | 2 +- .../peripherals/stm32f4/stm32f407xx/pins.c | 38 +-- .../peripherals/stm32f4/stm32f407xx/pins.h | 36 +-- .../peripherals/stm32f4/stm32f411xe/gpio.c | 2 - .../peripherals/stm32f4/stm32f411xe/periph.h | 2 +- .../peripherals/stm32f4/stm32f411xe/pins.c | 2 +- .../peripherals/stm32f4/stm32f412zx/gpio.c | 2 +- .../peripherals/stm32f4/stm32f412zx/periph.h | 2 +- .../peripherals/stm32f4/stm32f412zx/pins.c | 36 +-- .../peripherals/stm32f4/stm32f412zx/pins.h | 36 +-- .../peripherals/stm32f7/stm32f746xx/gpio.c | 1 - .../peripherals/stm32f7/stm32f746xx/pins.c | 2 +- .../peripherals/stm32f7/stm32f767xx/gpio.c | 2 - .../peripherals/stm32f7/stm32f767xx/periph.h | 2 +- .../peripherals/stm32f7/stm32f767xx/pins.c | 2 +- .../peripherals/stm32h7/stm32h743xx/gpio.c | 2 - .../peripherals/stm32h7/stm32h743xx/periph.h | 2 +- .../peripherals/stm32h7/stm32h743xx/pins.c | 2 +- ports/stm/supervisor/internal_flash.c | 1 - ports/stm/supervisor/port.c | 1 - ports/stm/supervisor/serial.c | 1 - ports/stm/tools/examples/nucleo_h743.csv | 2 +- ports/stm/tools/parse_af_csv.py | 8 +- ports/stm/tools/parse_pins_csv.py | 8 +- py/proto.h | 1 - py/stackctrl.c | 4 +- py/stream.h | 2 +- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- shared-bindings/aesio/__init__.c | 1 - shared-bindings/displayio/ColorConverter.c | 1 - shared-bindings/framebufferio/__init__.c | 1 - shared-bindings/nvm/__init__.c | 2 +- shared-bindings/supervisor/__init__.h | 2 +- shared-bindings/ulab/approx/__init__.pyi | 5 +- shared-bindings/vectorio/Circle.c | 1 - shared-bindings/vectorio/Polygon.c | 1 - shared-bindings/wiznet/__init__.c | 1 - shared-module/_bleio/ScanResults.c | 4 +- shared-module/_eve/__init__.c | 1 - shared-module/displayio/ColorConverter.c | 5 +- shared-module/displayio/Display.c | 4 +- shared-module/displayio/TileGrid.c | 2 +- .../framebufferio/FramebufferDisplay.c | 2 +- shared-module/network/__init__.c | 6 +- shared-module/rgbmatrix/RGBMatrix.c | 1 - shared-module/ustack/__init__.c | 1 - shared-module/vectorio/Circle.c | 1 - shared-module/vectorio/Circle.h | 1 - shared-module/vectorio/Polygon.c | 3 +- shared-module/vectorio/Rectangle.c | 1 - shared-module/vectorio/Rectangle.h | 1 - shared-module/vectorio/VectorShape.c | 4 +- shared-module/vectorio/__init__.c | 1 - shared-module/vectorio/__init__.h | 1 - supervisor/shared/bluetooth.h | 2 +- supervisor/shared/tick.c | 1 - supervisor/stub/internal_flash.c | 1 - tests/basics/assign1.py | 1 - tests/basics/builtin_chr.py | 1 - tests/basics/dict_popitem.py | 1 - tests/basics/dict_setdefault.py | 2 - tests/basics/gen_yield_from_throw.py | 2 +- tests/basics/gen_yield_from_throw2.py | 2 +- tests/basics/int_big_and2.py | 4 +- tests/basics/int_big_and3.py | 4 +- tests/basics/int_big_or.py | 8 +- tests/basics/int_big_or2.py | 4 +- tests/basics/int_big_or3.py | 4 +- tests/basics/int_big_xor.py | 8 +- tests/basics/int_big_xor2.py | 4 +- tests/basics/int_big_xor3.py | 4 +- tests/basics/set_iter.py | 1 - tests/basics/string_cr_conversion.py | 2 +- tests/basics/subscr_tuple.py | 1 - tests/extmod/uctypes_array_assign_le.py | 1 - tests/extmod/uctypes_byteat.py | 4 +- tests/extmod/uctypes_error.py | 10 +- tests/extmod/ujson_dump_iobase.py | 2 +- tests/extmod/ure_sub.py | 6 +- tests/feature_check/complex.py | 1 - tests/float/builtin_float_minmax.py | 1 - tests/float/float_struct.py | 1 - tests/float/math_fun_bool.py | 2 +- tests/inlineasm/asmfpaddsub.py | 1 - tests/inlineasm/asmfpldrstr.py | 1 - tests/inlineasm/asmfpmuldiv.py | 1 - tests/inlineasm/asmfpsqrt.py | 1 - tests/inlineasm/asmspecialregs.py | 1 - tests/jni/README | 1 - tests/misc/features.py | 6 +- tests/thread/mutate_bytearray.py | 1 - tests/wipy/i2c.py | 1 - tests/wipy/pin.py | 7 +- tests/wipy/sd.py | 1 - tests/wipy/uart.py | 6 +- tests/wipy/wlan/wlan.py | 1 - tools/codestats.sh | 2 +- 294 files changed, 1101 insertions(+), 1227 deletions(-) diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index da4dad1790..79a6c68a75 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -18,7 +18,7 @@ jobs: python-version: 3.8 - name: Install deps run: | - pip install requests sh click + pip install requests sh click - name: Versions run: | gcc --version diff --git a/BUILDING.md b/BUILDING.md index 73499d65d5..bc60026785 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,7 +1,7 @@ # Building CircuitPython -Welcome to CircuitPython! +Welcome to CircuitPython! This document is a quick-start guide only. @@ -28,7 +28,7 @@ This project has a bunch of git submodules. You will need to update them regula As part of the build process, mpy-cross is needed to compile .py files into .mpy files. To compile (or recompile) mpy-cross: - make -C mpy-cross + make -C mpy-cross # Building @@ -68,7 +68,7 @@ A successful run will say something like # Debugging -The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB. +The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB. Instructions can be found at https://learn.adafruit.com/debugging-the-samd21-with-gdb If using JLink, you'll need both the `JLinkGDBServer` and `arm-none-eabi-gdb` running. diff --git a/docs/README.md b/docs/README.md index b01ae9d491..e98b46f67b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,10 +34,10 @@ All commands will, by default, run with `-E` (forces a rebuild from scratch of d # will turn OFF the force rebuild make html FORCE= - + # will turn OFF the verbosity make html VERBOSE= - + # will turn OFF the force rebuild and make it doubly verbose when running make html FORCE= VERBOSE="-v -v" diff --git a/drivers/wiznet5k/ethernet/socket.c b/drivers/wiznet5k/ethernet/socket.c index bea98601de..7a114aa1bc 100644 --- a/drivers/wiznet5k/ethernet/socket.c +++ b/drivers/wiznet5k/ethernet/socket.c @@ -2,7 +2,7 @@ // //! \file socket.c //! \brief SOCKET APIs Implements file. -//! \details SOCKET APIs like as Berkeley Socket APIs. +//! \details SOCKET APIs like as Berkeley Socket APIs. //! \version 1.0.3 //! \date 2013/10/21 //! \par Revision history @@ -10,7 +10,7 @@ //! <2014/05/01> V1.0.3. Refer to M20140501 //! 1. Implicit type casting -> Explicit type casting. //! 2. replace 0x01 with PACK_REMAINED in recvfrom() -//! 3. Validation a destination ip in connect() & sendto(): +//! 3. Validation a destination ip in connect() & sendto(): //! It occurs a fatal error on converting unint32 address if uint8* addr parameter is not aligned by 4byte address. //! Copy 4 byte addr value into temporary uint32 variable and then compares it. //! <2013/12/20> V1.0.2 Refer to M20131220 @@ -23,30 +23,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -123,7 +123,7 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 #if _WIZCHIP_ == 5200 if(flag & 0x10) return SOCKERR_SOCKFLAG; #endif - + if(flag != 0) { switch(protocol) @@ -154,7 +154,7 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 port = sock_any_port++; if(sock_any_port == 0xFFF0) sock_any_port = SOCK_ANY_PORT_NUM; } - setSn_PORT(sn,port); + setSn_PORT(sn,port); setSn_CR(sn,Sn_CR_OPEN); while(getSn_CR(sn)); sock_io_mode |= ((flag & SF_IO_NONBLOCK) << sn); @@ -163,12 +163,12 @@ int8_t WIZCHIP_EXPORT(socket)(uint8_t sn, uint8_t protocol, uint16_t port, uint8 sock_pack_info[sn] = 0; while(getSn_SR(sn) == SOCK_CLOSED); return (int8_t)sn; -} +} int8_t WIZCHIP_EXPORT(close)(uint8_t sn) { CHECK_SOCKNUM(); - + setSn_CR(sn,Sn_CR_CLOSE); /* wait to process the command... */ while( getSn_CR(sn) ); @@ -216,18 +216,18 @@ int8_t WIZCHIP_EXPORT(connect)(uint8_t sn, uint8_t * addr, uint16_t port) if (taddr == 0xFFFFFFFF || taddr == 0) return SOCKERR_IPINVALID; } // - + if(port == 0) return SOCKERR_PORTZERO; setSn_DIPR(sn,addr); setSn_DPORT(sn,port); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR(wizchip_getsubn()); #endif setSn_CR(sn,Sn_CR_CONNECT); while(getSn_CR(sn)); if(sock_io_mode & (1< freesize) len = freesize; // check size not to exceed MAX size. while(1) @@ -413,7 +413,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t }; wiz_send_data(sn, buf, len); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR(wizchip_getsubn()); #endif @@ -433,7 +433,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t else if(tmp & Sn_IR_TIMEOUT) { setSn_IR(sn, Sn_IR_TIMEOUT); - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR((uint8_t*)"\x00\x00\x00\x00"); #endif return SOCKERR_TIMEOUT; @@ -441,7 +441,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t //////////// MICROPY_THREAD_YIELD(); } - #if _WIZCHIP_ == 5200 // for W5200 ARP errata + #if _WIZCHIP_ == 5200 // for W5200 ARP errata setSUBR((uint8_t*)"\x00\x00\x00\x00"); #endif return len; @@ -462,7 +462,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_ case Sn_MR_UDP: case Sn_MR_MACRAW: break; - #if ( _WIZCHIP_ < 5200 ) + #if ( _WIZCHIP_ < 5200 ) case Sn_MR_IPRAW: case Sn_MR_PPPoE: break; @@ -519,7 +519,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_ sock_remained_size[sn] = head[0]; sock_remained_size[sn] = (sock_remained_size[sn] <<8) + head[1]; sock_remained_size[sn] -= 2; // len includes 2 len bytes - if(sock_remained_size[sn] > 1514) + if(sock_remained_size[sn] > 1514) { WIZCHIP_EXPORT(close)(sn); return SOCKFATAL_PACKLEN; @@ -582,7 +582,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) else if(tmp == SOCK_IO_BLOCK) sock_io_mode &= ~(1< explict type casting //*((uint8_t*)arg) = (sock_io_mode >> sn) & 0x0001; *((uint8_t*)arg) = (uint8_t)((sock_io_mode >> sn) & 0x0001); @@ -591,7 +591,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) case CS_GET_MAXTXBUF: *((uint16_t*)arg) = getSn_TxMAX(sn); break; - case CS_GET_MAXRXBUF: + case CS_GET_MAXRXBUF: *((uint16_t*)arg) = getSn_RxMAX(sn); break; case CS_CLR_INTERRUPT: @@ -601,11 +601,11 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg) case CS_GET_INTERRUPT: *((uint8_t*)arg) = getSn_IR(sn); break; - case CS_SET_INTMASK: + case CS_SET_INTMASK: if( (*(uint8_t*)arg) > SIK_ALL) return SOCKERR_ARG; setSn_IMR(sn,*(uint8_t*)arg); break; - case CS_GET_INTMASK: + case CS_GET_INTMASK: *((uint8_t*)arg) = getSn_IMR(sn); default: return SOCKERR_ARG; @@ -658,11 +658,11 @@ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg) CHECK_SOCKMODE(Sn_MR_TCP); setSn_KPALVTR(sn,*(uint8_t*)arg); break; - #endif -#endif + #endif +#endif default: return SOCKERR_ARG; - } + } return SOCK_OK; } @@ -680,20 +680,20 @@ int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg) case SO_TOS: *(uint8_t*) arg = getSn_TOS(sn); break; - case SO_MSS: + case SO_MSS: *(uint8_t*) arg = getSn_MSSR(sn); case SO_DESTIP: getSn_DIPR(sn, (uint8_t*)arg); break; - case SO_DESTPORT: + case SO_DESTPORT: *(uint16_t*) arg = getSn_DPORT(sn); break; - #if _WIZCHIP_ > 5200 + #if _WIZCHIP_ > 5200 case SO_KEEPALIVEAUTO: CHECK_SOCKMODE(Sn_MR_TCP); *(uint16_t*) arg = getSn_KPALVTR(sn); break; - #endif + #endif case SO_SENDBUF: *(uint16_t*) arg = getSn_TX_FSR(sn); case SO_RECVBUF: diff --git a/drivers/wiznet5k/ethernet/socket.h b/drivers/wiznet5k/ethernet/socket.h index 2f03a34eba..4f602e429c 100644 --- a/drivers/wiznet5k/ethernet/socket.h +++ b/drivers/wiznet5k/ethernet/socket.h @@ -2,43 +2,43 @@ // //! \file socket.h //! \brief SOCKET APIs Header file. -//! \details SOCKET APIs like as berkeley socket api. +//! \details SOCKET APIs like as berkeley socket api. //! \version 1.0.2 //! \date 2013/10/21 //! \par Revision history //! <2014/05/01> V1.0.2. Refer to M20140501 //! 1. Modify the comment : SO_REMAINED -> PACK_REMAINED -//! 2. Add the comment as zero byte udp data reception in getsockopt(). +//! 2. Add the comment as zero byte udp data reception in getsockopt(). //! <2013/10/21> 1st Release //! \author MidnightCow //! \copyright //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -92,7 +92,7 @@ #define SOCK_BUSY 0 ///< Socket is busy on processing the operation. Valid only Non-block IO Mode. #define SOCK_FATAL -1000 ///< Result is fatal error about socket process. -#define SOCK_ERROR 0 +#define SOCK_ERROR 0 #define SOCKERR_SOCKNUM (SOCK_ERROR - 1) ///< Invalid socket number #define SOCKERR_SOCKOPT (SOCK_ERROR - 2) ///< Invalid socket option #define SOCKERR_SOCKINIT (SOCK_ERROR - 3) ///< Socket is not initialized @@ -113,7 +113,7 @@ * SOCKET FLAG */ #define SF_ETHER_OWN (Sn_MR_MFEN) ///< In \ref Sn_MR_MACRAW, Receive only the packet as broadcast, multicast and own packet -#define SF_IGMP_VER2 (Sn_MR_MC) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2. +#define SF_IGMP_VER2 (Sn_MR_MC) ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2. #define SF_TCP_NODELAY (Sn_MR_ND) ///< In \ref Sn_MR_TCP, Use to nodelayed ack. #define SF_MULTI_ENABLE (Sn_MR_MULTI) ///< In \ref Sn_MR_UDP, Enable multicast mode. @@ -184,7 +184,7 @@ int8_t WIZCHIP_EXPORT(listen)(uint8_t sn); * @ingroup WIZnet_socket_APIs * @brief Try to connect a server. * @details It requests connection to the server with destination IP address and port number passed as parameter.\n - * @note It is valid only in TCP client mode. + * @note It is valid only in TCP client mode. * In block io mode, it does not return until connection is completed. * In Non-block io mode, it return @ref SOCK_BUSY immediately. * @@ -286,7 +286,7 @@ int32_t WIZCHIP_EXPORT(recv)(uint8_t sn, uint8_t * buf, uint16_t len); * @ref SOCKERR_PORTZERO - Server port zero\n * @ref SOCKERR_SOCKCLOSED - Socket unexpectedly closed \n * @ref SOCKERR_TIMEOUT - Timeout occurred \n - * @ref SOCK_BUSY - Socket is busy. + * @ref SOCK_BUSY - Socket is busy. */ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port); @@ -294,7 +294,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * @ingroup WIZnet_socket_APIs * @brief Receive datagram of UDP or MACRAW * @details This function is an application I/F function which is used to receive the data in other then TCP mode. \n - * This function is used to receive UDP and MAC_RAW mode, and handle the header as well. + * This function is used to receive UDP and MAC_RAW mode, and handle the header as well. * This function can divide to received the packet data. * On the MACRAW SOCKET, the addr and port parameters are ignored. * @note In block io mode, it doesn't return until data reception is completed - data is filled as len in socket buffer @@ -302,7 +302,7 @@ int32_t WIZCHIP_EXPORT(sendto)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * * @param sn Socket number. It should be 0 ~ @ref \_WIZCHIP_SOCK_NUM_. * @param buf Pointer buffer to read incoming data. - * @param len The max data length of data in buf. + * @param len The max data length of data in buf. * When the received packet size <= len, receives data as packet sized. * When others, receives data as len. * @param addr Pointer variable of destination IP address. It should be allocated 4 bytes. @@ -366,7 +366,7 @@ typedef enum /** * @ingroup DATA_TYPE * @brief The type of socket option in @ref setsockopt() or @ref getsockopt() - */ + */ typedef enum { SO_FLAG, ///< Valid only in getsockopt(), For set flag of socket refer to flag in @ref socket(). @@ -375,11 +375,11 @@ typedef enum SO_MSS, ///< Set/Get MSS. @ref Sn_MSSR ( @ref setSn_MSSR(), @ref getSn_MSSR() ) SO_DESTIP, ///< Set/Get the destination IP address. @ref Sn_DIPR ( @ref setSn_DIPR(), @ref getSn_DIPR() ) SO_DESTPORT, ///< Set/Get the destination Port number. @ref Sn_DPORT ( @ref setSn_DPORT(), @ref getSn_DPORT() ) -#if _WIZCHIP_ != 5100 +#if _WIZCHIP_ != 5100 SO_KEEPALIVESEND, ///< Valid only in setsockopt. Manually send keep-alive packet in TCP mode - #if _WIZCHIP_ > 5200 + #if _WIZCHIP_ > 5200 SO_KEEPALIVEAUTO, ///< Set/Get keep-alive auto transmission timer in TCP mode - #endif + #endif #endif SO_SENDBUF, ///< Valid only in getsockopt. Get the free data size of Socekt TX buffer. @ref Sn_TX_FSR, @ref getSn_TX_FSR() SO_RECVBUF, ///< Valid only in getsockopt. Get the received data size in socket RX buffer. @ref Sn_RX_RSR, @ref getSn_RX_RSR() @@ -400,34 +400,34 @@ typedef enum * @b cstype @b data type@b value * @ref CS_SET_IOMODE \n @ref CS_GET_IOMODE uint8_t @ref SOCK_IO_BLOCK @ref SOCK_IO_NONBLOCK * @ref CS_GET_MAXTXBUF \n @ref CS_GET_MAXRXBUF uint16_t 0 ~ 16K - * @ref CS_CLR_INTERRUPT \n @ref CS_GET_INTERRUPT \n @ref CS_SET_INTMASK \n @ref CS_GET_INTMASK @ref sockint_kind @ref SIK_CONNECTED, etc. + * @ref CS_CLR_INTERRUPT \n @ref CS_GET_INTERRUPT \n @ref CS_SET_INTMASK \n @ref CS_GET_INTMASK @ref sockint_kind @ref SIK_CONNECTED, etc. * * @return @b Success @ref SOCK_OK \n * @b fail @ref SOCKERR_ARG - Invalid argument\n */ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg); -/** +/** * @ingroup WIZnet_socket_APIs * @brief set socket options * @details Set socket option like as TTL, MSS, TOS, and so on. Refer to @ref sockopt_type. - * + * * @param sn socket number * @param sotype socket option type. refer to @ref sockopt_type * @param arg Data type and value is determined according to sotype. \n * - * + * * * * - * - * - * - * + * + * + * + * *
@b sotype @b data type@b value
@b sotype @b data type@b value
@ref SO_TTL uint8_t 0 ~ 255
@ref SO_TOS uint8_t 0 ~ 255
@ref SO_MSS uint16_t 0 ~ 65535
@ref SO_DESTIP uint8_t[4]
@ref SO_DESTPORT uint16_t 0 ~ 65535
@ref SO_KEEPALIVESEND null null
@ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255
@ref SO_DESTIP uint8_t[4]
@ref SO_DESTPORT uint16_t 0 ~ 65535
@ref SO_KEEPALIVESEND null null
@ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255
- * @return + * @return * - @b Success : @ref SOCK_OK \n - * - @b Fail + * - @b Fail * - @ref SOCKERR_SOCKNUM - Invalid Socket number \n * - @ref SOCKERR_SOCKMODE - Invalid socket mode \n * - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n @@ -435,7 +435,7 @@ int8_t WIZCHIP_EXPORT(ctlsocket)(uint8_t sn, ctlsock_type cstype, void* arg); */ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg); -/** +/** * @ingroup WIZnet_socket_APIs * @brief get socket options * @details Get socket option like as FLAG, TTL, MSS, and so on. Refer to @ref sockopt_type @@ -447,24 +447,24 @@ int8_t WIZCHIP_EXPORT(setsockopt)(uint8_t sn, sockopt_type sotype, void* arg); * @ref SO_FLAG uint8_t @ref SF_ETHER_OWN, etc... * @ref SO_TOS uint8_t 0 ~ 255 * @ref SO_MSS uint16_t 0 ~ 65535 - * @ref SO_DESTIP uint8_t[4] - * @ref SO_DESTPORT uint16_t - * @ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255 - * @ref SO_SENDBUF uint16_t 0 ~ 65535 - * @ref SO_RECVBUF uint16_t 0 ~ 65535 - * @ref SO_STATUS uint8_t @ref SOCK_ESTABLISHED, etc.. + * @ref SO_DESTIP uint8_t[4] + * @ref SO_DESTPORT uint16_t + * @ref SO_KEEPALIVEAUTO uint8_t 0 ~ 255 + * @ref SO_SENDBUF uint16_t 0 ~ 65535 + * @ref SO_RECVBUF uint16_t 0 ~ 65535 + * @ref SO_STATUS uint8_t @ref SOCK_ESTABLISHED, etc.. * @ref SO_REMAINSIZE uint16_t 0~ 65535 * @ref SO_PACKINFO uint8_t @ref PACK_FIRST, etc... * - * @return + * @return * - @b Success : @ref SOCK_OK \n - * - @b Fail + * - @b Fail * - @ref SOCKERR_SOCKNUM - Invalid Socket number \n * - @ref SOCKERR_SOCKOPT - Invalid socket option or its value \n * - @ref SOCKERR_SOCKMODE - Invalid socket mode \n * @note * The option as PACK_REMAINED and SO_PACKINFO is valid only in NON-TCP mode and after call @ref recvfrom(). \n - * When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero, + * When SO_PACKINFO value is PACK_FIRST and the return value of recvfrom() is zero, * This means the zero byte UDP data(UDP Header only) received. */ int8_t WIZCHIP_EXPORT(getsockopt)(uint8_t sn, sockopt_type sotype, void* arg); diff --git a/drivers/wiznet5k/ethernet/w5200/w5200.c b/drivers/wiznet5k/ethernet/w5200/w5200.c index 8c3780792e..cbcb136091 100644 --- a/drivers/wiznet5k/ethernet/w5200/w5200.c +++ b/drivers/wiznet5k/ethernet/w5200/w5200.c @@ -22,30 +22,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** diff --git a/drivers/wiznet5k/ethernet/w5200/w5200.h b/drivers/wiznet5k/ethernet/w5200/w5200.h index 63561940f8..988c8827fc 100644 --- a/drivers/wiznet5k/ethernet/w5200/w5200.h +++ b/drivers/wiznet5k/ethernet/w5200/w5200.h @@ -13,30 +13,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -66,8 +66,8 @@ * - @ref WIZCHIP_register : @ref Common_register_group and @ref Socket_register_group * - @ref WIZCHIP_IO_Functions : @ref Basic_IO_function, @ref Common_register_access_function and @ref Socket_register_access_function */ - - + + /** * @defgroup WIZCHIP_register WIZCHIP register * @ingroup W5500 @@ -138,9 +138,9 @@ * @sa UIPR, UPORTR : ICMP message. * @sa PHYCFGR, VERSIONR : etc. */ - - - + + + /** * @defgroup Socket_register_group Socket register * @ingroup WIZCHIP_register @@ -153,9 +153,9 @@ * @sa Sn_MSSR, Sn_TOS, Sn_TTL, Sn_KPALVTR, Sn_FRAG : Internet protocol. * @sa Sn_RXBUF_SIZE, Sn_TXBUF_SIZE, Sn_TX_FSR, Sn_TX_RD, Sn_TX_WR, Sn_RX_RSR, Sn_RX_RD, Sn_RX_WR : Data communication */ - - - + + + /** * @defgroup Basic_IO_function Basic I/O function * @ingroup WIZCHIP_IO_Functions @@ -173,7 +173,7 @@ * @ingroup WIZCHIP_IO_Functions * @brief These are functions to access socket registers. */ - + //------------------------------- defgroup end -------------------------------------------- //----------------------------- W5500 Common Registers IOMAP ----------------------------- /** @@ -276,7 +276,7 @@ * @brief Socket Interrupt Mask Register(R/W) * @details Each bit of @ref SIMR corresponds to each bit of @ref SIR. * When a bit of @ref SIMR is and the corresponding bit of @ref SIR is Interrupt will be issued. - * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is + * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is */ //#define SIMR (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_CREG_BLOCK << 3)) @@ -531,7 +531,7 @@ */ #define Sn_TTL(N) WIZCHIP_SREG_ADDR(N, 0x0016) // Reserved (_W5500_IO_BASE_ + (0x0017 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) -// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) +// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0019 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001A << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001B << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -633,8 +633,8 @@ * @ingroup Socket_register_group * @brief socket interrupt mask register(R) * @details @ref Sn_IMR masks the interrupt of Socket n. - * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is - * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is + * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is + * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is * Host is interrupted by asserted INTn PIN to low. */ //#define Sn_IMR(N) (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -694,7 +694,7 @@ * @brief Enable PPPoE * @details 0 : DisablePPPoE mode\n * 1 : EnablePPPoE mode\n - * If you use ADSL, this bit should be + * If you use ADSL, this bit should be */ #define MR_PPPOE 0x08 @@ -715,7 +715,7 @@ /** * @brief Get the destination unreachable message in UDP sending. - * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as + * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as * When this bit is Destination Information such as IP address and Port number may be checked with the corresponding @ref UIPR & @ref UPORTR. */ #define IR_UNREACH 0x40 @@ -743,7 +743,7 @@ #define PHYCFGR_OPMDC_100F (3<<3) #define PHYCFGR_OPMDC_100H (2<<3) #define PHYCFGR_OPMDC_10F (1<<3) -#define PHYCFGR_OPMDC_10H (0<<3) +#define PHYCFGR_OPMDC_10H (0<<3) #define PHYCFGR_DPX_FULL (1<<2) #define PHYCFGR_DPX_HALF (0<<2) #define PHYCFGR_SPD_100 (1<<1) @@ -818,7 +818,7 @@ * @brief Unicast Block in UDP Multicasting * @details 0 : disable Unicast Blocking\n * 1 : enable Unicast Blocking\n - * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = + * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = */ //#define Sn_MR_UCASTB 0x10 @@ -866,7 +866,7 @@ * @brief Multicast Blocking in @ref Sn_MR_MACRAW mode * @details 0 : using IGMP version 2\n * 1 : using IGMP version 1\n - * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = + * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = * It configures the version for IGMP messages (Join/Leave/Report). */ #define Sn_MR_MMB Sn_MR_ND @@ -921,7 +921,7 @@ * In this mode, Socket n operates as a �TCP serverand waits for connection-request (SYN packet) from any �TCP client * The @ref Sn_SR changes the state from SOCK_INIT to SOCKET_LISTEN. * When a �TCP clientconnection request is successfully established, - * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes + * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes * But when a �TCP clientconnection request is failed, Sn_IR(3) becomes and the status of @ref Sn_SR changes to SOCK_CLOSED. */ #define Sn_CR_LISTEN 0x02 @@ -1132,7 +1132,7 @@ //#define SOCK_PPPOE 0x5F /* IP PROTOCOL */ -#define IPPROTO_IP 0 //< Dummy for IP +#define IPPROTO_IP 0 //< Dummy for IP #define IPPROTO_ICMP 1 //< Control message protocol #define IPPROTO_IGMP 2 //< Internet group management protocol #define IPPROTO_GGP 3 //< Gateway^2 (deprecated) @@ -2027,7 +2027,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); ///////////////////////////////////// // Sn_TXBUF & Sn_RXBUF IO function // ///////////////////////////////////// -/** +/** * @brief Gets the max buffer size of socket sn passed as parameter. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n RX max buffer size. @@ -2035,7 +2035,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); #define getSn_RxMAX(sn) \ (getSn_RXBUF_SIZE(sn) << 10) -/** +/** * @brief Gets the max buffer size of socket sn passed as parameters. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n TX max buffer size. diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.c b/drivers/wiznet5k/ethernet/w5500/w5500.c index 3107b1b71a..fef08e2e3e 100644 --- a/drivers/wiznet5k/ethernet/w5500/w5500.c +++ b/drivers/wiznet5k/ethernet/w5500/w5500.c @@ -20,30 +20,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -114,7 +114,7 @@ void WIZCHIP_WRITE(uint32_t AddrSel, uint8_t wb ) WIZCHIP.CS._deselect(); WIZCHIP_CRITICAL_EXIT(); } - + void WIZCHIP_READ_BUF (uint32_t AddrSel, uint8_t* pBuf, uint16_t len) { uint8_t spi_data[3]; @@ -213,7 +213,7 @@ void wiz_send_data(uint8_t sn, uint8_t *wizdata, uint16_t len) addrsel = ((uint32_t)ptr << 8) + (WIZCHIP_TXBUF_BLOCK(sn) << 3); // WIZCHIP_WRITE_BUF(addrsel,wizdata, len); - + ptr += len; setSn_TX_WR(sn,ptr); } @@ -222,7 +222,7 @@ void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len) { uint16_t ptr = 0; uint32_t addrsel = 0; - + if(len == 0) return; ptr = getSn_RX_RD(sn); //M20140501 : implict type casting -> explict type casting @@ -231,7 +231,7 @@ void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint16_t len) // WIZCHIP_READ_BUF(addrsel, wizdata, len); ptr += len; - + setSn_RX_RD(sn,ptr); } @@ -244,4 +244,3 @@ void wiz_recv_ignore(uint8_t sn, uint16_t len) ptr += len; setSn_RX_RD(sn,ptr); } - diff --git a/drivers/wiznet5k/ethernet/w5500/w5500.h b/drivers/wiznet5k/ethernet/w5500/w5500.h index c2afb180eb..f94eed3aff 100644 --- a/drivers/wiznet5k/ethernet/w5500/w5500.h +++ b/drivers/wiznet5k/ethernet/w5500/w5500.h @@ -11,30 +11,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -76,8 +76,8 @@ * - @ref WIZCHIP_register : @ref Common_register_group and @ref Socket_register_group * - @ref WIZCHIP_IO_Functions : @ref Basic_IO_function, @ref Common_register_access_function and @ref Socket_register_access_function */ - - + + /** * @defgroup WIZCHIP_register WIZCHIP register * @ingroup W5500 @@ -148,9 +148,9 @@ * @sa UIPR, UPORTR : ICMP message. * @sa PHYCFGR, VERSIONR : etc. */ - - - + + + /** * @defgroup Socket_register_group Socket register * @ingroup WIZCHIP_register @@ -163,9 +163,9 @@ * @sa Sn_MSSR, Sn_TOS, Sn_TTL, Sn_KPALVTR, Sn_FRAG : Internet protocol. * @sa Sn_RXBUF_SIZE, Sn_TXBUF_SIZE, Sn_TX_FSR, Sn_TX_RD, Sn_TX_WR, Sn_RX_RSR, Sn_RX_RD, Sn_RX_WR : Data communication */ - - - + + + /** * @defgroup Basic_IO_function Basic I/O function * @ingroup WIZCHIP_IO_Functions @@ -183,7 +183,7 @@ * @ingroup WIZCHIP_IO_Functions * @brief These are functions to access socket registers. */ - + //------------------------------- defgroup end -------------------------------------------- //----------------------------- W5500 Common Registers IOMAP ----------------------------- /** @@ -286,7 +286,7 @@ * @brief Socket Interrupt Mask Register(R/W) * @details Each bit of @ref SIMR corresponds to each bit of @ref SIR. * When a bit of @ref SIMR is and the corresponding bit of @ref SIR is Interrupt will be issued. - * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is + * In other words, if a bit of @ref SIMR is an interrupt will be not issued even if the corresponding bit of @ref SIR is */ #define SIMR (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_CREG_BLOCK << 3)) @@ -540,7 +540,7 @@ */ #define Sn_TTL(N) (_W5500_IO_BASE_ + (0x0016 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0017 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) -// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) +// Reserved (_W5500_IO_BASE_ + (0x0018 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x0019 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001A << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) // Reserved (_W5500_IO_BASE_ + (0x001B << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -642,8 +642,8 @@ * @ingroup Socket_register_group * @brief socket interrupt mask register(R) * @details @ref Sn_IMR masks the interrupt of Socket n. - * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is - * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is + * Each bit corresponds to each bit of @ref Sn_IR. When a Socket n Interrupt is occurred and the corresponding bit of @ref Sn_IMR is + * the corresponding bit of @ref Sn_IR becomes When both the corresponding bit of @ref Sn_IMR and @ref Sn_IR are and the n-th bit of @ref IR is * Host is interrupted by asserted INTn PIN to low. */ #define Sn_IMR(N) (_W5500_IO_BASE_ + (0x002C << 8) + (WIZCHIP_SREG_BLOCK(N) << 3)) @@ -703,7 +703,7 @@ * @brief Enable PPPoE * @details 0 : DisablePPPoE mode\n * 1 : EnablePPPoE mode\n - * If you use ADSL, this bit should be + * If you use ADSL, this bit should be */ #define MR_PPPOE 0x08 @@ -724,7 +724,7 @@ /** * @brief Get the destination unreachable message in UDP sending. - * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as + * @details When receiving the ICMP (Destination port unreachable) packet, this bit is set as * When this bit is Destination Information such as IP address and Port number may be checked with the corresponding @ref UIPR & @ref UPORTR. */ #define IR_UNREACH 0x40 @@ -752,7 +752,7 @@ #define PHYCFGR_OPMDC_100F (3<<3) #define PHYCFGR_OPMDC_100H (2<<3) #define PHYCFGR_OPMDC_10F (1<<3) -#define PHYCFGR_OPMDC_10H (0<<3) +#define PHYCFGR_OPMDC_10H (0<<3) #define PHYCFGR_DPX_FULL (1<<2) #define PHYCFGR_DPX_HALF (0<<2) #define PHYCFGR_SPD_100 (1<<1) @@ -823,7 +823,7 @@ * @brief Unicast Block in UDP Multicasting * @details 0 : disable Unicast Blocking\n * 1 : enable Unicast Blocking\n - * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = + * This bit blocks receiving the unicast packet during UDP mode(P[3:0] = 010 and MULTI = */ #define Sn_MR_UCASTB 0x10 @@ -871,7 +871,7 @@ * @brief Multicast Blocking in @ref Sn_MR_MACRAW mode * @details 0 : using IGMP version 2\n * 1 : using IGMP version 1\n - * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = + * This bit is applied only during UDP mode(P[3:0] = 010 and MULTI = * It configures the version for IGMP messages (Join/Leave/Report). */ #define Sn_MR_MMB Sn_MR_ND @@ -926,7 +926,7 @@ * In this mode, Socket n operates as a �TCP serverand waits for connection-request (SYN packet) from any �TCP client * The @ref Sn_SR changes the state from SOCK_INIT to SOCKET_LISTEN. * When a �TCP clientconnection request is successfully established, - * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes + * the @ref Sn_SR changes from SOCK_LISTEN to SOCK_ESTABLISHED and the Sn_IR(0) becomes * But when a �TCP clientconnection request is failed, Sn_IR(3) becomes and the status of @ref Sn_SR changes to SOCK_CLOSED. */ #define Sn_CR_LISTEN 0x02 @@ -1137,7 +1137,7 @@ //#define SOCK_PPPOE 0x5F /* IP PROTOCOL */ -#define IPPROTO_IP 0 //< Dummy for IP +#define IPPROTO_IP 0 //< Dummy for IP #define IPPROTO_ICMP 1 //< Control message protocol #define IPPROTO_IGMP 2 //< Internet group management protocol #define IPPROTO_GGP 3 //< Gateway^2 (deprecated) @@ -1994,7 +1994,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); ///////////////////////////////////// // Sn_TXBUF & Sn_RXBUF IO function // ///////////////////////////////////// -/** +/** * @brief Gets the max buffer size of socket sn passed as parameter. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n RX max buffer size. @@ -2002,7 +2002,7 @@ uint16_t getSn_RX_RSR(uint8_t sn); #define getSn_RxMAX(sn) \ (getSn_RXBUF_SIZE(sn) << 10) -/** +/** * @brief Gets the max buffer size of socket sn passed as parameters. * @param (uint8_t)sn Socket number. It should be 0 ~ 7. * @return uint16_t. Value of Socket n TX max buffer size. diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.c b/drivers/wiznet5k/ethernet/wizchip_conf.c index 3e54d2c90b..c7a2f50f04 100644 --- a/drivers/wiznet5k/ethernet/wizchip_conf.c +++ b/drivers/wiznet5k/ethernet/wizchip_conf.c @@ -1,4 +1,4 @@ -//****************************************************************************/ +//****************************************************************************/ //! //! \file wizchip_conf.c //! \brief WIZCHIP Config Header File. @@ -17,30 +17,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //*****************************************************************************/ @@ -88,7 +88,7 @@ uint8_t wizchip_bus_readbyte(uint32_t AddrSel) { return * ((volatile uint8_t *)( * @note This function help not to access wrong address. If you do not describe this function or register any functions, * null function is called. */ - + //M20140501 : Explict pointer type casting //void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*) AddrSel) = wb; }; void wizchip_bus_writebyte(uint32_t AddrSel, uint8_t wb) { *((volatile uint8_t*)((ptrdiff_t)AddrSel)) = wb; }; @@ -160,7 +160,7 @@ void reg_wizchip_cs_cbfunc(void(*cs_sel)(void), void(*cs_desel)(void)) void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint32_t addr, uint8_t wb)) { while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_BUS_)); - + if(!bus_rb || !bus_wb) { WIZCHIP.IF.BUS._read_byte = wizchip_bus_readbyte; @@ -176,7 +176,7 @@ void reg_wizchip_bus_cbfunc(uint8_t(*bus_rb)(uint32_t addr), void (*bus_wb)(uint void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)(const uint8_t *, uint32_t)) { while(!(WIZCHIP.if_mode & _WIZCHIP_IO_MODE_SPI_)); - + if(!spi_rb || !spi_wb) { WIZCHIP.IF.SPI._read_bytes = wizchip_spi_readbytes; @@ -199,7 +199,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) wizchip_sw_reset(); break; case CW_INIT_WIZCHIP: - if(arg != 0) + if(arg != 0) { ptmp[0] = (uint8_t*)arg; ptmp[1] = ptmp[0] + _WIZCHIP_SOCK_NUM_; @@ -213,7 +213,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) break; case CW_SET_INTRMASK: wizchip_setinterruptmask(*((intr_kind*)arg)); - break; + break; case CW_GET_INTRMASK: *((intr_kind*)arg) = wizchip_getinterruptmask(); break; @@ -267,7 +267,7 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg) int8_t ctlnetwork(ctlnetwork_type cntype, void* arg) { - + switch(cntype) { case CN_SET_NETINFO: @@ -346,7 +346,7 @@ void wizchip_clrinterrupt(intr_kind intr) #if _WIZCHIP_ == 5200 ir |= (1 << 6); #endif - + #if _WIZCHIP_ < 5200 sir &= 0x0F; #endif @@ -357,7 +357,7 @@ void wizchip_clrinterrupt(intr_kind intr) #else setIR(ir); setSIR(sir); -#endif +#endif } intr_kind wizchip_getinterrupt(void) @@ -371,7 +371,7 @@ intr_kind wizchip_getinterrupt(void) #else ir = getIR(); sir = getSIR(); -#endif +#endif #if _WIZCHIP_ < 5500 ir &= ~(1<<4); // IK_WOL @@ -394,7 +394,7 @@ void wizchip_setinterruptmask(intr_kind intr) #if _WIZCHIP_ == 5200 imr &= ~(1 << 6); #endif - + #if _WIZCHIP_ < 5200 simr &= 0x0F; #endif @@ -405,7 +405,7 @@ void wizchip_setinterruptmask(intr_kind intr) #else setIMR(imr); setSIMR(simr); -#endif +#endif } intr_kind wizchip_getinterruptmask(void) @@ -419,7 +419,7 @@ intr_kind wizchip_getinterruptmask(void) #else imr = getIMR(); simr = getSIMR(); -#endif +#endif #if _WIZCHIP_ < 5500 imr &= ~(1<<4); // IK_WOL @@ -459,12 +459,12 @@ int8_t wizphy_getphypmode(void) #if _WIZCHIP_ == 5200 if(getPHYSTATUS() & PHYSTATUS_POWERDOWN) tmp = PHY_POWER_DOWN; - else + else tmp = PHY_POWER_NORM; #elif _WIZCHIP_ == 5500 if(getPHYCFGR() & PHYCFGR_OPMDC_PDOWN) tmp = PHY_POWER_DOWN; - else + else tmp = PHY_POWER_NORM; #else tmp = -1; @@ -479,7 +479,7 @@ void wizphy_reset(void) uint8_t tmp = getPHYCFGR(); tmp &= PHYCFGR_RST; setPHYCFGR(tmp); - tmp = getPHYCFGR(); + tmp = getPHYCFGR(); tmp |= ~PHYCFGR_RST; setPHYCFGR(tmp); } @@ -501,7 +501,7 @@ void wizphy_setphyconf(wiz_PhyConf* phyconf) tmp |= PHYCFGR_OPMDC_100F; else tmp |= PHYCFGR_OPMDC_10F; - } + } else { if(phyconf->speed == PHY_SPEED_100) @@ -522,7 +522,7 @@ void wizphy_getphyconf(wiz_PhyConf* phyconf) switch(tmp & PHYCFGR_OPMDC_ALLA) { case PHYCFGR_OPMDC_ALLA: - case PHYCFGR_OPMDC_100FA: + case PHYCFGR_OPMDC_100FA: phyconf->mode = PHY_MODE_AUTONEGO; break; default: @@ -565,7 +565,7 @@ int8_t wizphy_setphypmode(uint8_t pmode) uint8_t tmp = 0; tmp = getPHYCFGR(); if((tmp & PHYCFGR_OPMD)== 0) return -1; - tmp &= ~PHYCFGR_OPMDC_ALLA; + tmp &= ~PHYCFGR_OPMDC_ALLA; if( pmode == PHY_POWER_DOWN) tmp |= PHYCFGR_OPMDC_PDOWN; else @@ -633,11 +633,11 @@ uint8_t *wizchip_getsubn(void) { int8_t wizchip_setnetmode(netmode_type netmode) { uint8_t tmp = 0; -#if _WIZCHIP_ != 5500 +#if _WIZCHIP_ != 5500 if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK)) return -1; #else if(netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK | NM_FORCEARP)) return -1; -#endif +#endif tmp = getMR(); tmp |= (uint8_t)netmode; setMR(tmp); diff --git a/drivers/wiznet5k/ethernet/wizchip_conf.h b/drivers/wiznet5k/ethernet/wizchip_conf.h index 10f12a7947..509ba0668a 100644 --- a/drivers/wiznet5k/ethernet/wizchip_conf.h +++ b/drivers/wiznet5k/ethernet/wizchip_conf.h @@ -11,30 +11,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -42,9 +42,9 @@ /** * @defgroup extra_functions 2. WIZnet Extra Functions * - * @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions. + * @brief These functions is optional function. It could be replaced at WIZCHIP I/O function because they were made by WIZCHIP I/O functions. * @details There are functions of configuring WIZCHIP, network, interrupt, phy, network information and timer. \n - * + * */ #ifndef _WIZCHIP_CONF_H_ @@ -97,10 +97,10 @@ #include "w5200/w5200.h" #elif (_WIZCHIP_ == 5500) #define _WIZCHIP_ID_ "W5500\0" - + /** * @brief Define interface mode. \n - * @todo Should select interface mode as chip. + * @todo Should select interface mode as chip. * - @ref \_WIZCHIP_IO_MODE_SPI_ \n * -@ref \_WIZCHIP_IO_MODE_SPI_VDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n * -@ref \_WIZCHIP_IO_MODE_SPI_FDM_ : Valid only in @ref \_WIZCHIP_ == 5500 \n @@ -109,12 +109,12 @@ * - @ref \_WIZCHIP_IO_MODE_BUS_INDIR_ \n * - Others will be defined in future. \n\n * ex> #define \_WIZCHIP_IO_MODE_ \_WIZCHIP_IO_MODE_SPI_VDM_ - * + * */ //#define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_FDM_ #define _WIZCHIP_IO_MODE_ _WIZCHIP_IO_MODE_SPI_VDM_ #include "w5500/w5500.h" -#else +#else #error "Unknown defined _WIZCHIP_. You should define one of 5100, 5200, and 5500 !!!" #endif @@ -128,19 +128,19 @@ * @ref \_WIZCHIP_IO_MODE_BUS_DIR_, @ref \_WIZCHIP_IO_MODE_BUS_INDIR_). \n\n * ex> #define \_WIZCHIP_IO_BASE_ 0x00008000 */ -#define _WIZCHIP_IO_BASE_ 0x00000000 // +#define _WIZCHIP_IO_BASE_ 0x00000000 // #if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_ #ifndef _WIZCHIP_IO_BASE_ #error "You should be define _WIZCHIP_IO_BASE to fit your system memory map." #endif -#endif +#endif #if _WIZCHIP_ > 5100 #define _WIZCHIP_SOCK_NUM_ 8 ///< The count of independant socket of @b WIZCHIP #else #define _WIZCHIP_SOCK_NUM_ 4 ///< The count of independant socket of @b WIZCHIP -#endif +#endif /******************************************************** @@ -159,9 +159,9 @@ typedef struct __WIZCHIP */ struct _CRIS { - void (*_enter) (void); ///< crtical section enter - void (*_exit) (void); ///< critial section exit - }CRIS; + void (*_enter) (void); ///< crtical section enter + void (*_exit) (void); ///< critial section exit + }CRIS; /** * The set of @ref\_WIZCHIP_ select control callback func. */ @@ -169,20 +169,20 @@ typedef struct __WIZCHIP { void (*_select) (void); ///< @ref \_WIZCHIP_ selected void (*_deselect)(void); ///< @ref \_WIZCHIP_ deselected - }CS; + }CS; /** * The set of interface IO callback func. */ union _IF - { + { /** * For BUS interface IO - */ + */ struct { uint8_t (*_read_byte) (uint32_t AddrSel); void (*_write_byte) (uint32_t AddrSel, uint8_t wb); - }BUS; + }BUS; /** * For SPI interface IO */ @@ -210,13 +210,13 @@ typedef enum CW_CLR_INTERRUPT, ///< Clears interrupt CW_SET_INTRMASK, ///< Masks interrupt CW_GET_INTRMASK, ///< Get interrupt mask - CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt. - CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt. + CW_SET_INTRTIME, ///< Set interval time between the current and next interrupt. + CW_GET_INTRTIME, ///< Set interval time between the current and next interrupt. CW_GET_ID, ///< Gets WIZCHIP name. #if _WIZCHIP_ == 5500 CW_RESET_PHY, ///< Resets internal PHY. Valid Only W5000 - CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000 + CW_SET_PHYCONF, ///< When PHY configured by interal register, PHY operation mode (Manual/Auto, 10/100, Half/Full). Valid Only W5000 CW_GET_PHYCONF, ///< Get PHY operation mode in interal register. Valid Only W5000 CW_GET_PHYSTATUS, ///< Get real PHY status on operating. Valid Only W5000 CW_SET_PHYPOWMODE, ///< Set PHY power mode as noraml and down when PHYSTATUS.OPMD == 1. Valid Only W5000 @@ -249,13 +249,13 @@ typedef enum { #if _WIZCHIP_ > 5200 IK_WOL = (1 << 4), ///< Wake On Lan by receiving the magic packet. Valid in W500. -#endif +#endif IK_PPPOE_TERMINATED = (1 << 5), ///< PPPoE Disconnected #if _WIZCHIP_ != 5200 IK_DEST_UNREACH = (1 << 6), ///< Destination IP & Port Unreable, No use in W5200 -#endif +#endif IK_IP_CONFLICT = (1 << 7), ///< IP conflict occurred @@ -263,22 +263,22 @@ typedef enum IK_SOCK_1 = (1 << 9), ///< Socket 1 interrupt IK_SOCK_2 = (1 << 10), ///< Socket 2 interrupt IK_SOCK_3 = (1 << 11), ///< Socket 3 interrupt -#if _WIZCHIP_ > 5100 +#if _WIZCHIP_ > 5100 IK_SOCK_4 = (1 << 12), ///< Socket 4 interrupt, No use in 5100 IK_SOCK_5 = (1 << 13), ///< Socket 5 interrupt, No use in 5100 IK_SOCK_6 = (1 << 14), ///< Socket 6 interrupt, No use in 5100 IK_SOCK_7 = (1 << 15), ///< Socket 7 interrupt, No use in 5100 -#endif +#endif #if _WIZCHIP_ > 5100 IK_SOCK_ALL = (0xFF << 8) ///< All Socket interrpt #else - IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt -#endif + IK_SOCK_ALL = (0x0F << 8) ///< All Socket interrpt +#endif }intr_kind; #define PHY_CONFBY_HW 0 ///< Configured PHY operation mode by HW pin -#define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register +#define PHY_CONFBY_SW 1 ///< Configured PHY operation mode by SW register #define PHY_MODE_MANUAL 0 ///< Configured PHY operation mode with user setting. #define PHY_MODE_AUTONEGO 1 ///< Configured PHY operation mode with auto-negotiation #define PHY_SPEED_10 0 ///< Link Speed 10 @@ -288,13 +288,13 @@ typedef enum #define PHY_LINK_OFF 0 ///< Link Off #define PHY_LINK_ON 1 ///< Link On #define PHY_POWER_NORM 0 ///< PHY power normal mode -#define PHY_POWER_DOWN 1 ///< PHY power down mode +#define PHY_POWER_DOWN 1 ///< PHY power down mode -#if _WIZCHIP_ == 5500 +#if _WIZCHIP_ == 5500 /** * @ingroup DATA_TYPE - * It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, + * It configures PHY configuration when CW_SET PHYCONF or CW_GET_PHYCONF in W5500, * and it indicates the real PHY status configured by HW or SW in all WIZCHIP. \n * Valid only in W5500. */ @@ -303,11 +303,11 @@ typedef struct wiz_PhyConf_t uint8_t by; ///< set by @ref PHY_CONFBY_HW or @ref PHY_CONFBY_SW uint8_t mode; ///< set by @ref PHY_MODE_MANUAL or @ref PHY_MODE_AUTONEGO uint8_t speed; ///< set by @ref PHY_SPEED_10 or @ref PHY_SPEED_100 - uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL + uint8_t duplex; ///< set by @ref PHY_DUPLEX_HALF @ref PHY_DUPLEX_FULL //uint8_t power; ///< set by @ref PHY_POWER_NORM or @ref PHY_POWER_DOWN - //uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF + //uint8_t link; ///< Valid only in CW_GET_PHYSTATUS. set by @ref PHY_LINK_ON or PHY_DUPLEX_OFF }wiz_PhyConf; -#endif +#endif /** * @ingroup DATA_TYPE @@ -327,7 +327,7 @@ typedef struct wiz_NetInfo_t { uint8_t mac[6]; ///< Source Mac Address uint8_t ip[4]; ///< Source IP Address - uint8_t sn[4]; ///< Subnet Mask + uint8_t sn[4]; ///< Subnet Mask uint8_t gw[4]; ///< Gateway IP Address uint8_t dns[4]; ///< DNS server IP Address dhcp_mode dhcp; ///< 1 - Static, 2 - DHCP @@ -339,10 +339,10 @@ typedef struct wiz_NetInfo_t */ typedef enum { -#if _WIZCHIP_ == 5500 +#if _WIZCHIP_ == 5500 NM_FORCEARP = (1<<1), ///< Force to APP send whenever udp data is sent. Valid only in W5500 -#endif - NM_WAKEONLAN = (1<<5), ///< Wake On Lan +#endif + NM_WAKEONLAN = (1<<5), ///< Wake On Lan NM_PINGBLOCK = (1<<4), ///< Block ping-request NM_PPPOE = (1<<3), ///< PPPoE mode }netmode_type; @@ -353,7 +353,7 @@ typedef enum */ typedef struct wiz_NetTimeout_t { - uint8_t retry_cnt; ///< retry count + uint8_t retry_cnt; ///< retry count uint16_t time_100us; ///< time unit 100us }wiz_NetTimeout; @@ -389,8 +389,8 @@ void reg_wizchip_bus_cbfunc(uint8_t (*bus_rb)(uint32_t addr), void (*bus_wb)(uin /** *@brief Registers call back function for SPI interface. - *@param spi_rb : callback function to read byte usig SPI - *@param spi_wb : callback function to write byte usig SPI + *@param spi_rb : callback function to read byte usig SPI + *@param spi_wb : callback function to write byte usig SPI *@todo Describe \ref wizchip_spi_readbyte and \ref wizchip_spi_writebyte function *or register your functions. *@note If you do not describe or register, null function is called. @@ -405,8 +405,8 @@ void reg_wizchip_spi_cbfunc(void (*spi_rb)(uint8_t *, uint32_t), void (*spi_wb)( * @param cwtype : Decides to the control type * @param arg : arg type is dependent on cwtype. * @return 0 : Success \n - * -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP - */ + * -1 : Fail because of invalid \ref ctlwizchip_type or unsupported \ref ctlwizchip_type in WIZCHIP + */ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg); /** @@ -416,20 +416,20 @@ int8_t ctlwizchip(ctlwizchip_type cwtype, void* arg); * @param cntype : Input. Decides to the control type * @param arg : Inout. arg type is dependent on cntype. * @return -1 : Fail because of invalid \ref ctlnetwork_type or unsupported \ref ctlnetwork_type in WIZCHIP \n - * 0 : Success - */ + * 0 : Success + */ int8_t ctlnetwork(ctlnetwork_type cntype, void* arg); -/* - * The following functions are implemented for internal use. +/* + * The following functions are implemented for internal use. * but You can call these functions for code size reduction instead of ctlwizchip() and ctlnetwork(). */ - + /** * @ingroup extra_functions * @brief Reset WIZCHIP by softly. - */ + */ void wizchip_sw_reset(void); /** @@ -442,28 +442,28 @@ void wizchip_sw_reset(void); */ int8_t wizchip_init(uint8_t* txsize, uint8_t* rxsize); -/** +/** * @ingroup extra_functions * @brief Clear Interrupt of WIZCHIP. * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. */ void wizchip_clrinterrupt(intr_kind intr); -/** +/** * @ingroup extra_functions * @brief Get Interrupt of WIZCHIP. * @return @ref intr_kind value operated OR. It can type-cast to uint16_t. */ intr_kind wizchip_getinterrupt(void); -/** +/** * @ingroup extra_functions * @brief Mask or Unmask Interrupt of WIZCHIP. * @param intr : @ref intr_kind value operated OR. It can type-cast to uint16_t. */ void wizchip_setinterruptmask(intr_kind intr); -/** +/** * @ingroup extra_functions * @brief Get Interrupt mask of WIZCHIP. * @return : The operated OR vaule of @ref intr_kind. It can type-cast to uint16_t. @@ -482,25 +482,25 @@ intr_kind wizchip_getinterruptmask(void); * @brief Set the phy information for WIZCHIP without power mode * @param phyconf : @ref wiz_PhyConf */ - void wizphy_setphyconf(wiz_PhyConf* phyconf); + void wizphy_setphyconf(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief Get phy configuration information. * @param phyconf : @ref wiz_PhyConf */ - void wizphy_getphyconf(wiz_PhyConf* phyconf); + void wizphy_getphyconf(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief Get phy status. * @param phyconf : @ref wiz_PhyConf - */ + */ void wizphy_getphystat(wiz_PhyConf* phyconf); /** * @ingroup extra_functions * @brief set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200 * @param pmode Settig value of power down mode. - */ - int8_t wizphy_setphypmode(uint8_t pmode); + */ + int8_t wizphy_setphypmode(uint8_t pmode); #endif /** @@ -523,14 +523,14 @@ uint8_t *wizchip_getsubn(void); /** * @ingroup extra_functions - * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. + * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. * @param pnetinfo Value of network mode. Refer to @ref netmode_type. */ int8_t wizchip_setnetmode(netmode_type netmode); /** * @ingroup extra_functions - * @brief Get the network mode such WOL, PPPoE, Ping Block, and etc. + * @brief Get the network mode such WOL, PPPoE, Ping Block, and etc. * @return Value of network mode. Refer to @ref netmode_type. */ netmode_type wizchip_getnetmode(void); @@ -538,16 +538,16 @@ netmode_type wizchip_getnetmode(void); /** * @ingroup extra_functions * @brief Set retry time value(@ref RTR) and retry count(@ref RCR). - * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. - * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. + * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. + * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. */ void wizchip_settimeout(wiz_NetTimeout* nettime); /** * @ingroup extra_functions * @brief Get retry time value(@ref RTR) and retry count(@ref RCR). - * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. - * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. + * @details @ref RTR configures the retransmission timeout period and @ref RCR configures the number of time of retransmission. + * @param nettime @ref RTR value and @ref RCR value. Refer to @ref wiz_NetTimeout. */ void wizchip_gettimeout(wiz_NetTimeout* nettime); diff --git a/drivers/wiznet5k/internet/dhcp/dhcp.h b/drivers/wiznet5k/internet/dhcp/dhcp.h index 881bf5a6c1..618a91498b 100644 --- a/drivers/wiznet5k/internet/dhcp/dhcp.h +++ b/drivers/wiznet5k/internet/dhcp/dhcp.h @@ -15,30 +15,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -46,7 +46,7 @@ #define _DHCP_H_ /* - * @brief + * @brief * @details If you want to display debug & processing message, Define _DHCP_DEBUG_ * @note If defined, it depends on */ @@ -65,7 +65,7 @@ #define DCHP_HOST_NAME "WIZnet\0" -/* +/* * @brief return value of @ref DHCP_run() */ enum @@ -74,7 +74,7 @@ enum DHCP_RUNNING, ///< Processing DHCP protocol DHCP_IP_ASSIGN, ///< First Occupy IP from DHPC server (if cbfunc == null, act as default default_ip_assign) DHCP_IP_CHANGED, ///< Change IP address by new IP address from DHCP (if cbfunc == null, act as default default_ip_update) - DHCP_IP_LEASED, ///< Stand by + DHCP_IP_LEASED, ///< Stand by DHCP_STOPPED ///< Stop processing DHCP protocol }; @@ -89,12 +89,12 @@ void DHCP_init(uint8_t s, DHCP_INIT_BUFFER_TYPE* buf); /* * @brief DHCP 1s Tick Timer handler - * @note SHOULD BE register to your system 1s Tick timer handler + * @note SHOULD BE register to your system 1s Tick timer handler */ void DHCP_time_handler(void); -/* - * @brief Register call back function +/* + * @brief Register call back function * @param ip_assign - callback func when IP is assigned from DHCP server first * @param ip_update - callback func when IP is changed * @prarm ip_conflict - callback func when the assigned IP is conflict with others. @@ -112,13 +112,13 @@ void reg_dhcp_cbfunc(void(*ip_assign)(void), void(*ip_update)(void), void(*ip_co * @ref DHCP_STOPPED \n * * @note This function is always called by you main task. - */ + */ uint8_t DHCP_run(void); /* * @brief Stop DHCP processing * @note If you want to restart. call DHCP_init() and DHCP_run() - */ + */ void DHCP_stop(void); /* Get Network information assigned from DHCP server */ diff --git a/drivers/wiznet5k/internet/dns/dns.c b/drivers/wiznet5k/internet/dns/dns.c index 8b9e966708..aa3a738091 100644 --- a/drivers/wiznet5k/internet/dns/dns.c +++ b/drivers/wiznet5k/internet/dns/dns.c @@ -22,30 +22,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** @@ -338,7 +338,7 @@ uint8_t * dns_answer(uint8_t * msg, uint8_t * cp, uint8_t * ip_from_dns) * len - is the size of reply message. * Returns : -1 - Domain name length is too big * 0 - Fail (Timeout or parse error) - * 1 - Success, + * 1 - Success, */ int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns) { @@ -525,7 +525,7 @@ int8_t DNS_run(uint8_t * dns_ip, uint8_t * name, uint8_t * ip_from_dns) int8_t ret_check_timeout; hal_sys_tick = HAL_GetTick(); - + // Socket open WIZCHIP_EXPORT(socket)(DNS_SOCKET, Sn_MR_UDP, 0, 0); diff --git a/drivers/wiznet5k/internet/dns/dns.h b/drivers/wiznet5k/internet/dns/dns.h index de0039515e..574b632a6a 100644 --- a/drivers/wiznet5k/internet/dns/dns.h +++ b/drivers/wiznet5k/internet/dns/dns.h @@ -2,7 +2,7 @@ // //! \file dns.h //! \brief DNS APIs Header file. -//! \details Send DNS query & Receive DNS reponse. +//! \details Send DNS query & Receive DNS reponse. //! \version 1.1.0 //! \date 2013/11/18 //! \par Revision history @@ -20,30 +20,30 @@ //! //! Copyright (c) 2013, WIZnet Co., LTD. //! All rights reserved. -//! -//! Redistribution and use in source and binary forms, with or without -//! modification, are permitted provided that the following conditions -//! are met: -//! -//! * Redistributions of source code must retain the above copyright -//! notice, this list of conditions and the following disclaimer. +//! +//! Redistribution and use in source and binary forms, with or without +//! modification, are permitted provided that the following conditions +//! are met: +//! +//! * Redistributions of source code must retain the above copyright +//! notice, this list of conditions and the following disclaimer. //! * Redistributions in binary form must reproduce the above copyright //! notice, this list of conditions and the following disclaimer in the -//! documentation and/or other materials provided with the distribution. -//! * Neither the name of the nor the names of its -//! contributors may be used to endorse or promote products derived -//! from this software without specific prior written permission. -//! +//! documentation and/or other materials provided with the distribution. +//! * Neither the name of the nor the names of its +//! contributors may be used to endorse or promote products derived +//! from this software without specific prior written permission. +//! //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +//! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +//! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +//! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +//! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +//! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +//! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +//! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF //! THE POSSIBILITY OF SUCH DAMAGE. // //***************************************************************************** diff --git a/extmod/font_petme128_8x8.h b/extmod/font_petme128_8x8.h index cdc4e73a79..9963698b17 100644 --- a/extmod/font_petme128_8x8.h +++ b/extmod/font_petme128_8x8.h @@ -27,7 +27,7 @@ #define MICROPY_INCLUDED_STM32_FONT_PETME128_8X8_H static const uint8_t font_petme128_8x8[] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32= 0x00,0x00,0x00,0x4f,0x4f,0x00,0x00,0x00, // 33=! 0x00,0x07,0x07,0x00,0x00,0x07,0x07,0x00, // 34=" 0x14,0x7f,0x7f,0x14,0x14,0x7f,0x7f,0x14, // 35=# diff --git a/lib/libm/ef_rem_pio2.c b/lib/libm/ef_rem_pio2.c index 601f3bac4e..bbb73097d6 100644 --- a/lib/libm/ef_rem_pio2.c +++ b/lib/libm/ef_rem_pio2.c @@ -17,22 +17,22 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * */ /* __ieee754_rem_pio2f(x,y) - * - * return the remainder of x rem pi/2 in y[0]+y[1] + * + * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2f() */ #include "fdlibm.h" /* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const __int32_t two_over_pi[] = { @@ -40,27 +40,27 @@ static const __int32_t two_over_pi[] = { static __int32_t two_over_pi[] = { #endif 0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC, -0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, +0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, 0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63, -0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, +0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, 0x42, 0x4D, 0xD2, 0xE0, 0x06, 0x49, 0x2E, 0xEA, 0x09, -0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, +0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, 0xA7, 0x3E, 0xE8, 0x82, 0x35, 0xF5, 0x2E, 0xBB, 0x44, -0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, +0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, 0x39, 0x91, 0xD6, 0x39, 0x83, 0x53, 0x39, 0xF4, 0x9C, -0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, +0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, 0x97, 0xFF, 0xDE, 0x05, 0x98, 0x0F, 0xEF, 0x2F, 0x11, -0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, +0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, 0x27, 0xCB, 0x09, 0xB7, 0x4F, 0x46, 0x3F, 0x66, 0x9E, -0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, +0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, 0xF1, 0x7B, 0x3D, 0x07, 0x39, 0xF7, 0x8A, 0x52, 0x92, -0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, +0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, 0x56, 0x03, 0x30, 0x46, 0xFC, 0x7B, 0x6B, 0xAB, 0xF0, -0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, +0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, 0x91, 0x61, 0x5E, 0xE6, 0x1B, 0x08, 0x65, 0x99, 0x85, -0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, +0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, 0x4D, 0x73, 0x27, 0x31, 0x06, 0x06, 0x15, 0x56, 0xCA, -0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, +0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, }; /* This array is like the one in e_rem_pio2.c, but the numbers are @@ -89,9 +89,9 @@ static __int32_t npio2_hw[] = { */ #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0000000000e+00, /* 0x00000000 */ half = 5.0000000000e-01, /* 0x3f000000 */ @@ -121,7 +121,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(ix<=0x3f490fd8) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */ - if(hx>0) { + if(hx>0) { z = x - pio2_1; if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */ y[0] = z - pio2_1t; @@ -151,27 +151,27 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ fn = (float)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 40 bit */ - if(n<32&&(__int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) { + if(n<32&&(__int32_t)(ix&0xffffff00)!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { __uint32_t high; j = ix>>23; - y[0] = r-w; + y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>8) { /* 2nd iteration needed, good to 57 */ t = r; - w = fn*pio2_2; + w = fn*pio2_2; r = t-w; - w = fn*pio2_2t-((t-r)-w); + w = fn*pio2_2t-((t-r)-w); y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>25) { /* 3rd iteration need, 74 bits acc */ t = r; /* will cover all possible cases */ - w = fn*pio2_3; + w = fn*pio2_3; r = t-w; - w = fn*pio2_3t-((t-r)-w); + w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } @@ -180,7 +180,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } - /* + /* * all other (large) arguments */ if(!FLT_UWORD_IS_FINITE(ix)) { diff --git a/lib/libm/ef_sqrt.c b/lib/libm/ef_sqrt.c index 87484d0bf0..8615dfc172 100644 --- a/lib/libm/ef_sqrt.c +++ b/lib/libm/ef_sqrt.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -74,12 +74,12 @@ float sqrtf(float x) r = 0x01000000L; /* r = moving bit from right to left */ while(r!=0) { - t = s+r; - if(t<=ix) { - s = t+r; - ix -= t; - q += r; - } + t = s+r; + if(t<=ix) { + s = t+r; + ix -= t; + q += r; + } ix += ix; r>>=1; } diff --git a/lib/libm/erf_lgamma.c b/lib/libm/erf_lgamma.c index fcb1d0a0c6..5116e3c1b1 100644 --- a/lib/libm/erf_lgamma.c +++ b/lib/libm/erf_lgamma.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * @@ -29,9 +29,9 @@ #define __ieee754_logf logf #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif two23= 8.3886080000e+06, /* 0x4b000000 */ half= 5.0000000000e-01, /* 0x3f000000 */ @@ -144,9 +144,9 @@ static float zero= 0.0000000000e+00; } switch (n) { case 0: y = __kernel_sinf(pi*y,zero,0); break; - case 1: + case 1: case 2: y = __kernel_cosf(pi*((float)0.5-y),zero); break; - case 3: + case 3: case 4: y = __kernel_sinf(pi*(one-y),zero,0); break; case 5: case 6: y = -__kernel_cosf(pi*(y-(float)1.5),zero); break; @@ -219,7 +219,7 @@ static float zero= 0.0000000000e+00; p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); p = z*p1-(tt-w*(p2+y*p3)); r += (tf + p); break; - case 2: + case 2: p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); r += (-(float)0.5*y + p1/p2); @@ -248,7 +248,7 @@ static float zero= 0.0000000000e+00; y = z*z; w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); r = (x-half)*(t-one)+w; - } else + } else /* 2**58 <= x <= inf */ r = x*(__ieee754_logf(x)-one); if(hx<0) r = nadj - r; diff --git a/lib/libm/fdlibm.h b/lib/libm/fdlibm.h index ace3b2da22..67bc622ea5 100644 --- a/lib/libm/fdlibm.h +++ b/lib/libm/fdlibm.h @@ -15,7 +15,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -136,12 +136,12 @@ #define __P(p) () #endif -/* +/* * set X_TLOSS = pi*2**52, which is possibly defined in * (one may replace the following line by "#include ") */ -#define X_TLOSS 1.41484755040568800000e+16 +#define X_TLOSS 1.41484755040568800000e+16 /* Functions that are not documented, and are not in . */ @@ -154,13 +154,13 @@ extern float scalbf __P((float, float)); extern float significandf __P((float)); /* ieee style elementary float functions */ -extern float __ieee754_sqrtf __P((float)); -extern float __ieee754_acosf __P((float)); -extern float __ieee754_acoshf __P((float)); -extern float __ieee754_logf __P((float)); -extern float __ieee754_atanhf __P((float)); -extern float __ieee754_asinf __P((float)); -extern float __ieee754_atan2f __P((float,float)); +extern float __ieee754_sqrtf __P((float)); +extern float __ieee754_acosf __P((float)); +extern float __ieee754_acoshf __P((float)); +extern float __ieee754_logf __P((float)); +extern float __ieee754_atanhf __P((float)); +extern float __ieee754_asinf __P((float)); +extern float __ieee754_atan2f __P((float,float)); extern float __ieee754_expf __P((float)); extern float __ieee754_coshf __P((float)); extern float __ieee754_fmodf __P((float,float)); diff --git a/lib/libm/kf_cos.c b/lib/libm/kf_cos.c index 691f9842fd..5181664901 100644 --- a/lib/libm/kf_cos.c +++ b/lib/libm/kf_cos.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -25,9 +25,9 @@ #include "fdlibm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ C1 = 4.1666667908e-02, /* 0x3d2aaaab */ @@ -53,7 +53,7 @@ C6 = -1.1359647598e-11; /* 0xad47d74e */ } z = x*x; r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); - if(ix < 0x3e99999a) /* if |x| < 0.3 */ + if(ix < 0x3e99999a) /* if |x| < 0.3 */ return one - ((float)0.5*z - (z*r - x*y)); else { if(ix > 0x3f480000) { /* x > 0.78125 */ diff --git a/lib/libm/kf_rem_pio2.c b/lib/libm/kf_rem_pio2.c index 3b09de5fd0..62aa242bc7 100644 --- a/lib/libm/kf_rem_pio2.c +++ b/lib/libm/kf_rem_pio2.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -30,7 +30,7 @@ #ifdef __STDC__ static const int init_jk[] = {4,7,9}; /* initial value for jk */ #else -static int init_jk[] = {4,7,9}; +static int init_jk[] = {4,7,9}; #endif #ifdef __STDC__ @@ -52,9 +52,9 @@ static float PIo2[] = { }; #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0, one = 1.0, @@ -62,9 +62,9 @@ two8 = 2.5600000000e+02, /* 0x43800000 */ twon8 = 3.9062500000e-03; /* 0x3b800000 */ #ifdef __STDC__ - int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2) + int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2) #else - int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) + int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) float x[], y[]; int e0,nx,prec; __int32_t ipio2[]; #endif { @@ -109,7 +109,7 @@ recompute: i = (iq[jz-1]>>(8-q0)); n += i; iq[jz-1] -= i<<(8-q0); ih = iq[jz-1]>>(7-q0); - } + } else if(q0==0) ih = iq[jz-1]>>8; else if(z>=(float)0.5) ih=2; @@ -141,7 +141,7 @@ recompute: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" if(z==zero) { -#pragma GCC diagnostic pop +#pragma GCC diagnostic pop j = 0; for (i=jz-1;i>=jk;i--) j |= iq[i]; if(j==0) { /* need recomputation */ @@ -166,7 +166,7 @@ recompute: while(iq[jz]==0) { jz--; q0-=8;} } else { /* break z into 8-bit if necessary */ z = scalbnf(z,-(int)q0); - if(z>=two8) { + if(z>=two8) { fw = (float)((__int32_t)(twon8*z)); iq[jz] = (__int32_t)(z-two8*fw); jz += 1; q0 += 8; @@ -191,29 +191,29 @@ recompute: case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; - for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; - y[1] = (ih==0)? fw: -fw; + y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } - for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; + for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { diff --git a/lib/libm/kf_sin.c b/lib/libm/kf_sin.c index 07ea993446..6ef8903cae 100644 --- a/lib/libm/kf_sin.c +++ b/lib/libm/kf_sin.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -25,9 +25,9 @@ #include "fdlibm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif half = 5.0000000000e-01,/* 0x3f000000 */ S1 = -1.6666667163e-01, /* 0xbe2aaaab */ diff --git a/lib/libm/kf_tan.c b/lib/libm/kf_tan.c index 6da9bd8171..f0ff94c88d 100644 --- a/lib/libm/kf_tan.c +++ b/lib/libm/kf_tan.c @@ -17,16 +17,16 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #include "libm.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ pio4 = 7.8539812565e-01, /* 0x3f490fda */ @@ -87,7 +87,7 @@ T[] = { return (float)(1-((hx>>30)&2))*(v-(float)2.0*(x-(w*w/(w+v)-r))); } if(iy==1) return w; - else { /* if allow error up to 2 ulp, + else { /* if allow error up to 2 ulp, simply return -1.0/(x+r) here */ /* compute -1.0/(x+r) accurately */ float a,t; diff --git a/lib/libm/sf_cos.c b/lib/libm/sf_cos.c index fabb129cd9..0fe7c8ce6e 100644 --- a/lib/libm/sf_cos.c +++ b/lib/libm/sf_cos.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_erf.c b/lib/libm/sf_erf.c index 3f0172c6e9..a6aec096f1 100644 --- a/lib/libm/sf_erf.c +++ b/lib/libm/sf_erf.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -57,7 +57,7 @@ qq3 = 5.0813062117e-03, /* 0x3ba68116 */ qq4 = 1.3249473704e-04, /* 0x390aee49 */ qq5 = -3.9602282413e-06, /* 0xb684e21a */ /* - * Coefficients for approximation to erf in [0.84375,1.25] + * Coefficients for approximation to erf in [0.84375,1.25] */ pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */ pa1 = 4.1485610604e-01, /* 0x3ed46805 */ @@ -110,9 +110,9 @@ sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ #ifdef __STDC__ - float erff(float x) + float erff(float x) #else - float erff(x) + float erff(x) float x; #endif { @@ -127,7 +127,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ if(ix < 0x3f580000) { /* |x|<0.84375 */ if(ix < 0x31800000) { /* |x|<2**-28 */ - if (ix < 0x04000000) + if (ix < 0x04000000) /*avoid underflow */ return (float)0.125*((float)8.0*x+efx8*x); return x + efx*x; @@ -167,9 +167,9 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ } #ifdef __STDC__ - float erfcf(float x) + float erfcf(float x) #else - float erfcf(x) + float erfcf(x) float x; #endif { @@ -202,7 +202,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); if(hx>=0) { - z = one-erx; return z - P/Q; + z = one-erx; return z - P/Q; } else { z = erx+P/Q; return one+z; } diff --git a/lib/libm/sf_frexp.c b/lib/libm/sf_frexp.c index df50fb7737..92cedb8bc4 100644 --- a/lib/libm/sf_frexp.c +++ b/lib/libm/sf_frexp.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_ldexp.c b/lib/libm/sf_ldexp.c index 75cb8b7275..c177160a3c 100644 --- a/lib/libm/sf_ldexp.c +++ b/lib/libm/sf_ldexp.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_modf.c b/lib/libm/sf_modf.c index 410db2a373..8bad5d2e28 100644 --- a/lib/libm/sf_modf.c +++ b/lib/libm/sf_modf.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_sin.c b/lib/libm/sf_sin.c index d270507785..b9d4049b32 100644 --- a/lib/libm/sf_sin.c +++ b/lib/libm/sf_sin.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/sf_tan.c b/lib/libm/sf_tan.c index 148b16d618..42d2df9c90 100644 --- a/lib/libm/sf_tan.c +++ b/lib/libm/sf_tan.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ diff --git a/lib/libm/wf_lgamma.c b/lib/libm/wf_lgamma.c index d86ede790b..8a7fb822d7 100644 --- a/lib/libm/wf_lgamma.c +++ b/lib/libm/wf_lgamma.c @@ -17,7 +17,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== * @@ -44,7 +44,7 @@ y = __ieee754_lgammaf_r(x,&(_REENT_SIGNGAM(_REENT))); if(_LIB_VERSION == _IEEE_) return y; if(!finitef(y)&&finitef(x)) { -#ifndef HUGE_VAL +#ifndef HUGE_VAL #define HUGE_VAL inf double inf = 0.0; @@ -77,11 +77,11 @@ } if (exc.err != 0) errno = exc.err; - return (float)exc.retval; + return (float)exc.retval; } else return y; #endif -} +} #ifdef _DOUBLE_IS_32BITS diff --git a/lib/libm_dbl/__signbit.c b/lib/libm_dbl/__signbit.c index 18c6728a50..f1f1ae8108 100644 --- a/lib/libm_dbl/__signbit.c +++ b/lib/libm_dbl/__signbit.c @@ -8,5 +8,3 @@ int __signbitd(double x) } y = { x }; return y.i>>63; } - - diff --git a/lib/memzip/README.md b/lib/memzip/README.md index 287d0fc489..c4e31a1170 100644 --- a/lib/memzip/README.md +++ b/lib/memzip/README.md @@ -25,4 +25,3 @@ $(BUILD)/memzip-files.c: $(shell find ${MEMZIP_DIR} -type f) @$(ECHO) "Creating $@" $(Q)$(PYTHON) $(MAKE_MEMZIP) --zip-file $(BUILD)/memzip-files.zip --c-file $@ $(MEMZIP_DIR) ``` - diff --git a/lib/memzip/lexermemzip.c b/lib/memzip/lexermemzip.c index 6b26961bdc..c1f21c1caa 100644 --- a/lib/memzip/lexermemzip.c +++ b/lib/memzip/lexermemzip.c @@ -16,4 +16,3 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)data, (mp_uint_t)len, 0); } - diff --git a/lib/memzip/make-memzip.py b/lib/memzip/make-memzip.py index 9730f5e008..dd1ac93da4 100755 --- a/lib/memzip/make-memzip.py +++ b/lib/memzip/make-memzip.py @@ -76,4 +76,3 @@ def main(): if __name__ == "__main__": main() - diff --git a/lib/oofatfs/option/ccsbcs.c b/lib/oofatfs/option/ccsbcs.c index fdded968d5..f0c7e90a5c 100644 --- a/lib/oofatfs/option/ccsbcs.c +++ b/lib/oofatfs/option/ccsbcs.c @@ -385,4 +385,3 @@ WCHAR ff_wtoupper ( /* Returns upper converted character */ return chr; } - diff --git a/lib/tinytest/README b/lib/tinytest/README index 902c4a2e0f..28165d8bc7 100644 --- a/lib/tinytest/README +++ b/lib/tinytest/README @@ -15,4 +15,3 @@ You can get the latest version using Git, by pulling from Patches are welcome. Patches that turn this from tinytest to hugetest will not be applied. If you want a huge test framework, use CUnit. - diff --git a/lib/tinytest/tinytest.c b/lib/tinytest/tinytest.c index 01772f3f8e..be2ebd4956 100644 --- a/lib/tinytest/tinytest.c +++ b/lib/tinytest/tinytest.c @@ -474,4 +474,3 @@ tinytest_set_test_skipped_(void) if (cur_test_outcome==OK) cur_test_outcome = SKIP; } - diff --git a/logo/adafruit_blinka_angles-back.svg b/logo/adafruit_blinka_angles-back.svg index 589ed6f0a6..b69e3436d6 100644 --- a/logo/adafruit_blinka_angles-back.svg +++ b/logo/adafruit_blinka_angles-back.svg @@ -368,4 +368,4 @@ id="g5465"> \ No newline at end of file + d="M 0,0 C 1.069,-0.604 2.001,-3.052 2.61,-6.566 2.596,-6.436 2.585,-6.304 2.571,-6.173 2.43,-4.877 2.259,-3.587 2.062,-2.304 1.874,-1.02 1.655,0.257 1.4,1.521 1.151,2.784 0.866,4.036 0.524,5.259 c -0.336,1.22 -0.722,2.422 -1.205,3.525 -0.243,0.548 -0.503,1.077 -0.792,1.529 -0.278,0.448 -0.623,0.838 -0.84,0.961 -0.04,0.026 -0.067,0.038 -0.087,0.044 l -0.072,-0.004 c -0.043,-0.015 0.108,0.01 0.067,-10e-4 0.002,0 -0.016,-0.009 -0.05,-0.03 C -2.604,11.21 -2.939,10.854 -3.202,10.421 -3.755,9.534 -4.186,8.371 -4.556,7.206 -4.924,6.027 -5.222,4.799 -5.471,3.554 -5.718,2.307 -5.938,1.046 -6.115,-0.226 c -0.179,-1.272 -0.32,-2.552 -0.447,-3.836 -0.241,-2.571 -0.389,-5.158 -0.452,-7.75 l -0.037,-1.519 -1.451,-0.058 -2.032,-0.081 c 0.304,-0.178 0.607,-0.357 0.91,-0.536 l 5.116,-3.091 c 0.042,-0.025 0.083,-0.051 0.126,-0.077 -0.004,0.309 -0.007,0.619 -0.007,0.933 0,6.707 0.952,12.47 2.316,15.006 -0.071,-0.657 -0.11,-1.382 -0.11,-2.149 0,-1.433 0.136,-2.731 0.356,-3.677 0.224,-0.964 0.537,-1.563 0.883,-1.563 0.468,0 0.878,1.107 1.088,2.738 0.095,0.743 0.15,1.596 0.15,2.502 0,1.29 -0.111,2.47 -0.294,3.384" /> diff --git a/logo/adafruit_blinka_angles-front.svg b/logo/adafruit_blinka_angles-front.svg index f09ce38607..b5c07c5025 100644 --- a/logo/adafruit_blinka_angles-front.svg +++ b/logo/adafruit_blinka_angles-front.svg @@ -413,4 +413,4 @@ id="g10457"> \ No newline at end of file + d="m 0,0 3.99,1.09 7.954,2.26 6.252,1.855 1.671,0.496 5.787,1.717 -6.001,1.541 C 18.416,9.277 17.168,9.536 15.924,9.82 l -2.158,0.484 c -0.021,0.944 -0.06,1.888 -0.122,2.832 -0.103,1.462 -0.252,2.923 -0.469,4.38 -0.431,2.912 -1.074,5.82 -2.162,8.645 -0.537,1.413 -1.186,2.807 -2,4.159 -0.825,1.343 -1.814,2.67 -3.237,3.775 -1.408,1.107 -3.488,1.847 -5.552,1.385 -2.006,-0.444 -3.459,-1.684 -4.511,-2.921 -0.382,-0.455 -0.719,-0.925 -1.035,-1.401 -0.161,0.064 -0.317,0.123 -0.49,0.191 -0.304,0.124 -0.619,0.252 -0.938,0.382 -0.342,0.124 -0.626,0.295 -0.931,0.464 -0.311,0.174 -0.621,0.349 -0.927,0.52 -0.312,0.177 -0.557,0.393 -0.837,0.59 -0.261,0.205 -0.563,0.392 -0.768,0.611 -0.228,0.219 -0.444,0.427 -0.643,0.618 -0.199,0.198 -0.341,0.401 -0.493,0.579 -0.153,0.179 -0.267,0.34 -0.351,0.479 -0.189,0.278 -0.271,0.463 -0.271,0.463 0,0 -0.041,-0.186 -0.054,-0.536 -0.016,-0.18 -0.02,-0.399 -10e-4,-0.64 0.017,-0.242 0.015,-0.536 0.061,-0.838 0.053,-0.307 0.111,-0.64 0.171,-0.991 0.051,-0.371 0.187,-0.708 0.294,-1.093 0.122,-0.373 0.226,-0.795 0.392,-1.174 0.171,-0.384 0.345,-0.775 0.52,-1.165 0.18,-0.395 0.36,-0.808 0.585,-1.154 0.221,-0.365 0.438,-0.724 0.647,-1.071 0.217,-0.347 0.423,-0.703 0.638,-1.01 0.225,-0.294 0.438,-0.572 0.635,-0.829 0.05,-0.063 0.095,-0.121 0.144,-0.182 -0.112,-0.354 -0.235,-0.705 -0.335,-1.06 -0.809,-2.85 -1.251,-5.746 -1.455,-8.64 -0.105,-1.446 -0.169,-2.891 -0.148,-4.334 0.024,-1.456 0.071,-2.878 0.216,-4.314 0.096,-1.433 0.329,-2.854 0.552,-4.269 0.237,-1.421 0.562,-2.802 0.925,-4.181 l -0.1,2.134 -0.038,2.122 c -0.002,0.546 0.007,1.094 0.017,1.641 0.015,0.862 0.041,1.723 0.087,2.581 0.049,1.399 0.169,2.813 0.321,4.189 0.154,1.389 0.324,2.771 0.567,4.139 0.489,2.732 1.141,5.425 2.041,7.984 0.458,1.276 0.988,2.514 1.606,3.673 0.626,1.146 1.309,2.247 2.121,3.11 0.797,0.88 1.722,1.465 2.52,1.585 0.19,0.038 0.42,0.041 0.571,0.022 l 0.265,-0.021 c 0.096,-0.007 0.077,-0.026 0.121,-0.034 0.053,-0.018 0.11,-0.023 0.224,-0.07 0.393,-0.131 0.799,-0.37 1.208,-0.684 0.817,-0.647 1.571,-1.621 2.203,-2.7 0.633,-1.087 1.175,-2.279 1.626,-3.522 0.459,-1.242 0.816,-2.536 1.155,-3.841 0.333,-1.307 0.603,-2.639 0.821,-3.985 0.443,-2.69 0.633,-5.433 0.716,-8.178 L 9.918,7.053 11.459,6.811 12.605,6.63 11.046,6.059 4.729,3.658 3.317,3.122 2.445,2.78 c 0.027,0.486 0.045,0.979 0.045,1.484 0,3.923 -0.828,7.348 -2.062,9.241 -0.378,-0.966 -0.901,-1.567 -1.479,-1.567 -0.787,0 -1.465,1.122 -1.819,2.756 -1.821,-1.229 -3.165,-5.426 -3.165,-10.43 0,-1.679 0.156,-3.261 0.425,-4.678 -0.762,-0.31 -1.523,-0.62 -2.283,-0.933 -1.383,-0.57 -2.763,-1.147 -4.136,-1.744 2.692,0.631 5.363,1.323 8.034,2.018 z" /> diff --git a/logo/adafruit_blinka_angles-left.svg b/logo/adafruit_blinka_angles-left.svg index 32c83c4074..dae709fe05 100644 --- a/logo/adafruit_blinka_angles-left.svg +++ b/logo/adafruit_blinka_angles-left.svg @@ -5873,4 +5873,4 @@ id="g10145"> \ No newline at end of file + d="M 0,0 C 0.588,-0.108 1.194,-0.158 1.804,-0.242 2.11,-0.279 2.417,-0.317 2.727,-0.355 3.036,-0.389 3.349,-0.4 3.661,-0.424 c 0.627,-0.036 1.26,-0.09 1.894,-0.113 0.635,-0.015 1.274,-0.029 1.911,-0.044 0.638,-0.006 1.275,0.033 1.91,0.047 0.211,0.005 0.421,0.014 0.631,0.024 0.422,0.019 0.843,0.043 1.26,0.074 1.254,0.063 2.474,0.241 3.658,0.376 1.179,0.171 2.316,0.346 3.384,0.567 0.534,0.106 1.053,0.211 1.555,0.311 0.498,0.119 0.98,0.233 1.442,0.343 0.925,0.209 1.764,0.446 2.506,0.656 0.746,0.201 1.386,0.4 1.912,0.57 1.052,0.335 1.649,0.545 1.649,0.545 0,0 -0.63,-0.064 -1.726,-0.21 C 24.558,2.58 22.998,2.378 21.128,2.136 20.195,2.012 19.184,1.904 18.116,1.781 17.583,1.715 17.034,1.661 16.474,1.617 15.913,1.563 15.341,1.509 14.759,1.454 14.177,1.413 13.585,1.371 12.986,1.328 12.388,1.277 11.78,1.276 11.17,1.233 10.56,1.196 9.944,1.169 9.326,1.167 8.708,1.164 8.088,1.135 7.468,1.15 6.848,1.155 6.228,1.16 5.61,1.165 4.993,1.179 4.38,1.221 3.77,1.246 3.159,1.27 2.556,1.32 1.96,1.364 1.364,1.417 0.771,1.436 0.194,1.514 -0.96,1.655 -2.084,1.757 -3.14,1.932 -4.2,2.075 -5.197,2.258 -6.121,2.419 -7.048,2.568 -7.884,2.77 -8.636,2.912 c -0.751,0.147 -1.403,0.292 -1.938,0.42 -0.39,0.09 -0.719,0.162 -0.982,0.219 -0.462,0.099 -0.716,0.149 -0.716,0.149 0,0 0.573,-0.264 1.593,-0.696 0.256,-0.108 0.539,-0.228 0.847,-0.358 C -9.523,2.517 -9.181,2.408 -8.817,2.274 -8.089,2.021 -7.274,1.697 -6.354,1.452 -6.342,1.448 -6.327,1.444 -6.315,1.44 -6.533,1.319 -6.751,1.192 -6.967,1.062 -7.001,1.04 -7.035,1.021 -7.069,1 -7.28,0.87 -7.489,0.733 -7.696,0.594 -7.744,0.562 -7.792,0.532 -7.84,0.499 -8.087,0.329 -8.332,0.153 -8.573,-0.031 -9.037,-0.36 -9.46,-0.744 -9.901,-1.114 c -0.414,-0.398 -0.842,-0.791 -1.231,-1.223 -0.406,-0.417 -0.769,-0.868 -1.15,-1.314 -0.355,-0.459 -0.713,-0.926 -1.033,-1.411 -0.333,-0.479 -0.649,-0.97 -0.946,-1.469 -0.894,-1.497 -1.638,-3.068 -2.293,-4.639 -0.111,-0.263 -0.217,-0.525 -0.32,-0.788 -0.309,-0.789 -0.588,-1.58 -0.865,-2.372 -0.186,-0.536 -0.364,-1.053 -0.524,-1.56 -0.114,-0.363 -0.22,-0.721 -0.329,-1.08 v -0.001 c -0.001,-0.002 -0.002,-0.006 -0.003,-0.008 -0.293,-0.912 -0.583,-1.816 -0.869,-2.709 -0.14,-0.448 -0.291,-0.875 -0.436,-1.307 -0.147,-0.43 -0.279,-0.864 -0.433,-1.276 -0.576,-1.684 -1.217,-3.232 -1.908,-4.655 -0.178,-0.352 -0.354,-0.7 -0.527,-1.043 -0.194,-0.328 -0.385,-0.65 -0.573,-0.967 -0.094,-0.16 -0.186,-0.32 -0.278,-0.477 -0.105,-0.148 -0.207,-0.294 -0.31,-0.439 -0.204,-0.294 -0.404,-0.581 -0.601,-0.864 -0.209,-0.27 -0.432,-0.521 -0.642,-0.777 -0.218,-0.246 -0.404,-0.522 -0.636,-0.736 -0.452,-0.436 -0.857,-0.897 -1.295,-1.264 -0.445,-0.37 -0.861,-0.717 -1.245,-1.037 -0.412,-0.287 -0.79,-0.55 -1.131,-0.788 -0.176,-0.12 -0.334,-0.245 -0.5,-0.344 -0.168,-0.098 -0.326,-0.19 -0.472,-0.274 -0.294,-0.17 -0.542,-0.315 -0.744,-0.433 -0.403,-0.242 -0.617,-0.371 -0.617,-0.371 0,0 0.248,0.04 0.71,0.116 0.23,0.041 0.515,0.092 0.848,0.152 0.167,0.031 0.347,0.063 0.537,0.097 0.191,0.044 0.389,0.115 0.603,0.178 0.427,0.129 0.903,0.285 1.428,0.459 0.502,0.205 1.029,0.463 1.608,0.726 0.298,0.121 0.566,0.306 0.856,0.48 0.289,0.178 0.588,0.361 0.893,0.55 0.318,0.176 0.584,0.43 0.89,0.656 0.184,0.147 0.377,0.297 0.569,0.45 0.002,10e-4 0.002,0.002 0.004,0.003 0,0 0,-0.002 -0.001,-0.002 -0.139,-0.39 -0.28,-0.769 -0.427,-1.136 -0.56,-1.452 -1.203,-2.72 -1.855,-3.808 -0.655,-1.084 -1.326,-1.986 -1.944,-2.682 -0.148,-0.181 -0.303,-0.337 -0.447,-0.487 -0.147,-0.148 -0.273,-0.303 -0.404,-0.428 -0.263,-0.251 -0.48,-0.479 -0.676,-0.646 -0.386,-0.344 -0.592,-0.527 -0.592,-0.527 0,0 0.256,0.101 0.737,0.29 0.468,0.21 1.185,0.528 2.006,1.068 0.105,0.066 0.21,0.134 0.318,0.208 0.757,0.507 1.613,1.175 2.467,2.049 0.978,0.995 1.973,2.238 2.879,3.693 0.458,0.726 0.88,1.508 1.308,2.321 0.411,0.819 0.801,1.678 1.185,2.564 0.254,0.606 0.497,1.231 0.738,1.863 0.112,0.293 0.224,0.584 0.335,0.883 0.117,0.316 0.228,0.64 0.34,0.963 0.21,0.601 0.416,1.207 0.624,1.818 0.009,0.03 0.019,0.059 0.03,0.089 0.624,1.917 1.269,3.897 1.926,5.91 0.164,0.493 0.338,0.985 0.511,1.472 0.08,0.225 0.161,0.452 0.241,0.679 0.179,0.481 0.359,0.957 0.54,1.433 0.063,0.168 0.127,0.335 0.19,0.501 0.213,0.555 0.429,1.105 0.652,1.647 0.7,1.744 1.496,3.394 2.375,4.916 0.234,0.368 0.441,0.761 0.692,1.108 0.244,0.352 0.488,0.703 0.73,1.052 0.534,0.646 1.044,1.311 1.635,1.871 0.543,0.619 1.203,1.078 1.793,1.613 0.318,0.235 0.649,0.449 0.97,0.675 0.16,0.112 0.321,0.223 0.479,0.334 0.165,0.102 0.338,0.192 0.504,0.288 0.338,0.191 0.67,0.381 0.998,0.566 0.325,0.196 0.686,0.312 1.018,0.479 0.218,0.099 0.429,0.196 0.641,0.295 C -0.259,0.043 -0.169,0.028 -0.078,0.013 -0.052,0.009 -0.026,0.004 0,0" /> diff --git a/logo/adafruit_blinka_angles-right.svg b/logo/adafruit_blinka_angles-right.svg index 51f9279aac..a448b19494 100644 --- a/logo/adafruit_blinka_angles-right.svg +++ b/logo/adafruit_blinka_angles-right.svg @@ -478,4 +478,4 @@ id="g5189"> \ No newline at end of file + d="m 0,0 c -0.752,-0.143 -1.588,-0.344 -2.515,-0.493 -0.923,-0.161 -1.92,-0.344 -2.98,-0.487 -1.056,-0.175 -2.179,-0.277 -3.334,-0.418 -0.576,-0.079 -1.169,-0.097 -1.765,-0.15 -0.597,-0.044 -1.2,-0.095 -1.81,-0.118 -0.611,-0.025 -1.224,-0.067 -1.842,-0.081 -0.616,-0.005 -1.236,-0.01 -1.858,-0.015 -0.619,-0.015 -1.24,0.014 -1.857,0.017 -0.619,0.002 -1.234,0.029 -1.844,0.066 -0.61,0.043 -1.217,0.044 -1.816,0.095 -0.599,0.043 -1.191,0.085 -1.774,0.126 -0.581,0.055 -1.154,0.109 -1.712,0.163 -0.563,0.044 -1.112,0.098 -1.644,0.164 -1.067,0.123 -2.08,0.231 -3.012,0.355 -1.87,0.242 -3.428,0.444 -4.52,0.586 -1.092,0.146 -1.721,0.21 -1.725,0.21 h -10e-4 c 0,0 0.597,-0.21 1.652,-0.545 0.525,-0.17 1.166,-0.37 1.91,-0.57 0.742,-0.21 1.581,-0.447 2.506,-0.656 0.462,-0.11 0.943,-0.225 1.442,-0.343 0.501,-0.1 1.02,-0.205 1.556,-0.311 1.066,-0.221 2.205,-0.396 3.382,-0.567 1.184,-0.135 2.406,-0.313 3.659,-0.376 0.423,-0.032 0.849,-0.056 1.277,-0.075 0.205,-0.009 0.409,-0.018 0.614,-0.023 0.634,-0.014 1.272,-0.053 1.909,-0.047 0.639,0.014 1.277,0.029 1.913,0.044 0.634,0.023 1.265,0.077 1.892,0.113 0.313,0.023 0.626,0.035 0.936,0.068 0.308,0.039 0.616,0.077 0.922,0.114 0.609,0.084 1.216,0.133 1.804,0.242 0.027,0.004 0.053,0.009 0.08,0.014 0.09,0.015 0.179,0.029 0.27,0.044 0.213,-0.098 0.424,-0.195 0.641,-0.294 0.332,-0.167 0.693,-0.283 1.018,-0.479 0.327,-0.186 0.661,-0.375 0.998,-0.566 0.167,-0.096 0.339,-0.186 0.503,-0.288 0.159,-0.111 0.32,-0.222 0.48,-0.334 0.321,-0.226 0.652,-0.44 0.971,-0.675 0.589,-0.535 1.25,-0.994 1.793,-1.614 0.59,-0.559 1.1,-1.224 1.635,-1.871 0.241,-0.348 0.485,-0.699 0.729,-1.051 0.251,-0.347 0.458,-0.74 0.693,-1.108 0.879,-1.522 1.676,-3.172 2.374,-4.916 0.481,-1.167 0.93,-2.368 1.382,-3.577 0.08,-0.227 0.161,-0.457 0.241,-0.684 0.174,-0.486 0.347,-0.978 0.513,-1.471 0.655,-2.013 1.3,-3.993 1.925,-5.91 0.328,-0.971 0.648,-1.933 0.993,-2.87 0.349,-0.938 0.702,-1.858 1.074,-2.747 0.384,-0.885 0.773,-1.744 1.185,-2.563 0.427,-0.814 0.848,-1.595 1.307,-2.321 0.906,-1.455 1.901,-2.699 2.879,-3.693 0.976,-0.999 1.955,-1.728 2.785,-2.258 0.822,-0.539 1.537,-0.857 2.006,-1.067 0.481,-0.189 0.738,-0.29 0.738,-0.29 0,0 -0.206,0.183 -0.592,0.527 -0.197,0.167 -0.414,0.395 -0.675,0.646 -0.132,0.125 -0.259,0.28 -0.405,0.428 -0.144,0.15 -0.299,0.306 -0.448,0.487 -0.618,0.696 -1.289,1.598 -1.944,2.682 -0.653,1.087 -1.293,2.356 -1.855,3.808 -0.147,0.368 -0.289,0.748 -0.427,1.138 0.193,-0.154 0.387,-0.305 0.573,-0.453 0.305,-0.226 0.571,-0.48 0.889,-0.657 0.306,-0.188 0.604,-0.372 0.893,-0.549 0.29,-0.174 0.559,-0.359 0.856,-0.48 0.58,-0.264 1.106,-0.521 1.608,-0.726 0.525,-0.174 1,-0.33 1.428,-0.459 0.214,-0.063 0.414,-0.134 0.603,-0.178 0.191,-0.034 0.37,-0.067 0.537,-0.097 0.334,-0.06 0.617,-0.111 0.848,-0.152 0.463,-0.076 0.71,-0.116 0.71,-0.116 0,0 -0.214,0.129 -0.616,0.371 -0.203,0.118 -0.452,0.262 -0.744,0.433 -0.147,0.084 -0.304,0.176 -0.473,0.274 -0.164,0.099 -0.324,0.223 -0.499,0.344 -0.342,0.238 -0.72,0.501 -1.132,0.788 -0.385,0.32 -0.801,0.667 -1.245,1.037 -0.438,0.367 -0.843,0.828 -1.296,1.264 -0.231,0.214 -0.416,0.49 -0.635,0.736 -0.21,0.256 -0.433,0.507 -0.641,0.777 -0.197,0.283 -0.398,0.57 -0.602,0.864 -0.103,0.145 -0.206,0.291 -0.31,0.439 -0.091,0.157 -0.184,0.317 -0.277,0.477 -0.189,0.317 -0.38,0.639 -0.574,0.967 -0.174,0.343 -0.349,0.691 -0.526,1.043 -0.691,1.423 -1.334,2.971 -1.91,4.655 -0.153,0.412 -0.285,0.846 -0.431,1.276 -0.146,0.431 -0.297,0.859 -0.436,1.306 -0.287,0.894 -0.578,1.798 -0.87,2.71 -0.001,0.002 -0.002,0.006 -0.003,0.008 -0.107,0.36 -0.215,0.717 -0.329,1.081 -0.161,0.507 -0.337,1.024 -0.523,1.56 -0.371,1.055 -0.745,2.109 -1.186,3.16 -0.873,2.095 -1.905,4.189 -3.238,6.108 -0.322,0.485 -0.679,0.952 -1.034,1.411 -0.379,0.446 -0.743,0.897 -1.151,1.314 -0.387,0.432 -0.815,0.825 -1.228,1.223 -0.443,0.37 -0.866,0.754 -1.33,1.083 -0.727,0.557 -1.486,1.044 -2.258,1.471 l 0.041,0.012 c 0.918,0.245 1.733,0.569 2.462,0.822 0.362,0.134 0.706,0.242 1.014,0.372 0.308,0.13 0.592,0.249 0.847,0.358 1.02,0.431 1.593,0.696 1.593,0.696 0,0 -0.16,-0.031 -0.455,-0.094 C 2.891,0.633 2.471,0.542 1.939,0.42 1.403,0.292 0.752,0.146 0,0" /> diff --git a/logo/adafruit_blinka_computer.svg b/logo/adafruit_blinka_computer.svg index 31753081ae..0d2e09976c 100644 --- a/logo/adafruit_blinka_computer.svg +++ b/logo/adafruit_blinka_computer.svg @@ -618,4 +618,4 @@ id="g14550"> \ No newline at end of file + d="m 0,0 c -0.161,-1.553 -0.126,-2.987 -0.026,-4.161 -12.803,0.01 -17.578,2.458 -17.578,4.003 0,2.687 7.455,7.852 17.653,7.852 0.88,0 1.737,-0.04 2.574,-0.112 C 1.191,5.452 0.3,2.902 0,0 M 8.064,6.59 C 13.921,4.923 17.7,1.755 17.7,-0.158 17.7,-1.499 14.1,-3.52 4.777,-4.036 4.5,-1.401 4.582,3.378 8.064,6.59 M -21.31,3.529 c -0.711,-1.182 -1.103,-2.424 -1.103,-3.687 0,-4.204 4.146,-6.26 7.624,-7.243 3.681,-1.041 8.673,-1.569 14.838,-1.569 6.164,0 11.156,0.528 14.836,1.569 3.478,0.983 7.625,3.039 7.625,7.243 0,5.128 -6.413,9.899 -14.761,11.796 0,0 -15.682,4.692 -29.059,-8.109" /> diff --git a/logo/adafruit_circuit_python_ourboros_color.svg b/logo/adafruit_circuit_python_ourboros_color.svg index d1177ef224..ef100abaa6 100644 --- a/logo/adafruit_circuit_python_ourboros_color.svg +++ b/logo/adafruit_circuit_python_ourboros_color.svg @@ -552,4 +552,4 @@ id="g15028"> \ No newline at end of file + d="m 0,0 c -7.64,-20.177 -18.594,-38.166 -32.558,-53.466 -31.154,-34.137 -74.877,-52.181 -126.439,-52.181 -13.743,0 -28.182,1.294 -42.917,3.847 -20.992,3.638 -45.356,14.012 -65.172,27.752 -19.049,13.208 -35.213,29.878 -48.041,49.546 -12.833,19.674 -21.686,41.363 -26.313,64.466 -4.794,23.932 -4.82,48.324 -0.078,72.499 4.046,20.626 11.412,40.168 21.894,58.083 10.127,17.309 22.929,32.718 38.048,45.797 17.472,15.115 37.416,26.563 59.279,34.026 l 4.237,1.448 -0.01,0.017 c 18.412,6.534 26.683,11.716 32.798,15.547 1.996,1.251 3.694,2.314 5.404,3.199 l -0.003,-0.015 c 0.302,0.165 0.618,0.32 0.931,0.477 l 1.265,0.562 c 3.218,1.427 6.819,2.392 10.703,2.866 1.684,0.205 3.382,0.309 5.047,0.309 4.639,0 8.782,-0.789 11.667,-2.221 0.876,-0.434 1.673,-0.872 2.406,-1.312 l 0.028,0.02 c 4.336,-2.605 6.388,-5.287 8.375,-7.895 2.487,-3.266 5.061,-6.643 11.633,-9.185 2.794,-1.081 5.784,-1.625 8.676,-2.152 4.078,-0.742 7.928,-1.443 8.946,-3.447 0.04,-0.079 0.074,-0.161 0.107,-0.246 0.01,-0.028 0.02,-0.056 0.029,-0.085 0.02,-0.058 0.039,-0.117 0.057,-0.178 0.008,-0.035 0.019,-0.071 0.025,-0.107 0.015,-0.058 0.028,-0.117 0.039,-0.177 0.006,-0.039 0.012,-0.077 0.019,-0.116 0.011,-0.065 0.017,-0.131 0.023,-0.197 0.003,-0.038 0.009,-0.075 0.011,-0.112 0.006,-0.1 0.01,-0.202 0.01,-0.307 0,-0.046 -0.002,-0.093 -0.004,-0.14 -0.001,-0.066 -0.002,-0.131 -0.006,-0.198 -0.004,-0.058 -0.01,-0.118 -0.015,-0.176 -0.006,-0.06 -0.011,-0.118 -0.018,-0.178 -0.008,-0.064 -0.016,-0.129 -0.025,-0.195 -0.007,-0.057 -0.018,-0.114 -0.028,-0.172 -0.011,-0.071 -0.023,-0.142 -0.037,-0.215 -0.011,-0.05 -0.021,-0.101 -0.033,-0.154 -0.037,-0.183 -0.082,-0.371 -0.137,-0.566 -0.003,-0.014 -0.006,-0.028 -0.01,-0.042 -0.025,-0.093 -0.054,-0.187 -0.082,-0.283 -0.014,-0.048 -0.029,-0.096 -0.043,-0.143 -0.03,-0.095 -0.061,-0.19 -0.093,-0.287 -0.017,-0.05 -0.033,-0.101 -0.053,-0.152 -0.033,-0.099 -0.068,-0.2 -0.106,-0.301 -0.017,-0.047 -0.036,-0.094 -0.052,-0.142 -0.043,-0.109 -0.084,-0.217 -0.129,-0.328 l -9.826,0.62 c -0.389,1.006 -1.333,1.749 -2.477,1.821 -1.57,0.1 -2.928,-1.098 -3.027,-2.666 -0.1,-1.569 1.096,-2.928 2.667,-3.027 1.144,-0.073 2.175,0.546 2.686,1.494 l 8.887,-0.562 h -0.002 c -1.279,-2.25 -3.256,-4.091 -5.805,-5.462 -0.013,-0.007 -0.027,-0.014 -0.041,-0.022 -0.156,-0.084 -0.316,-0.166 -0.478,-0.247 -0.031,-0.015 -0.063,-0.031 -0.096,-0.047 -0.149,-0.074 -0.303,-0.146 -0.455,-0.216 -0.047,-0.021 -0.092,-0.042 -0.137,-0.062 -0.145,-0.066 -0.292,-0.13 -0.439,-0.193 -0.057,-0.023 -0.114,-0.048 -0.172,-0.071 -0.141,-0.059 -0.284,-0.115 -0.428,-0.171 -0.066,-0.026 -0.133,-0.052 -0.2,-0.077 -0.138,-0.052 -0.279,-0.103 -0.421,-0.152 -0.074,-0.028 -0.15,-0.054 -0.226,-0.08 -0.136,-0.047 -0.274,-0.092 -0.412,-0.137 -0.084,-0.027 -0.168,-0.053 -0.252,-0.079 -0.135,-0.042 -0.271,-0.082 -0.409,-0.122 -0.089,-0.027 -0.18,-0.053 -0.273,-0.078 -0.133,-0.037 -0.268,-0.074 -0.402,-0.109 -0.098,-0.025 -0.197,-0.05 -0.296,-0.075 -0.132,-0.033 -0.265,-0.065 -0.4,-0.096 -0.103,-0.024 -0.21,-0.048 -0.314,-0.071 -0.133,-0.028 -0.264,-0.058 -0.398,-0.085 -0.11,-0.022 -0.221,-0.044 -0.335,-0.065 -0.13,-0.025 -0.26,-0.05 -0.392,-0.074 -0.119,-0.021 -0.237,-0.041 -0.356,-0.06 -0.129,-0.022 -0.259,-0.043 -0.388,-0.063 -0.125,-0.019 -0.252,-0.036 -0.377,-0.054 -0.128,-0.018 -0.254,-0.036 -0.383,-0.052 -0.133,-0.018 -0.268,-0.032 -0.402,-0.047 -0.123,-0.015 -0.248,-0.03 -0.373,-0.043 -0.144,-0.015 -0.287,-0.027 -0.43,-0.04 -0.121,-0.012 -0.239,-0.023 -0.361,-0.033 -0.156,-0.012 -0.313,-0.023 -0.471,-0.033 -0.11,-0.007 -0.221,-0.016 -0.334,-0.022 -0.18,-0.011 -0.361,-0.019 -0.543,-0.026 -0.092,-0.004 -0.185,-0.01 -0.277,-0.013 -0.276,-0.009 -0.553,-0.017 -0.833,-0.021 l -0.001,-0.001 c -0.112,-0.007 -0.5,-0.029 -1.112,-0.065 -0.181,-0.009 -0.383,-0.02 -0.603,-0.032 -0.207,-0.004 -0.432,-0.008 -0.671,-0.012 -0.241,-0.005 -0.497,-0.009 -0.767,-0.014 -0.269,-0.009 -0.563,0.009 -0.865,0.014 -0.303,0.007 -0.619,0.015 -0.947,0.023 -0.326,0.021 -0.664,0.042 -1.012,0.064 -0.699,0.032 -1.426,0.124 -2.188,0.202 -0.38,0.037 -0.761,0.108 -1.15,0.16 -0.391,0.058 -0.786,0.111 -1.18,0.192 -0.395,0.075 -0.793,0.15 -1.193,0.226 -0.396,0.092 -0.795,0.184 -1.193,0.277 -0.404,0.087 -0.796,0.197 -1.189,0.308 -0.391,0.115 -0.79,0.209 -1.172,0.34 -0.384,0.126 -0.766,0.251 -1.142,0.374 -0.377,0.126 -0.739,0.276 -1.102,0.41 -0.18,0.069 -0.359,0.137 -0.537,0.204 -0.177,0.071 -0.346,0.15 -0.517,0.224 -0.341,0.149 -0.675,0.295 -1,0.437 -0.318,0.159 -0.627,0.314 -0.925,0.463 -0.151,0.075 -0.297,0.149 -0.443,0.222 -0.142,0.074 -0.277,0.157 -0.413,0.233 -0.538,0.31 -1.041,0.583 -1.457,0.874 -0.42,0.281 -0.804,0.51 -1.086,0.739 -0.584,0.44 -0.919,0.691 -0.919,0.691 0.494,-1.396 1.127,-2.74 1.814,-4.059 0.166,-0.334 0.351,-0.657 0.534,-0.981 0.181,-0.326 0.368,-0.649 0.563,-0.967 0.384,-0.641 0.802,-1.262 1.219,-1.887 0.446,-0.606 0.876,-1.226 1.362,-1.808 0.464,-0.599 0.989,-1.153 1.498,-1.725 0.554,-0.538 1.067,-1.086 1.706,-1.602 l 0.463,-0.391 0.233,-0.194 0.223,-0.16 0.892,-0.643 0.056,-0.041 0.014,-0.01 0.065,-0.04 0.031,-0.018 0.123,-0.073 0.247,-0.145 0.495,-0.291 0.996,-0.576 c 0.335,-0.183 0.662,-0.399 1.006,-0.555 l 1.028,-0.487 1.033,-0.48 c 0.344,-0.164 0.69,-0.317 1.043,-0.447 l 2.109,-0.819 c 0.709,-0.255 1.426,-0.476 2.139,-0.715 0.404,-0.143 0.814,-0.264 1.226,-0.38 h -10e-4 l 0.003,-10e-4 c -6.951,-3.271 -13.928,1.633 -23.946,0.382 -0.571,-0.072 -1.15,-0.159 -1.742,-0.274 -0.03,-0.004 -0.063,-0.009 -0.093,-0.014 -0.167,-0.028 -0.338,-0.056 -0.511,-0.082 -0.111,-0.017 -0.224,-0.033 -0.337,-0.049 -0.169,-0.023 -0.337,-0.048 -0.512,-0.069 -0.264,-0.034 -0.533,-0.064 -0.81,-0.092 -0.136,-0.014 -0.278,-0.026 -0.418,-0.038 -0.19,-0.017 -0.382,-0.034 -0.577,-0.049 -0.139,-0.01 -0.279,-0.02 -0.42,-0.029 -0.222,-0.015 -0.448,-0.028 -0.677,-0.038 -0.117,-0.006 -0.232,-0.013 -0.35,-0.018 -0.347,-0.015 -0.697,-0.025 -1.056,-0.032 -0.066,-0.002 -0.135,-0.001 -0.201,-0.002 -0.228,-0.004 -0.457,-0.007 -0.69,-0.007 -0.055,0 -0.113,0.002 -0.168,0.002 -0.317,0.002 -0.638,0.008 -0.961,0.015 -0.143,0.003 -0.283,0.004 -0.428,0.008 -0.469,0.015 -0.943,0.036 -1.424,0.065 -0.041,0.002 -0.082,0.006 -0.123,0.009 -0.439,0.027 -0.884,0.06 -1.331,0.1 -0.161,0.014 -0.322,0.032 -0.483,0.048 -0.332,0.032 -0.666,0.066 -1.002,0.106 -0.188,0.023 -0.377,0.048 -0.566,0.072 -0.314,0.041 -0.629,0.085 -0.946,0.132 -0.196,0.029 -0.393,0.06 -0.59,0.092 -0.318,0.051 -0.636,0.107 -0.954,0.165 -0.193,0.036 -0.385,0.07 -0.578,0.108 -0.344,0.067 -0.688,0.141 -1.032,0.217 -0.165,0.036 -0.33,0.069 -0.495,0.108 -0.508,0.117 -1.016,0.242 -1.522,0.379 -0.343,0.092 -0.67,0.176 -0.989,0.255 -0.056,0.014 -0.112,0.028 -0.168,0.042 -0.303,0.075 -0.595,0.144 -0.877,0.208 -0.052,0.012 -0.103,0.023 -0.155,0.035 -0.577,0.129 -1.11,0.237 -1.605,0.326 -0.044,0.008 -0.09,0.017 -0.133,0.025 -0.235,0.041 -0.462,0.078 -0.68,0.111 -0.041,0.006 -0.081,0.012 -0.122,0.017 -0.222,0.033 -0.438,0.063 -0.643,0.087 -0.003,10e-4 -0.006,10e-4 -0.01,10e-4 -0.203,0.025 -0.397,0.044 -0.585,0.062 -0.036,0.003 -0.072,0.007 -0.108,0.01 -0.179,0.015 -0.352,0.028 -0.519,0.037 -0.036,0.002 -0.07,0.004 -0.105,0.006 -0.168,0.008 -0.333,0.015 -0.489,0.018 h -0.019 c -0.1,0.002 -0.198,0.004 -0.293,0.004 -0.025,0 -0.045,-0.002 -0.069,-0.002 -0.234,-0.001 -0.457,-0.007 -0.668,-0.018 -0.035,-0.002 -0.068,-0.005 -0.103,-0.007 -0.192,-0.012 -0.375,-0.027 -0.551,-0.044 -0.031,-0.003 -0.063,-0.005 -0.092,-0.009 -0.191,-0.02 -0.374,-0.042 -0.552,-0.066 -0.043,-0.006 -0.085,-0.012 -0.127,-0.018 -0.168,-0.024 -0.333,-0.049 -0.495,-0.073 -0.951,-0.15 -1.898,-0.312 -2.843,-0.479 -0.642,-0.113 -1.28,-0.234 -1.919,-0.356 -0.13,-0.025 -0.262,-0.049 -0.392,-0.074 -6.123,-1.178 -12.111,-2.713 -17.94,-4.59 -3.091,-0.995 -6.137,-2.086 -9.134,-3.269 -0.776,-0.306 -1.551,-0.614 -2.321,-0.932 -8.949,-3.706 -17.445,-8.242 -25.384,-13.521 -0.695,-0.462 -1.384,-0.932 -2.07,-1.405 -7.989,-5.512 -15.391,-11.786 -22.09,-18.738 -0.578,-0.6 -1.15,-1.207 -1.718,-1.817 -6.609,-7.1 -12.499,-14.875 -17.556,-23.231 -0.431,-0.713 -0.857,-1.429 -1.276,-2.15 -4.85,-8.344 -8.881,-17.246 -11.979,-26.619 -0.261,-0.79 -0.512,-1.585 -0.76,-2.382 -2.84,-9.125 -4.799,-18.682 -5.788,-28.592 -0.082,-0.827 -0.158,-1.657 -0.227,-2.489 -0.339,-4.096 -0.52,-8.249 -0.52,-12.457 0,-5.623 0.317,-11.171 0.916,-16.635 0.091,-0.829 0.18,-1.659 0.284,-2.484 1.231,-9.752 3.399,-19.211 6.399,-28.292 0.262,-0.792 0.531,-1.581 0.805,-2.367 3.207,-9.193 7.275,-17.979 12.111,-26.264 0.42,-0.72 0.841,-1.44 1.272,-2.152 5.007,-8.261 10.785,-16.001 17.231,-23.125 0.559,-0.618 1.128,-1.227 1.698,-1.836 6.555,-7.011 13.771,-13.395 21.549,-19.056 0.673,-0.49 1.349,-0.977 2.032,-1.457 7.808,-5.489 16.157,-10.26 24.956,-14.211 0.76,-0.341 1.524,-0.673 2.29,-1.002 8.714,-3.739 17.851,-6.678 27.32,-8.735 0.813,-0.177 1.628,-0.351 2.446,-0.515 9.228,-1.843 18.759,-2.842 28.511,-2.922 0.417,-0.003 0.832,-0.015 1.25,-0.015 0.418,0 0.833,0.012 1.25,0.015 9.751,0.08 19.281,1.079 28.51,2.922 0.818,0.164 1.633,0.338 2.445,0.515 9.469,2.057 18.606,4.996 27.321,8.735 0.765,0.329 1.53,0.661 2.29,1.002 8.797,3.951 17.147,8.722 24.956,14.21 0.681,0.48 1.357,0.967 2.031,1.457 7.777,5.662 14.994,12.046 21.55,19.057 0.569,0.609 1.137,1.218 1.697,1.836 6.446,7.124 12.224,14.865 17.231,23.125 0.432,0.713 0.852,1.432 1.272,2.152 4.836,8.285 8.904,17.071 12.111,26.263 0.274,0.786 0.543,1.575 0.805,2.367 3,9.082 5.168,18.541 6.4,28.293 0.104,0.825 0.193,1.654 0.284,2.484 0.598,5.463 0.916,11.012 0.916,16.635 0,4.195 -0.182,8.348 -0.517,12.457 -0.067,0.832 -0.138,1.663 -0.218,2.491 -0.969,9.855 -2.889,19.429 -5.658,28.636 -0.24,0.799 -0.481,1.597 -0.734,2.39 -2.999,9.397 -6.897,18.392 -11.585,26.89 -0.404,0.73 -0.812,1.456 -1.226,2.179 -4.895,8.534 -10.591,16.549 -16.998,23.932 -0.547,0.629 -1.104,1.25 -1.66,1.87 -7.627,8.502 -16.203,16.134 -25.564,22.729 -0.662,0.467 -1.329,0.928 -1.999,1.384 -0.198,0.135 -0.398,0.267 -0.598,0.402 -0.477,0.321 -0.954,0.641 -1.435,0.958 -0.224,0.147 -0.45,0.292 -0.676,0.438 -0.465,0.303 -0.931,0.604 -1.4,0.901 -0.219,0.139 -0.439,0.276 -0.658,0.413 -0.488,0.306 -0.977,0.61 -1.469,0.911 -0.196,0.12 -0.393,0.239 -0.59,0.358 -0.531,0.321 -1.065,0.64 -1.601,0.955 -0.157,0.092 -0.315,0.185 -0.471,0.276 -0.603,0.351 -1.207,0.698 -1.814,1.041 -0.093,0.052 -0.186,0.106 -0.28,0.158 -5.937,3.336 -12.123,6.28 -18.521,8.801 -0.057,0.025 -0.113,0.05 -0.168,0.074 -1.451,0.614 -2.889,1.156 -4.303,1.614 -0.066,0.021 -0.133,0.045 -0.199,0.065 l -0.025,0.016 -0.293,0.174 c 34.572,-7.316 63.56,-24.111 84.956,-49.504 C -12.854,157.081 -3.269,139.703 3.101,120.309 9.257,101.564 12.173,81.713 11.767,61.306 11.347,40.137 7.388,19.511 0,0 m -25.675,177.617 c -0.002,0.001 -0.002,0.002 -0.003,0.003 -0.458,0.51 -0.919,1.018 -1.384,1.523 -0.005,0.005 -0.011,0.011 -0.016,0.017 -0.464,0.503 -0.931,1.003 -1.401,1.5 l -0.014,0.014 c -4.756,5.016 -9.903,9.737 -15.442,14.116 -0.033,0.027 -0.068,0.053 -0.101,0.08 -0.508,0.401 -1.02,0.798 -1.533,1.193 l -0.223,0.17 c -0.477,0.365 -0.955,0.727 -1.437,1.086 -0.1,0.075 -0.201,0.148 -0.301,0.223 -0.459,0.34 -0.92,0.678 -1.384,1.014 -0.118,0.086 -0.236,0.171 -0.355,0.256 -0.449,0.323 -0.902,0.644 -1.355,0.962 -0.131,0.092 -0.26,0.183 -0.391,0.274 -0.447,0.311 -0.896,0.621 -1.348,0.929 l -0.41,0.278 c -0.451,0.304 -0.902,0.605 -1.356,0.905 -0.14,0.092 -0.28,0.185 -0.42,0.277 -0.456,0.298 -0.915,0.595 -1.376,0.89 -0.139,0.089 -0.279,0.178 -0.419,0.267 -0.469,0.298 -0.94,0.593 -1.413,0.885 -0.133,0.083 -0.265,0.166 -0.398,0.248 -0.492,0.301 -0.988,0.601 -1.485,0.898 -0.115,0.07 -0.23,0.14 -0.347,0.209 -0.534,0.318 -1.071,0.632 -1.61,0.944 -0.081,0.047 -0.16,0.094 -0.242,0.141 -0.618,0.356 -1.24,0.709 -1.867,1.058 -10e-4,0.001 -0.002,0.002 -0.004,0.002 -1.921,1.07 -3.877,2.105 -5.868,3.103 -0.048,0.023 -0.096,0.046 -0.144,0.07 -0.599,0.3 -1.202,0.597 -1.808,0.89 -0.143,0.069 -0.285,0.136 -0.428,0.204 -0.514,0.247 -1.03,0.493 -1.55,0.735 -0.187,0.087 -0.376,0.173 -0.565,0.26 -0.476,0.22 -0.953,0.439 -1.434,0.655 -0.217,0.097 -0.434,0.193 -0.652,0.289 -0.455,0.202 -0.911,0.403 -1.37,0.602 -0.238,0.102 -0.475,0.203 -0.712,0.304 -0.444,0.189 -0.887,0.377 -1.332,0.562 -0.252,0.105 -0.506,0.209 -0.76,0.313 -0.436,0.179 -0.872,0.356 -1.311,0.531 -0.262,0.105 -0.525,0.209 -0.789,0.313 -0.433,0.17 -0.869,0.339 -1.305,0.506 -0.271,0.104 -0.54,0.207 -0.812,0.309 -0.435,0.164 -0.871,0.326 -1.308,0.487 -0.276,0.101 -0.551,0.202 -0.829,0.302 -0.438,0.159 -0.878,0.315 -1.32,0.47 -0.277,0.097 -0.554,0.195 -0.832,0.291 -0.446,0.155 -0.895,0.306 -1.346,0.458 -0.276,0.093 -0.552,0.186 -0.83,0.278 -0.459,0.151 -0.921,0.3 -1.382,0.448 -0.271,0.086 -0.54,0.174 -0.811,0.26 -0.482,0.152 -0.968,0.3 -1.453,0.448 -0.254,0.078 -0.508,0.157 -0.763,0.233 -0.522,0.157 -1.047,0.309 -1.573,0.461 -0.222,0.065 -0.443,0.131 -0.666,0.194 -0.623,0.178 -1.249,0.351 -1.877,0.523 -0.127,0.035 -0.254,0.071 -0.382,0.105 -1.524,0.413 -3.063,0.807 -4.618,1.182 -0.217,0.052 -0.436,0.102 -0.652,0.154 -0.555,0.131 -1.111,0.263 -1.669,0.39 -0.285,0.064 -0.572,0.126 -0.857,0.19 -0.495,0.109 -0.99,0.22 -1.488,0.326 -0.316,0.068 -0.633,0.132 -0.95,0.198 -0.473,0.098 -0.945,0.197 -1.42,0.291 -0.334,0.067 -0.67,0.131 -1.005,0.197 -0.461,0.089 -0.923,0.178 -1.387,0.264 -0.347,0.065 -0.697,0.128 -1.047,0.191 -0.455,0.082 -0.91,0.163 -1.367,0.242 -0.357,0.063 -0.719,0.122 -1.078,0.183 -0.453,0.075 -0.906,0.15 -1.361,0.222 -0.366,0.058 -0.732,0.115 -1.098,0.171 -0.455,0.07 -0.911,0.138 -1.368,0.205 -0.369,0.054 -0.739,0.107 -1.11,0.159 -0.457,0.064 -0.917,0.127 -1.377,0.188 -0.375,0.05 -0.748,0.099 -1.124,0.147 -0.462,0.059 -0.926,0.115 -1.39,0.171 -0.377,0.045 -0.754,0.09 -1.131,0.133 -0.469,0.054 -0.939,0.105 -1.41,0.155 -0.377,0.04 -0.754,0.081 -1.133,0.12 -0.478,0.049 -0.959,0.094 -1.439,0.14 -0.375,0.035 -0.748,0.071 -1.123,0.105 -0.495,0.044 -0.991,0.084 -1.488,0.125 -0.366,0.029 -0.731,0.061 -1.098,0.089 -0.522,0.04 -1.047,0.076 -1.572,0.112 -0.344,0.023 -0.688,0.049 -1.034,0.071 -0.587,0.038 -1.177,0.07 -1.766,0.104 -0.289,0.016 -0.575,0.034 -0.863,0.049 -0.881,0.046 -1.764,0.086 -2.653,0.122 0,0 0.59,-0.065 1.615,-0.197 l -1.615,0.197 c 0,0 40.553,-8.103 74.257,-34.671 6.396,-5.111 12.381,-10.751 17.852,-16.85 0.535,-0.595 1.087,-1.21 1.62,-1.825 6.257,-7.21 11.844,-15.075 16.607,-23.38 0.391,-0.683 0.794,-1.399 1.197,-2.129 4.618,-8.371 8.425,-17.208 11.316,-26.263 0.25,-0.786 0.492,-1.585 0.716,-2.334 2.738,-9.098 4.596,-18.508 5.526,-27.97 0.081,-0.824 0.15,-1.654 0.214,-2.434 0.335,-4.104 0.505,-8.199 0.505,-12.172 0,-5.364 -0.301,-10.833 -0.895,-16.254 l -0.031,-0.277 c -0.081,-0.744 -0.158,-1.445 -0.246,-2.15 -1.182,-9.356 -3.286,-18.654 -6.251,-27.633 -0.246,-0.744 -0.503,-1.5 -0.786,-2.312 -3.102,-8.887 -7.082,-17.517 -11.829,-25.651 l -0.027,-0.045 c -0.397,-0.681 -0.809,-1.385 -1.217,-2.058 -4.857,-8.014 -10.521,-15.616 -16.832,-22.592 -0.553,-0.61 -1.14,-1.239 -1.659,-1.792 -6.399,-6.843 -13.482,-13.107 -21.053,-18.618 -0.794,-0.577 -1.405,-1.016 -1.985,-1.423 -7.668,-5.391 -15.869,-10.061 -24.376,-13.88 -0.644,-0.289 -1.333,-0.591 -2.237,-0.979 -8.567,-3.677 -17.545,-6.547 -26.682,-8.531 -0.754,-0.164 -1.564,-0.338 -2.39,-0.503 -9.096,-1.817 -18.466,-2.778 -27.851,-2.855 -0.186,-0.002 -0.369,-0.004 -0.553,-0.007 -0.223,-0.004 -0.445,-0.008 -0.669,-0.008 -0.223,0 -0.446,0.004 -0.669,0.008 -0.183,0.003 -0.368,0.005 -0.553,0.007 -9.385,0.077 -18.756,1.038 -27.854,2.855 -0.825,0.165 -1.635,0.339 -2.388,0.503 -9.138,1.984 -18.115,4.854 -26.683,8.531 -0.907,0.39 -1.597,0.692 -2.237,0.979 -8.506,3.819 -16.709,8.489 -24.377,13.88 -0.578,0.407 -1.19,0.846 -1.985,1.424 -7.569,5.51 -14.652,11.774 -21.052,18.617 -0.587,0.626 -1.124,1.202 -1.658,1.792 -6.311,6.976 -11.975,14.577 -16.833,22.591 -0.408,0.673 -0.819,1.377 -1.217,2.058 l -0.027,0.047 c -4.748,8.134 -8.728,16.764 -11.828,25.65 -0.288,0.826 -0.545,1.583 -0.786,2.313 -2.967,8.98 -5.07,18.277 -6.251,27.633 -0.088,0.7 -0.164,1.397 -0.245,2.135 l -0.032,0.291 c -0.594,5.421 -0.895,10.89 -0.895,16.254 0,3.993 0.171,8.087 0.509,12.168 0.066,0.808 0.141,1.626 0.221,2.432 0.95,9.523 2.85,18.91 5.647,27.898 0.292,0.939 0.52,1.655 0.741,2.324 2.981,9.018 6.912,17.751 11.682,25.958 0.389,0.669 0.808,1.375 1.244,2.096 4.892,8.083 10.653,15.707 17.124,22.66 0.614,0.659 1.162,1.239 1.677,1.773 6.512,6.759 13.765,12.91 21.556,18.285 0.743,0.513 1.405,0.961 2.021,1.371 7.772,5.168 16.111,9.61 24.785,13.202 0.762,0.316 1.538,0.623 2.267,0.911 2.923,1.154 5.925,2.228 8.921,3.193 5.697,1.834 11.595,3.342 17.529,4.484 l 0.379,0.072 0.089,0.017 c 0.597,0.113 1.192,0.226 1.79,0.332 1.093,0.192 1.976,0.341 2.779,0.468 0.679,0.102 1.284,0.194 2.113,0.194 1.61,0 3.767,-0.368 6.595,-1.125 5.343,-1.442 10.295,-1.745 13.508,-1.745 2.88,0 5.613,0.238 7.903,0.69 0.028,0.005 0.06,0.009 0.088,0.015 0,0.001 -0.001,0.002 -0.001,0.003 9.582,2.158 12.655,-1.566 19.878,-0.942 10.129,0.875 15.048,5.307 15.048,5.307 l -4.599,0.95 c -0.661,0.136 -1.375,0.295 -2.063,0.461 -0.695,0.164 -1.391,0.326 -2.08,0.521 -0.689,0.189 -1.384,0.36 -2.066,0.571 -0.683,0.207 -1.373,0.398 -2.051,0.618 l -2.019,0.684 c -0.685,0.21 -1.316,0.516 -1.981,0.763 l -0.392,0.153 c -3.685,1.591 -7.777,4.721 -9.509,7.465 0,0 5.863,-2.928 18.288,-3.385 0.894,-0.045 1.66,-0.058 2.271,-0.056 0.006,0 0.011,-0.001 0.017,-0.001 l -0.002,0.001 c 0.484,0.001 0.871,0.012 1.14,0.023 0.146,0.007 0.296,0.015 0.441,0.022 h 0.004 c 0.304,0.016 0.604,0.034 0.893,0.063 0.533,0.039 1.037,0.098 1.503,0.149 0.466,0.046 0.889,0.12 1.27,0.167 0.379,0.049 0.71,0.102 0.981,0.149 0.196,0.033 0.363,0.058 0.496,0.078 0.021,0.003 0.037,0.006 0.056,0.008 1.546,0.402 2.994,0.914 4.337,1.528 0.023,0.012 0.048,0.021 0.071,0.032 0.034,0.015 0.063,0.03 0.092,0.044 0.383,0.179 0.755,0.365 1.119,0.56 0.17,0.09 0.338,0.182 0.502,0.276 0.166,0.095 0.334,0.187 0.496,0.286 0.334,0.202 0.657,0.414 0.973,0.631 0.076,0.052 0.151,0.101 0.226,0.154 0.368,0.26 0.721,0.53 1.062,0.811 0.017,0.013 0.033,0.026 0.05,0.04 1.498,1.236 2.734,2.661 3.695,4.269 0.004,0.006 0.008,0.013 0.012,0.02 0.238,0.4 0.461,0.809 0.666,1.232 0.521,1.073 0.935,2.074 1.244,3.01 0.389,1.17 0.612,2.238 0.674,3.22 0.088,1.374 -0.143,2.576 -0.687,3.646 -1.231,2.427 -3.817,3.589 -6.917,4.37 -0.005,0.002 -0.013,0.004 -0.019,0.006 -0.231,0.058 -0.467,0.113 -0.703,0.167 -0.053,0.012 -0.105,0.025 -0.156,0.037 -0.024,0.006 -0.047,0.01 -0.07,0.015 -1.141,0.255 -2.337,0.474 -3.55,0.695 -0.21,0.037 -0.419,0.076 -0.63,0.115 l -0.367,0.067 c -0.13,0.023 -0.261,0.049 -0.391,0.074 -0.209,0.039 -0.416,0.077 -0.625,0.117 -0.144,0.028 -0.286,0.058 -0.43,0.086 -0.195,0.038 -0.39,0.077 -0.584,0.117 -0.151,0.032 -0.303,0.066 -0.453,0.098 -0.186,0.04 -0.369,0.078 -0.553,0.12 -0.156,0.035 -0.31,0.074 -0.467,0.111 -0.176,0.043 -0.354,0.084 -0.529,0.128 -0.155,0.04 -0.308,0.083 -0.462,0.123 -0.175,0.046 -0.348,0.093 -0.522,0.143 -0.151,0.043 -0.299,0.09 -0.448,0.135 -0.172,0.053 -0.345,0.104 -0.515,0.161 -0.145,0.047 -0.285,0.099 -0.43,0.148 -0.215,0.075 -0.431,0.15 -0.641,0.231 -0.163,0.062 -0.322,0.126 -0.478,0.189 -0.05,0.021 -0.098,0.041 -0.146,0.061 -0.108,0.045 -0.214,0.089 -0.32,0.134 -0.053,0.023 -0.106,0.047 -0.16,0.069 -0.101,0.045 -0.201,0.088 -0.3,0.134 -0.049,0.021 -0.096,0.043 -0.144,0.065 -0.118,0.054 -0.235,0.108 -0.348,0.162 -0.025,0.013 -0.053,0.024 -0.077,0.037 -0.138,0.066 -0.274,0.133 -0.407,0.201 -0.036,0.018 -0.073,0.037 -0.109,0.056 -0.096,0.049 -0.192,0.099 -0.286,0.149 -0.045,0.024 -0.089,0.048 -0.133,0.071 -0.086,0.047 -0.17,0.093 -0.255,0.141 -0.042,0.023 -0.085,0.048 -0.127,0.071 -0.09,0.052 -0.179,0.103 -0.267,0.155 -0.032,0.019 -0.065,0.037 -0.096,0.056 -0.117,0.07 -0.233,0.141 -0.345,0.212 -0.024,0.014 -0.045,0.028 -0.066,0.042 -0.092,0.058 -0.183,0.116 -0.271,0.174 -0.036,0.024 -0.073,0.048 -0.109,0.073 -0.073,0.048 -0.145,0.098 -0.218,0.147 -0.037,0.026 -0.076,0.052 -0.113,0.078 -0.073,0.051 -0.142,0.103 -0.215,0.153 -0.031,0.023 -0.063,0.047 -0.095,0.069 -0.1,0.074 -0.2,0.149 -0.297,0.223 -0.002,10e-4 -0.002,0.003 -0.004,0.003 -0.096,0.074 -0.19,0.148 -0.283,0.222 -0.03,0.025 -0.059,0.048 -0.088,0.073 -0.066,0.052 -0.129,0.105 -0.192,0.157 -0.033,0.028 -0.065,0.056 -0.097,0.083 -0.061,0.052 -0.121,0.103 -0.182,0.156 -0.029,0.026 -0.059,0.052 -0.088,0.078 -0.071,0.063 -0.14,0.126 -0.211,0.19 -0.015,0.014 -0.032,0.029 -0.048,0.044 -0.084,0.078 -0.167,0.156 -0.249,0.234 -0.024,0.023 -0.047,0.046 -0.072,0.069 -0.057,0.057 -0.115,0.114 -0.173,0.171 -0.028,0.029 -0.057,0.058 -0.085,0.087 -0.052,0.053 -0.105,0.106 -0.156,0.159 -0.029,0.029 -0.057,0.058 -0.085,0.087 -0.056,0.058 -0.111,0.117 -0.167,0.176 -0.019,0.023 -0.041,0.045 -0.062,0.067 -0.077,0.082 -0.151,0.164 -0.223,0.245 -0.017,0.018 -0.032,0.036 -0.049,0.054 -0.058,0.065 -0.115,0.13 -0.172,0.195 -0.025,0.029 -0.053,0.06 -0.078,0.088 -0.047,0.056 -0.094,0.111 -0.141,0.166 -0.025,0.031 -0.052,0.062 -0.079,0.094 -0.047,0.056 -0.095,0.113 -0.143,0.169 -0.024,0.029 -0.047,0.057 -0.071,0.087 -0.066,0.081 -0.134,0.162 -0.2,0.245 -0.003,10e-4 -0.003,0.003 -0.005,0.006 0.086,0.117 0.17,0.235 0.245,0.364 0.109,0.177 0.214,0.356 0.302,0.543 0.097,0.181 0.174,0.369 0.25,0.553 0.079,0.18 0.134,0.368 0.196,0.541 0.05,0.179 0.103,0.347 0.138,0.51 0.039,0.164 0.071,0.316 0.094,0.459 0.099,0.565 0.092,0.939 0.092,0.939 0,0 -0.18,-0.329 -0.526,-0.747 -0.084,-0.105 -0.18,-0.214 -0.284,-0.326 -0.1,-0.112 -0.219,-0.223 -0.335,-0.337 -0.125,-0.107 -0.243,-0.224 -0.38,-0.323 -0.131,-0.105 -0.264,-0.206 -0.407,-0.294 -0.135,-0.095 -0.279,-0.176 -0.418,-0.25 -0.056,-0.033 -0.113,-0.061 -0.17,-0.087 -0.047,0.06 -0.092,0.12 -0.138,0.181 -2.041,2.677 -4.317,5.653 -8.951,8.522 -0.038,0.024 -0.078,0.048 -0.117,0.072 -0.259,0.159 -0.521,0.317 -0.795,0.475 -0.129,0.075 -0.265,0.149 -0.398,0.224 -0.203,0.114 -0.403,0.228 -0.615,0.341 -0.365,0.197 -0.742,0.393 -1.133,0.587 -0.258,0.128 -0.526,0.25 -0.798,0.369 -0.08,0.034 -0.161,0.068 -0.241,0.102 -0.208,0.087 -0.42,0.172 -0.637,0.254 -0.08,0.03 -0.16,0.061 -0.241,0.092 -0.29,0.106 -0.584,0.209 -0.887,0.305 -0.031,0.011 -0.064,0.02 -0.097,0.03 -0.273,0.087 -0.552,0.169 -0.835,0.247 -0.096,0.027 -0.192,0.053 -0.289,0.078 -0.241,0.064 -0.485,0.126 -0.733,0.184 -0.088,0.021 -0.174,0.042 -0.262,0.063 -0.328,0.074 -0.661,0.145 -0.999,0.21 -0.059,0.012 -0.12,0.021 -0.179,0.033 -0.286,0.053 -0.574,0.103 -0.865,0.149 -0.107,0.017 -0.215,0.034 -0.323,0.05 -0.271,0.04 -0.546,0.078 -0.823,0.113 -0.088,0.011 -0.176,0.023 -0.264,0.034 -0.359,0.042 -0.722,0.08 -1.087,0.113 -0.079,0.006 -0.159,0.012 -0.238,0.019 -0.295,0.024 -0.593,0.046 -0.892,0.063 -0.115,0.007 -0.23,0.014 -0.345,0.02 -0.301,0.015 -0.604,0.028 -0.908,0.037 -0.082,0.002 -0.163,0.006 -0.245,0.008 -0.343,0.008 -0.688,0.013 -1.036,0.013 -0.031,0 -0.062,-0.002 -0.094,-0.002 -0.252,0 -0.508,-0.006 -0.763,-0.011 -0.188,-0.004 -0.375,-0.005 -0.564,-0.011 -0.266,-0.008 -0.535,-0.024 -0.803,-0.037 -0.18,-0.009 -0.358,-0.015 -0.538,-0.026 -0.298,-0.018 -0.597,-0.044 -0.896,-0.068 -0.152,-0.013 -0.303,-0.021 -0.455,-0.035 -0.452,-0.042 -0.904,-0.09 -1.358,-0.145 -4.254,-0.519 -8.218,-1.596 -11.699,-3.142 l 0.001,0.006 c -8.665,-3.624 -13.565,-10.559 -42.812,-20.606 -0.098,-0.033 -0.197,-0.068 -0.295,-0.101 -0.405,-0.139 -0.813,-0.278 -1.228,-0.417 l 0.001,-0.002 c -21.967,-7.499 -42.581,-19.244 -60.438,-34.692 -15.41,-13.331 -28.457,-29.035 -38.78,-46.677 -10.68,-18.254 -18.185,-38.164 -22.306,-59.176 -4.831,-24.627 -4.804,-49.477 0.08,-73.861 4.715,-23.541 13.736,-45.642 26.813,-65.69 13.077,-20.049 29.556,-37.043 48.979,-50.51 20.118,-13.95 45.189,-24.62 66.568,-28.324 0.992,-0.172 1.981,-0.338 2.967,-0.498 0.356,-0.058 0.709,-0.111 1.064,-0.167 0.627,-0.1 1.254,-0.2 1.879,-0.295 0.425,-0.063 0.847,-0.124 1.27,-0.187 0.552,-0.081 1.104,-0.163 1.655,-0.24 0.453,-0.063 0.904,-0.124 1.355,-0.185 0.516,-0.071 1.032,-0.14 1.546,-0.207 0.467,-0.061 0.932,-0.119 1.397,-0.176 0.497,-0.063 0.994,-0.124 1.49,-0.183 0.471,-0.055 0.94,-0.109 1.409,-0.163 0.488,-0.055 0.976,-0.109 1.462,-0.162 0.47,-0.051 0.939,-0.1 1.408,-0.147 0.482,-0.05 0.964,-0.098 1.445,-0.144 0.467,-0.046 0.933,-0.09 1.398,-0.132 0.482,-0.044 0.962,-0.086 1.442,-0.127 0.46,-0.039 0.92,-0.078 1.379,-0.115 0.484,-0.038 0.966,-0.074 1.447,-0.109 0.452,-0.035 0.903,-0.068 1.352,-0.099 0.495,-0.034 0.988,-0.064 1.481,-0.095 0.43,-0.027 0.861,-0.055 1.291,-0.08 0.525,-0.03 1.048,-0.055 1.572,-0.082 0.394,-0.02 0.789,-0.042 1.181,-0.059 0.598,-0.028 1.192,-0.05 1.787,-0.074 0.315,-0.011 0.633,-0.026 0.948,-0.037 0.911,-0.031 1.82,-0.057 2.724,-0.078 0.033,0 0.065,-0.001 0.099,-0.001 0.873,-0.019 1.743,-0.034 2.61,-0.043 0.274,-0.003 0.547,-0.003 0.82,-0.005 0.546,-0.004 1.093,-0.009 1.637,-0.009 0.076,0 0.151,0.001 0.228,0.001 0.348,0 0.695,0.004 1.042,0.006 0.548,0.003 1.096,0.006 1.642,0.013 0.365,0.005 0.73,0.013 1.094,0.02 0.523,0.008 1.048,0.018 1.568,0.031 0.375,0.01 0.748,0.021 1.122,0.033 0.509,0.016 1.018,0.031 1.525,0.05 0.377,0.014 0.753,0.03 1.129,0.046 0.5,0.021 0.999,0.044 1.497,0.068 0.377,0.019 0.752,0.039 1.127,0.06 0.495,0.027 0.989,0.055 1.482,0.086 0.373,0.023 0.745,0.047 1.117,0.072 0.492,0.033 0.985,0.068 1.475,0.104 0.368,0.028 0.735,0.056 1.102,0.085 0.493,0.039 0.982,0.081 1.471,0.123 0.361,0.032 0.723,0.064 1.083,0.097 0.495,0.046 0.987,0.094 1.481,0.143 0.35,0.035 0.701,0.07 1.05,0.106 0.502,0.053 1.001,0.109 1.501,0.165 0.336,0.038 0.673,0.075 1.008,0.115 0.52,0.061 1.035,0.125 1.551,0.191 0.312,0.039 0.625,0.077 0.935,0.118 0.549,0.071 1.094,0.147 1.641,0.223 0.275,0.039 0.551,0.075 0.825,0.115 0.61,0.087 1.216,0.18 1.821,0.272 0.208,0.033 0.417,0.062 0.626,0.095 0.785,0.123 1.565,0.251 2.343,0.383 0.028,0.004 0.054,0.009 0.08,0.013 1.643,0.279 3.27,0.579 4.884,0.897 0.122,0.024 0.242,0.05 0.364,0.074 0.672,0.134 1.344,0.271 2.012,0.412 0.192,0.04 0.383,0.083 0.575,0.124 0.594,0.128 1.187,0.257 1.777,0.389 0.226,0.052 0.451,0.104 0.676,0.156 0.556,0.127 1.111,0.255 1.664,0.387 0.238,0.058 0.474,0.116 0.712,0.174 0.537,0.131 1.073,0.262 1.606,0.397 0.244,0.062 0.486,0.125 0.73,0.188 0.526,0.136 1.049,0.272 1.573,0.412 0.243,0.064 0.486,0.131 0.728,0.197 0.522,0.142 1.041,0.285 1.559,0.431 0.238,0.067 0.474,0.135 0.712,0.203 0.522,0.149 1.044,0.302 1.563,0.456 0.229,0.067 0.455,0.135 0.682,0.203 0.527,0.159 1.054,0.32 1.579,0.484 0.216,0.067 0.431,0.134 0.645,0.202 0.539,0.17 1.075,0.342 1.61,0.517 0.196,0.065 0.392,0.128 0.589,0.193 0.559,0.185 1.115,0.373 1.67,0.563 0.168,0.058 0.336,0.114 0.505,0.173 0.591,0.204 1.18,0.412 1.767,0.622 0.129,0.047 0.259,0.092 0.388,0.139 0.647,0.233 1.29,0.47 1.93,0.711 0.069,0.025 0.135,0.049 0.203,0.075 5.069,1.907 9.959,4.029 14.674,6.349 0.019,0.01 0.037,0.02 0.057,0.03 0.648,0.318 1.292,0.641 1.933,0.967 0.043,0.023 0.085,0.044 0.127,0.067 0.62,0.316 1.237,0.636 1.85,0.959 0.051,0.027 0.102,0.054 0.152,0.081 0.608,0.32 1.21,0.644 1.811,0.972 0.051,0.027 0.103,0.056 0.154,0.084 0.603,0.329 1.201,0.662 1.798,0.998 0.044,0.024 0.089,0.049 0.134,0.075 0.607,0.344 1.213,0.69 1.815,1.041 0.028,0.015 0.056,0.032 0.083,0.048 0.625,0.364 1.246,0.732 1.866,1.104 0.002,0.002 0.005,0.003 0.007,0.005 90.995,54.734 105.94,188.322 39.592,262.371" /> diff --git a/logo/adafruit_circuit_python_ouroboros_logo_final.svg b/logo/adafruit_circuit_python_ouroboros_logo_final.svg index 051966d4ac..2c71fd8ecf 100644 --- a/logo/adafruit_circuit_python_ouroboros_logo_final.svg +++ b/logo/adafruit_circuit_python_ouroboros_logo_final.svg @@ -93,4 +93,4 @@ id="g3884"> \ No newline at end of file + d="M 0,0 V -0.002 C -0.52,0.546 -1.049,1.08 -1.595,1.603 -1.68,1.685 -1.767,1.766 -1.853,1.848 V -3.94 C -1.219,-4.651 -0.59,-5.367 0,-6.117 V -6.39 -41.674 h 6.278 v 24.966 c 0.379,-0.889 0.738,-1.784 1.062,-2.698 h 4.22 c -0.584,1.809 -1.27,3.573 -2.044,5.289 -0.068,0.148 -0.132,0.299 -0.203,0.444 -0.223,0.483 -0.454,0.961 -0.693,1.436 -0.08,0.158 -0.161,0.317 -0.244,0.475 -0.246,0.481 -0.498,0.961 -0.761,1.431 -0.039,0.07 -0.08,0.138 -0.119,0.207 -0.39,0.691 -0.797,1.369 -1.218,2.041 v 0.008 C 4.458,-5.172 2.353,-2.469 0,0" /> diff --git a/logo/adafruit_circuit_python_sitting_color.svg b/logo/adafruit_circuit_python_sitting_color.svg index 6da7f5ca86..266a46c550 100644 --- a/logo/adafruit_circuit_python_sitting_color.svg +++ b/logo/adafruit_circuit_python_sitting_color.svg @@ -603,4 +603,4 @@ id="g15548"> \ No newline at end of file + d="m 0,0 2.273,0.622 4.532,1.288 3.56,1.055 0.953,0.284 3.297,0.977 -3.418,0.88 C 10.492,5.286 9.781,5.434 9.072,5.595 L 7.842,5.871 C 7.83,6.408 7.809,6.947 7.771,7.484 7.715,8.318 7.629,9.149 7.506,9.98 7.26,11.64 6.895,13.296 6.273,14.906 5.967,15.71 5.6,16.505 5.135,17.275 4.664,18.041 4.1,18.797 3.291,19.425 c -0.803,0.631 -1.986,1.054 -3.164,0.789 -1.143,-0.253 -1.971,-0.959 -2.57,-1.664 -0.219,-0.259 -0.411,-0.527 -0.588,-0.798 -0.094,0.037 -0.182,0.071 -0.282,0.109 -0.171,0.07 -0.351,0.143 -0.535,0.218 -0.193,0.07 -0.355,0.168 -0.529,0.264 -0.176,0.1 -0.353,0.199 -0.527,0.296 -0.178,0.101 -0.319,0.224 -0.479,0.336 -0.148,0.118 -0.32,0.223 -0.435,0.348 -0.131,0.125 -0.252,0.244 -0.366,0.352 -0.115,0.114 -0.195,0.229 -0.281,0.331 -0.088,0.102 -0.154,0.193 -0.201,0.273 -0.107,0.158 -0.152,0.263 -0.152,0.263 0,0 -0.026,-0.106 -0.034,-0.305 -0.009,-0.103 -0.009,-0.227 0,-0.365 0.01,-0.139 0.01,-0.305 0.036,-0.477 0.029,-0.175 0.062,-0.365 0.097,-0.564 0.03,-0.212 0.106,-0.404 0.166,-0.623 0.071,-0.212 0.129,-0.454 0.223,-0.669 0.1,-0.219 0.197,-0.443 0.297,-0.664 0.103,-0.225 0.205,-0.46 0.332,-0.657 0.127,-0.208 0.25,-0.412 0.371,-0.611 0.123,-0.198 0.24,-0.4 0.363,-0.575 0.127,-0.168 0.248,-0.326 0.362,-0.472 0.029,-0.037 0.054,-0.069 0.084,-0.104 C -4.588,14.254 -4.658,14.053 -4.715,13.852 -5.174,12.229 -5.428,10.579 -5.543,8.93 -5.604,8.105 -5.641,7.283 -5.629,6.46 -5.613,5.631 -5.588,4.821 -5.504,4.002 -5.451,3.186 -5.316,2.377 -5.189,1.57 -5.055,0.76 -4.871,-0.027 -4.662,-0.812 L -4.721,0.404 -4.74,1.613 c -0.002,0.311 0.004,0.623 0.008,0.935 0.009,0.491 0.025,0.981 0.048,1.47 0.03,0.797 0.098,1.603 0.184,2.387 0.088,0.792 0.184,1.579 0.324,2.359 0.278,1.556 0.649,3.089 1.162,4.547 0.262,0.728 0.563,1.433 0.916,2.093 0.356,0.654 0.746,1.281 1.207,1.773 0.454,0.501 0.983,0.835 1.436,0.902 0.109,0.022 0.24,0.024 0.326,0.013 L 1.02,18.079 C 1.076,18.076 1.066,18.065 1.09,18.06 1.121,18.05 1.154,18.047 1.219,18.021 1.443,17.946 1.674,17.809 1.906,17.631 2.371,17.262 2.801,16.707 3.162,16.093 3.521,15.474 3.832,14.794 4.088,14.086 4.35,13.378 4.551,12.642 4.746,11.897 4.936,11.154 5.09,10.394 5.213,9.627 5.467,8.095 5.574,6.533 5.621,4.968 L 5.65,4.019 6.529,3.881 7.182,3.778 6.295,3.452 2.693,2.085 1.889,1.778 1.393,1.584 C 1.41,1.861 1.418,2.143 1.418,2.429 1.418,4.665 0.945,6.616 0.244,7.695 0.027,7.144 -0.27,6.802 -0.6,6.802 c -0.449,0 -0.834,0.639 -1.035,1.57 -1.039,-0.7 -1.804,-3.092 -1.804,-5.943 0,-0.955 0.087,-1.857 0.242,-2.664 -0.436,-0.177 -0.867,-0.353 -1.301,-0.531 -0.787,-0.326 -1.572,-0.654 -2.357,-0.995 1.535,0.36 3.056,0.755 4.578,1.15 z" /> diff --git a/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg index 3fbce7126e..62d7f66367 100644 --- a/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg +++ b/logo/adafruit_circuit_python_stacked_lockup_logo_final.svg @@ -74,4 +74,4 @@ id="g3772"> \ No newline at end of file + d="M 0,0 5.74,24.865 H 2.239 L -3.499,0 Z" /> diff --git a/logo/awesome_circuitpython.svg b/logo/awesome_circuitpython.svg index f60b0c6593..53225310be 100644 --- a/logo/awesome_circuitpython.svg +++ b/logo/awesome_circuitpython.svg @@ -633,4 +633,4 @@ id="g16074"> \ No newline at end of file + d="m 0,0 h 4.107 v -2.053 c 0.948,1.217 2.162,2.324 4.241,2.324 3.108,0 4.921,-2.054 4.921,-5.378 v -9.375 H 9.161 v 8.077 c 0,1.946 -0.922,2.947 -2.485,2.947 -1.571,0 -2.569,-1.001 -2.569,-2.947 v -8.077 H 0 Z" /> diff --git a/logo/blinka_colorform-cooking.svg b/logo/blinka_colorform-cooking.svg index d108479f75..8f169ede9b 100644 --- a/logo/blinka_colorform-cooking.svg +++ b/logo/blinka_colorform-cooking.svg @@ -1082,4 +1082,4 @@ id="g17854"> \ No newline at end of file + d="M 0,0 C -4.549,0 -8.826,-0.083 -12.044,-0.235 -17.5,-0.492 -17.5,-0.762 -17.5,-1.301 c 0,-0.538 0,-0.808 5.456,-1.066 3.218,-0.151 7.495,-0.235 12.044,-0.235 4.549,0 8.826,0.084 12.044,0.235 5.456,0.258 5.456,0.528 5.456,1.066 0,0.539 0,0.809 -5.456,1.066 C 8.826,-0.083 4.549,0 0,0 m 0,-0.5 c 9.389,0 17,-0.358 17,-0.801 0,-0.442 -7.611,-0.801 -17,-0.801 -9.389,0 -17,0.359 -17,0.801 0,0.443 7.611,0.801 17,0.801" /> diff --git a/logo/blinka_colorform-first-birthday.svg b/logo/blinka_colorform-first-birthday.svg index 37626864c3..9b4a5d30d6 100644 --- a/logo/blinka_colorform-first-birthday.svg +++ b/logo/blinka_colorform-first-birthday.svg @@ -883,4 +883,4 @@ id="tspan20612" y="0" x="0">1 - \ No newline at end of file + diff --git a/logo/blinka_colorform-painting.svg b/logo/blinka_colorform-painting.svg index c7493207ac..33252883d1 100644 --- a/logo/blinka_colorform-painting.svg +++ b/logo/blinka_colorform-painting.svg @@ -1019,4 +1019,4 @@ id="g21156"> \ No newline at end of file + d="m 0,0 c 0,0 0.227,0.497 0.522,1.411 0.284,0.912 0.644,2.254 0.721,3.922 0.064,1.659 -0.203,3.658 -1.092,5.584 -0.874,1.93 -2.358,3.705 -4.093,5.105 -0.436,0.36 -0.869,0.688 -1.35,1.006 -0.456,0.299 -0.885,0.61 -1.396,0.866 -0.975,0.566 -1.991,0.951 -3.004,1.268 -1.03,0.251 -2.045,0.451 -3.024,0.425 -0.972,-0.013 -1.889,-0.131 -2.699,-0.369 -0.817,-0.211 -1.527,-0.525 -2.123,-0.849 -0.589,-0.341 -1.07,-0.681 -1.447,-0.98 -0.373,-0.308 -0.651,-0.564 -0.823,-0.757 -0.177,-0.184 -0.272,-0.283 -0.272,-0.283 0,0 0.109,0.082 0.314,0.236 0.199,0.16 0.513,0.365 0.908,0.625 0.403,0.247 0.908,0.518 1.507,0.774 0.611,0.226 1.293,0.495 2.078,0.63 0.774,0.168 1.637,0.213 2.534,0.16 0.902,-0.037 1.836,-0.241 2.779,-0.513 0.922,-0.326 1.897,-0.691 2.77,-1.223 0.448,-0.228 0.901,-0.549 1.358,-0.838 0.428,-0.273 0.868,-0.602 1.277,-0.933 0.827,-0.666 1.599,-1.397 2.278,-2.184 0.682,-0.785 1.243,-1.645 1.698,-2.52 C 0.347,8.811 0.706,6.937 0.731,5.337 0.784,3.729 0.56,2.38 0.356,1.454 0.161,0.523 0,0 0,0" /> diff --git a/logo/blinka_colorform-reading.svg b/logo/blinka_colorform-reading.svg index 761895ac06..fc57b6f800 100644 --- a/logo/blinka_colorform-reading.svg +++ b/logo/blinka_colorform-reading.svg @@ -903,4 +903,4 @@ transform="translate(266.938,449.3901)"> \ No newline at end of file + d="m 0,0 -0.031,0.008 -39.606,10.181 0.063,0.243 L 0,0.258 39.574,10.432 39.637,10.189 Z" /> diff --git a/logo/blinka_colorform-singing.svg b/logo/blinka_colorform-singing.svg index ec22f43627..f64c034c11 100644 --- a/logo/blinka_colorform-singing.svg +++ b/logo/blinka_colorform-singing.svg @@ -1034,4 +1034,4 @@ style="fill:#e80e8a;fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 0,0 h 0.006 c 0,0 -0.006,0.001 -0.007,0.001 -0.53,0.417 -1.547,0.95 -3.369,1.006 -2.13,0.065 -3.564,0.182 -4.913,0.526 -0.15,0.051 -0.3,0.098 -0.447,0.154 -0.531,0.165 -1.046,0.366 -1.542,0.59 -0.511,0.198 -0.973,0.469 -1.434,0.706 -0.444,0.262 -0.878,0.516 -1.268,0.788 -0.389,0.273 -0.748,0.542 -1.055,0.824 -1.269,1.086 -1.791,2.109 -1.791,2.109 0,0 0.087,-0.269 0.335,-0.699 0.123,-0.215 0.29,-0.465 0.498,-0.742 0.213,-0.27 0.453,-0.582 0.765,-0.873 0.297,-0.308 0.648,-0.608 1.031,-0.912 0.383,-0.303 0.81,-0.597 1.268,-0.871 0.468,-0.253 0.941,-0.543 1.459,-0.754 0.506,-0.242 1.029,-0.46 1.569,-0.636 0.534,-0.196 1.081,-0.344 1.624,-0.474 0.538,-0.149 1.073,-0.266 1.597,-0.347 0.337,-0.056 0.662,-0.115 0.983,-0.162 0.769,-0.117 1.44,-0.26 2.023,-0.438 0.661,-0.2 1.22,-0.444 1.674,-0.754 0.488,-0.334 0.858,-0.746 1.147,-1.244 0.157,-0.297 0.315,-0.592 0.445,-0.919 0.059,-0.14 0.115,-0.283 0.17,-0.427 0.016,-0.043 0.033,-0.086 0.049,-0.129 0.047,-0.125 0.094,-0.248 0.141,-0.373 0.02,-0.059 0.041,-0.117 0.062,-0.176 0.045,-0.127 0.09,-0.254 0.133,-0.383 0.17,-0.521 0.338,-1.035 0.5,-1.533 0.002,-0.008 0.005,-0.016 0.008,-0.024 0.054,-0.158 0.107,-0.316 0.162,-0.472 0.029,-0.082 0.056,-0.166 0.088,-0.25 0.029,-0.076 0.058,-0.153 0.087,-0.229 0.063,-0.164 0.126,-0.326 0.191,-0.482 0.1,-0.231 0.201,-0.453 0.308,-0.666 0.111,-0.211 0.22,-0.414 0.339,-0.604 0.235,-0.377 0.494,-0.699 0.747,-0.957 0.222,-0.226 0.445,-0.4 0.64,-0.533 0.028,-0.017 0.057,-0.035 0.083,-0.053 0.213,-0.14 0.4,-0.222 0.521,-0.277 0.125,-0.049 0.191,-0.076 0.191,-0.076 0,0 -0.054,0.049 -0.154,0.137 -0.051,0.043 -0.107,0.103 -0.175,0.168 -0.034,0.033 -0.067,0.072 -0.105,0.111 -0.037,0.039 -0.078,0.08 -0.116,0.127 -0.161,0.18 -0.335,0.414 -0.505,0.695 -0.169,0.283 -0.336,0.611 -0.48,0.988 -0.039,0.096 -0.076,0.194 -0.111,0.295 0.05,-0.039 0.099,-0.078 0.148,-0.117 0.079,-0.058 0.148,-0.123 0.23,-0.17 0.081,-0.049 0.157,-0.095 0.233,-0.142 0.074,-0.045 0.144,-0.094 0.222,-0.125 0.15,-0.069 0.287,-0.135 0.417,-0.188 0.136,-0.045 0.259,-0.086 0.371,-0.119 0.055,-0.018 0.107,-0.035 0.156,-0.047 0.049,-0.008 0.096,-0.017 0.14,-0.025 0.086,-0.016 0.16,-0.03 0.219,-0.039 0.121,-0.02 0.184,-0.03 0.184,-0.03 0,0 -0.055,0.034 -0.16,0.096 C 5.481,-9.119 5.417,-9.082 5.34,-9.039 5.301,-9.015 5.26,-8.992 5.217,-8.966 5.174,-8.941 5.133,-8.91 5.087,-8.878 4.999,-8.816 4.901,-8.748 4.793,-8.673 4.694,-8.589 4.586,-8.5 4.47,-8.404 4.357,-8.308 4.252,-8.189 4.134,-8.076 4.075,-8.021 4.026,-7.949 3.969,-7.884 3.915,-7.818 3.858,-7.753 3.803,-7.683 3.752,-7.609 3.7,-7.535 3.647,-7.458 3.62,-7.421 3.593,-7.382 3.567,-7.345 3.542,-7.304 3.518,-7.263 3.495,-7.22 3.446,-7.138 3.396,-7.054 3.346,-6.97 3.3,-6.88 3.254,-6.791 3.208,-6.699 3.03,-6.33 2.864,-5.929 2.713,-5.49 c -0.04,0.106 -0.074,0.219 -0.111,0.33 -0.039,0.112 -0.078,0.223 -0.114,0.338 -0.074,0.233 -0.15,0.467 -0.226,0.705 v 0.002 c -0.029,0.092 -0.056,0.186 -0.086,0.28 -0.041,0.132 -0.088,0.265 -0.135,0.406 -0.072,0.205 -0.145,0.41 -0.225,0.615 -0.026,0.068 -0.054,0.135 -0.083,0.203 -0.17,0.409 -0.363,0.816 -0.596,1.204 -0.076,0.131 -0.158,0.258 -0.245,0.383 -0.083,0.126 -0.176,0.247 -0.267,0.366 -0.046,0.053 -0.093,0.103 -0.138,0.157 l 0.006,-0.003 c 0,0 -0.116,0.193 -0.41,0.442 C 0.059,-0.043 0.027,-0.021 0,0" /> \ No newline at end of file + id="g20008" /> diff --git a/logo/blinka_colorform-telescope.svg b/logo/blinka_colorform-telescope.svg index 8b3724171b..081b9cb685 100644 --- a/logo/blinka_colorform-telescope.svg +++ b/logo/blinka_colorform-telescope.svg @@ -962,4 +962,4 @@ id="g17204"> \ No newline at end of file + d="m 0,0 c 0,-0.838 -0.686,-1.518 -1.525,-1.518 -0.837,0 -1.518,0.68 -1.518,1.518 0,0.839 0.681,1.519 1.518,1.519 C -0.686,1.519 0,0.839 0,0" /> diff --git a/logo/blinka_colorform-test_tubes.svg b/logo/blinka_colorform-test_tubes.svg index b6b939d2f0..62e5a572e0 100644 --- a/logo/blinka_colorform-test_tubes.svg +++ b/logo/blinka_colorform-test_tubes.svg @@ -1214,4 +1214,4 @@ d="m 0,0 c 3.464,0.942 2.658,10.376 2.658,10.376 h -14.301 -12.299 c 0,0 -1.419,-9.774 4.78,-10.567 6.046,-0.773 4.318,7.167 15.929,5.897" /> \ No newline at end of file + d="m 154.293,494.23 h -27.616 v 0.917 h 27.616 z" /> diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index 04f9a24d5c..1a8b4880da 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -128,7 +128,7 @@ X(ENOTEMPTY) \ X(EILSEQ) #endif - + // type definitions for the specific machine #ifdef __LP64__ diff --git a/ports/atmel-samd/boards/8086_commander/pins.c b/ports/atmel-samd/boards/8086_commander/pins.c index 3eea4009e7..728da3f6b2 100644 --- a/ports/atmel-samd/boards/8086_commander/pins.c +++ b/ports/atmel-samd/boards/8086_commander/pins.c @@ -2,7 +2,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - // Serial + // Serial { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, // RX { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, // TX diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c index b418d0f1b9..1e9ab029e2 100644 --- a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -// Updated to support Alorium Technology Evo M51 +// Updated to support Alorium Technology Evo M51 // Author: Bryan Craker // Date: 2020-05-20 diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c index b1966930c7..f7ad82c579 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c +++ b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ANMB), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ANVLIM), MP_ROM_PTR(&pin_PA04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_AN5V), MP_ROM_PTR(&pin_PA05) }, - + { MP_OBJ_NEW_QSTR(MP_QSTR_MBPWM), MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MBINT), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MBCS), MP_ROM_PTR(&pin_PA18) }, diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h index 592160b84f..321436c6b7 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.h @@ -32,4 +32,4 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 \ No newline at end of file +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index 19e5dd2ab9..a71728e2db 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -15,4 +15,3 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_VECTORIO = 0 - diff --git a/ports/atmel-samd/boards/datum_distance/pins.c b/ports/atmel-samd/boards/datum_distance/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_distance/pins.c +++ b/ports/atmel-samd/boards/datum_distance/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_imu/pins.c b/ports/atmel-samd/boards/datum_imu/pins.c index 237b5774ec..eabd2567ef 100644 --- a/ports/atmel-samd/boards/datum_imu/pins.c +++ b/ports/atmel-samd/boards/datum_imu/pins.c @@ -16,7 +16,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_light/pins.c b/ports/atmel-samd/boards/datum_light/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_light/pins.c +++ b/ports/atmel-samd/boards/datum_light/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/datum_weather/pins.c b/ports/atmel-samd/boards/datum_weather/pins.c index b29a859b64..8e4f1101e8 100644 --- a/ports/atmel-samd/boards/datum_weather/pins.c +++ b/ports/atmel-samd/boards/datum_weather/pins.c @@ -14,7 +14,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, diff --git a/ports/atmel-samd/boards/escornabot_makech/pins.c b/ports/atmel-samd/boards/escornabot_makech/pins.c index d43d254e71..fefee19199 100644 --- a/ports/atmel-samd/boards/escornabot_makech/pins.c +++ b/ports/atmel-samd/boards/escornabot_makech/pins.c @@ -9,11 +9,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // Buttons { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA03) }, - - + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA01) }, - + // Motors { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, @@ -23,10 +23,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, - + // Buzzer { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA16) }, - + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA13) }, @@ -34,7 +34,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { //UART { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) }, - + // I2C { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 7cb53bd130..4946788d3e 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -12,4 +12,3 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ CIRCUITPY_VECTORIO = 1 - diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index 3aa7c5721a..e9d94638af 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -18,4 +18,3 @@ CIRCUITPY_AUDIOIO = 0 # Too much flash for Korean translations CIRCUITPY_VECTORIO = 0 - diff --git a/ports/atmel-samd/boards/hallowing_m4_express/pins.c b/ports/atmel-samd/boards/hallowing_m4_express/pins.c index 9365ea3caf..388a85d56f 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/pins.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/pins.c @@ -40,7 +40,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, - + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PB31) }, diff --git a/ports/atmel-samd/boards/kicksat-sprite/board.c b/ports/atmel-samd/boards/kicksat-sprite/board.c index fc53f39675..75cdfbc824 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/board.c +++ b/ports/atmel-samd/boards/kicksat-sprite/board.c @@ -38,4 +38,4 @@ bool board_requests_safe_mode(void) { } void reset_board(void) { -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/kicksat-sprite/pins.c b/ports/atmel-samd/boards/kicksat-sprite/pins.c index 03af22ff26..87d894c589 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/pins.c +++ b/ports/atmel-samd/boards/kicksat-sprite/pins.c @@ -22,7 +22,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, - + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, @@ -30,9 +30,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB03) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h index 4bd01706df..ed8f15856c 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h @@ -23,6 +23,3 @@ // Enable the use of 2 displays #define CIRCUITPY_DISPLAY_LIMIT (2) - - - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h index 869f207a16..51be8d7c06 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.h @@ -29,4 +29,3 @@ // USB is always used. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk index 5e5f0ff5fd..09804bc4e7 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk @@ -12,4 +12,3 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 6d1fc53b6d..2ea5630079 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -23,7 +23,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, - + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA09) }, diff --git a/ports/atmel-samd/boards/pycubed/board.c b/ports/atmel-samd/boards/pycubed/board.c index 31b0812094..9d29d2a66a 100644 --- a/ports/atmel-samd/boards/pycubed/board.c +++ b/ports/atmel-samd/boards/pycubed/board.c @@ -58,4 +58,4 @@ void reset_board(void) { common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out); ++value_out; common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.h b/ports/atmel-samd/boards/pycubed/mpconfigboard.h index 8d046c75bd..fc16e22b59 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.h +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.h @@ -17,7 +17,7 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) -// External flash W25Q80DV +// External flash W25Q80DV #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/pycubed/pins.c b/ports/atmel-samd/boards/pycubed/pins.c index 4c97f58a80..e494fb54bf 100644 --- a/ports/atmel-samd/boards/pycubed/pins.c +++ b/ports/atmel-samd/boards/pycubed/pins.c @@ -40,16 +40,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_EN_GPS), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) }, - + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_WDT_WDI), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA21) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/pycubed_mram/board.c b/ports/atmel-samd/boards/pycubed_mram/board.c index 31b0812094..9d29d2a66a 100644 --- a/ports/atmel-samd/boards/pycubed_mram/board.c +++ b/ports/atmel-samd/boards/pycubed_mram/board.c @@ -58,4 +58,4 @@ void reset_board(void) { common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out); ++value_out; common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/pygamer/pins.c b/ports/atmel-samd/boards/pygamer/pins.c index 7e6eff43f9..107d780a8a 100644 --- a/ports/atmel-samd/boards/pygamer/pins.c +++ b/ports/atmel-samd/boards/pygamer/pins.c @@ -44,7 +44,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, // SDCS, dup of D4 - { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, // Special named pins { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, diff --git a/ports/atmel-samd/boards/pygamer_advance/pins.c b/ports/atmel-samd/boards/pygamer_advance/pins.c index 9c2284db1a..653a1bb2ef 100644 --- a/ports/atmel-samd/boards/pygamer_advance/pins.c +++ b/ports/atmel-samd/boards/pygamer_advance/pins.c @@ -44,7 +44,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, // SDCS, dup of D4 - { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, // Special named pins { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, diff --git a/ports/atmel-samd/boards/robohatmm1_m4/pins.c b/ports/atmel-samd/boards/robohatmm1_m4/pins.c index 4fc290fb0a..74dcfd651f 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/pins.c +++ b/ports/atmel-samd/boards/robohatmm1_m4/pins.c @@ -83,7 +83,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_PI_GP24), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA31) }, - + { 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) }, diff --git a/ports/atmel-samd/boards/sam32/board.c b/ports/atmel-samd/boards/sam32/board.c index 7a23d30070..e032601440 100644 --- a/ports/atmel-samd/boards/sam32/board.c +++ b/ports/atmel-samd/boards/sam32/board.c @@ -49,4 +49,4 @@ void reset_board(void) { common_hal_digitalio_digitalinout_switch_to_output(&neopixel, false, DRIVE_MODE_PUSH_PULL); common_hal_neopixel_write(&neopixel, zeroes, 96); common_hal_digitalio_digitalinout_deinit(&neopixel); -} \ No newline at end of file +} diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index 1187449355..1dc686ef8a 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -14,4 +14,4 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_USTACK = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/sam32/pins.c b/ports/atmel-samd/boards/sam32/pins.c index f0a5b2b626..463615960f 100644 --- a/ports/atmel-samd/boards/sam32/pins.c +++ b/ports/atmel-samd/boards/sam32/pins.c @@ -42,12 +42,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TDI), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_TMS), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_ESP_CS),MP_ROM_PTR(&pin_PB15) }, - + { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PB16) }, { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PB17) }, - + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, @@ -56,11 +56,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, - + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { 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_BATTERY), MP_ROM_PTR(&pin_PA06) }, - + }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/serpente/pins.c b/ports/atmel-samd/boards/serpente/pins.c index 0bf6866561..7b7b14799e 100644 --- a/ports/atmel-samd/boards/serpente/pins.c +++ b/ports/atmel-samd/boards/serpente/pins.c @@ -37,4 +37,3 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); - diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c index f9d755d935..9562dc3b80 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c @@ -21,14 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, - + // External SPI { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - // UART + // UART { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c index f9d755d935..9562dc3b80 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c @@ -21,14 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, - + // External SPI { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - // UART + // UART { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c index db5b325b8f..d2e3fae630 100644 --- a/ports/atmel-samd/common-hal/countio/Counter.c +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -25,20 +25,20 @@ void common_hal_countio_counter_construct(countio_counter_obj_t* self, // These default settings apply when the EIC isn't yet enabled. self->eic_channel_a = pin_a->extint_channel; - + self->pin_a = pin_a->number; - + gpio_set_pin_function(self->pin_a, GPIO_PIN_FUNCTION_A); gpio_set_pin_pull_mode(self->pin_a, GPIO_PULL_UP); set_eic_channel_data(self->eic_channel_a, (void*) self); self->count = 0; - + claim_pin(pin_a); - - + + set_eic_handler(self->eic_channel_a, EIC_HANDLER_COUNTER); turn_on_eic_channel(self->eic_channel_a, EIC_CONFIG_SENSE0_FALL_Val); @@ -77,7 +77,7 @@ void common_hal_countio_counter_reset(countio_counter_obj_t* self){ void counter_interrupt_handler(uint8_t channel) { countio_counter_obj_t* self = get_eic_channel_data(channel); - + self->count += 1; - + } diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 1755270253..5c79f72a40 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -150,4 +150,3 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, mp_hal_enable_all_interrupts(); } - diff --git a/ports/atmel-samd/common-hal/supervisor/__init__.c b/ports/atmel-samd/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/atmel-samd/common-hal/supervisor/__init__.c +++ b/ports/atmel-samd/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/cxd56/boards/spresense/mpconfigboard.h b/ports/cxd56/boards/spresense/mpconfigboard.h index c53f6b418c..adfcbacb9e 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.h +++ b/ports/cxd56/boards/spresense/mpconfigboard.h @@ -38,4 +38,3 @@ #define DEFAULT_UART_BUS_TX (&pin_UART2_TXD) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) - diff --git a/ports/cxd56/common-hal/busio/I2C.c b/ports/cxd56/common-hal/busio/I2C.c index c163c183a9..127b6e75cd 100644 --- a/ports/cxd56/common-hal/busio/I2C.c +++ b/ports/cxd56/common-hal/busio/I2C.c @@ -79,7 +79,7 @@ bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { return self->has_lock; } - + void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { self->has_lock = false; } diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index 9a41011f2a..718a8ff16e 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -31,7 +31,7 @@ #include "shared-bindings/busio/SPI.h" -void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, +void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) { int port = -1; diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index 5e1d5a2ed4..21b4c77e55 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -63,7 +63,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, if (pulse_fd < 0) { pulse_fd = open("/dev/timer0", O_RDONLY); } - + if (pulse_fd < 0) { mp_raise_RuntimeError(translate("All timers in use")); } diff --git a/ports/cxd56/mkspk/.gitignore b/ports/cxd56/mkspk/.gitignore index e9a6ab18f8..4c3d12e3ad 100644 --- a/ports/cxd56/mkspk/.gitignore +++ b/ports/cxd56/mkspk/.gitignore @@ -1,3 +1,2 @@ /mkspk /mkspk.exe - diff --git a/ports/cxd56/supervisor/port.c b/ports/cxd56/supervisor/port.c index a7e9c30a3d..a40d31fafb 100644 --- a/ports/cxd56/supervisor/port.c +++ b/ports/cxd56/supervisor/port.c @@ -146,4 +146,3 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_sleep_until_interrupt(void) { // TODO: Implement sleep. } - diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.c b/ports/esp32s2/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100644 --- a/ports/esp32s2/common-hal/supervisor/Runtime.c +++ b/ports/esp32s2/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/esp32s2/common-hal/supervisor/__init__.c b/ports/esp32s2/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100644 --- a/ports/esp32s2/common-hal/supervisor/__init__.c +++ b/ports/esp32s2/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index ef216c4b1b..a8d3fa485c 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -121,4 +121,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/esp32s2/supervisor/usb.c b/ports/esp32s2/supervisor/usb.c index 8bba84015a..39eb8204ff 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/esp32s2/supervisor/usb.c @@ -88,4 +88,3 @@ void init_usb_hardware(void) { usb_device_stack, &usb_device_taskdef); } - diff --git a/ports/litex/common-hal/supervisor/Runtime.c b/ports/litex/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100644 --- a/ports/litex/common-hal/supervisor/Runtime.c +++ b/ports/litex/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/litex/common-hal/supervisor/__init__.c b/ports/litex/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100644 --- a/ports/litex/common-hal/supervisor/__init__.c +++ b/ports/litex/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/litex/hw/common.h b/ports/litex/hw/common.h index 6a97ca2e93..b902bc4f27 100644 --- a/ports/litex/hw/common.h +++ b/ports/litex/hw/common.h @@ -30,4 +30,4 @@ static inline uint32_t csr_readl(uint32_t addr) { return *(volatile uint32_t *)addr; } -#endif /* _HW_COMMON_H_ */ \ No newline at end of file +#endif /* _HW_COMMON_H_ */ diff --git a/ports/litex/irq.h b/ports/litex/irq.h index a822189071..dc96c228d8 100644 --- a/ports/litex/irq.h +++ b/ports/litex/irq.h @@ -68,4 +68,4 @@ static inline unsigned int irq_pending(void) } #endif -#endif /* __IRQ_H */ \ No newline at end of file +#endif /* __IRQ_H */ diff --git a/ports/litex/supervisor/internal_flash.c b/ports/litex/supervisor/internal_flash.c index 2dbf46b3a6..cf777a8acc 100644 --- a/ports/litex/supervisor/internal_flash.c +++ b/ports/litex/supervisor/internal_flash.c @@ -348,4 +348,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c index 80a57f17be..43ffe0dd13 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/flash_config.c @@ -45,7 +45,7 @@ const flexspi_nor_config_t qspiflash_config = { #ifdef BOARD_USING_SECONDARY_QSPI_PINMUX .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromInternally, #else - .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, #endif .csHoldTime = 1u, .csSetupTime = 2u, diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index ef34e61724..c51aef4daa 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -87,7 +87,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, //if both MOSI and MISO exist, loop search normally if ((mosi != NULL) && (miso != NULL)) { for (uint j = 0; j < mosi_count; j++) { - if ((mcu_spi_mosi_list[i].pin != mosi) + if ((mcu_spi_mosi_list[i].pin != mosi) || (mcu_spi_sck_list[i].bank_idx != mcu_spi_mosi_list[j].bank_idx)){ continue; } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index a517dc7b5e..5ef347e591 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -109,7 +109,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // If TX is on, keep looking, else stop if (tx != NULL) { for (uint32_t j = 0; j < tx_count; ++j) { - if (mcu_uart_tx_list[j].pin != tx || + if (mcu_uart_tx_list[j].pin != tx || mcu_uart_tx_list[j].bank_idx != mcu_uart_rx_list[i].bank_idx) { continue; } @@ -291,7 +291,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } else { reserved_uart[self->tx->bank_idx - 1] = false; } - + LPUART_Deinit(self->uart); gc_free(self->ringbuf); diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 233e66006b..a005924e2f 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -41,8 +41,8 @@ STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; // There are two numbering systems used here: -// IOMUXC index, used for iterating through pins and accessing reset information, -// and GPIO port and number, used to store claimed and reset tagging. The two number +// IOMUXC index, used for iterating through pins and accessing reset information, +// and GPIO port and number, used to store claimed and reset tagging. The two number // systems are not related and one cannot determine the other without a pin object void reset_all_pins(void) { for (uint8_t i = 0; i < IOMUXC_SW_PAD_CTL_PAD_COUNT; i++) { @@ -64,8 +64,8 @@ void reset_all_pins(void) { #endif } -// Since i.MX pins need extra register and reset information to reset properly, -// resetting pins by number alone has been removed. +// Since i.MX pins need extra register and reset information to reset properly, +// resetting pins by number alone has been removed. void common_hal_reset_pin(const mcu_pin_obj_t* pin) { never_reset_pins[pin->mux_idx] = false; claimed_pins[pin->mux_idx] = false; diff --git a/ports/mimxrt10xx/common-hal/supervisor/__init__.c b/ports/mimxrt10xx/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/mimxrt10xx/common-hal/supervisor/__init__.c +++ b/ports/mimxrt10xx/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index 3e2c6972b0..a994e154de 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -115,7 +115,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[9] = { const mcu_periph_obj_t mcu_uart_rts_list[4] = { PERIPH_PIN(1, 6, 0, 0, &pin_GPIO_07), - + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_07), PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_13), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 814b4120d1..3d043a14ec 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -160,7 +160,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[16] = { const mcu_periph_obj_t mcu_uart_rts_list[10] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_09), - + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_21), PERIPH_PIN(2, 2, 0, 1, &pin_GPIO_AD_B1_07), diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 388a1b0147..fd1e4ddb85 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -165,7 +165,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[18] = { const mcu_periph_obj_t mcu_uart_rts_list[9] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_15), - + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B1_01), PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_AD_B1_05), @@ -188,7 +188,7 @@ const mcu_periph_obj_t mcu_uart_cts_list[9] = { PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B1_00), PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 0, &pin_GPIO_EMC_15), - PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 1, &pin_GPIO_AD_B1_04), + PERIPH_PIN(3, 2, kIOMUXC_LPUART3_CTS_B_SELECT_INPUT, 1, &pin_GPIO_AD_B1_04), PERIPH_PIN(4, 2, 0, 0, &pin_GPIO_EMC_17), diff --git a/ports/mimxrt10xx/supervisor/internal_flash.c b/ports/mimxrt10xx/supervisor/internal_flash.c index 4f52748ed5..9abd15e60e 100644 --- a/ports/mimxrt10xx/supervisor/internal_flash.c +++ b/ports/mimxrt10xx/supervisor/internal_flash.c @@ -254,4 +254,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index acec3cf727..ed5824732d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -257,7 +257,7 @@ safe_mode_t port_init(void) { // enabled. It won't occur very often so it'll be low overhead. NVIC_EnableIRQ(SNVS_HP_WRAPPER_IRQn); - // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been + // Note that `reset_port` CANNOT GO HERE, unlike other ports, because `board_init` hasn't been // run yet, which uses `never_reset` to protect critical pins from being reset by `reset_port`. if (board_requests_safe_mode()) { diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index 22c979cf9a..01656a819c 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -90,4 +90,3 @@ void serial_write_substring(const char *text, uint32_t len) { LPUART_WriteBlocking(uart_instance, (uint8_t*)text, len); } - diff --git a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox index a444c5e4ec..ecabf96aa3 100644 --- a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox +++ b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/doc/ble_api.dox @@ -968,11 +968,11 @@ * |||; * SD<-ADVERTISERS [label = "Scannable Advertisement (ADV_SCAN_IND)", textcolor="#000080", linecolor="#000080"]; * SD->ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; - * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; - * ...; - * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; - * |||; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; * @endmsc * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising * @msc @@ -1011,7 +1011,7 @@ * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; @@ -1030,8 +1030,8 @@ * --- [label = " Variant #2 Reporting incomplete advertising reports"]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; - * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {{peer_addr1, peer_irk1}}, pp_local_irks: {local_irk1}) "]; * APP<ADVERTISERS [label = "Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; - * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; + * SD<-ADVERTISERS [label = "Scan Response (SCAN_RSP)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {bdaddr, rssi, data}"]; - * ...; - * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; - * |||; + * ...; + * APP<<=SD [label = "BLE_GAP_EVT_TIMEOUT {BLE_GAP_TIMEOUT_SRC_SCAN}"]; + * |||; * @endmsc * @defgroup BLE_GAP_SCAN_MSC_AE Scanning for advertisers performing legacy and extended advertising * @msc @@ -1011,7 +1011,7 @@ * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 1, scannable = 1, scan_response = 1}, data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; * APP<ADVERTISERS [label = "Legacy Scan Request (SCAN_REQ)", textcolor="#000080", linecolor="#000080"]; * APP<<=SD [label = "BLE_GAP_EVT_ADV_REPORT {type : {extended_pdu = 0, scannable = 1, scan_response = 0}, adv_data}"]; * APP=>SD [label = "sd_ble_gap_scan_start(params = NULL, adv_report_buffer)"]; @@ -1030,8 +1030,8 @@ * --- [label = " Variant #2 Reporting incomplete advertising reports"]; * |||; * APP=>SD [label = "sd_ble_gap_scan_start(params : {extended = 1, report_incomplete_evts = 1}, adv_report_buffer)"]; - * APP<SD [label = "sd_ble_gap_privacy_set(params: {mode: DEVICE_PRIVACY, private_addr_type: RESOLVABLE } "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: local_irk1) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: {local_irk1}) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<SD [label = "sd_ble_gap_device_identities_set(pp_id_keys: {peer_addr1, peer_irk1}, pp_local_irks: NULL) "]; * APP<PEER [label = "LL Length Request (LL_LENGTH_REQ) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; * SD<:PEER [label = "LL Length Response (LL_LENGTH_RSP) {tx=251, rx=251}", textcolor="#000080", linecolor="#000080"]; - + * APP<<=SD [label = "BLE_GAP_EVT_DATA_LENGTH_UPDATE {.effective_params={.max_tx_octets=251, .max_rx_octets=251, .max_tx_time_us=2120, .max_rx_time_us=2120}}"]; * |||; * ...; @@ -3927,4 +3927,3 @@ * @} * @} */ - diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h index 39944854c2..d17ac9a596 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble.h @@ -89,7 +89,7 @@ enum BLE_COMMON_SVCS */ enum BLE_COMMON_EVTS { - BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t + BLE_EVT_USER_MEM_REQUEST = BLE_EVT_BASE + 0, /**< User Memory request. See @ref ble_evt_user_mem_request_t \n Reply with @ref sd_ble_user_mem_reply. */ BLE_EVT_USER_MEM_RELEASE = BLE_EVT_BASE + 1, /**< User Memory release. See @ref ble_evt_user_mem_release_t */ }; @@ -389,10 +389,10 @@ typedef union * application RAM region (APP_RAM_BASE). On return, this will * contain the minimum start address of the application RAM region * required by the SoftDevice for this configuration. - * @warning After this call, the SoftDevice may generate several events. The list of events provided - * below require the application to initiate a SoftDevice API call. The corresponding API call - * is referenced in the event documentation. - * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop + * @warning After this call, the SoftDevice may generate several events. The list of events provided + * below require the application to initiate a SoftDevice API call. The corresponding API call + * is referenced in the event documentation. + * If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop * communicating with the peer device. * - @ref BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST * - @ref BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST @@ -537,7 +537,7 @@ SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_v /**@brief Remove a Vendor Specific base UUID. - * + * * @details This call removes a Vendor Specific base UUID that has been added with @ref sd_ble_uuid_vs_add. This function allows * the application to reuse memory allocated for Vendor Specific base UUIDs. * diff --git a/ports/nrf/boards/electronut_labs_papyr/README.md b/ports/nrf/boards/electronut_labs_papyr/README.md index fda3901938..7e5c43cc87 100644 --- a/ports/nrf/boards/electronut_labs_papyr/README.md +++ b/ports/nrf/boards/electronut_labs_papyr/README.md @@ -4,7 +4,7 @@ The `Electronut Labs Papyr` board is based on the `nRF52840` SoC from Nordic Semiconductors. It has an e-ink display on it, along with a CR2477 battery holder. -Papyr can be programmed with the [`Adafruit nRF52 bootloader`](https://github.com/adafruit/Adafruit_nRF52_Bootloader) to +Papyr can be programmed with the [`Adafruit nRF52 bootloader`](https://github.com/adafruit/Adafruit_nRF52_Bootloader) to Schematic, datasheet default pin mapping etc. can be found over [here](https://docs.electronut.in/papyr/). The default pin mapping can be found in the board directory. diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h index c4833e7196..4b7a884cfa 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.h @@ -62,6 +62,3 @@ #define DEFAULT_UART_BUS_RX (&pin_P0_28) #define DEFAULT_UART_BUS_TX (&pin_P0_02) - - - diff --git a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk index b6614f8b3f..e43639a897 100644 --- a/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk +++ b/ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk @@ -15,4 +15,3 @@ EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ" # We use a CFLAGS define here because there are include order issues # if we try to include "mpconfigport.h" into nrfx_config.h . CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2 - diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.mk b/ports/nrf/boards/particle_argon/mpconfigboard.mk index a0edfda958..2ca08b9829 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_argon/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.mk b/ports/nrf/boards/particle_boron/mpconfigboard.mk index ccb2d63a17..f03f43a7bc 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.mk +++ b/ports/nrf/boards/particle_boron/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.mk b/ports/nrf/boards/particle_xenon/mpconfigboard.mk index 3970b1d056..44309bbca2 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.mk +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICES = "MX25L3233F" # Support for the Ethernet FeatherWing CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 \ No newline at end of file +MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/README.md b/ports/nrf/boards/sparkfun_nrf52840_mini/README.md index f80f1c27ca..396e169a1e 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/README.md +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/README.md @@ -45,4 +45,4 @@ The nRF52840 Mini hardware layout is open source: * [Schematic](https://cdn.sparkfun.com/assets/learn_tutorials/8/2/0/nrf52840-breakout-mdbt50q-v10.pdf) * [Eagle Files](https://cdn.sparkfun.com/assets/learn_tutorials/8/2/0/nrf52840-breakout-mdbt50q-v10.zip) -* [Hookup Guide](https://learn.sparkfun.com/tutorials/sparkfun-pro-nrf52840-mini-hookup-guide) \ No newline at end of file +* [Hookup Guide](https://learn.sparkfun.com/tutorials/sparkfun-pro-nrf52840-mini-hookup-guide) diff --git a/ports/nrf/common-hal/neopixel_write/__init__.h b/ports/nrf/common-hal/neopixel_write/__init__.h index b8dce85adf..9366235af7 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.h +++ b/ports/nrf/common-hal/neopixel_write/__init__.h @@ -29,4 +29,4 @@ void neopixel_write_reset(void); -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_NEOPIXEL_WRITE_INIT_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_NEOPIXEL_WRITE_INIT_H diff --git a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c index a0cfd48d56..28f563da6f 100644 --- a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c @@ -49,9 +49,9 @@ static void _intr_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { self->state = new_state; - // logic from the atmel-samd port: provides some damping and scales movement - // down by 4:1. - if (self->quarter >= 4) { + // logic from the atmel-samd port: provides some damping and scales movement + // down by 4:1. + if (self->quarter >= 4) { self->position++; self->quarter = 0; } else if (self->quarter <= -4) { diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 06345f5895..93ba007c83 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -79,4 +79,3 @@ int common_hal_rtc_get_calibration(void) { void common_hal_rtc_set_calibration(int calibration) { mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); } - diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100755 --- a/ports/nrf/common-hal/supervisor/Runtime.c +++ b/ports/nrf/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/nrf/common-hal/supervisor/__init__.c b/ports/nrf/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/nrf/common-hal/supervisor/__init__.c +++ b/ports/nrf/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/nrf/examples/ubluepy_eddystone.py b/ports/nrf/examples/ubluepy_eddystone.py index baf25ba4b4..426a4aa55f 100644 --- a/ports/nrf/examples/ubluepy_eddystone.py +++ b/ports/nrf/examples/ubluepy_eddystone.py @@ -53,6 +53,6 @@ def generate_eddystone_adv_packet(url): return packet def start(): - adv_packet = generate_eddystone_adv_packet("micropython") + adv_packet = generate_eddystone_adv_packet("micropython") p = Peripheral() - p.advertise(data=adv_packet, connectable=False) \ No newline at end of file + p.advertise(data=adv_packet, connectable=False) diff --git a/ports/nrf/examples/ubluepy_scan.py b/ports/nrf/examples/ubluepy_scan.py index ab11661cca..c0a7d05a37 100644 --- a/ports/nrf/examples/ubluepy_scan.py +++ b/ports/nrf/examples/ubluepy_scan.py @@ -19,7 +19,7 @@ def get_device_names(scan_entries): def find_device_by_name(name): s = Scanner() scan_res = s.scan(100) - + device_names = get_device_names(scan_res) for dev in device_names: if name == dev[1]: @@ -30,9 +30,9 @@ def find_device_by_name(name): # ... print("address:", res.addr()) # ... print("address type:", res.addr_type()) # ... print("rssi:", res.rssi()) -# ... -# ... -# ... +# ... +# ... +# ... # address: c2:73:61:89:24:45 # address type: 1 # rssi: -26 diff --git a/ports/nrf/examples/ubluepy_temp.py b/ports/nrf/examples/ubluepy_temp.py index e5c157dbbd..118407af5e 100644 --- a/ports/nrf/examples/ubluepy_temp.py +++ b/ports/nrf/examples/ubluepy_temp.py @@ -31,7 +31,7 @@ def event_handler(id, handle, data): global periph global serv_env_sense global notif_enabled - + if id == constants.EVT_GAP_CONNECTED: # indicated 'connected' LED(1).on() @@ -50,7 +50,7 @@ def event_handler(id, handle, data): notif_enabled = True # start low power timer rtc.start() - else: + else: notif_enabled = False # stop low power timer rtc.stop() @@ -68,7 +68,7 @@ def send_temp(timer_id): # start off with LED(1) off LED(1).off() -# use RTC1 as RTC0 is used by bluetooth stack +# use RTC1 as RTC0 is used by bluetooth stack # set up RTC callback every 5 second rtc = RTC(1, period=5, mode=RTC.PERIODIC, callback=send_temp) @@ -76,7 +76,7 @@ notif_enabled = False uuid_env_sense = UUID("0x181A") # Environmental Sensing service uuid_temp = UUID("0x2A6E") # Temperature characteristic - + serv_env_sense = Service(uuid_env_sense) temp_props = Characteristic.PROP_NOTIFY | Characteristic.PROP_READ @@ -89,4 +89,3 @@ periph = Peripheral() periph.addService(serv_env_sense) periph.setConnectionHandler(event_handler) periph.advertise(device_name="micr_temp", services=[serv_env_sense]) - diff --git a/ports/nrf/gccollect.c b/ports/nrf/gccollect.c index b7aa57a55a..3661daa535 100644 --- a/ports/nrf/gccollect.c +++ b/ports/nrf/gccollect.c @@ -43,7 +43,7 @@ void gc_collect(void) { gc_collect_start(); mp_uint_t sp = get_msp(); // Get stack pointer - + // trace the stack, including the registers (since they live on the stack in this function) gc_collect_root((void**)sp, ((uint32_t)&_ram_end - sp) / sizeof(uint32_t)); diff --git a/ports/stm/.gitignore b/ports/stm/.gitignore index 3080ece14d..5d645392ca 100644 --- a/ports/stm/.gitignore +++ b/ports/stm/.gitignore @@ -6,4 +6,4 @@ build-*/ ##################### ref/ -.gdb_history \ No newline at end of file +.gdb_history diff --git a/ports/stm/README.md b/ports/stm/README.md index 95e9bd13fd..5df9cedee2 100644 --- a/ports/stm/README.md +++ b/ports/stm/README.md @@ -1,6 +1,6 @@ # Circuitpython on STM32 # -This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. +This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors. Refer to the ST Microelectronics website for more information on features sorted by family and individual chip lines: [st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html](https://www.st.com/en/microcontrollers-microprocessors/stm32-high-performance-mcus.html) @@ -13,10 +13,10 @@ STM32 SoCs vary product-by-product in clock speed, peripheral capability, pin as - **packages/** contains package-specific pin bindings (LQFP100, BGA216, etc) - **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. - **st-driver/** submodule for ST HAL and LL files generated via CubeMX. Shared with TinyUSB. -- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. -- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. -At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. ## Build instructions ## @@ -36,9 +36,9 @@ You may also build with certain flags available in the makefile, depending on yo ## USB connection ## -Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. +Connect your development board of choice to the host PC via the USB cable. Note that for most ST development boards such as the Nucleo and Discovery series, you must use a secondary OTG USB connector to access circuitpython, as the primary USB connector will be connected to a built-in ST-Link debugger rather than the chip itself. -In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. +In many cases, this ST-Link USB connector will **still need to be connected to power** for the chip to turn on - refer to your specific product manual for details. ## Flash the bootloader ## @@ -52,7 +52,7 @@ Windows users will need to install [stm32cubeprog](https://www.st.com/en/develop ## Flashing the circuitpython image with DFU-Util ## -Ensure the board is in dfu mode by following the steps in the previous section. Then run: +Ensure the board is in dfu mode by following the steps in the previous section. Then run: $ make BOARD=feather_stm32F405_express flash @@ -62,10 +62,10 @@ Alternatively, you can navigate to the build directory and run the raw `dfu-util ## Accessing the board ## -Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. +Connecting the board to the PC via the USB cable will allow code to be uploaded to the `CIRCUITPY` volume. -Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: +Circuitpython exposes a CDC virtual serial connection for REPL access and debugging. Connecting to it from OSX will look something like this: screen /dev/tty.usbmodem14111201 115200 -You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. +You may also use a program like [mu](https://codewith.mu/) to assist with REPL access. diff --git a/ports/stm/boards/STM32F401xe_boot.ld b/ports/stm/boards/STM32F401xe_boot.ld index 37827c3301..4f3e6ea70e 100644 --- a/ports/stm/boards/STM32F401xe_boot.ld +++ b/ports/stm/boards/STM32F401xe_boot.ld @@ -1,5 +1,5 @@ /* - GNU linker script for STM32F401 with bootloader (such as the Meowbit). No internal fs. + GNU linker script for STM32F401 with bootloader (such as the Meowbit). No internal fs. */ /* Specify the memory areas */ @@ -23,4 +23,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_boot.ld b/ports/stm/boards/STM32F405_boot.ld index 5768d1a01e..0b0e1a5f34 100644 --- a/ports/stm/boards/STM32F405_boot.ld +++ b/ports/stm/boards/STM32F405_boot.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_default.ld b/ports/stm/boards/STM32F405_default.ld index 4c11fd7cf3..39255ff7a0 100644 --- a/ports/stm/boards/STM32F405_default.ld +++ b/ports/stm/boards/STM32F405_default.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F405_fs.ld b/ports/stm/boards/STM32F405_fs.ld index e6c66127fb..d6de1a08b6 100644 --- a/ports/stm/boards/STM32F405_fs.ld +++ b/ports/stm/boards/STM32F405_fs.ld @@ -25,4 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F407_fs.ld b/ports/stm/boards/STM32F407_fs.ld index f06c19d992..293ac6ff56 100644 --- a/ports/stm/boards/STM32F407_fs.ld +++ b/ports/stm/boards/STM32F407_fs.ld @@ -25,4 +25,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F411_fs.ld b/ports/stm/boards/STM32F411_fs.ld index 1b45f235fa..69b98cf825 100644 --- a/ports/stm/boards/STM32F411_fs.ld +++ b/ports/stm/boards/STM32F411_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F412_fs.ld b/ports/stm/boards/STM32F412_fs.ld index 8837bd87d6..d3ad291a2b 100644 --- a/ports/stm/boards/STM32F412_fs.ld +++ b/ports/stm/boards/STM32F412_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index be10a14294..6c9ea4de31 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -49,4 +49,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 25322b0b6f..2feb422257 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -24,4 +24,3 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/STM32H743_fs.ld b/ports/stm/boards/STM32H743_fs.ld index b6c3d5b62d..ca69f0d8d1 100644 --- a/ports/stm/boards/STM32H743_fs.ld +++ b/ports/stm/boards/STM32H743_fs.ld @@ -36,4 +36,3 @@ _estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); - diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index ade3571a59..0c7efd01d4 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -1,4 +1,4 @@ -/* Memory layout for default case. +/* Memory layout for default case. FLASH_ISR .isr_vector FLASH_FIRMWARE .text @@ -96,4 +96,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index f948b94e10..91e453bfd9 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -106,4 +106,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 1a41853fe6..9e677862d3 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -133,7 +133,7 @@ SECTIONS . += _ld_default_stack_size; } > DTCM _ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM); - + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ports/stm/boards/espruino_pico/README.md b/ports/stm/boards/espruino_pico/README.md index 9f0321c474..86df1ad32a 100644 --- a/ports/stm/boards/espruino_pico/README.md +++ b/ports/stm/boards/espruino_pico/README.md @@ -6,10 +6,10 @@ The Espruino Pico is normally updated via a bootloader activated by the Espruino - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - **Mac**: install with Homebrew: `brew install dfu-util` - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - Hold down the Pico's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. -To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file +To reinstall Espruino, follow the same steps with the latest Espruino Pico binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index 890b1b88e7..5136fac224 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -37,4 +37,3 @@ #define BOARD_OSC_DIV (8) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) - diff --git a/ports/stm/boards/espruino_wifi/README.MD b/ports/stm/boards/espruino_wifi/README.MD index 8c2cd3be2b..cc78811f1c 100644 --- a/ports/stm/boards/espruino_wifi/README.MD +++ b/ports/stm/boards/espruino_wifi/README.MD @@ -6,10 +6,10 @@ The Espruino Wifi is normally updated via a bootloader activated by the Espruino - Install ST's DFU utility on Windows, or dfu-util for Mac or Linux - **Mac**: install with Homebrew: `brew install dfu-util` - **Linux**: install with apt-get: `sudo apt-get install dfu-util` - - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. + - **Windows**: download [ST's application](https://www.st.com/en/development-tools/stsw-stm32080.html) or install the Linux subsystem for Windows 10 and follow the linux instructions. - Hold down the Wifi's button while plugging it into USB (when overwriting Espruino's default firmware) - - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. - - Restart the board. + - Navigate to the same directory as your firmware.bin file for Circuitpython and run the following command: `sudo dfu-util -a 0 -s 0x08000000 -D firmware.bin` or use the ST utility on Windows. + - Restart the board. -To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. \ No newline at end of file +To reinstall Espruino, follow the same steps with the latest Espruino Wifi binary from espruino.com/binaries. This will reinstall the usual Espruino bootloader. You must un-short the BOOT0/BTN jumper to re-use the original Espruino Bootloader again. If you used a Pencil mark then you may need to use cleaning fluid and a small brush to totally clear out the graphite. diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index 70d0ea2bdf..ee82095ffd 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index 85ed18f4f6..d98bd29ec7 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -12,8 +12,7 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld -LD_DEFAULT = boards/STM32F405_default.ld +LD_COMMON = boards/common_default.ld +LD_DEFAULT = boards/STM32F405_default.ld LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option UF2_OFFSET = 0x8010000 - diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cd8d3b548e..cf60c89c26 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -15,7 +15,6 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld -LD_FILE = boards/STM32F401xe_boot.ld +LD_COMMON = boards/common_default.ld +LD_FILE = boards/STM32F401xe_boot.ld # LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash - diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 8a793d5709..f23f642e7e 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index c8c2a3d2b1..4e5e1bc7c8 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F767_fs.ld - diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index 01ace06a23..ea99a1e10b 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = H7 MCU_VARIANT = STM32H743xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32H743_fs.ld - diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 9a049ed2cf..2f26c6e71f 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -34,4 +34,3 @@ #define BOARD_OSC_DIV (12) #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) - diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index 242dac52cd..4ff0f18d54 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = H7 MCU_VARIANT = STM32H743xx MCU_PACKAGE = LQFP100_x7 -LD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32H743_fs.ld - diff --git a/ports/stm/boards/openmv_h7/openmv.csv b/ports/stm/boards/openmv_h7/openmv.csv index 9045e1ea2d..f9d4ebc400 100644 --- a/ports/stm/boards/openmv_h7/openmv.csv +++ b/ports/stm/boards/openmv_h7/openmv.csv @@ -23,4 +23,4 @@ I2C4_SDA,PD13 SPI2_NSS,PB12 SPI2_SCK,PB13 SPI2_MISO,PB14 -SPI2_MOSI,PB15 \ No newline at end of file +SPI2_MOSI,PB15 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 0a06852fb8..08a2668167 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -12,6 +12,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index 9d8b0f3f27..c0c0f5f6cd 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -10,6 +10,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F405xx MCU_PACKAGE = LQFP64 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F405_fs.ld - diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 62887c0289..0054232e1d 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -15,6 +15,5 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/stm32f411ce_blackpill/pins.c b/ports/stm/boards/stm32f411ce_blackpill/pins.c index aa9736fc4c..2f8aab6e8e 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/pins.c +++ b/ports/stm/boards/stm32f411ce_blackpill/pins.c @@ -33,7 +33,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index 761602acdf..ca2f10ba37 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -12,4 +12,3 @@ MCU_PACKAGE = LQFP100_f4 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F411_fs.ld - diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index 09e7bda85d..04d2a9b0d0 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -17,5 +17,3 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld - - diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 57a65f75ae..09652d9ad9 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -12,4 +12,3 @@ MCU_PACKAGE = LQFP100_f4 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F407_fs.ld - diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index 0b4ccc7604..ff8456df66 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = TFBGA216 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/system_stm32f4xx.c b/ports/stm/boards/system_stm32f4xx.c index caa4f9cafb..d8c745dbbd 100644 --- a/ports/stm/boards/system_stm32f4xx.c +++ b/ports/stm/boards/system_stm32f4xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2019 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -28,16 +28,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f4xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -79,8 +79,8 @@ /** @addtogroup stm32f4xx_system * @{ - */ - + */ + /** @addtogroup STM32F4xx_System_Private_Includes * @{ */ @@ -89,7 +89,7 @@ #include "stm32f4xx.h" #include "py/mpconfig.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -121,7 +121,7 @@ /* #define DATA_IN_ExtSRAM */ #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ STM32F412Zx || STM32F412Vx */ - + #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) /* #define DATA_IN_ExtSDRAM */ @@ -131,7 +131,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -153,7 +153,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -170,7 +170,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; */ #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - static void SystemInit_ExtMemCtl(void); + static void SystemInit_ExtMemCtl(void); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /** @@ -183,7 +183,7 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; /** * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory + * Initialize the FPU setting, vector table location and External memory * configuration. * @param None * @retval None @@ -214,7 +214,7 @@ void SystemInit(void) RCC->CIR = 0x00000000; #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); + SystemInit_ExtMemCtl(); #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /* Configure the Vector Table location add offset address ------------------*/ @@ -232,41 +232,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value * depends on the application requirements), user has to ensure that HSE_VALUE * is same as the real frequency of the crystal used. Otherwise, this function * may have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -282,10 +282,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -334,79 +334,79 @@ void SystemInit_ExtMemCtl(void) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; - + /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -414,50 +414,50 @@ void SystemInit_ExtMemCtl(void) tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ FMC_Bank5_6->SDCMR = 0x00000073; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ FMC_Bank5_6->SDCMR = 0x00046014; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) @@ -465,7 +465,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Configure and enable Bank1_SRAM2 */ FMC_Bank1->BTCR[2] = 0x00001091; @@ -473,7 +473,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1E->BWTR[2] = 0x0fffffff; #endif /* STM32F469xx || STM32F479xx */ - (void)(tmp); + (void)(tmp); } #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ #elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) @@ -499,13 +499,13 @@ void SystemInit_ExtMemCtl(void) clock */ RCC->AHB1ENR |= 0x0000007D; #else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface + /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ +#endif /* STM32F446xx */ /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - + #if defined(STM32F446xx) /* Connect PAx pins to FMC Alternate function */ GPIOA->AFR[0] |= 0xC0000000; @@ -535,78 +535,78 @@ void SystemInit_ExtMemCtl(void) /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x000000CC; GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ + /* Configure PDx pins speed to 50 MHz */ GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00000CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ + /* Configure PEx pins speed to 50 MHz */ GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0xCCCCCCCC; GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ + /* Configure PFx pins speed to 50 MHz */ GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0xCCCCCCCC; GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ + /* Configure PGx pins speed to 50 MHz */ GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ - || defined(STM32F469xx) || defined(STM32F479xx) + || defined(STM32F469xx) || defined(STM32F479xx) /* Connect PHx pins to FMC Alternate function */ GPIOH->AFR[0] = 0x00C0CC00; GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ + /* Configure PHx pins in Alternate function mode */ GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ + /* Configure PHx pins speed to 50 MHz */ GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ + /* Configure PHx pins Output type to push-pull */ GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ + /* No pull-up, pull-down for PHx pins */ GPIOH->PUPDR = 0x00000000; - + /* Connect PIx pins to FMC Alternate function */ GPIOI->AFR[0] = 0xCCCCCCCC; GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ + /* Configure PIx pins in Alternate function mode */ GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ + /* Configure PIx pins speed to 50 MHz */ GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ + /* Configure PIx pins Output type to push-pull */ GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ + /* No pull-up, pull-down for PIx pins */ GPIOI->PUPDR = 0x00000000; #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - + /*-- FMC Configuration -------------------------------------------------------*/ /* Enable the FMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -616,65 +616,65 @@ void SystemInit_ExtMemCtl(void) /* Configure and enable SDRAM bank1 */ #if defined(STM32F446xx) FMC_Bank5_6->SDCR[0] = 0x00001954; -#else +#else FMC_Bank5_6->SDCR[0] = 0x000019E4; #endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - + FMC_Bank5_6->SDTR[0] = 0x01115351; + /* SDRAM initialization sequence */ /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + FMC_Bank5_6->SDCMR = 0x00000011; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } /* Delay */ for (index = 0; index<1000; index++); - + /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; + FMC_Bank5_6->SDCMR = 0x00000012; timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* Auto refresh command */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x000000F3; -#else +#else FMC_Bank5_6->SDCMR = 0x00000073; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; } - + /* MRD register program */ #if defined(STM32F446xx) FMC_Bank5_6->SDCMR = 0x00044014; -#else +#else FMC_Bank5_6->SDCMR = 0x00046014; #endif /* STM32F446xx */ timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - + tmpreg = FMC_Bank5_6->SDSR & 0x00000020; + } + /* Set refresh count */ tmpreg = FMC_Bank5_6->SDRTR; #if defined(STM32F446xx) FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); -#else +#else FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); #endif /* STM32F446xx */ - + /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; + tmpreg = FMC_Bank5_6->SDCR[0]; FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); #endif /* DATA_IN_ExtSDRAM */ #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ @@ -689,55 +689,55 @@ void SystemInit_ExtMemCtl(void) RCC->AHB1ENR |= 0x00000078; /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - + /* Connect PDx pins to FMC Alternate function */ GPIOD->AFR[0] = 0x00CCC0CC; GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ + /* Configure PDx pins in Alternate function mode */ GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ + /* Configure PDx pins speed to 100 MHz */ GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ + /* Configure PDx pins Output type to push-pull */ GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ + /* No pull-up, pull-down for PDx pins */ GPIOD->PUPDR = 0x00000000; /* Connect PEx pins to FMC Alternate function */ GPIOE->AFR[0] = 0xC00CC0CC; GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ + /* Configure PEx pins in Alternate function mode */ GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ + /* Configure PEx pins speed to 100 MHz */ GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ + /* Configure PEx pins Output type to push-pull */ GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ + /* No pull-up, pull-down for PEx pins */ GPIOE->PUPDR = 0x00000000; /* Connect PFx pins to FMC Alternate function */ GPIOF->AFR[0] = 0x00CCCCCC; GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ + /* Configure PFx pins in Alternate function mode */ GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ + /* Configure PFx pins speed to 100 MHz */ GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ + /* Configure PFx pins Output type to push-pull */ GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ + /* No pull-up, pull-down for PFx pins */ GPIOF->PUPDR = 0x00000000; /* Connect PGx pins to FMC Alternate function */ GPIOG->AFR[0] = 0x00CCCCCC; GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ + /* Configure PGx pins in Alternate function mode */ GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ + /* Configure PGx pins speed to 100 MHz */ GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ + /* Configure PGx pins Output type to push-pull */ GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ + /* No pull-up, pull-down for PGx pins */ GPIOG->PUPDR = 0x00000000; - + /*-- FMC/FSMC Configuration --------------------------------------------------*/ /* Enable the FMC/FSMC interface clock */ RCC->AHB3ENR |= 0x00000001; @@ -749,7 +749,7 @@ void SystemInit_ExtMemCtl(void) FMC_Bank1->BTCR[2] = 0x00001011; FMC_Bank1->BTCR[3] = 0x00000201; FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ +#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ #if defined(STM32F469xx) || defined(STM32F479xx) /* Delay after an RCC peripheral clock enabling */ tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); @@ -770,8 +770,8 @@ void SystemInit_ExtMemCtl(void) #endif /* DATA_IN_ExtSRAM */ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); + STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ + (void)(tmp); } #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ /** diff --git a/ports/stm/boards/system_stm32f7xx.c b/ports/stm/boards/system_stm32f7xx.c index 184fefb36c..4aebc3d357 100644 --- a/ports/stm/boards/system_stm32f7xx.c +++ b/ports/stm/boards/system_stm32f7xx.c @@ -4,16 +4,16 @@ * @author MCD Application Team * @brief CMSIS Cortex-M7 Device Peripheral Access Layer System Source File. * - * This file provides two functions and one global variable to be called from + * This file provides two functions and one global variable to be called from * user application: - * - SystemInit(): This function is called at startup just after reset and + * - SystemInit(): This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f7xx.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick + * by the user application to setup the SysTick * timer or configure other parameters. - * + * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. @@ -39,15 +39,15 @@ /** @addtogroup stm32f7xx_system * @{ - */ - + */ + /** @addtogroup STM32F7xx_System_Private_Includes * @{ */ #include "stm32f7xx.h" -#if !defined (HSE_VALUE) +#if !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ #endif /* HSE_VALUE */ @@ -76,7 +76,7 @@ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. +#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /******************************************************************************/ @@ -99,7 +99,7 @@ /* This variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency Note: If you use this function to configure the system clock; then there is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. @@ -126,7 +126,7 @@ /** * @brief Setup the microcontroller system - * Initialize the Embedded Flash Interface, the PLL and update the + * Initialize the Embedded Flash Interface, the PLL and update the * SystemFrequency variable. * @param None * @retval None @@ -154,41 +154,41 @@ void SystemInit(void) * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. - * + * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: - * + * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * + * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * + * * (*) HSI_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * + * in voltage and temperature. + * * (**) HSE_VALUE is a constant defined in stm32f7xx_hal_conf.h file (default value * 25 MHz), user has to ensure that HSE_VALUE is same as the real * frequency of the crystal used. Otherwise, this function may * have wrong result. - * + * * - The result of this function could be not correct when using fractional * value for HSE crystal. - * + * * @param None * @retval None */ void SystemCoreClockUpdate(void) { uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - + /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; @@ -204,10 +204,10 @@ void SystemCoreClockUpdate(void) /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N SYSCLK = PLL_VCO / PLL_P - */ + */ pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - + if (pllsource != 0) { /* HSE used as PLL clock source */ @@ -216,7 +216,7 @@ void SystemCoreClockUpdate(void) else { /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); + pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); } pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; @@ -240,8 +240,8 @@ void SystemCoreClockUpdate(void) /** * @} */ - + /** * @} - */ + */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm/boards/system_stm32h7xx.c b/ports/stm/boards/system_stm32h7xx.c index 2132f26a0c..bbb0f821fb 100644 --- a/ports/stm/boards/system_stm32h7xx.c +++ b/ports/stm/boards/system_stm32h7xx.c @@ -1,6 +1,6 @@ /* * Taken from ST Cube library and modified. See below for original header. - * + * * Modifications copyright (c) 2020 Lucian Copeland for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/stm/boards/thunderpack/pins.c b/ports/stm/boards/thunderpack/pins.c index 559d9658e7..eed54eb3c8 100644 --- a/ports/stm/boards/thunderpack/pins.c +++ b/ports/stm/boards/thunderpack/pins.c @@ -10,7 +10,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) }, diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 0dc10c4e4c..86a932290a 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -280,7 +280,7 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->rx = NULL; } - + ringbuf_free(&self->ringbuf); } diff --git a/ports/stm/common-hal/nvm/ByteArray.c b/ports/stm/common-hal/nvm/ByteArray.c index 1aaf54653b..462d3aa9de 100644 --- a/ports/stm/common-hal/nvm/ByteArray.c +++ b/ports/stm/common-hal/nvm/ByteArray.c @@ -60,7 +60,7 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, return false; } } - + // Finish up HAL_FLASH_Lock(); return true; diff --git a/ports/stm/common-hal/os/__init__.c b/ports/stm/common-hal/os/__init__.c index eef58bfe22..84deb81759 100644 --- a/ports/stm/common-hal/os/__init__.c +++ b/ports/stm/common-hal/os/__init__.c @@ -92,4 +92,4 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { #else return false; #endif -} \ No newline at end of file +} diff --git a/ports/stm/common-hal/supervisor/Runtime.c b/ports/stm/common-hal/supervisor/Runtime.c index feab6987d8..ea663f897d 100755 --- a/ports/stm/common-hal/supervisor/Runtime.c +++ b/ports/stm/common-hal/supervisor/Runtime.c @@ -35,4 +35,3 @@ bool common_hal_get_serial_connected(void) { bool common_hal_get_serial_bytes_available(void) { return (bool) serial_bytes_available(); } - diff --git a/ports/stm/common-hal/supervisor/__init__.c b/ports/stm/common-hal/supervisor/__init__.c index ac88556b45..6dca35fb5a 100755 --- a/ports/stm/common-hal/supervisor/__init__.c +++ b/ports/stm/common-hal/supervisor/__init__.c @@ -37,4 +37,4 @@ const super_runtime_obj_t common_hal_supervisor_runtime_obj = { .base = { .type = &supervisor_runtime_type, }, -}; \ No newline at end of file +}; diff --git a/ports/stm/packages/LQFP100_f4.c b/ports/stm/packages/LQFP100_f4.c index 5bc0a5158e..9136b94951 100644 --- a/ports/stm/packages/LQFP100_f4.c +++ b/ports/stm/packages/LQFP100_f4.c @@ -114,4 +114,4 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { // VDD --------------------------------------------*/ }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP100_x7.c b/ports/stm/packages/LQFP100_x7.c index 23d89a8268..4d3d5f45ae 100644 --- a/ports/stm/packages/LQFP100_x7.c +++ b/ports/stm/packages/LQFP100_x7.c @@ -112,4 +112,4 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { // VDD --------------------------------------------*/ }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP144.c b/ports/stm/packages/LQFP144.c index 36683bb648..5e0d743d7e 100644 --- a/ports/stm/packages/LQFP144.c +++ b/ports/stm/packages/LQFP144.c @@ -154,6 +154,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) }, // PDR_ON -----------------------------------------*/ // VDD --------------------------------------------*/ - + }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/LQFP64.c b/ports/stm/packages/LQFP64.c index e6a492bc33..52ca27cd92 100644 --- a/ports/stm/packages/LQFP64.c +++ b/ports/stm/packages/LQFP64.c @@ -76,6 +76,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, // VSS --------------------------------------------*/ // VDD --------------------------------------------*/ - + }; MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/packages/UFQFPN48.c b/ports/stm/packages/UFQFPN48.c index ae4bcf6cda..5304482ec0 100644 --- a/ports/stm/packages/UFQFPN48.c +++ b/ports/stm/packages/UFQFPN48.c @@ -58,6 +58,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, // VSS --------------------------------------------*/ // VDD --------------------------------------------*/ - + }; -MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table); diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 316dbbec5c..34089c849a 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -51,8 +51,8 @@ typedef struct { // Timer Peripheral typedef struct { - uint8_t tim_index:4; - uint8_t altfn_index:4; + uint8_t tim_index:4; + uint8_t altfn_index:4; uint8_t channel_index:4; const mcu_pin_obj_t * pin; } mcu_tim_pin_obj_t; diff --git a/ports/stm/peripherals/pins.h b/ports/stm/peripherals/pins.h index 8f06d012ec..358313f565 100644 --- a/ports/stm/peripherals/pins.h +++ b/ports/stm/peripherals/pins.h @@ -39,7 +39,7 @@ typedef struct { mp_obj_base_t base; uint8_t port:4; uint8_t number:4; - uint8_t adc_unit:3; + uint8_t adc_unit:3; uint8_t adc_channel:5; } mcu_pin_obj_t; @@ -50,8 +50,8 @@ typedef struct { #define ADC_3 4 //STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, -//but all 3 ADCs will share the same input number per pin. -//F4 family has 3 ADC max, 24 channels max. +//but all 3 ADCs will share the same input number per pin. +//F4 family has 3 ADC max, 24 channels max. #define ADC_INPUT(mask, number) \ .adc_unit = mask, \ .adc_channel = number, @@ -63,7 +63,7 @@ typedef struct { extern const mp_obj_type_t mcu_pin_type; // STM32 can have up to 9 ports, each restricted to 16 pins -// We split the pin/port evenly, in contrast to nrf. +// We split the pin/port evenly, in contrast to nrf. #define PIN(p_port, p_number, p_adc) \ { \ { &mcu_pin_type }, \ diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c index 514bcc506e..d10fcbb6ff 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/gpio.c @@ -42,4 +42,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h index 334a14db57..ae416bda1d 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[6]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c index eea2a1a1b3..ed89f0de6b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/pins.c @@ -120,4 +120,4 @@ const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c index a5f4eae78c..03fba62895 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/gpio.c @@ -48,12 +48,10 @@ void stm32_peripherals_gpio_init(void) { // never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h index 98b4fab9c2..df67a99d79 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c index 0f669f1c6c..4282741a84 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); @@ -91,7 +91,7 @@ const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h index b3e5e3344d..e722b6e5ae 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/pins.h @@ -38,17 +38,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -69,13 +69,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c index a5f4eae78c..03fba62895 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/gpio.c @@ -48,12 +48,10 @@ void stm32_peripherals_gpio_init(void) { // never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h index 15cbfb16d2..55c00ee936 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c index 0f669f1c6c..4282741a84 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1 -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); @@ -91,7 +91,7 @@ const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); +const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC); const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h index 109dcb9226..a247fe6312 100644 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/pins.h @@ -38,17 +38,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -69,13 +69,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c index 9aabffa9f6..08c6b55cde 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/gpio.c @@ -56,5 +56,3 @@ void stm32_peripherals_gpio_init(void) { //LEDs are inverted on F411 DISCO void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { } - - diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h index 2c5e5dd564..14a73d12f1 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/periph.h @@ -54,4 +54,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[7]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c index eea2a1a1b3..ed89f0de6b 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/pins.c @@ -120,4 +120,4 @@ const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c index 3ec1b5b795..5ca4667a43 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/gpio.c @@ -49,6 +49,6 @@ void stm32_peripherals_gpio_init(void) { //never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array - // never_reset_pin_number(5,0); //PH0 JTDO + // never_reset_pin_number(5,0); //PH0 JTDO // never_reset_pin_number(5,1); //PH1 JTRST } diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h index f668ace752..f6b001a4e9 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/periph.h @@ -55,4 +55,4 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12]; TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c index ef3ce6d0ed..c1b624f4d5 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.c @@ -38,17 +38,17 @@ const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT -const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC); // 144 only const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); @@ -71,14 +71,14 @@ const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); -const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only -const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only +const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h index 5cf99345ce..8914530d2c 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/pins.h @@ -37,17 +37,17 @@ extern const mcu_pin_obj_t pin_PC13; extern const mcu_pin_obj_t pin_PC14; //pg 51 extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PF00; // 144 only -extern const mcu_pin_obj_t pin_PF01; // 144 only -extern const mcu_pin_obj_t pin_PF02; // 144 only -extern const mcu_pin_obj_t pin_PF03; // 144 only -extern const mcu_pin_obj_t pin_PF04; // 144 only -extern const mcu_pin_obj_t pin_PF05; // 144 only -extern const mcu_pin_obj_t pin_PF06; // 144 only -extern const mcu_pin_obj_t pin_PF07; // 144 only -extern const mcu_pin_obj_t pin_PF08; // 144 only -extern const mcu_pin_obj_t pin_PF09; // 144 only -extern const mcu_pin_obj_t pin_PF10; // 144 only +extern const mcu_pin_obj_t pin_PF00; // 144 only +extern const mcu_pin_obj_t pin_PF01; // 144 only +extern const mcu_pin_obj_t pin_PF02; // 144 only +extern const mcu_pin_obj_t pin_PF03; // 144 only +extern const mcu_pin_obj_t pin_PF04; // 144 only +extern const mcu_pin_obj_t pin_PF05; // 144 only +extern const mcu_pin_obj_t pin_PF06; // 144 only +extern const mcu_pin_obj_t pin_PF07; // 144 only +extern const mcu_pin_obj_t pin_PF08; // 144 only +extern const mcu_pin_obj_t pin_PF09; // 144 only +extern const mcu_pin_obj_t pin_PF10; // 144 only //pg 52 extern const mcu_pin_obj_t pin_PC00; extern const mcu_pin_obj_t pin_PC01; @@ -68,13 +68,13 @@ extern const mcu_pin_obj_t pin_PC05; extern const mcu_pin_obj_t pin_PB00; extern const mcu_pin_obj_t pin_PB01; extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PF11; // 144 only -extern const mcu_pin_obj_t pin_PF12; // 144 only -extern const mcu_pin_obj_t pin_PF13; // 144 only -extern const mcu_pin_obj_t pin_PF14; // 144 only -extern const mcu_pin_obj_t pin_PF15; // 144 only -extern const mcu_pin_obj_t pin_PG00; // 144 only -extern const mcu_pin_obj_t pin_PG01; // 144 only +extern const mcu_pin_obj_t pin_PF11; // 144 only +extern const mcu_pin_obj_t pin_PF12; // 144 only +extern const mcu_pin_obj_t pin_PF13; // 144 only +extern const mcu_pin_obj_t pin_PF14; // 144 only +extern const mcu_pin_obj_t pin_PF15; // 144 only +extern const mcu_pin_obj_t pin_PG00; // 144 only +extern const mcu_pin_obj_t pin_PG01; // 144 only //pg 55 extern const mcu_pin_obj_t pin_PE07; extern const mcu_pin_obj_t pin_PE08; diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c index cee4b4f457..ca64428eb0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/gpio.c @@ -50,4 +50,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(7,0); //PH0 OSC_IN never_reset_pin_number(7,1); //PH1 OSC_OUT } - diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c index 895ad5ec0d..ae940c1a05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c index d51ff53c1f..1189948c77 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/gpio.c @@ -44,5 +44,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - - diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h index 98aa5782a8..438964c3e1 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/periph.h @@ -54,4 +54,4 @@ TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F767XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c index 870545f994..5c9daea982 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c index d51ff53c1f..1189948c77 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/gpio.c @@ -44,5 +44,3 @@ void stm32_peripherals_gpio_init(void) { never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK } - - diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h index 4b852413b3..9aa2f7366b 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/periph.h @@ -52,4 +52,4 @@ const mcu_periph_obj_t mcu_uart_rx_list[26]; #define TIM_PIN_ARRAY_LEN 58 TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H \ No newline at end of file +#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32H743XX_PERIPH_H diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c index 491fe69385..7484781c2b 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/pins.c @@ -28,7 +28,7 @@ #include "py/mphal.h" #include "peripherals/pins.h" -// Todo: some pins do have ADCs, but the module isn't set up yet. +// Todo: some pins do have ADCs, but the module isn't set up yet. const mcu_pin_obj_t pin_PA00 = PIN(0, 0, NO_ADC); const mcu_pin_obj_t pin_PA01 = PIN(0, 1, NO_ADC); diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 060eadecb3..d37a54f60f 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -321,4 +321,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, void supervisor_flash_release_cache(void) { } - diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 9b62fa2eb1..dfe4c5ba2f 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -453,4 +453,3 @@ void _init(void) { } - diff --git a/ports/stm/supervisor/serial.c b/ports/stm/supervisor/serial.c index ce13660000..3a058ed2e1 100644 --- a/ports/stm/supervisor/serial.c +++ b/ports/stm/supervisor/serial.c @@ -72,4 +72,3 @@ void serial_write_substring(const char *text, uint32_t len) { } HAL_UART_Transmit(&huart2, (uint8_t*)text, len, 5000); } - diff --git a/ports/stm/tools/examples/nucleo_h743.csv b/ports/stm/tools/examples/nucleo_h743.csv index 2481415b30..d3647ca42a 100644 --- a/ports/stm/tools/examples/nucleo_h743.csv +++ b/ports/stm/tools/examples/nucleo_h743.csv @@ -127,4 +127,4 @@ ETH_RMII_RXD0,PC4 ETH_RMII_RXD1,PC5 ETH_RMII_TX_EN,PG11 ETH_RMII_TXD0,PG13 -ETH_RMII_TXD1,PB13 \ No newline at end of file +ETH_RMII_TXD1,PB13 diff --git a/ports/stm/tools/parse_af_csv.py b/ports/stm/tools/parse_af_csv.py index b257a450c2..4e97252602 100644 --- a/ports/stm/tools/parse_af_csv.py +++ b/ports/stm/tools/parse_af_csv.py @@ -28,8 +28,8 @@ import sys # Use: parse_af_csf.py Filename.csv -pins-only # Designed for use with .csv files from Micropython, or in identical format # created via Datasheet peripheral tables with a Sheets program. -# -# See examples/stm32f405.csv for example formatting. +# +# See examples/stm32f405.csv for example formatting. # Most peripherals (SPI, I2C) output 3 values: # peripheral index, alt function, pin string @@ -52,7 +52,7 @@ def evaluate_tim(inper, inlist, altfn, pin): if inper[:3] == "TIM" and inper[5:7] == "CH" and inper[-1:] != 'N': inlist.append([inper[3:4],altfn,inper[-1:],pin]) - + # Open target file with open(sys.argv[1]) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') @@ -107,7 +107,7 @@ with open(sys.argv[1]) as csv_file: print(" PERIPH(" + row[0] + ", " + str(row[1]) + ", &pin_" + row[2] + "),") print("};") - # Timer special case: + # Timer special case: print("const mcu_tim_pin_obj_t mcu_tim_pin_list[" + str(len(outlist[-1])) + "] = {") for row in outlist[-1]: print(" TIM(" + row[0] + ", " + str(row[1]) + ", " + str(row[2]) + ", &pin_" + row[3] + "),") diff --git a/ports/stm/tools/parse_pins_csv.py b/ports/stm/tools/parse_pins_csv.py index b69b4791be..4ab3fc25c9 100644 --- a/ports/stm/tools/parse_pins_csv.py +++ b/ports/stm/tools/parse_pins_csv.py @@ -25,12 +25,12 @@ import csv import sys -# Use: parse_pins_csv.py Filename.csv +# Use: parse_pins_csv.py Filename.csv # Designed for use with .csv files from Micropython, or in identical format # created via Datasheet peripheral tables with a Sheets program. -# -# See examples/nucleo_h743.csv for example formatting. - +# +# See examples/nucleo_h743.csv for example formatting. + # Open target file with open(sys.argv[1]) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') diff --git a/py/proto.h b/py/proto.h index 2d4f805659..fadf1f8822 100644 --- a/py/proto.h +++ b/py/proto.h @@ -40,4 +40,3 @@ const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj); #endif #endif - diff --git a/py/stackctrl.c b/py/stackctrl.c index 46cbefc8c1..26fc065b7d 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -77,7 +77,7 @@ void mp_stack_set_bottom(void* stack_bottom) { // // The stack_dummy approach used elsewhere in this file is not safe in // all cases. That value may be below the actual top of the stack. -static void* approx_stack_pointer(void){ +static void* approx_stack_pointer(void){ __asm volatile (""); return __builtin_frame_address(0); } @@ -90,7 +90,7 @@ void mp_stack_fill_with_sentinel(void) { // Continue until we've hit the bottom of the stack (lowest address, // logical "ceiling" of stack). char* p = (char *) approx_stack_pointer() - 1; - + while(p >= MP_STATE_THREAD(stack_bottom)) { *p-- = MP_MAX_STACK_USAGE_SENTINEL_BYTE; } diff --git a/py/stream.h b/py/stream.h index 543fe8c82a..dc9fc84c96 100644 --- a/py/stream.h +++ b/py/stream.h @@ -95,7 +95,7 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj); // Object is assumed to have a non-NULL stream protocol with valid r/w/ioctl methods static inline const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) { - return mp_proto_get(MP_QSTR_protocol_stream, self); + return mp_proto_get(MP_QSTR_protocol_stream, self); } const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags); diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 63a4eaa17e..c953951ea5 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -55,7 +55,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t //| //| When ``P`` (PWM duration) is present as the 4th character of the byteorder //| string, the 4th value in the tuple/list for a pixel is the individual pixel -//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each +//| brightness (0.0-1.0) and will enable a Dotstar compatible 1st byte for each //| pixel. //| //| :param ~int size: Number of pixels diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c index fa2a2c426e..80913b70ad 100644 --- a/shared-bindings/aesio/__init__.c +++ b/shared-bindings/aesio/__init__.c @@ -63,4 +63,3 @@ const mp_obj_module_t aesio_module = { .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&aesio_module_globals, }; - diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 505e9f7665..33d0bdd3cb 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -122,4 +122,3 @@ const mp_obj_type_t displayio_colorconverter_type = { .make_new = displayio_colorconverter_make_new, .locals_dict = (mp_obj_dict_t*)&displayio_colorconverter_locals_dict, }; - diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index 492423464a..3e58162bf2 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -48,4 +48,3 @@ const mp_obj_module_t framebufferio_module = { .globals = (mp_obj_dict_t*)&framebufferio_module_globals, }; #endif - diff --git a/shared-bindings/nvm/__init__.c b/shared-bindings/nvm/__init__.c index cdcc285dc4..e9784bd187 100644 --- a/shared-bindings/nvm/__init__.c +++ b/shared-bindings/nvm/__init__.c @@ -35,7 +35,7 @@ //| //| The `nvm` module allows you to store whatever raw bytes you wish in a //| reserved section non-volatile memory. -//| +//| //| Note that this module can't be imported and used directly. The sole //| instance of :class:`ByteArray` is available at //| :attr:`microcontroller.nvm`.""" diff --git a/shared-bindings/supervisor/__init__.h b/shared-bindings/supervisor/__init__.h index d2e5689452..b79bdacca3 100755 --- a/shared-bindings/supervisor/__init__.h +++ b/shared-bindings/supervisor/__init__.h @@ -36,4 +36,4 @@ extern const super_runtime_obj_t common_hal_supervisor_runtime_obj; -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR___INIT___H \ No newline at end of file +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR___INIT___H diff --git a/shared-bindings/ulab/approx/__init__.pyi b/shared-bindings/ulab/approx/__init__.pyi index 89f136f690..7e012690f3 100644 --- a/shared-bindings/ulab/approx/__init__.pyi +++ b/shared-bindings/ulab/approx/__init__.pyi @@ -7,7 +7,7 @@ def bisect(fun, a, b, *, xtol=2.4e-7, maxiter=100) -> float: :param float b: The right side of the interval :param float xtol: The tolerance value :param float maxiter: The maximum number of iterations to perform - + Find a solution (zero) of the function ``f(x)`` on the interval (``a``..``b``) using the bisection method. The result is accurate to within ``xtol`` unless more than ``maxiter`` steps are required.""" @@ -46,7 +46,6 @@ def interp(x: ulab.array, xp:ulab.array, fp:ulab.array, *, left=None, right=None :param ulab.array fp: The y-coordinates of the data points, same length as xp :param left: Value to return for ``x < xp[0]``, default is ``fp[0]``. :param right: Value to return for ``x > xp[-1]``, default is ``fp[-1]``. - + Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.""" ... - diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 6b5682e149..65923fd96a 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -72,4 +72,3 @@ const mp_obj_type_t vectorio_circle_type = { .make_new = vectorio_circle_make_new, .locals_dict = (mp_obj_dict_t*)&vectorio_circle_locals_dict, }; - diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 01045d098f..3443d9e426 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -92,4 +92,3 @@ const mp_obj_type_t vectorio_polygon_type = { .make_new = vectorio_polygon_make_new, .locals_dict = (mp_obj_dict_t*)&vectorio_polygon_locals_dict, }; - diff --git a/shared-bindings/wiznet/__init__.c b/shared-bindings/wiznet/__init__.c index 0b0b7b14b7..0d3f1e4cd6 100644 --- a/shared-bindings/wiznet/__init__.c +++ b/shared-bindings/wiznet/__init__.c @@ -52,4 +52,3 @@ const mp_obj_module_t wiznet_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&mp_module_wiznet_globals, }; - diff --git a/shared-module/_bleio/ScanResults.c b/shared-module/_bleio/ScanResults.c index ae36f8863d..cb48d636dc 100644 --- a/shared-module/_bleio/ScanResults.c +++ b/shared-module/_bleio/ScanResults.c @@ -56,7 +56,7 @@ mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { uint8_t type = ringbuf_get(&self->buf); bool connectable = (type & (1 << 0)) != 0; bool scan_response = (type & (1 << 1)) != 0; - uint64_t ticks_ms; + uint64_t ticks_ms; ringbuf_get_n(&self->buf, (uint8_t*) &ticks_ms, sizeof(ticks_ms)); uint8_t rssi = ringbuf_get(&self->buf); uint8_t peer_addr[NUM_BLEIO_ADDRESS_BYTES]; @@ -81,7 +81,7 @@ mp_obj_t common_hal_bleio_scanresults_next(bleio_scanresults_obj_t *self) { entry->time_received = ticks_ms; entry->connectable = connectable; entry->scan_response = scan_response; - + return MP_OBJ_FROM_PTR(entry); } diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c index 2c93eb69f7..0f1e12d9fd 100644 --- a/shared-module/_eve/__init__.c +++ b/shared-module/_eve/__init__.c @@ -314,4 +314,3 @@ void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, uint32_t y) { void common_hal__eve_Vertex2ii(common_hal__eve_t *eve, uint32_t x, uint32_t y, uint32_t handle, uint32_t cell) { C4(eve, ((2 << 30) | (((x) & 511) << 21) | (((y) & 511) << 12) | (((handle) & 31) << 7) | (((cell) & 127) << 0))); } - diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 2c9fb6d789..c2c3214aae 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -110,7 +110,7 @@ void common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *sel displayio_input_pixel_t input_pixel; input_pixel.pixel = input_color; input_pixel.x = input_pixel.y = input_pixel.tile = input_pixel.tile_x = input_pixel.tile_y = 0; - + displayio_output_pixel_t output_pixel; output_pixel.pixel = 0; output_pixel.opaque = false; @@ -130,7 +130,7 @@ bool common_hal_displayio_colorconverter_get_dither(displayio_colorconverter_t* void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _displayio_colorspace_t* colorspace, const displayio_input_pixel_t *input_pixel, displayio_output_pixel_t *output_color) { uint32_t pixel = input_pixel->pixel; - + if (self->dither){ uint8_t randr = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x,input_pixel->tile_y)); uint8_t randg = (displayio_colorconverter_dither_noise_2(input_pixel->tile_x+33,input_pixel->tile_y)); @@ -193,4 +193,3 @@ bool displayio_colorconverter_needs_refresh(displayio_colorconverter_t *self) { void displayio_colorconverter_finish_refresh(displayio_colorconverter_t *self) { } - diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 281c6fe90f..a3d877f1a9 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -170,7 +170,7 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t* self, brightness = 1.0-brightness; } bool ok = false; - + // Avoid PWM types and functions when the module isn't enabled #if (CIRCUITPY_PULSEIO) bool ispwm = (self->backlight_pwm.base.type == &pulseio_pwmout_type) ? true : false; @@ -413,7 +413,7 @@ void release_display(displayio_display_obj_t* self) { #if (CIRCUITPY_PULSEIO) if (self->backlight_pwm.base.type == &pulseio_pwmout_type) { common_hal_pulseio_pwmout_reset_ok(&self->backlight_pwm); - common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); + common_hal_pulseio_pwmout_deinit(&self->backlight_pwm); } else if (self->backlight_inout.base.type == &digitalio_digitalinout_type) { common_hal_digitalio_digitalinout_deinit(&self->backlight_inout); } diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index c4855c3331..2766cbecdc 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -435,7 +435,7 @@ bool displayio_tilegrid_fill_area(displayio_tilegrid_t *self, const _displayio_c } else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_ondiskbitmap_type)) { input_pixel.pixel = common_hal_displayio_ondiskbitmap_get_pixel(self->bitmap, input_pixel.tile_x, input_pixel.tile_y); } - + output_pixel.opaque = true; if (self->pixel_shader == mp_const_none) { output_pixel.pixel = input_pixel.pixel; diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 2a88b53070..f296da4095 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -57,7 +57,7 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu NULL, self->framebuffer_protocol->get_width(self->framebuffer), self->framebuffer_protocol->get_height(self->framebuffer), - ram_width, + ram_width, ram_height, 0, 0, diff --git a/shared-module/network/__init__.c b/shared-module/network/__init__.c index 925e9a2a30..a45191d8c8 100644 --- a/shared-module/network/__init__.c +++ b/shared-module/network/__init__.c @@ -37,7 +37,7 @@ #include "shared-module/network/__init__.h" -// mod_network_nic_list needs to be declared in mpconfigport.h +// mod_network_nic_list needs to be declared in mpconfigport.h void network_module_init(void) { @@ -47,7 +47,7 @@ void network_module_init(void) { void network_module_deinit(void) { for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); if (nic_type->deinit != NULL) nic_type->deinit(nic); } mp_obj_list_set_len(&MP_STATE_PORT(mod_network_nic_list), 0); @@ -61,7 +61,7 @@ void network_module_background(void) { for (mp_uint_t i = 0; i < MP_STATE_PORT(mod_network_nic_list).len; i++) { mp_obj_t nic = MP_STATE_PORT(mod_network_nic_list).items[i]; - mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); + mod_network_nic_type_t *nic_type = (mod_network_nic_type_t*)mp_obj_get_type(nic); if (nic_type->timer_tick != NULL) nic_type->timer_tick(nic); } } diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index df064ff81f..6dad91679f 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -206,4 +206,3 @@ int common_hal_rgbmatrix_rgbmatrix_get_height(rgbmatrix_rgbmatrix_obj_t* self) { int computed_height = (self->rgb_count / 3) << (self->addr_count); return computed_height; } - diff --git a/shared-module/ustack/__init__.c b/shared-module/ustack/__init__.c index 947f81f8e5..1e168ad6a0 100644 --- a/shared-module/ustack/__init__.c +++ b/shared-module/ustack/__init__.c @@ -49,4 +49,3 @@ uint32_t shared_module_ustack_stack_size() { uint32_t shared_module_ustack_stack_usage() { return mp_stack_usage(); } - diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 999d625121..73629b8cee 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -53,4 +53,3 @@ void common_hal_vectorio_circle_set_radius(void *obj, int16_t radius) { self->on_dirty.event(self->on_dirty.obj); } } - diff --git a/shared-module/vectorio/Circle.h b/shared-module/vectorio/Circle.h index 4b43d767ec..d6a77b1667 100644 --- a/shared-module/vectorio/Circle.h +++ b/shared-module/vectorio/Circle.h @@ -14,4 +14,3 @@ typedef struct { } vectorio_circle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H - diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index aadf47911a..0025d4bfc4 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -136,7 +136,7 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) { // Wind down, point is to the left of the edge vector --winding_number; - VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); + VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); } x1 = x2; @@ -144,4 +144,3 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) } return winding_number == 0 ? 0 : 1; } - diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index 7fabe6ff93..5d48cc6480 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -32,4 +32,3 @@ uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) { vectorio_rectangle_t *self = rectangle; return self->height; } - diff --git a/shared-module/vectorio/Rectangle.h b/shared-module/vectorio/Rectangle.h index c1f2a7a64e..56342a6d76 100644 --- a/shared-module/vectorio/Rectangle.h +++ b/shared-module/vectorio/Rectangle.h @@ -12,4 +12,3 @@ typedef struct { } vectorio_rectangle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H - diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 4fb353aae7..bfe8a7b259 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -191,7 +191,7 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ bool full_coverage = displayio_area_equal(area, &overlap); uint8_t pixels_per_byte = 8 / colorspace->depth; - + uint32_t linestride_px = displayio_area_width(area); uint32_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; uint32_t column_dirty_offset_px = overlap.x1 - area->x1; @@ -332,5 +332,3 @@ void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displ self->absolute_transform = group_transform == NULL ? &null_transform : group_transform; common_hal_vectorio_vector_shape_set_dirty(self); } - - diff --git a/shared-module/vectorio/__init__.c b/shared-module/vectorio/__init__.c index 473c509c3c..f5227ef01f 100644 --- a/shared-module/vectorio/__init__.c +++ b/shared-module/vectorio/__init__.c @@ -1,3 +1,2 @@ // Don't need anything in here yet - diff --git a/shared-module/vectorio/__init__.h b/shared-module/vectorio/__init__.h index 6ae381f067..8da85bba43 100644 --- a/shared-module/vectorio/__init__.h +++ b/shared-module/vectorio/__init__.h @@ -12,4 +12,3 @@ typedef struct { #endif - diff --git a/supervisor/shared/bluetooth.h b/supervisor/shared/bluetooth.h index 7ebcb953f0..1fb6a879a8 100644 --- a/supervisor/shared/bluetooth.h +++ b/supervisor/shared/bluetooth.h @@ -31,4 +31,4 @@ void supervisor_start_bluetooth(void); bool supervisor_bluetooth_hook(ble_evt_t *ble_evt); void supervisor_bluetooth_background(void); -#endif \ No newline at end of file +#endif diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 23516799fa..47395bd602 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -140,4 +140,3 @@ extern void supervisor_disable_tick(void) { } common_hal_mcu_enable_interrupts(); } - diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 5db6b5bc00..5a82f81f77 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -63,4 +63,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, void supervisor_flash_release_cache(void) { } - diff --git a/tests/basics/assign1.py b/tests/basics/assign1.py index 118747f74a..01047fa929 100644 --- a/tests/basics/assign1.py +++ b/tests/basics/assign1.py @@ -8,4 +8,3 @@ print(a, b) a = b = c = 3 print(a, b, c) - diff --git a/tests/basics/builtin_chr.py b/tests/basics/builtin_chr.py index 02d783ae66..c1a9f70530 100644 --- a/tests/basics/builtin_chr.py +++ b/tests/basics/builtin_chr.py @@ -6,4 +6,3 @@ try: chr(0x110000) except ValueError: print("ValueError") - diff --git a/tests/basics/dict_popitem.py b/tests/basics/dict_popitem.py index e37bcec19e..0e3384253f 100644 --- a/tests/basics/dict_popitem.py +++ b/tests/basics/dict_popitem.py @@ -13,4 +13,3 @@ except KeyError: else: print("Did not raise KeyError") print(sorted(els)) - diff --git a/tests/basics/dict_setdefault.py b/tests/basics/dict_setdefault.py index 57d0ba4518..87de5b3af5 100644 --- a/tests/basics/dict_setdefault.py +++ b/tests/basics/dict_setdefault.py @@ -9,5 +9,3 @@ d.pop(5) print(d.setdefault(5, 1)) print(d[1]) print(d[5]) - - diff --git a/tests/basics/gen_yield_from_throw.py b/tests/basics/gen_yield_from_throw.py index 829bf0f3b4..d6754d5cd1 100644 --- a/tests/basics/gen_yield_from_throw.py +++ b/tests/basics/gen_yield_from_throw.py @@ -21,7 +21,7 @@ except TypeError: def gen3(): yield 123 yield 456 - + g3 = gen3() print(next(g3)) try: diff --git a/tests/basics/gen_yield_from_throw2.py b/tests/basics/gen_yield_from_throw2.py index 0abfdd8cc3..5c0fc7dbc9 100644 --- a/tests/basics/gen_yield_from_throw2.py +++ b/tests/basics/gen_yield_from_throw2.py @@ -6,7 +6,7 @@ def gen(): except GeneratorExit: print('GeneratorExit') yield 456 - + # thrown a class g = gen() print(next(g)) diff --git a/tests/basics/int_big_and2.py b/tests/basics/int_big_and2.py index f8c81fe0cd..045a90ef75 100644 --- a/tests/basics/int_big_and2.py +++ b/tests/basics/int_big_and2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_and3.py b/tests/basics/int_big_and3.py index 788ecd823b..7a3b415af7 100644 --- a/tests/basics/int_big_and3.py +++ b/tests/basics/int_big_and3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or.py b/tests/basics/int_big_or.py index 17d9935265..ccded37781 100644 --- a/tests/basics/int_big_or.py +++ b/tests/basics/int_big_or.py @@ -3,7 +3,7 @@ print(0 | (1 << 80)) a = 0xfffffffffffffffffffffffffffff print(a | (1 << 200)) -# test + + +# test + + print(0 | (1 << 80)) print((1 << 80) | (1 << 80)) @@ -15,7 +15,7 @@ print(a | (1 << 200)) print(a | a == 0) print(bool(a | a)) -# test - + +# test - + print((-1 << 80) | (1 << 80)) print((-1 << 80) | 0) @@ -25,7 +25,7 @@ print((-a) | (1 << 200)) print((-a) | a == 0) print(bool((-a) | a)) -# test + - +# test + - print(0 | (-1 << 80)) print((1 << 80) | (-1 << 80)) @@ -35,7 +35,7 @@ print(a | (-1 << 200)) print(a | (-a) == 0) print(bool(a | (-a))) -# test - - +# test - - print((-1 << 80) | (-1 << 80)) diff --git a/tests/basics/int_big_or2.py b/tests/basics/int_big_or2.py index 255495150a..92d76c7703 100644 --- a/tests/basics/int_big_or2.py +++ b/tests/basics/int_big_or2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -23,7 +23,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or3.py b/tests/basics/int_big_or3.py index 07edaea2df..212b3da8a6 100644 --- a/tests/basics/int_big_or3.py +++ b/tests/basics/int_big_or3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor.py b/tests/basics/int_big_xor.py index cd1d9ae97f..28b191d3d9 100644 --- a/tests/basics/int_big_xor.py +++ b/tests/basics/int_big_xor.py @@ -1,4 +1,4 @@ -# test + + +# test + + print(0 ^ (1 << 80)) print((1 << 80) ^ (1 << 80)) @@ -10,7 +10,7 @@ print(a ^ (1 << 200)) print(a ^ a == 0) print(bool(a ^ a)) -# test - + +# test - + print((-1 << 80) ^ (1 << 80)) print((-1 << 80) ^ 0) @@ -22,7 +22,7 @@ print(bool((-a) ^ a)) i = -1 print(i ^ 0xffffffffffffffff) # carry overflows to higher digit -# test + - +# test + - print(0 ^ (-1 << 80)) print((1 << 80) ^ (-1 << 80)) @@ -32,7 +32,7 @@ print(a ^ (-1 << 200)) print(a ^ (-a) == 0) print(bool(a ^ (-a))) -# test - - +# test - - print((-1 << 80) ^ (-1 << 80)) diff --git a/tests/basics/int_big_xor2.py b/tests/basics/int_big_xor2.py index b5b3db60c6..21ef842f86 100644 --- a/tests/basics/int_big_xor2.py +++ b/tests/basics/int_big_xor2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor3.py b/tests/basics/int_big_xor3.py index 00881e3740..ff5e9aeff2 100644 --- a/tests/basics/int_big_xor3.py +++ b/tests/basics/int_big_xor3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/set_iter.py b/tests/basics/set_iter.py index 2960177303..e7da28e1b5 100644 --- a/tests/basics/set_iter.py +++ b/tests/basics/set_iter.py @@ -2,4 +2,3 @@ s = {1, 2, 3, 4} l = list(s) l.sort() print(l) - diff --git a/tests/basics/string_cr_conversion.py b/tests/basics/string_cr_conversion.py index 0c3ba16b86..b8ec7e8259 100644 --- a/tests/basics/string_cr_conversion.py +++ b/tests/basics/string_cr_conversion.py @@ -1 +1 @@ -# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) \ No newline at end of file +# this file has CR line endings to test lexer's conversion of them to LF # in triple quoted strings print(repr("""abc def""")) diff --git a/tests/basics/subscr_tuple.py b/tests/basics/subscr_tuple.py index 85d25366da..0210e24df8 100644 --- a/tests/basics/subscr_tuple.py +++ b/tests/basics/subscr_tuple.py @@ -4,4 +4,3 @@ class Foo(tuple): foo = Foo((1,2)) foo[0] - diff --git a/tests/extmod/uctypes_array_assign_le.py b/tests/extmod/uctypes_array_assign_le.py index 6afa7e0a24..37c52388d6 100644 --- a/tests/extmod/uctypes_array_assign_le.py +++ b/tests/extmod/uctypes_array_assign_le.py @@ -55,4 +55,3 @@ assert hex(S.arr6[0]) == "0xaabbccdd" print(S.arr6[0] == S.arr8[0].l) assert S.arr6[0] == S.arr8[0].l - diff --git a/tests/extmod/uctypes_byteat.py b/tests/extmod/uctypes_byteat.py index ab2535db8f..784209f803 100644 --- a/tests/extmod/uctypes_byteat.py +++ b/tests/extmod/uctypes_byteat.py @@ -6,5 +6,5 @@ except ImportError: data = bytearray(b'01234567') -print(uctypes.bytes_at(uctypes.addressof(data), 4)) -print(uctypes.bytearray_at(uctypes.addressof(data), 4)) +print(uctypes.bytes_at(uctypes.addressof(data), 4)) +print(uctypes.bytearray_at(uctypes.addressof(data), 4)) diff --git a/tests/extmod/uctypes_error.py b/tests/extmod/uctypes_error.py index 95ba0fad44..2500e29278 100644 --- a/tests/extmod/uctypes_error.py +++ b/tests/extmod/uctypes_error.py @@ -9,29 +9,29 @@ except ImportError: data = bytearray(b"01234567") # del subscr not supported -S = uctypes.struct(uctypes.addressof(data), {}) +S = uctypes.struct(uctypes.addressof(data), {}) try: del S[0] except TypeError: print('TypeError') # list is an invalid descriptor -S = uctypes.struct(uctypes.addressof(data), []) +S = uctypes.struct(uctypes.addressof(data), []) try: - S.x + S.x except TypeError: print('TypeError') # can't access attribute with invalid descriptor S = uctypes.struct(uctypes.addressof(data), {'x':[]}) try: - S.x + S.x except TypeError: print('TypeError') # can't assign to aggregate S = uctypes.struct(uctypes.addressof(data), {'x':(uctypes.ARRAY | 0, uctypes.INT8 | 2)}) try: - S.x = 1 + S.x = 1 except TypeError: print('TypeError') diff --git a/tests/extmod/ujson_dump_iobase.py b/tests/extmod/ujson_dump_iobase.py index d30d1b561e..6280fb11b6 100644 --- a/tests/extmod/ujson_dump_iobase.py +++ b/tests/extmod/ujson_dump_iobase.py @@ -28,5 +28,5 @@ class S(io.IOBase): # dump to the user stream s = S() -json.dump([123, {}], s) +json.dump([123, {}], s) print(s.buf) diff --git a/tests/extmod/ure_sub.py b/tests/extmod/ure_sub.py index 4aeb8650a1..f5a19af8db 100644 --- a/tests/extmod/ure_sub.py +++ b/tests/extmod/ure_sub.py @@ -27,11 +27,11 @@ print(re.sub('a', A(), 'aBCBABCDabcda.')) print( re.sub( - r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', - 'static PyObject*\npy_\\1(void){\n return;\n}\n', + r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', + 'static PyObject*\npy_\\1(void){\n return;\n}\n', '\n\ndef myfunc():\n\ndef myfunc1():\n\ndef myfunc2():' ) -) +) print( re.compile( diff --git a/tests/feature_check/complex.py b/tests/feature_check/complex.py index a22eb52ce3..7576dcb953 100644 --- a/tests/feature_check/complex.py +++ b/tests/feature_check/complex.py @@ -3,4 +3,3 @@ try: print("complex") except NameError: print("no") - diff --git a/tests/float/builtin_float_minmax.py b/tests/float/builtin_float_minmax.py index 266ed133d5..8a53746e5d 100644 --- a/tests/float/builtin_float_minmax.py +++ b/tests/float/builtin_float_minmax.py @@ -29,4 +29,3 @@ print(min([1, 2.9, 4, 6.5, -1, 2])) print(max([1, 2.9, 4, 6.5, -1, 2])) print(min([1, 2.9, 4, -6.5, -1, 2])) print(max([1, 2.9, 4, -6.5, -1, 2])) - diff --git a/tests/float/float_struct.py b/tests/float/float_struct.py index c4c186b89e..dd7a418ad5 100644 --- a/tests/float/float_struct.py +++ b/tests/float/float_struct.py @@ -15,4 +15,3 @@ for fmt in ('f', 'd', '>f', '>d', ' Date: Sat, 30 May 2020 10:44:57 +0100 Subject: [PATCH 764/919] Add a pre-commit configuration to enforce basic file hygiene. --- .github/workflows/pre-commit.yml | 24 ++++++++++++++++++++++++ .pre-commit-config.yaml | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000000..116829296d --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2019 Anthony Sottile +# +# SPDX-License-Identifier: MIT + +name: pre-commit + +on: + pull_request: + push: + branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - name: set PY + run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: pre-commit/action@v1.1.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..7c41ca3ce8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' + - id: trailing-whitespace + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' From c93ccd1e918b58b68dfdb783b3770233e884c32b Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 3 Jun 2020 12:04:40 -0400 Subject: [PATCH 765/919] Disable pin resets on the 1060 --- ports/mimxrt10xx/boards/teensy41/board.c | 1 + ports/mimxrt10xx/supervisor/port.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index f9dea01f70..28786ab902 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -27,6 +27,7 @@ #include "boards/board.h" #include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" void board_init(void) { // FLEX flash diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index acec3cf727..40d28d2ef8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,7 +306,9 @@ void reset_port(void) { //reset_event_system(); + #if !defined (MIMXRT1062_SERIES) reset_all_pins(); + #endif } void reset_to_bootloader(void) { From 660081ece233b7c9caaa15fd63dcdeba50081443 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 17:28:08 -0500 Subject: [PATCH 766/919] tools/cpboard.py: change 'async' variable usage; 'async' became a keyword in CPython 3.7 --- tools/cpboard.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 0b9c43c614..7bb6daaeb5 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -118,7 +118,7 @@ class REPL: self.write(b'\r' + REPL.CHAR_CTRL_B) # enter or reset friendly repl data = self.read_until(b'>>> ') - def execute(self, code, timeout=10, async=False): + def execute(self, code, timeout=10, wait_for_response=False): self.read() # Throw away self.write(REPL.CHAR_CTRL_A) @@ -127,7 +127,7 @@ class REPL: self.write(code) self.write(REPL.CHAR_CTRL_D) - if async: + if wait_for_response: return b'', b'' self.read_until(b'OK') @@ -424,10 +424,11 @@ class CPboard: self.serial.close() self.serial = None - def exec(self, command, timeout=10, async=False): + def exec(self, command, timeout=10, wait_for_response=False): with self.repl as repl: try: - output, error = repl.execute(command, timeout=timeout, async=async) + output, error = repl.execute(command, timeout=timeout, + wait_for_response=wait_for_response) except OSError as e: if self.debug: print('exec: session: ', self.repl.session) @@ -451,7 +452,8 @@ class CPboard: def _reset(self, mode='NORMAL'): self.exec("import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" % mode) try: - self.exec("import microcontroller;microcontroller.reset()", async=True) + self.exec("import microcontroller;microcontroller.reset()", + wait_for_response=True) except OSError: pass From cf9da5982996f0eab8b0cb1ff4559050533db905 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 17:39:31 -0500 Subject: [PATCH 767/919] tools/cpboard.py: update pyserial usage to match 3.x version --- tools/cpboard.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 7bb6daaeb5..8c60077c2c 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -73,8 +73,8 @@ class REPL: return self.board.serial def read(self): - if self.serial.inWaiting(): - data = self.serial.read(self.serial.inWaiting()) + if self.serial.in_waiting: + data = self.serial.read(self.serial.in_waiting) else: data = b'' self.session += data @@ -86,7 +86,7 @@ class REPL: while True: if data.endswith(ending): break - elif self.serial.inWaiting() > 0: + elif self.serial.in_waiting > 0: new_data = self.serial.read(1) data += new_data self.session += new_data @@ -401,7 +401,10 @@ class CPboard: delayed = False for attempt in range(wait + 1): try: - self.serial = serial.Serial(self.device, baudrate=self.baudrate, timeout=self.timeout, write_timeout=self.timeout, interCharTimeout=1) + self.serial = serial.Serial(self.device, baudrate=self.baudrate, + timeout=self.timeout, + inter_byte_timeout=10, + write_timeout=self.timeout) break except (OSError, IOError): # Py2 and Py3 have different errors if wait == 0: From 074697a89fa78e749971df5824c97e48839e4ffc Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 18:01:12 -0500 Subject: [PATCH 768/919] tools/cpboard.py: run black formatter --- tools/cpboard.py | 350 +++++++++++++++++++++++++++-------------------- 1 file changed, 201 insertions(+), 149 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index 8c60077c2c..e5a29ab254 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -39,27 +39,34 @@ import serial.tools.list_ports import sh import shutil + class CPboardError(BaseException): pass + # supervisor/messages/default.h: MSG_NEWLINE = b"\r\n" MSG_SAFE_MODE_CRASH = b"Looks like our core CircuitPython code crashed hard. Whoops!" -MSG_SAFE_MODE_BROWN_OUT_LINE_1 = b"The microcontroller's power dipped. Please make sure your power supply provides" -MSG_SAFE_MODE_BROWN_OUT_LINE_2 = b"enough power for the whole circuit and press reset (after ejecting CIRCUITPY)." +MSG_SAFE_MODE_BROWN_OUT_LINE_1 = ( + b"The microcontroller's power dipped. Please make sure your power supply provides" +) +MSG_SAFE_MODE_BROWN_OUT_LINE_2 = ( + b"enough power for the whole circuit and press reset (after ejecting CIRCUITPY)." +) MSG_WAIT_BEFORE_REPL = b"Press any key to enter the REPL. Use CTRL-D to reload." + class REPL: - CHAR_CTRL_A = b'\x01' - CHAR_CTRL_B = b'\x02' - CHAR_CTRL_C = b'\x03' - CHAR_CTRL_D = b'\x04' + CHAR_CTRL_A = b"\x01" + CHAR_CTRL_B = b"\x02" + CHAR_CTRL_C = b"\x03" + CHAR_CTRL_D = b"\x04" def __init__(self, board): self.board = board self.write_chunk_size = 32 self.safe_mode = False - self.session = b'' + self.session = b"" def __enter__(self): self.reset() @@ -76,12 +83,12 @@ class REPL: if self.serial.in_waiting: data = self.serial.read(self.serial.in_waiting) else: - data = b'' + data = b"" self.session += data return data def read_until(self, ending, timeout=10): - data = b'' + data = b"" timeout_count = 0 while True: if data.endswith(ending): @@ -102,10 +109,10 @@ class REPL: if chunk_size is None: chunk_size = self.write_chunk_size if not isinstance(data, bytes): - data = bytes(data, encoding='utf8') + data = bytes(data, encoding="utf8") for i in range(0, len(data), chunk_size): - chunk = data[i:min(i + chunk_size, len(data))] + chunk = data[i : min(i + chunk_size, len(data))] self.session += chunk self.serial.write(chunk) time.sleep(0.01) @@ -113,28 +120,30 @@ class REPL: def reset(self): # Use read() since serial.reset_input_buffer() fails with termios.error now and then self.read() - self.session = b'' - self.write(b'\r' + REPL.CHAR_CTRL_C + REPL.CHAR_CTRL_C) # interrupt any running program - self.write(b'\r' + REPL.CHAR_CTRL_B) # enter or reset friendly repl - data = self.read_until(b'>>> ') + self.session = b"" + self.write( + b"\r" + REPL.CHAR_CTRL_C + REPL.CHAR_CTRL_C + ) # interrupt any running program + self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl + data = self.read_until(b">>> ") def execute(self, code, timeout=10, wait_for_response=False): - self.read() # Throw away + self.read() # Throw away self.write(REPL.CHAR_CTRL_A) - self.read_until(b'\r\n>') + self.read_until(b"\r\n>") self.write(code) self.write(REPL.CHAR_CTRL_D) if wait_for_response: - return b'', b'' - self.read_until(b'OK') + return b"", b"" + self.read_until(b"OK") - output = self.read_until(b'\x04', timeout=timeout) + output = self.read_until(b"\x04", timeout=timeout) output = output[:-1] - error = self.read_until(b'\x04') + error = self.read_until(b"\x04") error = error[:-1] return output, error @@ -146,8 +155,8 @@ class REPL: self.reset() self.write(REPL.CHAR_CTRL_D) - data = self.read_until(b' output:\r\n') - if b'Running in safe mode' in data: + data = self.read_until(b" output:\r\n") + if b"Running in safe mode" in data: self.safe_mode = True raise RuntimeError("Can't run in safe mode") @@ -159,7 +168,7 @@ class REPL: data = data.split(marker)[0] # Haven't found out why we have to strip off this... - if data.endswith(b'\r\n\r\n'): + if data.endswith(b"\r\n\r\n"): data = data[:-4] return data @@ -168,9 +177,13 @@ class Disk: def __init__(self, dev): self.dev = os.path.realpath(dev) self.mountpoint = None - with open('/etc/mtab', 'r') as f: + with open("/etc/mtab", "r") as f: mtab = f.read() - mount = [mount.split(' ') for mount in mtab.splitlines() if mount.startswith(self.dev)] + mount = [ + mount.split(" ") + for mount in mtab.splitlines() + if mount.startswith(self.dev) + ] if mount: self._path = mount[0][1] else: @@ -245,22 +258,22 @@ class Firmware: @property def info(self): with self.disk as disk: - fname = os.path.join(disk.path, 'INFO_UF2.TXT') - with open(fname, 'r') as f: + fname = os.path.join(disk.path, "INFO_UF2.TXT") + with open(fname, "r") as f: info = f.read() lines = info.splitlines() res = {} - res['header'] = lines[0] + res["header"] = lines[0] for line in lines[1:]: - k, _, v = line.partition(':') - res[k.replace(':', '')] = v.strip() + k, _, v = line.partition(":") + res[k.replace(":", "")] = v.strip() return res def upload(self, fw): - with open(fw, 'rb') as f: + with open(fw, "rb") as f: header = f.read(32) - if header[0:4] != b'UF2\n': - raise ValueError('Only UF2 files are supported') + if header[0:4] != b"UF2\n": + raise ValueError("Only UF2 files are supported") self.board.close() with self.disk as disk: disk.copy(fw, sync=False) @@ -274,35 +287,37 @@ class CPboard: except ValueError: pass - vendor, _, product = name.partition(':') + vendor, _, product = name.partition(":") if vendor and product: - return CPboard.from_usb(**kwargs, idVendor=int(vendor, 16), idProduct=int(product, 16)) + return CPboard.from_usb( + **kwargs, idVendor=int(vendor, 16), idProduct=int(product, 16) + ) return CPboard(name, **kwargs) @classmethod def from_build_name(cls, name, **kwargs): boards = { - #'arduino_zero' - 'circuitplayground_express' : (0x239a, 0x8019), - #'feather_m0_adalogger' : (0x239a, ), - #'feather_m0_basic' : (0x239a, ), - 'feather_m0_express' : (0x239a, 0x8023), - #'feather_m0_rfm69' : (0x239a, ), - #'feather_m0_rfm9x' : (0x239a, ), - #'feather_m0_supersized' : (0x239a, ), - #'feather_m4_express' : (0x239a, ), - #'gemma_m0' : (0x239a, ), - #'itsybitsy_m0_express' : (0x239a, ), - #'itsybitsy_m4_express' : (0x239a, ), - 'metro_m0_express' : (0x239a, 0x8014), - 'metro_m4_express' : (0x239a, 0x8021), - #'metro_m4_express_revb' : (0x239a, ), - #'pirkey_m0' : (0x239a, ), - #'trinket_m0' : (0x239a, ), - #'trinket_m0_haxpress' : (0x239a, ), - #'ugame10' - } + #'arduino_zero' + "circuitplayground_express": (0x239A, 0x8019), + #'feather_m0_adalogger' : (0x239a, ), + #'feather_m0_basic' : (0x239a, ), + "feather_m0_express": (0x239A, 0x8023), + #'feather_m0_rfm69' : (0x239a, ), + #'feather_m0_rfm9x' : (0x239a, ), + #'feather_m0_supersized' : (0x239a, ), + #'feather_m4_express' : (0x239a, ), + #'gemma_m0' : (0x239a, ), + #'itsybitsy_m0_express' : (0x239a, ), + "itsybitsy_m4_express": (0x239A, 0x802C), + "metro_m0_express": (0x239A, 0x8014), + "metro_m4_express": (0x239A, 0x8021), + #'metro_m4_express_revb' : (0x239a, ), + #'pirkey_m0' : (0x239a, ), + #'trinket_m0' : (0x239a, ), + #'trinket_m0_haxpress' : (0x239a, ), + #'ugame10' + } try: vendor, product = boards[name] @@ -314,26 +329,26 @@ class CPboard: @classmethod def from_build_name_bootloader(cls, name, **kwargs): boards = { - #'arduino_zero' - #'circuitplayground_express' : (0x239a, ), - #'feather_m0_adalogger' : (0x239a, ), - #'feather_m0_basic' : (0x239a, ), - 'feather_m0_express' : (0x239a, 0x001b), - #'feather_m0_rfm69' : (0x239a, ), - #'feather_m0_rfm9x' : (0x239a, ), - #'feather_m0_supersized' : (0x239a, ), - #'feather_m4_express' : (0x239a, ), - #'gemma_m0' : (0x239a, ), - #'itsybitsy_m0_express' : (0x239a, ), - #'itsybitsy_m4_express' : (0x239a, ), - #'metro_m0_express' : (0x239a, 0x8014), - 'metro_m4_express' : (0x239a, 0x0021), - #'metro_m4_express_revb' : (0x239a, ), - #'pirkey_m0' : (0x239a, ), - #'trinket_m0' : (0x239a, ), - #'trinket_m0_haxpress' : (0x239a, ), - #'ugame10' - } + #'arduino_zero' + #'circuitplayground_express' : (0x239a, ), + #'feather_m0_adalogger' : (0x239a, ), + #'feather_m0_basic' : (0x239a, ), + "feather_m0_express": (0x239A, 0x001B), + #'feather_m0_rfm69' : (0x239a, ), + #'feather_m0_rfm9x' : (0x239a, ), + #'feather_m0_supersized' : (0x239a, ), + #'feather_m4_express' : (0x239a, ), + #'gemma_m0' : (0x239a, ), + #'itsybitsy_m0_express' : (0x239a, ), + "itsybitsy_m4_express": (0x239A, 0x002B), + #'metro_m0_express' : (0x239a, 0x8014), + "metro_m4_express": (0x239A, 0x0021), + #'metro_m4_express_revb' : (0x239a, ), + #'pirkey_m0' : (0x239a, ), + #'trinket_m0' : (0x239a, ), + #'trinket_m0_haxpress' : (0x239a, ), + #'ugame10' + } try: vendor, product = boards[name] @@ -347,16 +362,17 @@ class CPboard: @classmethod def from_usb(cls, baudrate=115200, wait=0, timeout=10, **kwargs): import usb.core + dev = usb.core.find(**kwargs) if not dev: s = "Can't find USB device: " args = [] for x in kwargs.items(): try: - args.append('%s=0x%x' % x) + args.append("%s=0x%x" % x) except: - args.append('%s = %s' % x) - raise RuntimeError("Can't find USB device: " + ', '.join(args)) + args.append("%s = %s" % x) + raise RuntimeError("Can't find USB device: " + ", ".join(args)) return cls(dev, baudrate=baudrate, wait=wait, timeout=timeout) def __init__(self, device, baudrate=115200, wait=0, timeout=10): @@ -364,11 +380,15 @@ class CPboard: self.usb_dev = None try: # Is it a usb.core.Device? - portstr = ':' + '.'.join(map(str, device.port_numbers)) + ':' + portstr = ":" + ".".join(map(str, device.port_numbers)) + ":" except: pass else: - serials = [serial for serial in os.listdir("/dev/serial/by-path") if portstr in serial] + serials = [ + serial + for serial in os.listdir("/dev/serial/by-path") + if portstr in serial + ] if len(serials) != 1: raise RuntimeError("Can't find excatly one matching usb serial device") self.device = os.path.realpath("/dev/serial/by-path/" + serials[0]) @@ -401,26 +421,29 @@ class CPboard: delayed = False for attempt in range(wait + 1): try: - self.serial = serial.Serial(self.device, baudrate=self.baudrate, - timeout=self.timeout, - inter_byte_timeout=10, - write_timeout=self.timeout) + self.serial = serial.Serial( + self.device, + baudrate=self.baudrate, + timeout=self.timeout, + inter_byte_timeout=10, + write_timeout=self.timeout, + ) break - except (OSError, IOError): # Py2 and Py3 have different errors + except (OSError, IOError): # Py2 and Py3 have different errors if wait == 0: continue if attempt == 0: - sys.stdout.write('Waiting {} seconds for board '.format(wait)) + sys.stdout.write("Waiting {} seconds for board ".format(wait)) delayed = True time.sleep(1) - sys.stdout.write('.') + sys.stdout.write(".") sys.stdout.flush() else: if delayed: - print('') - raise CPboardError('failed to access ' + self.device) + print("") + raise CPboardError("failed to access " + self.device) if delayed: - print('') + print("") def close(self): if self.serial: @@ -430,38 +453,43 @@ class CPboard: def exec(self, command, timeout=10, wait_for_response=False): with self.repl as repl: try: - output, error = repl.execute(command, timeout=timeout, - wait_for_response=wait_for_response) + output, error = repl.execute( + command, timeout=timeout, wait_for_response=wait_for_response + ) except OSError as e: if self.debug: - print('exec: session: ', self.repl.session) - raise CPboardError('timeout', e) + print("exec: session: ", self.repl.session) + raise CPboardError("timeout", e) if error: - raise CPboardError('exception', output, error) + raise CPboardError("exception", output, error) return output def eval(self, expression, timeout=10): - command = 'print({})'.format(expression) + command = "print({})".format(expression) with self.repl as repl: output, error = repl.execute(command, timeout=timeout) if error: - raise CPboardError('exception', output, error) + raise CPboardError("exception", output, error) try: - res = eval(str(output, encoding='utf8')) + res = eval(str(output, encoding="utf8")) except: - raise CPboardError('failed to eval: %s' % output) + raise CPboardError("failed to eval: %s" % output) return res - def _reset(self, mode='NORMAL'): - self.exec("import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" % mode) + def _reset(self, mode="NORMAL"): + self.exec( + "import microcontroller;microcontroller.on_next_reset(microcontroller.RunMode.%s)" + % mode + ) try: - self.exec("import microcontroller;microcontroller.reset()", - wait_for_response=True) + self.exec( + "import microcontroller;microcontroller.reset()", wait_for_response=True + ) except OSError: pass def reset(self, safe_mode=False, delay=5, wait=10): - self._reset('SAFE_MODE' if safe_mode else 'NORMAL') + self._reset("SAFE_MODE" if safe_mode else "NORMAL") self.close() time.sleep(delay) self.open(wait) @@ -469,7 +497,7 @@ class CPboard: def reset_to_bootloader(self, repl=False): if repl: - self._reset('BOOTLOADER') + self._reset("BOOTLOADER") self.close() else: self.close() @@ -486,7 +514,7 @@ class CPboard: @property def serial_number(self): - try: # Permissions are needed to read the value + try: # Permissions are needed to read the value return self.usb_dev.serial_number except: pass @@ -495,18 +523,26 @@ class CPboard: def get_disks(self): if self.usb_dev: - portstr = ':' + '.'.join(map(str, self.usb_dev.port_numbers)) + ':' - return ["/dev/disk/by-path/" + disk for disk in os.listdir("/dev/disk/by-path") if portstr in disk] + portstr = ":" + ".".join(map(str, self.usb_dev.port_numbers)) + ":" + return [ + "/dev/disk/by-path/" + disk + for disk in os.listdir("/dev/disk/by-path") + if portstr in disk + ] serial = self.serial_number if not serial: raise RuntimeError("Serial number not found for: " + self.device) - return ["/dev/disk/by-id/" + disk for disk in os.listdir("/dev/disk/by-id") if serial in disk] + return [ + "/dev/disk/by-id/" + disk + for disk in os.listdir("/dev/disk/by-id") + if serial in disk + ] @property def disk(self): disks = self.get_disks() - part = [part for part in disks if 'part1' in part] + part = [part for part in disks if "part1" in part] if not part: raise RuntimeError("Disk not found for: " + self.device) @@ -518,13 +554,13 @@ class CPboard: def execfile_disk(self, filename): with self.disk as disk: - disk.copy(filename, 'code.py') + disk.copy(filename, "code.py") with self.repl as repl: try: output = repl.run() except OSError as e: - raise CPboardError('timeout', e) + raise CPboardError("timeout", e) except RuntimeError: if self.repl.safe_mode: raise PyboardError("Can't run in safe mode") @@ -534,10 +570,10 @@ class CPboard: return output def execfile(self, filename, timeout=10): - if os.environ.get('CPBOARD_EXEC_MODE') == 'disk': + if os.environ.get("CPBOARD_EXEC_MODE") == "disk": return self.execfile_disk(filename) else: - with open(filename, 'rb') as f: + with open(filename, "rb") as f: pyfile = f.read() return self.exec(pyfile, timeout=timeout) @@ -545,11 +581,14 @@ class CPboard: # Implement just enough to make tests/run-tests work PyboardError = CPboardError + class Pyboard: - def __init__(self, device, baudrate=115200, user='micro', password='python', wait=0): + def __init__( + self, device, baudrate=115200, user="micro", password="python", wait=0 + ): self.board = CPboard.from_try_all(device, baudrate=baudrate, wait=wait) with self.board.disk as disk: - disk.copy('skip_if.py') + disk.copy("skip_if.py") def close(self): self.board.close() @@ -563,12 +602,13 @@ class Pyboard: def eval_namedtuple(board, command): from collections import namedtuple + s = board.exec("print(%s)" % command) s = s.decode().strip() - items = [key.split('=') for key in s[1:-1].split(', ')] + items = [key.split("=") for key in s[1:-1].split(", ")] keys = [item[0] for item in items] vals = [item[1] for item in items] - nt = namedtuple('eval', keys) + nt = namedtuple("eval", keys) res = nt(*[eval(val) for val in vals]) return res @@ -576,14 +616,16 @@ def eval_namedtuple(board, command): def os_uname(board): return eval_namedtuple(board, "__import__('os').uname()") + def print_verbose(cargs, *args, **kwargs): if cargs.verbose: print(*args, flush=True, **kwargs) + def upload(args): try: board = CPboard.from_build_name_bootloader(args.board) - print_verbose(args, 'Board is already in the bootloader') + print_verbose(args, "Board is already in the bootloader") except (ValueError, RuntimeError): board = CPboard.from_try_all(args.board) @@ -591,29 +633,32 @@ def upload(args): if not (args.quiet or board.bootloader): board.open() - print('Current version:', os_uname(board).version, flush=True) + print("Current version:", os_uname(board).version, flush=True) if not board.bootloader: - print_verbose(args, 'Reset to bootloader...', end='') - board.reset_to_bootloader(repl=True) # Feather M0 Express doesn't respond to 1200 baud + print_verbose(args, "Reset to bootloader...", end="") + board.reset_to_bootloader( + repl=True + ) # Feather M0 Express doesn't respond to 1200 baud time.sleep(5) - print_verbose(args, 'done') + print_verbose(args, "done") - print_verbose(args, 'Bootloader:', board.firmware.info) + print_verbose(args, "Bootloader:", board.firmware.info) - print_verbose(args, 'Upload firmware...', end='') + print_verbose(args, "Upload firmware...", end="") board.firmware.upload(args.firmware) - print_verbose(args, 'done') + print_verbose(args, "done") - print_verbose(args, 'Wait for board...', end='') + print_verbose(args, "Wait for board...", end="") time.sleep(5) - print_verbose(args, 'done') + print_verbose(args, "done") if not args.quiet: if board.bootloader: board = CPboard.from_try_all(args.board) board.open(wait=10) - print('New version:', os_uname(board).version, flush=True) + print("New version:", os_uname(board).version, flush=True) + def print_error_exit(args, e): if args.debug: @@ -622,16 +667,20 @@ def print_error_exit(args, e): print(e, file=sys.stderr) sys.exit(1) + def main(): import argparse - cmd_parser = argparse.ArgumentParser(description='Circuit Python Board Tool') - cmd_parser.add_argument('board', help='build_name, vid:pid or /dev/tty') - cmd_parser.add_argument('-f', '--firmware', help='upload UF2 firmware file') - cmd_parser.add_argument('-c', '--command', help='program passed in as string') - cmd_parser.add_argument('--tty', action='store_true', help='print tty') - cmd_parser.add_argument('--verbose', '-v', action='count', default=0, help='be verbose') - cmd_parser.add_argument('-q', '--quiet', action='store_true', help='be quiet') - cmd_parser.add_argument('--debug', action='store_true', help='raise exceptions') + + cmd_parser = argparse.ArgumentParser(description="Circuit Python Board Tool") + cmd_parser.add_argument("board", help="build_name, vid:pid or /dev/tty") + cmd_parser.add_argument("-f", "--firmware", help="upload UF2 firmware file") + cmd_parser.add_argument("-c", "--command", help="program passed in as string") + cmd_parser.add_argument("--tty", action="store_true", help="print tty") + cmd_parser.add_argument( + "--verbose", "-v", action="count", default=0, help="be verbose" + ) + cmd_parser.add_argument("-q", "--quiet", action="store_true", help="be quiet") + cmd_parser.add_argument("--debug", action="store_true", help="raise exceptions") args = cmd_parser.parse_args() if args.quiet: @@ -653,9 +702,9 @@ def main(): raise if args.verbose: - exec_mode = os.environ.get('CPBOARD_EXEC_MODE') + exec_mode = os.environ.get("CPBOARD_EXEC_MODE") if exec_mode: - print('CPBOARD_EXEC_MODE =', exec_mode) + print("CPBOARD_EXEC_MODE =", exec_mode) # Make sure we can open serial try: @@ -672,18 +721,21 @@ def main(): print(b.eval(args.command)) else: with board as b: - print('Device: ', end='') + print("Device: ", end="") if b.usb_dev: - print('%04x:%04x on ' % (b.usb_dev.idVendor, b.usb_dev.idProduct), end='') + print( + "%04x:%04x on " % (b.usb_dev.idVendor, b.usb_dev.idProduct), end="" + ) print(b.device) - print('Serial number:', b.serial_number) + print("Serial number:", b.serial_number) uname = os_uname(b) - print('os.uname:') - print(' sysname:', uname.sysname) - print(' nodename:', uname.nodename) - print(' release:', uname.release) - print(' version:', uname.version) - print(' machine:', uname.machine) + print("os.uname:") + print(" sysname:", uname.sysname) + print(" nodename:", uname.nodename) + print(" release:", uname.release) + print(" version:", uname.version) + print(" machine:", uname.machine) + if __name__ == "__main__": main() From 1e7ff52bb738e02695b1b87f8e4644152a576508 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 3 Jun 2020 21:51:33 -0500 Subject: [PATCH 769/919] tools/cpboard.py: fix backwards logic of 'wait_for_response' in #3005 --- tools/cpboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cpboard.py b/tools/cpboard.py index e5a29ab254..7769cb4f46 100644 --- a/tools/cpboard.py +++ b/tools/cpboard.py @@ -127,7 +127,7 @@ class REPL: self.write(b"\r" + REPL.CHAR_CTRL_B) # enter or reset friendly repl data = self.read_until(b">>> ") - def execute(self, code, timeout=10, wait_for_response=False): + def execute(self, code, timeout=10, wait_for_response=True): self.read() # Throw away self.write(REPL.CHAR_CTRL_A) @@ -136,7 +136,7 @@ class REPL: self.write(code) self.write(REPL.CHAR_CTRL_D) - if wait_for_response: + if not wait_for_response: return b"", b"" self.read_until(b"OK") @@ -450,7 +450,7 @@ class CPboard: self.serial.close() self.serial = None - def exec(self, command, timeout=10, wait_for_response=False): + def exec(self, command, timeout=10, wait_for_response=True): with self.repl as repl: try: output, error = repl.execute( @@ -483,7 +483,7 @@ class CPboard: ) try: self.exec( - "import microcontroller;microcontroller.reset()", wait_for_response=True + "import microcontroller;microcontroller.reset()", wait_for_response=False ) except OSError: pass From d14e34449b5b70ea5e39938324e27af76498b0dd Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 2 Jun 2020 17:51:51 -0400 Subject: [PATCH 770/919] Rework LSE clock init, allow clock overrides --- ports/stm/Makefile | 4 +- .../stm/boards/espruino_pico/mpconfigboard.h | 3 +- .../stm/boards/espruino_wifi/mpconfigboard.h | 3 +- .../feather_stm32f405_express/mpconfigboard.h | 4 +- ports/stm/boards/meowbit_v121/mpconfigboard.h | 5 +- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 6 +- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 6 +- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 3 +- ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 3 +- ports/stm/boards/pyboard_v11/mpconfigboard.h | 5 +- .../stm32f411ce_blackpill/mpconfigboard.h | 4 +- .../stm32f411ve_discovery/mpconfigboard.h | 4 +- .../stm32f412zg_discovery/mpconfigboard.h | 5 +- .../boards/stm32f4_discovery/mpconfigboard.h | 3 +- .../stm32f746g_discovery/mpconfigboard.h | 15 ++- ports/stm/boards/thunderpack/mpconfigboard.h | 3 +- ports/stm/peripherals/stm32f4/clocks.c | 120 +++++++++++++++++ .../peripherals/stm32f4/stm32f401xe/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f401xe/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f405xx/clocks.c | 64 --------- .../peripherals/stm32f4/stm32f405xx/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f407xx/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f407xx/clocks.h | 63 +++++++++ .../peripherals/stm32f4/stm32f411xe/clocks.c | 62 --------- .../peripherals/stm32f4/stm32f411xe/clocks.h | 67 ++++++++++ .../peripherals/stm32f4/stm32f412zx/clocks.c | 75 ----------- .../peripherals/stm32f4/stm32f412zx/clocks.h | 66 ++++++++++ ports/stm/peripherals/stm32f7/clocks.c | 118 +++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.c | 96 -------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 63 +++++++++ .../peripherals/stm32f7/stm32f767xx/clocks.c | 66 ---------- .../peripherals/stm32f7/stm32f767xx/clocks.h | 63 +++++++++ ports/stm/peripherals/stm32h7/clocks.c | 123 ++++++++++++++++++ .../peripherals/stm32h7/stm32h743xx/clocks.c | 83 ------------ .../peripherals/stm32h7/stm32h743xx/clocks.h | 70 ++++++++++ ports/stm/supervisor/port.c | 60 +-------- 37 files changed, 926 insertions(+), 665 deletions(-) create mode 100644 ports/stm/peripherals/stm32f4/clocks.c delete mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h delete mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c create mode 100644 ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h create mode 100644 ports/stm/peripherals/stm32f7/clocks.c delete mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h delete mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c create mode 100644 ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h create mode 100644 ports/stm/peripherals/stm32h7/clocks.c delete mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c create mode 100644 ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h diff --git a/ports/stm/Makefile b/ports/stm/Makefile index bd69d6fd7a..a7b519ffcb 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -207,11 +207,11 @@ SRC_C += \ mphalport.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ + peripherals/stm32$(MCU_SERIES_LOWER)/clocks.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \ - peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/clocks.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/gpio.c \ peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/periph.c \ - packages/$(MCU_PACKAGE).c\ + packages/$(MCU_PACKAGE).c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ lib/oofatfs/ff.c \ diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index 890b1b88e7..12e24244ff 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -35,6 +35,7 @@ #define AUTORESET_DELAY_MS (500) #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.h b/ports/stm/boards/espruino_wifi/mpconfigboard.h index 80aae3ad42..b7f38f69be 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.h +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.h @@ -32,6 +32,7 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define BOARD_OVERWRITE_SWD (1) diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h index 8f8e245665..0d49748c84 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.h @@ -34,8 +34,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_PC00) -#define BOARD_OSC_DIV (12) -#define HSE_VALUE ((uint32_t)12000000U) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.h b/ports/stm/boards/meowbit_v121/mpconfigboard.h index 268a660159..106f25b15c 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.h +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.h @@ -35,10 +35,9 @@ #define AUTORESET_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000U) +#define LSE_VALUE ((uint32_t)32000U) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define HSE_VALUE ((uint32_t)12000000U) -#define LSE_VALUE ((uint32_t)32000U) #define BOARD_NO_VBUS_SENSE (1) #define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index cd2c61b919..c1f0d59b2d 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -33,8 +33,10 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 1dcb26f49e..21e0ef0ba4 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -32,5 +32,7 @@ #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 14c2dfe308..1ae7f81a47 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -31,5 +31,7 @@ #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 9a049ed2cf..300f38aff0 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -31,7 +31,6 @@ #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (12) -#define HSE_VALUE ((uint32_t)12000000) +#define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 721a91defc..7c1ab31e34 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -32,7 +32,8 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // On-board flash diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.h b/ports/stm/boards/pyboard_v11/mpconfigboard.h index 77fab2c69e..50a90c52b0 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.h @@ -32,10 +32,9 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (12) +#define HSE_VALUE ((uint32_t)12000000) +#define LSE_VALUE ((uint32_t)32000U) #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define HSE_VALUE ((uint32_t)12000000U) -#define LSE_VALUE ((uint32_t)32000U) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h index a21060a848..83a8bded39 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -32,11 +32,9 @@ #define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (25) +#define HSE_VALUE ((uint32_t)25000000) #define BOARD_NO_VBUS_SENSE (1) - #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) -#define HSE_VALUE ((uint32_t)25000000U) // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index 3956a365cf..0be43f4fb7 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,8 +32,8 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K -#define BOARD_OSC_DIV (8) - +#define HSE_VALUE ((uint32_t)8000000) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h index c0590b80c1..6b9ab64678 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.h @@ -32,8 +32,11 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +#define CPY_CLK_USB_USES_AUDIOPLL (1) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h index 6274345ade..44ee073780 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.h @@ -32,5 +32,6 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (8) +#define HSE_VALUE ((uint32_t)8000000) +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index cace54e9b0..1fa69182a6 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -34,12 +34,15 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define BOARD_OSC_DIV (25) -#define HSE_VALUE ((uint32_t)25000000) -#define BOARD_OSC_PLLN (400) -#define BOARD_OSC_PLLQ (9) +// Lower frequency to allow external RAM use +#define HSE_VALUE ((uint32_t)25000000) +#define LSE_VALUE ((uint32_t)32768) +#define CPY_CLK_PLLN (400) +#define CPY_CLK_PLLQ (9) +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) +#define CPY_CLK_USB_USES_AUDIOPLL (1) -#define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // TODO: enable this once LSE is fixed for H7/F7 +#define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define BOARD_FLASH_LATENCY FLASH_LATENCY_6 #define BOARD_NO_VBUS_SENSE 1 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 7102b12429..394fbfd84f 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -40,12 +40,11 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) -#define BOARD_OSC_DIV (24) +#define HSE_VALUE ((uint32_t)24000000U) #define BOARD_OVERWRITE_SWD (1) #define BOARD_NO_VBUS_SENSE (1) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) -#define HSE_VALUE ((uint32_t)24000000U) // Status LEDs #define MICROPY_HW_LED_STATUS (&pin_PA02) diff --git a/ports/stm/peripherals/stm32f4/clocks.c b/ports/stm/peripherals/stm32f4/clocks.c new file mode 100644 index 0000000000..7a16812b36 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/clocks.c @@ -0,0 +1,120 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +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(); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; + #if (CPY_CLK_USB_USES_AUDIOPLL) + RCC_OscInitStruct.PLL.PLLR = 2; // Unused but required by HAL + #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; + } + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) + // Not supported by all lines. Should always result in 48M. + PeriphClkInitStruct.PLLI2S.PLLI2SM = HSE_VALUE/1000000; + PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; + PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; + PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; + #endif + + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c deleted file mode 100644 index 194992e819..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h new file mode 100644 index 0000000000..be62370d88 --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F401 +// Line Type: Access Line +// Speed: 84MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE2) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef (CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV4) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_2) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c deleted file mode 100644 index f4c5830686..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.c +++ /dev/null @@ -1,64 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - // APB1 must always be on so that we can talk to the RTC for timing. - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - // TODO: Only turn on APB2 when it is needed to save power. - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h new file mode 100644 index 0000000000..87faec035d --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F405 +// Line Type: Foundation Line +// Speed: 168MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_5) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c deleted file mode 100644 index a545aaec56..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h new file mode 100644 index 0000000000..5894b4ae8b --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f407xx/clocks.h @@ -0,0 +1,63 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F407 +// Line Type: Foundation Line +// Speed: 168MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (336) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_5) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c deleted file mode 100644 index 194992e819..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.c +++ /dev/null @@ -1,62 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h new file mode 100644 index 0000000000..adb60e8a9e --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h @@ -0,0 +1,67 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F411 +// Line Type: Access Line +// Speed: 96MHz + +// Note - the actual maximum frequency is 100MHz, but this requires divisors +// which are incompatible with USB, and there is no additional PLL such as on +// the F412. + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (192) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (4) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_3) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c deleted file mode 100644 index 6c4cb5b322..0000000000 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.c +++ /dev/null @@ -1,75 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f4xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the - * device is clocked below the maximum system frequency, to update the - * voltage scaling value regarding system frequency refer to product - * datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 200; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLR = 2; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLLSAI output as USB clock source */ - PeriphClkInitStruct.PLLI2S.PLLI2SM = 8; - PeriphClkInitStruct.PLLI2S.PLLI2SQ = 4; - PeriphClkInitStruct.PLLI2S.PLLI2SN = 192; - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CK48; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CK48CLKSOURCE_PLLI2SQ; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - * clocks dividers */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | - RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h new file mode 100644 index 0000000000..8f092adbac --- /dev/null +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h @@ -0,0 +1,66 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f4xx_hal.h" + +// Chip: STM32F412 +// Line Type: Access Line +// Speed: 200MHz (MAX) + +// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB +// can't get the right divisors from 100MHz PLL settings. + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (200) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (7) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_3) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (1) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f7/clocks.c b/ports/stm/peripherals/stm32f7/clocks.c new file mode 100644 index 0000000000..93016f6828 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/clocks.c @@ -0,0 +1,118 @@ + /* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +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(); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + + // Set voltage scaling in accordance with system clock speed + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + 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; + } + + /* Activate the OverDrive to reach the 216 MHz Frequency */ + HAL_PWREx_EnableOverDrive(); + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) + // Should always result in 48M. + PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; + PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; + PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; + PeriphClkInitStruct.PLLSAIDivQ = 1; + PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; + PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_CK48; + PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; + #endif + + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c deleted file mode 100644 index 2afa2e377a..0000000000 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.c +++ /dev/null @@ -1,96 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * Copyright (c) 2020 Mark Olsson - * - * 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 STM32_HAL_H - -#ifndef BOARD_OSC_DIV -#define BOARD_OSC_DIV (8) -#endif -#ifndef BOARD_OSC_PLLN -#define BOARD_OSC_PLLN (432) -#endif -#ifndef BOARD_OSC_PLLQ -#define BOARD_OSC_PLLQ (9) -#endif -#ifndef BOARD_FLASH_LATENCY -#define BOARD_FLASH_LATENCY FLASH_LATENCY_7 -#endif -#ifndef BOARD_OSC_HSESTATE -#define BOARD_OSC_HSESTATE RCC_HSE_BYPASS -#endif - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = BOARD_OSC_HSESTATE; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = BOARD_OSC_PLLN; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = BOARD_OSC_PLLQ; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Activate the OverDrive to reach the 216 MHz Frequency */ - HAL_PWREx_EnableOverDrive(); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, BOARD_FLASH_LATENCY); - - #ifdef STM32F746G_DISCO - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48; - PeriphClkInitStruct.PLLSAI.PLLSAIN = 192; - PeriphClkInitStruct.PLLSAI.PLLSAIR = 2; - PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2; - PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4; - PeriphClkInitStruct.PLLSAIDivQ = 1; - PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2; - PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48SOURCE_PLLSAIP; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - #endif -} diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h new file mode 100644 index 0000000000..eb44625143 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -0,0 +1,63 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" + +// Chip: STM32F746 +// Line Type: Advanced Line +// Speed: 216MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (432) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (9) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_7) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c deleted file mode 100644 index 18b202df56..0000000000 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.c +++ /dev/null @@ -1,66 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32f7xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 432; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 9; - RCC_OscInitStruct.PLL.PLLR = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Activate the OverDrive to reach the 216 MHz Frequency */ - HAL_PWREx_EnableOverDrive(); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7); - -} diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h new file mode 100644 index 0000000000..187a024ad0 --- /dev/null +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -0,0 +1,63 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32f7xx_hal.h" + +// Chip: STM32F767 +// Line Type: Advanced Line +// Speed: 216MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (432) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (RCC_PLLP_DIV2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (9) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_HCLK_DIV4) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_7) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/peripherals/stm32h7/clocks.c b/ports/stm/peripherals/stm32h7/clocks.c new file mode 100644 index 0000000000..d68137df0f --- /dev/null +++ b/ports/stm/peripherals/stm32h7/clocks.c @@ -0,0 +1,123 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32h7xx_hal.h" +#include "supervisor/shared/safe_mode.h" +#include + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + +void stm32_peripherals_clocks_init(void) { + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + bool lse_failure = false; + + // Set voltage scaling in accordance with system clock speed + HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY); + __HAL_PWR_VOLTAGESCALING_CONFIG(CPY_CLK_VSCALE); + while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {} + + // Configure LSE Drive + HAL_PWR_EnableBkUpAccess(); + __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); + + // Set up primary PLL and HSE clocks + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.LSEState = RCC_LSE_ON; + #else + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI; + RCC_OscInitStruct.LSIState = RCC_LSI_ON; + #endif + #if (CPY_CLK_USB_USES_AUDIOPLL) // Not actually audio PLL in this case, swap macro? + RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_HSI48; + RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; + #endif + RCC_OscInitStruct.HSEState = BOARD_HSE_SOURCE; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/2000000; + RCC_OscInitStruct.PLL.PLLN = CPY_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = CPY_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ; + RCC_OscInitStruct.PLL.PLLR = 2; + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_1; + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + 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; + } + + // Configure bus clock sources and divisors + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2 + |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = CPY_CLK_AHBDIV; + RCC_ClkInitStruct.APB1CLKDivider = CPY_CLK_APB1DIV; + RCC_ClkInitStruct.APB2CLKDivider = CPY_CLK_APB2DIV; + RCC_ClkInitStruct.APB3CLKDivider = CPY_CLK_APB3DIV; + RCC_ClkInitStruct.APB4CLKDivider = CPY_CLK_APB4DIV; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, CPY_CLK_FLASH_LATENCY); + + // Set up non-bus peripherals + // TODO: I2S settings go here + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_USART3 + |RCC_PERIPHCLK_USB; + #if (BOARD_HAS_LOW_SPEED_CRYSTAL) + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + #else + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; + #endif + PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1; + #if (CPY_CLK_USB_USES_AUDIOPLL) // Not actually audio PLL in this case, swap macro? + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; + #else + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; + #endif + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + // Enable USB Voltage detector + HAL_PWREx_EnableUSBVoltageDetector(); + + if (lse_failure) { + reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? + } +} \ No newline at end of file diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c deleted file mode 100644 index 8ede6080e8..0000000000 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.c +++ /dev/null @@ -1,83 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Lucian Copeland for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "stm32h7xx_hal.h" - -void stm32_peripherals_clocks_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* The PWR block is always enabled on the H7 series- there is no clock - enable. For now, use the default VOS3 scale mode (lowest) and limit clock - frequencies to avoid potential current draw problems from bus - power when using the max clock speeds throughout the chip. */ - - /* Enable HSE Oscillator and activate PLL1 with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.CSIState = RCC_CSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = 2; - RCC_OscInitStruct.PLL.PLLQ = 7; - RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_0; - RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; - RCC_OscInitStruct.PLL.PLLFRACN = 0; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | \ - RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | \ - RCC_CLOCKTYPE_D3PCLK1); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1; - - /* Unlike on the STM32F4 family, it appears the maximum APB frequencies are - device-dependent- 120 MHz for this board according to Figure 2 of - the datasheet. Dividing by half will be safe for now. */ - RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2; - RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; - RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2; - - /* 4 wait states required for 168MHz and VOS3. */ - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); - - /* Like on F4, on H7, USB's actual peripheral clock and bus clock are - separate. However, the main system PLL (PLL1) doesn't have a direct - connection to the USB peripheral clock to generate 48 MHz, so we do this - dance. This will connect PLL1's Q output to the USB peripheral clock. */ - RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct; - - RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; - RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL; - HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct); - -} diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h new file mode 100644 index 0000000000..ad241b7ef6 --- /dev/null +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -0,0 +1,70 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "stm32h7xx_hal.h" + +// Chip: STM32H743 +// Line Type: Single-Core +// Speed: 480MHz (MAX) + +// Defaults: +#ifndef CPY_CLK_VSCALE +#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE0) +#endif +#ifndef CPY_CLK_PLLN +#define CPY_CLK_PLLN (480) +#endif +#ifndef CPY_CLK_PLLP +#define CPY_CLK_PLLP (2) +#endif +#ifndef CPY_CLK_PLLQ +#define CPY_CLK_PLLQ (20) +#endif +#ifndef CPY_CLK_AHBDIV +#define CPY_CLK_AHBDIV (RCC_HCLK_DIV2) +#endif +#ifndef CPY_CLK_APB1DIV +#define CPY_CLK_APB1DIV (RCC_APB1_DIV2) +#endif +#ifndef CPY_CLK_APB2DIV +#define CPY_CLK_APB2DIV (RCC_APB2_DIV2) +#endif +#ifndef CPY_CLK_APB3DIV +#define CPY_CLK_APB3DIV (RCC_APB3_DIV2) +#endif +#ifndef CPY_CLK_APB4DIV +#define CPY_CLK_APB4DIV (RCC_APB4_DIV2) +#endif +#ifndef CPY_CLK_FLASH_LATENCY +#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_4) +#endif +#ifndef CPY_CLK_USB_USES_AUDIOPLL +#define CPY_CLK_USB_USES_AUDIOPLL (0) +#endif +#ifndef BOARD_HSE_SOURCE +#define BOARD_HSE_SOURCE (RCC_HSE_ON) +#endif diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 9b62fa2eb1..cb500addee 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -169,64 +169,7 @@ safe_mode_t port_init(void) { stm32_peripherals_clocks_init(); stm32_peripherals_gpio_init(); - HAL_PWR_EnableBkUpAccess(); - - // TODO: move all of this to clocks.c - #if BOARD_HAS_LOW_SPEED_CRYSTAL - uint32_t tickstart = HAL_GetTick(); - - // H7/F7 untested with LSE, so autofail them until above move is done - #if (CPY_STM32F4) - bool lse_setupsuccess = true; - #else - bool lse_setupsuccess = false; - #endif - - // Update LSE configuration in Backup Domain control register - // Requires to enable write access to Backup Domain of necessary - // TODO: should be using the HAL OSC initializer, otherwise we'll need - // preprocessor defines for every register to account for F7/H7 - #if (CPY_STM32F4) - if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) - { - // Enable write access to Backup domain - SET_BIT(PWR->CR, PWR_CR_DBP); - // Wait for Backup domain Write protection disable - tickstart = HAL_GetTick(); - while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) - { - if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) - { - lse_setupsuccess = false; - } - } - } - #endif - - __HAL_RCC_LSE_CONFIG(RCC_LSE_ON); - tickstart = HAL_GetTick(); - while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) { - if((HAL_GetTick() - tickstart ) > LSE_STARTUP_TIMEOUT) - { - lse_setupsuccess = false; - __HAL_RCC_LSE_CONFIG(RCC_LSE_OFF); - __HAL_RCC_LSI_ENABLE(); - rtc_clock_frequency = LSI_VALUE; - break; - } - } - - if (lse_setupsuccess) { - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); - } else { - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); - } - - #else - __HAL_RCC_LSI_ENABLE(); - __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSI); - #endif - + // RTC oscillator selection is handled in peripherals///clocks.c __HAL_RCC_RTC_ENABLE(); _hrtc.Instance = RTC; _hrtc.Init.HourFormat = RTC_HOURFORMAT_24; @@ -237,7 +180,6 @@ safe_mode_t port_init(void) { _hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; HAL_RTC_Init(&_hrtc); - HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); return NO_SAFE_MODE; From 74effeeefd832e31ea2a2e80d37e71a1d8e685e0 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 4 Jun 2020 13:30:07 -0400 Subject: [PATCH 771/919] Add temporary fix warning --- ports/mimxrt10xx/supervisor/port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 40d28d2ef8..c36595e041 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,6 +306,7 @@ void reset_port(void) { //reset_event_system(); + // TODO: implement a proper fix for 1060 resets #if !defined (MIMXRT1062_SERIES) reset_all_pins(); #endif From ad0971fb25347a8cc36ace2c45449ef7eac6995e Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 5 Jun 2020 11:42:34 -0400 Subject: [PATCH 772/919] Override HAL_Delay and HAL_GetTick --- .../peripherals/stm32f4/stm32f401xe/clocks.h | 2 +- .../peripherals/stm32f4/stm32f411xe/clocks.h | 2 +- .../peripherals/stm32f4/stm32f412zx/clocks.h | 2 +- ports/stm/peripherals/stm32h7/clocks.c | 2 +- ports/stm/supervisor/port.c | 32 +++++++++++++++++-- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h index be62370d88..d157d944a3 100644 --- a/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f401xe/clocks.h @@ -37,7 +37,7 @@ #ifndef CPY_CLK_PLLN #define CPY_CLK_PLLN (336) #endif -#ifndef (CPY_CLK_PLLP +#ifndef CPY_CLK_PLLP #define CPY_CLK_PLLP (RCC_PLLP_DIV4) #endif #ifndef CPY_CLK_PLLQ diff --git a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h index adb60e8a9e..a2fb7bd544 100644 --- a/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f411xe/clocks.h @@ -32,7 +32,7 @@ // Note - the actual maximum frequency is 100MHz, but this requires divisors // which are incompatible with USB, and there is no additional PLL such as on -// the F412. +// the F412. // Defaults: #ifndef CPY_CLK_VSCALE diff --git a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h index 8f092adbac..e1355c8f34 100644 --- a/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h +++ b/ports/stm/peripherals/stm32f4/stm32f412zx/clocks.h @@ -30,7 +30,7 @@ // Line Type: Access Line // Speed: 200MHz (MAX) -// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB +// Note - uses the I2S PLL for SUSB to enable full 100MHz operation, since USB // can't get the right divisors from 100MHz PLL settings. // Defaults: diff --git a/ports/stm/peripherals/stm32h7/clocks.c b/ports/stm/peripherals/stm32h7/clocks.c index d68137df0f..0e4e79f9f7 100644 --- a/ports/stm/peripherals/stm32h7/clocks.c +++ b/ports/stm/peripherals/stm32h7/clocks.c @@ -120,4 +120,4 @@ void stm32_peripherals_clocks_init(void) { if (lse_failure) { reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT? } -} \ No newline at end of file +} diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 8156b2272a..25504ddece 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -147,9 +147,10 @@ __attribute__((used, naked)) void Reset_Handler(void) { __enable_irq(); main(); } - #endif //end H7 specific code +// Low power clock variables +static volatile uint32_t systick_ms; static RTC_HandleTypeDef _hrtc; #if BOARD_HAS_LOW_SPEED_CRYSTAL @@ -159,7 +160,7 @@ static uint32_t rtc_clock_frequency = LSI_VALUE; #endif safe_mode_t port_init(void) { - HAL_Init(); + HAL_Init(); // Turns on SysTick __HAL_RCC_SYSCFG_CLK_ENABLE(); #if (CPY_STM32F4) @@ -182,13 +183,38 @@ safe_mode_t port_init(void) { HAL_RTC_Init(&_hrtc); HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); + // Turn off SysTick + SysTick->CTRL = 0; + return NO_SAFE_MODE; } +void HAL_Delay(uint32_t delay_ms) { + if (SysTick->CTRL != 0) { + // SysTick is on, so use it + uint32_t tickstart = systick_ms; + while (systick_ms - tickstart < delay_ms) { + } + } else { + mp_hal_delay_ms(delay_ms); + } +} + +uint32_t HAL_GetTick() { + if (SysTick->CTRL != 0) { + return systick_ms; + } else { + uint8_t subticks; + uint32_t result = (uint32_t)port_get_raw_ticks(&subticks); + return result; + } +} + + void SysTick_Handler(void) { + systick_ms += 1; // Read the CTRL register to clear the SysTick interrupt. SysTick->CTRL; - HAL_IncTick(); } void reset_port(void) { From 93cffaa87e0cd42130c198fd2f9a69b7f4330474 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Fri, 5 Jun 2020 16:43:08 -0400 Subject: [PATCH 773/919] Fix pin macros typo, add extra flash protection --- ports/mimxrt10xx/boards/teensy40/board.c | 2 ++ ports/mimxrt10xx/boards/teensy41/board.c | 2 ++ .../peripherals/mimxrt10xx/MIMXRT1062/pins.c | 24 +++++++++---------- ports/mimxrt10xx/supervisor/port.c | 3 --- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 28786ab902..09f0bf3f2a 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -48,6 +48,8 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_EMC_01); common_hal_never_reset_pin(&pin_GPIO_B0_13); common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 28786ab902..09f0bf3f2a 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -48,6 +48,8 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_EMC_01); common_hal_never_reset_pin(&pin_GPIO_B0_13); common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } bool board_requests_safe_mode(void) { diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c index 9f25225bb6..ce098ea2bc 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c @@ -141,15 +141,15 @@ const mcu_pin_obj_t pin_GPIO_SD_B0_02 = PIN(GPIO3, 14, GPIO_SD_B0_02, NO_ADC, 0, const mcu_pin_obj_t pin_GPIO_SD_B0_03 = PIN(GPIO3, 15, GPIO_SD_B0_03, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B0_04 = PIN(GPIO3, 16, GPIO_SD_B0_04, NO_ADC, 0, 0x00000005, 0x000010B0); const mcu_pin_obj_t pin_GPIO_SD_B0_05 = PIN(GPIO3, 17, GPIO_SD_B0_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); -const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_00 = PIN(GPIO3, 0, GPIO_SD_B1_00, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_01 = PIN(GPIO3, 1, GPIO_SD_B1_01, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_02 = PIN(GPIO3, 2, GPIO_SD_B1_02, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_03 = PIN(GPIO3, 3, GPIO_SD_B1_03, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_04 = PIN(GPIO3, 4, GPIO_SD_B1_04, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_05 = PIN(GPIO3, 5, GPIO_SD_B1_05, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_06 = PIN(GPIO3, 6, GPIO_SD_B1_06, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_07 = PIN(GPIO3, 7, GPIO_SD_B1_07, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_08 = PIN(GPIO3, 8, GPIO_SD_B1_08, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_09 = PIN(GPIO3, 9, GPIO_SD_B1_09, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_10 = PIN(GPIO3, 10, GPIO_SD_B1_10, NO_ADC, 0, 0x00000005, 0x000010B0); +const mcu_pin_obj_t pin_GPIO_SD_B1_11 = PIN(GPIO3, 11, GPIO_SD_B1_11, NO_ADC, 0, 0x00000005, 0x000010B0); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 3ac66fd2a6..ed5824732d 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -306,10 +306,7 @@ void reset_port(void) { //reset_event_system(); - // TODO: implement a proper fix for 1060 resets - #if !defined (MIMXRT1062_SERIES) reset_all_pins(); - #endif } void reset_to_bootloader(void) { From 33496e9c68a33028e472defdcda7fff35b7db8b0 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 5 Jun 2020 19:58:54 -0500 Subject: [PATCH 774/919] Add nice!nano board support --- .github/workflows/build.yml | 1 + ports/nrf/boards/nice_nano/board.c | 38 +++++++++++++ ports/nrf/boards/nice_nano/mpconfigboard.h | 45 ++++++++++++++++ ports/nrf/boards/nice_nano/mpconfigboard.mk | 8 +++ ports/nrf/boards/nice_nano/pins.c | 60 +++++++++++++++++++++ 5 files changed, 152 insertions(+) create mode 100644 ports/nrf/boards/nice_nano/board.c create mode 100644 ports/nrf/boards/nice_nano/mpconfigboard.h create mode 100644 ports/nrf/boards/nice_nano/mpconfigboard.mk create mode 100644 ports/nrf/boards/nice_nano/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0719b40e94..00454cc2da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -205,6 +205,7 @@ jobs: - "monster_m4sk" - "ndgarage_ndbit6" - "nfc_copy_cat" + - "nice_nano" - "nucleo_f746zg" - "nucleo_f767zi" - "nucleo_h743zi_2" diff --git a/ports/nrf/boards/nice_nano/board.c b/ports/nrf/boards/nice_nano/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/nice_nano/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/nice_nano/mpconfigboard.h b/ports/nrf/boards/nice_nano/mpconfigboard.h new file mode 100644 index 0000000000..5f61947007 --- /dev/null +++ b/ports/nrf/boards/nice_nano/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "nice!nano" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_15) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_20) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_17) + +#define DEFAULT_SPI_BUS_SCK (&pin_P1_13) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_10) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_11) + +#define DEFAULT_UART_BUS_RX (&pin_P0_08) +#define DEFAULT_UART_BUS_TX (&pin_P0_06) diff --git a/ports/nrf/boards/nice_nano/mpconfigboard.mk b/ports/nrf/boards/nice_nano/mpconfigboard.mk new file mode 100644 index 0000000000..511a754e69 --- /dev/null +++ b/ports/nrf/boards/nice_nano/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x80B4 +USB_PRODUCT = "nice!nano" +USB_MANUFACTURER = "Nice Keyboards" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/nice_nano/pins.c b/ports/nrf/boards/nice_nano/pins.c new file mode 100644 index 0000000000..98c1251fe3 --- /dev/null +++ b/ports/nrf/boards/nice_nano/pins.c @@ -0,0 +1,60 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_BAT_VOLT), MP_ROM_PTR(&pin_P0_04) }, // Read battery voltage + + { MP_ROM_QSTR(MP_QSTR_VCC_OFF), MP_ROM_PTR(&pin_P0_13) }, // Turn off external VCC by MOSFET + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_15) }, // Controls blue LED, high is on + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_11) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From 07fa458767d05a36ebe3e03293bea7ce52d0e389 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Tue, 2 Jun 2020 21:43:57 +0000 Subject: [PATCH 775/919] Translated using Weblate (Swedish) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/sv/ --- locale/sv.po | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index 58e810c4c2..09d3faa181 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 21:42+0000\n" +"PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -153,7 +153,7 @@ msgstr "'%s' heltal %d ligger inte inom intervallet %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "'%s' heltal 0x%x får inte plats i mask 0x%x" +msgstr "'%s' heltal 0x%x ryms inte i mask 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" @@ -166,12 +166,12 @@ msgstr "Objektet '%s' har inte stöd för '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "Objektet \"%s\" stöder inte tilldelning av objekt" +msgstr "Objektet '%s' stöder inte tilldelningen" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "'%s'-objekt stöder inte borttagning av objekt" +msgstr "Objektet '%s' stöder inte borttagning av objekt" #: py/runtime.c msgid "'%s' object has no attribute '%q'" @@ -190,16 +190,16 @@ msgstr "Objektet '%s' kan inte anropas" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "Objektet '%s' är inte itererbar" +msgstr "Objektet '%s' är inte itererable" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "Objektet \"%s\" är inte indexbar" +msgstr "Objektet '%s' är inte indexbar" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "'='-justering tillåts inte i strängformatspecificerare" +msgstr "'='-justering tillåts inte i strängformatspecifikation" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -211,7 +211,7 @@ msgstr "'align' kräver 1 argument" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "'async for' eller 'async with' utanför asynk-funktion" +msgstr "'async for' eller 'async with' utanför async-funktion" #: py/compile.c msgid "'await' outside function" @@ -264,7 +264,7 @@ msgstr "3-arguments pow() stöds inte" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "En kanal för hårdvaruavbrotts används redan" +msgstr "En kanal för hårdvaruavbrott används redan" #: shared-bindings/_bleio/Address.c #, c-format @@ -285,7 +285,7 @@ msgstr "All SPI-kringutrustning används" #: ports/nrf/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "Alla UART-tillbehör används" +msgstr "Alla UART-kringutrustning används" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -316,7 +316,7 @@ msgstr "Annonserar redan." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn stöds inte på en given pinne" +msgstr "AnalogIn stöds inte på angiven pinne" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -326,16 +326,16 @@ msgstr "AnalogOut-funktionalitet stöds inte" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut är bara 16 bitar. Värdet måste vara mindre än 65536." +msgstr "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut stöds inte på given pinne" +msgstr "AnalogOut stöds inte på angiven pinne" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "En annan sändning är redan aktiv" +msgstr "En annan send är redan aktiv" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" @@ -343,7 +343,7 @@ msgstr "Matrisen måste innehålla halfwords (typ \"H\")" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Matrisvärden ska vara enstaka byte." +msgstr "Matrisvärden ska bestå av enstaka bytes." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" @@ -351,7 +351,7 @@ msgstr "Högst %d %q kan anges (inte %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." -msgstr "Försökte tilldelning av heap när MicroPython VM inte körs." +msgstr "Försökte tilldela heap när MicroPython VM inte körs." #: main.c msgid "Auto-reload is off.\n" @@ -376,7 +376,7 @@ msgstr "Bitklocka och ordval måste dela en klockenhet" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "Bitdjupet måste vara multipel av 8." +msgstr "Bitdjup måste vara multipel av 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -390,16 +390,16 @@ msgstr "Båda pinnarna måste stödja maskinvaruavbrott" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "Ljusstyrkan måste vara 0-1,0" +msgstr "Ljusstyrkan måste vara mellan 0 och 1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" -msgstr "Ljusstyrkan måste vara mellan 0 och 255" +msgstr "Ljusstyrka måste vara mellan 0 och 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "Ljusstyrkan kan inte justeras" +msgstr "Ljusstyrka kan inte justeras" #: shared-bindings/_bleio/UUID.c #, c-format @@ -437,7 +437,7 @@ msgstr "Bufferten är för stor och kan inte allokeras" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "Buffert för kort med %d bytes" +msgstr "Buffert år %d bytes för kort" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -459,7 +459,7 @@ msgstr "CBC-block måste vara multiplar om 16 byte" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Anropa super().__init__() innan du använder det nativa objektet." +msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -504,9 +504,7 @@ msgstr "Kan inte återmontera '/' när USB är aktivt." #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" -"Det går inte att återställa till bootloader eftersom det inte finns någon " -"bootloader." +msgstr "Det går inte att återställa till bootloader eftersom bootloader saknas." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." From 53a1b68649fc4efa310fa875f3b6dbe2a65fb8d4 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 3 Jun 2020 20:59:52 +0200 Subject: [PATCH 776/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/ --- locale/sv.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/sv.po b/locale/sv.po index 09d3faa181..bf9bb3f5d9 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -504,7 +504,8 @@ msgstr "Kan inte återmontera '/' när USB är aktivt." #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Det går inte att återställa till bootloader eftersom bootloader saknas." +msgstr "" +"Det går inte att återställa till bootloader eftersom bootloader saknas." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." From 6502ec5dffe705642c26c81eb35b599fd2103942 Mon Sep 17 00:00:00 2001 From: aberwag Date: Thu, 4 Jun 2020 19:17:25 +0000 Subject: [PATCH 777/919] Translated using Weblate (French) Currently translated at 100.0% (764 of 764 strings) Translation: CircuitPython/master Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/fr/ --- locale/fr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 9c7adb7e00..587f098771 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-02 19:50+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-06-05 17:29+0000\n" +"Last-Translator: aberwag \n" "Language-Team: French \n" "Language: fr\n" @@ -1735,7 +1735,7 @@ msgstr "WatchDogTimer.timeout doit être supérieur à 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "Le minuteur Watchdog a expiré." #: py/builtinhelp.c #, c-format From d8bb2d7c6d32781addf07afdc2b6514386b6f30e Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 8 Jun 2020 10:52:27 -0500 Subject: [PATCH 778/919] Correct ticks being returned from port_get_raw_ticks() Issue #2958 . Correct calculation of usec back to ticks in port_get_raw_ticks(). --- ports/esp32s2/supervisor/port.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 4c42f11af9..f5a4ae48e3 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -118,11 +118,12 @@ uint32_t port_get_saved_word(void) { uint64_t port_get_raw_ticks(uint8_t* subticks) { struct timeval tv_now; gettimeofday(&tv_now, NULL); - uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 32768; + // convert usec back to ticks + uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024; if (subticks != NULL) { *subticks = all_subticks % 32; } - return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; + return (uint64_t)tv_now.tv_sec * 1024L + all_subticks; } // Enable 1/1024 second tick. From ec7a3feeba913b615c785fb03015f9edbedbaa95 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 9 Jun 2020 10:08:49 -0500 Subject: [PATCH 779/919] Redid formula for calculating subticks changed subticks calculation to give a range from 0 to 32767. --- ports/esp32s2/supervisor/port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index f5a4ae48e3..2437b4f341 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -119,11 +119,11 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { struct timeval tv_now; gettimeofday(&tv_now, NULL); // convert usec back to ticks - uint64_t all_subticks = (uint64_t)tv_now.tv_usec / 1024; + uint64_t all_subticks = (uint64_t)(tv_now.tv_usec * 2) / 71; if (subticks != NULL) { *subticks = all_subticks % 32; } - return (uint64_t)tv_now.tv_sec * 1024L + all_subticks; + return (uint64_t)tv_now.tv_sec * 1024L + all_subticks / 32; } // Enable 1/1024 second tick. From eeb3825646453762b6e40f012cc3b9bbd9442d20 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 9 Jun 2020 13:04:42 -0700 Subject: [PATCH 780/919] Update precommit check branch --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 116829296d..9663103046 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,7 +7,7 @@ name: pre-commit on: pull_request: push: - branches: [master] + branches: [main] jobs: pre-commit: From b414f82669ad2106d8705a485fcfde13ac5cf358 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 9 Jun 2020 18:01:52 -0400 Subject: [PATCH 781/919] Add DTCM and ITCM support to F7 series --- ports/stm/boards/STM32F746xG_fs.ld | 10 ++++++++-- ports/stm/boards/STM32F767_fs.ld | 11 +++++++++-- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 8 ++++++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 2 +- ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 8 ++++++++ ports/stm/supervisor/port.c | 14 +++++++------- 8 files changed, 50 insertions(+), 13 deletions(-) diff --git a/ports/stm/boards/STM32F746xG_fs.ld b/ports/stm/boards/STM32F746xG_fs.ld index 6c9ea4de31..7419c43d2e 100644 --- a/ports/stm/boards/STM32F746xG_fs.ld +++ b/ports/stm/boards/STM32F746xG_fs.ld @@ -26,6 +26,11 @@ * THE SOFTWARE. */ + /* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -33,7 +38,8 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (xrw) : ORIGIN = 0x20010000, LENGTH = 256K /* AXI SRAM */ ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } @@ -44,7 +50,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/STM32F767_fs.ld b/ports/stm/boards/STM32F767_fs.ld index 2feb422257..2ab73e907c 100644 --- a/ports/stm/boards/STM32F767_fs.ld +++ b/ports/stm/boards/STM32F767_fs.ld @@ -2,6 +2,11 @@ GNU linker script for STM32F767 with filesystem */ +/* Entry Point */ +ENTRY(Reset_Handler) + +_ld_default_stack_size = 24K; + /* Specify the memory areas */ MEMORY { @@ -9,7 +14,9 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 32K /* sector 0 */ FLASH_FS (rx) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1,2,3 are 32K */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sector 4 is 128K, sectors 5,6,7 are 256K */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K + DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + RAM (xrw) : ORIGIN = 0x20020000, LENGTH = 384K /* AXI SRAM */ + ITCM (xrw) : ORIGIN = 0x00000000, LENGTH = 16K } /* produce a link error if there is not this amount of RAM for these sections */ @@ -19,7 +26,7 @@ _minimum_heap_size = 16K; /* Define tho top end of the stack. The stack is full descending so begins just above last byte of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ -_estack = ORIGIN(RAM) + LENGTH(RAM); +_estack = ORIGIN(DTCM) + LENGTH(DTCM); /* RAM extents for the garbage collector */ _ram_start = ORIGIN(RAM); diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index c1f0d59b2d..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -33,6 +33,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index f23f642e7e..6e88e6d882 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LLD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 21e0ef0ba4..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -32,6 +32,14 @@ #define FLASH_SIZE (0x200000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 +#define CPY_SRAM_START_ADDR 0x20020000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index 4e5e1bc7c8..c5d956b994 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F767xx MCU_PACKAGE = LQFP144 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F767_fs.ld diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 1ae7f81a47..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -31,6 +31,14 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 25504ddece..713803d55d 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -49,7 +49,7 @@ #include STM32_HAL_H //only enable the Reset Handler overwrite for the H7 for now -#if (CPY_STM32H7) +#if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. #define DEVICE 2 @@ -86,7 +86,7 @@ extern uint32_t _ld_itcm_flash_copy; extern void main(void); extern void SystemInit(void); -// This replaces the Reset_Handler in startup_*.S and SystemInit in system_*.c. +// This replaces the Reset_Handler in gcc/startup_*.s, calls SystemInit from system_*.c __attribute__((used, naked)) void Reset_Handler(void) { __disable_irq(); __set_MSP((uint32_t) &_ld_stack_top); @@ -105,20 +105,20 @@ __attribute__((used, naked)) void Reset_Handler(void) { // Mark all the flash the same until instructed otherwise. MPU->RBAR = ARM_MPU_RBAR(11, 0x08000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_2MB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_FLASH_REGION_SIZE); // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to // accidentally write the wrong value to 0x00000000 (aka NULL). MPU->RBAR = ARM_MPU_RBAR(12, 0x00000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_64KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_RO, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_ITCM_REGION_SIZE); // This the DTCM. MPU->RBAR = ARM_MPU_RBAR(14, 0x20000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_128KB); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, CPY_DTCM_REGION_SIZE); // This is AXI SRAM (D1). - MPU->RBAR = ARM_MPU_RBAR(15, 0x24000000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, NO_SUBREGIONS, ARM_MPU_REGION_SIZE_512KB); + MPU->RBAR = ARM_MPU_RBAR(15, CPY_SRAM_START_ADDR); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, CPY_SRAM_SUBMASK, CPY_SRAM_REGION_SIZE); /* Enable MPU */ ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk); From 7cc8b784c36d1fc01867a00c9a6e40353eedc599 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 09:49:35 -0400 Subject: [PATCH 782/919] Add missing openmv definitions --- ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 2 +- ports/stm/boards/openmv_h7/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 8 ++++++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 6e88e6d882..651f3c2292 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = LQFP144 -LLD_COMMON = boards/common_tcm.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index cf9d6e7d14..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -31,5 +31,13 @@ #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_2MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_64KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_512KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x24000000 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 1fa69182a6..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -34,6 +34,14 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) +// H7 and F7 MPU definitions +#define CPY_FLASH_REGION_SIZE ARM_MPU_REGION_SIZE_1MB +#define CPY_ITCM_REGION_SIZE ARM_MPU_REGION_SIZE_16KB +#define CPY_DTCM_REGION_SIZE ARM_MPU_REGION_SIZE_128KB +#define CPY_SRAM_REGION_SIZE ARM_MPU_REGION_SIZE_256KB +#define CPY_SRAM_SUBMASK 0x00 +#define CPY_SRAM_START_ADDR 0x20010000 + // Lower frequency to allow external RAM use #define HSE_VALUE ((uint32_t)25000000) #define LSE_VALUE ((uint32_t)32768) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index ff8456df66..94a50853cb 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -10,5 +10,5 @@ MCU_SERIES = F7 MCU_VARIANT = STM32F746xx MCU_PACKAGE = TFBGA216 -LD_COMMON = boards/common_default.ld +LD_COMMON = boards/common_tcm.ld LD_FILE = boards/STM32F746xG_fs.ld From c88a8e66c6552294671e4282bdaa52d97c6e6c2c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 13:22:21 -0400 Subject: [PATCH 783/919] Minor comment fix --- ports/stm/supervisor/port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index 713803d55d..07a93c025b 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -48,7 +48,6 @@ #include STM32_HAL_H -//only enable the Reset Handler overwrite for the H7 for now #if (CPY_STM32H7) || (CPY_STM32F7) // Device memories must be accessed in order. From c08702414e410769de3d4821aa07f419c9ef7508 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 16:36:44 -0400 Subject: [PATCH 784/919] Add macros for setting correct F7 and H7 I2C timing --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 6 ++++++ ports/stm/boards/openmv_h7/mpconfigboard.h | 4 ++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 4 ++++ ports/stm/common-hal/busio/I2C.c | 8 +++++++- 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index e2b54335a5..13ec369bf3 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,9 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 327651923a..b08a0062e2 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,6 +40,10 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 2ac986701e..15186e89d6 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,6 +39,12 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + + + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 77ae235ecf..2f61e24213 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,5 +39,9 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 769990a98c..35a28ca3d1 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,6 +50,10 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00401959 +#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF + #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 48c4c1933a..01d0703ca1 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // Handle the HAL handle differences #if (CPY_STM32H7 || CPY_STM32F7) - self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples + if (frequency == 400000) { + self->handle.Init.Timing = CPY_I2CFAST_TIMINGR; + } else if (frequency == 100000) { + self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; + } else { + mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + } #else self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; From 058c16e98c4036c8a53547062f513a0d74eb90c4 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Wed, 10 Jun 2020 17:11:28 -0500 Subject: [PATCH 785/919] Issue #3014 - refresh after changing to transparent Adding self->needs_refresh = true; in common_hal_displayio_palette_make_opaque() and common_hal_displayio_palette_make_transparent() --- shared-module/displayio/Palette.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index 1ef03aab44..facb1fa732 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -35,10 +35,12 @@ void common_hal_displayio_palette_construct(displayio_palette_t* self, uint16_t void common_hal_displayio_palette_make_opaque(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = false; + self->needs_refresh = true; } void common_hal_displayio_palette_make_transparent(displayio_palette_t* self, uint32_t palette_index) { self->colors[palette_index].transparent = true; + self->needs_refresh = true; } uint32_t common_hal_displayio_palette_get_len(displayio_palette_t* self) { From 724637faa3b96b20f4deed32d58dcb7b50672479 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Jun 2020 11:17:51 -0400 Subject: [PATCH 786/919] Move I2C speed to clock-style definition --- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 4 --- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 4 --- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 ---- ports/stm/boards/openmv_h7/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 3 +- ports/stm/peripherals/clocks.h | 30 +++++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 +++++ .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 +++++ .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 +++++ 9 files changed, 56 insertions(+), 19 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 13ec369bf3..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,9 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index b08a0062e2..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,10 +40,6 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 15186e89d6..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,12 +39,6 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - - - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 2f61e24213..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,9 +39,5 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 01d0703ca1..00f15aaa60 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,6 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" +#include "clocks.h" // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 @@ -125,7 +126,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } else if (frequency == 100000) { self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; } else { - mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + mp_raise_ValueError(translate("Unsupported baudrate")); } #else self->handle.Init.ClockSpeed = frequency; diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 1f837c79ee..192190e5ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,4 +24,34 @@ * THE SOFTWARE. */ +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index eb44625143..bd53c38cd9 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index 187a024ad0..a89756db05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index ad241b7ef6..e7c5170966 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,3 +68,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif From 3c3cad5ae6f050150931373e1472098671779973 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 11:11:44 -0500 Subject: [PATCH 787/919] docs: Improve 5.0.x <-> main branch doc linkrot This improves, but does not entirely fix, the broken links that result from the autoapi change. It fixes module-level links, but class links still do not work (e.g., /shared-bindings/displayio/Palette.html (5.0.x) is now just /shared-bindings/displayio/#displayio.Palette). --- .gitignore | 1 + conf.py | 1 + ports/atmel-samd/README.rst | 2 +- shared-bindings/index.rst | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f5edb89f0e..8a773970d3 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ _build ###################### genrst/ /autoapi/ +/shared-bindings/**/*.rst # ctags and similar ################### diff --git a/conf.py b/conf.py index 3980ea8e1b..06aab271b2 100644 --- a/conf.py +++ b/conf.py @@ -79,6 +79,7 @@ autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True +autoapi_root = "shared-bindings" # The encoding of source files. #source_encoding = 'utf-8-sig' diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index a6881902e9..0746d1de06 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -21,4 +21,4 @@ Port Specific modules --------------------- .. toctree:: - ../../autoapi/samd/index + ../../shared-bindings/samd/index diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index d941773943..bf04ae18b1 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -19,5 +19,5 @@ Modules :glob: :maxdepth: 2 - ../autoapi/*/index + ../shared-bindings/*/index help From f83b0c2507611a95ab4dea0c87b25ba85a0de9d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 12:56:22 -0500 Subject: [PATCH 788/919] docs: conf.py: alphabetize imports --- conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 06aab271b2..99423841b8 100644 --- a/conf.py +++ b/conf.py @@ -14,11 +14,12 @@ # serve to show the default. import json -import sys import os +import subprocess +import sys +import urllib.parse import recommonmark -import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the From cb8539b06dd4bce11207341a311bffca741d190c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:21 -0500 Subject: [PATCH 789/919] docs: Generate redirects for autoapi renaming --- conf.py | 45 ++++++++++++++++++++++ docs/redirects.txt | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 docs/redirects.txt diff --git a/conf.py b/conf.py index 99423841b8..d39f74bd7d 100644 --- a/conf.py +++ b/conf.py @@ -14,6 +14,7 @@ # serve to show the default. import json +import logging import os import subprocess import sys @@ -82,6 +83,8 @@ autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" +redirects_file = 'docs/redirects.txt' + # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -376,5 +379,47 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), "bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} +# Adapted from sphinxcontrib-redirects +from sphinx.builders import html as builders + +TEMPLATE = """ + + +""" + + +def generate_redirects(app): + path = os.path.join(app.srcdir, app.config.redirects_file) + if not os.path.exists(path): + app.info("Could not find redirects file at '%s'" % path) + return + + # TODO(stephenfin): Add support for DirectoryHTMLBuilder + if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn("The 'sphinxcontib-redirects' plugin is only supported " + "by the 'html' builder. Skipping...") + return + + with open(path) as redirects: + for line in redirects.readlines(): + from_path, to_path = line.rstrip().split(' ') + + logging.debug("Redirecting '%s' to '%s'" % (from_path, to_path)) + + from_path = os.path.splitext(from_path)[0] + ".html" + to_path_prefix = '..%s' % os.path.sep * ( + len(from_path.split(os.path.sep)) - 1) + to_path = to_path_prefix + to_path + + redirected_filename = os.path.join(app.builder.outdir, from_path) + redirected_directory = os.path.dirname(redirected_filename) + if not os.path.exists(redirected_directory): + os.makedirs(redirected_directory) + + with open(redirected_filename, 'w') as f: + f.write(TEMPLATE % urllib.parse.quote(to_path, '#/')) + def setup(app): app.add_css_file("customstyle.css") + app.add_config_value('redirects_file', 'redirects', 'env') + app.connect('builder-inited', generate_redirects) diff --git a/docs/redirects.txt b/docs/redirects.txt new file mode 100644 index 0000000000..68d0b2de2e --- /dev/null +++ b/docs/redirects.txt @@ -0,0 +1,94 @@ +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap +shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter +shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display +shared-bindings/displayio/EPaperDisplay.rst shared-bindings/displayio/#displayio.EPaperDisplay +shared-bindings/displayio/FourWire.rst shared-bindings/displayio/#displayio.FourWire +shared-bindings/displayio/Group.rst shared-bindings/displayio/#displayio.Group +shared-bindings/displayio/I2CDisplay.rst shared-bindings/displayio/#displayio.I2CDisplay +shared-bindings/displayio/OnDiskBitmap.rst shared-bindings/displayio/#displayio.OnDiskBitmap +shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palette +shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus +shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape +shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin +shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor +shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock From 32a29ffdff4f757b818be9d63df44366a9ea389c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:58 -0500 Subject: [PATCH 790/919] shared-bindings: Change docstrings with '\x...' chars to raw strings Closes: #3032 --- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index ccbab1b9d2..9beaff2ab2 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, } //| address_bytes: Any = ... -//| """The bytes that make up the device address (read-only). +//| r"""The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 62ef0f5d00..6e454f34bd 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -50,7 +50,7 @@ //| contain the initialization sequence at minimum.""" //| //| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): -//| """Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a //| command byte followed by a byte to determine the parameter count and if a delay is need after. diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 871b2b06af..37cfbd82e9 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -85,7 +85,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } //| def __setitem__(self, index: Any, value: Any) -> Any: -//| """Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. +//| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). //| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 326f719a83..06d7d4c95b 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" //| class ByteArray: -//| """Presents a stretch of non-volatile memory as a bytearray. +//| r"""Presents a stretch of non-volatile memory as a bytearray. //| //| Non-volatile memory is available as a byte array that persists over reloads //| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign From 03c04e77ae5f94750408009cfa91f06b96a5898d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 18:54:05 -0500 Subject: [PATCH 791/919] actions: Try checkout v2.2.0 This version is supposed to > Fetch all history for all tags and branches when fetch-depth=0 We leave the tags fetch in place so that actions _in cloned repos_ work. Cloned repos' tags do not necessarily match adafruit/circuitpython, but we want version reporting to be able to use adafruit/circuitpython tags when they are most relevant according to "git describe"'s heuristics. Submodules are different, as they always point to the repo specified in .gitmodules, so they don't need special handling to get the most relevant tags. --- .github/workflows/build.yml | 25 +++++-------------------- .github/workflows/create_website_pr.yml | 3 +-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..ae73b3a655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,11 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Set up Python 3.8 @@ -110,14 +107,11 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Build mpy-cross @@ -286,14 +280,11 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -337,14 +328,11 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -377,14 +365,11 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - uses: actions/cache@v1 diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 79a6c68a75..9907c08ae6 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,12 +23,11 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Website From 2aac3cbdceffbeb1d70ac9de1412a29335f18158 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 15 Jun 2020 13:51:09 -0400 Subject: [PATCH 792/919] Revert I2C timing overrides, reduce scope to module only --- .../stm32f746g_discovery/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 19 +++++++++++- ports/stm/peripherals/clocks.h | 30 ------------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 ----- .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 ----- .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 ----- 6 files changed, 18 insertions(+), 59 deletions(-) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 35a28ca3d1..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,10 +50,6 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00401959 -#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF - #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 00f15aaa60..6adcf55750 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,7 +33,24 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -#include "clocks.h" + +// I2C timing specs for the H7 and F7 +// Configured for maximum possible clock settings for the family +#if (CPY_STM32F7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif +#elif (CPY_STM32H7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif +#endif // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 192190e5ee..1f837c79ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,34 +24,4 @@ * THE SOFTWARE. */ -// F4 Series -#ifdef STM32F401xE -#include "stm32f4/stm32f401xe/clocks.h" -#endif -#ifdef STM32F411xE -#include "stm32f4/stm32f411xe/clocks.h" -#endif -#ifdef STM32F412Zx -#include "stm32f4/stm32f412zx/clocks.h" -#endif -#ifdef STM32F405xx -#include "stm32f4/stm32f405xx/clocks.h" -#endif -#ifdef STM32F407xx -#include "stm32f4/stm32f407xx/clocks.h" -#endif - -// F7 Series -#ifdef STM32F746xx -#include "stm32f7/stm32f746xx/clocks.h" -#endif -#ifdef STM32F767xx -#include "stm32f7/stm32f767xx/clocks.h" -#endif - -// H7 Series -#ifdef STM32H743xx -#include "stm32h7/stm32h743xx/clocks.h" -#endif - void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index bd53c38cd9..eb44625143 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index a89756db05..187a024ad0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index e7c5170966..ad241b7ef6 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,11 +68,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 -#endif From a9614bb9643fac83275a7085f3fa5fca28bb4239 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:17:27 -0500 Subject: [PATCH 793/919] cxd56: Sort the configuration settings --- ports/cxd56/mpconfigport.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8aeae1de56..4594df731a 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -8,15 +8,15 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 -CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_I2CSLAVE = 0 -CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_TOUCHIO = 0 INTERNAL_LIBM = 1 From 9d5ccccf7d572697284a12fa9804878fc67c32f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 15:18:11 -0500 Subject: [PATCH 794/919] cxd56: Disable HID and MIDI These are already disabled via the USB_DEVICES setting, but the code is included anyway. --- ports/cxd56/mpconfigport.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 4594df731a..5894b9b73b 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -19,4 +19,6 @@ CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 From 81896930c7a91447c8830003e8cf92dce28db3d4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 16:35:51 -0400 Subject: [PATCH 795/919] Fix ScanEntry prefix matching for all --- shared-module/_bleio/ScanEntry.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 785209c4ab..91712baadc 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -56,12 +56,19 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (prefixes_length == 0) { return true; } + if (len == 0) { + // Prefixes exist, but no data. + return false; + } size_t i = 0; while(i < prefixes_length) { uint8_t prefix_length = prefixes[i]; i += 1; size_t j = 0; + bool prefix_matched = false; + mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { + mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -71,13 +78,21 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (any) { return true; } - } else if (!any) { - return false; + prefix_matched = true; + mp_printf(&mp_plat_print," match\n"); // XXX + break; } j += structure_length; } + // If all (!any), the current prefix must have matched at least one field. + if (!prefix_matched && !any) { + mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 16:50:33 -0500 Subject: [PATCH 796/919] docs: conf.py: Remove an irrelevant TODO This TODO made sense in the context of the original project, but for use in CircuitPython it does not appear to be relevant. Remove it. --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index d39f74bd7d..38546a5d0a 100644 --- a/conf.py +++ b/conf.py @@ -394,7 +394,6 @@ def generate_redirects(app): app.info("Could not find redirects file at '%s'" % path) return - # TODO(stephenfin): Add support for DirectoryHTMLBuilder if not type(app.builder) == builders.StandaloneHTMLBuilder: logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder. Skipping...") From c91435eff2e0ec0fa92fb383e2e96a18237d5c3f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 18:10:34 -0400 Subject: [PATCH 797/919] remove debugging prints --- shared-module/_bleio/ScanEntry.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 91712baadc..af9e4b3471 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -66,9 +66,7 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t i += 1; size_t j = 0; bool prefix_matched = false; - mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { - mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -79,20 +77,17 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t return true; } prefix_matched = true; - mp_printf(&mp_plat_print," match\n"); // XXX break; } j += structure_length; } // If all (!any), the current prefix must have matched at least one field. if (!prefix_matched && !any) { - mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 14:52:35 -0500 Subject: [PATCH 798/919] supervisor.mk: Compute what USB_DEVICES should be, and check it against what it is --- supervisor/supervisor.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 195e4a9b23..7eb7e26305 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -119,10 +119,25 @@ ifndef USB_DEVICES USB_DEVICES = "CDC,MSC,AUDIO,HID" endif +USB_DEVICES_COMPUTED := CDC,MSC +ifeq ($(CIRCUITPY_USB_MIDI),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO +endif +ifeq ($(CIRCUITPY_USB_HID),1) +USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID +endif +USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" + ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif +# During a transitional period, check that the COMPUTED values match. +# Once they do all match, we can remove all the hard-coded ones. +ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) +$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') +endif + ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From 37793044fc7725551e10dec8ace7e0e08f8d975f Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 16 Jun 2020 12:03:56 -0400 Subject: [PATCH 799/919] Add meowbit UF2 download override to website --- tools/build_board_info.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 4433023305..6c670930f4 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -56,7 +56,10 @@ extension_by_board = { "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, "pca10056": BIN_UF2, "pca10059": BIN_UF2, - "electronut_labs_blip": HEX + "electronut_labs_blip": HEX, + + # stm32 + "meowbit_v121": UF2 } aliases_by_board = { From fd4aafacbe9251177694598ea65f51f59af3f614 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Tue, 16 Jun 2020 12:33:15 -0400 Subject: [PATCH 800/919] Add port D to LQFP64 --- ports/stm/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 6102134978..e966f709f6 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -46,8 +46,8 @@ bool neopixel_in_use; #define GPIO_PORT_COUNT 5 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + #define GPIO_PORT_COUNT 4 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; From 47425f21cc73c8038f79231521bd60c163092211 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 16 Jun 2020 15:10:23 -0500 Subject: [PATCH 801/919] Handle a sleep exit with ctrl-c --- shared-module/time/__init__.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 347e68ae02..fad72c4b26 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -27,6 +27,8 @@ #include "py/mphal.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" +#include "py/obj.h" +#include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); @@ -42,4 +44,9 @@ uint64_t common_hal_time_monotonic_ns(void) { void common_hal_time_delay_ms(uint32_t delay) { mp_hal_delay_ms(delay); + // if the delay was cut short by a CTRL-C then clear the keyboard exception + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + { + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + } } From 80fdb18da130afed96316bdcd05e39134aea619e Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Tue, 16 Jun 2020 05:50:40 +0000 Subject: [PATCH 802/919] Translated using Weblate (German) Currently translated at 98.0% (749 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/master/de/ --- locale/de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 76a0eec831..1359ce6dd0 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-29 17:42+0000\n" -"Last-Translator: Thomas Friehoff \n" +"PO-Revision-Date: 2020-06-16 18:24+0000\n" +"Last-Translator: Andreas Buchen \n" "Language-Team: German \n" "Language: de_DE\n" @@ -17,7 +17,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.1-dev\n" +"X-Generator: Weblate 4.1.1-dev\n" #: main.c msgid "" @@ -1717,7 +1717,7 @@ msgstr "" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "WatchDogTimer läuft aktuell nicht" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" From 23da0fa99cce43941c0736b1bd24ed80ca89a991 Mon Sep 17 00:00:00 2001 From: Mark Olsson Date: Wed, 17 Jun 2020 20:48:04 +0200 Subject: [PATCH 803/919] Fixes issue with memory alignment in STM32 When compiling with optimizations on, an issue occurs where the claimed_pins/never_reset_pins memory location is shared with another variable. This causes some bad memory read, so the USB pins ended up being reset. Setting these to have an alignment of 4 bytes resolves this. Tested on nucleo_f746zg --- ports/stm/common-hal/microcontroller/Pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index e966f709f6..f474414b39 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -55,7 +55,7 @@ bool neopixel_in_use; STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; -STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; +STATIC uint16_t __ALIGNED(4) never_reset_pins[GPIO_PORT_COUNT]; void reset_all_pins(void) { // Reset claimed pins From 178be2e3c9ec76db03a379a2c26d56a667bf8840 Mon Sep 17 00:00:00 2001 From: Florin Trutiu Date: Fri, 19 Jun 2020 18:56:20 +0300 Subject: [PATCH 804/919] loc_ber_m4_base_board --- .github/workflows/build.yml | 1 + .../boards/loc_ber_m4_base_board/board.c | 39 +++++++++++++++ .../loc_ber_m4_base_board/mpconfigboard.h | 32 ++++++++++++ .../loc_ber_m4_base_board/mpconfigboard.mk | 17 +++++++ .../boards/loc_ber_m4_base_board/pins.c | 49 +++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/board.c create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f312bc0931..9945024d24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,6 +195,7 @@ jobs: - "itsybitsy_m4_express" - "itsybitsy_nrf52840_express" - "kicksat-sprite" + - "loc_ber_m4_base_board" - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - "meowbit_v121" diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h new file mode 100644 index 0000000000..cbc7b25c16 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.h @@ -0,0 +1,32 @@ +#define MICROPY_HW_BOARD_NAME "LoC BeR M4 base board" +#define MICROPY_HW_MCU_NAME "samd51g19" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// This is for Rev B +#define MICROPY_HW_LED_STATUS (&pin_PA22) + +#define MICROPY_HW_APA102_MOSI (&pin_PB03) +#define MICROPY_HW_APA102_SCK (&pin_PB02) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// DotStar pins, QSPI CS, and QSPI SCK +#define MICROPY_PORT_B (PORT_PB02 | PORT_PB03 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA13) +#define DEFAULT_I2C_BUS_SDA (&pin_PA12) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA01) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA00) +#define DEFAULT_SPI_BUS_MISO (&pin_PB23) + +#define DEFAULT_UART_BUS_RX (&pin_PA16) +#define DEFAULT_UART_BUS_TX (&pin_PA17) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk new file mode 100644 index 0000000000..e88127afd2 --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x802C +USB_PRODUCT = "LoC BeR M4 base board" +USB_MANUFACTURER = "Zoomax" + +CHIP_VARIANT = SAMD51G19A +CHIP_FAMILY = samd51 + +INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_FULL_BUILD = 0 + +LONGINT_IMPL = MPZ + +# No I2S on SAMD51G +CIRCUITPY_AUDIOBUSIO = 0 + +CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c new file mode 100644 index 0000000000..6d0f34c7da --- /dev/null +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c @@ -0,0 +1,49 @@ +#include "shared-bindings/board/__init__.h" + +// This mapping only includes functional names because pins broken +// out on connectors are labeled with their MCU name available from +// microcontroller.pin. +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA06) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA22) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB23) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PB02) }, + { 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_OBJ_NEW_QSTR(MP_QSTR_SCK_2), MP_ROM_PTR(&pin_PB10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI_2), MP_ROM_PTR(&pin_PA08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO_2), MP_ROM_PTR(&pin_PA09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CS_2), MP_ROM_PTR(&pin_PB11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_WP_2), MP_ROM_PTR(&pin_PA10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_HOLD_2), MP_ROM_PTR(&pin_PA11) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From b31654959071ee23b16e636938831daaab911bac Mon Sep 17 00:00:00 2001 From: Florin Trutiu Date: Fri, 19 Jun 2020 19:26:29 +0300 Subject: [PATCH 805/919] Added the new assigned VID/PID pair --- ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk index e88127afd2..55d6fa78e6 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x802C +USB_PID = 0x80B8 USB_PRODUCT = "LoC BeR M4 base board" USB_MANUFACTURER = "Zoomax" From 6a76e1571b7303f08dd90948bce44042716cc4a0 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:30:18 -0500 Subject: [PATCH 806/919] Added stack trace after a sleep ctrl-c interrupt --- shared-module/time/__init__.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index fad72c4b26..b83c3ca519 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -28,6 +28,7 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" #include "py/obj.h" +#include "py/nlr.h" #include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { @@ -47,6 +48,7 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From 99789289d8f2a1d6284caa8ae788ca530e7deb79 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:33:43 -0500 Subject: [PATCH 807/919] Update __init__.c --- shared-module/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index b83c3ca519..dd232e755e 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -48,7 +48,7 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + MP_STATE_VM (mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From beb80e75458168dd475f2153179bd786c867f380 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 12:38:55 -0500 Subject: [PATCH 808/919] removed trailing whitespace --- shared-module/time/__init__.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index dd232e755e..559e224a3f 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -48,7 +48,8 @@ void common_hal_time_delay_ms(uint32_t delay) { // if the delay was cut short by a CTRL-C then clear the keyboard exception if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - MP_STATE_VM (mp_pending_exception) = MP_OBJ_NULL; + // clear exception and generate stacktrace + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } } From 1687c8b1e38aa646639455e141c28e724da4d269 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 19 Jun 2020 15:05:51 -0400 Subject: [PATCH 809/919] delay 1ms on SAMD51 when reading processor voltage --- .../atmel-samd/common-hal/microcontroller/Processor.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index 1e0b8fa791..2ca3ab30bd 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -61,6 +61,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "py/mphal.h" #include "common-hal/microcontroller/Processor.h" #include "samd/adc.h" @@ -286,11 +287,15 @@ float common_hal_mcu_processor_get_voltage(void) { #ifdef SAMD51 hri_supc_set_VREF_SEL_bf(SUPC, SUPC_VREF_SEL_1V0_Val); - // ONDEMAND must be clear, and VREFOE must be set, or else the ADC conversion will not complete. - // See https://community.atmel.com/forum/samd51-using-intref-adc-voltage-reference - hri_supc_clear_VREF_ONDEMAND_bit(SUPC); hri_supc_set_VREF_VREFOE_bit(SUPC); + adc_sync_set_reference(&adc, ADC_REFCTRL_REFSEL_INTREF_Val); + + // On some processor samples, the ADC will hang trying to read the voltage. A simple + // delay after setting the SUPC bits seems to fix things. This appears to be due to VREFOE + // startup time. There is no synchronization bit to check. + // See https://community.atmel.com/forum/samd51-using-intref-adc-voltage-reference + mp_hal_delay_ms(1); #endif adc_sync_set_resolution(&adc, ADC_CTRLB_RESSEL_12BIT_Val); From e381f593ff2071d8f40c7cd049fbdb924b3c1faa Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 19:00:03 -0500 Subject: [PATCH 810/919] Moved changes to supervisor/shared/tick.c --- shared-module/time/__init__.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 559e224a3f..2e43799415 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -28,7 +28,6 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" #include "py/obj.h" -#include "py/nlr.h" #include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { @@ -45,11 +44,4 @@ uint64_t common_hal_time_monotonic_ns(void) { void common_hal_time_delay_ms(uint32_t delay) { mp_hal_delay_ms(delay); - // if the delay was cut short by a CTRL-C then clear the keyboard exception - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) - { - // clear exception and generate stacktrace - MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); - } } From 0b52359190490ab4a821d3998ce053a6fb23f28c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Fri, 19 Jun 2020 19:02:43 -0500 Subject: [PATCH 811/919] Generate stacktrace and reset exception for ctrl-c interrupt Added code in mp_hal_delay_ms() to generate stacktrace and reset exception for ctrl-c interrupt --- supervisor/shared/tick.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 47395bd602..001db0f354 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -105,6 +105,12 @@ void mp_hal_delay_ms(mp_uint_t delay) { if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + { + // clear exception and generate stacktrace + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; + nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); + } break; } remaining = end_tick - port_get_raw_ticks(NULL); From 182a8733a4acf356b848714c1f2e85190a27da0c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Sun, 21 Jun 2020 13:28:26 -0500 Subject: [PATCH 812/919] Rework handling of ctrl-c interrupt --- supervisor/shared/tick.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 001db0f354..3842b67d56 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -102,15 +102,15 @@ void mp_hal_delay_ms(mp_uint_t delay) { while (remaining > 0) { RUN_BACKGROUND_TASKS; // Check to see if we've been CTRL-Ced by autoreload or the user. - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)) || - MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || - WATCHDOG_EXCEPTION_CHECK()) { - if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) + if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); - } + } + if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || + WATCHDOG_EXCEPTION_CHECK()) { + // stop sleeping immediately break; } remaining = end_tick - port_get_raw_ticks(NULL); From dff1c07e185831e145fb77f152194c408d972d8b Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sun, 21 Jun 2020 03:51:19 +0000 Subject: [PATCH 813/919] Translated using Weblate (Spanish) Currently translated at 69.7% (533 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/locale/es.po b/locale/es.po index 5fe0f945ad..074230cabb 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-05-17 20:56+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2020-06-22 04:41+0000\n" +"Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.1-dev\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" @@ -32,12 +32,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Reporte un problema con el contenido de su unidad CIRCUITPY en\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Para salir, favor reinicie la tarjeta sin " #: py/obj.c msgid " File \"%q\"" @@ -59,7 +64,7 @@ msgstr "%%c requiere int o char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -75,7 +80,7 @@ msgstr "%q indices deben ser enteros, no %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "%q lista debe ser una lista" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -86,7 +91,7 @@ msgstr "%q debe ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q debe ser una tupla de longitud 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -152,11 +157,11 @@ msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "El objeto '%s' no puede asignar al atributo '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "El objeto '%s' no admite '%q'" #: py/obj.c #, c-format @@ -268,7 +273,7 @@ msgstr "La dirección debe ser %d bytes de largo" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "Tipo de dirección fuera de rango" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -309,11 +314,11 @@ msgstr "Todos los timers en uso" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Ya se encuentra publicando." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "El pin proporcionado no soporta AnalogIn" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -344,7 +349,7 @@ msgstr "Valores del array deben ser bytes individuales." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Como máximo %d %q se puede especificar (no %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." @@ -377,7 +382,7 @@ msgstr "Bits depth debe ser múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Ambos RX y TX requeridos para control de flujo" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -387,7 +392,7 @@ msgstr "Ambos pines deben soportar interrupciones por hardware" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "El brillo debe ser 0-1.0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -411,17 +416,17 @@ msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer no es un bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "El buffer es muy pequeño" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -429,7 +434,7 @@ msgstr "Buffer debe ser de longitud 1 como minimo" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "Buffer demasiado grande e incapaz de asignar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format @@ -452,11 +457,11 @@ msgstr "Bytes debe estar entre 0 y 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" From ac2a4608da7d1f0cbcf501b24fab7bc5c2072d22 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Mon, 22 Jun 2020 04:56:36 +0000 Subject: [PATCH 814/919] Translated using Weblate (Spanish) Currently translated at 77.7% (594 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 124 ++++++++++++++++++++++++++------------------------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/locale/es.po b/locale/es.po index 074230cabb..8ecc00931b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-22 04:41+0000\n" +"PO-Revision-Date: 2020-06-22 10:35+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -370,7 +370,7 @@ msgstr "" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Por debajo de taza mínima de refrescamiento" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -513,7 +513,7 @@ msgstr "No se puede asignar un valor cuando la dirección es input." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "No se puede especificar RTS o CTS en modo RS485" #: py/objslice.c msgid "Cannot subclass slice" @@ -529,7 +529,7 @@ msgstr "No se puede obtener inequívocamente sizeof escalar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "No puede variar la frecuencia en un temporizador que ya está en uso" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -541,13 +541,15 @@ msgstr "CharateristicBuffer escritura no proporcionada" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "El código central de CircuitPython se estrelló con fuerza. ¡Whoops!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"CircuitPython está en modo seguro porque presionó el botón de reinicio " +"durante el arranque. Presione nuevamente para salir del modo seguro.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -575,14 +577,16 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"La conexión se ha desconectado y ya no se puede usar. Crea una nueva " +"conexión." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Archivo .mpy corrupto" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Código crudo corrupto" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -590,31 +594,31 @@ msgstr "No se puede inicializar la UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "No se pudo inicializar el canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "No se pudo inicializar el temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "No se pudo reiniciar el canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "No se pudo reiniciar el temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "No se pudo reiniciar el PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "No se pudo iniciar el PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "No se pudo iniciar la interrupción, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" @@ -640,11 +644,11 @@ msgstr "" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Error de inicio del canal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Error de inicio del dispositivo DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -669,16 +673,16 @@ msgstr "Capacidad de destino es mas pequeña que destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Dispositivo en uso" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "DigitalInOut no es compatible con un pin dado" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "La pantalla debe tener un espacio de color de 16 bits." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -718,7 +722,7 @@ msgstr "Se esperaba una Característica." #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Se esperaba un servicio" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -727,7 +731,7 @@ msgstr "Se esperaba un UUID" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Se esperaba una dirección" #: shared-module/_pixelbuf/PixelBuf.c #, c-format @@ -736,7 +740,7 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "No se admiten anuncios extendidos con respuesta de escaneo." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" @@ -766,15 +770,15 @@ msgstr "Falló la asignación del buffer RX de %d bytes" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Error al conectar: error interno" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Error al conectar: tiempo de espera agotado" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Error al analizar el archivo MP3" #: ports/nrf/sd_mutex.c #, c-format @@ -783,7 +787,7 @@ msgstr "No se puede liberar el mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Error al escribir al flash interno." #: py/moduerrno.c msgid "File exists" @@ -796,6 +800,7 @@ msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"La frecuencia debe coincidir con PWMOut existente usando este temporizador" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -806,7 +811,7 @@ msgstr "La función requiere lock" #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "El grupo ya está siendo utilizado" #: shared-module/displayio/Group.c msgid "Group full" @@ -815,11 +820,11 @@ msgstr "Group lleno" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware ocupado, pruebe pines alternativos" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "Hardware en uso, pruebe pines alternativos" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -827,7 +832,7 @@ msgstr "Operación I/O en archivo cerrado" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Error de inicio de I2C" #: extmod/machine_i2c.c msgid "I2C operation not supported" @@ -836,7 +841,7 @@ msgstr "operación I2C no soportada" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV debe tener %d bytes de longitud" #: py/persistentcode.c msgid "" @@ -856,11 +861,11 @@ msgstr "error Input/output" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Autenticación insuficiente" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Cifrado insuficiente" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" @@ -869,7 +874,7 @@ msgstr "" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Error interno #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -878,7 +883,7 @@ msgstr "Pin %q inválido" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Valor de unidad de ADC no válido" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -886,11 +891,11 @@ msgstr "Archivo BMP inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Pin suministrado inválido para DAC" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "Selección de pin I2C no válida" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -900,11 +905,11 @@ msgstr "Frecuencia PWM inválida" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "Selección de pin SPI no válida" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "Selección de pin UART no válida" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -920,7 +925,7 @@ msgstr "Tamaño de buffer inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "Cadena de byteorder inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" @@ -944,7 +949,7 @@ msgstr "Formato de fragmento de formato no válido" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "Frecuencia suministrada no válida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." @@ -986,7 +991,7 @@ msgstr "pines inválidos" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Pines inválidos para PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -995,7 +1000,7 @@ msgstr "Polaridad inválida" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Propiedades inválidas" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." @@ -1064,7 +1069,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Error fatal de MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -1072,7 +1077,7 @@ msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "Falta el pin MISO o MOSI" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." @@ -1080,7 +1085,7 @@ msgstr "Debe de ser una subclase de %q" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Debe proporcionar un pin MISO o MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1089,7 +1094,7 @@ msgstr "" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nombre muy largo" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" @@ -1107,11 +1112,11 @@ msgstr "No se encontró el canal DMA" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Sin pin MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Sin pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1131,7 +1136,7 @@ msgstr "Relojes no disponibles" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Sin conexión: no se puede determinar la longitud" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1160,15 +1165,15 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "No hay soporte de entero largo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "No hay más temporizadores disponibles en este pin." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "No hay pulldown en el pin; 1Mohm recomendado" #: py/moduerrno.c msgid "No space left on device" @@ -1180,7 +1185,7 @@ msgstr "No existe el archivo/directorio" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "No hay temporizador disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1261,15 +1266,15 @@ msgstr "Pin no tiene capacidad ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "El pin es solo de entrada" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "El pin debe admitir interrupciones de hardware" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Número de pin ya reservado por EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1280,13 +1285,12 @@ msgid "" msgstr "" #: py/builtinhelp.c -#, fuzzy msgid "Plus any modules on the filesystem\n" -msgstr "Incapaz de montar de nuevo el sistema de archivos" +msgstr "Además de cualquier módulo en el sistema de archivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "El polígono necesita al menos 3 puntos" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" From 579784c4a070293ae8561b7fe1acd41d993847eb Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 22 Jun 2020 12:36:00 +0200 Subject: [PATCH 815/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/es.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/es.po b/locale/es.po index 8ecc00931b..43e80a1da6 100644 --- a/locale/es.po +++ b/locale/es.po @@ -64,7 +64,8 @@ msgstr "%%c requiere int o char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" +msgstr "" +"%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" From de14b5b02f1ceebabca8f79c8e166e673f039aec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 8 May 2020 10:48:46 -0500 Subject: [PATCH 816/919] flash: Correctly signal error on invalid flash read This logic was intended to mirror what is done for "write", but the wrong variable name was repeated twice. --- supervisor/shared/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 298e7d83e4..9f52ddbc48 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -88,7 +88,7 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { - if (block_num > 1) { + if (num_blocks > 1) { return 1; // error } // fake the MBR so we can decide on our own partition table From 5a3a0a50924e8306690769b0683f836cb9608145 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 21 May 2020 11:02:54 -0500 Subject: [PATCH 817/919] stm: Makefile: sort files in SRC_STM32 --- ports/stm/Makefile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index a7b519ffcb..08cb36ddf2 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -154,43 +154,43 @@ CFLAGS += \ -DCFG_TUD_MIDI_TX_BUFSIZE=128 SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\ + hal.c \ hal_adc.c \ hal_adc_ex.c \ + hal_cortex.c \ hal_dac.c \ hal_dac_ex.c \ + hal_dma.c \ + hal_dma_ex.c \ + hal_exti.c \ + hal_flash.c \ + hal_flash_ex.c \ + hal_gpio.c \ hal_i2c.c \ hal_i2c_ex.c \ + hal_pwr.c \ + hal_pwr_ex.c \ hal_qspi.c \ + hal_rcc.c \ + hal_rcc_ex.c \ hal_rng.c \ hal_rtc.c \ hal_rtc_ex.c \ + hal_sd.c \ hal_spi.c \ hal_tim.c \ hal_tim_ex.c \ hal_uart.c \ hal_usart.c \ - hal_rcc.c \ - hal_rcc_ex.c \ - hal_flash.c \ - hal_flash_ex.c \ - hal_gpio.c \ - hal_dma_ex.c \ - hal_dma.c \ - hal_pwr.c \ - hal_pwr_ex.c \ - hal_cortex.c \ - hal.c \ - hal_exti.c \ - hal_sd.c \ - ll_gpio.c \ ll_adc.c \ - ll_i2c.c \ ll_dma.c \ + ll_exti.c \ + ll_gpio.c \ + ll_i2c.c \ + ll_rcc.c \ ll_sdmmc.c \ ll_usart.c \ - ll_rcc.c \ ll_utils.c \ - ll_exti.c \ ) # Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks. From a580f0f1c4f2a221ddf3ff169eff79158bd8acf6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 21 Jun 2020 08:31:26 -0500 Subject: [PATCH 818/919] _pew: move to common-hal I noticed that this code was referring to samd-specific functionality, and isn't enabled except in one samd board (pewpew10). Move it. There is incomplte support for _pew in mimxrt10xx which then caused build errors; adding a #if guard to check for _pew being enabled fixes it. The _pew module is not likely to be important on mimxrt but I'll leave the choice to remove it to someone else. --- {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.c | 0 {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.h | 0 .../atmel-samd/common-hal}/_pew/__init__.c | 0 .../atmel-samd/common-hal}/_pew/__init__.h | 0 ports/atmel-samd/supervisor/port.c | 4 +++- ports/atmel-samd/timer_handler.c | 2 +- ports/mimxrt10xx/supervisor/port.c | 2 ++ py/circuitpy_defns.mk | 4 ++-- shared-bindings/_pew/PewPew.c | 2 +- shared-bindings/_pew/__init__.c | 2 +- 10 files changed, 10 insertions(+), 6 deletions(-) rename {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.c (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/PewPew.h (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/__init__.c (100%) rename {shared-module => ports/atmel-samd/common-hal}/_pew/__init__.h (100%) diff --git a/shared-module/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c similarity index 100% rename from shared-module/_pew/PewPew.c rename to ports/atmel-samd/common-hal/_pew/PewPew.c diff --git a/shared-module/_pew/PewPew.h b/ports/atmel-samd/common-hal/_pew/PewPew.h similarity index 100% rename from shared-module/_pew/PewPew.h rename to ports/atmel-samd/common-hal/_pew/PewPew.h diff --git a/shared-module/_pew/__init__.c b/ports/atmel-samd/common-hal/_pew/__init__.c similarity index 100% rename from shared-module/_pew/__init__.c rename to ports/atmel-samd/common-hal/_pew/__init__.c diff --git a/shared-module/_pew/__init__.h b/ports/atmel-samd/common-hal/_pew/__init__.h similarity index 100% rename from shared-module/_pew/__init__.h rename to ports/atmel-samd/common-hal/_pew/__init__.h diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 2b3e9826f8..74c9849976 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -85,7 +85,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif -#include "shared-module/_pew/PewPew.h" +#if CIRCUITPY_PEW +#include "common-hal/_pew/PewPew.h" +#endif extern volatile bool mp_msc_enabled; diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 34d819e162..16d65334e0 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -31,7 +31,7 @@ #include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseOut.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" #include "common-hal/frequencyio/FrequencyIn.h" extern void _PM_IRQ_HANDLER(void); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index ed5824732d..0b53a79f07 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -53,7 +53,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif +#if CIRCUITPY_PEW #include "shared-module/_pew/PewPew.h" +#endif #include "supervisor/shared/tick.h" #include "clocks.h" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 67fbde6e4f..cdfb4c6b69 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -259,6 +259,8 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ + _pew/__init__.c \ + _pew/PewPew.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -396,8 +398,6 @@ SRC_SHARED_MODULE_ALL = \ terminalio/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - _pew/__init__.c \ - _pew/PewPew.c \ _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 82bf04a617..352ef38f27 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -31,7 +31,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" #include "supervisor/shared/translate.h" //| class PewPew: diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index 6e0070d8e2..498beaf1c9 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -27,7 +27,7 @@ #include "py/runtime.h" #include "py/mphal.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" STATIC mp_obj_t get_pressed(void) { pew_obj_t *pew = MP_STATE_VM(pew_singleton); From 8a760b065733fb27ad42f78d606beed025d8106d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Jun 2020 10:27:37 -0500 Subject: [PATCH 819/919] stm: Pin.c: Compute GPIO_PORT_COUNT instead of specifying manually --- ports/stm/common-hal/microcontroller/Pin.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index e966f709f6..b0e3c7015f 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -37,23 +37,20 @@ bool neopixel_in_use; #endif #if defined(TFBGA216) - #define GPIO_PORT_COUNT 11 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK}; #elif defined(LQFP144) - #define GPIO_PORT_COUNT 7 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; #elif defined(LQFP100_f4) || (LQFP100_x7) - #define GPIO_PORT_COUNT 5 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 4 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + GPIO_TypeDef * ports[] = {GPIOA, GPIOB, GPIOC}; #endif +#define GPIO_PORT_COUNT (MP_ARRAY_SIZE(ports)) + STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; From 6638bc32c3c989c3bd4ffc761bd1462ed06828be Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 9 Jun 2020 14:06:54 -0500 Subject: [PATCH 820/919] samd: Makefile: Regularize whitespace --- ports/atmel-samd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index d0ab65e6b7..8eb24e8361 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -206,7 +206,7 @@ SRC_ASF += \ else ifeq ($(CHIP_FAMILY), samd51) SRC_ASF += \ - hal/src/hal_rand_sync.c \ + hal/src/hal_rand_sync.c \ hpl/core/hpl_core_m4.c \ hpl/mclk/hpl_mclk.c \ hpl/osc32kctrl/hpl_osc32kctrl.c \ From a770b5a919338b9df068bd0bca14edec9996bc31 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 16 Jun 2020 11:31:07 -0500 Subject: [PATCH 821/919] never_reset_pin: Move pin validity check before first use of pin number --- ports/atmel-samd/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index cf78673b20..3c214a9f41 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -110,12 +110,12 @@ void never_reset_pin_number(uint8_t pin_number) { } void reset_pin_number(uint8_t pin_number) { - never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number)); - if (pin_number >= PORT_BITS) { return; } + never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number)); + #ifdef MICROPY_HW_NEOPIXEL if (pin_number == MICROPY_HW_NEOPIXEL->number) { neopixel_in_use = false; From a7b36f724f16a204f6d324e70e3e1429389249fe Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 21 Jun 2020 08:33:33 -0500 Subject: [PATCH 822/919] circuitpy_defns.mk: Sort several lists of source files and regularize whitespace in one spot --- py/circuitpy_defns.mk | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index cdfb4c6b69..fb8f46bd87 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -249,7 +249,6 @@ endif # All possible sources are listed here, and are filtered by SRC_PATTERNS in SRC_COMMON_HAL SRC_COMMON_HAL_ALL = \ - _bleio/__init__.c \ _bleio/Adapter.c \ _bleio/Attribute.c \ _bleio/Characteristic.c \ @@ -259,18 +258,19 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ - _pew/__init__.c \ + _bleio/__init__.c \ _pew/PewPew.c \ + _pew/__init__.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ - audiobusio/__init__.c \ audiobusio/I2SOut.c \ audiobusio/PDMIn.c \ - audiopwmio/__init__.c \ - audiopwmio/PWMAudioOut.c \ - audioio/__init__.c \ + audiobusio/__init__.c \ audioio/AudioOut.c \ + audioio/__init__.c \ + audiopwmio/PWMAudioOut.c \ + audiopwmio/__init__.c \ board/__init__.c \ busio/I2C.c \ busio/SPI.c \ @@ -281,8 +281,8 @@ SRC_COMMON_HAL_ALL = \ digitalio/DigitalInOut.c \ digitalio/__init__.c \ displayio/ParallelBus.c \ - frequencyio/__init__.c \ frequencyio/FrequencyIn.c \ + frequencyio/__init__.c \ i2cslave/I2CSlave.c \ i2cslave/__init__.c \ microcontroller/Pin.c \ @@ -292,23 +292,23 @@ SRC_COMMON_HAL_ALL = \ nvm/ByteArray.c \ nvm/__init__.c \ os/__init__.c \ - rgbmatrix/RGBMatrix.c \ - rgbmatrix/__init__.c \ + ps2io/Ps2.c \ + ps2io/__init__.c \ pulseio/PWMOut.c \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ pulseio/__init__.c \ - ps2io/Ps2.c \ - ps2io/__init__.c \ + rgbmatrix/RGBMatrix.c \ + rgbmatrix/__init__.c \ rotaryio/IncrementalEncoder.c \ rotaryio/__init__.c \ rtc/RTC.c \ rtc/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ - watchdog/__init__.c \ watchdog/WatchDogMode.c \ watchdog/WatchDogTimer.c \ + watchdog/__init__.c \ SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) @@ -320,13 +320,13 @@ $(filter $(SRC_PATTERNS), \ _bleio/Address.c \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ + _eve/__init__.c \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ fontio/Glyph.c \ - microcontroller/RunMode.c \ math/__init__.c \ - _eve/__init__.c \ + microcontroller/RunMode.c \ ) SRC_BINDINGS_ENUMS += \ @@ -337,29 +337,30 @@ SRC_SHARED_MODULE_ALL = \ _bleio/Attribute.c \ _bleio/ScanEntry.c \ _bleio/ScanResults.c \ + _eve/__init__.c \ _pixelbuf/PixelBuf.c \ _pixelbuf/__init__.c \ _stage/Layer.c \ _stage/Text.c \ _stage/__init__.c \ - audiopwmio/__init__.c \ - audioio/__init__.c \ - audiocore/__init__.c \ + aesio/__init__.c \ + aesio/aes.c \ audiocore/RawSample.c \ audiocore/WaveFile.c \ - audiomixer/__init__.c \ + audiocore/__init__.c \ + audioio/__init__.c \ audiomixer/Mixer.c \ audiomixer/MixerVoice.c \ - audiomp3/__init__.c \ + audiomixer/__init__.c \ audiomp3/MP3Decoder.c \ + audiomp3/__init__.c \ + audiopwmio/__init__.c \ bitbangio/I2C.c \ bitbangio/OneWire.c \ bitbangio/SPI.c \ bitbangio/__init__.c \ board/__init__.c \ busio/OneWire.c \ - aesio/__init__.c \ - aesio/aes.c \ displayio/Bitmap.c \ displayio/ColorConverter.c \ displayio/Display.c \ @@ -372,11 +373,6 @@ SRC_SHARED_MODULE_ALL = \ displayio/Shape.c \ displayio/TileGrid.c \ displayio/__init__.c \ - vectorio/Circle.c \ - vectorio/Rectangle.c \ - vectorio/Polygon.c \ - vectorio/VectorShape.c \ - vectorio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ @@ -385,20 +381,24 @@ SRC_SHARED_MODULE_ALL = \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ gamepadshift/__init__.c \ + network/__init__.c \ os/__init__.c \ random/__init__.c \ - socket/__init__.c \ - network/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ + socket/__init__.c \ storage/__init__.c \ struct/__init__.c \ - time/__init__.c \ terminalio/Terminal.c \ terminalio/__init__.c \ + time/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - _eve/__init__.c + vectorio/Circle.c \ + vectorio/Polygon.c \ + vectorio/Rectangle.c \ + vectorio/VectorShape.c \ + vectorio/__init__.c \ # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL)) From d43449a6d613c5a6a386231745f6fca91b352b79 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 22 Jun 2020 10:17:44 -0500 Subject: [PATCH 823/919] sparkfun samd51 thing plus: Fix board.I2C() This had the SDA and SCL pins transposed, so nothing worked. --- .../boards/sparkfun_samd51_thing_plus/mpconfigboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h index a5dee295bf..97a4465a19 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/mpconfigboard.h @@ -18,8 +18,8 @@ #define BOARD_HAS_CRYSTAL 1 -#define DEFAULT_I2C_BUS_SCL (&pin_PA22) -#define DEFAULT_I2C_BUS_SDA (&pin_PA23) +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) #define DEFAULT_SPI_BUS_SCK (&pin_PB13) #define DEFAULT_SPI_BUS_MOSI (&pin_PB12) From 65512cef1c278258f525422fe57271ffac6f51b0 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 22 Jun 2020 15:59:15 -0500 Subject: [PATCH 824/919] Update tick.c --- supervisor/shared/tick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 3842b67d56..106ff53f89 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -104,13 +104,13 @@ void mp_hal_delay_ms(mp_uint_t delay) { // Check to see if we've been CTRL-Ced by autoreload or the user. if(MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) { - // clear exception and generate stacktrace + // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); } if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { - // stop sleeping immediately + // stop sleeping immediately break; } remaining = end_tick - port_get_raw_ticks(NULL); From 30a1624d59830e9eb73340e329586beec704b713 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 22 Jun 2020 20:18:55 -0500 Subject: [PATCH 825/919] Removed unneeded #includes --- shared-module/time/__init__.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/shared-module/time/__init__.c b/shared-module/time/__init__.c index 2e43799415..347e68ae02 100644 --- a/shared-module/time/__init__.c +++ b/shared-module/time/__init__.c @@ -27,8 +27,6 @@ #include "py/mphal.h" #include "supervisor/port.h" #include "supervisor/shared/tick.h" -#include "py/obj.h" -#include "py/mpstate.h" uint64_t common_hal_time_monotonic(void) { return supervisor_ticks_ms64(); From da733c01da5c19d377aa215d25abdcd074fbc846 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Jun 2020 14:13:59 -0500 Subject: [PATCH 826/919] atmel-samd: Add support for SAM E54 family MCUs This introduces the new macro SAM_D5X_E5X. This is mostly the same as SAMD51 before, except in a few places where a special case for SAME54 is required --- ports/atmel-samd/Makefile | 55 +- ports/atmel-samd/asf4 | 2 +- .../asf4_conf/same54/hpl_adc_config.h | 303 + .../asf4_conf/same54/hpl_dac_config.h | 169 + .../asf4_conf/same54/hpl_dmac_config.h | 7277 +++++++++++++++++ .../asf4_conf/same54/hpl_gclk_config.h | 924 +++ .../asf4_conf/same54/hpl_mclk_config.h | 104 + .../asf4_conf/same54/hpl_nvmctrl_config.h | 36 + .../asf4_conf/same54/hpl_osc32kctrl_config.h | 163 + .../asf4_conf/same54/hpl_oscctrl_config.h | 634 ++ .../asf4_conf/same54/hpl_rtc_config.h | 145 + .../asf4_conf/same54/hpl_sercom_config.h | 751 ++ .../asf4_conf/same54/hpl_systick_config.h | 18 + .../asf4_conf/same54/hpl_tc_config.h | 209 + .../asf4_conf/same54/hpl_trng_config.h | 27 + .../asf4_conf/same54/hpl_usb_config.h | 413 + .../asf4_conf/same54/peripheral_clk_config.h | 1006 +++ .../atmel-samd/asf4_conf/same54/usbd_config.h | 850 ++ ports/atmel-samd/bindings/samd/Clock.c | 2 +- ports/atmel-samd/common-hal/_pew/PewPew.c | 4 +- .../common-hal/analogio/AnalogOut.c | 20 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 26 +- .../atmel-samd/common-hal/audiobusio/PDMIn.c | 20 +- .../atmel-samd/common-hal/audioio/AudioOut.c | 46 +- .../atmel-samd/common-hal/audioio/AudioOut.h | 2 +- ports/atmel-samd/common-hal/busio/UART.c | 2 +- .../common-hal/frequencyio/FrequencyIn.c | 44 +- .../common-hal/frequencyio/FrequencyIn.h | 2 +- .../common-hal/microcontroller/Pin.c | 8 +- .../common-hal/microcontroller/Processor.c | 8 +- .../common-hal/neopixel_write/__init__.c | 17 +- ports/atmel-samd/common-hal/os/__init__.c | 6 +- ports/atmel-samd/common-hal/pulseio/PWMOut.c | 16 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 6 +- .../atmel-samd/common-hal/pulseio/PulseOut.c | 4 +- ports/atmel-samd/mpconfigport.h | 14 +- ports/atmel-samd/mphalport.c | 2 +- ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/internal_flash.c | 8 +- ports/atmel-samd/supervisor/port.c | 33 +- ports/atmel-samd/supervisor/same54_cpu.s | 27 + ports/atmel-samd/supervisor/usb.c | 6 +- 42 files changed, 13257 insertions(+), 154 deletions(-) create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/usbd_config.h create mode 100755 ports/atmel-samd/supervisor/same54_cpu.s diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 8eb24e8361..5f901a1991 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -86,17 +86,27 @@ INC += -I. \ # NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt. ifeq ($(CHIP_FAMILY), samd21) +PERIPHERALS_CHIP_FAMILY=samd21 CFLAGS += -Os -DNDEBUG # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 endif ifeq ($(CHIP_FAMILY), samd51) +PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x CFLAGS += -Os -DNDEBUG # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=256 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024 endif +ifeq ($(CHIP_FAMILY), same54) +PERIPHERALS_CHIP_FAMILY=sam_d5x_e5x +CFLAGS += -Os -DNDEBUG +# TinyUSB defines +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD51 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=256 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=256 -DCFG_TUD_MSC_BUFSIZE=1024 +endif + +$(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb @@ -152,7 +162,16 @@ CFLAGS += \ -mcpu=cortex-m4 \ -mfloat-abi=hard \ -mfpu=fpv4-sp-d16 \ - -DSAMD51 + -DSAM_D5X_E5X -DSAMD51 +endif +ifeq ($(CHIP_FAMILY), same54) +CFLAGS += \ + -mthumb \ + -mabi=aapcs-linux \ + -mcpu=cortex-m4 \ + -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 \ + -DSAM_D5X_E5X -DSAME54 endif @@ -171,6 +190,9 @@ BOOTLOADER_SIZE := 0x2000 else ifeq ($(CHIP_FAMILY), samd51) LDFLAGS += -mthumb -mcpu=cortex-m4 BOOTLOADER_SIZE := 0x4000 +else ifeq ($(CHIP_FAMILY), same54) +LDFLAGS += -mthumb -mcpu=cortex-m4 +BOOTLOADER_SIZE := 0x4000 endif SRC_ASF := \ @@ -213,6 +235,15 @@ SRC_ASF += \ hpl/oscctrl/hpl_oscctrl.c \ hpl/trng/hpl_trng.c \ +else ifeq ($(CHIP_FAMILY), same54) +SRC_ASF += \ + hal/src/hal_rand_sync.c \ + hpl/core/hpl_core_m4.c \ + hpl/mclk/hpl_mclk.c \ + hpl/osc32kctrl/hpl_osc32kctrl.c \ + hpl/oscctrl/hpl_oscctrl.c \ + hpl/trng/hpl_trng.c \ + endif SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) @@ -240,15 +271,15 @@ SRC_C = \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ mphalport.c \ - peripherals/samd/$(CHIP_FAMILY)/adc.c \ - peripherals/samd/$(CHIP_FAMILY)/cache.c \ - peripherals/samd/$(CHIP_FAMILY)/clocks.c \ - peripherals/samd/$(CHIP_FAMILY)/dma.c \ - peripherals/samd/$(CHIP_FAMILY)/events.c \ - peripherals/samd/$(CHIP_FAMILY)/external_interrupts.c \ - peripherals/samd/$(CHIP_FAMILY)/pins.c \ - peripherals/samd/$(CHIP_FAMILY)/sercom.c \ - peripherals/samd/$(CHIP_FAMILY)/timers.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/adc.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/cache.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/dma.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/events.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/external_interrupts.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/pins.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/sercom.c \ + peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/timers.c \ peripherals/samd/clocks.c \ peripherals/samd/dma.c \ peripherals/samd/events.c \ @@ -288,7 +319,7 @@ endif # The smallest SAMD51 packages don't have I2S. Everything else does. ifeq ($(CIRCUITPY_AUDIOBUSIO),1) -SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c +SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c endif SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ @@ -317,7 +348,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. -SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c +SRC_QSTR_PREPROCESSOR += peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index 039b5f3bbc..c0eef7b751 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit 039b5f3bbc3f4ba4421e581db290560d59fef625 +Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h new file mode 100644 index 0000000000..13d8151028 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_adc_config.h @@ -0,0 +1,303 @@ +/* Auto-generated config file hpl_adc_config.h */ +#ifndef HPL_ADC_CONFIG_H +#define HPL_ADC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef CONF_ADC_0_ENABLE +#define CONF_ADC_0_ENABLE 1 +#endif + +// Basic Configuration + +// Conversion Result Resolution +// <0x0=>12-bit +// <0x1=>16-bit (averaging must be enabled) +// <0x2=>10-bit +// <0x3=>8-bit +// Defines the bit resolution for the ADC sample values (RESSEL) +// adc_resolution +#ifndef CONF_ADC_0_RESSEL +#define CONF_ADC_0_RESSEL 0x0 +#endif + +// Reference Selection +// <0x0=>Internal bandgap reference +// <0x2=>1/2 VDDANA (only for VDDANA > 2.0V) +// <0x3=>VDDANA +// <0x4=>External reference A +// <0x5=>External reference B +// <0x6=>External reference C +// Select the reference for the ADC (REFSEL) +// adc_reference +#ifndef CONF_ADC_0_REFSEL +#define CONF_ADC_0_REFSEL 0x0 +#endif + +// Prescaler configuration +// <0x0=>Peripheral clock divided by 2 +// <0x1=>Peripheral clock divided by 4 +// <0x2=>Peripheral clock divided by 8 +// <0x3=>Peripheral clock divided by 16 +// <0x4=>Peripheral clock divided by 32 +// <0x5=>Peripheral clock divided by 64 +// <0x6=>Peripheral clock divided by 128 +// <0x7=>Peripheral clock divided by 256 +// These bits define the ADC clock relative to the peripheral clock (PRESCALER) +// adc_prescaler +#ifndef CONF_ADC_0_PRESCALER +#define CONF_ADC_0_PRESCALER 0x3 +#endif + +// Free Running Mode +// When enabled, the ADC is in free running mode and a new conversion will be initiated when a previous conversion completes. (FREERUN) +// adc_freerunning_mode +#ifndef CONF_ADC_0_FREERUN +#define CONF_ADC_0_FREERUN 0 +#endif + +// Differential Mode +// In differential mode, the voltage difference between the MUXPOS and MUXNEG inputs will be converted by the ADC. (DIFFMODE) +// adc_differential_mode +#ifndef CONF_ADC_0_DIFFMODE +#define CONF_ADC_0_DIFFMODE 0 +#endif + +// Positive Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x08=>ADC AIN8 pin +// <0x09=>ADC AIN9 pin +// <0x0A=>ADC AIN10 pin +// <0x0B=>ADC AIN11 pin +// <0x0C=>ADC AIN12 pin +// <0x0D=>ADC AIN13 pin +// <0x0E=>ADC AIN14 pin +// <0x0F=>ADC AIN15 pin +// <0x18=>1/4 scaled core supply +// <0x19=>1/4 Scaled VBAT Supply +// <0x1A=>1/4 scaled I/O supply +// <0x1B=>Bandgap voltage +// <0x1C=>Temperature reference (PTAT) +// <0x1D=>Temperature reference (CTAT) +// <0x1E=>DAC Output +// These bits define the Mux selection for the positive ADC input. (MUXPOS) +// adc_pinmux_positive +#ifndef CONF_ADC_0_MUXPOS +#define CONF_ADC_0_MUXPOS 0x0 +#endif + +// Negative Mux Input Selection +// <0x00=>ADC AIN0 pin +// <0x01=>ADC AIN1 pin +// <0x02=>ADC AIN2 pin +// <0x03=>ADC AIN3 pin +// <0x04=>ADC AIN4 pin +// <0x05=>ADC AIN5 pin +// <0x06=>ADC AIN6 pin +// <0x07=>ADC AIN7 pin +// <0x18=>Internal ground +// <0x19=>I/O ground +// These bits define the Mux selection for the negative ADC input. (MUXNEG) +// adc_pinmux_negative +#ifndef CONF_ADC_0_MUXNEG +#define CONF_ADC_0_MUXNEG 0x0 +#endif + +// + +// Advanced Configuration +// adc_advanced_settings +#ifndef CONF_ADC_0_ADVANCED +#define CONF_ADC_0_ADVANCED 0 +#endif + +// Run in standby +// Indicates whether the ADC will continue running in standby sleep mode or not (RUNSTDBY) +// adc_arch_runstdby +#ifndef CONF_ADC_0_RUNSTDBY +#define CONF_ADC_0_RUNSTDBY 0 +#endif + +// Debug Run +// If enabled, the ADC is running if the CPU is halted by an external debugger. (DBGRUN) +// adc_arch_dbgrun +#ifndef CONF_ADC_0_DBGRUN +#define CONF_ADC_0_DBGRUN 0 +#endif + +// On Demand Control +// Will keep the ADC peripheral running if requested by other peripherals (ONDEMAND) +// adc_arch_ondemand +#ifndef CONF_ADC_0_ONDEMAND +#define CONF_ADC_0_ONDEMAND 0 +#endif + +// Left-Adjusted Result +// When enabled, the ADC conversion result is left-adjusted in the RESULT register. The high byte of the 12-bit result will be present in the upper part of the result register. (LEFTADJ) +// adc_arch_leftadj +#ifndef CONF_ADC_0_LEFTADJ +#define CONF_ADC_0_LEFTADJ 0 +#endif + +// Reference Buffer Offset Compensation Enable +// The accuracy of the gain stage can be increased by enabling the reference buffer offset compensation. This will decrease the input impedance and thus increase the start-up time of the reference. (REFCOMP) +// adc_arch_refcomp +#ifndef CONF_ADC_0_REFCOMP +#define CONF_ADC_0_REFCOMP 0 +#endif + +// Comparator Offset Compensation Enable +// This bit indicates whether the Comparator Offset Compensation is enabled or not (OFFCOMP) +// adc_arch_offcomp +#ifndef CONF_ADC_0_OFFCOMP +#define CONF_ADC_0_OFFCOMP 0 +#endif + +// Digital Correction Logic Enabled +// When enabled, the ADC conversion result in the RESULT register is then corrected for gain and offset based on the values in the GAINCAL and OFFSETCAL registers. (CORREN) +// adc_arch_corren +#ifndef CONF_ADC_0_CORREN +#define CONF_ADC_0_CORREN 0 +#endif + +// Offset Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for offset error before being written to the Result register. (OFFSETCORR) +// adc_arch_offsetcorr +#ifndef CONF_ADC_0_OFFSETCORR +#define CONF_ADC_0_OFFSETCORR 0 +#endif + +// Gain Correction Value <0-4095> +// If the digital correction logic is enabled (CTRLB.CORREN = 1), these bits define how the ADC conversion result is compensated for gain error before being written to the result register. (GAINCORR) +// adc_arch_gaincorr +#ifndef CONF_ADC_0_GAINCORR +#define CONF_ADC_0_GAINCORR 0 +#endif + +// Adjusting Result / Division Coefficient <0-7> +// These bits define the division coefficient in 2n steps. (ADJRES) +// adc_arch_adjres +#ifndef CONF_ADC_0_ADJRES +#define CONF_ADC_0_ADJRES 0x0 +#endif + +// Number of Samples to be Collected +// <0x0=>1 sample +// <0x1=>2 samples +// <0x2=>4 samples +// <0x3=>8 samples +// <0x4=>16 samples +// <0x5=>32 samples +// <0x6=>64 samples +// <0x7=>128 samples +// <0x8=>256 samples +// <0x9=>512 samples +// <0xA=>1024 samples +// Define how many samples should be added together.The result will be available in the Result register (SAMPLENUM) +// adc_arch_samplenum +#ifndef CONF_ADC_0_SAMPLENUM +#define CONF_ADC_0_SAMPLENUM 0x0 +#endif + +// Sampling Time Length <0-63> +// These bits control the ADC sampling time in number of half CLK_ADC cycles, depending of the prescaler value, thus controlling the ADC input impedance. (SAMPLEN) +// adc_arch_samplen +#ifndef CONF_ADC_0_SAMPLEN +#define CONF_ADC_0_SAMPLEN 0 +#endif + +// Window Monitor Mode +// <0x0=>No window mode +// <0x1=>Mode 1: RESULT above lower threshold +// <0x2=>Mode 2: RESULT beneath upper threshold +// <0x3=>Mode 3: RESULT inside lower and upper threshold +// <0x4=>Mode 4: RESULT outside lower and upper threshold +// These bits enable and define the window monitor mode. (WINMODE) +// adc_arch_winmode +#ifndef CONF_ADC_0_WINMODE +#define CONF_ADC_0_WINMODE 0x0 +#endif + +// Window Monitor Lower Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINLT) +// adc_arch_winlt +#ifndef CONF_ADC_0_WINLT +#define CONF_ADC_0_WINLT 0 +#endif + +// Window Monitor Upper Threshold <0-65535> +// If the window monitor is enabled, these bits define the lower threshold value. (WINUT) +// adc_arch_winut +#ifndef CONF_ADC_0_WINUT +#define CONF_ADC_0_WINUT 0 +#endif + +// Bitmask for positive input sequence <0-4294967295> +// Use this parameter to input the bitmask for positive input sequence control (refer to datasheet for the device). +// adc_arch_seqen +#ifndef CONF_ADC_0_SEQEN +#define CONF_ADC_0_SEQEN 0x0 +#endif + +// + +// Event Control +// adc_arch_event_settings +#ifndef CONF_ADC_0_EVENT_CONTROL +#define CONF_ADC_0_EVENT_CONTROL 0 +#endif + +// Window Monitor Event Out +// Enables event output on window event (WINMONEO) +// adc_arch_winmoneo +#ifndef CONF_ADC_0_WINMONEO +#define CONF_ADC_0_WINMONEO 0 +#endif + +// Result Ready Event Out +// Enables event output on result ready event (RESRDEO) +// adc_arch_resrdyeo +#ifndef CONF_ADC_0_RESRDYEO +#define CONF_ADC_0_RESRDYEO 0 +#endif + +// Invert flush Event Signal +// Invert the flush event input signal (FLUSHINV) +// adc_arch_flushinv +#ifndef CONF_ADC_0_FLUSHINV +#define CONF_ADC_0_FLUSHINV 0 +#endif + +// Trigger Flush On Event +// Trigger an ADC pipeline flush on event (FLUSHEI) +// adc_arch_flushei +#ifndef CONF_ADC_0_FLUSHEI +#define CONF_ADC_0_FLUSHEI 0 +#endif + +// Invert Start Conversion Event Signal +// Invert the start conversion event input signal (STARTINV) +// adc_arch_startinv +#ifndef CONF_ADC_0_STARTINV +#define CONF_ADC_0_STARTINV 0 +#endif + +// Trigger Conversion On Event +// Trigger a conversion on event. (STARTEI) +// adc_arch_startei +#ifndef CONF_ADC_0_STARTEI +#define CONF_ADC_0_STARTEI 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_ADC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h new file mode 100644 index 0000000000..c46f99b7db --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_dac_config.h @@ -0,0 +1,169 @@ +/* Auto-generated config file hpl_dac_config.h */ +#ifndef HPL_DAC_CONFIG_H +#define HPL_DAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic configuration +// Reference Selection +// <0x00=> Unbuffered external voltage reference +// <0x01=> Voltage supply +// <0x02=> Buffered external voltage reference +// <0x03=> Internal bandgap reference +// dac_arch_refsel +#ifndef CONF_DAC_REFSEL +#define CONF_DAC_REFSEL 0 +#endif + +// Differential mode +// Indicates whether the differential mode is enabled or not +// dac_arch_diff +#ifndef CONF_DAC_DIFF +#define CONF_DAC_DIFF 0 +#endif +// + +// Advanced Configuration +// dac_advanced_settings +#ifndef CONF_DAC_ADVANCED_CONFIG +#define CONF_DAC_ADVANCED_CONFIG 0 +#endif + +// Debug Run +// Indicate whether running when CPU is halted +// adc_arch_dbgrun +#ifndef CONF_DAC_DBGRUN +#define CONF_DAC_DBGRUN 1 +#endif + +// Channel 0 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac0_arch_leftadj +#ifndef CONF_DAC0_LEFTADJ +#define CONF_DAC0_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac0_arch_cctrl +#ifndef CONF_DAC0_CCTRL +#define CONF_DAC0_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac0_arch_runstdby +#ifndef CONF_DAC0_RUNSTDBY +#define CONF_DAC0_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac0_arch_ditrher +#ifndef CONF_DAC0_DITHER +#define CONF_DAC0_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac0_arch_refresh +#ifndef CONF_DAC0_REFRESH +#define CONF_DAC0_REFRESH 2 +#endif +// +// Channel 1 configuration +// Left Adjusted Data +// Indicate how the data is adjusted in the Data and Data Buffer register +// dac1_arch_leftadj +#ifndef CONF_DAC1_LEFTADJ +#define CONF_DAC1_LEFTADJ 1 +#endif + +// Current control +// <0=> GCLK_DAC <= 1.2MHz (100kSPS) +// <1=> 1.2MHz < GCLK_DAC <= 6MHz (500kSPS) +// <2=> 6MHz < GCLK_DAC <= 12MHz (1MSPS) +// This defines the current in output buffer according to conversion rate +// dac1_arch_cctrl +#ifndef CONF_DAC1_CCTRL +#define CONF_DAC1_CCTRL 0 +#endif + +// Run in standby +// Indicates whether the DAC channel will continue running in standby sleep mode or not +// dac1_arch_runstdby +#ifndef CONF_DAC1_RUNSTDBY +#define CONF_DAC1_RUNSTDBY 0 +#endif + +// Dithering Mode +// Indicate whether dithering mode is enabled +// dac1_arch_ditrher +#ifndef CONF_DAC1_DITHER +#define CONF_DAC1_DITHER 0 +#endif + +// Refresh period <0x00-0xFF> +// This defines the refresh period. If it is 0, the refresh mode is disabled, else the refresh period is: value * 500us +// dac1_arch_refresh +#ifndef CONF_DAC1_REFRESH +#define CONF_DAC1_REFRESH 2 +#endif +// + +// Event configuration +// Inversion of DAC 0 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei0 +#ifndef CONF_DAC_INVEI0 +#define CONF_DAC_INVEI0 0 +#endif + +// Data Buffer of DAC 0 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_0 +#ifndef CONF_DAC_EMPTYEO0 +#define CONF_DAC_EMPTYEO0 0 +#endif + +// Start Conversion Event Input DAC 0 +// Indicate whether Start input event is enabled +// dac_arch_startei_0 +#ifndef CONF_DAC_STARTEI0 +#define CONF_DAC_STARTEI0 0 +#endif +// Inversion of DAC 1 event +// <0=> Detection on rising edge pf the input event +// <1=> Detection on falling edge pf the input event +// This defines the edge detection of the input event +// dac_arch_invei1 +#ifndef CONF_DAC_INVEI1 +#define CONF_DAC_INVEI1 0 +#endif + +// Data Buffer of DAC 1 Empty Event Output +// Indicate whether Data Buffer Empty Event is enabled and generated when the Data Buffer register is empty or not +// dac_arch_emptyeo_1 +#ifndef CONF_DAC_EMPTYEO1 +#define CONF_DAC_EMPTYEO1 0 +#endif + +// Start Conversion Event Input DAC 1 +// Indicate whether Start input event is enabled +// dac_arch_startei_1 +#ifndef CONF_DAC_STARTEI1 +#define CONF_DAC_STARTEI1 0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_DAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h new file mode 100644 index 0000000000..90499fc27f --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_dmac_config.h @@ -0,0 +1,7277 @@ +/* Auto-generated config file hpl_dmac_config.h */ +#ifndef HPL_DMAC_CONFIG_H +#define HPL_DMAC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// DMAC enable +// Indicates whether dmac is enabled or not +// dmac_enable +#ifndef CONF_DMAC_ENABLE +#define CONF_DMAC_ENABLE 0 +#endif + +// Priority Level 0 +// Indicates whether Priority Level 0 is enabled or not +// dmac_lvlen0 +#ifndef CONF_DMAC_LVLEN0 +#define CONF_DMAC_LVLEN0 1 +#endif + +// Level 0 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 0 +// <1=> Round-robin arbitration scheme for channel with priority 0 +// Defines Level 0 Arbitration for DMA channels +// dmac_rrlvlen0 +#ifndef CONF_DMAC_RRLVLEN0 +#define CONF_DMAC_RRLVLEN0 0 +#endif + +// Level 0 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri0 +#ifndef CONF_DMAC_LVLPRI0 +#define CONF_DMAC_LVLPRI0 0 +#endif +// Priority Level 1 +// Indicates whether Priority Level 1 is enabled or not +// dmac_lvlen1 +#ifndef CONF_DMAC_LVLEN1 +#define CONF_DMAC_LVLEN1 1 +#endif + +// Level 1 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 1 +// <1=> Round-robin arbitration scheme for channel with priority 1 +// Defines Level 1 Arbitration for DMA channels +// dmac_rrlvlen1 +#ifndef CONF_DMAC_RRLVLEN1 +#define CONF_DMAC_RRLVLEN1 0 +#endif + +// Level 1 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri1 +#ifndef CONF_DMAC_LVLPRI1 +#define CONF_DMAC_LVLPRI1 0 +#endif +// Priority Level 2 +// Indicates whether Priority Level 2 is enabled or not +// dmac_lvlen2 +#ifndef CONF_DMAC_LVLEN2 +#define CONF_DMAC_LVLEN2 1 +#endif + +// Level 2 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 2 +// <1=> Round-robin arbitration scheme for channel with priority 2 +// Defines Level 2 Arbitration for DMA channels +// dmac_rrlvlen2 +#ifndef CONF_DMAC_RRLVLEN2 +#define CONF_DMAC_RRLVLEN2 0 +#endif + +// Level 2 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri2 +#ifndef CONF_DMAC_LVLPRI2 +#define CONF_DMAC_LVLPRI2 0 +#endif +// Priority Level 3 +// Indicates whether Priority Level 3 is enabled or not +// dmac_lvlen3 +#ifndef CONF_DMAC_LVLEN3 +#define CONF_DMAC_LVLEN3 1 +#endif + +// Level 3 Round-Robin Arbitration +// <0=> Static arbitration scheme for channel with priority 3 +// <1=> Round-robin arbitration scheme for channel with priority 3 +// Defines Level 3 Arbitration for DMA channels +// dmac_rrlvlen3 +#ifndef CONF_DMAC_RRLVLEN3 +#define CONF_DMAC_RRLVLEN3 0 +#endif + +// Level 3 Channel Priority Number <0x00-0xFF> +// dmac_lvlpri3 +#ifndef CONF_DMAC_LVLPRI3 +#define CONF_DMAC_LVLPRI3 0 +#endif +// Debug Run +// Indicates whether Debug Run is enabled or not +// dmac_dbgrun +#ifndef CONF_DMAC_DBGRUN +#define CONF_DMAC_DBGRUN 0 +#endif + +// Channel 0 settings +// dmac_channel_0_settings +#ifndef CONF_DMAC_CHANNEL_0_SETTINGS +#define CONF_DMAC_CHANNEL_0_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 0 is running in standby mode or not +// dmac_runstdby_0 +#ifndef CONF_DMAC_RUNSTDBY_0 +#define CONF_DMAC_RUNSTDBY_0 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_0 +#ifndef CONF_DMAC_TRIGACT_0 +#define CONF_DMAC_TRIGACT_0 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_0 +#ifndef CONF_DMAC_TRIGSRC_0 +#define CONF_DMAC_TRIGSRC_0 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_0 +#ifndef CONF_DMAC_LVL_0 +#define CONF_DMAC_LVL_0 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_0 +#ifndef CONF_DMAC_EVOE_0 +#define CONF_DMAC_EVOE_0 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_0 +#ifndef CONF_DMAC_EVIE_0 +#define CONF_DMAC_EVIE_0 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_0 +#ifndef CONF_DMAC_EVACT_0 +#define CONF_DMAC_EVACT_0 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_0 +#ifndef CONF_DMAC_STEPSIZE_0 +#define CONF_DMAC_STEPSIZE_0 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_0 +#ifndef CONF_DMAC_STEPSEL_0 +#define CONF_DMAC_STEPSEL_0 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_0 +#ifndef CONF_DMAC_SRCINC_0 +#define CONF_DMAC_SRCINC_0 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_0 +#ifndef CONF_DMAC_DSTINC_0 +#define CONF_DMAC_DSTINC_0 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_0 +#ifndef CONF_DMAC_BEATSIZE_0 +#define CONF_DMAC_BEATSIZE_0 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_0 +#ifndef CONF_DMAC_BLOCKACT_0 +#define CONF_DMAC_BLOCKACT_0 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_0 +#ifndef CONF_DMAC_EVOSEL_0 +#define CONF_DMAC_EVOSEL_0 0 +#endif +// + +// Channel 1 settings +// dmac_channel_1_settings +#ifndef CONF_DMAC_CHANNEL_1_SETTINGS +#define CONF_DMAC_CHANNEL_1_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 1 is running in standby mode or not +// dmac_runstdby_1 +#ifndef CONF_DMAC_RUNSTDBY_1 +#define CONF_DMAC_RUNSTDBY_1 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_1 +#ifndef CONF_DMAC_TRIGACT_1 +#define CONF_DMAC_TRIGACT_1 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_1 +#ifndef CONF_DMAC_TRIGSRC_1 +#define CONF_DMAC_TRIGSRC_1 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_1 +#ifndef CONF_DMAC_LVL_1 +#define CONF_DMAC_LVL_1 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_1 +#ifndef CONF_DMAC_EVOE_1 +#define CONF_DMAC_EVOE_1 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_1 +#ifndef CONF_DMAC_EVIE_1 +#define CONF_DMAC_EVIE_1 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_1 +#ifndef CONF_DMAC_EVACT_1 +#define CONF_DMAC_EVACT_1 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_1 +#ifndef CONF_DMAC_STEPSIZE_1 +#define CONF_DMAC_STEPSIZE_1 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_1 +#ifndef CONF_DMAC_STEPSEL_1 +#define CONF_DMAC_STEPSEL_1 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_1 +#ifndef CONF_DMAC_SRCINC_1 +#define CONF_DMAC_SRCINC_1 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_1 +#ifndef CONF_DMAC_DSTINC_1 +#define CONF_DMAC_DSTINC_1 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_1 +#ifndef CONF_DMAC_BEATSIZE_1 +#define CONF_DMAC_BEATSIZE_1 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_1 +#ifndef CONF_DMAC_BLOCKACT_1 +#define CONF_DMAC_BLOCKACT_1 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_1 +#ifndef CONF_DMAC_EVOSEL_1 +#define CONF_DMAC_EVOSEL_1 0 +#endif +// + +// Channel 2 settings +// dmac_channel_2_settings +#ifndef CONF_DMAC_CHANNEL_2_SETTINGS +#define CONF_DMAC_CHANNEL_2_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 2 is running in standby mode or not +// dmac_runstdby_2 +#ifndef CONF_DMAC_RUNSTDBY_2 +#define CONF_DMAC_RUNSTDBY_2 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_2 +#ifndef CONF_DMAC_TRIGACT_2 +#define CONF_DMAC_TRIGACT_2 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_2 +#ifndef CONF_DMAC_TRIGSRC_2 +#define CONF_DMAC_TRIGSRC_2 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_2 +#ifndef CONF_DMAC_LVL_2 +#define CONF_DMAC_LVL_2 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_2 +#ifndef CONF_DMAC_EVOE_2 +#define CONF_DMAC_EVOE_2 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_2 +#ifndef CONF_DMAC_EVIE_2 +#define CONF_DMAC_EVIE_2 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_2 +#ifndef CONF_DMAC_EVACT_2 +#define CONF_DMAC_EVACT_2 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_2 +#ifndef CONF_DMAC_STEPSIZE_2 +#define CONF_DMAC_STEPSIZE_2 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_2 +#ifndef CONF_DMAC_STEPSEL_2 +#define CONF_DMAC_STEPSEL_2 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_2 +#ifndef CONF_DMAC_SRCINC_2 +#define CONF_DMAC_SRCINC_2 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_2 +#ifndef CONF_DMAC_DSTINC_2 +#define CONF_DMAC_DSTINC_2 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_2 +#ifndef CONF_DMAC_BEATSIZE_2 +#define CONF_DMAC_BEATSIZE_2 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_2 +#ifndef CONF_DMAC_BLOCKACT_2 +#define CONF_DMAC_BLOCKACT_2 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_2 +#ifndef CONF_DMAC_EVOSEL_2 +#define CONF_DMAC_EVOSEL_2 0 +#endif +// + +// Channel 3 settings +// dmac_channel_3_settings +#ifndef CONF_DMAC_CHANNEL_3_SETTINGS +#define CONF_DMAC_CHANNEL_3_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 3 is running in standby mode or not +// dmac_runstdby_3 +#ifndef CONF_DMAC_RUNSTDBY_3 +#define CONF_DMAC_RUNSTDBY_3 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_3 +#ifndef CONF_DMAC_TRIGACT_3 +#define CONF_DMAC_TRIGACT_3 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_3 +#ifndef CONF_DMAC_TRIGSRC_3 +#define CONF_DMAC_TRIGSRC_3 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_3 +#ifndef CONF_DMAC_LVL_3 +#define CONF_DMAC_LVL_3 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_3 +#ifndef CONF_DMAC_EVOE_3 +#define CONF_DMAC_EVOE_3 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_3 +#ifndef CONF_DMAC_EVIE_3 +#define CONF_DMAC_EVIE_3 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_3 +#ifndef CONF_DMAC_EVACT_3 +#define CONF_DMAC_EVACT_3 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_3 +#ifndef CONF_DMAC_STEPSIZE_3 +#define CONF_DMAC_STEPSIZE_3 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_3 +#ifndef CONF_DMAC_STEPSEL_3 +#define CONF_DMAC_STEPSEL_3 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_3 +#ifndef CONF_DMAC_SRCINC_3 +#define CONF_DMAC_SRCINC_3 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_3 +#ifndef CONF_DMAC_DSTINC_3 +#define CONF_DMAC_DSTINC_3 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_3 +#ifndef CONF_DMAC_BEATSIZE_3 +#define CONF_DMAC_BEATSIZE_3 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_3 +#ifndef CONF_DMAC_BLOCKACT_3 +#define CONF_DMAC_BLOCKACT_3 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_3 +#ifndef CONF_DMAC_EVOSEL_3 +#define CONF_DMAC_EVOSEL_3 0 +#endif +// + +// Channel 4 settings +// dmac_channel_4_settings +#ifndef CONF_DMAC_CHANNEL_4_SETTINGS +#define CONF_DMAC_CHANNEL_4_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 4 is running in standby mode or not +// dmac_runstdby_4 +#ifndef CONF_DMAC_RUNSTDBY_4 +#define CONF_DMAC_RUNSTDBY_4 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_4 +#ifndef CONF_DMAC_TRIGACT_4 +#define CONF_DMAC_TRIGACT_4 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_4 +#ifndef CONF_DMAC_TRIGSRC_4 +#define CONF_DMAC_TRIGSRC_4 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_4 +#ifndef CONF_DMAC_LVL_4 +#define CONF_DMAC_LVL_4 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_4 +#ifndef CONF_DMAC_EVOE_4 +#define CONF_DMAC_EVOE_4 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_4 +#ifndef CONF_DMAC_EVIE_4 +#define CONF_DMAC_EVIE_4 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_4 +#ifndef CONF_DMAC_EVACT_4 +#define CONF_DMAC_EVACT_4 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_4 +#ifndef CONF_DMAC_STEPSIZE_4 +#define CONF_DMAC_STEPSIZE_4 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_4 +#ifndef CONF_DMAC_STEPSEL_4 +#define CONF_DMAC_STEPSEL_4 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_4 +#ifndef CONF_DMAC_SRCINC_4 +#define CONF_DMAC_SRCINC_4 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_4 +#ifndef CONF_DMAC_DSTINC_4 +#define CONF_DMAC_DSTINC_4 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_4 +#ifndef CONF_DMAC_BEATSIZE_4 +#define CONF_DMAC_BEATSIZE_4 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_4 +#ifndef CONF_DMAC_BLOCKACT_4 +#define CONF_DMAC_BLOCKACT_4 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_4 +#ifndef CONF_DMAC_EVOSEL_4 +#define CONF_DMAC_EVOSEL_4 0 +#endif +// + +// Channel 5 settings +// dmac_channel_5_settings +#ifndef CONF_DMAC_CHANNEL_5_SETTINGS +#define CONF_DMAC_CHANNEL_5_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 5 is running in standby mode or not +// dmac_runstdby_5 +#ifndef CONF_DMAC_RUNSTDBY_5 +#define CONF_DMAC_RUNSTDBY_5 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_5 +#ifndef CONF_DMAC_TRIGACT_5 +#define CONF_DMAC_TRIGACT_5 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_5 +#ifndef CONF_DMAC_TRIGSRC_5 +#define CONF_DMAC_TRIGSRC_5 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_5 +#ifndef CONF_DMAC_LVL_5 +#define CONF_DMAC_LVL_5 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_5 +#ifndef CONF_DMAC_EVOE_5 +#define CONF_DMAC_EVOE_5 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_5 +#ifndef CONF_DMAC_EVIE_5 +#define CONF_DMAC_EVIE_5 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_5 +#ifndef CONF_DMAC_EVACT_5 +#define CONF_DMAC_EVACT_5 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_5 +#ifndef CONF_DMAC_STEPSIZE_5 +#define CONF_DMAC_STEPSIZE_5 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_5 +#ifndef CONF_DMAC_STEPSEL_5 +#define CONF_DMAC_STEPSEL_5 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_5 +#ifndef CONF_DMAC_SRCINC_5 +#define CONF_DMAC_SRCINC_5 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_5 +#ifndef CONF_DMAC_DSTINC_5 +#define CONF_DMAC_DSTINC_5 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_5 +#ifndef CONF_DMAC_BEATSIZE_5 +#define CONF_DMAC_BEATSIZE_5 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_5 +#ifndef CONF_DMAC_BLOCKACT_5 +#define CONF_DMAC_BLOCKACT_5 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_5 +#ifndef CONF_DMAC_EVOSEL_5 +#define CONF_DMAC_EVOSEL_5 0 +#endif +// + +// Channel 6 settings +// dmac_channel_6_settings +#ifndef CONF_DMAC_CHANNEL_6_SETTINGS +#define CONF_DMAC_CHANNEL_6_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 6 is running in standby mode or not +// dmac_runstdby_6 +#ifndef CONF_DMAC_RUNSTDBY_6 +#define CONF_DMAC_RUNSTDBY_6 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_6 +#ifndef CONF_DMAC_TRIGACT_6 +#define CONF_DMAC_TRIGACT_6 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_6 +#ifndef CONF_DMAC_TRIGSRC_6 +#define CONF_DMAC_TRIGSRC_6 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_6 +#ifndef CONF_DMAC_LVL_6 +#define CONF_DMAC_LVL_6 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_6 +#ifndef CONF_DMAC_EVOE_6 +#define CONF_DMAC_EVOE_6 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_6 +#ifndef CONF_DMAC_EVIE_6 +#define CONF_DMAC_EVIE_6 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_6 +#ifndef CONF_DMAC_EVACT_6 +#define CONF_DMAC_EVACT_6 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_6 +#ifndef CONF_DMAC_STEPSIZE_6 +#define CONF_DMAC_STEPSIZE_6 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_6 +#ifndef CONF_DMAC_STEPSEL_6 +#define CONF_DMAC_STEPSEL_6 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_6 +#ifndef CONF_DMAC_SRCINC_6 +#define CONF_DMAC_SRCINC_6 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_6 +#ifndef CONF_DMAC_DSTINC_6 +#define CONF_DMAC_DSTINC_6 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_6 +#ifndef CONF_DMAC_BEATSIZE_6 +#define CONF_DMAC_BEATSIZE_6 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_6 +#ifndef CONF_DMAC_BLOCKACT_6 +#define CONF_DMAC_BLOCKACT_6 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_6 +#ifndef CONF_DMAC_EVOSEL_6 +#define CONF_DMAC_EVOSEL_6 0 +#endif +// + +// Channel 7 settings +// dmac_channel_7_settings +#ifndef CONF_DMAC_CHANNEL_7_SETTINGS +#define CONF_DMAC_CHANNEL_7_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 7 is running in standby mode or not +// dmac_runstdby_7 +#ifndef CONF_DMAC_RUNSTDBY_7 +#define CONF_DMAC_RUNSTDBY_7 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_7 +#ifndef CONF_DMAC_TRIGACT_7 +#define CONF_DMAC_TRIGACT_7 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_7 +#ifndef CONF_DMAC_TRIGSRC_7 +#define CONF_DMAC_TRIGSRC_7 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_7 +#ifndef CONF_DMAC_LVL_7 +#define CONF_DMAC_LVL_7 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_7 +#ifndef CONF_DMAC_EVOE_7 +#define CONF_DMAC_EVOE_7 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_7 +#ifndef CONF_DMAC_EVIE_7 +#define CONF_DMAC_EVIE_7 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_7 +#ifndef CONF_DMAC_EVACT_7 +#define CONF_DMAC_EVACT_7 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_7 +#ifndef CONF_DMAC_STEPSIZE_7 +#define CONF_DMAC_STEPSIZE_7 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_7 +#ifndef CONF_DMAC_STEPSEL_7 +#define CONF_DMAC_STEPSEL_7 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_7 +#ifndef CONF_DMAC_SRCINC_7 +#define CONF_DMAC_SRCINC_7 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_7 +#ifndef CONF_DMAC_DSTINC_7 +#define CONF_DMAC_DSTINC_7 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_7 +#ifndef CONF_DMAC_BEATSIZE_7 +#define CONF_DMAC_BEATSIZE_7 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_7 +#ifndef CONF_DMAC_BLOCKACT_7 +#define CONF_DMAC_BLOCKACT_7 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_7 +#ifndef CONF_DMAC_EVOSEL_7 +#define CONF_DMAC_EVOSEL_7 0 +#endif +// + +// Channel 8 settings +// dmac_channel_8_settings +#ifndef CONF_DMAC_CHANNEL_8_SETTINGS +#define CONF_DMAC_CHANNEL_8_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 8 is running in standby mode or not +// dmac_runstdby_8 +#ifndef CONF_DMAC_RUNSTDBY_8 +#define CONF_DMAC_RUNSTDBY_8 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_8 +#ifndef CONF_DMAC_TRIGACT_8 +#define CONF_DMAC_TRIGACT_8 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_8 +#ifndef CONF_DMAC_TRIGSRC_8 +#define CONF_DMAC_TRIGSRC_8 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_8 +#ifndef CONF_DMAC_LVL_8 +#define CONF_DMAC_LVL_8 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_8 +#ifndef CONF_DMAC_EVOE_8 +#define CONF_DMAC_EVOE_8 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_8 +#ifndef CONF_DMAC_EVIE_8 +#define CONF_DMAC_EVIE_8 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_8 +#ifndef CONF_DMAC_EVACT_8 +#define CONF_DMAC_EVACT_8 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_8 +#ifndef CONF_DMAC_STEPSIZE_8 +#define CONF_DMAC_STEPSIZE_8 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_8 +#ifndef CONF_DMAC_STEPSEL_8 +#define CONF_DMAC_STEPSEL_8 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_8 +#ifndef CONF_DMAC_SRCINC_8 +#define CONF_DMAC_SRCINC_8 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_8 +#ifndef CONF_DMAC_DSTINC_8 +#define CONF_DMAC_DSTINC_8 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_8 +#ifndef CONF_DMAC_BEATSIZE_8 +#define CONF_DMAC_BEATSIZE_8 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_8 +#ifndef CONF_DMAC_BLOCKACT_8 +#define CONF_DMAC_BLOCKACT_8 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_8 +#ifndef CONF_DMAC_EVOSEL_8 +#define CONF_DMAC_EVOSEL_8 0 +#endif +// + +// Channel 9 settings +// dmac_channel_9_settings +#ifndef CONF_DMAC_CHANNEL_9_SETTINGS +#define CONF_DMAC_CHANNEL_9_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 9 is running in standby mode or not +// dmac_runstdby_9 +#ifndef CONF_DMAC_RUNSTDBY_9 +#define CONF_DMAC_RUNSTDBY_9 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_9 +#ifndef CONF_DMAC_TRIGACT_9 +#define CONF_DMAC_TRIGACT_9 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_9 +#ifndef CONF_DMAC_TRIGSRC_9 +#define CONF_DMAC_TRIGSRC_9 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_9 +#ifndef CONF_DMAC_LVL_9 +#define CONF_DMAC_LVL_9 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_9 +#ifndef CONF_DMAC_EVOE_9 +#define CONF_DMAC_EVOE_9 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_9 +#ifndef CONF_DMAC_EVIE_9 +#define CONF_DMAC_EVIE_9 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_9 +#ifndef CONF_DMAC_EVACT_9 +#define CONF_DMAC_EVACT_9 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_9 +#ifndef CONF_DMAC_STEPSIZE_9 +#define CONF_DMAC_STEPSIZE_9 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_9 +#ifndef CONF_DMAC_STEPSEL_9 +#define CONF_DMAC_STEPSEL_9 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_9 +#ifndef CONF_DMAC_SRCINC_9 +#define CONF_DMAC_SRCINC_9 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_9 +#ifndef CONF_DMAC_DSTINC_9 +#define CONF_DMAC_DSTINC_9 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_9 +#ifndef CONF_DMAC_BEATSIZE_9 +#define CONF_DMAC_BEATSIZE_9 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_9 +#ifndef CONF_DMAC_BLOCKACT_9 +#define CONF_DMAC_BLOCKACT_9 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_9 +#ifndef CONF_DMAC_EVOSEL_9 +#define CONF_DMAC_EVOSEL_9 0 +#endif +// + +// Channel 10 settings +// dmac_channel_10_settings +#ifndef CONF_DMAC_CHANNEL_10_SETTINGS +#define CONF_DMAC_CHANNEL_10_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 10 is running in standby mode or not +// dmac_runstdby_10 +#ifndef CONF_DMAC_RUNSTDBY_10 +#define CONF_DMAC_RUNSTDBY_10 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_10 +#ifndef CONF_DMAC_TRIGACT_10 +#define CONF_DMAC_TRIGACT_10 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_10 +#ifndef CONF_DMAC_TRIGSRC_10 +#define CONF_DMAC_TRIGSRC_10 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_10 +#ifndef CONF_DMAC_LVL_10 +#define CONF_DMAC_LVL_10 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_10 +#ifndef CONF_DMAC_EVOE_10 +#define CONF_DMAC_EVOE_10 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_10 +#ifndef CONF_DMAC_EVIE_10 +#define CONF_DMAC_EVIE_10 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_10 +#ifndef CONF_DMAC_EVACT_10 +#define CONF_DMAC_EVACT_10 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_10 +#ifndef CONF_DMAC_STEPSIZE_10 +#define CONF_DMAC_STEPSIZE_10 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_10 +#ifndef CONF_DMAC_STEPSEL_10 +#define CONF_DMAC_STEPSEL_10 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_10 +#ifndef CONF_DMAC_SRCINC_10 +#define CONF_DMAC_SRCINC_10 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_10 +#ifndef CONF_DMAC_DSTINC_10 +#define CONF_DMAC_DSTINC_10 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_10 +#ifndef CONF_DMAC_BEATSIZE_10 +#define CONF_DMAC_BEATSIZE_10 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_10 +#ifndef CONF_DMAC_BLOCKACT_10 +#define CONF_DMAC_BLOCKACT_10 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_10 +#ifndef CONF_DMAC_EVOSEL_10 +#define CONF_DMAC_EVOSEL_10 0 +#endif +// + +// Channel 11 settings +// dmac_channel_11_settings +#ifndef CONF_DMAC_CHANNEL_11_SETTINGS +#define CONF_DMAC_CHANNEL_11_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 11 is running in standby mode or not +// dmac_runstdby_11 +#ifndef CONF_DMAC_RUNSTDBY_11 +#define CONF_DMAC_RUNSTDBY_11 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_11 +#ifndef CONF_DMAC_TRIGACT_11 +#define CONF_DMAC_TRIGACT_11 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_11 +#ifndef CONF_DMAC_TRIGSRC_11 +#define CONF_DMAC_TRIGSRC_11 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_11 +#ifndef CONF_DMAC_LVL_11 +#define CONF_DMAC_LVL_11 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_11 +#ifndef CONF_DMAC_EVOE_11 +#define CONF_DMAC_EVOE_11 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_11 +#ifndef CONF_DMAC_EVIE_11 +#define CONF_DMAC_EVIE_11 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_11 +#ifndef CONF_DMAC_EVACT_11 +#define CONF_DMAC_EVACT_11 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_11 +#ifndef CONF_DMAC_STEPSIZE_11 +#define CONF_DMAC_STEPSIZE_11 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_11 +#ifndef CONF_DMAC_STEPSEL_11 +#define CONF_DMAC_STEPSEL_11 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_11 +#ifndef CONF_DMAC_SRCINC_11 +#define CONF_DMAC_SRCINC_11 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_11 +#ifndef CONF_DMAC_DSTINC_11 +#define CONF_DMAC_DSTINC_11 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_11 +#ifndef CONF_DMAC_BEATSIZE_11 +#define CONF_DMAC_BEATSIZE_11 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_11 +#ifndef CONF_DMAC_BLOCKACT_11 +#define CONF_DMAC_BLOCKACT_11 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_11 +#ifndef CONF_DMAC_EVOSEL_11 +#define CONF_DMAC_EVOSEL_11 0 +#endif +// + +// Channel 12 settings +// dmac_channel_12_settings +#ifndef CONF_DMAC_CHANNEL_12_SETTINGS +#define CONF_DMAC_CHANNEL_12_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 12 is running in standby mode or not +// dmac_runstdby_12 +#ifndef CONF_DMAC_RUNSTDBY_12 +#define CONF_DMAC_RUNSTDBY_12 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_12 +#ifndef CONF_DMAC_TRIGACT_12 +#define CONF_DMAC_TRIGACT_12 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_12 +#ifndef CONF_DMAC_TRIGSRC_12 +#define CONF_DMAC_TRIGSRC_12 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_12 +#ifndef CONF_DMAC_LVL_12 +#define CONF_DMAC_LVL_12 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_12 +#ifndef CONF_DMAC_EVOE_12 +#define CONF_DMAC_EVOE_12 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_12 +#ifndef CONF_DMAC_EVIE_12 +#define CONF_DMAC_EVIE_12 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_12 +#ifndef CONF_DMAC_EVACT_12 +#define CONF_DMAC_EVACT_12 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_12 +#ifndef CONF_DMAC_STEPSIZE_12 +#define CONF_DMAC_STEPSIZE_12 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_12 +#ifndef CONF_DMAC_STEPSEL_12 +#define CONF_DMAC_STEPSEL_12 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_12 +#ifndef CONF_DMAC_SRCINC_12 +#define CONF_DMAC_SRCINC_12 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_12 +#ifndef CONF_DMAC_DSTINC_12 +#define CONF_DMAC_DSTINC_12 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_12 +#ifndef CONF_DMAC_BEATSIZE_12 +#define CONF_DMAC_BEATSIZE_12 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_12 +#ifndef CONF_DMAC_BLOCKACT_12 +#define CONF_DMAC_BLOCKACT_12 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_12 +#ifndef CONF_DMAC_EVOSEL_12 +#define CONF_DMAC_EVOSEL_12 0 +#endif +// + +// Channel 13 settings +// dmac_channel_13_settings +#ifndef CONF_DMAC_CHANNEL_13_SETTINGS +#define CONF_DMAC_CHANNEL_13_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 13 is running in standby mode or not +// dmac_runstdby_13 +#ifndef CONF_DMAC_RUNSTDBY_13 +#define CONF_DMAC_RUNSTDBY_13 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_13 +#ifndef CONF_DMAC_TRIGACT_13 +#define CONF_DMAC_TRIGACT_13 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_13 +#ifndef CONF_DMAC_TRIGSRC_13 +#define CONF_DMAC_TRIGSRC_13 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_13 +#ifndef CONF_DMAC_LVL_13 +#define CONF_DMAC_LVL_13 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_13 +#ifndef CONF_DMAC_EVOE_13 +#define CONF_DMAC_EVOE_13 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_13 +#ifndef CONF_DMAC_EVIE_13 +#define CONF_DMAC_EVIE_13 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_13 +#ifndef CONF_DMAC_EVACT_13 +#define CONF_DMAC_EVACT_13 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_13 +#ifndef CONF_DMAC_STEPSIZE_13 +#define CONF_DMAC_STEPSIZE_13 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_13 +#ifndef CONF_DMAC_STEPSEL_13 +#define CONF_DMAC_STEPSEL_13 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_13 +#ifndef CONF_DMAC_SRCINC_13 +#define CONF_DMAC_SRCINC_13 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_13 +#ifndef CONF_DMAC_DSTINC_13 +#define CONF_DMAC_DSTINC_13 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_13 +#ifndef CONF_DMAC_BEATSIZE_13 +#define CONF_DMAC_BEATSIZE_13 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_13 +#ifndef CONF_DMAC_BLOCKACT_13 +#define CONF_DMAC_BLOCKACT_13 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_13 +#ifndef CONF_DMAC_EVOSEL_13 +#define CONF_DMAC_EVOSEL_13 0 +#endif +// + +// Channel 14 settings +// dmac_channel_14_settings +#ifndef CONF_DMAC_CHANNEL_14_SETTINGS +#define CONF_DMAC_CHANNEL_14_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 14 is running in standby mode or not +// dmac_runstdby_14 +#ifndef CONF_DMAC_RUNSTDBY_14 +#define CONF_DMAC_RUNSTDBY_14 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_14 +#ifndef CONF_DMAC_TRIGACT_14 +#define CONF_DMAC_TRIGACT_14 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_14 +#ifndef CONF_DMAC_TRIGSRC_14 +#define CONF_DMAC_TRIGSRC_14 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_14 +#ifndef CONF_DMAC_LVL_14 +#define CONF_DMAC_LVL_14 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_14 +#ifndef CONF_DMAC_EVOE_14 +#define CONF_DMAC_EVOE_14 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_14 +#ifndef CONF_DMAC_EVIE_14 +#define CONF_DMAC_EVIE_14 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_14 +#ifndef CONF_DMAC_EVACT_14 +#define CONF_DMAC_EVACT_14 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_14 +#ifndef CONF_DMAC_STEPSIZE_14 +#define CONF_DMAC_STEPSIZE_14 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_14 +#ifndef CONF_DMAC_STEPSEL_14 +#define CONF_DMAC_STEPSEL_14 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_14 +#ifndef CONF_DMAC_SRCINC_14 +#define CONF_DMAC_SRCINC_14 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_14 +#ifndef CONF_DMAC_DSTINC_14 +#define CONF_DMAC_DSTINC_14 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_14 +#ifndef CONF_DMAC_BEATSIZE_14 +#define CONF_DMAC_BEATSIZE_14 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_14 +#ifndef CONF_DMAC_BLOCKACT_14 +#define CONF_DMAC_BLOCKACT_14 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_14 +#ifndef CONF_DMAC_EVOSEL_14 +#define CONF_DMAC_EVOSEL_14 0 +#endif +// + +// Channel 15 settings +// dmac_channel_15_settings +#ifndef CONF_DMAC_CHANNEL_15_SETTINGS +#define CONF_DMAC_CHANNEL_15_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 15 is running in standby mode or not +// dmac_runstdby_15 +#ifndef CONF_DMAC_RUNSTDBY_15 +#define CONF_DMAC_RUNSTDBY_15 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_15 +#ifndef CONF_DMAC_TRIGACT_15 +#define CONF_DMAC_TRIGACT_15 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_15 +#ifndef CONF_DMAC_TRIGSRC_15 +#define CONF_DMAC_TRIGSRC_15 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_15 +#ifndef CONF_DMAC_LVL_15 +#define CONF_DMAC_LVL_15 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_15 +#ifndef CONF_DMAC_EVOE_15 +#define CONF_DMAC_EVOE_15 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_15 +#ifndef CONF_DMAC_EVIE_15 +#define CONF_DMAC_EVIE_15 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_15 +#ifndef CONF_DMAC_EVACT_15 +#define CONF_DMAC_EVACT_15 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_15 +#ifndef CONF_DMAC_STEPSIZE_15 +#define CONF_DMAC_STEPSIZE_15 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_15 +#ifndef CONF_DMAC_STEPSEL_15 +#define CONF_DMAC_STEPSEL_15 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_15 +#ifndef CONF_DMAC_SRCINC_15 +#define CONF_DMAC_SRCINC_15 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_15 +#ifndef CONF_DMAC_DSTINC_15 +#define CONF_DMAC_DSTINC_15 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_15 +#ifndef CONF_DMAC_BEATSIZE_15 +#define CONF_DMAC_BEATSIZE_15 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_15 +#ifndef CONF_DMAC_BLOCKACT_15 +#define CONF_DMAC_BLOCKACT_15 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_15 +#ifndef CONF_DMAC_EVOSEL_15 +#define CONF_DMAC_EVOSEL_15 0 +#endif +// + +// Channel 16 settings +// dmac_channel_16_settings +#ifndef CONF_DMAC_CHANNEL_16_SETTINGS +#define CONF_DMAC_CHANNEL_16_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 16 is running in standby mode or not +// dmac_runstdby_16 +#ifndef CONF_DMAC_RUNSTDBY_16 +#define CONF_DMAC_RUNSTDBY_16 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_16 +#ifndef CONF_DMAC_TRIGACT_16 +#define CONF_DMAC_TRIGACT_16 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_16 +#ifndef CONF_DMAC_TRIGSRC_16 +#define CONF_DMAC_TRIGSRC_16 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_16 +#ifndef CONF_DMAC_LVL_16 +#define CONF_DMAC_LVL_16 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_16 +#ifndef CONF_DMAC_EVOE_16 +#define CONF_DMAC_EVOE_16 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_16 +#ifndef CONF_DMAC_EVIE_16 +#define CONF_DMAC_EVIE_16 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_16 +#ifndef CONF_DMAC_EVACT_16 +#define CONF_DMAC_EVACT_16 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_16 +#ifndef CONF_DMAC_STEPSIZE_16 +#define CONF_DMAC_STEPSIZE_16 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_16 +#ifndef CONF_DMAC_STEPSEL_16 +#define CONF_DMAC_STEPSEL_16 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_16 +#ifndef CONF_DMAC_SRCINC_16 +#define CONF_DMAC_SRCINC_16 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_16 +#ifndef CONF_DMAC_DSTINC_16 +#define CONF_DMAC_DSTINC_16 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_16 +#ifndef CONF_DMAC_BEATSIZE_16 +#define CONF_DMAC_BEATSIZE_16 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_16 +#ifndef CONF_DMAC_BLOCKACT_16 +#define CONF_DMAC_BLOCKACT_16 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_16 +#ifndef CONF_DMAC_EVOSEL_16 +#define CONF_DMAC_EVOSEL_16 0 +#endif +// + +// Channel 17 settings +// dmac_channel_17_settings +#ifndef CONF_DMAC_CHANNEL_17_SETTINGS +#define CONF_DMAC_CHANNEL_17_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 17 is running in standby mode or not +// dmac_runstdby_17 +#ifndef CONF_DMAC_RUNSTDBY_17 +#define CONF_DMAC_RUNSTDBY_17 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_17 +#ifndef CONF_DMAC_TRIGACT_17 +#define CONF_DMAC_TRIGACT_17 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_17 +#ifndef CONF_DMAC_TRIGSRC_17 +#define CONF_DMAC_TRIGSRC_17 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_17 +#ifndef CONF_DMAC_LVL_17 +#define CONF_DMAC_LVL_17 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_17 +#ifndef CONF_DMAC_EVOE_17 +#define CONF_DMAC_EVOE_17 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_17 +#ifndef CONF_DMAC_EVIE_17 +#define CONF_DMAC_EVIE_17 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_17 +#ifndef CONF_DMAC_EVACT_17 +#define CONF_DMAC_EVACT_17 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_17 +#ifndef CONF_DMAC_STEPSIZE_17 +#define CONF_DMAC_STEPSIZE_17 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_17 +#ifndef CONF_DMAC_STEPSEL_17 +#define CONF_DMAC_STEPSEL_17 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_17 +#ifndef CONF_DMAC_SRCINC_17 +#define CONF_DMAC_SRCINC_17 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_17 +#ifndef CONF_DMAC_DSTINC_17 +#define CONF_DMAC_DSTINC_17 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_17 +#ifndef CONF_DMAC_BEATSIZE_17 +#define CONF_DMAC_BEATSIZE_17 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_17 +#ifndef CONF_DMAC_BLOCKACT_17 +#define CONF_DMAC_BLOCKACT_17 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_17 +#ifndef CONF_DMAC_EVOSEL_17 +#define CONF_DMAC_EVOSEL_17 0 +#endif +// + +// Channel 18 settings +// dmac_channel_18_settings +#ifndef CONF_DMAC_CHANNEL_18_SETTINGS +#define CONF_DMAC_CHANNEL_18_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 18 is running in standby mode or not +// dmac_runstdby_18 +#ifndef CONF_DMAC_RUNSTDBY_18 +#define CONF_DMAC_RUNSTDBY_18 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_18 +#ifndef CONF_DMAC_TRIGACT_18 +#define CONF_DMAC_TRIGACT_18 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_18 +#ifndef CONF_DMAC_TRIGSRC_18 +#define CONF_DMAC_TRIGSRC_18 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_18 +#ifndef CONF_DMAC_LVL_18 +#define CONF_DMAC_LVL_18 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_18 +#ifndef CONF_DMAC_EVOE_18 +#define CONF_DMAC_EVOE_18 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_18 +#ifndef CONF_DMAC_EVIE_18 +#define CONF_DMAC_EVIE_18 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_18 +#ifndef CONF_DMAC_EVACT_18 +#define CONF_DMAC_EVACT_18 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_18 +#ifndef CONF_DMAC_STEPSIZE_18 +#define CONF_DMAC_STEPSIZE_18 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_18 +#ifndef CONF_DMAC_STEPSEL_18 +#define CONF_DMAC_STEPSEL_18 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_18 +#ifndef CONF_DMAC_SRCINC_18 +#define CONF_DMAC_SRCINC_18 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_18 +#ifndef CONF_DMAC_DSTINC_18 +#define CONF_DMAC_DSTINC_18 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_18 +#ifndef CONF_DMAC_BEATSIZE_18 +#define CONF_DMAC_BEATSIZE_18 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_18 +#ifndef CONF_DMAC_BLOCKACT_18 +#define CONF_DMAC_BLOCKACT_18 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_18 +#ifndef CONF_DMAC_EVOSEL_18 +#define CONF_DMAC_EVOSEL_18 0 +#endif +// + +// Channel 19 settings +// dmac_channel_19_settings +#ifndef CONF_DMAC_CHANNEL_19_SETTINGS +#define CONF_DMAC_CHANNEL_19_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 19 is running in standby mode or not +// dmac_runstdby_19 +#ifndef CONF_DMAC_RUNSTDBY_19 +#define CONF_DMAC_RUNSTDBY_19 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_19 +#ifndef CONF_DMAC_TRIGACT_19 +#define CONF_DMAC_TRIGACT_19 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_19 +#ifndef CONF_DMAC_TRIGSRC_19 +#define CONF_DMAC_TRIGSRC_19 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_19 +#ifndef CONF_DMAC_LVL_19 +#define CONF_DMAC_LVL_19 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_19 +#ifndef CONF_DMAC_EVOE_19 +#define CONF_DMAC_EVOE_19 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_19 +#ifndef CONF_DMAC_EVIE_19 +#define CONF_DMAC_EVIE_19 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_19 +#ifndef CONF_DMAC_EVACT_19 +#define CONF_DMAC_EVACT_19 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_19 +#ifndef CONF_DMAC_STEPSIZE_19 +#define CONF_DMAC_STEPSIZE_19 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_19 +#ifndef CONF_DMAC_STEPSEL_19 +#define CONF_DMAC_STEPSEL_19 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_19 +#ifndef CONF_DMAC_SRCINC_19 +#define CONF_DMAC_SRCINC_19 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_19 +#ifndef CONF_DMAC_DSTINC_19 +#define CONF_DMAC_DSTINC_19 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_19 +#ifndef CONF_DMAC_BEATSIZE_19 +#define CONF_DMAC_BEATSIZE_19 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_19 +#ifndef CONF_DMAC_BLOCKACT_19 +#define CONF_DMAC_BLOCKACT_19 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_19 +#ifndef CONF_DMAC_EVOSEL_19 +#define CONF_DMAC_EVOSEL_19 0 +#endif +// + +// Channel 20 settings +// dmac_channel_20_settings +#ifndef CONF_DMAC_CHANNEL_20_SETTINGS +#define CONF_DMAC_CHANNEL_20_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 20 is running in standby mode or not +// dmac_runstdby_20 +#ifndef CONF_DMAC_RUNSTDBY_20 +#define CONF_DMAC_RUNSTDBY_20 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_20 +#ifndef CONF_DMAC_TRIGACT_20 +#define CONF_DMAC_TRIGACT_20 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_20 +#ifndef CONF_DMAC_TRIGSRC_20 +#define CONF_DMAC_TRIGSRC_20 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_20 +#ifndef CONF_DMAC_LVL_20 +#define CONF_DMAC_LVL_20 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_20 +#ifndef CONF_DMAC_EVOE_20 +#define CONF_DMAC_EVOE_20 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_20 +#ifndef CONF_DMAC_EVIE_20 +#define CONF_DMAC_EVIE_20 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_20 +#ifndef CONF_DMAC_EVACT_20 +#define CONF_DMAC_EVACT_20 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_20 +#ifndef CONF_DMAC_STEPSIZE_20 +#define CONF_DMAC_STEPSIZE_20 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_20 +#ifndef CONF_DMAC_STEPSEL_20 +#define CONF_DMAC_STEPSEL_20 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_20 +#ifndef CONF_DMAC_SRCINC_20 +#define CONF_DMAC_SRCINC_20 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_20 +#ifndef CONF_DMAC_DSTINC_20 +#define CONF_DMAC_DSTINC_20 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_20 +#ifndef CONF_DMAC_BEATSIZE_20 +#define CONF_DMAC_BEATSIZE_20 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_20 +#ifndef CONF_DMAC_BLOCKACT_20 +#define CONF_DMAC_BLOCKACT_20 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_20 +#ifndef CONF_DMAC_EVOSEL_20 +#define CONF_DMAC_EVOSEL_20 0 +#endif +// + +// Channel 21 settings +// dmac_channel_21_settings +#ifndef CONF_DMAC_CHANNEL_21_SETTINGS +#define CONF_DMAC_CHANNEL_21_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 21 is running in standby mode or not +// dmac_runstdby_21 +#ifndef CONF_DMAC_RUNSTDBY_21 +#define CONF_DMAC_RUNSTDBY_21 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_21 +#ifndef CONF_DMAC_TRIGACT_21 +#define CONF_DMAC_TRIGACT_21 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_21 +#ifndef CONF_DMAC_TRIGSRC_21 +#define CONF_DMAC_TRIGSRC_21 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_21 +#ifndef CONF_DMAC_LVL_21 +#define CONF_DMAC_LVL_21 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_21 +#ifndef CONF_DMAC_EVOE_21 +#define CONF_DMAC_EVOE_21 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_21 +#ifndef CONF_DMAC_EVIE_21 +#define CONF_DMAC_EVIE_21 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_21 +#ifndef CONF_DMAC_EVACT_21 +#define CONF_DMAC_EVACT_21 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_21 +#ifndef CONF_DMAC_STEPSIZE_21 +#define CONF_DMAC_STEPSIZE_21 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_21 +#ifndef CONF_DMAC_STEPSEL_21 +#define CONF_DMAC_STEPSEL_21 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_21 +#ifndef CONF_DMAC_SRCINC_21 +#define CONF_DMAC_SRCINC_21 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_21 +#ifndef CONF_DMAC_DSTINC_21 +#define CONF_DMAC_DSTINC_21 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_21 +#ifndef CONF_DMAC_BEATSIZE_21 +#define CONF_DMAC_BEATSIZE_21 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_21 +#ifndef CONF_DMAC_BLOCKACT_21 +#define CONF_DMAC_BLOCKACT_21 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_21 +#ifndef CONF_DMAC_EVOSEL_21 +#define CONF_DMAC_EVOSEL_21 0 +#endif +// + +// Channel 22 settings +// dmac_channel_22_settings +#ifndef CONF_DMAC_CHANNEL_22_SETTINGS +#define CONF_DMAC_CHANNEL_22_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 22 is running in standby mode or not +// dmac_runstdby_22 +#ifndef CONF_DMAC_RUNSTDBY_22 +#define CONF_DMAC_RUNSTDBY_22 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_22 +#ifndef CONF_DMAC_TRIGACT_22 +#define CONF_DMAC_TRIGACT_22 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_22 +#ifndef CONF_DMAC_TRIGSRC_22 +#define CONF_DMAC_TRIGSRC_22 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_22 +#ifndef CONF_DMAC_LVL_22 +#define CONF_DMAC_LVL_22 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_22 +#ifndef CONF_DMAC_EVOE_22 +#define CONF_DMAC_EVOE_22 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_22 +#ifndef CONF_DMAC_EVIE_22 +#define CONF_DMAC_EVIE_22 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_22 +#ifndef CONF_DMAC_EVACT_22 +#define CONF_DMAC_EVACT_22 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_22 +#ifndef CONF_DMAC_STEPSIZE_22 +#define CONF_DMAC_STEPSIZE_22 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_22 +#ifndef CONF_DMAC_STEPSEL_22 +#define CONF_DMAC_STEPSEL_22 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_22 +#ifndef CONF_DMAC_SRCINC_22 +#define CONF_DMAC_SRCINC_22 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_22 +#ifndef CONF_DMAC_DSTINC_22 +#define CONF_DMAC_DSTINC_22 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_22 +#ifndef CONF_DMAC_BEATSIZE_22 +#define CONF_DMAC_BEATSIZE_22 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_22 +#ifndef CONF_DMAC_BLOCKACT_22 +#define CONF_DMAC_BLOCKACT_22 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_22 +#ifndef CONF_DMAC_EVOSEL_22 +#define CONF_DMAC_EVOSEL_22 0 +#endif +// + +// Channel 23 settings +// dmac_channel_23_settings +#ifndef CONF_DMAC_CHANNEL_23_SETTINGS +#define CONF_DMAC_CHANNEL_23_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 23 is running in standby mode or not +// dmac_runstdby_23 +#ifndef CONF_DMAC_RUNSTDBY_23 +#define CONF_DMAC_RUNSTDBY_23 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_23 +#ifndef CONF_DMAC_TRIGACT_23 +#define CONF_DMAC_TRIGACT_23 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_23 +#ifndef CONF_DMAC_TRIGSRC_23 +#define CONF_DMAC_TRIGSRC_23 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_23 +#ifndef CONF_DMAC_LVL_23 +#define CONF_DMAC_LVL_23 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_23 +#ifndef CONF_DMAC_EVOE_23 +#define CONF_DMAC_EVOE_23 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_23 +#ifndef CONF_DMAC_EVIE_23 +#define CONF_DMAC_EVIE_23 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_23 +#ifndef CONF_DMAC_EVACT_23 +#define CONF_DMAC_EVACT_23 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_23 +#ifndef CONF_DMAC_STEPSIZE_23 +#define CONF_DMAC_STEPSIZE_23 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_23 +#ifndef CONF_DMAC_STEPSEL_23 +#define CONF_DMAC_STEPSEL_23 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_23 +#ifndef CONF_DMAC_SRCINC_23 +#define CONF_DMAC_SRCINC_23 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_23 +#ifndef CONF_DMAC_DSTINC_23 +#define CONF_DMAC_DSTINC_23 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_23 +#ifndef CONF_DMAC_BEATSIZE_23 +#define CONF_DMAC_BEATSIZE_23 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_23 +#ifndef CONF_DMAC_BLOCKACT_23 +#define CONF_DMAC_BLOCKACT_23 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_23 +#ifndef CONF_DMAC_EVOSEL_23 +#define CONF_DMAC_EVOSEL_23 0 +#endif +// + +// Channel 24 settings +// dmac_channel_24_settings +#ifndef CONF_DMAC_CHANNEL_24_SETTINGS +#define CONF_DMAC_CHANNEL_24_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 24 is running in standby mode or not +// dmac_runstdby_24 +#ifndef CONF_DMAC_RUNSTDBY_24 +#define CONF_DMAC_RUNSTDBY_24 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_24 +#ifndef CONF_DMAC_TRIGACT_24 +#define CONF_DMAC_TRIGACT_24 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_24 +#ifndef CONF_DMAC_TRIGSRC_24 +#define CONF_DMAC_TRIGSRC_24 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_24 +#ifndef CONF_DMAC_LVL_24 +#define CONF_DMAC_LVL_24 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_24 +#ifndef CONF_DMAC_EVOE_24 +#define CONF_DMAC_EVOE_24 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_24 +#ifndef CONF_DMAC_EVIE_24 +#define CONF_DMAC_EVIE_24 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_24 +#ifndef CONF_DMAC_EVACT_24 +#define CONF_DMAC_EVACT_24 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_24 +#ifndef CONF_DMAC_STEPSIZE_24 +#define CONF_DMAC_STEPSIZE_24 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_24 +#ifndef CONF_DMAC_STEPSEL_24 +#define CONF_DMAC_STEPSEL_24 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_24 +#ifndef CONF_DMAC_SRCINC_24 +#define CONF_DMAC_SRCINC_24 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_24 +#ifndef CONF_DMAC_DSTINC_24 +#define CONF_DMAC_DSTINC_24 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_24 +#ifndef CONF_DMAC_BEATSIZE_24 +#define CONF_DMAC_BEATSIZE_24 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_24 +#ifndef CONF_DMAC_BLOCKACT_24 +#define CONF_DMAC_BLOCKACT_24 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_24 +#ifndef CONF_DMAC_EVOSEL_24 +#define CONF_DMAC_EVOSEL_24 0 +#endif +// + +// Channel 25 settings +// dmac_channel_25_settings +#ifndef CONF_DMAC_CHANNEL_25_SETTINGS +#define CONF_DMAC_CHANNEL_25_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 25 is running in standby mode or not +// dmac_runstdby_25 +#ifndef CONF_DMAC_RUNSTDBY_25 +#define CONF_DMAC_RUNSTDBY_25 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_25 +#ifndef CONF_DMAC_TRIGACT_25 +#define CONF_DMAC_TRIGACT_25 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_25 +#ifndef CONF_DMAC_TRIGSRC_25 +#define CONF_DMAC_TRIGSRC_25 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_25 +#ifndef CONF_DMAC_LVL_25 +#define CONF_DMAC_LVL_25 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_25 +#ifndef CONF_DMAC_EVOE_25 +#define CONF_DMAC_EVOE_25 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_25 +#ifndef CONF_DMAC_EVIE_25 +#define CONF_DMAC_EVIE_25 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_25 +#ifndef CONF_DMAC_EVACT_25 +#define CONF_DMAC_EVACT_25 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_25 +#ifndef CONF_DMAC_STEPSIZE_25 +#define CONF_DMAC_STEPSIZE_25 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_25 +#ifndef CONF_DMAC_STEPSEL_25 +#define CONF_DMAC_STEPSEL_25 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_25 +#ifndef CONF_DMAC_SRCINC_25 +#define CONF_DMAC_SRCINC_25 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_25 +#ifndef CONF_DMAC_DSTINC_25 +#define CONF_DMAC_DSTINC_25 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_25 +#ifndef CONF_DMAC_BEATSIZE_25 +#define CONF_DMAC_BEATSIZE_25 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_25 +#ifndef CONF_DMAC_BLOCKACT_25 +#define CONF_DMAC_BLOCKACT_25 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_25 +#ifndef CONF_DMAC_EVOSEL_25 +#define CONF_DMAC_EVOSEL_25 0 +#endif +// + +// Channel 26 settings +// dmac_channel_26_settings +#ifndef CONF_DMAC_CHANNEL_26_SETTINGS +#define CONF_DMAC_CHANNEL_26_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 26 is running in standby mode or not +// dmac_runstdby_26 +#ifndef CONF_DMAC_RUNSTDBY_26 +#define CONF_DMAC_RUNSTDBY_26 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_26 +#ifndef CONF_DMAC_TRIGACT_26 +#define CONF_DMAC_TRIGACT_26 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_26 +#ifndef CONF_DMAC_TRIGSRC_26 +#define CONF_DMAC_TRIGSRC_26 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_26 +#ifndef CONF_DMAC_LVL_26 +#define CONF_DMAC_LVL_26 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_26 +#ifndef CONF_DMAC_EVOE_26 +#define CONF_DMAC_EVOE_26 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_26 +#ifndef CONF_DMAC_EVIE_26 +#define CONF_DMAC_EVIE_26 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_26 +#ifndef CONF_DMAC_EVACT_26 +#define CONF_DMAC_EVACT_26 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_26 +#ifndef CONF_DMAC_STEPSIZE_26 +#define CONF_DMAC_STEPSIZE_26 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_26 +#ifndef CONF_DMAC_STEPSEL_26 +#define CONF_DMAC_STEPSEL_26 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_26 +#ifndef CONF_DMAC_SRCINC_26 +#define CONF_DMAC_SRCINC_26 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_26 +#ifndef CONF_DMAC_DSTINC_26 +#define CONF_DMAC_DSTINC_26 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_26 +#ifndef CONF_DMAC_BEATSIZE_26 +#define CONF_DMAC_BEATSIZE_26 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_26 +#ifndef CONF_DMAC_BLOCKACT_26 +#define CONF_DMAC_BLOCKACT_26 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_26 +#ifndef CONF_DMAC_EVOSEL_26 +#define CONF_DMAC_EVOSEL_26 0 +#endif +// + +// Channel 27 settings +// dmac_channel_27_settings +#ifndef CONF_DMAC_CHANNEL_27_SETTINGS +#define CONF_DMAC_CHANNEL_27_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 27 is running in standby mode or not +// dmac_runstdby_27 +#ifndef CONF_DMAC_RUNSTDBY_27 +#define CONF_DMAC_RUNSTDBY_27 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_27 +#ifndef CONF_DMAC_TRIGACT_27 +#define CONF_DMAC_TRIGACT_27 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_27 +#ifndef CONF_DMAC_TRIGSRC_27 +#define CONF_DMAC_TRIGSRC_27 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_27 +#ifndef CONF_DMAC_LVL_27 +#define CONF_DMAC_LVL_27 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_27 +#ifndef CONF_DMAC_EVOE_27 +#define CONF_DMAC_EVOE_27 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_27 +#ifndef CONF_DMAC_EVIE_27 +#define CONF_DMAC_EVIE_27 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_27 +#ifndef CONF_DMAC_EVACT_27 +#define CONF_DMAC_EVACT_27 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_27 +#ifndef CONF_DMAC_STEPSIZE_27 +#define CONF_DMAC_STEPSIZE_27 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_27 +#ifndef CONF_DMAC_STEPSEL_27 +#define CONF_DMAC_STEPSEL_27 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_27 +#ifndef CONF_DMAC_SRCINC_27 +#define CONF_DMAC_SRCINC_27 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_27 +#ifndef CONF_DMAC_DSTINC_27 +#define CONF_DMAC_DSTINC_27 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_27 +#ifndef CONF_DMAC_BEATSIZE_27 +#define CONF_DMAC_BEATSIZE_27 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_27 +#ifndef CONF_DMAC_BLOCKACT_27 +#define CONF_DMAC_BLOCKACT_27 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_27 +#ifndef CONF_DMAC_EVOSEL_27 +#define CONF_DMAC_EVOSEL_27 0 +#endif +// + +// Channel 28 settings +// dmac_channel_28_settings +#ifndef CONF_DMAC_CHANNEL_28_SETTINGS +#define CONF_DMAC_CHANNEL_28_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 28 is running in standby mode or not +// dmac_runstdby_28 +#ifndef CONF_DMAC_RUNSTDBY_28 +#define CONF_DMAC_RUNSTDBY_28 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_28 +#ifndef CONF_DMAC_TRIGACT_28 +#define CONF_DMAC_TRIGACT_28 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_28 +#ifndef CONF_DMAC_TRIGSRC_28 +#define CONF_DMAC_TRIGSRC_28 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_28 +#ifndef CONF_DMAC_LVL_28 +#define CONF_DMAC_LVL_28 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_28 +#ifndef CONF_DMAC_EVOE_28 +#define CONF_DMAC_EVOE_28 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_28 +#ifndef CONF_DMAC_EVIE_28 +#define CONF_DMAC_EVIE_28 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_28 +#ifndef CONF_DMAC_EVACT_28 +#define CONF_DMAC_EVACT_28 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_28 +#ifndef CONF_DMAC_STEPSIZE_28 +#define CONF_DMAC_STEPSIZE_28 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_28 +#ifndef CONF_DMAC_STEPSEL_28 +#define CONF_DMAC_STEPSEL_28 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_28 +#ifndef CONF_DMAC_SRCINC_28 +#define CONF_DMAC_SRCINC_28 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_28 +#ifndef CONF_DMAC_DSTINC_28 +#define CONF_DMAC_DSTINC_28 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_28 +#ifndef CONF_DMAC_BEATSIZE_28 +#define CONF_DMAC_BEATSIZE_28 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_28 +#ifndef CONF_DMAC_BLOCKACT_28 +#define CONF_DMAC_BLOCKACT_28 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_28 +#ifndef CONF_DMAC_EVOSEL_28 +#define CONF_DMAC_EVOSEL_28 0 +#endif +// + +// Channel 29 settings +// dmac_channel_29_settings +#ifndef CONF_DMAC_CHANNEL_29_SETTINGS +#define CONF_DMAC_CHANNEL_29_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 29 is running in standby mode or not +// dmac_runstdby_29 +#ifndef CONF_DMAC_RUNSTDBY_29 +#define CONF_DMAC_RUNSTDBY_29 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_29 +#ifndef CONF_DMAC_TRIGACT_29 +#define CONF_DMAC_TRIGACT_29 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_29 +#ifndef CONF_DMAC_TRIGSRC_29 +#define CONF_DMAC_TRIGSRC_29 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_29 +#ifndef CONF_DMAC_LVL_29 +#define CONF_DMAC_LVL_29 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_29 +#ifndef CONF_DMAC_EVOE_29 +#define CONF_DMAC_EVOE_29 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_29 +#ifndef CONF_DMAC_EVIE_29 +#define CONF_DMAC_EVIE_29 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_29 +#ifndef CONF_DMAC_EVACT_29 +#define CONF_DMAC_EVACT_29 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_29 +#ifndef CONF_DMAC_STEPSIZE_29 +#define CONF_DMAC_STEPSIZE_29 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_29 +#ifndef CONF_DMAC_STEPSEL_29 +#define CONF_DMAC_STEPSEL_29 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_29 +#ifndef CONF_DMAC_SRCINC_29 +#define CONF_DMAC_SRCINC_29 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_29 +#ifndef CONF_DMAC_DSTINC_29 +#define CONF_DMAC_DSTINC_29 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_29 +#ifndef CONF_DMAC_BEATSIZE_29 +#define CONF_DMAC_BEATSIZE_29 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_29 +#ifndef CONF_DMAC_BLOCKACT_29 +#define CONF_DMAC_BLOCKACT_29 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_29 +#ifndef CONF_DMAC_EVOSEL_29 +#define CONF_DMAC_EVOSEL_29 0 +#endif +// + +// Channel 30 settings +// dmac_channel_30_settings +#ifndef CONF_DMAC_CHANNEL_30_SETTINGS +#define CONF_DMAC_CHANNEL_30_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 30 is running in standby mode or not +// dmac_runstdby_30 +#ifndef CONF_DMAC_RUNSTDBY_30 +#define CONF_DMAC_RUNSTDBY_30 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_30 +#ifndef CONF_DMAC_TRIGACT_30 +#define CONF_DMAC_TRIGACT_30 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_30 +#ifndef CONF_DMAC_TRIGSRC_30 +#define CONF_DMAC_TRIGSRC_30 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_30 +#ifndef CONF_DMAC_LVL_30 +#define CONF_DMAC_LVL_30 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_30 +#ifndef CONF_DMAC_EVOE_30 +#define CONF_DMAC_EVOE_30 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_30 +#ifndef CONF_DMAC_EVIE_30 +#define CONF_DMAC_EVIE_30 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_30 +#ifndef CONF_DMAC_EVACT_30 +#define CONF_DMAC_EVACT_30 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_30 +#ifndef CONF_DMAC_STEPSIZE_30 +#define CONF_DMAC_STEPSIZE_30 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_30 +#ifndef CONF_DMAC_STEPSEL_30 +#define CONF_DMAC_STEPSEL_30 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_30 +#ifndef CONF_DMAC_SRCINC_30 +#define CONF_DMAC_SRCINC_30 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_30 +#ifndef CONF_DMAC_DSTINC_30 +#define CONF_DMAC_DSTINC_30 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_30 +#ifndef CONF_DMAC_BEATSIZE_30 +#define CONF_DMAC_BEATSIZE_30 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_30 +#ifndef CONF_DMAC_BLOCKACT_30 +#define CONF_DMAC_BLOCKACT_30 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_30 +#ifndef CONF_DMAC_EVOSEL_30 +#define CONF_DMAC_EVOSEL_30 0 +#endif +// + +// Channel 31 settings +// dmac_channel_31_settings +#ifndef CONF_DMAC_CHANNEL_31_SETTINGS +#define CONF_DMAC_CHANNEL_31_SETTINGS 0 +#endif + +// Channel Run in Standby +// Indicates whether channel 31 is running in standby mode or not +// dmac_runstdby_31 +#ifndef CONF_DMAC_RUNSTDBY_31 +#define CONF_DMAC_RUNSTDBY_31 0 +#endif + +// Trigger action +// <0=> One trigger required for each block transfer +// <2=> One trigger required for each beat transfer +// <3=> One trigger required for each transaction +// Defines the trigger action used for a transfer +// dmac_trigact_31 +#ifndef CONF_DMAC_TRIGACT_31 +#define CONF_DMAC_TRIGACT_31 0 +#endif + +// Trigger source +// <0x00=> Only software/event triggers +// <0x01=> RTC Time Stamp Trigger +// <0x02=> DSU Debug Communication Channel 0 Trigger +// <0x03=> DSU Debug Communication Channel 1 Trigger +// <0x04=> SERCOM0 RX Trigger +// <0x05=> SERCOM0 TX Trigger +// <0x06=> SERCOM1 RX Trigger +// <0x07=> SERCOM1 TX Trigger +// <0x08=> SERCOM2 RX Trigger +// <0x09=> SERCOM2 TX Trigger +// <0x0A=> SERCOM3 RX Trigger +// <0x0B=> SERCOM3 TX Trigger +// <0x0C=> SERCOM4 RX Trigger +// <0x0D=> SERCOM4 TX Trigger +// <0x0E=> SERCOM5 RX Trigger +// <0x0F=> SERCOM5 TX Trigger +// <0x10=> SERCOM6 RX Trigger +// <0x11=> SERCOM6 TX Trigger +// <0x12=> SERCOM7 RX Trigger +// <0x13=> SERCOM7 TX Trigger +// <0x14=> CAN0 DEBUG Trigger +// <0x15=> CAN1 DEBUG Trigger +// <0x16=> TCC0 Overflow Trigger Trigger +// <0x17=> TCC0 Match/Compare 0 Trigger Trigger +// <0x18=> TCC0 Match/Compare 1 Trigger Trigger +// <0x19=> TCC0 Match/Compare 2 Trigger Trigger +// <0x1A=> TCC0 Match/Compare 3 Trigger Trigger +// <0x1B=> TCC0 Match/Compare 4 Trigger Trigger +// <0x1C=> TCC0 Match/Compare 5 Trigger Trigger +// <0x1D=> TCC1 Overflow Trigger Trigger +// <0x1E=> TCC1 Match/Compare 0 Trigger Trigger +// <0x1F=> TCC1 Match/Compare 1 Trigger Trigger +// <0x20=> TCC1 Match/Compare 2 Trigger Trigger +// <0x21=> TCC1 Match/Compare 3 Trigger Trigger +// <0x22=> TCC2 Overflow Trigger Trigger +// <0x23=> TCC2 Match/Compare 0 Trigger Trigger +// <0x24=> TCC2 Match/Compare 1 Trigger Trigger +// <0x25=> TCC2 Match/Compare 2 Trigger Trigger +// <0x26=> TCC3 Overflow Trigger Trigger +// <0x27=> TCC3 Match/Compare 0 Trigger Trigger +// <0x28=> TCC3 Match/Compare 1 Trigger Trigger +// <0x29=> TCC4 Overflow Trigger Trigger +// <0x2A=> TCC4 Match/Compare 0 Trigger Trigger +// <0x2B=> TCC4 Match/Compare 1 Trigger Trigger +// <0x2C=> TC0 Overflow Trigger +// <0x2D=> TC0 Match/Compare 0 Trigger +// <0x2E=> TC0 Match/Compare 1 Trigger +// <0x2F=> TC1 Overflow Trigger +// <0x30=> TC1 Match/Compare 0 Trigger +// <0x31=> TC1 Match/Compare 1 Trigger +// <0x32=> TC2 Overflow Trigger +// <0x33=> TC2 Match/Compare 0 Trigger +// <0x34=> TC2 Match/Compare 1 Trigger +// <0x35=> TC3 Overflow Trigger +// <0x36=> TC3 Match/Compare 0 Trigger +// <0x37=> TC3 Match/Compare 1 Trigger +// <0x38=> TC4 Overflow Trigger +// <0x39=> TC4 Match/Compare 0 Trigger +// <0x3A=> TC4 Match/Compare 1 Trigger +// <0x3B=> TC5 Overflow Trigger +// <0x3C=> TC5 Match/Compare 0 Trigger +// <0x3D=> TC5 Match/Compare 1 Trigger +// <0x3E=> TC6 Overflow Trigger +// <0x3F=> TC6 Match/Compare 0 Trigger +// <0x40=> TC6 Match/Compare 1 Trigger +// <0x41=> TC7 Overflow Trigger +// <0x42=> TC7 Match/Compare 0 Trigger +// <0x43=> TC7 Match/Compare 1 Trigger +// <0x44=> ADC0 Result Ready Trigger +// <0x45=> ADC0 Sequencing Trigger +// <0x46=> ADC1 Result Ready Trigger +// <0x47=> ADC1 Sequencing Trigger +// <0x48=> DAC Empty 0 Trigger +// <0x49=> DAC Empty 1 Trigger +// <0x4A=> DAC Result Ready 0 Trigger +// <0x4B=> DAC Result Ready 1 Trigger +// <0x4C=> I2S Rx 0 Trigger +// <0x4D=> I2S Rx 1 Trigger +// <0x4E=> I2S Tx 0 Trigger +// <0x4F=> I2S Tx 1 Trigger +// <0x50=> PCC RX Trigger +// <0x51=> AES Write Trigger +// <0x52=> AES Read Trigger +// <0x53=> QSPI Rx Trigger +// <0x54=> QSPI Tx Trigger +// Defines the peripheral trigger which is source of the transfer +// dmac_trifsrc_31 +#ifndef CONF_DMAC_TRIGSRC_31 +#define CONF_DMAC_TRIGSRC_31 0 +#endif + +// Channel Arbitration Level +// <0=> Channel priority 0 +// <1=> Channel priority 1 +// <2=> Channel priority 2 +// <3=> Channel priority 3 +// Defines the arbitration level for this channel +// dmac_lvl_31 +#ifndef CONF_DMAC_LVL_31 +#define CONF_DMAC_LVL_31 0 +#endif + +// Channel Event Output +// Indicates whether channel event generation is enabled or not +// dmac_evoe_31 +#ifndef CONF_DMAC_EVOE_31 +#define CONF_DMAC_EVOE_31 0 +#endif + +// Channel Event Input +// Indicates whether channel event reception is enabled or not +// dmac_evie_31 +#ifndef CONF_DMAC_EVIE_31 +#define CONF_DMAC_EVIE_31 0 +#endif + +// Event Input Action +// <0=> No action +// <1=> Normal transfer and conditional transfer on strobe trigger +// <2=> Conditional transfer trigger +// <3=> Conditional block transfer +// <4=> Channel suspend operation +// <5=> Channel resume operation +// <6=> Skip next block suspend action +// Defines the event input action +// dmac_evact_31 +#ifndef CONF_DMAC_EVACT_31 +#define CONF_DMAC_EVACT_31 0 +#endif + +// Address Increment Step Size +// <0=> Next ADDR = ADDR + (BEATSIZE + 1) * 1 +// <1=> Next ADDR = ADDR + (BEATSIZE + 1) * 2 +// <2=> Next ADDR = ADDR + (BEATSIZE + 1) * 4 +// <3=> Next ADDR = ADDR + (BEATSIZE + 1) * 8 +// <4=> Next ADDR = ADDR + (BEATSIZE + 1) * 16 +// <5=> Next ADDR = ADDR + (BEATSIZE + 1) * 32 +// <6=> Next ADDR = ADDR + (BEATSIZE + 1) * 64 +// <7=> Next ADDR = ADDR + (BEATSIZE + 1) * 128 +// Defines the address increment step size, applies to source or destination address +// dmac_stepsize_31 +#ifndef CONF_DMAC_STEPSIZE_31 +#define CONF_DMAC_STEPSIZE_31 0 +#endif + +// Step Selection +// <0=> Step size settings apply to the destination address +// <1=> Step size settings apply to the source address +// Defines whether source or destination addresses are using the step size settings +// dmac_stepsel_31 +#ifndef CONF_DMAC_STEPSEL_31 +#define CONF_DMAC_STEPSEL_31 0 +#endif + +// Source Address Increment +// Indicates whether the source address incrementation is enabled or not +// dmac_srcinc_31 +#ifndef CONF_DMAC_SRCINC_31 +#define CONF_DMAC_SRCINC_31 0 +#endif + +// Destination Address Increment +// Indicates whether the destination address incrementation is enabled or not +// dmac_dstinc_31 +#ifndef CONF_DMAC_DSTINC_31 +#define CONF_DMAC_DSTINC_31 0 +#endif + +// Beat Size +// <0=> 8-bit bus transfer +// <1=> 16-bit bus transfer +// <2=> 32-bit bus transfer +// Defines the size of one beat +// dmac_beatsize_31 +#ifndef CONF_DMAC_BEATSIZE_31 +#define CONF_DMAC_BEATSIZE_31 0 +#endif + +// Block Action +// <0=> Channel will be disabled if it is the last block transfer in the transaction +// <1=> Channel will be disabled if it is the last block transfer in the transaction and block interrupt +// <2=> Channel suspend operation is complete +// <3=> Both channel suspend operation and block interrupt +// Defines the the DMAC should take after a block transfer has completed +// dmac_blockact_31 +#ifndef CONF_DMAC_BLOCKACT_31 +#define CONF_DMAC_BLOCKACT_31 0 +#endif + +// Event Output Selection +// <0=> Event generation disabled +// <1=> Event strobe when block transfer complete +// <3=> Event strobe when beat transfer complete +// Defines the event output selection +// dmac_evosel_31 +#ifndef CONF_DMAC_EVOSEL_31 +#define CONF_DMAC_EVOSEL_31 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_DMAC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h new file mode 100644 index 0000000000..6f4f01a7e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_gclk_config.h @@ -0,0 +1,924 @@ +// Circuit Python SAMD51 clock tree: +// DFLL48M (with USBCRM on to sync with external USB ref) -> GCLK1, GCLK5, GCLK6 +// GCLK1 (48MHz) -> 48 MHz peripherals +// GCLK5 (48 MHz divided down to 2 MHz) -> DPLL0 +// DPLL0 (multiplied up to 120 MHz) -> GCLK0, GCLK4 (output for monitoring) +// GCLK6 (48 MHz divided down to 12 MHz) -> DAC + +// We'd like to use XOSC32K as a ref for DFLL48M on boards with a 32kHz crystal, +// but haven't figured that out yet. + +// Used in hpl/core/hpl_init.c to define which clocks should be initialized first. +// Not clear why all these need to be specified, but it doesn't work properly otherwise. + +//#define CIRCUITPY_GCLK_INIT_1ST (1 << 0 | 1 << 1 | 1 << 3 | 1 <<5) +#define CIRCUITPY_GCLK_INIT_1ST 0xffff + +/* Auto-generated config file hpl_gclk_config.h */ +#ifndef HPL_GCLK_CONFIG_H +#define HPL_GCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Generic clock generator 0 configuration +// Indicates whether generic clock 0 configuration is enabled or not +// enable_gclk_gen_0 +#ifndef CONF_GCLK_GENERATOR_0_CONFIG +#define CONF_GCLK_GENERATOR_0_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 0 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 0 +// gclk_gen_0_oscillator +#ifndef CONF_GCLK_GEN_0_SOURCE +#define CONF_GCLK_GEN_0_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_0_runstdby +#ifndef CONF_GCLK_GEN_0_RUNSTDBY +#define CONF_GCLK_GEN_0_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_0_div_sel +#ifndef CONF_GCLK_GEN_0_DIVSEL +#define CONF_GCLK_GEN_0_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_0_oe +#ifndef CONF_GCLK_GEN_0_OE +#define CONF_GCLK_GEN_0_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_0_oov +#ifndef CONF_GCLK_GEN_0_OOV +#define CONF_GCLK_GEN_0_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_0_idc +#ifndef CONF_GCLK_GEN_0_IDC +#define CONF_GCLK_GEN_0_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_0_enable +#ifndef CONF_GCLK_GEN_0_GENEN +#define CONF_GCLK_GEN_0_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 0 division <0x0000-0xFFFF> +// gclk_gen_0_div +#ifndef CONF_GCLK_GEN_0_DIV +#define CONF_GCLK_GEN_0_DIV 1 +#endif +// +// + +// Generic clock generator 1 configuration +// Indicates whether generic clock 1 configuration is enabled or not +// enable_gclk_gen_1 +#ifndef CONF_GCLK_GENERATOR_1_CONFIG +#define CONF_GCLK_GENERATOR_1_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 1 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 1 +// gclk_gen_1_oscillator +#ifndef CONF_GCLK_GEN_1_SOURCE +#define CONF_GCLK_GEN_1_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_1_runstdby +#ifndef CONF_GCLK_GEN_1_RUNSTDBY +#define CONF_GCLK_GEN_1_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_1_div_sel +#ifndef CONF_GCLK_GEN_1_DIVSEL +#define CONF_GCLK_GEN_1_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_1_oe +#ifndef CONF_GCLK_GEN_1_OE +#define CONF_GCLK_GEN_1_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_1_oov +#ifndef CONF_GCLK_GEN_1_OOV +#define CONF_GCLK_GEN_1_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_1_idc +#ifndef CONF_GCLK_GEN_1_IDC +#define CONF_GCLK_GEN_1_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_1_enable +#ifndef CONF_GCLK_GEN_1_GENEN +#define CONF_GCLK_GEN_1_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 1 division <0x0000-0xFFFF> +// gclk_gen_1_div +#ifndef CONF_GCLK_GEN_1_DIV +#define CONF_GCLK_GEN_1_DIV 1 +#endif +// +// + +// Generic clock generator 2 configuration +// Indicates whether generic clock 2 configuration is enabled or not +// enable_gclk_gen_2 +#ifndef CONF_GCLK_GENERATOR_2_CONFIG +#define CONF_GCLK_GENERATOR_2_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 2 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 2 +// gclk_gen_2_oscillator +#ifndef CONF_GCLK_GEN_2_SOURCE +#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_2_runstdby +#ifndef CONF_GCLK_GEN_2_RUNSTDBY +#define CONF_GCLK_GEN_2_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_2_div_sel +#ifndef CONF_GCLK_GEN_2_DIVSEL +#define CONF_GCLK_GEN_2_DIVSEL 1 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_2_oe +#ifndef CONF_GCLK_GEN_2_OE +#define CONF_GCLK_GEN_2_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_2_oov +#ifndef CONF_GCLK_GEN_2_OOV +#define CONF_GCLK_GEN_2_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_2_idc +#ifndef CONF_GCLK_GEN_2_IDC +#define CONF_GCLK_GEN_2_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_2_enable +#ifndef CONF_GCLK_GEN_2_GENEN +#define CONF_GCLK_GEN_2_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 2 division <0x0000-0xFFFF> +// gclk_gen_2_div +#ifndef CONF_GCLK_GEN_2_DIV +#define CONF_GCLK_GEN_2_DIV 4 +#endif +// +// + +// Generic clock generator 3 configuration +// Indicates whether generic clock 3 configuration is enabled or not +// enable_gclk_gen_3 +#ifndef CONF_GCLK_GENERATOR_3_CONFIG +#define CONF_GCLK_GENERATOR_3_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 3 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 3 +// gclk_gen_3_oscillator +#ifndef CONF_GCLK_GEN_3_SOURCE +#define CONF_GCLK_GEN_3_SOURCE GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_3_runstdby +#ifndef CONF_GCLK_GEN_3_RUNSTDBY +#define CONF_GCLK_GEN_3_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_3_div_sel +#ifndef CONF_GCLK_GEN_3_DIVSEL +#define CONF_GCLK_GEN_3_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_3_oe +#ifndef CONF_GCLK_GEN_3_OE +#define CONF_GCLK_GEN_3_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_3_oov +#ifndef CONF_GCLK_GEN_3_OOV +#define CONF_GCLK_GEN_3_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_3_idc +#ifndef CONF_GCLK_GEN_3_IDC +#define CONF_GCLK_GEN_3_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_3_enable +#ifndef CONF_GCLK_GEN_3_GENEN +#define CONF_GCLK_GEN_3_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 3 division <0x0000-0xFFFF> +// gclk_gen_3_div +#ifndef CONF_GCLK_GEN_3_DIV +#define CONF_GCLK_GEN_3_DIV 1 +#endif +// +// + +// Generic clock generator 4 configuration +// Indicates whether generic clock 4 configuration is enabled or not +// enable_gclk_gen_4 +#ifndef CONF_GCLK_GENERATOR_4_CONFIG +#define CONF_GCLK_GENERATOR_4_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 4 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 4 +// gclk_gen_4_oscillator +#ifndef CONF_GCLK_GEN_4_SOURCE +#define CONF_GCLK_GEN_4_SOURCE GCLK_GENCTRL_SRC_DPLL0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_4_runstdby +#ifndef CONF_GCLK_GEN_4_RUNSTDBY +#define CONF_GCLK_GEN_4_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_4_div_sel +#ifndef CONF_GCLK_GEN_4_DIVSEL +#define CONF_GCLK_GEN_4_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_4_oe +#ifndef CONF_GCLK_GEN_4_OE +#define CONF_GCLK_GEN_4_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_4_oov +#ifndef CONF_GCLK_GEN_4_OOV +#define CONF_GCLK_GEN_4_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_4_idc +#ifndef CONF_GCLK_GEN_4_IDC +#define CONF_GCLK_GEN_4_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_4_enable +#ifndef CONF_GCLK_GEN_4_GENEN +#define CONF_GCLK_GEN_4_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 4 division <0x0000-0xFFFF> +// gclk_gen_4_div +#ifndef CONF_GCLK_GEN_4_DIV +#define CONF_GCLK_GEN_4_DIV 1 +#endif +// +// + +// Generic clock generator 5 configuration +// Indicates whether generic clock 5 configuration is enabled or not +// enable_gclk_gen_5 +#ifndef CONF_GCLK_GENERATOR_5_CONFIG +#define CONF_GCLK_GENERATOR_5_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 5 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 5 +// gclk_gen_5_oscillator +#ifndef CONF_GCLK_GEN_5_SOURCE +#define CONF_GCLK_GEN_5_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_5_runstdby +#ifndef CONF_GCLK_GEN_5_RUNSTDBY +#define CONF_GCLK_GEN_5_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_5_div_sel +#ifndef CONF_GCLK_GEN_5_DIVSEL +#define CONF_GCLK_GEN_5_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_5_oe +#ifndef CONF_GCLK_GEN_5_OE +#define CONF_GCLK_GEN_5_OE 1 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_5_oov +#ifndef CONF_GCLK_GEN_5_OOV +#define CONF_GCLK_GEN_5_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_5_idc +#ifndef CONF_GCLK_GEN_5_IDC +#define CONF_GCLK_GEN_5_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_5_enable +#ifndef CONF_GCLK_GEN_5_GENEN +#define CONF_GCLK_GEN_5_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 5 division <0x0000-0xFFFF> +// gclk_gen_5_div +#ifndef CONF_GCLK_GEN_5_DIV +#define CONF_GCLK_GEN_5_DIV 24 +#endif +// +// + +// Generic clock generator 6 configuration +// Indicates whether generic clock 6 configuration is enabled or not +// enable_gclk_gen_6 +#ifndef CONF_GCLK_GENERATOR_6_CONFIG +#define CONF_GCLK_GENERATOR_6_CONFIG 1 +#endif + +// Generic Clock Generator Control +// Generic clock generator 6 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 6 +// gclk_gen_6_oscillator +#ifndef CONF_GCLK_GEN_6_SOURCE +#define CONF_GCLK_GEN_6_SOURCE GCLK_GENCTRL_SRC_DFLL +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_6_runstdby +#ifndef CONF_GCLK_GEN_6_RUNSTDBY +#define CONF_GCLK_GEN_6_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_6_div_sel +#ifndef CONF_GCLK_GEN_6_DIVSEL +#define CONF_GCLK_GEN_6_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_6_oe +#ifndef CONF_GCLK_GEN_6_OE +#define CONF_GCLK_GEN_6_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_6_oov +#ifndef CONF_GCLK_GEN_6_OOV +#define CONF_GCLK_GEN_6_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_6_idc +#ifndef CONF_GCLK_GEN_6_IDC +#define CONF_GCLK_GEN_6_IDC 1 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_6_enable +#ifndef CONF_GCLK_GEN_6_GENEN +#define CONF_GCLK_GEN_6_GENEN 1 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 6 division <0x0000-0xFFFF> +// gclk_gen_6_div +#ifndef CONF_GCLK_GEN_6_DIV +#define CONF_GCLK_GEN_6_DIV 4 +#endif +// +// + +// Generic clock generator 7 configuration +// Indicates whether generic clock 7 configuration is enabled or not +// enable_gclk_gen_7 +#ifndef CONF_GCLK_GENERATOR_7_CONFIG +#define CONF_GCLK_GENERATOR_7_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 7 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 7 +// gclk_gen_7_oscillator +#ifndef CONF_GCLK_GEN_7_SOURCE +#define CONF_GCLK_GEN_7_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_7_runstdby +#ifndef CONF_GCLK_GEN_7_RUNSTDBY +#define CONF_GCLK_GEN_7_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_7_div_sel +#ifndef CONF_GCLK_GEN_7_DIVSEL +#define CONF_GCLK_GEN_7_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_7_oe +#ifndef CONF_GCLK_GEN_7_OE +#define CONF_GCLK_GEN_7_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_7_oov +#ifndef CONF_GCLK_GEN_7_OOV +#define CONF_GCLK_GEN_7_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_7_idc +#ifndef CONF_GCLK_GEN_7_IDC +#define CONF_GCLK_GEN_7_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_7_enable +#ifndef CONF_GCLK_GEN_7_GENEN +#define CONF_GCLK_GEN_7_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 7 division <0x0000-0xFFFF> +// gclk_gen_7_div +#ifndef CONF_GCLK_GEN_7_DIV +#define CONF_GCLK_GEN_7_DIV 1 +#endif +// +// + +// Generic clock generator 8 configuration +// Indicates whether generic clock 8 configuration is enabled or not +// enable_gclk_gen_8 +#ifndef CONF_GCLK_GENERATOR_8_CONFIG +#define CONF_GCLK_GENERATOR_8_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 8 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 8 +// gclk_gen_8_oscillator +#ifndef CONF_GCLK_GEN_8_SOURCE +#define CONF_GCLK_GEN_8_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_8_runstdby +#ifndef CONF_GCLK_GEN_8_RUNSTDBY +#define CONF_GCLK_GEN_8_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_8_div_sel +#ifndef CONF_GCLK_GEN_8_DIVSEL +#define CONF_GCLK_GEN_8_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_8_oe +#ifndef CONF_GCLK_GEN_8_OE +#define CONF_GCLK_GEN_8_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_8_oov +#ifndef CONF_GCLK_GEN_8_OOV +#define CONF_GCLK_GEN_8_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_8_idc +#ifndef CONF_GCLK_GEN_8_IDC +#define CONF_GCLK_GEN_8_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_8_enable +#ifndef CONF_GCLK_GEN_8_GENEN +#define CONF_GCLK_GEN_8_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 8 division <0x0000-0xFFFF> +// gclk_gen_8_div +#ifndef CONF_GCLK_GEN_8_DIV +#define CONF_GCLK_GEN_8_DIV 1 +#endif +// +// + +// Generic clock generator 9 configuration +// Indicates whether generic clock 9 configuration is enabled or not +// enable_gclk_gen_9 +#ifndef CONF_GCLK_GENERATOR_9_CONFIG +#define CONF_GCLK_GENERATOR_9_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 9 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 9 +// gclk_gen_9_oscillator +#ifndef CONF_GCLK_GEN_9_SOURCE +#define CONF_GCLK_GEN_9_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_9_runstdby +#ifndef CONF_GCLK_GEN_9_RUNSTDBY +#define CONF_GCLK_GEN_9_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_9_div_sel +#ifndef CONF_GCLK_GEN_9_DIVSEL +#define CONF_GCLK_GEN_9_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_9_oe +#ifndef CONF_GCLK_GEN_9_OE +#define CONF_GCLK_GEN_9_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_9_oov +#ifndef CONF_GCLK_GEN_9_OOV +#define CONF_GCLK_GEN_9_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_9_idc +#ifndef CONF_GCLK_GEN_9_IDC +#define CONF_GCLK_GEN_9_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_9_enable +#ifndef CONF_GCLK_GEN_9_GENEN +#define CONF_GCLK_GEN_9_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 9 division <0x0000-0xFFFF> +// gclk_gen_9_div +#ifndef CONF_GCLK_GEN_9_DIV +#define CONF_GCLK_GEN_9_DIV 1 +#endif +// +// + +// Generic clock generator 10 configuration +// Indicates whether generic clock 10 configuration is enabled or not +// enable_gclk_gen_10 +#ifndef CONF_GCLK_GENERATOR_10_CONFIG +#define CONF_GCLK_GENERATOR_10_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 10 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 10 +// gclk_gen_10_oscillator +#ifndef CONF_GCLK_GEN_10_SOURCE +#define CONF_GCLK_GEN_10_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_10_runstdby +#ifndef CONF_GCLK_GEN_10_RUNSTDBY +#define CONF_GCLK_GEN_10_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_10_div_sel +#ifndef CONF_GCLK_GEN_10_DIVSEL +#define CONF_GCLK_GEN_10_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_10_oe +#ifndef CONF_GCLK_GEN_10_OE +#define CONF_GCLK_GEN_10_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_10_oov +#ifndef CONF_GCLK_GEN_10_OOV +#define CONF_GCLK_GEN_10_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_10_idc +#ifndef CONF_GCLK_GEN_10_IDC +#define CONF_GCLK_GEN_10_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_10_enable +#ifndef CONF_GCLK_GEN_10_GENEN +#define CONF_GCLK_GEN_10_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 10 division <0x0000-0xFFFF> +// gclk_gen_10_div +#ifndef CONF_GCLK_GEN_10_DIV +#define CONF_GCLK_GEN_10_DIV 1 +#endif +// +// + +// Generic clock generator 11 configuration +// Indicates whether generic clock 11 configuration is enabled or not +// enable_gclk_gen_11 +#ifndef CONF_GCLK_GENERATOR_11_CONFIG +#define CONF_GCLK_GENERATOR_11_CONFIG 0 +#endif + +// Generic Clock Generator Control +// Generic clock generator 11 source// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator input pad +// Generic clock generator 1 +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// Digital Frequency Locked Loop (DFLL48M) +// Digital Phase Locked Loop (DPLL0) +// Digital Phase Locked Loop (DPLL1) +// This defines the clock source for generic clock generator 11 +// gclk_gen_11_oscillator +#ifndef CONF_GCLK_GEN_11_SOURCE +#define CONF_GCLK_GEN_11_SOURCE GCLK_GENCTRL_SRC_XOSC1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// gclk_arch_gen_11_runstdby +#ifndef CONF_GCLK_GEN_11_RUNSTDBY +#define CONF_GCLK_GEN_11_RUNSTDBY 0 +#endif + +// Divide Selection +// Indicates whether Divide Selection is enabled or not +// gclk_gen_11_div_sel +#ifndef CONF_GCLK_GEN_11_DIVSEL +#define CONF_GCLK_GEN_11_DIVSEL 0 +#endif + +// Output Enable +// Indicates whether Output Enable is enabled or not +// gclk_arch_gen_11_oe +#ifndef CONF_GCLK_GEN_11_OE +#define CONF_GCLK_GEN_11_OE 0 +#endif + +// Output Off Value +// Indicates whether Output Off Value is enabled or not +// gclk_arch_gen_11_oov +#ifndef CONF_GCLK_GEN_11_OOV +#define CONF_GCLK_GEN_11_OOV 0 +#endif + +// Improve Duty Cycle +// Indicates whether Improve Duty Cycle is enabled or not +// gclk_arch_gen_11_idc +#ifndef CONF_GCLK_GEN_11_IDC +#define CONF_GCLK_GEN_11_IDC 0 +#endif + +// Generic Clock Generator Enable +// Indicates whether Generic Clock Generator Enable is enabled or not +// gclk_arch_gen_11_enable +#ifndef CONF_GCLK_GEN_11_GENEN +#define CONF_GCLK_GEN_11_GENEN 0 +#endif +// + +// Generic Clock Generator Division +// Generic clock generator 11 division <0x0000-0xFFFF> +// gclk_gen_11_div +#ifndef CONF_GCLK_GEN_11_DIV +#define CONF_GCLK_GEN_11_DIV 1 +#endif +// +// + +// <<< end of configuration section >>> + +#endif // HPL_GCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h new file mode 100644 index 0000000000..a5a7de53c2 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_mclk_config.h @@ -0,0 +1,104 @@ +/* Auto-generated config file hpl_mclk_config.h */ +#ifndef HPL_MCLK_CONFIG_H +#define HPL_MCLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// System Configuration +// Indicates whether configuration for system is enabled or not +// enable_cpu_clock +#ifndef CONF_SYSTEM_CONFIG +#define CONF_SYSTEM_CONFIG 1 +#endif + +// Basic settings +// CPU Clock source +// Generic clock generator 0 +// This defines the clock source for the CPU +// cpu_clock_source +#ifndef CONF_CPU_SRC +#define CONF_CPU_SRC GCLK_PCHCTRL_GEN_GCLK0_Val +#endif + +// CPU Clock Division Factor +// 1 +// 2 +// 4 +// 8 +// 16 +// 32 +// 64 +// 128 +// Prescalar for CPU clock +// cpu_div +#ifndef CONF_MCLK_CPUDIV +#define CONF_MCLK_CPUDIV MCLK_CPUDIV_DIV_DIV1_Val +#endif +// Low Power Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_lpdiv +#ifndef CONF_MCLK_LPDIV +#define CONF_MCLK_LPDIV MCLK_LPDIV_LPDIV_DIV4_Val +#endif + +// Backup Clock Division +// Divide by 1 +// Divide by 2 +// Divide by 4 +// Divide by 8 +// Divide by 16 +// Divide by 32 +// Divide by 64 +// Divide by 128 +// mclk_arch_bupdiv +#ifndef CONF_MCLK_BUPDIV +#define CONF_MCLK_BUPDIV MCLK_BUPDIV_BUPDIV_DIV8_Val +#endif +// High-Speed Clock Division +// Divide by 1 +// mclk_arch_hsdiv +#ifndef CONF_MCLK_HSDIV +#define CONF_MCLK_HSDIV MCLK_HSDIV_DIV_DIV1_Val +#endif +// + +// NVM Settings +// NVM Wait States +// These bits select the number of wait states for a read operation. +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// nvm_wait_states +#ifndef CONF_NVM_WAIT_STATE +#define CONF_NVM_WAIT_STATE 0 +#endif + +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_MCLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h new file mode 100644 index 0000000000..53fcb593ab --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_nvmctrl_config.h @@ -0,0 +1,36 @@ +/* Auto-generated config file hpl_nvmctrl_config.h */ +#ifndef HPL_NVMCTRL_CONFIG_H +#define HPL_NVMCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic Settings + +// Power Reduction Mode During Sleep +// <0x00=> Wake On Access +// <0x01=> Wake Up Instant +// <0x03=> Disabled +// nvm_arch_sleepprm +#ifndef CONF_NVM_SLEEPPRM +#define CONF_NVM_SLEEPPRM 0 +#endif + +// AHB0 Cache Disable +// Indicate whether AHB0 cache is disable or not +// nvm_arch_cache0 +#ifndef CONF_NVM_CACHE0 +#define CONF_NVM_CACHE0 1 +#endif + +// AHB1 Cache Disable +// Indicate whether AHB1 cache is disable or not +// nvm_arch_cache1 +#ifndef CONF_NVM_CACHE1 +#define CONF_NVM_CACHE1 1 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_NVMCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h new file mode 100644 index 0000000000..d93cbf922e --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_osc32kctrl_config.h @@ -0,0 +1,163 @@ +/* Auto-generated config file hpl_osc32kctrl_config.h */ +#ifndef HPL_OSC32KCTRL_CONFIG_H +#define HPL_OSC32KCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// RTC Source configuration +// enable_rtc_source +#ifndef CONF_RTCCTRL_CONFIG +#define CONF_RTCCTRL_CONFIG 0 +#endif + +// RTC source control +// RTC Clock Source Selection +// 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) +// 32kHz External Crystal Oscillator (XOSC32K) +// This defines the clock source for RTC +// rtc_source_oscillator +#ifndef CONF_RTCCTRL_SRC +#define CONF_RTCCTRL_SRC GCLK_GENCTRL_SRC_OSCULP32K +#endif + +// Use 1 kHz output +// rtc_1khz_selection +#ifndef CONF_RTCCTRL_1KHZ +#define CONF_RTCCTRL_1KHZ 1 +#endif + +#if CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_OSCULP32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_ULP32K_Val) +#elif CONF_RTCCTRL_SRC == GCLK_GENCTRL_SRC_XOSC32K +#define CONF_RTCCTRL (CONF_RTCCTRL_1KHZ ? OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val : OSC32KCTRL_RTCCTRL_RTCSEL_XOSC32K_Val) +#else +#error unexpected CONF_RTCCTRL_SRC +#endif + +// +// + +// 32kHz External Crystal Oscillator Configuration +// Indicates whether configuration for External 32K Osc is enabled or not +// enable_xosc32k +#ifndef CONF_XOSC32K_CONFIG +#define CONF_XOSC32K_CONFIG 1 +#endif + +// 32kHz External Crystal Oscillator Control +// Oscillator enable +// Indicates whether 32kHz External Crystal Oscillator is enabled or not +// xosc32k_arch_enable +#ifndef CONF_XOSC32K_ENABLE +#define CONF_XOSC32K_ENABLE 1 +#endif + +// Start-Up Time +// <0x0=>62592us +// <0x1=>125092us +// <0x2=>500092us +// <0x3=>1000092us +// <0x4=>2000092us +// <0x5=>4000092us +// <0x6=>8000092us +// xosc32k_arch_startup +#ifndef CONF_XOSC32K_STARTUP +#define CONF_XOSC32K_STARTUP 0x0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc32k_arch_ondemand +#ifndef CONF_XOSC32K_ONDEMAND +#define CONF_XOSC32K_ONDEMAND 1 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc32k_arch_runstdby +#ifndef CONF_XOSC32K_RUNSTDBY +#define CONF_XOSC32K_RUNSTDBY 0 +#endif + +// 1kHz Output Enable +// Indicates whether 1kHz Output is enabled or not +// xosc32k_arch_en1k +#ifndef CONF_XOSC32K_EN1K +#define CONF_XOSC32K_EN1K 0 +#endif + +// 32kHz Output Enable +// Indicates whether 32kHz Output is enabled or not +// xosc32k_arch_en32k +#ifndef CONF_XOSC32K_EN32K +#define CONF_XOSC32K_EN32K 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc32k_arch_swben +#ifndef CONF_XOSC32K_SWBEN +#define CONF_XOSC32K_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc32k_arch_cfden +#ifndef CONF_XOSC32K_CFDEN +#define CONF_XOSC32K_CFDEN 0 +#endif + +// Clock Failure Detector Event Out +// Indicates whether Clock Failure Detector Event Out is enabled or not +// xosc32k_arch_cfdeo +#ifndef CONF_XOSC32K_CFDEO +#define CONF_XOSC32K_CFDEO 0 +#endif + +// Crystal connected to XIN32/XOUT32 Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc32k_arch_xtalen +#ifndef CONF_XOSC32K_XTALEN +#define CONF_XOSC32K_XTALEN 0 +#endif + +// Control Gain Mode +// <0x0=>Low Power mode +// <0x1=>Standard mode +// <0x2=>High Speed mode +// xosc32k_arch_cgm +#ifndef CONF_XOSC32K_CGM +#define CONF_XOSC32K_CGM 0x1 +#endif + +// +// + +// 32kHz Ultra Low Power Internal Oscillator Configuration +// Indicates whether configuration for OSCULP32K is enabled or not +// enable_osculp32k +#ifndef CONF_OSCULP32K_CONFIG +#define CONF_OSCULP32K_CONFIG 1 +#endif + +// 32kHz Ultra Low Power Internal Oscillator Control + +// Oscillator Calibration Control +// Indicates whether Oscillator Calibration is enabled or not +// osculp32k_calib_enable +#ifndef CONF_OSCULP32K_CALIB_ENABLE +#define CONF_OSCULP32K_CALIB_ENABLE 0 +#endif + +// Oscillator Calibration <0x0-0x3F> +// osculp32k_calib +#ifndef CONF_OSCULP32K_CALIB +#define CONF_OSCULP32K_CALIB 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSC32KCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h new file mode 100644 index 0000000000..cd11866059 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_oscctrl_config.h @@ -0,0 +1,634 @@ +/* Auto-generated config file hpl_oscctrl_config.h */ +#ifndef HPL_OSCCTRL_CONFIG_H +#define HPL_OSCCTRL_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC0 is enabled or not +// enable_xosc0 +#ifndef CONF_XOSC0_CONFIG +#define CONF_XOSC0_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc0_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC0_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc0_arch_enable +#ifndef CONF_XOSC0_ENABLE +#define CONF_XOSC0_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc0_arch_startup +#ifndef CONF_XOSC0_STARTUP +#define CONF_XOSC0_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc0_arch_swben +#ifndef CONF_XOSC0_SWBEN +#define CONF_XOSC0_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc0_arch_cfden +#ifndef CONF_XOSC0_CFDEN +#define CONF_XOSC0_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc0_arch_enalc +#ifndef CONF_XOSC0_ENALC +#define CONF_XOSC0_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc0_arch_lowbufgain +#ifndef CONF_XOSC0_LOWBUFGAIN +#define CONF_XOSC0_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc0_arch_ondemand +#ifndef CONF_XOSC0_ONDEMAND +#define CONF_XOSC0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc0_arch_runstdby +#ifndef CONF_XOSC0_RUNSTDBY +#define CONF_XOSC0_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc0_arch_xtalen +#ifndef CONF_XOSC0_XTALEN +#define CONF_XOSC0_XTALEN 0 +#endif +// +// + +#if CONF_XOSC0_FREQUENCY >= 32000000 +#define CONF_XOSC0_CFDPRESC 0x0 +#define CONF_XOSC0_IMULT 0x7 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 24000000 +#define CONF_XOSC0_CFDPRESC 0x1 +#define CONF_XOSC0_IMULT 0x6 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 16000000 +#define CONF_XOSC0_CFDPRESC 0x2 +#define CONF_XOSC0_IMULT 0x5 +#define CONF_XOSC0_IPTAT 0x3 +#elif CONF_XOSC0_FREQUENCY >= 8000000 +#define CONF_XOSC0_CFDPRESC 0x3 +#define CONF_XOSC0_IMULT 0x4 +#define CONF_XOSC0_IPTAT 0x3 +#endif + +// External Multipurpose Crystal Oscillator Configuration +// Indicates whether configuration for XOSC1 is enabled or not +// enable_xosc1 +#ifndef CONF_XOSC1_CONFIG +#define CONF_XOSC1_CONFIG 0 +#endif + +// Frequency <8000000-48000000> +// Oscillation frequency of the resonator connected to the External Multipurpose Crystal Oscillator. +// xosc1_frequency +#ifndef CONF_XOSC_FREQUENCY +#define CONF_XOSC1_FREQUENCY 12000000 +#endif + +// External Multipurpose Crystal Oscillator Control +// Oscillator enable +// Indicates whether External Multipurpose Crystal Oscillator is enabled or not +// xosc1_arch_enable +#ifndef CONF_XOSC1_ENABLE +#define CONF_XOSC1_ENABLE 0 +#endif + +// Start-Up Time +// <0x0=>31us +// <0x1=>61us +// <0x2=>122us +// <0x3=>244us +// <0x4=>488us +// <0x5=>977us +// <0x6=>1953us +// <0x7=>3906us +// <0x8=>7813us +// <0x9=>15625us +// <0xA=>31250us +// <0xB=>62500us +// <0xC=>125000us +// <0xD=>250000us +// <0xE=>500000us +// <0xF=>1000000us +// xosc1_arch_startup +#ifndef CONF_XOSC1_STARTUP +#define CONF_XOSC1_STARTUP 0 +#endif + +// Clock Switch Back +// Indicates whether Clock Switch Back is enabled or not +// xosc1_arch_swben +#ifndef CONF_XOSC1_SWBEN +#define CONF_XOSC1_SWBEN 0 +#endif + +// Clock Failure Detector +// Indicates whether Clock Failure Detector is enabled or not +// xosc1_arch_cfden +#ifndef CONF_XOSC1_CFDEN +#define CONF_XOSC1_CFDEN 0 +#endif + +// Automatic Loop Control Enable +// Indicates whether Automatic Loop Control is enabled or not +// xosc1_arch_enalc +#ifndef CONF_XOSC1_ENALC +#define CONF_XOSC1_ENALC 0 +#endif + +// Low Buffer Gain Enable +// Indicates whether Low Buffer Gain is enabled or not +// xosc1_arch_lowbufgain +#ifndef CONF_XOSC1_LOWBUFGAIN +#define CONF_XOSC1_LOWBUFGAIN 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// xosc1_arch_ondemand +#ifndef CONF_XOSC1_ONDEMAND +#define CONF_XOSC1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// xosc1_arch_runstdby +#ifndef CONF_XOSC1_RUNSTDBY +#define CONF_XOSC1_RUNSTDBY 0 +#endif + +// Crystal connected to XIN/XOUT Enable +// Indicates whether the connections between the I/O pads and the external clock or crystal oscillator is enabled or not +// xosc1_arch_xtalen +#ifndef CONF_XOSC1_XTALEN +#define CONF_XOSC1_XTALEN 0 +#endif +// +// + +#if CONF_XOSC1_FREQUENCY >= 32000000 +#define CONF_XOSC1_CFDPRESC 0x0 +#define CONF_XOSC1_IMULT 0x7 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 24000000 +#define CONF_XOSC1_CFDPRESC 0x1 +#define CONF_XOSC1_IMULT 0x6 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 16000000 +#define CONF_XOSC1_CFDPRESC 0x2 +#define CONF_XOSC1_IMULT 0x5 +#define CONF_XOSC1_IPTAT 0x3 +#elif CONF_XOSC1_FREQUENCY >= 8000000 +#define CONF_XOSC1_CFDPRESC 0x3 +#define CONF_XOSC1_IMULT 0x4 +#define CONF_XOSC1_IPTAT 0x3 +#endif + +// DFLL Configuration +// Indicates whether configuration for DFLL is enabled or not +// enable_dfll +#ifndef CONF_DFLL_CONFIG +#define CONF_DFLL_CONFIG 0 +#endif + +// Reference Clock Source +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source +// dfll_ref_clock +#ifndef CONF_DFLL_GCLK +#define CONF_DFLL_GCLK GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +// Digital Frequency Locked Loop Control +// DFLL Enable +// Indicates whether DFLL is enabled or not +// dfll_arch_enable +#ifndef CONF_DFLL_ENABLE +#define CONF_DFLL_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// dfll_arch_ondemand +#ifndef CONF_DFLL_ONDEMAND +#define CONF_DFLL_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// dfll_arch_runstdby +#ifndef CONF_DFLL_RUNSTDBY +#define CONF_DFLL_RUNSTDBY 0 +#endif + +// USB Clock Recovery Mode +// Indicates whether USB Clock Recovery Mode is enabled or not +// dfll_arch_usbcrm +#ifndef CONF_DFLL_USBCRM +#define CONF_DFLL_USBCRM 1 +#endif + +// Wait Lock +// Indicates whether Wait Lock is enabled or not +// dfll_arch_waitlock +#ifndef CONF_DFLL_WAITLOCK +#define CONF_DFLL_WAITLOCK 1 +#endif + +// Bypass Coarse Lock +// Indicates whether Bypass Coarse Lock is enabled or not +// dfll_arch_bplckc +#ifndef CONF_DFLL_BPLCKC +#define CONF_DFLL_BPLCKC 0 +#endif + +// Quick Lock Disable +// Indicates whether Quick Lock Disable is enabled or not +// dfll_arch_qldis +#ifndef CONF_DFLL_QLDIS +#define CONF_DFLL_QLDIS 0 +#endif + +// Chill Cycle Disable +// Indicates whether Chill Cycle Disable is enabled or not +// dfll_arch_ccdis +#ifndef CONF_DFLL_CCDIS +#define CONF_DFLL_CCDIS 1 +#endif + +// Lose Lock After Wake +// Indicates whether Lose Lock After Wake is enabled or not +// dfll_arch_llaw +#ifndef CONF_DFLL_LLAW +#define CONF_DFLL_LLAW 0 +#endif + +// Stable DFLL Frequency +// Indicates whether Stable DFLL Frequency is enabled or not +// dfll_arch_stable +#ifndef CONF_DFLL_STABLE +#define CONF_DFLL_STABLE 0 +#endif + +// Operating Mode Selection +// <0=>Open Loop Mode +// <1=>Closed Loop Mode +// dfll_mode +#ifndef CONF_DFLL_MODE +#define CONF_DFLL_MODE 0x0 +#endif + +// Coarse Maximum Step <0x0-0x1F> +// dfll_arch_cstep +#ifndef CONF_DFLL_CSTEP +#define CONF_DFLL_CSTEP 0x1 +#endif + +// Fine Maximum Step <0x0-0xFF> +// dfll_arch_fstep +#ifndef CONF_DFLL_FSTEP +#define CONF_DFLL_FSTEP 0x1 +#endif + +// DFLL Multiply Factor <0x0-0xFFFF> +// dfll_mul +#ifndef CONF_DFLL_MUL +#define CONF_DFLL_MUL 0x0 +#endif + +// DFLL Calibration Overwrite +// Indicates whether Overwrite Calibration value of DFLL +// dfll_arch_calibration +#ifndef CONF_DFLL_OVERWRITE_CALIBRATION +#define CONF_DFLL_OVERWRITE_CALIBRATION 0 +#endif + +// Coarse Value <0x0-0x3F> +// dfll_arch_coarse +#ifndef CONF_DFLL_COARSE +#define CONF_DFLL_COARSE (0x1f / 4) +#endif + +// Fine Value <0x0-0xFF> +// dfll_arch_fine +#ifndef CONF_DFLL_FINE +#define CONF_DFLL_FINE (0x80) +#endif + +// + +// + +// + +// FDPLL0 Configuration +// Indicates whether configuration for FDPLL0 is enabled or not +// enable_fdpll0 +#ifndef CONF_FDPLL0_CONFIG +#define CONF_FDPLL0_CONFIG 1 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll0_ref_clock +#ifndef CONF_FDPLL0_GCLK +#define CONF_FDPLL0_GCLK GCLK_PCHCTRL_GEN_GCLK5_Val +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll0_arch_enable +#ifndef CONF_FDPLL0_ENABLE +#define CONF_FDPLL0_ENABLE 1 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll0_arch_ondemand +#ifndef CONF_FDPLL0_ONDEMAND +#define CONF_FDPLL0_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll0_arch_runstdby +#ifndef CONF_FDPLL0_RUNSTDBY +#define CONF_FDPLL0_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll0_ldrfrac +#ifndef CONF_FDPLL0_LDRFRAC +#define CONF_FDPLL0_LDRFRAC 0x0 +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll0_ldr +#ifndef CONF_FDPLL0_LDR +#define CONF_FDPLL0_LDR 59 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll0_clock_div +#ifndef CONF_FDPLL0_DIV +#define CONF_FDPLL0_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll0_arch_dcoen +#ifndef CONF_FDPLL0_DCOEN +#define CONF_FDPLL0_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll0_clock_dcofilter +#ifndef CONF_FDPLL0_DCOFILTER +#define CONF_FDPLL0_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll0_arch_lbypass +#ifndef CONF_FDPLL0_LBYPASS +#define CONF_FDPLL0_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll0_arch_ltime +#ifndef CONF_FDPLL0_LTIME +#define CONF_FDPLL0_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll0_arch_refclk +#ifndef CONF_FDPLL0_REFCLK +#define CONF_FDPLL0_REFCLK 0x0 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll0_arch_wuf +#ifndef CONF_FDPLL0_WUF +#define CONF_FDPLL0_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll0_arch_filter +#ifndef CONF_FDPLL0_FILTER +#define CONF_FDPLL0_FILTER 0x0 +#endif + +// +// +// FDPLL1 Configuration +// Indicates whether configuration for FDPLL1 is enabled or not +// enable_fdpll1 +#ifndef CONF_FDPLL1_CONFIG +#define CONF_FDPLL1_CONFIG 0 +#endif + +// Reference Clock Source +// 32kHz External Crystal Oscillator (XOSC32K) +// External Crystal Oscillator 8-48MHz (XOSC0) +// External Crystal Oscillator 8-48MHz (XOSC1) +// Generic clock generator 0 +// Generic clock generator 1 +// Generic clock generator 2 +// Generic clock generator 3 +// Generic clock generator 4 +// Generic clock generator 5 +// Generic clock generator 6 +// Generic clock generator 7 +// Generic clock generator 8 +// Generic clock generator 9 +// Generic clock generator 10 +// Generic clock generator 11 +// Select the clock source. +// fdpll1_ref_clock +#ifndef CONF_FDPLL1_GCLK +#define CONF_FDPLL1_GCLK GCLK_GENCTRL_SRC_XOSC32K +#endif + +// Digital Phase Locked Loop Control +// Enable +// Indicates whether Digital Phase Locked Loop is enabled or not +// fdpll1_arch_enable +#ifndef CONF_FDPLL1_ENABLE +#define CONF_FDPLL1_ENABLE 0 +#endif + +// On Demand Control +// Indicates whether On Demand Control is enabled or not +// fdpll1_arch_ondemand +#ifndef CONF_FDPLL1_ONDEMAND +#define CONF_FDPLL1_ONDEMAND 0 +#endif + +// Run in Standby +// Indicates whether Run in Standby is enabled or not +// fdpll1_arch_runstdby +#ifndef CONF_FDPLL1_RUNSTDBY +#define CONF_FDPLL1_RUNSTDBY 0 +#endif + +// Loop Divider Ratio Fractional Part <0x0-0x1F> +// fdpll1_ldrfrac +#ifndef CONF_FDPLL1_LDRFRAC +#define CONF_FDPLL1_LDRFRAC 0xd +#endif + +// Loop Divider Ratio Integer Part <0x0-0x1FFF> +// fdpll1_ldr +#ifndef CONF_FDPLL1_LDR +#define CONF_FDPLL1_LDR 0x5b7 +#endif + +// Clock Divider <0x0-0x7FF> +// fdpll1_clock_div +#ifndef CONF_FDPLL1_DIV +#define CONF_FDPLL1_DIV 0x0 +#endif + +// DCO Filter Enable +// Indicates whether DCO Filter Enable is enabled or not +// fdpll1_arch_dcoen +#ifndef CONF_FDPLL1_DCOEN +#define CONF_FDPLL1_DCOEN 0 +#endif + +// Sigma-Delta DCO Filter Selection <0x0-0x7> +// fdpll1_clock_dcofilter +#ifndef CONF_FDPLL1_DCOFILTER +#define CONF_FDPLL1_DCOFILTER 0x0 +#endif + +// Lock Bypass +// Indicates whether Lock Bypass is enabled or not +// fdpll1_arch_lbypass +#ifndef CONF_FDPLL1_LBYPASS +#define CONF_FDPLL1_LBYPASS 0 +#endif + +// Lock Time +// <0x0=>No time-out, automatic lock +// <0x4=>The Time-out if no lock within 800 us +// <0x5=>The Time-out if no lock within 900 us +// <0x6=>The Time-out if no lock within 1 ms +// <0x7=>The Time-out if no lock within 11 ms +// fdpll1_arch_ltime +#ifndef CONF_FDPLL1_LTIME +#define CONF_FDPLL1_LTIME 0x0 +#endif + +// Reference Clock Selection +// <0x0=>GCLK clock reference +// <0x1=>XOSC32K clock reference +// <0x2=>XOSC0 clock reference +// <0x3=>XOSC1 clock reference +// fdpll1_arch_refclk +#ifndef CONF_FDPLL1_REFCLK +#define CONF_FDPLL1_REFCLK 0x1 +#endif + +// Wake Up Fast +// Indicates whether Wake Up Fast is enabled or not +// fdpll1_arch_wuf +#ifndef CONF_FDPLL1_WUF +#define CONF_FDPLL1_WUF 0 +#endif + +// Proportional Integral Filter Selection <0x0-0xF> +// fdpll1_arch_filter +#ifndef CONF_FDPLL1_FILTER +#define CONF_FDPLL1_FILTER 0x0 +#endif + +// +// + +// <<< end of configuration section >>> + +#endif // HPL_OSCCTRL_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h new file mode 100644 index 0000000000..2b0b6712e6 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_rtc_config.h @@ -0,0 +1,145 @@ +/* Auto-generated config file hpl_rtc_config.h */ +#ifndef HPL_RTC_CONFIG_H +#define HPL_RTC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Basic settings + +#ifndef CONF_RTC_ENABLE +#define CONF_RTC_ENABLE 1 +#endif + +// Force reset RTC on initialization +// Force RTC to reset on initialization. +// Note that the previous power down data in RTC is lost if it's enabled. +// rtc_arch_init_reset +#ifndef CONF_RTC_INIT_RESET +#define CONF_RTC_INIT_RESET 0 +#endif + +// Prescaler configuration +// <0x0=>OFF(Peripheral clock divided by 1) +// <0x1=>Peripheral clock divided by 1 +// <0x2=>Peripheral clock divided by 2 +// <0x3=>Peripheral clock divided by 4 +// <0x4=>Peripheral clock divided by 8 +// <0x5=>Peripheral clock divided by 16 +// <0x6=>Peripheral clock divided by 32 +// <0x7=>Peripheral clock divided by 64 +// <0x8=>Peripheral clock divided by 128 +// <0x9=>Peripheral clock divided by 256 +// <0xA=>Peripheral clock divided by 512 +// <0xB=>Peripheral clock divided by 1024 +// These bits define the RTC clock relative to the peripheral clock +// rtc_arch_prescaler +#ifndef CONF_RTC_PRESCALER +#define CONF_RTC_PRESCALER 0xb + +#endif + +// Compare Value <1-4294967295> +// These bits define the RTC Compare value, the ticks period is equal to reciprocal of (rtc clock/prescaler/compare value), +// by default 1K clock input, 1 prescaler, 1 compare value, the ticks period equals to 1ms. +// rtc_arch_comp_val + +#ifndef CONF_RTC_COMP_VAL +#define CONF_RTC_COMP_VAL 1 + +#endif + +// Event control +// rtc_event_control +#ifndef CONF_RTC_EVENT_CONTROL_ENABLE +#define CONF_RTC_EVENT_CONTROL_ENABLE 0 +#endif + +// Periodic Interval 0 Event Output +// This bit indicates whether Periodic interval 0 event is enabled and will be generated +// rtc_pereo0 +#ifndef CONF_RTC_PEREO0 +#define CONF_RTC_PEREO0 0 +#endif +// Periodic Interval 1 Event Output +// This bit indicates whether Periodic interval 1 event is enabled and will be generated +// rtc_pereo1 +#ifndef CONF_RTC_PEREO1 +#define CONF_RTC_PEREO1 0 +#endif +// Periodic Interval 2 Event Output +// This bit indicates whether Periodic interval 2 event is enabled and will be generated +// rtc_pereo2 +#ifndef CONF_RTC_PEREO2 +#define CONF_RTC_PEREO2 0 +#endif +// Periodic Interval 3 Event Output +// This bit indicates whether Periodic interval 3 event is enabled and will be generated +// rtc_pereo3 +#ifndef CONF_RTC_PEREO3 +#define CONF_RTC_PEREO3 0 +#endif +// Periodic Interval 4 Event Output +// This bit indicates whether Periodic interval 4 event is enabled and will be generated +// rtc_pereo4 +#ifndef CONF_RTC_PEREO4 +#define CONF_RTC_PEREO4 0 +#endif +// Periodic Interval 5 Event Output +// This bit indicates whether Periodic interval 5 event is enabled and will be generated +// rtc_pereo5 +#ifndef CONF_RTC_PEREO5 +#define CONF_RTC_PEREO5 0 +#endif +// Periodic Interval 6 Event Output +// This bit indicates whether Periodic interval 6 event is enabled and will be generated +// rtc_pereo6 +#ifndef CONF_RTC_PEREO6 +#define CONF_RTC_PEREO6 0 +#endif +// Periodic Interval 7 Event Output +// This bit indicates whether Periodic interval 7 event is enabled and will be generated +// rtc_pereo7 +#ifndef CONF_RTC_PEREO7 +#define CONF_RTC_PEREO7 0 +#endif + +// Compare 0 Event Output +// This bit indicates whether Compare O event is enabled and will be generated +// rtc_cmpeo0 +#ifndef CONF_RTC_COMPE0 +#define CONF_RTC_COMPE0 0 +#endif + +// Compare 1 Event Output +// This bit indicates whether Compare 1 event is enabled and will be generated +// rtc_cmpeo1 +#ifndef CONF_RTC_COMPE1 +#define CONF_RTC_COMPE1 0 +#endif +// Overflow Event Output +// This bit indicates whether Overflow event is enabled and will be generated +// rtc_ovfeo +#ifndef CONF_RTC_OVFEO +#define CONF_RTC_OVFEO 0 +#endif + +// Tamper Event Output +// This bit indicates whether Tamper event output is enabled and will be generated +// rtc_tampereo +#ifndef CONF_RTC_TAMPEREO +#define CONF_RTC_TAMPEREO 0 +#endif + +// Tamper Event Input +// This bit indicates whether Tamper event input is enabled and will be generated +// rtc_tampevei +#ifndef CONF_RTC_TAMPEVEI +#define CONF_RTC_TAMPEVEI 0 +#endif +// + +// + +// <<< end of configuration section >>> + +#endif // HPL_RTC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h new file mode 100644 index 0000000000..cd411154c7 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h @@ -0,0 +1,751 @@ +// For CircuitPython, use SERCOM settings as prototypes to set +// the default settings. This file defines these SERCOMs +// +// SERCOM0: SPI with hal_spi_m_sync.c driver: spi master synchronous +// SERCOM1: I2C with hal_i2c_m_sync.c driver: i2c master synchronous +// SERCOM2: USART with hal_usart_async.c driver: usart asynchronous +// SERCOM3: SPI with hal_spi_m_dma.c: spi master DMA + +#define PROTOTYPE_SERCOM_SPI_M_SYNC SERCOM0 +#define PROTOTYPE_SERCOM_SPI_M_SYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM0_CORE_FREQUENCY + +#define PROTOTYPE_SERCOM_I2CM_SYNC SERCOM1 + +#define PROTOTYPE_SERCOM_USART_ASYNC SERCOM2 +#define PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY CONF_GCLK_SERCOM2_CORE_FREQUENCY + +/* Auto-generated config file hpl_sercom_config.h */ +#ifndef HPL_SERCOM_CONFIG_H +#define HPL_SERCOM_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_0_SPI_ENABLE +#define CONF_SERCOM_0_SPI_ENABLE 1 +#endif + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_0_SPI_MODE +#define CONF_SERCOM_0_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_0_SPI_RXEN +#define CONF_SERCOM_0_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_0_SPI_CHSIZE +#define CONF_SERCOM_0_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_0_SPI_BAUD +#define CONF_SERCOM_0_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_0_SPI_ADVANCED +#define CONF_SERCOM_0_SPI_ADVANCED 1 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_0_SPI_DUMMYBYTE +#define CONF_SERCOM_0_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_0_SPI_DORD +#define CONF_SERCOM_0_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_0_SPI_CPOL +#define CONF_SERCOM_0_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_0_SPI_CPHA +#define CONF_SERCOM_0_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_0_SPI_IBON +#define CONF_SERCOM_0_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_0_SPI_RUNSTDBY +#define CONF_SERCOM_0_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_0_SPI_DBGSTOP +#define CONF_SERCOM_0_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_0_SPI_AMODE_EN +#define CONF_SERCOM_0_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_AMODE +#define CONF_SERCOM_0_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDR +#define CONF_SERCOM_0_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_ADDRMASK +#define CONF_SERCOM_0_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_SSDE +#define CONF_SERCOM_0_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_0_SPI_MSSEN +#define CONF_SERCOM_0_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_0_SPI_PLOADEN +#define CONF_SERCOM_0_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_0_SPI_RXPO +#define CONF_SERCOM_0_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_0_SPI_TXPO +#define CONF_SERCOM_0_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_0_SPI_BAUD_RATE +#define CONF_SERCOM_0_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM0_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_0_SPI_BAUD)) - 1 +#endif + +#include + +#ifndef SERCOM_I2CM_CTRLA_MODE_I2C_MASTER +#define SERCOM_I2CM_CTRLA_MODE_I2C_MASTER (5 << 2) +#endif + +#ifndef CONF_SERCOM_1_I2CM_ENABLE +#define CONF_SERCOM_1_I2CM_ENABLE 1 +#endif + +// Basic + +// I2C Bus clock speed (Hz) <1-400000> +// I2C Bus clock (SCL) speed measured in Hz +// i2c_master_baud_rate +#ifndef CONF_SERCOM_1_I2CM_BAUD +#define CONF_SERCOM_1_I2CM_BAUD 100000 +#endif + +// + +// Advanced +// i2c_master_advanced +#ifndef CONF_SERCOM_1_I2CM_ADVANCED_CONFIG +#define CONF_SERCOM_1_I2CM_ADVANCED_CONFIG 1 +#endif + +// TRise (ns) <0-300> +// Determined by the bus impedance, check electric characteristics in the datasheet +// Standard Fast Mode: typical 215ns, max 300ns +// Fast Mode +: typical 60ns, max 100ns +// High Speed Mode: typical 20ns, max 40ns +// i2c_master_arch_trise + +#ifndef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// Master SCL Low Extended Time-Out (MEXTTOEN) +// This enables the master SCL low extend time-out +// i2c_master_arch_mexttoen +#ifndef CONF_SERCOM_1_I2CM_MEXTTOEN +#define CONF_SERCOM_1_I2CM_MEXTTOEN 0 +#endif + +// Slave SCL Low Extend Time-Out (SEXTTOEN) +// Enables the slave SCL low extend time-out. If SCL is cumulatively held low for greater than 25ms from the initial START to a STOP, the slave will release its clock hold if enabled and reset the internal state machine +// i2c_master_arch_sexttoen +#ifndef CONF_SERCOM_1_I2CM_SEXTTOEN +#define CONF_SERCOM_1_I2CM_SEXTTOEN 0 +#endif + +// SCL Low Time-Out (LOWTOUT) +// Enables SCL low time-out. If SCL is held low for 25ms-35ms, the master will release it's clock hold +// i2c_master_arch_lowtout +#ifndef CONF_SERCOM_1_I2CM_LOWTOUT +#define CONF_SERCOM_1_I2CM_LOWTOUT 0 +#endif + +// Inactive Time-Out (INACTOUT) +// <0x0=>Disabled +// <0x1=>5-6 SCL cycle time-out(50-60us) +// <0x2=>10-11 SCL cycle time-out(100-110us) +// <0x3=>20-21 SCL cycle time-out(200-210us) +// Defines if inactivity time-out should be enabled, and how long the time-out should be +// i2c_master_arch_inactout +#ifndef CONF_SERCOM_1_I2CM_INACTOUT +#define CONF_SERCOM_1_I2CM_INACTOUT 0x0 +#endif + +// SDA Hold Time (SDAHOLD) +// <0=>Disabled +// <1=>50-100ns hold time +// <2=>300-600ns hold time +// <3=>400-800ns hold time +// Defines the SDA hold time with respect to the negative edge of SCL +// i2c_master_arch_sdahold +#ifndef CONF_SERCOM_1_I2CM_SDAHOLD +#define CONF_SERCOM_1_I2CM_SDAHOLD 0x2 +#endif + +// Run in stand-by +// Determine if the module shall run in standby sleep mode +// i2c_master_arch_runstdby +#ifndef CONF_SERCOM_1_I2CM_RUNSTDBY +#define CONF_SERCOM_1_I2CM_RUNSTDBY 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// i2c_master_arch_dbgstop +#ifndef CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE +#define CONF_SERCOM_1_I2CM_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_1_I2CM_SPEED +#define CONF_SERCOM_1_I2CM_SPEED 0x00 // Speed: Standard/Fast mode +#endif +#if CONF_SERCOM_1_I2CM_TRISE < 215 || CONF_SERCOM_1_I2CM_TRISE > 300 +#warning Bad I2C Rise time for Standard/Fast mode, reset to 215ns +#undef CONF_SERCOM_1_I2CM_TRISE +#define CONF_SERCOM_1_I2CM_TRISE 215 +#endif + +// gclk_freq - (i2c_scl_freq * 10) - (gclk_freq * i2c_scl_freq * Trise) +// BAUD + BAUDLOW = -------------------------------------------------------------------- +// i2c_scl_freq +// BAUD: register value low [7:0] +// BAUDLOW: register value high [15:8], only used for odd BAUD + BAUDLOW +#define CONF_SERCOM_1_I2CM_BAUD_BAUDLOW \ + (((CONF_GCLK_SERCOM1_CORE_FREQUENCY - (CONF_SERCOM_1_I2CM_BAUD * 10) \ + - (CONF_SERCOM_1_I2CM_TRISE * (CONF_SERCOM_1_I2CM_BAUD / 100) * (CONF_GCLK_SERCOM1_CORE_FREQUENCY / 10000) \ + / 1000)) \ + * 10 \ + + 5) \ + / (CONF_SERCOM_1_I2CM_BAUD * 10)) +#ifndef CONF_SERCOM_1_I2CM_BAUD_RATE +#if CONF_SERCOM_1_I2CM_BAUD_BAUDLOW > (0xFF * 2) +#warning Requested I2C baudrate too low, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 0xFF +#elif CONF_SERCOM_1_I2CM_BAUD_BAUDLOW <= 1 +#warning Requested I2C baudrate too high, please check +#define CONF_SERCOM_1_I2CM_BAUD_RATE 1 +#else +#define CONF_SERCOM_1_I2CM_BAUD_RATE \ + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW & 0x1) \ + ? (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2) + ((CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2 + 1) << 8) \ + : (CONF_SERCOM_1_I2CM_BAUD_BAUDLOW / 2)) +#endif +#endif + +#include + +#ifndef CONF_SERCOM_2_USART_ENABLE +#define CONF_SERCOM_2_USART_ENABLE 1 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable input buffer in SERCOM module +// usart_rx_enable +#ifndef CONF_SERCOM_2_USART_RXEN +#define CONF_SERCOM_2_USART_RXEN 1 +#endif + +// Transmitt buffer enable +// Enable output buffer in SERCOM module +// usart_tx_enable +#ifndef CONF_SERCOM_2_USART_TXEN +#define CONF_SERCOM_2_USART_TXEN 1 +#endif + +// Frame parity +// <0x0=>No parity +// <0x1=>Even parity +// <0x2=>Odd parity +// Parity bit mode for USART frame +// usart_parity +#ifndef CONF_SERCOM_2_USART_PARITY +#define CONF_SERCOM_2_USART_PARITY 0x0 +#endif + +// Character Size +// <0x0=>8 bits +// <0x1=>9 bits +// <0x5=>5 bits +// <0x6=>6 bits +// <0x7=>7 bits +// Data character size in USART frame +// usart_character_size +#ifndef CONF_SERCOM_2_USART_CHSIZE +#define CONF_SERCOM_2_USART_CHSIZE 0x0 +#endif + +// Stop Bit +// <0=>One stop bit +// <1=>Two stop bits +// Number of stop bits in USART frame +// usart_stop_bit +#ifndef CONF_SERCOM_2_USART_SBMODE +#define CONF_SERCOM_2_USART_SBMODE 0 +#endif + +// Baud rate <1-3000000> +// USART baud rate setting +// usart_baud_rate +#ifndef CONF_SERCOM_2_USART_BAUD +#define CONF_SERCOM_2_USART_BAUD 9600 +#endif + +// + +// Advanced configuration +// usart_advanced +#ifndef CONF_SERCOM_2_USART_ADVANCED_CONFIG +#define CONF_SERCOM_2_USART_ADVANCED_CONFIG 1 +#endif + +// Run in stand-by +// Keep the module running in standby sleep mode +// usart_arch_runstdby +#ifndef CONF_SERCOM_2_USART_RUNSTDBY +#define CONF_SERCOM_2_USART_RUNSTDBY 0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when the BUFOVF status bit is asserted +// usart_arch_ibon +#ifndef CONF_SERCOM_2_USART_IBON +#define CONF_SERCOM_2_USART_IBON 0 +#endif + +// Start of Frame Detection Enable +// Will wake the device from any sleep mode if usart_init and usart_enable was run priort to going to sleep. (receive buffer must be enabled) +// usart_arch_sfde +#ifndef CONF_SERCOM_2_USART_SFDE +#define CONF_SERCOM_2_USART_SFDE 0 +#endif + +// Collision Detection Enable +// Collision detection enable +// usart_arch_cloden +#ifndef CONF_SERCOM_2_USART_CLODEN +#define CONF_SERCOM_2_USART_CLODEN 0 +#endif + +// Operating Mode +// <0x0=>USART with external clock +// <0x1=>USART with internal clock +// Drive the shift register by an internal clock generated by the baud rate generator or an external clock supplied on the XCK pin. +// usart_arch_clock_mode +#ifndef CONF_SERCOM_2_USART_MODE +#define CONF_SERCOM_2_USART_MODE 0x1 +#endif + +// Sample Rate +// <0x0=>16x arithmetic +// <0x1=>16x fractional +// <0x2=>8x arithmetic +// <0x3=>8x fractional +// <0x3=>3x +// How many over-sampling bits used when samling data state +// usart_arch_sampr +#ifndef CONF_SERCOM_2_USART_SAMPR +#define CONF_SERCOM_2_USART_SAMPR 0x0 +#endif + +// Sample Adjustment +// <0x0=>7-8-9 (3-4-5 8-bit over-sampling) +// <0x1=>9-10-11 (4-5-6 8-bit over-sampling) +// <0x2=>11-12-13 (5-6-7 8-bit over-sampling) +// <0x3=>13-14-15 (6-7-8 8-bit over-sampling) +// Adjust which samples to use for data sampling in asynchronous mode +// usart_arch_sampa +#ifndef CONF_SERCOM_2_USART_SAMPA +#define CONF_SERCOM_2_USART_SAMPA 0x0 +#endif + +// Fractional Part <0-7> +// Fractional part of the baud rate if baud rate generator is in fractional mode +// usart_arch_fractional +#ifndef CONF_SERCOM_2_USART_FRACTIONAL +#define CONF_SERCOM_2_USART_FRACTIONAL 0x0 +#endif + +// Data Order +// <0=>MSB is transmitted first +// <1=>LSB is transmitted first +// Data order of the data bits in the frame +// usart_arch_dord +#ifndef CONF_SERCOM_2_USART_DORD +#define CONF_SERCOM_2_USART_DORD 1 +#endif + +// Does not do anything in UART mode +#define CONF_SERCOM_2_USART_CPOL 0 + +// Encoding Format +// <0=>No encoding +// <1=>IrDA encoded +// usart_arch_enc +#ifndef CONF_SERCOM_2_USART_ENC +#define CONF_SERCOM_2_USART_ENC 0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. +// <0=>Keep running +// <1=>Halt +// usart_arch_dbgstop +#ifndef CONF_SERCOM_2_USART_DEBUG_STOP_MODE +#define CONF_SERCOM_2_USART_DEBUG_STOP_MODE 0 +#endif + +// + +#ifndef CONF_SERCOM_2_USART_INACK +#define CONF_SERCOM_2_USART_INACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_DSNACK +#define CONF_SERCOM_2_USART_DSNACK 0x0 +#endif + +#ifndef CONF_SERCOM_2_USART_MAXITER +#define CONF_SERCOM_2_USART_MAXITER 0x7 +#endif + +#ifndef CONF_SERCOM_2_USART_GTIME +#define CONF_SERCOM_2_USART_GTIME 0x2 +#endif + +#define CONF_SERCOM_2_USART_RXINV 0x0 +#define CONF_SERCOM_2_USART_TXINV 0x0 + +#ifndef CONF_SERCOM_2_USART_CMODE +#define CONF_SERCOM_2_USART_CMODE 0 +#endif + +#ifndef CONF_SERCOM_2_USART_RXPO +#define CONF_SERCOM_2_USART_RXPO 1 /* RX is on PIN_PA08 */ +#endif + +#ifndef CONF_SERCOM_2_USART_TXPO +#define CONF_SERCOM_2_USART_TXPO 0 /* TX is on PIN_PA09 */ +#endif + +/* Set correct parity settings in register interface based on PARITY setting */ +#if CONF_SERCOM_2_USART_PARITY == 0 +#define CONF_SERCOM_2_USART_PMODE 0 +#define CONF_SERCOM_2_USART_FORM 0 +#else +#define CONF_SERCOM_2_USART_PMODE CONF_SERCOM_2_USART_PARITY - 1 +#define CONF_SERCOM_2_USART_FORM 1 +#endif + +// Calculate BAUD register value in UART mode +#if CONF_SERCOM_2_USART_SAMPR == 0 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 16.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 1 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 16)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 2 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 8.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 3 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + ((CONF_GCLK_SERCOM2_CORE_FREQUENCY) / (CONF_SERCOM_2_USART_BAUD * 8)) - (CONF_SERCOM_2_USART_FRACTIONAL / 8) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#elif CONF_SERCOM_2_USART_SAMPR == 4 +#ifndef CONF_SERCOM_2_USART_BAUD_RATE +#define CONF_SERCOM_2_USART_BAUD_RATE \ + 65536 - ((65536 * 3.0f * CONF_SERCOM_2_USART_BAUD) / CONF_GCLK_SERCOM2_CORE_FREQUENCY) +#endif +#ifndef CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH +#define CONF_SERCOM_2_USART_RECEIVE_PULSE_LENGTH 0 +#endif +#endif + +#include + +// Enable configuration of module +#ifndef CONF_SERCOM_3_SPI_ENABLE +#define CONF_SERCOM_3_SPI_ENABLE 1 +#endif + +// SPI DMA TX Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_tx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_TX_CHANNEL 0 +#endif + +// SPI RX Channel Enable +// spi_master_rx_channel +#ifndef CONF_SERCOM_3_SPI_RX_CHANNEL +#define CONF_SERCOM_3_SPI_RX_CHANNEL 1 +#endif + +// DMA Channel <0-32> +// This defines DMA channel to be used +// spi_master_dma_rx_channel +#ifndef CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL +#define CONF_SERCOM_3_SPI_M_DMA_RX_CHANNEL 1 +#endif + +// + +// Set module in SPI Master mode +#ifndef CONF_SERCOM_3_SPI_MODE +#define CONF_SERCOM_3_SPI_MODE 0x03 +#endif + +// Basic Configuration + +// Receive buffer enable +// Enable receive buffer to receive data from slave (RXEN) +// spi_master_rx_enable +#ifndef CONF_SERCOM_3_SPI_RXEN +#define CONF_SERCOM_3_SPI_RXEN 0x1 +#endif + +// Character Size +// Bit size for all characters sent over the SPI bus (CHSIZE) +// <0x0=>8 bits +// <0x1=>9 bits +// spi_master_character_size +#ifndef CONF_SERCOM_3_SPI_CHSIZE +#define CONF_SERCOM_3_SPI_CHSIZE 0x0 +#endif + +// Baud rate <1-12000000> +// The SPI data transfer rate +// spi_master_baud_rate +#ifndef CONF_SERCOM_3_SPI_BAUD +#define CONF_SERCOM_3_SPI_BAUD 50000 +#endif + +// + +// Advanced Configuration +// spi_master_advanced +#ifndef CONF_SERCOM_3_SPI_ADVANCED +#define CONF_SERCOM_3_SPI_ADVANCED 0 +#endif + +// Dummy byte <0x00-0x1ff> +// spi_master_dummybyte +// Dummy byte used when reading data from the slave without sending any data +#ifndef CONF_SERCOM_3_SPI_DUMMYBYTE +#define CONF_SERCOM_3_SPI_DUMMYBYTE 0x1ff +#endif + +// Data Order +// <0=>MSB first +// <1=>LSB first +// I least significant or most significant bit is shifted out first (DORD) +// spi_master_arch_dord +#ifndef CONF_SERCOM_3_SPI_DORD +#define CONF_SERCOM_3_SPI_DORD 0x0 +#endif + +// Clock Polarity +// <0=>SCK is low when idle +// <1=>SCK is high when idle +// Determines if the leading edge is rising or falling with a corresponding opposite edge at the trailing edge. (CPOL) +// spi_master_arch_cpol +#ifndef CONF_SERCOM_3_SPI_CPOL +#define CONF_SERCOM_3_SPI_CPOL 0x0 +#endif + +// Clock Phase +// <0x0=>Sample input on leading edge +// <0x1=>Sample input on trailing edge +// Determines if input data is sampled on leading or trailing SCK edge. (CPHA) +// spi_master_arch_cpha +#ifndef CONF_SERCOM_3_SPI_CPHA +#define CONF_SERCOM_3_SPI_CPHA 0x0 +#endif + +// Immediate Buffer Overflow Notification +// Controls when OVF is asserted (IBON) +// <0x0=>In data stream +// <0x1=>On buffer overflow +// spi_master_arch_ibon +#ifndef CONF_SERCOM_3_SPI_IBON +#define CONF_SERCOM_3_SPI_IBON 0x0 +#endif + +// Run in stand-by +// Module stays active in stand-by sleep mode. (RUNSTDBY) +// spi_master_arch_runstdby +#ifndef CONF_SERCOM_3_SPI_RUNSTDBY +#define CONF_SERCOM_3_SPI_RUNSTDBY 0x0 +#endif + +// Debug Stop Mode +// Behavior of the baud-rate generator when CPU is halted by external debugger. (DBGSTOP) +// <0=>Keep running +// <1=>Halt +// spi_master_arch_dbgstop +#ifndef CONF_SERCOM_3_SPI_DBGSTOP +#define CONF_SERCOM_3_SPI_DBGSTOP 0 +#endif + +// + +// Address mode disabled in master mode +#ifndef CONF_SERCOM_3_SPI_AMODE_EN +#define CONF_SERCOM_3_SPI_AMODE_EN 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_AMODE +#define CONF_SERCOM_3_SPI_AMODE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDR +#define CONF_SERCOM_3_SPI_ADDR 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_ADDRMASK +#define CONF_SERCOM_3_SPI_ADDRMASK 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_SSDE +#define CONF_SERCOM_3_SPI_SSDE 0 +#endif + +#ifndef CONF_SERCOM_3_SPI_MSSEN +#define CONF_SERCOM_3_SPI_MSSEN 0x0 +#endif + +#ifndef CONF_SERCOM_3_SPI_PLOADEN +#define CONF_SERCOM_3_SPI_PLOADEN 0 +#endif + +// Receive Data Pinout +// <0x0=>PAD[0] +// <0x1=>PAD[1] +// <0x2=>PAD[2] +// <0x3=>PAD[3] +// spi_master_rxpo +#ifndef CONF_SERCOM_3_SPI_RXPO +#define CONF_SERCOM_3_SPI_RXPO 2 +#endif + +// Transmit Data Pinout +// <0x0=>PAD[0,1]_DO_SCK +// <0x1=>PAD[2,3]_DO_SCK +// <0x2=>PAD[3,1]_DO_SCK +// <0x3=>PAD[0,3]_DO_SCK +// spi_master_txpo +#ifndef CONF_SERCOM_3_SPI_TXPO +#define CONF_SERCOM_3_SPI_TXPO 0 +#endif + +// Calculate baud register value from requested baudrate value +#ifndef CONF_SERCOM_3_SPI_BAUD_RATE +#define CONF_SERCOM_3_SPI_BAUD_RATE ((float)CONF_GCLK_SERCOM3_CORE_FREQUENCY / (float)(2 * CONF_SERCOM_3_SPI_BAUD)) - 1 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SERCOM_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h new file mode 100644 index 0000000000..a7f2f36208 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_systick_config.h @@ -0,0 +1,18 @@ +/* Auto-generated config file hpl_systick_config.h */ +#ifndef HPL_SYSTICK_CONFIG_H +#define HPL_SYSTICK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced settings +// SysTick exception request +// Indicates whether the generation of SysTick exception is enabled or not +// systick_arch_tickint +#ifndef CONF_SYSTICK_TICKINT +#define CONF_SYSTICK_TICKINT 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_SYSTICK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h new file mode 100644 index 0000000000..38d48e9b67 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h @@ -0,0 +1,209 @@ +/* Auto-generated config file hpl_tc_config.h */ +#ifndef HPL_TC_CONFIG_H +#define HPL_TC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include + +#ifndef CONF_TC0_ENABLE +#define CONF_TC0_ENABLE 1 +#endif + +// Basic settings +// Prescaler +// <0=> No division +// <1=> Divide by 2 +// <2=> Divide by 4 +// <3=> Divide by 8 +// <4=> Divide by 16 +// <5=> Divide by 64 +// <6=> Divide by 256 +// <7=> Divide by 1024 +// This defines the prescaler value +// tc_prescaler +#ifndef CONF_TC0_PRESCALER +#define CONF_TC0_PRESCALER 0 +#endif +// + +// PWM Waveform Output settings +// Waveform Period Value (uS) <0x00-0xFFFFFFFF> +// The unit of this value is us. +// tc_arch_wave_per_val +#ifndef CONF_TC0_WAVE_PER_VAL +#define CONF_TC0_WAVE_PER_VAL 0x3e8 +#endif + +// Waveform Duty Value (0.1%) <0x00-0x03E8> +// The unit of this value is 1/1000. +// tc_arch_wave_duty_val +#ifndef CONF_TC0_WAVE_DUTY_VAL +#define CONF_TC0_WAVE_DUTY_VAL 0x1f4 +#endif + +/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +#if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 \ + ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV64_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 64000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV256_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 256000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) + +#elif CONF_TC0_PRESCALER == TC_CTRLA_PRESCALER_DIV1024_Val +#define CONF_TC0_CC0 ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1024000000 - 1)) +#define CONF_TC0_CC1 ((CONF_TC0_CC0 * CONF_TC0_WAVE_DUTY_VAL) / 1000) +#endif + +// + +// Advanced settings +// Mode +// Counter in 16-bit mode +// Counter in 32-bit mode +// These bits mode +// tc_mode +#ifndef CONF_TC0_MODE +#define CONF_TC0_MODE TC_CTRLA_MODE_COUNT16_Val +#endif + +// Period Value <0x00000000-0xFFFFFFFF> +// tc_per +#ifndef CONF_TC0_PER +#define CONF_TC0_PER 0x32 +#endif +// + +// Advanced settings +// Prescaler and Counter Synchronization Selection +// Reload or reset counter on next GCLK +// Reload or reset counter on next prescaler clock +// Reload or reset counter on next GCLK and reset prescaler counter +// These bits select if on retrigger event, the Counter should be cleared or reloaded on the next GCLK_TCx clock or on the next prescaled GCLK_TCx clock. +// tc_arch_presync +#ifndef CONF_TC0_PRESCSYNC +#define CONF_TC0_PRESCSYNC TC_CTRLA_PRESCSYNC_GCLK_Val +#endif + +// Run in standby +// Indicates whether the will continue running in standby sleep mode or not +// tc_arch_runstdby +#ifndef CONF_TC0_RUNSTDBY +#define CONF_TC0_RUNSTDBY 0 +#endif + +// On-Demand +// Indicates whether the TC0's on-demand mode is on or not +// tc_arch_ondemand +#ifndef CONF_TC0_ONDEMAND +#define CONF_TC0_ONDEMAND 0 +#endif + +// Auto Lock +// <0x0=>The Lock Update bit is not affected on overflow/underflow and re-trigger event +// <0x1=>The Lock Update bit is set on each overflow/underflow or re-trigger event +// tc_arch_alock +#ifndef CONF_TC0_ALOCK +#define CONF_TC0_ALOCK 0 +#endif + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CAPTEN0 0 +//#define CONF_TC0_CAPTEN1 0 +//#define CONF_TC0_COPEN0 0 +//#define CONF_TC0_COPEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_DIR 0 +//#define CONF_TC0_ONESHOT 0 +//#define CONF_TC0_LUPD 0 + +// Debug Running Mode +// Indicates whether the Debug Running Mode is enabled or not +// tc_arch_dbgrun +#ifndef CONF_TC0_DBGRUN +#define CONF_TC0_DBGRUN 0 +#endif + +// Event control +// timer_event_control +#ifndef CONF_TC0_EVENT_CONTROL_ENABLE +#define CONF_TC0_EVENT_CONTROL_ENABLE 0 +#endif + +// Output Event On Match or Capture on Channel 0 +// Enable output of event on timer tick +// tc_arch_mceo0 +#ifndef CONF_TC0_MCEO0 +#define CONF_TC0_MCEO0 0 +#endif + +// Output Event On Match or Capture on Channel 1 +// Enable output of event on timer tick +// tc_arch_mceo1 +#ifndef CONF_TC0_MCEO1 +#define CONF_TC0_MCEO1 0 +#endif + +// Output Event On Timer Tick +// Enable output of event on timer tick +// tc_arch_ovfeo +#ifndef CONF_TC0_OVFEO +#define CONF_TC0_OVFEO 0 +#endif + +// Event Input +// Enable asynchronous input events +// tc_arch_tcei +#ifndef CONF_TC0_TCEI +#define CONF_TC0_TCEI 0 +#endif + +// Inverted Event Input +// Invert the asynchronous input events +// tc_arch_tcinv +#ifndef CONF_TC0_TCINV +#define CONF_TC0_TCINV 0 +#endif + +// Event action +// <0=> Event action disabled +// <1=> Start, restart or re-trigger TC on event +// <2=> Count on event +// <3=> Start on event +// <4=> Time stamp capture +// <5=> Period captured in CC0, pulse width in CC1 +// <6=> Period captured in CC1, pulse width in CC0 +// <7=> Pulse width capture +// Event which will be performed on an event +// tc_arch_evact +#ifndef CONF_TC0_EVACT +#define CONF_TC0_EVACT 0 +#endif +// + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_WAVEGEN TC_CTRLA_WAVEGEN_MFRQ_Val + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_INVEN0 0 +//#define CONF_TC0_INVEN1 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_PERBUF 0 + +/* Commented intentionally. Timer uses fixed value. May be used by other abstractions based on TC. */ +//#define CONF_TC0_CCBUF0 0 +//#define CONF_TC0_CCBUF1 0 + +// + +// <<< end of configuration section >>> + +#endif // HPL_TC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h new file mode 100644 index 0000000000..ba9014989a --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_trng_config.h @@ -0,0 +1,27 @@ +/* Auto-generated config file hpl_trng_config.h */ +#ifndef HPL_TRNG_CONFIG_H +#define HPL_TRNG_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Advanced configurations + +// Run In Standby +// Indicates whether the TRNG works in standby mode +// trng_runstdby +#ifndef CONF_TRNG_RUNSTDBY +#define CONF_TRNG_RUNSTDBY 0 +#endif + +// Data Ready Event Output Enable +// Indicates whether the TRNG generates event on Data Ready +// trng_datardyeo +#ifndef CONF_TRNG_DATARDYEO +#define CONF_TRNG_DATARDYEO 0 +#endif + +// + +// <<< end of configuration section >>> + +#endif // HPL_TRNG_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h new file mode 100644 index 0000000000..d1bb42fe45 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_usb_config.h @@ -0,0 +1,413 @@ +/* Auto-generated config file hpl_usb_config.h */ +#ifndef HPL_USB_CONFIG_H +#define HPL_USB_CONFIG_H + +// CIRCUITPY: + +// Use 64-byte USB buffers for endpoint directions that are in use. They're set to 0 below otherwise. + +#include "genhdr/autogen_usb_descriptor.h" + +#if defined(USB_ENDPOINT_1_OUT_USED) && USB_ENDPOINT_1_OUT_USED +#define CONF_USB_EP1_CACHE 64 +#endif +#if defined(USB_ENDPOINT_1_IN_USED) && USB_ENDPOINT_1_IN_USED +#define CONF_USB_EP1_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_2_OUT_USED) && USB_ENDPOINT_2_OUT_USED +#define CONF_USB_EP2_CACHE 64 +#endif +#if defined(USB_ENDPOINT_2_IN_USED) && USB_ENDPOINT_2_IN_USED +#define CONF_USB_EP2_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_3_OUT_USED) && USB_ENDPOINT_3_OUT_USED +#define CONF_USB_EP3_CACHE 64 +#endif +#if defined(USB_ENDPOINT_3_IN_USED) && USB_ENDPOINT_3_IN_USED +#define CONF_USB_EP3_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_4_OUT_USED) && USB_ENDPOINT_4_OUT_USED +#define CONF_USB_EP4_CACHE 64 +#endif +#if defined(USB_ENDPOINT_4_IN_USED) && USB_ENDPOINT_4_IN_USED +#define CONF_USB_EP4_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_5_OUT_USED) && USB_ENDPOINT_5_OUT_USED +#define CONF_USB_EP5_CACHE 64 +#endif +#if defined(USB_ENDPOINT_5_IN_USED) && USB_ENDPOINT_5_IN_USED +#define CONF_USB_EP5_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_6_OUT_USED) && USB_ENDPOINT_6_OUT_USED +#define CONF_USB_EP6_CACHE 64 +#endif +#if defined(USB_ENDPOINT_6_IN_USED) && USB_ENDPOINT_6_IN_USED +#define CONF_USB_EP6_I_CACHE 64 +#endif + +#if defined(USB_ENDPOINT_7_OUT_USED) && USB_ENDPOINT_7_OUT_USED +#define CONF_USB_EP7_CACHE 64 +#endif +#if defined(USB_ENDPOINT_7_IN_USED) && USB_ENDPOINT_7_IN_USED +#define CONF_USB_EP7_I_CACHE 64 +#endif + + +// <<< Use Configuration Wizard in Context Menu >>> + +#define CONF_USB_N_0 0 +#define CONF_USB_N_1 1 +#define CONF_USB_N_2 2 +#define CONF_USB_N_3 3 +#define CONF_USB_N_4 4 +#define CONF_USB_N_5 5 +#define CONF_USB_N_6 6 +#define CONF_USB_N_7 7 +#define CONF_USB_N_8 8 +#define CONF_USB_N_9 9 +#define CONF_USB_N_10 10 +#define CONF_USB_N_11 11 +#define CONF_USB_N_12 12 +#define CONF_USB_N_13 13 +#define CONF_USB_N_14 14 +#define CONF_USB_N_15 15 + +#define CONF_USB_D_EP_N_MAX (USB_EPT_NUM - 1) +#define CONF_USB_D_N_EP_MAX (CONF_USB_D_EP_N_MAX * 2 - 1) + +// USB Device HAL Configuration + +// Max number of endpoints supported +// Limits the number of endpoints (described by EP address) can be used in app. +// NOTE(tannewt): This not only limits the number of endpoints but also the +// addresses. In other words, even if you use endpoint 6 you need to set this to 11. +// 1 (EP0 only) +// 2 (EP0 + 1 endpoint) +// 3 (EP0 + 2 endpoints) +// 4 (EP0 + 3 endpoints) +// 5 (EP0 + 4 endpoints) +// 6 (EP0 + 5 endpoints) +// 7 (EP0 + 6 endpoints) +// 8 (EP0 + 7 endpoints) +// Max possible (by "Max Endpoint Number" config) +// usbd_num_ep_sp +#ifndef CONF_USB_D_NUM_EP_SP +#define CONF_USB_D_NUM_EP_SP CONF_USB_D_N_EP_MAX +#endif + +// + +// Max Endpoint Number supported +// Limits the max endpoint number. +// USB endpoint address is constructed by direction and endpoint number. Bit 8 of address set indicates the direction is IN. E.g., EP0x81 and EP0x01 have the same endpoint number, 1. +// Reduce the value according to specific device design, to cut-off memory usage. +// 0 (only EP0) +// 1 (EP 0x81 or 0x01) +// 2 (EP 0x82 or 0x02) +// 3 (EP 0x83 or 0x03) +// 4 (EP 0x84 or 0x04) +// 5 (EP 0x85 or 0x05) +// 6 (EP 0x86 or 0x06) +// 7 (EP 0x87 or 0x07) +// Max possible (by HW) +// The number of physical endpoints - 1 +// usbd_arch_max_ep_n +#ifndef CONF_USB_D_MAX_EP_N +#define CONF_USB_D_MAX_EP_N CONF_USB_D_EP_N_MAX +#endif + +// USB Speed Limit +// Limits the working speed of the device. +// Full speed +// Low Speed +// usbd_arch_speed +#ifndef CONF_USB_D_SPEED +#define CONF_USB_D_SPEED USB_SPEED_FS +#endif + +// Cache buffer size for EP0 +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// EP0 is default control endpoint, so cache must be used to be able to receive SETUP packet at any time. +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// usb_arch_ep0_cache +#ifndef CONF_USB_EP0_CACHE +#define CONF_USB_EP0_CACHE 64 +#endif + +// Cache configuration EP1 +// Cache buffer size for EP1 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep1_cache +#ifndef CONF_USB_EP1_CACHE +#define CONF_USB_EP1_CACHE 0 +#endif + +// Cache buffer size for EP1 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep1_I_CACHE +#ifndef CONF_USB_EP1_I_CACHE +#define CONF_USB_EP1_I_CACHE 0 +#endif +// + +// Cache configuration EP2 +// Cache buffer size for EP2 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep2_cache +#ifndef CONF_USB_EP2_CACHE +#define CONF_USB_EP2_CACHE 0 +#endif + +// Cache buffer size for EP2 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep2_I_CACHE +#ifndef CONF_USB_EP2_I_CACHE +#define CONF_USB_EP2_I_CACHE 0 +#endif +// + +// Cache configuration EP3 +// Cache buffer size for EP3 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep3_cache +#ifndef CONF_USB_EP3_CACHE +#define CONF_USB_EP3_CACHE 0 +#endif + +// Cache buffer size for EP3 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep3_I_CACHE +#ifndef CONF_USB_EP3_I_CACHE +#define CONF_USB_EP3_I_CACHE 0 +#endif +// + +// Cache configuration EP4 +// Cache buffer size for EP4 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep4_cache +#ifndef CONF_USB_EP4_CACHE +#define CONF_USB_EP4_CACHE 0 +#endif + +// Cache buffer size for EP4 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep4_I_CACHE +#ifndef CONF_USB_EP4_I_CACHE +#define CONF_USB_EP4_I_CACHE 0 +#endif +// + +// Cache configuration EP5 +// Cache buffer size for EP5 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep5_cache +#ifndef CONF_USB_EP5_CACHE +#define CONF_USB_EP5_CACHE 0 +#endif + +// Cache buffer size for EP5 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep5_I_CACHE +#ifndef CONF_USB_EP5_I_CACHE +#define CONF_USB_EP5_I_CACHE 0 +#endif +// + +// Cache configuration EP6 +// Cache buffer size for EP6 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep6_cache +#ifndef CONF_USB_EP6_CACHE +#define CONF_USB_EP6_CACHE 0 +#endif + +// Cache buffer size for EP6 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep6_I_CACHE +#ifndef CONF_USB_EP6_I_CACHE +#define CONF_USB_EP6_I_CACHE 0 +#endif +// + +// Cache configuration EP7 +// Cache buffer size for EP7 OUT +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_arch_ep7_cache +#ifndef CONF_USB_EP7_CACHE +#define CONF_USB_EP7_CACHE 0 +#endif + +// Cache buffer size for EP7 IN +// Cache is used because the USB hardware always uses DMA which requires specific memory feature. +// This cache must not be allocated if you plan to use the endpoint as control endpoint. +// No cache means IN transaction not support data buffer outside of RAM, OUT transaction not support unaligned buffer and buffer size less than endpoint max packet size +// <0=> No cache +// <8=> Cached by 8 bytes buffer +// <16=> Cached by 16 bytes buffer +// <32=> Cached by 32 bytes buffer +// <64=> Cached by 64 bytes buffer +// <128=> Cached by 128 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <256=> Cached by 256 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <512=> Cached by 512 bytes buffer (HS Bulk or interrupt or isochronous EP) +// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP) +// usb_ep7_I_CACHE +#ifndef CONF_USB_EP7_I_CACHE +#define CONF_USB_EP7_I_CACHE 0 +#endif +// + +// <<< end of configuration section >>> + +#endif // HPL_USB_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h new file mode 100644 index 0000000000..030a90a7a9 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h @@ -0,0 +1,1006 @@ +/* Auto-generated config file peripheral_clk_config.h */ +#ifndef PERIPHERAL_CLK_CONFIG_H +#define PERIPHERAL_CLK_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ADC Clock Source +// adc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for ADC. +#ifndef CONF_GCLK_ADC0_SRC +#define CONF_GCLK_ADC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_ADC0_FREQUENCY + * \brief ADC0's Clock frequency + */ +#ifndef CONF_GCLK_ADC0_FREQUENCY +#define CONF_GCLK_ADC0_FREQUENCY 48000000 +#endif + +// DAC Clock Source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// dac_gclk_selection +// Select the clock source for DAC. +#ifndef CONF_GCLK_DAC_SRC +#define CONF_GCLK_DAC_SRC GCLK_PCHCTRL_GEN_GCLK6_Val +#endif + +/** + * \def CONF_GCLK_DAC_FREQUENCY + * \brief DAC's Clock frequency + */ +#ifndef CONF_GCLK_DAC_FREQUENCY +#define CONF_GCLK_DAC_FREQUENCY 2000000 +#endif + +// EVSYS Channel 0 Clock Source +// evsys_clk_selection_0 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 0. +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_SRC +#define CONF_GCLK_EVSYS_CHANNEL_0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_0_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 1 Clock Source +// evsys_clk_selection_1 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 1. +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_SRC +#define CONF_GCLK_EVSYS_CHANNEL_1_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_1_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 2 Clock Source +// evsys_clk_selection_2 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 2. +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_SRC +#define CONF_GCLK_EVSYS_CHANNEL_2_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_2_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 3 Clock Source +// evsys_clk_selection_3 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 3. +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_SRC +#define CONF_GCLK_EVSYS_CHANNEL_3_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_3_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 4 Clock Source +// evsys_clk_selection_4 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 4. +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_SRC +#define CONF_GCLK_EVSYS_CHANNEL_4_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_4_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 5 Clock Source +// evsys_clk_selection_5 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 5. +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_SRC +#define CONF_GCLK_EVSYS_CHANNEL_5_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_5_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 6 Clock Source +// evsys_clk_selection_6 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 6. +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_SRC +#define CONF_GCLK_EVSYS_CHANNEL_6_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_6_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 7 Clock Source +// evsys_clk_selection_7 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 7. +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_SRC +#define CONF_GCLK_EVSYS_CHANNEL_7_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_7_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 8 Clock Source +// evsys_clk_selection_8 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 8. +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_SRC +#define CONF_GCLK_EVSYS_CHANNEL_8_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_8_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 9 Clock Source +// evsys_clk_selection_9 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 9. +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_SRC +#define CONF_GCLK_EVSYS_CHANNEL_9_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_9_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 10 Clock Source +// evsys_clk_selection_10 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 10. +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_SRC +#define CONF_GCLK_EVSYS_CHANNEL_10_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_10_FREQUENCY 48000000.0 +#endif + +// EVSYS Channel 11 Clock Source +// evsys_clk_selection_11 + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for channel 11. +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_SRC +#define CONF_GCLK_EVSYS_CHANNEL_11_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY + * \brief EVSYS's Clock frequency + */ + +#ifndef CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY +#define CONF_GCLK_EVSYS_CHANNEL_11_FREQUENCY 48000000.0 +#endif + +/** + * \def CONF_CPU_FREQUENCY + * \brief CPU's Clock frequency + */ +#ifndef CONF_CPU_FREQUENCY +#define CONF_CPU_FREQUENCY 120000000 +#endif + +// RTC Clock Source +// rtc_clk_selection +// RTC source +// Select the clock source for RTC. +#ifndef CONF_GCLK_RTC_SRC +#define CONF_GCLK_RTC_SRC RTC_CLOCK_SOURCE +#endif + +/** + * \def CONF_GCLK_RTC_FREQUENCY + * \brief RTC's Clock frequency + */ +#ifndef CONF_GCLK_RTC_FREQUENCY +#define CONF_GCLK_RTC_FREQUENCY 1024 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM0_CORE_SRC +#define CONF_GCLK_SERCOM0_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM0_SLOW_SRC +#define CONF_GCLK_SERCOM0_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM0_CORE_FREQUENCY + * \brief SERCOM0's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_CORE_FREQUENCY +#define CONF_GCLK_SERCOM0_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM0_SLOW_FREQUENCY + * \brief SERCOM0's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM0_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM0_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM1_CORE_SRC +#define CONF_GCLK_SERCOM1_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM1_SLOW_SRC +#define CONF_GCLK_SERCOM1_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM1_CORE_FREQUENCY + * \brief SERCOM1's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_CORE_FREQUENCY +#define CONF_GCLK_SERCOM1_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM1_SLOW_FREQUENCY + * \brief SERCOM1's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM1_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM1_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM2_CORE_SRC +#define CONF_GCLK_SERCOM2_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM2_SLOW_SRC +#define CONF_GCLK_SERCOM2_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM2_CORE_FREQUENCY + * \brief SERCOM2's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_CORE_FREQUENCY +#define CONF_GCLK_SERCOM2_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM2_SLOW_FREQUENCY + * \brief SERCOM2's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM2_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM2_SLOW_FREQUENCY 32768 +#endif + +// Core Clock Source +// core_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for CORE. +#ifndef CONF_GCLK_SERCOM3_CORE_SRC +#define CONF_GCLK_SERCOM3_CORE_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +// Slow Clock Source +// slow_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the slow clock source. +#ifndef CONF_GCLK_SERCOM3_SLOW_SRC +#define CONF_GCLK_SERCOM3_SLOW_SRC GCLK_PCHCTRL_GEN_GCLK3_Val +#endif + +/** + * \def CONF_GCLK_SERCOM3_CORE_FREQUENCY + * \brief SERCOM3's Core Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_CORE_FREQUENCY +#define CONF_GCLK_SERCOM3_CORE_FREQUENCY 48000000 +#endif + +/** + * \def CONF_GCLK_SERCOM3_SLOW_FREQUENCY + * \brief SERCOM3's Slow Clock frequency + */ +#ifndef CONF_GCLK_SERCOM3_SLOW_FREQUENCY +#define CONF_GCLK_SERCOM3_SLOW_FREQUENCY 32768 +#endif + +// TC Clock Source +// tc_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for TC. +#ifndef CONF_GCLK_TC0_SRC +#define CONF_GCLK_TC0_SRC GCLK_PCHCTRL_GEN_GCLK1_Val +#endif + +/** + * \def CONF_GCLK_TC0_FREQUENCY + * \brief TC0's Clock frequency + */ +#ifndef CONF_GCLK_TC0_FREQUENCY +#define CONF_GCLK_TC0_FREQUENCY 48000000 +#endif + +// USB Clock Source +// usb_gclk_selection + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for USB. +#ifndef CONF_GCLK_USB_SRC +#define CONF_GCLK_USB_SRC GCLK_PCHCTRL_GEN_GCLK1_Val + +#endif + +/** + * \def CONF_GCLK_USB_FREQUENCY + * \brief USB's Clock frequency + */ +#ifndef CONF_GCLK_USB_FREQUENCY +#define CONF_GCLK_USB_FREQUENCY 48000000 +#endif + +// <<< end of configuration section >>> + +#endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/usbd_config.h b/ports/atmel-samd/asf4_conf/same54/usbd_config.h new file mode 100644 index 0000000000..be1fa3c9e0 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/usbd_config.h @@ -0,0 +1,850 @@ +/* Auto-generated config file usbd_config.h */ +#ifndef USBD_CONFIG_H +#define USBD_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// ---- USB Device Stack Core Options ---- + +// High Speed Support +// Enable high speed specific descriptors support, e.g., DeviceQualifierDescriptor and OtherSpeedConfiguration Descriptor. +// High speed support require descriptors description array on start, for LS/FS and HS support in first and second place. +// usbd_hs_sp +#ifndef CONF_USBD_HS_SP +#define CONF_USBD_HS_SP 0 +#endif + +// ---- USB Device Stack Composite Options ---- + +// Enable String Descriptors +// usb_composite_str_en +#ifndef CONF_USB_COMPOSITE_STR_EN +#define CONF_USB_COMPOSITE_STR_EN 0 +#endif +// Language IDs +// Language IDs in c format, split by comma (E.g., 0x0409 ...) +// usb_composite_langid +#ifndef CONF_USB_COMPOSITE_LANGID +#define CONF_USB_COMPOSITE_LANGID "0x0409" +#endif + +#ifndef CONF_USB_COMPOSITE_LANGID_DESC +#define CONF_USB_COMPOSITE_LANGID_DESC +#endif +// + +// Composite Device Descriptor + +// bcdUSB +// <0x0200=> USB 2.0 version +// <0x0210=> USB 2.1 version +// usb_composite_bcdusb +#ifndef CONF_USB_COMPOSITE_BCDUSB +#define CONF_USB_COMPOSITE_BCDUSB 0x200 +#endif + +// bMaxPackeSize0 +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_bmaxpksz0 +#ifndef CONF_USB_COMPOSITE_BMAXPKSZ0 +#define CONF_USB_COMPOSITE_BMAXPKSZ0 0x40 +#endif + +// idVender <0x0000-0xFFFF> +// usb_composite_idvender +#ifndef CONF_USB_COMPOSITE_IDVENDER +#define CONF_USB_COMPOSITE_IDVENDER 0x3eb +#endif + +// idProduct <0x0000-0xFFFF> +// usb_composite_idproduct +#ifndef CONF_USB_COMPOSITE_IDPRODUCT +#define CONF_USB_COMPOSITE_IDPRODUCT 0x2421 +#endif + +// bcdDevice <0x0000-0xFFFF> +// usb_composite_bcddevice +#ifndef CONF_USB_COMPOSITE_BCDDEVICE +#define CONF_USB_COMPOSITE_BCDDEVICE 0x100 +#endif + +// Enable string descriptor of iManufact +// usb_composite_imanufact_en +#ifndef CONF_USB_COMPOSITE_IMANUFACT_EN +#define CONF_USB_COMPOSITE_IMANUFACT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT +#define CONF_USB_COMPOSITE_IMANUFACT (CONF_USB_COMPOSITE_IMANUFACT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN)) +#endif + +// Unicode string of iManufact +// usb_composite_imanufact_str +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR +#define CONF_USB_COMPOSITE_IMANUFACT_STR "Atmel" +#endif + +#ifndef CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#define CONF_USB_COMPOSITE_IMANUFACT_STR_DESC +#endif + +// + +// Enable string descriptor of iProduct +// usb_composite_iproduct_en +#ifndef CONF_USB_COMPOSITE_IPRODUCT_EN +#define CONF_USB_COMPOSITE_IPRODUCT_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT +#define CONF_USB_COMPOSITE_IPRODUCT \ + (CONF_USB_COMPOSITE_IPRODUCT_EN * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN)) +#endif + +// Unicode string of iProduct +// usb_composite_iproduct_str +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR +#define CONF_USB_COMPOSITE_IPRODUCT_STR "Composite Demo" +#endif + +#ifndef CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#define CONF_USB_COMPOSITE_IPRODUCT_STR_DESC +#endif + +// + +// Enable string descriptor of iSerialNum +// usb_composite_iserialnum_en +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_EN +#define CONF_USB_COMPOSITE_ISERIALNUM_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM +#define CONF_USB_COMPOSITE_ISERIALNUM \ + (CONF_USB_COMPOSITE_ISERIALNUM_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN)) +#endif + +// Unicode string of iSerialNum +// usb_composite_iserialnum_str +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR +#define CONF_USB_COMPOSITE_ISERIALNUM_STR "123456789ABCDEF" +#endif + +#ifndef CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#define CONF_USB_COMPOSITE_ISERIALNUM_STR_DESC +#endif + +// + +// bNumConfigurations <0x01-0xFF> +// usb_composite_bnumconfig +#ifndef CONF_USB_COMPOSITE_BNUMCONFIG +#define CONF_USB_COMPOSITE_BNUMCONFIG 0x1 +#endif + +// + +// Composite Configuration Descriptor +// bConfigurationValue <0x01-0xFF> +// usb_composite_bconfigval +#ifndef CONF_USB_COMPOSITE_BCONFIGVAL +#define CONF_USB_COMPOSITE_BCONFIGVAL 0x1 +#endif +// Enable string descriptor of iConfig +// usb_composite_iconfig_en +#ifndef CONF_USB_COMPOSITE_ICONFIG_EN +#define CONF_USB_COMPOSITE_ICONFIG_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG +#define CONF_USB_COMPOSITE_ICONFIG \ + (CONF_USB_COMPOSITE_ICONFIG_EN \ + * (CONF_USB_COMPOSITE_IMANUFACT_EN + CONF_USB_COMPOSITE_IPRODUCT_EN + CONF_USB_COMPOSITE_ISERIALNUM_EN \ + + CONF_USB_COMPOSITE_ICONFIG_EN)) +#endif + +// Unicode string of iConfig +// usb_composite_iconfig_str +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR +#define CONF_USB_COMPOSITE_ICONFIG_STR "" +#endif + +#ifndef CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#define CONF_USB_COMPOSITE_ICONFIG_STR_DESC +#endif + +// + +// bmAttributes +// <0x80=> Bus power supply, not support for remote wakeup +// <0xA0=> Bus power supply, support for remote wakeup +// <0xC0=> Self powered, not support for remote wakeup +// <0xE0=> Self powered, support for remote wakeup +// usb_composite_bmattri +#ifndef CONF_USB_COMPOSITE_BMATTRI +#define CONF_USB_COMPOSITE_BMATTRI 0x80 +#endif + +// bMaxPower <0x00-0xFF> +// usb_composite_bmaxpower +#ifndef CONF_USB_COMPOSITE_BMAXPOWER +#define CONF_USB_COMPOSITE_BMAXPOWER 0x32 +#endif +// + +// CDC ACM Support +// usb_composite_cdc_acm_support +#ifndef CONF_USB_COMPOSITE_CDC_ACM_EN +#define CONF_USB_COMPOSITE_CDC_ACM_EN 0 +#endif + +// CDC ACM Comm Interrupt IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_EPADDR 0x82 +#endif + +// CDC ACM Comm Interrupt IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_comm_int_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_COMM_INT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_cdc_acm_data_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_EPADDR 0x81 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK IN Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_builin_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKIN_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Data BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_cdc_acm_data_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_EPADDR 0x1 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ 0x40 +#endif + +// CDC ACM Data BULK OUT Endpoint wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_cdc_acm_data_buckout_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_CDC_ACM_DATA_BULKOUT_MAXPKSZ_HS 0x200 +#endif + +// CDC ACM Echo Demo generation +// conf_usb_composite_cdc_echo_demo +// Invoke cdcdf_acm_demo_init(buf[wMaxPacketSize]) to enable the echo demo. +// Buf is packet buffer for data receive and echo back. +// The buffer is 4 byte aligned to support DMA. +#ifndef CONF_USB_COMPOSITE_CDC_ECHO_DEMO +#define CONF_USB_COMPOSITE_CDC_ECHO_DEMO 0 +#endif + +// + +// HID Mouse Support +// usb_composite_hid_mouse_support +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_EN +#define CONF_USB_COMPOSITE_HID_MOUSE_EN 0 +#endif + +// HID Mouse INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_mouse_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_EPADDR 0x83 +#endif + +// HID Mouse INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_mouse_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_MOUSE_INTIN_MAXPKSZ 0x8 +#endif + +// HID Mouse Move Demo generation +// conf_usb_composite_hid_mouse_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Button1 and button3 are the pins used for mouse moving left and right. +#ifndef CONF_USB_COMPOSITE_HID_MOUSE_DEMO +#define CONF_USB_COMPOSITE_HID_MOUSE_DEMO 0 +#endif + +// + +// HID Keyboard Support +// usb_composite_hid_keyboard_support +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_EN +#define CONF_USB_COMPOSITE_HID_KEYBOARD_EN 0 +#endif + +// HID Keyboard INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_keyboard_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_EPADDR 0x84 +#endif + +// HID Keyboard INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTIN_MAXPKSZ 0x8 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_keyboard_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_EPADDR 0x2 +#endif + +// HID Keyboard INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_keyboard_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_KEYBOARD_INTOUT_MAXPKSZ 0x8 +#endif + +// HID Keyboard Caps Lock Demo generation +// conf_usb_composite_hid_keyboard_demo +// Invoke hiddf_demo_init(button1, button2, button3) to enabled the move demo. +// Buffon2 is the pin used for keyboard CAPS LOCK simulation. +#ifndef CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO +#define CONF_USB_COMPOSITE_HID_KEYBOARD_DEMO 0 +#endif + +// + +// HID Generic Support +// usb_composite_hid_generic_support +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_EN +#define CONF_USB_COMPOSITE_HID_GENERIC_EN 0 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT_LEN 53 +#endif + +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_REPORT +#define CONF_USB_COMPOSITE_HID_GENERIC_REPORT \ + 0x06, 0xFF, 0xFF, 0x09, 0x01, 0xA1, 0x01, 0x09, 0x02, 0x09, 0x03, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, \ + 0x40, 0x81, 0x02, 0x09, 0x04, 0x09, 0x05, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x40, 0x91, 0x02, \ + 0x09, 0x06, 0x09, 0x07, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x75, 0x08, 0x95, 0x04, 0xB1, 0x02, 0xC0 +#endif + +// HID Generic INTERRUPT IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_hid_generic_intin_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_EPADDR 0x85 +#endif + +// HID Generic INTERRUPT IN Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_hid_generic_intin_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTIN_MAXPKSZ 0x40 +#endif + +// HID Generic INTERRUPT OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_hid_generic_intout_epaddr +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_EPADDR 0x3 +#endif + +// HID Generic INTERRUPT OUT Endpoint wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// usb_composite_hid_generic_intout_maxpksz +// Please make sure that the setting here is coincide with the endpoint setting in USB device driver. +#ifndef CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ +#define CONF_USB_COMPOSITE_HID_GENERIC_INTOUT_MAXPKSZ 0x40 +#endif + +// + +// MSC Support +// usb_composite_msc_support +#ifndef CONF_USB_COMPOSITE_MSC_EN +#define CONF_USB_COMPOSITE_MSC_EN 0 +#endif + +// MSC BULK Endpoints wMaxPacketSize +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes + +// usb_composite_msc_bulk_maxpksz +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ 0x40 +#endif + +// MSC BULK Endpoints wMaxPacketSize for High Speed +// <0x0008=> 8 bytes +// <0x0010=> 16 bytes +// <0x0020=> 32 bytes +// <0x0040=> 64 bytes +// <0x0080=> 128 bytes +// <0x0100=> 256 bytes +// <0x0200=> 512 bytes + +// usb_composite_msc_bulk_maxpksz_hs +#ifndef CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS +#define CONF_USB_COMPOSITE_MSC_BULK_MAXPKSZ_HS 0x200 +#endif + +// MSC BULK IN Endpoint Address +// <0x81=> EndpointAddress = 0x81 +// <0x82=> EndpointAddress = 0x82 +// <0x83=> EndpointAddress = 0x83 +// <0x84=> EndpointAddress = 0x84 +// <0x85=> EndpointAddress = 0x85 +// <0x86=> EndpointAddress = 0x86 +// <0x87=> EndpointAddress = 0x87 +// <0x88=> EndpointAddress = 0x88 +// <0x89=> EndpointAddress = 0x89 + +// usb_composite_msc_bulkin_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKIN_EPADDR 0x86 +#endif + +// MSC BULK OUT Endpoint Address +// <0x01=> EndpointAddress = 0x01 +// <0x02=> EndpointAddress = 0x02 +// <0x03=> EndpointAddress = 0x03 +// <0x04=> EndpointAddress = 0x04 +// <0x05=> EndpointAddress = 0x05 +// <0x06=> EndpointAddress = 0x06 +// <0x07=> EndpointAddress = 0x07 +// <0x08=> EndpointAddress = 0x08 +// <0x09=> EndpointAddress = 0x09 + +// usb_composite_msc_bulkout_epaddr +#ifndef CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR +#define CONF_USB_COMPOSITE_MSC_BULKOUT_EPADDR 0x4 +#endif + +// Enable Demo code for Disk LUN handling +// usb_composite_msc_demo_en +#ifndef CONF_USB_COMPOSITE_MSC_LUN_DEMO +#define CONF_USB_COMPOSITE_MSC_LUN_DEMO 1 +#endif + +// Disk access cache/buffer of sectors if non-RAM disk (e.g., SD/MMC) enabled <1-64> +// conf_usb_msc_lun_buf_sectors +#ifndef CONF_USB_MSC_LUN_BUF_SECTORS +#define CONF_USB_MSC_LUN_BUF_SECTORS 4 +#endif + +// Enable Demo for RAM Disk +// conf_usb_msc_lun0_enable +#ifndef CONF_USB_MSC_LUN0_ENABLE +#define CONF_USB_MSC_LUN0_ENABLE 1 +#endif + +#ifndef CONF_USB_MSC_LUN0_TYPE +#define CONF_USB_MSC_LUN0_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun0_rmb +#ifndef CONF_USB_MSC_LUN0_RMB +#define CONF_USB_MSC_LUN0_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN0_ISO +#define CONF_USB_MSC_LUN0_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ECMA +#define CONF_USB_MSC_LUN0_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_ANSI +#define CONF_USB_MSC_LUN0_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_REPO +#define CONF_USB_MSC_LUN0_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN0_FACTORY +#define CONF_USB_MSC_LUN0_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT +#define CONF_USB_MSC_LUN0_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN0_PRODUCT_VERSION +#define CONF_USB_MSC_LUN0_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// Windows will not show disk less than 20K, so 22K is used to reserve more RAM for APP +// conf_usb_msc_lun0_capacity + +#ifndef CONF_USB_MSC_LUN0_CAPACITY +#define CONF_USB_MSC_LUN0_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN0_BLOCK_SIZE +#define CONF_USB_MSC_LUN0_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN0_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN0_CAPACITY * 1024 / CONF_USB_MSC_LUN0_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for SD/MMC Disk +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_enable +#ifndef CONF_USB_MSC_LUN1_ENABLE +#define CONF_USB_MSC_LUN1_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN1_TYPE +#define CONF_USB_MSC_LUN1_TYPE 0x00 +#endif + +// The disk is removable +// SD/MMC stack must be added before enable SD/MMC demo +// SD/MMC insert/eject not supported by this simple demo +// conf_usb_msc_lun1_rmb +#ifndef CONF_USB_MSC_LUN1_RMB +#define CONF_USB_MSC_LUN1_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN1_ISO +#define CONF_USB_MSC_LUN1_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ECMA +#define CONF_USB_MSC_LUN1_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_ANSI +#define CONF_USB_MSC_LUN1_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_REPO +#define CONF_USB_MSC_LUN1_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN1_FACTORY +#define CONF_USB_MSC_LUN1_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT +#define CONF_USB_MSC_LUN1_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_PRODUCT_VERSION +#define CONF_USB_MSC_LUN1_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN1_CAPACITY +#define CONF_USB_MSC_LUN1_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN1_BLOCK_SIZE +#define CONF_USB_MSC_LUN1_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN1_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN1_CAPACITY * 1024 / CONF_USB_MSC_LUN1_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 2 +// conf_usb_msc_lun2_enable +#ifndef CONF_USB_MSC_LUN2_ENABLE +#define CONF_USB_MSC_LUN2_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN2_TYPE +#define CONF_USB_MSC_LUN2_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun2_rmb +#ifndef CONF_USB_MSC_LUN2_RMB +#define CONF_USB_MSC_LUN2_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN2_ISO +#define CONF_USB_MSC_LUN2_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ECMA +#define CONF_USB_MSC_LUN2_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_ANSI +#define CONF_USB_MSC_LUN2_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_REPO +#define CONF_USB_MSC_LUN2_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN2_FACTORY +#define CONF_USB_MSC_LUN2_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT +#define CONF_USB_MSC_LUN2_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN2_PRODUCT_VERSION +#define CONF_USB_MSC_LUN2_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun2_capacity + +#ifndef CONF_USB_MSC_LUN2_CAPACITY +#define CONF_USB_MSC_LUN2_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN2_BLOCK_SIZE +#define CONF_USB_MSC_LUN2_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN2_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN2_CAPACITY * 1024 / CONF_USB_MSC_LUN2_BLOCK_SIZE - 1) +#endif + +// + +// Enable Demo for LUN 3 +// conf_usb_msc_lun3_enable +#ifndef CONF_USB_MSC_LUN3_ENABLE +#define CONF_USB_MSC_LUN3_ENABLE 0 +#endif + +#ifndef CONF_USB_MSC_LUN3_TYPE +#define CONF_USB_MSC_LUN3_TYPE 0x00 +#endif + +// The disk is removable +// conf_usb_msc_lun3_rmb +#ifndef CONF_USB_MSC_LUN3_RMB +#define CONF_USB_MSC_LUN3_RMB 0x1 +#endif + +#ifndef CONF_USB_MSC_LUN3_ISO +#define CONF_USB_MSC_LUN3_ISO 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ECMA +#define CONF_USB_MSC_LUN3_ECMA 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_ANSI +#define CONF_USB_MSC_LUN3_ANSI 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_REPO +#define CONF_USB_MSC_LUN3_REPO 0x01 +#endif + +#ifndef CONF_USB_MSC_LUN3_FACTORY +#define CONF_USB_MSC_LUN3_FACTORY 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT +#define CONF_USB_MSC_LUN3_PRODUCT 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +#endif + +#ifndef CONF_USB_MSC_LUN3_PRODUCT_VERSION +#define CONF_USB_MSC_LUN3_PRODUCT_VERSION 0x00, 0x00, 0x00, 0x00 +#endif + +// Disk Size (in KB) <0x1-0xFFFFFFFF> +// conf_usb_msc_lun3_capacity + +#ifndef CONF_USB_MSC_LUN3_CAPACITY +#define CONF_USB_MSC_LUN3_CAPACITY 22 +#endif + +#ifndef CONF_USB_MSC_LUN3_BLOCK_SIZE +#define CONF_USB_MSC_LUN3_BLOCK_SIZE 512 +#endif + +#ifndef CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR +#define CONF_USB_MSC_LUN3_LAST_BLOCK_ADDR \ + ((uint32_t)CONF_USB_MSC_LUN3_CAPACITY * 1024 / CONF_USB_MSC_LUN3_BLOCK_SIZE - 1) +#endif + +// + +// +// + +// <<< end of configuration section >>> + +#endif // USBD_CONFIG_H diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index 24e425e8cb..e1022c52f7 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -272,7 +272,7 @@ MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c index 568dc6425f..cfdfe75d8d 100644 --- a/ports/atmel-samd/common-hal/_pew/PewPew.c +++ b/ports/atmel-samd/common-hal/_pew/PewPew.c @@ -88,7 +88,7 @@ void pew_init() { #ifdef SAMD21 turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X turn_on_clocks(true, index, 1); #endif @@ -98,7 +98,7 @@ void pew_init() { TC_CTRLA_PRESCALER_DIV64 | TC_CTRLA_WAVEGEN_MFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index 9ac1f7bd15..e69a240717 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -50,7 +50,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, mp_raise_NotImplementedError(translate("No DAC on chip")); #else if (pin->number != PIN_PA02 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X && pin->number != PIN_PA05 #endif ) { @@ -59,13 +59,13 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, } self->channel = 0; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (pin->number == PIN_PA05) { self->channel = 1; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBDMASK_DAC_bit(MCLK); #endif @@ -80,16 +80,16 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, // Don't double init the DAC on the SAMD51 when both outputs are in use. We use the free state // of each output pin to determine DAC state. int32_t result = ERR_NONE; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (!common_hal_mcu_pin_is_free(&pin_PA02) || !common_hal_mcu_pin_is_free(&pin_PA05)) { #endif // Fake the descriptor if the DAC is already initialized. self->descriptor.device.hw = DAC; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } else { #endif result = dac_sync_init(&self->descriptor, DAC); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } #endif if (result != ERR_NONE) { @@ -109,18 +109,18 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAMD51) + #if (defined(SAMD21) && defined(PIN_PA02)) || defined(SAM_D5X_E5X) if (common_hal_analogio_analogout_deinited(self)) { return; } dac_sync_disable_channel(&self->descriptor, self->channel); reset_pin_number(PIN_PA02); // Only deinit the DAC on the SAMD51 if both outputs are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (common_hal_mcu_pin_is_free(&pin_PA02) && common_hal_mcu_pin_is_free(&pin_PA05)) { #endif dac_sync_deinit(&self->descriptor); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } #endif self->deinited = true; @@ -147,7 +147,7 @@ void analogout_reset(void) { #ifdef SAMD21 while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.reg & DAC_SYNCBUSY_SWRST) {} #endif DAC->CTRLA.reg |= DAC_CTRLA_SWRST; diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 8f827e7fba..20fa624edf 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -59,13 +59,13 @@ #define SERCTRL(name) I2S_SERCTRL_ ## name #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SERCTRL(name) I2S_TXCTRL_ ## name #endif void i2sout_reset(void) { // Make sure the I2S peripheral is running so we can see if the resources we need are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Connect the clock units to the 2mhz clock. It can't disable without it. connect_gclk_to_peripheral(5, I2S_GCLK_ID_0); connect_gclk_to_peripheral(5, I2S_GCLK_ID_1); @@ -76,7 +76,7 @@ void i2sout_reset(void) { } // Make sure the I2S peripheral is running so we can see if the resources we need are free. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Connect the clock units to the 2mhz clock by default. They can't reset without it. disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_0); disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_1); @@ -132,7 +132,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, serializer = 1; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Only clock unit 0 can be used for transmission. if (bit_clock == &pin_PA10 || bit_clock == &pin_PB16) { // I2S SCK[0] bc_clock_unit = 0; @@ -170,14 +170,14 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self, mp_raise_RuntimeError(translate("Serializer in use")); } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (I2S->CTRLA.bit.TXEN == 1) { mp_raise_RuntimeError(translate("Serializer in use")); } #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif #ifdef SAMD21 @@ -254,7 +254,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, #ifdef SAMD21 uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_TX) | I2S_SERCTRL_TXSAME_SAME | I2S_SERCTRL_EXTEND_MSBIT | I2S_SERCTRL_TXDEFAULT_ONE | I2S_SERCTRL_SLOTADJ_LEFT; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | I2S_TXCTRL_TXSAME_SAME; #endif if (audiosample_channel_count(sample) == 1) { @@ -277,7 +277,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, #ifdef SAMD21 I2S->SERCTRL[self->serializer].reg = serctrl; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->TXCTRL.reg = serctrl; #endif @@ -291,7 +291,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, uint32_t tx_register = (uint32_t) &I2S->DATA[self->serializer].reg; uint8_t dmac_id = I2S_DMAC_ID_TX_0 + self->serializer; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t tx_register = (uint32_t) &I2S->TXDATA.reg; uint8_t dmac_id = I2S_DMAC_ID_TX_0; #endif @@ -316,7 +316,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, I2S->CTRLA.vec.SEREN = 1 << self->serializer; while ((I2S->SYNCBUSY.vec.SEREN & (1 << self->serializer)) != 0) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->CTRLA.bit.TXEN = 1; while (I2S->SYNCBUSY.bit.TXEN == 1) {} #endif @@ -333,7 +333,7 @@ void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t* self) { #ifdef SAMD21 I2S->INTFLAG.reg = I2S_INTFLAG_TXUR0 << self->serializer; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->INTFLAG.reg = I2S_INTFLAG_TXUR0 | I2S_INTFLAG_TXUR1; #endif @@ -351,7 +351,7 @@ void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { I2S->CTRLA.vec.SEREN &= ~(1 << self->serializer); while ((I2S->SYNCBUSY.vec.SEREN & (1 << self->serializer)) != 0) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->CTRLA.bit.TXEN = 0; while (I2S->SYNCBUSY.bit.TXEN == 1) {} #endif @@ -368,7 +368,7 @@ void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t* self) { disconnect_gclk_from_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); disable_clock_generator(self->gclk); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_gclk_to_peripheral(5, I2S_GCLK_ID_0 + self->clock_unit); #endif diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index a1e35a1dc0..474512f5ea 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -60,7 +60,7 @@ #define SERCTRL(name) I2S_SERCTRL_ ## name #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SERCTRL(name) I2S_RXCTRL_ ## name #endif @@ -94,7 +94,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->clock_unit = 1; #endif #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { self->clock_unit = 0; } else if (clock_pin == &pin_PB12 @@ -122,7 +122,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #endif self->serializer = 1; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { self->serializer = 1; #endif @@ -145,13 +145,13 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, mp_raise_RuntimeError(translate("Serializer in use")); } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (I2S->CTRLA.bit.RXEN == 1) { mp_raise_RuntimeError(translate("Serializer in use")); } #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_J #endif #ifdef SAMD21 @@ -185,7 +185,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #ifdef SAMD21 uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t serctrl = (self->clock_unit << I2S_RXCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_PDM2) | SERCTRL(DATASIZE_32); #endif @@ -196,7 +196,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #ifdef SAMD21 I2S->SERCTRL[self->serializer].reg = serctrl; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X I2S->RXCTRL.reg = serctrl; #endif @@ -274,7 +274,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, #ifdef SAMD21 descriptor->SRCADDR.reg = (uint32_t)&I2S->DATA[self->serializer]; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif @@ -295,7 +295,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, #ifdef SAMD21 second_descriptor->SRCADDR.reg = (uint32_t)&I2S->DATA[self->serializer]; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X second_descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif second_descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | @@ -400,7 +400,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se #ifdef SAMD21 #define MAX_WAIT_COUNTS 1000 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define MAX_WAIT_COUNTS 6000 #endif // If wait_counts exceeds the max count, buffer has probably stopped filling; diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 75621b361f..5cefba56f1 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -74,7 +74,7 @@ static void ramp_value(uint16_t start, uint16_t end) { } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X static void ramp_value(uint16_t start, uint16_t end) { int32_t diff = (int32_t) end - start; int32_t step = 49; @@ -104,7 +104,7 @@ void audioout_reset(void) { #ifdef SAMD21 while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.reg & DAC_SYNCBUSY_SWRST) {} #endif if (DAC->CTRLA.bit.ENABLE) { @@ -118,7 +118,7 @@ void audioout_reset(void) { // Caller validates that pins are free. void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X bool dac_clock_enabled = hri_mclk_get_APBDMASK_DAC_bit(MCLK); #endif @@ -138,7 +138,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, } claim_pin(left_channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X self->right_channel = NULL; if (left_channel != &pin_PA02 && left_channel != &pin_PA05) { mp_raise_ValueError(translate("Invalid pin for left channel")); @@ -159,7 +159,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, self->left_channel = left_channel; audio_dma_init(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBDMASK_DAC_bit(MCLK); #endif @@ -176,12 +176,12 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC->CTRLA.bit.SWRST = 1; while (DAC->CTRLA.bit.SWRST == 1) {} // Make sure there are no outstanding access errors. (Reading DATA can cause this.) - #ifdef SAMD51 + #ifdef SAM_D5X_E5X PAC->INTFLAGD.reg = PAC_INTFLAGD_DAC; #endif bool channel0_enabled = true; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X channel0_enabled = self->left_channel == &pin_PA02 || self->right_channel == &pin_PA02; bool channel1_enabled = self->left_channel == &pin_PA05 || self->right_channel == &pin_PA05; #endif @@ -195,7 +195,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC_CTRLB_EOEN | DAC_CTRLB_VPD; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI0; DAC->DACCTRL[0].reg = DAC_DACCTRL_CCTRL_CC100K | DAC_DACCTRL_ENABLE | @@ -203,7 +203,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, DAC->CTRLB.reg = DAC_CTRLB_REFSEL_VREFPU; #endif } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (channel1_enabled) { DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI1; DAC->DACCTRL[1].reg = DAC_DACCTRL_CCTRL_CC100K | @@ -218,7 +218,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, #ifdef SAMD21 while (DAC->STATUS.bit.SYNCBUSY == 1) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.bit.ENABLE == 1) {} while (channel0_enabled && DAC->STATUS.bit.READY0 == 0) {} while (channel1_enabled && DAC->STATUS.bit.READY1 == 0) {} @@ -243,7 +243,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, // Use the 48mhz clocks on both the SAMD21 and 51 because we will be going much slower. uint8_t tc_gclk = 0; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_gclk = 1; #endif @@ -253,7 +253,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, // Don't bother setting the period. We set it before you playback anything. tc_set_enable(t, false); tc_reset(t); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X t->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ; #endif #ifdef SAMD21 @@ -268,7 +268,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, #ifdef SAMD21 #define FIRST_TC_GEN_ID EVSYS_ID_GEN_TC3_OVF #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X #define FIRST_TC_GEN_ID EVSYS_ID_GEN_TC0_OVF #endif uint8_t tc_gen_id = FIRST_TC_GEN_ID + 3 * tc_index; @@ -282,7 +282,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self, mp_raise_RuntimeError(translate("All event channels in use")); } - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_event_user_to_channel(EVSYS_ID_USER_DAC_START_1, channel); if (right_channel != NULL) { gpio_set_pin_function(self->right_channel->number, GPIO_PIN_FUNCTION_B); @@ -322,7 +322,7 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { #ifdef SAMD21 while (DAC->STATUS.bit.SYNCBUSY == 1) {} #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (DAC->SYNCBUSY.bit.ENABLE == 1) {} #endif @@ -332,7 +332,7 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) { reset_pin_number(self->left_channel->number); self->left_channel = NULL; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X reset_pin_number(self->right_channel->number); self->right_channel = NULL; #endif @@ -369,7 +369,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, #ifdef SAMD21 uint32_t max_sample_rate = 350000; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t max_sample_rate = 1000000; #endif if (sample_rate > max_sample_rate) { @@ -382,7 +382,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, DAC_DMAC_ID_EMPTY); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t left_channel_reg = (uint32_t) &DAC->DATABUF[0].reg; uint8_t tc_trig_id = TC0_DMAC_ID_OVF + 3 * self->tc_index; uint8_t left_channel_trigger = tc_trig_id; @@ -416,7 +416,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, #endif if (result != AUDIO_DMA_OK) { audio_dma_stop(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_stop(&self->right_dma); #endif if (result == AUDIO_DMA_DMA_BUSY) { @@ -434,7 +434,7 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self, void common_hal_audioio_audioout_pause(audioio_audioout_obj_t* self) { audio_dma_pause(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_pause(&self->right_dma); #endif } @@ -444,12 +444,12 @@ void common_hal_audioio_audioout_resume(audioio_audioout_obj_t* self) { #ifdef SAMD21 DAC->INTFLAG.reg = DAC_INTFLAG_UNDERRUN; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X DAC->INTFLAG.reg = DAC_INTFLAG_UNDERRUN0 | DAC_INTFLAG_UNDERRUN1; #endif audio_dma_resume(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_resume(&self->right_dma); #endif } @@ -462,7 +462,7 @@ void common_hal_audioio_audioout_stop(audioio_audioout_obj_t* self) { Tc* timer = tc_insts[self->tc_index]; timer->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_STOP; audio_dma_stop(&self->left_dma); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X audio_dma_stop(&self->right_dma); #endif // Ramp the DAC to default. The start is ignored when the current value can be readback. diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.h b/ports/atmel-samd/common-hal/audioio/AudioOut.h index 56b6b75c89..956839969f 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.h +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.h @@ -36,7 +36,7 @@ typedef struct { mp_obj_base_t base; const mcu_pin_obj_t *left_channel; audio_dma_t left_dma; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X const mcu_pin_obj_t *right_channel; audio_dma_t right_dma; #endif diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 9f740dc8af..b587eaaef4 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -105,7 +105,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, continue; } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || !(tx->sercom[i].pad == 0)) { continue; diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index fcb3c0ce73..1952df5637 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -54,7 +54,7 @@ static frequencyio_frequencyin_obj_t *active_frequencyins[TC_INST_NUM]; volatile uint8_t reference_tc = 0xff; -#ifdef SAMD51 +#ifdef SAM_D5X_E5X static uint8_t dpll_gclk; #endif @@ -67,7 +67,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index) { NVIC_DisableIRQ(EIC_IRQn); NVIC_ClearPendingIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); #endif @@ -78,7 +78,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index) { #ifdef SAMD21 NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif mp_raise_RuntimeError(translate("Frequency captured is above capability. Capture Paused.")); @@ -107,7 +107,7 @@ void frequencyin_interrupt_handler(uint8_t index) { self->factor = (uint32_t) (current_ns - self->last_ns) / 1000000.0; self->last_ns = current_ns; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_READSYNC_Val; while ((tc->COUNT16.SYNCBUSY.bit.COUNT == 1) || (tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val)) { @@ -121,7 +121,7 @@ void frequencyin_interrupt_handler(uint8_t index) { } self->frequency = new_freq; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.bit.CMD = TC_CTRLBSET_CMD_RETRIGGER_Val; while ((tc->COUNT16.SYNCBUSY.bit.COUNT == 1) || (tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_RETRIGGER_Val)) { @@ -151,7 +151,7 @@ void frequencyin_reference_tc_init() { #endif // use the DPLL we setup so that the reference_tc and freqin_tc(s) // are using the same clock frequency. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (dpll_gclk == 0xff) { frequencyin_samd51_start_dpll(); } @@ -168,7 +168,7 @@ void frequencyin_reference_tc_init() { tc->COUNT16.INTENSET.bit.OVF = 1; NVIC_EnableIRQ(TC3_IRQn + reference_tc); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1; tc->COUNT16.INTENSET.bit.OVF = 1; @@ -192,7 +192,7 @@ void frequencyin_reference_tc_enable(bool enable) { tc_set_enable(tc, enable); } -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void frequencyin_samd51_start_dpll() { if (clock_get_enabled(0, GCLK_SOURCE_DPLL1)) { return; @@ -259,7 +259,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 ((EIC->INTENSET.vec.EXTINT & mask) != 0 || (EIC->EVCTRL.vec.EXTINTEO & mask) != 0)) { #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ((EIC->INTENSET.bit.EXTINT & mask) != 0 || (EIC->EVCTRL.bit.EXTINTEO & mask) != 0)) { #endif mp_raise_RuntimeError(translate("EXTINT channel already in use")); @@ -280,7 +280,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 self->TC_IRQ = TC3_IRQn + timer_index; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X self->TC_IRQ = TC0_IRQn + timer_index; #endif @@ -292,7 +292,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* set_timer_handler(timer_index, 0, TC_HANDLER_NO_INTERRUPT); turn_on_clocks(true, timer_index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X frequencyin_samd51_start_dpll(); if (dpll_gclk == 0xff && !clock_get_enabled(0, GCLK_SOURCE_DPLL1)) { common_hal_frequencyio_frequencyin_deinit(self); @@ -318,7 +318,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value | (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value | (1 << self->channel); EIC->ASYNCH.bit.ASYNCH = 1; @@ -334,7 +334,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* #ifdef SAMD21 connect_event_user_to_channel((EVSYS_ID_USER_TC3_EVU + timer_index), evsys_channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X connect_event_user_to_channel((EVSYS_ID_USER_TC0_EVU + timer_index), evsys_channel); #endif init_async_event_channel(evsys_channel, (EVSYS_ID_GEN_EIC_EXTINT_0 + self->channel)); @@ -349,7 +349,7 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* tc->COUNT16.EVCTRL.bit.EVACT = TC_EVCTRL_EVACT_COUNT_Val; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.EVCTRL.reg = TC_EVCTRL_EVACT(TC_EVCTRL_EVACT_COUNT_Val) | TC_EVCTRL_TCEI; tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1; @@ -393,7 +393,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value ^ (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X disable_event_user(EVSYS_ID_USER_TC0_EVU + self->tc_index); uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value ^ (1 << self->channel); @@ -427,7 +427,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se if (!check_active) { frequencyin_reference_tc_enable(false); reference_tc = 0xff; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X frequencyin_samd51_stop_dpll(); #endif } @@ -438,7 +438,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj #ifdef SAMD21 NVIC_DisableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); #endif @@ -462,7 +462,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj NVIC_ClearPendingIRQ(EIC_IRQn); NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif @@ -481,7 +481,7 @@ void common_hal_frequencyio_frequencyin_pause(frequencyio_frequencyin_obj_t* sel uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value ^ (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value ^ (1 << self->channel); #endif @@ -499,7 +499,7 @@ void common_hal_frequencyio_frequencyin_resume(frequencyio_frequencyin_obj_t* se uint32_t masked_value = EIC->EVCTRL.vec.EXTINTEO; EIC->EVCTRL.vec.EXTINTEO = masked_value | (1 << self->channel); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t masked_value = EIC->EVCTRL.bit.EXTINTEO; EIC->EVCTRL.bit.EXTINTEO = masked_value | (1 << self->channel); #endif @@ -512,7 +512,7 @@ void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* sel #ifdef SAMD21 NVIC_DisableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_DisableIRQ(EIC_0_IRQn + self->channel); #endif @@ -524,7 +524,7 @@ void common_hal_frequencyio_frequencyin_clear(frequencyio_frequencyin_obj_t* sel NVIC_ClearPendingIRQ(EIC_IRQn); NVIC_EnableIRQ(EIC_IRQn); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_ClearPendingIRQ(EIC_0_IRQn + self->channel); NVIC_EnableIRQ(EIC_0_IRQn + self->channel); #endif diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h index 461fb661f1..53b9f2d2d1 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.h @@ -50,7 +50,7 @@ void frequencyin_emergency_cancel_capture(uint8_t index); void frequencyin_reference_tc_init(void); void frequencyin_reference_tc_enable(bool enable); bool frequencyin_reference_tc_enabled(void); -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void frequencyin_samd51_start_dpll(void); void frequencyin_samd51_stop_dpll(void); #endif diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 3c214a9f41..5ce077eb86 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -45,7 +45,7 @@ bool speaker_enable_in_use; #define PORT_COUNT (PORT_BITS / 32 + 1) -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define SWD_MUX GPIO_PIN_FUNCTION_H #endif #ifdef SAMD21 @@ -80,7 +80,7 @@ void reset_all_pins(void) { // Configure SWD. SWDIO will be automatically switched on PA31 when a signal is input on // SWCLK. - #ifdef SAMD51 + #ifdef SAM_D5X_E5X gpio_set_pin_function(PIN_PA30, MUX_PA30H_CM4_SWCLK); #endif #ifdef SAMD21 @@ -136,7 +136,7 @@ void reset_pin_number(uint8_t pin_number) { #endif if (pin_number == PIN_PA30 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ) { #endif #ifdef SAMD21 @@ -199,7 +199,7 @@ bool pin_number_is_free(uint8_t pin_number) { return false; } if (pin_number == PIN_PA30 - #ifdef SAMD51 + #ifdef SAM_D5X_E5X ) { #endif #ifdef SAMD21 diff --git a/ports/atmel-samd/common-hal/microcontroller/Processor.c b/ports/atmel-samd/common-hal/microcontroller/Processor.c index 2ca3ab30bd..199f19354b 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Processor.c +++ b/ports/atmel-samd/common-hal/microcontroller/Processor.c @@ -163,7 +163,7 @@ STATIC float calculate_temperature(uint16_t raw_value) { } #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X STATIC float calculate_temperature(uint16_t TP, uint16_t TC) { uint32_t TLI = (*(uint32_t *)FUSES_ROOM_TEMP_VAL_INT_ADDR & FUSES_ROOM_TEMP_VAL_INT_Msk) >> FUSES_ROOM_TEMP_VAL_INT_Pos; uint32_t TLD = (*(uint32_t *)FUSES_ROOM_TEMP_VAL_DEC_ADDR & FUSES_ROOM_TEMP_VAL_DEC_Msk) >> FUSES_ROOM_TEMP_VAL_DEC_Pos; @@ -231,7 +231,7 @@ float common_hal_mcu_processor_get_temperature(void) { return calculate_temperature(value); #endif // SAMD21 -#ifdef SAMD51 +#ifdef SAM_D5X_E5X adc_sync_set_resolution(&adc, ADC_CTRLB_RESSEL_12BIT_Val); // Using INTVCC0 as the reference voltage. // INTVCC1 seems to read a little high. @@ -285,7 +285,7 @@ float common_hal_mcu_processor_get_voltage(void) { adc_sync_set_reference(&adc, ADC_REFCTRL_REFSEL_INT1V_Val); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X hri_supc_set_VREF_SEL_bf(SUPC, SUPC_VREF_SEL_1V0_Val); hri_supc_set_VREF_VREFOE_bit(SUPC); @@ -332,7 +332,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { uint32_t* id_addresses[4] = {(uint32_t *) 0x0080A00C, (uint32_t *) 0x0080A040, (uint32_t *) 0x0080A044, (uint32_t *) 0x0080A048}; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X uint32_t* id_addresses[4] = {(uint32_t *) 0x008061FC, (uint32_t *) 0x00806010, (uint32_t *) 0x00806014, (uint32_t *) 0x00806018}; #endif diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 5c79f72a40..43c8575cb3 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -31,7 +31,10 @@ #include "supervisor/port.h" -#ifdef SAMD51 +#if defined(SAME54) +#include "hri/hri_cmcc_e54.h" +#include "hri/hri_nvmctrl_e54.h" +#elif defined(SAMD51) #include "hri/hri_cmcc_d51.h" #include "hri/hri_nvmctrl_d51.h" #endif @@ -53,7 +56,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #3; d2: sub r6, #1; bne d2;" // delay 3 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #3; d2: subs r6, #1; bne d2;" // delay 3 #endif " tst r4, r5;" // mask&r5 @@ -63,14 +66,14 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #6; d0: sub r6, #1; bne d0;" // delay 6 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #6; d0: subs r6, #1; bne d0;" // delay 6 #endif " str r1, [r0, #0];" // clr (possibly again, doesn't matter) #ifdef SAMD21 " asr r4, r4, #1;" // mask >>= 1 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " asrs r4, r4, #1;" // mask >>= 1 #endif " beq nextbyte;" @@ -78,7 +81,7 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa #ifdef SAMD21 " movs r6, #2; d1: sub r6, #1; bne d1;" // delay 2 #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X " movs r6, #2; d1: subs r6, #1; bne d1;" // delay 2 #endif " b loopBit;" @@ -108,7 +111,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, mp_hal_disable_all_interrupts(); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // When this routine is positioned at certain addresses, the timing logic // below can be too fast by about 2.5x. This is some kind of (un)fortunate code // positioning with respect to a cache line. @@ -135,7 +138,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, volatile uint32_t *clr = &(port->OUTCLR.reg); neopixel_send_buffer_core(clr, pinMask, pixels, numBytes); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Turn instruction, data, and NVM caches back on. hri_cmcc_clear_CFG_reg(CMCC, CMCC_CFG_DCDIS | CMCC_CFG_ICDIS); hri_nvmctrl_clear_CTRLA_CACHEDIS0_bit(NVMCTRL); diff --git a/ports/atmel-samd/common-hal/os/__init__.c b/ports/atmel-samd/common-hal/os/__init__.c index eeba29dfaf..c151b105a8 100644 --- a/ports/atmel-samd/common-hal/os/__init__.c +++ b/ports/atmel-samd/common-hal/os/__init__.c @@ -30,7 +30,7 @@ #include "py/objtuple.h" #include "py/qstr.h" -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #include "hal/include/hal_rand_sync.h" #endif @@ -42,7 +42,7 @@ STATIC const qstr os_uname_info_fields[] = { STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21"); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21"); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X STATIC const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51"); STATIC const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51"); #endif @@ -67,7 +67,7 @@ mp_obj_t common_hal_os_uname(void) { } bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_APBCMASK_TRNG_bit(MCLK); struct rand_sync_desc random; rand_sync_init(&random, TRNG); diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c index b627dadc54..752f6c214b 100644 --- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c @@ -55,7 +55,7 @@ uint8_t tcc_refcount[TCC_INST_NUM]; #ifdef SAMD21 uint8_t tcc_channels[3]; // Set by pwmout_reset() to {0xf0, 0xfc, 0xfc} initially. #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 0xfc} initially. #endif @@ -148,7 +148,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, if (pin->timer[0].index >= TC_INST_NUM && pin->timer[1].index >= TCC_INST_NUM -#ifdef SAMD51 +#ifdef SAM_D5X_E5X && pin->timer[2].index >= TCC_INST_NUM #endif ) { @@ -260,7 +260,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self, TC_CTRLA_WAVEGEN_MPWM; tc->COUNT16.CC[0].reg = top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLA.bit.SWRST = 1; while (tc->COUNT16.CTRLA.bit.SWRST == 1) { @@ -345,7 +345,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tc_insts[t->index]->COUNT16.CC[t->wave_output].reg = adjusted_duty; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X Tc* tc = tc_insts[t->index]; while (tc->COUNT16.SYNCBUSY.bit.CC1 != 0) {} tc->COUNT16.CCBUF[1].reg = adjusted_duty; @@ -366,7 +366,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tcc->CCB[channel].reg = adjusted_duty; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tcc->CCBUF[channel].reg = adjusted_duty; #endif tcc->CTRLBCLR.bit.LUPD = 1; @@ -396,7 +396,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) { cv = tcc->CC[channel].reg; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if ((tcc->STATUS.vec.CCBUFV & (1 << channel)) != 0) { cv = tcc->CCBUF[channel].reg; } else { @@ -444,7 +444,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tc->COUNT16.CC[0].reg = new_top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while (tc->COUNT16.SYNCBUSY.reg != 0) {} tc->COUNT16.CCBUF[0].reg = new_top; #endif @@ -461,7 +461,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, #ifdef SAMD21 tcc->PERB.bit.PERB = new_top; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tcc->PERBUF.bit.PERBUF = new_top; #endif } diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 508ee8d385..7ea20321b2 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -79,7 +79,7 @@ void pulsein_interrupt_handler(uint8_t channel) { // Grab the current time first. uint32_t current_overflow = overflow_count; Tc* tc = tc_insts[pulsein_tc_index]; - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_READSYNC; while (tc->COUNT16.SYNCBUSY.bit.COUNT == 1 || tc->COUNT16.CTRLBSET.bit.CMD == TC_CTRLBSET_CMD_READSYNC_Val) {} @@ -173,7 +173,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, // We use GCLK0 for SAMD21 which is 48MHz. We prescale it to 3MHz. turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // We use GCLK5 for SAMD51 because it runs at 2MHz and we can use it for a 1MHz clock, // 1us per tick. turn_on_clocks(true, index, 5); @@ -185,7 +185,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, TC_CTRLA_PRESCALER_DIV16 | TC_CTRLA_WAVEGEN_NFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV2; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index 8b8bc6dc68..5c829f84db 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -119,7 +119,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, #ifdef SAMD21 turn_on_clocks(true, index, 0); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X turn_on_clocks(true, index, 1); #endif @@ -129,7 +129,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, TC_CTRLA_PRESCALER_DIV64 | TC_CTRLA_WAVEGEN_NFRQ; #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X tc_reset(tc); tc_set_enable(tc, false); tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV64; diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 1aa305cd30..354097ce41 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -65,13 +65,17 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD51 +#ifdef SAM_D5X_E5X -// HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. +// HSRAM_SIZE is defined in the ASF4 include files for each SAM_D5X_E5X chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) #define CIRCUITPY_MCU_FAMILY samd51 +#ifdef SAMD51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" +#elif defined(SAME54) +#define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54" +#endif #define SPI_FLASH_MAX_BAUDRATE 24000000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) @@ -81,7 +85,7 @@ #define MICROPY_PY_UJSON (1) // MICROPY_PY_UERRNO_LIST - Use the default -#endif // SAMD51 +#endif // SAM_D5X_E5X //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -115,7 +119,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) @@ -137,7 +141,7 @@ #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif -#endif // SAMD51 +#endif // SAM_D5X_E5X //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ports/atmel-samd/mphalport.c b/ports/atmel-samd/mphalport.c index 23a9b43300..b497b89cd8 100644 --- a/ports/atmel-samd/mphalport.c +++ b/ports/atmel-samd/mphalport.c @@ -58,7 +58,7 @@ extern uint32_t common_hal_mcu_processor_get_frequency(void); #ifdef SAMD21 #define DELAY_LOOP_ITERATIONS_PER_US ( (10U*48000000U) / common_hal_mcu_processor_get_frequency()) #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X #define DELAY_LOOP_ITERATIONS_PER_US ( (30U*120000000U) / common_hal_mcu_processor_get_frequency()) #endif diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 6b531fc923..e4161d7d6d 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 6b531fc923d9f02b14bd731a5f584ddf716e8773 +Subproject commit e4161d7d6d98d78eddcccb82128856af4baf7e50 diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index 9c8ff990ed..091959c4e6 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -39,6 +39,12 @@ #ifdef SAMD21 #include "hpl/pm/hpl_pm_base.h" #endif +#ifdef SAME54 +#include "hri/hri_mclk_e54.h" +#endif +#ifdef SAMD51 +#include "hri/hri_mclk_d51.h" +#endif #include "hal/include/hal_flash.h" #include "supervisor/flash.h" @@ -57,7 +63,7 @@ void supervisor_flash_init(void) { port_pin_set_output_level(MICROPY_HW_LED_MSC, false); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_mclk_set_AHBMASK_NVMCTRL_bit(MCLK); #endif #ifdef SAMD21 diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 74c9849976..48bd3211b5 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -40,11 +40,14 @@ #include "hpl/gclk/hpl_gclk_base.h" #include "hpl/pm/hpl_pm_base.h" -#ifdef SAMD21 +#if defined(SAMD21) #include "hri/hri_pm_d21.h" -#endif -#ifdef SAMD51 +#elif defined(SAME54) +#include "hri/hri_rstc_e54.h" +#elif defined(SAMD51) #include "hri/hri_rstc_d51.h" +#else +#error Unknown chip family #endif #include "common-hal/analogio/AnalogIn.h" @@ -146,7 +149,7 @@ static void rtc_init(void) { RTC_MODE0_CTRL_MODE_COUNT32 | RTC_MODE0_CTRL_PRESCALER_DIV2; #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X hri_mclk_set_APBAMASK_RTC_bit(MCLK); RTC->MODE0.CTRLA.bit.SWRST = true; while (RTC->MODE0.SYNCBUSY.bit.SWRST != 0) {} @@ -169,7 +172,7 @@ static void rtc_init(void) { NVIC_SetPriority(USB_IRQn, 1); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X NVIC_SetPriority(USB_0_IRQn, 1); NVIC_SetPriority(USB_1_IRQn, 1); NVIC_SetPriority(USB_2_IRQn, 1); @@ -204,7 +207,7 @@ safe_mode_t port_init(void) { #endif #endif -#if defined(SAMD51) +#if defined(SAM_D5X_E5X) // Set brownout detection to ~2.7V. Default from factory is 1.7V, // which is too low for proper operation of external SPI flash chips (they are 2.7-3.6V). // Disable while changing level. @@ -283,7 +286,7 @@ safe_mode_t port_init(void) { return BROWNOUT; } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X if (RSTC->RCAUSE.bit.BODVDD == 1 || RSTC->RCAUSE.bit.BODCORE == 1) { return BROWNOUT; } @@ -341,7 +344,7 @@ void reset_port(void) { // Output clocks for debugging. // not supported by SAMD51G; uncomment for SAMD51J or update for 51G - // #ifdef SAMD51 + // #ifdef SAM_D5X_E5X // gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3 // gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4 // gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5 @@ -388,7 +391,7 @@ uint32_t *port_heap_get_top(void) { #ifdef SAMD21 uint32_t* safe_word = (uint32_t*) (HMCRAMC0_ADDR + HMCRAMC0_SIZE - 0x2000); #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X uint32_t* safe_word = (uint32_t*) (HSRAM_ADDR + HSRAM_SIZE - 0x2000); #endif @@ -412,7 +415,7 @@ void RTC_Handler(void) { // Our RTC is 32 bits and we're clocking it at 16.384khz which is 16 (2 ** 4) subticks per // tick. overflowed_ticks += (1L<< (32 - 4)); - #ifdef SAMD51 + #ifdef SAM_D5X_E5X } else if (intflag & RTC_MODE0_INTFLAG_PER2) { RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_PER2; // Do things common to all ports when the tick occurs @@ -431,14 +434,14 @@ void RTC_Handler(void) { } } #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; #endif } } static uint32_t _get_count(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} #endif #ifdef SAMD21 @@ -459,7 +462,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // PER2 will generate an interrupt every 32 ticks of the source 32.768 clock. RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif @@ -471,7 +474,7 @@ void port_enable_tick(void) { // Disable 1/1024 second tick. void port_disable_tick(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; #endif #ifdef SAMD21 @@ -492,7 +495,7 @@ void port_interrupt_after_ticks(uint32_t ticks) { } void port_sleep_until_interrupt(void) { - #ifdef SAMD51 + #ifdef SAM_D5X_E5X // Clear the FPU interrupt because it can prevent us from sleeping. if (__get_FPSCR() & ~(0x9f)) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); diff --git a/ports/atmel-samd/supervisor/same54_cpu.s b/ports/atmel-samd/supervisor/same54_cpu.s new file mode 100755 index 0000000000..9e6807a5e2 --- /dev/null +++ b/ports/atmel-samd/supervisor/same54_cpu.s @@ -0,0 +1,27 @@ +.syntax unified +.cpu cortex-m4 +.thumb +.text +.align 2 + +@ uint cpu_get_regs_and_sp(r0=uint regs[10]) +.global cpu_get_regs_and_sp +.thumb +.thumb_func +.type cpu_get_regs_and_sp, %function +cpu_get_regs_and_sp: +@ store registers into given array +str r4, [r0], #4 +str r5, [r0], #4 +str r6, [r0], #4 +str r7, [r0], #4 +str r8, [r0], #4 +str r9, [r0], #4 +str r10, [r0], #4 +str r11, [r0], #4 +str r12, [r0], #4 +str r13, [r0], #4 + +@ return the sp +mov r0, sp +bx lr diff --git a/ports/atmel-samd/supervisor/usb.c b/ports/atmel-samd/supervisor/usb.c index b8a94790d7..650ed6a397 100644 --- a/ports/atmel-samd/supervisor/usb.c +++ b/ports/atmel-samd/supervisor/usb.c @@ -37,7 +37,7 @@ void init_usb_hardware(void) { _gclk_enable_channel(USB_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK0_Val); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X hri_gclk_write_PCHCTRL_reg(GCLK, USB_GCLK_ID, GCLK_PCHCTRL_GEN_GCLK1_Val | GCLK_PCHCTRL_CHEN); hri_mclk_set_AHBMASK_USB_bit(MCLK); hri_mclk_set_APBBMASK_USB_bit(MCLK); @@ -53,7 +53,7 @@ void init_usb_hardware(void) { gpio_set_pin_function(PIN_PA24, PINMUX_PA24G_USB_DM); gpio_set_pin_function(PIN_PA25, PINMUX_PA25G_USB_DP); #endif - #ifdef SAMD51 + #ifdef SAM_D5X_E5X gpio_set_pin_function(PIN_PA24, PINMUX_PA24H_USB_DM); gpio_set_pin_function(PIN_PA25, PINMUX_PA25H_USB_DP); #endif @@ -65,7 +65,7 @@ void USB_Handler(void) { } #endif -#ifdef SAMD51 +#ifdef SAM_D5X_E5X void USB_0_Handler (void) { tud_int_handler(0); } From d5074220a8e80fb1cd6292b2159eecc3d4599d48 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 18 Jun 2020 14:16:57 -0500 Subject: [PATCH 827/919] atmel-samd: Add SAM E54 Xplained board Few peripherals are actually tested. However, USB, I2C and GPIO seem to work. Most pins are silkscreened with the "PX00" style, so the board module only includes the small number that are screened differently. The default SPI, I2C, and UART are the ones on the EXT2 header. This is arbitrary, but the I2C on this connector is shared with the on-board I2C devices and the PCC header, making it the most versatile. --- .github/workflows/build.yml | 1 + .../atmel-samd/boards/same54_xplained/board.c | 39 ++++++++ .../boards/same54_xplained/mpconfigboard.h | 33 +++++++ .../boards/same54_xplained/mpconfigboard.mk | 13 +++ .../atmel-samd/boards/same54_xplained/pins.c | 99 +++++++++++++++++++ supervisor/shared/external_flash/devices.h | 19 ++++ 6 files changed, 204 insertions(+) create mode 100644 ports/atmel-samd/boards/same54_xplained/board.c create mode 100644 ports/atmel-samd/boards/same54_xplained/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/same54_xplained/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9945024d24..fd357e78ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,7 @@ jobs: - "pyruler" - "robohatmm1_m4" - "sam32" + - "same54_xplained" - "seeeduino_xiao" - "serpente" - "shirtty" diff --git a/ports/atmel-samd/boards/same54_xplained/board.c b/ports/atmel-samd/boards/same54_xplained/board.c new file mode 100644 index 0000000000..7599f02b8e --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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 "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h new file mode 100644 index 0000000000..934559a2a4 --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.h @@ -0,0 +1,33 @@ +#define MICROPY_HW_BOARD_NAME "SAM E54 Xplained Pro" +#define MICROPY_HW_MCU_NAME "same54p20" + +#define CIRCUITPY_MCU_FAMILY samd51 + +// This is for Rev B which is green and has the SD card slot at the edge of the board. + +#define MICROPY_HW_LED_STATUS (&pin_PC18) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A ( PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11 ) +// QSPI CS, and QSPI SCK +#define MICROPY_PORT_B ( PORT_PB10 | PORT_PB11 ) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PD09) +#define DEFAULT_I2C_BUS_SDA (&pin_PD08) + +#define DEFAULT_SPI_BUS_SCK (&pin_PC05) +#define DEFAULT_SPI_BUS_MOSI (&pin_PC04) +#define DEFAULT_SPI_BUS_MISO (&pin_PC07) + +#define DEFAULT_UART_BUS_RX (&pin_PB17) +#define DEFAULT_UART_BUS_TX (&pin_PB16) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PC19 1 diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk new file mode 100644 index 0000000000..ffc4f567f9 --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x239A +USB_PID = 0x80B6 +USB_PRODUCT = "SAM E54 Xplained Pro" +USB_MANUFACTURER = "Microchip" + +CHIP_VARIANT = SAME54P20A +CHIP_FAMILY = same54 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 2 +EXTERNAL_FLASH_DEVICES = "N25Q256A" +LONGINT_IMPL = MPZ +LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c new file mode 100644 index 0000000000..5b9373724e --- /dev/null +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -0,0 +1,99 @@ +#include "shared-bindings/board/__init__.h" + +// This mapping only includes functional names because pins broken +// out on connectors are labeled with their MCU name available from +// microcontroller.pin. +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_VSYNC), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_HSYNC), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PCLK), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_XCLK), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D07), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D06), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D05), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D04), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D03), MP_ROM_PTR(&pin_PA19) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D02), MP_ROM_PTR(&pin_PA18) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D01), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D00), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D09), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D08), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RST), MP_ROM_PTR(&pin_PC12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PWDN), MP_ROM_PTR(&pin_PC11) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_A), MP_ROM_PTR(&pin_PC16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_B), MP_ROM_PTR(&pin_PC17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PDEC_C), MP_ROM_PTR(&pin_PC18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_ADCDAC), MP_ROM_PTR(&pin_PA02) }, + + + { MP_OBJ_NEW_QSTR(MP_QSTR_SW0), MP_ROM_PTR(&pin_PB31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC18) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_QT), MP_ROM_PTR(&pin_PA16) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_CANRX), MP_ROM_PTR(&pin_PB12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_CANTX), MP_ROM_PTR(&pin_PB13) }, + + // EXT1 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA27), MP_ROM_PTR(&pin_PA27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA23), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB28), MP_ROM_PTR(&pin_PB28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB27), MP_ROM_PTR(&pin_PB27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB29), MP_ROM_PTR(&pin_PB29) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB26), MP_ROM_PTR(&pin_PB26) }, + + // EXT2 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB17), MP_ROM_PTR(&pin_PB17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PB16), MP_ROM_PTR(&pin_PB16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + + // EXT3 header + { MP_OBJ_NEW_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC31), MP_ROM_PTR(&pin_PC31) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC30), MP_ROM_PTR(&pin_PC30) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC22), MP_ROM_PTR(&pin_PC22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC23), MP_ROM_PTR(&pin_PC23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC14), MP_ROM_PTR(&pin_PC14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h index 466ab49eb8..a874dbd4fd 100644 --- a/supervisor/shared/external_flash/devices.h +++ b/supervisor/shared/external_flash/devices.h @@ -618,4 +618,23 @@ typedef struct { .write_status_register_split = false, \ .single_status_byte = true, \ } + +// Settings for the Micron N25Q256A 256Mb (32MiB) QSPI flash. +// Datasheet: https://www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/n25q/n25q_256mb_3v.pdf +#define N25Q256A {\ + /* .total_size = (1 << 25), 32 MiB does not work at this time, as assumptions about 3-byte addresses abound */ \ + .total_size = (1 << 24), /* 16 MiB */ \ + .start_up_time_us = 10000, \ + .manufacturer_id = 0x20, \ + .memory_type = 0xBA, \ + .capacity = 0x19, \ + .max_clock_speed_mhz = 108, \ + .quad_enable_bit_mask = 0x02, \ + .has_sector_protection = false, \ + .supports_fast_read = true, \ + .supports_qspi = true, \ + .supports_qspi_writes = true, \ + .write_status_register_split = false, \ + .single_status_byte = true, \ +} #endif // MICROPY_INCLUDED_ATMEL_SAMD_EXTERNAL_FLASH_DEVICES_H From 38659b566c5cd4c9be1a8340bdd801f394ce7084 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:56:27 -0500 Subject: [PATCH 828/919] atmel-samd: Finish disabling USB MIDI and/or HID on certain boards --- ports/atmel-samd/boards/8086_commander/mpconfigboard.mk | 1 + ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 ++ .../boards/winterbloom_big_honking_button/mpconfigboard.mk | 1 + ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 ++ 5 files changed, 8 insertions(+) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index dcc62fc9bc..8f8f508ea4 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ" LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 +CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 7305abf73a..1ad2553a31 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,3 +24,5 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 + +USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..2ccaa9bdbd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,3 +39,5 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif + +USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 466e345911..d2477e9fdc 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -31,4 +31,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 9309fdce0d..372b1f4912 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,3 +28,5 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD + +USB_DEVICES="CDC,MSC,HID" From 458eef052e732a5c8385d30c966b4c59cde2b15a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:25 -0500 Subject: [PATCH 829/919] esp32s2: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/esp32s2/mpconfigport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c9df81db03..040022052c 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -30,8 +30,8 @@ CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 -# Enable USB support +# Enable USB HID support CIRCUITPY_USB_HID = 1 -CIRCUITPY_USB_MIDI = 1 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_MODULE ?= none From 3f112d28e3ef4ba15e8e0829abbbba6e411977f9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 10:57:32 -0500 Subject: [PATCH 830/919] mimxrt10xx: Disable USB MIDI .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/mimxrt10xx/mpconfigport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index e9e554142c..8162d43279 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -27,4 +27,5 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 +CIRCUITPY_USB_MIDI = 0 LONGINT_IMPL = MPZ From 0110463811869e187556e5ed8033c280a7199aa5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:01:08 -0500 Subject: [PATCH 831/919] stm: Disable USB MIDI and most USB HID .. it was not in the USB descriptors anyway (lack of enough endpoints?) --- ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk | 2 ++ ports/stm/mpconfigport.mk | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index 04d2a9b0d0..a2a322dfab 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -17,3 +17,5 @@ MCU_PACKAGE = LQFP144 LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F412_fs.ld + +CIRCUITPY_USB_HID = 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 0c5247d952..09db525bd8 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -21,6 +21,8 @@ ifeq ($(MCU_SERIES),F4) ifndef CIRCUITPY_NVM CIRCUITPY_NVM = 0 endif + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) @@ -36,6 +38,8 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),F7) @@ -50,4 +54,6 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_USB_HID ?= 0 endif From 93d3629da279ae080cdfa616d54451150b373697 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 11:02:38 -0500 Subject: [PATCH 832/919] stm: Sort configuration options and make them all conditional This makes them all overridable on the board level, tersely --- ports/stm/mpconfigport.mk | 77 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 09db525bd8..7b720d1564 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -1,59 +1,56 @@ -MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz -LONGINT_IMPL = MPZ -INTERNAL_LIBM = 1 -USB_SERIAL_NUMBER_LENGTH = 24 +MPY_TOOL_LONGINT_IMPL ?= -mlongint-impl=mpz +LONGINT_IMPL ?= MPZ +INTERNAL_LIBM ?= 1 +USB_SERIAL_NUMBER_LENGTH ?= 24 ifeq ($(MCU_VARIANT),STM32F405xx) - CIRCUITPY_FRAMEBUFFERIO = 1 - CIRCUITPY_RGBMATRIX = 1 + CIRCUITPY_FRAMEBUFFERIO ?= 1 + CIRCUITPY_RGBMATRIX ?= 1 endif ifeq ($(MCU_SERIES),F4) # Not yet implemented common-hal modules: - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - # Can be overridden on board level - ifndef CIRCUITPY_NVM - CIRCUITPY_NVM = 0 - endif + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_MIDI ?= 0 CIRCUITPY_USB_HID ?= 0 endif ifeq ($(MCU_SERIES),H7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_PULSEIO = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_PULSEIO ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif ifeq ($(MCU_SERIES),F7) # Not yet implemented common-hal modules: - CIRCUITPY_ANALOGIO = 0 - CIRCUITPY_NEOPIXEL_WRITE = 0 - CIRCUITPY_NVM = 0 - CIRCUITPY_AUDIOBUSIO = 0 - CIRCUITPY_AUDIOIO = 0 - CIRCUITPY_ROTARYIO = 0 - CIRCUITPY_COUNTIO = 0 - CIRCUITPY_RTC = 0 - CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 - CIRCUITPY_USB_MIDI ?= 0 + CIRCUITPY_ANALOGIO ?= 0 + CIRCUITPY_AUDIOBUSIO ?= 0 + CIRCUITPY_AUDIOIO ?= 0 + CIRCUITPY_COUNTIO ?= 0 + CIRCUITPY_FREQUENCYIO ?= 0 + CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_NEOPIXEL_WRITE ?= 0 + CIRCUITPY_NVM ?= 0 + CIRCUITPY_ROTARYIO ?= 0 + CIRCUITPY_RTC ?= 0 CIRCUITPY_USB_HID ?= 0 + CIRCUITPY_USB_MIDI ?= 0 endif From b80abf1a90b515fff1503b75358e629fb248660c Mon Sep 17 00:00:00 2001 From: DavePutz Date: Tue, 23 Jun 2020 12:15:01 -0500 Subject: [PATCH 833/919] Update handing of a CTRL-C exception --- supervisor/shared/tick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 106ff53f89..dd7dba8f3e 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -106,7 +106,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { { // clear exception and generate stacktrace MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; - nlr_raise(mp_obj_new_exception(&mp_type_KeyboardInterrupt)); + nlr_raise(&MP_STATE_VM(mp_kbd_exception)); } if( MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception)) || WATCHDOG_EXCEPTION_CHECK()) { From f232aef7865c4e094f060f9766418f60fb9f86ea Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 19:12:04 -0500 Subject: [PATCH 834/919] supervisor.mk: Compute USB_DEVICES; remove from boards and ports Since Actions passed on the previous commit, where this computed value was checked against the specified value (if any), this is no net change, except that we no longer need to specify it for particular boards or ports. --- .../boards/8086_commander/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/ugame10/mpconfigboard.mk | 2 -- .../winterbloom_big_honking_button/mpconfigboard.mk | 1 - .../boards/winterbloom_sol/mpconfigboard.mk | 1 - .../atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 2 -- ports/cxd56/mpconfigport.mk | 1 - .../boards/espressif_saola_1_wroom/mpconfigboard.mk | 1 - .../boards/espressif_saola_1_wrover/mpconfigboard.mk | 1 - ports/litex/boards/fomu/mpconfigboard.mk | 1 - ports/mimxrt10xx/mpconfigport.mk | 1 - ports/stm/boards/espruino_pico/mpconfigboard.mk | 1 - ports/stm/boards/espruino_wifi/mpconfigboard.mk | 1 - .../feather_stm32f405_express/mpconfigboard.mk | 1 - ports/stm/boards/meowbit_v121/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f746zg/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_f767zi/mpconfigboard.mk | 1 - ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk | 1 - ports/stm/boards/openmv_h7/mpconfigboard.mk | 1 - ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 1 - ports/stm/boards/pyboard_v11/mpconfigboard.mk | 1 - .../boards/stm32f411ce_blackpill/mpconfigboard.mk | 1 - .../boards/stm32f411ve_discovery/mpconfigboard.mk | 1 - .../boards/stm32f412zg_discovery/mpconfigboard.mk | 1 - ports/stm/boards/stm32f4_discovery/mpconfigboard.mk | 1 - .../stm/boards/stm32f746g_discovery/mpconfigboard.mk | 1 - ports/stm/boards/thunderpack/mpconfigboard.mk | 1 - supervisor/supervisor.mk | 12 +----------- 29 files changed, 1 insertion(+), 44 deletions(-) diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 8f8f508ea4..4b0377be25 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -3,8 +3,6 @@ USB_PID = 0x0101 USB_PRODUCT = "Commander" USB_MANUFACTURER = "8086 Consultancy" -USB_DEVICES= "CDC,MSC,HID" - CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index 1ad2553a31..7305abf73a 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,5 +24,3 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x CFLAGS_BOARD = --param max-inline-insns-auto=15 - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 87f92ae9ec..864d31909d 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -46,8 +46,6 @@ CIRCUITPY_MATH = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf -USB_DEVICES = "CDC,MSC" - # Tweak inlining depending on language. ifeq ($(TRANSLATION), zh_Latn_pinyin) CFLAGS_INLINE_LIMIT = 45 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 2ccaa9bdbd..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -39,5 +39,3 @@ CFLAGS_INLINE_LIMIT = 45 else CFLAGS_INLINE_LIMIT = 70 endif - -USB_DEVICES="CDC,MSC" diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index d2477e9fdc..de9b617649 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -4,7 +4,6 @@ USB_VID = 0x239A USB_PID = 0x6005 USB_PRODUCT = "Big Honking Button" USB_MANUFACTURER = "Winterbloom" -USB_DEVICES = "CDC,MSC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 6a78a4ff99..e96497b3e5 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -6,7 +6,6 @@ USB_PID = 0x8062 USB_PRODUCT = "Sol" USB_MANUFACTURER = "Winterbloom" USB_INTERFACE_NAME = "Sol" -USB_DEVICES = "CDC,MSC,AUDIO" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index 372b1f4912..9309fdce0d 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -28,5 +28,3 @@ CIRCUITPY_COUNTIO=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD - -USB_DEVICES="CDC,MSC,HID" diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 5894b9b73b..d91458aca3 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -1,5 +1,4 @@ USB_SERIAL_NUMBER_LENGTH = 10 -USB_DEVICES = "CDC,MSC" USB_MSC_MAX_PACKET_SIZE = 512 USB_RENUMBER_ENDPOINTS = 0 USB_CDC_EP_NUM_NOTIFICATION = 3 diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index cd27356153..d9ad568863 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A8 USB_PRODUCT = "Saola 1 w/WROOM" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 0b847de943..558b1144a9 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A6 USB_PRODUCT = "Saola 1 w/WROVER" USB_MANUFACTURER = "Espressif" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/litex/boards/fomu/mpconfigboard.mk b/ports/litex/boards/fomu/mpconfigboard.mk index 4787803ccd..c8de94e9c0 100644 --- a/ports/litex/boards/fomu/mpconfigboard.mk +++ b/ports/litex/boards/fomu/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x1209 USB_PID = 0x5BF0 USB_PRODUCT = "Fomu" USB_MANUFACTURER = "Foosn" -USB_DEVICES = "CDC,MSC,AUDIO,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 8162d43279..49d9985083 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -14,7 +14,6 @@ endif INTERNAL_LIBM = 1 -USB_DEVICES = "CDC,MSC,HID" USB_SERIAL_NUMBER_LENGTH = 32 USB_MSC_MAX_PACKET_SIZE = 512 diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 054937c33e..201237c9d6 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808E USB_PRODUCT = "Espruino Pico" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/espruino_wifi/mpconfigboard.mk b/ports/stm/boards/espruino_wifi/mpconfigboard.mk index ee82095ffd..9500a5f185 100644 --- a/ports/stm/boards/espruino_wifi/mpconfigboard.mk +++ b/ports/stm/boards/espruino_wifi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8090 USB_PRODUCT = "Espruino Wifi" USB_MANUFACTURER = "Espruino" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk index d98bd29ec7..2b2c0d6db5 100644 --- a/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk +++ b/ports/stm/boards/feather_stm32f405_express/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Feather STM32F405 Express" USB_MANUFACTURER = "Adafruit Industries LLC" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index cf60c89c26..127cdb60e2 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805A USB_PRODUCT = "Meowbit" USB_MANUFACTURER = "Kittenbot" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk index 651f3c2292..1c8edecc35 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809E USB_PRODUCT = "Nucleo F746zg - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk index c5d956b994..0c712a0f48 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809A USB_PRODUCT = "Nucleo F767ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk index ea99a1e10b..35f47e1931 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8098 USB_PRODUCT = "Nucleo H743ZI - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.mk b/ports/stm/boards/openmv_h7/mpconfigboard.mk index 4ff0f18d54..a837dc9ec7 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.mk +++ b/ports/stm/boards/openmv_h7/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x80A4 USB_PRODUCT = "OpenMV-H7 R1" USB_MANUFACTURER = "OpenMV, LLC" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 08a2668167..237dba921e 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8068 USB_PRODUCT = "PYB LR Nano V2" USB_MANUFACTURER = "MicroPython Chinese Community" -USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/pyboard_v11/mpconfigboard.mk b/ports/stm/boards/pyboard_v11/mpconfigboard.mk index c0c0f5f6cd..78b96e55fc 100644 --- a/ports/stm/boards/pyboard_v11/mpconfigboard.mk +++ b/ports/stm/boards/pyboard_v11/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805C USB_PRODUCT = "Pyboard Version 1.1" USB_MANUFACTURER = "George Robotic" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index 0054232e1d..9b45a0fac7 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "stm32f411ce blackpill" USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC,MSC" # SPI_FLASH_FILESYSTEM = 1 # EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index ca2f10ba37..3cb7162a4a 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x805E USB_PRODUCT = "STM32F411VE Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk index a2a322dfab..c99eb1a008 100644 --- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x8056 USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk index 09652d9ad9..7eece58968 100644 --- a/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f4_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x808A USB_PRODUCT = "STM32F407VG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk index 94a50853cb..c1c754ab5b 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x809C USB_PRODUCT = "ST STM32F746G Discovery - CPy" USB_MANUFACTURER = "STMicroelectronics" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/stm/boards/thunderpack/mpconfigboard.mk b/ports/stm/boards/thunderpack/mpconfigboard.mk index 007b00cdd1..afd0ffd751 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack/mpconfigboard.mk @@ -2,7 +2,6 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "Thunderpack STM32F411" USB_MANUFACTURER = "Jeremy Gillick" -USB_DEVICES = "CDC,MSC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 7eb7e26305..0717785e7f 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -115,10 +115,6 @@ ifndef USB_INTERFACE_NAME USB_INTERFACE_NAME = "CircuitPython" endif -ifndef USB_DEVICES -USB_DEVICES = "CDC,MSC,AUDIO,HID" -endif - USB_DEVICES_COMPUTED := CDC,MSC ifeq ($(CIRCUITPY_USB_MIDI),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO @@ -126,18 +122,12 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES_COMPUTED := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES := "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" endif -# During a transitional period, check that the COMPUTED values match. -# Once they do all match, we can remove all the hard-coded ones. -ifneq ($(USB_DEVICES),$(USB_DEVICES_COMPUTED)) -$(error Computed USB devices '$(USB_DEVICES_COMPUTED)' different than hard-coded USB devices '$(USB_DEVICES)') -endif - ifndef USB_MSC_MAX_PACKET_SIZE USB_MSC_MAX_PACKET_SIZE = 64 endif From 84f424f6310bd9315d2dc002ff59b1802bcc1e8b Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 16 Jun 2020 20:39:56 +0200 Subject: [PATCH 835/919] gnss: Implement new library for GNSS --- py/circuitpy_defns.mk | 7 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/gnss/GNSS.c | 245 +++++++++++++++++++++++++ shared-bindings/gnss/GNSS.h | 50 +++++ shared-bindings/gnss/PositionFix.c | 108 +++++++++++ shared-bindings/gnss/PositionFix.h | 50 +++++ shared-bindings/gnss/SatelliteSystem.c | 145 +++++++++++++++ shared-bindings/gnss/SatelliteSystem.h | 55 ++++++ shared-bindings/gnss/__init__.c | 53 ++++++ 10 files changed, 724 insertions(+) create mode 100644 shared-bindings/gnss/GNSS.c create mode 100644 shared-bindings/gnss/GNSS.h create mode 100644 shared-bindings/gnss/PositionFix.c create mode 100644 shared-bindings/gnss/PositionFix.h create mode 100644 shared-bindings/gnss/SatelliteSystem.c create mode 100644 shared-bindings/gnss/SatelliteSystem.h create mode 100644 shared-bindings/gnss/__init__.c diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index fb8f46bd87..95824be1e8 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -162,6 +162,9 @@ endif ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) SRC_PATTERNS += gamepadshift/% endif +ifeq ($(CIRCUITPY_GNSS),1) +SRC_PATTERNS += gnss/% +endif ifeq ($(CIRCUITPY_I2CSLAVE),1) SRC_PATTERNS += i2cslave/% endif @@ -283,6 +286,10 @@ SRC_COMMON_HAL_ALL = \ displayio/ParallelBus.c \ frequencyio/FrequencyIn.c \ frequencyio/__init__.c \ + gnss/__init__.c \ + gnss/GNSS.c \ + gnss/PositionFix.c \ + gnss/SatelliteSystem.c \ i2cslave/I2CSlave.c \ i2cslave/__init__.c \ microcontroller/Pin.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3fbb469000..4b054b83ce 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -401,6 +401,13 @@ extern const struct _mp_obj_module_t gamepadshift_module; #define GAMEPAD_ROOT_POINTERS #endif +#if CIRCUITPY_GNSS +extern const struct _mp_obj_module_t gnss_module; +#define GNSS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gnss), (mp_obj_t)&gnss_module }, +#else +#define GNSS_MODULE +#endif + #if CIRCUITPY_I2CSLAVE extern const struct _mp_obj_module_t i2cslave_module; #define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, @@ -682,6 +689,7 @@ extern const struct _mp_obj_module_t watchdog_module; FREQUENCYIO_MODULE \ GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ + GNSS_MODULE \ I2CSLAVE_MODULE \ JSON_MODULE \ MATH_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 865654a0d5..ac7d2ec305 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -109,6 +109,9 @@ CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) CIRCUITPY_GAMEPADSHIFT ?= 0 CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) +CIRCUITPY_GNSS ?= 0 +CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) + CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c new file mode 100644 index 0000000000..37c25cf849 --- /dev/null +++ b/shared-bindings/gnss/GNSS.c @@ -0,0 +1,245 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/util.h" + +#include "py/objproperty.h" +#include "py/runtime.h" + +//| class GNSS: +//| """Get updated positioning information from GNSS +//| +//| Usage:: +//| +//| import gnss +//| import time +//| +//| gps = gnss.GNSS() +//| gps.select(gnss.SatelliteSystem.GPS) +//| gps.start() +//| last_print = time.monotonic() +//| while True: +//| gps.update() +//| current = time.monotonic() +//| if current - last_print >= 1.0: +//| last_print = current +//| if gps.fix is gnss.PositionFix.INVALID: +//| print("Waiting for fix...") +//| continue +//| print("Latitude: {0:.6f} degrees".format(gps.latitude)) +//| print("Longitude: {0:.6f} degrees".format(gps.longitude))""" +//| + +//| def __init__(self, ): +//| """Turn on the GNSS.""" +//| ... +//| +STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + gnss_obj_t *self = m_new_obj(gnss_obj_t); + self->base.type = &gnss_type; + + common_hal_gnss_construct(self); + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self, ) -> Any: +//| """Turn off the GNSS.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_deinit(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_gnss_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_deinit_obj, gnss_obj_deinit); + +STATIC void check_for_deinit(gnss_obj_t *self) { + if (common_hal_gnss_deinited(self)) { + raise_deinited_error(); + } +} + +//| def select(self, system: gnss.SatelliteSystem) -> Any: +//| """Add specified satellite system to selection for positioning. +//| +//| :param gnss.SatelliteSystem system: satellite system to use""" +//| ... +//| +STATIC mp_obj_t gnss_obj_select(mp_obj_t self_in, mp_obj_t system_obj) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); + common_hal_gnss_select(self, system); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_select_obj, gnss_obj_select); + +//| def deselect(self, system: gnss.SatelliteSystem) -> Any: +//| """Remove specified satellite system from selection for positioning. +//| +//| :param gnss.SatelliteSystem system: satellite system to remove""" +//| ... +//| +STATIC mp_obj_t gnss_obj_deselect(mp_obj_t self_in, mp_obj_t system_obj) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); + common_hal_gnss_deselect(self, system); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_deselect_obj, gnss_obj_deselect); + +//| def start(self, ) -> Any: +//| """Start positioning.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_start(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_start(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_start_obj, gnss_obj_start); + +//| def stop(self, ) -> Any: +//| """Stop positioning.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_stop(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_stop(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_stop_obj, gnss_obj_stop); + +//| def update(self, ) -> Any: +//| """Update GNSS positioning information.""" +//| ... +//| +STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_gnss_update(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); + +//| latitude: Any = ... +//| """Latitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_latitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude); + +const mp_obj_property_t gnss_latitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_latitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| longitude: Any = ... +//| """Longitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_longitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude); + +const mp_obj_property_t gnss_longitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_longitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| altitude: Any = ... +//| """Altitude of current position.""" +//| +STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_gnss_get_altitude(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude); + +const mp_obj_property_t gnss_altitude_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_altitude_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| fix: Any = ... +//| """Fix mode.""" +//| +STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return gnss_positionfix_type_to_obj(common_hal_gnss_get_fix(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix); + +const mp_obj_property_t gnss_fix_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_fix_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&gnss_select_obj) }, + { MP_ROM_QSTR(MP_QSTR_deselect), MP_ROM_PTR(&gnss_deselect_obj) }, + { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&gnss_start_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&gnss_stop_obj) }, + { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, + + { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } +}; +STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); + +const mp_obj_type_t gnss_type = { + { &mp_type_type }, + .name = MP_QSTR_GNSS, + .make_new = gnss_make_new, + .locals_dict = (mp_obj_dict_t*)&gnss_locals_dict, +}; diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h new file mode 100644 index 0000000000..953eb9ce31 --- /dev/null +++ b/shared-bindings/gnss/GNSS.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H + +#include "common-hal/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" + +extern const mp_obj_type_t gnss_type; + +void common_hal_gnss_construct(gnss_obj_t *self); +void common_hal_gnss_deinit(gnss_obj_t *self); +bool common_hal_gnss_deinited(gnss_obj_t *self); +void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system); +void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system); +void common_hal_gnss_start(gnss_obj_t *self); +void common_hal_gnss_stop(gnss_obj_t *self); +void common_hal_gnss_update(gnss_obj_t *self); + +mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); +mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); +gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H diff --git a/shared-bindings/gnss/PositionFix.c b/shared-bindings/gnss/PositionFix.c new file mode 100644 index 0000000000..106a28c347 --- /dev/null +++ b/shared-bindings/gnss/PositionFix.c @@ -0,0 +1,108 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/gnss/PositionFix.h" + +//| class PositionFix: +//| """Position fix mode""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the position fix mode.""" +//| +//| INVALID: Any = ... +//| """No measurement. +//| +//| :type gnss.PositionFix:""" +//| +//| FIX_2D: Any = ... +//| """2D fix. +//| +//| :type gnss.PositionFix:""" +//| +//| FIX_3D: Any = ... +//| """3D fix. +//| +//| :type gnss.PositionFix:""" +//| +const mp_obj_type_t gnss_positionfix_type; + +const gnss_positionfix_obj_t gnss_positionfix_invalid_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj = { + { &gnss_positionfix_type }, +}; + +const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj = { + { &gnss_positionfix_type }, +}; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj) { + gnss_positionfix_t posfix = POSITIONFIX_INVALID; + if (obj == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = POSITIONFIX_2D; + } else if (obj == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = POSITIONFIX_3D; + } + return posfix; +} + +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t posfix) { + switch (posfix) { + case POSITIONFIX_2D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix2d_obj); + case POSITIONFIX_3D: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_fix3d_obj); + case POSITIONFIX_INVALID: + default: + return (mp_obj_t)MP_ROM_PTR(&gnss_positionfix_invalid_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_positionfix_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_INVALID), MP_ROM_PTR(&gnss_positionfix_invalid_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_2D), MP_ROM_PTR(&gnss_positionfix_fix2d_obj)}, + {MP_ROM_QSTR(MP_QSTR_FIX_3D), MP_ROM_PTR(&gnss_positionfix_fix3d_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_positionfix_locals_dict, gnss_positionfix_locals_dict_table); + +STATIC void gnss_positionfix_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr posfix = MP_QSTR_INVALID; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix2d_obj)) { + posfix = MP_QSTR_FIX_2D; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_positionfix_fix3d_obj)) { + posfix = MP_QSTR_FIX_3D; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_PositionFix, posfix); +} + +const mp_obj_type_t gnss_positionfix_type = { + { &mp_type_type }, + .name = MP_QSTR_PositionFix, + .print = gnss_positionfix_print, + .locals_dict = (mp_obj_t)&gnss_positionfix_locals_dict, +}; diff --git a/shared-bindings/gnss/PositionFix.h b/shared-bindings/gnss/PositionFix.h new file mode 100644 index 0000000000..64497cb59b --- /dev/null +++ b/shared-bindings/gnss/PositionFix.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H + +#include "py/obj.h" + +typedef enum { + POSITIONFIX_INVALID, + POSITIONFIX_2D, + POSITIONFIX_3D, +} gnss_positionfix_t; + +const mp_obj_type_t gnss_positionfix_type; + +gnss_positionfix_t gnss_positionfix_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_positionfix_type_to_obj(gnss_positionfix_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_positionfix_obj_t; +extern const gnss_positionfix_obj_t gnss_positionfix_invalid_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix2d_obj; +extern const gnss_positionfix_obj_t gnss_positionfix_fix3d_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_POSITIONFIX_H diff --git a/shared-bindings/gnss/SatelliteSystem.c b/shared-bindings/gnss/SatelliteSystem.c new file mode 100644 index 0000000000..badc02b964 --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem.c @@ -0,0 +1,145 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/gnss/SatelliteSystem.h" + +//| class SatelliteSystem: +//| """Satellite system type""" +//| +//| def __init__(self, ): +//| """Enum-like class to define the satellite system type.""" +//| +//| GPS: Any = ... +//| """Global Positioning System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| GLONASS: Any = ... +//| """GLObal NAvigation Satellite System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| SBAS: Any = ... +//| """Satellite Based Augmentation System. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| QZSS_L1CA: Any = ... +//| """Quasi-Zenith Satellite System L1C/A. +//| +//| :type gnss.SatelliteSystem:""" +//| +//| QZSS_L1S: Any = ... +//| """Quasi-Zenith Satellite System L1S. +//| +//| :type gnss.SatelliteSystem:""" +//| +const mp_obj_type_t gnss_satellitesystem_type; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj = { + { &gnss_satellitesystem_type }, +}; + +const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj = { + { &gnss_satellitesystem_type }, +}; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj) { + if (obj == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + return SATELLITESYSTEM_GPS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + return SATELLITESYSTEM_GLONASS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + return SATELLITESYSTEM_SBAS; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + return SATELLITESYSTEM_QZSS_L1CA; + } else if (obj == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + return SATELLITESYSTEM_QZSS_L1S; + } + return SATELLITESYSTEM_NONE; +} + +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t system) { + switch (system) { + case SATELLITESYSTEM_GPS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_gps_obj); + case SATELLITESYSTEM_GLONASS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_glonass_obj); + case SATELLITESYSTEM_SBAS: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_sbas_obj); + case SATELLITESYSTEM_QZSS_L1CA: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj); + case SATELLITESYSTEM_QZSS_L1S: + return (mp_obj_t)MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj); + case SATELLITESYSTEM_NONE: + default: + return (mp_obj_t)MP_ROM_PTR(&mp_const_none_obj); + } +} + +STATIC const mp_rom_map_elem_t gnss_satellitesystem_locals_dict_table[] = { + {MP_ROM_QSTR(MP_QSTR_GPS), MP_ROM_PTR(&gnss_satellitesystem_gps_obj)}, + {MP_ROM_QSTR(MP_QSTR_GLONASS), MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)}, + {MP_ROM_QSTR(MP_QSTR_SBAS), MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1CA), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)}, + {MP_ROM_QSTR(MP_QSTR_QZSS_L1S), MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)}, +}; +STATIC MP_DEFINE_CONST_DICT(gnss_satellitesystem_locals_dict, gnss_satellitesystem_locals_dict_table); + +STATIC void gnss_satellitesystem_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { + qstr system = MP_QSTR_None; + if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_gps_obj)) { + system = MP_QSTR_GPS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_glonass_obj)) { + system = MP_QSTR_GLONASS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_sbas_obj)) { + system = MP_QSTR_SBAS; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1ca_obj)) { + system = MP_QSTR_QZSS_L1CA; + } else if (MP_OBJ_TO_PTR(self_in) == MP_ROM_PTR(&gnss_satellitesystem_qzss_l1s_obj)) { + system = MP_QSTR_QZSS_L1S; + } + mp_printf(print, "%q.%q.%q", MP_QSTR_gnss, MP_QSTR_SatelliteSystem, system); +} + +const mp_obj_type_t gnss_satellitesystem_type = { + { &mp_type_type }, + .name = MP_QSTR_SatelliteSystem, + .print = gnss_satellitesystem_print, + .locals_dict = (mp_obj_t)&gnss_satellitesystem_locals_dict, +}; diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h new file mode 100644 index 0000000000..210cd0bb8b --- /dev/null +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H + +#include "py/obj.h" + +typedef enum { + SATELLITESYSTEM_NONE, + SATELLITESYSTEM_GPS, + SATELLITESYSTEM_GLONASS, + SATELLITESYSTEM_SBAS, + SATELLITESYSTEM_QZSS_L1CA, + SATELLITESYSTEM_QZSS_L1S, +} gnss_satellitesystem_t; + +const mp_obj_type_t gnss_satellitesystem_type; + +gnss_satellitesystem_t gnss_satellitesystem_obj_to_type(mp_obj_t obj); +mp_obj_t gnss_satellitesystem_type_to_obj(gnss_satellitesystem_t mode); + +typedef struct { + mp_obj_base_t base; +} gnss_satellitesystem_obj_t; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_gps_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_glonass_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_sbas_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1ca_obj; +extern const gnss_satellitesystem_obj_t gnss_satellitesystem_qzss_l1s_obj; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_SATELLITESYSTEM_H diff --git a/shared-bindings/gnss/__init__.c b/shared-bindings/gnss/__init__.c new file mode 100644 index 0000000000..b3cf722f11 --- /dev/null +++ b/shared-bindings/gnss/__init__.c @@ -0,0 +1,53 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/mphal.h" +#include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/gnss/SatelliteSystem.h" +#include "shared-bindings/gnss/PositionFix.h" +#include "shared-bindings/util.h" + +//| """Global Navigation Satellite System +//| +//| The `gnss` module contains classes to control the GNSS and acquire positioning information.""" +//| +STATIC const mp_rom_map_elem_t gnss_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gnss) }, + { MP_ROM_QSTR(MP_QSTR_GNSS), MP_ROM_PTR(&gnss_type) }, + + // Enum-like Classes. + { MP_ROM_QSTR(MP_QSTR_SatelliteSystem), MP_ROM_PTR(&gnss_satellitesystem_type) }, + { MP_ROM_QSTR(MP_QSTR_PositionFix), MP_ROM_PTR(&gnss_positionfix_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(gnss_module_globals, gnss_module_globals_table); + +const mp_obj_module_t gnss_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&gnss_module_globals, +}; From 343f093ead9380347681aed5decb524281083746 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Tue, 16 Jun 2020 20:41:02 +0200 Subject: [PATCH 836/919] spresense: Add support for GNSS --- ports/cxd56/common-hal/gnss/GNSS.c | 152 ++++++++++++++++++ ports/cxd56/common-hal/gnss/GNSS.h | 41 +++++ ports/cxd56/common-hal/gnss/PositionFix.c | 0 ports/cxd56/common-hal/gnss/SatelliteSystem.c | 0 ports/cxd56/common-hal/gnss/__init__.c | 0 ports/cxd56/mpconfigport.mk | 1 + 6 files changed, 194 insertions(+) create mode 100644 ports/cxd56/common-hal/gnss/GNSS.c create mode 100644 ports/cxd56/common-hal/gnss/GNSS.h create mode 100644 ports/cxd56/common-hal/gnss/PositionFix.c create mode 100644 ports/cxd56/common-hal/gnss/SatelliteSystem.c create mode 100644 ports/cxd56/common-hal/gnss/__init__.c diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c new file mode 100644 index 0000000000..0e5655534b --- /dev/null +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -0,0 +1,152 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * 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 +#include +#include +#include + +#include "py/runtime.h" + +#include "shared-bindings/gnss/GNSS.h" + +typedef struct { + const char* devpath; + int fd; +} gnss_dev_t; + +STATIC gnss_dev_t gnss_dev = {"/dev/gps", -1}; + +static unsigned long satellitesystem_type_to_bit_fields(gnss_satellitesystem_t system) { + switch (system) { + case SATELLITESYSTEM_GPS: + return CXD56_GNSS_SAT_GPS; + case SATELLITESYSTEM_GLONASS: + return CXD56_GNSS_SAT_GLONASS; + case SATELLITESYSTEM_SBAS: + return CXD56_GNSS_SAT_SBAS; + case SATELLITESYSTEM_QZSS_L1CA: + return CXD56_GNSS_SAT_QZ_L1CA; + case SATELLITESYSTEM_QZSS_L1S: + return CXD56_GNSS_SAT_QZ_L1S; + case SATELLITESYSTEM_NONE: + default: + return CXD56_GNSS_SAT_NONE; + } +} + +static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { + switch (fix) { + case CXD56_GNSS_PVT_POSFIX_2D: + return POSITIONFIX_2D; + case CXD56_GNSS_PVT_POSFIX_3D: + return POSITIONFIX_3D; + case CXD56_GNSS_PVT_POSFIX_INVALID: + default: + return POSITIONFIX_INVALID; + } +} + +void common_hal_gnss_construct(gnss_obj_t *self) { + if (gnss_dev.fd < 0) { + gnss_dev.fd = open(gnss_dev.devpath, O_RDONLY); + if (gnss_dev.fd < 0) { + mp_raise_ValueError(translate("Could not initialize GNSS")); + } + } + + self->satellite_system = 0; + self->fix = POSITIONFIX_INVALID; +} + +void common_hal_gnss_deinit(gnss_obj_t *self) { + if (common_hal_gnss_deinited(self)) { + return; + } + + close(gnss_dev.fd); + gnss_dev.fd = -1; +} + +bool common_hal_gnss_deinited(gnss_obj_t *self) { + return gnss_dev.fd < 0; +} + +void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system) { + unsigned long selection = self->satellite_system | satellitesystem_type_to_bit_fields(system); + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); + + self->satellite_system = selection; +} + +void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system) { + unsigned long selection = self->satellite_system & ~satellitesystem_type_to_bit_fields(system); + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); + + self->satellite_system = selection; +} + +void common_hal_gnss_start(gnss_obj_t *self) { + if (self->satellite_system == 0) { + mp_raise_ValueError(translate("Cannot start without selecting at least one satellite system.")); + } + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); +} + +void common_hal_gnss_stop(gnss_obj_t *self) { + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_STOP, 0); +} + +void common_hal_gnss_update(gnss_obj_t *self) { + struct cxd56_gnss_positiondata_s positiondata; + + read(gnss_dev.fd, &positiondata, sizeof(struct cxd56_gnss_positiondata_s)); + + if (positiondata.receiver.pos_dataexist) { + self->fix = positiondata.receiver.pos_fixmode; + self->latitude = positiondata.receiver.latitude; + self->longitude = positiondata.receiver.longitude; + self->altitude = positiondata.receiver.altitude; + } +} + +mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self) { + return (mp_float_t) self->latitude; +} + +mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self) { + return (mp_float_t) self->longitude; +} + +mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self) { + return (mp_float_t) self->altitude; +} + +gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self) { + return fix_to_positionfix_type(self->fix); +} diff --git a/ports/cxd56/common-hal/gnss/GNSS.h b/ports/cxd56/common-hal/gnss/GNSS.h new file mode 100644 index 0000000000..fd44bcb5cd --- /dev/null +++ b/ports/cxd56/common-hal/gnss/GNSS.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H +#define MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + unsigned long satellite_system; + uint8_t fix; + double latitude; + double longitude; + double altitude; +} gnss_obj_t; + +#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H diff --git a/ports/cxd56/common-hal/gnss/PositionFix.c b/ports/cxd56/common-hal/gnss/PositionFix.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/common-hal/gnss/SatelliteSystem.c b/ports/cxd56/common-hal/gnss/SatelliteSystem.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/common-hal/gnss/__init__.c b/ports/cxd56/common-hal/gnss/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8aeae1de56..6c59e12993 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -14,6 +14,7 @@ CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_GAMEPAD = 0 +CIRCUITPY_GNSS = 1 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_DISPLAYIO = 0 From fc8908b6a4daaf32db51623e7c86b14b7d077d60 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 17 Jun 2020 08:03:14 +0200 Subject: [PATCH 837/919] locale: make translate --- locale/circuitpython.pot | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 11ecb99e8c..76f2a41dd8 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-17 08:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -503,6 +503,10 @@ msgstr "" msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Cannot start without selecting at least one satellite system." +msgstr "" + #: py/objslice.c msgid "Cannot subclass slice" msgstr "" @@ -572,6 +576,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -1611,6 +1619,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" From c49f4bcc8516a6dcc129305c1e2a052c5f66f4f7 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 18 Jun 2020 17:08:30 +0200 Subject: [PATCH 838/919] gnss: add a comment about the units --- shared-bindings/gnss/GNSS.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index 37c25cf849..e7c2234506 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -31,7 +31,7 @@ #include "py/runtime.h" //| class GNSS: -//| """Get updated positioning information from GNSS +//| """Get updated positioning information from Global Navigation Satellite System (GNSS) //| //| Usage:: //| @@ -155,7 +155,7 @@ STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); //| latitude: Any = ... -//| """Latitude of current position.""" +//| """Latitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -172,7 +172,7 @@ const mp_obj_property_t gnss_latitude_obj = { }; //| longitude: Any = ... -//| """Longitude of current position.""" +//| """Longitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -189,7 +189,7 @@ const mp_obj_property_t gnss_longitude_obj = { }; //| altitude: Any = ... -//| """Altitude of current position.""" +//| """Altitude of current position in degrees (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); From 3509dad5b3364ea23ea8108a33aa88a853626104 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:04:05 +0200 Subject: [PATCH 839/919] gnss: Remove start and stop --- ports/cxd56/common-hal/gnss/GNSS.c | 64 +++++---------- shared-bindings/gnss/GNSS.c | 105 ++++++++----------------- shared-bindings/gnss/GNSS.h | 6 +- shared-bindings/gnss/SatelliteSystem.h | 12 +-- 4 files changed, 58 insertions(+), 129 deletions(-) diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index 0e5655534b..401d880d92 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -40,24 +40,6 @@ typedef struct { STATIC gnss_dev_t gnss_dev = {"/dev/gps", -1}; -static unsigned long satellitesystem_type_to_bit_fields(gnss_satellitesystem_t system) { - switch (system) { - case SATELLITESYSTEM_GPS: - return CXD56_GNSS_SAT_GPS; - case SATELLITESYSTEM_GLONASS: - return CXD56_GNSS_SAT_GLONASS; - case SATELLITESYSTEM_SBAS: - return CXD56_GNSS_SAT_SBAS; - case SATELLITESYSTEM_QZSS_L1CA: - return CXD56_GNSS_SAT_QZ_L1CA; - case SATELLITESYSTEM_QZSS_L1S: - return CXD56_GNSS_SAT_QZ_L1S; - case SATELLITESYSTEM_NONE: - default: - return CXD56_GNSS_SAT_NONE; - } -} - static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { switch (fix) { case CXD56_GNSS_PVT_POSFIX_2D: @@ -70,7 +52,7 @@ static gnss_positionfix_t fix_to_positionfix_type(uint8_t fix) { } } -void common_hal_gnss_construct(gnss_obj_t *self) { +void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection) { if (gnss_dev.fd < 0) { gnss_dev.fd = open(gnss_dev.devpath, O_RDONLY); if (gnss_dev.fd < 0) { @@ -80,6 +62,23 @@ void common_hal_gnss_construct(gnss_obj_t *self) { self->satellite_system = 0; self->fix = POSITIONFIX_INVALID; + + unsigned long sel = 0; + + if (selection & SATELLITESYSTEM_GPS) { + sel |= CXD56_GNSS_SAT_GPS; + } else if (selection & SATELLITESYSTEM_GLONASS) { + sel |= CXD56_GNSS_SAT_GLONASS; + } else if (selection & SATELLITESYSTEM_SBAS) { + sel |= CXD56_GNSS_SAT_SBAS; + } else if (selection & SATELLITESYSTEM_QZSS_L1CA) { + sel |= CXD56_GNSS_SAT_QZ_L1CA; + } else if (selection & SATELLITESYSTEM_QZSS_L1S) { + sel |= CXD56_GNSS_SAT_QZ_L1S; + } + + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, sel); + ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); } void common_hal_gnss_deinit(gnss_obj_t *self) { @@ -95,33 +94,6 @@ bool common_hal_gnss_deinited(gnss_obj_t *self) { return gnss_dev.fd < 0; } -void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system) { - unsigned long selection = self->satellite_system | satellitesystem_type_to_bit_fields(system); - - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); - - self->satellite_system = selection; -} - -void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system) { - unsigned long selection = self->satellite_system & ~satellitesystem_type_to_bit_fields(system); - - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_SELECT_SATELLITE_SYSTEM, selection); - - self->satellite_system = selection; -} - -void common_hal_gnss_start(gnss_obj_t *self) { - if (self->satellite_system == 0) { - mp_raise_ValueError(translate("Cannot start without selecting at least one satellite system.")); - } - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_START, CXD56_GNSS_STMOD_COLD); -} - -void common_hal_gnss_stop(gnss_obj_t *self) { - ioctl(gnss_dev.fd, CXD56_GNSS_IOCTL_STOP, 0); -} - void common_hal_gnss_update(gnss_obj_t *self) { struct cxd56_gnss_positiondata_s positiondata; diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index e7c2234506..a7bb964a66 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -38,31 +38,54 @@ //| import gnss //| import time //| -//| gps = gnss.GNSS() -//| gps.select(gnss.SatelliteSystem.GPS) -//| gps.start() +//| nav = gnss.GNSS([gnss.SatelliteSystem.GPS, gnss.SatelliteSystem.GLONASS]) //| last_print = time.monotonic() //| while True: -//| gps.update() +//| nav.update() //| current = time.monotonic() //| if current - last_print >= 1.0: //| last_print = current -//| if gps.fix is gnss.PositionFix.INVALID: +//| if nav.fix is gnss.PositionFix.INVALID: //| print("Waiting for fix...") //| continue -//| print("Latitude: {0:.6f} degrees".format(gps.latitude)) -//| print("Longitude: {0:.6f} degrees".format(gps.longitude))""" +//| print("Latitude: {0:.6f} degrees".format(nav.latitude)) +//| print("Longitude: {0:.6f} degrees".format(nav.longitude))""" //| //| def __init__(self, ): -//| """Turn on the GNSS.""" +//| """Turn on the GNSS. +//| +//| :param gnss.SatelliteSystem system: satellite system to use""" //| ... //| STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { gnss_obj_t *self = m_new_obj(gnss_obj_t); self->base.type = &gnss_type; + enum { ARG_system }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_system, MP_ARG_REQUIRED | MP_ARG_OBJ }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - common_hal_gnss_construct(self); + unsigned long selection = 0; + if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &gnss_satellitesystem_type)) { + selection |= gnss_satellitesystem_obj_to_type(args[ARG_system].u_obj); + } else if (MP_OBJ_IS_TYPE(args[ARG_system].u_obj, &mp_type_list)) { + size_t systems_size = 0; + mp_obj_t *systems; + mp_obj_list_get(args[ARG_system].u_obj, &systems_size, &systems); + for (size_t i = 0; i < systems_size; ++i) { + if (!MP_OBJ_IS_TYPE(systems[i], &gnss_satellitesystem_type)) { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + selection |= gnss_satellitesystem_obj_to_type(systems[i]); + } + } else { + mp_raise_TypeError(translate("System entry must be gnss.SatelliteSystem")); + } + + common_hal_gnss_construct(self, selection); return MP_OBJ_FROM_PTR(self); } @@ -83,64 +106,6 @@ STATIC void check_for_deinit(gnss_obj_t *self) { } } -//| def select(self, system: gnss.SatelliteSystem) -> Any: -//| """Add specified satellite system to selection for positioning. -//| -//| :param gnss.SatelliteSystem system: satellite system to use""" -//| ... -//| -STATIC mp_obj_t gnss_obj_select(mp_obj_t self_in, mp_obj_t system_obj) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); - common_hal_gnss_select(self, system); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_select_obj, gnss_obj_select); - -//| def deselect(self, system: gnss.SatelliteSystem) -> Any: -//| """Remove specified satellite system from selection for positioning. -//| -//| :param gnss.SatelliteSystem system: satellite system to remove""" -//| ... -//| -STATIC mp_obj_t gnss_obj_deselect(mp_obj_t self_in, mp_obj_t system_obj) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - gnss_satellitesystem_t system = gnss_satellitesystem_obj_to_type(system_obj); - common_hal_gnss_deselect(self, system); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(gnss_deselect_obj, gnss_obj_deselect); - -//| def start(self, ) -> Any: -//| """Start positioning.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_start(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_gnss_start(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_start_obj, gnss_obj_start); - -//| def stop(self, ) -> Any: -//| """Stop positioning.""" -//| ... -//| -STATIC mp_obj_t gnss_obj_stop(mp_obj_t self_in) { - gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_gnss_stop(self); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gnss_stop_obj, gnss_obj_stop); - //| def update(self, ) -> Any: //| """Update GNSS positioning information.""" //| ... @@ -189,7 +154,7 @@ const mp_obj_property_t gnss_longitude_obj = { }; //| altitude: Any = ... -//| """Altitude of current position in degrees (float).""" +//| """Altitude of current position in meters (float).""" //| STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -224,10 +189,6 @@ const mp_obj_property_t gnss_fix_obj = { STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_select), MP_ROM_PTR(&gnss_select_obj) }, - { MP_ROM_QSTR(MP_QSTR_deselect), MP_ROM_PTR(&gnss_deselect_obj) }, - { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&gnss_start_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&gnss_stop_obj) }, { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&gnss_update_obj) }, { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h index 953eb9ce31..c7332dc0e4 100644 --- a/shared-bindings/gnss/GNSS.h +++ b/shared-bindings/gnss/GNSS.h @@ -33,13 +33,9 @@ extern const mp_obj_type_t gnss_type; -void common_hal_gnss_construct(gnss_obj_t *self); +void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); void common_hal_gnss_deinit(gnss_obj_t *self); bool common_hal_gnss_deinited(gnss_obj_t *self); -void common_hal_gnss_select(gnss_obj_t *self, gnss_satellitesystem_t system); -void common_hal_gnss_deselect(gnss_obj_t *self, gnss_satellitesystem_t system); -void common_hal_gnss_start(gnss_obj_t *self); -void common_hal_gnss_stop(gnss_obj_t *self); void common_hal_gnss_update(gnss_obj_t *self); mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); diff --git a/shared-bindings/gnss/SatelliteSystem.h b/shared-bindings/gnss/SatelliteSystem.h index 210cd0bb8b..484e861abd 100644 --- a/shared-bindings/gnss/SatelliteSystem.h +++ b/shared-bindings/gnss/SatelliteSystem.h @@ -30,12 +30,12 @@ #include "py/obj.h" typedef enum { - SATELLITESYSTEM_NONE, - SATELLITESYSTEM_GPS, - SATELLITESYSTEM_GLONASS, - SATELLITESYSTEM_SBAS, - SATELLITESYSTEM_QZSS_L1CA, - SATELLITESYSTEM_QZSS_L1S, + SATELLITESYSTEM_NONE = 0, + SATELLITESYSTEM_GPS = (1U << 0), + SATELLITESYSTEM_GLONASS = (1U << 1), + SATELLITESYSTEM_SBAS = (1U << 2), + SATELLITESYSTEM_QZSS_L1CA = (1U << 3), + SATELLITESYSTEM_QZSS_L1S = (1U << 4), } gnss_satellitesystem_t; const mp_obj_type_t gnss_satellitesystem_type; From ab4c09cea7d93478f9e305bfdf4cfe4be6204186 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:06:25 +0200 Subject: [PATCH 840/919] gnss: Add timestamp --- ports/cxd56/common-hal/gnss/GNSS.c | 13 ++++++++++++- ports/cxd56/common-hal/gnss/GNSS.h | 4 ++++ shared-bindings/gnss/GNSS.c | 21 +++++++++++++++++++++ shared-bindings/gnss/GNSS.h | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index 401d880d92..c0aaa3cfbd 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -26,8 +26,8 @@ #include #include +#include #include -#include #include "py/runtime.h" @@ -104,6 +104,8 @@ void common_hal_gnss_update(gnss_obj_t *self) { self->latitude = positiondata.receiver.latitude; self->longitude = positiondata.receiver.longitude; self->altitude = positiondata.receiver.altitude; + memcpy(&self->date, &positiondata.receiver.date, sizeof(struct cxd56_gnss_date_s)); + memcpy(&self->time, &positiondata.receiver.time, sizeof(struct cxd56_gnss_time_s)); } } @@ -119,6 +121,15 @@ mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self) { return (mp_float_t) self->altitude; } +void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm) { + tm->tm_year = self->date.year; + tm->tm_mon = self->date.month; + tm->tm_mday = self->date.day; + tm->tm_hour = self->time.hour; + tm->tm_min = self->time.minute; + tm->tm_sec = self->time.sec; +} + gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self) { return fix_to_positionfix_type(self->fix); } diff --git a/ports/cxd56/common-hal/gnss/GNSS.h b/ports/cxd56/common-hal/gnss/GNSS.h index fd44bcb5cd..e226104492 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.h +++ b/ports/cxd56/common-hal/gnss/GNSS.h @@ -27,6 +27,8 @@ #ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H #define MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H +#include + #include "py/obj.h" typedef struct { @@ -36,6 +38,8 @@ typedef struct { double latitude; double longitude; double altitude; + struct cxd56_gnss_date_s date; + struct cxd56_gnss_time_s time; } gnss_obj_t; #endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_GNSS_GNSS_H diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index a7bb964a66..929e02ab81 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/gnss/GNSS.h" +#include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" #include "py/objproperty.h" @@ -170,6 +171,25 @@ const mp_obj_property_t gnss_altitude_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| timestamp: Any = ... +//| """Time when the position data was updated.""" +//| +STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { + gnss_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + timeutils_struct_time_t tm; + common_hal_gnss_get_timestamp(self, &tm); + return struct_time_from_tm(&tm); +} +MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp); + +const mp_obj_property_t gnss_timestamp_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&gnss_get_timestamp_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| fix: Any = ... //| """Fix mode.""" //| @@ -194,6 +214,7 @@ STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_latitude), MP_ROM_PTR(&gnss_latitude_obj) }, { MP_ROM_QSTR(MP_QSTR_longitude), MP_ROM_PTR(&gnss_longitude_obj) }, { MP_ROM_QSTR(MP_QSTR_altitude), MP_ROM_PTR(&gnss_altitude_obj) }, + { MP_ROM_QSTR(MP_QSTR_timestamp), MP_ROM_PTR(&gnss_timestamp_obj) }, { MP_ROM_QSTR(MP_QSTR_fix), MP_ROM_PTR(&gnss_fix_obj) } }; STATIC MP_DEFINE_CONST_DICT(gnss_locals_dict, gnss_locals_dict_table); diff --git a/shared-bindings/gnss/GNSS.h b/shared-bindings/gnss/GNSS.h index c7332dc0e4..61ae35b12a 100644 --- a/shared-bindings/gnss/GNSS.h +++ b/shared-bindings/gnss/GNSS.h @@ -31,6 +31,8 @@ #include "shared-bindings/gnss/SatelliteSystem.h" #include "shared-bindings/gnss/PositionFix.h" +#include "lib/timeutils/timeutils.h" + extern const mp_obj_type_t gnss_type; void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection); @@ -41,6 +43,7 @@ void common_hal_gnss_update(gnss_obj_t *self); mp_float_t common_hal_gnss_get_latitude(gnss_obj_t *self); mp_float_t common_hal_gnss_get_longitude(gnss_obj_t *self); mp_float_t common_hal_gnss_get_altitude(gnss_obj_t *self); +void common_hal_gnss_get_timestamp(gnss_obj_t *self, timeutils_struct_time_t *tm); gnss_positionfix_t common_hal_gnss_get_fix(gnss_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_GNSS_GNSS_H From 1537e7ae77870cf41eddc6f10df1855448801f8c Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Wed, 24 Jun 2020 11:10:37 +0200 Subject: [PATCH 841/919] locale: update translate --- locale/circuitpython.pot | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 76f2a41dd8..f125c2cc4b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-17 08:00+0200\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -503,10 +503,6 @@ msgstr "" msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Cannot start without selecting at least one satellite system." -msgstr "" - #: py/objslice.c msgid "Cannot subclass slice" msgstr "" @@ -1433,6 +1429,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" From bf460ddf25ead020c6aeeb9ac4393ddf17daf7bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 24 Jun 2020 09:44:45 -0500 Subject: [PATCH 842/919] supervisor.mk: Conditionally assign USB_DEVICES This restores the ability to remove CDC and/or MSC, at the price of giving up the new automatic check that USB_DEVICES is correct. Since devices have to have CDC and MSC to be "CircuitPython", this is not a facility that is going to be used by any in-tree drivers. --- supervisor/supervisor.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 0717785e7f..21803ae0a3 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -122,7 +122,7 @@ endif ifeq ($(CIRCUITPY_USB_HID),1) USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID endif -USB_DEVICES := "$(USB_DEVICES_COMPUTED)" +USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)" ifndef USB_HID_DEVICES USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD" From d0401f02a947a468d3019e70b5b0f5f633429c5d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 28 May 2020 15:51:33 -0700 Subject: [PATCH 843/919] Add initial I2C support, not quite working fully though --- ports/esp32s2/Makefile | 1 + ports/esp32s2/common-hal/busio/I2C.c | 239 +++++++++++ ports/esp32s2/common-hal/busio/I2C.h | 49 +++ ports/esp32s2/common-hal/busio/OneWire.h | 33 ++ ports/esp32s2/common-hal/busio/SPI.c | 249 +++++++++++ ports/esp32s2/common-hal/busio/SPI.h | 44 ++ ports/esp32s2/common-hal/busio/UART.c | 405 ++++++++++++++++++ ports/esp32s2/common-hal/busio/UART.h | 48 +++ ports/esp32s2/common-hal/busio/__init__.c | 1 + .../esp32s2/common-hal/microcontroller/Pin.c | 4 + .../esp32s2/common-hal/microcontroller/Pin.h | 1 + ports/esp32s2/mpconfigport.mk | 4 +- ports/esp32s2/supervisor/port.c | 10 +- 13 files changed, 1085 insertions(+), 3 deletions(-) create mode 100644 ports/esp32s2/common-hal/busio/I2C.c create mode 100644 ports/esp32s2/common-hal/busio/I2C.h create mode 100644 ports/esp32s2/common-hal/busio/OneWire.h create mode 100644 ports/esp32s2/common-hal/busio/SPI.c create mode 100644 ports/esp32s2/common-hal/busio/SPI.h create mode 100644 ports/esp32s2/common-hal/busio/UART.c create mode 100644 ports/esp32s2/common-hal/busio/UART.h create mode 100644 ports/esp32s2/common-hal/busio/__init__.c diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5ad5c2f1d3..4eac07f99f 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -78,6 +78,7 @@ INC += -Iesp-idf/components/freertos/xtensa/include INC += -Iesp-idf/components/esp32s2/include INC += -Iesp-idf/components/xtensa/esp32s2/include INC += -Iesp-idf/components/esp_common/include +INC += -Iesp-idf/components/esp_ringbuf/include INC += -Iesp-idf/components/esp_rom/include INC += -Iesp-idf/components/xtensa/include INC += -Iesp-idf/components/esp_timer/include diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c new file mode 100644 index 0000000000..80743dc894 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -0,0 +1,239 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/busio/I2C.h" +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "driver/i2c.h" + +#include "esp_log.h" + +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/translate.h" + +// Number of times to try to send packet if failed. +#define ATTEMPTS 2 + +static const char* TAG = "CircuitPython I2C"; + +typedef enum { + STATUS_FREE = 0, + STATUS_IN_USE, + STATUS_NEVER_RESET +} i2c_status_t; + +static i2c_status_t i2c_status[I2C_NUM_MAX]; + +void never_reset_i2c(i2c_port_t num) { + i2c_status[num] = STATUS_NEVER_RESET; +} + +void i2c_reset(void) { + for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { + if (i2c_status[num] == STATUS_IN_USE) { + i2c_driver_delete(num); + i2c_status[num] = STATUS_FREE; + } + } +} + +void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, + const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { + + // Make sure scl and sda aren't input only + +#if CIRCUITPY_REQUIRE_I2C_PULLUPS + // // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + // gpio_set_pin_function(sda->number, GPIO_PIN_FUNCTION_OFF); + // gpio_set_pin_function(scl->number, GPIO_PIN_FUNCTION_OFF); + // gpio_set_pin_direction(sda->number, GPIO_DIRECTION_IN); + // gpio_set_pin_direction(scl->number, GPIO_DIRECTION_IN); + + // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_DOWN); + // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_DOWN); + + // common_hal_mcu_delay_us(10); + + // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_OFF); + // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_OFF); + + // // We must pull up within 3us to achieve 400khz. + // common_hal_mcu_delay_us(3); + + // if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { + // reset_pin_number(sda->number); + // reset_pin_number(scl->number); + // mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + // } +#endif + ESP_EARLY_LOGW(TAG, "create I2C"); + + + self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); + xSemaphoreGive(self->semaphore_handle); + ESP_EARLY_LOGW(TAG, "new I2C lock %x", self->semaphore_handle); + self->sda_pin = sda; + self->scl_pin = scl; + ESP_EARLY_LOGW(TAG, "scl %d sda %d", self->sda_pin->number, self->scl_pin->number); + self->i2c_num = I2C_NUM_MAX; + for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { + if (i2c_status[num] == STATUS_FREE) { + self->i2c_num = num; + } + } + if (self->i2c_num == I2C_NUM_MAX) { + mp_raise_ValueError(translate("All I2C peripherals are in use")); + } + i2c_status[self->i2c_num] = STATUS_IN_USE; + i2c_config_t i2c_conf = { + .mode = I2C_MODE_MASTER, + .sda_io_num = self->sda_pin->number, + .scl_io_num = self->scl_pin->number, + .sda_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C sda signal*/ + .scl_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C scl signal*/ + + .master = { + .clk_speed = frequency, + } + }; + // ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", &i2c_conf, &(i2c_conf.mode), i2c_conf.mode, I2C_MODE_MAX); + ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); + esp_err_t result = i2c_param_config(self->i2c_num, &i2c_conf); + if (result != ESP_OK) { + ESP_EARLY_LOGW(TAG, "error %d %p %d %d", result, &i2c_conf, (&i2c_conf)->mode, I2C_MODE_MAX); + vTaskDelay(0); + mp_raise_ValueError(translate("Invalid pins")); + } + ESP_EARLY_LOGW(TAG, "param config I2C done"); + result = i2c_driver_install(self->i2c_num, + I2C_MODE_MASTER, + 0, + 0, + 0); + if (result != ESP_OK) { + mp_raise_OSError(MP_EIO); + } + + claim_pin(sda); + claim_pin(scl); + ESP_EARLY_LOGW(TAG, "create I2C done"); +} + +bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { + return self->sda_pin == NULL; +} + +void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { + if (common_hal_busio_i2c_deinited(self)) { + return; + } + + i2c_driver_delete(self->i2c_num); + i2c_status[self->i2c_num] = STATUS_FREE; + + reset_pin(self->sda_pin); + reset_pin(self->scl_pin); + self->sda_pin = NULL; + self->scl_pin = NULL; +} + +bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1, true); + i2c_master_stop(cmd); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100); + i2c_cmd_link_delete(cmd); + return result == ESP_OK; +} + +bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { + ESP_EARLY_LOGW(TAG, "locking I2C %x", self->semaphore_handle); + self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; + if (self->has_lock) { + ESP_EARLY_LOGW(TAG, "lock grabbed"); + } else { + ESP_EARLY_LOGW(TAG, "unable to grab lock"); + } + return self->has_lock; +} + +bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { + ESP_EARLY_LOGW(TAG, "unlocking I2C"); + xSemaphoreGive(self->semaphore_handle); + self->has_lock = false; +} + +uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, + const uint8_t *data, size_t len, bool transmit_stop_bit) { + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1, true); + i2c_master_write(cmd, (uint8_t*) data, len, true); + if (transmit_stop_bit) { + i2c_master_stop(cmd); + } + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); + i2c_cmd_link_delete(cmd); + + if (result == ESP_OK) { + return 0; + } else if (result == ESP_FAIL) { + return MP_ENODEV; + } + return MP_EIO; +} + +uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, + uint8_t *data, size_t len) { + + i2c_cmd_handle_t cmd = i2c_cmd_link_create(); + i2c_master_start(cmd); + i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read + i2c_master_read(cmd, data, len, true); + i2c_master_stop(cmd); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); + i2c_cmd_link_delete(cmd); + + if (result == ESP_OK) { + return 0; + } else if (result == ESP_FAIL) { + return MP_ENODEV; + } + return MP_EIO; +} + +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + never_reset_i2c(self->i2c_num); + + never_reset_pin(self->scl_pin); + never_reset_pin(self->sda_pin); +} diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h new file mode 100644 index 0000000000..d90fb2713a --- /dev/null +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -0,0 +1,49 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_I2C_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_I2C_H + +#include "common-hal/microcontroller/Pin.h" + +#include "esp-idf/components/soc/include/hal/i2c_types.h" +#include "FreeRTOS.h" +#include "freertos/semphr.h" +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t* scl_pin; + const mcu_pin_obj_t* sda_pin; + i2c_port_t i2c_num; + StaticSemaphore_t semaphore; + SemaphoreHandle_t semaphore_handle; + bool has_lock; +} busio_i2c_obj_t; + +void i2c_reset(void); + +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_H diff --git a/ports/esp32s2/common-hal/busio/OneWire.h b/ports/esp32s2/common-hal/busio/OneWire.h new file mode 100644 index 0000000000..bb6a014190 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/OneWire.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H + +// Use bitbangio. +#include "shared-module/busio/OneWire.h" + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c new file mode 100644 index 0000000000..e761eb49be --- /dev/null +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -0,0 +1,249 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/busio/SPI.h" +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "supervisor/shared/rgb_led_status.h" + +void spi_reset(void) { + +} + +void common_hal_busio_spi_construct(busio_spi_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, + const mcu_pin_obj_t * miso) { + // uint8_t sercom_index; + // uint32_t clock_pinmux = 0; + // bool mosi_none = mosi == NULL; + // bool miso_none = miso == NULL; + // uint32_t mosi_pinmux = 0; + // uint32_t miso_pinmux = 0; + // uint8_t clock_pad = 0; + // uint8_t mosi_pad = 0; + // uint8_t miso_pad = 0; + // uint8_t dopo = 255; + + // if (sercom == NULL) { + // mp_raise_ValueError(translate("Invalid pins")); + // } + + // // Set up SPI clocks on SERCOM. + // samd_peripherals_sercom_clock_init(sercom, sercom_index); + + #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 + // // if we're re-using the dotstar sercom, make sure it is disabled or the init will fail out + // hri_sercomspi_clear_CTRLA_ENABLE_bit(sercom); + #endif + // if (spi_m_sync_init(&self->spi_desc, sercom) != ERR_NONE) { + // mp_raise_OSError(MP_EIO); + // } + + // Pads must be set after spi_m_sync_init(), which uses default values from + // the prototypical SERCOM. + // hri_sercomspi_write_CTRLA_DOPO_bf(sercom, dopo); + // hri_sercomspi_write_CTRLA_DIPO_bf(sercom, miso_pad); + + // Always start at 250khz which is what SD cards need. They are sensitive to + // SPI bus noise before they are put into SPI mode. + // uint8_t baud_value = samd_peripherals_spi_baudrate_to_baud_reg_value(250000); + // if (spi_m_sync_set_baudrate(&self->spi_desc, baud_value) != ERR_NONE) { + // // spi_m_sync_set_baudrate does not check for validity, just whether the device is + // // busy or not + // mp_raise_OSError(MP_EIO); + // } + + // gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF); + // gpio_set_pin_function(clock->number, clock_pinmux); + // claim_pin(clock); + // self->clock_pin = clock->number; + + // if (mosi_none) { + // self->MOSI_pin = NO_PIN; + // } else { + // gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); + // gpio_set_pin_function(mosi->number, mosi_pinmux); + // self->MOSI_pin = mosi->number; + // claim_pin(mosi); + // } + + // if (miso_none) { + // self->MISO_pin = NO_PIN; + // } else { + // gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); + // gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); + // gpio_set_pin_function(miso->number, miso_pinmux); + // self->MISO_pin = miso->number; + // claim_pin(miso); + // } + + // spi_m_sync_enable(&self->spi_desc); +} + +void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { + // never_reset_sercom(self->spi_desc.dev.prvt); + + never_reset_pin(self->clock_pin); + never_reset_pin(self->MOSI_pin); + never_reset_pin(self->MISO_pin); +} + +bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { + return self->clock_pin == NULL; +} + +void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { + if (common_hal_busio_spi_deinited(self)) { + return; + } + // allow_reset_sercom(self->spi_desc.dev.prvt); + + // spi_m_sync_disable(&self->spi_desc); + // spi_m_sync_deinit(&self->spi_desc); + reset_pin(self->clock_pin); + reset_pin(self->MOSI_pin); + reset_pin(self->MISO_pin); + self->clock_pin = NULL; +} + +bool common_hal_busio_spi_configure(busio_spi_obj_t *self, + uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { + // If the settings are already what we want then don't reset them. + // if (hri_sercomspi_get_CTRLA_CPHA_bit(hw) == phase && + // hri_sercomspi_get_CTRLA_CPOL_bit(hw) == polarity && + // hri_sercomspi_read_CTRLB_CHSIZE_bf(hw) == ((uint32_t)bits - 8) && + // hri_sercomspi_read_BAUD_BAUD_bf(hw) == baud_reg_value) { + // return true; + // } + + // Disable, set values (most or all are enable-protected), and re-enable. + // spi_m_sync_disable(&self->spi_desc); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + // hri_sercomspi_write_CTRLA_CPHA_bit(hw, phase); + // hri_sercomspi_write_CTRLA_CPOL_bit(hw, polarity); + // hri_sercomspi_write_CTRLB_CHSIZE_bf(hw, bits - 8); + // hri_sercomspi_write_BAUD_BAUD_bf(hw, baud_reg_value); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + // spi_m_sync_enable(&self->spi_desc); + // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + + return true; +} + +bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { + bool grabbed_lock = false; + // CRITICAL_SECTION_ENTER() + if (!self->has_lock) { + grabbed_lock = true; + self->has_lock = true; + } + // CRITICAL_SECTION_LEAVE(); + return grabbed_lock; +} + +bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { + return self->has_lock; +} + +void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { + self->has_lock = false; +} + +bool common_hal_busio_spi_write(busio_spi_obj_t *self, + const uint8_t *data, size_t len) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_write(self->spi_desc.dev.prvt, data, len); + } else { + // struct io_descriptor *spi_io; + // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); + // status = spi_io->write(spi_io, data, len); + } + return false; // Status is number of chars read or an error code < 0. +} + +bool common_hal_busio_spi_read(busio_spi_obj_t *self, + uint8_t *data, size_t len, uint8_t write_value) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_read(self->spi_desc.dev.prvt, data, len, write_value); + } else { + // self->spi_desc.dev.dummy_byte = write_value; + + // struct io_descriptor *spi_io; + // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); + + // status = spi_io->read(spi_io, data, len); + } + return false; // Status is number of chars read or an error code < 0. +} + +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { + if (len == 0) { + return true; + } + // int32_t status; + if (len >= 16) { + // status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); + } else { + // struct spi_xfer xfer; + // xfer.txbuf = data_out; + // xfer.rxbuf = data_in; + // xfer.size = len; + // status = spi_m_sync_transfer(&self->spi_desc, &xfer); + } + return false; // Status is number of chars read or an error code < 0. +} + +uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { + // return samd_peripherals_spi_baud_reg_value_to_baudrate(hri_sercomspi_read_BAUD_reg(self->spi_desc.dev.prvt)); + return 0; +} + +uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { + // void * hw = self->spi_desc.dev.prvt; + // return hri_sercomspi_get_CTRLA_CPHA_bit(hw); + return 0; +} + +uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { + // void * hw = self->spi_desc.dev.prvt; + // return hri_sercomspi_get_CTRLA_CPOL_bit(hw); + return 0; +} diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h new file mode 100644 index 0000000000..0ff1a4f7ea --- /dev/null +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + bool has_lock; + const mcu_pin_obj_t* clock_pin; + const mcu_pin_obj_t* MOSI_pin; + const mcu_pin_obj_t* MISO_pin; +} busio_spi_obj_t; + +void spi_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_SPI_H diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c new file mode 100644 index 0000000000..4a016ad1a8 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -0,0 +1,405 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/busio/UART.h" + +#include "mpconfigport.h" +#include "lib/utils/interrupt_char.h" +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" + +#define UART_DEBUG(...) (void)0 +// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) + +// Do-nothing callback needed so that usart_async code will enable rx interrupts. +// See comment below re usart_async_register_callback() +// static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { +// // Nothing needs to be done by us. +// } + +void uart_reset(void) { + +} + +void common_hal_busio_uart_construct(busio_uart_obj_t *self, + const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, + const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, + const mcu_pin_obj_t * rs485_dir, bool rs485_invert, + uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, + bool sigint_enabled) { + + // uint8_t sercom_index = 255; // Unset index + // uint32_t rx_pinmux = 0; + // uint8_t rx_pad = 255; // Unset pad + // uint32_t tx_pinmux = 0; + // uint8_t tx_pad = 255; // Unset pad + + // if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { + // mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + // } + + // if (bits > 8) { + // mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); + // } + + bool have_tx = tx != NULL; + bool have_rx = rx != NULL; + if (!have_tx && !have_rx) { + mp_raise_ValueError(translate("tx and rx cannot both be None")); + } + + self->baudrate = baudrate; + self->character_bits = bits; + self->timeout_ms = timeout * 1000; + + // This assignment is only here because the usart_async routines take a *const argument. +// struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + +// for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { +// Sercom* potential_sercom = NULL; +// if (have_tx) { +// sercom_index = tx->sercom[i].index; +// if (sercom_index >= SERCOM_INST_NUM) { +// continue; +// } +// potential_sercom = sercom_insts[sercom_index]; +// #ifdef SAMD21 +// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || +// !(tx->sercom[i].pad == 0 || +// tx->sercom[i].pad == 2)) { +// continue; +// } +// #endif +// #ifdef SAMD51 +// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || +// !(tx->sercom[i].pad == 0)) { +// continue; +// } +// #endif +// tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); +// tx_pad = tx->sercom[i].pad; +// if (rx == NULL) { +// sercom = potential_sercom; +// break; +// } +// } +// for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { +// if (((!have_tx && rx->sercom[j].index < SERCOM_INST_NUM && +// sercom_insts[rx->sercom[j].index]->USART.CTRLA.bit.ENABLE == 0) || +// sercom_index == rx->sercom[j].index) && +// rx->sercom[j].pad != tx_pad) { +// rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); +// rx_pad = rx->sercom[j].pad; +// sercom = sercom_insts[rx->sercom[j].index]; +// sercom_index = rx->sercom[j].index; +// break; +// } +// } +// if (sercom != NULL) { +// break; +// } +// } + // if (sercom == NULL) { + // mp_raise_ValueError(translate("Invalid pins")); + // } + // if (!have_tx) { + // tx_pad = 0; + // if (rx_pad == 0) { + // tx_pad = 2; + // } + // } + // if (!have_rx) { + // rx_pad = (tx_pad + 1) % 4; + // } + + // // Set up clocks on SERCOM. + // samd_peripherals_sercom_clock_init(sercom, sercom_index); + + // if (rx && receiver_buffer_size > 0) { + // self->buffer_length = receiver_buffer_size; + // // Initially allocate the UART's buffer in the long-lived part of the + // // heap. UARTs are generally long-lived objects, but the "make long- + // // lived" machinery is incapable of moving internal pointers like + // // self->buffer, so do it manually. (However, as long as internal + // // pointers like this are NOT moved, allocating the buffer + // // in the long-lived pool is not strictly necessary) + // self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); + // if (self->buffer == NULL) { + // common_hal_busio_uart_deinit(self); + // mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); + // } + // } else { + // self->buffer_length = 0; + // self->buffer = NULL; + // } + + // if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { + // mp_raise_ValueError(translate("Could not initialize UART")); + // } + + // usart_async_init() sets a number of defaults based on a prototypical SERCOM + // which don't necessarily match what we need. After calling it, set the values + // specific to this instantiation of UART. + + // Set pads computed for this SERCOM. + // TXPO: + // 0x0: TX pad 0; no RTS/CTS + // 0x1: TX pad 2; no RTS/CTS + // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) + // So divide by 2 to map pad to value. + // RXPO: + // 0x0: RX pad 0 + // 0x1: RX pad 1 + // 0x2: RX pad 2 + // 0x3: RX pad 3 + + // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. + + // sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | + // SERCOM_USART_CTRLA_RXPO_Msk | + // SERCOM_USART_CTRLA_FORM_Msk); + // sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | + // SERCOM_USART_CTRLA_RXPO(rx_pad) | + // (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); + + // Enable tx and/or rx based on whether the pins were specified. + // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. + // sercom->USART.CTRLB.reg &= ~(SERCOM_USART_CTRLB_TXEN | + // SERCOM_USART_CTRLB_RXEN | + // SERCOM_USART_CTRLB_PMODE | + // SERCOM_USART_CTRLB_SBMODE | + // SERCOM_USART_CTRLB_CHSIZE_Msk); + // sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | + // (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | + // (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | + // (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | + // SERCOM_USART_CTRLB_CHSIZE(bits % 8); + + // Set baud rate + // common_hal_busio_uart_set_baudrate(self, baudrate); + + // Turn on rx interrupt handling. The UART async driver has its own set of internal callbacks, + // which are set up by uart_async_init(). These in turn can call user-specified callbacks. + // In fact, the actual interrupts are not enabled unless we set up a user-specified callback. + // This is confusing. It's explained in the Atmel START User Guide -> Implementation Description -> + // Different read function behavior in some asynchronous drivers. As of this writing: + // http://start.atmel.com/static/help/index.html?GUID-79201A5A-226F-4FBB-B0B8-AB0BE0554836 + // Look at the ASFv4 code example for async USART. + // usart_async_register_callback(usart_desc_p, USART_ASYNC_RXC_CB, usart_async_rxc_callback); + + + // if (have_tx) { + // gpio_set_pin_direction(tx->number, GPIO_DIRECTION_OUT); + // gpio_set_pin_pull_mode(tx->number, GPIO_PULL_OFF); + // gpio_set_pin_function(tx->number, tx_pinmux); + // self->tx_pin = tx->number; + // claim_pin(tx); + // } else { + // self->tx_pin = NO_PIN; + // } + + // if (have_rx) { + // gpio_set_pin_direction(rx->number, GPIO_DIRECTION_IN); + // gpio_set_pin_pull_mode(rx->number, GPIO_PULL_OFF); + // gpio_set_pin_function(rx->number, rx_pinmux); + // self->rx_pin = rx->number; + // claim_pin(rx); + // } else { + // self->rx_pin = NO_PIN; + // } + + // usart_async_enable(usart_desc_p); +} + +bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { + return self->rx_pin == NULL && self->tx_pin == NULL; +} + +void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + if (common_hal_busio_uart_deinited(self)) { + return; + } + // // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_disable(usart_desc_p); + // usart_async_deinit(usart_desc_p); + reset_pin(self->rx_pin); + reset_pin(self->tx_pin); + self->rx_pin = NULL; + self->tx_pin = NULL; +} + +// Read characters. +size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (self->rx_pin == NULL) { + mp_raise_ValueError(translate("No RX pin")); + } + + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + + if (len == 0) { + // Nothing to read. + return 0; + } + + // struct io_descriptor *io; + // usart_async_get_io_descriptor(usart_desc_p, &io); + + // size_t total_read = 0; + // uint64_t start_ticks = supervisor_ticks_ms64(); + + // Busy-wait until timeout or until we've read enough chars. + // while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { + // // Read as many chars as we can right now, up to len. + // size_t num_read = io_read(io, data, len); + + // // Advance pointer in data buffer, and decrease how many chars left to read. + // data += num_read; + // len -= num_read; + // total_read += num_read; + // if (len == 0) { + // // Don't need to read any more: data buf is full. + // break; + // } + // if (num_read > 0) { + // // Reset the timeout on every character read. + // start_ticks = supervisor_ticks_ms64(); + // } + // RUN_BACKGROUND_TASKS; + // // Allow user to break out of a timeout with a KeyboardInterrupt. + // if (mp_hal_is_interrupted()) { + // break; + // } + // // If we are zero timeout, make sure we don't loop again (in the event + // // we read in under 1ms) + // if (self->timeout_ms == 0) { + // break; + // } + // } + + // if (total_read == 0) { + // *errcode = EAGAIN; + // return MP_STREAM_ERROR; + // } + + // return total_read; + return 0; +} + +// Write characters. +size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + if (self->tx_pin == NULL) { + mp_raise_ValueError(translate("No TX pin")); + } + + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + + // struct io_descriptor *io; + // usart_async_get_io_descriptor(usart_desc_p, &io); + + // // Start writing characters. This is non-blocking and will + // // return immediately after setting up the write. + // if (io_write(io, data, len) < 0) { + // *errcode = MP_EAGAIN; + // return MP_STREAM_ERROR; + // } + + // // Busy-wait until all characters transmitted. + // struct usart_async_status async_status; + // while (true) { + // usart_async_get_status(usart_desc_p, &async_status); + // if (async_status.txcnt >= len) { + // break; + // } + // RUN_BACKGROUND_TASKS; + // } + + return len; +} + +uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { + return self->baudrate; +} + +void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_set_baud_rate(usart_desc_p, + // // Samples and ARITHMETIC vs FRACTIONAL must correspond to USART_SAMPR in + // // hpl_sercom_config.h. + // _usart_async_calculate_baud_rate(baudrate, // e.g. 9600 baud + // PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY, + // 16, // samples + // USART_BAUDRATE_ASYNCH_ARITHMETIC, + // 0 // fraction - not used for ARITHMETIC + // )); + self->baudrate = baudrate; +} + +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + +uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // struct usart_async_status async_status; + // usart_async_get_status(usart_desc_p, &async_status); + // return async_status.rxcnt; + return 0; +} + +void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // usart_async_flush_rx_buffer(usart_desc_p); + +} + +// True if there are no characters still to be written. +bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { + if (self->tx_pin == NULL) { + return false; + } + // This assignment is only here because the usart_async routines take a *const argument. + // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + // struct usart_async_status async_status; + // usart_async_get_status(usart_desc_p, &async_status); + // return !(async_status.flags & USART_ASYNC_STATUS_BUSY); + return false; +} diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h new file mode 100644 index 0000000000..3c2bd1dac5 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t* rx_pin; + const mcu_pin_obj_t* tx_pin; + uint8_t character_bits; + bool rx_error; + uint32_t baudrate; + uint32_t timeout_ms; + uint32_t buffer_length; + uint8_t* buffer; +} busio_uart_obj_t; + +void uart_reset(void); + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_UART_H diff --git a/ports/esp32s2/common-hal/busio/__init__.c b/ports/esp32s2/common-hal/busio/__init__.c new file mode 100644 index 0000000000..41761b6743 --- /dev/null +++ b/ports/esp32s2/common-hal/busio/__init__.c @@ -0,0 +1 @@ +// No busio module functions. diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 4c39eea164..fd815518d5 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -49,6 +49,10 @@ void reset_pin_number(gpio_num_t pin_number) { in_use[pin_number / 32] &= ~(1 << pin_number % 32); } +void reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->number); +} + void reset_all_pins(void) { for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index 6f47b1ed31..573eec392b 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -35,6 +35,7 @@ void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. void reset_pin_number(gpio_num_t pin_number); +void reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index c9df81db03..9f59c1b467 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -16,10 +16,10 @@ CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANGIO = 1 CIRCUITPY_BOARD = 1 CIRCUITPY_DIGITALIO = 1 -CIRCUITPY_BUSIO = 0 +CIRCUITPY_BUSIO = 1 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index 2437b4f341..fbfbc9f2eb 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -35,6 +35,9 @@ #include "freertos/task.h" #include "common-hal/microcontroller/Pin.h" +#include "common-hal/busio/I2C.h" +#include "common-hal/busio/SPI.h" +#include "common-hal/busio/UART.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" @@ -64,8 +67,13 @@ safe_mode_t port_init(void) { } void reset_port(void) { - reset_all_pins(); + +#if CIRCUITPY_BUSIO + i2c_reset(); + spi_reset(); + uart_reset(); +#endif } void reset_to_bootloader(void) { From ae52d052cb6b4fb6cd89702dafe8448565b4aa5e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 29 May 2020 16:32:31 -0700 Subject: [PATCH 844/919] Fix I2C thanks to Mark! --- ports/esp32s2/common-hal/busio/I2C.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 80743dc894..0a696bed61 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -218,7 +218,10 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read - i2c_master_read(cmd, data, len, true); + if (len > 1) { + i2c_master_read(cmd, data, len - 1, 0); + } + i2c_master_read_byte(cmd, data + len - 1, 1); i2c_master_stop(cmd); esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100 /* wait in ticks */); i2c_cmd_link_delete(cmd); From 6f050d7af368afb3eb45ac34533727794fa66c58 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 3 Jun 2020 14:05:21 -0700 Subject: [PATCH 845/919] Add pull up testing, proper us delay and stop supporting 45 and 46 for I2C --- ports/esp32s2/common-hal/busio/I2C.c | 72 ++++++++++------------------ ports/esp32s2/mphalport.c | 3 +- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 0a696bed61..fd983619ff 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,16 +30,9 @@ #include "driver/i2c.h" -#include "esp_log.h" - #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" -// Number of times to try to send packet if failed. -#define ATTEMPTS 2 - -static const char* TAG = "CircuitPython I2C"; - typedef enum { STATUS_FREE = 0, STATUS_IN_USE, @@ -63,42 +56,43 @@ void i2c_reset(void) { void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { - - // Make sure scl and sda aren't input only + // Pins 45 and 46 are "strapping" pins that impact start up behavior. They usually need to + // be pulled-down so pulling them up for I2C is a bad idea. To make this hard, we don't + // support I2C on these pins. + // + // 46 is also input-only so it'll never work. + if (scl->number == 45 || scl->number == 46 || sda->number == 45 || sda->number == 46) { + mp_raise_ValueError(translate("Invalid pins")); + } #if CIRCUITPY_REQUIRE_I2C_PULLUPS - // // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) - // gpio_set_pin_function(sda->number, GPIO_PIN_FUNCTION_OFF); - // gpio_set_pin_function(scl->number, GPIO_PIN_FUNCTION_OFF); - // gpio_set_pin_direction(sda->number, GPIO_DIRECTION_IN); - // gpio_set_pin_direction(scl->number, GPIO_DIRECTION_IN); + // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) + gpio_set_direction(sda->number, GPIO_MODE_DEF_INPUT); + gpio_set_direction(scl->number, GPIO_MODE_DEF_INPUT); - // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_DOWN); - // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_DOWN); + gpio_pulldown_en(sda->number); + gpio_pulldown_en(scl->number); - // common_hal_mcu_delay_us(10); + common_hal_mcu_delay_us(10); - // gpio_set_pin_pull_mode(sda->number, GPIO_PULL_OFF); - // gpio_set_pin_pull_mode(scl->number, GPIO_PULL_OFF); + gpio_pulldown_dis(sda->number); + gpio_pulldown_dis(scl->number); - // // We must pull up within 3us to achieve 400khz. - // common_hal_mcu_delay_us(3); + // We must pull up within 3us to achieve 400khz. + common_hal_mcu_delay_us(3); - // if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) { - // reset_pin_number(sda->number); - // reset_pin_number(scl->number); - // mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); - // } + if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) { + reset_pin_number(sda->number); + reset_pin_number(scl->number); + mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); + } #endif - ESP_EARLY_LOGW(TAG, "create I2C"); self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); xSemaphoreGive(self->semaphore_handle); - ESP_EARLY_LOGW(TAG, "new I2C lock %x", self->semaphore_handle); self->sda_pin = sda; self->scl_pin = scl; - ESP_EARLY_LOGW(TAG, "scl %d sda %d", self->sda_pin->number, self->scl_pin->number); self->i2c_num = I2C_NUM_MAX; for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) { if (i2c_status[num] == STATUS_FREE) { @@ -120,15 +114,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, .clk_speed = frequency, } }; - // ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", &i2c_conf, &(i2c_conf.mode), i2c_conf.mode, I2C_MODE_MAX); - ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); esp_err_t result = i2c_param_config(self->i2c_num, &i2c_conf); if (result != ESP_OK) { - ESP_EARLY_LOGW(TAG, "error %d %p %d %d", result, &i2c_conf, (&i2c_conf)->mode, I2C_MODE_MAX); - vTaskDelay(0); mp_raise_ValueError(translate("Invalid pins")); } - ESP_EARLY_LOGW(TAG, "param config I2C done"); result = i2c_driver_install(self->i2c_num, I2C_MODE_MASTER, 0, @@ -140,7 +129,6 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, claim_pin(sda); claim_pin(scl); - ESP_EARLY_LOGW(TAG, "create I2C done"); } bool common_hal_busio_i2c_deinited(busio_i2c_obj_t *self) { @@ -166,19 +154,13 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1, true); i2c_master_stop(cmd); - esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 100); + esp_err_t result = i2c_master_cmd_begin(self->i2c_num, cmd, 10); i2c_cmd_link_delete(cmd); return result == ESP_OK; } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { - ESP_EARLY_LOGW(TAG, "locking I2C %x", self->semaphore_handle); self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; - if (self->has_lock) { - ESP_EARLY_LOGW(TAG, "lock grabbed"); - } else { - ESP_EARLY_LOGW(TAG, "unable to grab lock"); - } return self->has_lock; } @@ -187,7 +169,6 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { } void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { - ESP_EARLY_LOGW(TAG, "unlocking I2C"); xSemaphoreGive(self->semaphore_handle); self->has_lock = false; } @@ -213,8 +194,7 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, } uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, - uint8_t *data, size_t len) { - + uint8_t *data, size_t len) { i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, addr << 1 | 1, true); // | 1 to indicate read diff --git a/ports/esp32s2/mphalport.c b/ports/esp32s2/mphalport.c index da5258b0e2..e1662a6ce2 100644 --- a/ports/esp32s2/mphalport.c +++ b/ports/esp32s2/mphalport.c @@ -32,9 +32,10 @@ #include "py/gc.h" #include "esp-idf/components/xtensa/include/esp_debug_helpers.h" +#include "esp-idf/components/esp_rom/include/esp32s2/rom/ets_sys.h" void mp_hal_delay_us(mp_uint_t delay) { - mp_hal_delay_ms(delay / 1000); + ets_delay_us(delay); } // This is provided by the esp-idf/components/xtensa/esp32s2/libhal.a binary From a26102607e3fe5b6f888fcd246e20ac82a70af7b Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 9 Jun 2020 18:28:02 -0700 Subject: [PATCH 846/919] Add UART support --- Makefile | 9 + ports/atmel-samd/common-hal/busio/UART.c | 6 +- ports/cxd56/common-hal/busio/UART.c | 4 +- ports/esp32s2/common-hal/busio/UART.c | 480 ++++++++++------------- ports/esp32s2/common-hal/busio/UART.h | 7 +- ports/esp32s2/esp-idf | 2 +- ports/mimxrt10xx/common-hal/busio/UART.c | 4 +- ports/nrf/common-hal/busio/UART.c | 6 +- ports/stm/common-hal/busio/UART.c | 6 +- shared-bindings/busio/UART.c | 14 +- shared-bindings/busio/UART.h | 10 +- shared-module/board/__init__.c | 2 +- 12 files changed, 250 insertions(+), 300 deletions(-) diff --git a/Makefile b/Makefile index 55f64b17df..0df1950938 100644 --- a/Makefile +++ b/Makefile @@ -243,3 +243,12 @@ stubs: update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done + +one-of-each: all-source + make -C ports/atmel-samd BOARD=trinket_m0 + make -C ports/atmel-samd BOARD=feather_m4_express + make -C ports/esp32s2 BOARD=espressif_saola_1_wroom + make -C ports/litex BOARD=fomu + make -C ports/mimxrt10xx BOARD=feather_mimxrt1011 + make -C ports/nrf BOARD=feather_nrf52840_express + make -C ports/stm BOARD=feather_stm32f405_express diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 9f740dc8af..9e213e061a 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -58,7 +58,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -195,7 +195,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, SERCOM_USART_CTRLA_FORM_Msk); sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | SERCOM_USART_CTRLA_RXPO(rx_pad) | - (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); + (parity == BUSIO_UART_PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); // Enable tx and/or rx based on whether the pins were specified. // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. @@ -206,7 +206,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, SERCOM_USART_CTRLB_CHSIZE_Msk); sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | - (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | + (parity == BUSIO_UART_PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | SERCOM_USART_CTRLB_CHSIZE(bits % 8); diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index e455b0568d..52d2afc0c2 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -56,7 +56,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { struct termios tio; @@ -69,7 +69,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Could not initialize UART")); } - if (parity != PARITY_NONE) { + if (parity != BUSIO_UART_PARITY_NONE) { mp_raise_ValueError(translate("Could not initialize UART")); } diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index 4a016ad1a8..d52e50cade 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,6 +27,8 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/busio/UART.h" +#include "driver/uart.h" + #include "mpconfigport.h" #include "lib/utils/interrupt_char.h" #include "py/gc.h" @@ -36,208 +38,178 @@ #include "supervisor/shared/translate.h" #include "supervisor/shared/tick.h" -#define UART_DEBUG(...) (void)0 -// #define UART_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) - -// Do-nothing callback needed so that usart_async code will enable rx interrupts. -// See comment below re usart_async_register_callback() -// static void usart_async_rxc_callback(const struct usart_async_descriptor *const descr) { -// // Nothing needs to be done by us. -// } - void uart_reset(void) { - + for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { + // Ignore the UART used by the IDF. + #ifdef CONFIG_CONSOLE_UART_NUM + if (num == CONFIG_CONSOLE_UART_NUM) { + continue; + } + #endif + if (uart_is_driver_installed(num)) { + uart_driver_delete(num); + } + } } void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { - // uint8_t sercom_index = 255; // Unset index - // uint32_t rx_pinmux = 0; - // uint8_t rx_pad = 255; // Unset pad - // uint32_t tx_pinmux = 0; - // uint8_t tx_pad = 255; // Unset pad - - // if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - // mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); - // } - - // if (bits > 8) { - // mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); - // } + if (bits > 8) { + mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); + } bool have_tx = tx != NULL; bool have_rx = rx != NULL; + bool have_rts = rts != NULL; + bool have_cts = cts != NULL; + bool have_rs485_dir = rs485_dir != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } - self->baudrate = baudrate; - self->character_bits = bits; + // Filter for sane settings for RS485 + if (have_rs485_dir) { + if (have_rts || have_cts) { + mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); + } + } else if (rs485_invert) { + mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); + } + self->timeout_ms = timeout * 1000; - // This assignment is only here because the usart_async routines take a *const argument. -// struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; + self->uart_num = UART_NUM_MAX; + for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { + if (!uart_is_driver_installed(num)) { + self->uart_num = num; + } + } + if (self->uart_num == UART_NUM_MAX) { + mp_raise_ValueError(translate("All UART peripherals are in use")); + } -// for (int i = 0; i < NUM_SERCOMS_PER_PIN; i++) { -// Sercom* potential_sercom = NULL; -// if (have_tx) { -// sercom_index = tx->sercom[i].index; -// if (sercom_index >= SERCOM_INST_NUM) { -// continue; -// } -// potential_sercom = sercom_insts[sercom_index]; -// #ifdef SAMD21 -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0 || -// tx->sercom[i].pad == 2)) { -// continue; -// } -// #endif -// #ifdef SAMD51 -// if (potential_sercom->USART.CTRLA.bit.ENABLE != 0 || -// !(tx->sercom[i].pad == 0)) { -// continue; -// } -// #endif -// tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); -// tx_pad = tx->sercom[i].pad; -// if (rx == NULL) { -// sercom = potential_sercom; -// break; -// } -// } -// for (int j = 0; j < NUM_SERCOMS_PER_PIN; j++) { -// if (((!have_tx && rx->sercom[j].index < SERCOM_INST_NUM && -// sercom_insts[rx->sercom[j].index]->USART.CTRLA.bit.ENABLE == 0) || -// sercom_index == rx->sercom[j].index) && -// rx->sercom[j].pad != tx_pad) { -// rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); -// rx_pad = rx->sercom[j].pad; -// sercom = sercom_insts[rx->sercom[j].index]; -// sercom_index = rx->sercom[j].index; -// break; -// } -// } -// if (sercom != NULL) { -// break; -// } -// } - // if (sercom == NULL) { - // mp_raise_ValueError(translate("Invalid pins")); - // } - // if (!have_tx) { - // tx_pad = 0; - // if (rx_pad == 0) { - // tx_pad = 2; - // } - // } - // if (!have_rx) { - // rx_pad = (tx_pad + 1) % 4; - // } + uart_mode_t mode = UART_MODE_UART; + uart_hw_flowcontrol_t flow_control = UART_HW_FLOWCTRL_DISABLE; + if (have_rs485_dir) { + mode = UART_MODE_RS485_HALF_DUPLEX; + if (!rs485_invert) { + uart_set_line_inverse(self->uart_num, UART_SIGNAL_DTR_INV); + } + } else if (have_rts && have_cts) { + flow_control = UART_HW_FLOWCTRL_CTS_RTS; + } else if (have_rts) { + flow_control = UART_HW_FLOWCTRL_RTS; + } else if (have_rts) { + flow_control = UART_HW_FLOWCTRL_CTS; + } - // // Set up clocks on SERCOM. - // samd_peripherals_sercom_clock_init(sercom, sercom_index); + if (receiver_buffer_size <= UART_FIFO_LEN) { + receiver_buffer_size = UART_FIFO_LEN + 8; + } - // if (rx && receiver_buffer_size > 0) { - // self->buffer_length = receiver_buffer_size; - // // Initially allocate the UART's buffer in the long-lived part of the - // // heap. UARTs are generally long-lived objects, but the "make long- - // // lived" machinery is incapable of moving internal pointers like - // // self->buffer, so do it manually. (However, as long as internal - // // pointers like this are NOT moved, allocating the buffer - // // in the long-lived pool is not strictly necessary) - // self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); - // if (self->buffer == NULL) { - // common_hal_busio_uart_deinit(self); - // mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); - // } - // } else { - // self->buffer_length = 0; - // self->buffer = NULL; - // } - - // if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { - // mp_raise_ValueError(translate("Could not initialize UART")); - // } - - // usart_async_init() sets a number of defaults based on a prototypical SERCOM - // which don't necessarily match what we need. After calling it, set the values - // specific to this instantiation of UART. - - // Set pads computed for this SERCOM. - // TXPO: - // 0x0: TX pad 0; no RTS/CTS - // 0x1: TX pad 2; no RTS/CTS - // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) - // So divide by 2 to map pad to value. - // RXPO: - // 0x0: RX pad 0 - // 0x1: RX pad 1 - // 0x2: RX pad 2 - // 0x3: RX pad 3 - - // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. - - // sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | - // SERCOM_USART_CTRLA_RXPO_Msk | - // SERCOM_USART_CTRLA_FORM_Msk); - // sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | - // SERCOM_USART_CTRLA_RXPO(rx_pad) | - // (parity == PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); - - // Enable tx and/or rx based on whether the pins were specified. - // CHSIZE is 0 for 8 bits, 5, 6, 7 for 5, 6, 7 bits. 1 for 9 bits, but we don't support that. - // sercom->USART.CTRLB.reg &= ~(SERCOM_USART_CTRLB_TXEN | - // SERCOM_USART_CTRLB_RXEN | - // SERCOM_USART_CTRLB_PMODE | - // SERCOM_USART_CTRLB_SBMODE | - // SERCOM_USART_CTRLB_CHSIZE_Msk); - // sercom->USART.CTRLB.reg |= (have_tx ? SERCOM_USART_CTRLB_TXEN : 0) | - // (have_rx ? SERCOM_USART_CTRLB_RXEN : 0) | - // (parity == PARITY_ODD ? SERCOM_USART_CTRLB_PMODE : 0) | - // (stop > 1 ? SERCOM_USART_CTRLB_SBMODE : 0) | - // SERCOM_USART_CTRLB_CHSIZE(bits % 8); + uint8_t rx_threshold = UART_FIFO_LEN - 8; + // Install the driver before we change the settings. + if (uart_driver_install(self->uart_num, receiver_buffer_size, 0, 0, NULL, 0) != ESP_OK || + uart_set_mode(self->uart_num, mode) != ESP_OK) { + mp_raise_ValueError(translate("Could not initialize UART")); + } + uart_set_hw_flow_ctrl(self->uart_num, flow_control, rx_threshold); // Set baud rate - // common_hal_busio_uart_set_baudrate(self, baudrate); + common_hal_busio_uart_set_baudrate(self, baudrate); - // Turn on rx interrupt handling. The UART async driver has its own set of internal callbacks, - // which are set up by uart_async_init(). These in turn can call user-specified callbacks. - // In fact, the actual interrupts are not enabled unless we set up a user-specified callback. - // This is confusing. It's explained in the Atmel START User Guide -> Implementation Description -> - // Different read function behavior in some asynchronous drivers. As of this writing: - // http://start.atmel.com/static/help/index.html?GUID-79201A5A-226F-4FBB-B0B8-AB0BE0554836 - // Look at the ASFv4 code example for async USART. - // usart_async_register_callback(usart_desc_p, USART_ASYNC_RXC_CB, usart_async_rxc_callback); + uart_word_length_t word_length = UART_DATA_8_BITS; + switch (bits) { + // Shared bindings prevents data < 7 bits. + // case 5: + // word_length = UART_DATA_5_BITS; + // break; + // case 6: + // word_length = UART_DATA_6_BITS; + // break; + case 7: + word_length = UART_DATA_7_BITS; + break; + case 8: + word_length = UART_DATA_8_BITS; + break; + default: + // Won't hit this because shared-bindings limits to 7-9 bits. We error on 9 above. + break; + } + uart_set_word_length(self->uart_num, word_length); + uart_parity_t parity_mode = UART_PARITY_DISABLE; + switch (parity) { + case BUSIO_UART_PARITY_NONE: + parity_mode = UART_PARITY_DISABLE; + break; + case BUSIO_UART_PARITY_EVEN: + parity_mode = UART_PARITY_EVEN; + break; + case BUSIO_UART_PARITY_ODD: + parity_mode = UART_PARITY_ODD; + break; + default: + // Won't reach here because the input is an enum that is completely handled. + break; + } + uart_set_parity(self->uart_num, parity_mode); - // if (have_tx) { - // gpio_set_pin_direction(tx->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(tx->number, GPIO_PULL_OFF); - // gpio_set_pin_function(tx->number, tx_pinmux); - // self->tx_pin = tx->number; - // claim_pin(tx); - // } else { - // self->tx_pin = NO_PIN; - // } + // Stop is 1 or 2 always. + uart_stop_bits_t stop_bits= UART_STOP_BITS_1; + if (stop == 2) { + stop_bits = UART_STOP_BITS_2; + } + uart_set_stop_bits(self->uart_num, stop_bits); - // if (have_rx) { - // gpio_set_pin_direction(rx->number, GPIO_DIRECTION_IN); - // gpio_set_pin_pull_mode(rx->number, GPIO_PULL_OFF); - // gpio_set_pin_function(rx->number, rx_pinmux); - // self->rx_pin = rx->number; - // claim_pin(rx); - // } else { - // self->rx_pin = NO_PIN; - // } + self->tx_pin = NULL; + self->rx_pin = NULL; + self->rts_pin = NULL; + self->cts_pin = NULL; + int tx_num = -1; + int rx_num = -1; + int rts_num = -1; + int cts_num = -1; + if (have_tx) { + claim_pin(tx); + self->tx_pin = tx; + tx_num = tx->number; + } - // usart_async_enable(usart_desc_p); + if (have_rx) { + claim_pin(rx); + self->rx_pin = rx; + rx_num = rx->number; + } + + if (have_rts) { + claim_pin(rts); + self->rts_pin = rts; + rts_num = rts->number; + } + + if (have_cts) { + claim_pin(cts); + self->cts_pin = cts; + cts_num = cts->number; + } + + if (have_rs485_dir) { + claim_pin(rs485_dir); + // RTS is used for RS485 direction. + self->rts_pin = rs485_dir; + rts_num = rs485_dir->number; + } + if (uart_set_pin(self->uart_num, tx_num, rx_num, rts_num, cts_num) != ESP_OK) { + mp_raise_ValueError(translate("Invalid pins")); + } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -248,14 +220,16 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) { return; } - // // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_disable(usart_desc_p); - // usart_async_deinit(usart_desc_p); + uart_driver_delete(self->uart_num); + reset_pin(self->rx_pin); reset_pin(self->tx_pin); + reset_pin(self->rts_pin); + reset_pin(self->cts_pin); self->rx_pin = NULL; self->tx_pin = NULL; + self->cts_pin = NULL; + self->rts_pin = NULL; } // Read characters. @@ -263,57 +237,49 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t if (self->rx_pin == NULL) { mp_raise_ValueError(translate("No RX pin")); } - - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - if (len == 0) { // Nothing to read. return 0; } - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - // size_t total_read = 0; - // uint64_t start_ticks = supervisor_ticks_ms64(); + size_t total_read = 0; + uint64_t start_ticks = supervisor_ticks_ms64(); // Busy-wait until timeout or until we've read enough chars. - // while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { - // // Read as many chars as we can right now, up to len. - // size_t num_read = io_read(io, data, len); + while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { + // Read as many chars as we can right now, up to len. + size_t num_read = uart_read_bytes(self->uart_num, data, len, 0); - // // Advance pointer in data buffer, and decrease how many chars left to read. - // data += num_read; - // len -= num_read; - // total_read += num_read; - // if (len == 0) { - // // Don't need to read any more: data buf is full. - // break; - // } - // if (num_read > 0) { - // // Reset the timeout on every character read. - // start_ticks = supervisor_ticks_ms64(); - // } - // RUN_BACKGROUND_TASKS; - // // Allow user to break out of a timeout with a KeyboardInterrupt. - // if (mp_hal_is_interrupted()) { - // break; - // } - // // If we are zero timeout, make sure we don't loop again (in the event - // // we read in under 1ms) - // if (self->timeout_ms == 0) { - // break; - // } - // } + // Advance pointer in data buffer, and decrease how many chars left to read. + data += num_read; + len -= num_read; + total_read += num_read; + if (len == 0) { + // Don't need to read any more: data buf is full. + break; + } + if (num_read > 0) { + // Reset the timeout on every character read. + start_ticks = supervisor_ticks_ms64(); + } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + break; + } + // If we are zero timeout, make sure we don't loop again (in the event + // we read in under 1ms) + if (self->timeout_ms == 0) { + break; + } + } - // if (total_read == 0) { - // *errcode = EAGAIN; - // return MP_STREAM_ERROR; - // } + if (total_read == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } - // return total_read; - return 0; + return total_read; } // Write characters. @@ -322,49 +288,34 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, mp_raise_ValueError(translate("No TX pin")); } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - - // struct io_descriptor *io; - // usart_async_get_io_descriptor(usart_desc_p, &io); - - // // Start writing characters. This is non-blocking and will - // // return immediately after setting up the write. - // if (io_write(io, data, len) < 0) { - // *errcode = MP_EAGAIN; - // return MP_STREAM_ERROR; - // } - - // // Busy-wait until all characters transmitted. - // struct usart_async_status async_status; - // while (true) { - // usart_async_get_status(usart_desc_p, &async_status); - // if (async_status.txcnt >= len) { - // break; - // } - // RUN_BACKGROUND_TASKS; - // } + while (len > 0) { + int count = uart_tx_chars(self->uart_num, (const char*) data, len); + if (count < 0) { + *errcode = MP_EAGAIN; + return MP_STREAM_ERROR; + } + len -= count; + data += count; + RUN_BACKGROUND_TASKS; + } + while (uart_wait_tx_done(self->uart_num, 0) == ESP_ERR_TIMEOUT) { + RUN_BACKGROUND_TASKS; + } return len; } uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { - return self->baudrate; + uint32_t baudrate; + uart_get_baudrate(self->uart_num, &baudrate); + return baudrate; } void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_set_baud_rate(usart_desc_p, - // // Samples and ARITHMETIC vs FRACTIONAL must correspond to USART_SAMPR in - // // hpl_sercom_config.h. - // _usart_async_calculate_baud_rate(baudrate, // e.g. 9600 baud - // PROTOTYPE_SERCOM_USART_ASYNC_CLOCK_FREQUENCY, - // 16, // samples - // USART_BAUDRATE_ASYNCH_ARITHMETIC, - // 0 // fraction - not used for ARITHMETIC - // )); - self->baudrate = baudrate; + if (baudrate > UART_BITRATE_MAX || + uart_set_baudrate(self->uart_num, baudrate) != ESP_OK) { + mp_raise_ValueError(translate("Unsupported baudrate")); + } } mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { @@ -376,19 +327,13 @@ void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeou } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return async_status.rxcnt; - return 0; + size_t count; + uart_get_buffered_data_len(self->uart_num, &count); + return count; } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // usart_async_flush_rx_buffer(usart_desc_p); - + uart_flush(self->uart_num); } // True if there are no characters still to be written. @@ -396,10 +341,5 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { if (self->tx_pin == NULL) { return false; } - // This assignment is only here because the usart_async routines take a *const argument. - // struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc; - // struct usart_async_status async_status; - // usart_async_get_status(usart_desc_p, &async_status); - // return !(async_status.flags & USART_ASYNC_STATUS_BUSY); - return false; + return uart_wait_tx_done(self->uart_num, 0) != ESP_ERR_TIMEOUT; } diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/esp32s2/common-hal/busio/UART.h index 3c2bd1dac5..b3cc929665 100644 --- a/ports/esp32s2/common-hal/busio/UART.h +++ b/ports/esp32s2/common-hal/busio/UART.h @@ -29,18 +29,19 @@ #include "common-hal/microcontroller/Pin.h" +#include "esp-idf/components/soc/include/hal/uart_types.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; const mcu_pin_obj_t* rx_pin; const mcu_pin_obj_t* tx_pin; + const mcu_pin_obj_t* rts_pin; + const mcu_pin_obj_t* cts_pin; + uart_port_t uart_num; uint8_t character_bits; bool rx_error; - uint32_t baudrate; uint32_t timeout_ms; - uint32_t buffer_length; - uint8_t* buffer; } busio_uart_obj_t; void uart_reset(void); diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 7aae7f034b..648f959037 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 7aae7f034bab68d2dd6aaa763924c91eb697d87e +Subproject commit 648f959037896cff887a05b67105748790bfe63a diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 5ef347e591..4ca2f8e497 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -85,7 +85,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -94,7 +94,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->timeout_ms = timeout * 1000; // We are transmitting one direction if one pin is NULL and the other isn't. - bool is_onedirection = (rx != NULL) != (tx != NULL); + bool is_onedirection = (rx == NULL) != (tx == NULL); bool uart_taken = false; const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 89f3c9f327..012ebc3b5e 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -133,7 +133,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -162,7 +162,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Invalid buffer size")); } - if ( parity == PARITY_ODD ) { + if ( parity == BUSIO_UART_PARITY_ODD ) { mp_raise_ValueError(translate("Odd parity is not supported")); } @@ -176,7 +176,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, .interrupt_priority = 7, .hal_cfg = { .hwfc = NRF_UARTE_HWFC_DISABLED, - .parity = (parity == PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED + .parity = (parity == BUSIO_UART_PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED } }; diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 86a932290a..7450f9897a 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -79,7 +79,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled) { @@ -201,8 +201,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->handle.Init.BaudRate = baudrate; self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; - self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : - (parity == PARITY_EVEN) ? UART_PARITY_EVEN : + self->handle.Init.Parity = (parity == BUSIO_UART_PARITY_ODD) ? UART_PARITY_ODD : + (parity == BUSIO_UART_PARITY_EVEN) ? UART_PARITY_EVEN : UART_PARITY_NONE; self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : (self->tx != NULL) ? UART_MODE_TX : diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 8c0811266c..018ded1828 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -52,8 +52,8 @@ //| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only. //| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use. //| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use. -//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use. -//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin. +//| :param ~microcontroller.Pin rs485_dir: the output pin for rs485 direction setting, or ``None`` if rs485 not in use. +//| :param bool rs485_invert: rs485_dir pin active high when set. Active low otherwise. //| :param int baudrate: the transmit and receive speed. //| :param int bits: the number of bits per byte, 7, 8 or 9. //| :param Parity parity: the parity used for error checking. @@ -87,8 +87,8 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co enum { ARG_tx, ARG_rx, ARG_baudrate, ARG_bits, ARG_parity, ARG_stop, ARG_timeout, ARG_receiver_buffer_size, ARG_rts, ARG_cts, ARG_rs485_dir,ARG_rs485_invert}; static const mp_arg_t allowed_args[] = { - { MP_QSTR_tx, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_rx, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_tx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_rx, MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_baudrate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 9600} }, { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, { MP_QSTR_parity, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, @@ -115,11 +115,11 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co mp_raise_ValueError(translate("bits must be 7, 8 or 9")); } - uart_parity_t parity = PARITY_NONE; + busio_uart_parity_t parity = BUSIO_UART_PARITY_NONE; if (args[ARG_parity].u_obj == &busio_uart_parity_even_obj) { - parity = PARITY_EVEN; + parity = BUSIO_UART_PARITY_EVEN; } else if (args[ARG_parity].u_obj == &busio_uart_parity_odd_obj) { - parity = PARITY_ODD; + parity = BUSIO_UART_PARITY_ODD; } uint8_t stop = args[ARG_stop].u_int; diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h index 3aed4e534c..ce8da1445c 100644 --- a/shared-bindings/busio/UART.h +++ b/shared-bindings/busio/UART.h @@ -34,17 +34,17 @@ extern const mp_obj_type_t busio_uart_type; typedef enum { - PARITY_NONE, - PARITY_EVEN, - PARITY_ODD -} uart_parity_t; + BUSIO_UART_PARITY_NONE, + BUSIO_UART_PARITY_EVEN, + BUSIO_UART_PARITY_ODD +} busio_uart_parity_t; // Construct an underlying UART object. extern void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, const mcu_pin_obj_t * rts, const mcu_pin_obj_t * cts, const mcu_pin_obj_t * rs485_dir, bool rs485_invert, - uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, + uint32_t baudrate, uint8_t bits, busio_uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer, bool sigint_enabled); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 0fbf916cd9..2c9139d8af 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -123,7 +123,7 @@ mp_obj_t common_hal_board_create_uart(void) { #endif common_hal_busio_uart_construct(self, tx, rx, rts, cts, rs485_dir, rs485_invert, - 9600, 8, PARITY_NONE, 1, 1.0f, 64, NULL, false); + 9600, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, 64, NULL, false); MP_STATE_VM(shared_uart_bus) = MP_OBJ_FROM_PTR(self); return MP_STATE_VM(shared_uart_bus); } From 7b56617f8ef6cf9af9a5a8dbdadbc678918d52ca Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 10 Jun 2020 13:50:10 -0700 Subject: [PATCH 847/919] Turn off stub so flash works over native usb --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 4eac07f99f..570eab0213 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -275,7 +275,7 @@ $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BU $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin flash: $(BUILD)/firmware.bin - esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ include $(TOP)/py/mkrules.mk From f52f60b17d7fe5b7f139484e8b9988e3cf96eac1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Jun 2020 10:57:52 -0700 Subject: [PATCH 848/919] Add UF2 build target --- ports/esp32s2/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 570eab0213..29504065e9 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -258,7 +258,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-id FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) -all: $(BUILD)/firmware.bin +all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 $(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD) $(STEPECHO) "LINK $@" @@ -274,6 +274,10 @@ $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BUILD)/esp-idf/bootloader/bootloader.bin $(BUILD)/circuitpython-firmware.bin $(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin +$(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin + $(STEPECHO) "Create $@" + $(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^ + flash: $(BUILD)/firmware.bin esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ From fc9c0ba5731a7eb1188366841a9a564074e7052f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Jun 2020 13:45:21 -0700 Subject: [PATCH 849/919] Initial SPI implementation. Almost certainly doesn't compile --- .../espressif_saola_1_wroom/mpconfigboard.mk | 2 - .../boards/unexpectedmaker_feathers2/board.c | 56 ++++ .../unexpectedmaker_feathers2/mpconfigboard.h | 36 +++ .../mpconfigboard.mk | 21 ++ .../boards/unexpectedmaker_feathers2/pins.c | 57 ++++ .../unexpectedmaker_feathers2/sdkconfig | 0 ports/esp32s2/common-hal/busio/I2C.c | 4 +- ports/esp32s2/common-hal/busio/SPI.c | 282 +++++++++++------- ports/esp32s2/common-hal/busio/SPI.h | 12 +- ports/esp32s2/common-hal/busio/UART.c | 8 +- .../esp32s2/common-hal/microcontroller/Pin.c | 5 +- .../esp32s2/common-hal/microcontroller/Pin.h | 5 +- 12 files changed, 366 insertions(+), 122 deletions(-) create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/board.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c create mode 100644 ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk index cd27356153..94e3b60f2d 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_DIGITALIO = 0 -CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c new file mode 100644 index 0000000000..8890ec4c16 --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c @@ -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 + never_reset_pin(&pin_GPIO19); + never_reset_pin(&pin_GPIO20); + + // Debug UART + never_reset_pin(&pin_GPIO43); + never_reset_pin(&pin_GPIO44); + + // SPI Flash and RAM + never_reset_pin(&pin_GPIO26); + never_reset_pin(&pin_GPIO27); + never_reset_pin(&pin_GPIO28); + never_reset_pin(&pin_GPIO29); + never_reset_pin(&pin_GPIO30); + never_reset_pin(&pin_GPIO31); + never_reset_pin(&pin_GPIO32); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h new file mode 100644 index 0000000000..93fb0c573d --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//Micropython setup + +#define MICROPY_HW_BOARD_NAME "FeatherS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define AUTORESET_DELAY_MS 500 + +// Doesn't work with this on. +// #define MICROPY_HW_APA102_MOSI (&pin_GPIO44) +// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk new file mode 100644 index 0000000000..ea3484d2fa --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x80AC +USB_PRODUCT = "FeatherS2" +USB_MANUFACTURER = "UnexpectedMaker" +USB_DEVICES = "CDC,MSC,HID" + + +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=qio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB + +CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c new file mode 100644 index 0000000000..e8dd2edf6a --- /dev/null +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -0,0 +1,57 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + // Moving to 9 and 8 + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO44) }, // MTDO + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index fd983619ff..51817c95e2 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -143,8 +143,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { i2c_driver_delete(self->i2c_num); i2c_status[self->i2c_num] = STATUS_FREE; - reset_pin(self->sda_pin); - reset_pin(self->scl_pin); + common_hal_reset_pin(self->sda_pin); + common_hal_reset_pin(self->scl_pin); self->sda_pin = NULL; self->scl_pin = NULL; } diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index e761eb49be..92a3dd4436 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,84 +32,141 @@ #include "common-hal/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" -void spi_reset(void) { +static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; +void spi_reset(void) { + for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) { + if (spi_never_reset[host_id]) { + continue; + } + spi_bus_free(host_id); + } +} + +// This is copied in from the ESP-IDF because it is static. +// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* bus_config) +{ + if (bus_config->sclk_io_num>=0 && + bus_config->sclk_io_num != spi_periph_signal[host].spiclk_iomux_pin) return false; + if (bus_config->quadwp_io_num>=0 && + bus_config->quadwp_io_num != spi_periph_signal[host].spiwp_iomux_pin) return false; + if (bus_config->quadhd_io_num>=0 && + bus_config->quadhd_io_num != spi_periph_signal[host].spihd_iomux_pin) return false; + if (bus_config->mosi_io_num >= 0 && + bus_config->mosi_io_num != spi_periph_signal[host].spid_iomux_pin) return false; + if (bus_config->miso_io_num>=0 && + bus_config->miso_io_num != spi_periph_signal[host].spiq_iomux_pin) return false; + + return true; +} + +// End copied code. + +static bool spi_bus_free(spi_host_device_t host_id) { + return spi_bus_get_attr(host_id) == NULL; } void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { - // uint8_t sercom_index; - // uint32_t clock_pinmux = 0; - // bool mosi_none = mosi == NULL; - // bool miso_none = miso == NULL; - // uint32_t mosi_pinmux = 0; - // uint32_t miso_pinmux = 0; - // uint8_t clock_pad = 0; - // uint8_t mosi_pad = 0; - // uint8_t miso_pad = 0; - // uint8_t dopo = 255; + spi_bus_config_t bus_config; + bus_config.mosi_io_num = mosi != NULL ? mosi->number : -1; + bus_config.miso_io_num = miso != NULL ? miso->number : -1; + bus_config.sclk_io_num = clock != NULL ? clock->number : -1; + bus_config.quadwp_io_num = -1; + bus_config.quadhd_io_num = -1; + bus_config.max_transfer_sz = 0; // Uses the default + bus_config.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_SCLK | + mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0 | + miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0; + bus_config.intr_flags = 0; - // if (sercom == NULL) { - // mp_raise_ValueError(translate("Invalid pins")); - // } + // RAM and Flash is often on SPI1 and is unsupported by the IDF so use it as + // a flag value. + spi_host_device_t host_id = SPI1_HOST; + self->connected_through_gpio = true; + // Try and save SPI2 for pins that are on the IOMUX + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_free(SPI2_HOST)) { + host_id = SPI2_HOST; + self->connected_through_gpio = false; + } else if (spi_bus_free(SPI3_HOST)) { + host_id = SPI3_HOST; + } else if (spi_bus_free(SPI2_HOST)) { + host_id = SPI2_HOST; + } + if (host_id == SPI1_HOST) { + mp_raise_ValueError(translate("All SPI peripherals are in use")); + } - // // Set up SPI clocks on SERCOM. - // samd_peripherals_sercom_clock_init(sercom, sercom_index); + esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } else if (result = ESP_INVALID_ARG) { + mp_raise_ValueError(translate("Invalid pins")); + } + spi_bus_lock_dev_config_t config = { .flags = 0 }; + result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, + spi_bus_lock_dev_config_t *config, + &self->lock); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } - #if defined(MICROPY_HW_APA102_SCK) && defined(MICROPY_HW_APA102_MOSI) && !CIRCUITPY_BITBANG_APA102 - // // if we're re-using the dotstar sercom, make sure it is disabled or the init will fail out - // hri_sercomspi_clear_CTRLA_ENABLE_bit(sercom); - #endif - // if (spi_m_sync_init(&self->spi_desc, sercom) != ERR_NONE) { - // mp_raise_OSError(MP_EIO); - // } - // Pads must be set after spi_m_sync_init(), which uses default values from - // the prototypical SERCOM. - // hri_sercomspi_write_CTRLA_DOPO_bf(sercom, dopo); - // hri_sercomspi_write_CTRLA_DIPO_bf(sercom, miso_pad); + err = esp_intr_alloc(spicommon_irqsource_for_host(host_id), + bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, + spi_interrupt_handler, self, &self->intr); + if (result == ESP_ERR_NO_MEM) { + mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); + } - // Always start at 250khz which is what SD cards need. They are sensitive to - // SPI bus noise before they are put into SPI mode. - // uint8_t baud_value = samd_peripherals_spi_baudrate_to_baud_reg_value(250000); - // if (spi_m_sync_set_baudrate(&self->spi_desc, baud_value) != ERR_NONE) { - // // spi_m_sync_set_baudrate does not check for validity, just whether the device is - // // busy or not - // mp_raise_OSError(MP_EIO); - // } + spi_hal_context_t* hal = &self->hal_context; + hal->hw = NULL; // Set by spi_hal_init + hal->dmadesc_tx = NULL; + hal->dmadesc_rx = NULL; + hal->dmadesc_n = 0; - // gpio_set_pin_direction(clock->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(clock->number, GPIO_PULL_OFF); - // gpio_set_pin_function(clock->number, clock_pinmux); - // claim_pin(clock); - // self->clock_pin = clock->number; + // We don't use native CS. + hal->cs_setup = 0; + hal->cs_hold = 0; + hal->cs_pin_id = -1; + hal->timing_conf = &self->timing_conf; - // if (mosi_none) { - // self->MOSI_pin = NO_PIN; - // } else { - // gpio_set_pin_direction(mosi->number, GPIO_DIRECTION_OUT); - // gpio_set_pin_pull_mode(mosi->number, GPIO_PULL_OFF); - // gpio_set_pin_function(mosi->number, mosi_pinmux); - // self->MOSI_pin = mosi->number; - // claim_pin(mosi); - // } + hal->sio = 1; + hal->half_duplex = 0; + hal->tx_lsbfirst = 0; + hal->rx_lsbfirst = 0; + hal->dma_enabled = 0; + hal->no_compensate = 1; + // Ignore CS bits - // if (miso_none) { - // self->MISO_pin = NO_PIN; - // } else { - // gpio_set_pin_direction(miso->number, GPIO_DIRECTION_IN); - // gpio_set_pin_pull_mode(miso->number, GPIO_PULL_OFF); - // gpio_set_pin_function(miso->number, miso_pinmux); - // self->MISO_pin = miso->number; - // claim_pin(miso); - // } + // We don't use cmd, addr or dummy bits. + hal->cmd = 0; + hal->cmd_bits = 0; + hal->addr_bits = 0; + hal->dummy_bits = 0; + hal->addr = 0; - // spi_m_sync_enable(&self->spi_desc); + hal->io_mode = SPI_LL_IO_MODE_NORMAL; + + spi_hal_init(hal, host_id); } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { - // never_reset_sercom(self->spi_desc.dev.prvt); + spi_never_reset[self->host_id] = true; never_reset_pin(self->clock_pin); never_reset_pin(self->MOSI_pin); @@ -124,51 +181,50 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { if (common_hal_busio_spi_deinited(self)) { return; } - // allow_reset_sercom(self->spi_desc.dev.prvt); + spi_never_reset[self->host_id] = false; + spi_bus_free(self->host_id); - // spi_m_sync_disable(&self->spi_desc); - // spi_m_sync_deinit(&self->spi_desc); - reset_pin(self->clock_pin); - reset_pin(self->MOSI_pin); - reset_pin(self->MISO_pin); + common_hal_reset_pin(self->clock_pin); + common_hal_reset_pin(self->MOSI_pin); + common_hal_reset_pin(self->MISO_pin); self->clock_pin = NULL; } bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) { - // If the settings are already what we want then don't reset them. - // if (hri_sercomspi_get_CTRLA_CPHA_bit(hw) == phase && - // hri_sercomspi_get_CTRLA_CPOL_bit(hw) == polarity && - // hri_sercomspi_read_CTRLB_CHSIZE_bf(hw) == ((uint32_t)bits - 8) && - // hri_sercomspi_read_BAUD_BAUD_bf(hw) == baud_reg_value) { - // return true; - // } - - // Disable, set values (most or all are enable-protected), and re-enable. - // spi_m_sync_disable(&self->spi_desc); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); - - // hri_sercomspi_write_CTRLA_CPHA_bit(hw, phase); - // hri_sercomspi_write_CTRLA_CPOL_bit(hw, polarity); - // hri_sercomspi_write_CTRLB_CHSIZE_bf(hw, bits - 8); - // hri_sercomspi_write_BAUD_BAUD_bf(hw, baud_reg_value); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); - - // spi_m_sync_enable(&self->spi_desc); - // hri_sercomspi_wait_for_sync(hw, SERCOM_SPI_SYNCBUSY_MASK); + if (baudrate == self->target_frequency && + polarity == self->polarity && + phase == self->phase && + bits == self->bits) { + return true; + } + self->hal_context->mode = polarity << 1 | phase; + self->polarity = polarity; + self->phase = phase; + self->bits = bits; + self->target_frequency = baudrate; + esp_err_t result = spi_hal_get_clock_conf(self->hal_context, + self->target_frequency, + 128 /* duty_cycle */, + self->connected_through_gpio, + 0 /* input_delay_ns */, + &self->real_frequency, + &self->timing_conf); + spi_hal_setup_device(&self->hal_context); return true; } bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { - bool grabbed_lock = false; - // CRITICAL_SECTION_ENTER() - if (!self->has_lock) { - grabbed_lock = true; - self->has_lock = true; - } - // CRITICAL_SECTION_LEAVE(); - return grabbed_lock; + // If our lock has already been taken then return false because someone else + // may already grabbed it in our call stack. + if (self->has_lock) { + return false; + } + // Wait to grab the lock from another task. + esp_err_t ret = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); + self->has_lock = true; + return true; } bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { @@ -176,6 +232,7 @@ bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { } void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { + spi_bus_lock_acquire_end(self->lock); self->has_lock = false; } @@ -218,32 +275,35 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin if (len == 0) { return true; } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); + + spi_hal_context_t* hal = &self->hal_context; + hal->tx_bitlen = len * 8; + hal->rx_bitlen = len * 8; + hal->send_buffer = data_out; + hal->rcv_buffer = data_in; + + spi_hal_setup_trans(hal); + spi_hal_prepare_data(hal); + spi_hal_user_start(hal); + if (len >= 16 && false) { + // Set up the interrupt and wait on the lock. } else { - // struct spi_xfer xfer; - // xfer.txbuf = data_out; - // xfer.rxbuf = data_in; - // xfer.size = len; - // status = spi_m_sync_transfer(&self->spi_desc, &xfer); + while (!spi_hal_usr_is_done(hal)) { + RUN_BACKGROUND_TASKS(); + } } - return false; // Status is number of chars read or an error code < 0. + + return false; } uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { - // return samd_peripherals_spi_baud_reg_value_to_baudrate(hri_sercomspi_read_BAUD_reg(self->spi_desc.dev.prvt)); - return 0; + return self->real_frequency; } uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { - // void * hw = self->spi_desc.dev.prvt; - // return hri_sercomspi_get_CTRLA_CPHA_bit(hw); - return 0; + return self->phase; } uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { - // void * hw = self->spi_desc.dev.prvt; - // return hri_sercomspi_get_CTRLA_CPOL_bit(hw); - return 0; + return self->polarity; } diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 0ff1a4f7ea..0c2f286078 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -33,10 +33,20 @@ typedef struct { mp_obj_base_t base; - bool has_lock; const mcu_pin_obj_t* clock_pin; const mcu_pin_obj_t* MOSI_pin; const mcu_pin_obj_t* MISO_pin; + spi_host_device_t host_id; + spi_bus_lock_dev_handle_t lock; + spi_hal_context_t hal_context; + spi_hal_timing_conf_t timing_conf; + uint32_t target_frequency; + uint32_t real_frequency; + uint8_t polarity; + uint8_t phase; + uint8_t bits; + bool has_lock; + bool connected_through_gpio; } busio_spi_obj_t; void spi_reset(void); diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index d52e50cade..f73f5c993d 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -222,10 +222,10 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { } uart_driver_delete(self->uart_num); - reset_pin(self->rx_pin); - reset_pin(self->tx_pin); - reset_pin(self->rts_pin); - reset_pin(self->cts_pin); + common_hal_reset_pin(self->rx_pin); + common_hal_reset_pin(self->tx_pin); + common_hal_reset_pin(self->rts_pin); + common_hal_reset_pin(self->cts_pin); self->rx_pin = NULL; self->tx_pin = NULL; self->cts_pin = NULL; diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index fd815518d5..075f80abc6 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -35,6 +35,9 @@ STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; +bool apa102_mosi_in_use; +bool apa102_sck_in_use; + void never_reset_pin_number(gpio_num_t pin_number) { never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } @@ -49,7 +52,7 @@ void reset_pin_number(gpio_num_t pin_number) { in_use[pin_number / 32] &= ~(1 << pin_number % 32); } -void reset_pin(const mcu_pin_obj_t* pin) { +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { reset_pin_number(pin->number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index 573eec392b..ab06b388f8 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -31,11 +31,14 @@ #include "peripherals/pins.h" +extern bool apa102_mosi_in_use; +extern bool apa102_sck_in_use; + void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. void reset_pin_number(gpio_num_t pin_number); -void reset_pin(const mcu_pin_obj_t* pin); +void common_hal_reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); From c5fa9730a87b47f569a2bc4a7599e67b198826e6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Jun 2020 12:58:01 -0700 Subject: [PATCH 850/919] Compiles! --- ports/atmel-samd/common-hal/busio/SPI.c | 4 +- .../espressif_saola_1_wrover/mpconfigboard.mk | 2 - ports/esp32s2/common-hal/busio/SPI.c | 82 ++++++++----------- ports/esp32s2/common-hal/busio/SPI.h | 6 +- ports/esp32s2/esp-idf | 2 +- ports/mimxrt10xx/common-hal/busio/SPI.c | 4 +- ports/nrf/common-hal/busio/SPI.c | 6 +- ports/stm/common-hal/busio/SPI.c | 4 +- shared-bindings/busio/SPI.h | 2 +- 9 files changed, 48 insertions(+), 64 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 1dc389027d..921713d690 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -341,7 +341,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return status >= 0; // Status is number of chars read or an error code < 0. } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } @@ -350,7 +350,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin status = sercom_dma_transfer(self->spi_desc.dev.prvt, data_out, data_in, len); } else { struct spi_xfer xfer; - xfer.txbuf = data_out; + xfer.txbuf = (uint8_t*) data_out; xfer.rxbuf = data_in; xfer.size = len; status = spi_m_sync_transfer(&self->spi_desc, &xfer); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk index 0b847de943..08f2770f58 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_DIGITALIO = 0 -CIRCUITPY_MICROCONTROLLER = 0 CIRCUITPY_ESP_FLASH_MODE=dio CIRCUITPY_ESP_FLASH_FREQ=40m diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 92a3dd4436..db28dee661 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -75,10 +75,14 @@ static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* // End copied code. -static bool spi_bus_free(spi_host_device_t host_id) { +static bool _spi_bus_free(spi_host_device_t host_id) { return spi_bus_get_attr(host_id) == NULL; } +static void spi_interrupt_handler(void *arg) { + +} + void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { @@ -90,8 +94,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, bus_config.quadhd_io_num = -1; bus_config.max_transfer_sz = 0; // Uses the default bus_config.flags = SPICOMMON_BUSFLAG_MASTER | SPICOMMON_BUSFLAG_SCLK | - mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0 | - miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0; + (mosi != NULL ? SPICOMMON_BUSFLAG_MOSI : 0) | + (miso != NULL ? SPICOMMON_BUSFLAG_MISO : 0); bus_config.intr_flags = 0; // RAM and Flash is often on SPI1 and is unsupported by the IDF so use it as @@ -99,12 +103,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_host_device_t host_id = SPI1_HOST; self->connected_through_gpio = true; // Try and save SPI2 for pins that are on the IOMUX - if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_free(SPI2_HOST)) { + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && _spi_bus_free(SPI2_HOST)) { host_id = SPI2_HOST; self->connected_through_gpio = false; - } else if (spi_bus_free(SPI3_HOST)) { + } else if (_spi_bus_free(SPI3_HOST)) { host_id = SPI3_HOST; - } else if (spi_bus_free(SPI2_HOST)) { + } else if (_spi_bus_free(SPI2_HOST)) { host_id = SPI2_HOST; } if (host_id == SPI1_HOST) { @@ -114,21 +118,21 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); - } else if (result = ESP_INVALID_ARG) { + } else if (result == ESP_ERR_INVALID_ARG) { mp_raise_ValueError(translate("Invalid pins")); } spi_bus_lock_dev_config_t config = { .flags = 0 }; result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, - spi_bus_lock_dev_config_t *config, + &config, &self->lock); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } - err = esp_intr_alloc(spicommon_irqsource_for_host(host_id), - bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, - spi_interrupt_handler, self, &self->intr); + result = esp_intr_alloc(spicommon_irqsource_for_host(host_id), + bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, + spi_interrupt_handler, self, &self->interrupt); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } @@ -198,18 +202,21 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, bits == self->bits) { return true; } - self->hal_context->mode = polarity << 1 | phase; + self->hal_context.mode = polarity << 1 | phase; self->polarity = polarity; self->phase = phase; self->bits = bits; self->target_frequency = baudrate; - esp_err_t result = spi_hal_get_clock_conf(self->hal_context, + esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, self->connected_through_gpio, 0 /* input_delay_ns */, &self->real_frequency, &self->timing_conf); + if (result != ESP_OK) { + return false; + } spi_hal_setup_device(&self->hal_context); return true; @@ -222,9 +229,9 @@ bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { return false; } // Wait to grab the lock from another task. - esp_err_t ret = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); - self->has_lock = true; - return true; + esp_err_t result = spi_bus_lock_acquire_start(self->lock, portMAX_DELAY); + self->has_lock = result == ESP_OK; + return self->has_lock; } bool common_hal_busio_spi_has_lock(busio_spi_obj_t *self) { @@ -238,62 +245,37 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size_t len) { - if (len == 0) { - return true; - } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_write(self->spi_desc.dev.prvt, data, len); - } else { - // struct io_descriptor *spi_io; - // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); - // status = spi_io->write(spi_io, data, len); - } - return false; // Status is number of chars read or an error code < 0. + return common_hal_busio_spi_transfer(self, data, NULL, len); } bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { - if (len == 0) { - return true; - } - // int32_t status; - if (len >= 16) { - // status = sercom_dma_read(self->spi_desc.dev.prvt, data, len, write_value); - } else { - // self->spi_desc.dev.dummy_byte = write_value; - - // struct io_descriptor *spi_io; - // spi_m_sync_get_io_descriptor(&self->spi_desc, &spi_io); - - // status = spi_io->read(spi_io, data, len); - } - return false; // Status is number of chars read or an error code < 0. + return common_hal_busio_spi_transfer(self, NULL, data, len); } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } spi_hal_context_t* hal = &self->hal_context; - hal->tx_bitlen = len * 8; - hal->rx_bitlen = len * 8; - hal->send_buffer = data_out; + hal->tx_bitlen = len * self->bits; + hal->rx_bitlen = len * self->bits; + hal->send_buffer = (uint8_t*) data_out; hal->rcv_buffer = data_in; spi_hal_setup_trans(hal); spi_hal_prepare_data(hal); spi_hal_user_start(hal); - if (len >= 16 && false) { + if (len >= SOC_SPI_MAXIMUM_BUFFER_SIZE && false) { // Set up the interrupt and wait on the lock. } else { while (!spi_hal_usr_is_done(hal)) { - RUN_BACKGROUND_TASKS(); + RUN_BACKGROUND_TASKS; } } - return false; + return true; } uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 0c2f286078..38fbe42ffc 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -29,6 +29,9 @@ #include "common-hal/microcontroller/Pin.h" +#include "esp-idf/components/driver/include/driver/spi_common_internal.h" +#include "esp-idf/components/soc/include/hal/spi_hal.h" +#include "esp-idf/components/soc/include/hal/spi_types.h" #include "py/obj.h" typedef struct { @@ -40,8 +43,9 @@ typedef struct { spi_bus_lock_dev_handle_t lock; spi_hal_context_t hal_context; spi_hal_timing_conf_t timing_conf; + intr_handle_t interrupt; uint32_t target_frequency; - uint32_t real_frequency; + int32_t real_frequency; uint8_t polarity; uint8_t phase; uint8_t bits; diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf index 648f959037..160ba4924d 160000 --- a/ports/esp32s2/esp-idf +++ b/ports/esp32s2/esp-idf @@ -1 +1 @@ -Subproject commit 648f959037896cff887a05b67105748790bfe63a +Subproject commit 160ba4924d8b588e718f76e3a0d0e92c11052fa3 diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index c51aef4daa..8fe1b799d6 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -321,7 +321,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, return (status == kStatus_Success); } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (len == 0) { return true; } @@ -332,7 +332,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin LPSPI_SetDummyData(self->spi, 0xFF); lpspi_transfer_t xfer = { 0 }; - xfer.txData = data_out; + xfer.txData = (uint8_t *)data_out; xfer.rxData = data_in; xfer.dataSize = len; diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index 3f205e7782..f27f0e267b 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -271,13 +271,13 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, return true; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { const bool is_spim3 = self->spim_peripheral->spim.p_reg == NRF_SPIM3; - uint8_t *next_chunk_out = data_out; + const uint8_t *next_chunk_out = data_out; uint8_t *next_chunk_in = data_in; while (len > 0) { - uint8_t *chunk_out = next_chunk_out; + const uint8_t *chunk_out = next_chunk_out; size_t chunk_size = MIN(len, self->spim_peripheral->max_xfer_size); if (is_spim3) { // If SPIM3, copy into unused RAM block, and do DMA from there. diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 65eeb8ebcf..c76705cd85 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -380,12 +380,12 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, } bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, - uint8_t *data_out, uint8_t *data_in, size_t len) { + const uint8_t *data_out, uint8_t *data_in, size_t len) { if (self->miso == NULL || self->mosi == NULL) { mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); } HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle, - data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); + (uint8_t *) data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); return result == HAL_OK; } diff --git a/shared-bindings/busio/SPI.h b/shared-bindings/busio/SPI.h index b7b0715d13..f1a3b041ff 100644 --- a/shared-bindings/busio/SPI.h +++ b/shared-bindings/busio/SPI.h @@ -56,7 +56,7 @@ extern bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *dat extern bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value); // Reads and write len bytes simultaneously. -extern bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len); +extern bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len); // Return actual SPI bus frequency. uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self); From 496e16d99b2277a09ab8a518ee94450653e63317 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 23 Jun 2020 17:02:16 -0700 Subject: [PATCH 851/919] Handle memory (hopefully). Short TX works --- ports/esp32s2/Makefile | 3 ++ ports/esp32s2/common-hal/busio/SPI.c | 79 +++++++++++++++++++++++++--- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 29504065e9..ee1e8107a6 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -281,6 +281,9 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin flash: $(BUILD)/firmware.bin esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^ +flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin + esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x10000 $^ + include $(TOP)/py/mkrules.mk # Print out the value of a make variable. diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index db28dee661..9790c516ff 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,14 +32,35 @@ #include "common-hal/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" +#include "esp_log.h" + +static const char* TAG = "CircuitPython SPI"; + static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; +// Store one lock handle per device so that we can free it. +static spi_bus_lock_dev_handle_t lock_dev_handle[SOC_SPI_PERIPH_NUM]; +static intr_handle_t intr_handle[SOC_SPI_PERIPH_NUM]; + void spi_reset(void) { for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) { if (spi_never_reset[host_id]) { continue; } - spi_bus_free(host_id); + bool in_use = false; + if (lock_dev_handle[host_id] != NULL) { + spi_bus_lock_unregister_dev(lock_dev_handle[host_id]); + lock_dev_handle[host_id] = NULL; + in_use = true; + } + if (intr_handle[host_id] != NULL) { + esp_intr_free(intr_handle[host_id]); + intr_handle[host_id] = NULL; + in_use = true; + } + if (in_use) { + spi_bus_free(host_id); + } } } @@ -75,12 +96,24 @@ static bool bus_uses_iomux_pins(spi_host_device_t host, const spi_bus_config_t* // End copied code. -static bool _spi_bus_free(spi_host_device_t host_id) { +static bool spi_bus_is_free(spi_host_device_t host_id) { return spi_bus_get_attr(host_id) == NULL; } static void spi_interrupt_handler(void *arg) { + // busio_spi_obj_t *self = arg; +} +// The interrupt may get invoked by the bus lock. +static void spi_bus_intr_enable(void *self) +{ + esp_intr_enable(((busio_spi_obj_t *)self)->interrupt); +} + +// The interrupt is always disabled by the ISR itself, not exposed +static void spi_bus_intr_disable(void *self) +{ + esp_intr_disable(((busio_spi_obj_t *)self)->interrupt); } void common_hal_busio_spi_construct(busio_spi_obj_t *self, @@ -103,12 +136,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_host_device_t host_id = SPI1_HOST; self->connected_through_gpio = true; // Try and save SPI2 for pins that are on the IOMUX - if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && _spi_bus_free(SPI2_HOST)) { + if (bus_uses_iomux_pins(SPI2_HOST, &bus_config) && spi_bus_is_free(SPI2_HOST)) { host_id = SPI2_HOST; self->connected_through_gpio = false; - } else if (_spi_bus_free(SPI3_HOST)) { + } else if (spi_bus_is_free(SPI3_HOST)) { host_id = SPI3_HOST; - } else if (_spi_bus_free(SPI2_HOST)) { + } else if (spi_bus_is_free(SPI2_HOST)) { host_id = SPI2_HOST; } if (host_id == SPI1_HOST) { @@ -121,21 +154,33 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } else if (result == ESP_ERR_INVALID_ARG) { mp_raise_ValueError(translate("Invalid pins")); } + + // After this point, we need to deinit to free IDF memory so fill out self's pins. + self->clock_pin = clock; + self->MOSI_pin = mosi; + self->MISO_pin = miso; + spi_bus_lock_dev_config_t config = { .flags = 0 }; + // The returned lock is stored in the bus lock but must be freed separately with + // spi_bus_lock_unregister_dev. result = spi_bus_lock_register_dev(spi_bus_get_attr(host_id)->lock, &config, &self->lock); if (result == ESP_ERR_NO_MEM) { + common_hal_busio_spi_deinit(self); mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } - + lock_dev_handle[host_id] = self->lock; result = esp_intr_alloc(spicommon_irqsource_for_host(host_id), bus_config.intr_flags | ESP_INTR_FLAG_INTRDISABLED, spi_interrupt_handler, self, &self->interrupt); if (result == ESP_ERR_NO_MEM) { + common_hal_busio_spi_deinit(self); mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } + intr_handle[host_id] = self->interrupt; + spi_bus_lock_set_bg_control(spi_bus_get_attr(host_id)->lock, spi_bus_intr_enable, spi_bus_intr_disable, self); spi_hal_context_t* hal = &self->hal_context; hal->hw = NULL; // Set by spi_hal_init @@ -146,8 +191,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // We don't use native CS. hal->cs_setup = 0; hal->cs_hold = 0; - hal->cs_pin_id = -1; - hal->timing_conf = &self->timing_conf; + hal->cs_pin_id = 0; hal->sio = 1; hal->half_duplex = 0; @@ -167,6 +211,13 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, hal->io_mode = SPI_LL_IO_MODE_NORMAL; spi_hal_init(hal, host_id); + // This must be set after spi_hal_init. + hal->timing_conf = &self->timing_conf; + if (hal->hw == NULL) { + ESP_LOGE(TAG, "SPI error %p", hal->hw); + } + + common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { @@ -186,6 +237,14 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { return; } spi_never_reset[self->host_id] = false; + if (self->lock != NULL) { + spi_bus_lock_unregister_dev(self->lock); + lock_dev_handle[self->host_id] = NULL; + } + if (self->interrupt != NULL) { + esp_intr_free(self->interrupt); + intr_handle[self->host_id] = NULL; + } spi_bus_free(self->host_id); common_hal_reset_pin(self->clock_pin); @@ -218,7 +277,11 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, return false; } + ESP_LOGI(TAG, "configure"); + ESP_LOGI(TAG, "real frequency %d", self->real_frequency); + ESP_LOGI(TAG, "timing_conf %p", self->hal_context.timing_conf); spi_hal_setup_device(&self->hal_context); + ESP_LOGI(TAG, "setup done"); return true; } From ed6e81d688469138b555f3579b1083f521485382 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 24 Jun 2020 12:46:36 -0700 Subject: [PATCH 852/919] Switch SPI to polling DMA and enable displayio --- ports/esp32s2/background.c | 6 +- .../boards/espressif_saola_1_wrover/board.c | 8 +- ports/esp32s2/common-hal/busio/I2C.c | 5 +- ports/esp32s2/common-hal/busio/SPI.c | 80 +++++++++++-------- ports/esp32s2/common-hal/busio/SPI.h | 4 + .../common-hal/displayio/ParallelBus.c | 66 +++++++++++++++ .../common-hal/displayio/ParallelBus.h | 36 +++++++++ .../esp32s2/common-hal/microcontroller/Pin.c | 2 +- .../esp32s2/common-hal/microcontroller/Pin.h | 1 - ports/esp32s2/modules/wroom.c | 12 +-- ports/esp32s2/modules/wrover.c | 14 ++-- ports/esp32s2/mpconfigport.mk | 2 +- shared-module/displayio/Display.h | 4 + shared-module/displayio/EPaperDisplay.h | 1 - 14 files changed, 182 insertions(+), 59 deletions(-) create mode 100644 ports/esp32s2/common-hal/displayio/ParallelBus.c create mode 100644 ports/esp32s2/common-hal/displayio/ParallelBus.h diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index e22cf4aacc..e979d78311 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -54,9 +54,9 @@ void run_background_tasks(void) { running_background_tasks = true; filesystem_background(); - // #if CIRCUITPY_DISPLAYIO - // displayio_background(); - // #endif + #if CIRCUITPY_DISPLAYIO + displayio_background(); + #endif running_background_tasks = false; assert_heap_ok(); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c index b7b2c4ef5b..9f708874bf 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wrover/board.c @@ -30,12 +30,12 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 51817c95e2..391d7323c5 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -31,6 +31,7 @@ #include "driver/i2c.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" typedef enum { @@ -217,6 +218,6 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { never_reset_i2c(self->i2c_num); - never_reset_pin(self->scl_pin); - never_reset_pin(self->sda_pin); + common_hal_never_reset_pin(self->scl_pin); + common_hal_never_reset_pin(self->sda_pin); } diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 9790c516ff..686f44cbc2 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "boards/board.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" #include "esp_log.h" @@ -101,7 +101,8 @@ static bool spi_bus_is_free(spi_host_device_t host_id) { } static void spi_interrupt_handler(void *arg) { - // busio_spi_obj_t *self = arg; + busio_spi_obj_t *self = arg; + ESP_LOGE(TAG, "SPI interrupt %p", self); } // The interrupt may get invoked by the bus lock. @@ -148,7 +149,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, mp_raise_ValueError(translate("All SPI peripherals are in use")); } - esp_err_t result = spi_bus_initialize(host_id, &bus_config, 0 /* dma channel */); + esp_err_t result = spi_bus_initialize(host_id, &bus_config, host_id /* dma channel */); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { @@ -183,34 +184,35 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_bus_lock_set_bg_control(spi_bus_get_attr(host_id)->lock, spi_bus_intr_enable, spi_bus_intr_disable, self); spi_hal_context_t* hal = &self->hal_context; - hal->hw = NULL; // Set by spi_hal_init - hal->dmadesc_tx = NULL; - hal->dmadesc_rx = NULL; - hal->dmadesc_n = 0; + + // spi_hal_init clears the given hal context so set everything after. + spi_hal_init(hal, host_id); + hal->dmadesc_tx = &self->tx_dma; + hal->dmadesc_rx = &self->rx_dma; + hal->dmadesc_n = 1; // We don't use native CS. - hal->cs_setup = 0; - hal->cs_hold = 0; - hal->cs_pin_id = 0; + // hal->cs_setup = 0; + // hal->cs_hold = 0; + // hal->cs_pin_id = 0; hal->sio = 1; - hal->half_duplex = 0; - hal->tx_lsbfirst = 0; - hal->rx_lsbfirst = 0; - hal->dma_enabled = 0; + // hal->half_duplex = 0; + // hal->tx_lsbfirst = 0; + // hal->rx_lsbfirst = 0; + hal->dma_enabled = 1; hal->no_compensate = 1; // Ignore CS bits // We don't use cmd, addr or dummy bits. - hal->cmd = 0; - hal->cmd_bits = 0; - hal->addr_bits = 0; - hal->dummy_bits = 0; - hal->addr = 0; + // hal->cmd = 0; + // hal->cmd_bits = 0; + // hal->addr_bits = 0; + // hal->dummy_bits = 0; + // hal->addr = 0; hal->io_mode = SPI_LL_IO_MODE_NORMAL; - spi_hal_init(hal, host_id); // This must be set after spi_hal_init. hal->timing_conf = &self->timing_conf; if (hal->hw == NULL) { @@ -223,9 +225,9 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, void common_hal_busio_spi_never_reset(busio_spi_obj_t *self) { spi_never_reset[self->host_id] = true; - never_reset_pin(self->clock_pin); - never_reset_pin(self->MOSI_pin); - never_reset_pin(self->MISO_pin); + common_hal_never_reset_pin(self->clock_pin); + common_hal_never_reset_pin(self->MOSI_pin); + common_hal_never_reset_pin(self->MISO_pin); } bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { @@ -322,17 +324,29 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou } spi_hal_context_t* hal = &self->hal_context; - hal->tx_bitlen = len * self->bits; - hal->rx_bitlen = len * self->bits; - hal->send_buffer = (uint8_t*) data_out; - hal->rcv_buffer = data_in; + hal->send_buffer = NULL; + hal->rcv_buffer = NULL; + // This rounds up. + size_t dma_count = (len + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; + for (size_t i = 0; i < dma_count; i++) { + size_t offset = LLDESC_MAX_NUM_PER_DESC * i; + size_t dma_len = len - offset; + if (dma_len > LLDESC_MAX_NUM_PER_DESC) { + dma_len = LLDESC_MAX_NUM_PER_DESC; + } + hal->tx_bitlen = dma_len * self->bits; + hal->rx_bitlen = dma_len * self->bits; + if (data_out != NULL) { + hal->send_buffer = (uint8_t*) data_out + offset; + } + if (data_in != NULL) { + hal->rcv_buffer = data_in + offset; + } - spi_hal_setup_trans(hal); - spi_hal_prepare_data(hal); - spi_hal_user_start(hal); - if (len >= SOC_SPI_MAXIMUM_BUFFER_SIZE && false) { - // Set up the interrupt and wait on the lock. - } else { + spi_hal_setup_trans(hal); + spi_hal_prepare_data(hal); + spi_hal_user_start(hal); + // TODO: Switch to waiting on a lock that is given by an interrupt. while (!spi_hal_usr_is_done(hal)) { RUN_BACKGROUND_TASKS; } diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/esp32s2/common-hal/busio/SPI.h index 38fbe42ffc..6d82038317 100644 --- a/ports/esp32s2/common-hal/busio/SPI.h +++ b/ports/esp32s2/common-hal/busio/SPI.h @@ -44,6 +44,10 @@ typedef struct { spi_hal_context_t hal_context; spi_hal_timing_conf_t timing_conf; intr_handle_t interrupt; + // IDF allocates these in DMA accessible memory so they may need to move when + // we use external RAM for CircuitPython. + lldesc_t tx_dma; + lldesc_t rx_dma; uint32_t target_frequency; int32_t real_frequency; uint8_t polarity; diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.c b/ports/esp32s2/common-hal/displayio/ParallelBus.c new file mode 100644 index 0000000000..314b72ff73 --- /dev/null +++ b/ports/esp32s2/common-hal/displayio/ParallelBus.c @@ -0,0 +1,66 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/displayio/ParallelBus.h" + +#include + +#include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/__init__.h" + +void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, + const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, + const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { + + mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); +} + +void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t* self) { + +} + +bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { + + return false; +} + +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { + +} + +void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { + +} diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.h b/ports/esp32s2/common-hal/displayio/ParallelBus.h new file mode 100644 index 0000000000..cd636921d9 --- /dev/null +++ b/ports/esp32s2/common-hal/displayio/ParallelBus.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H + +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; +} displayio_parallelbus_obj_t; + +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 075f80abc6..5a059f0bbc 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -42,7 +42,7 @@ void never_reset_pin_number(gpio_num_t pin_number) { never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; } -void never_reset_pin(const mcu_pin_obj_t* pin) { +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { never_reset_pin_number(pin->number); } diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index ab06b388f8..19985bda6f 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -42,6 +42,5 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin); void claim_pin(const mcu_pin_obj_t* pin); bool pin_number_is_free(gpio_num_t pin_number); void never_reset_pin_number(gpio_num_t pin_number); -void never_reset_pin(const mcu_pin_obj_t* pin); #endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/esp32s2/modules/wroom.c b/ports/esp32s2/modules/wroom.c index 16c5861187..5e530701bf 100644 --- a/ports/esp32s2/modules/wroom.c +++ b/ports/esp32s2/modules/wroom.c @@ -28,10 +28,10 @@ void never_reset_module_internal_pins(void) { // SPI Flash - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + 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); } diff --git a/ports/esp32s2/modules/wrover.c b/ports/esp32s2/modules/wrover.c index d589a8fd4d..23fa7ee5ca 100644 --- a/ports/esp32s2/modules/wrover.c +++ b/ports/esp32s2/modules/wrover.c @@ -28,11 +28,11 @@ void never_reset_module_internal_pins(void) { // SPI Flash and RAM - never_reset_pin(&pin_GPIO26); - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + 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); } diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 9f59c1b467..8e2745a8c6 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -20,7 +20,7 @@ CIRCUITPY_BITBANGIO = 1 CIRCUITPY_BOARD = 1 CIRCUITPY_DIGITALIO = 1 CIRCUITPY_BUSIO = 1 -CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_MICROCONTROLLER = 1 diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index 8adaf597f9..861a38fd7c 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -29,7 +29,9 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" +#if CIRCUITPY_PULSEIO #include "shared-bindings/pulseio/PWMOut.h" +#endif #include "shared-module/displayio/area.h" #include "shared-module/displayio/display_core.h" @@ -39,7 +41,9 @@ typedef struct { displayio_display_core_t core; union { digitalio_digitalinout_obj_t backlight_inout; + #if CIRCUITPY_PULSEIO pulseio_pwmout_obj_t backlight_pwm; + #endif }; uint64_t last_backlight_refresh; uint64_t last_refresh_call; diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index d08bed5462..3b9f6e3680 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -29,7 +29,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/displayio/Group.h" -#include "shared-bindings/pulseio/PWMOut.h" #include "shared-module/displayio/area.h" #include "shared-module/displayio/display_core.h" From 03e5043af4de14bd8115a4eeb608a2726ab59c6e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 24 Jun 2020 13:10:31 -0700 Subject: [PATCH 853/919] Turn off Idle WDT and speed up CPU --- ports/esp32s2/background.c | 6 ++---- ports/esp32s2/sdkconfig.defaults | 28 ++++++++++++++++------------ ports/esp32s2/supervisor/port.c | 3 +++ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ports/esp32s2/background.c b/ports/esp32s2/background.c index e979d78311..a90fa7d0aa 100644 --- a/ports/esp32s2/background.c +++ b/ports/esp32s2/background.c @@ -47,10 +47,8 @@ void run_background_tasks(void) { return; } - // Delay for 1 tick so that we don't starve the idle task. - // TODO: 1 tick is 10ms which is a long time! Can we delegate to idle for a minimal amount of - // time? - vTaskDelay(1); + // Zero delay in case FreeRTOS wants to switch to something else. + vTaskDelay(0); running_background_tasks = true; filesystem_background(); diff --git a/ports/esp32s2/sdkconfig.defaults b/ports/esp32s2/sdkconfig.defaults index 958e1852ea..729ebac889 100644 --- a/ports/esp32s2/sdkconfig.defaults +++ b/ports/esp32s2/sdkconfig.defaults @@ -190,9 +190,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 # ESP32S2-specific # # CONFIG_ESP32S2_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=240 # # Memory protection @@ -271,10 +271,7 @@ CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_TASK_WDT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_ESP_TASK_WDT is not set CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y # end of Common ESP-related @@ -528,6 +525,7 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set # CONFIG_MBEDTLS_DEBUG is not set # @@ -547,8 +545,12 @@ CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_GCM=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set CONFIG_MBEDTLS_HAVE_TIME=y # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set @@ -627,6 +629,10 @@ CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -705,6 +711,7 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_DEBUG_PRINT is not set # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_TLS_V12 is not set +# CONFIG_WPA_WPS_WARS is not set # end of Supplicant # end of Component config @@ -756,7 +763,7 @@ CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_ADC2_DISABLE_DAC=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_MAIN_TASK_STACK_SIZE=8192 CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -767,10 +774,7 @@ CONFIG_CONSOLE_UART_RX_GPIO=3 CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_TASK_WDT is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index fbfbc9f2eb..ebf0020399 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -69,6 +69,9 @@ safe_mode_t port_init(void) { void reset_port(void) { reset_all_pins(); + // A larger delay so the idle task can run and do any IDF cleanup needed. + vTaskDelay(4); + #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); From 436b15e558868ff836ba7205e7e799046bb53b64 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 25 Jun 2020 10:26:33 +0200 Subject: [PATCH 854/919] spresense: add elf32.h for mkspk --- ports/cxd56/mkspk/elf32.h | 175 ++++++++++++++++++++++++++++++++++++++ ports/cxd56/mkspk/mkspk.h | 12 ++- 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 ports/cxd56/mkspk/elf32.h diff --git a/ports/cxd56/mkspk/elf32.h b/ports/cxd56/mkspk/elf32.h new file mode 100644 index 0000000000..94a9c81ba3 --- /dev/null +++ b/ports/cxd56/mkspk/elf32.h @@ -0,0 +1,175 @@ +/**************************************************************************** + * include/elf32.h + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Reference: System V Application Binary Interface, Edition 4.1, March 18, + * 1997, The Santa Cruz Operation, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __INCLUDE_ELF32_H +#define __INCLUDE_ELF32_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define EI_NIDENT 16 /* Size of e_ident[] */ + +#define ELF32_ST_BIND(i) ((i) >> 4) +#define ELF32_ST_TYPE(i) ((i) & 0xf) +#define ELF32_ST_INFO(b,t) (((b) << 4) | ((t) & 0xf)) + +/* Definitions for Elf32_Rel*::r_info */ + +#define ELF32_R_SYM(i) ((i) >> 8) +#define ELF32_R_TYPE(i) ((i) & 0xff) +#define ELF32_R_INFO(s,t) (((s)<< 8) | ((t) & 0xff)) + +#define ELF_R_SYM(i) ELF32_R_SYM(i) + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/* Figure 4.2: 32-Bit Data Types */ + +typedef uint32_t Elf32_Addr; /* Unsigned program address */ +typedef uint16_t Elf32_Half; /* Unsigned medium integer */ +typedef uint32_t Elf32_Off; /* Unsigned file offset */ +typedef int32_t Elf32_Sword; /* Signed large integer */ +typedef uint32_t Elf32_Word; /* Unsigned large integer */ + +/* Figure 4-3: ELF Header */ + +typedef struct +{ + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; +} Elf32_Ehdr; + +/* Figure 4-8: Section Header */ + +typedef struct +{ + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; +} Elf32_Shdr; + +/* Figure 4-15: Symbol Table Entry */ + +typedef struct +{ + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; +} Elf32_Sym; + +/* Figure 4-19: Relocation Entries */ + +typedef struct +{ + Elf32_Addr r_offset; + Elf32_Word r_info; +} Elf32_Rel; + +typedef struct +{ + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; +} Elf32_Rela; + +/* Figure 5-1: Program Header */ + +typedef struct +{ + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; +} Elf32_Phdr; + +/* Figure 5-9: Dynamic Structure */ + +typedef struct +{ + Elf32_Sword d_tag; + union + { + Elf32_Word d_val; + Elf32_Addr d_ptr; + } d_un; +} Elf32_Dyn; + +typedef Elf32_Addr Elf_Addr; +typedef Elf32_Ehdr Elf_Ehdr; +typedef Elf32_Rel Elf_Rel; +typedef Elf32_Rela Elf_Rela; +typedef Elf32_Sym Elf_Sym; +typedef Elf32_Shdr Elf_Shdr; +typedef Elf32_Word Elf_Word; + +#endif /* __INCLUDE_ELF32_H */ diff --git a/ports/cxd56/mkspk/mkspk.h b/ports/cxd56/mkspk/mkspk.h index 5a67bb3dd4..5c1b979c04 100644 --- a/ports/cxd56/mkspk/mkspk.h +++ b/ports/cxd56/mkspk/mkspk.h @@ -36,12 +36,22 @@ ****************************************************************************/ #include "clefia.h" -#include "elf.h" +#include "elf32.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +#define EI_MAG0 0 /* File identification */ +#define EI_MAG1 1 +#define EI_MAG2 2 +#define EI_MAG3 3 + +#define SHT_SYMTAB 2 +#define SHT_STRTAB 3 + +#define PT_LOAD 1 + #define alignup(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) #define swap(a, b) { (a) ^= (b); (b) ^= (a); (a) ^= (b); } From f552d854f440b9332782b314ba381fb10f3a461a Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Wed, 24 Jun 2020 12:43:23 +0000 Subject: [PATCH 855/919] Translated using Weblate (Spanish) Currently translated at 81.9% (626 of 764 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/locale/es.po b/locale/es.po index 43e80a1da6..013750e931 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-01 17:10-0700\n" -"PO-Revision-Date: 2020-06-22 10:35+0000\n" +"PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -954,7 +954,7 @@ msgstr "Frecuencia suministrada no válida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "Acceso a memoria no válido" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1013,7 +1013,7 @@ msgstr "" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "Voz inválida" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" @@ -1025,11 +1025,11 @@ msgstr "Archivo wave inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "Tamaño no válido de palabra/bit" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "La llave debe tener 16, 24 o 32 bytes de longitud" #: py/compile.c msgid "LHS of keyword arg must be an id" @@ -1162,7 +1162,7 @@ msgstr "Sin soporte de hardware en pin" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "No se especificó ninguna llave" #: shared-bindings/time/__init__.c msgid "No long integer support" @@ -1251,7 +1251,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "ParallelBus no soportado aún" #: py/moduerrno.c msgid "Permission denied" @@ -1312,11 +1312,11 @@ msgstr "Pull no se usa cuando la dirección es output." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "PulseIn no es compatible con este chip" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "PulseOut no es compatible con este chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -1324,7 +1324,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Error de inicialización de RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" @@ -1346,7 +1346,7 @@ msgstr "" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Error de generación de números aleatorios" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1357,17 +1357,16 @@ msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" #: shared-module/displayio/Bitmap.c -#, fuzzy msgid "Read-only object" -msgstr "Solo-lectura" +msgstr "Objeto de solo-lectura" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "Actualizando demasiado pronto" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "El modo AES solicitado no es compatible" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1392,11 +1391,11 @@ msgstr "SDA o SCL necesitan una pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Error de inicio de SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Error de reinicialización de SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" @@ -1409,15 +1408,15 @@ msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "Escaneo en progreso. Use stop_scan para detener." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "Pin CTS seleccionado no válido" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "Pin RTS seleccionado no válido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1451,11 +1450,11 @@ msgstr "A Stream le falta el método readinto() o write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Suministre al menos un pin UART" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "Lectura de temperatura expirada" #: supervisor/shared/safe_mode.c msgid "" @@ -1498,11 +1497,11 @@ msgstr "La altura del Tile debe dividir exacto la altura del bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Índice de mosaico fuera de límites" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Valor de mosaico fuera de límites" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -1512,6 +1511,8 @@ msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"Tiempo de espera demasiado largo: El tiempo máximo de espera es de %d " +"segundos" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1543,19 +1544,19 @@ msgstr "" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Error de desinicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Error de inicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Error de reinicialización de UARL" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Error de escritura UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1567,7 +1568,7 @@ msgstr "Error USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "El valor entero del UUID debe ser 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1585,7 +1586,7 @@ msgstr "No se pudieron asignar buffers para la conversión con signo" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "No se puede encontrar la pantalla I2C en %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1615,17 +1616,17 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Razón desconocida." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Error de seguridad desconocido: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Error suave desconocido en dispositivo: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format From ce95b9379d9a7f763a19de58be7a751e6874435c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:25:58 -0500 Subject: [PATCH 856/919] Refer to "main" branch of circuitpython --- CONTRIBUTING.md | 2 +- README.rst | 6 +++--- docs/README.md | 2 +- docs/design_guide.rst | 2 +- tools/codestats.sh | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7477df61cf..0d85926310 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Please note that this project is released with a -[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/master/CODE_OF_CONDUCT.md). +[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Participation covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do so will result in corrective actions such as time out or ban from the project. diff --git a/README.rst b/README.rst index dfddd13373..d09dcda456 100644 --- a/README.rst +++ b/README.rst @@ -55,12 +55,12 @@ Contributing ------------ See -`CONTRIBUTING.md `__ +`CONTRIBUTING.md `__ for full guidelines but please be aware that by contributing to this project you are agreeing to the `Code of -Conduct `__. +Conduct `__. Contributors who follow the `Code of -Conduct `__ +Conduct `__ are welcome to submit pull requests and they will be promptly reviewed by project admins. Please join the `Discord `__ too. diff --git a/docs/README.md b/docs/README.md index e98b46f67b..19c81a2fa3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@ The latest documentation can be found at: http://circuitpython.readthedocs.io/en/latest/ The documentation you see there is generated from the files in the whole tree: -https://github.com/adafruit/circuitpython/tree/master +https://github.com/adafruit/circuitpython/tree/main Building the documentation locally ---------------------------------- diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 6f87ecf798..1d40943acb 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -3,7 +3,7 @@ Design Guide This guide covers a variety of development practices for CircuitPython core and library APIs. These APIs are both `built-into CircuitPython -`_ and those that are +`_ and those that are `distributed on GitHub `_ and in the `Adafruit `_ and `Community `_ bundles. Consistency with these diff --git a/tools/codestats.sh b/tools/codestats.sh index d33db973b1..5f7625c450 100755 --- a/tools/codestats.sh +++ b/tools/codestats.sh @@ -90,9 +90,9 @@ else last_rev="v1.0" fi -# get a list of hashes between last revision (exclusive) and master -hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master) -#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..master | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one +# get a list of hashes between last revision (exclusive) and main +hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main) +#hashes=$(git log --format=format:"%H" --reverse ${last_rev}..main | $AWK '{if (NR % 10 == 0) print $0}') # do every 10th one for hash in $hashes; do @@ -182,6 +182,6 @@ EOF done -# checkout master and cleanup -git checkout master +# checkout main and cleanup +git checkout main $RM $pystoneavg From 2a1c37cf8b6d529294625ff0097642f926117f3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:26:14 -0500 Subject: [PATCH 857/919] locale: Remove Language-Team lines that point nowhere --- locale/de_DE.po | 2 -- locale/en_x_pirate.po | 2 -- locale/fr.po | 2 -- 3 files changed, 6 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 1359ce6dd0..d317a6234a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -10,8 +10,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" -"Language-Team: German \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index b240ab689b..0f1bf91057 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -10,8 +10,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 08:56-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" -"Language-Team: English \n" "Language: en_x_pirate\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/locale/fr.po b/locale/fr.po index 587f098771..20d42d49e0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -11,8 +11,6 @@ msgstr "" "POT-Creation-Date: 2020-06-01 17:10-0700\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" -"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" From 9110e366369ba0f99c8e33032da64edb34a4c74a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:28:11 -0500 Subject: [PATCH 858/919] Use main/selected terminology in docstrings Also copy some notes from busio docstrings to bitbangio docstrings --- shared-bindings/bitbangio/I2C.c | 14 +++++++++++--- shared-bindings/bitbangio/SPI.c | 24 +++++++++++++++++------- shared-bindings/busio/I2C.c | 6 +++--- shared-bindings/busio/SPI.c | 15 ++++++++------- shared-bindings/i2cslave/I2CSlave.c | 8 ++++---- shared-bindings/i2cslave/__init__.c | 6 +++--- 6 files changed, 46 insertions(+), 27 deletions(-) diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index 2043fc903f..43fe11e628 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -45,6 +45,14 @@ //| physical level it consists of 2 wires: SCL and SDA, the clock and data //| lines respectively. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin //| :param int frequency: The clock frequency of the bus @@ -158,7 +166,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_i2c_unlock_obj, bitbangio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. //| @@ -210,7 +218,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address`` and then transmits a +//| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. //| @@ -270,7 +278,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_writeto_obj, 1, bitbangio_i2c_wr //| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 08bbf1257f..6d31037c75 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -43,19 +43,29 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~bitbangio.I2C` because a -//| separate pin is used to control the active slave rather than a transmitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| """Construct an SPI object on the given pins. //| +//| .. seealso:: Using this class directly requires careful lock management. +//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| manage locks. +//| +//| .. seealso:: Using this class to directly read registers requires manual +//| bit unpacking. Instead, use an existing driver or make one with +//| :ref:`Register ` data descriptors. +//| +//| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 7e8af765f7..b61dd93f3a 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -177,7 +177,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock); //| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any: -//| """Read into ``buffer`` from the slave specified by ``address``. +//| """Read into ``buffer`` from the device selected by ``address``. //| The number of bytes read will be the length of ``buffer``. //| At least one byte must be read. //| @@ -229,7 +229,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); //| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any: -//| """Write the bytes from ``buffer`` to the slave specified by ``address``. +//| """Write the bytes from ``buffer`` to the device selected by ``address``. //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and //| repeated start before a read. @@ -288,7 +288,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any: -//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop +//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 2ba9a4c22c..22f001d2dc 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -45,12 +45,13 @@ //| """A 3-4 wire serial protocol //| //| SPI is a serial protocol that has exclusive pins for data in and out of the -//| master. It is typically faster than :py:class:`~busio.I2C` because a -//| separate pin is used to control the active slave rather than a transitted +//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a +//| separate pin is used to select a device rather than a transmitted //| address. This class only manages three of the four SPI lines: `!clock`, -//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate slave -//| select line. (This is common because multiple slaves can share the `!clock`, -//| `!MOSI` and `!MISO` lines and therefore the hardware.)""" +//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate +//| select line, often abbreviated `!CS` or `!SS`. (This is common because +//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines +//| and therefore the hardware.)""" //| //| def __init__(self, clock: microcontroller.Pin, MOSI: microcontroller.Pin = None, MISO: microcontroller.Pin = None): //| @@ -72,8 +73,8 @@ //| :ref:`Register ` data descriptors. //| //| :param ~microcontroller.Pin clock: the pin to use for the clock. -//| :param ~microcontroller.Pin MOSI: the Master Out Slave In pin. -//| :param ~microcontroller.Pin MISO: the Master In Slave Out pin.""" +//| :param ~microcontroller.Pin MOSI: the Main Out Selected In pin. +//| :param ~microcontroller.Pin MISO: the Main In Selected Out pin.""" //| ... //| diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cslave/I2CSlave.c index 80875ce758..9f051a1253 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cslave/I2CSlave.c @@ -134,7 +134,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *a STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); //| def request(self, timeout: float = -1) -> Any: -//| """Wait for an I2C request from a master. +//| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once //| :return: I2C Slave Request or None if timeout=-1 and there's no request @@ -228,12 +228,12 @@ const mp_obj_type_t i2cslave_i2c_slave_type = { //| class I2CSlaveRequest: //| //| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): -//| """I2C transfer request from a master. +//| """Information about an I2C transfer request //| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. //| //| :param slave: The I2C Slave receiving this request //| :param address: I2C address -//| :param is_read: I2C Master read request +//| :param is_read: True if the main device is requesting data //| :param is_restart: Repeated Start Condition""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { @@ -270,7 +270,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); //| is_read: bool = ... -//| """The I2C master is reading from the device.""" +//| """The I2C main controller is reading from this device.""" //| STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cslave/__init__.c index 41b42fef83..59674d5cb4 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cslave/__init__.c @@ -53,9 +53,9 @@ //| if not r: //| # Maybe do some housekeeping //| continue -//| with r: # Closes the transfer if necessary by sending a NACK or feeding the master dummy bytes +//| with r: # Closes the transfer if necessary by sending a NACK or feeding dummy bytes //| if r.address == 0x40: -//| if not r.is_read: # Master write which is Slave read +//| if not r.is_read: # Main write which is Selected read //| b = r.read(1) //| if not b or b[0] > 15: //| break @@ -63,7 +63,7 @@ //| b = r.read(1) //| if b: //| regs[index] = b[0] -//| elif r.is_restart: # Combined transfer: This is the Master read message +//| elif r.is_restart: # Combined transfer: This is the Main read message //| n = r.write(bytes([regs[index]])) //| #else: //| # A read transfer is not supported in this example From 9737dd9c308df0d7356ee5ff727e34a93a88e302 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:28:32 -0500 Subject: [PATCH 859/919] Scripts: Change wording for pseudoterminals --- tests/run-tests | 20 ++++++++++++-------- tools/pyboard.py | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/run-tests b/tests/run-tests index 6e980f03ce..151d48095b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -87,28 +87,32 @@ def run_micropython(pyb, args, test_file, is_special=False): def get(required=False): rv = b'' while True: - ready = select.select([master], [], [], 0.02) - if ready[0] == [master]: - rv += os.read(master, 1024) + ready = select.select([emulator], [], [], 0.02) + if ready[0] == [emulator]: + rv += os.read(emulator, 1024) else: if not required or rv: return rv def send_get(what): - os.write(master, what) + os.write(emulator, what) return get() with open(test_file, 'rb') as f: # instead of: output_mupy = subprocess.check_output(args, stdin=f) - master, slave = pty.openpty() - p = subprocess.Popen(args, stdin=slave, stdout=slave, + # openpty returns two read/write file descriptors. The first one is + # used by the program which provides the virtual + # terminal service, and the second one is used by the + # subprogram which requires a tty to work. + emulator, subterminal = pty.openpty() + p = subprocess.Popen(args, stdin=subterminal, stdout=subterminal, stderr=subprocess.STDOUT, bufsize=0) banner = get(True) output_mupy = banner + b''.join(send_get(line) for line in f) send_get(b'\x04') # exit the REPL, so coverage info is saved p.kill() - os.close(master) - os.close(slave) + os.close(emulator) + os.close(subterminal) else: output_mupy = subprocess.check_output(args + [test_file], stderr=subprocess.STDOUT) except subprocess.CalledProcessError: diff --git a/tools/pyboard.py b/tools/pyboard.py index 16ee41f703..bb5642bd78 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -191,7 +191,7 @@ class ProcessToSerial: class ProcessPtyToTerminal: - """Execute a process which creates a PTY and prints slave PTY as + """Execute a process which creates a PTY and prints secondary PTY as first line of its output, and emulate serial connection using this PTY.""" From 1d2cc0b968fb75e19a752ebe4ec846921297db0f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 08:45:15 -0500 Subject: [PATCH 860/919] I2CPeripheral: Rename class and its module This is an incompatible change. --- docs/porting.rst | 2 +- docs/redirects.txt | 4 +- .../boards/bdmicro_vina_m0/mpconfigboard.mk | 2 +- .../circuitbrains_basic_m0/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../feather_m0_express/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- .../feather_m0_supersized/mpconfigboard.mk | 2 +- .../hallowing_m0_express/mpconfigboard.mk | 2 +- .../itsybitsy_m0_express/mpconfigboard.mk | 2 +- .../boards/metro_m0_express/mpconfigboard.mk | 2 +- .../boards/pewpew_m4/mpconfigboard.mk | 2 +- .../boards/shirtty/mpconfigboard.mk | 2 +- .../boards/snekboard/mpconfigboard.mk | 2 +- .../sparkfun_redboard_turbo/mpconfigboard.mk | 2 +- .../stringcar_m0_express/mpconfigboard.mk | 2 +- .../trinket_m0_haxpress/mpconfigboard.mk | 2 +- .../boards/ugame10/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 3 +- .../boards/winterbloom_sol/mpconfigboard.mk | 2 +- .../I2CPeripheral.c} | 40 ++-- .../I2CPeripheral.h} | 8 +- .../common-hal/i2cperipheral/__init__.c | 1 + .../atmel-samd/common-hal/i2cslave/__init__.c | 1 - ports/cxd56/mpconfigport.mk | 2 +- ports/esp32s2/mpconfigport.mk | 2 +- ports/litex/mpconfigport.mk | 2 +- ports/mimxrt10xx/mpconfigport.mk | 2 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 2 +- ports/nrf/mpconfigport.mk | 4 +- ports/stm/mpconfigport.mk | 6 +- py/circuitpy_defns.mk | 8 +- py/circuitpy_mpconfig.h | 10 +- py/circuitpy_mpconfig.mk | 4 +- .../I2CPeripheral.c} | 204 +++++++++--------- .../I2CPeripheral.h} | 26 +-- .../{i2cslave => i2cperipheral}/__init__.c | 37 ++-- 39 files changed, 203 insertions(+), 203 deletions(-) rename ports/atmel-samd/common-hal/{i2cslave/I2CSlave.c => i2cperipheral/I2CPeripheral.c} (80%) rename ports/atmel-samd/common-hal/{i2cslave/I2CSlave.h => i2cperipheral/I2CPeripheral.h} (85%) create mode 100644 ports/atmel-samd/common-hal/i2cperipheral/__init__.c delete mode 100644 ports/atmel-samd/common-hal/i2cslave/__init__.c rename shared-bindings/{i2cslave/I2CSlave.c => i2cperipheral/I2CPeripheral.c} (51%) rename shared-bindings/{i2cslave/I2CSlave.h => i2cperipheral/I2CPeripheral.h} (60%) rename shared-bindings/{i2cslave => i2cperipheral}/__init__.c (71%) diff --git a/docs/porting.rst b/docs/porting.rst index d28f56f475..db4ae76262 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -64,7 +64,7 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CSLAVE = 0 + CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok) # These modules are implemented in shared-module/ - they can be included in diff --git a/docs/redirects.txt b/docs/redirects.txt index 68d0b2de2e..28dc73aba2 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -32,8 +32,8 @@ shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time -shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave -shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire diff --git a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk index 5a47a5890d..a36966b87c 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_m0/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "MX25L51245G" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk index a71728e2db..da5f1ffac8 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk @@ -13,5 +13,5 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index cdbdf44f80..81391b953e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -14,7 +14,7 @@ LONGINT_IMPL = MPZ # Make room for frozen libs. CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 46a245e609..7aa45eb39e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 4220aa77ff..863b97d315 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -14,7 +14,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = NONE CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 # So not all of displayio, sorry! diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 199cef362a..cec87f2bf9 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index d5e03b49d4..9e27ec7b4a 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -15,7 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_GAMEPAD = 0 CFLAGS_INLINE_LIMIT = 50 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index a94dd3c4e7..8bd4b818df 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 # supersized, not ultra-supersized CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index a8390fd97c..15c5ad817c 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 812c208ccb..09420ed3da 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -15,7 +15,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 # too itsy bitsy for all of displayio CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 588e50ee1b..e3948565d1 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 864d31909d..b6490433e5 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index 295ba4bce4..a04e097692 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -CIRCUITPY_I2CSLAVE = 1 +CIRCUITPY_I2CPERIPHERAL = 1 CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index 08f8d431ea..eae50d70bf 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -13,7 +13,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 7a9b44e4c9..c17600fc75 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -12,7 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV" LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index c4b1f6d5af..6f3febfe56 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -16,7 +16,7 @@ CIRCUITPY_BITBANG_APA102 = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC = 0 CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index 46f727131d..9e0621810c 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -15,6 +15,6 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 1c43369076..d641a89ebd 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -21,7 +21,7 @@ CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index de9b617649..e06a2af7ee 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -19,12 +19,11 @@ CIRCUITPY_AUDIOIO = 1 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index e96497b3e5..11592073f9 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -22,7 +22,7 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c similarity index 80% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.c rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c index 79c1449e2f..84642d4048 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "common-hal/busio/I2C.h" #include "lib/utils/interrupt_char.h" @@ -35,7 +35,7 @@ #include "hal/include/hal_gpio.h" #include "peripherals/samd/sercom.h" -void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus) { uint8_t sercom_index; @@ -87,19 +87,19 @@ void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, if (smbus) { sercom->I2CS.CTRLA.bit.LOWTOUTEN = 1; // Errata 12003 - sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // Slave SCL Low Extend/Cumulative Time-Out 25ms + sercom->I2CS.CTRLA.bit.SEXTTOEN = 1; // SCL Low Extend/Cumulative Time-Out 25ms } sercom->I2CS.CTRLA.bit.SCLSM = 0; // Clock stretch before ack - sercom->I2CS.CTRLA.bit.MODE = 0x04; // Slave mode + sercom->I2CS.CTRLA.bit.MODE = 0x04; // Device mode sercom->I2CS.CTRLA.bit.ENABLE = 1; } -bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self) { +bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) { return self->sda_pin == NO_PIN; } -void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { - if (common_hal_i2cslave_i2c_slave_deinited(self)) { +void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) { + if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { return; } @@ -111,7 +111,7 @@ void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self) { self->scl_pin = NO_PIN; } -static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { +static int i2c_peripheral_check_error(i2cperipheral_i2c_peripheral_obj_t *self, bool raise) { if (!self->sercom->I2CS.INTFLAG.bit.ERROR) { return 0; } @@ -130,9 +130,9 @@ static int i2c_slave_check_error(i2cslave_i2c_slave_obj_t *self, bool raise) { return -err; } -int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) +int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { - int err = i2c_slave_check_error(self, false); + int err = i2c_peripheral_check_error(self, false); if (err) { return err; } @@ -149,22 +149,22 @@ int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, u for (unsigned int i = 0; i < self->num_addresses; i++) { if (*address == self->addresses[i]) { - common_hal_i2cslave_i2c_slave_ack(self, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self, true); return 1; } } // This should clear AMATCH, but it doesn't... - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); return 0; } -int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data) { +int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) { for (int t = 0; t < 100 && !self->sercom->I2CS.INTFLAG.reg; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (!self->sercom->I2CS.INTFLAG.bit.DRDY || self->sercom->I2CS.INTFLAG.bit.PREC || @@ -176,12 +176,12 @@ int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint return 1; } -int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data) { +int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } - i2c_slave_check_error(self, true); + i2c_peripheral_check_error(self, true); if (self->sercom->I2CS.INTFLAG.bit.PREC) { return 0; @@ -203,12 +203,12 @@ int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uin return 1; } -void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack) { +void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) { self->sercom->I2CS.CTRLB.bit.ACKACT = !ack; self->sercom->I2CS.CTRLB.bit.CMD = 0x03; } -void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { +void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } @@ -218,7 +218,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { } if (!self->sercom->I2CS.STATUS.bit.DIR) { - common_hal_i2cslave_i2c_slave_ack(self, false); + common_hal_i2cperipheral_i2c_peripheral_ack(self, false); } else { int i = 0; while (self->sercom->I2CS.INTFLAG.reg == SERCOM_I2CS_INTFLAG_DRDY) { @@ -246,7 +246,7 @@ void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self) { if (self->sercom->I2CS.STATUS.bit.CLKHOLD) { // Unable to release the clock. - // The slave might have to be re-initialized to get unstuck. + // The device might have to be re-initialized to get unstuck. mp_raise_OSError(MP_EIO); } } diff --git a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h similarity index 85% rename from ports/atmel-samd/common-hal/i2cslave/I2CSlave.h rename to ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h index bf4f877bd4..03ae3a2885 100644 --- a/ports/atmel-samd/common-hal/i2cslave/I2CSlave.h +++ b/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t scl_pin; uint8_t sda_pin; bool writing; -} i2cslave_i2c_slave_obj_t; +} i2cperipheral_i2c_peripheral_obj_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_SLAVE_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H diff --git a/ports/atmel-samd/common-hal/i2cperipheral/__init__.c b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c new file mode 100644 index 0000000000..c67511c536 --- /dev/null +++ b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c @@ -0,0 +1 @@ +// No i2cperipheral module functions. diff --git a/ports/atmel-samd/common-hal/i2cslave/__init__.c b/ports/atmel-samd/common-hal/i2cslave/__init__.c deleted file mode 100644 index f289bbc0e4..0000000000 --- a/ports/atmel-samd/common-hal/i2cslave/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No i2cslave module functions. diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index c60bb83e7d..23f60f8a7f 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -14,7 +14,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_GNSS = 1 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk index 040022052c..ad23105393 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/esp32s2/mpconfigport.mk @@ -22,7 +22,7 @@ CIRCUITPY_DIGITALIO = 1 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_MICROCONTROLLER = 1 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 004930ba70..311c87b5d5 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -20,7 +20,7 @@ CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 49d9985083..12f34343b9 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -22,7 +22,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_COUNTIO = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 715b65e63e..385870a654 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -14,7 +14,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index dda9b24366..ed689545d0 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -25,8 +25,8 @@ CIRCUITPY_AUDIOPWMIO ?= 1 CIRCUITPY_BLEIO ?= 1 -# No I2CSlave implementation -CIRCUITPY_I2CSLAVE = 0 +# No I2CPeripheral implementation +CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_RTC ?= 1 diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index 7b720d1564..896d78bba7 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -14,7 +14,7 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 CIRCUITPY_RTC ?= 0 @@ -29,7 +29,7 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_PULSEIO ?= 0 @@ -46,7 +46,7 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CSLAVE ?= 0 + CIRCUITPY_I2CPERIPHERAL ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 95824be1e8..74d8f548dd 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -165,8 +165,8 @@ endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif -ifeq ($(CIRCUITPY_I2CSLAVE),1) -SRC_PATTERNS += i2cslave/% +ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) +SRC_PATTERNS += i2cperipheral/% endif ifeq ($(CIRCUITPY_MATH),1) SRC_PATTERNS += math/% @@ -290,8 +290,8 @@ SRC_COMMON_HAL_ALL = \ gnss/GNSS.c \ gnss/PositionFix.c \ gnss/SatelliteSystem.c \ - i2cslave/I2CSlave.c \ - i2cslave/__init__.c \ + i2cperipheral/I2CPeripheral.c \ + i2cperipheral/__init__.c \ microcontroller/Pin.c \ microcontroller/Processor.c \ microcontroller/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4b054b83ce..c92cb1b669 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -408,11 +408,11 @@ extern const struct _mp_obj_module_t gnss_module; #define GNSS_MODULE #endif -#if CIRCUITPY_I2CSLAVE -extern const struct _mp_obj_module_t i2cslave_module; -#define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, +#if CIRCUITPY_I2CPERIPHERAL +extern const struct _mp_obj_module_t i2cperipheral_module; +#define I2CPERIPHERAL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cperipheral), (mp_obj_t)&i2cperipheral_module }, #else -#define I2CSLAVE_MODULE +#define I2CPERIPHERAL_MODULE #endif #if CIRCUITPY_MATH @@ -690,7 +690,7 @@ extern const struct _mp_obj_module_t watchdog_module; GAMEPAD_MODULE \ GAMEPADSHIFT_MODULE \ GNSS_MODULE \ - I2CSLAVE_MODULE \ + I2CPERIPHERAL_MODULE \ JSON_MODULE \ MATH_MODULE \ _EVE_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index ac7d2ec305..3459bff6d7 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -112,8 +112,8 @@ CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) -CIRCUITPY_I2CSLAVE ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_I2CSLAVE=$(CIRCUITPY_I2CSLAVE) +CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) CIRCUITPY_MATH ?= 1 CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH) diff --git a/shared-bindings/i2cslave/I2CSlave.c b/shared-bindings/i2cperipheral/I2CPeripheral.c similarity index 51% rename from shared-bindings/i2cslave/I2CSlave.c rename to shared-bindings/i2cperipheral/I2CPeripheral.c index 9f051a1253..4a3900174a 100644 --- a/shared-bindings/i2cslave/I2CSlave.c +++ b/shared-bindings/i2cperipheral/I2CPeripheral.c @@ -25,7 +25,7 @@ */ #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" @@ -39,22 +39,22 @@ #include "py/objproperty.h" #include "py/runtime.h" -STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t *slave, uint8_t address, bool is_read, bool is_restart) { - i2cslave_i2c_slave_request_obj_t *self = m_new_obj(i2cslave_i2c_slave_request_obj_t); - self->base.type = &i2cslave_i2c_slave_request_type; - self->slave = slave; +STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { + i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_request_type; + self->peripheral = peripheral; self->address = address; self->is_read = is_read; self->is_restart = is_restart; return (mp_obj_t)self; } -//| class I2CSlave: -//| """Two wire serial protocol slave""" +//| class I2CPeripheral: +//| """Two wire serial protocol peripheral""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: tuple, smbus: bool = False): //| """I2C is a two-wire protocol for communicating between devices. -//| This implements the slave side. +//| This implements the peripheral (sensor, secondary) side. //| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin @@ -62,9 +62,9 @@ STATIC mp_obj_t mp_obj_new_i2cslave_i2c_slave_request(i2cslave_i2c_slave_obj_t * //| :param bool smbus: Use SMBUS timings if the hardware supports it""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - i2cslave_i2c_slave_obj_t *self = m_new_obj(i2cslave_i2c_slave_obj_t); - self->base.type = &i2cslave_i2c_slave_type; +STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); + self->base.type = &i2cperipheral_i2c_peripheral_type; enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -98,7 +98,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ mp_raise_ValueError(translate("addresses is empty")); } - common_hal_i2cslave_i2c_slave_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); + common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); return (mp_obj_t)self; } @@ -106,13 +106,13 @@ STATIC mp_obj_t i2cslave_i2c_slave_make_new(const mp_obj_type_t *type, size_t n_ //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj_deinit(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_deinit); +MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); //| def __enter__(self, ) -> Any: //| """No-op used in Context Managers.""" @@ -125,25 +125,25 @@ MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_deinit_obj, i2cslave_i2c_slave_obj_ //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_deinit(self); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave___exit___obj, 4, 4, i2cslave_i2c_slave_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); //| def request(self, timeout: float = -1) -> Any: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once //| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cslave.I2CSlaveRequest""" +//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_type)); - i2cslave_i2c_slave_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if(common_hal_i2cslave_i2c_slave_deinited(self)) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_type)); + i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + if(common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { raise_deinited_error(); } enum { ARG_timeout }; @@ -180,7 +180,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar return mp_const_none; } - int status = common_hal_i2cslave_i2c_slave_is_addressed(self, &address, &is_read, &is_restart); + int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); if (status < 0) { // On error try one more time before bailing out if (last_error) { @@ -198,7 +198,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar continue; } - return mp_obj_new_i2cslave_i2c_slave_request(self, address, is_read, is_restart); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); } while (forever || common_hal_time_monotonic() < timeout_end); if (timeout_ms > 0) { @@ -206,39 +206,39 @@ STATIC mp_obj_t i2cslave_i2c_slave_request(size_t n_args, const mp_obj_t *pos_ar } return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_obj, 1, i2cslave_i2c_slave_request); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cslave_i2c_slave_deinit_obj) }, +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cslave_i2c_slave_request_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_locals_dict, i2cslave_i2c_slave_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlave, - .make_new = i2cslave_i2c_slave_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_locals_dict, + .name = MP_QSTR_I2CPeripheral, + .make_new = i2cperipheral_i2c_peripheral_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_locals_dict, }; -//| class I2CSlaveRequest: +//| class I2CPeripheralRequest: //| -//| def __init__(self, slave: i2cslave.I2CSlave, address: int, is_read: bool, is_restart: bool): +//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool): //| """Information about an I2C transfer request -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CSlave.request`. +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. //| -//| :param slave: The I2C Slave receiving this request +//| :param peripheral: The I2CPeripheral object receiving this request //| :param address: I2C address -//| :param is_read: True if the main device is requesting data +//| :param is_read: True if the main peripheral is requesting data //| :param is_restart: Repeated Start Condition""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_arg_check_num(n_args, kw_args, 4, 4, false); - return mp_obj_new_i2cslave_i2c_slave_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); + return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } //| def __enter__(self, ) -> Any: @@ -251,56 +251,56 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_make_new(const mp_obj_type_t *type, s //| """Close the request.""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cslave_i2c_slave_close(self->slave); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request___exit___obj, 4, 4, i2cslave_i2c_slave_request_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); //| address: int = ... //| """The I2C address of the request.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_address(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_int(self->address); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_address_obj, i2cslave_i2c_slave_request_get_address); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); //| is_read: bool = ... -//| """The I2C main controller is reading from this device.""" +//| """The I2C main controller is reading from this peripheral.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_read(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_read); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_read_obj, i2cslave_i2c_slave_request_get_is_read); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); //| is_restart: bool = ... //| """Is Repeated Start Condition.""" //| -STATIC mp_obj_t i2cslave_i2c_slave_request_get_is_restart(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_restart); } -MP_DEFINE_CONST_PROP_GET(i2cslave_i2c_slave_request_is_restart_obj, i2cslave_i2c_slave_request_get_is_restart); +MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); //| def read(self, n: int = -1, ack: bool = True) -> bytearray: //| """Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CSlaveRequest.ack`. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. //| //| :param n: Number of bytes to read (negative means all) //| :param ack: Whether or not to send an ACK after the n'th byte //| :return: Bytes read""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(MP_OBJ_IS_TYPE(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); enum { ARG_n, ARG_ack }; static const mp_arg_t allowed_args[] = { { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, @@ -329,7 +329,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p } uint8_t data; - int num = common_hal_i2cslave_i2c_slave_read_byte(self->slave, &data); + int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); if (num == 0) { break; } @@ -338,16 +338,16 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_read(size_t n_args, const mp_obj_t *p buffer[i++] = data; if (i == n) { if (ack) { - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } break; } - common_hal_i2cslave_i2c_slave_ack(self->slave, true); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); } return mp_obj_new_bytearray(i, buffer); } -MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_slave_request_read); +MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); //| def write(self, buffer: bytearray) -> int: //| """Write the data contained in buffer. @@ -356,9 +356,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cslave_i2c_slave_request_read_obj, 1, i2cslave_i2c_ //| :return: Number of bytes written""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); if (!self->is_read) { mp_raise_OSError(MP_EACCES); @@ -373,7 +373,7 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ break; } - int num = common_hal_i2cslave_i2c_slave_write_byte(self->slave, ((uint8_t *)(bufinfo.buf))[i]); + int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); if (num == 0) { return mp_obj_new_int(i); } @@ -381,55 +381,55 @@ STATIC mp_obj_t i2cslave_i2c_slave_request_write(mp_obj_t self_in, mp_obj_t buf_ return mp_obj_new_int(bufinfo.len); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cslave_i2c_slave_request_write_obj, i2cslave_i2c_slave_request_write); +STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); //| def ack(self, ack: bool = True) -> Any: //| """Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CSlaveRequest.read` ack=False. +//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. //| //| :param ack: Whether to send an ACK or NACK""" //| ... //| -STATIC mp_obj_t i2cslave_i2c_slave_request_ack(uint n_args, const mp_obj_t *args) { - mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { + mp_check_self(MP_OBJ_IS_TYPE(args[0], &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); if (self->is_read) { mp_raise_OSError(MP_EACCES); } - common_hal_i2cslave_i2c_slave_ack(self->slave, ack); + common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cslave_i2c_slave_request_ack_obj, 1, 2, i2cslave_i2c_slave_request_ack); +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); -STATIC mp_obj_t i2cslave_i2c_slave_request_close(mp_obj_t self_in) { - mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cslave_i2c_slave_request_type)); - i2cslave_i2c_slave_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { + mp_check_self(MP_OBJ_IS_TYPE(self_in, &i2cperipheral_i2c_peripheral_request_type)); + i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cslave_i2c_slave_close(self->slave); + common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cslave_i2c_slave_request_close_obj, i2cslave_i2c_slave_request_close); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); -STATIC const mp_rom_map_elem_t i2cslave_i2c_slave_request_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cslave_i2c_slave_request___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cslave_i2c_slave_request_address_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cslave_i2c_slave_request_is_restart_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cslave_i2c_slave_request_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cslave_i2c_slave_request_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cslave_i2c_slave_request_ack_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cslave_i2c_slave_request_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_i2c_slave_request_locals_dict, i2cslave_i2c_slave_request_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); -const mp_obj_type_t i2cslave_i2c_slave_request_type = { +const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { { &mp_type_type }, - .name = MP_QSTR_I2CSlaveRequest, - .make_new = i2cslave_i2c_slave_request_make_new, - .locals_dict = (mp_obj_dict_t*)&i2cslave_i2c_slave_request_locals_dict, + .name = MP_QSTR_I2CPeripheralRequest, + .make_new = i2cperipheral_i2c_peripheral_request_make_new, + .locals_dict = (mp_obj_dict_t*)&i2cperipheral_i2c_peripheral_request_locals_dict, }; diff --git a/shared-bindings/i2cslave/I2CSlave.h b/shared-bindings/i2cperipheral/I2CPeripheral.h similarity index 60% rename from shared-bindings/i2cslave/I2CSlave.h rename to shared-bindings/i2cperipheral/I2CPeripheral.h index abb7614168..3035cfbfe7 100644 --- a/shared-bindings/i2cslave/I2CSlave.h +++ b/shared-bindings/i2cperipheral/I2CPeripheral.h @@ -30,31 +30,31 @@ #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/i2cslave/I2CSlave.h" +#include "common-hal/i2cperipheral/I2CPeripheral.h" typedef struct { mp_obj_base_t base; - i2cslave_i2c_slave_obj_t *slave; + i2cperipheral_i2c_peripheral_obj_t *peripheral; uint16_t address; bool is_read; bool is_restart; -} i2cslave_i2c_slave_request_obj_t; +} i2cperipheral_i2c_peripheral_request_obj_t; -extern const mp_obj_type_t i2cslave_i2c_slave_request_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; -extern const mp_obj_type_t i2cslave_i2c_slave_type; +extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; -extern void common_hal_i2cslave_i2c_slave_construct(i2cslave_i2c_slave_obj_t *self, +extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint8_t *addresses, unsigned int num_addresses, bool smbus); -extern void common_hal_i2cslave_i2c_slave_deinit(i2cslave_i2c_slave_obj_t *self); -extern bool common_hal_i2cslave_i2c_slave_deinited(i2cslave_i2c_slave_obj_t *self); +extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); +extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); -extern int common_hal_i2cslave_i2c_slave_is_addressed(i2cslave_i2c_slave_obj_t *self, +extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart); -extern int common_hal_i2cslave_i2c_slave_read_byte(i2cslave_i2c_slave_obj_t *self, uint8_t *data); -extern int common_hal_i2cslave_i2c_slave_write_byte(i2cslave_i2c_slave_obj_t *self, uint8_t data); -extern void common_hal_i2cslave_i2c_slave_ack(i2cslave_i2c_slave_obj_t *self, bool ack); -extern void common_hal_i2cslave_i2c_slave_close(i2cslave_i2c_slave_obj_t *self); +extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); +extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); +extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); +extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H diff --git a/shared-bindings/i2cslave/__init__.c b/shared-bindings/i2cperipheral/__init__.c similarity index 71% rename from shared-bindings/i2cslave/__init__.c rename to shared-bindings/i2cperipheral/__init__.c index 59674d5cb4..e2cb8509d6 100644 --- a/shared-bindings/i2cslave/__init__.c +++ b/shared-bindings/i2cperipheral/__init__.c @@ -30,26 +30,26 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" -//#include "shared-bindings/i2cslave/__init__.h" -#include "shared-bindings/i2cslave/I2CSlave.h" +//#include "shared-bindings/i2cperipheral/__init__.h" +#include "shared-bindings/i2cperipheral/I2CPeripheral.h" #include "py/runtime.h" -//| """Two wire serial protocol slave +//| """Two wire serial protocol peripheral //| -//| The `i2cslave` module contains classes to support a I2C slave. +//| The `i2cperipheral` module contains classes to support an I2C peripheral. //| -//| Example emulating 2 devices:: +//| Example emulating a peripheral with 2 addresses (read and write):: //| //| import board -//| from i2cslave import I2CSlave +//| from i2cperipheral import I2CPeripheral //| //| regs = [0] * 16 //| index = 0 //| -//| with I2CSlave(board.SCL, board.SDA, (0x40, 0x41)) as slave: +//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: //| while True: -//| r = slave.request() +//| r = device.request() //| if not r: //| # Maybe do some housekeeping //| continue @@ -67,7 +67,7 @@ //| n = r.write(bytes([regs[index]])) //| #else: //| # A read transfer is not supported in this example -//| # If the Master tries, it will get 0xff byte(s) by the ctx manager (r.close()) +//| # If the microcontroller tries, it will get 0xff byte(s) by the ctx manager (r.close()) //| elif r.address == 0x41: //| if not r.is_read: //| b = r.read(1) @@ -75,7 +75,7 @@ //| # do something //| pass //| -//| This example sets up an I2C slave that can be accessed from Linux like this:: +//| This example sets up an I2C device that can be accessed from Linux like this:: //| //| $ i2cget -y 1 0x40 0x01 //| 0x00 @@ -84,22 +84,23 @@ //| 0xaa //| //| .. warning:: -//| I2CSlave makes use of clock stretching in order to slow down the master. -//| Make sure the I2C master supports this. +//| I2CPeripheral makes use of clock stretching in order to slow down +//| the host. +//| Make sure the I2C host supports this. //| //| Raspberry Pi in particular does not support this with its I2C hw block. //| This can be worked around by using the ``i2c-gpio`` bit banging driver. //| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" //| -STATIC const mp_rom_map_elem_t i2cslave_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cslave) }, - { MP_ROM_QSTR(MP_QSTR_I2CSlave), MP_ROM_PTR(&i2cslave_i2c_slave_type) }, +STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, + { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cslave_module_globals, i2cslave_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); -const mp_obj_module_t i2cslave_module = { +const mp_obj_module_t i2cperipheral_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t*)&i2cslave_module_globals, + .globals = (mp_obj_dict_t*)&i2cperipheral_module_globals, }; From 3c11f6cc05d1e53985591fec3d0297444eeee151 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 14:43:02 -0500 Subject: [PATCH 861/919] tests: Remove a test for micropython-specific SPI behavior --- tests/pyb/spi.py | 33 --------------------------------- tests/pyb/spi.py.exp | 14 -------------- 2 files changed, 47 deletions(-) delete mode 100644 tests/pyb/spi.py delete mode 100644 tests/pyb/spi.py.exp diff --git a/tests/pyb/spi.py b/tests/pyb/spi.py deleted file mode 100644 index 88cc975bb6..0000000000 --- a/tests/pyb/spi.py +++ /dev/null @@ -1,33 +0,0 @@ -from pyb import SPI - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - SPI(bus) - print("SPI", bus) - except ValueError: - print("ValueError", bus) - -spi = SPI(1) -print(spi) - -spi = SPI(1, SPI.MASTER) -spi = SPI(1, SPI.MASTER, baudrate=500000) -spi = SPI(1, SPI.MASTER, 500000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, ti=False, crc=None) -print(spi) - -spi.init(SPI.SLAVE, phase=1) -print(spi) -try: - # need to flush input before we get an error (error is what we want to test) - for i in range(10): - spi.recv(1, timeout=100) -except OSError: - print("OSError") - -spi.init(SPI.MASTER) -spi.send(1, timeout=100) -print(spi.recv(1, timeout=100)) -print(spi.send_recv(1, timeout=100)) - -spi.deinit() diff --git a/tests/pyb/spi.py.exp b/tests/pyb/spi.py.exp deleted file mode 100644 index a0d835700f..0000000000 --- a/tests/pyb/spi.py.exp +++ /dev/null @@ -1,14 +0,0 @@ -ValueError -1 -ValueError 0 -SPI 1 -SPI 2 -ValueError 3 -SPI X -SPI Y -ValueError Z -SPI(1) -SPI(1, SPI.MASTER, baudrate=328125, prescaler=256, polarity=1, phase=0, bits=8) -SPI(1, SPI.SLAVE, polarity=1, phase=1, bits=8) -OSError -b'\xff' -b'\xff' From d82292fa1f902f014f763948996cf31a617d0a8e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 16:58:08 -0500 Subject: [PATCH 862/919] README: Remove a statement that's not particularly true at the moment --- README.rst | 1 - tests/pyb/halerror.py | 15 ---- tests/pyb/i2c.py | 32 -------- tests/pyb/i2c.py.exp | 12 --- tests/pyb/i2c_error.py | 50 ------------ tests/wipy/i2c.py | 175 ----------------------------------------- tests/wipy/i2c.py.exp | 51 ------------ tests/wipy/spi.py | 147 ---------------------------------- tests/wipy/spi.py.exp | 35 --------- 9 files changed, 518 deletions(-) delete mode 100644 tests/pyb/halerror.py delete mode 100644 tests/pyb/i2c.py delete mode 100644 tests/pyb/i2c.py.exp delete mode 100644 tests/pyb/i2c_error.py delete mode 100644 tests/wipy/i2c.py delete mode 100644 tests/wipy/i2c.py.exp delete mode 100644 tests/wipy/spi.py delete mode 100644 tests/wipy/spi.py.exp diff --git a/README.rst b/README.rst index d09dcda456..15e0c96783 100644 --- a/README.rst +++ b/README.rst @@ -96,7 +96,6 @@ CircuitPython: - Supports native USB on all boards, allowing file editing without special tools. - Supports only SAMD21, SAMD51, nRF52840, CXD56, STM32F4 and i.MX RT ports. -- Tracks MicroPython's releases (not master). - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. - Does not support concurrency within Python (including interrupts and threading). Some concurrency diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py deleted file mode 100644 index 1a6bce1a7e..0000000000 --- a/tests/pyb/halerror.py +++ /dev/null @@ -1,15 +0,0 @@ -# test hal errors - -import pyb - -i2c = pyb.I2C(2, pyb.I2C.MASTER) -try: - i2c.recv(1, 1) -except OSError as e: - print(repr(e)) - -can = pyb.CAN(1, pyb.CAN.NORMAL) -try: - can.send('1', 1, timeout=50) -except OSError as e: - print(repr(e)) diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py deleted file mode 100644 index 6875e5a5aa..0000000000 --- a/tests/pyb/i2c.py +++ /dev/null @@ -1,32 +0,0 @@ -import pyb -from pyb import I2C - -# test we can correctly create by id or name -for bus in (-1, 0, 1, 2, 3, "X", "Y", "Z"): - try: - I2C(bus) - print("I2C", bus) - except ValueError: - print("ValueError", bus) - -i2c = I2C(1) - -i2c.init(I2C.MASTER, baudrate=400000) -print(i2c.scan()) -i2c.deinit() - -# use accelerometer to test i2c bus - -accel_addr = 76 - -pyb.Accel() # this will init the MMA for us -i2c.init(I2C.MASTER, baudrate=400000) - -print(i2c.scan()) -print(i2c.is_ready(accel_addr)) - -print(i2c.mem_read(1, accel_addr, 7, timeout=500)) -i2c.mem_write(0, accel_addr, 0, timeout=500) - -i2c.send(7, addr=accel_addr) -i2c.recv(1, addr=accel_addr) diff --git a/tests/pyb/i2c.py.exp b/tests/pyb/i2c.py.exp deleted file mode 100644 index 709fb412de..0000000000 --- a/tests/pyb/i2c.py.exp +++ /dev/null @@ -1,12 +0,0 @@ -ValueError -1 -ValueError 0 -I2C 1 -I2C 2 -ValueError 3 -I2C X -I2C Y -ValueError Z -[] -[76] -True -b'\x01' diff --git a/tests/pyb/i2c_error.py b/tests/pyb/i2c_error.py deleted file mode 100644 index 3201d6367d..0000000000 --- a/tests/pyb/i2c_error.py +++ /dev/null @@ -1,50 +0,0 @@ -# test I2C errors, with polling (disabled irqs) and DMA - -import pyb -from pyb import I2C - -# init accelerometer -pyb.Accel() - -# get I2C bus -i2c = I2C(1, I2C.MASTER, dma=True) - -# test polling mem_read -pyb.disable_irq() -i2c.mem_read(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test polling mem_write -pyb.disable_irq() -i2c.mem_write(1, 76, 0x0a) # should succeed -pyb.enable_irq() -try: - pyb.disable_irq() - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - pyb.enable_irq() - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed - -# test DMA mem_read -i2c.mem_read(1, 76, 0x0a) # should succeed -try: - i2c.mem_read(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_read(1, 76, 0x0a) # should succeed - -# test DMA mem_write -i2c.mem_write(1, 76, 0x0a) # should succeed -try: - i2c.mem_write(1, 77, 0x0a) # should fail -except OSError as e: - print(repr(e)) -i2c.mem_write(1, 76, 0x0a) # should succeed diff --git a/tests/wipy/i2c.py b/tests/wipy/i2c.py deleted file mode 100644 index 39dcdc722b..0000000000 --- a/tests/wipy/i2c.py +++ /dev/null @@ -1,175 +0,0 @@ -''' -I2C test for the CC3200 based boards. -A MPU-9150 sensor must be connected to the I2C bus. -''' - -from machine import I2C -import os -import time - -mch = os.uname().machine -if 'LaunchPad' in mch: - i2c_pins = ('GP11', 'GP10') -elif 'WiPy' in mch: - i2c_pins = ('GP15', 'GP10') -else: - raise Exception('Board not supported!') - -i2c = I2C(0, I2C.MASTER, baudrate=400000) -# try initing without the peripheral id -i2c = I2C() -print(i2c) -i2c = I2C(mode=I2C.MASTER, baudrate=50000, pins=i2c_pins) -print(i2c) - -i2c = I2C(0, I2C.MASTER, baudrate=100000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000) -print(i2c) -i2c = I2C(0, mode=I2C.MASTER, baudrate=400000, pins=i2c_pins) -print(i2c) - -addr = i2c.scan()[0] -print(addr) - -reg = bytearray(1) -reg2 = bytearray(2) -reg2_r = bytearray(2) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) - -# now just read one byte -data = i2c.readfrom_mem(addr, 117, 1) # read the "who am I?" register -print(0x68 == data[0]) -print(len(data) == 1) -print(1 == i2c.readfrom_mem_into(addr, 117, reg)) # read the "who am I?" register again -print(0x68 == reg[0]) - -# now try reading two bytes -data = i2c.readfrom_mem(addr, 116, 2) # read the "who am I?" register -print(0x68 == data[1]) -print(data == b'\x00\x68') -print(len(data) == 2) -print(2 == i2c.readfrom_mem_into(addr, 116, reg2)) # read the "who am I?" register again -print(0x68 == reg2[1]) -print(reg2 == b'\x00\x68') - -print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1 -print(0x40 == reg[0]) -# clear the sleep bit -reg[0] = 0 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0 == reg[0]) - -# set the sleep bit -reg[0] = 0x40 -print(1 == i2c.writeto_mem(addr, 107, reg)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg) -print(0x40 == reg[0]) - -# reset the sensor -reg[0] |= 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# now read and write two register at a time -print(2 == i2c.readfrom_mem_into(addr, 107, reg2)) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) -# clear the sleep bit -reg2[0] = 0 -# set some other bits -reg2[1] |= 0x03 -print(2 == i2c.writeto_mem(addr, 107, reg2)) -# read it back -i2c.readfrom_mem_into(addr, 107, reg2_r) -print(reg2 == reg2_r) - -# reset the sensor -reg[0] = 0x80 -print(1 == i2c.writeto_mem(addr, 107, reg)) -time.sleep_ms(100) # wait for the sensor to reset... - -# try some raw read and writes -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(1 == i2c.readfrom_into(addr, reg)) -print(reg[0] == 0x68) -reg[0] = 117 # register address -print(1 == i2c.writeto(addr, reg, stop=False)) # just write the register address -# now read -print(0x68 == i2c.readfrom(addr, 1)[0]) - -i2c.readfrom_mem_into(addr, 107, reg2) -print(0x40 == reg2[0]) -print(0x00 == reg2[1]) - -reg2[0] = 107 # register address -reg2[1] = 0 -print(2 == i2c.writeto(addr, reg2, stop=True)) # write the register address and the data -i2c.readfrom_mem_into(addr, 107, reg) # check it back -print(reg[0] == 0) - -# check for memory leaks... -for i in range (0, 1000): - i2c = I2C(0, I2C.MASTER, baudrate=100000) - -# test deinit -i2c = I2C(0, I2C.MASTER, baudrate=100000) -i2c.deinit() -print(i2c) - -# next ones should raise -try: - i2c.scan() -except Exception: - print("Exception") - -try: - i2c.readfrom(addr, 1) -except Exception: - print("Exception") - -try: - i2c.readfrom_into(addr, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem_into(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.writeto(addr, reg, stop=False) -except Exception: - print("Exception") - -try: - i2c.writeto_mem(addr, 107, reg) -except Exception: - print("Exception") - -try: - i2c.readfrom_mem(addr, 116, 2) -except Exception: - print("Exception") - -try: - I2C(1, I2C.MASTER, baudrate=100000) -except Exception: - print("Exception") - -# reinitialization must work -i2c.init(baudrate=400000) -print(i2c) diff --git a/tests/wipy/i2c.py.exp b/tests/wipy/i2c.py.exp deleted file mode 100644 index 083da9be7d..0000000000 --- a/tests/wipy/i2c.py.exp +++ /dev/null @@ -1,51 +0,0 @@ -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=50000) -I2C(0, I2C.MASTER, baudrate=100000) -I2C(0, I2C.MASTER, baudrate=400000) -I2C(0, I2C.MASTER, baudrate=400000) -104 -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -True -I2C(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -I2C(0, I2C.MASTER, baudrate=400000) diff --git a/tests/wipy/spi.py b/tests/wipy/spi.py deleted file mode 100644 index 6bd7aabce1..0000000000 --- a/tests/wipy/spi.py +++ /dev/null @@ -1,147 +0,0 @@ -''' -SPI test for the CC3200 based boards. -''' - -from machine import SPI -import os - -mch = os.uname().machine -if 'LaunchPad' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -elif 'WiPy' in mch: - spi_pins = ('GP14', 'GP16', 'GP30') -else: - raise Exception('Board not supported!') - -spi = SPI(0, SPI.MASTER, baudrate=2000000, polarity=0, phase=0, firstbit=SPI.MSB, pins=spi_pins) -print(spi) -spi = SPI(baudrate=5000000) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=1) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0) -print(spi) -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -print(spi) -spi.init(baudrate=20000000, polarity=0, phase=0) -print(spi) -spi=SPI() -print(spi) -SPI(mode=SPI.MASTER) -SPI(mode=SPI.MASTER, pins=spi_pins) -SPI(id=0, mode=SPI.MASTER, polarity=0, phase=0, pins=('GP14', 'GP16', 'GP15')) -SPI(0, SPI.MASTER, polarity=0, phase=0, pins=('GP31', 'GP16', 'GP15')) - -spi = SPI(0, SPI.MASTER, baudrate=10000000, polarity=0, phase=0, pins=spi_pins) -print(spi.write('123456') == 6) -buffer_r = bytearray(10) -print(spi.readinto(buffer_r) == 10) -print(spi.readinto(buffer_r, write=0x55) == 10) -read = spi.read(10) -print(len(read) == 10) -read = spi.read(10, write=0xFF) -print(len(read) == 10) -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) -print(spi.write_readinto(buffer_w, buffer_r) == 10) -print(buffer_w == buffer_r) - -# test all polaritiy and phase combinations -spi.init(polarity=1, phase=0, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=1, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -spi.init(polarity=0, phase=1, pins=None) -buffer_r = bytearray(10) -spi.write_readinto(buffer_w, buffer_r) -print(buffer_w == buffer_r) - -# test 16 and 32 bit transfers -buffer_w = bytearray([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2]) -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=16, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -buffer_r = bytearray(12) -spi.init(SPI.MASTER, baudrate=10000000, bits=32, polarity=0, phase=0, pins=None) -print(spi.write_readinto(buffer_w, buffer_r) == 12) -print(buffer_w == buffer_r) - -# check for memory leaks... -for i in range (0, 1000): - spi = SPI(0, SPI.MASTER, baudrate=1000000) - -# test deinit -spi = SPI(0, SPI.MASTER, baudrate=1000000) -spi.deinit() -print(spi) - -spi = SPI(0, SPI.MASTER, baudrate=1000000) -# next ones must fail -try: - spi = SPI(0, 10, baudrate=10000000, polarity=0, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=2) -except: - print("Exception") - -try: - spi = SPI(1, mode=SPI.MASTER, baudrate=10000000, polarity=1, phase=1) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, firstbit=2) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=2, phase=0, pins=('GP1', 'GP2')) -except: - print("Exception") - -try: - spi = SPI(0, mode=SPI.MASTER, baudrate=2000000, polarity=0, phase=0, bits=9) -except: - print("Exception") - -spi.deinit() -try: - spi.read(15) -except Exception: - print("Exception") - -try: - spi.spi.readinto(buffer_r) -except Exception: - print("Exception") - -try: - spi.spi.write('abc') -except Exception: - print("Exception") - -try: - spi.write_readinto(buffer_w, buffer_r) -except Exception: - print("Exception") - -# reinitialization must work -spi.init(baudrate=500000) -print(spi) diff --git a/tests/wipy/spi.py.exp b/tests/wipy/spi.py.exp deleted file mode 100644 index cc4ff40228..0000000000 --- a/tests/wipy/spi.py.exp +++ /dev/null @@ -1,35 +0,0 @@ -SPI(0, SPI.MASTER, baudrate=2000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=200000, bits=16, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=0, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=5000000, bits=32, polarity=1, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=10000000, bits=8, polarity=1, phase=1, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=20000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -SPI(0, SPI.MASTER, baudrate=1000000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) -True -True -True -True -True -True -True -True -True -True -True -True -True -True -SPI(0) -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -SPI(0, SPI.MASTER, baudrate=500000, bits=8, polarity=0, phase=0, firstbit=SPI.MSB) From 4f8b37042d3575ace22067dba09694adf8fb80c0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 16:58:22 -0500 Subject: [PATCH 863/919] README: point at status badge for github actions, and right branch --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 15e0c96783..347b8b8c6b 100644 --- a/README.rst +++ b/README.rst @@ -210,8 +210,8 @@ The remaining port directories not listed above are in the repo to maintain comp `back to top <#circuitpython>`__ -.. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master - :target: https://travis-ci.org/adafruit/circuitpython +.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg + :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain .. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest :target: http://circuitpython.readthedocs.io/ .. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg From 103ad9966a1c871fe06f2222bd0226bbd81fffba Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 17:00:35 -0500 Subject: [PATCH 864/919] remove machine_i2c, machine_spi This micropython code is not used in circuitpython --- extmod/machine_i2c.c | 641 ------------------------------------------- extmod/machine_i2c.h | 58 ---- extmod/machine_spi.c | 286 ------------------- extmod/machine_spi.h | 58 ---- ports/unix/Makefile | 2 - 5 files changed, 1045 deletions(-) delete mode 100644 extmod/machine_i2c.c delete mode 100644 extmod/machine_i2c.h delete mode 100644 extmod/machine_spi.c delete mode 100644 extmod/machine_spi.h diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c deleted file mode 100644 index 4129ace0a0..0000000000 --- a/extmod/machine_i2c.c +++ /dev/null @@ -1,641 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include -#include - -#include "py/mperrno.h" -#include "py/mphal.h" -#include "py/runtime.h" -#include "extmod/machine_i2c.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_I2C - -typedef mp_machine_soft_i2c_obj_t machine_i2c_obj_t; - -STATIC void mp_hal_i2c_delay(machine_i2c_obj_t *self) { - // We need to use an accurate delay to get acceptable I2C - // speeds (eg 1us should be not much more than 1us). - mp_hal_delay_us_fast(self->us_delay); -} - -STATIC void mp_hal_i2c_scl_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->scl); -} - -STATIC int mp_hal_i2c_scl_release(machine_i2c_obj_t *self) { - uint32_t count = self->us_timeout; - - mp_hal_pin_od_high(self->scl); - mp_hal_i2c_delay(self); - // For clock stretching, wait for the SCL pin to be released, with timeout. - for (; mp_hal_pin_read(self->scl) == 0 && count; --count) { - mp_hal_delay_us_fast(1); - } - if (count == 0) { - return -MP_ETIMEDOUT; - } - return 0; // success -} - -STATIC void mp_hal_i2c_sda_low(machine_i2c_obj_t *self) { - mp_hal_pin_od_low(self->sda); -} - -STATIC void mp_hal_i2c_sda_release(machine_i2c_obj_t *self) { - mp_hal_pin_od_high(self->sda); -} - -STATIC int mp_hal_i2c_sda_read(machine_i2c_obj_t *self) { - return mp_hal_pin_read(self->sda); -} - -STATIC int mp_hal_i2c_start(machine_i2c_obj_t *self) { - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - return 0; // success -} - -STATIC int mp_hal_i2c_stop(machine_i2c_obj_t *self) { - mp_hal_i2c_delay(self); - mp_hal_i2c_sda_low(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - return ret; -} - -STATIC void mp_hal_i2c_init(machine_i2c_obj_t *self, uint32_t freq) { - self->us_delay = 500000 / freq; - if (self->us_delay == 0) { - self->us_delay = 1; - } - mp_hal_pin_open_drain(self->scl); - mp_hal_pin_open_drain(self->sda); - mp_hal_i2c_stop(self); // ignore error -} - -// return value: -// 0 - byte written and ack received -// 1 - byte written and nack received -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_write_byte(machine_i2c_obj_t *self, uint8_t val) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - for (int i = 7; i >= 0; i--) { - if ((val >> i) & 1) { - mp_hal_i2c_sda_release(self); - } else { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - } - - mp_hal_i2c_sda_release(self); - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - - int ack = mp_hal_i2c_sda_read(self); - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - - return ack; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -STATIC int mp_hal_i2c_read_byte(machine_i2c_obj_t *self, uint8_t *val, int nack) { - mp_hal_i2c_delay(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - - uint8_t data = 0; - for (int i = 7; i >= 0; i--) { - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - return ret; - } - data = (data << 1) | mp_hal_i2c_sda_read(self); - mp_hal_i2c_scl_low(self); - mp_hal_i2c_delay(self); - } - *val = data; - - // send ack/nack bit - if (!nack) { - mp_hal_i2c_sda_low(self); - } - mp_hal_i2c_delay(self); - int ret = mp_hal_i2c_scl_release(self); - if (ret != 0) { - mp_hal_i2c_sda_release(self); - return ret; - } - mp_hal_i2c_scl_low(self); - mp_hal_i2c_sda_release(self); - - return 0; // success -} - -// return value: -// >=0 - number of acks received -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, addr << 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // write the buffer to the I2C memory - int num_acks = 0; - while (len--) { - ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return num_acks; -} - -// return value: -// 0 - success -// <0 - error, with errno being the negative of the return value -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - - // start the I2C transaction - int ret = mp_hal_i2c_start(self); - if (ret != 0) { - return ret; - } - - // write the slave address - ret = mp_hal_i2c_write_byte(self, (addr << 1) | 1); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, release the bus cleanly - mp_hal_i2c_stop(self); - return -MP_ENODEV; - } - - // read the bytes from the slave - while (len--) { - ret = mp_hal_i2c_read_byte(self, dest++, len == 0); - if (ret != 0) { - return ret; - } - } - - // finish the I2C transaction - if (stop) { - ret = mp_hal_i2c_stop(self); - if (ret != 0) { - return ret; - } - } - - return 0; // success -} - -/******************************************************************************/ -// MicroPython bindings for I2C - -STATIC void machine_i2c_obj_init_helper(machine_i2c_obj_t *self, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_scl, ARG_sda, ARG_freq, ARG_timeout }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_freq, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 400000} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - self->scl = mp_hal_get_pin_obj(args[ARG_scl].u_obj); - self->sda = mp_hal_get_pin_obj(args[ARG_sda].u_obj); - self->us_timeout = args[ARG_timeout].u_int; - mp_hal_i2c_init(self, args[ARG_freq].u_int); -} - -STATIC mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_I2C_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_I2C_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_I2C_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid I2C peripheral")); - #endif - } - --n_args; - ++args; - } - - // create new soft I2C object - machine_i2c_obj_t *self = m_new_obj(machine_i2c_obj_t); - self->base.type = &machine_i2c_type; - machine_i2c_obj_init_helper(self, n_args, args, kw_args); - return (mp_obj_t)self; -} - -STATIC mp_obj_t machine_i2c_obj_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - machine_i2c_obj_init_helper(args[0], n_args - 1, args + 1, kw_args); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_init_obj, 1, machine_i2c_obj_init); - -STATIC mp_obj_t machine_i2c_scan(mp_obj_t self_in) { - mp_obj_base_t *self = MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_obj_t list = mp_obj_new_list(0, NULL); - // 7-bit addresses 0b0000xxx and 0b1111xxx are reserved - for (int addr = 0x08; addr < 0x78; ++addr) { - int ret = i2c_p->writeto(self, addr, NULL, 0, true); - if (ret == 0) { - mp_obj_list_append(list, MP_OBJ_NEW_SMALL_INT(addr)); - } - } - return list; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_scan_obj, machine_i2c_scan); - -STATIC mp_obj_t machine_i2c_start(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->start == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->start(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_start_obj, machine_i2c_start); - -STATIC mp_obj_t machine_i2c_stop(mp_obj_t self_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->stop == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - int ret = i2c_p->stop(self); - if (ret != 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_stop_obj, machine_i2c_stop); - -STATIC mp_obj_t machine_i2c_readinto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->read == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to read into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - - // work out if we want to send a nack at the end - bool nack = (n_args == 2) ? true : mp_obj_is_true(args[2]); - - // do the read - int ret = i2c_p->read(self, bufinfo.buf, bufinfo.len, nack); - if (ret != 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readinto_obj, 2, 3, machine_i2c_readinto); - -STATIC mp_obj_t machine_i2c_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - if (i2c_p->write == NULL) { - mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); - } - - // get the buffer to write from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); - - // do the write - int ret = i2c_p->write(self, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -MP_DEFINE_CONST_FUN_OBJ_2(machine_i2c_write_obj, machine_i2c_write); - -STATIC mp_obj_t machine_i2c_readfrom(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[2])); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, (uint8_t*)vstr.buf, vstr.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_obj, 3, 4, machine_i2c_readfrom); - -STATIC mp_obj_t machine_i2c_readfrom_into(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_WRITE); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->readfrom(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_into_obj, 3, 4, machine_i2c_readfrom_into); - -STATIC mp_obj_t machine_i2c_writeto(size_t n_args, const mp_obj_t *args) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - mp_int_t addr = mp_obj_get_int(args[1]); - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ); - bool stop = (n_args == 3) ? true : mp_obj_is_true(args[3]); - int ret = i2c_p->writeto(self, addr, bufinfo.buf, bufinfo.len, stop); - if (ret < 0) { - mp_raise_OSError(-ret); - } - // return number of acks received - return MP_OBJ_NEW_SMALL_INT(ret); -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_writeto_obj, 3, 4, machine_i2c_writeto); - -STATIC int read_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - uint8_t memaddr_buf[4]; - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - memaddr_buf[memaddr_len++] = memaddr >> i; - } - int ret = i2c_p->writeto(self, addr, memaddr_buf, memaddr_len, false); - if (ret != memaddr_len) { - // must generate STOP - i2c_p->writeto(self, addr, NULL, 0, true); - return ret; - } - return i2c_p->readfrom(self, addr, buf, len, true); -} - -#define MAX_MEMADDR_SIZE (4) -#define BUF_STACK_SIZE (12) - -STATIC int write_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, const uint8_t *buf, size_t len) { - mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); - - // need some memory to create the buffer to send; try to use stack if possible - uint8_t buf2_stack[MAX_MEMADDR_SIZE + BUF_STACK_SIZE]; - uint8_t *buf2; - size_t buf2_alloc = 0; - if (len <= BUF_STACK_SIZE) { - buf2 = buf2_stack; - } else { - buf2_alloc = MAX_MEMADDR_SIZE + len; - buf2 = m_new(uint8_t, buf2_alloc); - } - - // create the buffer to send - size_t memaddr_len = 0; - for (int16_t i = addrsize - 8; i >= 0; i -= 8) { - buf2[memaddr_len++] = memaddr >> i; - } - memcpy(buf2 + memaddr_len, buf, len); - - int ret = i2c_p->writeto(self, addr, buf2, memaddr_len + len, true); - if (buf2_alloc != 0) { - m_del(uint8_t, buf2, buf2_alloc); - } - return ret; -} - -STATIC const mp_arg_t machine_i2c_mem_allowed_args[] = { - { MP_QSTR_addr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_memaddr, MP_ARG_REQUIRED | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_arg, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_addrsize, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, -}; - -STATIC mp_obj_t machine_i2c_readfrom_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_n, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // create the buffer to store data into - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[ARG_n].u_obj)); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, (uint8_t*)vstr.buf, vstr.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_obj, 1, machine_i2c_readfrom_mem); - - -STATIC mp_obj_t machine_i2c_readfrom_mem_into(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to store data into - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_WRITE); - - // do the transfer - int ret = read_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_readfrom_mem_into_obj, 1, machine_i2c_readfrom_mem_into); - -STATIC mp_obj_t machine_i2c_writeto_mem(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_addr, ARG_memaddr, ARG_buf, ARG_addrsize }; - mp_arg_val_t args[MP_ARRAY_SIZE(machine_i2c_mem_allowed_args)]; - mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, - MP_ARRAY_SIZE(machine_i2c_mem_allowed_args), machine_i2c_mem_allowed_args, args); - - // get the buffer to write the data from - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_READ); - - // do the transfer - int ret = write_mem(pos_args[0], args[ARG_addr].u_int, args[ARG_memaddr].u_int, - args[ARG_addrsize].u_int, bufinfo.buf, bufinfo.len); - if (ret < 0) { - mp_raise_OSError(-ret); - } - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_writeto_mem_obj, 1, machine_i2c_writeto_mem); - -STATIC const mp_rom_map_elem_t machine_i2c_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_i2c_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_scan), MP_ROM_PTR(&machine_i2c_scan_obj) }, - - // primitive I2C operations - { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&machine_i2c_start_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&machine_i2c_stop_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&machine_i2c_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&machine_i2c_write_obj) }, - - // standard bus operations - { MP_ROM_QSTR(MP_QSTR_readfrom), MP_ROM_PTR(&machine_i2c_readfrom_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_into), MP_ROM_PTR(&machine_i2c_readfrom_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto), MP_ROM_PTR(&machine_i2c_writeto_obj) }, - - // memory operations - { MP_ROM_QSTR(MP_QSTR_readfrom_mem), MP_ROM_PTR(&machine_i2c_readfrom_mem_obj) }, - { MP_ROM_QSTR(MP_QSTR_readfrom_mem_into), MP_ROM_PTR(&machine_i2c_readfrom_mem_into_obj) }, - { MP_ROM_QSTR(MP_QSTR_writeto_mem), MP_ROM_PTR(&machine_i2c_writeto_mem_obj) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_soft_i2c_locals_dict, machine_i2c_locals_dict_table); - -int mp_machine_soft_i2c_read(mp_obj_base_t *self_in, uint8_t *dest, size_t len, bool nack) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - while (len--) { - int ret = mp_hal_i2c_read_byte(self, dest++, nack && (len == 0)); - if (ret != 0) { - return ret; - } - } - return 0; // success -} - -int mp_machine_soft_i2c_write(mp_obj_base_t *self_in, const uint8_t *src, size_t len) { - machine_i2c_obj_t *self = (machine_i2c_obj_t*)self_in; - int num_acks = 0; - while (len--) { - int ret = mp_hal_i2c_write_byte(self, *src++); - if (ret < 0) { - return ret; - } else if (ret != 0) { - // nack received, stop sending - break; - } - ++num_acks; - } - return num_acks; -} - -STATIC const mp_machine_i2c_p_t mp_machine_soft_i2c_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_i2c) - .start = (int(*)(mp_obj_base_t*))mp_hal_i2c_start, - .stop = (int(*)(mp_obj_base_t*))mp_hal_i2c_stop, - .read = mp_machine_soft_i2c_read, - .write = mp_machine_soft_i2c_write, - .readfrom = mp_machine_soft_i2c_readfrom, - .writeto = mp_machine_soft_i2c_writeto, -}; - -const mp_obj_type_t machine_i2c_type = { - { &mp_type_type }, - .name = MP_QSTR_I2C, - .make_new = machine_i2c_make_new, - .protocol = &mp_machine_soft_i2c_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_soft_i2c_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_I2C diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h deleted file mode 100644 index 7f5ee568e3..0000000000 --- a/extmod/machine_i2c.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H - -#include "py/obj.h" -#include "py/proto.h" - -// I2C protocol -// the first 4 methods can be NULL, meaning operation is not supported -typedef struct _mp_machine_i2c_p_t { - MP_PROTOCOL_HEAD - int (*start)(mp_obj_base_t *obj); - int (*stop)(mp_obj_base_t *obj); - int (*read)(mp_obj_base_t *obj, uint8_t *dest, size_t len, bool nack); - int (*write)(mp_obj_base_t *obj, const uint8_t *src, size_t len); - int (*readfrom)(mp_obj_base_t *obj, uint16_t addr, uint8_t *dest, size_t len, bool stop); - int (*writeto)(mp_obj_base_t *obj, uint16_t addr, const uint8_t *src, size_t len, bool stop); -} mp_machine_i2c_p_t; - -typedef struct _mp_machine_soft_i2c_obj_t { - mp_obj_base_t base; - uint32_t us_delay; - uint32_t us_timeout; - mp_hal_pin_obj_t scl; - mp_hal_pin_obj_t sda; -} mp_machine_soft_i2c_obj_t; - -extern const mp_obj_type_t machine_i2c_type; -extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict; - -int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop); -int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c deleted file mode 100644 index 4ead321d90..0000000000 --- a/extmod/machine_spi.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -#include "py/runtime.h" -#include "extmod/machine_spi.h" - -#include "supervisor/shared/translate.h" - -#if MICROPY_PY_MACHINE_SPI - -// if a port didn't define MSB/LSB constants then provide them -#ifndef MICROPY_PY_MACHINE_SPI_MSB -#define MICROPY_PY_MACHINE_SPI_MSB (0) -#define MICROPY_PY_MACHINE_SPI_LSB (1) -#endif - -/******************************************************************************/ -// MicroPython bindings for generic machine.SPI - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - // check the id argument, if given - if (n_args > 0) { - if (args[0] != MP_OBJ_NEW_SMALL_INT(-1)) { - #if defined(MICROPY_PY_MACHINE_SPI_MAKE_NEW) - // dispatch to port-specific constructor - extern mp_obj_t MICROPY_PY_MACHINE_SPI_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - return MICROPY_PY_MACHINE_SPI_MAKE_NEW(type, n_args, args, kw_args); - #else - mp_raise_ValueError(translate("invalid SPI peripheral")); - #endif - } - --n_args; - ++args; - } - - // software SPI - return mp_machine_soft_spi_make_new(type, n_args, args, kw_args); -} - -STATIC mp_obj_t machine_spi_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->init(s, n_args - 1, args + 1, kw_args); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_spi_init_obj, 1, machine_spi_init); - -STATIC mp_obj_t machine_spi_deinit(mp_obj_t self) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - if (spi_p->deinit != NULL) { - spi_p->deinit(s); - } - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_spi_deinit_obj, machine_spi_deinit); - -STATIC void mp_machine_spi_transfer(mp_obj_t self, size_t len, const void *src, void *dest) { - mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); - spi_p->transfer(s, len, src, dest); -} - -STATIC mp_obj_t mp_machine_spi_read(size_t n_args, const mp_obj_t *args) { - vstr_t vstr; - vstr_init_len(&vstr, mp_obj_get_int(args[1])); - memset(vstr.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, vstr.len); - mp_machine_spi_transfer(args[0], vstr.len, vstr.buf, vstr.buf); - return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj, 2, 3, mp_machine_spi_read); - -STATIC mp_obj_t mp_machine_spi_readinto(size_t n_args, const mp_obj_t *args) { - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); - memset(bufinfo.buf, n_args == 3 ? mp_obj_get_int(args[2]) : 0, bufinfo.len); - mp_machine_spi_transfer(args[0], bufinfo.len, bufinfo.buf, bufinfo.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj, 2, 3, mp_machine_spi_readinto); - -STATIC mp_obj_t mp_machine_spi_write(mp_obj_t self, mp_obj_t wr_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_machine_spi_transfer(self, src.len, (const uint8_t*)src.buf, NULL); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj, mp_machine_spi_write); - -STATIC mp_obj_t mp_machine_spi_write_readinto(mp_obj_t self, mp_obj_t wr_buf, mp_obj_t rd_buf) { - mp_buffer_info_t src; - mp_get_buffer_raise(wr_buf, &src, MP_BUFFER_READ); - mp_buffer_info_t dest; - mp_get_buffer_raise(rd_buf, &dest, MP_BUFFER_WRITE); - if (src.len != dest.len) { - mp_raise_ValueError(translate("buffers must be the same length")); - } - mp_machine_spi_transfer(self, src.len, src.buf, dest.buf); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj, mp_machine_spi_write_readinto); - -STATIC const mp_rom_map_elem_t machine_spi_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&machine_spi_init_obj) }, - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&machine_spi_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_machine_spi_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_machine_spi_readinto_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_machine_spi_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&mp_machine_spi_write_readinto_obj) }, - - { MP_ROM_QSTR(MP_QSTR_MSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_MSB) }, - { MP_ROM_QSTR(MP_QSTR_LSB), MP_ROM_INT(MICROPY_PY_MACHINE_SPI_LSB) }, -}; - -MP_DEFINE_CONST_DICT(mp_machine_spi_locals_dict, machine_spi_locals_dict_table); - -/******************************************************************************/ -// Implementation of soft SPI - -STATIC uint32_t baudrate_from_delay_half(uint32_t delay_half) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (delay_half == MICROPY_HW_SOFTSPI_MIN_DELAY) { - return MICROPY_HW_SOFTSPI_MAX_BAUDRATE; - } else - #endif - { - return 500000 / delay_half; - } -} - -STATIC uint32_t baudrate_to_delay_half(uint32_t baudrate) { - #ifdef MICROPY_HW_SOFTSPI_MIN_DELAY - if (baudrate >= MICROPY_HW_SOFTSPI_MAX_BAUDRATE) { - return MICROPY_HW_SOFTSPI_MIN_DELAY; - } else - #endif - { - uint32_t delay_half = 500000 / baudrate; - // round delay_half up so that: actual_baudrate <= requested_baudrate - if (500000 % baudrate != 0) { - delay_half += 1; - } - return delay_half; - } -} - -STATIC void mp_machine_soft_spi_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - mp_machine_soft_spi_obj_t *self = MP_OBJ_TO_PTR(self_in); - mp_printf(print, "SoftSPI(baudrate=%u, polarity=%u, phase=%u," - " sck=" MP_HAL_PIN_FMT ", mosi=" MP_HAL_PIN_FMT ", miso=" MP_HAL_PIN_FMT ")", - baudrate_from_delay_half(self->spi.delay_half), self->spi.polarity, self->spi.phase, - mp_hal_pin_name(self->spi.sck), mp_hal_pin_name(self->spi.mosi), mp_hal_pin_name(self->spi.miso)); -} - -STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *all_args, mp_map_t *kw_args) { - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_bits, ARG_firstbit, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 500000} }, - { MP_QSTR_polarity, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_phase, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, - { MP_QSTR_bits, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 8} }, - { MP_QSTR_firstbit, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = MICROPY_PY_MACHINE_SPI_MSB} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, all_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - // create new object - mp_machine_soft_spi_obj_t *self = m_new_obj(mp_machine_soft_spi_obj_t); - self->base.type = &mp_machine_soft_spi_type; - - // set parameters - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - self->spi.polarity = args[ARG_polarity].u_int; - self->spi.phase = args[ARG_phase].u_int; - if (args[ARG_bits].u_int != 8) { - mp_raise_ValueError(translate("bits must be 8")); - } - if (args[ARG_firstbit].u_int != MICROPY_PY_MACHINE_SPI_MSB) { - mp_raise_ValueError(translate("firstbit must be MSB")); - } - if (args[ARG_sck].u_obj == MP_OBJ_NULL - || args[ARG_mosi].u_obj == MP_OBJ_NULL - || args[ARG_miso].u_obj == MP_OBJ_NULL) { - mp_raise_ValueError(translate("must specify all of sck/mosi/miso")); - } - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); - - return MP_OBJ_FROM_PTR(self); -} - -STATIC void mp_machine_soft_spi_init(mp_obj_base_t *self_in, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - - enum { ARG_baudrate, ARG_polarity, ARG_phase, ARG_sck, ARG_mosi, ARG_miso }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_polarity, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_phase, MP_ARG_INT, {.u_int = -1} }, - { MP_QSTR_sck, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_mosi, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - { MP_QSTR_miso, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, - }; - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - - if (args[ARG_baudrate].u_int != -1) { - self->spi.delay_half = baudrate_to_delay_half(args[ARG_baudrate].u_int); - } - if (args[ARG_polarity].u_int != -1) { - self->spi.polarity = args[ARG_polarity].u_int; - } - if (args[ARG_phase].u_int != -1) { - self->spi.phase = args[ARG_phase].u_int; - } - if (args[ARG_sck].u_obj != MP_OBJ_NULL) { - self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj); - } - if (args[ARG_mosi].u_obj != MP_OBJ_NULL) { - self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj); - } - if (args[ARG_miso].u_obj != MP_OBJ_NULL) { - self->spi.miso = mp_hal_get_pin_obj(args[ARG_miso].u_obj); - } - - // configure bus - mp_soft_spi_ioctl(&self->spi, MP_SPI_IOCTL_INIT); -} - -STATIC void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, const uint8_t *src, uint8_t *dest) { - mp_machine_soft_spi_obj_t *self = (mp_machine_soft_spi_obj_t*)self_in; - mp_soft_spi_transfer(&self->spi, len, src, dest); -} - -const mp_machine_spi_p_t mp_machine_soft_spi_p = { - MP_PROTO_IMPLEMENT(MP_QSTR_protocol_spi) - .init = mp_machine_soft_spi_init, - .deinit = NULL, - .transfer = mp_machine_soft_spi_transfer, -}; - -const mp_obj_type_t mp_machine_soft_spi_type = { - { &mp_type_type }, - .name = MP_QSTR_SoftSPI, - .print = mp_machine_soft_spi_print, - .make_new = mp_machine_spi_make_new, // delegate to master constructor - .protocol = &mp_machine_soft_spi_p, - .locals_dict = (mp_obj_dict_t*)&mp_machine_spi_locals_dict, -}; - -#endif // MICROPY_PY_MACHINE_SPI diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h deleted file mode 100644 index 365b44d6e8..0000000000 --- a/extmod/machine_spi.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H -#define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H - -#include "py/obj.h" -#include "py/proto.h" -#include "py/mphal.h" -#include "drivers/bus/spi.h" - -// SPI protocol -typedef struct _mp_machine_spi_p_t { - MP_PROTOCOL_HEAD - void (*init)(mp_obj_base_t *obj, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); - void (*deinit)(mp_obj_base_t *obj); // can be NULL - void (*transfer)(mp_obj_base_t *obj, size_t len, const uint8_t *src, uint8_t *dest); -} mp_machine_spi_p_t; - -typedef struct _mp_machine_soft_spi_obj_t { - mp_obj_base_t base; - mp_soft_spi_obj_t spi; -} mp_machine_soft_spi_obj_t; - -extern const mp_machine_spi_p_t mp_machine_soft_spi_p; -extern const mp_obj_type_t mp_machine_soft_spi_type; -extern const mp_obj_dict_t mp_machine_spi_locals_dict; - -mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args); - -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj); -MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj); -MP_DECLARE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj); -MP_DECLARE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj); - -#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 63c4980c31..5d4b168fe9 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -161,8 +161,6 @@ PY_EXTMOD_O_BASENAME += \ extmod/machine_pinbase.o \ extmod/machine_signal.o \ extmod/machine_pulse.o \ - extmod/machine_i2c.o \ - extmod/machine_spi.o LIB_SRC_C = $(addprefix lib/,\ $(LIB_SRC_C_EXTRA) \ From e7923c068ec62d4426af4b4ecc8fabe378b0f067 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 15 Jun 2020 16:48:16 -0500 Subject: [PATCH 865/919] docs: Explain our shift in terminology --- docs/design_guide.rst | 37 +++++++++++++++++++++++++++++++++++++ docs/static/customstyle.css | 4 ++++ 2 files changed, 41 insertions(+) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 1d40943acb..2d52e988b0 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -1,3 +1,5 @@ +.. role:: strike + Design Guide ============ @@ -46,6 +48,41 @@ not have the ``adafruit_`` module or package prefix. Both should have the CircuitPython repository topic on GitHub. +Terminology +----------- + +As our Code of Conduct states, we strive to use "welcoming and inclusive +language." Whether it is in documentation or in code, the words we use matter. +This means we disfavor language that due to historical and social context can +make community members and potential community members feel unwelcome. + +There are specific terms to avoid except where technical limitations require it. +While specific cases may call for other terms, consider using these suggested +terms first: + ++--------------------+---------------------+ +| Preferred | Deprecated | ++====================+=====================+ +| Main (device) | :strike:`Master` | ++--------------------+---------------------+ +| Peripheral | :strike:`Slave` | ++--------------------+ + +| Sensor | | ++--------------------+ + +| Secondary (device) | | ++--------------------+---------------------+ +| Denylist | :strike:`Blacklist` | ++--------------------+---------------------+ +| Allowlist | :strike:`Whitelist` | ++--------------------+---------------------+ + +Note that "technical limitations" refers e.g., to the situation where an +upstream library or URL has to contain those substrings in order to work. +However, when it comes to documentation and the names of parameters and +properties in CircuitPython, we will use alternate terms even if this breaks +tradition with past practice. + + .. _lifetime-and-contextmanagers: Lifetime and ContextManagers diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..3c0bc84243 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -24,3 +24,7 @@ overflow: visible !important; } } + +.strike { + text-decoration: line-through; +} From 66d031fc1890381cbdf14b1abce3436bc7d23abb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Jun 2020 14:15:45 -0500 Subject: [PATCH 866/919] make translate and msgmerge --- locale/ID.po | 71 ++++++++++++++++--------------- locale/circuitpython.pot | 41 ++++-------------- locale/cs.po | 50 +++++++--------------- locale/de_DE.po | 71 ++++++++++++++++--------------- locale/en_US.po | 78 +++++++++++++++++++--------------- locale/en_x_pirate.po | 90 +++++++++++++++++++++++++--------------- locale/es.po | 71 ++++++++++++++++--------------- locale/fil.po | 71 ++++++++++++++++--------------- locale/fr.po | 71 ++++++++++++++++--------------- locale/it_IT.po | 71 ++++++++++++++++--------------- locale/ko.po | 59 +++++++++++--------------- locale/nl.po | 71 ++++++++++++++++--------------- locale/pl.po | 71 ++++++++++++++++--------------- locale/pt_BR.po | 71 ++++++++++++++++--------------- locale/sv.po | 71 ++++++++++++++++--------------- locale/zh_Latn_pinyin.po | 71 ++++++++++++++++--------------- 16 files changed, 555 insertions(+), 544 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c40ac105c5..ae057fbd7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "Semua channel event yang disinkronisasi sedang digunakan" msgid "All timers for this pin are in use" msgstr "Semua timer untuk pin ini sedang digunakan" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Semua timer sedang digunakan" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -828,10 +833,6 @@ msgstr "operasi I/O pada file tertutup" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operasi I2C tidak didukung" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pin untuk channel kanan tidak valid" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1441,6 +1442,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1627,6 +1632,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate tidak didukung" @@ -1743,11 +1749,11 @@ msgstr "abort() dipanggil" msgid "address %08x is not aligned to %d bytes" msgstr "alamat %08x tidak selaras dengan %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1828,10 +1834,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits harus memilki nilai 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1858,10 +1860,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers harus mempunyai panjang yang sama" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1937,7 +1935,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2291,10 +2289,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "bit pertama(firstbit) harus berupa MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2479,14 +2473,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "perangkat I2C tidak valid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "perangkat SPI tidak valid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumen-argumen tidak valid" @@ -2663,10 +2649,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "harus menentukan semua pin sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3455,6 +3437,9 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" +#~ msgid "I2C operation not supported" +#~ msgstr "operasi I2C tidak didukung" + #~ msgid "Invalid bit clock pin" #~ msgstr "Bit clock pada pin tidak valid" @@ -3546,9 +3531,15 @@ msgstr "" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits harus memilki nilai 8" + #~ msgid "buffer too long" #~ msgstr "buffer terlalu panjang" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers harus mempunyai panjang yang sama" + #~ msgid "can query only one param" #~ msgstr "hanya bisa melakukan query satu param" @@ -3573,6 +3564,9 @@ msgstr "" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "bit pertama(firstbit) harus berupa MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "alokasi flash harus dibawah 1MByte" @@ -3582,6 +3576,12 @@ msgstr "" #~ msgid "impossible baudrate" #~ msgstr "baudrate tidak memungkinkan" +#~ msgid "invalid I2C peripheral" +#~ msgstr "perangkat I2C tidak valid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "perangkat SPI tidak valid" + #~ msgid "invalid alarm" #~ msgstr "alarm tidak valid" @@ -3603,6 +3603,9 @@ msgstr "" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alokasi memori gagal, mengalokasikan %u byte untuk kode native" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "harus menentukan semua pin sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f125c2cc4b..1582b746ca 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -821,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1729,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1814,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1843,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1922,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2276,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2648,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 39bf51af8e..b23144fc8c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -580,6 +581,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -825,10 +830,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -970,7 +971,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1433,6 +1434,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1619,6 +1624,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1728,11 +1734,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1813,10 +1819,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1842,10 +1844,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1921,7 +1919,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2275,10 +2273,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2463,14 +2457,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2647,10 +2633,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index d317a6234a..eff611b20d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -298,6 +298,7 @@ msgstr "Alle sync event Kanäle werden benutzt" msgid "All timers for this pin are in use" msgstr "Alle timer für diesen Pin werden bereits benutzt" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +306,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timer werden benutzt" @@ -590,6 +591,10 @@ msgstr "Beschädigte .mpy Datei" msgid "Corrupt raw code" msgstr "Beschädigter raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -840,10 +845,6 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei" msgid "I2C Init Error" msgstr "I2C-Init-Fehler" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-operation nicht unterstützt" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -987,7 +988,7 @@ msgstr "Ungültiger Pin für rechten Kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1463,6 +1464,10 @@ msgstr "Stream fehlt readinto() oder write() Methode." msgid "Supply at least one UART pin" msgstr "Geben Sie mindestens einen UART-Pin an" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Zeitüberschreitung beim Auslesen der Temperatur" @@ -1667,6 +1672,7 @@ msgstr "" "Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" @@ -1785,11 +1791,11 @@ msgstr "abort() wurde aufgerufen" msgid "address %08x is not aligned to %d bytes" msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses ist leer" @@ -1870,10 +1876,6 @@ msgstr "Der binäre Operator %q ist nicht implementiert" msgid "bits must be 7, 8 or 9" msgstr "bits muss 7, 8 oder 9 sein" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits müssen 8 sein" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -1899,10 +1901,6 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "Buffer müssen gleich lang sein" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "Tasten müssen digitalio.DigitalInOut sein" @@ -1980,7 +1978,7 @@ msgstr "Kann '%q' Objekt nicht implizit nach %q konvertieren" msgid "can't convert NaN to int" msgstr "kann NaN nicht nach int konvertieren" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kann Adresse nicht in int konvertieren" @@ -2345,10 +2343,6 @@ msgstr "Das erste Argument muss ein Ndarray sein" msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "Die Abflachungsreihenfolge muss entweder \"C\" oder \"F\" sein" @@ -2534,14 +2528,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Das Intervall muss im Bereich %s-%s sein" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ungültige I2C Schnittstelle" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ungültige SPI Schnittstelle" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ungültige argumente" @@ -2724,10 +2710,6 @@ msgstr "Mehrfache Vererbung nicht unterstützt" msgid "must raise an object" msgstr "muss ein Objekt verursachen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso müssen alle spezifiziert sein" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" @@ -3560,6 +3542,9 @@ msgstr "Nullschritt" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 unterstützt pull up nicht" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-operation nicht unterstützt" + #~ msgid "Invalid bit clock pin" #~ msgstr "Ungültiges bit clock pin" @@ -3709,12 +3694,18 @@ msgstr "Nullschritt" #~ "Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " #~ "passiert ist.\n" +#~ msgid "bits must be 8" +#~ msgstr "bits müssen 8 sein" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf ist zu klein. brauche %d Bytes" #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" +#~ msgid "buffers must be the same length" +#~ msgstr "Buffer müssen gleich lang sein" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder ist keine Instanz von ByteOrder (%s erhalten)" @@ -3730,6 +3721,9 @@ msgstr "Nullschritt" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" + #~ msgid "flash location must be below 1MByte" #~ msgstr "flash location muss unter 1MByte sein" @@ -3742,6 +3736,12 @@ msgstr "Nullschritt" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "ungültige I2C Schnittstelle" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ungültige SPI Schnittstelle" + #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" @@ -3764,6 +3764,9 @@ msgstr "Nullschritt" #~ msgstr "" #~ "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso müssen alle spezifiziert sein" + #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" diff --git a/locale/en_US.po b/locale/en_US.po index 579fc6501e..c89772779e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -291,6 +291,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -298,7 +299,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -572,6 +573,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -817,10 +822,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -962,7 +963,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1425,6 +1426,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1611,6 +1616,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1652,6 +1658,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1700,11 +1726,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1785,10 +1811,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1814,10 +1836,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1893,7 +1911,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2247,10 +2265,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2435,14 +2449,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2619,10 +2625,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3059,6 +3061,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3212,6 +3218,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 0f1bf91057..16f2b3669a 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 08:56-0500\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-03-30 22:11+0000\n" "Last-Translator: Tannewt \n" "Language: en_x_pirate\n" @@ -296,6 +296,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -303,7 +304,7 @@ msgstr "" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "" @@ -579,6 +580,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -824,10 +829,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -969,7 +970,7 @@ msgstr "Belay that! Invalid pin for starboard-side channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1432,6 +1433,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1618,6 +1623,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1659,6 +1665,26 @@ msgstr "" msgid "WARNING: Your code filename has two extensions\n" msgstr "Blimey! Yer code filename has two extensions\n" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer is not currently running" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" +msgstr "" + +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "WatchDogTimer.timeout must be greater than 0" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Watchdog timer expired." +msgstr "" + #: py/builtinhelp.c #, c-format msgid "" @@ -1707,11 +1733,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1792,10 +1818,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "pieces must be of 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1821,10 +1843,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "yer buffers must be of the same length" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1900,7 +1918,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2254,10 +2272,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2442,14 +2456,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "Belay that! I2C peripheral be invalid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "Arr! SPI peripheral be invalid" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2626,10 +2632,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3066,6 +3068,10 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" +#: ports/nrf/common-hal/watchdog/WatchDogTimer.c +msgid "timeout duration exceeded the maximum supported value" +msgstr "" + #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" msgstr "" @@ -3219,6 +3225,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/watchdog/WatchDogTimer.c +msgid "watchdog timeout must be greater than 0" +msgstr "" + #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" msgstr "" @@ -3281,3 +3291,15 @@ msgstr "" #~ msgid "Invalid clock pin" #~ msgstr "Avast! Clock pin be invalid" + +#~ msgid "bits must be 8" +#~ msgstr "pieces must be of 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "yer buffers must be of the same length" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "Belay that! I2C peripheral be invalid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "Arr! SPI peripheral be invalid" diff --git a/locale/es.po b/locale/es.po index 013750e931..22597249bd 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -302,6 +302,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos los timers para este pin están siendo utilizados" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -309,7 +310,7 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos los timers en uso" @@ -589,6 +590,10 @@ msgstr "Archivo .mpy corrupto" msgid "Corrupt raw code" msgstr "Código crudo corrupto" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -835,10 +840,6 @@ msgstr "Operación I/O en archivo cerrado" msgid "I2C Init Error" msgstr "Error de inicio de I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operación I2C no soportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Pin inválido para canal derecho" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1452,6 +1453,10 @@ msgstr "A Stream le falta el método readinto() o write()." msgid "Supply at least one UART pin" msgstr "Suministre al menos un pin UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Lectura de temperatura expirada" @@ -1640,6 +1645,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate no soportado" @@ -1756,11 +1762,11 @@ msgstr "se llamó abort()" msgid "address %08x is not aligned to %d bytes" msgstr "la dirección %08x no esta alineada a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "address fuera de límites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "addresses esta vacío" @@ -1841,10 +1847,6 @@ msgstr "operacion binaria %q no implementada" msgid "bits must be 7, 8 or 9" msgstr "bits deben ser 7, 8 ó 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits debe ser 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -1871,10 +1873,6 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "los buffers deben de tener la misma longitud" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" @@ -1950,7 +1948,7 @@ msgstr "no se puede convertir el objeto '%q' a %q implícitamente" msgid "can't convert NaN to int" msgstr "no se puede convertir Nan a int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "no se puede convertir address a int" @@ -2311,10 +2309,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit debe ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2499,14 +2493,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2686,10 +2672,6 @@ msgstr "herencia multiple no soportada" msgid "must raise an object" msgstr "debe hacer un raise de un objeto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "se deben de especificar sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" @@ -3526,6 +3508,9 @@ msgstr "paso cero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 no soporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "operación I2C no soportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin bit clock inválido" @@ -3695,12 +3680,18 @@ msgstr "paso cero" #~ msgid "bad GATT role" #~ msgstr "mal GATT role" +#~ msgid "bits must be 8" +#~ msgstr "bits debe ser 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf es demasiado pequeño. necesita %d bytes" #~ msgid "buffer too long" #~ msgstr "buffer demasiado largo" +#~ msgid "buffers must be the same length" +#~ msgstr "los buffers deben de tener la misma longitud" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder no es instancia de ByteOrder (encontarmos un %s)" @@ -3737,6 +3728,9 @@ msgstr "paso cero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit debe ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "la ubicación de la flash debe estar debajo de 1MByte" @@ -3749,6 +3743,12 @@ msgstr "paso cero" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "alarma inválida" @@ -3771,6 +3771,9 @@ msgstr "paso cero" #~ msgstr "" #~ "falló la asignación de memoria, asignando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "se deben de especificar sck/mosi/miso" + #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" diff --git a/locale/fil.po b/locale/fil.po index 66ccc711ac..e4c5678d27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -295,6 +295,7 @@ msgstr "Lahat ng sync event channels ay ginagamit" msgid "All timers for this pin are in use" msgstr "Lahat ng timers para sa pin na ito ay ginagamit" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -302,7 +303,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Lahat ng timer ginagamit" @@ -581,6 +582,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -831,10 +836,6 @@ msgstr "I/O operasyon sa saradong file" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Hindi supportado ang operasyong I2C" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -978,7 +979,7 @@ msgstr "Mali ang pin para sa kanang channel" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1448,6 +1449,10 @@ msgstr "Stream kulang ng readinto() o write() method." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1635,6 +1640,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Hindi supportadong baudrate" @@ -1753,11 +1759,11 @@ msgstr "abort() tinawag" msgid "address %08x is not aligned to %d bytes" msgstr "address %08x ay hindi pantay sa %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "wala sa sakop ang address" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "walang laman ang address" @@ -1838,10 +1844,6 @@ msgstr "binary op %q hindi implemented" msgid "bits must be 7, 8 or 9" msgstr "bits ay dapat 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits ay dapat walo (8)" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -1868,10 +1870,6 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "ang buffers ay dapat parehas sa haba" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1948,7 +1946,7 @@ msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" msgid "can't convert NaN to int" msgstr "hindi ma i-convert NaN sa int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "hindi ma i-convert ang address sa INT" @@ -2312,10 +2310,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit ay dapat MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2501,14 +2495,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "maling I2C peripheral" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "hindi wastong SPI peripheral" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "mali ang mga argumento" @@ -2689,10 +2675,6 @@ msgstr "maraming inhertance hindi sinusuportahan" msgid "must raise an object" msgstr "dapat itaas ang isang object" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" @@ -3506,6 +3488,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Walang pull down support ang GPI016." +#~ msgid "I2C operation not supported" +#~ msgstr "Hindi supportado ang operasyong I2C" + #~ msgid "Invalid bit clock pin" #~ msgstr "Mali ang bit clock pin" @@ -3647,9 +3632,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "bits must be 8" +#~ msgstr "bits ay dapat walo (8)" + #~ msgid "buffer too long" #~ msgstr "masyadong mahaba ng buffer" +#~ msgid "buffers must be the same length" +#~ msgstr "ang buffers ay dapat parehas sa haba" + #~ msgid "can query only one param" #~ msgstr "maaaring i-query lamang ang isang param" @@ -3680,6 +3671,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit ay dapat MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "dapat na mas mababa sa 1MB ang lokasyon ng flash" @@ -3689,6 +3683,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "impossibleng baudrate" +#~ msgid "invalid I2C peripheral" +#~ msgstr "maling I2C peripheral" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "hindi wastong SPI peripheral" + #~ msgid "invalid alarm" #~ msgstr "mali ang alarm" @@ -3711,6 +3711,9 @@ msgstr "zero step" #~ msgstr "" #~ "nabigo ang paglalaan ng memorya, naglalaan ng %u bytes para sa native code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" diff --git a/locale/fr.po b/locale/fr.po index 20d42d49e0..5a49fd5f91 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -302,6 +302,7 @@ msgstr "Tous les canaux d'événements de synchro sont utilisés" msgid "All timers for this pin are in use" msgstr "Tous les timers pour cette broche sont utilisés" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -309,7 +310,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tous les timers sont utilisés" @@ -597,6 +598,10 @@ msgstr "Fichier .mpy corrompu" msgid "Corrupt raw code" msgstr "Code brut corrompu" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" @@ -844,10 +849,6 @@ msgstr "opération d'E/S sur un fichier fermé" msgid "I2C Init Error" msgstr "Erreur d'initialisation I2C" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "opération sur I2C non supportée" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -991,7 +992,7 @@ msgstr "Broche invalide pour le canal droit" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1467,6 +1468,10 @@ msgstr "Il manque une méthode readinto() ou write() au flux." msgid "Supply at least one UART pin" msgstr "Fournissez au moins une broche UART" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temporisation de lecture dépassée" @@ -1669,6 +1674,7 @@ msgstr "" "appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Débit non supporté" @@ -1788,11 +1794,11 @@ msgstr "abort() appelé" msgid "address %08x is not aligned to %d bytes" msgstr "l'adresse %08x n'est pas alignée sur %d octets" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adresse hors limites" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresses vides" @@ -1873,10 +1879,6 @@ msgstr "opération binaire '%q' non implémentée" msgid "bits must be 7, 8 or 9" msgstr "bits doivent être 7, 8 ou 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "les bits doivent être 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" @@ -1902,10 +1904,6 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "les tampons doivent être de la même longueur" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" @@ -1982,7 +1980,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" msgid "can't convert NaN to int" msgstr "on ne peut convertir NaN en entier 'int'" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "ne peut convertir l'adresse en entier 'int'" @@ -2351,10 +2349,6 @@ msgstr "le premier argument doit être un ndarray" msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "le 1er bit doit être le MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "l'ordre d'aplatissement doit être «C» ou «F»" @@ -2541,14 +2535,6 @@ msgstr "interp est défini pour les tableaux 1D de longueur égale" msgid "interval must be in range %s-%s" msgstr "l'intervalle doit être dans la plage %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "périphérique I2C invalide" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "périphérique SPI invalide" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "arguments invalides" @@ -2729,10 +2715,6 @@ msgstr "héritages multiples non supportés" msgid "must raise an object" msgstr "doit lever un objet" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck, mosi et miso doivent tous être spécifiés" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" @@ -3579,6 +3561,9 @@ msgstr "'step' nul" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" +#~ msgid "I2C operation not supported" +#~ msgstr "opération sur I2C non supportée" + #~ msgid "Invalid bit clock pin" #~ msgstr "Broche invalide pour 'bit clock'" @@ -3748,12 +3733,18 @@ msgstr "'step' nul" #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" +#~ msgid "bits must be 8" +#~ msgstr "les bits doivent être 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "'buf' est trop petit. Besoin de %d octets" #~ msgid "buffer too long" #~ msgstr "tampon trop long" +#~ msgid "buffers must be the same length" +#~ msgstr "les tampons doivent être de la même longueur" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "'byteorder' n'est pas une instance de ByteOrder (reçu un %s)" @@ -3792,6 +3783,9 @@ msgstr "'step' nul" #~ msgid "expecting a pin" #~ msgstr "une broche (Pin) est attendue" +#~ msgid "firstbit must be MSB" +#~ msgstr "le 1er bit doit être le MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" @@ -3804,6 +3798,12 @@ msgstr "'step' nul" #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "intervalle hors bornes 0.0020 à 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "périphérique I2C invalide" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "périphérique SPI invalide" + #~ msgid "invalid alarm" #~ msgstr "alarme invalide" @@ -3826,6 +3826,9 @@ msgstr "'step' nul" #~ msgstr "" #~ "l'allocation de mémoire a échoué en allouant %u octets pour un code natif" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck, mosi et miso doivent tous être spécifiés" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" diff --git a/locale/it_IT.po b/locale/it_IT.po index 01368e88a8..c47d0e8e3e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "Tutti i canali di eventi sincronizzati in uso" msgid "All timers for this pin are in use" msgstr "Tutti i timer per questo pin sono in uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Tutti i timer utilizzati" @@ -582,6 +583,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -831,10 +836,6 @@ msgstr "operazione I/O su file chiuso" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operazione I2C non supportata" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Pin non valido per il canale destro" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Metodi mancanti readinto() o write() allo stream." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1646,6 +1651,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "baudrate non supportato" @@ -1756,11 +1762,11 @@ msgstr "abort() chiamato" msgid "address %08x is not aligned to %d bytes" msgstr "l'indirizzo %08x non è allineato a %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "indirizzo fuori limite" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" @@ -1841,10 +1847,6 @@ msgstr "operazione binaria %q non implementata" msgid "bits must be 7, 8 or 9" msgstr "i bit devono essere 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "i bit devono essere 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1873,10 +1875,6 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "i buffer devono essere della stessa lunghezza" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1953,7 +1951,7 @@ msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" msgid "can't convert NaN to int" msgstr "impossibile convertire NaN in int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "impossible convertire indirizzo in int" @@ -2313,10 +2311,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "il primo bit deve essere il più significativo (MSB)" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2502,14 +2496,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periferica I2C invalida" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periferica SPI invalida" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argomenti non validi" @@ -2691,10 +2677,6 @@ msgstr "ereditarietà multipla non supportata" msgid "must raise an object" msgstr "deve lanciare un oggetto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "è necessario specificare tutte le sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3529,6 +3511,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" +#~ msgid "I2C operation not supported" +#~ msgstr "operazione I2C non supportata" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin del clock di bit non valido" @@ -3636,9 +3621,15 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" +#~ msgid "bits must be 8" +#~ msgstr "i bit devono essere 8" + #~ msgid "buffer too long" #~ msgstr "buffer troppo lungo" +#~ msgid "buffers must be the same length" +#~ msgstr "i buffer devono essere della stessa lunghezza" + #~ msgid "can query only one param" #~ msgstr "è possibile interrogare solo un parametro" @@ -3669,6 +3660,9 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "il primo bit deve essere il più significativo (MSB)" + #~ msgid "flash location must be below 1MByte" #~ msgstr "Locazione della flash deve essere inferiore a 1mb" @@ -3678,6 +3672,12 @@ msgstr "zero step" #~ msgid "impossible baudrate" #~ msgstr "baudrate impossibile" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periferica I2C invalida" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periferica SPI invalida" + #~ msgid "invalid alarm" #~ msgstr "alarm non valido" @@ -3700,6 +3700,9 @@ msgstr "zero step" #~ msgstr "" #~ "allocazione di memoria fallita, allocazione di %d byte per codice nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "è necessario specificare tutte le sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" diff --git a/locale/ko.po b/locale/ko.po index 27f8216f83..156f40d9b6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -293,6 +293,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "핀의 모든 타이머가 사용 중입니다" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -300,7 +301,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" @@ -576,6 +577,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -821,10 +826,6 @@ msgstr "" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -966,7 +967,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1429,6 +1430,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "" @@ -1725,11 +1731,11 @@ msgstr "" msgid "address %08x is not aligned to %d bytes" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1810,10 +1816,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "비트(bits)는 7, 8 또는 9 여야합니다" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "비트(bits)는 8이어야합니다" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -1839,10 +1841,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1918,7 +1916,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2272,10 +2270,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2460,14 +2454,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ICT주변 기기가 유효하지 않습니다" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "SPI주변 기기가 유효하지 않습니다" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "" @@ -2644,10 +2630,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3319,3 +3301,12 @@ msgstr "" #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" + +#~ msgid "bits must be 8" +#~ msgstr "비트(bits)는 8이어야합니다" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ICT주변 기기가 유효하지 않습니다" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "SPI주변 기기가 유효하지 않습니다" diff --git a/locale/nl.po b/locale/nl.po index 5be371d83f..77cc11cab3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -299,6 +299,7 @@ msgstr "Alle sync event kanalen zijn in gebruik" msgid "All timers for this pin are in use" msgstr "Alle timers voor deze pin zijn in gebruik" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alle timers zijn in gebruik" @@ -588,6 +589,10 @@ msgstr "Corrupt .mpy bestand" msgid "Corrupt raw code" msgstr "Corrupt raw code" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" @@ -835,10 +840,6 @@ msgstr "I/O actie op gesloten bestand" msgid "I2C Init Error" msgstr "I2C Init Fout" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C actie niet ondersteund" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -982,7 +983,7 @@ msgstr "Ongeldige pin voor rechter kanaal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1459,6 +1460,10 @@ msgstr "Stream mist readinto() of write() methode." msgid "Supply at least one UART pin" msgstr "Geef op zijn minst 1 UART pin op" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperatuur lees time-out" @@ -1655,6 +1660,7 @@ msgstr "" "apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Niet-ondersteunde baudsnelheid" @@ -1773,11 +1779,11 @@ msgstr "abort() aangeroepen" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x is niet afgestemd op %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres buiten bereik" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adressen zijn leeg" @@ -1858,10 +1864,6 @@ msgstr "binaire op %q niet geïmplementeerd" msgid "bits must be 7, 8 or 9" msgstr "bits moet 7, 8, of 9 zijn" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits moet 8 zijn" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" @@ -1887,10 +1889,6 @@ msgstr "buffer slices moeten van gelijke grootte zijn" msgid "buffer too small" msgstr "buffer te klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers moeten dezelfde lengte hebben" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons moeten digitalio.DigitalInOut zijn" @@ -1967,7 +1965,7 @@ msgstr "kan '%q' object niet omzetten naar %q impliciet" msgid "can't convert NaN to int" msgstr "kan NaN niet omzetten naar int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan adres niet omzetten naar int" @@ -2324,10 +2322,6 @@ msgstr "eerst argument moet een ndarray zijn" msgid "first argument to super() must be type" msgstr "eerste argument voor super() moet een type zijn" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "het eerste bit moet het MSB zijn" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "De afvlakkingsvolgorde moet ofwel \"C\", ofwel \"F\" zijn" @@ -2513,14 +2507,6 @@ msgstr "interp is gedefinieerd for eendimensionale arrays van gelijke lengte" msgid "interval must be in range %s-%s" msgstr "interval moet binnen bereik %s-%s vallen" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "onjuist I2C randapparaat" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "onjuist SPI randapparaat" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ongeldige argumenten" @@ -2700,10 +2686,6 @@ msgstr "meervoudige overerving niet ondersteund" msgid "must raise an object" msgstr "moet een object oproepen (raise)" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso moeten alle gespecificeerd worden" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "voor sleutelfunctie moet een trefwoordargument gebruikt worden" @@ -3352,5 +3334,26 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C actie niet ondersteund" + #~ msgid "Negative step not supported" #~ msgstr "Negatieve stappen niet ondersteund" + +#~ msgid "bits must be 8" +#~ msgstr "bits moet 8 zijn" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffers moeten dezelfde lengte hebben" + +#~ msgid "firstbit must be MSB" +#~ msgstr "het eerste bit moet het MSB zijn" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "onjuist I2C randapparaat" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "onjuist SPI randapparaat" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso moeten alle gespecificeerd worden" diff --git a/locale/pl.po b/locale/pl.po index 0e82359f9b..888ce64285 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -292,6 +292,7 @@ msgstr "Wszystkie kanały zdarzeń synchronizacji w użyciu" msgid "All timers for this pin are in use" msgstr "Wszystkie timery tej nóżki w użyciu" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -299,7 +300,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Wszystkie timery w użyciu" @@ -575,6 +576,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" @@ -820,10 +825,6 @@ msgstr "Operacja I/O na zamkniętym pliku" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Operacja I2C nieobsługiwana" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -967,7 +968,7 @@ msgstr "Zła nóżka dla prawego kanału" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1430,6 +1431,10 @@ msgstr "Strumień nie ma metod readinto() lub write()." msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1616,6 +1621,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Zła szybkość transmisji" @@ -1728,11 +1734,11 @@ msgstr "Wywołano abort()" msgid "address %08x is not aligned to %d bytes" msgstr "adres %08x nie jest wyrównany do %d bajtów" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adres poza zakresem" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adres jest pusty" @@ -1813,10 +1819,6 @@ msgstr "brak dwu-argumentowego operatora %q" msgid "bits must be 7, 8 or 9" msgstr "bits musi być 7, 8 lub 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits musi być 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -1842,10 +1844,6 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "bufory muszą mieć tę samą długość" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" @@ -1921,7 +1919,7 @@ msgstr "nie można automatycznie skonwertować '%q' do '%q'" msgid "can't convert NaN to int" msgstr "nie można skonwertować NaN do int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "nie można skonwertować adresu do int" @@ -2276,10 +2274,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit musi być MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2464,14 +2458,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "złe I2C" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "złe SPI" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "złe arguemnty" @@ -2648,10 +2634,6 @@ msgstr "wielokrotne dziedzicznie niewspierane" msgid "must raise an object" msgstr "wyjątek musi być obiektem" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso muszą być podane" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" @@ -3426,6 +3408,9 @@ msgstr "zerowy krok" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "Operacja I2C nieobsługiwana" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -3523,9 +3508,15 @@ msgstr "zerowy krok" #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" +#~ msgid "bits must be 8" +#~ msgstr "bits musi być 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "buf zbyt mały. Wymagane %d bajtów" +#~ msgid "buffers must be the same length" +#~ msgstr "bufory muszą mieć tę samą długość" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "byteorder musi być typu ByteOrder (jest %s)" @@ -3536,9 +3527,21 @@ msgstr "zerowy krok" #~ msgid "color buffer must be a buffer or int" #~ msgstr "bufor kolorów musi być typu buffer lub int" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit musi być MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "przedział poza zakresem 0.0020 do 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "złe I2C" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "złe SPI" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso muszą być podane" + #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 308809a2be..e951df1080 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -294,6 +294,7 @@ msgstr "" msgid "All timers for this pin are in use" msgstr "Todos os temporizadores para este pino estão em uso" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -301,7 +302,7 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Todos os temporizadores em uso" @@ -578,6 +579,10 @@ msgstr "" msgid "Corrupt raw code" msgstr "" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" @@ -826,10 +831,6 @@ msgstr "Operação I/O no arquivo fechado" msgid "I2C Init Error" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C operação não suportada" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -973,7 +974,7 @@ msgstr "Pino inválido para canal direito" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1442,6 +1443,10 @@ msgstr "" msgid "Supply at least one UART pin" msgstr "" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1628,6 +1633,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" @@ -1738,11 +1744,11 @@ msgstr "abort() chamado" msgid "address %08x is not aligned to %d bytes" msgstr "endereço %08x não está alinhado com %d bytes" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "" @@ -1823,10 +1829,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits devem ser 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1855,10 +1857,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers devem ser o mesmo tamanho" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1934,7 +1932,7 @@ msgstr "" msgid "can't convert NaN to int" msgstr "" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "" @@ -2289,10 +2287,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit devem ser MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2477,14 +2471,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "argumentos inválidos" @@ -2661,10 +2647,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "deve especificar todos sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -3439,6 +3421,9 @@ msgstr "passo zero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "I2C operação não suportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pino de bit clock inválido" @@ -3512,9 +3497,15 @@ msgstr "passo zero" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Use o esptool para apagar o flash e recarregar o Python" +#~ msgid "bits must be 8" +#~ msgstr "bits devem ser 8" + #~ msgid "buffer too long" #~ msgstr "buffer muito longo" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers devem ser o mesmo tamanho" + #~ msgid "can query only one param" #~ msgstr "pode consultar apenas um parâmetro" @@ -3539,6 +3530,9 @@ msgstr "passo zero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit devem ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "o local do flash deve estar abaixo de 1 MByte" @@ -3548,6 +3542,12 @@ msgstr "passo zero" #~ msgid "impossible baudrate" #~ msgstr "taxa de transmissão impossível" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "Alarme inválido" @@ -3569,6 +3569,9 @@ msgstr "passo zero" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alocação de memória falhou, alocando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "deve especificar todos sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" diff --git a/locale/sv.po b/locale/sv.po index bf9bb3f5d9..df2431c4e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -299,6 +299,7 @@ msgstr "Alla händelsekanaler används" msgid "All timers for this pin are in use" msgstr "Alla timers för denna pinne är i bruk" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -306,7 +307,7 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Alla timers används" @@ -588,6 +589,10 @@ msgstr "Skadad .mpy-fil" msgid "Corrupt raw code" msgstr "Korrupt rå kod" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" @@ -833,10 +838,6 @@ msgstr "I/O-operation på stängd fil" msgid "I2C Init Error" msgstr "I2C init-fel" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-åtgärd stöds inte" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -980,7 +981,7 @@ msgstr "Ogiltig pinne för höger kanal" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1455,6 +1456,10 @@ msgstr "Stream saknar readinto() eller write() metod." msgid "Supply at least one UART pin" msgstr "Ange minst en UART-pinne" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "Temperaturavläsning tog för lång tid" @@ -1651,6 +1656,7 @@ msgstr "" "eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Baudrate stöd inte" @@ -1766,11 +1772,11 @@ msgstr "abort() anropad" msgid "address %08x is not aligned to %d bytes" msgstr "adressen %08x är inte justerad till %d byte" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "adress utanför gränsen" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "adresserna är tomma" @@ -1851,10 +1857,6 @@ msgstr "binär op %q är inte implementerad" msgid "bits must be 7, 8 or 9" msgstr "bits måste vara 7, 8 eller 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits måste vara 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample måste vara 8 eller 16" @@ -1880,10 +1882,6 @@ msgstr "buffertsegmenten måste vara lika långa" msgid "buffer too small" msgstr "buffert för liten" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffertar måste vara samma längd" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons måste vara digitalio.DigitalInOut" @@ -1959,7 +1957,7 @@ msgstr "kan inte konvertera '%q' objekt implicit till %q" msgid "can't convert NaN to int" msgstr "kan inte konvertera NaN till int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "kan inte konvertera address till int" @@ -2318,10 +2316,6 @@ msgstr "första argumentet måste vara en ndarray" msgid "first argument to super() must be type" msgstr "första argumentet till super() måste vara typ" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit måste vara MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "förenklingsordningen måste vara antingen \"C\" eller \"F\"" @@ -2506,14 +2500,6 @@ msgstr "interp är definierad för 1D-matriser med samma längd" msgid "interval must be in range %s-%s" msgstr "interval måste vara i intervallet %s-%s" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ogiltig I2C-kringutrustning" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ogiltig SPI-kringutrustning" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "ogiltiga argument" @@ -2693,10 +2679,6 @@ msgstr "multipelt arv stöds inte" msgid "must raise an object" msgstr "måste ge ett objekt" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "måste ange alla av sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "måste använda nyckelordsargument för nyckelfunktion" @@ -3345,8 +3327,29 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-åtgärd stöds inte" + #~ msgid "Negative step not supported" #~ msgstr "Negativt step stöds inte" +#~ msgid "bits must be 8" +#~ msgstr "bits måste vara 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "buffertar måste vara samma längd" + #~ msgid "empty %q list" #~ msgstr "tom %q-lista" + +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit måste vara MSB" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ogiltig I2C-kringutrustning" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ogiltig SPI-kringutrustning" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "måste ange alla av sck/mosi/miso" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 9f44fbd9ef..4f85c5fa86 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-01 17:10-0700\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -298,6 +298,7 @@ msgstr "Suǒyǒu tóngbù shìjiàn píndào shǐyòng" msgid "All timers for this pin are in use" msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" +#: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -305,7 +306,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng" #: ports/cxd56/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c -#: shared-bindings/pulseio/PWMOut.c shared-module/_pew/PewPew.c +#: shared-bindings/pulseio/PWMOut.c msgid "All timers in use" msgstr "Suǒyǒu jìshí qì shǐyòng" @@ -583,6 +584,10 @@ msgstr "Fǔbài de .mpy wénjiàn" msgid "Corrupt raw code" msgstr "Sǔnhuài de yuánshǐ dàimǎ" +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "Could not initialize GNSS" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" @@ -828,10 +833,6 @@ msgstr "Wénjiàn shàng de I/ O cāozuò" msgid "I2C Init Error" msgstr "I2C chūshǐhuà cuòwù" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C cāozuò bù zhīchí" - #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" @@ -975,7 +976,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c +#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c #: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c @@ -1444,6 +1445,10 @@ msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." msgid "Supply at least one UART pin" msgstr "Dìngyì zhìshǎo yīgè UART yǐn jiǎo" +#: shared-bindings/gnss/GNSS.c +msgid "System entry must be gnss.SatelliteSystem" +msgstr "" + #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" msgstr "" @@ -1639,6 +1644,7 @@ msgstr "" "huò hūlüè." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c +#: ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" msgstr "Bù zhīchí de baudrate" @@ -1753,11 +1759,11 @@ msgstr "zhōngzhǐ () diàoyòng" msgid "address %08x is not aligned to %d bytes" msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" @@ -1838,10 +1844,6 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" msgid "bits must be 7, 8 or 9" msgstr "bǐtè bìxū shì 7,8 huò 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bǐtè bìxū shì 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -1867,10 +1869,6 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" @@ -1946,7 +1944,7 @@ msgstr "wúfǎ jiāng '%q' duìxiàng zhuǎnhuàn wèi %q yǐn hán" msgid "can't convert NaN to int" msgstr "wúfǎ jiāng dǎoháng zhuǎnhuàn wèi int" -#: shared-bindings/i2cslave/I2CSlave.c +#: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" msgstr "wúfǎ jiāng dìzhǐ zhuǎnhuàn wèi int" @@ -2304,10 +2302,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "dì yī wèi bìxū shì MSB" - #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" msgstr "" @@ -2492,14 +2486,6 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "wúxiào de I2C wàiwéi qì" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "wúxiào de SPI wàiwéi qì" - #: lib/netutils/netutils.c msgid "invalid arguments" msgstr "wúxiào de cānshù" @@ -2677,10 +2663,6 @@ msgstr "bù zhīchí duō gè jìchéng" msgid "must raise an object" msgstr "bìxū tíchū duìxiàng" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" @@ -3485,6 +3467,9 @@ msgstr "líng bù" #~ msgid "Flash write failed to start, err 0x%04x" #~ msgstr "Flash xiě rù shībài, err 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C cāozuò bù zhīchí" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -3605,9 +3590,15 @@ msgstr "líng bù" #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" +#~ msgid "bits must be 8" +#~ msgstr "bǐtè bìxū shì 8" + #~ msgid "buf is too small. need %d bytes" #~ msgstr "huǎnchōng tài xiǎo. Xūyào%d zì jié" +#~ msgid "buffers must be the same length" +#~ msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" + #~ msgid "byteorder is not an instance of ByteOrder (got a %s)" #~ msgstr "zì jié bùshì zì jié xù shílì (yǒu %s)" @@ -3620,9 +3611,21 @@ msgstr "líng bù" #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" +#~ msgid "firstbit must be MSB" +#~ msgstr "dì yī wèi bìxū shì MSB" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" +#~ msgid "invalid I2C peripheral" +#~ msgstr "wúxiào de I2C wàiwéi qì" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "wúxiào de SPI wàiwéi qì" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" + #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" From 0a41b86f6bbbd1333b277dd0b224ab425b57f301 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 26 Jun 2020 01:36:03 +0200 Subject: [PATCH 867/919] Fix typo inserting IDF_PATH variable --- ports/esp32s2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile index 5ad5c2f1d3..47afc41081 100644 --- a/ports/esp32s2/Makefile +++ b/ports/esp32s2/Makefile @@ -212,7 +212,7 @@ $(BUILD)/esp-idf: # create the config headers $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/$(BOARD)/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info From a80d7479d0fe4e39eea99aebd2c526b697fefcff Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 26 Jun 2020 02:04:14 +0200 Subject: [PATCH 868/919] Update minimum required cmake to 3.16 Earliest tested version that compiles. Failed with version 3.10 --- ports/esp32s2/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt index c831e48469..c99c1c7e78 100644 --- a/ports/esp32s2/CMakeLists.txt +++ b/ports/esp32s2/CMakeLists.txt @@ -1,6 +1,6 @@ # The following five lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) set(COMPONENTS esptool_py soc driver log main) From 017c188ab5894723b4da004f01b45f84a5b3441c Mon Sep 17 00:00:00 2001 From: jgillick Date: Thu, 25 Jun 2020 16:31:28 -0700 Subject: [PATCH 869/919] Move NVM block to increase program size. --- ports/stm/boards/STM32F411_nvm.ld | 8 ++++---- ports/stm/boards/thunderpack/mpconfigboard.h | 16 ++++++++-------- ports/stm/supervisor/internal_flash.h | 5 ----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ports/stm/boards/STM32F411_nvm.ld b/ports/stm/boards/STM32F411_nvm.ld index 5ac3e52a6e..b2134b2594 100644 --- a/ports/stm/boards/STM32F411_nvm.ld +++ b/ports/stm/boards/STM32F411_nvm.ld @@ -6,10 +6,10 @@ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ - FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ - FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */ - FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */ - FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */ + FLASH_NVM (rwx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 is 64K */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } diff --git a/ports/stm/boards/thunderpack/mpconfigboard.h b/ports/stm/boards/thunderpack/mpconfigboard.h index 394fbfd84f..c2649e2555 100644 --- a/ports/stm/boards/thunderpack/mpconfigboard.h +++ b/ports/stm/boards/thunderpack/mpconfigboard.h @@ -28,16 +28,16 @@ // Non-volatile memory config #define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000) -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000) -#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3 +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000) +#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4 // Putting the entire flash sector in the NVM byte array buffer // would take up too much RAM. This limits how much of the sector we use. -#define NVM_BYTEARRAY_BUFFER_SIZE 512 +#define NVM_BYTEARRAY_BUFFER_SIZE 512 // Flash config -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) +#define FLASH_SIZE (0x80000) +#define FLASH_PAGE_SIZE (0x4000) #define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000) #define HSE_VALUE ((uint32_t)24000000U) @@ -47,7 +47,7 @@ #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // Status LEDs -#define MICROPY_HW_LED_STATUS (&pin_PA02) +#define MICROPY_HW_LED_STATUS (&pin_PA02) -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index b4d07ff482..13ade4e6e7 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -41,14 +41,9 @@ #ifdef STM32F411xE #define STM32_FLASH_SIZE 0x80000 //512KiB -#if CIRCUITPY_NVM -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 -#else #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000 #endif -#endif #ifdef STM32F412Zx #define STM32_FLASH_SIZE 0x100000 //1MB From 57fde2e07bb2ee4dcff342deed08e4e7799da799 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 6 May 2020 11:04:53 -0500 Subject: [PATCH 870/919] sdcardio: implement new library for SD card I/O Testing performed: That a card is successfully mounted on Pygamer with the built in SD card slot This module is enabled for most FULL_BUILD boards, but is disabled for samd21 ("M0"), litex, and pca10100 for various reasons. --- locale/circuitpython.pot | 37 +- ports/atmel-samd/mpconfigport.mk | 2 + ports/litex/mpconfigport.mk | 3 +- ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/busio/SPI.c | 7 + shared-bindings/busio/SPI.h | 2 + shared-bindings/sdcardio/SDCard.c | 184 ++++++++ shared-bindings/sdcardio/SDCard.h | 30 ++ shared-bindings/sdcardio/__init__.c | 47 +++ shared-bindings/sdcardio/__init__.h | 0 shared-module/sdcardio/SDCard.c | 466 +++++++++++++++++++++ shared-module/sdcardio/SDCard.h | 51 +++ shared-module/sdcardio/__init__.c | 0 shared-module/sdcardio/__init__.h | 0 17 files changed, 843 insertions(+), 3 deletions(-) create mode 100644 shared-bindings/sdcardio/SDCard.c create mode 100644 shared-bindings/sdcardio/SDCard.h create mode 100644 shared-bindings/sdcardio/__init__.c create mode 100644 shared-bindings/sdcardio/__init__.h create mode 100644 shared-module/sdcardio/SDCard.c create mode 100644 shared-module/sdcardio/SDCard.h create mode 100644 shared-module/sdcardio/__init__.c create mode 100644 shared-module/sdcardio/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1582b746ca..55147dc03e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -417,6 +417,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -698,7 +702,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -1358,6 +1363,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1979,6 +1988,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2105,6 +2118,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2662,6 +2679,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2683,6 +2704,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3073,6 +3098,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 92d47b186a..face79fad7 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -37,6 +37,8 @@ ifndef CIRCUITPY_TOUCHIO_USE_NATIVE CIRCUITPY_TOUCHIO_USE_NATIVE = 1 endif +CIRCUITPY_SDCARDIO ?= 0 + # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 311c87b5d5..427e9ea841 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -18,6 +18,7 @@ CIRCUITPY_AUDIOIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BOARD = 0 CIRCUITPY_BUSIO = 0 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 @@ -25,7 +26,7 @@ CIRCUITPY_NVM = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CIRCUITPY_COUNTIO = 0 +CIRCUITPY_SDCARDIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 385870a654..318bc02065 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -21,6 +21,7 @@ CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 +CIRCUITPY_SDCARDIO = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_ULAB = 0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 74d8f548dd..f40f506c23 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -213,6 +213,9 @@ endif ifeq ($(CIRCUITPY_SAMD),1) SRC_PATTERNS += samd/% endif +ifeq ($(CIRCUITPY_SDCARDIO),1) +SRC_PATTERNS += sdcardio/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -384,6 +387,8 @@ SRC_SHARED_MODULE_ALL = \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ + sdcardio/SDCard.c \ + sdcardio/__init__.c \ gamepad/GamePad.c \ gamepad/__init__.c \ gamepadshift/GamePadShift.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index c92cb1b669..10f91167b7 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -537,6 +537,13 @@ extern const struct _mp_obj_module_t samd_module; #define SAMD_MODULE #endif +#if CIRCUITPY_SDCARDIO +extern const struct _mp_obj_module_t sdcardio_module; +#define SDCARDIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdcardio), (mp_obj_t)&sdcardio_module }, +#else +#define SDCARDIO_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -709,6 +716,7 @@ extern const struct _mp_obj_module_t watchdog_module; ROTARYIO_MODULE \ RTC_MODULE \ SAMD_MODULE \ + SDCARDIO_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 3459bff6d7..0850c195a0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -166,6 +166,9 @@ CFLAGS += -DCIRCUITPY_RTC=$(CIRCUITPY_RTC) CIRCUITPY_SAMD ?= 0 CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) +CIRCUITPY_SDCARDIO ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 22f001d2dc..793ab4f671 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -418,3 +418,10 @@ const mp_obj_type_t busio_spi_type = { .make_new = busio_spi_make_new, .locals_dict = (mp_obj_dict_t*)&busio_spi_locals_dict, }; + +busio_spi_obj_t *validate_obj_is_spi_bus(mp_obj_t obj) { + if (!MP_OBJ_IS_TYPE(obj, &busio_spi_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), busio_spi_type.name); + } + return MP_OBJ_TO_PTR(obj); +} diff --git a/shared-bindings/busio/SPI.h b/shared-bindings/busio/SPI.h index b7b0715d13..aa7d715b9f 100644 --- a/shared-bindings/busio/SPI.h +++ b/shared-bindings/busio/SPI.h @@ -70,4 +70,6 @@ uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self); // This is used by the supervisor to claim SPI devices indefinitely. extern void common_hal_busio_spi_never_reset(busio_spi_obj_t *self); +extern busio_spi_obj_t *validate_obj_is_spi_bus(mp_obj_t obj_in); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SPI_H diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c new file mode 100644 index 0000000000..54ca39f806 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard.c @@ -0,0 +1,184 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "shared-bindings/sdcardio/SDCard.h" +#include "shared-module/sdcardio/SDCard.h" +#include "common-hal/busio/SPI.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/flash.h" + +//| class SDCard: +//| """SD Card Block Interface +//| +//| Controls an SD card over SPI. This built-in module has higher read +//| performance than the library adafruit_sdcard, but it is only compatible with +//| `busio.SPI`, not `bitbangio.SPI`. Usually an SDCard object is used +//| with ``storage.VfsFat`` to allow file I/O to an SD card.""" +//| +//| def __init__(bus:busio.SPI, cs=digitalio.DigitalInOut, baudrate=8000000): +//| """Construct an SPI SD Card object with the given properties +//| +//| :param busio.SPI spi: The SPI bus +//| :param microcontroller.Pin cs: The chip select connected to the card +//| :param int baudrate: The SPI data rate to use after card setup +//| :param busio.SDIO sdio: The SDIO bus. Mutually exclusive with spi and cs. +//| +//| Note that during detection and configuration, a hard-coded low baudrate is used. +//| Data transfers use the specified baurate (rounded down to one that is supported by +//| the microcontroller) +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdcardio +//| import storage +//| +//| sd = sdcardio.SDCard(board.SPI(), board.SD_CS) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" + +STATIC mp_obj_t sdcardio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_spi, ARG_cs, ARG_baudrate, ARG_sdio, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_spi, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_cs, MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 8000000} }, + { MP_QSTR_sdio, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_int = 8000000} }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + busio_spi_obj_t *spi = validate_obj_is_spi_bus(args[ARG_spi].u_obj); + mcu_pin_obj_t *cs = validate_obj_is_free_pin(args[ARG_cs].u_obj); + + sdcardio_sdcard_obj_t *self = m_new_obj(sdcardio_sdcard_obj_t); + self->base.type = &sdcardio_SDCard_type; + + common_hal_sdcardio_sdcard_construct(self, spi, cs, args[ARG_baudrate].u_int); + + return self; +} + + +//| def count() -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +mp_obj_t sdcardio_sdcard_count(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + return mp_obj_new_int_from_ull(common_hal_sdcardio_sdcard_get_blockcount(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_count_obj, sdcardio_sdcard_count); + +//| def deinit() -> None: +//| """Disable permanently. +//| +//| :return: None""" +//| +mp_obj_t sdcardio_sdcard_deinit(mp_obj_t self_in) { + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + common_hal_sdcardio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdcardio_sdcard_deinit_obj, sdcardio_sdcard_deinit); + + +//| def readblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_readblocks_obj, sdcardio_sdcard_readblocks); + +//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| + +mp_obj_t sdcardio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + sdcardio_sdcard_obj_t *self = (sdcardio_sdcard_obj_t*)self_in; + int result = common_hal_sdcardio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_3(sdcardio_sdcard_writeblocks_obj, sdcardio_sdcard_writeblocks); + +STATIC const mp_rom_map_elem_t sdcardio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdcardio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdcardio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdcardio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdcardio_sdcard_writeblocks_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(sdcardio_sdcard_locals_dict, sdcardio_sdcard_locals_dict_table); + +const mp_obj_type_t sdcardio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdcardio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdcardio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdcardio/SDCard.h b/shared-bindings/sdcardio/SDCard.h new file mode 100644 index 0000000000..5986d5b814 --- /dev/null +++ b/shared-bindings/sdcardio/SDCard.h @@ -0,0 +1,30 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +extern const mp_obj_type_t sdcardio_SDCard_type; diff --git a/shared-bindings/sdcardio/__init__.c b/shared-bindings/sdcardio/__init__.c new file mode 100644 index 0000000000..746aa5588e --- /dev/null +++ b/shared-bindings/sdcardio/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdcardio/SDCard.h" + +//| """Interface to an SD card via the SPI bus""" + +STATIC const mp_rom_map_elem_t sdcardio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdcardio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdcardio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdcardio_module_globals, sdcardio_module_globals_table); + +const mp_obj_module_t sdcardio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdcardio_module_globals, +}; diff --git a/shared-bindings/sdcardio/__init__.h b/shared-bindings/sdcardio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sdcardio/SDCard.c b/shared-module/sdcardio/SDCard.c new file mode 100644 index 0000000000..9e861279d3 --- /dev/null +++ b/shared-module/sdcardio/SDCard.c @@ -0,0 +1,466 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// This implementation largely follows the structure of adafruit_sdcard.py + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/util.h" +#include "shared-module/sdcardio/SDCard.h" + +#include "py/mperrno.h" + +#if 0 +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, ## __VA_ARGS__)) +#else +#define DEBUG_PRINT(...) ((void)0) +#endif + +#define CMD_TIMEOUT (200) + +#define R1_IDLE_STATE (1<<0) +#define R1_ILLEGAL_COMMAND (1<<2) + +#define TOKEN_CMD25 (0xFC) +#define TOKEN_STOP_TRAN (0xFD) +#define TOKEN_DATA (0xFE) + +STATIC bool lock_and_configure_bus(sdcardio_sdcard_obj_t *self) { + if (!common_hal_busio_spi_try_lock(self->bus)) { + return false; + } + common_hal_busio_spi_configure(self->bus, self->baudrate, 0, 0, 8); + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + return true; +} + +STATIC void lock_bus_or_throw(sdcardio_sdcard_obj_t *self) { + if (!lock_and_configure_bus(self)) { + mp_raise_OSError(EAGAIN); + } +} + +STATIC void clock_card(sdcardio_sdcard_obj_t *self, int bytes) { + uint8_t buf[] = {0xff}; + common_hal_digitalio_digitalinout_set_value(&self->cs, true); + for (int i=0; ibus, buf, 1); + } +} + +STATIC void extraclock_and_unlock_bus(sdcardio_sdcard_obj_t *self) { + clock_card(self, 1); + common_hal_busio_spi_unlock(self->bus); +} + +static uint8_t CRC7(const uint8_t* data, uint8_t n) { + uint8_t crc = 0; + for (uint8_t i = 0; i < n; i++) { + uint8_t d = data[i]; + for (uint8_t j = 0; j < 8; j++) { + crc <<= 1; + if ((d & 0x80) ^ (crc & 0x80)) { + crc ^= 0x09; + } + d <<= 1; + } + } + return (crc << 1) | 1; +} + +#define READY_TIMEOUT_NS (300 * 1000 * 1000) // 300ms +STATIC void wait_for_ready(sdcardio_sdcard_obj_t *self) { + uint64_t deadline = common_hal_time_monotonic_ns() + READY_TIMEOUT_NS; + while (common_hal_time_monotonic_ns() < deadline) { + uint8_t b; + common_hal_busio_spi_read(self->bus, &b, 1, 0xff); + if (b == 0xff) { + break; + } + } +} + +// In Python API, defaults are response=None, data_block=True, wait=True +STATIC int cmd(sdcardio_sdcard_obj_t *self, int cmd, int arg, void *response_buf, size_t response_len, bool data_block, bool wait) { + DEBUG_PRINT("cmd % 3d [%02x] arg=% 11d [%08x] len=%d%s%s\n", cmd, cmd, arg, arg, response_len, data_block ? " data" : "", wait ? " wait" : ""); + uint8_t cmdbuf[6]; + cmdbuf[0] = cmd | 0x40; + cmdbuf[1] = (arg >> 24) & 0xff; + cmdbuf[2] = (arg >> 16) & 0xff; + cmdbuf[3] = (arg >> 8) & 0xff; + cmdbuf[4] = arg & 0xff; + cmdbuf[5] = CRC7(cmdbuf, 5); + + if (wait) { + wait_for_ready(self); + } + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == 0) + bool response_received = false; + for (int i=0; ibus, cmdbuf, 1, 0xff); + if ((cmdbuf[0] & 0x80) == 0) { + response_received = true; + break; + } + } + + if (!response_received) { + return -EIO; + } + + if (response_buf) { + + if (data_block) { + cmdbuf[1] = 0xff; + do { + // Wait for the start block byte + common_hal_busio_spi_read(self->bus, cmdbuf+1, 1, 0xff); + } while (cmdbuf[1] != 0xfe); + } + + common_hal_busio_spi_read(self->bus, response_buf, response_len, 0xff); + + if (data_block) { + // Read and discard the CRC-CCITT checksum + common_hal_busio_spi_read(self->bus, cmdbuf+1, 2, 0xff); + } + + } + + return cmdbuf[0]; +} + +STATIC int block_cmd(sdcardio_sdcard_obj_t *self, int cmd_, int block, void *response_buf, size_t response_len, bool data_block, bool wait) { + return cmd(self, cmd_, block * self->cdv, response_buf, response_len, true, true); +} + +STATIC bool cmd_nodata(sdcardio_sdcard_obj_t* self, int cmd, int response) { + uint8_t cmdbuf[2] = {cmd, 0xff}; + + common_hal_busio_spi_write(self->bus, cmdbuf, sizeof(cmdbuf)); + + // Wait for the response (response[7] == response) + for (int i=0; ibus, cmdbuf, 1, 0xff); + if (cmdbuf[0] == response) { + return 0; + } + } + return -EIO; +} + +STATIC const compressed_string_t *init_card_v1(sdcardio_sdcard_obj_t *self) { + for (int i=0; icdv = 1; + } + return NULL; + } + } + return translate("timeout waiting for v2 card"); +} + +STATIC const compressed_string_t *init_card(sdcardio_sdcard_obj_t *self) { + clock_card(self, 10); + + common_hal_digitalio_digitalinout_set_value(&self->cs, false); + + // CMD0: init card: should return _R1_IDLE_STATE (allow 5 attempts) + { + bool reached_idle_state = false; + for (int i=0; i<5; i++) { + if (cmd(self, 0, 0, NULL, 0, true, true) == R1_IDLE_STATE) { + reached_idle_state = true; + break; + } + } + if (!reached_idle_state) { + return translate("no SD card"); + } + } + + // CMD8: determine card version + { + uint8_t rb7[4]; + int response = cmd(self, 8, 0x1AA, rb7, sizeof(rb7), false, true); + if (response == R1_IDLE_STATE) { + const compressed_string_t *result =init_card_v2(self); + if (result != NULL) { + return result; + } + } else if (response == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) { + const compressed_string_t *result =init_card_v1(self); + if (result != NULL) { + return result; + } + } else { + return translate("couldn't determine SD card version"); + } + } + + // CMD9: get number of sectors + { + uint8_t csd[16]; + int response = cmd(self, 9, 0, csd, sizeof(csd), true, true); + if (response != 0) { + return translate("no response from SD card"); + } + int csd_version = (csd[0] & 0xC0) >> 6; + if (csd_version >= 2) { + return translate("SD card CSD format not supported"); + } + + if (csd_version == 1) { + self->sectors = ((csd[8] << 8 | csd[9]) + 1) * 1024; + } else { + uint32_t block_length = 1 << (csd[5] & 0xF); + uint32_t c_size = ((csd[6] & 0x3) << 10) | (csd[7] << 2) | ((csd[8] & 0xC) >> 6); + uint32_t mult = 1 << (((csd[9] & 0x3) << 1 | (csd[10] & 0x80) >> 7) + 2); + self->sectors = block_length / 512 * mult * (c_size + 1); + } + } + + // CMD16: set block length to 512 bytes + { + int response = cmd(self, 16, 512, NULL, 0, true, true); + if (response != 0) { + return translate("can't set 512 block size"); + } + } + + return NULL; +} + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *bus, mcu_pin_obj_t *cs, int baudrate) { + self->bus = bus; + common_hal_digitalio_digitalinout_construct(&self->cs, cs); + common_hal_digitalio_digitalinout_switch_to_output(&self->cs, true, DRIVE_MODE_PUSH_PULL); + + self->cdv = 512; + self->sectors = 0; + self->baudrate = 250000; + + lock_bus_or_throw(self); + const compressed_string_t *result = init_card(self); + extraclock_and_unlock_bus(self); + + if (result != NULL) { + common_hal_digitalio_digitalinout_deinit(&self->cs); + mp_raise_OSError_msg(result); + } + + self->baudrate = baudrate; +} + +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + return; + } + self->bus = 0; + common_hal_digitalio_digitalinout_deinit(&self->cs); +} + +void common_hal_sdcardio_check_for_deinit(sdcardio_sdcard_obj_t *self) { + if (!self->bus) { + raise_deinited_error(); + } +} + +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self) { + common_hal_sdcardio_check_for_deinit(self); + return self->sectors; +} + +int readinto(sdcardio_sdcard_obj_t *self, void *buf, size_t size) { + uint8_t aux[2] = {0, 0}; + while (aux[0] != 0xfe) { + common_hal_busio_spi_read(self->bus, aux, 1, 0xff); + } + + common_hal_busio_spi_read(self->bus, buf, size, 0xff); + + // Read checksum and throw it away + common_hal_busio_spi_read(self->bus, aux, sizeof(aux), 0xff); + return 0; +} + +int readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD17 to read a single block + return block_cmd(self, 17, start_block, buf->buf, buf->len, true, true); + } else { + // Use CMD18 to read multiple blocks + int r = block_cmd(self, 18, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = readinto(self, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + // End the multi-block read + r = cmd(self, 12, 0, NULL, 0, true, false); + + // Return first status 0 or last before card ready (0xff) + while (r != 0) { + uint8_t single_byte; + common_hal_busio_spi_read(self->bus, &single_byte, 1, 0xff); + if (single_byte & 0x80) { + return r; + } + r = single_byte; + } + } + return 0; +} + +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + + lock_and_configure_bus(self); + int r = readblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} + +int _write(sdcardio_sdcard_obj_t *self, uint8_t token, void *buf, size_t size) { + wait_for_ready(self); + + uint8_t cmd[2]; + cmd[0] = token; + + common_hal_busio_spi_write(self->bus, cmd, 1); + common_hal_busio_spi_write(self->bus, buf, size); + + cmd[0] = cmd[1] = 0xff; + common_hal_busio_spi_write(self->bus, cmd, 2); + + // Check the response + // This differs from the traditional adafruit_sdcard handling, + // but adafruit_sdcard also ignored the return value of SDCard._write(!) + // so nobody noticed + // + // + // Response is as follows: + // x x x 0 STAT 1 + // 7 6 5 4 3..1 0 + // with STATUS 010 indicating "data accepted", and other status bit + // combinations indicating failure. + // In practice, I was seeing cmd[0] as 0xe5, indicating success + for (int i=0; ibus, cmd, 1, 0xff); + DEBUG_PRINT("i=%02d cmd[0] = 0x%02x\n", i, cmd[0]); + if ((cmd[0] & 0b00010001) == 0b00000001) { + if ((cmd[0] & 0x1f) != 0x5) { + return -EIO; + } else { + break; + } + } + } + + // Wait for the write to finish + do { + common_hal_busio_spi_read(self->bus, cmd, 1, 0xff); + } while (cmd[0] == 0); + + // Success + return 0; +} + +int writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + uint32_t nblocks = buf->len / 512; + if (nblocks == 1) { + // Use CMD24 to write a single block + int r = block_cmd(self, 24, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + r = _write(self, TOKEN_DATA, buf->buf, buf->len); + if (r < 0) { + return r; + } + } else { + // Use CMD25 to write multiple block + int r = block_cmd(self, 25, start_block, NULL, 0, true, true); + if (r < 0) { + return r; + } + + uint8_t *ptr = buf->buf; + while (nblocks--) { + r = _write(self, TOKEN_CMD25, ptr, 512); + if (r < 0) { + return r; + } + ptr += 512; + } + + cmd_nodata(self, TOKEN_STOP_TRAN, 0); + } + return 0; +} + +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf) { + common_hal_sdcardio_check_for_deinit(self); + if (buf->len % 512 != 0) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } + lock_and_configure_bus(self); + int r = writeblocks(self, start_block, buf); + extraclock_and_unlock_bus(self); + return r; +} diff --git a/shared-module/sdcardio/SDCard.h b/shared-module/sdcardio/SDCard.h new file mode 100644 index 0000000000..76c906029f --- /dev/null +++ b/shared-module/sdcardio/SDCard.h @@ -0,0 +1,51 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "py/objarray.h" + +#include "common-hal/busio/SPI.h" +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; + busio_spi_obj_t *bus; + digitalio_digitalinout_obj_t cs; + int cdv; + int baudrate; + uint32_t sectors; +} sdcardio_sdcard_obj_t; + +void common_hal_sdcardio_sdcard_construct(sdcardio_sdcard_obj_t *self, busio_spi_obj_t *spi, mcu_pin_obj_t *cs, int baudrate); +void common_hal_sdcardio_sdcard_deinit(sdcardio_sdcard_obj_t *self); +void common_hal_sdcardio_sdcard_check_for_deinit(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_get_blockcount(sdcardio_sdcard_obj_t *self); +int common_hal_sdcardio_sdcard_readblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); +int common_hal_sdcardio_sdcard_writeblocks(sdcardio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *buf); diff --git a/shared-module/sdcardio/__init__.c b/shared-module/sdcardio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/sdcardio/__init__.h b/shared-module/sdcardio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 From 159728b550c70f239e03c267a23f3950de635d3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 27 May 2020 09:09:39 -0500 Subject: [PATCH 871/919] shared-bindings: Factor out validate_list_is_free_pins This will ultimately be used by SDIO, where a variable length list of data lines is called for. --- locale/circuitpython.pot | 2 +- shared-bindings/microcontroller/Pin.c | 12 ++++++++++++ shared-bindings/microcontroller/Pin.h | 1 + shared-bindings/rgbmatrix/RGBMatrix.c | 11 ++++------- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 55147dc03e..9a5a788b08 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -338,7 +338,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index 765e602e5f..d5b971ae5e 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -101,6 +101,18 @@ mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj) { return pin; } +// Validate every element in the list to be a free pin. +void validate_list_is_free_pins(qstr what, mcu_pin_obj_t **pins_out, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out) { + mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); + if (len > max_pins) { + mp_raise_ValueError_varg(translate("At most %d %q may be specified (not %d)"), max_pins, what, len); + } + *count_out = len; + for (mp_int_t i=0; i max_pins) { - mp_raise_ValueError_varg(translate("At most %d %q may be specified (not %d)"), max_pins, what, len); - } - *count_out = len; - for (mp_int_t i=0; i Date: Fri, 26 Jun 2020 10:10:39 -0500 Subject: [PATCH 872/919] sdioio: Add shared-bindings There is no implementation yet. --- locale/circuitpython.pot | 4 + py/circuitpy_defns.mk | 5 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 3 + shared-bindings/sdioio/SDCard.c | 310 ++++++++++++++++++++++++++++++ shared-bindings/sdioio/SDCard.h | 66 +++++++ shared-bindings/sdioio/__init__.c | 47 +++++ shared-bindings/sdioio/__init__.h | 0 8 files changed, 443 insertions(+) create mode 100644 shared-bindings/sdioio/SDCard.c create mode 100644 shared-bindings/sdioio/SDCard.h create mode 100644 shared-bindings/sdioio/__init__.c create mode 100644 shared-bindings/sdioio/__init__.h diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9a5a788b08..481d29f248 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -863,6 +863,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f40f506c23..32d3640069 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -216,6 +216,9 @@ endif ifeq ($(CIRCUITPY_SDCARDIO),1) SRC_PATTERNS += sdcardio/% endif +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_PATTERNS += sdioio/% +endif ifeq ($(CIRCUITPY_STAGE),1) SRC_PATTERNS += _stage/% endif @@ -314,6 +317,8 @@ SRC_COMMON_HAL_ALL = \ rotaryio/__init__.c \ rtc/RTC.c \ rtc/__init__.c \ + sdioio/SDCard.c \ + sdioio/__init__.c \ supervisor/Runtime.c \ supervisor/__init__.c \ watchdog/WatchDogMode.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 10f91167b7..d05a246fce 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -544,6 +544,13 @@ extern const struct _mp_obj_module_t sdcardio_module; #define SDCARDIO_MODULE #endif +#if CIRCUITPY_SDIOIO +extern const struct _mp_obj_module_t sdioio_module; +#define SDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdioio), (mp_obj_t)&sdioio_module }, +#else +#define SDIOIO_MODULE +#endif + #if CIRCUITPY_STAGE extern const struct _mp_obj_module_t stage_module; #define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, @@ -717,6 +724,7 @@ extern const struct _mp_obj_module_t watchdog_module; RTC_MODULE \ SAMD_MODULE \ SDCARDIO_MODULE \ + SDIOIO_MODULE \ STAGE_MODULE \ STORAGE_MODULE \ STRUCT_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 0850c195a0..302368f74a 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -169,6 +169,9 @@ CFLAGS += -DCIRCUITPY_SAMD=$(CIRCUITPY_SAMD) CIRCUITPY_SDCARDIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_SDCARDIO=$(CIRCUITPY_SDCARDIO) +CIRCUITPY_SDIOIO ?= 0 +CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) + # Currently always off. CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c new file mode 100644 index 0000000000..c6b1d280ba --- /dev/null +++ b/shared-bindings/sdioio/SDCard.c @@ -0,0 +1,310 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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. + */ + +// This file contains all of the Python API definitions for the +// sdioio.SDCard class. + +#include + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/util.h" + +#include "lib/utils/buffer_helper.h" +#include "lib/utils/context_manager_helpers.h" +#include "py/mperrno.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "supervisor/shared/translate.h" + +//| class SDCard: +//| """SD Card Block Interface with SDIO +//| +//| Controls an SD card over SDIO. SDIO is a parallel protocol designed +//| for SD cards. It uses a clock pin, a command pin, and 1 or 4 +//| data pins. It can be operated at a high frequency such as +//| 25MHz. Usually an SDCard object is used with ``storage.VfsFat`` +//| to allow file I/O to an SD card.""" +//| +//| def __init__(*, clock: digitalio.DigitalInOut, command: digitalio.DigitalInOut, data: List[digitalio.DigitalInOut], frequency: int): +//| """Construct an SDIO SD Card object with the given properties +//| +//| :param ~microcontroller.Pin clock: the pin to use for the clock. +//| :param ~microcontroller.Pin command: the pin to use for the command. +//| :param data: A sequence of pins to use for data. +//| :param frequency: The frequency of the bus in Hz +//| +//| Example usage: +//| +//| .. code-block:: python +//| +//| import os +//| +//| import board +//| import sdioio +//| import storage +//| +//| sd = sdioio.SDCard( +//| clock=board.SDIO_CLOCK, +//| command=board.SDIO_COMMAND, +//| data=board.SDIO_DATA, +//| frequency=25000000) +//| vfs = storage.VfsFat(sd) +//| storage.mount(vfs, '/sd') +//| os.listdir('/sd')""" +//| ... +//| + +STATIC mp_obj_t sdioio_sdcard_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + sdioio_sdcard_obj_t *self = m_new_obj(sdioio_sdcard_obj_t); + self->base.type = &sdioio_SDCard_type; + enum { ARG_clock, ARG_command, ARG_data, ARG_frequency, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_command, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_INT }, + }; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const mcu_pin_obj_t* clock = validate_obj_is_free_pin(args[ARG_clock].u_obj); + const mcu_pin_obj_t* command = validate_obj_is_free_pin(args[ARG_command].u_obj); + mcu_pin_obj_t *data_pins[4]; + uint8_t num_data; + validate_list_is_free_pins(MP_QSTR_data, data_pins, MP_ARRAY_SIZE(data_pins), args[ARG_data].u_obj, &num_data); + + common_hal_sdioio_sdcard_construct(self, clock, command, num_data, data_pins, args[ARG_frequency].u_int); + return MP_OBJ_FROM_PTR(self); +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } +} + +//| def configure(*, frequency=0, width=0) -> None: +//| """Configures the SDIO bus. +//| +//| :param int frequency: the desired clock rate in Hertz. The actual clock rate may be higher or lower due to the granularity of available clock settings. Check the `frequency` attribute for the actual clock rate. +//| :param int width: the number of data lines to use. Must be 1 or 4 and must also not exceed the number of data lines at construction +//| +//| .. note:: Leaving a value unspecified or 0 means the current setting is kept""" +//| +STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_frequency, ARG_width, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_width, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + }; + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT( MP_ARRAY_SIZE(allowed_args) == NUM_ARGS ); + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_int_t frequency = args[ARG_frequency].u_int; + if (frequency < 0) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_baudrate); + } + + uint8_t width = args[ARG_width].u_int; + if (width != 0 && width != 1 && width != 4) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_width); + } + + if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(sdioio_sdcard_configure_obj, 1, sdioio_sdcard_configure); + +//| def count() -> int: +//| """Returns the total number of sectors +//| +//| Due to technical limitations, this is a function and not a property. +//| +//| :return: The number of 512-byte blocks, as a number""" +//| +STATIC mp_obj_t sdioio_sdcard_count(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_count_obj, sdioio_sdcard_count); + +//| def readblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Read one or more blocks from the card +//| +//| :param int start_block: The block to start reading from +//| :param bytearray buf: The buffer to write into. Length must be multiple of 512. +//| +//| :return: None""" +mp_obj_t sdioio_sdcard_readblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_readblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_readblocks_obj, sdioio_sdcard_readblocks); + +//| def writeblocks(start_block: int, buf: bytearray) -> None: +//| +//| """Write one or more blocks to the card +//| +//| :param int start_block: The block to start writing from +//| :param bytearray buf: The buffer to read from. Length must be multiple of 512. +//| +//| :return: None""" +//| +mp_obj_t sdioio_sdcard_writeblocks(mp_obj_t self_in, mp_obj_t start_block_in, mp_obj_t buf_in) { + uint32_t start_block = mp_obj_get_int(start_block_in); + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_WRITE); + sdioio_sdcard_obj_t *self = (sdioio_sdcard_obj_t*)self_in; + int result = common_hal_sdioio_sdcard_writeblocks(self, start_block, &bufinfo); + if (result < 0) { + mp_raise_OSError(-result); + } + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_3(sdioio_sdcard_writeblocks_obj, sdioio_sdcard_writeblocks); + +//| @property +//| def frequency(self) -> int: +//| """The actual SDIO bus frequency. This may not match the frequency +//| requested due to internal limitations.""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_frequency(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get_frequency); + +const mp_obj_property_t sdioio_sdcard_frequency_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| @property +//| def width(self) -> int: +//| """The actual SDIO bus width, in bits""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_sdioio_sdcard_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_width); + +const mp_obj_property_t sdioio_sdcard_width_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| def deinit() -> None: +//| """Disable permanently. +//| +//| :return: None""" +STATIC mp_obj_t sdioio_sdcard_obj_deinit(mp_obj_t self_in) { + sdioio_sdcard_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_sdioio_sdcard_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_deinit_obj, sdioio_sdcard_obj_deinit); + +//| def __enter__(self, ) -> Any: +//| """No-op used by Context Managers. +//| Provided by context manager helper.""" +//| ... +//| + +//| def __exit__(self, ) -> Any: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t sdioio_sdcard_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_sdioio_sdcard_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(sdioio_sdcard_obj___exit___obj, 4, 4, sdioio_sdcard_obj___exit__); + +STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&sdioio_sdcard_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&sdioio_sdcard_obj___exit___obj) }, + + { MP_ROM_QSTR(MP_QSTR_configure), MP_ROM_PTR(&sdioio_sdcard_configure_obj) }, + { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&sdioio_sdcard_frequency_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&sdioio_sdcard_width_obj) }, + + { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, + { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, + +// Methods in STM HAL: +// InitCard +// ReadBlocks +// WriteBlocks +// Erase +// GetCardState +// GetCardCID +// GetCardCSD +// GetCardInfo +// GetState +// GetError +// Abort + +}; +STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); + +const mp_obj_type_t sdioio_SDCard_type = { + { &mp_type_type }, + .name = MP_QSTR_SDCard, + .make_new = sdioio_sdcard_make_new, + .locals_dict = (mp_obj_dict_t*)&sdioio_sdcard_locals_dict, +}; diff --git a/shared-bindings/sdioio/SDCard.h b/shared-bindings/sdioio/SDCard.h new file mode 100644 index 0000000000..7f62ee7a65 --- /dev/null +++ b/shared-bindings/sdioio/SDCard.h @@ -0,0 +1,66 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/sdioio/SDCard.h" + +// Type object used in Python. Should be shared between ports. +extern const mp_obj_type_t sdioio_SDCard_type; + +// Construct an underlying SDIO object. +extern void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency); + +extern void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self); +extern bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self); + +extern bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width); + +extern void common_hal_sdioio_sdcard_unlock(sdioio_sdcard_obj_t *self); + +// Return actual SDIO bus frequency. +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self); + +// Return SDIO bus width. +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self); + +// Return number of device blocks +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self); + +// Read or write blocks +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo); + +// This is used by the supervisor to claim SDIO devices indefinitely. +extern void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_SDIO_H diff --git a/shared-bindings/sdioio/__init__.c b/shared-bindings/sdioio/__init__.c new file mode 100644 index 0000000000..b88e5c3a96 --- /dev/null +++ b/shared-bindings/sdioio/__init__.c @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include + +#include "py/obj.h" +#include "py/runtime.h" + +#include "shared-bindings/sdioio/SDCard.h" + +//| """Interface to an SD card via the SDIO bus""" + +STATIC const mp_rom_map_elem_t sdioio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sdio) }, + { MP_ROM_QSTR(MP_QSTR_SDCard), MP_ROM_PTR(&sdioio_SDCard_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(sdioio_module_globals, sdioio_module_globals_table); + +const mp_obj_module_t sdioio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&sdioio_module_globals, +}; diff --git a/shared-bindings/sdioio/__init__.h b/shared-bindings/sdioio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 From d4b945851285c0b5d3a38094223d97184449e7e1 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 9 Jun 2020 11:19:51 -0500 Subject: [PATCH 873/919] samd: sdio: Add needed files from atmel start --- ports/atmel-samd/sd_mmc/conf_sd_mmc.h | 79 + ports/atmel-samd/sd_mmc/sd_mmc.c | 1671 +++++++++++++++++++++ ports/atmel-samd/sd_mmc/sd_mmc.h | 310 ++++ ports/atmel-samd/sd_mmc/sd_mmc_protocol.h | 1001 ++++++++++++ 4 files changed, 3061 insertions(+) create mode 100644 ports/atmel-samd/sd_mmc/conf_sd_mmc.h create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc.c create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc.h create mode 100644 ports/atmel-samd/sd_mmc/sd_mmc_protocol.h diff --git a/ports/atmel-samd/sd_mmc/conf_sd_mmc.h b/ports/atmel-samd/sd_mmc/conf_sd_mmc.h new file mode 100644 index 0000000000..735dd3783c --- /dev/null +++ b/ports/atmel-samd/sd_mmc/conf_sd_mmc.h @@ -0,0 +1,79 @@ +/* Auto-generated config file conf_sd_mmc.h */ +#ifndef CONF_SD_MMC_H +#define CONF_SD_MMC_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Enable the SDIO support +// conf_sdio_support +#ifndef CONF_SDIO_SUPPORT +#define CONF_SDIO_SUPPORT 0 +#endif + +// Enable the MMC card support +// conf_mmc_support +#ifndef CONF_MMC_SUPPORT +#define CONF_MMC_SUPPORT 0 +#endif + +// Enable the OS support +// conf_sd_mmc_os_support +#ifndef CONF_OS_SUPPORT +#define CONF_OS_SUPPORT 0 +#endif + +// Detection (card/write protect) timeout (ms/ticks) +// conf_sd_mmc_debounce +#ifndef CONF_SD_MMC_DEBOUNCE +#define CONF_SD_MMC_DEBOUNCE 1000 +#endif + +#ifndef CONF_SD_MMC_MEM_CNT +#define CONF_SD_MMC_MEM_CNT 1 +#endif + +// SD/MMC Slot 0 +// conf_sd_mmc_0_enable +#ifndef CONF_SD_MMC_0_ENABLE +#define CONF_SD_MMC_0_ENABLE 1 +#endif + +// Card Detect (CD) 0 Enable +// conf_sd_mmc_0_cd_detect_en +#ifndef CONF_SD_MMC_0_CD_DETECT_EN +#define CONF_SD_MMC_0_CD_DETECT_EN 0 +#endif + +// Card Detect (CD) detection level +// <1=> High +// <0=> Low +// conf_sd_mmc_0_cd_detect_value +#ifndef CONF_SD_MMC_0_CD_DETECT_VALUE +#define CONF_SD_MMC_0_CD_DETECT_VALUE 0 +#endif +// + +// Write Protect (WP) 0 Enable +// conf_sd_mmc_0_wp_detect_en +#ifndef CONF_SD_MMC_0_WP_DETECT_EN +#define CONF_SD_MMC_0_WP_DETECT_EN 0 +#endif + +// Write Protect (WP) detection level +// <1=> High +// <0=> Low +// conf_sd_mmc_0_wp_detect_value +#ifndef CONF_SD_MMC_0_WP_DETECT_VALUE +#define CONF_SD_MMC_0_WP_DETECT_VALUE 1 +#endif +// + +// + +#ifndef CONF_MCI_OS_SUPPORT +#define CONF_MCI_OS_SUPPORT 0 +#endif + +// <<< end of configuration section >>> + +#endif // CONF_SD_MMC_H diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.c b/ports/atmel-samd/sd_mmc/sd_mmc.c new file mode 100644 index 0000000000..5ea9d830e9 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc.c @@ -0,0 +1,1671 @@ +/** + * \file + * + * \brief Common SD/MMC stack + * + * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#include + +#include "conf_sd_mmc.h" + +#include "sd_mmc_protocol.h" +#include "sd_mmc.h" + +#if CONF_OS_SUPPORT +#include +#endif +#include +#include +#include +#include + +#define TPASTE2(a, b) a##b +#define ATPASTE2(a, b) TPASTE2(a, b) + +/** + * \ingroup sd_mmc_stack + * \defgroup sd_mmc_stack_internal Implementation of SD/MMC/SDIO Stack + * @{ + */ + +#ifndef CONF_SD_MMC_MEM_CNT +#define CONF_SD_MMC_MEM_CNT 0 +#endif + +/* Macros to switch SD MMC stack to the correct driver (MCI or SPI) */ +#if (CONF_SD_MMC_MEM_CNT != 0) +#if CONF_MCI_OS_SUPPORT +#include "hal_mci_os.h" +#else +#include "hal_mci_sync.h" +#endif +#define driver mci +#else +#error No MCI or HSMCI interfaces are defined for SD MMC stack. \ + CONF_SD_MMC_MEM_CNT must be added in board.h file. +#endif + +#if CONF_MCI_OS_SUPPORT +#define driver_select_device ATPASTE2(driver, _os_select_device) +#define driver_deselect_device ATPASTE2(driver, _os_deselect_device) +#define driver_get_bus_width ATPASTE2(driver, _os_get_bus_width) +#define driver_is_high_speed_capable ATPASTE2(driver, _os_is_high_speed_capable) +#define driver_send_clock ATPASTE2(driver, _os_send_init_sequence) +#define driver_send_cmd ATPASTE2(driver, _os_send_cmd) +#define driver_get_response ATPASTE2(driver, _os_get_response) +#define driver_get_response_128 ATPASTE2(driver, _os_get_response_128) +#define driver_adtc_start ATPASTE2(driver, _os_adtc_start) +#define driver_adtc_stop ATPASTE2(driver, _os_send_cmd) +#define driver_read_word ATPASTE2(driver, _os_read_bytes) +#define driver_write_word ATPASTE2(driver, _os_write_bytes) +#define driver_start_read_blocks ATPASTE2(driver, _os_start_read_blocks) +#define driver_wait_end_of_read_blocks ATPASTE2(driver, _os_wait_end_of_read_blocks) +#define driver_start_write_blocks ATPASTE2(driver, _os_start_write_blocks) +#define driver_wait_end_of_write_blocks ATPASTE2(driver, _os_wait_end_of_write_blocks) +#else +#define driver_select_device ATPASTE2(driver, _sync_select_device) +#define driver_deselect_device ATPASTE2(driver, _sync_deselect_device) +#define driver_get_bus_width ATPASTE2(driver, _sync_get_bus_width) +#define driver_is_high_speed_capable ATPASTE2(driver, _sync_is_high_speed_capable) +#define driver_send_clock ATPASTE2(driver, _sync_send_clock) +#define driver_send_cmd ATPASTE2(driver, _sync_send_cmd) +#define driver_get_response ATPASTE2(driver, _sync_get_response) +#define driver_get_response_128 ATPASTE2(driver, _sync_get_response_128) +#define driver_adtc_start ATPASTE2(driver, _sync_adtc_start) +#define driver_adtc_stop ATPASTE2(driver, _sync_send_cmd) +#define driver_read_word ATPASTE2(driver, _sync_read_word) +#define driver_write_word ATPASTE2(driver, _sync_write_word) +#define driver_start_read_blocks ATPASTE2(driver, _sync_start_read_blocks) +#define driver_wait_end_of_read_blocks ATPASTE2(driver, _sync_wait_end_of_read_blocks) +#define driver_start_write_blocks ATPASTE2(driver, _sync_start_write_blocks) +#define driver_wait_end_of_write_blocks ATPASTE2(driver, _sync_wait_end_of_write_blocks) +#endif + +#if (CONF_SDIO_SUPPORT == 1) +#define IS_SDIO() (sd_mmc_card->type & CARD_TYPE_SDIO) +#else +#define IS_SDIO() false +#endif + +/** This SD MMC stack supports only the high voltage */ +#define SD_MMC_VOLTAGE_SUPPORT \ + (OCR_VDD_27_28 | OCR_VDD_28_29 | OCR_VDD_29_30 | OCR_VDD_30_31 | OCR_VDD_31_32 | OCR_VDD_32_33) + +/** SD/MMC card states */ +enum card_state { + SD_MMC_CARD_STATE_READY = 0, /**< Ready to use */ + SD_MMC_CARD_STATE_DEBOUNCE = 1, /**< Debounce on going */ + SD_MMC_CARD_STATE_INIT = 2, /**< Initialization on going */ + SD_MMC_CARD_STATE_UNUSABLE = 3, /**< Unusable card */ + SD_MMC_CARD_STATE_NO_CARD = 4 /**< No SD/MMC card inserted */ +}; + +/** SD/MMC card information structure */ +struct sd_mmc_card { + uint32_t clock; /**< Card access clock */ + uint32_t capacity; /**< Card capacity in KBytes */ + uint16_t rca; /**< Relative card address */ + enum card_state state; /**< Card state */ + card_type_t type; /**< Card type */ + card_version_t version; /**< Card version */ + uint8_t bus_width; /**< Number of DATA lin on bus (MCI only) */ + uint8_t csd[CSD_REG_BSIZE]; /**< CSD register */ + uint8_t high_speed; /**< High speed card (1) */ +}; + +/** Card detect pin */ +static sd_mmc_detect_t *_cd; +/** Write protect pin */ +static sd_mmc_detect_t *_wp; + +/** SD/MMC card list */ +/** Note: Initialize card detect pin fields if present */ +static struct sd_mmc_card sd_mmc_cards[CONF_SD_MMC_MEM_CNT]; + +/** HAL driver instance */ +static void *sd_mmc_hal; +/** Index of current slot configurated */ +static uint8_t sd_mmc_slot_sel; +/** Pointer on current slot configurated */ +static struct sd_mmc_card *sd_mmc_card; +/** Number of block to read or write on the current transfer */ +static uint16_t sd_mmc_nb_block_to_tranfer = 0; +/** Number of block remaining to read or write on the current transfer */ +static uint16_t sd_mmc_nb_block_remaining = 0; + +/** SD/MMC transfer rate unit codes (10K) list */ +const uint32_t sd_mmc_trans_units[7] = {10, 100, 1000, 10000, 0, 0, 0}; +/** SD transfer multiplier factor codes (1/10) list */ +const uint32_t sd_trans_multipliers[16] = {0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80}; +/** MMC transfer multiplier factor codes (1/10) list */ +const uint32_t mmc_trans_multipliers[16] = {0, 10, 12, 13, 15, 20, 26, 30, 35, 40, 45, 52, 55, 60, 70, 80}; + +/** \name MMC, SD and SDIO commands process */ +/** @{ */ +#if CONF_MMC_SUPPORT +static bool mmc_mci_op_cond(void); +static bool mmc_cmd6_set_bus_width(uint8_t bus_width); +static bool mmc_cmd6_set_high_speed(void); +static bool mmc_cmd8(uint8_t *b_authorize_high_speed); +static void mmc_decode_csd(void); +#endif +static bool sd_mci_op_cond(uint8_t v2); +static bool sdio_op_cond(void); +static bool sdio_get_max_speed(void); +static bool sdio_cmd52_set_bus_width(void); +static bool sdio_cmd52_set_high_speed(void); +static bool sd_cm6_set_high_speed(void); +static bool sd_cmd8(uint8_t *v2); +static bool sd_mmc_cmd9_mci(void); +static void sd_decode_csd(void); +static bool sd_mmc_cmd13(void); +#if (CONF_SDIO_SUPPORT == 1) +static bool sdio_cmd52(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t rd_after_wr, uint8_t *io_data); +static bool sdio_cmd53(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t inc_addr, uint32_t size, + bool access_block); +#endif +static bool sd_acmd6(void); +static bool sd_acmd51(void); +/** @} */ + +/** \name Internal function to process the initialization and install */ +/** @{ */ +static sd_mmc_err_t sd_mmc_select_slot(uint8_t slot); +static void sd_mmc_configure_slot(void); +static void sd_mmc_deselect_slot(void); +static bool sd_mmc_mci_card_init(void); +#if CONF_MMC_SUPPORT +static bool sd_mmc_mci_install_mmc(void); +#endif +/** @} */ + +/** \name Internal functions to manage a large timeout after a card insertion */ +/** @{ */ +#if CONF_OS_SUPPORT +#define SD_MMC_START_TIMEOUT() os_sleep(CONF_SD_MMC_DEBOUNCE) +#else +#define SD_MMC_START_TIMEOUT() +#endif +#define SD_MMC_IS_TIMEOUT() true +#define SD_MMC_STOP_TIMEOUT() +/** @} */ + +#if CONF_MMC_SUPPORT +/** + * \brief Sends operation condition command and read OCR (MCI only) + * - CMD1 sends operation condition command + * - CMD1 reads OCR + * + * \return true if success, otherwise false + */ +static bool mmc_mci_op_cond(void) +{ + uint32_t retry, resp; + + /* + * Timeout 1s = 400KHz / ((6+6)*8) cylces = 4200 retry + * 6 = cmd byte size + * 6 = response byte size + */ + retry = 4200; + do { + if (!driver_send_cmd(sd_mmc_hal, MMC_MCI_CMD1_SEND_OP_COND, SD_MMC_VOLTAGE_SUPPORT | OCR_ACCESS_MODE_SECTOR)) { + return false; + } + /* Check busy flag */ + resp = driver_get_response(sd_mmc_hal); + if (resp & OCR_POWER_UP_BUSY) { + /* Check OCR value */ + if ((resp & OCR_ACCESS_MODE_MASK) == OCR_ACCESS_MODE_SECTOR) { + sd_mmc_card->type |= CARD_TYPE_HC; + } + break; + } + if (retry-- == 0) { + return false; + } + } while (1); + return true; +} +#endif + +/** + * \brief Ask to all cards to send their operations conditions (MCI only). + * - ACMD41 sends operation condition command. + * - ACMD41 reads OCR + * + * \param v2 Shall be 1 if it is a SD card V2 + * + * \return true if success, otherwise false + */ +static bool sd_mci_op_cond(uint8_t v2) +{ + uint32_t arg, retry, resp; + + /* + * Timeout 1s = 400KHz / ((6+6+6+6)*8) cylces = 2100 retry + * 6 = cmd byte size + * 6 = response byte size + * 6 = cmd byte size + * 6 = response byte size + */ + retry = 2100; + do { + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, 0)) { + return false; + } + + /* (ACMD41) Sends host OCR register */ + arg = SD_MMC_VOLTAGE_SUPPORT; + if (v2) { + arg |= SD_ACMD41_HCS; + } + /* Check response */ + if (!driver_send_cmd(sd_mmc_hal, SD_MCI_ACMD41_SD_SEND_OP_COND, arg)) { + return false; + } + resp = driver_get_response(sd_mmc_hal); + if (resp & OCR_POWER_UP_BUSY) { + /* Card is ready */ + if ((resp & OCR_CCS) != 0) { + sd_mmc_card->type |= CARD_TYPE_HC; + } + break; + } + if (retry-- == 0) { + return false; + } + } while (1); + return true; +} + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief Try to get the SDIO card's operating condition + * - CMD5 to read OCR NF field + * - CMD5 to wait OCR power up busy + * - CMD5 to read OCR MP field + * sd_mmc_card->type is updated + * + * \return true if success, otherwise false + */ +static bool sdio_op_cond(void) +{ + uint32_t resp; + + /* CMD5 - SDIO send operation condition (OCR) command. */ + if (!driver_send_cmd(sd_mmc_hal, SDIO_CMD5_SEND_OP_COND, 0)) { + return true; /* No error but card type not updated */ + } + resp = driver_get_response(sd_mmc_hal); + if ((resp & OCR_SDIO_NF) == 0) { + return true; /* No error but card type not updated */ + } + + /* + * Wait card ready + * Timeout 1s = 400KHz / ((6+4)*8) cylces = 5000 retry + * 6 = cmd byte size + * 4(SPI) 6(MCI) = response byte size + */ + uint32_t cmd5_retry = 5000; + while (1) { + /* CMD5 - SDIO send operation condition (OCR) command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDIO_CMD5_SEND_OP_COND, resp & SD_MMC_VOLTAGE_SUPPORT)) { + return false; + } + resp = driver_get_response(sd_mmc_hal); + if ((resp & OCR_POWER_UP_BUSY) == OCR_POWER_UP_BUSY) { + break; + } + if (cmd5_retry-- == 0) { + return false; + } + } + /* Update card type at the end of busy */ + if ((resp & OCR_SDIO_MP) > 0) { + sd_mmc_card->type = CARD_TYPE_SD_COMBO; + } else { + sd_mmc_card->type = CARD_TYPE_SDIO; + } + return true; /* No error and card type updated with SDIO type */ +} + +/** + * \brief Get SDIO max transfer speed in Hz. + * - CMD53 reads CIS area address in CCCR area. + * - Nx CMD53 search Fun0 tuple in CIS area + * - CMD53 reads TPLFE_MAX_TRAN_SPEED in Fun0 tuple + * - Compute maximum speed of SDIO + * and update sd_mmc_card->clock + * + * \return true if success, otherwise false + */ +static bool sdio_get_max_speed(void) +{ + uint32_t addr_new, addr_old; + uint8_t buf[6]; + uint32_t unit; + uint32_t mul; + uint8_t tplfe_max_tran_speed, i; + uint8_t addr_cis[4]; + + /* Read CIS area address in CCCR area */ + addr_old = SDIO_CCCR_CIS_PTR; + for (i = 0; i < 4; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_old, 0, &addr_cis[i]); + addr_old++; + } + addr_old = addr_cis[0] + (addr_cis[1] << 8) + (addr_cis[2] << 16) + (addr_cis[3] << 24); + addr_new = addr_old; + + while (1) { + /* Read a sample of CIA area */ + for (i = 0; i < 3; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_new, 0, &buf[i]); + addr_new++; + } + if (buf[0] == SDIO_CISTPL_END) { + return false; /* Tuple error */ + } + if (buf[0] == SDIO_CISTPL_FUNCE && buf[2] == 0x00) { + break; /* Fun0 tuple found */ + } + if (buf[1] == 0) { + return false; /* Tuple error */ + } + /* Next address */ + addr_new += buf[1] - 1; + if (addr_new > (addr_old + 256)) { + return false; /* Outoff CIS area */ + } + } + + /* Read all Fun0 tuple fields: fn0_blk_siz & max_tran_speed */ + addr_new -= 3; + for (i = 0; i < 6; i++) { + sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, addr_new, 0, &buf[i]); + addr_new++; + } + + tplfe_max_tran_speed = buf[5]; + if (tplfe_max_tran_speed > 0x32) { + /* Error on SDIO register, the high speed is not activated + * and the clock can not be more than 25MHz. + * This error is present on specific SDIO card + * (H&D wireless card - HDG104 WiFi SIP). + */ + tplfe_max_tran_speed = 0x32; /* 25Mhz */ + } + + /* Decode transfer speed in Hz.*/ + unit = sd_mmc_trans_units[tplfe_max_tran_speed & 0x7]; + mul = sd_trans_multipliers[(tplfe_max_tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + /** + * Note: A combo card shall be a Full-Speed SDIO card + * which supports upto 25MHz. + * A SDIO card alone can be: + * - a Low-Speed SDIO card which supports 400Khz minimum + * - a Full-Speed SDIO card which supports upto 25MHz + */ + return true; +} + +/** + * \brief CMD52 for SDIO - Switches the bus width mode to 4 + * + * \note sd_mmc_card->bus_width is updated. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52_set_bus_width(void) +{ + /** + * A SD memory card always supports bus 4bit + * A SD COMBO card always supports bus 4bit + * A SDIO Full-Speed alone always supports 4bit + * A SDIO Low-Speed alone can supports 4bit (Optional) + */ + uint8_t u8_value; + + /* Check 4bit support in 4BLS of "Card Capability" register */ + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, SDIO_CCCR_CAP, 0, &u8_value)) { + return false; + } + if ((u8_value & SDIO_CAP_4BLS) != SDIO_CAP_4BLS) { + /* No supported, it is not a protocol error */ + return true; + } + /* HS mode possible, then enable */ + u8_value = SDIO_BUSWIDTH_4B; + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_BUS_CTRL, 1, &u8_value)) { + return false; + } + sd_mmc_card->bus_width = 4; + return true; +} + +/** + * \brief CMD52 for SDIO - Enable the high speed mode + * + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52_set_high_speed(void) +{ + uint8_t u8_value; + + /* Check CIA.HS */ + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, SDIO_CIA, SDIO_CCCR_HS, 0, &u8_value)) { + return false; + } + if ((u8_value & SDIO_SHS) != SDIO_SHS) { + /* No supported, it is not a protocol error */ + return true; + } + /* HS mode possible, then enable */ + u8_value = SDIO_EHS; + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_HS, 1, &u8_value)) { + return false; + } + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock *= 2; + return true; +} + +#else +static bool sdio_op_cond(void) +{ + return true; /* No error but card type not updated */ +} +static bool sdio_get_max_speed(void) +{ + return false; +} +static bool sdio_cmd52_set_bus_width(void) +{ + return false; +} +static bool sdio_cmd52_set_high_speed(void) +{ + return false; +} +#endif + +/** + * \brief CMD6 for SD - Switch card in high speed mode + * + * \note CMD6 for SD is valid under the "trans" state. + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool sd_cm6_set_high_speed(void) +{ + uint8_t switch_status[SD_SW_STATUS_BSIZE] = {0}; + + if (!driver_adtc_start(sd_mmc_hal, + SD_CMD6_SWITCH_FUNC, + SD_CMD6_MODE_SWITCH | SD_CMD6_GRP6_NO_INFLUENCE | SD_CMD6_GRP5_NO_INFLUENCE + | SD_CMD6_GRP4_NO_INFLUENCE | SD_CMD6_GRP3_NO_INFLUENCE | SD_CMD6_GRP2_DEFAULT + | SD_CMD6_GRP1_HIGH_SPEED, + SD_SW_STATUS_BSIZE, + 1, + true)) { + return false; + } + if (!driver_start_read_blocks(sd_mmc_hal, switch_status, 1)) { + return false; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return false; + } + + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + return false; + } + if (SD_SW_STATUS_FUN_GRP1_RC(switch_status) == SD_SW_STATUS_FUN_GRP_RC_ERROR) { + /* No supported, it is not a protocol error */ + return true; + } + if (SD_SW_STATUS_FUN_GRP1_BUSY(switch_status)) { + return false; + } + /* CMD6 function switching period is within 8 clocks + * after the end bit of status data.*/ + driver_send_clock(sd_mmc_hal); + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock *= 2; + return true; +} + +#if CONF_MMC_SUPPORT + +/** + * \brief CMD6 for MMC - Switches the bus width mode + * + * \note CMD6 is valid under the "trans" state. + * \note sd_mmc_card->bus_width is updated. + * + * \param bus_width Bus width to set + * + * \return true if success, otherwise false + */ +static bool mmc_cmd6_set_bus_width(uint8_t bus_width) +{ + uint32_t arg; + + switch (bus_width) { + case 8: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_8BIT; + break; + case 4: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_4BIT; + break; + default: + arg = MMC_CMD6_ACCESS_SET_BITS | MMC_CMD6_INDEX_BUS_WIDTH | MMC_CMD6_VALUE_BUS_WIDTH_1BIT; + break; + } + if (!driver_send_cmd(sd_mmc_hal, MMC_CMD6_SWITCH, arg)) { + return false; + } + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + /* No supported, it is not a protocol error */ + return false; + } + sd_mmc_card->bus_width = bus_width; + return true; +} + +/** + * \brief CMD6 for MMC - Switches in high speed mode + * + * \note CMD6 is valid under the "trans" state. + * \note sd_mmc_card->high_speed is updated. + * \note sd_mmc_card->clock is updated. + * + * \return true if success, otherwise false + */ +static bool mmc_cmd6_set_high_speed(void) +{ + if (!driver_send_cmd(sd_mmc_hal, + MMC_CMD6_SWITCH, + MMC_CMD6_ACCESS_WRITE_BYTE | MMC_CMD6_INDEX_HS_TIMING | MMC_CMD6_VALUE_HS_TIMING_ENABLE)) { + return false; + } + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_SWITCH_ERROR) { + /* No supported, it is not a protocol error */ + return false; + } + sd_mmc_card->high_speed = 1; + sd_mmc_card->clock = 52000000lu; + return true; +} +#endif + +/** + * \brief CMD8 for SD card - Send Interface Condition Command. + * + * \note + * Send SD Memory Card interface condition, which includes host supply + * voltage information and asks the card whether card supports voltage. + * Should be performed at initialization time to detect the card type. + * + * \param v2 Pointer to v2 flag to update + * + * \return true if success, otherwise false + * with a update of \ref sd_mmc_err. + */ +static bool sd_cmd8(uint8_t *v2) +{ + uint32_t resp; + + *v2 = 0; + /* Test for SD version 2 */ + if (!driver_send_cmd(sd_mmc_hal, SD_CMD8_SEND_IF_COND, SD_CMD8_PATTERN | SD_CMD8_HIGH_VOLTAGE)) { + return true; /* It is not a V2 */ + } + /* Check R7 response */ + resp = driver_get_response(sd_mmc_hal); + if (resp == 0xFFFFFFFF) { + /* No compliance R7 value */ + return true; /* It is not a V2 */ + } + if ((resp & (SD_CMD8_MASK_PATTERN | SD_CMD8_MASK_VOLTAGE)) != (SD_CMD8_PATTERN | SD_CMD8_HIGH_VOLTAGE)) { + return false; + } + *v2 = 1; + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief CMD8 - The card sends its EXT_CSD register as a block of data. + * + * \param b_authorize_high_speed Pointer to update with the high speed + * support information + * + * \return true if success, otherwise false + */ +static bool mmc_cmd8(uint8_t *b_authorize_high_speed) +{ + uint16_t i; + uint32_t ext_csd; + uint32_t sec_count; + + if (!driver_adtc_start(sd_mmc_hal, MMC_CMD8_SEND_EXT_CSD, 0, EXT_CSD_BSIZE, 1, false)) { + return false; + } + /* Read and decode Extended Extended CSD + * Note: The read access is done in byte to avoid a buffer + * of EXT_CSD_BSIZE Byte in stack.*/ + + /* Read card type */ + for (i = 0; i < (EXT_CSD_CARD_TYPE_INDEX + 4) / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &ext_csd)) { + return false; + } + } + *b_authorize_high_speed = (ext_csd >> ((EXT_CSD_CARD_TYPE_INDEX % 4) * 8)) & MMC_CTYPE_52MHZ; + + if (MMC_CSD_C_SIZE(sd_mmc_card->csd) == 0xFFF) { + /* For high capacity SD/MMC card, + * memory capacity = SEC_COUNT * 512 byte */ + for (; i < (EXT_CSD_SEC_COUNT_INDEX + 4) / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &sec_count)) { + return false; + } + } + sd_mmc_card->capacity = sec_count / 2; + } + for (; i < EXT_CSD_BSIZE / 4; i++) { + if (!driver_read_word(sd_mmc_hal, &sec_count)) { + return false; + } + } + return true; +} + +#endif + +/** + * \brief CMD9: Addressed card sends its card-specific + * data (CSD) on the CMD line mci. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_cmd9_mci(void) +{ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD9_SEND_CSD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + driver_get_response_128(sd_mmc_hal, sd_mmc_card->csd); + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief Decodes MMC CSD register + */ +static void mmc_decode_csd(void) +{ + uint32_t unit; + uint32_t mul; + uint32_t tran_speed; + + /* Get MMC System Specification version supported by the card */ + switch (MMC_CSD_SPEC_VERS(sd_mmc_card->csd)) { + default: + case 0: + sd_mmc_card->version = CARD_VER_MMC_1_2; + break; + + case 1: + sd_mmc_card->version = CARD_VER_MMC_1_4; + break; + + case 2: + sd_mmc_card->version = CARD_VER_MMC_2_2; + break; + + case 3: + sd_mmc_card->version = CARD_VER_MMC_3; + break; + + case 4: + sd_mmc_card->version = CARD_VER_MMC_4; + break; + } + + /* Get MMC memory max transfer speed in Hz.*/ + tran_speed = CSD_TRAN_SPEED(sd_mmc_card->csd); + unit = sd_mmc_trans_units[tran_speed & 0x7]; + mul = mmc_trans_multipliers[(tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + + /* + * Get card capacity. + * ---------------------------------------------------- + * For normal SD/MMC card: + * memory capacity = BLOCKNR * BLOCK_LEN + * Where + * BLOCKNR = (C_SIZE+1) * MULT + * MULT = 2 ^ (C_SIZE_MULT+2) (C_SIZE_MULT < 8) + * BLOCK_LEN = 2 ^ READ_BL_LEN (READ_BL_LEN < 12) + * ---------------------------------------------------- + * For high capacity SD/MMC card: + * memory capacity = SEC_COUNT * 512 byte + */ + if (MMC_CSD_C_SIZE(sd_mmc_card->csd) != 0xFFF) { + uint32_t blocknr + = ((MMC_CSD_C_SIZE(sd_mmc_card->csd) + 1) * (1 << (MMC_CSD_C_SIZE_MULT(sd_mmc_card->csd) + 2))); + sd_mmc_card->capacity = blocknr * (1 << MMC_CSD_READ_BL_LEN(sd_mmc_card->csd)) / 1024; + } +} +#endif + +/** + * \brief Decodes SD CSD register + */ +static void sd_decode_csd(void) +{ + uint32_t unit; + uint32_t mul; + uint32_t tran_speed; + + /* Get SD memory maximum transfer speed in Hz. */ + tran_speed = CSD_TRAN_SPEED(sd_mmc_card->csd); + unit = sd_mmc_trans_units[tran_speed & 0x7]; + mul = sd_trans_multipliers[(tran_speed >> 3) & 0xF]; + sd_mmc_card->clock = unit * mul * 1000; + + /* + * Get card capacity. + * ---------------------------------------------------- + * For normal SD/MMC card: + * memory capacity = BLOCKNR * BLOCK_LEN + * Where + * BLOCKNR = (C_SIZE+1) * MULT + * MULT = 2 ^ (C_SIZE_MULT+2) (C_SIZE_MULT < 8) + * BLOCK_LEN = 2 ^ READ_BL_LEN (READ_BL_LEN < 12) + * ---------------------------------------------------- + * For high capacity SD card: + * memory capacity = (C_SIZE+1) * 512K byte + */ + if (CSD_STRUCTURE_VERSION(sd_mmc_card->csd) >= SD_CSD_VER_2_0) { + sd_mmc_card->capacity = (SD_CSD_2_0_C_SIZE(sd_mmc_card->csd) + 1) * 512; + } else { + uint32_t blocknr + = ((SD_CSD_1_0_C_SIZE(sd_mmc_card->csd) + 1) * (1 << (SD_CSD_1_0_C_SIZE_MULT(sd_mmc_card->csd) + 2))); + sd_mmc_card->capacity = blocknr * (1 << SD_CSD_1_0_READ_BL_LEN(sd_mmc_card->csd)) / 1024; + } +} + +/** + * \brief CMD13 - Addressed card sends its status register. + * This function waits the clear of the busy flag + * + * \return true if success, otherwise false + */ +static bool sd_mmc_cmd13(void) +{ + uint32_t nec_timeout; + + /* Wait for data ready status. + * Nec timing: 0 to unlimited + * However a timeout is used. + * 200 000 * 8 cycles + */ + nec_timeout = 200000; + do { + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD13_SEND_STATUS, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* Check busy flag */ + if (driver_get_response(sd_mmc_hal) & CARD_STATUS_READY_FOR_DATA) { + break; + } + if (nec_timeout-- == 0) { + return false; + } + } while (1); + + return true; +} + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief CMD52 - SDIO IO_RW_DIRECT command + * + * \param rw_flag Direction, 1:write, 0:read. + * \param func_nb Number of the function. + * \param rd_after_wr Read after Write flag. + * \param reg_addr register address. + * \param io_data Pointer to input argument and response buffer. + * + * \return true if success, otherwise false + */ +static bool sdio_cmd52(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t rd_after_wr, uint8_t *io_data) +{ + ASSERT(io_data != NULL); + if (!driver_send_cmd(sd_mmc_hal, + SDIO_CMD52_IO_RW_DIRECT, + ((uint32_t)*io_data << SDIO_CMD52_WR_DATA) | ((uint32_t)rw_flag << SDIO_CMD52_RW_FLAG) + | ((uint32_t)func_nb << SDIO_CMD52_FUNCTION_NUM) + | ((uint32_t)rd_after_wr << SDIO_CMD52_RAW_FLAG) + | ((uint32_t)reg_addr << SDIO_CMD52_REG_ADRR))) { + return false; + } + *io_data = driver_get_response(sd_mmc_hal) & 0xFF; + return true; +} + +/** + * \brief CMD53 - SDIO IO_RW_EXTENDED command + * This implementation support only the SDIO multi-byte transfer mode which is + * similar to the single block transfer on memory. + * Note: The SDIO block transfer mode is optional for SDIO card. + * + * \param rw_flag Direction, 1:write, 0:read. + * \param func_nb Number of the function. + * \param reg_addr Register address. + * \param inc_addr 1:Incrementing address, 0: fixed. + * \param size Transfer data size. + * \param access_block true, if the block access (DMA) is used + * + * \return true if success, otherwise false + */ +static bool sdio_cmd53(uint8_t rw_flag, uint8_t func_nb, uint32_t reg_addr, uint8_t inc_addr, uint32_t size, + bool access_block) +{ + ASSERT(size != 0); + ASSERT(size <= 512); + + return driver_adtc_start( + sd_mmc_hal, + (rw_flag == SDIO_CMD53_READ_FLAG) ? SDIO_CMD53_IO_R_BYTE_EXTENDED : SDIO_CMD53_IO_W_BYTE_EXTENDED, + ((size % 512) << SDIO_CMD53_COUNT) | ((uint32_t)reg_addr << SDIO_CMD53_REG_ADDR) + | ((uint32_t)inc_addr << SDIO_CMD53_OP_CODE) | ((uint32_t)0 << SDIO_CMD53_BLOCK_MODE) + | ((uint32_t)func_nb << SDIO_CMD53_FUNCTION_NUM) | ((uint32_t)rw_flag << SDIO_CMD53_RW_FLAG), + size, + 1, + access_block); +} +#endif + +/** + * \brief ACMD6 - Define the data bus width to 4 bits bus + * + * \return true if success, otherwise false + */ +static bool sd_acmd6(void) +{ + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* 10b = 4 bits bus */ + if (!driver_send_cmd(sd_mmc_hal, SD_ACMD6_SET_BUS_WIDTH, 0x2)) { + return false; + } + sd_mmc_card->bus_width = 4; + return true; +} + +/** + * \brief ACMD51 - Read the SD Configuration Register. + * + * \note + * SD Card Configuration Register (SCR) provides information on the SD Memory + * Card's special features that were configured into the given card. The size + * of SCR register is 64 bits. + * + * + * \return true if success, otherwise false + */ +static bool sd_acmd51(void) +{ + uint8_t scr[SD_SCR_REG_BSIZE]; + + /* CMD55 - Indicate to the card that the next command is an + * application specific command rather than a standard command.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD55_APP_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + if (!driver_adtc_start(sd_mmc_hal, SD_ACMD51_SEND_SCR, 0, SD_SCR_REG_BSIZE, 1, true)) { + return false; + } + if (!driver_start_read_blocks(sd_mmc_hal, scr, 1)) { + return false; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return false; + } + + /* Get SD Memory Card - Spec. Version */ + switch (SD_SCR_SD_SPEC(scr)) { + case SD_SCR_SD_SPEC_1_0_01: + sd_mmc_card->version = CARD_VER_SD_1_0; + break; + + case SD_SCR_SD_SPEC_1_10: + sd_mmc_card->version = CARD_VER_SD_1_10; + break; + + case SD_SCR_SD_SPEC_2_00: + if (SD_SCR_SD_SPEC3(scr) == SD_SCR_SD_SPEC_3_00) { + sd_mmc_card->version = CARD_VER_SD_3_0; + } else { + sd_mmc_card->version = CARD_VER_SD_2_0; + } + break; + + default: + sd_mmc_card->version = CARD_VER_SD_1_0; + break; + } + return true; +} + +/** + * \brief Select a card slot and initialize the associated driver + * + * \param slot Card slot number + * + * \retval SD_MMC_ERR_SLOT Wrong slot number + * \retval SD_MMC_ERR_NO_CARD No card present on slot + * \retval SD_MMC_ERR_UNUSABLE Unusable card + * \retval SD_MMC_INIT_ONGOING Card initialization requested + * \retval SD_MMC_OK Card present + */ +static sd_mmc_err_t sd_mmc_select_slot(uint8_t slot) +{ + if (slot >= CONF_SD_MMC_MEM_CNT) { + return SD_MMC_ERR_SLOT; + } + + if (_cd && _cd[slot].pin != -1) { + /** Card Detect pins */ + if (gpio_get_pin_level(_cd[slot].pin) != _cd[slot].val) { + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_DEBOUNCE) { + SD_MMC_STOP_TIMEOUT(); + } + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_NO_CARD; + return SD_MMC_ERR_NO_CARD; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_NO_CARD) { + /* A card plug on going, but this is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_DEBOUNCE; + /* Debounce + Power On Setup */ + SD_MMC_START_TIMEOUT(); + return SD_MMC_ERR_NO_CARD; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_DEBOUNCE) { + if (!SD_MMC_IS_TIMEOUT()) { + /* Debounce on going */ + return SD_MMC_ERR_NO_CARD; + } + /* Card is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_INIT; + /* Set 1-bit bus width and low clock for initialization */ + sd_mmc_cards[slot].clock = SDMMC_CLOCK_INIT; + sd_mmc_cards[slot].bus_width = 1; + sd_mmc_cards[slot].high_speed = 0; + } + if (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_UNUSABLE) { + return SD_MMC_ERR_UNUSABLE; + } + } else { + /* No pin card detection, then always try to install it */ + if ((sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_NO_CARD) + || (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_UNUSABLE)) { + /* Card is not initialized */ + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_INIT; + /* Set 1-bit bus width and low clock for initialization */ + sd_mmc_cards[slot].clock = SDMMC_CLOCK_INIT; + sd_mmc_cards[slot].bus_width = 1; + sd_mmc_cards[slot].high_speed = 0; + } + } + + ASSERT(!(sd_mmc_slot_sel != slot && sd_mmc_nb_block_remaining != 0)); + + /* Initialize interface */ + sd_mmc_slot_sel = slot; + sd_mmc_card = &sd_mmc_cards[slot]; + sd_mmc_configure_slot(); + return (sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_INIT) ? SD_MMC_INIT_ONGOING : SD_MMC_OK; +} + +/** + * \brief Configures the driver with the selected card configuration + */ +static void sd_mmc_configure_slot(void) +{ + driver_select_device( + sd_mmc_hal, sd_mmc_slot_sel, sd_mmc_card->clock, sd_mmc_card->bus_width, sd_mmc_card->high_speed); +} + +/** + * \brief Deselect the current card slot + */ +static void sd_mmc_deselect_slot(void) +{ + if (sd_mmc_slot_sel < CONF_SD_MMC_MEM_CNT) { + driver_deselect_device(sd_mmc_hal, sd_mmc_slot_sel); + } +} + +/** + * \brief Initialize the SD card in MCI mode. + * + * \note + * This function runs the initialization procedure and the identification + * process, then it sets the SD/MMC card in transfer state. + * At last, it will automaticly enable maximum bus width and transfer speed. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_mci_card_init(void) +{ + uint8_t v2 = 0; +#if (CONF_SDIO_SUPPORT == 1) + uint8_t data = 0x08; +#endif + + /* In first, try to install SD/SDIO card */ + sd_mmc_card->type = CARD_TYPE_SD; + sd_mmc_card->version = CARD_VER_UNKNOWN; + sd_mmc_card->rca = 0; + + /* Card need of 74 cycles clock minimum to start */ + driver_send_clock(sd_mmc_hal); + +#if (CONF_SDIO_SUPPORT == 1) + /* CMD52 Reset SDIO */ + sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_IOA, 0, &data); +#endif + + /* CMD0 - Reset all cards to idle state.*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD0_GO_IDLE_STATE, 0)) { + return false; + } + if (!sd_cmd8(&v2)) { + return false; + } + /* Try to get the SDIO card's operating condition */ + if (!sdio_op_cond()) { + return false; + } + + if (sd_mmc_card->type & CARD_TYPE_SD) { + /* Try to get the SD card's operating condition */ + if (!sd_mci_op_cond(v2)) { + /* It is not a SD card */ +#if CONF_MMC_SUPPORT + sd_mmc_card->type = CARD_TYPE_MMC; + return sd_mmc_mci_install_mmc(); +#else + sd_mmc_card->type = CARD_TYPE_UNKNOWN; + return false; +#endif + } + } + + if (sd_mmc_card->type & CARD_TYPE_SD) { + /* SD MEMORY, Put the Card in Identify Mode + * Note: The CID is not used in this stack */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD2_ALL_SEND_CID, 0)) { + return false; + } + } + /* Ask the card to publish a new relative address (RCA).*/ + if (!driver_send_cmd(sd_mmc_hal, SD_CMD3_SEND_RELATIVE_ADDR, 0)) { + return false; + } + sd_mmc_card->rca = (driver_get_response(sd_mmc_hal) >> 16) & 0xFFFF; + + /* SD MEMORY, Get the Card-Specific Data */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_mmc_cmd9_mci()) { + return false; + } + sd_decode_csd(); + } + /* Select the and put it into Transfer Mode */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD7_SELECT_CARD_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* SD MEMORY, Read the SCR to get card version */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_acmd51()) { + return false; + } + } + if (IS_SDIO()) { + if (!sdio_get_max_speed()) { + return false; + } + } + if ((4 <= driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel))) { + /* TRY to enable 4-bit mode */ + if (IS_SDIO()) { + if (!sdio_cmd52_set_bus_width()) { + return false; + } + } + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!sd_acmd6()) { + return false; + } + } + /* Switch to selected bus mode */ + sd_mmc_configure_slot(); + } + if (driver_is_high_speed_capable(sd_mmc_hal)) { + /* TRY to enable High-Speed Mode */ + if (IS_SDIO()) { + if (!sdio_cmd52_set_high_speed()) { + return false; + } + } + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (sd_mmc_card->version > CARD_VER_SD_1_0) { + if (!sd_cm6_set_high_speed()) { + return false; + } + } + } + /* Valid new configuration */ + sd_mmc_configure_slot(); + } + /* SD MEMORY, Set default block size */ + if (sd_mmc_card->type & CARD_TYPE_SD) { + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD16_SET_BLOCKLEN, SD_MMC_BLOCK_SIZE)) { + return false; + } + } + return true; +} + +#if CONF_MMC_SUPPORT +/** + * \brief Initialize the MMC card in MCI mode. + * + * \note + * This function runs the initialization procedure and the identification + * process, then it sets the SD/MMC card in transfer state. + * At last, it will automaticly enable maximum bus width and transfer speed. + * + * \return true if success, otherwise false + */ +static bool sd_mmc_mci_install_mmc(void) +{ + uint8_t b_authorize_high_speed; + + /* CMD0 - Reset all cards to idle state. */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_MCI_CMD0_GO_IDLE_STATE, 0)) { + return false; + } + + if (!mmc_mci_op_cond()) { + return false; + } + + /* Put the Card in Identify Mode + * Note: The CID is not used in this stack*/ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD2_ALL_SEND_CID, 0)) { + return false; + } + /* Assign relative address to the card.*/ + sd_mmc_card->rca = 1; + if (!driver_send_cmd(sd_mmc_hal, MMC_CMD3_SET_RELATIVE_ADDR, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + /* Get the Card-Specific Data */ + if (!sd_mmc_cmd9_mci()) { + return false; + } + mmc_decode_csd(); + /* Select the and put it into Transfer Mode */ + if (!driver_send_cmd(sd_mmc_hal, SDMMC_CMD7_SELECT_CARD_CMD, (uint32_t)sd_mmc_card->rca << 16)) { + return false; + } + if (sd_mmc_card->version >= CARD_VER_MMC_4) { + /* For MMC 4.0 Higher version + * Get EXT_CSD */ + if (!mmc_cmd8(&b_authorize_high_speed)) { + return false; + } + if (4 <= driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel)) { + /* Enable more bus width */ + if (!mmc_cmd6_set_bus_width(driver_get_bus_width(sd_mmc_hal, sd_mmc_slot_sel))) { + return false; + } + /* Reinitialize the slot with the bus width */ + sd_mmc_configure_slot(); + } + if (driver_is_high_speed_capable(sd_mmc_hal) && b_authorize_high_speed) { + /* Enable HS */ + if (!mmc_cmd6_set_high_speed()) { + return false; + } + /* Reinitialize the slot with the new speed */ + sd_mmc_configure_slot(); + } + } else { + /* Reinitialize the slot with the new speed */ + sd_mmc_configure_slot(); + } + + uint8_t retry = 10; + while (retry--) { + /* Retry is a WORKAROUND for no compliance card (Atmel Internal ref. MMC19): + * These cards seem not ready immediatly + * after the end of busy of mmc_cmd6_set_high_speed()*/ + + /* Set default block size */ + if (driver_send_cmd(sd_mmc_hal, SDMMC_CMD16_SET_BLOCKLEN, SD_MMC_BLOCK_SIZE)) { + return true; + } + } + return false; +} +#endif + +/*--------------------- PUBLIC FUNCTIONS ----------------------------*/ + +void sd_mmc_init(void *hal, sd_mmc_detect_t *card_detects, sd_mmc_detect_t *wp_detects) +{ + /* GPIO will be used to detect card and write protect. + * The related clocks and pinmux must be configurated in good + * condition. */ + + for (uint8_t slot = 0; slot < CONF_SD_MMC_MEM_CNT; slot++) { + sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_NO_CARD; + } + sd_mmc_slot_sel = 0xFF; /* No slot configurated */ + sd_mmc_hal = hal; + _cd = card_detects; + _wp = wp_detects; +} + +uint8_t sd_mmc_nb_slot(void) +{ + return CONF_SD_MMC_MEM_CNT; +} + +sd_mmc_err_t sd_mmc_check(uint8_t slot) +{ + sd_mmc_err_t sd_mmc_err; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_INIT_ONGOING) { + sd_mmc_deselect_slot(); + return sd_mmc_err; + } + + /* Initialization of the card requested */ + if (sd_mmc_mci_card_init()) { + sd_mmc_card->state = SD_MMC_CARD_STATE_READY; + sd_mmc_deselect_slot(); + /* To notify that the card has been just initialized + * It is necessary for USB Device MSC */ + return SD_MMC_INIT_ONGOING; + } + sd_mmc_card->state = SD_MMC_CARD_STATE_UNUSABLE; + sd_mmc_deselect_slot(); + return SD_MMC_ERR_UNUSABLE; +} + +card_type_t sd_mmc_get_type(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return CARD_TYPE_UNKNOWN; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->type; +} + +card_version_t sd_mmc_get_version(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return CARD_VER_UNKNOWN; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->version; +} + +uint32_t sd_mmc_get_capacity(uint8_t slot) +{ + if (SD_MMC_OK != sd_mmc_select_slot(slot)) { + return 0; + } + sd_mmc_deselect_slot(); + return sd_mmc_card->capacity; +} + +bool sd_mmc_is_write_protected(uint8_t slot) +{ + /* No detection, always writable */ + if (!_wp || _wp[slot].pin == -1) { + return false; + } + /* Write Protect Detect */ + if (gpio_get_pin_level(_wp[slot].pin) == _wp[slot].val) { + return true; + } + return false; +} + +sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block) +{ + sd_mmc_err_t sd_mmc_err; + uint32_t cmd, arg, resp; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + /* Wait for data ready status */ + if (!sd_mmc_cmd13()) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + if (nb_block > 1) { + cmd = SDMMC_CMD18_READ_MULTIPLE_BLOCK; + } else { + cmd = SDMMC_CMD17_READ_SINGLE_BLOCK; + } + /* + * SDSC Card (CCS=0) uses byte unit address, + * SDHC and SDXC Cards (CCS=1) use block unit address (512 Bytes unit). + */ + if (sd_mmc_card->type & CARD_TYPE_HC) { + arg = start; + } else { + arg = (start * SD_MMC_BLOCK_SIZE); + } + + if (!driver_adtc_start(sd_mmc_hal, cmd, arg, SD_MMC_BLOCK_SIZE, nb_block, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + /* Check response */ + resp = driver_get_response(sd_mmc_hal); + if (resp & CARD_STATUS_ERR_RD_WR) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_nb_block_remaining = nb_block; + sd_mmc_nb_block_to_tranfer = nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block) +{ + ASSERT(sd_mmc_nb_block_remaining >= nb_block); + + if (!driver_start_read_blocks(sd_mmc_hal, dest, nb_block)) { + sd_mmc_nb_block_remaining = 0; + return SD_MMC_ERR_COMM; + } + sd_mmc_nb_block_remaining -= nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort) +{ + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + return SD_MMC_ERR_COMM; + } + if (abort) { + sd_mmc_nb_block_remaining = 0; + } else if (sd_mmc_nb_block_remaining) { + return SD_MMC_OK; + } + + /* All blocks are transfered then stop read operation */ + if (sd_mmc_nb_block_to_tranfer == 1) { + /* Single block transfer, then nothing to do */ + sd_mmc_deselect_slot(); + return SD_MMC_OK; + } + /* WORKAROUND for no compliance card (Atmel Internal ref. !MMC7 !SD19): + * The errors on this command must be ignored + * and one retry can be necessary in SPI mode for no compliance card.*/ + if (!driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0)) { + driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0); + } + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block) +{ + sd_mmc_err_t sd_mmc_err; + uint32_t cmd, arg, resp; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + if (sd_mmc_is_write_protected(slot)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_WP; + } + + if (nb_block > 1) { + cmd = SDMMC_CMD25_WRITE_MULTIPLE_BLOCK; + } else { + cmd = SDMMC_CMD24_WRITE_BLOCK; + } + /* + * SDSC Card (CCS=0) uses byte unit address, + * SDHC and SDXC Cards (CCS=1) use block unit address (512 Bytes unit). + */ + if (sd_mmc_card->type & CARD_TYPE_HC) { + arg = start; + } else { + arg = (start * SD_MMC_BLOCK_SIZE); + } + if (!driver_adtc_start(sd_mmc_hal, cmd, arg, SD_MMC_BLOCK_SIZE, nb_block, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + /* Check response */ + resp = driver_get_response(sd_mmc_hal); + if (resp & CARD_STATUS_ERR_RD_WR) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_nb_block_remaining = nb_block; + sd_mmc_nb_block_to_tranfer = nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block) +{ + ASSERT(sd_mmc_nb_block_remaining >= nb_block); + if (!driver_start_write_blocks(sd_mmc_hal, src, nb_block)) { + sd_mmc_nb_block_remaining = 0; + return SD_MMC_ERR_COMM; + } + sd_mmc_nb_block_remaining -= nb_block; + return SD_MMC_OK; +} + +sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort) +{ + if (!driver_wait_end_of_write_blocks(sd_mmc_hal)) { + return SD_MMC_ERR_COMM; + } + if (abort) { + sd_mmc_nb_block_remaining = 0; + } else if (sd_mmc_nb_block_remaining) { + return SD_MMC_OK; + } + + /* All blocks are transfered then stop write operation */ + if (sd_mmc_nb_block_to_tranfer == 1) { + /* Single block transfer, then nothing to do */ + sd_mmc_deselect_slot(); + return SD_MMC_OK; + } + + /* Note: SPI multiblock writes terminate using a special + * token, not a STOP_TRANSMISSION request.*/ + if (!driver_adtc_stop(sd_mmc_hal, SDMMC_CMD12_STOP_TRANSMISSION, 0)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +#if (CONF_SDIO_SUPPORT == 1) +sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t *dest) +{ + sd_mmc_err_t sd_mmc_err; + + if (dest == NULL) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd52(SDIO_CMD52_READ_FLAG, func_num, addr, 0, dest)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t data) +{ + sd_mmc_err_t sd_mmc_err; + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd52(SDIO_CMD52_WRITE_FLAG, func_num, addr, 0, &data)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *dest, + uint16_t size) +{ + sd_mmc_err_t sd_mmc_err; + + if ((size == 0) || (size > 512)) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd53(SDIO_CMD53_READ_FLAG, func_num, addr, inc_addr, size, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_start_read_blocks(sd_mmc_hal, dest, 1)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_wait_end_of_read_blocks(sd_mmc_hal)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} + +sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *src, + uint16_t size) +{ + sd_mmc_err_t sd_mmc_err; + + if ((size == 0) || (size > 512)) { + return SD_MMC_ERR_PARAM; + } + + sd_mmc_err = sd_mmc_select_slot(slot); + if (sd_mmc_err != SD_MMC_OK) { + return sd_mmc_err; + } + + if (!sdio_cmd53(SDIO_CMD53_WRITE_FLAG, func_num, addr, inc_addr, size, true)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_start_write_blocks(sd_mmc_hal, src, 1)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + if (!driver_wait_end_of_write_blocks(sd_mmc_hal)) { + sd_mmc_deselect_slot(); + return SD_MMC_ERR_COMM; + } + + sd_mmc_deselect_slot(); + return SD_MMC_OK; +} +#endif + +/** @} */ diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.h b/ports/atmel-samd/sd_mmc/sd_mmc.h new file mode 100644 index 0000000000..1437e5efd5 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc.h @@ -0,0 +1,310 @@ +/** + * \file + * + * \brief Common SD/MMC stack header file + * + * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#ifndef SD_MMC_H_INCLUDED +#define SD_MMC_H_INCLUDED + +#include "compiler.h" +#include "conf_sd_mmc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup common_memory + * \defgroup sd_mmc_stack_group SD/MMC/SDIO common stack + * + * SD/MMC/SDIO basic APIs used by SD/MMC/SDIO memory + * APIs (\ref sd_mmc_stack_mem_group). + * Also, it can be used by application which use the SDIO card + * or specific application which does not need of File System. + * + * For usual application which use the SD/MMC card in + * memory mode with a file system, please refer to + * \ref sd_mmc_stack_mem_group. + * @{ + */ + +typedef uint8_t sd_mmc_err_t; /**< Type of return error code */ + +/** \name Return error codes */ +/** @{ */ +#define SD_MMC_OK 0 /**< No error */ +#define SD_MMC_INIT_ONGOING 1 /**< Card not initialized */ +#define SD_MMC_ERR_NO_CARD 2 /**< No SD/MMC card inserted */ +#define SD_MMC_ERR_UNUSABLE 3 /**< Unusable card */ +#define SD_MMC_ERR_SLOT 4 /**< Slot unknow */ +#define SD_MMC_ERR_COMM 5 /**< General communication error */ +#define SD_MMC_ERR_PARAM 6 /**< Illeage input parameter */ +#define SD_MMC_ERR_WP 7 /**< Card write protected */ +/** @} */ + +typedef uint8_t card_type_t; /**< Type of card type */ + +/** \name Card Types */ +/** @{ */ +#define CARD_TYPE_UNKNOWN (0) /**< Unknown type card */ +#define CARD_TYPE_SD (1 << 0) /**< SD card */ +#define CARD_TYPE_MMC (1 << 1) /**< MMC card */ +#define CARD_TYPE_SDIO (1 << 2) /**< SDIO card */ +#define CARD_TYPE_HC (1 << 3) /**< High capacity card */ +/** SD combo card (io + memory) */ +#define CARD_TYPE_SD_COMBO (CARD_TYPE_SD | CARD_TYPE_SDIO) +/** @} */ + +typedef uint8_t card_version_t; /**< Type of card version */ + +/** \name Card Versions */ +/** @{ */ +#define CARD_VER_UNKNOWN (0) /**< Unknown card version */ +#define CARD_VER_SD_1_0 (0x10) /**< SD version 1.0 and 1.01 */ +#define CARD_VER_SD_1_10 (0x1A) /**< SD version 1.10 */ +#define CARD_VER_SD_2_0 (0X20) /**< SD version 2.00 */ +#define CARD_VER_SD_3_0 (0X30) /**< SD version 3.0X */ +#define CARD_VER_MMC_1_2 (0x12) /**< MMC version 1.2 */ +#define CARD_VER_MMC_1_4 (0x14) /**< MMC version 1.4 */ +#define CARD_VER_MMC_2_2 (0x22) /**< MMC version 2.2 */ +#define CARD_VER_MMC_3 (0x30) /**< MMC version 3 */ +#define CARD_VER_MMC_4 (0x40) /**< MMC version 4 */ +/** @} */ + +/** Card detect setting */ +typedef struct sd_mmc_detect { + int16_t pin; /**< Detection pin, -1 if no such pin */ + uint16_t val; /**< Detection value */ +} sd_mmc_detect_t; + +/** This SD MMC stack uses the maximum block size autorized (512 bytes) */ +#define SD_MMC_BLOCK_SIZE 512 + +/** + * \brief Initialize the SD/MMC stack and low level driver required + * \param[in] hal Pointer to HAL instance + * \param[in] card_detects Pointer to list of card detect settings, + * list size should be \ref CONF_SD_MMC_MEM_CNT + * \param[in] wp_detects Pointer to list of write protect detect settings + * list size should be \ref CONF_SD_MMC_MEM_CNT + */ +void sd_mmc_init(void *hal, sd_mmc_detect_t *card_detects, sd_mmc_detect_t *wp_detects); + +/** \brief Return the number of slot available + * + * \return Number of card slot available + */ +uint8_t sd_mmc_nb_slot(void); + +/** \brief Performs a card checks + * + * \param[in] slot Card slot to use + * + * \retval SD_MMC_OK Card ready + * \retval SD_MMC_INIT_ONGOING Initialization on going + * \retval SD_MMC_ERR_NO_CARD Card not present in slot + * \retval Other value for error cases, see \ref sd_mmc_err_t + */ +sd_mmc_err_t sd_mmc_check(uint8_t slot); + +/** \brief Get the card type + * + * \param[in] slot Card slot + * + * \return Card type (\ref card_type_t) + */ +card_type_t sd_mmc_get_type(uint8_t slot); + +/** \brief Get the card version + * + * \param[in] slot Card slot + * + * \return Card version (\ref card_version_t) + */ +card_version_t sd_mmc_get_version(uint8_t slot); + +/** \brief Get the memory capacity + * + * \param[in] slot Card slot + * + * \return Capacity (unit KB) + */ +uint32_t sd_mmc_get_capacity(uint8_t slot); + +/** \brief Get the card write protection status + * + * \param[in] slot Card slot + * + * \return true, if write portected + */ +bool sd_mmc_is_write_protected(uint8_t slot); + +/** + * \brief Initialize the read blocks of data from the card. + * + * \param[in] slot Card slot to use + * \param[in] start Start block number to to read. + * \param[in] nb_block Total number of blocks to be read. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block); + +/** + * \brief Start the read blocks of data from the card. + * + * \param[out] dest Pointer to read buffer. + * \param[in] nb_block Number of blocks to be read. + * + * \return return SD_MMC_OK if started, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block); + +/** + * \brief Wait the end of read blocks of data from the card. + * + * \param[in] abort Abort reading process initialized by + * \ref sd_mmc_init_read_blocks() after the reading issued by + * \ref sd_mmc_start_read_blocks() is done + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort); + +/** + * \brief Initialize the write blocks of data + * + * \param[in] slot Card slot to use + * \param[in] start Start block number to be written. + * \param[in] nb_block Total number of blocks to be written. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block); + +/** + * \brief Start the write blocks of data + * + * \param[in] src Pointer to write buffer. + * \param[in] nb_block Number of blocks to be written. + * + * \return return SD_MMC_OK if started, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block); + +/** + * \brief Wait the end of write blocks of data + * + * \param[in] abort Abort writing process initialized by + * \ref sd_mmc_init_write_blocks() after the writing issued by + * \ref sd_mmc_start_write_blocks() is done + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort); + +#if (CONF_SDIO_SUPPORT == 1) +/** + * \brief Read one byte from SDIO using RW_DIRECT command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr Register address to read from. + * \param[out] dest Pointer to read buffer. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t *dest); +/** + * \brief Write one byte to SDIO using RW_DIRECT command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr Register address to read from. + * \param[in] data Data to be written. + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t data); + +/** + * \brief Read bytes from SDIO using RW_EXTENDED command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr First register address to read from. + * \param[in] inc_addr 0 - The data address is fixed. + * 1 - The data address increase automatically. + * \param[out] dest Pointer to read buffer. + * \param[in] size Number of bytes to read (1 ~ 512). + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *dest, + uint16_t size); + +/** + * \brief Write bytes to SDIO using RW_EXTENDED command. + * + * \param[in] slot Card slot to use + * \param[in] func_num Function number. + * \param[in] addr First register address to write to. + * \param[in] inc_addr 0 - The data address is fixed. + * 1 - The data address increase automatically. + * \param[in] src Pointer to write buffer. + * \param[in] size Number of bytes to read (1 ~ 512). + * + * \return return SD_MMC_OK if success, + * otherwise return an error code (\ref sd_mmc_err_t). + */ +sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *src, + uint16_t size); +#endif /* SDIO_SUPPORT_ENABLE */ + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* SD_MMC_H_INCLUDED */ diff --git a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h new file mode 100644 index 0000000000..0516e4fd10 --- /dev/null +++ b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h @@ -0,0 +1,1001 @@ +/** + * \file + * + * \brief SD/MMC protocol definitions. + * + * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. + * + * \asf_license_start + * + * \page License + * + * Subject to your compliance with these terms, you may use Microchip + * software and any derivatives exclusively with Microchip products. + * It is your responsibility to comply with third party license terms applicable + * to your use of third party software (including open source software) that + * may accompany Microchip software. + * + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE + * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL + * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE + * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE + * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT + * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY + * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, + * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Microchip Support + */ + +#ifndef SD_MMC_PROTOCOL_H_INCLUDED +#define SD_MMC_PROTOCOL_H_INCLUDED + +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \addtogroup sd_mmc_protocol SD/MMC Protocol Definition + * \ingroup sd_mmc_stack_group + * @{ + */ + +// SD/MMC/SDIO default clock frequency for initialization (400KHz) +#define SDMMC_CLOCK_INIT 400000 + +/** + * \name Macros for command definition + * + * Commands types: + * - broadcast commands (bc), no response + * - broadcast commands with response (bcr) (Note: No open drain on SD card) + * - addressed (point-to-point) commands (ac), no data transfer on DAT lines + * - addressed (point-to-point) data transfer commands (adtc), data transfer + * on DAT lines + * + * Specific MMC norms: + * CMD1, CMD2 & CMD3 are processed in the open-drain mode. + * The CMD line is driven with push-pull drivers. + * + * Specific SD norms: + * There is no open drain mode in SD memory card. + * + *************************************** + * Responses types: + * + * R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum + * - R1 receiv data not specified + * - R3 receiv OCR + * - R4, R5 RCA management (MMC only) + * - R6, R7 RCA management (SD only) + * + * R1b assert the BUSY signal and respond with R1. + * If the busy signal is asserted, it is done two clock cycles (Nsr time) + * after the end bit of the command. The DAT0 line is driven low. + * DAT1-DAT7 lines are driven by the card though their values are not relevant. + * + * R2 use a 136 bits response protected by a 7bit CRC checksum + * The content is CID or CSD + * + * Specific MMC norms: + * - R4 (Fast I/O) return RCA + * - R5 (interrupt request) return RCA null + * + * Specific SD norms: + * - R6 (Published RCA) return RCA + * - R7 (Card interface condition) return RCA null + * + * @{ + */ + +//! Value to define a SD/MMC/SDIO command +typedef uint32_t sdmmc_cmd_def_t; + +//! \name Flags used to define a SD/MMC/SDIO command +//! @{ +#define SDMMC_CMD_GET_INDEX(cmd) (cmd & 0x3F) +//! Have response (MCI only) +#define SDMMC_RESP_PRESENT (1lu << 8) +//! 8 bit response (SPI only) +#define SDMMC_RESP_8 (1lu << 9) +//! 32 bit response (SPI only) +#define SDMMC_RESP_32 (1lu << 10) +//! 136 bit response (MCI only) +#define SDMMC_RESP_136 (1lu << 11) +//! Expect valid crc (MCI only) +#define SDMMC_RESP_CRC (1lu << 12) +//! Card may send busy +#define SDMMC_RESP_BUSY (1lu << 13) +// Open drain for a braodcast command (bc) +// or to enter in inactive state (MCI only) +#define SDMMC_CMD_OPENDRAIN (1lu << 14) +//! To signal a data write operation +#define SDMMC_CMD_WRITE (1lu << 15) +//! To signal a SDIO tranfer in multi byte mode +#define SDMMC_CMD_SDIO_BYTE (1lu << 16) +//! To signal a SDIO tranfer in block mode +#define SDMMC_CMD_SDIO_BLOCK (1lu << 17) +//! To signal a data transfer in stream mode +#define SDMMC_CMD_STREAM (1lu << 18) +//! To signal a data transfer in single block mode +#define SDMMC_CMD_SINGLE_BLOCK (1lu << 19) +//! To signal a data transfer in multi block mode +#define SDMMC_CMD_MULTI_BLOCK (1lu << 20) +//! @} + +//! \name Set of flags to define a reponse type +//! @{ +#define SDMMC_CMD_NO_RESP (0) +#define SDMMC_CMD_R1 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) +#define SDMMC_CMD_R1B (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC | SDMMC_RESP_BUSY) +#define SDMMC_CMD_R2 (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_136 | SDMMC_RESP_CRC) +#define SDMMC_CMD_R3 (SDMMC_RESP_PRESENT | SDMMC_RESP_32) +#define SDMMC_CMD_R4 (SDMMC_RESP_PRESENT | SDMMC_RESP_32) +#define SDMMC_CMD_R5 (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_CRC) +#define SDMMC_CMD_R6 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) +#define SDMMC_CMD_R7 (SDMMC_RESP_PRESENT | SDMMC_RESP_32 | SDMMC_RESP_CRC) +//! @} + +//! \name SD/MMC/SDIO command definitions +//! SDMMC_CMDx are include in SD and MMC norms +//! MMC_CMDx are include in MMC norms only +//! SD_CMDx are include in SD norms only +//! SDIO_CMDx are include in SDIO norms only +//! @{ + +/* + * --- Basic commands and read-stream command (class 0 and class 1) --- + */ + +/** Cmd0(bc): Reset all cards to idle state */ +#define SDMMC_SPI_CMD0_GO_IDLE_STATE (0 | SDMMC_CMD_R1) +#define SDMMC_MCI_CMD0_GO_IDLE_STATE (0 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd1(bcr, R3): Ask the card to send its Operating Conditions */ +#define MMC_SPI_CMD1_SEND_OP_COND (1 | SDMMC_CMD_R1) +#define MMC_MCI_CMD1_SEND_OP_COND (1 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) +/** Cmd2(bcr, R2): Ask the card to send its CID number (stuff but arg 0 used) */ +#define SDMMC_CMD2_ALL_SEND_CID (2 | SDMMC_CMD_R2 | SDMMC_CMD_OPENDRAIN) +/** SD Cmd3(bcr, R6): Ask the card to publish a new relative address (RCA) */ +#define SD_CMD3_SEND_RELATIVE_ADDR (3 | SDMMC_CMD_R6 | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd3(ac, R1): Assigns relative address to the card */ +#define MMC_CMD3_SET_RELATIVE_ADDR (3 | SDMMC_CMD_R1) +/** Cmd4(bc): Program the DSR of all cards (MCI only) */ +#define SDMMC_CMD4_SET_DSR (4 | SDMMC_CMD_NO_RESP) +/** MMC Cmd5(ac, R1b): Toggle the card between Sleep state and Standby state. */ +#define MMC_CMD5_SLEEP_AWAKE (5 | SDMMC_CMD_R1B) +/** Cmd7(ac, R1/R1b): Select/Deselect card + * For SD: R1b only from the selected card. + * For MMC: R1 while selecting from Stand-By State to Transfer State; + * R1b while selecting from Disconnected State to Programming State. + */ +#define SDMMC_CMD7_SELECT_CARD_CMD (7 | SDMMC_CMD_R1B) +#define SDMMC_CMD7_DESELECT_CARD_CMD (7 | SDMMC_CMD_R1) +/** MMC Cmd8(adtc, R1): Send EXT_CSD register as a block of data */ +#define MMC_CMD8_SEND_EXT_CSD (8 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** SD Cmd8(bcr, R7) : Send SD Memory Card interface condition */ +#define SD_CMD8_SEND_IF_COND (8 | SDMMC_CMD_R7 | SDMMC_CMD_OPENDRAIN) +/** Cmd9 SPI (R1): Addressed card sends its card-specific data (CSD) */ +#define SDMMC_SPI_CMD9_SEND_CSD (9 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd9 MCI (ac, R2): Addressed card sends its card-specific data (CSD) */ +#define SDMMC_MCI_CMD9_SEND_CSD (9 | SDMMC_CMD_R2) +/** Cmd10(ac, R2): Addressed card sends its card identification (CID) */ +#define SDMMC_CMD10_SEND_CID (10 | SDMMC_CMD_R2) +/** + * MMC Cmd11(adtc, R1): Read data stream from the card, starting at the given + * address, until a STOP_TRANSMISSION follows. + */ +#define MMC_CMD11_READ_DAT_UNTIL_STOP (11 | SDMMC_CMD_R1) +/* SD Cmd11 MCI (ac, R1): Voltage switching */ +#define SD_CMD11_READ_DAT_UNTIL_STOP (11 | SDMMC_CMD_R1) +/** Cmd12(ac, R1b): Force the card to stop transmission */ +#define SDMMC_CMD12_STOP_TRANSMISSION (12 | SDMMC_CMD_R1B) +/** Cmd13(R2): Addressed card sends its status register. */ +#define SDMMC_SPI_CMD13_SEND_STATUS (13 | SDMMC_CMD_R2) +/** Cmd13(ac, R1): Addressed card sends its status register. */ +#define SDMMC_MCI_CMD13_SEND_STATUS (13 | SDMMC_CMD_R1) +/** MMC Cmd14(adtc, R1): Read the reversed bus testing data pattern from a card. */ +#define MMC_CMD14_BUSTEST_R (14 | SDMMC_CMD_R1) +/** Cmd15(ac): Send an addressed card into the Inactive State. */ +// Note: It is a ac cmd, but it must be send like bc cmd to open drain +#define SDMMC_CMD15_GO_INACTIVE_STATE (15 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN) +/** MMC Cmd19(adtc, R1): Send the bus test data pattern */ +#define MMC_CMD19_BUSTEST_W (19 | SDMMC_CMD_R1) +/** Cmd58(R3): Reads the OCR register of a card */ +#define SDMMC_SPI_CMD58_READ_OCR (58 | SDMMC_CMD_R3) +/** Cmd59(R1): Turns the CRC option on or off */ +#define SDMMC_SPI_CMD59_CRC_ON_OFF (59 | SDMMC_CMD_R1) + +/* + * --- Block-oriented read commands (class 2) --- + */ +/** Cmd16(ac, R1): Set the block length (in bytes) */ +#define SDMMC_CMD16_SET_BLOCKLEN (16 | SDMMC_CMD_R1) +/** Cmd17(adtc, R1): Read single block */ +#define SDMMC_CMD17_READ_SINGLE_BLOCK (17 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd18(adtc, R1): Read multiple block */ +#define SDMMC_CMD18_READ_MULTIPLE_BLOCK (18 | SDMMC_CMD_R1 | SDMMC_CMD_MULTI_BLOCK) + +/* + * --- Sequential write commands (class 3) --- + */ + +/** + * MMC Cmd20(adtc, R1): Write a data stream from the host, starting at the + * given address, until a STOP_TRANSMISSION follows. + */ +#define MMC_CMD20_WRITE_DAT_UNTIL_STOP (20 | SDMMC_CMD_R1) + +/* + * --- Block-oriented write commands (class 4) --- + */ +/** MMC Cmd23(ac, R1): Set block count */ +#define MMC_CMD23_SET_BLOCK_COUNT (23 | SDMMC_CMD_R1) +/** Cmd24(adtc, R1): Write block */ +#define SDMMC_CMD24_WRITE_BLOCK (24 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_SINGLE_BLOCK) +/** Cmd25(adtc, R1): Write multiple block */ +#define SDMMC_CMD25_WRITE_MULTIPLE_BLOCK (25 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_MULTI_BLOCK) +/** MMC Cmd26(adtc, R1): Programming of the card identification register. */ +#define MMC_CMD26_PROGRAM_CID (26 | SDMMC_CMD_R1) +/** Cmd27(adtc, R1): Programming of the programmable bits of the CSD. */ +#define SDMMC_CMD27_PROGRAM_CSD (27 | SDMMC_CMD_R1) + +/* + * --- Erase commands (class 5) --- + */ +/** SD Cmd32(ac, R1): */ +#define SD_CMD32_ERASE_WR_BLK_START (32 | SDMMC_CMD_R1) +/** SD Cmd33(ac, R1): */ +#define SD_CMD33_ERASE_WR_BLK_END (33 | SDMMC_CMD_R1) +/** MMC Cmd35(ac, R1): */ +#define MMC_CMD35_ERASE_GROUP_START (35 | SDMMC_CMD_R1) +/** MMC Cmd36(ac, R1): */ +#define MMC_CMD36_ERASE_GROUP_END (36 | SDMMC_CMD_R1) +/** Cmd38(ac, R1B): */ +#define SDMMC_CMD38_ERASE (38 | SDMMC_CMD_R1B) + +/* + * --- Block Oriented Write Protection Commands (class 6) --- + */ +/** Cmd28(ac, R1b): Set write protection */ +#define SDMMC_CMD28_SET_WRITE_PROT (28 | SDMMC_CMD_R1B) +/** Cmd29(ac, R1b): Clr write protection */ +#define SDMMC_CMD29_CLR_WRITE_PROT (29 | SDMMC_CMD_R1B) +/** Cmd30(adtc, R1b): Send write protection */ +#define SDMMC_CMD30_SEND_WRITE_PROT (30 | SDMMC_CMD_R1) + +/* + * --- Lock Card (class 7) --- + */ +/** Cmd42(adtc, R1): Used to set/reset the password or lock/unlock the card. */ +#define SDMMC_CMD42_LOCK_UNLOCK (42 | SDMMC_CMD_R1) + +/* + * --- Application-specific commands (class 8) --- + */ +/** + * Cmd55(ac, R1): Indicate to the card that the next command is an application + * specific command rather than a standard command. + */ +#define SDMMC_CMD55_APP_CMD (55 | SDMMC_CMD_R1) +/** + * Cmd 56(adtc, R1): Used either to transfer a data block to the card or to get + * a data block from the card for general purpose/application specific commands. + */ +#define SDMMC_CMD56_GEN_CMD (56 | SDMMC_CMD_R1) + +/** + * MMC Cmd6(ac, R1b) : Switche the mode of operation of the selected card + * or modifies the EXT_CSD registers. + */ +#define MMC_CMD6_SWITCH (6 | SDMMC_CMD_R1B) +/** + * SD Cmd6(adtc, R1) : Check switchable function (mode 0) + * and switch card function (mode 1). + */ +#define SD_CMD6_SWITCH_FUNC (6 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) +/** ACMD6(ac, R1): Define the data bus width */ +#define SD_ACMD6_SET_BUS_WIDTH (6 | SDMMC_CMD_R1) +/** ACMD13(adtc, R1): Send the SD Status. */ +#define SD_ACMD13_SD_STATUS (13 | SDMMC_CMD_R1) +/** + * ACMD22(adtc, R1): Send the number of the written (with-out errors) write + * blocks. + */ +#define SD_ACMD22_SEND_NUM_WR_BLOCKS (22 | SDMMC_CMD_R1) +/** + * ACMD23(ac, R1): Set the number of write blocks to be pre-erased before + * writing + */ +#define SD_ACMD23_SET_WR_BLK_ERASE_COUNT (23 | SDMMC_CMD_R1) +/** + * ACMD41(bcr, R3): Send host capacity support information (HCS) and asks the + * accessed card to send its operating condition register (OCR) content + * in the response + */ +#define SD_MCI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) +/** + * ACMD41(R1): Send host capacity support information (HCS) and activates the + * card's initilization process + */ +#define SD_SPI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R1) +/** + * ACMD42(ac, R1): Connect[1]/Disconnect[0] the 50 KOhm pull-up resistor on + * CD/DAT3 (pin 1) of the card. + */ +#define SD_ACMD42_SET_CLR_CARD_DETECT (42 | SDMMC_CMD_R1) +/** ACMD51(adtc, R1): Read the SD Configuration Register (SCR). */ +#define SD_ACMD51_SEND_SCR (51 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK) + +/* + * --- I/O mode commands (class 9) --- + */ +/** MMC Cmd39(ac, R4): Used to write and read 8 bit (register) data fields. */ +#define MMC_CMD39_FAST_IO (39 | SDMMC_CMD_R4) +/** MMC Cmd40(bcr, R5): Set the system into interrupt mode */ +#define MMC_CMD40_GO_IRQ_STATE (40 | SDMMC_CMD_R5 | SDMMC_CMD_OPENDRAIN) +/** SDIO Cmd5(R4): Send operation condition */ +#define SDIO_CMD5_SEND_OP_COND (5 | SDMMC_CMD_R4 | SDMMC_CMD_OPENDRAIN) +/** SDIO CMD52(R5): Direct IO read/write */ +#define SDIO_CMD52_IO_RW_DIRECT (52 | SDMMC_CMD_R5) +/** SDIO CMD53(R5): Extended IO read/write */ +#define SDIO_CMD53_IO_R_BYTE_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE) +#define SDIO_CMD53_IO_W_BYTE_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE | SDMMC_CMD_WRITE) +#define SDIO_CMD53_IO_R_BLOCK_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK) +#define SDIO_CMD53_IO_W_BLOCK_EXTENDED (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK | SDMMC_CMD_WRITE) +//! @} +//! @} + +//! \name Macros for command argument definition +//! @{ + +//! \name MMC CMD6 argument structure +//! @{ +//! [31:26] Set to 0 +//! [25:24] Access +#define MMC_CMD6_ACCESS_COMMAND_SET (0lu << 24) +#define MMC_CMD6_ACCESS_SET_BITS (1lu << 24) +#define MMC_CMD6_ACCESS_CLEAR_BITS (2lu << 24) +#define MMC_CMD6_ACCESS_WRITE_BYTE (3lu << 24) +//! [23:16] Index for Mode Segment +#define MMC_CMD6_INDEX_CMD_SET (EXT_CSD_CMD_SET_INDEX << 16) +#define MMC_CMD6_INDEX_CMD_SET_REV (EXT_CSD_CMD_SET_REV_INDEX << 16) +#define MMC_CMD6_INDEX_POWER_CLASS (EXT_CSD_POWER_CLASS_INDEX << 16) +#define MMC_CMD6_INDEX_HS_TIMING (EXT_CSD_HS_TIMING_INDEX << 16) +#define MMC_CMD6_INDEX_BUS_WIDTH (EXT_CSD_BUS_WIDTH_INDEX << 16) +#define MMC_CMD6_INDEX_ERASED_MEM_CONT (EXT_CSD_ERASED_MEM_CONT_INDEX << 16) +#define MMC_CMD6_INDEX_BOOT_CONFIG (EXT_CSD_BOOT_CONFIG_INDEX << 16) +#define MMC_CMD6_INDEX_BOOT_BUS_WIDTH (EXT_CSD_BOOT_BUS_WIDTH_INDEX << 16) +#define MMC_CMD6_INDEX_ERASE_GROUP_DEF (EXT_CSD_ERASE_GROUP_DEF_INDEX << 16) +//! [15:8] Value +#define MMC_CMD6_VALUE_BUS_WIDTH_1BIT (0x0lu << 8) +#define MMC_CMD6_VALUE_BUS_WIDTH_4BIT (0x1lu << 8) +#define MMC_CMD6_VALUE_BUS_WIDTH_8BIT (0x2lu << 8) +#define MMC_CMD6_VALUE_HS_TIMING_ENABLE (0x1lu << 8) +#define MMC_CMD6_VALUE_HS_TIMING_DISABLE (0x0lu << 8) +//! [7:3] Set to 0 +//! [2:0] Cmd Set +//! @} + +//! \name SD CMD6 argument structure +//! @{ +//! CMD6 arg[ 3: 0] function group 1, access mode +#define SD_CMD6_GRP1_HIGH_SPEED (0x1lu << 0) +#define SD_CMD6_GRP1_DEFAULT (0x0lu << 0) +//! CMD6 arg[ 7: 4] function group 2, command system +#define SD_CMD6_GRP2_NO_INFLUENCE (0xFlu << 4) +#define SD_CMD6_GRP2_DEFAULT (0x0lu << 4) +//! CMD6 arg[11: 8] function group 3, 0xF or 0x0 +#define SD_CMD6_GRP3_NO_INFLUENCE (0xFlu << 8) +#define SD_CMD6_GRP3_DEFAULT (0x0lu << 8) +//! CMD6 arg[15:12] function group 4, 0xF or 0x0 +#define SD_CMD6_GRP4_NO_INFLUENCE (0xFlu << 12) +#define SD_CMD6_GRP4_DEFAULT (0x0lu << 12) +//! CMD6 arg[19:16] function group 5, 0xF or 0x0 +#define SD_CMD6_GRP5_NO_INFLUENCE (0xFlu << 16) +#define SD_CMD6_GRP5_DEFAULT (0x0lu << 16) +//! CMD6 arg[23:20] function group 6, 0xF or 0x0 +#define SD_CMD6_GRP6_NO_INFLUENCE (0xFlu << 20) +#define SD_CMD6_GRP6_DEFAULT (0x0lu << 20) +//! CMD6 arg[30:24] reserved 0 +//! CMD6 arg[31 ] Mode, 0: Check, 1: Switch +#define SD_CMD6_MODE_CHECK (0lu << 31) +#define SD_CMD6_MODE_SWITCH (1lu << 31) +//! @} + +//! \name SD CMD8 argument structure +//! @{ +#define SD_CMD8_PATTERN 0xAA +#define SD_CMD8_MASK_PATTERN 0xFF +#define SD_CMD8_HIGH_VOLTAGE 0x100 +#define SD_CMD8_MASK_VOLTAGE 0xF00 +//! @} + +//! \name SD ACMD41 arguments +//! @{ +#define SD_ACMD41_HCS (1lu << 30) //!< (SD) Host Capacity Support + //! @} +//! @} + +//! \name SDIO definitions +//! @{ + +//! \name SDIO state (in R5) +//! @{ +#define SDIO_R5_COM_CRC_ERROR (1lu << 15) /**< CRC check error */ +#define SDIO_R5_ILLEGAL_COMMAND (1lu << 14) /**< Illegal command */ +#define SDIO_R5_STATE (3lu << 12) /**< SDIO R5 state mask */ +#define SDIO_R5_STATE_DIS (0lu << 12) /**< Disabled */ +#define SDIO_R5_STATE_CMD (1lu << 12) /**< DAT lines free */ +#define SDIO_R5_STATE_TRN (2lu << 12) /**< Transfer */ +#define SDIO_R5_STATE_RFU (3lu << 12) /**< Reserved */ +#define SDIO_R5_ERROR (1lu << 11) /**< General error */ +#define SDIO_R5_FUNC_NUM (1lu << 9) /**< Invalid function number */ +#define SDIO_R5_OUT_OF_RANGE (1lu << 8) /**< Argument out of range */ +#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) //!< Errro status bits mask + //! @} + +//! \name SDIO state (in R6) +//! @{ +/** The CRC check of the previous command failed. */ +#define SDIO_R6_COM_CRC_ERROR (1lu << 15) +/** Command not legal for the card state. */ +#define SDIO_R6_ILLEGAL_COMMAND (1lu << 14) +/** A general or an unknown error occurred during the operation. */ +#define SDIO_R6_ERROR (1lu << 13) +/** Status bits mask for SDIO R6 */ +#define SDIO_STATUS_R6 (SDIO_R6_COM_CRC_ERROR | SDIO_R6_ILLEGAL_COMMAND | SDIO_R6_ERROR) +//! @} + +//! \name SDIO CMD52 argument bit offset +//! @{ +//! CMD52 arg[ 7: 0] Write data or stuff bits +#define SDIO_CMD52_WR_DATA 0 +//! CMD52 arg[ 8] Reserved +#define SDIO_CMD52_STUFF0 8 +//! CMD52 arg[25: 9] Register address +#define SDIO_CMD52_REG_ADRR 9 +//! CMD52 arg[ 26] Reserved +#define SDIO_CMD52_STUFF1 26 +//! CMD52 arg[ 27] Read after Write flag +#define SDIO_CMD52_RAW_FLAG 27 +//! CMD52 arg[30:28] Number of the function +#define SDIO_CMD52_FUNCTION_NUM 28 +//! CMD52 arg[ 31] Direction, 1:write, 0:read. +#define SDIO_CMD52_RW_FLAG 31 +#define SDIO_CMD52_READ_FLAG 0 +#define SDIO_CMD52_WRITE_FLAG 1 +//! @} + +//! \name SDIO CMD53 argument structure +//! @{ +/** + * [ 8: 0] Byte mode: number of bytes to transfer, + * 0 cause 512 bytes transfer. + * Block mode: number of blocks to transfer, + * 0 set count to infinite. + */ +#define SDIO_CMD53_COUNT 0 +//! CMD53 arg[25: 9] Start Address I/O register +#define SDIO_CMD53_REG_ADDR 9 +//! CMD53 arg[ 26] 1:Incrementing address, 0: fixed +#define SDIO_CMD53_OP_CODE 26 +//! CMD53 arg[ 27] (Optional) 1:block mode +#define SDIO_CMD53_BLOCK_MODE 27 +//! CMD53 arg[30:28] Number of the function +#define SDIO_CMD53_FUNCTION_NUM 28 +//! CMD53 arg[ 31] Direction, 1:WR, 0:RD +#define SDIO_CMD53_RW_FLAG 31 +#define SDIO_CMD53_READ_FLAG 0 +#define SDIO_CMD53_WRITE_FLAG 1 +//! @} + +//! \name SDIO Functions +//! @{ +#define SDIO_CIA 0 /**< SDIO Function 0 (CIA) */ +#define SDIO_FN0 0 /**< SDIO Function 0 */ +#define SDIO_FN1 1 /**< SDIO Function 1 */ +#define SDIO_FN2 2 /**< SDIO Function 2 */ +#define SDIO_FN3 3 /**< SDIO Function 3 */ +#define SDIO_FN4 4 /**< SDIO Function 4 */ +#define SDIO_FN5 5 /**< SDIO Function 5 */ +#define SDIO_FN6 6 /**< SDIO Function 6 */ +#define SDIO_FN7 7 /**< SDIO Function 7 */ + //! @} + +//! \name SDIO Card Common Control Registers (CCCR) +//! @{ +#define SDIO_CCCR_SDIO_REV 0x00 /**< CCCR/SDIO revision (RO) */ +#define SDIO_CCCR_REV (0xFlu << 0) /**< CCCR/FBR Version */ +#define SDIO_CCCR_REV_1_00 (0x0lu << 0) /**< CCCR/FBR Version 1.00 */ +#define SDIO_CCCR_REV_1_10 (0x1lu << 0) /**< CCCR/FBR Version 1.10 */ +#define SDIO_CCCR_REV_2_00 (0x2lu << 0) /**< CCCR/FBR Version 2.00 */ +#define SDIO_CCCR_REV_3_00 (0x3lu << 0) /**< CCCR/FBR Version 3.00 */ +#define SDIO_SDIO_REV (0xFlu << 4) /**< SDIO Spec */ +#define SDIO_SDIO_REV_1_00 (0x0lu << 4) /**< SDIO Spec 1.00 */ +#define SDIO_SDIO_REV_1_10 (0x1lu << 4) /**< SDIO Spec 1.10 */ +#define SDIO_SDIO_REV_1_20 (0x2lu << 4) /**< SDIO Spec 1.20(unreleased) */ +#define SDIO_SDIO_REV_2_00 (0x3lu << 4) /**< SDIO Spec Version 2.00 */ +#define SDIO_SDIO_REV_3_00 (0x4lu << 4) /**< SDIO Spec Version 3.00 */ +#define SDIO_CCCR_SD_REV 0x01 /**< SD Spec Revision (RO) */ +#define SDIO_SD_REV (0xFlu << 0) /**< SD Physical Spec */ +#define SDIO_SD_REV_1_01 (0x0lu << 0) /**< SD 1.01 (Mar 2000) */ +#define SDIO_SD_REV_1_10 (0x1lu << 0) /**< SD 1.10 (Oct 2004) */ +#define SDIO_SD_REV_2_00 (0x2lu << 0) /**< SD 2.00 (May 2006) */ +#define SDIO_SD_REV_3_00 (0x3lu << 0) /**< SD 3.00 */ +#define SDIO_CCCR_IOE 0x02 /**< I/O Enable (R/W) */ +#define SDIO_IOE (0xFElu << 1) /**< Functions Enable/Disable */ +#define SDIO_IOE_FN1 (0x1lu << 1) /**< Function 1 Enable/Disable */ +#define SDIO_IOE_FN2 (0x1lu << 2) /**< Function 2 Enable/Disable */ +#define SDIO_IOE_FN3 (0x1lu << 3) /**< Function 3 Enable/Disable */ +#define SDIO_IOE_FN4 (0x1lu << 4) /**< Function 4 Enable/Disable */ +#define SDIO_IOE_FN5 (0x1lu << 5) /**< Function 5 Enable/Disable */ +#define SDIO_IOE_FN6 (0x1lu << 6) /**< Function 6 Enable/Disable */ +#define SDIO_IOE_FN7 (0x1lu << 7) /**< Function 7 Enable/Disable */ +#define SDIO_CCCR_IOR 0x03 /**< I/O Ready (RO) */ +#define SDIO_IOR (0xFElu << 1) /**< Functions ready */ +#define SDIO_IOR_FN1 (0x1lu << 1) /**< Function 1 ready */ +#define SDIO_IOR_FN2 (0x1lu << 2) /**< Function 2 ready */ +#define SDIO_IOR_FN3 (0x1lu << 3) /**< Function 3 ready */ +#define SDIO_IOR_FN4 (0x1lu << 4) /**< Function 4 ready */ +#define SDIO_IOR_FN5 (0x1lu << 5) /**< Function 5 ready */ +#define SDIO_IOR_FN6 (0x1lu << 6) /**< Function 6 ready */ +#define SDIO_IOR_FN7 (0x1lu << 7) /**< Function 7 ready */ +#define SDIO_CCCR_IEN 0x04 /**< Int Enable */ +#define SDIO_IENM (0x1lu << 0) /**< Int Enable Master (R/W) */ +#define SDIO_IEN (0xFElu << 1) /**< Functions Int Enable */ +#define SDIO_IEN_FN1 (0x1lu << 1) /**< Function 1 Int Enable */ +#define SDIO_IEN_FN2 (0x1lu << 2) /**< Function 2 Int Enable */ +#define SDIO_IEN_FN3 (0x1lu << 3) /**< Function 3 Int Enable */ +#define SDIO_IEN_FN4 (0x1lu << 4) /**< Function 4 Int Enable */ +#define SDIO_IEN_FN5 (0x1lu << 5) /**< Function 5 Int Enable */ +#define SDIO_IEN_FN6 (0x1lu << 6) /**< Function 6 Int Enable */ +#define SDIO_IEN_FN7 (0x1lu << 7) /**< Function 7 Int Enable */ +#define SDIO_CCCR_INT 0x05 /**< Int Pending */ +#define SDIO_INT (0xFElu << 1) /**< Functions Int pending */ +#define SDIO_INT_FN1 (0x1lu << 1) /**< Function 1 Int pending */ +#define SDIO_INT_FN2 (0x1lu << 2) /**< Function 2 Int pending */ +#define SDIO_INT_FN3 (0x1lu << 3) /**< Function 3 Int pending */ +#define SDIO_INT_FN4 (0x1lu << 4) /**< Function 4 Int pending */ +#define SDIO_INT_FN5 (0x1lu << 5) /**< Function 5 Int pending */ +#define SDIO_INT_FN6 (0x1lu << 6) /**< Function 6 Int pending */ +#define SDIO_INT_FN7 (0x1lu << 7) /**< Function 7 Int pending */ +#define SDIO_CCCR_IOA 0x06 /**< I/O Abort */ +#define SDIO_AS (0x7lu << 0) /**< Abort Select In Order (WO) */ +#define SDIO_AS_FN1 (0x1lu << 0) /**< Abort function 1 IO */ +#define SDIO_AS_FN2 (0x2lu << 0) /**< Abort function 2 IO */ +#define SDIO_AS_FN3 (0x3lu << 0) /**< Abort function 3 IO */ +#define SDIO_AS_FN4 (0x4lu << 0) /**< Abort function 4 IO */ +#define SDIO_AS_FN5 (0x5lu << 0) /**< Abort function 5 IO */ +#define SDIO_AS_FN6 (0x6lu << 0) /**< Abort function 6 IO */ +#define SDIO_AS_FN7 (0x7lu << 0) /**< Abort function 7 IO */ +#define SDIO_RES (0x1lu << 3) /**< IO CARD RESET (WO) */ +#define SDIO_CCCR_BUS_CTRL 0x07 /**< Bus Interface Control */ +#define SDIO_BUSWIDTH (0x3lu << 0) /**< Data bus width (R/W) */ +#define SDIO_BUSWIDTH_1B (0x0lu << 0) /**< 1-bit data bus */ +#define SDIO_BUSWIDTH_4B (0x2lu << 0) /**< 4-bit data bus */ +/** Enable Continuous SPI interrupt (R/W) */ +#define SDIO_BUS_ECSI (0x1lu << 5) +/** Support Continuous SPI interrupt (RO) */ +#define SDIO_BUS_SCSI (0x1lu << 6) +/** Connect(0)/Disconnect(1) pull-up on CD/DAT[3] (R/W) */ +#define SDIO_BUS_CD_DISABLE (0x1lu << 7) +#define SDIO_CCCR_CAP 0x08 /**< Card Capability */ +/** Support Direct Commands during data transfer (RO) */ +#define SDIO_CAP_SDC (0x1lu << 0) +/** Support Multi-Block (RO) */ +#define SDIO_CAP_SMB (0x1lu << 1) +/** Support Read Wait (RO) */ +#define SDIO_CAP_SRW (0x1lu << 2) +/** Support Suspend/Resume (RO) */ +#define SDIO_CAP_SBS (0x1lu << 3) +/** Support interrupt between blocks of data in 4-bit SD mode (RO) */ +#define SDIO_CAP_S4MI (0x1lu << 4) +/** Enable interrupt between blocks of data in 4-bit SD mode (R/W) */ +#define SDIO_CAP_E4MI (0x1lu << 5) +/** Low-Speed Card (RO) */ +#define SDIO_CAP_LSC (0x1lu << 6) +/** 4-bit support for Low-Speed Card (RO) */ +#define SDIO_CAP_4BLS (0x1lu << 7) +/** Pointer to CIS (3B, LSB first) */ +#define SDIO_CCCR_CIS_PTR 0x09 +/** Bus Suspend */ +#define SDIO_CCCR_BUS_SUSPEND 0x0C +/** Bus Status (transfer on DAT[x] lines) (RO) */ +#define SDIO_BS (0x1lu << 0) +/** Bus Release Request/Status (R/W) */ +#define SDIO_BR (0x1lu << 1) +#define SDIO_CCCR_FUN_SEL 0x0D /**< Function select */ +#define SDIO_DF (0x1lu << 7) /**< Resume Data Flag (RO) */ +#define SDIO_FS (0xFlu << 0) /**< Select Function (R/W) */ +#define SDIO_FS_CIA (0x0lu << 0) /**< Select CIA (function 0) */ +#define SDIO_FS_FN1 (0x1lu << 0) /**< Select Function 1 */ +#define SDIO_FS_FN2 (0x2lu << 0) /**< Select Function 2 */ +#define SDIO_FS_FN3 (0x3lu << 0) /**< Select Function 3 */ +#define SDIO_FS_FN4 (0x4lu << 0) /**< Select Function 4 */ +#define SDIO_FS_FN5 (0x5lu << 0) /**< Select Function 5 */ +#define SDIO_FS_FN6 (0x6lu << 0) /**< Select Function 6 */ +#define SDIO_FS_FN7 (0x7lu << 0) /**< Select Function 7 */ +#define SDIO_FS_MEM (0x8lu << 0) /**< Select memory in combo card */ +#define SDIO_CCCR_EXEC 0x0E /**< Exec Flags (RO) */ +#define SDIO_EXM (0x1lu << 0) /**< Executing status of memory */ +#define SDIO_EX (0xFElu << 1) /**< Executing functions status */ +#define SDIO_EX_FN1 (0x1lu << 1) /**< Executing status of func 1 */ +#define SDIO_EX_FN2 (0x1lu << 2) /**< Executing status of func 2 */ +#define SDIO_EX_FN3 (0x1lu << 3) /**< Executing status of func 3 */ +#define SDIO_EX_FN4 (0x1lu << 4) /**< Executing status of func 4 */ +#define SDIO_EX_FN5 (0x1lu << 5) /**< Executing status of func 5 */ +#define SDIO_EX_FN6 (0x1lu << 6) /**< Executing status of func 6 */ +#define SDIO_EX_FN7 (0x1lu << 7) /**< Executing status of func 7 */ +#define SDIO_CCCR_READY 0x0F /**< Ready Flags (RO) */ +#define SDIO_RFM (0x1lu << 0) /**< Ready Flag for memory */ +#define SDIO_RF (0xFElu) /**< Ready Flag for functions */ +#define SDIO_RF_FN1 (0x1lu << 1) /**< Ready Flag for function 1 */ +#define SDIO_RF_FN2 (0x1lu << 2) /**< Ready Flag for function 2 */ +#define SDIO_RF_FN3 (0x1lu << 3) /**< Ready Flag for function 3 */ +#define SDIO_RF_FN4 (0x1lu << 4) /**< Ready Flag for function 4 */ +#define SDIO_RF_FN5 (0x1lu << 5) /**< Ready Flag for function 5 */ +#define SDIO_RF_FN6 (0x1lu << 6) /**< Ready Flag for function 6 */ +#define SDIO_RF_FN7 (0x1lu << 7) /**< Ready Flag for function 7 */ +#define SDIO_CCCR_FN0_BLKSIZ 0x10 /**< FN0 Block Size (2B, LSB first) (R/W) */ +#define SDIO_CCCR_POWER 0x12 /**< Power Control */ +#define SDIO_SMPC (0x1lu << 0) /**< Support Master Power Control*/ +#define SDIO_EMPC (0x1lu << 1) /**< Enable Master Power Control */ +#define SDIO_CCCR_HS 0x13 /**< High-Speed */ +#define SDIO_SHS (0x1lu << 0) /**< Support High-Speed (RO) */ +#define SDIO_EHS (0x1lu << 1) /**< Enable High-Speed (R/W) */ + //! @} + +//! \name SDIO Function Basic Registers (FBR) +//! @{ +#define SDIO_FBR_ADDR(fn, x) (0x100 * (fn) + (x)) +#define SDIO_FBR_CSA_IF 0x0 /**< CSA and function interface code (RO) */ +#define SDIO_IFC (0xFUL << 0) /**< Standard SDIO Fun Interface Code */ +#define SDIO_IFC_NO_IF (0x0UL << 0) /**< No SDIO standard interface */ +#define SDIO_IFC_UART (0x1UL << 0) /**< UART */ +#define SDIO_IFC_TA_BT (0x2UL << 0) /**< Type-A Bluetooth */ +#define SDIO_IFC_TB_BT (0x3UL << 0) /**< Type-B Bluetooth */ +#define SDIO_IFC_GPS (0x4UL << 0) /**< GPS */ +#define SDIO_IFC_CAMERA (0x5UL << 0) /**< Camera */ +#define SDIO_IFC_PHS (0x6UL << 0) /**< PHS */ +#define SDIO_IFC_WLAN (0x7UL << 0) /**< WLAN */ +#define SDIO_IFC_ATA (0x8UL << 0) /**< Embedded SDIO-ATA */ +#define SDIO_IFC_EXT (0xFUL << 0) /**< Check EXT interface code */ +#define SDIO_SCSA (0x1UL << 6) /**< Function supports Code Storage Area (CSA) */ +#define SDIO_FBR_CSA (0x1UL << 7) /**< Function CSA enable */ +#define SDIO_FBR_EXT_IF 0x1 /**< Extended function interface code (RO) */ +#define SDIO_FBR_PWR 0x2 /**< function power control */ +#define SDIO_SPS (0x1UL << 0) /**< function support power selection (RO) */ +#define SDIO_EPS (0x1UL << 1) /**< Low Current Mode/High Current Mode (R/W) */ +#define SDIO_FBR_CIS_PTR 0x9 /**< Address pointer to function CIS (3B, LSB first) (RO) */ +#define SDIO_FBR_CSA_PTR 0xC /**< Address pointer to CSA (3B, LSB first) (R/W) */ +#define SDIO_FBR_CSA_DATA 0xF /**< Read/Write fifo to CSA (R/W) */ +#define SDIO_FBR_BLK_SIZ 0x10 /**< Block size (2B, LSB first) (R/W) */ + //! @} + +//! \name SDIO Card Metaformat +//! @{ +/** Null tuple (PCMCIA 3.1.9) */ +#define SDIO_CISTPL_NULL 0x00 +/** Device tuple (PCMCIA 3.2.2) */ +#define SDIO_CISTPL_DEVICE 0x01 +/** Checksum control (PCMCIA 3.1.1) */ +#define SDIO_CISTPL_CHECKSUM 0x10 +/** Level 1 version (PCMCIA 3.2.10) */ +#define SDIO_CISTPL_VERS_1 0x15 +/** Alternate Language String (PCMCIA 3.2.1) */ +#define SDIO_CISTPL_ALTSTR 0x16 +/** Manufacturer Identification String (PCMCIA 3.2.9) */ +#define SDIO_CISTPL_MANFID 0x20 +/** Function Identification (PCMCIA 3.2.7) */ +#define SDIO_CISTPL_FUNCID 0x21 +/** Function Extensions (PCMCIA 3.2.6) */ +#define SDIO_CISTPL_FUNCE 0x22 +/** Additional information for SDIO (PCMCIA 6.1.2) */ +#define SDIO_CISTPL_SDIO_STD 0x91 +/** Reserved for future SDIO (PCMCIA 6.1.3) */ +#define SDIO_CISTPL_SDIO_EXT 0x92 +/** The End-of-chain Tuple (PCMCIA 3.1.2) */ +#define SDIO_CISTPL_END 0xFF +//! @} + +//! @} + +//! \name CSD, OCR, SCR, Switch status, extend CSD definitions +//! @{ + +/** + * \brief Macro function to extract a bits field from a large SD MMC register + * Used by : CSD, SCR, Switch status + */ +static inline uint32_t SDMMC_UNSTUFF_BITS(uint8_t *reg, uint16_t reg_size, uint16_t pos, uint8_t size) +{ + uint32_t value; + value = reg[((reg_size - pos + 7) / 8) - 1] >> (pos % 8); + if (((pos % 8) + size) > 8) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 2] << (8 - (pos % 8)); + } + if (((pos % 8) + size) > 16) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 3] << (16 - (pos % 8)); + } + if (((pos % 8) + size) > 24) { + value |= (uint32_t)reg[((reg_size - pos + 7) / 8) - 3] << (24 - (pos % 8)); + } + value &= ((uint32_t)1 << size) - 1; + return value; +} + + //! \name CSD Fields + //! @{ +#define CSD_REG_BIT_SIZE 128 //!< 128 bits +#define CSD_REG_BSIZE (CSD_REG_BIT_SIZE / 8) //!< 16 bytes +#define CSD_STRUCTURE(csd, pos, size) SDMMC_UNSTUFF_BITS(csd, CSD_REG_BIT_SIZE, pos, size) +#define CSD_STRUCTURE_VERSION(csd) CSD_STRUCTURE(csd, 126, 2) +#define SD_CSD_VER_1_0 0 +#define SD_CSD_VER_2_0 1 +#define MMC_CSD_VER_1_0 0 +#define MMC_CSD_VER_1_1 1 +#define MMC_CSD_VER_1_2 2 +#define CSD_TRAN_SPEED(csd) CSD_STRUCTURE(csd, 96, 8) +#define SD_CSD_1_0_C_SIZE(csd) CSD_STRUCTURE(csd, 62, 12) +#define SD_CSD_1_0_C_SIZE_MULT(csd) CSD_STRUCTURE(csd, 47, 3) +#define SD_CSD_1_0_READ_BL_LEN(csd) CSD_STRUCTURE(csd, 80, 4) +#define SD_CSD_2_0_C_SIZE(csd) CSD_STRUCTURE(csd, 48, 22) +#define MMC_CSD_C_SIZE(csd) CSD_STRUCTURE(csd, 62, 12) +#define MMC_CSD_C_SIZE_MULT(csd) CSD_STRUCTURE(csd, 47, 3) +#define MMC_CSD_READ_BL_LEN(csd) CSD_STRUCTURE(csd, 80, 4) +#define MMC_CSD_SPEC_VERS(csd) CSD_STRUCTURE(csd, 122, 4) + //! @} + + //! \name OCR Register Fields + //! @{ +#define OCR_REG_BSIZE (32 / 8) /**< 32 bits, 4 bytes */ +#define OCR_VDD_170_195 (1lu << 7) +#define OCR_VDD_20_21 (1lu << 8) +#define OCR_VDD_21_22 (1lu << 9) +#define OCR_VDD_22_23 (1lu << 10) +#define OCR_VDD_23_24 (1lu << 11) +#define OCR_VDD_24_25 (1lu << 12) +#define OCR_VDD_25_26 (1lu << 13) +#define OCR_VDD_26_27 (1lu << 14) +#define OCR_VDD_27_28 (1lu << 15) +#define OCR_VDD_28_29 (1lu << 16) +#define OCR_VDD_29_30 (1lu << 17) +#define OCR_VDD_30_31 (1lu << 18) +#define OCR_VDD_31_32 (1lu << 19) +#define OCR_VDD_32_33 (1lu << 20) +#define OCR_VDD_33_34 (1lu << 21) +#define OCR_VDD_34_35 (1lu << 22) +#define OCR_VDD_35_36 (1lu << 23) +#define OCR_SDIO_S18R (1lu << 24) /**< Switching to 1.8V Accepted */ +#define OCR_SDIO_MP (1lu << 27) /**< Memory Present */ +#define OCR_SDIO_NF (7lu << 28) /**< Number of I/O Functions */ +#define OCR_ACCESS_MODE_MASK (3lu << 29) /**< (MMC) Access mode mask */ +#define OCR_ACCESS_MODE_BYTE (0lu << 29) /**< (MMC) Byte access mode */ +#define OCR_ACCESS_MODE_SECTOR (2lu << 29) /**< (MMC) Sector access mode */ +#define OCR_CCS (1lu << 30) /**< (SD) Card Capacity Status */ +#define OCR_POWER_UP_BUSY (1lu << 31) /**< Card power up status bit */ + //! @} + + //! \name SD SCR Register Fields + //! @{ +#define SD_SCR_REG_BIT_SIZE 64 //!< 64 bits +#define SD_SCR_REG_BSIZE (SD_SCR_REG_BIT_SIZE / 8) //!< 8 bytes +#define SD_SCR_STRUCTURE(scr, pos, size) SDMMC_UNSTUFF_BITS(scr, SD_SCR_REG_BIT_SIZE, pos, size) +#define SD_SCR_SCR_STRUCTURE(scr) SD_SCR_STRUCTURE(scr, 60, 4) +#define SD_SCR_SCR_STRUCTURE_1_0 0 +#define SD_SCR_SD_SPEC(scr) SD_SCR_STRUCTURE(scr, 56, 4) +#define SD_SCR_SD_SPEC_1_0_01 0 +#define SD_SCR_SD_SPEC_1_10 1 +#define SD_SCR_SD_SPEC_2_00 2 +#define SD_SCR_DATA_STATUS_AFTER_ERASE(scr) SD_SCR_STRUCTURE(scr, 55, 1) +#define SD_SCR_SD_SECURITY(scr) SD_SCR_STRUCTURE(scr, 52, 3) +#define SD_SCR_SD_SECURITY_NO 0 +#define SD_SCR_SD_SECURITY_NOTUSED 1 +#define SD_SCR_SD_SECURITY_1_01 2 +#define SD_SCR_SD_SECURITY_2_00 3 +#define SD_SCR_SD_SECURITY_3_00 4 +#define SD_SCR_SD_BUS_WIDTHS(scr) SD_SCR_STRUCTURE(scr, 48, 4) +#define SD_SCR_SD_BUS_WIDTH_1BITS (1lu << 0) +#define SD_SCR_SD_BUS_WIDTH_4BITS (1lu << 2) +#define SD_SCR_SD_SPEC3(scr) SD_SCR_STRUCTURE(scr, 47, 1) +#define SD_SCR_SD_SPEC_3_00 1 +#define SD_SCR_SD_EX_SECURITY(scr) SD_SCR_STRUCTURE(scr, 43, 4) +#define SD_SCR_SD_CMD_SUPPORT(scr) SD_SCR_STRUCTURE(scr, 32, 2) + //! @} + + //! \name SD Switch Status Fields + //! @{ +#define SD_SW_STATUS_BIT_SIZE 512 //!< 512 bits +#define SD_SW_STATUS_BSIZE (SD_SW_STATUS_BIT_SIZE / 8) //!< 64 bytes +#define SD_SW_STATUS_STRUCTURE(sd_sw_status, pos, size) \ + SDMMC_UNSTUFF_BITS(sd_sw_status, SD_SW_STATUS_BIT_SIZE, pos, size) +#define SD_SW_STATUS_MAX_CURRENT_CONSUMPTION(status) SD_SW_STATUS_STRUCTURE(status, 496, 16) +#define SD_SW_STATUS_FUN_GRP6_INFO(status) SD_SW_STATUS_STRUCTURE(status, 480, 16) +#define SD_SW_STATUS_FUN_GRP5_INFO(status) SD_SW_STATUS_STRUCTURE(status, 464, 16) +#define SD_SW_STATUS_FUN_GRP4_INFO(status) SD_SW_STATUS_STRUCTURE(status, 448, 16) +#define SD_SW_STATUS_FUN_GRP3_INFO(status) SD_SW_STATUS_STRUCTURE(status, 432, 16) +#define SD_SW_STATUS_FUN_GRP2_INFO(status) SD_SW_STATUS_STRUCTURE(status, 416, 16) +#define SD_SW_STATUS_FUN_GRP1_INFO(status) SD_SW_STATUS_STRUCTURE(status, 400, 16) +#define SD_SW_STATUS_FUN_GRP6_RC(status) SD_SW_STATUS_STRUCTURE(status, 396, 4) +#define SD_SW_STATUS_FUN_GRP5_RC(status) SD_SW_STATUS_STRUCTURE(status, 392, 4) +#define SD_SW_STATUS_FUN_GRP4_RC(status) SD_SW_STATUS_STRUCTURE(status, 388, 4) +#define SD_SW_STATUS_FUN_GRP3_RC(status) SD_SW_STATUS_STRUCTURE(status, 384, 4) +#define SD_SW_STATUS_FUN_GRP2_RC(status) SD_SW_STATUS_STRUCTURE(status, 380, 4) +#define SD_SW_STATUS_FUN_GRP1_RC(status) SD_SW_STATUS_STRUCTURE(status, 376, 4) +#define SD_SW_STATUS_FUN_GRP_RC_ERROR 0xFU +#define SD_SW_STATUS_DATA_STRUCT_VER(status) SD_SW_STATUS_STRUCTURE(status, 368, 8) +#define SD_SW_STATUS_FUN_GRP6_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 352, 16) +#define SD_SW_STATUS_FUN_GRP5_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 336, 16) +#define SD_SW_STATUS_FUN_GRP4_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 320, 16) +#define SD_SW_STATUS_FUN_GRP3_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 304, 16) +#define SD_SW_STATUS_FUN_GRP2_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 288, 16) +#define SD_SW_STATUS_FUN_GRP1_BUSY(status) SD_SW_STATUS_STRUCTURE(status, 272, 16) + //! @} + + //! \name Card Status Fields + //! @{ +#define CARD_STATUS_APP_CMD (1lu << 5) +#define CARD_STATUS_SWITCH_ERROR (1lu << 7) +#define CARD_STATUS_READY_FOR_DATA (1lu << 8) +#define CARD_STATUS_STATE_IDLE (0lu << 9) +#define CARD_STATUS_STATE_READY (1lu << 9) +#define CARD_STATUS_STATE_IDENT (2lu << 9) +#define CARD_STATUS_STATE_STBY (3lu << 9) +#define CARD_STATUS_STATE_TRAN (4lu << 9) +#define CARD_STATUS_STATE_DATA (5lu << 9) +#define CARD_STATUS_STATE_RCV (6lu << 9) +#define CARD_STATUS_STATE_PRG (7lu << 9) +#define CARD_STATUS_STATE_DIS (8lu << 9) +#define CARD_STATUS_STATE (0xFlu << 9) +#define CARD_STATUS_ERASE_RESET (1lu << 13) +#define CARD_STATUS_WP_ERASE_SKIP (1lu << 15) +#define CARD_STATUS_CIDCSD_OVERWRITE (1lu << 16) +#define CARD_STATUS_OVERRUN (1lu << 17) +#define CARD_STATUS_UNERRUN (1lu << 18) +#define CARD_STATUS_ERROR (1lu << 19) +#define CARD_STATUS_CC_ERROR (1lu << 20) +#define CARD_STATUS_CARD_ECC_FAILED (1lu << 21) +#define CARD_STATUS_ILLEGAL_COMMAND (1lu << 22) +#define CARD_STATUS_COM_CRC_ERROR (1lu << 23) +#define CARD_STATUS_UNLOCK_FAILED (1lu << 24) +#define CARD_STATUS_CARD_IS_LOCKED (1lu << 25) +#define CARD_STATUS_WP_VIOLATION (1lu << 26) +#define CARD_STATUS_ERASE_PARAM (1lu << 27) +#define CARD_STATUS_ERASE_SEQ_ERROR (1lu << 28) +#define CARD_STATUS_BLOCK_LEN_ERROR (1lu << 29) +#define CARD_STATUS_ADDRESS_MISALIGN (1lu << 30) +#define CARD_STATUS_ADDR_OUT_OF_RANGE (1lu << 31) + +#define CARD_STATUS_ERR_RD_WR \ + (CARD_STATUS_ADDR_OUT_OF_RANGE | CARD_STATUS_ADDRESS_MISALIGN | CARD_STATUS_BLOCK_LEN_ERROR \ + | CARD_STATUS_WP_VIOLATION | CARD_STATUS_ILLEGAL_COMMAND | CARD_STATUS_CC_ERROR | CARD_STATUS_ERROR) + //! @} + + //! \name SD Status Field + //! @{ +#define SD_STATUS_BSIZE (512 / 8) /**< 512 bits, 64bytes */ + //! @} + + //! \name MMC Extended CSD Register Field + //! @{ +#define EXT_CSD_BSIZE 512 /**< 512 bytes. */ +/* Below belongs to Properties Segment */ +#define EXT_CSD_S_CMD_SET_INDEX 504lu +#define EXT_CSD_BOOT_INFO_INDEX 228lu +#define EXT_CSD_BOOT_SIZE_MULTI_INDEX 226lu +#define EXT_CSD_ACC_SIZE_INDEX 225lu +#define EXT_CSD_HC_ERASE_GRP_SIZE_INDEX 224lu +#define EXT_CSD_ERASE_TIMEOUT_MULT_INDEX 223lu +#define EXT_CSD_REL_WR_SEC_C_INDEX 222lu +#define EXT_CSD_HC_WP_GRP_SIZE_INDEX 221lu +#define EXT_CSD_S_C_VCC_INDEX 220lu +#define EXT_CSD_S_C_VCCQ_INDEX 219lu +#define EXT_CSD_S_A_TIMEOUT_INDEX 217lu +#define EXT_CSD_SEC_COUNT_INDEX 212lu +#define EXT_CSD_MIN_PERF_W_8_52_INDEX 210lu +#define EXT_CSD_MIN_PERF_R_8_52_INDEX 209lu +#define EXT_CSD_MIN_PERF_W_8_26_4_52_INDEX 208lu +#define EXT_CSD_MIN_PERF_R_8_26_4_52_INDEX 207lu +#define EXT_CSD_MIN_PERF_W_4_26_INDEX 206lu +#define EXT_CSD_MIN_PERF_R_4_26_INDEX 205lu +#define EXT_CSD_PWR_CL_26_360_INDEX 203lu +#define EXT_CSD_PWR_CL_52_360_INDEX 202lu +#define EXT_CSD_PWR_CL_26_195_INDEX 201lu +#define EXT_CSD_PWR_CL_52_195_INDEX 200lu +#define EXT_CSD_CARD_TYPE_INDEX 196lu +/* MMC card type */ +#define MMC_CTYPE_26MHZ 0x1 +#define MMC_CTYPE_52MHZ 0x2 +#define EXT_CSD_CSD_STRUCTURE_INDEX 194lu +#define EXT_CSD_EXT_CSD_REV_INDEX 192lu + +/* Below belongs to Mode Segment */ +#define EXT_CSD_CMD_SET_INDEX 191lu +#define EXT_CSD_CMD_SET_REV_INDEX 189lu +#define EXT_CSD_POWER_CLASS_INDEX 187lu +#define EXT_CSD_HS_TIMING_INDEX 185lu +#define EXT_CSD_BUS_WIDTH_INDEX 183lu +#define EXT_CSD_ERASED_MEM_CONT_INDEX 181lu +#define EXT_CSD_BOOT_CONFIG_INDEX 179lu +#define EXT_CSD_BOOT_BUS_WIDTH_INDEX 177lu +#define EXT_CSD_ERASE_GROUP_DEF_INDEX 175lu + //! @} +//! @} + +//! \name Definition for SPI mode only +//! @{ + +//! SPI commands start with a start bit "0" and a transmit bit "1" +#define SPI_CMD_ENCODE(x) (0x40 | (x & 0x3F)) + +//! \name Register R1 definition for SPI mode +//! The R1 register is always send after a command. +//! @{ +#define R1_SPI_IDLE (1lu << 0) +#define R1_SPI_ERASE_RESET (1lu << 1) +#define R1_SPI_ILLEGAL_COMMAND (1lu << 2) +#define R1_SPI_COM_CRC (1lu << 3) +#define R1_SPI_ERASE_SEQ (1lu << 4) +#define R1_SPI_ADDRESS (1lu << 5) +#define R1_SPI_PARAMETER (1lu << 6) +// R1 bit 7 is always zero, reuse this bit for error +#define R1_SPI_ERROR (1lu << 7) +//! @} + +//! \name Register R2 definition for SPI mode +//! The R2 register can be send after R1 register. +//! @{ +#define R2_SPI_CARD_LOCKED (1lu << 0) +#define R2_SPI_WP_ERASE_SKIP (1lu << 1) +#define R2_SPI_LOCK_UNLOCK_FAIL R2_SPI_WP_ERASE_SKIP +#define R2_SPI_ERROR (1lu << 2) +#define R2_SPI_CC_ERROR (1lu << 3) +#define R2_SPI_CARD_ECC_ERROR (1lu << 4) +#define R2_SPI_WP_VIOLATION (1lu << 5) +#define R2_SPI_ERASE_PARAM (1lu << 6) +#define R2_SPI_OUT_OF_RANGE (1lu << 7) +#define R2_SPI_CSD_OVERWRITE R2_SPI_OUT_OF_RANGE +//! @} + +//! \name Control Tokens in SPI Mode +//! @{ +//! \name Tokens used for a read operation +//! @{ +#define SPI_TOKEN_SINGLE_MULTI_READ 0xFE +#define SPI_TOKEN_DATA_ERROR_VALID(token) (((token)&0xF0) == 0) +#define SPI_TOKEN_DATA_ERROR_ERRORS (0x0F) +#define SPI_TOKEN_DATA_ERROR_ERROR (1lu << 0) +#define SPI_TOKEN_DATA_ERROR_CC_ERROR (1lu << 1) +#define SPI_TOKEN_DATA_ERROR_ECC_ERROR (1lu << 2) +#define SPI_TOKEN_DATA_ERROR_OUT_RANGE (1lu << 3) + //! @} + //! \name Tokens used for a write operation + //! @{ +#define SPI_TOKEN_SINGLE_WRITE 0xFE +#define SPI_TOKEN_MULTI_WRITE 0xFC +#define SPI_TOKEN_STOP_TRAN 0xFD +#define SPI_TOKEN_DATA_RESP_VALID(token) ((((token) & (1 << 4)) == 0) && (((token) & (1 << 0)) == 1)) +#define SPI_TOKEN_DATA_RESP_CODE(token) ((token)&0x1E) +#define SPI_TOKEN_DATA_RESP_ACCEPTED (2lu << 1) +#define SPI_TOKEN_DATA_RESP_CRC_ERR (5lu << 1) +#define SPI_TOKEN_DATA_RESP_WRITE_ERR (6lu << 1) + //! @} + //! @} + //! @} + + //! @} end of sd_mmc_protocol + +#ifdef __cplusplus +} +#endif + +#endif /* SD_MMC_PROTOCOL_H_INCLUDED */ From f496c0b58d63f594ce42bd5b34cf8421674b4108 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 10:58:54 -0500 Subject: [PATCH 874/919] atmel-samd: Add SDIO SD card interface --- locale/circuitpython.pot | 10 +- ports/atmel-samd/Makefile | 15 + ports/atmel-samd/asf4 | 2 +- .../asf4_conf/samd51/hpl_sdhc_config.h | 24 ++ .../asf4_conf/samd51/peripheral_clk_config.h | 164 +++++++++++ .../asf4_conf/same54/hpl_sdhc_config.h | 24 ++ .../asf4_conf/same54/peripheral_clk_config.h | 164 +++++++++++ .../grandcentral_m4_express/mpconfigboard.mk | 2 + .../boards/grandcentral_m4_express/pins.c | 17 ++ .../boards/same54_xplained/mpconfigboard.mk | 3 +- .../atmel-samd/boards/same54_xplained/pins.c | 17 ++ ports/atmel-samd/common-hal/sdioio/SDCard.c | 272 ++++++++++++++++++ ports/atmel-samd/common-hal/sdioio/SDCard.h | 40 +++ ports/atmel-samd/common-hal/sdioio/__init__.c | 0 ports/atmel-samd/common-hal/sdioio/__init__.h | 0 tools/mksdiodata.py | 40 +++ 16 files changed, 791 insertions(+), 3 deletions(-) create mode 100644 ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h create mode 100644 ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h create mode 100644 ports/atmel-samd/common-hal/sdioio/SDCard.c create mode 100644 ports/atmel-samd/common-hal/sdioio/SDCard.h create mode 100644 ports/atmel-samd/common-hal/sdioio/__init__.c create mode 100644 ports/atmel-samd/common-hal/sdioio/__init__.h create mode 100755 tools/mksdiodata.py diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 481d29f248..3a3b159a04 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -58,6 +58,10 @@ msgstr "" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -85,6 +89,10 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -417,7 +425,7 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 5f901a1991..c308105a32 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -246,6 +246,14 @@ SRC_ASF += \ endif +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_ASF += \ + hal/src/hal_mci_sync.c \ + hpl/sdhc/hpl_sdhc.c \ + +$(BUILD)/asf4/$(CHIP_FAMILY)/hpl/sdhc/hpl_sdhc.o: CFLAGS += -Wno-cast-align +endif + SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF)) SRC_C = \ @@ -290,6 +298,9 @@ SRC_C = \ supervisor/shared/memory.c \ timer_handler.c \ +ifeq ($(CIRCUITPY_SDIOIO),1) +SRC_C += ports/atmel-samd/sd_mmc/sd_mmc.c +endif ifeq ($(CIRCUITPY_NETWORK),1) CFLAGS += -DMICROPY_PY_NETWORK=1 @@ -346,6 +357,10 @@ endif OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) +SRC_QSTR += $(HEADER_BUILD)/sdiodata.h +$(HEADER_BUILD)/sdiodata.h: $(TOP)/tools/mksdiodata.py | $(HEADER_BUILD) + $(Q)$(PYTHON3) $< > $@ + SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) # Sources that only hold QSTRs after pre-processing. SRC_QSTR_PREPROCESSOR += peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/clocks.c diff --git a/ports/atmel-samd/asf4 b/ports/atmel-samd/asf4 index c0eef7b751..35a1525796 160000 --- a/ports/atmel-samd/asf4 +++ b/ports/atmel-samd/asf4 @@ -1 +1 @@ -Subproject commit c0eef7b75124fc946af5f75e12d82d6d01315ab1 +Subproject commit 35a1525796c7ef8a3893d90befdad2f267fca20e diff --git a/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h b/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h new file mode 100644 index 0000000000..daa6620517 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/samd51/hpl_sdhc_config.h @@ -0,0 +1,24 @@ +/* Auto-generated config file hpl_sdhc_config.h */ +#ifndef HPL_SDHC_CONFIG_H +#define HPL_SDHC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include "peripheral_clk_config.h" + +#ifndef CONF_BASE_FREQUENCY +#define CONF_BASE_FREQUENCY CONF_SDHC0_FREQUENCY +#endif + +// Clock Generator Select +// <0=> Divided Clock mode +// <1=> Programmable Clock mode +// This defines the clock generator mode in the SDCLK Frequency Select field +// sdhc_clk_gsel +#ifndef CONF_SDHC0_CLK_GEN_SEL +#define CONF_SDHC0_CLK_GEN_SEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SDHC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h index 030a90a7a9..59fe8730e6 100644 --- a/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/samd51/peripheral_clk_config.h @@ -1001,6 +1001,170 @@ #define CONF_GCLK_USB_FREQUENCY 48000000 #endif +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC0_SRC +#define CONF_GCLK_SDHC0_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC0_SLOW_SRC +#define CONF_GCLK_SDHC0_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC0_FREQUENCY +#define CONF_SDHC0_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC0_SLOW_FREQUENCY +#define CONF_SDHC0_SLOW_FREQUENCY 12000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC1_SRC +#define CONF_GCLK_SDHC1_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC1_SLOW_SRC +#define CONF_GCLK_SDHC1_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC1_FREQUENCY +#define CONF_SDHC1_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC1_SLOW_FREQUENCY +#define CONF_SDHC1_SLOW_FREQUENCY 12000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h new file mode 100644 index 0000000000..daa6620517 --- /dev/null +++ b/ports/atmel-samd/asf4_conf/same54/hpl_sdhc_config.h @@ -0,0 +1,24 @@ +/* Auto-generated config file hpl_sdhc_config.h */ +#ifndef HPL_SDHC_CONFIG_H +#define HPL_SDHC_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +#include "peripheral_clk_config.h" + +#ifndef CONF_BASE_FREQUENCY +#define CONF_BASE_FREQUENCY CONF_SDHC0_FREQUENCY +#endif + +// Clock Generator Select +// <0=> Divided Clock mode +// <1=> Programmable Clock mode +// This defines the clock generator mode in the SDCLK Frequency Select field +// sdhc_clk_gsel +#ifndef CONF_SDHC0_CLK_GEN_SEL +#define CONF_SDHC0_CLK_GEN_SEL 0 +#endif + +// <<< end of configuration section >>> + +#endif // HPL_SDHC_CONFIG_H diff --git a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h index 030a90a7a9..59fe8730e6 100644 --- a/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h +++ b/ports/atmel-samd/asf4_conf/same54/peripheral_clk_config.h @@ -1001,6 +1001,170 @@ #define CONF_GCLK_USB_FREQUENCY 48000000 #endif +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC0_SRC +#define CONF_GCLK_SDHC0_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC0_SLOW_SRC +#define CONF_GCLK_SDHC0_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC0_FREQUENCY +#define CONF_SDHC0_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC0_SLOW_FREQUENCY +#define CONF_SDHC0_SLOW_FREQUENCY 12000000 +#endif + +// SDHC Clock Settings +// SDHC Clock source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_gclk_selection +#ifndef CONF_GCLK_SDHC1_SRC +#define CONF_GCLK_SDHC1_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif + +// SDHC clock slow source + +// Generic clock generator 0 + +// Generic clock generator 1 + +// Generic clock generator 2 + +// Generic clock generator 3 + +// Generic clock generator 4 + +// Generic clock generator 5 + +// Generic clock generator 6 + +// Generic clock generator 7 + +// Generic clock generator 8 + +// Generic clock generator 9 + +// Generic clock generator 10 + +// Generic clock generator 11 + +// Select the clock source for SDHC. +// sdhc_slow_gclk_selection +#ifndef CONF_GCLK_SDHC1_SLOW_SRC +#define CONF_GCLK_SDHC1_SLOW_SRC GCLK_GENCTRL_SRC_DFLL_Val +#endif +// + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock frequency + */ +#ifndef CONF_SDHC1_FREQUENCY +#define CONF_SDHC1_FREQUENCY 12000000 +#endif + +/** + * \def SDHC FREQUENCY + * \brief SDHC's Clock slow frequency + */ +#ifndef CONF_SDHC1_SLOW_FREQUENCY +#define CONF_SDHC1_SLOW_FREQUENCY 12000000 +#endif + // <<< end of configuration section >>> #endif // PERIPHERAL_CLK_CONFIG_H diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index ab81ec5a29..08eb5c98ba 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -10,3 +10,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ + +CIRCUITPY_SDIOIO = 1 diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c index 6b09c62bf3..b125aca086 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c +++ b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c @@ -1,5 +1,18 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_PB18), + MP_ROM_PTR(&pin_PB19), + MP_ROM_PTR(&pin_PB20), + MP_ROM_PTR(&pin_PB21), + } +}; + + // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. @@ -129,5 +142,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk index ffc4f567f9..7ac1265149 100644 --- a/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk +++ b/ports/atmel-samd/boards/same54_xplained/mpconfigboard.mk @@ -10,4 +10,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "N25Q256A" LONGINT_IMPL = MPZ -LONGINT_IMPL = MPZ + +CIRCUITPY_SDIOIO = 1 diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c index 5b9373724e..8a864ab97d 100644 --- a/ports/atmel-samd/boards/same54_xplained/pins.c +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -1,5 +1,18 @@ +#include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_PB18), + MP_ROM_PTR(&pin_PB19), + MP_ROM_PTR(&pin_PB20), + MP_ROM_PTR(&pin_PB21), + } +}; + + // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. @@ -95,5 +108,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c new file mode 100644 index 0000000000..6014bd8abf --- /dev/null +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -0,0 +1,272 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "boards/board.h" +#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "supervisor/shared/translate.h" + +#include "genhdr/sdiodata.h" + +#include "sd_mmc/sd_mmc.h" +#include "sd_mmc/conf_sd_mmc.h" +#include "peripheral_clk_config.h" + +#ifndef DEBUG_SDIO +#define DEBUG_SDIO (1) +#endif + +#if DEBUG_SDIO +#define DEBUG_PRINT(...) ((void)mp_printf(&mp_plat_print, __VA_ARGS__)) +#define DEBUG_PRINT_OBJ(o) ((void)mp_obj_print_helper(&mp_plat_print, (mp_obj_t)o, PRINT_REPR)) +#else +#define DEBUG_PRINT(...) ((void)0) +#define DEBUG_PRINT_OBJ(...) ((void)0) +#endif +#define DEBUG_PRINT_OBJ_NL(o) (DEBUG_PRINT_OBJ(o), DEBUG_PRINT("\n")) + +#define GPIO_PIN_FUNCTION_SDIO (GPIO_PIN_FUNCTION_I) + +static Sdhc *sdhc_insts[] = SDHC_INSTS; + +STATIC pin_function_t *find_pin_function(pin_function_t *table, const mcu_pin_obj_t *pin, int instance, uint16_t name) { + DEBUG_PRINT("\n\n[inst=% 2d] %q: ", instance, name); + DEBUG_PRINT_OBJ_NL(pin); + + for(; table->obj; table++) { + DEBUG_PRINT("[inst=% 2d] considering table @%p: "); + DEBUG_PRINT_OBJ(table->obj); + DEBUG_PRINT(" %d %d\n", table->instance, table->pin); + if (instance != -1 && instance != table->instance) { + continue; + } + if (pin == table->obj) { + return table; + } + } + mp_raise_ValueError_varg(translate("%q pin invalid"), name); +} + +void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t * clock, const mcu_pin_obj_t * command, + uint8_t num_data, mcu_pin_obj_t ** data, uint32_t frequency) { + /* +SD breakout as assembled ("*" = minimum viable set) + +PURPLE 9 DAT2 SDA +BLUE 1 DAT3 SCL +GREEN 2 CMD * D32 +YELLOW 3 VSS1 +RED 4 VDD * 3.3V +BROWN 5 CLK * BROWN +BLACK 6 VSS2 * GND +WHITE 7 DAT0 * D8 +GREY 8 DAT1 D29 + +DAT0..3 PB18..21 (D8 D29 D20 D21) WHITE GREY PURPLE BLUE +CMD PA20 PCC_D? (D33) GREEN +CLK PA21 PCC_D? (D32) BROWN + +*/ + + pin_function_t *functions[6] = {}; + functions[0] = find_pin_function(sdio_cmd, command, -1, MP_QSTR_command); + int instance = functions[0]->instance; + functions[1] = find_pin_function(sdio_ck, clock, instance, MP_QSTR_clock); + functions[2] = find_pin_function(sdio_dat0, data[0], instance, MP_QSTR_data0); + if(num_data == 4) { + functions[3] = find_pin_function(sdio_dat1, data[1], instance, MP_QSTR_data1); + functions[4] = find_pin_function(sdio_dat2, data[2], instance, MP_QSTR_data2); + functions[5] = find_pin_function(sdio_dat3, data[3], instance, MP_QSTR_data3); + } + + // We've verified all pins, now set their special functions + self->command_pin = common_hal_mcu_pin_number(functions[0]->obj); + self->clock_pin = common_hal_mcu_pin_number(functions[1]->obj); + + for(int i=0; idata_pins[i] = common_hal_mcu_pin_number(function->obj); + } else { + self->data_pins[i] = COMMON_HAL_MCU_NO_PIN; + } + } + + for(size_t i=0; iobj) { + break; + } + + gpio_set_pin_direction(functions[i]->pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(functions[i]->pin, false); + // Enable pullups on all pins except CLK and DAT3 + gpio_set_pin_pull_mode(functions[i]->pin, + (i == 1 || i == 5) ? GPIO_PULL_OFF : GPIO_PULL_UP); + gpio_set_pin_function(functions[i]->pin, GPIO_PIN_FUNCTION_SDIO); + + common_hal_never_reset_pin(functions[i]->obj); + } + + self->num_data = num_data; + self->frequency = frequency; + + if(instance == 0) { + hri_mclk_set_AHBMASK_SDHC0_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID, CONF_GCLK_SDHC0_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC0_GCLK_ID_SLOW, CONF_GCLK_SDHC0_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + } else { +#ifdef SDHC1_GCLK_ID + hri_mclk_set_AHBMASK_SDHC1_bit(MCLK); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID, CONF_GCLK_SDHC1_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); + hri_gclk_write_PCHCTRL_reg(GCLK, SDHC1_GCLK_ID_SLOW, CONF_GCLK_SDHC1_SLOW_SRC | (1 << GCLK_PCHCTRL_CHEN_Pos)); +#endif + } + + DEBUG_PRINT("instance %d @%p\n", instance, sdhc_insts[instance]); + mci_sync_init(&self->IO_BUS, sdhc_insts[instance]); + sd_mmc_init(&self->IO_BUS, NULL, NULL); + + sd_mmc_err_t result = SD_MMC_INIT_ONGOING; + + for (int i=0; result == SD_MMC_INIT_ONGOING && i<100; i++) { + result = sd_mmc_check(0); + DEBUG_PRINT("sd_mmc_check(0) -> %d\n", result); + } + + if (result != SD_MMC_OK) { + mp_raise_OSError_msg_varg(translate("%q failure: %d"), MP_QSTR_sd_mmc_check, (int)result); + } + // sd_mmc_get_capacity() is in KiB, but our "capacity" is in 512-byte blocks + self->capacity = sd_mmc_get_capacity(0) * 2; + + DEBUG_PRINT("capacity=%u\n", self->capacity); +} + +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t *self) { + return self->capacity; +} + +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t *self) { + return self->frequency; // self->frequency; +} + +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t *self) { + return self->num_data; // self->width; +} + +STATIC void check_for_deinit(sdioio_sdcard_obj_t *self) { +} + +STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { + if (bufinfo->len % 512) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } +} + +STATIC void wait_write_complete(sdioio_sdcard_obj_t *self) { + if (self->state_programming) { + sd_mmc_wait_end_of_write_blocks(0); + self->state_programming = 0; + } +} + +STATIC void debug_print_state(sdioio_sdcard_obj_t *self, const char *what, sd_mmc_err_t r) { +#if DEBUG_SDIO + DEBUG_PRINT("%s: %d\n", what, r); +#endif +} + +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + self->state_programming = true; + sd_mmc_err_t r = sd_mmc_init_write_blocks(0, start_block, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_init_write_blocks", r); + return -EIO; + } + r = sd_mmc_start_write_blocks(bufinfo->buf, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_start_write_blocks", r); + return -EIO; + } + // debug_print_state(self, "after writeblocks OK"); + return 0; +} + +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t *self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + check_for_deinit(self); + check_whole_block(bufinfo); + wait_write_complete(self); + sd_mmc_err_t r = sd_mmc_init_read_blocks(0, start_block, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_init_read_blocks", r); + return -EIO; + } + r = sd_mmc_start_read_blocks(bufinfo->buf, bufinfo->len / 512); + if (r != SD_MMC_OK) { + debug_print_state(self, "sd_mmc_start_read_blocks", r); + return -EIO; + } + sd_mmc_wait_end_of_write_blocks(0); + return 0; +} + +bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t frequency, uint8_t bits) { + check_for_deinit(self); + return true; +} + +bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) { + return self->command_pin == COMMON_HAL_MCU_NO_PIN; +} + +void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) { + reset_pin_number(self->command_pin); + reset_pin_number(self->clock_pin); + reset_pin_number(self->data_pins[0]); + reset_pin_number(self->data_pins[1]); + reset_pin_number(self->data_pins[2]); + reset_pin_number(self->data_pins[3]); + + self->command_pin = COMMON_HAL_MCU_NO_PIN; + self->clock_pin = COMMON_HAL_MCU_NO_PIN; + self->data_pins[0] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[1] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[2] = COMMON_HAL_MCU_NO_PIN; + self->data_pins[3] = COMMON_HAL_MCU_NO_PIN; +} + +void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { +} diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.h b/ports/atmel-samd/common-hal/sdioio/SDCard.h new file mode 100644 index 0000000000..2baba38f0d --- /dev/null +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "hal_mci_sync.h" + +typedef struct { + mp_obj_base_t base; + struct mci_sync_desc IO_BUS; + uint32_t frequency; + uint32_t capacity; + uint8_t num_data:3, state_programming:1, has_lock:1; + uint8_t command_pin; + uint8_t clock_pin; + uint8_t data_pins[4]; +} sdioio_sdcard_obj_t; diff --git a/ports/atmel-samd/common-hal/sdioio/__init__.c b/ports/atmel-samd/common-hal/sdioio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/atmel-samd/common-hal/sdioio/__init__.h b/ports/atmel-samd/common-hal/sdioio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/mksdiodata.py b/tools/mksdiodata.py new file mode 100755 index 0000000000..0cce3819f3 --- /dev/null +++ b/tools/mksdiodata.py @@ -0,0 +1,40 @@ +#!/usr/bin/python3 + +def defines(name, function): + print(f'pin_function_t {name} [] = {{') + for instance in (0, 1): + for port in 'ABCD': + for idx in range(32): + pin = f'P{port}{idx:02d}' + pinmux = f'PINMUX_{pin}I_SDHC{instance}_{function}' + print(f'''\ +#if defined({pinmux}) && ! defined(IGNORE_PIN_{pin}) + {{&pin_{pin}, {instance}, PIN_{pin}, {pinmux} & 0xffff}}, +#endif''') + print(f'{{NULL, 0, 0}}') + print(f'}};') + print() + +print('''\ +#include +#include "py/obj.h" +#include "sam.h" +#include "samd/pins.h" +#include "mpconfigport.h" +#include "atmel_start_pins.h" +#include "hal/include/hal_gpio.h" + +typedef struct { + const mcu_pin_obj_t *obj; + uint8_t instance; + uint8_t pin; + uint16_t function; +} pin_function_t; +''') + +defines('sdio_ck', 'SDCK') +defines('sdio_cmd', 'SDCMD') +defines('sdio_dat0', 'SDDAT0') +defines('sdio_dat1', 'SDDAT1') +defines('sdio_dat2', 'SDDAT2') +defines('sdio_dat3', 'SDDAT3') From 0f2fb93d1416b0be1c9a2f94b0ef25eda8b05d1f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:15:30 -0500 Subject: [PATCH 875/919] Update shared-bindings/sdcardio/SDCard.c Co-authored-by: Scott Shawcroft --- shared-bindings/sdcardio/SDCard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c index 54ca39f806..1d8c4bafbe 100644 --- a/shared-bindings/sdcardio/SDCard.c +++ b/shared-bindings/sdcardio/SDCard.c @@ -50,7 +50,6 @@ //| :param busio.SPI spi: The SPI bus //| :param microcontroller.Pin cs: The chip select connected to the card //| :param int baudrate: The SPI data rate to use after card setup -//| :param busio.SDIO sdio: The SDIO bus. Mutually exclusive with spi and cs. //| //| Note that during detection and configuration, a hard-coded low baudrate is used. //| Data transfers use the specified baurate (rounded down to one that is supported by From c5db97c50f3dd2a8d71958b22efe9fe728e0d7f4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:16:16 -0500 Subject: [PATCH 876/919] atmel-sam: sdio: disable debug prints by default --- ports/atmel-samd/common-hal/sdioio/SDCard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 6014bd8abf..8cd077ecd7 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -42,7 +42,7 @@ #include "peripheral_clk_config.h" #ifndef DEBUG_SDIO -#define DEBUG_SDIO (1) +#define DEBUG_SDIO (0) #endif #if DEBUG_SDIO From 472a04ba4bd107575b42cab102e4849d6943779e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 13:17:00 -0500 Subject: [PATCH 877/919] sdioio: Remove junk in comments --- shared-bindings/sdioio/SDCard.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index c6b1d280ba..77b41ce127 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -285,20 +285,6 @@ STATIC const mp_rom_map_elem_t sdioio_sdcard_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&sdioio_sdcard_count_obj) }, { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&sdioio_sdcard_readblocks_obj) }, { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&sdioio_sdcard_writeblocks_obj) }, - -// Methods in STM HAL: -// InitCard -// ReadBlocks -// WriteBlocks -// Erase -// GetCardState -// GetCardCID -// GetCardCSD -// GetCardInfo -// GetState -// GetError -// Abort - }; STATIC MP_DEFINE_CONST_DICT(sdioio_sdcard_locals_dict, sdioio_sdcard_locals_dict_table); From a9f257bcd645b342bdc473e0ab2804a3c099126c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 12:32:56 -0700 Subject: [PATCH 878/919] Store host_id so that never reset works --- ports/esp32s2/common-hal/busio/SPI.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 686f44cbc2..60514df389 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -160,6 +160,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->clock_pin = clock; self->MOSI_pin = mosi; self->MISO_pin = miso; + self->host_id = host_id; spi_bus_lock_dev_config_t config = { .flags = 0 }; // The returned lock is stored in the bus lock but must be freed separately with From 2d579cc9953a3ba965973c6d5139c007b3c1b38d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 12:33:50 -0700 Subject: [PATCH 879/919] Use NULL for deinited DigitalInOut This fixes a Display issue where no backlight pin is given but it's still deinitialized. --- ports/esp32s2/common-hal/digitalio/DigitalInOut.c | 4 ++-- ports/litex/common-hal/digitalio/DigitalInOut.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c index 7745a9c0a3..fb3ee10ad7 100644 --- a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c +++ b/ports/esp32s2/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } reset_pin_number(self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c index 26f79f16df..53df637c43 100644 --- a/ports/litex/common-hal/digitalio/DigitalInOut.c +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -46,7 +46,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( } bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self) { - return self->pin == mp_const_none; + return self->pin == NULL; } void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self) { @@ -55,7 +55,7 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self } // reset_pin_number(0, self->pin->number); - self->pin = mp_const_none; + self->pin = NULL; } void common_hal_digitalio_digitalinout_switch_to_input( From 2019d47ed5b70eaf4da4175b9db47be7ba5f0441 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:04:04 -0500 Subject: [PATCH 880/919] redirects.txt: sort according to LANG=C.UTF-8 collation rules --- docs/redirects.txt | 144 ++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/docs/redirects.txt b/docs/redirects.txt index 28dc73aba2..20c730df43 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -1,15 +1,48 @@ -shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn -shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont -shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES -shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime -shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut -shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift -shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle -shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon -shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle -shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display @@ -22,73 +55,40 @@ shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palet shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid -shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad -shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew -shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder -shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer -shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice -shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut -shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn -shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut -shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest -shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray -shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C -shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire -shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI -shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART -shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity -shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array -shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode -shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer -shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut -shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 -shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn -shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix -shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 -shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn -shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut -shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device -shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K -shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError -shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError -shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError -shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError -shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter -shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address -shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute -shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic -shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer -shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection -shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor -shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer -shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry -shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults -shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service -shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID -shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode -shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample -shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile -shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay -shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut -shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn -shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter -shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat -shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut -shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction -shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode -shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull -shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C -shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire -shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC -shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn -shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut -shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer -shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K From 844f575a90630fa75f37abf0c089e638f98ec54e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:06:22 -0500 Subject: [PATCH 881/919] redirects: Add __init__ page redirects --- docs/redirects.txt | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/docs/redirects.txt b/docs/redirects.txt index 20c730df43..75965eff9b 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -1,3 +1,4 @@ +shared-bindings//__init__.rst shared-bindings// shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute @@ -14,35 +15,53 @@ shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResult shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/_bleio/__init__.rst shared-bindings/_bleio/ +shared-bindings/_eve/__init__.rst shared-bindings/_eve/ shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/_pew/__init__.rst shared-bindings/_pew/ shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/_pixelbuf/__init__.rst shared-bindings/_pixelbuf/ shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/_stage/__init__.rst shared-bindings/_stage/ shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/aesio/__init__.rst shared-bindings/aesio/ shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/analogio/__init__.rst shared-bindings/analogio/ shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/audiobusio/__init__.rst shared-bindings/audiobusio/ shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/audiocore/__init__.rst shared-bindings/audiocore/ shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/audioio/__init__.rst shared-bindings/audioio/ shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/audiomixer/__init__.rst shared-bindings/audiomixer/ shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/audiomp3/__init__.rst shared-bindings/audiomp3/ shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/audiopwmio/__init__.rst shared-bindings/audiopwmio/ shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/bitbangio/__init__.rst shared-bindings/bitbangio/ +shared-bindings/board/__init__.rst shared-bindings/board/ shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/__init__.rst shared-bindings/busio/ shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/countio/__init__.rst shared-bindings/countio/ shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/digitalio/__init__.rst shared-bindings/digitalio/ shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display @@ -55,40 +74,88 @@ shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palet shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/displayio/__init__.rst shared-bindings/displayio/ shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/fontio/__init__.rst shared-bindings/fontio/ shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/framebufferio/__init__.rst shared-bindings/framebufferio/ shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/frequencyio/__init__.rst shared-bindings/frequencyio/ shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/gamepad/__init__.rst shared-bindings/gamepad/ shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/gamepadshift/__init__.rst shared-bindings/gamepadshift/ +shared-bindings/gnss/__init__.rst shared-bindings/gnss/ +shared-bindings/i2cperipheral/__init__.rst shared-bindings/i2cperipheral/ +shared-bindings/i2csecondary/__init__.rst shared-bindings/i2csecondary/ shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheral shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cperipheral/#i2cperipheral.I2CPeripheralRequest +shared-bindings/math/__init__.rst shared-bindings/math/ shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/microcontroller/__init__.rst shared-bindings/microcontroller/ +shared-bindings/multiterminal/__init__.rst shared-bindings/multiterminal/ +shared-bindings/neopixel_write/__init__.rst shared-bindings/neopixel_write/ +shared-bindings/network/__init__.rst shared-bindings/network/ shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/nvm/__init__.rst shared-bindings/nvm/ +shared-bindings/os/__init__.rst shared-bindings/os/ +shared-bindings/protomatter/__init__.rst shared-bindings/protomatter/ shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/ps2io/__init__.rst shared-bindings/ps2io/ shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/pulseio/__init__.rst shared-bindings/pulseio/ +shared-bindings/random/__init__.rst shared-bindings/random/ shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/rgbmatrix/__init__.rst shared-bindings/rgbmatrix/ shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/rotaryio/__init__.rst shared-bindings/rotaryio/ shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/rtc/__init__.rst shared-bindings/rtc/ shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock +shared-bindings/samd/__init__.rst shared-bindings/samd/ +shared-bindings/socket/__init__.rst shared-bindings/socket/ shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/storage/__init__.rst shared-bindings/storage/ +shared-bindings/struct/__init__.rst shared-bindings/struct/ shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/supervisor/__init__.rst shared-bindings/supervisor/ shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/terminalio/__init__.rst shared-bindings/terminalio/ +shared-bindings/time/__init__.rst shared-bindings/time/ shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/touchio/__init__.rst shared-bindings/touchio/ +shared-bindings/uheap/__init__.rst shared-bindings/uheap/ +shared-bindings/ulab/__init__.rst shared-bindings/ulab/ +shared-bindings/ulab/approx/__init__.rst shared-bindings/ulab/approx/ shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/ulab/compare/__init__.rst shared-bindings/ulab/compare/ +shared-bindings/ulab/extras/__init__.rst shared-bindings/ulab/extras/ +shared-bindings/ulab/fft/__init__.rst shared-bindings/ulab/fft/ +shared-bindings/ulab/filter/__init__.rst shared-bindings/ulab/filter/ +shared-bindings/ulab/linalg/__init__.rst shared-bindings/ulab/linalg/ +shared-bindings/ulab/numerical/__init__.rst shared-bindings/ulab/numerical/ +shared-bindings/ulab/poly/__init__.rst shared-bindings/ulab/poly/ +shared-bindings/ulab/vector/__init__.rst shared-bindings/ulab/vector/ shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/usb_hid/__init__.rst shared-bindings/usb_hid/ shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_midi/__init__.rst shared-bindings/usb_midi/ +shared-bindings/ustack/__init__.rst shared-bindings/ustack/ shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/vectorio/__init__.rst shared-bindings/vectorio/ shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/watchdog/__init__.rst shared-bindings/watchdog/ shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/wiznet/__init__.rst shared-bindings/wiznet/ From 56367b197bdf8b6d4adced23b128fb45d17fbd27 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:23:42 -0500 Subject: [PATCH 882/919] docs: conf.py: Fix redirects for RTD --- conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index 38546a5d0a..8e4fbb23bb 100644 --- a/conf.py +++ b/conf.py @@ -391,12 +391,13 @@ TEMPLATE = """ def generate_redirects(app): path = os.path.join(app.srcdir, app.config.redirects_file) if not os.path.exists(path): - app.info("Could not find redirects file at '%s'" % path) + logging.info("Could not find redirects file at '%s'" % path) return - if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") + if not isinstance(app.builder, builders.StandaloneHTMLBuilder): logging.warn("The 'sphinxcontib-redirects' plugin is only supported " - "by the 'html' builder. Skipping...") + "by the 'html' builder and subclasses. Skipping...") return with open(path) as redirects: From e40539cacadd2967b8cdedf79963903d0668c1ca Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Jun 2020 15:28:20 -0500 Subject: [PATCH 883/919] docs: conf.py: fix logging about reidrects --- conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 8e4fbb23bb..43f689648d 100644 --- a/conf.py +++ b/conf.py @@ -391,13 +391,13 @@ TEMPLATE = """ def generate_redirects(app): path = os.path.join(app.srcdir, app.config.redirects_file) if not os.path.exists(path): - logging.info("Could not find redirects file at '%s'" % path) + logging.error("Could not find redirects file at '%s'" % path) return - logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") if not isinstance(app.builder, builders.StandaloneHTMLBuilder): logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder and subclasses. Skipping...") + logging.warn(f"Builder is {app.builder.name} ({type(app.builder)})") return with open(path) as redirects: From ba0911b0f6f03238d1f81b010f85192678fb7fa4 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 26 Jun 2020 17:01:25 -0500 Subject: [PATCH 884/919] add custom css for 'viewing-old-docs' message --- docs/static/customstyle.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/static/customstyle.css b/docs/static/customstyle.css index 6c964b762c..2f6e10bd83 100644 --- a/docs/static/customstyle.css +++ b/docs/static/customstyle.css @@ -9,7 +9,19 @@ margin: 4px; } +/* custom CSS to sticky the ' viewing outdated version' + warning +*/ +.document > .admonition { + position: sticky; + top: 0px; + background-color: salmon; + z-index: 2; +} +body { + overflow-x: unset!important; +} /* override table width restrictions */ @media screen and (min-width: 767px) { From 08749630a28527f45a01cbfa3c1db417030feacf Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 16:30:24 -0700 Subject: [PATCH 885/919] Fix SPI RX and remove debug prints --- ports/esp32s2/common-hal/busio/SPI.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 60514df389..73d7d0595e 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -32,10 +32,6 @@ #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/rgb_led_status.h" -#include "esp_log.h" - -static const char* TAG = "CircuitPython SPI"; - static bool spi_never_reset[SOC_SPI_PERIPH_NUM]; // Store one lock handle per device so that we can free it. @@ -101,8 +97,7 @@ static bool spi_bus_is_free(spi_host_device_t host_id) { } static void spi_interrupt_handler(void *arg) { - busio_spi_obj_t *self = arg; - ESP_LOGE(TAG, "SPI interrupt %p", self); + // busio_spi_obj_t *self = arg; } // The interrupt may get invoked by the bus lock. @@ -197,8 +192,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // hal->cs_hold = 0; // hal->cs_pin_id = 0; - hal->sio = 1; - // hal->half_duplex = 0; + hal->sio = 0; + hal->half_duplex = 0; // hal->tx_lsbfirst = 0; // hal->rx_lsbfirst = 0; hal->dma_enabled = 1; @@ -216,9 +211,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // This must be set after spi_hal_init. hal->timing_conf = &self->timing_conf; - if (hal->hw == NULL) { - ESP_LOGE(TAG, "SPI error %p", hal->hw); - } common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } @@ -280,11 +272,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, return false; } - ESP_LOGI(TAG, "configure"); - ESP_LOGI(TAG, "real frequency %d", self->real_frequency); - ESP_LOGI(TAG, "timing_conf %p", self->hal_context.timing_conf); spi_hal_setup_device(&self->hal_context); - ESP_LOGI(TAG, "setup done"); return true; } @@ -351,6 +339,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou while (!spi_hal_usr_is_done(hal)) { RUN_BACKGROUND_TASKS; } + spi_hal_fetch_result(hal); } return true; From 7f6bef3251d295120fe8f89e666b277dc2f596b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 26 Jun 2020 16:56:17 -0700 Subject: [PATCH 886/919] Remove debug prints --- ports/esp32s2/supervisor/internal_flash.c | 36 ++++++++--------------- ports/esp32s2/supervisor/port.c | 24 ++------------- 2 files changed, 15 insertions(+), 45 deletions(-) diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index a8d3fa485c..5cf77c8010 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -39,11 +39,6 @@ #include "esp-idf/components/spi_flash/include/esp_partition.h" -#include "esp_log.h" - - -static const char* TAG = "CircuitPython Internal Flash"; - #include "supervisor/usb.h" STATIC const esp_partition_t * _partition; @@ -52,8 +47,6 @@ void supervisor_flash_init(void) { _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, NULL); - - ESP_EARLY_LOGW(TAG, "fatfs partition %p", _partition); } uint32_t supervisor_flash_get_block_size(void) { @@ -74,11 +67,10 @@ STATIC uint8_t _cache[SECTOR_SIZE]; STATIC uint32_t _cache_lba; mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { - esp_err_t ok = esp_partition_read(_partition, - block * FILESYSTEM_BLOCK_SIZE, - dest, - num_blocks * FILESYSTEM_BLOCK_SIZE); - ESP_EARLY_LOGW(TAG, "read %d", ok); + esp_partition_read(_partition, + block * FILESYSTEM_BLOCK_SIZE, + dest, + num_blocks * FILESYSTEM_BLOCK_SIZE); return 0; } @@ -90,13 +82,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 uint32_t sector_offset = block_address / blocks_per_sector * SECTOR_SIZE; uint8_t block_offset = block_address % blocks_per_sector; - esp_err_t result; if (_cache_lba != block_address) { - result = esp_partition_read(_partition, - sector_offset, - _cache, - SECTOR_SIZE); - ESP_EARLY_LOGW(TAG, "flash read before write %d", result); + esp_partition_read(_partition, + sector_offset, + _cache, + SECTOR_SIZE); _cache_lba = sector_offset; } for (uint8_t b = block_offset; b < blocks_per_sector; b++) { @@ -109,11 +99,11 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 FILESYSTEM_BLOCK_SIZE); block++; } - result = esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); - result = esp_partition_write(_partition, - sector_offset, - _cache, - SECTOR_SIZE); + esp_partition_erase_range(_partition, sector_offset, SECTOR_SIZE); + esp_partition_write(_partition, + sector_offset, + _cache, + SECTOR_SIZE); } return 0; // success diff --git a/ports/esp32s2/supervisor/port.c b/ports/esp32s2/supervisor/port.c index ebf0020399..a80550b309 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/esp32s2/supervisor/port.c @@ -41,10 +41,6 @@ #include "supervisor/memory.h" #include "supervisor/shared/tick.h" -#include "esp_log.h" - -static const char* TAG = "CircuitPython"; - STATIC esp_timer_handle_t _tick_timer; void tick_timer_cb(void* arg) { @@ -57,12 +53,8 @@ safe_mode_t port_init(void) { args.arg = NULL; args.dispatch_method = ESP_TIMER_TASK; args.name = "CircuitPython Tick"; - esp_err_t result = esp_timer_create(&args, &_tick_timer); - if (result != ESP_OK) { - ESP_EARLY_LOGE(TAG, "Unable to create tick timer."); - } + esp_timer_create(&args, &_tick_timer); never_reset_module_internal_pins(); - ESP_EARLY_LOGW(TAG, "port init done"); return NO_SAFE_MODE; } @@ -109,12 +101,8 @@ uint32_t *port_stack_get_top(void) { supervisor_allocation _fixed_stack; supervisor_allocation* port_fixed_stack(void) { - - ESP_EARLY_LOGW(TAG, "port fixed stack"); _fixed_stack.ptr = port_stack_get_limit(); - ESP_EARLY_LOGW(TAG, "got limit %p", _fixed_stack.ptr); _fixed_stack.length = (port_stack_get_top() - port_stack_get_limit()) * sizeof(uint32_t); - ESP_EARLY_LOGW(TAG, "got length %d", _fixed_stack.length); return &_fixed_stack; } @@ -139,10 +127,7 @@ uint64_t port_get_raw_ticks(uint8_t* subticks) { // Enable 1/1024 second tick. void port_enable_tick(void) { - esp_err_t result = esp_timer_start_periodic(_tick_timer, 1000000 / 1024); - if (result != ESP_OK) { - ESP_EARLY_LOGE(TAG, "Unable to start tick timer."); - } + esp_timer_start_periodic(_tick_timer, 1000000 / 1024); } // Disable 1/1024 second tick. @@ -153,14 +138,12 @@ void port_disable_tick(void) { TickType_t sleep_time_set; TickType_t sleep_time_duration; void port_interrupt_after_ticks(uint32_t ticks) { - // ESP_EARLY_LOGW(TAG, "after ticks"); sleep_time_set = xTaskGetTickCount(); sleep_time_duration = ticks / portTICK_PERIOD_MS; // esp_sleep_enable_timer_wakeup(uint64_t time_in_us) } void port_sleep_until_interrupt(void) { - // ESP_EARLY_LOGW(TAG, "sleep until"); // FreeRTOS delay here maybe. // Light sleep shuts down BLE and wifi. // esp_light_sleep_start() @@ -174,8 +157,5 @@ void port_sleep_until_interrupt(void) { // Wrap main in app_main that the IDF expects. extern void main(void); void app_main(void) { - ESP_EARLY_LOGW(TAG, "Hello from CircuitPython"); - // ESP_LOGW(TAG, "Hello from CircuitPython"); - main(); } From bbedd43273fe404c5da151b9c12ab4a1ad02748d Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sat, 27 Jun 2020 13:27:42 -0400 Subject: [PATCH 887/919] change CMake verision requirement --- frozen/Adafruit_CircuitPython_RFM9x | 1 + ports/esp32s2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 frozen/Adafruit_CircuitPython_RFM9x diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x new file mode 160000 index 0000000000..6485df1279 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -0,0 +1 @@ +Subproject commit 6485df1279aac2d42a86861d27df5e692efbfc78 diff --git a/ports/esp32s2/CMakeLists.txt b/ports/esp32s2/CMakeLists.txt index c99c1c7e78..716588cf22 100644 --- a/ports/esp32s2/CMakeLists.txt +++ b/ports/esp32s2/CMakeLists.txt @@ -1,6 +1,6 @@ # The following five lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.13) set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) set(COMPONENTS esptool_py soc driver log main) From 501512552639c6dfd08a37149fbb9564237eb11a Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Sun, 28 Jun 2020 05:23:07 -0400 Subject: [PATCH 888/919] remove extra frozen folder --- frozen/Adafruit_CircuitPython_RFM9x | 1 - 1 file changed, 1 deletion(-) delete mode 160000 frozen/Adafruit_CircuitPython_RFM9x diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x deleted file mode 160000 index 6485df1279..0000000000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6485df1279aac2d42a86861d27df5e692efbfc78 From 39fc16deae265c691c4057d270641e5fd63fb166 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 25 Jun 2020 18:08:47 +0200 Subject: [PATCH 889/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ae057fbd7a..5a20dd965a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index b23144fc8c..4fc8309216 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index eff611b20d..dfe85323ab 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" diff --git a/locale/es.po b/locale/es.po index 22597249bd..7c0203565d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index e4c5678d27..8652cca634 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 5a49fd5f91..8fb8a72a1f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index c47d0e8e3e..a0cc25b740 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index 156f40d9b6..edab1d7377 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/nl.po b/locale/nl.po index 77cc11cab3..f7586d7432 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" diff --git a/locale/pl.po b/locale/pl.po index 888ce64285..ca32e190e3 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e951df1080..68c829ca57 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index df2431c4e0..f7c1278c6d 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4f85c5fa86..16f79f8ff2 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-24 11:10+0200\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From b0440a90a7f1d2833cc3570f8d362e1a75d58fae Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 25 Jun 2020 19:51:56 +0200 Subject: [PATCH 890/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 2 +- locale/cs.po | 2 +- locale/de_DE.po | 2 +- locale/es.po | 2 +- locale/fil.po | 2 +- locale/fr.po | 2 +- locale/it_IT.po | 2 +- locale/ko.po | 2 +- locale/nl.po | 2 +- locale/pl.po | 2 +- locale/pt_BR.po | 2 +- locale/sv.po | 2 +- locale/zh_Latn_pinyin.po | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5a20dd965a..ae057fbd7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/cs.po b/locale/cs.po index 4fc8309216..b23144fc8c 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" diff --git a/locale/de_DE.po b/locale/de_DE.po index dfe85323ab..eff611b20d 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" diff --git a/locale/es.po b/locale/es.po index 7c0203565d..22597249bd 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-24 18:32+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" diff --git a/locale/fil.po b/locale/fil.po index 8652cca634..e4c5678d27 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" diff --git a/locale/fr.po b/locale/fr.po index 8fb8a72a1f..5a49fd5f91 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" diff --git a/locale/it_IT.po b/locale/it_IT.po index a0cc25b740..c47d0e8e3e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" diff --git a/locale/ko.po b/locale/ko.po index edab1d7377..156f40d9b6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" diff --git a/locale/nl.po b/locale/nl.po index f7586d7432..77cc11cab3 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" diff --git a/locale/pl.po b/locale/pl.po index ca32e190e3..888ce64285 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 68c829ca57..e951df1080 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/locale/sv.po b/locale/sv.po index f7c1278c6d..df2431c4e0 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 16f79f8ff2..4f85c5fa86 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-24 11:10+0200\n" +"POT-Creation-Date: 2020-06-25 11:44-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" From c9d8cfc9faa3a7e351de0b5d789e7fa3a85ac333 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Fri, 26 Jun 2020 09:11:07 +0000 Subject: [PATCH 891/919] Translated using Weblate (Portuguese (Brazil)) Currently translated at 24.3% (185 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 109 +++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index e951df1080..33d98d5bdb 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -3,25 +3,28 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2018-10-02 21:14-0000\n" -"Last-Translator: \n" +"PO-Revision-Date: 2020-06-26 16:42+0000\n" +"Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.2-dev\n" #: main.c msgid "" "\n" "Code done running. Waiting for reload.\n" msgstr "" +"\n" +"O código concluiu a execução. Esperando pela recarga.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -29,12 +32,17 @@ msgid "" "Please file an issue with the contents of your CIRCUITPY drive at \n" "https://github.com/adafruit/circuitpython/issues\n" msgstr "" +"\n" +"Registre um problema com o conteúdo do seu controlador no CIRCUITPY\n" +"https://github.com/adafruit/circuitpython/issues\n" #: supervisor/shared/safe_mode.c msgid "" "\n" "To exit, please reset the board without " msgstr "" +"\n" +"Para encerrar, redefina a placa sem " #: py/obj.c msgid " File \"%q\"" @@ -56,7 +64,7 @@ msgstr "%%c requer int ou char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "" +msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -78,18 +86,16 @@ msgstr "" #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c #: shared-bindings/vectorio/Rectangle.c -#, fuzzy msgid "%q must be >= 1" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "%q deve ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" msgstr "" #: shared-bindings/fontio/BuiltinFont.c -#, fuzzy msgid "%q should be an int" -msgstr "y deve ser um int" +msgstr "%q deve ser um int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -261,9 +267,9 @@ msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" #: shared-bindings/_bleio/Address.c -#, fuzzy, c-format +#, c-format msgid "Address must be %d bytes long" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "O endereço deve ter %d bytes de comprimento" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" @@ -278,9 +284,8 @@ msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "All UART peripherals are in use" -msgstr "Todos os periféricos I2C estão em uso" +msgstr "Todos os periféricos UART estão em uso" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" @@ -435,14 +440,13 @@ msgstr "" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c -#, fuzzy, c-format +#, c-format msgid "Bus pin %d is already in use" -msgstr "DAC em uso" +msgstr "O pino bus %d já está em uso" #: shared-bindings/_bleio/UUID.c -#, fuzzy msgid "Byte buffer must be 16 bytes." -msgstr "buffers devem ser o mesmo tamanho" +msgstr "O buffer deve ter 16 bytes." #: shared-bindings/nvm/ByteArray.c msgid "Bytes must be between 0 and 255." @@ -471,9 +475,8 @@ msgid "Cannot get pull while in output mode" msgstr "" #: ports/nrf/common-hal/microcontroller/Processor.c -#, fuzzy msgid "Cannot get temperature" -msgstr "Não pode obter a temperatura. status: 0x%02x" +msgstr "Não é possível obter a temperatura" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." @@ -527,7 +530,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." -msgstr "Não é possível ler sem um pino MOSI" +msgstr "Não é possível fazer a escrita sem um pino MOSI." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -561,9 +564,8 @@ msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c -#, fuzzy msgid "Command must be an int between 0 and 255" -msgstr "Os bytes devem estar entre 0 e 255." +msgstr "O comando deve ser um int entre 0 e 255" #: shared-bindings/_bleio/Connection.c msgid "" @@ -659,9 +661,8 @@ msgid "Data chunk must follow fmt chunk" msgstr "Pedaço de dados deve seguir o pedaço de cortes" #: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy msgid "Data too large for advertisement packet" -msgstr "Não é possível ajustar dados no pacote de anúncios." +msgstr "Os dados são grandes demais para o pacote de publicidade" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -713,9 +714,8 @@ msgstr "Esperado um" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/Descriptor.c shared-bindings/_bleio/PacketBuffer.c -#, fuzzy msgid "Expected a Characteristic" -msgstr "Não é possível adicionar Característica." +msgstr "Uma característica é necessária" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" @@ -723,9 +723,8 @@ msgstr "" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c -#, fuzzy msgid "Expected a UUID" -msgstr "Esperado um" +msgstr "Um UUID é necessário" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" @@ -749,9 +748,9 @@ msgid "Failed sending command." msgstr "Falha ao enviar comando." #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to acquire mutex, err 0x%04x" -msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -779,9 +778,9 @@ msgid "Failed to parse MP3 file" msgstr "" #: ports/nrf/sd_mutex.c -#, fuzzy, c-format +#, c-format msgid "Failed to release mutex, err 0x%04x" -msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +msgstr "Houve uma falha ao liberar o mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." @@ -911,9 +910,8 @@ msgid "Invalid bits per value" msgstr "" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -#, fuzzy msgid "Invalid buffer size" -msgstr "Arquivo inválido" +msgstr "O tamanho do buffer é inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" @@ -924,13 +922,12 @@ msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid channel count" -msgstr "certificado inválido" +msgstr "A contagem do canal é inválido" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." -msgstr "Direção inválida" +msgstr "Direção inválida." #: shared-module/audiocore/WaveFile.c msgid "Invalid file" @@ -1008,9 +1005,8 @@ msgid "Invalid voice" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "Invalid voice count" -msgstr "certificado inválido" +msgstr "A contagem da voz é inválida" #: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" @@ -1046,7 +1042,7 @@ msgstr "" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "Inicialização do pino MISO falhou" +msgstr "A inicialização do pino MISO falhou." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." @@ -1187,9 +1183,8 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "Not connected" -msgstr "Não é possível conectar-se ao AP" +msgstr "Não Conectado" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c @@ -1203,9 +1198,8 @@ msgstr "" "Objeto foi desinicializado e não pode ser mais usaado. Crie um novo objeto." #: ports/nrf/common-hal/busio/UART.c -#, fuzzy msgid "Odd parity is not supported" -msgstr "I2C operação não suportada" +msgstr "A paridade ímpar não é compatível" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1276,9 +1270,8 @@ msgid "" msgstr "" #: py/builtinhelp.c -#, fuzzy msgid "Plus any modules on the filesystem\n" -msgstr "Não é possível remontar o sistema de arquivos" +msgstr "Além de quaisquer módulos no sistema de arquivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" @@ -1347,9 +1340,8 @@ msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" #: shared-module/displayio/Bitmap.c -#, fuzzy msgid "Read-only object" -msgstr "Somente leitura" +msgstr "Objeto de leitura apenas" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" @@ -1638,9 +1630,8 @@ msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" #: shared-module/displayio/display_core.c -#, fuzzy msgid "Unsupported display bus type" -msgstr "Taxa de transmissão não suportada" +msgstr "Não há suporte para o tipo do display bus" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" @@ -1716,7 +1707,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " -msgstr "Você solicitou o início do modo de segurança" +msgstr "Você solicitou o início do modo de segurança através do " #: py/objtype.c msgid "__init__() should return None" @@ -1830,23 +1821,20 @@ msgid "bits must be 7, 8 or 9" msgstr "" #: shared-bindings/audiomixer/Mixer.c -#, fuzzy msgid "bits_per_sample must be 8 or 16" -msgstr "bits devem ser 8" +msgstr "bits_per_sample deve ser 8 ou 16" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" -msgstr "Calibração está fora do intervalo" +msgstr "ramo fora do alcance" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" msgstr "" #: shared-module/struct/__init__.c -#, fuzzy msgid "buffer size must match format" -msgstr "buffers devem ser o mesmo tamanho" +msgstr "o tamanho do buffer deve coincidir com o formato" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" @@ -2193,9 +2181,8 @@ msgid "end of format while looking for conversion specifier" msgstr "" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "end_x should be an int" -msgstr "y deve ser um int" +msgstr "end_x deve ser um int" #: ports/nrf/common-hal/busio/UART.c #, c-format @@ -3015,9 +3002,8 @@ msgid "start/end indices" msgstr "" #: shared-bindings/displayio/Shape.c -#, fuzzy msgid "start_x should be an int" -msgstr "y deve ser um int" +msgstr "start_x deve ser um int" #: shared-bindings/random/__init__.c msgid "step must be non-zero" @@ -3093,9 +3079,8 @@ msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy msgid "timeout must be >= 0.0" -msgstr "bits devem ser 8" +msgstr "o tempo limite deve ser >= 0,0" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" From 87e4f47866853c938a5a624c5a1a416a831692c8 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 00:17:12 -0500 Subject: [PATCH 892/919] docs/shared_bindings_matrix.py: changes to allow usage in 'tools/build_board_info.py'; includes root dir finder, and output board name option. --- docs/shared_bindings_matrix.py | 49 +++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 02ef683492..c0d07d4b41 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -23,6 +23,7 @@ import json import os +import pathlib import re import subprocess import sys @@ -30,17 +31,39 @@ import sys SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] +def get_circuitpython_root_dir(): + """ The path to the root './circuitpython' directory + """ + cwd = pathlib.Path('.').resolve() + cwd_parts = cwd.parts + + root_idx = len(cwd_parts) + + # Search the path from tail to head, so that we capture the + # deepest folder. This avoids overshooting in instances like: + # '/home/user/circuitpython_v5/circuitpython' + for idx, val in enumerate(cwd_parts[::-1]): + if val.startswith("circuitpython"): + root_idx = root_idx - idx + break + + root_dir = '/'.join(cwd_parts[:root_idx]) + + return pathlib.Path(root_dir).resolve() + def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names """ - return [item for item in os.listdir("./shared-bindings")] + shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings" + return [item.name for item in shared_bindings_dir.iterdir()] def read_mpconfig(): """ Open 'circuitpy_mpconfig.mk' and return the contents. """ configs = [] - with open("py/circuitpy_mpconfig.mk") as mpconfig: + cpy_mpcfg = get_circuitpython_root_dir() / "py" / "circuitpy_mpconfig.mk" + with open(cpy_mpcfg) as mpconfig: configs = mpconfig.read() return configs @@ -120,7 +143,7 @@ def lookup_setting(settings, key, default=''): key = value[2:-1] return value -def support_matrix_by_board(): +def support_matrix_by_board(use_branded_name=True): """ Compiles a list of the available core modules available for each board. """ @@ -129,20 +152,22 @@ def support_matrix_by_board(): boards = dict() for port in SUPPORTED_PORTS: - port_dir = "ports/{}/boards".format(port) - for entry in os.scandir(port_dir): + 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(f'ports/{port}', entry.name) + settings = get_settings_from_makefile(str(port_dir), entry.name) - with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name: - board_contents = get_name.read() - board_name_re = re.search("(?<=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(os.path.join(entry.path, "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: From 928433f2e3d16ac04032f495fa4a83fd4a296ca3 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 00:27:45 -0500 Subject: [PATCH 893/919] tools/build_board_info.py: add built-in modules information for each board for use on circuitpython.org; uses 'docs/shared_bindings_matrix.py' --- tools/build_board_info.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 6c670930f4..20a5866b7f 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -9,6 +9,9 @@ import base64 from datetime import date from sh.contrib import git +sys.path.append("../docs") +import shared_bindings_matrix + sys.path.append("adabot") import adabot.github_requests as github @@ -246,6 +249,10 @@ def generate_download_info(): languages = get_languages() + support_matrix = shared_bindings_matrix.support_matrix_by_board( + use_branded_name=False + ) + new_stable = "-" not in new_tag previous_releases = set() @@ -283,6 +290,7 @@ def generate_download_info(): new_version = { "stable": new_stable, "version": new_tag, + "modules": support_matrix.get(alias, "[]"), "files": {} } for language in languages: From d911dc98d9a9acd76a337232933ee0776370a66c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 01:09:04 -0500 Subject: [PATCH 894/919] docs/shared_binding_matrix.py: fix usage with the branded name (building docs) --- docs/shared_bindings_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index c0d07d4b41..12a7b7eb86 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -162,7 +162,7 @@ def support_matrix_by_board(use_branded_name=True): settings = get_settings_from_makefile(str(port_dir), entry.name) if use_branded_name: - with open(os.path.join(entry.path, "mpconfigboard.h")) as get_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) From 0dd17f441805ef584a31294060e4a9101cbe7f7d Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Mon, 29 Jun 2020 16:22:41 +0800 Subject: [PATCH 895/919] Add: Added Seeed Wio Terminal board support --- .github/workflows/build.yml | 1 + .../boards/seeeduino_wio_terminal/board.c | 39 ++++++++++++++ .../seeeduino_wio_terminal/mpconfigboard.h | 32 ++++++++++++ .../seeeduino_wio_terminal/mpconfigboard.mk | 14 +++++ .../boards/seeeduino_wio_terminal/pins.c | 52 +++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/board.c create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd357e78ef..50b9cfeb4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,6 +240,7 @@ jobs: - "sam32" - "same54_xplained" - "seeeduino_xiao" + - "seeeduino_wio_terminal" - "serpente" - "shirtty" - "simmel" diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c new file mode 100644 index 0000000000..0f60736a24 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h new file mode 100644 index 0000000000..5409d6ca91 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -0,0 +1,32 @@ +#define MICROPY_HW_BOARD_NAME "Seeeduino Wio Terminal" +#define MICROPY_HW_MCU_NAME "samd51p19" + +// Rev E + +#define MICROPY_HW_LED_STATUS (&pin_PA15) + +// These are pins not to reset. +// QSPI Data pins +#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11) +// QSPI CS, QSPI SCK and NeoPixel pin +#define MICROPY_PORT_B (PORT_PB03 | PORT_PB10 | PORT_PB11) +#define MICROPY_PORT_C (0) +#define MICROPY_PORT_D (0) + +#define EXTERNAL_FLASH_QSPI_DUAL + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA16) +#define DEFAULT_I2C_BUS_SDA (&pin_PA17) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB03) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB02) +#define DEFAULT_SPI_BUS_MISO (&pin_PB00) + +#define DEFAULT_UART_BUS_RX (&pin_PB27) +#define DEFAULT_UART_BUS_TX (&pin_PB26) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 \ No newline at end of file diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk new file mode 100644 index 0000000000..ad6a0f356c --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk @@ -0,0 +1,14 @@ +USB_VID = 0x2886 +USB_PID = 0x802d +USB_PRODUCT = "Seeeduino Wio Terminal" +USB_MANUFACTURER = "Seeed" + +CHIP_VARIANT = SAMD51P19A +CHIP_FAMILY = samd51 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" +LONGINT_IMPL = MPZ + +CIRCUITPY_VECTORIO = 1 \ No newline at end of file diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c new file mode 100644 index 0000000000..deaffe80d4 --- /dev/null +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -0,0 +1,52 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + + // Analog pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA06) }, + + // Digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, // MP_QSTR_SDA + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA16) }, //MP_QSTR_SCL + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA15) }, // MP_QSTR_LED + + // UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB26) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB27) }, + + // SPI pins + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA00) }, + + // I2C pins + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, + + // LED pins + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA15) }, // status + + // Comm objects + { 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); \ No newline at end of file From 4613f80d7a049acc61332da59341a900ae0208f7 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Mon, 29 Jun 2020 17:41:48 +0800 Subject: [PATCH 896/919] Fix end of line --- ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h | 2 +- ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h index 5409d6ca91..f7d0448df9 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -29,4 +29,4 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 \ No newline at end of file +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk index ad6a0f356c..f57e016b4e 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.mk @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ" LONGINT_IMPL = MPZ -CIRCUITPY_VECTORIO = 1 \ No newline at end of file +CIRCUITPY_VECTORIO = 1 diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index deaffe80d4..8c6260ce2c 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -49,4 +49,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); \ No newline at end of file +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From c84c30846cded89bfef889ae3bd92f9102fab816 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 29 Jun 2020 09:02:04 -0500 Subject: [PATCH 897/919] docs/shared_bindings_matrix.py: use '__file__' to ascertain root dir --- docs/shared_bindings_matrix.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 12a7b7eb86..4abf5b8859 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -34,22 +34,10 @@ SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm'] def get_circuitpython_root_dir(): """ The path to the root './circuitpython' directory """ - cwd = pathlib.Path('.').resolve() - cwd_parts = cwd.parts + file_path = pathlib.Path(__file__).resolve() + root_dir = file_path.parent.parent - root_idx = len(cwd_parts) - - # Search the path from tail to head, so that we capture the - # deepest folder. This avoids overshooting in instances like: - # '/home/user/circuitpython_v5/circuitpython' - for idx, val in enumerate(cwd_parts[::-1]): - if val.startswith("circuitpython"): - root_idx = root_idx - idx - break - - root_dir = '/'.join(cwd_parts[:root_idx]) - - return pathlib.Path(root_dir).resolve() + return root_dir def get_shared_bindings(): """ Get a list of modules in shared-bindings based on folder names From ceb2efcbc3b4b5e34fda51abed7bd1bfb4d5a6db Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 16:34:37 -0700 Subject: [PATCH 898/919] Add new UnexpectedMaker FeatherS2 to CI. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..80cbc9b748 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -371,6 +371,7 @@ jobs: board: - "espressif_saola_1_wroom" - "espressif_saola_1_wrover" + - "unexpectedmaker_feathers2" steps: - name: Set up Python 3.8 From fc0cb8fb293839e1ed22cc219ad8df995af02bd5 Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Sun, 28 Jun 2020 18:25:01 +0000 Subject: [PATCH 899/919] Translated using Weblate (Spanish) Currently translated at 89.0% (676 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 121 +++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 56 deletions(-) diff --git a/locale/es.po b/locale/es.po index 22597249bd..ebffaeb984 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-24 18:32+0000\n" +"PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" "Language: es\n" @@ -441,7 +441,7 @@ msgstr "Buffer demasiado grande e incapaz de asignar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Búfer muy corto por %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -592,7 +592,7 @@ msgstr "Código crudo corrupto" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "No se pudo inicializar el GNSS" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -628,7 +628,7 @@ msgstr "No se pudo iniciar la interrupción, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "No se pudo encontrar el decodificador" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -637,7 +637,7 @@ msgstr "No se pudo asignar el primer buffer" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "No se pudo encontrar el búfer de entrada" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -702,7 +702,7 @@ msgstr "Modo Drive no se usa cuando la dirección es input." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB solo opera sobre 16 bytes a la vez" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -1285,6 +1285,8 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"El pinout utiliza %d bytes por elemento, lo que consume más del ideal de %d " +"bytes. Si esto no se puede evitar, pase allow_inefficient=True al constructor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1321,7 +1323,7 @@ msgstr "PulseOut no es compatible con este chip" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Error de desinicializado del RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" @@ -1329,7 +1331,7 @@ msgstr "Error de inicialización de RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "Se especifica inversión de RS485 sin estar en modo RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1343,7 +1345,7 @@ msgstr "RTC no soportado en esta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" @@ -1435,7 +1437,7 @@ msgstr "Rebanadas no soportadas" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Los búferes de fuente y destino deben ser del mismo tamaño" #: extmod/modure.c msgid "Splitting with sub-captures" @@ -1472,6 +1474,8 @@ msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"El módulo de `microcontroller` fue utilizado para bootear en modo seguro. " +"Presione reset para salir del modo seguro.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1479,6 +1483,11 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"La alimentación de la microntroladora bajó. Asegúrate que tu fuente de " +"poder\n" +"pueda suplir suficiente energía para todo el circuito y presione reset (" +"luego de\n" +"expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1533,7 +1542,7 @@ msgstr "Muchos displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "Los datos totales a escribir son más grandes que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1545,7 +1554,7 @@ msgstr "Argumento tuple o struct_time requerido" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "No se pudo encontrar el búfer para UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" @@ -1643,6 +1652,8 @@ msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Problema no especificado. Puede ser que la señal de emparejamiento del otro " +"dispositivo fue declinada o ignorada." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c @@ -1650,9 +1661,8 @@ msgid "Unsupported baudrate" msgstr "Baudrate no soportado" #: shared-module/displayio/display_core.c -#, fuzzy msgid "Unsupported display bus type" -msgstr "tipo de bitmap no soportado" +msgstr "Sin capacidad de bus tipo display" #: shared-module/audiocore/WaveFile.c msgid "Unsupported format" @@ -1669,12 +1679,12 @@ msgstr "valor pull no soportado." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Tamaño del valor != del tamaño fijo requerido" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "Tamaño de valor > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" @@ -1682,7 +1692,7 @@ msgstr "funciones Viper actualmente no soportan más de 4 argumentos." #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "Tiempo de espera agotado para lectura de voltaje" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1730,7 +1740,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Estás en modo seguro: algo inesperado ha sucedido.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1772,7 +1782,7 @@ msgstr "addresses esta vacío" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "arctan2 se encuentra implementado solo para escalares y ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" @@ -1780,7 +1790,7 @@ msgstr "argumento es una secuencia vacía" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "El argumento para argsort debe ser un ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1797,7 +1807,7 @@ msgstr "argumento deberia ser un '%q' no un '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "argumentos deben ser ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -1805,7 +1815,7 @@ msgstr "array/bytes requeridos en el lado derecho" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "se trató de traer argmin/argmax de una secuencia vacía" #: py/objstr.c msgid "attributes not supported yet" @@ -1813,15 +1823,15 @@ msgstr "atributos aún no soportados" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "eje debe ser -1, 0, None o 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "eje debe ser -1, 0, o 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "eje debe ser None, 0, o 1" #: py/builtinevex.c msgid "bad compile mode" @@ -1852,9 +1862,8 @@ msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" #: py/emitinlinethumb.c -#, fuzzy msgid "branch not in range" -msgstr "El argumento de chr() no esta en el rango(256)" +msgstr "la rama no está dentro del rango" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" @@ -1883,7 +1892,7 @@ msgstr "codigo byte no implementado" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "byteorder no es una cadena" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -2065,7 +2074,7 @@ msgstr "no se puedo realizar importación relativa" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" -msgstr "" +msgstr "no se puede reformar el arreglo (forma de entrada/salida incompatible)" #: py/emitnative.c msgid "casting" @@ -2085,7 +2094,7 @@ msgstr "El argumento de chr() no esta en el rango(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "circle solo puede ser registrado con un pariente" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" @@ -2093,7 +2102,7 @@ msgstr "color buffer debe ser 3 bytes (RGB) ó 4 bytes (RGB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "el búfer de color debe ser un búfer, una tupla, una lista o un entero" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" @@ -2149,11 +2158,11 @@ msgstr "" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "los datos deben permitir iteración" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "los datos deben ser de igual tamaño" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2291,19 +2300,19 @@ msgstr "sistema de archivos debe proporcionar método de montaje" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "se debe poder llamar al primer argumento" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "el primer argumento debe ser una función" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "el primer argumento debe permitir iteración" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "el primer argumento debe ser ndarray" #: py/objtype.c msgid "first argument to super() must be type" @@ -2319,7 +2328,7 @@ msgstr "" #: py/objint.c msgid "float too big" -msgstr "" +msgstr "punto flotante muy grande" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" @@ -2352,7 +2361,7 @@ msgstr "" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "la función está implementada solo para escalares y ndarrays" #: py/argcheck.c #, c-format @@ -2411,7 +2420,7 @@ msgstr "formato incompleto" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "formato de llave incompleto" #: extmod/modubinascii.c msgid "incorrect padding" @@ -2419,7 +2428,7 @@ msgstr "relleno (padding) incorrecto" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "el índice está fuera de límites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2434,11 +2443,11 @@ msgstr "indices deben ser enteros" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "los índices deben ser enteros, particiones o listas de booleanos" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "los valores iniciales deben permitir iteración" #: py/compile.c msgid "inline assembler must be a function" @@ -2446,35 +2455,35 @@ msgstr "ensamblador en línea debe ser una función" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "el argumento de entrada debe ser un entero o una tupla de par" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "el tamaño del arreglo de entrada debe ser potencia de 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "los datos de entrada deben permitir iteración" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "la matriz de entrada es asimétrica" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "la matriz de entrada es singular" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "la entrada debe ser una matriz cuadrada" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "la entrada debe ser una tupla, lista, rango o ndarray" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "los vectores de entrada deben ser de igual tamaño" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" @@ -2491,7 +2500,7 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "el intervalo debe ser der rango %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2523,7 +2532,7 @@ msgstr "decorador de micropython inválido" #: shared-bindings/random/__init__.c msgid "invalid step" -msgstr "" +msgstr "paso inválido" #: py/compile.c py/parse.c msgid "invalid syntax" @@ -2552,11 +2561,11 @@ msgstr "issubclass() arg 2 debe ser una clase o tuple de clases" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "los iterables no son del mismo tamaño" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "las iteraciones no convergen" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -2587,7 +2596,7 @@ msgstr "argumento length no permitido para este tipo" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "el nivel debe ser entre 0 y 1" #: py/objarray.c msgid "lhs and rhs should be compatible" From 4d9fcc6ed01d88de8747df3b47e2aab387903a99 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 29 Jun 2020 22:48:56 +0000 Subject: [PATCH 900/919] Translated using Weblate (Portuguese (Brazil)) Currently translated at 56.9% (432 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 506 ++++++++++++++++++++++++++---------------------- 1 file changed, 279 insertions(+), 227 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 33d98d5bdb..6b921ffdfe 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-26 16:42+0000\n" +"PO-Revision-Date: 2020-06-29 22:52+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -64,7 +64,7 @@ msgstr "%%c requer int ou char" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" -msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" +msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -72,15 +72,15 @@ msgstr "%q em uso" #: py/obj.c msgid "%q index out of range" -msgstr "" +msgstr "O índice %q está fora do intervalo" #: py/obj.c msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "Os índices %q devem ser inteiros, e não %s" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" -msgstr "" +msgstr "A lista %q deve ser uma lista" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -91,7 +91,7 @@ msgstr "%q deve ser >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" -msgstr "" +msgstr "%q deve ser uma tupla de comprimento 2" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -99,7 +99,7 @@ msgstr "%q deve ser um int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "" +msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" #: py/argcheck.c msgid "'%q' argument required" @@ -108,98 +108,100 @@ msgstr "'%q' argumento(s) requerido(s)" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "" +msgstr "'%s' exige um rótulo" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "" +msgstr "'%s' exige um registro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "" +msgstr "'%s' exige um registro especial" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "" +msgstr "'%s' exige um registro FPU" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an address of the form [a, b]" -msgstr "" +msgstr "'%s' exige um endereço no formato [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "" +msgstr "'%s' exige um número inteiro" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects at most r%d" -msgstr "" +msgstr "'%s' exige no máximo r%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s' exige {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "" +msgstr "O número inteiro '%s' %d não está dentro do intervalo %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "" +msgstr "O número inteiro '%s' 0x%x não cabe na máscara 0x%x" #: py/runtime.c msgid "'%s' object cannot assign attribute '%q'" -msgstr "" +msgstr "O objeto '%s' não pode definir o atributo '%q'" #: py/proto.c msgid "'%s' object does not support '%q'" -msgstr "" +msgstr "O objeto '%s' não é compatível com '%q'" #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" -msgstr "" +msgstr "O objeto '%s' não compatível com a atribuição dos itens" #: py/obj.c #, c-format msgid "'%s' object does not support item deletion" -msgstr "" +msgstr "O objeto '%s' não é compatível com exclusão do item" #: py/runtime.c msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "O objeto '%s' não possui o atributo '%q'" #: py/runtime.c #, c-format msgid "'%s' object is not an iterator" -msgstr "" +msgstr "O objeto '%s' não é um iterador" #: py/objtype.c py/runtime.c #, c-format msgid "'%s' object is not callable" -msgstr "" +msgstr "O objeto '%s' não é invocável" #: py/runtime.c #, c-format msgid "'%s' object is not iterable" -msgstr "" +msgstr "O objeto '%s' não é iterável" #: py/obj.c #, c-format msgid "'%s' object is not subscriptable" -msgstr "" +msgstr "O objeto '%s' não é subroteirizável" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" msgstr "" +"'=' alinhamento não permitido no especificador do formato da cadeia de " +"caracteres" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -207,59 +209,59 @@ msgstr "'S' e 'O' não são tipos de formato suportados" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "O 'align' exige 1 argumento" #: py/compile.c msgid "'async for' or 'async with' outside async function" -msgstr "" +msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'aguardar' fora da função" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' fora do loop" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' fora do loop" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' exige pelo menos 2 argumentos" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' exige argumentos inteiros" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' exige 1 argumento" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "função externa 'return'" #: py/compile.c msgid "'yield' outside function" -msgstr "" +msgstr "função externa 'yield'" #: py/compile.c msgid "*x must be assignment target" -msgstr "" +msgstr "*x deve ser o destino da atribuição" #: py/obj.c msgid ", in %q\n" -msgstr "" +msgstr ", em %q\n" #: py/objcomplex.c msgid "0.0 to a complex power" -msgstr "" +msgstr "0,0 para uma potência complexa" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "3-arg pow() não compatível" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -273,7 +275,7 @@ msgstr "O endereço deve ter %d bytes de comprimento" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "" +msgstr "O tipo do endereço está fora do alcance" #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" @@ -293,7 +295,7 @@ msgstr "Todos os canais de eventos em uso" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "" +msgstr "Todos os canais dos eventos de sincronização em uso" #: shared-bindings/pulseio/PWMOut.c msgid "All timers for this pin are in use" @@ -313,11 +315,11 @@ msgstr "Todos os temporizadores em uso" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Já está anunciando." #: ports/cxd56/common-hal/analogio/AnalogIn.c msgid "AnalogIn not supported on given pin" -msgstr "" +msgstr "O AnalogIn não é compatível no pino informado" #: ports/cxd56/common-hal/analogio/AnalogOut.c #: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -327,7 +329,7 @@ msgstr "Funcionalidade AnalogOut não suportada" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" +msgstr "O AnalogOut é de apenas 16 bits. O valor deve ser menor que 65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -344,15 +346,17 @@ msgstr "Array deve conter meias palavras (tipo 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Os valores da matriz devem ser bytes simples." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Pelo menos %d %q pode ser definido (não %d)" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" +"A tentativa da área de alocação dinâmica de variáveis (heap) quando o " +"MicroPython VM não está em execução." #: main.c msgid "Auto-reload is off.\n" @@ -363,19 +367,23 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" +"O recarregamento automático está ativo. Simplesmente salve os arquivos via " +"USB para executá-los ou digite REPL para desativar.\n" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Abaixo da taxa mínima de quadros" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "" +"O clock de bits e a seleção de palavras devem compartilhar uma unidade de " +"clock" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "A profundidade de bits deve ser o múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -389,7 +397,7 @@ msgstr "Ambos os pinos devem suportar interrupções de hardware" #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "O brilho deve ser 0-1,0" #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" @@ -398,12 +406,12 @@ msgstr "O brilho deve estar entre 0 e 255" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Brilho não ajustável" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "O buffer + desvio é muito pequeno %d %d %d" #: shared-module/usb_hid/Device.c #, c-format @@ -413,30 +421,30 @@ msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "O buffer não é um bytearray." #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "O buffer é muito pequeno" #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "" +msgstr "O comprimento do buffer deve ter pelo menos 1" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Buffer too large and unable to allocate" -msgstr "" +msgstr "O buffer é muito grande e incapaz de alocar" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "O buffer é muito curto em %d bytes" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -454,15 +462,15 @@ msgstr "Os bytes devem estar entre 0 e 255." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Chame super().__init__() antes de acessar o objeto nativo." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Não é possível definir o CCCD com a característica local" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" @@ -472,7 +480,7 @@ msgstr "Não é possível excluir valores" #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "Não é possível obter pull enquanto está modo de saída" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" @@ -481,10 +489,12 @@ msgstr "Não é possível obter a temperatura" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" +"Não é possível ter respostas da verificação para os anúncios estendidos e " +"conectáveis." #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" -msgstr "" +msgstr "Não é possível emitir os dois canais no mesmo pino" #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -503,18 +513,19 @@ msgstr "Não é possível remontar '/' enquanto o USB estiver ativo." #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" +"Não é possível redefinir para o bootloader porque o mesmo não está presente." #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Não é possível definir o valor quando a direção é inserida." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Não é possível definir o RTS ou CTS no modo RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Não é possível subclassificar a fatia" #: shared-module/bitbangio/SPI.c msgid "Cannot transfer without MOSI and MISO pins." @@ -522,11 +533,11 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "Não é possível obter inequivocamente o tamanho do escalar" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" +msgstr "Não é possível variar a frequência em um timer que já esteja em uso" #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -534,17 +545,20 @@ msgstr "Não é possível fazer a escrita sem um pino MOSI." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "Escrita CharacteristicBuffer não informada" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "O núcleo principal do CircuitPython falhou feio. Ops!\n" #: supervisor/shared/safe_mode.c msgid "" "CircuitPython is in safe mode because you pressed the reset button during " "boot. Press again to exit safe mode.\n" msgstr "" +"O CircuitPython está no modo de segurança porque você pressionou o botão de " +"redefinição durante a inicialização. Pressione novamente para sair do modo " +"de segurança.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." @@ -560,7 +574,7 @@ msgstr "Unidade de Clock em uso" #: shared-bindings/_pew/PewPew.c msgid "Column entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "A entrada da coluna deve ser digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c @@ -572,14 +586,15 @@ msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"A conexão foi desconectada e não pode mais ser usada. Crie uma nova conexão." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" +msgstr "Arquivo .mpy corrompido" #: py/emitglue.c msgid "Corrupt raw code" -msgstr "" +msgstr "Código bruto corrompido" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -591,35 +606,35 @@ msgstr "Não foi possível inicializar o UART" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize channel" -msgstr "" +msgstr "Não foi possível inicializar o canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not initialize timer" -msgstr "" +msgstr "Não foi possível inicializar o temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init channel" -msgstr "" +msgstr "Não foi possível reiniciar o canal" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not re-init timer" -msgstr "" +msgstr "Não foi possível reiniciar o temporizador" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not restart PWM" -msgstr "" +msgstr "Não foi possível reiniciar o PWM" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Não foi possível iniciar o PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Não foi possível iniciar a interrupção, RX ocupado" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" +msgstr "Não foi possível alocar o decodificador" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -628,7 +643,7 @@ msgstr "Não pôde alocar primeiro buffer" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" -msgstr "" +msgstr "Não foi possível alocar o buffer de entrada" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c @@ -637,15 +652,15 @@ msgstr "Não pôde alocar segundo buffer" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Falha no HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Erro de Inicialização do Canal DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Erro de Inicialização do Dispositivo DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -654,7 +669,7 @@ msgstr "DAC em uso" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "O pino de dados 0 deve ser alinhado por bytes" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" @@ -666,34 +681,34 @@ msgstr "Os dados são grandes demais para o pacote de publicidade" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "A capacidade do destino é menor que destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" +msgstr "Dispositivo em uso" #: ports/cxd56/common-hal/digitalio/DigitalInOut.c msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "O DigitalInOut não é compatível em um determinado pino" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "O monitor deve ter um espaço de cores com 16 bits." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" -msgstr "" +msgstr "A rotação da tela deve estar em incrementos de 90 graus" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "" +msgstr "O modo do controlador não é usado quando a direção for inserida." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "O BCE opera apenas com 16 bytes por vez" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -719,7 +734,7 @@ msgstr "Uma característica é necessária" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "" +msgstr "Esperava um Serviço" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -728,20 +743,20 @@ msgstr "Um UUID é necessário" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "" +msgstr "Um endereço esperado" #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" -msgstr "" +msgstr "Tupla esperada com comprimento %d, obteve %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." -msgstr "" +msgstr "Anúncios estendidos não compatíveis com a resposta da varredura." #: extmod/ulab/code/fft.c msgid "FFT is defined for ndarrays only" -msgstr "" +msgstr "O FFT é definido apenas para ndarrays" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." @@ -767,15 +782,15 @@ msgstr "Falha ao alocar buffer RX de %d bytes" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Falha ao conectar: erro interno" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" +msgstr "Falha ao conectar: tempo limite" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Falha ao analisar o arquivo MP3" #: ports/nrf/sd_mutex.c #, c-format @@ -784,7 +799,7 @@ msgstr "Houve uma falha ao liberar o mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Falha ao gravar o flash interno." #: py/moduerrno.c msgid "File exists" @@ -793,21 +808,23 @@ msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" +"A frequência capturada está acima da capacidade. A captura está em pausa." #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" +"A frequência deve coincidir com o PWMOut existente usando este temporizador" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "" +msgstr "A função requer bloqueio" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "O grupo já está em uso" #: shared-module/displayio/Group.c msgid "Group full" @@ -816,11 +833,11 @@ msgstr "Grupo cheio" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "O hardware está ocupado, tente os pinos alternativos" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" +msgstr "O hardware está em uso, tente os pinos alternativos" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -828,43 +845,45 @@ msgstr "Operação I/O no arquivo fechado" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" -msgstr "" +msgstr "Erro de inicialização do I2C" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "O IV deve ter %d bytes de comprimento" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte " +"http://adafru.it/mpy-update para mais informações." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "O tamanho do buffer está incorreto" #: py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Erro de entrada/saída" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Autenticação insuficiente" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Criptografia insuficiente" #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" -msgstr "" +msgstr "Erro interno de definição" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" -msgstr "" +msgstr "Erro interno #%d" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -873,7 +892,7 @@ msgstr "Pino do %q inválido" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" +msgstr "Valor inválido da unidade ADC" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -881,11 +900,11 @@ msgstr "Arquivo BMP inválido" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "O pino DAC informado é inválido" #: ports/stm/common-hal/busio/I2C.c msgid "Invalid I2C pin selection" -msgstr "" +msgstr "A seleção dos pinos I2C é inválido" #: ports/atmel-samd/common-hal/pulseio/PWMOut.c #: ports/cxd56/common-hal/pulseio/PWMOut.c @@ -895,11 +914,11 @@ msgstr "Frequência PWM inválida" #: ports/stm/common-hal/busio/SPI.c msgid "Invalid SPI pin selection" -msgstr "" +msgstr "A seleção do pino SPI é inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid UART pin selection" -msgstr "" +msgstr "A seleção dos pinos UART é inválido" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" @@ -907,7 +926,7 @@ msgstr "Argumento inválido" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" -msgstr "" +msgstr "Os valores por bits são inválidos" #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Invalid buffer size" @@ -915,11 +934,11 @@ msgstr "O tamanho do buffer é inválido" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "" +msgstr "A cadeia de bytes é inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" +msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" @@ -939,11 +958,11 @@ msgstr "Tamanho do pedaço de formato inválido" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid frequency supplied" -msgstr "" +msgstr "A frequência informada é inválida" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" +msgstr "O acesso da memória é inválido." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -981,28 +1000,28 @@ msgstr "Pinos inválidos" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "" +msgstr "Os pinos para o PWMOut são inválidos" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c msgid "Invalid polarity" -msgstr "" +msgstr "Polaridade inválida" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "" +msgstr "Propriedades inválidas" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." -msgstr "" +msgstr "O modo de execução é inválido." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "" +msgstr "O Security_mode é inválido" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" -msgstr "" +msgstr "A voz é inválida" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" @@ -1014,23 +1033,23 @@ msgstr "Aqruivo de ondas inválido" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "" +msgstr "O comprimento do bit/palavra são inválidos" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento" #: py/compile.c msgid "LHS of keyword arg must be an id" -msgstr "" +msgstr "O LHS da palavra-chave arg deve ser um ID" #: shared-module/displayio/Group.c msgid "Layer already in a group." -msgstr "" +msgstr "A camada já existe em um grupo." #: shared-module/displayio/Group.c msgid "Layer must be a Group or TileGrid subclass." -msgstr "" +msgstr "A camada deve ser uma subclasse Group ou TileGrid." #: py/objslice.c msgid "Length must be an int" @@ -1038,7 +1057,7 @@ msgstr "Tamanho deve ser um int" #: py/objslice.c msgid "Length must be non-negative" -msgstr "" +msgstr "O comprimento deve ser positivo" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." @@ -1051,44 +1070,44 @@ msgstr "Inicialização do pino MOSI falhou." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" +msgstr "O valor máximo de x quando espelhado é %d" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "O salto do MicroPython NLR falhou. Possível corrupção de memória." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." -msgstr "" +msgstr "Houve um erro fatal do MicroPython." #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" -msgstr "" +msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" -msgstr "" +msgstr "O pino MISO ou MOSI está ausente" #: shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Deve ser uma subclasse %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Deve informar os pinos MISO ou MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d" #: py/parse.c msgid "Name too long" -msgstr "" +msgstr "Nome muito longo" #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Não há nenhum CCCD para esta característica" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1102,11 +1121,11 @@ msgstr "Nenhum canal DMA encontrado" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Nenhum pino MISO" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Nenhum pino MOSI" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1122,11 +1141,11 @@ msgstr "Nenhum pino TX" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Nenhum clock disponível" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Sem conexão: o comprimento não pode ser determinado" #: shared-bindings/board/__init__.c msgid "No default %q bus" @@ -1138,7 +1157,7 @@ msgstr "Não há GCLKs livre" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "" +msgstr "Nenhum hardware aleatório está disponível" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" @@ -1151,35 +1170,35 @@ msgstr "Nenhum suporte de hardware no pino" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Nenhuma chave foi definida" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "" +msgstr "Não há compatibilidade com inteiro longo" #: ports/stm/common-hal/pulseio/PWMOut.c msgid "No more timers available on this pin." -msgstr "" +msgstr "Não há mais temporizadores disponíveis neste pino." #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M ohm" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Não resta espaço no dispositivo" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Este arquivo/diretório não existe" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Não há um temporizador disponível" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." -msgstr "" +msgstr "Declaração de falha do dispositivo Nordic Soft." #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -1189,7 +1208,7 @@ msgstr "Não Conectado" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Não está jogando" #: shared-bindings/util.c msgid "" @@ -1203,13 +1222,15 @@ msgstr "A paridade ímpar não é compatível" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " -msgstr "" +msgstr "Apenas mono com 8 ou 16 bits com " #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" +"O BMP descompactado é compatível apenas no formato Windows: o tamanho do " +"cabeçalho é %d" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1217,25 +1238,31 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" +"São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " +"16bpp ou superior: determinado %d bpp" #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." -msgstr "" +msgstr "A superamostragem deve ser um múltiplo de 8." #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" +"O duty_cycle do PWM deve estar entre 0 e inclusive 65535 (com resolução de " +"16 bits)" #: shared-bindings/pulseio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" +"A frequência do PWM não pode ser gravada quando variable_frequency for False " +"na construção." #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "" +msgstr "O ParallelBus ainda não é compatível" #: py/moduerrno.c msgid "Permission denied" @@ -1255,11 +1282,11 @@ msgstr "" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "" +msgstr "O pino deve ser compatível com as interrupções do hardware" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "" +msgstr "Número do PIN já está reservado através da EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1268,6 +1295,9 @@ msgid "" "bytes. If this cannot be avoided, pass allow_inefficient=True to the " "constructor" msgstr "" +"A pinagem utiliza %d bytes por elemento, que consome mais do que %d bytes do " +"ideal. Caso isso não possa ser evitado, passe allow_inefficient=True ao " +"construtor" #: py/builtinhelp.c msgid "Plus any modules on the filesystem\n" @@ -1284,34 +1314,37 @@ msgstr "Buffer Ps2 vazio" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" +"O buffer do prefixo deve estar na área de alocação dinâmica de variáveis " +"(heap)" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgstr "" +"Pressione qualquer tecla para entrar no REPL. Use CTRL-D para recarregar." #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." -msgstr "" +msgstr "O Pull não foi usado quando a direção for gerada." #: ports/stm/common-hal/pulseio/PulseIn.c msgid "PulseIn not supported on this chip" -msgstr "" +msgstr "O PulseIn não é compatível neste CI" #: ports/stm/common-hal/pulseio/PulseOut.c msgid "PulseOut not supported on this chip" -msgstr "" +msgstr "O PulseOut não é compatível neste CI" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "" +msgstr "Erro DeInit RNG" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "" +msgstr "Houve um erro na inicialização do RNG" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "" +msgstr "A definição da inversão do RS485 quando não está no modo RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/mimxrt10xx/common-hal/rtc/RTC.c #: ports/nrf/common-hal/rtc/RTC.c @@ -1325,11 +1358,11 @@ msgstr "O RTC não é suportado nesta placa" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" +msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "" +msgstr "Houve um erro na geração do número aleatório" #: shared-bindings/pulseio/PulseIn.c msgid "Read-only" @@ -1345,11 +1378,11 @@ msgstr "Objeto de leitura apenas" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "" +msgstr "A recarga foi cedo demais" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "" +msgstr "O modo AES solicitado não é compatível" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1357,7 +1390,7 @@ msgstr "Canal direito não suportado" #: shared-bindings/_pew/PewPew.c msgid "Row entry must be digitalio.DigitalInOut" -msgstr "" +msgstr "A entrada da linha deve ser digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! Auto-reload is off.\n" @@ -1374,15 +1407,15 @@ msgstr "SDA ou SCL precisa de um pull up" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" -msgstr "" +msgstr "Houve um erro na inicialização SPI" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Re-initialization error" -msgstr "" +msgstr "Houve um erro na reinicialização SPI" #: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" -msgstr "" +msgstr "A taxa de amostragem deve ser positiva" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format @@ -1391,15 +1424,15 @@ msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." -msgstr "" +msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "" +msgstr "O pino CTS selecionado é inválido" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "" +msgstr "O pino RTS selecionado é inválido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1408,20 +1441,20 @@ msgstr "Serializer em uso" #: shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." -msgstr "" +msgstr "Fatie e avalie os diferentes comprimentos." #: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c #: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c msgid "Slices not supported" -msgstr "" +msgstr "Fatiamento não compatível" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "" +msgstr "Os buffers da origem e do destino devem ter o mesmo comprimento" #: extmod/modure.c msgid "Splitting with sub-captures" -msgstr "" +msgstr "Divisão com sub-capturas" #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" @@ -1429,11 +1462,11 @@ msgstr "O tamanho da pilha deve ser pelo menos 256" #: shared-bindings/multiterminal/__init__.c msgid "Stream missing readinto() or write() method." -msgstr "" +msgstr "Transmita o método ausente readinto() ou write()." #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Supply at least one UART pin" -msgstr "" +msgstr "Forneça pelo menos um pino UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" @@ -1441,19 +1474,24 @@ msgstr "" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "" +msgstr "A leitura da temperatura expirou" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Please increase the stack size if you know how, or if not:" msgstr "" +"A área de alocação dinâmica de variáveis (heap) do CircuitPython foi " +"corrompida porque a pilha de funções (stack) era muito pequena.\n" +"Aumente o tamanho da pilha de funções caso saiba como, ou caso não saiba:" #: supervisor/shared/safe_mode.c msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" +"O módulo `microcontrolador` foi utilizado para inicializar no modo de " +"segurança. Pressione reset para encerrar do modo de segurança.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1461,38 +1499,42 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"A força do microcontrolador caiu. Verifique se a fonte de alimentação " +"fornece\n" +"energia suficiente para todo o circuito e pressione reset (após a ejeção " +"CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "A amostragem bits_per_sample não coincide com a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "A contagem da amostragem dos canais não coincide com o a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "A taxa de amostragem da amostra não coincide com a do mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "A amostragem \"signedness\" não coincide com a do mixer" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "A altura do bloco deve dividir exatamente com a altura do bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "O índice do bloco está fora dos limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "O valor do bloco está fora dos limites" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" #: ports/nrf/common-hal/_bleio/Adapter.c #, c-format @@ -1505,43 +1547,43 @@ msgstr "Muitos canais na amostra." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Muitos barramentos estão sendo exibidos" #: shared-module/displayio/__init__.c msgid "Too many displays" -msgstr "" +msgstr "Exibições demais" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "" +msgstr "O total dos dados que serão gravados é maior que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "Traceback (a última chamada mais recente):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "" +msgstr "O argumento de tupla ou struct_time é necessário" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "Houve um erro na alocação do Buffer UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Houve um erro da não inicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Houve um erro na inicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Houve um erro na reinicialização do UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Houve um erro na gravação UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" @@ -1553,15 +1595,15 @@ msgstr "Erro na USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "O valor inteiro UUID deve ser 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "A cadeia de caracteres UUID não 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "O valor UUID não é um buffer str, int ou byte" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1571,7 +1613,7 @@ msgstr "Não é possível alocar buffers para conversão assinada" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Não foi possível encontrar a tela I2C no %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1580,11 +1622,11 @@ msgstr "Não é possível encontrar GCLK livre" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "Não foi possível iniciar o analisador" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Não foi possível ler os dados da paleta de cores" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -1592,37 +1634,39 @@ msgstr "Não é possível gravar no nvm." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "Tipo uuid nrfx inesperado" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown gatt error: 0x%04x" -msgstr "" +msgstr "Erro gatt desconhecido: 0x%04x" #: supervisor/shared/safe_mode.c msgid "Unknown reason." -msgstr "" +msgstr "Motivo desconhecido." #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" -msgstr "" +msgstr "Erro de segurança desconhecido: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown soft device error: %04x" -msgstr "" +msgstr "Erro desconhecido do dispositivo de soft: %04x" #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." -msgstr "" +msgstr "Quantidade inigualável de itens no RHS (%d esperado, obteve %d)." #: ports/nrf/common-hal/_bleio/__init__.c msgid "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." msgstr "" +"Problema desconhecido. Pode ser que o prompt de emparelhamento no outro " +"dispositivo tenha sido recusado ou ignorado." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/I2C.c @@ -1639,29 +1683,29 @@ msgstr "Formato não suportado" #: py/moduerrno.c msgid "Unsupported operation" -msgstr "" +msgstr "Operação não suportada" #: shared-bindings/digitalio/DigitalInOut.c msgid "Unsupported pull value." -msgstr "" +msgstr "O valor pull não é compatível." #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "" +msgstr "Comprimento do valor != comprimento fixo necessário" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length > max_length" -msgstr "" +msgstr "O comprimento do valor é > max_length" #: py/emitnative.c msgid "Viper functions don't currently support more than 4 arguments" -msgstr "" +msgstr "Atualmente, as funções do Viper não suportam mais de 4 argumentos" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Voltage read timed out" -msgstr "" +msgstr "O tempo limite de leitura da tensão expirou" #: main.c msgid "WARNING: Your code filename has two extensions\n" @@ -1696,6 +1740,12 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" +"Bem-vindo ao Adafruit CircuitPython% s!\n" +"\n" +"Visite learn.adafruit.com/category/circuitpython para obter guias de projeto." +"\n" +"\n" +"Para listar os módulos internos, faça `help (\" modules \")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" @@ -2166,7 +2216,7 @@ msgstr "vazio" #: extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" -msgstr "heap vazia" +msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" #: py/objstr.c msgid "empty separator" @@ -2360,7 +2410,7 @@ msgstr "" #: extmod/moduheapq.c msgid "heap must be a list" -msgstr "heap deve ser uma lista" +msgstr "a área de alocação dinâmica de variáveis (heap) deve ser uma lista" #: py/compile.c msgid "identifier redefined as global" @@ -2609,6 +2659,8 @@ msgstr "" #: py/runtime.c msgid "memory allocation failed, heap is locked" msgstr "" +"falha na alocação de memória, a área de alocação dinâmica de variáveis (heap)" +" está bloqueada" #: py/builtinimport.c msgid "module not found" From 3f764d99eefb02cb2f19cf366ffe3f5831d6a675 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Mon, 29 Jun 2020 23:49:52 +0000 Subject: [PATCH 901/919] Translated using Weblate (Portuguese (Brazil)) Currently translated at 69.3% (526 of 759 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 195 +++++++++++++++++++++++++----------------------- 1 file changed, 102 insertions(+), 93 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6b921ffdfe..6ade65a33f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-25 11:44-0500\n" -"PO-Revision-Date: 2020-06-29 22:52+0000\n" +"PO-Revision-Date: 2020-06-29 23:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1740,20 +1740,20 @@ msgid "" "\n" "To list built-in modules please do `help(\"modules\")`.\n" msgstr "" -"Bem-vindo ao Adafruit CircuitPython% s!\n" +"Bem-vindo ao Adafruit CircuitPython %s!\n" "\n" -"Visite learn.adafruit.com/category/circuitpython para obter guias de projeto." +"Para obter guias de projeto, visite learn.adafruit.com/category/" +"circuitpython.\n" "\n" -"\n" -"Para listar os módulos internos, faça `help (\" modules \")`.\n" +"Para listar os módulos internos, faça `help(\"modules\")`.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "" +msgstr "A escrita não é compatível na Característica" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" -msgstr "" +msgstr "Você está no modo de segurança: algo inesperado aconteceu.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -1761,20 +1761,20 @@ msgstr "Você solicitou o início do modo de segurança através do " #: py/objtype.c msgid "__init__() should return None" -msgstr "" +msgstr "O __init__() deve retornar Nenhum" #: py/objtype.c #, c-format msgid "__init__() should return None, not '%s'" -msgstr "" +msgstr "O __init__() deve retornar Nenhum, não '%s'" #: py/objobject.c msgid "__new__ arg must be a user-type" -msgstr "" +msgstr "O argumento __new__ deve ser um tipo usuário" #: extmod/modubinascii.c extmod/moduhashlib.c msgid "a bytes-like object is required" -msgstr "" +msgstr "é necessário objetos tipo bytes" #: lib/embed/abort_.c msgid "abort() called" @@ -1787,23 +1787,23 @@ msgstr "endereço %08x não está alinhado com %d bytes" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" -msgstr "" +msgstr "endereço fora dos limites" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "addresses is empty" -msgstr "" +msgstr "os endereços estão vazios" #: extmod/ulab/code/vectorise.c msgid "arctan2 is implemented for scalars and ndarrays only" -msgstr "" +msgstr "O arctan2 está implementado apenas para escalares e ndarrays" #: py/modbuiltins.c msgid "arg is an empty sequence" -msgstr "" +msgstr "o arg é uma sequência vazia" #: extmod/ulab/code/numerical.c msgid "argsort argument must be an ndarray" -msgstr "" +msgstr "O argumento argsort deve ser um ndarray" #: py/runtime.c msgid "argument has wrong type" @@ -1812,23 +1812,23 @@ msgstr "argumento tem tipo errado" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "" +msgstr "o argumento num/tipos não combinam" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "" +msgstr "o argumento deve ser um '%q' e não um '%q'" #: extmod/ulab/code/linalg.c msgid "arguments must be ndarrays" -msgstr "" +msgstr "os argumentos devem ser ndarrays" #: py/objarray.c shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" -msgstr "" +msgstr "matriz/bytes são necessários no lado direito" #: extmod/ulab/code/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" -msgstr "" +msgstr "tente obter argmin/argmax de uma sequência vazia" #: py/objstr.c msgid "attributes not supported yet" @@ -1836,39 +1836,39 @@ msgstr "atributos ainda não suportados" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, None, or 1" -msgstr "" +msgstr "o eixo deve ser -1, 0, Nenhum ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be -1, 0, or 1" -msgstr "" +msgstr "o eixo deve ser -1, 0 ou 1" #: extmod/ulab/code/numerical.c msgid "axis must be None, 0, or 1" -msgstr "" +msgstr "o eixo deve ser Nenhum, 0 ou 1" #: py/builtinevex.c msgid "bad compile mode" -msgstr "" +msgstr "modo de compilação ruim" #: py/objstr.c msgid "bad conversion specifier" -msgstr "" +msgstr "especificador de conversão incorreto" #: py/objstr.c msgid "bad format string" -msgstr "" +msgstr "formato da string incorreta" #: py/binary.c msgid "bad typecode" -msgstr "" +msgstr "typecode incorreto" #: py/emitnative.c msgid "binary op %q not implemented" -msgstr "" +msgstr "a operação binário %q não foi implementada" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "os bits devem ser 7, 8 ou 9" #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" @@ -1880,7 +1880,7 @@ msgstr "ramo fora do alcance" #: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" -msgstr "" +msgstr "o buffer deve ser um objeto como bytes" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -1888,24 +1888,24 @@ msgstr "o tamanho do buffer deve coincidir com o formato" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "buffer slices must be of equal length" -msgstr "" +msgstr "as fatias do buffer devem ter o mesmo comprimento" #: py/modstruct.c shared-bindings/struct/__init__.c #: shared-module/struct/__init__.c msgid "buffer too small" -msgstr "" +msgstr "o buffer é muito pequeno" #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" -msgstr "" +msgstr "os botões devem ser digitalio.DigitalInOut" #: py/vm.c msgid "byte code not implemented" -msgstr "" +msgstr "o código dos bytes ainda não foi implementado" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "byteorder is not a string" -msgstr "" +msgstr "a ordem dos bytes não é uma cadeia de caracteres" #: ports/atmel-samd/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" @@ -1913,7 +1913,7 @@ msgstr "bytes > 8 bits não suportado" #: py/objstr.c msgid "bytes value out of range" -msgstr "" +msgstr "o valor dos bytes estão fora do alcance" #: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" @@ -1929,144 +1929,148 @@ msgstr "Valor de calibração fora do intervalo +/- 127" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "" +msgstr "só pode haver até 4 parâmetros para a montagem Thumb" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "" +msgstr "só pode haver até 4 parâmetros para a montagem Xtensa" #: py/persistentcode.c msgid "can only save bytecode" -msgstr "" +msgstr "apenas o bytecode pode ser salvo" #: py/objtype.c msgid "can't add special method to already-subclassed class" -msgstr "" +msgstr "não é possível adicionar o método especial à classe já subclassificada" #: py/compile.c msgid "can't assign to expression" -msgstr "" +msgstr "a expressão não pode ser atribuída" #: py/obj.c #, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "Não é possível converter %s para complex" #: py/obj.c #, c-format msgid "can't convert %s to float" -msgstr "" +msgstr "Não é possível converter %s para float" #: py/obj.c #, c-format msgid "can't convert %s to int" -msgstr "" +msgstr "Não é possível converter %s para int" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" -msgstr "" +msgstr "não é possível converter implicitamente o objeto '%q' para %q" #: py/objint.c msgid "can't convert NaN to int" -msgstr "" +msgstr "Não é possível converter NaN para int" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "can't convert address to int" -msgstr "" +msgstr "não é possível converter o endereço para int" #: py/objint.c msgid "can't convert inf to int" -msgstr "" +msgstr "não é possível converter inf para int" #: py/obj.c msgid "can't convert to complex" -msgstr "" +msgstr "não é possível converter para complex" #: py/obj.c msgid "can't convert to float" -msgstr "" +msgstr "não é possível converter para float" #: py/obj.c msgid "can't convert to int" -msgstr "" +msgstr "não é possível converter para int" #: py/objstr.c msgid "can't convert to str implicitly" -msgstr "" +msgstr "não é possível converter implicitamente para str" #: py/compile.c msgid "can't declare nonlocal in outer code" -msgstr "" +msgstr "não é possível declarar nonlocal no código externo" #: py/compile.c msgid "can't delete expression" -msgstr "" +msgstr "não é possível excluir a expressão" #: py/emitnative.c msgid "can't do binary op between '%q' and '%q'" -msgstr "" +msgstr "não é possível executar uma operação binária entre '%q' e '%q'" #: py/objcomplex.c msgid "can't do truncated division of a complex number" -msgstr "" +msgstr "não é possível fazer a divisão truncada de um número complexo" #: py/compile.c msgid "can't have multiple **x" -msgstr "" +msgstr "não pode haver vários **x" #: py/compile.c msgid "can't have multiple *x" -msgstr "" +msgstr "não pode haver vários *x" #: py/emitnative.c msgid "can't implicitly convert '%q' to 'bool'" -msgstr "" +msgstr "não é possível converter implicitamente '%q' em 'bool'" #: py/emitnative.c msgid "can't load from '%q'" -msgstr "" +msgstr "não é possível carregar a partir de '%q'" #: py/emitnative.c msgid "can't load with '%q' index" -msgstr "" +msgstr "não é possível carregar com o índice '%q'" #: py/objgenerator.c msgid "can't pend throw to just-started generator" -msgstr "" +msgstr "não pode pendurar o lançamento para o gerador recém-iniciado" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" +"Não é possível enviar algo que não seja um valor para um gerador recém-" +"iniciado" #: py/objnamedtuple.c msgid "can't set attribute" -msgstr "" +msgstr "não é possível definir o atributo" #: py/emitnative.c msgid "can't store '%q'" -msgstr "" +msgstr "não é possível armazenar '%q'" #: py/emitnative.c msgid "can't store to '%q'" -msgstr "" +msgstr "não é possível armazenar em '%q'" #: py/emitnative.c msgid "can't store with '%q' index" -msgstr "" +msgstr "não é possível armazenar com o índice '%q'" #: py/objstr.c msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" +"não é possível alternar entre a numeração automática dos campos para a manual" #: py/objstr.c msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +"não é possível alternar da especificação de campo manual para a automática" #: py/objtype.c msgid "cannot create '%q' instances" -msgstr "" +msgstr "não é possível criar instâncias '%q'" #: py/objtype.c msgid "cannot create instance" @@ -2078,43 +2082,46 @@ msgstr "não pode importar nome %q" #: py/builtinimport.c msgid "cannot perform relative import" -msgstr "" +msgstr "não pode executar a importação relativa" #: extmod/ulab/code/ndarray.c msgid "cannot reshape array (incompatible input/output shape)" msgstr "" +"não é possível remodelar a matriz (formato de entrada/saída incompatível)" #: py/emitnative.c msgid "casting" -msgstr "" +msgstr "fundição" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "" +msgstr "o buffer dos caracteres é muito pequeno" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "" +msgstr "o arg chr() está fora do intervalo(0x110000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "" +msgstr "o arg chr() está fora do intervalo(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" -msgstr "" +msgstr "o círculo só pode ser registrado em um pai" #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" -msgstr "" +msgstr "o buffer das cores deve ter 3 bytes (RGB) ou 4 bytes (RGB + pad byte)" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a buffer, tuple, list, or int" -msgstr "" +msgstr "O buffer das cores deve ser um buffer, tupla, lista ou int" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" msgstr "" +"O buffer das cores deve ser uma matriz de bytes ou uma matriz do tipo 'b' ou " +"'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -2126,15 +2133,15 @@ msgstr "cor deve ser um int" #: py/objcomplex.c msgid "complex division by zero" -msgstr "" +msgstr "divisão complexa por zero" #: py/objfloat.c py/parsenum.c msgid "complex values not supported" -msgstr "" +msgstr "os valores complexos não compatíveis" #: extmod/moduzlib.c msgid "compression header" -msgstr "" +msgstr "compressão do cabeçalho" #: py/parse.c msgid "constant must be an integer" @@ -2142,27 +2149,27 @@ msgstr "constante deve ser um inteiro" #: py/emitnative.c msgid "conversion to object" -msgstr "" +msgstr "conversão para o objeto" #: extmod/ulab/code/filter.c msgid "convolve arguments must be linear arrays" -msgstr "" +msgstr "os argumentos convolutivos devem ser matrizes lineares" #: extmod/ulab/code/filter.c msgid "convolve arguments must be ndarrays" -msgstr "" +msgstr "os argumentos convolutivos devem ser ndarrays" #: extmod/ulab/code/filter.c msgid "convolve arguments must not be empty" -msgstr "" +msgstr "os argumentos convolutivos não devem estar vazios" #: extmod/ulab/code/ndarray.c msgid "could not broadast input array from shape" -msgstr "" +msgstr "não foi possível transmitir a matriz da entrada a partir da forma" #: extmod/ulab/code/poly.c msgid "could not invert Vandermonde matrix" -msgstr "" +msgstr "não foi possível inverter a matriz Vandermonde" #: extmod/ulab/code/approx.c msgid "data must be iterable" @@ -2174,24 +2181,26 @@ msgstr "" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" -msgstr "" +msgstr "O ddof deve ser menor que o comprimento do conjunto dos dados" #: py/parsenum.c msgid "decimal numbers not supported" -msgstr "" +msgstr "os números decimais não são compatíveis" #: py/compile.c msgid "default 'except' must be last" -msgstr "" +msgstr "a predefinição 'exceto' deve ser o último" #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" +"o buffer do destino deve ser um bytearray ou matriz do tipo 'B' para " +"bit_depth = 8" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "" +msgstr "o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2199,11 +2208,11 @@ msgstr "destination_length deve ser um int >= 0" #: py/objdict.c msgid "dict update sequence has wrong length" -msgstr "" +msgstr "sequência da atualização dict tem o comprimento errado" #: extmod/ulab/code/numerical.c msgid "diff argument must be an ndarray" -msgstr "" +msgstr "O argumento diff deve ser um ndarray" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2220,7 +2229,7 @@ msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" #: py/objstr.c msgid "empty separator" -msgstr "" +msgstr "separador vazio" #: shared-bindings/random/__init__.c msgid "empty sequence" @@ -2228,7 +2237,7 @@ msgstr "seqüência vazia" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "" +msgstr "final de formato enquanto procura pelo especificador de conversão" #: shared-bindings/displayio/Shape.c msgid "end_x should be an int" From c1e7a254a3b6aceb66637a5b71efb47c0b928275 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 30 Jun 2020 01:50:07 +0200 Subject: [PATCH 902/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 51 +++++++++++++++++++++++++++++-- locale/cs.po | 51 +++++++++++++++++++++++++++++-- locale/de_DE.po | 51 +++++++++++++++++++++++++++++-- locale/es.po | 58 +++++++++++++++++++++++++++++++---- locale/fil.po | 51 +++++++++++++++++++++++++++++-- locale/fr.po | 51 +++++++++++++++++++++++++++++-- locale/it_IT.po | 51 +++++++++++++++++++++++++++++-- locale/ko.po | 51 +++++++++++++++++++++++++++++-- locale/nl.po | 51 +++++++++++++++++++++++++++++-- locale/pl.po | 51 +++++++++++++++++++++++++++++-- locale/pt_BR.po | 65 ++++++++++++++++++++++++++++++++++------ locale/sv.po | 51 +++++++++++++++++++++++++++++-- locale/zh_Latn_pinyin.po | 51 +++++++++++++++++++++++++++++-- 13 files changed, 636 insertions(+), 48 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ae057fbd7a..8d89115d7a 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -58,6 +58,10 @@ msgstr "" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "" @@ -86,6 +90,10 @@ msgstr "buffers harus mempunyai panjang yang sama" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "" @@ -340,7 +348,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -421,6 +429,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -709,7 +721,8 @@ msgstr "Channel EXTINT sedang digunakan" msgid "Error in regex" msgstr "Error pada regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -869,6 +882,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1374,6 +1391,10 @@ msgid "Running in safe mode! Not running saved code.\n" msgstr "" "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2003,6 +2024,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2129,6 +2154,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2686,6 +2715,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2707,6 +2740,10 @@ msgstr "tidak ada modul yang bernama '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3099,6 +3136,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "bits harus memilki nilai 8" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b23144fc8c..3869cd45ab 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,10 @@ msgstr "%% c vyžaduje int nebo char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adresní piny a %d rgb piny označují výšku %d, nikoli %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q se nyní používá" @@ -93,6 +97,10 @@ msgstr "% q musí být > = 1" msgid "%q must be a tuple of length 2" msgstr "% q musí být n-tice délky 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "% q by měl být int" @@ -346,7 +354,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -425,6 +433,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "" @@ -706,7 +718,8 @@ msgstr "" msgid "Error in regex" msgstr "" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -866,6 +879,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1366,6 +1383,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1987,6 +2008,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2113,6 +2138,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2670,6 +2699,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2691,6 +2724,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3081,6 +3118,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index eff611b20d..567a2f8ba2 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -65,6 +65,10 @@ msgstr "%%c erwartet int oder char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in Benutzung" @@ -92,6 +96,10 @@ msgstr "%q muss >= 1 sein" msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q sollte ein integer sein" @@ -345,7 +353,7 @@ msgstr "Array muss Halbwörter enthalten (type 'H')" msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)" @@ -428,6 +436,10 @@ msgstr "Der Puffer ist zu klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" @@ -716,7 +728,8 @@ msgstr "EXTINT Kanal ist schon in Benutzung" msgid "Error in regex" msgstr "Fehler in regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -883,6 +896,10 @@ msgstr "Interner Definitionsfehler" msgid "Internal error #%d" msgstr "Interner Fehler #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1396,6 +1413,10 @@ msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2048,6 +2069,10 @@ msgstr "" "Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " "gesendet werden" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kann Attribut nicht setzen" @@ -2181,6 +2206,10 @@ msgstr "Eingabearray konnte nicht aus der Form übertragen werden" msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2747,6 +2776,10 @@ msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" msgid "negative shift count" msgstr "Negative shift Anzahl" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "Keine aktive Ausnahme zu verusachen (raise)" @@ -2768,6 +2801,10 @@ msgstr "Kein Modul mit dem Namen '%q'" msgid "no reset pin available" msgstr "kein Reset Pin verfügbar" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "kein solches Attribut" @@ -3165,6 +3202,14 @@ msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" msgid "timeout must be >= 0.0" msgstr "timeout muss >= 0.0 sein" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" diff --git a/locale/es.po b/locale/es.po index ebffaeb984..aad07ddf4f 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -67,6 +67,10 @@ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q está siendo utilizado" @@ -94,6 +98,10 @@ msgstr "%q debe ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q debe ser una tupla de longitud 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q debe ser un int" @@ -349,7 +357,7 @@ msgstr "Array debe contener media palabra (type 'H')" msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Como máximo %d %q se puede especificar (no %d)" @@ -430,6 +438,10 @@ msgstr "El buffer es muy pequeño" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longitud del buffer %d es muy grande. Debe ser menor a %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer debe ser de longitud 1 como minimo" @@ -715,7 +727,8 @@ msgstr "El canal EXTINT ya está siendo utilizado" msgid "Error in regex" msgstr "Error en regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -878,6 +891,10 @@ msgstr "" msgid "Internal error #%d" msgstr "Error interno #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1387,6 +1404,10 @@ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1485,8 +1506,8 @@ msgid "" msgstr "" "La alimentación de la microntroladora bajó. Asegúrate que tu fuente de " "poder\n" -"pueda suplir suficiente energía para todo el circuito y presione reset (" -"luego de\n" +"pueda suplir suficiente energía para todo el circuito y presione reset " +"(luego de\n" "expulsar CIRCUITPY)\n" #: shared-module/audiomixer/MixerVoice.c @@ -1542,7 +1563,8 @@ msgstr "Muchos displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "Los datos totales a escribir son más grandes que outgoing_packet_length" +msgstr "" +"Los datos totales a escribir son más grandes que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -2026,6 +2048,10 @@ msgid "can't send non-None value to a just-started generator" msgstr "" "no se puede enviar un valor que no sea None a un generador recién iniciado" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "no se puede asignar el atributo" @@ -2156,6 +2182,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "los datos deben permitir iteración" @@ -2718,6 +2748,10 @@ msgstr "potencia negativa sin float support" msgid "negative shift count" msgstr "cuenta de corrimientos negativo" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "exception no activa para reraise" @@ -2739,6 +2773,10 @@ msgstr "ningún módulo se llama '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "no hay tal atributo" @@ -3136,6 +3174,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "tiempo muerto debe ser >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fuera de rango para plataform time_t" diff --git a/locale/fil.po b/locale/fil.po index e4c5678d27..4f155ecc58 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -58,6 +58,10 @@ msgstr "%%c nangangailangan ng int o char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q ay ginagamit" @@ -86,6 +90,10 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -342,7 +350,7 @@ msgstr "May halfwords (type 'H') dapat ang array" msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -423,6 +431,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer dapat ay hindi baba sa 1 na haba" @@ -710,7 +722,8 @@ msgstr "Ginagamit na ang EXTINT channel" msgid "Error in regex" msgstr "May pagkakamali sa REGEX" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -874,6 +887,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1381,6 +1398,10 @@ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2015,6 +2036,10 @@ msgstr "hindi mapadala ang send throw sa isang kaka umpisang generator" msgid "can't send non-None value to a just-started generator" msgstr "hindi mapadala ang non-None value sa isang kaka umpisang generator" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "hindi ma i-set ang attribute" @@ -2145,6 +2170,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2712,6 +2741,10 @@ msgstr "negatibong power na walang float support" msgid "negative shift count" msgstr "negative shift count" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "walang aktibong exception para i-reraise" @@ -2733,6 +2766,10 @@ msgstr "walang module na '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "walang ganoon na attribute" @@ -3129,6 +3166,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "bits ay dapat walo (8)" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "wala sa sakop ng timestamp ang platform time_t" diff --git a/locale/fr.po b/locale/fr.po index 5a49fd5f91..392b779894 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -69,6 +69,10 @@ msgstr "" "Les broches d'adresse %d et les broches RVB %d indiquent une hauteur de %d, " "pas %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q utilisé" @@ -96,6 +100,10 @@ msgstr "%q doit être >=1" msgid "%q must be a tuple of length 2" msgstr "%q doit être un tuple de longueur 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q doit être un entier (int)" @@ -350,7 +358,7 @@ msgstr "Le tableau doit contenir des demi-mots (type 'H')" msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Au plus %d %q peut être spécifié (pas %d)" @@ -433,6 +441,10 @@ msgstr "Le tampon est trop petit" msgid "Buffer length %d too big. It must be less than %d" msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Le tampon doit être de longueur au moins 1" @@ -723,7 +735,8 @@ msgstr "Canal EXTINT déjà utilisé" msgid "Error in regex" msgstr "Erreur dans l'expression régulière" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -887,6 +900,10 @@ msgstr "Erreur de définition interne" msgid "Internal error #%d" msgstr "Erreur interne #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1400,6 +1417,10 @@ msgstr "Mode sans-échec ! Auto-chargement désactivé.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2052,6 +2073,10 @@ msgstr "" "on ne peut envoyer une valeur autre que 'None' à un générateur fraîchement " "démarré" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "attribut non modifiable" @@ -2185,6 +2210,10 @@ msgstr "n'a pas pu diffuser le tableau d'entrée à partir de la forme" msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "les données doivent être les objets iterables" @@ -2752,6 +2781,10 @@ msgstr "puissance négative sans support des nombres à virgule flottante" msgid "negative shift count" msgstr "compte de décalage négatif" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "aucune exception active à relever" @@ -2773,6 +2806,10 @@ msgstr "pas de module '%q'" msgid "no reset pin available" msgstr "pas de broche de réinitialisation disponible" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "pas de tel attribut" @@ -3171,6 +3208,14 @@ msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" msgid "timeout must be >= 0.0" msgstr "'timeout' doit être >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" diff --git a/locale/it_IT.po b/locale/it_IT.po index c47d0e8e3e..13651437b7 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -58,6 +58,10 @@ msgstr "%%c necessita di int o char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in uso" @@ -86,6 +90,10 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c #, fuzzy msgid "%q should be an int" @@ -341,7 +349,7 @@ msgstr "Array deve avere mezzoparole (typo 'H')" msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -423,6 +431,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Il buffer deve essere lungo almeno 1" @@ -710,7 +722,8 @@ msgstr "Canale EXTINT già in uso" msgid "Error in regex" msgstr "Errore nella regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -874,6 +887,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1390,6 +1407,10 @@ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2019,6 +2040,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "impossibile impostare attributo" @@ -2147,6 +2172,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2714,6 +2743,10 @@ msgstr "potenza negativa senza supporto per float" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "nessuna eccezione attiva da rilanciare" @@ -2736,6 +2769,10 @@ msgstr "nessun modulo chiamato '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "attributo inesistente" @@ -3136,6 +3173,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "i bit devono essere 8" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp è fuori intervallo per il time_t della piattaforma" diff --git a/locale/ko.po b/locale/ko.po index 156f40d9b6..73926d47bd 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -60,6 +60,10 @@ msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q 사용 중입니다" @@ -87,6 +91,10 @@ msgstr "%q 는 >=1이어야합니다" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q 는 정수(int) 여야합니다" @@ -340,7 +348,7 @@ msgstr "" msgid "Array values should be single bytes." msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -421,6 +429,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "잘못된 크기의 버퍼. >1 여야합니다" @@ -702,7 +714,8 @@ msgstr "" msgid "Error in regex" msgstr "Regex에 오류가 있습니다." -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -862,6 +875,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1362,6 +1379,10 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1984,6 +2005,10 @@ msgstr "" msgid "can't send non-None value to a just-started generator" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "" @@ -2110,6 +2135,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2667,6 +2696,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2688,6 +2721,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3078,6 +3115,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 77cc11cab3..b9fd85e163 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -66,6 +66,10 @@ msgstr "%%c vereist een int of char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adres pins en %d RGB pins geven een hoogte van %d aan, niet %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q in gebruik" @@ -93,6 +97,10 @@ msgstr "%q moet >= 1 zijn" msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q moet een int zijn" @@ -346,7 +354,7 @@ msgstr "Array moet halfwords (type 'H') bevatten" msgid "Array values should be single bytes." msgstr "Array waardes moet enkele bytes zijn." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)" @@ -427,6 +435,10 @@ msgstr "Buffer is te klein" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Buffer moet op zijn minst lengte 1 zijn" @@ -714,7 +726,8 @@ msgstr "EXTINT kanaal al in gebruik" msgid "Error in regex" msgstr "Fout in regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -878,6 +891,10 @@ msgstr "Interne define fout" msgid "Internal error #%d" msgstr "Interne fout #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1392,6 +1409,10 @@ msgstr "Draaiende in veilige modus! Auto-herlaad is uit.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2033,6 +2054,10 @@ msgstr "kan throw niet aan net gestartte generator toevoegen" msgid "can't send non-None value to a just-started generator" msgstr "kan geen niet-'None' waarde naar een net gestartte generator sturen" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kan attribute niet instellen" @@ -2160,6 +2185,10 @@ msgstr "kon de invoerarray niet vanuit vorm uitzenden" msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "data moet itereerbaar zijn" @@ -2723,6 +2752,10 @@ msgstr "negatieve macht terwijl er geen ondersteuning is voor float" msgid "negative shift count" msgstr "negatieve verschuivingstelling (shift count)" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" @@ -2744,6 +2777,10 @@ msgstr "geen module met naam '%q'" msgid "no reset pin available" msgstr "geen reset pin beschikbaar" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "niet zo'n attribuut" @@ -3137,6 +3174,14 @@ msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" msgid "timeout must be >= 0.0" msgstr "timeout moet groter dan 0.0 zijn" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp buiten bereik voor platform time_t" diff --git a/locale/pl.po b/locale/pl.po index 888ce64285..1f2e9a61bc 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -59,6 +59,10 @@ msgstr "%%c wymaga int lub char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q w użyciu" @@ -86,6 +90,10 @@ msgstr "%q musi być >= 1" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q powinno być typu int" @@ -339,7 +347,7 @@ msgstr "Tablica musi zawierać pół-słowa (typ 'H')" msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -420,6 +428,10 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufor musi mieć długość 1 lub więcej" @@ -701,7 +713,8 @@ msgstr "Kanał EXTINT w użyciu" msgid "Error in regex" msgstr "Błąd w regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -863,6 +876,10 @@ msgstr "" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1363,6 +1380,10 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1987,6 +2008,10 @@ msgstr "nie można skoczyć do świeżo stworzonego generatora" msgid "can't send non-None value to a just-started generator" msgstr "świeżo stworzony generator może tylko przyjąć None" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "nie można ustawić atrybutu" @@ -2113,6 +2138,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2671,6 +2700,10 @@ msgstr "ujemna potęga, ale brak obsługi liczb zmiennoprzecinkowych" msgid "negative shift count" msgstr "ujemne przesunięcie" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "brak wyjątku do ponownego rzucenia" @@ -2692,6 +2725,10 @@ msgstr "brak modułu o nazwie '%q'" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "nie ma takiego atrybutu" @@ -3084,6 +3121,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "timeout musi być >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp poza zakresem dla time_t na tej platformie" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 6ade65a33f..30d77864b3 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-29 23:50+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -66,6 +66,10 @@ msgstr "%%c requer int ou char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q em uso" @@ -93,6 +97,10 @@ msgstr "%q deve ser >= 1" msgid "%q must be a tuple of length 2" msgstr "%q deve ser uma tupla de comprimento 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q deve ser um int" @@ -348,7 +356,7 @@ msgstr "Array deve conter meias palavras (tipo 'H')" msgid "Array values should be single bytes." msgstr "Os valores da matriz devem ser bytes simples." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Pelo menos %d %q pode ser definido (não %d)" @@ -433,6 +441,10 @@ msgstr "O buffer é muito pequeno" msgid "Buffer length %d too big. It must be less than %d" msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "O comprimento do buffer deve ter pelo menos 1" @@ -721,7 +733,8 @@ msgstr "Canal EXTINT em uso" msgid "Error in regex" msgstr "Erro no regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -857,8 +870,8 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte " -"http://adafru.it/mpy-update para mais informações." +"Arquivo .mpy incompatível. Atualize todos os arquivos .mpy. Consulte http://" +"adafru.it/mpy-update para mais informações." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" @@ -885,6 +898,10 @@ msgstr "Erro interno de definição" msgid "Internal error #%d" msgstr "Erro interno #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1400,6 +1417,10 @@ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -1555,7 +1576,8 @@ msgstr "Exibições demais" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" -msgstr "O total dos dados que serão gravados é maior que outgoing_packet_length" +msgstr "" +"O total dos dados que serão gravados é maior que outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -2040,6 +2062,10 @@ msgstr "" "Não é possível enviar algo que não seja um valor para um gerador recém-" "iniciado" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "não é possível definir o atributo" @@ -2171,6 +2197,10 @@ msgstr "não foi possível transmitir a matriz da entrada a partir da forma" msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2200,7 +2230,8 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" -msgstr "o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" +msgstr "" +"o buffer do destino deve ser uma matriz do tipo 'H' para bit_depth = 16" #: shared-bindings/audiobusio/PDMIn.c msgid "destination_length must be an int >= 0" @@ -2668,8 +2699,8 @@ msgstr "" #: py/runtime.c msgid "memory allocation failed, heap is locked" msgstr "" -"falha na alocação de memória, a área de alocação dinâmica de variáveis (heap)" -" está bloqueada" +"falha na alocação de memória, a área de alocação dinâmica de variáveis " +"(heap) está bloqueada" #: py/builtinimport.c msgid "module not found" @@ -2732,6 +2763,10 @@ msgstr "" msgid "negative shift count" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "" @@ -2753,6 +2788,10 @@ msgstr "" msgid "no reset pin available" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "" @@ -3143,6 +3182,14 @@ msgstr "" msgid "timeout must be >= 0.0" msgstr "o tempo limite deve ser >= 0,0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fora do intervalo para a plataforma time_t" diff --git a/locale/sv.po b/locale/sv.po index df2431c4e0..6a38d35702 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,10 @@ msgstr "%%c kräver int eller char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "%d adresspinnar och %d RGB-pinnar indikerar en höjd av %d, inte %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q används redan" @@ -93,6 +97,10 @@ msgstr "%q måste vara >= 1" msgid "%q must be a tuple of length 2" msgstr "%q måste vara en tuple av längd 2" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q ska vara en int" @@ -346,7 +354,7 @@ msgstr "Matrisen måste innehålla halfwords (typ \"H\")" msgid "Array values should be single bytes." msgstr "Matrisvärden ska bestå av enstaka bytes." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "Högst %d %q kan anges (inte %d)" @@ -427,6 +435,10 @@ msgstr "Bufferten är för liten" msgid "Buffer length %d too big. It must be less than %d" msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Bufferten måste ha minst längd 1" @@ -714,7 +726,8 @@ msgstr "EXTINT-kanalen används redan" msgid "Error in regex" msgstr "Fel i regex" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -876,6 +889,10 @@ msgstr "Internt define-fel" msgid "Internal error #%d" msgstr "Internt fel #%d" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1388,6 +1405,10 @@ msgstr "Kör i säkert läge! Autoladdning är avstängd.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Kör i säkert läge! Sparad kod körs inte.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2025,6 +2046,10 @@ msgstr "kan inte 'pend throw' för nystartad generator" msgid "can't send non-None value to a just-started generator" msgstr "kan inte skicka icke-None värde till nystartad generator" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "kan inte att ange attribut" @@ -2153,6 +2178,10 @@ msgstr "Kan inte sända indatamatris från form" msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "data måste vara itererbar" @@ -2716,6 +2745,10 @@ msgstr "negativ exponent utan stöd för flyttal" msgid "negative shift count" msgstr "negativt skiftantal" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "ingen aktiv exception för reraise" @@ -2737,6 +2770,10 @@ msgstr "ingen modul med namnet '%q'" msgid "no reset pin available" msgstr "ingen reset-pinne tillgänglig" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "inget sådant attribut" @@ -3130,6 +3167,14 @@ msgstr "timeout måste vara 0.0-100.0 sekunder" msgid "timeout must be >= 0.0" msgstr "timeout måste vara >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp utom räckvidd för plattformens \"time_t\"" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 4f85c5fa86..1609f672cd 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-25 11:44-0500\n" +"POT-Creation-Date: 2020-06-26 11:50-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -65,6 +65,10 @@ msgstr "%%c xūyào zhěngshù huò char" msgid "%d address pins and %d rgb pins indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q failure: %d" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q in use" msgstr "%q zhèngzài shǐyòng" @@ -92,6 +96,10 @@ msgstr "%q bìxū dàyú huò děngyú 1" msgid "%q must be a tuple of length 2" msgstr "" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +msgid "%q pin invalid" +msgstr "" + #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" msgstr "%q yīnggāi shì yīgè int" @@ -345,7 +353,7 @@ msgstr "Shùzǔ bìxū bāohán bàn zìshù (type 'H')" msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." -#: shared-bindings/rgbmatrix/RGBMatrix.c +#: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" msgstr "" @@ -426,6 +434,10 @@ msgstr "Huǎnchōng qū tài xiǎo" msgid "Buffer length %d too big. It must be less than %d" msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" +#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +msgid "Buffer length must be a multiple of 512" +msgstr "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù 1" @@ -709,7 +721,8 @@ msgstr "EXTINT píndào yǐjīng shǐyòng" msgid "Error in regex" msgstr "Zhèngzé biǎodá shì cuòwù" -#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c +#: 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/terminalio/Terminal.c msgid "Expected a %q" @@ -871,6 +884,10 @@ msgstr "Nèibù dìngyì cuòwù" msgid "Internal error #%d" msgstr "" +#: shared-bindings/sdioio/SDCard.c +msgid "Invalid %q" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1377,6 +1394,10 @@ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ g msgid "Running in safe mode! Not running saved code.\n" msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" +#: shared-module/sdcardio/SDCard.c +msgid "SD card CSD format not supported" +msgstr "" + #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" @@ -2012,6 +2033,10 @@ msgstr "bùnéng bǎ tā rēng dào gāng qǐdòng de fā diànjī shàng" msgid "can't send non-None value to a just-started generator" msgstr "wúfǎ xiàng gānggāng qǐdòng de shēngchéng qì fāsòng fēi zhí" +#: shared-module/sdcardio/SDCard.c +msgid "can't set 512 block size" +msgstr "" + #: py/objnamedtuple.c msgid "can't set attribute" msgstr "wúfǎ shèzhì shǔxìng" @@ -2141,6 +2166,10 @@ msgstr "" msgid "could not invert Vandermonde matrix" msgstr "" +#: shared-module/sdcardio/SDCard.c +msgid "couldn't determine SD card version" +msgstr "" + #: extmod/ulab/code/approx.c msgid "data must be iterable" msgstr "" @@ -2701,6 +2730,10 @@ msgstr "méiyǒu fú diǎn zhīchí de xiāojí gōnglǜ" msgid "negative shift count" msgstr "fù zhuǎnyí jìshù" +#: shared-module/sdcardio/SDCard.c +msgid "no SD card" +msgstr "" + #: py/vm.c msgid "no active exception to reraise" msgstr "méiyǒu jīhuó de yìcháng lái chóngxīn píngjià" @@ -2722,6 +2755,10 @@ msgstr "méiyǒu mókuài '%q'" msgid "no reset pin available" msgstr "Méiyǒu kěyòng de fùwèi yǐn jiǎo" +#: shared-module/sdcardio/SDCard.c +msgid "no response from SD card" +msgstr "" + #: py/runtime.c msgid "no such attribute" msgstr "méiyǒu cǐ shǔxìng" @@ -3114,6 +3151,14 @@ msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" msgid "timeout must be >= 0.0" msgstr "chāoshí bìxū shì >= 0.0" +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v1 card" +msgstr "" + +#: shared-module/sdcardio/SDCard.c +msgid "timeout waiting for v2 card" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" From 1a0c10c328842300aca8ed5113815cfb5bf95d26 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 17:15:01 -0700 Subject: [PATCH 903/919] Fix debug UART call --- supervisor/shared/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index 513022667a..8eb78a90e5 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -55,7 +55,7 @@ void serial_early_init(void) { const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(DEBUG_UART_TX); common_hal_busio_uart_construct(&debug_uart, tx, rx, NULL, NULL, NULL, - false, 115200, 8, PARITY_NONE, 1, 1.0f, 64, + false, 115200, 8, UART_PARITY_NONE, 1, 1.0f, 64, buf_array, true); common_hal_busio_uart_never_reset(&debug_uart); #endif From 965a40b6a19a9eb35ecc4256aa850d41c88a0137 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 17:17:46 -0700 Subject: [PATCH 904/919] Fix cxd56 function signature --- ports/cxd56/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index 718a8ff16e..2d365d4826 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -130,7 +130,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, return true; } -bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uint8_t *data_in, size_t len) { +bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { SPI_EXCHANGE(self->spi_dev, data_out, data_in, len); return true; From 69b3d475647b14a87891e38fe00a525b916c5d8a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 29 Jun 2020 18:21:53 -0700 Subject: [PATCH 905/919] Fix other esp builds --- .../boards/espressif_saola_1_wroom/board.c | 8 +++---- .../boards/unexpectedmaker_feathers2/board.c | 22 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c index b7b2c4ef5b..9f708874bf 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c +++ b/ports/esp32s2/boards/espressif_saola_1_wroom/board.c @@ -30,12 +30,12 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c index 8890ec4c16..1dc30b5af8 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c @@ -30,21 +30,21 @@ void board_init(void) { // USB - never_reset_pin(&pin_GPIO19); - never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); // Debug UART - never_reset_pin(&pin_GPIO43); - never_reset_pin(&pin_GPIO44); + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); // SPI Flash and RAM - never_reset_pin(&pin_GPIO26); - never_reset_pin(&pin_GPIO27); - never_reset_pin(&pin_GPIO28); - never_reset_pin(&pin_GPIO29); - never_reset_pin(&pin_GPIO30); - never_reset_pin(&pin_GPIO31); - never_reset_pin(&pin_GPIO32); + 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) { From d9e623eb09cbae5e088d761dd382df408f3c31d9 Mon Sep 17 00:00:00 2001 From: ansonhe97 Date: Tue, 30 Jun 2020 09:51:44 +0800 Subject: [PATCH 906/919] Fix order of ci check --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50b9cfeb4e..8ddb8bbd44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -239,8 +239,8 @@ jobs: - "robohatmm1_m4" - "sam32" - "same54_xplained" - - "seeeduino_xiao" - "seeeduino_wio_terminal" + - "seeeduino_xiao" - "serpente" - "shirtty" - "simmel" From 5028804878addc988548b91d173b5fb88380435f Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 30 Jun 2020 15:29:42 -0700 Subject: [PATCH 907/919] Remove fixed pointers and check UART return --- ports/esp32s2/common-hal/busio/I2C.c | 10 ++++++---- ports/esp32s2/common-hal/busio/I2C.h | 1 - ports/esp32s2/common-hal/busio/SPI.c | 6 +++--- ports/esp32s2/common-hal/busio/UART.c | 3 +++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 391d7323c5..74b3896fc2 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -90,8 +90,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, #endif - self->semaphore_handle = xSemaphoreCreateBinaryStatic(&self->semaphore); - xSemaphoreGive(self->semaphore_handle); + if (xSemaphoreCreateBinaryStatic(&self->semaphore) != &self->semaphore) { + mp_raise_RuntimeError(translate("Unable to create lock")); + } + xSemaphoreGive(&self->semaphore); self->sda_pin = sda; self->scl_pin = scl; self->i2c_num = I2C_NUM_MAX; @@ -161,7 +163,7 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { - self->has_lock = xSemaphoreTake(self->semaphore_handle, 0) == pdTRUE; + self->has_lock = xSemaphoreTake(&self->semaphore, 0) == pdTRUE; return self->has_lock; } @@ -170,7 +172,7 @@ bool common_hal_busio_i2c_has_lock(busio_i2c_obj_t *self) { } void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) { - xSemaphoreGive(self->semaphore_handle); + xSemaphoreGive(&self->semaphore); self->has_lock = false; } diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/esp32s2/common-hal/busio/I2C.h index d90fb2713a..24a3fd4951 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/esp32s2/common-hal/busio/I2C.h @@ -40,7 +40,6 @@ typedef struct { const mcu_pin_obj_t* sda_pin; i2c_port_t i2c_num; StaticSemaphore_t semaphore; - SemaphoreHandle_t semaphore_handle; bool has_lock; } busio_i2c_obj_t; diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 73d7d0595e..a22075cd59 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -209,9 +209,6 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, hal->io_mode = SPI_LL_IO_MODE_NORMAL; - // This must be set after spi_hal_init. - hal->timing_conf = &self->timing_conf; - common_hal_busio_spi_configure(self, 250000, 0, 0, 8); } @@ -261,6 +258,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, self->phase = phase; self->bits = bits; self->target_frequency = baudrate; + self->hal_context.timing_conf = &self->timing_conf; esp_err_t result = spi_hal_get_clock_conf(&self->hal_context, self->target_frequency, 128 /* duty_cycle */, @@ -315,6 +313,8 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou spi_hal_context_t* hal = &self->hal_context; hal->send_buffer = NULL; hal->rcv_buffer = NULL; + // Reset timing_conf in case we've moved since the last time we used it. + hal->timing_conf = &self->timing_conf; // This rounds up. size_t dma_count = (len + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; for (size_t i = 0; i < dma_count; i++) { diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/esp32s2/common-hal/busio/UART.c index f73f5c993d..b0162adba9 100644 --- a/ports/esp32s2/common-hal/busio/UART.c +++ b/ports/esp32s2/common-hal/busio/UART.c @@ -249,6 +249,9 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) { // Read as many chars as we can right now, up to len. size_t num_read = uart_read_bytes(self->uart_num, data, len, 0); + if (num_read < 0) { + break; + } // Advance pointer in data buffer, and decrease how many chars left to read. data += num_read; From c3d1256d765a7de12d787c2641017de25dbde7d0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 30 Jun 2020 15:30:07 -0700 Subject: [PATCH 908/919] Add one-of-each build target at the top level. --- Makefile | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0df1950938..d45dae8b90 100644 --- a/Makefile +++ b/Makefile @@ -244,11 +244,48 @@ update-frozen-libraries: @echo "Updating all frozen libraries to latest tagged version." cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done -one-of-each: all-source - make -C ports/atmel-samd BOARD=trinket_m0 - make -C ports/atmel-samd BOARD=feather_m4_express - make -C ports/esp32s2 BOARD=espressif_saola_1_wroom - make -C ports/litex BOARD=fomu - make -C ports/mimxrt10xx BOARD=feather_mimxrt1011 - make -C ports/nrf BOARD=feather_nrf52840_express - make -C ports/stm BOARD=feather_stm32f405_express +one-of-each: samd21 samd51 esp32s2 litex mimxrt10xx nrf stm + +samd21: + $(MAKE) -C ports/atmel-samd BOARD=trinket_m0 + +samd51: + $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express + +esp32s2: + $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom + +litex: + $(MAKE) -C ports/litex BOARD=fomu + +mimxrt10xx: + $(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011 + +nrf: + $(MAKE) -C ports/nrf BOARD=feather_nrf52840_express + +stm: + $(MAKE) -C ports/stm BOARD=feather_stm32f405_express + +clean-one-of-each: clean-samd21 clean-samd51 clean-esp32s2 clean-litex clean-mimxrt10xx clean-nrf clean-stm + +clean-samd21: + $(MAKE) -C ports/atmel-samd BOARD=trinket_m0 clean + +clean-samd51: + $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express clean + +clean-esp32s2: + $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom clean + +clean-litex: + $(MAKE) -C ports/litex BOARD=fomu clean + +clean-mimxrt10xx: + $(MAKE) -C ports/mimxrt10xx BOARD=feather_mimxrt1011 clean + +clean-nrf: + $(MAKE) -C ports/nrf BOARD=feather_nrf52840_express clean + +clean-stm: + $(MAKE) -C ports/stm BOARD=feather_stm32f405_express clean From 0a9c6fbb7f4381ab758945d4c02d9f156757a39c Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 30 Jun 2020 07:55:11 +0000 Subject: [PATCH 909/919] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (770 of 770 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 488 +++++++++++++++++++++++++----------------------- 1 file changed, 252 insertions(+), 236 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 30d77864b3..acabdb197e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-26 11:50-0500\n" -"PO-Revision-Date: 2020-06-29 23:50+0000\n" +"PO-Revision-Date: 2020-06-30 17:48+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -68,7 +68,7 @@ msgstr "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q falha: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -99,7 +99,7 @@ msgstr "%q deve ser uma tupla de comprimento 2" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q pin invalid" -msgstr "" +msgstr "%q pino inválido" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" @@ -395,7 +395,7 @@ msgstr "A profundidade de bits deve ser o múltiplo de 8." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Ambos os RX e TX são necessários para o controle do fluxo" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -443,7 +443,7 @@ msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "O comprimento do Buffer deve ser um múltiplo de 512" #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" @@ -610,7 +610,7 @@ msgstr "Código bruto corrompido" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "Não foi possível inicializar o GNSS" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" @@ -900,7 +900,7 @@ msgstr "Erro interno #%d" #: shared-bindings/sdioio/SDCard.c msgid "Invalid %q" -msgstr "" +msgstr "%q Inválido" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1295,7 +1295,7 @@ msgstr "O pino não tem recursos de ADC" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pin is input only" -msgstr "" +msgstr "Apenas o pino de entrada" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" @@ -1322,7 +1322,7 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "" +msgstr "O Polígono precisa de pelo menos 3 pontos" #: shared-bindings/ps2io/Ps2.c msgid "Pop from an empty Ps2 buffer" @@ -1419,7 +1419,7 @@ msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "" +msgstr "O formato CSD do Cartão SD não é compatível" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1491,7 +1491,7 @@ msgstr "Forneça pelo menos um pino UART" #: shared-bindings/gnss/GNSS.c msgid "System entry must be gnss.SatelliteSystem" -msgstr "" +msgstr "A entrada no sistema deve ser gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" @@ -1561,6 +1561,8 @@ msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" #, c-format msgid "Timeout is too long: Maximum timeout length is %d seconds" msgstr "" +"O tempo limite é long demais: O comprimento máximo do tempo limite é de %d " +"segundos" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1736,22 +1738,26 @@ msgstr "AVISO: Seu arquivo de código tem duas extensões\n" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" +"O WatchDogTimer não pode ser não-inicializado uma vez que o modo é definido " +"como RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer is not currently running" -msgstr "" +msgstr "O WatchDogTimer não está em execução" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" +"O WatchDogTimer.mode não pode ser alterado uma vez definido para WatchDogMode" +".RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" -msgstr "" +msgstr "O WatchDogTimer.timeout deve ser maior que 0" #: supervisor/shared/safe_mode.c msgid "Watchdog timer expired." -msgstr "" +msgstr "O temporizador Watchdog expirou." #: py/builtinhelp.c #, c-format @@ -2064,7 +2070,7 @@ msgstr "" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" -msgstr "" +msgstr "não é possível definir o tamanho de 512 blocos" #: py/objnamedtuple.c msgid "can't set attribute" @@ -2199,15 +2205,15 @@ msgstr "não foi possível inverter a matriz Vandermonde" #: shared-module/sdcardio/SDCard.c msgid "couldn't determine SD card version" -msgstr "" +msgstr "não foi possível determinar a versão do cartão SD" #: extmod/ulab/code/approx.c msgid "data must be iterable" -msgstr "" +msgstr "os dados devem ser iteráveis" #: extmod/ulab/code/approx.c msgid "data must be of equal length" -msgstr "" +msgstr "os dados devem ser de igual comprimento" #: extmod/ulab/code/numerical.c msgid "ddof must be smaller than length of data set" @@ -2281,31 +2287,31 @@ msgstr "erro = 0x%08lX" #: py/runtime.c msgid "exceptions must derive from BaseException" -msgstr "" +msgstr "as exceções devem derivar a partir do BaseException" #: py/objstr.c msgid "expected ':' after format specifier" -msgstr "" +msgstr "é esperado ':' após o especificador do formato" #: py/obj.c msgid "expected tuple/list" -msgstr "" +msgstr "é esperada tupla/lista" #: py/modthread.c msgid "expecting a dict for keyword args" -msgstr "" +msgstr "esperando um dicionário para os args da palavra-chave" #: py/compile.c msgid "expecting an assembler instruction" -msgstr "" +msgstr "esperando uma instrução assembler" #: py/compile.c msgid "expecting just a value for set" -msgstr "" +msgstr "esperando apenas um valor para o conjunto" #: py/compile.c msgid "expecting key:value for dict" -msgstr "" +msgstr "chave esperada: valor para dict" #: py/argcheck.c msgid "extra keyword arguments given" @@ -2317,28 +2323,28 @@ msgstr "argumentos extra posicionais passados" #: py/parse.c msgid "f-string expression part cannot include a '#'" -msgstr "" +msgstr "A parte da expressão f-string não pode incluir um '#'" #: py/parse.c msgid "f-string expression part cannot include a backslash" -msgstr "" +msgstr "A parte da expressão f-string não pode incluir uma barra invertida" #: py/parse.c msgid "f-string: empty expression not allowed" -msgstr "" +msgstr "f-string: expressão vazia não é permitida" #: py/parse.c msgid "f-string: expecting '}'" -msgstr "" +msgstr "f-string: esperando '}'" #: py/parse.c msgid "f-string: single '}' is not allowed" -msgstr "" +msgstr "f-string: um único '}' não é permitido" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" -msgstr "" +msgstr "o arquivo deve ser um arquivo aberto no modo byte" #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" @@ -2346,31 +2352,31 @@ msgstr "sistema de arquivos deve fornecer método de montagem" #: extmod/ulab/code/vectorise.c msgid "first argument must be a callable" -msgstr "" +msgstr "o primeiro argumento deve ser chamável" #: extmod/ulab/code/approx.c msgid "first argument must be a function" -msgstr "" +msgstr "o primeiro argumento deve ser uma função" #: extmod/ulab/code/ndarray.c msgid "first argument must be an iterable" -msgstr "" +msgstr "o primeiro argumento deve ser um iterável" #: extmod/ulab/code/vectorise.c msgid "first argument must be an ndarray" -msgstr "" +msgstr "o primeiro argumento deve ser um ndarray" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "" +msgstr "o primeiro argumento para super() deve ser um tipo" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" -msgstr "" +msgstr "a ordem do nivelamento deve ser 'C' ou 'F'" #: extmod/ulab/code/numerical.c msgid "flip argument must be an ndarray" -msgstr "" +msgstr "o argumento flip deve ser um ndarray" #: py/objint.c msgid "float too big" @@ -2378,11 +2384,11 @@ msgstr "float muito grande" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" -msgstr "" +msgstr "a fonte deve ter 2048 bytes de comprimento" #: py/objstr.c msgid "format requires a dict" -msgstr "" +msgstr "formato requer um dict" #: py/objdeque.c msgid "full" @@ -2399,15 +2405,15 @@ msgstr "função esperada na maioria dos %d argumentos, obteve %d" #: py/bc.c py/objnamedtuple.c msgid "function got multiple values for argument '%q'" -msgstr "" +msgstr "A função obteve vários valores para o argumento '%q'" #: extmod/ulab/code/approx.c msgid "function has the same sign at the ends of interval" -msgstr "" +msgstr "a função tem o mesmo sinal nas extremidades do intervalo" #: extmod/ulab/code/compare.c msgid "function is implemented for scalars and ndarrays only" -msgstr "" +msgstr "A função foi implementada apenas para escalares e ndarrays" #: py/argcheck.c #, c-format @@ -2416,16 +2422,16 @@ msgstr "função ausente %d requer argumentos posicionais" #: py/bc.c msgid "function missing keyword-only argument" -msgstr "" +msgstr "falta apenas a palavra chave do argumento da função" #: py/bc.c msgid "function missing required keyword argument '%q'" -msgstr "" +msgstr "falta apenas a palavra chave do argumento '%q' da função" #: py/bc.c #, c-format msgid "function missing required positional argument #%d" -msgstr "" +msgstr "falta o argumento #%d da posição necessária da função" #: py/argcheck.c py/bc.c py/objnamedtuple.c #, c-format @@ -2438,15 +2444,15 @@ msgstr "função leva exatamente 9 argumentos" #: py/objgenerator.c msgid "generator already executing" -msgstr "" +msgstr "o gerador já está em execução" #: py/objgenerator.c msgid "generator ignored GeneratorExit" -msgstr "" +msgstr "ignorando o gerador GeneratorExit" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" -msgstr "" +msgstr "o gráfico deve ter 2048 bytes de comprimento" #: extmod/moduheapq.c msgid "heap must be a list" @@ -2454,11 +2460,11 @@ msgstr "a área de alocação dinâmica de variáveis (heap) deve ser uma lista" #: py/compile.c msgid "identifier redefined as global" -msgstr "" +msgstr "o identificador foi redefinido como global" #: py/compile.c msgid "identifier redefined as nonlocal" -msgstr "" +msgstr "o identificador foi redefinido como não-local" #: py/objstr.c msgid "incomplete format" @@ -2466,7 +2472,7 @@ msgstr "formato incompleto" #: py/objstr.c msgid "incomplete format key" -msgstr "" +msgstr "a chave do formato está incompleto" #: extmod/modubinascii.c msgid "incorrect padding" @@ -2474,7 +2480,7 @@ msgstr "preenchimento incorreto" #: extmod/ulab/code/ndarray.c msgid "index is out of bounds" -msgstr "" +msgstr "o índice está fora dos limites" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c @@ -2485,55 +2491,55 @@ msgstr "Índice fora do intervalo" #: py/obj.c msgid "indices must be integers" -msgstr "" +msgstr "os índices devem ser inteiros" #: extmod/ulab/code/ndarray.c msgid "indices must be integers, slices, or Boolean lists" -msgstr "" +msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" #: extmod/ulab/code/approx.c msgid "initial values must be iterable" -msgstr "" +msgstr "os valores iniciais devem ser iteráveis" #: py/compile.c msgid "inline assembler must be a function" -msgstr "" +msgstr "o assembler em linha deve ser uma função" #: extmod/ulab/code/create.c msgid "input argument must be an integer or a 2-tuple" -msgstr "" +msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" #: extmod/ulab/code/fft.c msgid "input array length must be power of 2" -msgstr "" +msgstr "comprimento da matriz da entrada deve ter potência de 2" #: extmod/ulab/code/poly.c msgid "input data must be an iterable" -msgstr "" +msgstr "os dados da entrada devem ser iteráveis" #: extmod/ulab/code/linalg.c msgid "input matrix is asymmetric" -msgstr "" +msgstr "a matriz da entrada é assimétrica" #: extmod/ulab/code/linalg.c msgid "input matrix is singular" -msgstr "" +msgstr "a matriz da entrada é singular" #: extmod/ulab/code/linalg.c msgid "input must be square matrix" -msgstr "" +msgstr "a entrada deve ser uma matriz quadrada" #: extmod/ulab/code/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "" +msgstr "A entrada deve ser tupla, lista, intervalo ou matriz" #: extmod/ulab/code/poly.c msgid "input vectors must be of equal length" -msgstr "" +msgstr "os vetores da entrada devem ter o mesmo comprimento" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "" +msgstr "int() arg 2 deve ser >= 2 e <= 36" #: py/objstr.c msgid "integer required" @@ -2541,12 +2547,12 @@ msgstr "inteiro requerido" #: extmod/ulab/code/approx.c msgid "interp is defined for 1D arrays of equal length" -msgstr "" +msgstr "o interp é definido para matrizes 1D de igual comprimento" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "" +msgstr "o intervalo deve estar entre %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -2566,7 +2572,7 @@ msgstr "formato inválido" #: py/objstr.c msgid "invalid format specifier" -msgstr "" +msgstr "o especificador do formato é inválido" #: extmod/modussl_axtls.c msgid "invalid key" @@ -2574,7 +2580,7 @@ msgstr "chave inválida" #: py/compile.c msgid "invalid micropython decorator" -msgstr "" +msgstr "o decorador micropython é inválido" #: shared-bindings/random/__init__.c msgid "invalid step" @@ -2582,119 +2588,122 @@ msgstr "passo inválido" #: py/compile.c py/parse.c msgid "invalid syntax" -msgstr "" +msgstr "sintaxe inválida" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "sintaxe inválida para o número inteiro" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "" +msgstr "sintaxe inválida para o número inteiro com base %d" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "" +msgstr "sintaxe inválida para o número" #: py/objtype.c msgid "issubclass() arg 1 must be a class" -msgstr "" +msgstr "issubclass() arg 1 deve ser uma classe" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" -msgstr "" +msgstr "issubclass() arg 2 deve ser uma classe ou uma tupla de classes" #: extmod/ulab/code/ndarray.c msgid "iterables are not of the same length" -msgstr "" +msgstr "os iteráveis não têm o mesmo comprimento" #: extmod/ulab/code/linalg.c msgid "iterations did not converge" -msgstr "" +msgstr "as iterações não convergiram" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" +"join espera uma lista de objetos str/bytes consistentes com o próprio objeto" #: py/argcheck.c msgid "keyword argument(s) not yet implemented - use normal args instead" msgstr "" +"o(s) argumento(s) de palavra-chave ainda não foi implementado - em vez " +"disso, use argumentos normais" #: py/bc.c msgid "keywords must be strings" -msgstr "" +msgstr "as palavras-chave devem ser uma cadeia de caracteres" #: py/emitinlinethumb.c py/emitinlinextensa.c msgid "label '%q' not defined" -msgstr "" +msgstr "o rótulo '%q' não foi definido" #: py/compile.c msgid "label redefined" -msgstr "" +msgstr "o rótulo foi redefinido" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "" +msgstr "o argumento de comprimento não é permitido para este tipo" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" -msgstr "" +msgstr "o nível deve estar entre 0 e 1" #: py/objarray.c msgid "lhs and rhs should be compatible" -msgstr "" +msgstr "o lhs e rhs devem ser compatíveis" #: py/emitnative.c msgid "local '%q' has type '%q' but source is '%q'" -msgstr "" +msgstr "o local '%q' tem o tipo '%q', porém a origem é '%q'" #: py/emitnative.c msgid "local '%q' used before type known" -msgstr "" +msgstr "o local '%q' usado antes do tipo conhecido" #: py/vm.c msgid "local variable referenced before assignment" -msgstr "" +msgstr "a variável local referenciada antes da atribuição" #: py/objint.c msgid "long int not supported in this build" -msgstr "" +msgstr "o long int não é suportado nesta compilação" #: py/parse.c msgid "malformed f-string" -msgstr "" +msgstr "f-string malformado" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" -msgstr "" +msgstr "o mapa do buffer é muito pequeno" #: py/modmath.c shared-bindings/math/__init__.c msgid "math domain error" -msgstr "" +msgstr "erro de domínio matemático" #: extmod/ulab/code/linalg.c msgid "matrix dimensions do not match" -msgstr "" +msgstr "as dimensões da matriz não coincidem" #: extmod/ulab/code/linalg.c msgid "matrix is not positive definite" -msgstr "" +msgstr "a matriz não é definitiva positiva" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "" +msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" #: py/runtime.c msgid "maximum recursion depth exceeded" -msgstr "" +msgstr "a recursão máxima da profundidade foi excedida" #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" -msgstr "" +msgstr "falha na alocação de memória, alocando %u bytes" #: py/runtime.c msgid "memory allocation failed, heap is locked" @@ -2704,39 +2713,39 @@ msgstr "" #: py/builtinimport.c msgid "module not found" -msgstr "" +msgstr "o módulo não foi encontrado" #: extmod/ulab/code/poly.c msgid "more degrees of freedom than data points" -msgstr "" +msgstr "mais graus de liberdade do que pontos de dados" #: py/compile.c msgid "multiple *x in assignment" -msgstr "" +msgstr "múltiplo *x na atribuição" #: py/objtype.c msgid "multiple bases have instance lay-out conflict" -msgstr "" +msgstr "várias bases possuem instâncias de layout com conflitos" #: py/objtype.c msgid "multiple inheritance not supported" -msgstr "" +msgstr "herança múltipla não suportada" #: py/emitnative.c msgid "must raise an object" -msgstr "" +msgstr "deve levantar um objeto" #: py/modbuiltins.c msgid "must use keyword argument for key function" -msgstr "" +msgstr "deve usar o argumento da palavra-chave para a função da chave" #: extmod/ulab/code/numerical.c msgid "n must be between 0, and 9" -msgstr "" +msgstr "n deve estar entre 0 e 9" #: py/runtime.c msgid "name '%q' is not defined" -msgstr "" +msgstr "o nome '%q' não está definido" #: py/runtime.c msgid "name not defined" @@ -2744,11 +2753,11 @@ msgstr "nome não definido" #: py/compile.c msgid "name reused for argument" -msgstr "" +msgstr "o nome foi reutilizado para o argumento" #: py/emitnative.c msgid "native yield" -msgstr "" +msgstr "rendimento nativo" #: py/runtime.c #, c-format @@ -2757,113 +2766,113 @@ msgstr "precisa de mais de %d valores para desempacotar" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "" +msgstr "potência negativa sem suporte de flutuação" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "" +msgstr "contagem de turnos negativos" #: shared-module/sdcardio/SDCard.c msgid "no SD card" -msgstr "" +msgstr "nenhum cartão SD" #: py/vm.c msgid "no active exception to reraise" -msgstr "" +msgstr "nenhuma exceção ativa para reraise" #: shared-bindings/socket/__init__.c shared-module/network/__init__.c msgid "no available NIC" -msgstr "" +msgstr "não há uma Placa de Rede disponível" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "" +msgstr "nenhuma ligação para nonlocal foi encontrada" #: py/builtinimport.c msgid "no module named '%q'" -msgstr "" +msgstr "nenhum módulo chamado '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" -msgstr "" +msgstr "nenhum pino de redefinição está disponível" #: shared-module/sdcardio/SDCard.c msgid "no response from SD card" -msgstr "" +msgstr "não houve resposta do cartão SD" #: py/runtime.c msgid "no such attribute" -msgstr "" +msgstr "não há tal atributo" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "" +msgstr "um não UUID foi encontrado na lista service_uuids_whitelist" #: py/compile.c msgid "non-default argument follows default argument" -msgstr "" +msgstr "o argumento não predefinido segue o argumento predefinido" #: extmod/modubinascii.c msgid "non-hex digit found" -msgstr "" +msgstr "um dígito não hexadecimal foi encontrado" #: py/compile.c msgid "non-keyword arg after */**" -msgstr "" +msgstr "um arg sem palavra-chave após */ **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "" +msgstr "um arg não-palavra-chave após a palavra-chave arg" #: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" -msgstr "" +msgstr "não é um UUID com 128 bits" #: py/objstr.c msgid "not all arguments converted during string formatting" -msgstr "" +msgstr "nem todos os argumentos são convertidos durante a formatação da string" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "" +msgstr "argumentos insuficientes para o formato da string" #: extmod/ulab/code/poly.c msgid "number of arguments must be 2, or 3" -msgstr "" +msgstr "a quantidade dos argumentos deve ser 2 ou 3" #: extmod/ulab/code/create.c msgid "number of points must be at least 2" -msgstr "" +msgstr "a quantidade dos pontos deve ser pelo menos 2" #: py/obj.c #, c-format msgid "object '%s' is not a tuple or list" -msgstr "" +msgstr "o objeto '%s' não é uma tupla ou uma lista" #: py/obj.c msgid "object does not support item assignment" -msgstr "" +msgstr "O objeto não suporta a atribuição dos itens" #: py/obj.c msgid "object does not support item deletion" -msgstr "" +msgstr "objeto não suporta a exclusão do item" #: py/obj.c msgid "object has no len" -msgstr "" +msgstr "o objeto não tem len" #: py/obj.c msgid "object is not subscriptable" -msgstr "" +msgstr "O objeto não é subroteirizável" #: py/runtime.c msgid "object not an iterator" -msgstr "" +msgstr "o objeto não é um iterador" #: py/objtype.c py/runtime.c msgid "object not callable" -msgstr "" +msgstr "o objeto não é resgatável" #: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" @@ -2876,121 +2885,126 @@ msgstr "objeto não iterável" #: py/obj.c #, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "O objeto do tipo '%s' não possui len()" #: py/obj.c msgid "object with buffer protocol required" -msgstr "" +msgstr "é necessário objeto com protocolo do buffer" #: extmod/modubinascii.c msgid "odd-length string" -msgstr "" +msgstr "sequência com comprimento ímpar" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" -msgstr "" +msgstr "desvio fora dos limites" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only bit_depth=16 is supported" -msgstr "" +msgstr "apenas bit_depth = 16 é compatível" #: ports/nrf/common-hal/audiobusio/PDMIn.c msgid "only sample_rate=16000 is supported" -msgstr "" +msgstr "apenas sample_rate = 16000 é compatível" #: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c #: shared-bindings/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" msgstr "" +"apenas fatias com a etapa=1 (também conhecida como Nenhuma) são compatíveis" #: extmod/ulab/code/compare.c extmod/ulab/code/ndarray.c #: extmod/ulab/code/vectorise.c msgid "operands could not be broadcast together" -msgstr "" +msgstr "os operandos não puderam ser transmitidos juntos" #: extmod/ulab/code/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "" +msgstr "a operação não foi implementada nos ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" -msgstr "" +msgstr "operação não é compatível com o tipo informado" #: py/modbuiltins.c msgid "ord expects a character" -msgstr "" +msgstr "o ord espera um caractere" #: py/modbuiltins.c #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" +"o ord() esperava um caractere, porém a sequência do comprimento %d foi " +"encontrada" #: py/objint_mpz.c msgid "overflow converting long int to machine word" msgstr "" +"houve um transbordamento durante a conversão int longo para a palavra de " +"máquina" #: shared-bindings/_stage/Layer.c shared-bindings/_stage/Text.c msgid "palette must be 32 bytes long" -msgstr "" +msgstr "a paleta deve ter 32 bytes de comprimento" #: shared-bindings/displayio/Palette.c msgid "palette_index should be an int" -msgstr "" +msgstr "palette_index deve ser um int" #: py/compile.c msgid "parameter annotation must be an identifier" -msgstr "" +msgstr "a anotação do parâmetro deve ser um identificador" #: py/emitinlinextensa.c msgid "parameters must be registers in sequence a2 to a5" -msgstr "" +msgstr "os parâmetros devem ser registradores na sequência a2 até a5" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "" +msgstr "os parâmetros devem ser registradores na sequência r0 até r3" #: shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" -msgstr "" +msgstr "as coordenadas do pixel estão fora dos limites" #: shared-bindings/displayio/Bitmap.c msgid "pixel value requires too many bits" -msgstr "" +msgstr "o valor do pixel requer bits demais" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" -msgstr "" +msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" #: shared-module/vectorio/Polygon.c msgid "polygon can only be registered in one parent" -msgstr "" +msgstr "o polígono só pode ser registrado em um pai" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" -msgstr "" +msgstr "pop a partir de um PulseIn vazio" #: py/objset.c msgid "pop from an empty set" -msgstr "" +msgstr "pop a partir de um conjunto vazio" #: py/objlist.c msgid "pop from empty list" -msgstr "" +msgstr "pop a partir da lista vazia" #: py/objdict.c msgid "popitem(): dictionary is empty" -msgstr "" +msgstr "popitem(): o dicionário está vazio" #: py/objint_mpz.c msgid "pow() 3rd argument cannot be 0" -msgstr "" +msgstr "O terceiro argumento pow() não pode ser 0" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "" +msgstr "o pow() com 3 argumentos requer números inteiros" #: extmod/modutimeq.c msgid "queue overflow" @@ -2998,52 +3012,54 @@ msgstr "estouro de fila" #: py/parse.c msgid "raw f-strings are not implemented" -msgstr "" +msgstr "o f-strings bruto não estão implementados" #: extmod/ulab/code/fft.c msgid "real and imaginary parts must be of equal length" -msgstr "" +msgstr "partes reais e imaginárias devem ter o mesmo comprimento" #: py/builtinimport.c msgid "relative import" -msgstr "" +msgstr "importação relativa" #: py/obj.c #, c-format msgid "requested length %d but object has length %d" -msgstr "" +msgstr "o comprimento solicitado %d, porém o objeto tem comprimento %d" #: py/compile.c msgid "return annotation must be an identifier" -msgstr "" +msgstr "a anotação do retorno deve ser um identificador" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "" +msgstr "o retorno esperado era '%q', porém obteve '% q'" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] duplicates another pin assignment" -msgstr "" +msgstr "rgb_pins[%d] duplica outra atribuição dos pinos" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "" +msgstr "rgb_pins[%d] não está na mesma porta que o clock" #: extmod/ulab/code/ndarray.c msgid "right hand side must be an ndarray, or a scalar" -msgstr "" +msgstr "o lado direito deve ser um ndarray ou um escalar" #: py/objstr.c msgid "rsplit(None,n)" -msgstr "" +msgstr "rsplit(Nenhum,n)" #: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" msgstr "" +"O buffer sample_source deve ser um bytearray ou matriz do tipo 'h', 'H', 'b' " +"ou 'B'" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -3051,7 +3067,7 @@ msgstr "Taxa de amostragem fora do intervalo" #: py/modmicropython.c msgid "schedule stack full" -msgstr "" +msgstr "agende a pilha de função completa" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" @@ -3059,47 +3075,47 @@ msgstr "compilação de script não suportada" #: extmod/ulab/code/ndarray.c msgid "shape must be a 2-tuple" -msgstr "" +msgstr "a forma deve ser uma tupla de 2" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "" +msgstr "sinal não permitido no especificador do formato da sequência" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" -msgstr "" +msgstr "sinal não permitido com o especificador no formato inteiro 'c'" #: py/objstr.c msgid "single '}' encountered in format string" -msgstr "" +msgstr "único '}' encontrado na string do formato" #: extmod/ulab/code/linalg.c msgid "size is defined for ndarrays only" -msgstr "" +msgstr "o tamanho é definido apenas para os ndarrays" #: shared-bindings/time/__init__.c msgid "sleep length must be non-negative" -msgstr "" +msgstr "a duração do sleep não deve ser negativo" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" -msgstr "" +msgstr "a etapa da fatia não pode ser zero" #: py/objint.c py/sequence.c msgid "small int overflow" -msgstr "" +msgstr "transbordamento int pequeno" #: main.c msgid "soft reboot\n" -msgstr "" +msgstr "reinicialização soft\n" #: extmod/ulab/code/numerical.c msgid "sort argument must be an ndarray" -msgstr "" +msgstr "o argumento da classificação deve ser um ndarray" #: py/objstr.c msgid "start/end indices" -msgstr "" +msgstr "os índices de início/fim" #: shared-bindings/displayio/Shape.c msgid "start_x should be an int" @@ -3111,28 +3127,28 @@ msgstr "o passo deve ser diferente de zero" #: shared-bindings/busio/UART.c msgid "stop must be 1 or 2" -msgstr "" +msgstr "o stop deve ser 1 ou 2" #: shared-bindings/random/__init__.c msgid "stop not reachable from start" -msgstr "" +msgstr "stop não está acessível a partir do início" #: py/stream.c msgid "stream operation not supported" -msgstr "" +msgstr "a operação do fluxo não é compatível" #: py/objstrunicode.c msgid "string index out of range" -msgstr "" +msgstr "o índice da string está fora do intervalo" #: py/objstrunicode.c #, c-format msgid "string indices must be integers, not %s" -msgstr "" +msgstr "o índices das string devem ser números inteiros, não %s" #: py/stream.c msgid "string not supported; use bytes or bytearray" -msgstr "" +msgstr "a string não é compatível; use bytes ou bytearray" #: extmod/moductypes.c msgid "struct: cannot index" @@ -3148,11 +3164,11 @@ msgstr "struct: sem campos" #: py/objstr.c msgid "substring not found" -msgstr "" +msgstr "a substring não foi encontrada" #: py/compile.c msgid "super() can't find self" -msgstr "" +msgstr "o super() não consegue se encontrar" #: extmod/modujson.c msgid "syntax error in JSON" @@ -3160,7 +3176,7 @@ msgstr "erro de sintaxe no JSON" #: extmod/moductypes.c msgid "syntax error in uctypes descriptor" -msgstr "" +msgstr "houve um erro de sintaxe no descritor uctypes" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" @@ -3168,15 +3184,15 @@ msgstr "Limite deve estar no alcance de 0-65536" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" -msgstr "" +msgstr "time.struct_time() leva uma sequência com 9" #: ports/nrf/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" -msgstr "" +msgstr "a duração do tempo limite excedeu o valor máximo suportado" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -3184,11 +3200,11 @@ msgstr "o tempo limite deve ser >= 0,0" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" -msgstr "" +msgstr "o tempo limite na espera pelo cartão v1" #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v2 card" -msgstr "" +msgstr "o tempo limite na espera pelo cartão v2" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" @@ -3200,24 +3216,24 @@ msgstr "Muitos argumentos fornecidos com o formato dado" #: extmod/ulab/code/ndarray.c msgid "too many indices" -msgstr "" +msgstr "índices demais" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "" +msgstr "valores demais para descompactar (esperado %d)" #: extmod/ulab/code/linalg.c py/objstr.c msgid "tuple index out of range" -msgstr "" +msgstr "o índice da tupla está fora do intervalo" #: py/obj.c msgid "tuple/list has wrong length" -msgstr "" +msgstr "a tupla/lista está com tamanho incorreto" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "tuple/list required on RHS" -msgstr "" +msgstr "a tupla/lista necessária no RHS" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c @@ -3226,69 +3242,69 @@ msgstr "TX e RX não podem ser ambos" #: py/objtype.c msgid "type '%q' is not an acceptable base type" -msgstr "" +msgstr "o tipo '%q' não é um tipo base aceitável" #: py/objtype.c msgid "type is not an acceptable base type" -msgstr "" +msgstr "tipo não é um tipo base aceitável" #: py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "" +msgstr "o objeto tipo '%q' não possuí atributo '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" -msgstr "" +msgstr "o tipo usa 1 ou 3 argumentos" #: py/objint_longlong.c msgid "ulonglong too large" -msgstr "" +msgstr "ulonglong é muito grande" #: py/emitnative.c msgid "unary op %q not implemented" -msgstr "" +msgstr "op %q unário não foi implementado" #: py/parse.c msgid "unexpected indent" -msgstr "" +msgstr "recuo inesperado" #: py/bc.c msgid "unexpected keyword argument" -msgstr "" +msgstr "argumento inesperado da palavra-chave" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "" +msgstr "argumento inesperado da palavra-chave '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "" +msgstr "escapar o nome unicode" #: py/parse.c msgid "unindent does not match any outer indentation level" -msgstr "" +msgstr "o unindent não coincide com nenhum nível de recuo externo" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "" +msgstr "especificador de conversão desconhecido %c" #: py/objstr.c #, c-format msgid "unknown format code '%c' for object of type '%s'" -msgstr "" +msgstr "código de formato desconhecido '%c' para o objeto do tipo '%s'" #: py/compile.c msgid "unknown type" -msgstr "" +msgstr "tipo desconhecido" #: py/emitnative.c msgid "unknown type '%q'" -msgstr "" +msgstr "tipo desconhecido '%q'" #: py/objstr.c msgid "unmatched '{' in format" -msgstr "" +msgstr "um '{' sem par no formato" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -3297,83 +3313,83 @@ msgstr "atributo ilegível" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c #: shared-module/vectorio/Polygon.c msgid "unsupported %q type" -msgstr "" +msgstr "tipo %q não suportado" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "" +msgstr "instrução Thumb '%s' não compatível com argumentos %d" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "" +msgstr "instrução Xtensa '%s' não compatível com argumentos %d" #: py/objstr.c #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" -msgstr "" +msgstr "o caractere do formato não é compatível '%c' (0x%x) no índice %d" #: py/runtime.c msgid "unsupported type for %q: '%s'" -msgstr "" +msgstr "tipo não compatível para %q: '%s'" #: py/runtime.c msgid "unsupported type for operator" -msgstr "" +msgstr "tipo não compatível para o operador" #: py/runtime.c msgid "unsupported types for %q: '%s', '%s'" -msgstr "" +msgstr "tipos não compatíveis para %q: '%s', '%s'" #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" -msgstr "" +msgstr "o valor deve caber em %d byte(s)" #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" -msgstr "" +msgstr "o value_count deve ser > 0" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" -msgstr "" +msgstr "o tempo limite do watchdog deve ser maior que 0" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "" +msgstr "a janela deve ser <= intervalo" #: extmod/ulab/code/linalg.c msgid "wrong argument type" -msgstr "" +msgstr "tipo do argumento errado" #: extmod/ulab/code/ndarray.c msgid "wrong index type" -msgstr "" +msgstr "tipo do índice errado" #: extmod/ulab/code/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "tipo da entrada incorreta" #: py/objstr.c msgid "wrong number of arguments" -msgstr "" +msgstr "quantidade errada dos argumentos" #: py/runtime.c msgid "wrong number of values to unpack" -msgstr "" +msgstr "quantidade incorreta dos valores para descompressão" #: extmod/ulab/code/ndarray.c msgid "wrong operand type" -msgstr "" +msgstr "tipo do operando errado" #: extmod/ulab/code/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "tipo da saída incorreta" #: shared-module/displayio/Shape.c msgid "x value out of bounds" -msgstr "" +msgstr "a valor x está fora dos limites" #: shared-bindings/displayio/Shape.c msgid "y should be an int" @@ -3381,7 +3397,7 @@ msgstr "y deve ser um int" #: shared-module/displayio/Shape.c msgid "y value out of bounds" -msgstr "" +msgstr "o valor y está fora dos limites" #: py/objrange.c msgid "zero step" From 783846c6057f96999687c5895bef97b28e47e1fa Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:00:28 -0500 Subject: [PATCH 910/919] ulab: update to 0.51.1 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index 0394801933..48cb939839 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 0394801933f6e68a5bc7cdb0da76c7884e8cf70a +Subproject commit 48cb939839fcf091fcdcdf742530b1b650066a15 From e33accae4d8439dbab0764d98e6f188c9489eb06 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:15:09 -0500 Subject: [PATCH 911/919] ulab: document sosfilt --- shared-bindings/ulab/filter/__init__.pyi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shared-bindings/ulab/filter/__init__.pyi b/shared-bindings/ulab/filter/__init__.pyi index fff404300b..5e7202e06c 100644 --- a/shared-bindings/ulab/filter/__init__.pyi +++ b/shared-bindings/ulab/filter/__init__.pyi @@ -17,3 +17,20 @@ def convolve(r, c=None): Convolution is most time-efficient when both inputs are of float type.""" ... + +def sosfilt(sos : ulab.array, x : ulab.array, *, xi : Optional[ulab.array] = None) -> Union[ulab.array, Tuple[ulab.array, ulab.array]]: + """ + :param ulab.array sos: Array of second-order filter coefficients, must have shape (n_sections, 6). Each row corresponds to a second-order section, with the first three columns providing the numerator coefficients and the last three providing the denominator coefficients. + :param ulab.array x: The data to be filtered + :param ulab.array zi: Optional initial conditions for the filter + + :return: If ``xi`` is not specified, the filter result alone is returned. If ``xi`` is specified, the return value is a 2-tuple of the filter result and the final filter conditions. + + Filter data along one dimension using cascaded second-order sections. + + Filter a data sequence, x, using a digital IIR filter defined by sos. + + The filter function is implemented as a series of second-order filters with direct-form II transposed structure. It is designed to minimize numerical precision errors for high-order filters. + + Filter coefficients can be generated by using scipy's filter generators such as ``signal.ellip(..., output='sos')``.""" + ... From 48bc4bd5d6159c55ebe4c4ef6f517d794a054502 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 1 Jul 2020 10:33:38 -0500 Subject: [PATCH 912/919] make translate --- locale/circuitpython.pot | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3a3b159a04..7141cc8722 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3009,6 +3009,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3025,6 +3029,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3314,3 +3330,15 @@ msgstr "" #: py/objrange.c msgid "zero step" msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" From 367d3800fc501bfe3ec05b4b517ed195cf8d07c4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 1 Jul 2020 14:35:25 -0700 Subject: [PATCH 913/919] Return false if we already have the lock --- ports/esp32s2/common-hal/busio/I2C.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c index 74b3896fc2..57270372f1 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/esp32s2/common-hal/busio/I2C.c @@ -163,6 +163,9 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { } bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { + if (self->has_lock) { + return false; + } self->has_lock = xSemaphoreTake(&self->semaphore, 0) == pdTRUE; return self->has_lock; } From 87d58b3b0a7b9d1c67e3234680a14a18ca55189c Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 1 Jul 2020 17:48:10 -0400 Subject: [PATCH 914/919] STM32: add debug flags, fix hang in simplex SPI --- ports/stm/Makefile | 4 ++-- ports/stm/common-hal/busio/SPI.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 08cb36ddf2..a982de765b 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -81,12 +81,12 @@ INC += -I../../supervisor/shared/usb #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb + CFLAGS += -ggdb3 # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-inline -fno-ipa-sra else CFLAGS += -Os -DNDEBUG - CFLAGS += -ggdb + CFLAGS += -ggdb3 # TODO: Test with -flto # CFLAGS += -flto endif diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 65eeb8ebcf..380302da65 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -238,8 +238,11 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; - // Direction change only required for RX-only, see RefMan RM0090:884 - self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; + // Implementing one-directional recieve-only SPI as per [RefMan RM0090:884] + // results in BSY bit related hangs. Using MOSI as an IO works fine without it, + // so it's unclear why this mode is present in the first place. + //self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; + self->handle.Init.Direction = SPI_DIRECTION_2LINES; self->handle.Init.DataSize = SPI_DATASIZE_8BIT; self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; From a301a9d9b12b69284a6f21e365505a96295e0743 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 1 Jul 2020 23:21:09 +0200 Subject: [PATCH 915/919] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 30 +++++++++++++++++++++++++++++- locale/cs.po | 30 +++++++++++++++++++++++++++++- locale/de_DE.po | 30 +++++++++++++++++++++++++++++- locale/es.po | 30 +++++++++++++++++++++++++++++- locale/fil.po | 30 +++++++++++++++++++++++++++++- locale/fr.po | 30 +++++++++++++++++++++++++++++- locale/it_IT.po | 30 +++++++++++++++++++++++++++++- locale/ko.po | 30 +++++++++++++++++++++++++++++- locale/nl.po | 30 +++++++++++++++++++++++++++++- locale/pl.po | 30 +++++++++++++++++++++++++++++- locale/pt_BR.po | 34 +++++++++++++++++++++++++++++++--- locale/sv.po | 30 +++++++++++++++++++++++++++++- locale/zh_Latn_pinyin.po | 30 +++++++++++++++++++++++++++++- 13 files changed, 379 insertions(+), 15 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 8d89115d7a..da4f7b904b 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3034,6 +3034,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3050,6 +3054,18 @@ msgstr "memulai ulang software(soft reboot)\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3341,6 +3357,18 @@ msgstr "" msgid "zero step" msgstr "" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP dibutuhkan" diff --git a/locale/cs.po b/locale/cs.po index 3869cd45ab..9029985397 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-05-24 03:22+0000\n" "Last-Translator: dronecz \n" "Language-Team: LANGUAGE \n" @@ -3017,6 +3017,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3033,6 +3037,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3322,3 +3338,15 @@ msgstr "" #: py/objrange.c msgid "zero step" msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 567a2f8ba2..3b7c49b396 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-16 18:24+0000\n" "Last-Translator: Andreas Buchen \n" "Language: de_DE\n" @@ -3100,6 +3100,10 @@ msgstr "Größe ist nur für ndarrays definiert" msgid "sleep length must be non-negative" msgstr "Die Schlafdauer darf nicht negativ sein" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "Der Slice-Schritt kann nicht Null sein" @@ -3116,6 +3120,18 @@ msgstr "weicher reboot\n" msgid "sort argument must be an ndarray" msgstr "sortierungs Argument muss ein ndarray sein" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -3411,6 +3427,18 @@ msgstr "y Wert außerhalb der Grenzen" msgid "zero step" msgstr "Nullschritt" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP erforderlich" diff --git a/locale/es.po b/locale/es.po index aad07ddf4f..9034024068 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-29 13:13+0000\n" "Last-Translator: Alvaro Figueroa \n" "Language-Team: \n" @@ -3072,6 +3072,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "la longitud de sleep no puede ser negativa" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "slice step no puede ser cero" @@ -3088,6 +3092,18 @@ msgstr "reinicio suave\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -3381,6 +3397,18 @@ msgstr "address fuera de límites" msgid "zero step" msgstr "paso cero" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/fil.po b/locale/fil.po index 4f155ecc58..ff5cc6426d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -3063,6 +3063,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "sleep length ay dapat hindi negatibo" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "slice step ay hindi puedeng 0" @@ -3079,6 +3083,18 @@ msgstr "malambot na reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -3373,6 +3389,18 @@ msgstr "wala sa sakop ang address" msgid "zero step" msgstr "zero step" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP kailangan" diff --git a/locale/fr.po b/locale/fr.po index 392b779894..7facdef043 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-05 17:29+0000\n" "Last-Translator: aberwag \n" "Language: fr\n" @@ -3106,6 +3106,10 @@ msgstr "la taille est définie pour les ndarrays uniquement" msgid "sleep length must be non-negative" msgstr "la longueur de sleep ne doit pas être négative" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "le pas 'step' de la tranche ne peut être zéro" @@ -3122,6 +3126,18 @@ msgstr "redémarrage logiciel\n" msgid "sort argument must be an ndarray" msgstr "l'argument de «sort» doit être un ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -3413,6 +3429,18 @@ msgstr "valeur y hors limites" msgid "zero step" msgstr "'step' nul" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "'AP' requis" diff --git a/locale/it_IT.po b/locale/it_IT.po index 13651437b7..983b47b824 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -3070,6 +3070,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "la lunghezza di sleed deve essere non negativa" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "la step della slice non può essere zero" @@ -3086,6 +3090,18 @@ msgstr "soft reboot\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3380,6 +3396,18 @@ msgstr "indirizzo fuori limite" msgid "zero step" msgstr "zero step" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP richiesto" diff --git a/locale/ko.po b/locale/ko.po index 73926d47bd..ea3f564700 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -3014,6 +3014,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "" @@ -3030,6 +3034,18 @@ msgstr "" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "" @@ -3320,6 +3336,18 @@ msgstr "" msgid "zero step" msgstr "" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Can't add services in Central mode" #~ msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" diff --git a/locale/nl.po b/locale/nl.po index b9fd85e163..12a767b183 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-02 19:50+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -3073,6 +3073,10 @@ msgstr "omvang is alleen voor ndarrays gedefinieerd" msgid "sleep length must be non-negative" msgstr "de slaapduur mag niet negatief zijn" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "segmentstap mag niet nul zijn" @@ -3089,6 +3093,18 @@ msgstr "zachte herstart\n" msgid "sort argument must be an ndarray" msgstr "sorteerargument moet een ndarray zijn" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" @@ -3379,6 +3395,18 @@ msgstr "y-waarde buiten bereik" msgid "zero step" msgstr "nul-stap" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "I2C operation not supported" #~ msgstr "I2C actie niet ondersteund" diff --git a/locale/pl.po b/locale/pl.po index 1f2e9a61bc..d626e8ebcf 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -3020,6 +3020,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "okres snu musi być nieujemny" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "zerowy krok" @@ -3036,6 +3040,18 @@ msgstr "programowy reset\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -3326,6 +3342,18 @@ msgstr "y poza zakresem" msgid "zero step" msgstr "zerowy krok" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index acabdb197e..8094f4a2df 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-30 17:48+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1748,8 +1748,8 @@ msgstr "O WatchDogTimer não está em execução" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -"O WatchDogTimer.mode não pode ser alterado uma vez definido para WatchDogMode" -".RESET" +"O WatchDogTimer.mode não pode ser alterado uma vez definido para " +"WatchDogMode.RESET" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.timeout must be greater than 0" @@ -3097,6 +3097,10 @@ msgstr "o tamanho é definido apenas para os ndarrays" msgid "sleep length must be non-negative" msgstr "a duração do sleep não deve ser negativo" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "a etapa da fatia não pode ser zero" @@ -3113,6 +3117,18 @@ msgstr "reinicialização soft\n" msgid "sort argument must be an ndarray" msgstr "o argumento da classificação deve ser um ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -3403,6 +3419,18 @@ msgstr "o valor y está fora dos limites" msgid "zero step" msgstr "passo zero" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "AP required" #~ msgstr "AP requerido" diff --git a/locale/sv.po b/locale/sv.po index 6a38d35702..f359eba275 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2020-06-03 18:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -3066,6 +3066,10 @@ msgstr "storlek är enbart definierad ndarrays" msgid "sleep length must be non-negative" msgstr "värdet för sleep måste vara positivt" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "segmentsteg får inte vara noll" @@ -3082,6 +3086,18 @@ msgstr "mjuk omstart\n" msgid "sort argument must be an ndarray" msgstr "argumentet sort måste vara en ndarray" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" @@ -3372,6 +3388,18 @@ msgstr "y-värde utanför intervall" msgid "zero step" msgstr "noll steg" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "I2C operation not supported" #~ msgstr "I2C-åtgärd stöds inte" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 1609f672cd..bc9a7253b9 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-26 11:50-0500\n" +"POT-Creation-Date: 2020-07-01 10:33-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -3050,6 +3050,10 @@ msgstr "" msgid "sleep length must be non-negative" msgstr "shuìmián chángdù bìxū shìfēi fùshù" +#: extmod/ulab/code/ndarray.c +msgid "slice step can't be zero" +msgstr "" + #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" msgstr "qiēpiàn bù bùnéng wéi líng" @@ -3066,6 +3070,18 @@ msgstr "ruǎn chóngqǐ\n" msgid "sort argument must be an ndarray" msgstr "" +#: extmod/ulab/code/filter.c +msgid "sos array must be of shape (n_section, 6)" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sos[:, 3] should be all ones" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "sosfilt requires iterable arguments" +msgstr "" + #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -3356,6 +3372,18 @@ msgstr "y zhí chāochū biānjiè" msgid "zero step" msgstr "líng bù" +#: extmod/ulab/code/filter.c +msgid "zi must be an ndarray" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of float type" +msgstr "" + +#: extmod/ulab/code/filter.c +msgid "zi must be of shape (n_section, 2)" +msgstr "" + #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" From 75bcd73439bf038a1b88e1b4124059241ea054ff Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Wed, 1 Jul 2020 22:00:10 +0000 Subject: [PATCH 916/919] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (777 of 777 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8094f4a2df..92cf0172d0 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-01 10:33-0500\n" -"PO-Revision-Date: 2020-06-30 17:48+0000\n" +"PO-Revision-Date: 2020-07-02 02:02+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -354,7 +354,7 @@ msgstr "Array deve conter meias palavras (tipo 'H')" #: shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Os valores da matriz devem ser bytes simples." +msgstr "Os valores das matrizes devem ser bytes simples." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" @@ -3099,7 +3099,7 @@ msgstr "a duração do sleep não deve ser negativo" #: extmod/ulab/code/ndarray.c msgid "slice step can't be zero" -msgstr "" +msgstr "a etapa da fatia não pode ser zero" #: py/objslice.c py/sequence.c msgid "slice step cannot be zero" @@ -3119,15 +3119,15 @@ msgstr "o argumento da classificação deve ser um ndarray" #: extmod/ulab/code/filter.c msgid "sos array must be of shape (n_section, 6)" -msgstr "" +msgstr "o sos da matriz deve estar na forma (n_section, 6)" #: extmod/ulab/code/filter.c msgid "sos[:, 3] should be all ones" -msgstr "" +msgstr "sos[:, 3] deve ser um em todos" #: extmod/ulab/code/filter.c msgid "sosfilt requires iterable arguments" -msgstr "" +msgstr "o sosfilt requer que os argumentos sejam iteráveis" #: py/objstr.c msgid "start/end indices" @@ -3421,15 +3421,15 @@ msgstr "passo zero" #: extmod/ulab/code/filter.c msgid "zi must be an ndarray" -msgstr "" +msgstr "zi deve ser um ndarray" #: extmod/ulab/code/filter.c msgid "zi must be of float type" -msgstr "" +msgstr "zi deve ser de um tipo float" #: extmod/ulab/code/filter.c msgid "zi must be of shape (n_section, 2)" -msgstr "" +msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "AP required" #~ msgstr "AP requerido" From f4a24744477abe0d924ef08781d6e30118cc9982 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 2 Jul 2020 15:24:59 +0200 Subject: [PATCH 917/919] spresense: Add support for sdioio --- ports/cxd56/boards/spresense/pins.c | 16 +++ ports/cxd56/common-hal/microcontroller/Pin.c | 6 + ports/cxd56/common-hal/microcontroller/Pin.h | 6 + ports/cxd56/common-hal/sdioio/SDCard.c | 141 +++++++++++++++++++ ports/cxd56/common-hal/sdioio/SDCard.h | 47 +++++++ ports/cxd56/common-hal/sdioio/__init__.c | 0 ports/cxd56/mpconfigport.mk | 3 + 7 files changed, 219 insertions(+) create mode 100644 ports/cxd56/common-hal/sdioio/SDCard.c create mode 100644 ports/cxd56/common-hal/sdioio/SDCard.h create mode 100644 ports/cxd56/common-hal/sdioio/__init__.c diff --git a/ports/cxd56/boards/spresense/pins.c b/ports/cxd56/boards/spresense/pins.c index fcc854590a..5028d91556 100644 --- a/ports/cxd56/boards/spresense/pins.c +++ b/ports/cxd56/boards/spresense/pins.c @@ -24,8 +24,21 @@ * THE SOFTWARE. */ +#include "py/objtuple.h" + #include "shared-bindings/board/__init__.h" +STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { + {&mp_type_tuple}, + 4, + { + MP_ROM_PTR(&pin_SDIO_DATA0), + MP_ROM_PTR(&pin_SDIO_DATA1), + MP_ROM_PTR(&pin_SDIO_DATA2), + MP_ROM_PTR(&pin_SDIO_DATA3), + } +}; + STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_UART2_RXD) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_UART2_TXD) }, @@ -76,5 +89,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_CLOCK), MP_ROM_PTR(&pin_SDIO_CLK) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_SDIO_CMD) }, + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/cxd56/common-hal/microcontroller/Pin.c b/ports/cxd56/common-hal/microcontroller/Pin.c index 23377197c2..7aba1ad54b 100644 --- a/ports/cxd56/common-hal/microcontroller/Pin.c +++ b/ports/cxd56/common-hal/microcontroller/Pin.c @@ -72,6 +72,12 @@ const mcu_pin_obj_t pin_I2S1_BCK = PIN(PIN_I2S1_BCK, false); const mcu_pin_obj_t pin_I2S1_LRCK = PIN(PIN_I2S1_LRCK, false); const mcu_pin_obj_t pin_I2S1_DATA_IN = PIN(PIN_I2S1_DATA_IN, false); const mcu_pin_obj_t pin_I2S1_DATA_OUT = PIN(PIN_I2S1_DATA_OUT, false); +const mcu_pin_obj_t pin_SDIO_CLK = PIN(PIN_SDIO_CLK, false); +const mcu_pin_obj_t pin_SDIO_CMD = PIN(PIN_SDIO_CMD, false); +const mcu_pin_obj_t pin_SDIO_DATA0 = PIN(PIN_SDIO_DATA0, false); +const mcu_pin_obj_t pin_SDIO_DATA1 = PIN(PIN_SDIO_DATA1, false); +const mcu_pin_obj_t pin_SDIO_DATA2 = PIN(PIN_SDIO_DATA2, false); +const mcu_pin_obj_t pin_SDIO_DATA3 = PIN(PIN_SDIO_DATA3, false); const mcu_pin_obj_t pin_LPADC0 = PIN(0, true); const mcu_pin_obj_t pin_LPADC1 = PIN(1, true); const mcu_pin_obj_t pin_LPADC2 = PIN(2, true); diff --git a/ports/cxd56/common-hal/microcontroller/Pin.h b/ports/cxd56/common-hal/microcontroller/Pin.h index fe6524edb5..6759a2dcab 100644 --- a/ports/cxd56/common-hal/microcontroller/Pin.h +++ b/ports/cxd56/common-hal/microcontroller/Pin.h @@ -77,6 +77,12 @@ extern const mcu_pin_obj_t pin_I2S1_BCK; extern const mcu_pin_obj_t pin_I2S1_LRCK; extern const mcu_pin_obj_t pin_I2S1_DATA_IN; extern const mcu_pin_obj_t pin_I2S1_DATA_OUT; +extern const mcu_pin_obj_t pin_SDIO_CLK; +extern const mcu_pin_obj_t pin_SDIO_CMD; +extern const mcu_pin_obj_t pin_SDIO_DATA0; +extern const mcu_pin_obj_t pin_SDIO_DATA1; +extern const mcu_pin_obj_t pin_SDIO_DATA2; +extern const mcu_pin_obj_t pin_SDIO_DATA3; extern const mcu_pin_obj_t pin_LPADC0; extern const mcu_pin_obj_t pin_LPADC1; extern const mcu_pin_obj_t pin_LPADC2; diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c new file mode 100644 index 0000000000..cf7de422c1 --- /dev/null +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -0,0 +1,141 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * 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 +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-bindings/sdioio/SDCard.h" +#include "shared-bindings/util.h" + +#define DATA_PINS_NUM 4 + +void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, + const mcu_pin_obj_t *clock, const mcu_pin_obj_t *command, + uint8_t num_data, mcu_pin_obj_t **data, uint32_t frequency) { + struct geometry geo; + + if (clock->number != PIN_SDIO_CLK || command->number != PIN_SDIO_CMD) { + mp_raise_ValueError(translate("Invalid pins")); + } + + uint8_t data_pins_num = 0; + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + if (data[i]->number != PIN_SDIO_DATA0 || data[i]->number != PIN_SDIO_DATA1 || + data[i]->number != PIN_SDIO_DATA2 || data[i]->number != PIN_SDIO_DATA3) { + data_pins_num++; + } + } + + if (data_pins_num != DATA_PINS_NUM) { + mp_raise_ValueError(translate("Invalid pins")); + } + + if (open_blockdriver("/dev/mmcsd0", 0, &self->inode) < 0) { + mp_raise_ValueError(translate("Could not initialize SDCard")); + } + + self->inode->u.i_bops->geometry(self->inode, &geo); + + claim_pin(clock); + claim_pin(command); + self->clock_pin = clock; + self->command_pin = command; + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + claim_pin(data[i]); + self->data_pins[i] = data[i]; + } + + self->count = geo.geo_nsectors; + self->frequency = frequency; + self->width = num_data; +} + +void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) { + close_blockdriver(self->inode); + self->inode = NULL; + + reset_pin_number(self->clock_pin->number); + reset_pin_number(self->command_pin->number); + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + reset_pin_number(self->data_pins[i]->number); + } +} + +bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) { + return self->inode == NULL; +} + +bool common_hal_sdioio_sdcard_configure(sdioio_sdcard_obj_t *self, uint32_t baudrate, uint8_t width) { + return true; +} + +uint32_t common_hal_sdioio_sdcard_get_frequency(sdioio_sdcard_obj_t* self) { + return self->frequency; +} + +uint8_t common_hal_sdioio_sdcard_get_width(sdioio_sdcard_obj_t* self) { + return self->width; +} + +uint32_t common_hal_sdioio_sdcard_get_count(sdioio_sdcard_obj_t* self) { + return self->count; +} + +STATIC void check_whole_block(mp_buffer_info_t *bufinfo) { + if (bufinfo->len % 512) { + mp_raise_ValueError(translate("Buffer length must be a multiple of 512")); + } +} + +int common_hal_sdioio_sdcard_readblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } + check_whole_block(bufinfo); + + return self->inode->u.i_bops->read(self->inode, bufinfo->buf, start_block, bufinfo->len / 512); +} + +int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t* self, uint32_t start_block, mp_buffer_info_t *bufinfo) { + if (common_hal_sdioio_sdcard_deinited(self)) { + raise_deinited_error(); + } + check_whole_block(bufinfo); + + return self->inode->u.i_bops->write(self->inode, bufinfo->buf, start_block, bufinfo->len / 512);; +} + +void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { + never_reset_pin_number(self->clock_pin->number); + never_reset_pin_number(self->command_pin->number); + for (uint8_t i = 0; i < DATA_PINS_NUM; i++) { + never_reset_pin_number(self->data_pins[i]->number); + } +} diff --git a/ports/cxd56/common-hal/sdioio/SDCard.h b/ports/cxd56/common-hal/sdioio/SDCard.h new file mode 100644 index 0000000000..cbdcd47069 --- /dev/null +++ b/ports/cxd56/common-hal/sdioio/SDCard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright 2020 Sony Semiconductor Solutions Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H +#define MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H + +#include + +#include "py/obj.h" + +#include "common-hal/microcontroller/Pin.h" + +typedef struct { + mp_obj_base_t base; + struct inode* inode; + uint32_t frequency; + uint32_t count; + uint8_t width; + const mcu_pin_obj_t *command_pin; + const mcu_pin_obj_t *clock_pin; + const mcu_pin_obj_t *data_pins[4]; +} sdioio_sdcard_obj_t; + +#endif // MICROPY_INCLUDED_CXD56_SDIOIO_SDCARD_H diff --git a/ports/cxd56/common-hal/sdioio/__init__.c b/ports/cxd56/common-hal/sdioio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 23f60f8a7f..eb077c07bd 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -7,6 +7,8 @@ USB_CDC_EP_NUM_DATA_IN = 1 USB_MSC_EP_NUM_OUT = 5 USB_MSC_EP_NUM_IN = 4 +MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz + CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 @@ -18,6 +20,7 @@ CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_SDIOIO = 1 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 From 22f0c14fdbdd457f700411781c601d428105d913 Mon Sep 17 00:00:00 2001 From: Kamil Tomaszewski Date: Thu, 2 Jul 2020 15:26:05 +0200 Subject: [PATCH 918/919] locale: update translate --- locale/circuitpython.pot | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 7141cc8722..6e32ebab98 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-01 10:33-0500\n" +"POT-Creation-Date: 2020-07-02 15:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -425,7 +425,8 @@ msgstr "" msgid "Buffer length %d too big. It must be less than %d" msgstr "" -#: ports/atmel-samd/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c +#: ports/atmel-samd/common-hal/sdioio/SDCard.c +#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" msgstr "" @@ -589,6 +590,10 @@ msgstr "" msgid "Could not initialize GNSS" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "Could not initialize SDCard" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -982,7 +987,8 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c #: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/mimxrt10xx/common-hal/busio/I2C.c +#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c +#: ports/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" From 4b66483757048be03c7d34fd07d2028693a629a3 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 2 Jul 2020 15:38:37 -0400 Subject: [PATCH 919/919] Update submodule, revert direction change --- ports/stm/common-hal/busio/SPI.c | 7 ++----- ports/stm/st_driver | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index 380302da65..65eeb8ebcf 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -238,11 +238,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; - // Implementing one-directional recieve-only SPI as per [RefMan RM0090:884] - // results in BSY bit related hangs. Using MOSI as an IO works fine without it, - // so it's unclear why this mode is present in the first place. - //self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; - self->handle.Init.Direction = SPI_DIRECTION_2LINES; + // Direction change only required for RX-only, see RefMan RM0090:884 + self->handle.Init.Direction = (self->mosi == NULL) ? SPI_DIRECTION_2LINES_RXONLY : SPI_DIRECTION_2LINES; self->handle.Init.DataSize = SPI_DATASIZE_8BIT; self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; diff --git a/ports/stm/st_driver b/ports/stm/st_driver index 3fc2e0f3db..1900834751 160000 --- a/ports/stm/st_driver +++ b/ports/stm/st_driver @@ -1 +1 @@ -Subproject commit 3fc2e0f3db155b33177bb0705e0dd65cadb58412 +Subproject commit 1900834751fd6754457874b8c971690bab33e0a7